@uniqueli/openwork 0.2.3 → 0.3.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.
@@ -96,6 +96,7 @@
96
96
  --spacing: .25rem;
97
97
  --container-md: 28rem;
98
98
  --container-lg: 32rem;
99
+ --container-2xl: 42rem;
99
100
  --container-3xl: 48rem;
100
101
  --text-xs: .75rem;
101
102
  --text-xs--line-height: calc(1 / .75);
@@ -489,6 +490,10 @@
489
490
  margin-top: calc(var(--spacing) * 2);
490
491
  }
491
492
 
493
+ .mt-6 {
494
+ margin-top: calc(var(--spacing) * 6);
495
+ }
496
+
492
497
  .mr-1 {
493
498
  margin-right: calc(var(--spacing) * 1);
494
499
  }
@@ -747,6 +752,10 @@
747
752
  max-height: 80vh;
748
753
  }
749
754
 
755
+ .max-h-\[90vh\] {
756
+ max-height: 90vh;
757
+ }
758
+
750
759
  .min-h-0 {
751
760
  min-height: calc(var(--spacing) * 0);
752
761
  }
@@ -843,6 +852,10 @@
843
852
  width: 1px;
844
853
  }
845
854
 
855
+ .max-w-2xl {
856
+ max-width: var(--container-2xl);
857
+ }
858
+
846
859
  .max-w-3xl {
847
860
  max-width: var(--container-3xl);
848
861
  }
@@ -1434,6 +1447,16 @@
1434
1447
  }
1435
1448
  }
1436
1449
 
1450
+ .bg-accent\/30 {
1451
+ background-color: var(--accent);
1452
+ }
1453
+
1454
+ @supports (color: color-mix(in lab, red, red)) {
1455
+ .bg-accent\/30 {
1456
+ background-color: color-mix(in oklab, var(--accent) 30%, transparent);
1457
+ }
1458
+ }
1459
+
1437
1460
  .bg-amber-500\/5 {
1438
1461
  background-color: #f99c000d;
1439
1462
  }
@@ -12785,6 +12785,24 @@ const Music = createLucideIcon("Music", [
12785
12785
  ["circle", { cx: "6", cy: "18", r: "3", key: "fqmcym" }],
12786
12786
  ["circle", { cx: "18", cy: "16", r: "3", key: "1hluhg" }]
12787
12787
  ]);
12788
+ const PenTool = createLucideIcon("PenTool", [
12789
+ [
12790
+ "path",
12791
+ {
12792
+ d: "M15.707 21.293a1 1 0 0 1-1.414 0l-1.586-1.586a1 1 0 0 1 0-1.414l5.586-5.586a1 1 0 0 1 1.414 0l1.586 1.586a1 1 0 0 1 0 1.414z",
12793
+ key: "nt11vn"
12794
+ }
12795
+ ],
12796
+ [
12797
+ "path",
12798
+ {
12799
+ d: "m18 13-1.375-6.874a1 1 0 0 0-.746-.776L3.235 2.028a1 1 0 0 0-1.207 1.207L5.35 15.879a1 1 0 0 0 .776.746L13 18",
12800
+ key: "15qc1e"
12801
+ }
12802
+ ],
12803
+ ["path", { d: "m2.3 2.3 7.286 7.286", key: "1wuzzi" }],
12804
+ ["circle", { cx: "11", cy: "11", r: "2", key: "xmgehs" }]
12805
+ ]);
12788
12806
  const Pencil = createLucideIcon("Pencil", [
12789
12807
  [
12790
12808
  "path",
@@ -75841,6 +75859,76 @@ function ContextUsageIndicator({
75841
75859
  ] }) })
75842
75860
  ] });
75843
75861
  }
