@blade-hq/agent-kit 0.4.21 → 0.5.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.
@@ -8,13 +8,13 @@ import {
8
8
  getCodeLanguageFromFilename,
9
9
  parseAskUserQuestion,
10
10
  useHighlightedCodeHtml
11
- } from "./chunk-WZT2DOBJ.js";
11
+ } from "./chunk-2FTEBWEM.js";
12
12
  import {
13
13
  Collapsible,
14
14
  CollapsibleContent,
15
15
  CollapsibleTrigger,
16
16
  resolveSessionFilePreviewTarget
17
- } from "./chunk-47YVQZQ7.js";
17
+ } from "./chunk-CFZDKYT3.js";
18
18
  import {
19
19
  buildMessageContent,
20
20
  buildToolPreviewKey,
@@ -56,7 +56,7 @@ import {
56
56
  useUiBridgeStore,
57
57
  useUiStore,
58
58
  writeFile
59
- } from "./chunk-LKNU4NUC.js";
59
+ } from "./chunk-C7VSMOXN.js";
60
60
  import {
61
61
  registerBridgeIframe,
62
62
  tapBridgeEvent
@@ -3087,6 +3087,24 @@ function ChatInput({
3087
3087
  onDrop: (event) => {
3088
3088
  event.preventDefault();
3089
3089
  setDragging(false);
3090
+ const fileRef = event.dataTransfer.getData("application/blade-file-ref");
3091
+ if (fileRef) {
3092
+ try {
3093
+ const { path, name } = JSON.parse(fileRef);
3094
+ const normalizedPath = path.replace(/^\.?\//, "");
3095
+ const sandboxPath = path.startsWith("/") ? path : activeSessionId ? `/root/\u667A\u80FD\u52A9\u624B\u5DE5\u4F5C\u7A7A\u95F4/${activeSessionId}/${normalizedPath}` : normalizedPath;
3096
+ const editor2 = editorRef.current;
3097
+ if (editor2) {
3098
+ editor2.commands.focus("end");
3099
+ editor2.commands.insertContent([
3100
+ { type: "fileMention", attrs: { path: sandboxPath, name } },
3101
+ { type: "text", text: " " }
3102
+ ]);
3103
+ }
3104
+ } catch {
3105
+ }
3106
+ return;
3107
+ }
3090
3108
  void stableAppendFiles(event.dataTransfer.files);
3091
3109
  },
3092
3110
  children: /* @__PURE__ */ jsxs7(
@@ -3094,6 +3112,7 @@ function ChatInput({
3094
3112
  {
3095
3113
  className: `overflow-visible rounded-2xl border bg-[hsl(var(--card))] transition-[box-shadow,border-color] duration-300 ${isRecording ? "border-emerald-400/70! shadow-[0_0_0_3px_rgba(52,211,153,0.18),0_0_24px_rgba(52,211,153,0.28)]" : dragging ? isPlanning ? "border-amber-400/60" : "border-[hsl(var(--primary)/0.6)]" : isEditorFocused ? isPlanning ? "border-amber-400/60" : "border-[hsl(var(--primary)/0.6)]" : isPlanning ? "border-amber-400/30" : "border-[hsl(var(--border))]"}`,
3096
3114
  children: [
3115
+ dragging && /* @__PURE__ */ jsx8("div", { className: "pointer-events-none absolute inset-0 z-10 flex items-center justify-center rounded-2xl bg-[hsl(var(--primary)/0.06)]", children: /* @__PURE__ */ jsx8("span", { className: "rounded-full bg-[hsl(var(--primary)/0.12)] px-4 py-2 text-sm font-medium text-[hsl(var(--primary))]", children: "\u677E\u624B\u5F15\u7528\u6587\u4EF6" }) }),
3097
3116
  composerAttachments.length > 0 && /* @__PURE__ */ jsxs7("div", { className: "flex max-h-40 flex-col gap-2 overflow-y-auto border-b border-[hsl(var(--border))] px-3 py-2", children: [
3098
3117
  imageAttachments.length > 0 && /* @__PURE__ */ jsx8("div", { className: "grid grid-cols-3 gap-2", children: imageAttachments.map((attachment) => /* @__PURE__ */ jsxs7(
3099
3118
  "div",
@@ -8154,4 +8173,4 @@ use-stick-to-bottom/dist/StickToBottom.js:
8154
8173
  * Licensed under the MIT License. See License.txt in the project root for license information.
8155
8174
  *--------------------------------------------------------------------------------------------*)
8156
8175
  */
8157
- //# sourceMappingURL=chunk-RMLZ4ZBY.js.map
8176
+ //# sourceMappingURL=chunk-ZGM3H24C.js.map