@blade-hq/agent-kit 1.0.25 → 1.0.28

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 (287) hide show
  1. package/dist/chunk-7LEKQI47.js +32 -0
  2. package/dist/chunk-7LEKQI47.js.map +1 -0
  3. package/dist/{chunk-3I4ZURKH.js → chunk-BGNKHPCD.js} +223 -50
  4. package/dist/chunk-BGNKHPCD.js.map +1 -0
  5. package/dist/{chunk-4D4EXLVT.js → chunk-DQCXSPHP.js} +2 -2
  6. package/dist/chunk-HCQDDDOX.js +23 -0
  7. package/dist/chunk-HCQDDDOX.js.map +1 -0
  8. package/dist/{chunk-QODAKTG5.js → chunk-JCJFFJ42.js} +2 -31
  9. package/dist/chunk-JCJFFJ42.js.map +1 -0
  10. package/dist/{chunk-XCIDE3JW.js → chunk-OGHUIKCY.js} +7 -7
  11. package/dist/{chunk-WPLEMYL7.js → chunk-PYYDXV2A.js} +2 -2
  12. package/dist/{chunk-VJY6RLYU.js → chunk-TVWC3PED.js} +2 -2
  13. package/dist/{chunk-WVXXQ3KM.js → chunk-UWNQ4PXK.js} +134 -1201
  14. package/dist/chunk-UWNQ4PXK.js.map +1 -0
  15. package/dist/{chunk-M45K3554.js → chunk-YJ6BX3FU.js} +1382 -32
  16. package/dist/chunk-YJ6BX3FU.js.map +1 -0
  17. package/dist/client/auth.d.ts +8 -0
  18. package/dist/client/blade-client.d.ts +82 -0
  19. package/dist/client/index.d.ts +23 -15348
  20. package/dist/client/index.js +3 -1
  21. package/dist/client/resources/api-keys.d.ts +28 -0
  22. package/dist/client/resources/app-dev-templates.d.ts +93 -0
  23. package/dist/client/resources/auth.d.ts +26 -0
  24. package/dist/client/resources/env-buckets.d.ts +20 -0
  25. package/dist/client/resources/gis.d.ts +8 -0
  26. package/dist/client/resources/headless.d.ts +33 -0
  27. package/dist/client/resources/memories.d.ts +63 -0
  28. package/dist/client/resources/models.d.ts +26 -0
  29. package/dist/client/resources/published-apps.d.ts +8 -0
  30. package/dist/client/resources/registry.d.ts +58 -0
  31. package/dist/client/resources/runs.d.ts +8 -0
  32. package/dist/client/resources/scenarios.d.ts +49 -0
  33. package/dist/client/resources/sessions.d.ts +253 -0
  34. package/dist/client/resources/skills.d.ts +38 -0
  35. package/dist/client/resources/solutions.d.ts +31 -0
  36. package/dist/client/resources/user-preferences.d.ts +26 -0
  37. package/dist/client/rest.d.ts +19 -0
  38. package/dist/client/shared/projection/builder.d.ts +59 -0
  39. package/dist/client/shared/projection/helpers.d.ts +34 -0
  40. package/dist/client/shared/projection/history.d.ts +12 -0
  41. package/dist/client/shared/projection/index.d.ts +3 -0
  42. package/dist/client/shared/projection/state.d.ts +22 -0
  43. package/dist/client/socket.d.ts +9 -0
  44. package/dist/client/types/index.d.ts +8 -0
  45. package/dist/client/types/rest.d.ts +16316 -0
  46. package/dist/client/types/sdk-profile.d.ts +47 -0
  47. package/dist/client/types/socket-events.d.ts +389 -0
  48. package/dist/react/api/api-keys.d.ts +6 -0
  49. package/dist/react/api/app-dev-templates.d.ts +5 -0
  50. package/dist/react/api/auth.d.ts +7 -0
  51. package/dist/react/api/client.d.ts +8 -0
  52. package/dist/react/api/env-buckets.d.ts +10 -0
  53. package/dist/react/api/gis-api.d.ts +4 -0
  54. package/dist/react/api/memories.d.ts +14 -0
  55. package/dist/react/api/model-config.d.ts +68 -0
  56. package/dist/react/api/models.d.ts +13 -0
  57. package/dist/react/api/partner-skill.d.ts +2 -0
  58. package/dist/react/api/prod-solution.d.ts +456 -0
  59. package/dist/react/api/published-apps.d.ts +21 -0
  60. package/dist/react/api/published-apps.js +14 -0
  61. package/dist/react/api/published-apps.js.map +1 -0
  62. package/dist/react/api/registry.d.ts +46 -0
  63. package/dist/react/api/scenarios.d.ts +9 -0
  64. package/dist/react/api/scheduled-tasks.d.ts +24 -0
  65. package/dist/react/api/session-skill.d.ts +2 -0
  66. package/dist/react/api/sessions.d.ts +109 -0
  67. package/dist/react/api/sessions.js +93 -0
  68. package/dist/react/api/sessions.js.map +1 -0
  69. package/dist/react/api/skills.d.ts +27 -0
  70. package/dist/react/api/socket.d.ts +5 -0
  71. package/dist/react/api/solutions.d.ts +11 -0
  72. package/dist/react/api/user-preferences.d.ts +8 -0
  73. package/dist/react/asr/VoiceWaveform.d.ts +10 -0
  74. package/dist/react/asr/use-tiptap-voice-input.d.ts +29 -0
  75. package/dist/react/asr/use-voice-input.d.ts +17 -0
  76. package/dist/react/asr/voice-input-support.d.ts +5 -0
  77. package/dist/react/bootstrap.d.ts +4 -0
  78. package/dist/react/cards/register.d.ts +1 -2
  79. package/dist/react/cards/register.js +3 -2
  80. package/dist/react/cards/register.js.map +1 -1
  81. package/dist/react/components/ai-elements/file-tree.d.ts +26 -0
  82. package/dist/react/components/ai-elements/reasoning.d.ts +32 -0
  83. package/dist/react/components/ai-elements/shimmer.d.ts +11 -0
  84. package/dist/react/components/card/CardCodeBlock.d.ts +5 -0
  85. package/dist/react/components/card/CardContext.d.ts +7 -0
  86. package/dist/react/components/card/CardRenderer.d.ts +7 -0
  87. package/dist/react/components/card/CardStates.d.ts +8 -0
  88. package/dist/react/components/card/cards/attraction-card.d.ts +2 -0
  89. package/dist/react/components/card/cards/cite-card.d.ts +10 -0
  90. package/dist/react/components/card/cards/comprehensive-analysis-card.d.ts +2 -0
  91. package/dist/react/components/card/cards/conflict-detection-card.d.ts +4 -0
  92. package/dist/react/components/card/cards/counter.d.ts +2 -0
  93. package/dist/react/components/card/cards/damage-effect-card.d.ts +4 -0
  94. package/dist/react/components/card/cards/destination-card.d.ts +2 -0
  95. package/dist/react/components/card/cards/diff-card.d.ts +2 -0
  96. package/dist/react/components/card/cards/execution-order-card.d.ts +2 -0
  97. package/dist/react/components/card/cards/experience-card-with-options.d.ts +4 -0
  98. package/dist/react/components/card/cards/flight-card.d.ts +2 -0
  99. package/dist/react/components/card/cards/hotel-card.d.ts +2 -0
  100. package/dist/react/components/card/cards/kill-chain-card.d.ts +2 -0
  101. package/dist/react/components/card/cards/kill-chain-types.d.ts +157 -0
  102. package/dist/react/components/card/cards/map-card.d.ts +2 -0
  103. package/dist/react/components/card/cards/order-status-card.d.ts +2 -0
  104. package/dist/react/components/card/cards/patch-card.d.ts +15 -0
  105. package/dist/react/components/card/cards/product-recommendation-card.d.ts +2 -0
  106. package/dist/react/components/card/cards/reflection-optimization-card.d.ts +2 -0
  107. package/dist/react/components/card/cards/resolution-modifications-card.d.ts +2 -0
  108. package/dist/react/components/card/cards/resolution-summary-card.d.ts +2 -0
  109. package/dist/react/components/card/cards/restaurant-card.d.ts +2 -0
  110. package/dist/react/components/card/cards/shopping-list-card.d.ts +2 -0
  111. package/dist/react/components/card/cards/simulation-event-card.d.ts +4 -0
  112. package/dist/react/components/card/cards/survival-effect-card.d.ts +4 -0
  113. package/dist/react/components/card/cards/travel-itinerary-card.d.ts +2 -0
  114. package/dist/react/components/card/register.d.ts +1 -0
  115. package/dist/react/components/chat/AgentLoopBlock.d.ts +8 -0
  116. package/dist/react/components/chat/AskUserQuestionBlock.d.ts +32 -0
  117. package/dist/react/components/chat/AssistantTurnBlock.d.ts +28 -0
  118. package/dist/react/components/chat/AttachmentPreviewDialog.d.ts +26 -0
  119. package/dist/react/components/chat/BackgroundTasksPill.d.ts +3 -0
  120. package/dist/react/components/chat/ChatInput.d.ts +94 -0
  121. package/dist/react/components/chat/ChatView.d.ts +18 -0
  122. package/dist/react/components/chat/CompactionCard.d.ts +6 -0
  123. package/dist/react/components/chat/ConnectionBanner.d.ts +1 -0
  124. package/dist/react/components/chat/FileCompletionMenu.d.ts +13 -0
  125. package/dist/react/components/chat/FileSizeLimitDialog.d.ts +9 -0
  126. package/dist/react/components/chat/ImageLightbox.d.ts +11 -0
  127. package/dist/react/components/chat/MessageActions.d.ts +6 -0
  128. package/dist/react/components/chat/MessageContextPills.d.ts +6 -0
  129. package/dist/react/components/chat/MessageFileAttachmentList.d.ts +13 -0
  130. package/dist/react/components/chat/MessageList.d.ts +15 -0
  131. package/dist/react/components/chat/ProgressCircle.d.ts +12 -0
  132. package/dist/react/components/chat/RenderErrorBoundary.d.ts +19 -0
  133. package/dist/react/components/chat/ResourceIframe.d.ts +5 -0
  134. package/dist/react/components/chat/Shimmer.d.ts +6 -0
  135. package/dist/react/components/chat/SkillCompletionMenu.d.ts +9 -0
  136. package/dist/react/components/chat/SkillStatusBar.d.ts +8 -0
  137. package/dist/react/components/chat/StickyStatusBar.d.ts +10 -0
  138. package/dist/react/components/chat/TextAttachmentPills.d.ts +10 -0
  139. package/dist/react/components/chat/ThinkingToggle.d.ts +7 -0
  140. package/dist/react/components/chat/ToolCallBlock.d.ts +18 -0
  141. package/dist/react/components/chat/TurnNavRail.d.ts +11 -0
  142. package/dist/react/components/chat/UserMessageBubble.d.ts +20 -0
  143. package/dist/react/components/chat/WhatIfUserBubble.d.ts +13 -0
  144. package/dist/react/components/chat/customization.d.ts +82 -0
  145. package/dist/react/components/chat/display-utils.d.ts +35 -0
  146. package/dist/react/components/chat/extensions/file-mention.d.ts +12 -0
  147. package/dist/react/components/chat/extensions/skill-mention.d.ts +25 -0
  148. package/dist/react/components/chat/index.d.ts +16 -115
  149. package/dist/react/components/chat/index.js +8 -7
  150. package/dist/react/components/chat/scroll-anchor.d.ts +8 -0
  151. package/dist/react/components/chat/tool-renderers/BashRenderer.d.ts +2 -0
  152. package/dist/react/components/chat/tool-renderers/FileEditRenderer.d.ts +2 -0
  153. package/dist/react/components/chat/tool-renderers/FileReadRenderer.d.ts +2 -0
  154. package/dist/react/components/chat/tool-renderers/SearchRenderer.d.ts +2 -0
  155. package/dist/react/components/chat/tool-renderers/SubmitResultRenderer.d.ts +2 -0
  156. package/dist/react/components/chat/tool-renderers/registry.d.ts +9 -0
  157. package/dist/react/components/chat/tool-renderers/shared.d.ts +26 -0
  158. package/dist/react/components/chat/whatif-quote-context.d.ts +15 -0
  159. package/dist/react/components/markdown/ExternalLinkDialog.d.ts +8 -0
  160. package/dist/react/components/markdown/FileCardComponent.d.ts +10 -0
  161. package/dist/react/components/markdown/MarkdownContent.d.ts +19 -0
  162. package/dist/react/components/model/ModelSelector.d.ts +9 -0
  163. package/dist/react/components/plan/PlanSummaryCard.d.ts +8 -0
  164. package/dist/react/components/plan/PlanVisualization.d.ts +13 -0
  165. package/dist/react/components/plan/debug-log.d.ts +21 -0
  166. package/dist/react/components/plan/extract-plan-messages.d.ts +2 -0
  167. package/dist/react/components/plan/index.d.ts +6 -110
  168. package/dist/react/components/plan/index.js +7 -6
  169. package/dist/react/components/plan/index.js.map +1 -1
  170. package/dist/react/components/plan/parse-plan-messages.d.ts +10 -0
  171. package/dist/react/components/plan/parse-plan-tree.d.ts +16 -0
  172. package/dist/react/components/plan/phases/PlanMindMap.d.ts +8 -0
  173. package/dist/react/components/plan/phases/PlanStatusIcon.d.ts +5 -0
  174. package/dist/react/components/plan/phases/PlanTree.d.ts +8 -0
  175. package/dist/react/components/plan/phases/SkillAnalysis.d.ts +7 -0
  176. package/dist/react/components/plan/phases/SkillDiscovery.d.ts +10 -0
  177. package/dist/react/components/plan/types.d.ts +56 -0
  178. package/dist/react/components/session/SessionDetail.d.ts +8 -0
  179. package/dist/react/components/session/SessionList.d.ts +9 -0
  180. package/dist/react/components/session/SessionListItem.d.ts +8 -0
  181. package/dist/react/components/session/StatusBadge.d.ts +3 -0
  182. package/dist/react/components/session/index.d.ts +5 -53
  183. package/dist/react/components/session/index.js +6 -5
  184. package/dist/react/components/session/index.js.map +1 -1
  185. package/dist/react/components/session/session-utils.d.ts +19 -0
  186. package/dist/react/components/ui/collapsible.d.ts +5 -0
  187. package/dist/react/components/workspace/FileTree.d.ts +21 -0
  188. package/dist/react/components/workspace/WorkspaceFilesPanel.d.ts +30 -0
  189. package/dist/react/components/workspace/file-icon-assets.d.ts +3 -0
  190. package/dist/react/components/workspace/index.d.ts +2 -59
  191. package/dist/react/components/workspace/index.js +6 -5
  192. package/dist/react/components/workspace/index.js.map +1 -1
  193. package/dist/react/context.d.ts +2 -0
  194. package/dist/react/devtools/bridge-devtools/BridgeDevtoolsFab.d.ts +1 -0
  195. package/dist/react/devtools/bridge-devtools/index.d.ts +3 -36
  196. package/dist/react/devtools/bridge-devtools/mount.d.ts +1 -0
  197. package/dist/react/devtools/bridge-devtools/store.d.ts +15 -0
  198. package/dist/react/devtools/bridge-devtools/tap.d.ts +5 -0
  199. package/dist/react/devtools/bridge-devtools/types.d.ts +29 -0
  200. package/dist/react/hooks/use-background-tasks.d.ts +7 -0
  201. package/dist/react/hooks/use-card-state.d.ts +1 -0
  202. package/dist/react/hooks/use-chat.d.ts +13 -0
  203. package/dist/react/hooks/use-check-skill-file.d.ts +4 -0
  204. package/dist/react/hooks/use-check-solution-file.d.ts +4 -0
  205. package/dist/react/hooks/use-context-stats.d.ts +7 -0
  206. package/dist/react/hooks/use-gis.d.ts +17 -0
  207. package/dist/react/hooks/use-global-skill-stats.d.ts +6 -0
  208. package/dist/react/hooks/use-input-history.d.ts +7 -0
  209. package/dist/react/hooks/use-model-preferences.d.ts +18 -0
  210. package/dist/react/hooks/use-registry.d.ts +53 -0
  211. package/dist/react/hooks/use-resolved-model.d.ts +6 -0
  212. package/dist/react/hooks/use-session.d.ts +10 -0
  213. package/dist/react/hooks/use-skill-stats.d.ts +7 -0
  214. package/dist/react/hooks/use-skills.d.ts +6 -0
  215. package/dist/react/hooks/use-token-pressure.d.ts +6 -0
  216. package/dist/react/index.d.ts +124 -2034
  217. package/dist/react/index.js +125 -50
  218. package/dist/react/index.js.map +1 -1
  219. package/dist/react/lib/analytics.d.ts +7 -0
  220. package/dist/react/lib/attachment-upload.d.ts +10 -0
  221. package/dist/react/lib/card-registry.d.ts +35 -0
  222. package/dist/react/lib/chat.d.ts +48 -0
  223. package/dist/react/lib/code-highlight.d.ts +9 -0
  224. package/dist/react/lib/html-element-selection.d.ts +140 -0
  225. package/dist/react/lib/html-source-locator.d.ts +16 -0
  226. package/dist/react/lib/open-session-file.d.ts +2 -0
  227. package/dist/react/lib/parent-bridge.d.ts +22 -0
  228. package/dist/react/lib/preview-dispatch.d.ts +24 -0
  229. package/dist/react/lib/resource-bridge.d.ts +11 -0
  230. package/dist/react/lib/session-file-preview.d.ts +8 -0
  231. package/dist/react/lib/step-ranges.d.ts +42 -0
  232. package/dist/react/lib/tool-preview.d.ts +2 -0
  233. package/dist/react/lib/ui-meta.d.ts +9 -0
  234. package/dist/react/lib/utils.d.ts +3 -0
  235. package/dist/react/lib/whatif-prompt.d.ts +45 -0
  236. package/dist/react/provider.d.ts +8 -0
  237. package/dist/react/routes.d.ts +1 -0
  238. package/dist/react/schemas/background.d.ts +16 -0
  239. package/dist/react/schemas/event.d.ts +51 -0
  240. package/dist/react/schemas/gis.d.ts +50 -0
  241. package/dist/{AskUserQuestionBlock---kOTouk.d.ts → react/schemas/message.d.ts} +15 -48
  242. package/dist/react/schemas/partner-skill.d.ts +46 -0
  243. package/dist/{projection-BWYEFYNn.d.ts → react/schemas/projection.d.ts} +12 -10
  244. package/dist/react/schemas/published-apps.d.ts +38 -0
  245. package/dist/react/schemas/scheduled-task.d.ts +32 -0
  246. package/dist/react/schemas/session.d.ts +121 -0
  247. package/dist/react/schemas/skill.d.ts +50 -0
  248. package/dist/react/schemas/studio/agent.d.ts +12 -0
  249. package/dist/react/schemas/studio/database.d.ts +39 -0
  250. package/dist/react/schemas/studio/env.d.ts +7 -0
  251. package/dist/react/schemas/studio/knowledge.d.ts +18 -0
  252. package/dist/react/schemas/studio/resource-base.d.ts +7 -0
  253. package/dist/react/schemas/studio/scene.d.ts +12 -0
  254. package/dist/react/schemas/studio/tool.d.ts +25 -0
  255. package/dist/react/schemas/task.d.ts +12 -0
  256. package/dist/react/sockets/event-bridge.d.ts +115 -0
  257. package/dist/react/sockets/socket-state.d.ts +4 -0
  258. package/dist/react/stores/answer-callback-store.d.ts +9 -0
  259. package/dist/react/stores/auth-store.d.ts +38 -0
  260. package/dist/react/stores/background-store.d.ts +13 -0
  261. package/dist/react/stores/card-state-store.d.ts +10 -0
  262. package/dist/react/stores/chat-store.d.ts +34 -0
  263. package/dist/react/stores/client-aware.d.ts +7 -0
  264. package/dist/react/stores/connection-store.d.ts +14 -0
  265. package/dist/react/stores/gis-store.d.ts +19 -0
  266. package/dist/react/stores/index.d.ts +14 -0
  267. package/dist/react/stores/runtime-features-store.d.ts +21 -0
  268. package/dist/react/stores/runtime-store.d.ts +18 -0
  269. package/dist/react/stores/session-store.d.ts +44 -0
  270. package/dist/react/stores/task-store.d.ts +9 -0
  271. package/dist/react/stores/ui-bridge-store.d.ts +32 -0
  272. package/dist/react/stores/ui-store.d.ts +69 -0
  273. package/dist/react/types/index.d.ts +7 -0
  274. package/dist/react/types/solution.d.ts +101 -0
  275. package/package.json +41 -11
  276. package/dist/SkillStatusBar-U6fbQxMu.d.ts +0 -340
  277. package/dist/blade-client-qTOovekU.d.ts +0 -1609
  278. package/dist/chunk-3I4ZURKH.js.map +0 -1
  279. package/dist/chunk-M45K3554.js.map +0 -1
  280. package/dist/chunk-QODAKTG5.js.map +0 -1
  281. package/dist/chunk-WVXXQ3KM.js.map +0 -1
  282. package/dist/session-CNnotR90.d.ts +0 -227
  283. package/dist/sessions-BvfLGbjw.d.ts +0 -177
  284. /package/dist/{chunk-4D4EXLVT.js.map → chunk-DQCXSPHP.js.map} +0 -0
  285. /package/dist/{chunk-XCIDE3JW.js.map → chunk-OGHUIKCY.js.map} +0 -0
  286. /package/dist/{chunk-WPLEMYL7.js.map → chunk-PYYDXV2A.js.map} +0 -0
  287. /package/dist/{chunk-VJY6RLYU.js.map → chunk-TVWC3PED.js.map} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blade-hq/agent-kit",
