@molecule/app-ide-react 1.0.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 (250) hide show
  1. package/LICENSE +115 -0
  2. package/dist/chatTimelineOrdering.d.ts +50 -0
  3. package/dist/chatTimelineOrdering.d.ts.map +1 -0
  4. package/dist/chatTimelineOrdering.js +46 -0
  5. package/dist/chatTimelineOrdering.js.map +1 -0
  6. package/dist/command-metadata.d.ts +78 -0
  7. package/dist/command-metadata.d.ts.map +1 -0
  8. package/dist/command-metadata.js +214 -0
  9. package/dist/command-metadata.js.map +1 -0
  10. package/dist/components/ActivityCard.d.ts +28 -0
  11. package/dist/components/ActivityCard.d.ts.map +1 -0
  12. package/dist/components/ActivityCard.js +62 -0
  13. package/dist/components/ActivityCard.js.map +1 -0
  14. package/dist/components/AutoCommitBadge.d.ts +58 -0
  15. package/dist/components/AutoCommitBadge.d.ts.map +1 -0
  16. package/dist/components/AutoCommitBadge.js +78 -0
  17. package/dist/components/AutoCommitBadge.js.map +1 -0
  18. package/dist/components/ChatPanel.d.ts +184 -0
  19. package/dist/components/ChatPanel.d.ts.map +1 -0
  20. package/dist/components/ChatPanel.js +6691 -0
  21. package/dist/components/ChatPanel.js.map +1 -0
  22. package/dist/components/CommandPalette.d.ts +18 -0
  23. package/dist/components/CommandPalette.d.ts.map +1 -0
  24. package/dist/components/CommandPalette.js +33 -0
  25. package/dist/components/CommandPalette.js.map +1 -0
  26. package/dist/components/DeviceFrameSelector.d.ts +60 -0
  27. package/dist/components/DeviceFrameSelector.d.ts.map +1 -0
  28. package/dist/components/DeviceFrameSelector.js +230 -0
  29. package/dist/components/DeviceFrameSelector.js.map +1 -0
  30. package/dist/components/EditorPanel.d.ts +17 -0
  31. package/dist/components/EditorPanel.d.ts.map +1 -0
  32. package/dist/components/EditorPanel.js +241 -0
  33. package/dist/components/EditorPanel.js.map +1 -0
  34. package/dist/components/FileExplorer.d.ts +64 -0
  35. package/dist/components/FileExplorer.d.ts.map +1 -0
  36. package/dist/components/FileExplorer.js +1111 -0
  37. package/dist/components/FileExplorer.js.map +1 -0
  38. package/dist/components/FileExplorerContextMenu.d.ts +37 -0
  39. package/dist/components/FileExplorerContextMenu.d.ts.map +1 -0
  40. package/dist/components/FileExplorerContextMenu.js +241 -0
  41. package/dist/components/FileExplorerContextMenu.js.map +1 -0
  42. package/dist/components/HelpCard.d.ts +34 -0
  43. package/dist/components/HelpCard.d.ts.map +1 -0
  44. package/dist/components/HelpCard.js +28 -0
  45. package/dist/components/HelpCard.js.map +1 -0
  46. package/dist/components/Icon.d.ts +50 -0
  47. package/dist/components/Icon.d.ts.map +1 -0
  48. package/dist/components/Icon.js +25 -0
  49. package/dist/components/Icon.js.map +1 -0
  50. package/dist/components/KeyboardShortcutsPanel.d.ts +19 -0
  51. package/dist/components/KeyboardShortcutsPanel.d.ts.map +1 -0
  52. package/dist/components/KeyboardShortcutsPanel.js +187 -0
  53. package/dist/components/KeyboardShortcutsPanel.js.map +1 -0
  54. package/dist/components/MarkdownContent.d.ts +52 -0
  55. package/dist/components/MarkdownContent.d.ts.map +1 -0
  56. package/dist/components/MarkdownContent.js +303 -0
  57. package/dist/components/MarkdownContent.js.map +1 -0
  58. package/dist/components/ModelsTable.d.ts +38 -0
  59. package/dist/components/ModelsTable.d.ts.map +1 -0
  60. package/dist/components/ModelsTable.js +96 -0
  61. package/dist/components/ModelsTable.js.map +1 -0
  62. package/dist/components/PreviewPanel.d.ts +66 -0
  63. package/dist/components/PreviewPanel.d.ts.map +1 -0
  64. package/dist/components/PreviewPanel.js +1752 -0
  65. package/dist/components/PreviewPanel.js.map +1 -0
  66. package/dist/components/QuickOpen.d.ts +20 -0
  67. package/dist/components/QuickOpen.d.ts.map +1 -0
  68. package/dist/components/QuickOpen.js +72 -0
  69. package/dist/components/QuickOpen.js.map +1 -0
  70. package/dist/components/QuickPicker.d.ts +21 -0
  71. package/dist/components/QuickPicker.d.ts.map +1 -0
  72. package/dist/components/QuickPicker.js +174 -0
  73. package/dist/components/QuickPicker.js.map +1 -0
  74. package/dist/components/RelevantSkillSuggestion.d.ts +41 -0
  75. package/dist/components/RelevantSkillSuggestion.d.ts.map +1 -0
  76. package/dist/components/RelevantSkillSuggestion.js +85 -0
  77. package/dist/components/RelevantSkillSuggestion.js.map +1 -0
  78. package/dist/components/ReportModal.d.ts +35 -0
  79. package/dist/components/ReportModal.d.ts.map +1 -0
  80. package/dist/components/ReportModal.js +112 -0
  81. package/dist/components/ReportModal.js.map +1 -0
  82. package/dist/components/ResizeHandle.d.ts +21 -0
  83. package/dist/components/ResizeHandle.d.ts.map +1 -0
  84. package/dist/components/ResizeHandle.js +109 -0
  85. package/dist/components/ResizeHandle.js.map +1 -0
  86. package/dist/components/ScriptsCard.d.ts +37 -0
  87. package/dist/components/ScriptsCard.d.ts.map +1 -0
  88. package/dist/components/ScriptsCard.js +177 -0
  89. package/dist/components/ScriptsCard.js.map +1 -0
  90. package/dist/components/SearchPanel.d.ts +18 -0
  91. package/dist/components/SearchPanel.d.ts.map +1 -0
  92. package/dist/components/SearchPanel.js +449 -0
  93. package/dist/components/SearchPanel.js.map +1 -0
  94. package/dist/components/SettingsCard.d.ts +49 -0
  95. package/dist/components/SettingsCard.d.ts.map +1 -0
  96. package/dist/components/SettingsCard.js +59 -0
  97. package/dist/components/SettingsCard.js.map +1 -0
  98. package/dist/components/ShareModal.d.ts +32 -0
  99. package/dist/components/ShareModal.d.ts.map +1 -0
  100. package/dist/components/ShareModal.js +126 -0
  101. package/dist/components/ShareModal.js.map +1 -0
  102. package/dist/components/SidebarTabs.d.ts +18 -0
  103. package/dist/components/SidebarTabs.d.ts.map +1 -0
  104. package/dist/components/SidebarTabs.js +20 -0
  105. package/dist/components/SidebarTabs.js.map +1 -0
  106. package/dist/components/SkillsCard.d.ts +86 -0
  107. package/dist/components/SkillsCard.d.ts.map +1 -0
  108. package/dist/components/SkillsCard.js +227 -0
  109. package/dist/components/SkillsCard.js.map +1 -0
  110. package/dist/components/StreamingIndicator.d.ts +50 -0
  111. package/dist/components/StreamingIndicator.d.ts.map +1 -0
  112. package/dist/components/StreamingIndicator.js +142 -0
  113. package/dist/components/StreamingIndicator.js.map +1 -0
  114. package/dist/components/TabBar.d.ts +37 -0
  115. package/dist/components/TabBar.d.ts.map +1 -0
  116. package/dist/components/TabBar.js +187 -0
  117. package/dist/components/TabBar.js.map +1 -0
  118. package/dist/components/TipCard.d.ts +22 -0
  119. package/dist/components/TipCard.d.ts.map +1 -0
  120. package/dist/components/TipCard.js +73 -0
  121. package/dist/components/TipCard.js.map +1 -0
  122. package/dist/components/ToolCallCard.d.ts +18 -0
  123. package/dist/components/ToolCallCard.d.ts.map +1 -0
  124. package/dist/components/ToolCallCard.js +716 -0
  125. package/dist/components/ToolCallCard.js.map +1 -0
  126. package/dist/components/UserAvatar.d.ts +45 -0
  127. package/dist/components/UserAvatar.d.ts.map +1 -0
  128. package/dist/components/UserAvatar.js +80 -0
  129. package/dist/components/UserAvatar.js.map +1 -0
  130. package/dist/components/WorkspaceLayout.d.ts +19 -0
  131. package/dist/components/WorkspaceLayout.d.ts.map +1 -0
  132. package/dist/components/WorkspaceLayout.js +56 -0
  133. package/dist/components/WorkspaceLayout.js.map +1 -0
  134. package/dist/components/activity-utilities.d.ts +107 -0
  135. package/dist/components/activity-utilities.d.ts.map +1 -0
  136. package/dist/components/activity-utilities.js +154 -0
  137. package/dist/components/activity-utilities.js.map +1 -0
  138. package/dist/components/chat-autocommit-utilities.d.ts +172 -0
  139. package/dist/components/chat-autocommit-utilities.d.ts.map +1 -0
  140. package/dist/components/chat-autocommit-utilities.js +185 -0
  141. package/dist/components/chat-autocommit-utilities.js.map +1 -0
  142. package/dist/components/chat-card-style.d.ts +64 -0
  143. package/dist/components/chat-card-style.d.ts.map +1 -0
  144. package/dist/components/chat-card-style.js +74 -0
  145. package/dist/components/chat-card-style.js.map +1 -0
  146. package/dist/components/chat-commands.d.ts +17 -0
  147. package/dist/components/chat-commands.d.ts.map +1 -0
  148. package/dist/components/chat-commands.js +17 -0
  149. package/dist/components/chat-commands.js.map +1 -0
  150. package/dist/components/chat-commit-utilities.d.ts +29 -0
  151. package/dist/components/chat-commit-utilities.d.ts.map +1 -0
  152. package/dist/components/chat-commit-utilities.js +31 -0
  153. package/dist/components/chat-commit-utilities.js.map +1 -0
  154. package/dist/components/chat-cost-utilities.d.ts +62 -0
  155. package/dist/components/chat-cost-utilities.d.ts.map +1 -0
  156. package/dist/components/chat-cost-utilities.js +66 -0
  157. package/dist/components/chat-cost-utilities.js.map +1 -0
  158. package/dist/components/chat-effort-utilities.d.ts +96 -0
  159. package/dist/components/chat-effort-utilities.d.ts.map +1 -0
  160. package/dist/components/chat-effort-utilities.js +97 -0
  161. package/dist/components/chat-effort-utilities.js.map +1 -0
  162. package/dist/components/chat-help-utilities.d.ts +89 -0
  163. package/dist/components/chat-help-utilities.d.ts.map +1 -0
  164. package/dist/components/chat-help-utilities.js +131 -0
  165. package/dist/components/chat-help-utilities.js.map +1 -0
  166. package/dist/components/chat-model-mode-utilities.d.ts +143 -0
  167. package/dist/components/chat-model-mode-utilities.d.ts.map +1 -0
  168. package/dist/components/chat-model-mode-utilities.js +191 -0
  169. package/dist/components/chat-model-mode-utilities.js.map +1 -0
  170. package/dist/components/chat-models-utilities.d.ts +98 -0
  171. package/dist/components/chat-models-utilities.d.ts.map +1 -0
  172. package/dist/components/chat-models-utilities.js +136 -0
  173. package/dist/components/chat-models-utilities.js.map +1 -0
  174. package/dist/components/chat-report-utilities.d.ts +149 -0
  175. package/dist/components/chat-report-utilities.d.ts.map +1 -0
  176. package/dist/components/chat-report-utilities.js +151 -0
  177. package/dist/components/chat-report-utilities.js.map +1 -0
  178. package/dist/components/chat-scripts-utilities.d.ts +140 -0
  179. package/dist/components/chat-scripts-utilities.d.ts.map +1 -0
  180. package/dist/components/chat-scripts-utilities.js +158 -0
  181. package/dist/components/chat-scripts-utilities.js.map +1 -0
  182. package/dist/components/chat-settings-utilities.d.ts +72 -0
  183. package/dist/components/chat-settings-utilities.d.ts.map +1 -0
  184. package/dist/components/chat-settings-utilities.js +56 -0
  185. package/dist/components/chat-settings-utilities.js.map +1 -0
  186. package/dist/components/chat-share-utilities.d.ts +104 -0
  187. package/dist/components/chat-share-utilities.d.ts.map +1 -0
  188. package/dist/components/chat-share-utilities.js +90 -0
  189. package/dist/components/chat-share-utilities.js.map +1 -0
  190. package/dist/components/chat-skills-utilities.d.ts +242 -0
  191. package/dist/components/chat-skills-utilities.d.ts.map +1 -0
  192. package/dist/components/chat-skills-utilities.js +433 -0
  193. package/dist/components/chat-skills-utilities.js.map +1 -0
  194. package/dist/components/chat-stream-utilities.d.ts +74 -0
  195. package/dist/components/chat-stream-utilities.d.ts.map +1 -0
  196. package/dist/components/chat-stream-utilities.js +103 -0
  197. package/dist/components/chat-stream-utilities.js.map +1 -0
  198. package/dist/components/chat-tips-utilities.d.ts +108 -0
  199. package/dist/components/chat-tips-utilities.d.ts.map +1 -0
  200. package/dist/components/chat-tips-utilities.js +137 -0
  201. package/dist/components/chat-tips-utilities.js.map +1 -0
  202. package/dist/components/device-cycle.d.ts +84 -0
  203. package/dist/components/device-cycle.d.ts.map +1 -0
  204. package/dist/components/device-cycle.js +77 -0
  205. package/dist/components/device-cycle.js.map +1 -0
  206. package/dist/components/index.d.ts +36 -0
  207. package/dist/components/index.d.ts.map +1 -0
  208. package/dist/components/index.js +33 -0
  209. package/dist/components/index.js.map +1 -0
  210. package/dist/components/tool-call-utilities.d.ts +69 -0
  211. package/dist/components/tool-call-utilities.d.ts.map +1 -0
  212. package/dist/components/tool-call-utilities.js +368 -0
  213. package/dist/components/tool-call-utilities.js.map +1 -0
  214. package/dist/components/user-avatar-utilities.d.ts +41 -0
  215. package/dist/components/user-avatar-utilities.d.ts.map +1 -0
  216. package/dist/components/user-avatar-utilities.js +56 -0
  217. package/dist/components/user-avatar-utilities.js.map +1 -0
  218. package/dist/components/workspace-layout-utilities.d.ts +37 -0
  219. package/dist/components/workspace-layout-utilities.d.ts.map +1 -0
  220. package/dist/components/workspace-layout-utilities.js +58 -0
  221. package/dist/components/workspace-layout-utilities.js.map +1 -0
  222. package/dist/customEventCards.d.ts +117 -0
  223. package/dist/customEventCards.d.ts.map +1 -0
  224. package/dist/customEventCards.js +36 -0
  225. package/dist/customEventCards.js.map +1 -0
  226. package/dist/hooks/index.d.ts +8 -0
  227. package/dist/hooks/index.d.ts.map +1 -0
  228. package/dist/hooks/index.js +8 -0
  229. package/dist/hooks/index.js.map +1 -0
  230. package/dist/hooks/useKeyboardShortcuts.d.ts +48 -0
  231. package/dist/hooks/useKeyboardShortcuts.d.ts.map +1 -0
  232. package/dist/hooks/useKeyboardShortcuts.js +112 -0
  233. package/dist/hooks/useKeyboardShortcuts.js.map +1 -0
  234. package/dist/hooks/useViewport.d.ts +42 -0
  235. package/dist/hooks/useViewport.d.ts.map +1 -0
  236. package/dist/hooks/useViewport.js +61 -0
  237. package/dist/hooks/useViewport.js.map +1 -0
  238. package/dist/index.d.ts +75 -0
  239. package/dist/index.d.ts.map +1 -0
  240. package/dist/index.js +74 -0
  241. package/dist/index.js.map +1 -0
  242. package/dist/settings-metadata.d.ts +78 -0
  243. package/dist/settings-metadata.d.ts.map +1 -0
  244. package/dist/settings-metadata.js +131 -0
  245. package/dist/settings-metadata.js.map +1 -0
  246. package/dist/types.d.ts +751 -0
  247. package/dist/types.d.ts.map +1 -0
  248. package/dist/types.js +25 -0
  249. package/dist/types.js.map +1 -0
  250. package/package.json +90 -0