75862
+ const Card = reactExports.forwardRef(
75863
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntimeExports.jsx(
75864
+ "div",
75865
+ {
75866
+ ref,
75867
+ className: cn("rounded-sm border border-border bg-card text-card-foreground", className),
75868
+ ...props
75869
+ }
75870
+ )
75871
+ );
75872
+ Card.displayName = "Card";
75873
+ const CardHeader = reactExports.forwardRef(
75874
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref, className: cn("flex flex-col space-y-1.5 p-4", className), ...props })
75875
+ );
75876
+ CardHeader.displayName = "CardHeader";
75877
+ const CardTitle = reactExports.forwardRef(
75878
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { ref, className: cn("text-section-header", className), ...props })
75879
+ );
75880
+ CardTitle.displayName = "CardTitle";
75881
+ const CardDescription = reactExports.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntimeExports.jsx("p", { ref, className: cn("text-sm text-muted-foreground", className), ...props }));
75882
+ CardDescription.displayName = "CardDescription";
75883
+ const CardContent = reactExports.forwardRef(
75884
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref, className: cn("p-4 pt-0", className), ...props })
75885
+ );
75886
+ CardContent.displayName = "CardContent";
75887
+ const CardFooter = reactExports.forwardRef(
75888
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref, className: cn("flex items-center p-4 pt-0", className), ...props })
75889
+ );
75890
+ CardFooter.displayName = "CardFooter";
75891
+ const ICON_MAP = {
75892
+ FolderOpen,
75893
+ PenTool,
75894
+ FileText
75895
+ };
75896
+ const DEFAULT_SUGGESTIONS = [
75897
+ {
75898
+ icon: "FolderOpen",
75899
+ title: "文件整理",
75900
+ description: "智能整理和管理本地文件"
75901
+ },
75902
+ {
75903
+ icon: "PenTool",
75904
+ title: "内容创作",
75905
+ description: "创建演示文稿、文档和多媒体内容"
75906
+ },
75907
+ {
75908
+ icon: "FileText",
75909
+ title: "文档处理",
75910
+ description: "处理和分析文档数据"
75911
+ }
75912
+ ];
75913
+ function SuggestionCards({ onSelect }) {
75914
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { "data-testid": "suggestion-cards", className: "grid grid-cols-3 gap-3 mt-6 w-full max-w-lg", children: DEFAULT_SUGGESTIONS.map((suggestion) => {
75915
+ const IconComponent = ICON_MAP[suggestion.icon];
75916
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
75917
+ Card,
75918
+ {
75919
+ className: "cursor-pointer transition-colors hover:bg-accent/50",
75920
+ onClick: () => onSelect(suggestion),
75921
+ "data-testid": "suggestion-card",
75922
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs(CardContent, { className: "p-4 flex flex-col items-start gap-2", children: [
75923
+ IconComponent && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "rounded-lg bg-accent/30 p-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(IconComponent, { className: "size-5 text-muted-foreground" }) }),
75924
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-sm font-semibold", children: suggestion.title }),
75925
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-muted-foreground", children: suggestion.description })
75926
+ ] })
75927
+ },
75928
+ suggestion.title
75929
+ );
75930
+ }) });
75931
+ }
75844
75932
  function ChatContainer({ threadId }) {
75845
75933
  const inputRef = reactExports.useRef(null);
75846
75934
  const scrollRef = reactExports.useRef(null);
@@ -76055,11 +76143,33 @@ function ChatContainer({ threadId }) {
76055
76143
  await selectWorkspaceFolder(threadId, setWorkspacePath, setWorkspaceFiles, () => {
76056
76144
  }, void 0);
76057
76145
  };
76146
+ const handleSuggestionSelect = async (suggestion) => {
76147
+ if (isLoading || !stream || !workspacePath) return;
76148
+ const message = suggestion.title;
76149
+ const userMessage = {
76150
+ id: crypto.randomUUID(),
76151
+ role: "user",
76152
+ content: message,
76153
+ created_at: /* @__PURE__ */ new Date()
76154
+ };
76155
+ appendMessage(userMessage);
76156
+ const currentThread = threads.find((t) => t.thread_id === threadId);
76157
+ if (currentThread?.title?.startsWith("Thread ")) {
76158
+ generateTitleForFirstMessage(threadId, message);
76159
+ }
76160
+ await stream.submit(
76161
+ { messages: [{ type: "human", content: message }] },
76162
+ { config: { configurable: { thread_id: threadId, model_id: currentModel } } }
76163
+ );
76164
+ };
76058
76165
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-1 flex-col min-h-0 overflow-hidden", children: [
76059
76166
  /* @__PURE__ */ jsxRuntimeExports.jsx(ScrollArea, { className: "flex-1 min-h-0", ref: scrollRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-3xl mx-auto space-y-4", children: [
76060
76167
  displayMessages.length === 0 && !isLoading && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center justify-center py-20 text-muted-foreground", children: [
76061
76168
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-section-header mb-2", children: "NEW THREAD" }),
76062
- workspacePath ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-sm", children: "Start a conversation with the agent" }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-sm text-center space-y-3", children: [
76169
+ workspacePath ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
76170
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-sm", children: "Start a conversation with the agent" }),
76171
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SuggestionCards, { onSelect: handleSuggestionSelect })
76172
+ ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-sm text-center space-y-3", children: [
76063
76173
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
76064
76174
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-amber-500", children: "Select a workspace folder" }),
76065
76175
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "block text-xs mt-1 opacity-75", children: "The agent needs a workspace to create and modify files" })
@@ -76168,7 +76278,14 @@ function TabbedPanel({ threadId, showTabBar = true }) {
76168
76278
  ) })