3
- "version": "1.0.25",
3
+ "version": "1.0.28",
4
4
  "type": "module",
5
5
  "main": "./dist/react/index.js",
6
6
  "types": "./dist/react/index.d.ts",
@@ -14,16 +14,46 @@
14
14
  "import": "./dist/react/index.js"
15
15
  },
16
16
  "./style.css": "./dist/style.css",
17
- "./chat": "./dist/react/components/chat/index.js",
18
- "./plan": "./dist/react/components/plan/index.js",
19
- "./session": "./dist/react/components/session/index.js",
20
- "./workspace": "./dist/react/components/workspace/index.js",
21
- "./api/sessions": "./dist/react/api/sessions.js",
22
- "./api/published-apps": "./dist/react/api/published-apps.js",
23
- "./cards/register": "./dist/react/cards/register.js",
24
- "./devtools/bridge-devtools": "./dist/react/devtools/bridge-devtools/index.js",
25
- "./components/session": "./dist/react/components/session/index.js",
26
- "./components/workspace": "./dist/react/components/workspace/index.js"
17
+ "./chat": {
18
+ "types": "./dist/react/components/chat/index.d.ts",
19
+ "import": "./dist/react/components/chat/index.js"
20
+ },
21
+ "./plan": {
22
+ "types": "./dist/react/components/plan/index.d.ts",
23
+ "import": "./dist/react/components/plan/index.js"
24
+ },
25
+ "./session": {
26
+ "types": "./dist/react/components/session/index.d.ts",
27
+ "import": "./dist/react/components/session/index.js"
28
+ },
29
+ "./workspace": {
30
+ "types": "./dist/react/components/workspace/index.d.ts",
31
+ "import": "./dist/react/components/workspace/index.js"
32
+ },
33
+ "./api/sessions": {
34
+ "types": "./dist/react/api/sessions.d.ts",
35
+ "import": "./dist/react/api/sessions.js"
36
+ },
37
+ "./api/published-apps": {
38
+ "types": "./dist/react/api/published-apps.d.ts",
39
+ "import": "./dist/react/api/published-apps.js"
40
+ },
41
+ "./cards/register": {
42
+ "types": "./dist/react/cards/register.d.ts",
43
+ "import": "./dist/react/cards/register.js"
44
+ },
45
+ "./devtools/bridge-devtools": {
46
+ "types": "./dist/react/devtools/bridge-devtools/index.d.ts",
47
+ "import": "./dist/react/devtools/bridge-devtools/index.js"
48
+ },
49
+ "./components/session": {
50
+ "types": "./dist/react/components/session/index.d.ts",
51
+ "import": "./dist/react/components/session/index.js"
52
+ },
53
+ "./components/workspace": {
54
+ "types": "./dist/react/components/workspace/index.d.ts",
55
+ "import": "./dist/react/components/workspace/index.js"
56
+ }
27
57
  },
