@blade-hq/agent-kit 1.0.0 → 1.0.2
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.
- package/dist/{SkillStatusBar-Dp93pqlP.d.ts → SkillStatusBar-dAc3k2rZ.d.ts} +2 -2
- package/dist/{blade-client-DS7lV19a.d.ts → blade-client-BDKe7LRv.d.ts} +25 -3
- package/dist/{chunk-LVWRKH45.js → chunk-6PKGWPIK.js} +2 -2
- package/dist/{chunk-DQXXSHCR.js → chunk-DN4CKDDQ.js} +46 -5
- package/dist/chunk-DN4CKDDQ.js.map +1 -0
- package/dist/{chunk-OVOZQHYQ.js → chunk-HRQSJO3P.js} +45 -6
- package/dist/chunk-HRQSJO3P.js.map +1 -0
- package/dist/{chunk-IRHXGYY3.js → chunk-O5FJLN6G.js} +3 -3
- package/dist/{chunk-KSYNFNF4.js → chunk-QMYGPQCX.js} +2 -2
- package/dist/{chunk-II2PTBJI.js → chunk-U7Y7GRF6.js} +145 -17
- package/dist/chunk-U7Y7GRF6.js.map +1 -0
- package/dist/client/index.d.ts +1422 -149
- package/dist/client/index.js +1 -1
- package/dist/react/api/vibe-coding.d.ts +3 -3
- package/dist/react/api/vibe-coding.js +2 -2
- package/dist/react/components/chat/index.d.ts +4 -4
- package/dist/react/components/chat/index.js +5 -5
- package/dist/react/components/plan/index.js +4 -4
- package/dist/react/components/session/index.d.ts +1 -1
- package/dist/react/components/session/index.js +3 -3
- package/dist/react/components/workspace/index.d.ts +3 -3
- package/dist/react/components/workspace/index.js +140 -129
- package/dist/react/components/workspace/index.js.map +1 -1
- package/dist/react/index.d.ts +37 -10
- package/dist/react/index.js +49 -16
- package/dist/react/index.js.map +1 -1
- package/dist/{session-B5v5KkVd.d.ts → session-o8bAQoXK.d.ts} +11 -1
- package/dist/{sessions-DaddUdO6.d.ts → sessions-D_cIKSO6.d.ts} +2 -2
- package/package.json +1 -1
- package/dist/chunk-DQXXSHCR.js.map +0 -1
- package/dist/chunk-II2PTBJI.js.map +0 -1
- package/dist/chunk-OVOZQHYQ.js.map +0 -1
- /package/dist/{chunk-LVWRKH45.js.map → chunk-6PKGWPIK.js.map} +0 -0
- /package/dist/{chunk-IRHXGYY3.js.map → chunk-O5FJLN6G.js.map} +0 -0
- /package/dist/{chunk-KSYNFNF4.js.map → chunk-QMYGPQCX.js.map} +0 -0
package/dist/client/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { V as VibeCodingResource, C as CreateVibeCodingSessionResult, a as VibeCodingDeployStatus, b as VibeCodingDebugSessionStatus, c as VibeCodingSessionStatus, d as VibeCodingDeployRecord, e as VibeCodingSessionInfo } from '../../blade-client-
|
|
2
|
-
export { f as CreateVibeCodingSessionParams, D as DeployBumpMode, P as PortMapping } from '../../blade-client-
|
|
1
|
+
import { V as VibeCodingResource, C as CreateVibeCodingSessionResult, a as VibeCodingDeployStatus, b as VibeCodingDebugSessionStatus, c as VibeCodingSessionStatus, d as VibeCodingDeployRecord, e as VibeCodingSessionInfo } from '../../blade-client-BDKe7LRv.js';
|
|
2
|
+
export { f as CreateVibeCodingSessionParams, D as DeployBumpMode, P as PortMapping } from '../../blade-client-BDKe7LRv.js';
|
|
3
3
|
import 'arktype/internal/variants/object.ts';
|
|
4
4
|
import 'arktype/internal/variants/string.ts';
|
|
5
5
|
import '../../projection-BWYEFYNn.js';
|
|
6
|
-
import '../../session-
|
|
6
|
+
import '../../session-o8bAQoXK.js';
|
|
7
7
|
import 'socket.io-client';
|
|
8
8
|
|
|
9
9
|
declare const createVibeCodingSession: (...args: Parameters<VibeCodingResource["createVibeCodingSession"]>) => Promise<CreateVibeCodingSessionResult>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getClient
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-U7Y7GRF6.js";
|
|
4
4
|
import "../../chunk-J3XVFPOV.js";
|
|
5
|
-
import "../../chunk-
|
|
5
|
+
import "../../chunk-DN4CKDDQ.js";
|
|
6
6
|
import "../../chunk-JCJFFJ42.js";
|
|
7
7
|
import "../../chunk-PZ5AY32C.js";
|
|
8
8
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ChatViewCustomization, P as ParsedWhatIfPrompt } from '../../../SkillStatusBar-
|
|
2
|
-
export { A as AssistantTurnComponentProps, a as ChatInput, b as ChatView, c as ChatViewClassNames, d as ChatViewComponents, e as ChatViewProps, f as ChatViewRenderers, E as ErrorMessageBlock, F as FileComposerAttachment, g as FileSizeLimitDialog, M as MessageList, S as SkillStatusBar, h as SkillStatusBarComponentProps, T as ToolCallComponentProps, i as ToolRendererProps, U as UserMessageBubble, j as isErrorMessage, k as isUserMessage } from '../../../SkillStatusBar-
|
|
1
|
+
import { C as ChatViewCustomization, P as ParsedWhatIfPrompt } from '../../../SkillStatusBar-dAc3k2rZ.js';
|
|
2
|
+
export { A as AssistantTurnComponentProps, a as ChatInput, b as ChatView, c as ChatViewClassNames, d as ChatViewComponents, e as ChatViewProps, f as ChatViewRenderers, E as ErrorMessageBlock, F as FileComposerAttachment, g as FileSizeLimitDialog, M as MessageList, S as SkillStatusBar, h as SkillStatusBarComponentProps, T as ToolCallComponentProps, i as ToolRendererProps, U as UserMessageBubble, j as isErrorMessage, k as isUserMessage } from '../../../SkillStatusBar-dAc3k2rZ.js';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import { ReactNode } from 'react';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
@@ -7,10 +7,10 @@ import { a as CompactionInfo, C as ChatMessage, A as AskUserAnswerData, T as Too
|
|
|
7
7
|
export { b as AskUserQuestionBlock } from '../../../AskUserQuestionBlock---kOTouk.js';
|
|
8
8
|
import { C as ContentBlock } from '../../../projection-BWYEFYNn.js';
|
|
9
9
|
import 'zustand';
|
|
10
|
-
import '../../../session-
|
|
10
|
+
import '../../../session-o8bAQoXK.js';
|
|
11
11
|
import 'arktype/internal/variants/object.ts';
|
|
12
12
|
import 'arktype/internal/variants/string.ts';
|
|
13
|
-
import '../../../blade-client-
|
|
13
|
+
import '../../../blade-client-BDKe7LRv.js';
|
|
14
14
|
import 'socket.io-client';
|
|
15
15
|
|
|
16
16
|
/**
|
|
@@ -16,16 +16,16 @@ import {
|
|
|
16
16
|
isErrorMessage,
|
|
17
17
|
isUserMessage,
|
|
18
18
|
useWhatIfQuoteContext
|
|
19
|
-
} from "../../../chunk-
|
|
19
|
+
} from "../../../chunk-HRQSJO3P.js";
|
|
20
20
|
import {
|
|
21
21
|
AskUserQuestionBlock
|
|
22
|
-
} from "../../../chunk-
|
|
22
|
+
} from "../../../chunk-O5FJLN6G.js";
|
|
23
23
|
import "../../../chunk-2UP7MG3J.js";
|
|
24
24
|
import "../../../chunk-H62LH2AG.js";
|
|
25
|
-
import "../../../chunk-
|
|
26
|
-
import "../../../chunk-
|
|
25
|
+
import "../../../chunk-6PKGWPIK.js";
|
|
26
|
+
import "../../../chunk-U7Y7GRF6.js";
|
|
27
27
|
import "../../../chunk-J3XVFPOV.js";
|
|
28
|
-
import "../../../chunk-
|
|
28
|
+
import "../../../chunk-DN4CKDDQ.js";
|
|
29
29
|
import "../../../chunk-7LEKQI47.js";
|
|
30
30
|
import "../../../chunk-JCJFFJ42.js";
|
|
31
31
|
import "../../../chunk-PZ5AY32C.js";
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
PlanSummaryCard,
|
|
4
4
|
extractLatestPlanMessages,
|
|
5
5
|
parsePlanMessages
|
|
6
|
-
} from "../../../chunk-
|
|
6
|
+
} from "../../../chunk-O5FJLN6G.js";
|
|
7
7
|
import "../../../chunk-2UP7MG3J.js";
|
|
8
|
-
import "../../../chunk-
|
|
9
|
-
import "../../../chunk-
|
|
8
|
+
import "../../../chunk-6PKGWPIK.js";
|
|
9
|
+
import "../../../chunk-U7Y7GRF6.js";
|
|
10
10
|
import "../../../chunk-J3XVFPOV.js";
|
|
11
|
-
import "../../../chunk-
|
|
11
|
+
import "../../../chunk-DN4CKDDQ.js";
|
|
12
12
|
import {
|
|
13
13
|
cn
|
|
14
14
|
} from "../../../chunk-7LEKQI47.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { a as SessionInfo } from '../../../session-
|
|
2
|
+
import { a as SessionInfo } from '../../../session-o8bAQoXK.js';
|
|
3
3
|
import 'arktype/internal/variants/object.ts';
|
|
4
4
|
import 'arktype/internal/variants/string.ts';
|
|
5
5
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useSession
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-QMYGPQCX.js";
|
|
4
4
|
import {
|
|
5
5
|
checkoutSession,
|
|
6
6
|
getSessionCheckpoints,
|
|
7
7
|
useChatStore,
|
|
8
8
|
useSessionStore
|
|
9
|
-
} from "../../../chunk-
|
|
9
|
+
} from "../../../chunk-U7Y7GRF6.js";
|
|
10
10
|
import "../../../chunk-J3XVFPOV.js";
|
|
11
|
-
import "../../../chunk-
|
|
11
|
+
import "../../../chunk-DN4CKDDQ.js";
|
|
12
12
|
import {
|
|
13
13
|
cn
|
|
14
14
|
} from "../../../chunk-7LEKQI47.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { l as listDir } from '../../../sessions-
|
|
4
|
-
import '../../../blade-client-
|
|
3
|
+
import { l as listDir } from '../../../sessions-D_cIKSO6.js';
|
|
4
|
+
import '../../../blade-client-BDKe7LRv.js';
|
|
5
5
|
import 'arktype/internal/variants/object.ts';
|
|
6
6
|
import 'arktype/internal/variants/string.ts';
|
|
7
7
|
import '../../../projection-BWYEFYNn.js';
|
|
8
|
-
import '../../../session-
|
|
8
|
+
import '../../../session-o8bAQoXK.js';
|
|
9
9
|
import 'socket.io-client';
|
|
10
10
|
|
|
11
11
|
interface WorkspaceFileEntry {
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
} from "../../../chunk-H62LH2AG.js";
|
|
6
6
|
import {
|
|
7
7
|
resolveSessionFilePreviewTarget
|
|
8
|
-
} from "../../../chunk-
|
|
8
|
+
} from "../../../chunk-6PKGWPIK.js";
|
|
9
9
|
import {
|
|
10
10
|
apiFetchText,
|
|
11
11
|
copyFile,
|
|
@@ -19,9 +19,9 @@ import {
|
|
|
19
19
|
useChatStore,
|
|
20
20
|
useSessionStore,
|
|
21
21
|
useUiStore
|
|
22
|
-
} from "../../../chunk-
|
|
22
|
+
} from "../../../chunk-U7Y7GRF6.js";
|
|
23
23
|
import "../../../chunk-J3XVFPOV.js";
|
|
24
|
-
import "../../../chunk-
|
|
24
|
+
import "../../../chunk-DN4CKDDQ.js";
|
|
25
25
|
import {
|
|
26
26
|
cn
|
|
27
27
|
} from "../../../chunk-7LEKQI47.js";
|
|
@@ -560,138 +560,149 @@ function FolderNode({
|
|
|
560
560
|
}
|
|
561
561
|
};
|
|
562
562
|
return /* @__PURE__ */ jsx2(Collapsible, { open: isExpanded, onOpenChange: () => onToggleDir(entry.path), children: /* @__PURE__ */ jsxs2("div", { children: [
|
|
563
|
-
/* @__PURE__ */ jsxs2(
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
563
|
+
/* @__PURE__ */ jsxs2(
|
|
564
|
+
"div",
|
|
565
|
+
{
|
|
566
|
+
className: cn(TREE_ROW_CLASS, isSelected && "bg-muted"),
|
|
567
|
+
draggable: !isRenaming,
|
|
568
|
+
onDragStart: (e) => {
|
|
569
|
+
e.dataTransfer.setData("application/blade-file-ref", JSON.stringify({ path: entry.path, name: entry.name }));
|
|
570
|
+
e.dataTransfer.effectAllowed = "copy";
|
|
571
|
+
},
|
|
572
|
+
children: [
|
|
573
|
+
/* @__PURE__ */ jsx2(CollapsibleTrigger, { asChild: true, children: /* @__PURE__ */ jsx2(
|
|
574
|
+
"button",
|
|
572
575
|
{
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
+
type: "button",
|
|
577
|
+
className: "flex shrink-0 cursor-pointer items-center rounded border-none bg-transparent p-0",
|
|
578
|
+
title: isExpanded ? "\u6536\u8D77\u76EE\u5F55" : "\u5C55\u5F00\u76EE\u5F55",
|
|
579
|
+
children: /* @__PURE__ */ jsx2(
|
|
580
|
+
ChevronRight,
|
|
581
|
+
{
|
|
582
|
+
className: cn(
|
|
583
|
+
"size-5 shrink-0 text-[hsl(var(--muted-foreground))] transition-transform",
|
|
584
|
+
isExpanded && "rotate-90"
|
|
585
|
+
)
|
|
586
|
+
}
|
|
576
587
|
)
|
|
577
588
|
}
|
|
578
|
-
)
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
589
|
+
) }),
|
|
590
|
+
isRenaming ? /* @__PURE__ */ jsxs2(Fragment2, { children: [
|
|
591
|
+
/* @__PURE__ */ jsx2(FileTreeIcon, { children: getFolderIcon() }),
|
|
592
|
+
/* @__PURE__ */ jsx2(
|
|
593
|
+
"input",
|
|
594
|
+
{
|
|
595
|
+
ref: renameInputRef,
|
|
596
|
+
value: renamingValue,
|
|
597
|
+
className: "h-6 min-w-0 flex-1 rounded border border-[hsl(var(--border))] bg-background px-2 text-xs outline-none ring-offset-background focus-visible:ring-1 focus-visible:ring-[hsl(var(--ring))]",
|
|
598
|
+
disabled: activeAction === "rename",
|
|
599
|
+
onBlur: () => void finishRename(),
|
|
600
|
+
onChange: (event) => setRenamingValue(event.target.value),
|
|
601
|
+
onClick: (event) => event.stopPropagation(),
|
|
602
|
+
onKeyDown: (event) => {
|
|
603
|
+
event.stopPropagation();
|
|
604
|
+
if (event.key === "Enter") {
|
|
605
|
+
event.preventDefault();
|
|
606
|
+
void finishRename();
|
|
607
|
+
} else if (event.key === "Escape") {
|
|
608
|
+
event.preventDefault();
|
|
609
|
+
cancelRename();
|
|
610
|
+
}
|
|
611
|
+
}
|
|
601
612
|
}
|
|
613
|
+
)
|
|
614
|
+
] }) : /* @__PURE__ */ jsxs2(
|
|
615
|
+
"button",
|
|
616
|
+
{
|
|
617
|
+
type: "button",
|
|
618
|
+
className: "flex min-w-0 flex-1 cursor-pointer items-center gap-1 border-none bg-transparent p-0 text-left",
|
|
619
|
+
onClick: () => {
|
|
620
|
+
onToggleDir(entry.path);
|
|
621
|
+
onSelectPath(entry.path);
|
|
622
|
+
},
|
|
623
|
+
children: [
|
|
624
|
+
/* @__PURE__ */ jsx2(FileTreeIcon, { children: getFolderIcon() }),
|
|
625
|
+
/* @__PURE__ */ jsx2(FileTreeName, { className: "min-w-0 flex-1", children: entry.name }),
|
|
626
|
+
isCurrentSessionDir ? /* @__PURE__ */ jsx2("span", { className: "shrink-0 rounded-full bg-emerald-100 px-2 py-[2px] text-[11px] font-medium leading-[14px] text-emerald-700", children: "\u5F53\u524D\u5BF9\u8BDD" }) : null
|
|
627
|
+
]
|
|
602
628
|
}
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
/* @__PURE__ */ jsx2(FileTreeName, { className: "min-w-0 flex-1", children: entry.name }),
|
|
617
|
-
isCurrentSessionDir ? /* @__PURE__ */ jsx2("span", { className: "shrink-0 rounded-full bg-emerald-100 px-2 py-[2px] text-[11px] font-medium leading-[14px] text-emerald-700", children: "\u5F53\u524D\u5BF9\u8BDD" }) : null
|
|
618
|
-
]
|
|
619
|
-
}
|
|
620
|
-
),
|
|
621
|
-
!readOnly ? /* @__PURE__ */ jsxs2(FileTreeActions, { className: "ml-auto hidden shrink-0 group-hover:flex", children: [
|
|
622
|
-
/* @__PURE__ */ jsx2(
|
|
623
|
-
TreeActionButton,
|
|
624
|
-
{
|
|
625
|
-
onClick: () => {
|
|
626
|
-
const anchor = document.createElement("a");
|
|
627
|
-
anchor.href = downloadUrl;
|
|
628
|
-
anchor.download = `${entry.name}.zip`;
|
|
629
|
-
anchor.click();
|
|
630
|
-
},
|
|
631
|
-
title: "\u4E0B\u8F7D\u76EE\u5F55",
|
|
632
|
-
children: /* @__PURE__ */ jsx2(Download, { size: 12 })
|
|
633
|
-
}
|
|
634
|
-
),
|
|
635
|
-
/* @__PURE__ */ jsx2(
|
|
636
|
-
TreeActionButton,
|
|
637
|
-
{
|
|
638
|
-
disabled: activeAction !== null,
|
|
639
|
-
onClick: () => {
|
|
640
|
-
onSelectPath(entry.path);
|
|
641
|
-
setRenamingValue(entry.name);
|
|
642
|
-
setIsRenaming(true);
|
|
643
|
-
},
|
|
644
|
-
title: "\u91CD\u547D\u540D",
|
|
645
|
-
children: activeAction === "rename" ? /* @__PURE__ */ jsx2(Loader2, { size: 12, className: "animate-spin" }) : /* @__PURE__ */ jsx2(Pencil, { size: 12 })
|
|
646
|
-
}
|
|
647
|
-
),
|
|
648
|
-
/* @__PURE__ */ jsx2(
|
|
649
|
-
TreeActionButton,
|
|
650
|
-
{
|
|
651
|
-
disabled: activeAction !== null,
|
|
652
|
-
onClick: () => void handleCopy(),
|
|
653
|
-
title: "\u590D\u5236\u76EE\u5F55",
|
|
654
|
-
children: activeAction === "copy" ? /* @__PURE__ */ jsx2(Loader2, { size: 12, className: "animate-spin" }) : /* @__PURE__ */ jsx2(Copy, { size: 12 })
|
|
655
|
-
}
|
|
656
|
-
),
|
|
657
|
-
onShareFile ? /* @__PURE__ */ jsx2(
|
|
658
|
-
TreeActionButton,
|
|
659
|
-
{
|
|
660
|
-
disabled: activeAction !== null,
|
|
661
|
-
onClick: async () => {
|
|
662
|
-
setActiveAction("share");
|
|
663
|
-
try {
|
|
664
|
-
await onShareFile(entry.path, entry.name);
|
|
665
|
-
await queryClient.invalidateQueries({ queryKey: ["file-tree", sessionId] });
|
|
666
|
-
} catch (error) {
|
|
667
|
-
alert(getErrorMessage(error, "\u5171\u4EAB\u5931\u8D25"));
|
|
668
|
-
} finally {
|
|
669
|
-
setActiveAction(null);
|
|
629
|
+
),
|
|
630
|
+
!readOnly ? /* @__PURE__ */ jsxs2(FileTreeActions, { className: "ml-auto hidden shrink-0 group-hover:flex", children: [
|
|
631
|
+
/* @__PURE__ */ jsx2(
|
|
632
|
+
TreeActionButton,
|
|
633
|
+
{
|
|
634
|
+
onClick: () => {
|
|
635
|
+
const anchor = document.createElement("a");
|
|
636
|
+
anchor.href = downloadUrl;
|
|
637
|
+
anchor.download = `${entry.name}.zip`;
|
|
638
|
+
anchor.click();
|
|
639
|
+
},
|
|
640
|
+
title: "\u4E0B\u8F7D\u76EE\u5F55",
|
|
641
|
+
children: /* @__PURE__ */ jsx2(Download, { size: 12 })
|
|
670
642
|
}
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
643
|
+
),
|
|
644
|
+
/* @__PURE__ */ jsx2(
|
|
645
|
+
TreeActionButton,
|
|
646
|
+
{
|
|
647
|
+
disabled: activeAction !== null,
|
|
648
|
+
onClick: () => {
|
|
649
|
+
onSelectPath(entry.path);
|
|
650
|
+
setRenamingValue(entry.name);
|
|
651
|
+
setIsRenaming(true);
|
|
652
|
+
},
|
|
653
|
+
title: "\u91CD\u547D\u540D",
|
|
654
|
+
children: activeAction === "rename" ? /* @__PURE__ */ jsx2(Loader2, { size: 12, className: "animate-spin" }) : /* @__PURE__ */ jsx2(Pencil, { size: 12 })
|
|
655
|
+
}
|
|
656
|
+
),
|
|
657
|
+
/* @__PURE__ */ jsx2(
|
|
658
|
+
TreeActionButton,
|
|
659
|
+
{
|
|
660
|
+
disabled: activeAction !== null,
|
|
661
|
+
onClick: () => void handleCopy(),
|
|
662
|
+
title: "\u590D\u5236\u76EE\u5F55",
|
|
663
|
+
children: activeAction === "copy" ? /* @__PURE__ */ jsx2(Loader2, { size: 12, className: "animate-spin" }) : /* @__PURE__ */ jsx2(Copy, { size: 12 })
|
|
664
|
+
}
|
|
665
|
+
),
|
|
666
|
+
onShareFile ? /* @__PURE__ */ jsx2(
|
|
667
|
+
TreeActionButton,
|
|
668
|
+
{
|
|
669
|
+
disabled: activeAction !== null,
|
|
670
|
+
onClick: async () => {
|
|
671
|
+
setActiveAction("share");
|
|
672
|
+
try {
|
|
673
|
+
await onShareFile(entry.path, entry.name);
|
|
674
|
+
await queryClient.invalidateQueries({ queryKey: ["file-tree", sessionId] });
|
|
675
|
+
} catch (error) {
|
|
676
|
+
alert(getErrorMessage(error, "\u5171\u4EAB\u5931\u8D25"));
|
|
677
|
+
} finally {
|
|
678
|
+
setActiveAction(null);
|
|
679
|
+
}
|
|
680
|
+
},
|
|
681
|
+
title: "\u5171\u4EAB\u5230\u4EA7\u7269\u533A",
|
|
682
|
+
children: activeAction === "share" ? /* @__PURE__ */ jsx2(Loader2, { size: 12, className: "animate-spin" }) : /* @__PURE__ */ jsx2(Link2, { size: 12 })
|
|
683
|
+
}
|
|
684
|
+
) : null,
|
|
685
|
+
/* @__PURE__ */ jsx2(
|
|
686
|
+
TreeActionButton,
|
|
687
|
+
{
|
|
688
|
+
disabled: activeAction !== null,
|
|
689
|
+
onClick: () => void handleDelete(),
|
|
690
|
+
title: "\u5220\u9664\u76EE\u5F55",
|
|
691
|
+
children: activeAction === "delete" ? /* @__PURE__ */ jsx2(Loader2, { size: 12, className: "animate-spin" }) : /* @__PURE__ */ jsx2(Trash2, { size: 12 })
|
|
692
|
+
}
|
|
693
|
+
)
|
|
694
|
+
] }) : allowDelete ? /* @__PURE__ */ jsx2(FileTreeActions, { className: "ml-auto hidden shrink-0 group-hover:flex", children: /* @__PURE__ */ jsx2(
|
|
695
|
+
TreeActionButton,
|
|
696
|
+
{
|
|
697
|
+
disabled: activeAction !== null,
|
|
698
|
+
onClick: () => void handleDelete(),
|
|
699
|
+
title: "\u5220\u9664\u76EE\u5F55",
|
|
700
|
+
children: activeAction === "delete" ? /* @__PURE__ */ jsx2(Loader2, { size: 12, className: "animate-spin" }) : /* @__PURE__ */ jsx2(Trash2, { size: 12 })
|
|
701
|
+
}
|
|
702
|
+
) }) : null
|
|
703
|
+
]
|
|
704
|
+
}
|
|
705
|
+
),
|
|
695
706
|
/* @__PURE__ */ jsx2(CollapsibleContent, { children: /* @__PURE__ */ jsx2("div", { className: "ml-4 border-l pl-2", children: /* @__PURE__ */ jsx2(
|
|
696
707
|
LazyDirChildren,
|
|
697
708
|
{
|