76169
76279
  ] });
76170
76280
  }
76171
- function Switch({ checked = false, onCheckedChange, disabled = false, className, onClick, ...props }) {
76281
+ function Switch({
76282
+ checked = false,
76283
+ onCheckedChange,
76284
+ disabled = false,
76285
+ className,
76286
+ onClick,
76287
+ ...props
76288
+ }) {
76172
76289
  const handleClick = (e) => {
76173
76290
  onClick?.(e);
76174
76291
  if (!disabled) {
@@ -76501,19 +76618,20 @@ function CreateSkillDialog({ open, onClose, onCreate }) {
76501
76618
  };
76502
76619
  const currentTemplate = SKILL_TEMPLATES.find((t) => t.id === selectedTemplate);
76503
76620
  if (!open) return null;
76504
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-full max-w-3xl mx-4 bg-[#1A1A1D] rounded-lg shadow-xl border border-white/10", children: [
76505
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-b border-white/5", children: [
76621
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-full max-w-2xl bg-[#1A1A1D] rounded-lg shadow-xl border border-white/10 flex flex-col max-h-[90vh]", children: [
76622
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-b border-white/5 flex-shrink-0", children: [
76506
76623
  /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-lg font-semibold text-white", children: "Create Custom Skill" }),
76507
- /* @__PURE__ */ jsxRuntimeExports.jsx(
76508
- "button",
76624
+ /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: onClose, className: "text-gray-400 hover:text-white transition-colors", children: /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
76625
+ "path",
76509
76626
  {
76510
- onClick: onClose,
76511
- className: "text-gray-400 hover:text-white transition-colors",
76512
- children: /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
76627
+ strokeLinecap: "round",
76628
+ strokeLinejoin: "round",
76629
+ strokeWidth: 2,
76630
+ d: "M6 18L18 6M6 6l12 12"
76513
76631
  }
76514
- )
76632
+ ) }) })
76515
76633
  ] }),
76516
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 px-6 py-3 border-b border-white/5", children: [
76634
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 px-6 py-3 border-b border-white/5 flex-shrink-0", children: [
76517
76635
  /* @__PURE__ */ jsxRuntimeExports.jsx(
76518
76636
  "button",
76519
76637
  {
@@ -76533,7 +76651,7 @@ function CreateSkillDialog({ open, onClose, onCreate }) {
76533
76651
  }
76534
76652
  )
76535
76653
  ] }),
76536
- /* @__PURE__ */ jsxRuntimeExports.jsxs("form", { onSubmit: handleSubmit, className: "p-6 space-y-4", children: [
76654
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("form", { onSubmit: handleSubmit, className: "p-6 space-y-4 overflow-y-auto flex-1", children: [
76537
76655
  mode === "template" && /* Template Selection */
76538
76656
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
76539
76657
  /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "block text-sm font-medium text-gray-300 mb-2", children: "Choose Template" }),
@@ -76639,7 +76757,7 @@ function CreateSkillDialog({ open, onClose, onCreate }) {
76639
76757
  ),
76640
76758
  /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mt-1 text-xs text-gray-500", children: "This prompt will be loaded when the agent activates this skill, providing specialized knowledge and instructions." })
76641
76759
  ] }),
76642
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-end gap-3 pt-4 border-t border-white/5", children: [
76760
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-end gap-3 pt-4 border-t border-white/5 flex-shrink-0", children: [
76643
76761
  /* @__PURE__ */ jsxRuntimeExports.jsx(
76644
76762
  "button",
76645
76763
  {
@@ -76670,7 +76788,13 @@ const categoryColors = {
76670
76788
  system: "bg-orange-500/10 text-orange-500 border-orange-500/20",
76671
76789
  custom: "bg-cyan-500/10 text-cyan-500 border-cyan-500/20"
76672
76790
  };
76673
- function SkillDetailDialog({ skill, open, onClose, onToggle, onDelete }) {
76791
+ function SkillDetailDialog({
76792
+ skill,
76793
+ open,
76794
+ onClose,
76795
+ onToggle,
76796
+ onDelete
76797
+ }) {
76674
76798
  if (!open) return null;
76675
76799
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-full max-w-3xl mx-4 max-h-[80vh] bg-[#1A1A1D] rounded-lg shadow-xl border border-white/10 flex flex-col", children: [
76676
76800
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start justify-between px-6 py-4 border-b border-white/5", children: [
@@ -76693,7 +76817,15 @@ function SkillDetailDialog({ skill, open, onClose, onToggle, onDelete }) {
76693
76817
  {
76694
76818
  onClick: onClose,
76695
76819
  className: "ml-4 text-gray-400 hover:text-white transition-colors",
76696
- children: /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
76820
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
76821
+ "path",
76822
+ {
76823
+ strokeLinecap: "round",
76824
+ strokeLinejoin: "round",
76825
+ strokeWidth: 2,
76826
+ d: "M6 18L18 6M6 6l12 12"
76827
+ }
76828
+ ) })
76697
76829
  }
76698
76830
  )
76699
76831
  ] }),