28
58
  "files": [
29
59
  "dist",
@@ -1,340 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as react from 'react';
3
- import { ComponentType, ReactNode } from 'react';
4
- import { C as ChatMessage, A as AskUserAnswerData, T as ToolCallInfo, M as MessageContent } from './AskUserQuestionBlock---kOTouk.js';
5
- import * as zustand from 'zustand';
6
- import { M as ModeId, a as SessionInfo, b as SessionStatus } from './session-CNnotR90.js';
7
- import { n as BladeClient } from './blade-client-qTOovekU.js';
8
- import { C as ContentBlock } from './projection-BWYEFYNn.js';
9
-
10
- /**
11
- * 把 whatif-rerun 后端组装的 prompt 文本解析成可折叠展示的结构。
12
- *
13
- * 当前后端格式(`host/orchestrator/whatif_rerun.py::_compose_whatif_prompt`):
14
- *
15
- * 以下消息和 step 产物标记为 deprecated_by_rerun,请基于最新用户假设从 step{N} 开始完整重新推演,不要复用旧结论。
16
- *
17
- * [引用]
18
- * [步骤{n} · {label}]
19
- * {snapshot markdown…(内部允许空行)}
20
- * [步骤{m} · {label}]
21
- * {snapshot markdown…}
22
- *
23
- * [用户输入]
24
- * {用户真正输入的文本}
25
- *
26
- * Legacy 格式(历史 session 里没有 `[用户输入]` 标签):
27
- * …最后一条 snapshot 末尾…
28
- * <空行>
29
- * {用户真正输入的文本}
30
- *
31
- * Legacy 情况下用"从末尾反向扫描第一段连续空行"做切分。markdown 末尾段落
32
- * 被误吃的风险可接受——总比让用户完全看不到自己的输入好。
33
- */
34
- interface WhatIfQuote {
35
- stepNumber: number | null;
36
- label: string;
37
- snapshot: string;
38
- }
39
- interface ParsedWhatIfPrompt {
40
- fromStep: number | null;
41
- quotes: WhatIfQuote[];
42
- userText: string;
43
- }
44
- interface BuildWhatIfPromptInput {
45
- fromStep: number;
46
- quotes: Array<{
47
- stepNumber?: number | null;
48
- label?: string | null;
49
- snapshot?: string | null;
50
- }>;
51
- userText: string;
52
- }
53
- declare function buildWhatIfPrompt({ fromStep, quotes, userText, }: BuildWhatIfPromptInput): string;
54
- declare function parseWhatIfPrompt(text: string): ParsedWhatIfPrompt | null;
55
-
56
- interface ClientAwareState {
57
- _client: BladeClient | null;
58
- setClient: (client: BladeClient) => void;
59
- }
60
-
61
- declare const ATTACHMENT_SIZE_LIMIT_BYTES: number;
62
- type OversizedFileInfo = {
63
- name: string;
64
- size: number;
65
- };
66
- declare function formatFileSize(size: number): string;
67
- declare function splitFilesBySize(files: FileList | File[], limitBytes?: number): {
68
- accepted: File[];
69
- rejected: OversizedFileInfo[];
70
- };
71
-
72
- type UserChatMessage = ChatMessage & {
73
- role: "user";
74
- };
75
- type ErrorChatMessage = ChatMessage & {
76
- role: "error";
77
- };
78
- declare function isUserMessage(message: ChatMessage): message is UserChatMessage;
79
- declare function isErrorMessage(message: ChatMessage): message is ErrorChatMessage;
80
- interface UserMessageProps {
81
- message: UserChatMessage;
82
- className?: string;
83
- }
84
- declare function UserMessageBubble({ message, className }: UserMessageProps): react_jsx_runtime.JSX.Element;
85
- declare function ErrorMessageBlock({ message, className, }: {
86
- message: ErrorChatMessage;
87
- className?: string;
88
- }): react_jsx_runtime.JSX.Element;
89
-
90
- type ChatViewClassNames = Partial<{
91
- root: string;
92
- viewerBanner: string;
93
- messageListRoot: string;
94
- messageListContent: string;
95
- messageListInner: string;
96
- emptyState: string;
97
- userMessage: string;
98
- errorMessage: string;
99
- assistantTurn: string;
100
- assistantText: string;
101
- toolCall: string;
102
- chatInputRoot: string;
103
- chatInputInner: string;
104
- skillStatusBarRoot: string;
105
- skillStatusBarInner: string;
106
- }>;
107
- interface ChatViewComponents {
108
- EmptyState?: ComponentType;
109
- UserMessage?: ComponentType<{
110
- message: UserChatMessage;
111
- className?: string;
112
- }>;
113
- ErrorMessage?: ComponentType<{
114
- message: ErrorChatMessage;
115
- className?: string;
116
- }>;
117
- AssistantTurn?: ComponentType<AssistantTurnComponentProps>;
118
- ToolCall?: ComponentType<ToolCallComponentProps>;
119
- SkillStatusBar?: ComponentType<SkillStatusBarComponentProps>;
120
- }
121
- interface ChatViewRenderers {
122
- tool?: Record<string, ComponentType<ToolRendererProps>>;
123
- }
124
- interface ChatViewCustomization {
125
- classNames?: ChatViewClassNames;
126
- components?: ChatViewComponents;
127
- renderers?: ChatViewRenderers;
128
- }
129
- interface AssistantTurnComponentProps {
130
- turnKey: string;
131
- sessionId: string;
132
- messages: ChatMessage[];
133
- isStreaming?: boolean;
134
- isLastTurn?: boolean;
135
- askAnswers?: Record<string, AskUserAnswerData>;
136
- onAnswer?: (answer: string, toolCallId: string, answerData: AskUserAnswerData) => void;
137
- sessionStatus?: string;
138
- level?: 1 | 2;
139
- forceExpanded?: boolean;
140
- customization?: ChatViewCustomization;
141
- }
142
- interface ToolCallComponentProps {
143
- toolCall: ToolCallInfo;
144
- onAnswer?: (answer: string, toolCallId: string, answerData: AskUserAnswerData) => void;
145
- answered?: boolean;
146
- answerData?: AskUserAnswerData;
147
- sessionId?: string;
148
- sessionStatus?: string;
149
- level?: 1 | 2;
150
- turnBlocks?: ContentBlock[];
151
- reasoning?: string;
152
- customization?: ChatViewCustomization;
153
- }
154
- interface ToolRendererProps {
155
- toolCall: ToolCallInfo;
156
- sessionId?: string;
157
- }
158
- interface SkillStatusBarComponentProps {
159
- sessionId: string;
160
- onResync?: () => void;
161
- isResyncing?: boolean;
162
- vertical?: boolean;
163
- className?: string;
164
- innerClassName?: string;
165
- }
166
-
167
- interface ChatViewProps extends ChatViewCustomization {
168
- sessionId: string;
169
- renderAttachments?: () => ReactNode;
170
- onBeforeSend?: (content: MessageContent) => MessageContent | Promise<MessageContent>;
171
- onCommand?: (commandId: string) => void | Promise<void>;
172
- canShareSession?: boolean;
173
- onResyncSkills?: () => void;
174
- isResyncingSkills?: boolean;
175
- inputLabel?: string;
176
- onDoubleEscape?: (anchorRect: DOMRect | null) => void;
177
- composerHint?: ReactNode;
178
- }
179
- declare function ChatView({ sessionId, renderAttachments, onBeforeSend, onCommand, canShareSession, onResyncSkills, isResyncingSkills, inputLabel, onDoubleEscape, composerHint, classNames, components, renderers, }: ChatViewProps): react_jsx_runtime.JSX.Element;
180
-
181
- type SessionMode = ModeId;
182
- interface SessionState extends ClientAwareState {
183
- sessions: SessionInfo[];
184
- activeSessionId: string | null;
185
- loading: boolean;
186
- modes: Record<string, SessionMode>;
187
- rewindDrafts: Record<string, string>;
188
- errorMessages: Record<string, string>;
189
- /** Session IDs that were just created and haven't had their first history load yet */
190
- _freshSessions: Set<string>;
191
- fetchAllSessions: () => Promise<void>;
192
- createSession: (intent?: string) => Promise<string>;
193
- registerCreatedSession: (session: SessionInfo, mode?: SessionMode, options?: {
194
- fresh?: boolean;
195
- }) => void;
196
- upsertSession: (session: SessionInfo) => void;
197
- isFreshSession: (sessionId: string) => boolean;
198
- setActiveSession: (id: string) => void;
199
- clearActiveSession: () => void;
200
- deleteSession: (id: string) => Promise<void>;
201
- updateSessionStatus: (sessionId: string, status: SessionStatus) => void;
202
- updateSessionIntent: (sessionId: string, intent: string) => void;
203
- /**
204
- * ship-attack v2:通用增量更新 session 字段。用于 session:updated 等事件
205
- * 广播"后端刚改了 session 元数据(intent / bound_skill_id / ...)"时,
206
- * 前端原地 patch sessions 缓存,而不需要重新拉整个列表。
207
- */
208
- patchSession: (sessionId: string, patch: Partial<SessionInfo>) => void;
209
- pinSession: (sessionId: string, pinned: boolean) => Promise<void>;
210
- setErrorMessage: (sessionId: string, message: string) => void;
211
- clearErrorMessage: (sessionId: string) => void;
212
- setRewindDraft: (sessionId: string, text: string | null) => void;
213
- setMode: (sessionId: string, mode: SessionMode) => void;
214
- togglePlanningMode: (sessionId: string) => void;
215
- toggleSharing: (sessionId: string) => Promise<void>;
216
- reset: () => void;
217
- }
218
- /** 侧栏等使用 React Query 拉取会话列表时,与 zustand patch 同步失效。 */
219
- declare function invalidateHomeSidebarSessions(): void;
220
- declare const useSessionStore: zustand.UseBoundStore<zustand.StoreApi<SessionState>>;
221
-
222
- interface ChatSendOptions {
223
- targetSessionId?: string;
224
- model?: string | null;
225
- thinkingOverride?: boolean;
226
- }
227
- interface Props$2 {
228
- onSend: (message: MessageContent, options?: ChatSendOptions) => void;
229
- onAppend?: (message: string) => void;
230
- onStop: () => void | Promise<void>;
231
- isStreaming: boolean;
232
- isStopping?: boolean;
233
- mode?: SessionMode;
234
- onToggleMode?: () => void;
235
- renderAttachments?: () => ReactNode;
236
- onBeforeSend?: (content: MessageContent) => MessageContent | Promise<MessageContent>;
237
- /**
238
- * Creates (or returns) a session to upload pending attachments into when
239
- * the composer has files but no active session yet. The returned id is
240
- * used for the upload, and is also passed back to `onSend` so the send
241
- * path reaches exactly the session the files landed in — independent of
242
- * whatever the global activeSessionId is at that moment.
243
- */
244
- ensureSession?: (draftText: string) => Promise<string>;
245
- onCommand?: (commandId: string) => void | Promise<void>;
246
- canShareSession?: boolean;
247
- /**
248
- * Optional slot rendered directly above the textarea (below any file-pill
249
- * bar). ship-attack uses this to mount QuoteChipList for R4.
250
- */
251
- slotAboveTextarea?: ReactNode;
252
- /**
253
- * Optional external draft channel. When provided, the composer initializes
254
- * from `value` on mount and mirrors every internal `setInput` call into
255
- * `setValue`. Intended for ship-attack's cross-view draft sharing (R3.8),
256
- * not full controlled-input semantics — the tiptap editor remains the
257
- * source of truth, this is a persistence side-channel.
258
- */
259
- externalDraft?: {
260
- value: string;
261
- setValue: (v: string) => void;
262
- };
263
- /**
264
- * Optional external attachments channel. Same mirror semantics as
265
- * externalDraft. Upload state (pending/uploading/...) is carried on
266
- * `FileComposerAttachment.status`, so sharing the array is enough.
267
- */
268
- externalAttachments?: {
269
- value: FileComposerAttachment[];
270
- setValue: (a: FileComposerAttachment[]) => void;
271
- };
272
- /** Tailwind class for the inner max-width wrapper. Defaults to `max-w-3xl`. */
273
- maxWidthClassName?: string;
274
- className?: string;
275
- innerClassName?: string;
276
- SkillStatusBarComponent?: ComponentType<SkillStatusBarComponentProps>;
277
- skillStatusBarClassName?: string;
278
- skillStatusBarInnerClassName?: string;
279
- onResyncSkills?: () => void;
280
- isResyncingSkills?: boolean;
281
- inputLabel?: string;
282
- /**
283
- * Opt-in: invoked when the user presses Escape twice quickly on the composer.
284
- * Undefined for all consumers except the skill editor's rewind gesture, so
285
- * the shared composer behaves identically to today when not provided. The
286
- * composer's bounding rect is passed so the caller can anchor a popover.
287
- */
288
- onDoubleEscape?: (anchorRect: DOMRect | null) => void;
289
- /** Opt-in faint hint shown over the empty composer (e.g. the Esc-Esc tip). */
290
- composerHint?: ReactNode;
291
- }
292
- type FileComposerAttachment = {
293
- id: string;
294
- kind: "file";
295
- name: string;
296
- size: number;
297
- mimeType: string;
298
- status: "pending" | "uploading" | "uploaded" | "failed";
299
- file?: File;
300
- uploadedPath?: string;
301
- textContent?: string | null;
302
- uploadProgress?: number | null;
303
- };
304
- declare function ChatInput({ onSend, onAppend, onStop, isStreaming, isStopping, mode, onToggleMode, renderAttachments, onBeforeSend, ensureSession, onCommand, canShareSession, slotAboveTextarea, externalDraft, externalAttachments, maxWidthClassName, className, innerClassName, SkillStatusBarComponent, skillStatusBarClassName, skillStatusBarInnerClassName, onResyncSkills, isResyncingSkills, inputLabel, onDoubleEscape, composerHint, }: Props$2): react_jsx_runtime.JSX.Element;
305
-
306
- interface ThinkingToggleProps {
307
- enabled: boolean;
308
- onChange: (enabled: boolean) => void;
309
- disabled?: boolean;
310
- }
311
- declare function ThinkingToggle({ enabled, onChange, disabled }: ThinkingToggleProps): react_jsx_runtime.JSX.Element;
312
-
313
- interface Props$1 {
314
- open: boolean;
315
- onOpenChange: (open: boolean) => void;
316
- files: OversizedFileInfo[];
317
- limitBytes?: number;
318
- }
319
- declare function FileSizeLimitDialog({ open, onOpenChange, files, limitBytes, }: Props$1): react.ReactPortal | null;
320
-
321
- interface Props {
322
- sessionId: string;
323
- messages: ChatMessage[];
324
- onAnswer?: (answer: string, toolCallId: string, answerData: AskUserAnswerData) => void;
325
- sessionStatus?: string;
326
- onConfirmPlan?: (action: "execute" | "revise", text?: string) => void;
327
- customization?: ChatViewCustomization;
328
- }
329
- declare function MessageList({ sessionId, messages: rawMessages, onAnswer, sessionStatus, onConfirmPlan, customization, }: Props): react_jsx_runtime.JSX.Element;
330
-
331
- declare function SkillStatusBar({ sessionId, onResync, isResyncing, vertical, className, innerClassName, }: {
332
- sessionId: string;
333
- onResync?: () => void;
334
- isResyncing?: boolean;
335
- vertical?: boolean;
336
- className?: string;
337
- innerClassName?: string;
338
- }): react_jsx_runtime.JSX.Element;
339
-
340
- export { type AssistantTurnComponentProps as A, type BuildWhatIfPromptInput as B, type ChatViewCustomization as C, ErrorMessageBlock as E, type FileComposerAttachment as F, MessageList as M, type OversizedFileInfo as O, type ParsedWhatIfPrompt as P, SkillStatusBar as S, ThinkingToggle as T, UserMessageBubble as U, type WhatIfQuote as W, ChatInput as a, type ChatSendOptions as b, ChatView as c, type ChatViewClassNames as d, type ChatViewComponents as e, type ChatViewProps as f, type ChatViewRenderers as g, FileSizeLimitDialog as h, type SkillStatusBarComponentProps as i, type ToolCallComponentProps as j, type ToolRendererProps as k, isErrorMessage as l, isUserMessage as m, type ClientAwareState as n, ATTACHMENT_SIZE_LIMIT_BYTES as o, buildWhatIfPrompt as p, formatFileSize as q, invalidateHomeSidebarSessions as r, parseWhatIfPrompt as s, splitFilesBySize as t, useSessionStore as u };