@@ -0,0 +1,108 @@
1
+ /**
2
+ * Auto-tip selection + idle-gating for the dismissable chat tip cards.
3
+ *
4
+ * Two complementary surfaces, so a typical session reliably surfaces a tip
5
+ * (the previous idle-only gate was so conservative new users saw ZERO):
6
+ *
7
+ * 1. **Entry tip** ({@link ENTRY_TIP}) — one high-value onboarding hint shown
8
+ * once on a *fresh* conversation (before the first prompt), so a brand-new
9
+ * user always learns how to drive the agent. The caller shows it directly;
10
+ * no gate.
11
+ * 2. **Idle rotation** ({@link CHAT_TIPS}) — additional tips that MAY surface
12
+ * after the conversation has sat idle for a while, gated by a random roll and
13
+ * a cooldown so the timeline never fills with tips.
14
+ *
15
+ * {@link shouldShowIdleTip} and {@link pickIdleTip} are pure (the random roll is
16
+ * injected) so the behavior is unit-testable; {@link selectTip} remains a
17
+ * deterministic by-index helper.
18
+ *
19
+ * @module
20
+ */
21
+ /** A single onboarding tip. */
22
+ export interface TipDef {
23
+ /** Stable id (also used as the i18n key suffix). */
24
+ id: string;
25
+ /**
26
+ * English default text, rendered via `t('ide.chat.tip.<id>', { agentName }, { defaultValue })`.
27
+ * May contain the `{{agentName}}` interpolation token, filled in by the caller
28
+ * from the host's agent identity (neutral default: "the assistant").
29
+ */
30
+ text: string;
31
+ }
32
+ /**
33
+ * The single highest-value onboarding tip, shown once on a fresh conversation
34
+ * (see the module overview). It points at the two interactions that unlock
35
+ * everything else — the `/` command menu and `@`-mentioning a file — so a brand-
36
+ * new user is never left staring at an empty chat with no idea how to begin.
37
+ * Its `id` is also a locale key (`ide.chat.tip.getStarted`), like every entry in
38
+ * {@link CHAT_TIPS}.
39
+ */
40
+ export declare const ENTRY_TIP: TipDef;
41
+ /**
42
+ * The idle-rotation tip pool. Each covers a real, shipped slash command or
43
+ * affordance — file mentions, the command menu, plan vs execute, `/undo`,
44
+ * `/compact`, `/commit`, and `/report`. Surfaced occasionally
45
+ * while idle (in no fixed order — {@link pickIdleTip} chooses an unseen one at
46
+ * random), so a longer session keeps learning new features without the timeline
47
+ * filling with hints. The {@link ENTRY_TIP} (`getStarted`) is shown separately at
48
+ * onboarding and is intentionally NOT part of this rotation.
49
+ */
50
+ export declare const CHAT_TIPS: readonly TipDef[];
51
+ /**
52
+ * How long the conversation must sit idle before a rotation tip may surface
53
+ * ("idle for a while"). Kept short enough that a typical pause in a real session
54
+ * reaches it.
55
+ */
56
+ export declare const TIP_IDLE_MS = 45000;
57
+ /**
58
+ * Don't surface an *idle-rotation* tip until the conversation has at least this
59
+ * many messages (one real back-and-forth). The {@link ENTRY_TIP} is exempt — it
60
+ * is the onboarding hint shown before the first prompt.
61
+ */
62
+ export declare const TIP_MIN_MESSAGES = 2;
63
+ /** Minimum gap between two idle tips, so the timeline never fills with them. */
64
+ export declare const TIP_COOLDOWN_MS = 150000;
65
+ /**
66
+ * Chance to surface a rotation tip once idle + cooldown allow it — high enough
67
+ * that an active session reliably sees one, but not every idle period.
68
+ */
69
+ export declare const TIP_IDLE_PROBABILITY = 0.7;
70
+ /** Inputs to the idle-tip gate. All durations in milliseconds. */
71
+ export interface IdleTipState {
72
+ /** Total messages in the conversation. */
73
+ messageCount: number;
74
+ /** Time since the last message activity (the idle duration). */
75
+ msSinceLastActivity: number;
76
+ /** Time since the last tip was shown (`Infinity` if none yet). */
77
+ msSinceLastTip: number;
78
+ }
79
+ /**
80
+ * Decide whether to surface an idle tip. Pure: pass `rand` (0–1, e.g. `Math.random()`)
81
+ * so it is testable. Returns false unless the conversation has enough history (never
82
+ * on the first prompt), has been idle long enough, the cooldown since the last tip has
83
+ * elapsed, AND the random roll passes — so tips stay occasional and never pile up.
84
+ *
85
+ * @param state - Conversation idle state.
86
+ * @param rand - A random value in [0, 1) (injected for testability).
87
+ * @returns Whether a tip should be shown now.
88
+ */
89
+ export declare function shouldShowIdleTip(state: IdleTipState, rand: number): boolean;
90
+ /**
91
+ * Pick a tip the user hasn't seen yet (falling back to the full pool once all have
92
+ * been shown). Pure: pass `rand` (0–1) for a testable random choice; out-of-range or
93
+ * non-finite values are clamped.
94
+ *
95
+ * @param shownIds - Ids of tips already shown this conversation.
96
+ * @param rand - A random value in [0, 1) (injected for testability).
97
+ * @returns The chosen tip definition.
98
+ */
99
+ export declare function pickIdleTip(shownIds: readonly string[], rand: number): TipDef;
100
+ /**
101
+ * Deterministic by-index tip pick, cycling through {@link CHAT_TIPS} via modulo.
102
+ * Non-finite or negative indices clamp to slot 0.
103
+ *
104
+ * @param index - The tip index.
105
+ * @returns The tip definition for that index.
106
+ */
107
+ export declare function selectTip(index: number): TipDef;
108
+ //# sourceMappingURL=chat-tips-utilities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat-tips-utilities.d.ts","sourceRoot":"","sources":["../../src/components/chat-tips-utilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,+BAA+B;AAC/B,MAAM,WAAW,MAAM;IACrB,oDAAoD;IACpD,EAAE,EAAE,MAAM,CAAA;IACV;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAA;CACb;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS,EAAE,MAGvB,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,SAAS,EAAE,SAAS,MAAM,EA6B7B,CAAA;AAEV;;;;GAIG;AACH,eAAO,MAAM,WAAW,QAAS,CAAA;AACjC;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,IAAI,CAAA;AACjC,gFAAgF;AAChF,eAAO,MAAM,eAAe,SAAU,CAAA;AACtC;;;GAGG;AACH,eAAO,MAAM,oBAAoB,MAAM,CAAA;AAEvC,kEAAkE;AAClE,MAAM,WAAW,YAAY;IAC3B,0CAA0C;IAC1C,YAAY,EAAE,MAAM,CAAA;IACpB,gEAAgE;IAChE,mBAAmB,EAAE,MAAM,CAAA;IAC3B,kEAAkE;IAClE,cAAc,EAAE,MAAM,CAAA;CACvB;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAK5E;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAK7E;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAI/C"}
@@ -0,0 +1,137 @@
1
+ /**
2
+ * Auto-tip selection + idle-gating for the dismissable chat tip cards.
3
+ *
4
+ * Two complementary surfaces, so a typical session reliably surfaces a tip
5
+ * (the previous idle-only gate was so conservative new users saw ZERO):
6
+ *
7
+ * 1. **Entry tip** ({@link ENTRY_TIP}) — one high-value onboarding hint shown
8
+ * once on a *fresh* conversation (before the first prompt), so a brand-new
9
+ * user always learns how to drive the agent. The caller shows it directly;
10
+ * no gate.
11
+ * 2. **Idle rotation** ({@link CHAT_TIPS}) — additional tips that MAY surface
12
+ * after the conversation has sat idle for a while, gated by a random roll and
13
+ * a cooldown so the timeline never fills with tips.
14
+ *
15
+ * {@link shouldShowIdleTip} and {@link pickIdleTip} are pure (the random roll is
16
+ * injected) so the behavior is unit-testable; {@link selectTip} remains a
17
+ * deterministic by-index helper.
18
+ *
19
+ * @module
20
+ */
21
+ /**
22
+ * The single highest-value onboarding tip, shown once on a fresh conversation
23
+ * (see the module overview). It points at the two interactions that unlock
24
+ * everything else — the `/` command menu and `@`-mentioning a file — so a brand-
25
+ * new user is never left staring at an empty chat with no idea how to begin.
26
+ * Its `id` is also a locale key (`ide.chat.tip.getStarted`), like every entry in
27
+ * {@link CHAT_TIPS}.
28
+ */
29
+ export const ENTRY_TIP = {
30
+ id: 'getStarted',
31
+ text: 'Tip: type / to see every command, or @ a filename to give {{agentName}} a file to work from.',
32
+ };
33
+ /**
34
+ * The idle-rotation tip pool. Each covers a real, shipped slash command or
35
+ * affordance — file mentions, the command menu, plan vs execute, `/undo`,
36
+ * `/compact`, `/commit`, and `/report`. Surfaced occasionally
37
+ * while idle (in no fixed order — {@link pickIdleTip} chooses an unseen one at
38
+ * random), so a longer session keeps learning new features without the timeline
39
+ * filling with hints. The {@link ENTRY_TIP} (`getStarted`) is shown separately at
40
+ * onboarding and is intentionally NOT part of this rotation.
41
+ */
42
+ export const CHAT_TIPS = [
43
+ {
44
+ id: 'mention',
45
+ text: 'Tip: type @filename to attach a project file as context — {{agentName}} reads it directly.',
46
+ },
47
+ {
48
+ id: 'slash',
49
+ text: 'Tip: type / to browse every command (commit, model, and more).',
50
+ },
51
+ {
52
+ id: 'plan',
53
+ text: 'Tip: use /plan to have {{agentName}} research and propose a plan before it edits any files.',
54
+ },
55
+ {
56
+ id: 'undo',
57
+ text: "Tip: use /undo to instantly revert the last AI turn's file changes if it went the wrong way.",
58
+ },
59
+ {
60
+ id: 'compact',
61
+ text: 'Tip: long conversation? /compact compresses the context so you keep room to work.',
62
+ },
63
+ {
64
+ id: 'commit',
65
+ text: 'Tip: use /commit to save your changes as a git commit you can always return to.',
66
+ },
67
+ {
68
+ id: 'report',
69
+ text: 'Tip: something off? /report sends a bug or feedback to the team with your recent chat attached.',
70
+ },
71
+ ];
72
+ /**
73
+ * How long the conversation must sit idle before a rotation tip may surface
74
+ * ("idle for a while"). Kept short enough that a typical pause in a real session
75
+ * reaches it.
76
+ */
77
+ export const TIP_IDLE_MS = 45_000;
78
+ /**
79
+ * Don't surface an *idle-rotation* tip until the conversation has at least this
80
+ * many messages (one real back-and-forth). The {@link ENTRY_TIP} is exempt — it
81
+ * is the onboarding hint shown before the first prompt.
82
+ */
83
+ export const TIP_MIN_MESSAGES = 2;
84
+ /** Minimum gap between two idle tips, so the timeline never fills with them. */
85
+ export const TIP_COOLDOWN_MS = 150_000;
86
+ /**
87
+ * Chance to surface a rotation tip once idle + cooldown allow it — high enough
88
+ * that an active session reliably sees one, but not every idle period.
89
+ */
90
+ export const TIP_IDLE_PROBABILITY = 0.7;
91
+ /**
92
+ * Decide whether to surface an idle tip. Pure: pass `rand` (0–1, e.g. `Math.random()`)
93
+ * so it is testable. Returns false unless the conversation has enough history (never
94
+ * on the first prompt), has been idle long enough, the cooldown since the last tip has
95
+ * elapsed, AND the random roll passes — so tips stay occasional and never pile up.
96
+ *
97
+ * @param state - Conversation idle state.
98
+ * @param rand - A random value in [0, 1) (injected for testability).
99
+ * @returns Whether a tip should be shown now.
100
+ */
101
+ export function shouldShowIdleTip(state, rand) {
102
+ if (state.messageCount < TIP_MIN_MESSAGES)
103
+ return false;
104
+ if (state.msSinceLastActivity < TIP_IDLE_MS)
105
+ return false;
106
+ if (state.msSinceLastTip < TIP_COOLDOWN_MS)
107
+ return false;
108
+ return rand < TIP_IDLE_PROBABILITY;
109
+ }
110
+ /**
111
+ * Pick a tip the user hasn't seen yet (falling back to the full pool once all have
112
+ * been shown). Pure: pass `rand` (0–1) for a testable random choice; out-of-range or
113
+ * non-finite values are clamped.
114
+ *
115
+ * @param shownIds - Ids of tips already shown this conversation.
116
+ * @param rand - A random value in [0, 1) (injected for testability).
117
+ * @returns The chosen tip definition.
118
+ */
119
+ export function pickIdleTip(shownIds, rand) {
120
+ const fresh = CHAT_TIPS.filter((tip) => !shownIds.includes(tip.id));
121
+ const pool = fresh.length ? fresh : CHAT_TIPS;
122
+ const safe = Number.isFinite(rand) ? Math.min(Math.max(rand, 0), 0.999999) : 0;
123
+ return pool[Math.floor(safe * pool.length)];
124
+ }
125
+ /**
126
+ * Deterministic by-index tip pick, cycling through {@link CHAT_TIPS} via modulo.
127
+ * Non-finite or negative indices clamp to slot 0.
128
+ *
129
+ * @param index - The tip index.
130
+ * @returns The tip definition for that index.
131
+ */
132
+ export function selectTip(index) {
133
+ const len = CHAT_TIPS.length;
134
+ const safe = Number.isFinite(index) && index > 0 ? Math.floor(index) : 0;
135
+ return CHAT_TIPS[safe % len];
136
+ }
137
+ //# sourceMappingURL=chat-tips-utilities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat-tips-utilities.js","sourceRoot":"","sources":["../../src/components/chat-tips-utilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAcH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,SAAS,GAAW;IAC/B,EAAE,EAAE,YAAY;IAChB,IAAI,EAAE,8FAA8F;CACrG,CAAA;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,SAAS,GAAsB;IAC1C;QACE,EAAE,EAAE,SAAS;QACb,IAAI,EAAE,4FAA4F;KACnG;IACD;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,gEAAgE;KACvE;IACD;QACE,EAAE,EAAE,MAAM;QACV,IAAI,EAAE,6FAA6F;KACpG;IACD;QACE,EAAE,EAAE,MAAM;QACV,IAAI,EAAE,8FAA8F;KACrG;IACD;QACE,EAAE,EAAE,SAAS;QACb,IAAI,EAAE,mFAAmF;KAC1F;IACD;QACE,EAAE,EAAE,QAAQ;QACZ,IAAI,EAAE,iFAAiF;KACxF;IACD;QACE,EAAE,EAAE,QAAQ;QACZ,IAAI,EAAE,iGAAiG;KACxG;CACO,CAAA;AAEV;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAA;AACjC;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAA;AACjC,gFAAgF;AAChF,MAAM,CAAC,MAAM,eAAe,GAAG,OAAO,CAAA;AACtC;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,CAAA;AAYvC;;;;;;;;;GASG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAmB,EAAE,IAAY;IACjE,IAAI,KAAK,CAAC,YAAY,GAAG,gBAAgB;QAAE,OAAO,KAAK,CAAA;IACvD,IAAI,KAAK,CAAC,mBAAmB,GAAG,WAAW;QAAE,OAAO,KAAK,CAAA;IACzD,IAAI,KAAK,CAAC,cAAc,GAAG,eAAe;QAAE,OAAO,KAAK,CAAA;IACxD,OAAO,IAAI,GAAG,oBAAoB,CAAA;AACpC,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,WAAW,CAAC,QAA2B,EAAE,IAAY;IACnE,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAA;IACnE,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAA;IAC7C,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAC9E,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAA;AAC7C,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAC,KAAa;IACrC,MAAM,GAAG,GAAG,SAAS,CAAC,MAAM,CAAA;IAC5B,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IACxE,OAAO,SAAS,CAAC,IAAI,GAAG,GAAG,CAAC,CAAA;AAC9B,CAAC"}
@@ -0,0 +1,84 @@
1
+ /**
2
+ * Device-frame data + helpers for the preview panel.
3
+ *
4
+ * The preview header exposes a {@link DeviceFrameSelector} dropdown that lists
5
+ * every device frame, plus a "Rotate" control that swaps a fixed-frame device
6
+ * between portrait and landscape. The frame order, the icon + human label for
7
+ * each frame, the fixed pixel DIMENSIONS used to size the preview iframe, and
8
+ * the orientation-aware size resolver all live here as pure data/functions so
9
+ * they can be unit tested and reused.
10
+ *
11
+ * @module
12
+ */
13
+ import type { IconName } from '@molecule/app-icons';
14
+ import type { DeviceFrame } from '@molecule/app-live-preview';
15
+ /**
16
+ * The device frames the selector dropdown lists, in display order.
17
+ * `none` = responsive (no fixed frame, full width).
18
+ */
19
+ export declare const DEVICE_FRAMES: readonly DeviceFrame[];
20
+ /**
21
+ * Per-frame display metadata: the icon-set glyph name and the i18n label
22
+ * (key + English default) shown in the dropdown trigger + menu items.
23
+ */
24
+ export declare const DEVICE_META: Record<DeviceFrame, {
25
+ readonly icon: IconName;
26
+ readonly labelKey: string;
27
+ readonly label: string;
28
+ }>;
29
+ /**
30
+ * Preview-only iframe orientation. Portrait is the natural orientation of a
31
+ * fixed-frame device; landscape swaps its width/height. This is a visual
32
+ * preview concern that lives in {@link PreviewPanel}'s local state — it is NOT
33
+ * part of the live-preview core state.
34
+ */
35
+ export type DeviceOrientation = 'portrait' | 'landscape';
36
+ /**
37
+ * Per-frame iframe sizing. `width`/`height` are the PORTRAIT CSS sizes; a
38
+ * fixed-frame (`rotatable`) device swaps them in landscape. `'100%'` width with
39
+ * a `null` height means "fluid" — fill the available preview area (responsive /
40
+ * desktop have no fixed frame to rotate).
41
+ */
42
+ export interface DeviceDimensions {
43
+ /** Portrait CSS width (e.g. `'768px'`, or `'100%'` for a fluid frame). */
44
+ readonly width: string;
45
+ /** Portrait CSS height in px (e.g. `'1024px'`), or `null` to fill the area. */
46
+ readonly height: string | null;
47
+ /** Whether the frame has a fixed size that can be rotated portrait ⇄ landscape. */
48
+ readonly rotatable: boolean;
49
+ }
50
+ /**
51
+ * The fixed pixel frame each device renders the preview iframe at. `none`
52
+ * (responsive) and `desktop` are fluid — full width, full height, nothing to
53
+ * rotate. `tablet` (768×1024) and `mobile` (375×667) are fixed frames that can
54
+ * be rotated to landscape (swapping width/height).
55
+ */
56
+ export declare const DEVICE_DIMENSIONS: Record<DeviceFrame, DeviceDimensions>;
57
+ /**
58
+ * Whether a device frame can be rotated (true only for fixed-frame devices —
59
+ * tablet and mobile). Responsive and desktop are full-width with nothing to
60
+ * rotate, so the "Rotate" control is enabled only "where possible".
61
+ * @param device - The device frame.
62
+ * @returns `true` if the frame has a fixed size that can be rotated.
63
+ */
64
+ export declare function isDeviceRotatable(device: DeviceFrame): boolean;
65
+ /**
66
+ * Resolves the concrete iframe `width`/`height` for a device frame at a given
67
+ * orientation. Fluid frames (responsive/desktop) ignore orientation and fill
68
+ * the preview area (`width` from dims, `height: '100%'`). Fixed frames render
69
+ * at their pixel size in portrait and at the swapped size in landscape.
70
+ * @param device - The device frame.
71
+ * @param orientation - The preview orientation.
72
+ * @returns The CSS `width` and `height` to apply to the preview iframe.
73
+ */
74
+ export declare function resolveDeviceSize(device: DeviceFrame, orientation: DeviceOrientation): {
75
+ width: string;
76
+ height: string;
77
+ };
78
+ /**
79
+ * Returns the icon-set glyph name for a device frame.
80
+ * @param device - The device frame.
81
+ * @returns The icon name registered in the bonded icon set.
82
+ */
83
+ export declare function deviceIconName(device: DeviceFrame): string;
84
+ //# sourceMappingURL=device-cycle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"device-cycle.d.ts","sourceRoot":"","sources":["../../src/components/device-cycle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAE7D;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,SAAS,WAAW,EAA4C,CAAA;AAE5F;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAC9B,WAAW,EACX;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAM/E,CAAA;AAED;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,WAAW,CAAA;AAExD;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,0EAA0E;IAC1E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,+EAA+E;IAC/E,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,mFAAmF;IACnF,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;CAC5B;AAED;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,WAAW,EAAE,gBAAgB,CAKnE,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAE9D;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,WAAW,EACnB,WAAW,EAAE,iBAAiB,GAC7B;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CASnC;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAE1D"}
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Device-frame data + helpers for the preview panel.
3
+ *
4
+ * The preview header exposes a {@link DeviceFrameSelector} dropdown that lists
5
+ * every device frame, plus a "Rotate" control that swaps a fixed-frame device
6
+ * between portrait and landscape. The frame order, the icon + human label for
7
+ * each frame, the fixed pixel DIMENSIONS used to size the preview iframe, and
8
+ * the orientation-aware size resolver all live here as pure data/functions so
9
+ * they can be unit tested and reused.
10
+ *
11
+ * @module
12
+ */
13
+ /**
14
+ * The device frames the selector dropdown lists, in display order.
15
+ * `none` = responsive (no fixed frame, full width).
16
+ */
17
+ export const DEVICE_FRAMES = ['none', 'desktop', 'tablet', 'mobile'];
18
+ /**
19
+ * Per-frame display metadata: the icon-set glyph name and the i18n label
20
+ * (key + English default) shown in the dropdown trigger + menu items.
21
+ */
22
+ export const DEVICE_META = {
23
+ none: { icon: 'browser', labelKey: 'ide.device.responsive', label: 'Responsive' },
24
+ desktop: { icon: 'device-desktop', labelKey: 'ide.device.desktop', label: 'Desktop' },
25
+ tablet: { icon: 'device-tablet', labelKey: 'ide.device.tablet', label: 'Tablet' },
26
+ mobile: { icon: 'device-mobile', labelKey: 'ide.device.mobile', label: 'Mobile' },
27
+ };
28
+ /**
29
+ * The fixed pixel frame each device renders the preview iframe at. `none`
30
+ * (responsive) and `desktop` are fluid — full width, full height, nothing to
31
+ * rotate. `tablet` (768×1024) and `mobile` (375×667) are fixed frames that can
32
+ * be rotated to landscape (swapping width/height).
33
+ */
34
+ export const DEVICE_DIMENSIONS = {
35
+ none: { width: '100%', height: null, rotatable: false },
36
+ desktop: { width: '100%', height: null, rotatable: false },
37
+ tablet: { width: '768px', height: '1024px', rotatable: true },
38
+ mobile: { width: '375px', height: '667px', rotatable: true },
39
+ };
40
+ /**
41
+ * Whether a device frame can be rotated (true only for fixed-frame devices —
42
+ * tablet and mobile). Responsive and desktop are full-width with nothing to
43
+ * rotate, so the "Rotate" control is enabled only "where possible".
44
+ * @param device - The device frame.
45
+ * @returns `true` if the frame has a fixed size that can be rotated.
46
+ */
47
+ export function isDeviceRotatable(device) {
48
+ return DEVICE_DIMENSIONS[device].rotatable;
49
+ }
50
+ /**
51
+ * Resolves the concrete iframe `width`/`height` for a device frame at a given
52
+ * orientation. Fluid frames (responsive/desktop) ignore orientation and fill
53
+ * the preview area (`width` from dims, `height: '100%'`). Fixed frames render
54
+ * at their pixel size in portrait and at the swapped size in landscape.
55
+ * @param device - The device frame.
56
+ * @param orientation - The preview orientation.
57
+ * @returns The CSS `width` and `height` to apply to the preview iframe.
58
+ */
59
+ export function resolveDeviceSize(device, orientation) {
60
+ const dims = DEVICE_DIMENSIONS[device];
61
+ if (!dims.rotatable || dims.height === null) {
62
+ // Fluid frame — fill the available preview area; nothing to rotate.
63
+ return { width: dims.width, height: '100%' };
64
+ }
65
+ return orientation === 'landscape'
66
+ ? { width: dims.height, height: dims.width }
67
+ : { width: dims.width, height: dims.height };
68
+ }
69
+ /**
70
+ * Returns the icon-set glyph name for a device frame.
71
+ * @param device - The device frame.
72
+ * @returns The icon name registered in the bonded icon set.
73
+ */
74
+ export function deviceIconName(device) {
75
+ return DEVICE_META[device].icon;
76
+ }
77
+ //# sourceMappingURL=device-cycle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"device-cycle.js","sourceRoot":"","sources":["../../src/components/device-cycle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAA2B,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAA;AAE5F;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAGpB;IACF,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,uBAAuB,EAAE,KAAK,EAAE,YAAY,EAAE;IACjF,OAAO,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,QAAQ,EAAE,oBAAoB,EAAE,KAAK,EAAE,SAAS,EAAE;IACrF,MAAM,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,QAAQ,EAAE,mBAAmB,EAAE,KAAK,EAAE,QAAQ,EAAE;IACjF,MAAM,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,QAAQ,EAAE,mBAAmB,EAAE,KAAK,EAAE,QAAQ,EAAE;CAClF,CAAA;AAyBD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAA0C;IACtE,IAAI,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE;IACvD,OAAO,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE;IAC1D,MAAM,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE;IAC7D,MAAM,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE;CAC7D,CAAA;AAED;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAmB;IACnD,OAAO,iBAAiB,CAAC,MAAM,CAAC,CAAC,SAAS,CAAA;AAC5C,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,iBAAiB,CAC/B,MAAmB,EACnB,WAA8B;IAE9B,MAAM,IAAI,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAA;IACtC,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;QAC5C,oEAAoE;QACpE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,CAAA;IAC9C,CAAC;IACD,OAAO,WAAW,KAAK,WAAW;QAChC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE;QAC5C,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAA;AAChD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,MAAmB;IAChD,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC,IAAI,CAAA;AACjC,CAAC"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * IDE React components.
3
+ *
4
+ * @module
5
+ */
6
+ export * from './activity-utilities.js';
7
+ export type { ActivityCardProps } from './ActivityCard.js';
8
+ export { ActivityCard } from './ActivityCard.js';
9
+ export * from './chat-autocommit-utilities.js';
10
+ export * from './chat-report-utilities.js';
11
+ export * from './chat-share-utilities.js';
12
+ export { ChatPanel } from './ChatPanel.js';
13
+ export { CommandPalette } from './CommandPalette.js';
14
+ export * from './device-cycle.js';
15
+ export { DeviceFrameSelector } from './DeviceFrameSelector.js';
16
+ export { EditorPanel } from './EditorPanel.js';
17
+ export { FileExplorer } from './FileExplorer.js';
18
+ export type { IconProps } from './Icon.js';
19
+ export { Icon } from './Icon.js';
20
+ export { KeyboardShortcutsPanel } from './KeyboardShortcutsPanel.js';
21
+ export { PreviewPanel } from './PreviewPanel.js';
22
+ export { QuickOpen } from './QuickOpen.js';
23
+ export { QuickPicker } from './QuickPicker.js';
24
+ export { ReportModal } from './ReportModal.js';
25
+ export { ResizeHandle } from './ResizeHandle.js';
26
+ export { SearchPanel } from './SearchPanel.js';
27
+ export { ShareModal } from './ShareModal.js';
28
+ export { SidebarTabs } from './SidebarTabs.js';
29
+ export { TabBar } from './TabBar.js';
30
+ export { ToolCallCard } from './ToolCallCard.js';
31
+ export * from './user-avatar-utilities.js';
32
+ export type { UserAvatarProps } from './UserAvatar.js';
33
+ export { UserAvatar } from './UserAvatar.js';
34
+ export * from './workspace-layout-utilities.js';
35
+ export { WorkspaceLayout } from './WorkspaceLayout.js';
36
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,yBAAyB,CAAA;AACvC,YAAY,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,cAAc,gCAAgC,CAAA;AAC9C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,2BAA2B,CAAA;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,cAAc,mBAAmB,CAAA;AACjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,YAAY,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,cAAc,4BAA4B,CAAA;AAC1C,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,cAAc,iCAAiC,CAAA;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * IDE React components.
3
+ *
4
+ * @module
5
+ */
6
+ export * from './activity-utilities.js';
7
+ export { ActivityCard } from './ActivityCard.js';
8
+ export * from './chat-autocommit-utilities.js';
9
+ export * from './chat-report-utilities.js';
10
+ export * from './chat-share-utilities.js';
11
+ export { ChatPanel } from './ChatPanel.js';
12
+ export { CommandPalette } from './CommandPalette.js';
13
+ export * from './device-cycle.js';
14
+ export { DeviceFrameSelector } from './DeviceFrameSelector.js';
15
+ export { EditorPanel } from './EditorPanel.js';
16
+ export { FileExplorer } from './FileExplorer.js';
17
+ export { Icon } from './Icon.js';
18
+ export { KeyboardShortcutsPanel } from './KeyboardShortcutsPanel.js';
19
+ export { PreviewPanel } from './PreviewPanel.js';
20
+ export { QuickOpen } from './QuickOpen.js';
21
+ export { QuickPicker } from './QuickPicker.js';
22
+ export { ReportModal } from './ReportModal.js';
23
+ export { ResizeHandle } from './ResizeHandle.js';
24
+ export { SearchPanel } from './SearchPanel.js';
25
+ export { ShareModal } from './ShareModal.js';
26
+ export { SidebarTabs } from './SidebarTabs.js';
27
+ export { TabBar } from './TabBar.js';
28
+ export { ToolCallCard } from './ToolCallCard.js';
29
+ export * from './user-avatar-utilities.js';
30
+ export { UserAvatar } from './UserAvatar.js';
31
+ export * from './workspace-layout-utilities.js';
32
+ export { WorkspaceLayout } from './WorkspaceLayout.js';
33
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,yBAAyB,CAAA;AAEvC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,cAAc,gCAAgC,CAAA;AAC9C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,2BAA2B,CAAA;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,cAAc,mBAAmB,CAAA;AACjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAEhD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,cAAc,4BAA4B,CAAA;AAE1C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,cAAc,iCAAiC,CAAA;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Pure utility functions for tool call display.
3
+ *
4
+ * Extracted from ToolCallCard for testability — these functions have no
5
+ * React dependencies and can be unit-tested directly.
6
+ *
7
+ * @module
8
+ */
9
+ /** Raw tool output shape. */
10
+ export type ToolOutput = Record<string, unknown> | string | null | undefined;
11
+ /**
12
+ * Extracts the last path segment from a file path (e.g. "a/b/c.ts" → "c.ts").
13
+ * @param path - The file path to extract the basename from.
14
+ * @returns The basename string, or empty string if path is undefined.
15
+ */
16
+ export declare function basename(path: string | undefined): string;
17
+ /**
18
+ * Path of a `@molecule/*` package's MOLECULE.md inside the sandbox, where every
19
+ * package is pre-installed. Used by the find_package / read_molecule_doc cards
20
+ * so clicking a package opens its docs in the editor.
21
+ * @param packageName - The package name, with or without the `@molecule/` prefix.
22
+ * @returns The absolute sandbox path to the package's MOLECULE.md, or null for
23
+ * a name that isn't a plain molecule package slug.
24
+ */
25
+ export declare function moleculeDocPath(packageName: string | undefined): string | null;
26
+ /**
27
+ * Human-readable label for a tool call (e.g. "Edit `ChatPanel.tsx`").
28
+ * @param name - The tool name (e.g. "write_file", "exec_command").
29
+ * @param input - The raw tool input payload.
30
+ * @returns A formatted label string with backtick-wrapped filenames.
31
+ */
32
+ export declare function toolLabel(name: string, input: unknown): string;
33
+ /**
34
+ * One-line result summary shown beneath the label.
35
+ * @param name - The tool name.
36
+ * @param output - The raw tool output payload.
37
+ * @param status - The execution status (pending, running, done, error).
38
+ * @returns A brief summary string describing the result.
39
+ */
40
+ export declare function toolSummary(name: string, output: ToolOutput, status: string): string;
41
+ /**
42
+ * Count truly added/removed lines between two line arrays using LCS.
43
+ * @param oldLines - The original lines array.
44
+ * @param newLines - The modified lines array.
45
+ * @returns An object with the number of added and removed lines.
46
+ */
47
+ export declare function diffLineCount(oldLines: string[], newLines: string[]): {
48
+ added: number;
49
+ removed: number;
50
+ };
51
+ /**
52
+ * Compute lines added/removed from a file-changing tool call.
53
+ * @param name - The tool name (edit_file or write_file).
54
+ * @param input - The raw tool input payload.
55
+ * @param output - The raw tool output payload.
56
+ * @returns Diff stats with added and removed line counts, or null if not applicable.
57
+ */
58
+ export declare function fileDiffStats(name: string, input: unknown, output: unknown): {
59
+ added: number;
60
+ removed: number;
61
+ } | null;
62
+ /**
63
+ * Extracts the primary file path from a tool's input, if it operates on a single file.
64
+ * @param name - The tool name.
65
+ * @param input - The raw tool input payload.
66
+ * @returns The file path string, or null if the tool doesn't target a single file.
67
+ */
68
+ export declare function extractFilePath(name: string, input: unknown): string | null;
69
+ //# sourceMappingURL=tool-call-utilities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-call-utilities.d.ts","sourceRoot":"","sources":["../../src/components/tool-call-utilities.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,6BAA6B;AAC7B,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;AAE5E;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAGzD;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAK9E;AAOD;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,CA4H9D;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CA8HpF;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,MAAM,EAAE,EAClB,QAAQ,EAAE,MAAM,EAAE,GACjB;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAcpC;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,OAAO,GACd;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAyB3C;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAgB3E"}