@@ -77105,7 +77237,15 @@ function RightPanel() {
77105
77237
  else if (nextPanel === "skills") setSkillsOpen(false);
77106
77238
  }
77107
77239
  },
77108
- [getContentHeights, getAvailableContentHeight, filesOpen, agentsOpen, skillsOpen, agentsHeight, skillsHeight]
77240
+ [
77241
+ getContentHeights,
77242
+ getAvailableContentHeight,
77243
+ filesOpen,
77244
+ agentsOpen,
77245
+ skillsOpen,
77246
+ agentsHeight,
77247
+ skillsHeight
77248
+ ]
77109
77249
  );
77110
77250
  const handleFilesResize = reactExports.useCallback(
77111
77251
  (totalDelta) => {
@@ -77728,35 +77868,6 @@ function KanbanColumn({
77728
77868
  }
77729
77869
  );
77730
77870
  }
77731
- const Card = reactExports.forwardRef(
77732
- ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntimeExports.jsx(
77733
- "div",
77734
- {
77735
- ref,
77736
- className: cn("rounded-sm border border-border bg-card text-card-foreground", className),
77737
- ...props
77738
- }
77739
- )
77740
- );
77741
- Card.displayName = "Card";
77742
- const CardHeader = reactExports.forwardRef(
77743
- ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref, className: cn("flex flex-col space-y-1.5 p-4", className), ...props })
77744
- );
77745
- CardHeader.displayName = "CardHeader";
77746
- const CardTitle = reactExports.forwardRef(
77747
- ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { ref, className: cn("text-section-header", className), ...props })
77748
- );
77749
- CardTitle.displayName = "CardTitle";
77750
- const CardDescription = reactExports.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntimeExports.jsx("p", { ref, className: cn("text-sm text-muted-foreground", className), ...props }));
77751
- CardDescription.displayName = "CardDescription";
77752
- const CardContent = reactExports.forwardRef(
77753
- ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref, className: cn("p-4 pt-0", className), ...props })
77754
- );
77755
- CardContent.displayName = "CardContent";
77756
- const CardFooter = reactExports.forwardRef(
77757
- ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref, className: cn("flex items-center p-4 pt-0", className), ...props })
77758
- );
77759
- CardFooter.displayName = "CardFooter";
77760
77871
  function ThreadStatusIcon({ threadId }) {
77761
77872
  const { isLoading } = useThreadStream(threadId);
77762
77873
  if (isLoading) {
@@ -78120,7 +78231,7 @@ function App() {
78120
78231
  },
78121
78232
  children: [
78122
78233
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "app-badge-name", children: "OPENWORK" }),
78123
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "app-badge-version", children: "0.2.3" })
78234
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "app-badge-version", children: "0.3.0" })
78124
78235
  ]
78125
78236
  }
78126
78237
  ),
@@ -7,8 +7,8 @@
7
7
  http-equiv="Content-Security-Policy"
8
8
  content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:"
9
9
  />
10
- <script type="module" crossorigin src="./assets/index-DTaVewa6.js"></script>
11
- <link rel="stylesheet" crossorigin href="./assets/index-BmPF126u.css">
10
+ <script type="module" crossorigin src="./assets/index-ZbiHA5we.js"></script>
11
+ <link rel="stylesheet" crossorigin href="./assets/index-0WBq9FlY.css">
12
12
  </head>
13
13
  <body>
14
14
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniqueli/openwork",
3
- "version": "0.2.3",
3
+ "version": "0.3.0",
4
4
  "description": "A tactical agent interface for deepagentsjs with multiple custom API support",
5
5
  "main": "./out/main/index.js",
6
6
  "files": [