@aacpc/components 0.1.0 → 0.1.1
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/components/acp/agent-card.js +3 -3
- package/dist/components/acp/agent-form.js +5 -5
- package/dist/components/acp/chat-view.d.ts +1 -1
- package/dist/components/acp/chat-view.js +15 -15
- package/dist/components/acp/composer.js +3 -3
- package/dist/components/acp/cwd-picker.js +5 -5
- package/dist/components/acp/elicitation.js +5 -5
- package/dist/components/acp/index.d.ts +9 -9
- package/dist/components/acp/index.js +9 -9
- package/dist/components/acp/markdown.js +2 -2
- package/dist/components/acp/session-config.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/package.json +2 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { CheckCircle2, Plus, Power, RefreshCw, Settings2, Trash2, XCircle } from "lucide-react";
|
|
3
|
-
import { Badge } from "../ui/badge";
|
|
4
|
-
import { Button } from "../ui/button";
|
|
5
|
-
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, } from "../ui/card";
|
|
3
|
+
import { Badge } from "../ui/badge.js";
|
|
4
|
+
import { Button } from "../ui/button.js";
|
|
5
|
+
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, } from "../ui/card.js";
|
|
6
6
|
export function AcpAgentCard({ agent, testing, onNewSession, onTest, onEdit, onDelete, onKill, killing, }) {
|
|
7
7
|
return (_jsxs(Card, { children: [_jsx(CardHeader, { children: _jsx("div", { className: "flex items-start justify-between gap-3", children: _jsxs("div", { className: "min-w-0", children: [_jsxs(CardTitle, { className: "flex items-center gap-2", children: [_jsx("span", { className: "truncate", children: agent.name }), agent.detected ? (_jsxs(Badge, { variant: "secondary", children: [_jsx(CheckCircle2, { "data-icon": "inline-start" }), "\u5DF2\u5B89\u88C5"] })) : (_jsxs(Badge, { variant: "outline", children: [_jsx(XCircle, { "data-icon": "inline-start" }), "\u672A\u68C0\u6D4B\u5230"] }))] }), _jsx(CardDescription, { className: "mt-1 line-clamp-2", children: agent.description || "自定义 ACP agent" }), agent.sessions !== undefined ? (_jsxs("p", { className: "mt-1 text-xs text-muted-foreground", children: [agent.sessions, " \u4E2A\u4F1A\u8BDD", agent.running ? " · " + agent.running + " 个运行中" : ""] })) : null] }) }) }), _jsxs(CardContent, { className: "flex flex-col gap-2", children: [_jsx("code", { className: "truncate rounded-md bg-muted px-2 py-1 font-mono text-xs", children: [agent.command, ...agent.args].join(" ") }), agent.defaultModel || agent.defaultMode ? (_jsxs("p", { className: "truncate text-xs text-muted-foreground", children: ["\u9ED8\u8BA4", agent.defaultModel ? "模型 " + agent.defaultModel : "", agent.defaultModel && agent.defaultMode ? " · " : "", agent.defaultMode ? "模式 " + agent.defaultMode : ""] })) : null, agent.resolvedPath ? (_jsx("p", { className: "truncate text-xs text-muted-foreground", children: agent.resolvedPath })) : agent.installHint ? (_jsxs("p", { className: "text-xs text-muted-foreground", children: ["\u5B89\u88C5\uFF1A", agent.installHint] })) : null] }), _jsxs(CardFooter, { className: "flex flex-wrap gap-2", children: [_jsxs(Button, { size: "sm", onClick: () => onNewSession(agent.id), isDisabled: !agent.detected, children: [_jsx(Plus, { "data-icon": "inline-start" }), "\u65B0\u5EFA\u4F1A\u8BDD"] }), _jsxs(Button, { size: "sm", variant: "outline", onClick: () => onTest(agent.id), isDisabled: testing, children: [_jsx(RefreshCw, { "data-icon": "inline-start", className: testing ? "animate-spin" : undefined }), "\u6D4B\u8BD5"] }), _jsxs(Button, { size: "sm", variant: "ghost", onClick: () => onKill(agent.id), isDisabled: killing || !agent.detected, children: [_jsx(Power, { "data-icon": "inline-start" }), "\u7EC8\u6B62"] }), _jsxs(Button, { size: "sm", variant: "ghost", onClick: () => onEdit(agent.id), children: [_jsx(Settings2, { "data-icon": "inline-start" }), "\u7F16\u8F91"] }), _jsxs(Button, { size: "sm", variant: "ghost", className: "text-destructive", onClick: () => onDelete(agent.id), children: [_jsx(Trash2, { "data-icon": "inline-start" }), "\u5220\u9664"] })] })] }));
|
|
8
8
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
|
-
import { Button } from "../ui/button";
|
|
4
|
-
import { Dialog, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from "../ui/dialog";
|
|
5
|
-
import { Field, FieldGroup, FieldLabel } from "../ui/field";
|
|
6
|
-
import { Input } from "../ui/input";
|
|
7
|
-
import { Textarea } from "../ui/textarea";
|
|
3
|
+
import { Button } from "../ui/button.js";
|
|
4
|
+
import { Dialog, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from "../ui/dialog.js";
|
|
5
|
+
import { Field, FieldGroup, FieldLabel } from "../ui/field.js";
|
|
6
|
+
import { Input } from "../ui/input.js";
|
|
7
|
+
import { Textarea } from "../ui/textarea.js";
|
|
8
8
|
const EMPTY = {
|
|
9
9
|
name: "",
|
|
10
10
|
description: "",
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Brain, CheckCircle2, Circle, FileText, Globe, Loader2, Pencil, Search, Terminal, Trash2, Wrench, XCircle, } from "lucide-react";
|
|
3
|
-
import { Alert, AlertDescription, AlertTitle } from "../ui/alert";
|
|
4
|
-
import { Badge } from "../ui/badge";
|
|
5
|
-
import { Bubble, BubbleContent } from "../ui/bubble";
|
|
6
|
-
import { Button } from "../ui/button";
|
|
7
|
-
import { Card, CardContent, CardHeader, CardTitle } from "../ui/card";
|
|
8
|
-
import { CodeBlock, CodeBlockContent, CodeBlockHeader, CodeBlockTitle, } from "../ui/code-block";
|
|
9
|
-
import { Empty, EmptyDescription, EmptyHeader, EmptyTitle, } from "../ui/empty";
|
|
10
|
-
import { Item, ItemActions, ItemContent, ItemDescription, ItemMedia, ItemTitle, } from "../ui/item";
|
|
11
|
-
import { Message, MessageContent } from "../ui/message";
|
|
12
|
-
import { MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport, } from "../ui/message-scroller";
|
|
13
|
-
import { Progress, ProgressLabel, ProgressValue } from "../ui/progress";
|
|
14
|
-
import { Spinner } from "../ui/spinner";
|
|
15
|
-
import { Trace, TraceCollapsible, TraceCollapsibleContent, TraceCollapsibleTrigger, TraceDescription, TraceIcon, TraceLine, TraceTitle, } from "../ui/trace";
|
|
16
|
-
import { cn } from "../../lib/utils";
|
|
17
|
-
import { AcpMarkdown } from "./markdown";
|
|
3
|
+
import { Alert, AlertDescription, AlertTitle } from "../ui/alert.js";
|
|
4
|
+
import { Badge } from "../ui/badge.js";
|
|
5
|
+
import { Bubble, BubbleContent } from "../ui/bubble.js";
|
|
6
|
+
import { Button } from "../ui/button.js";
|
|
7
|
+
import { Card, CardContent, CardHeader, CardTitle } from "../ui/card.js";
|
|
8
|
+
import { CodeBlock, CodeBlockContent, CodeBlockHeader, CodeBlockTitle, } from "../ui/code-block.js";
|
|
9
|
+
import { Empty, EmptyDescription, EmptyHeader, EmptyTitle, } from "../ui/empty.js";
|
|
10
|
+
import { Item, ItemActions, ItemContent, ItemDescription, ItemMedia, ItemTitle, } from "../ui/item.js";
|
|
11
|
+
import { Message, MessageContent } from "../ui/message.js";
|
|
12
|
+
import { MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport, } from "../ui/message-scroller.js";
|
|
13
|
+
import { Progress, ProgressLabel, ProgressValue } from "../ui/progress.js";
|
|
14
|
+
import { Spinner } from "../ui/spinner.js";
|
|
15
|
+
import { Trace, TraceCollapsible, TraceCollapsibleContent, TraceCollapsibleTrigger, TraceDescription, TraceIcon, TraceLine, TraceTitle, } from "../ui/trace.js";
|
|
16
|
+
import { cn } from "../../lib/utils.js";
|
|
17
|
+
import { AcpMarkdown } from "./markdown.js";
|
|
18
18
|
export function AcpChatView({ items, permissions, prompting, showThoughts = true, defaultToolExpanded = false, onAnswerPermission, }) {
|
|
19
19
|
const visibleItems = showThoughts
|
|
20
20
|
? items
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { ArrowUp, Square } from "lucide-react";
|
|
3
|
-
import { Button } from "../ui/button";
|
|
4
|
-
import { Textarea } from "../ui/textarea";
|
|
5
|
-
import { cn } from "../../lib/utils";
|
|
3
|
+
import { Button } from "../ui/button.js";
|
|
4
|
+
import { Textarea } from "../ui/textarea.js";
|
|
5
|
+
import { cn } from "../../lib/utils.js";
|
|
6
6
|
export function AcpComposer({ value, onChange, onSend, onStop, prompting, disabled = false, placeholder = "输入任务,Enter 发送,Shift+Enter 换行", }) {
|
|
7
7
|
const canSend = value.trim().length > 0 && !disabled && !prompting;
|
|
8
8
|
return (_jsx("div", { className: "mx-auto w-full max-w-3xl px-4 pb-4", children: _jsxs("div", { className: cn("flex flex-col gap-2 rounded-2xl border bg-card p-3 shadow-sm transition-colors", "focus-within:border-ring focus-within:ring-[3px] focus-within:ring-ring/30"), children: [_jsx(Textarea, { value: value, onChange: (event) => onChange(event.target.value), onKeyDown: (event) => {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
3
|
import { ArrowUp, Folder, HardDrive } from "lucide-react";
|
|
4
|
-
import { Button } from "../ui/button";
|
|
5
|
-
import { Dialog, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from "../ui/dialog";
|
|
6
|
-
import { Input } from "../ui/input";
|
|
7
|
-
import { ScrollArea } from "../ui/scroll-area";
|
|
8
|
-
import { Spinner } from "../ui/spinner";
|
|
4
|
+
import { Button } from "../ui/button.js";
|
|
5
|
+
import { Dialog, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from "../ui/dialog.js";
|
|
6
|
+
import { Input } from "../ui/input.js";
|
|
7
|
+
import { ScrollArea } from "../ui/scroll-area.js";
|
|
8
|
+
import { Spinner } from "../ui/spinner.js";
|
|
9
9
|
export function AcpCwdPicker({ open, value, onOpenChange, onChange, loadDirs, }) {
|
|
10
10
|
const [data, setData] = useState(null);
|
|
11
11
|
const [path, setPath] = useState(value);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from "react";
|
|
3
3
|
import { ExternalLink } from "lucide-react";
|
|
4
|
-
import { Button } from "../ui/button";
|
|
5
|
-
import { Dialog, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from "../ui/dialog";
|
|
6
|
-
import { Field, FieldLabel } from "../ui/field";
|
|
7
|
-
import { Input } from "../ui/input";
|
|
8
|
-
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "../ui/select";
|
|
4
|
+
import { Button } from "../ui/button.js";
|
|
5
|
+
import { Dialog, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from "../ui/dialog.js";
|
|
6
|
+
import { Field, FieldLabel } from "../ui/field.js";
|
|
7
|
+
import { Input } from "../ui/input.js";
|
|
8
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "../ui/select.js";
|
|
9
9
|
export function AcpElicitationDialog({ request, onReply }) {
|
|
10
10
|
const [values, setValues] = useState({});
|
|
11
11
|
if (!request)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export * from "./types";
|
|
2
|
-
export * from "./markdown";
|
|
3
|
-
export * from "./chat-view";
|
|
4
|
-
export * from "./composer";
|
|
5
|
-
export * from "./agent-card";
|
|
6
|
-
export * from "./agent-form";
|
|
7
|
-
export * from "./cwd-picker";
|
|
8
|
-
export * from "./session-config";
|
|
9
|
-
export * from "./elicitation";
|
|
1
|
+
export * from "./types.js";
|
|
2
|
+
export * from "./markdown.js";
|
|
3
|
+
export * from "./chat-view.js";
|
|
4
|
+
export * from "./composer.js";
|
|
5
|
+
export * from "./agent-card.js";
|
|
6
|
+
export * from "./agent-form.js";
|
|
7
|
+
export * from "./cwd-picker.js";
|
|
8
|
+
export * from "./session-config.js";
|
|
9
|
+
export * from "./elicitation.js";
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export * from "./types";
|
|
2
|
-
export * from "./markdown";
|
|
3
|
-
export * from "./chat-view";
|
|
4
|
-
export * from "./composer";
|
|
5
|
-
export * from "./agent-card";
|
|
6
|
-
export * from "./agent-form";
|
|
7
|
-
export * from "./cwd-picker";
|
|
8
|
-
export * from "./session-config";
|
|
9
|
-
export * from "./elicitation";
|
|
1
|
+
export * from "./types.js";
|
|
2
|
+
export * from "./markdown.js";
|
|
3
|
+
export * from "./chat-view.js";
|
|
4
|
+
export * from "./composer.js";
|
|
5
|
+
export * from "./agent-card.js";
|
|
6
|
+
export * from "./agent-form.js";
|
|
7
|
+
export * from "./cwd-picker.js";
|
|
8
|
+
export * from "./session-config.js";
|
|
9
|
+
export * from "./elicitation.js";
|
|
10
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Streamdown } from "streamdown";
|
|
3
|
-
import { cn } from "../../lib/utils";
|
|
4
|
-
import { useTypewriter } from "./use-typewriter";
|
|
3
|
+
import { cn } from "../../lib/utils.js";
|
|
4
|
+
import { useTypewriter } from "./use-typewriter.js";
|
|
5
5
|
export function AcpMarkdown({ children, streaming = false, animate = false, className, }) {
|
|
6
6
|
const { text, typing } = useTypewriter(children, animate);
|
|
7
7
|
const active = streaming || typing;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "../ui/select";
|
|
2
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "../ui/select.js";
|
|
3
3
|
function flatten(options) {
|
|
4
4
|
if (!options)
|
|
5
5
|
return [];
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { cn } from "./lib/utils";
|
|
2
|
-
export * from "./components/acp";
|
|
1
|
+
export { cn } from "./lib/utils.js";
|
|
2
|
+
export * from "./components/acp/index.js";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { cn } from "./lib/utils";
|
|
2
|
-
export * from "./components/acp";
|
|
1
|
+
export { cn } from "./lib/utils.js";
|
|
2
|
+
export * from "./components/acp/index.js";
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aacpc/components",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "AACPC UI components — shadcn/ui (aria-maia)",
|
|
6
6
|
"type": "module",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
|
-
"build": "tsc -p tsconfig.build.json && node -e \"const fs=require('fs');fs.mkdirSync('dist',{recursive:true});fs.copyFileSync('src/styles/globals.css','dist/styles.css')\"",
|
|
31
|
+
"build": "tsc -p tsconfig.build.json && node -e \"const fs=require('fs');fs.mkdirSync('dist',{recursive:true});fs.copyFileSync('src/styles/globals.css','dist/styles.css')\" && node scripts/fix-esm-imports.mjs",
|
|
32
32
|
"typecheck": "tsc --noEmit",
|
|
33
33
|
"lint": "oxlint src",
|
|
34
34
|
"format": "prettier --write \"src/**/*.{ts,tsx,css}\""
|