@inf-monkeys-tech/monkeys-design 1.0.68 → 1.0.69

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.
@@ -1,4 +1,4 @@
1
- import { ChevronDown, Check, ChevronRight, Circle, ChevronUp, ArrowUp, ArrowDown, Pencil, Trash2, Image, File, LoaderCircle, CircleAlert, RotateCcw, X, Paperclip, FileText, Mic, Send, Square, ShoppingBag, Code2, Search, Palette, Sparkles, ArrowLeft, Upload, ArrowUpRight, Plus, Pin, SquarePen, Blocks, MessageSquare, Bot, Settings, AlertCircle, RefreshCw, Loader2, TerminalSquare, Clock3, FileOutput, Download, ListFilter, Link2, ExternalLink, PanelRightClose, Wrench, BookOpen, CheckCircle2, XCircle, CircleStop, GitFork, PencilLine, Copy, FileCode2, Files, TestTube2, Globe2, Film, Presentation, FileImage, Music2, Ellipsis } from 'lucide-react';
1
+ import { ChevronDown, Check, ChevronRight, Circle, ChevronUp, ArrowUp, ArrowDown, Pencil, Trash2, Image, File, LoaderCircle, CircleAlert, RotateCcw, X, Paperclip, FileText, Mic, Send, Square, ShoppingBag, Code2, Search, Palette, Sparkles, ArrowLeft, Upload, ArrowUpRight, Plus, Pin, SquarePen, Blocks, MessageSquare, Bot, Settings, AlertCircle, RefreshCw, Loader2, Clock3, TerminalSquare, FileOutput, Download, ListFilter, Link2, ExternalLink, PanelRightClose, Wrench, BookOpen, CheckCircle2, XCircle, CircleStop, GitFork, PencilLine, Copy, FileCode2, Files, TestTube2, Globe2, Film, Presentation, FileImage, Music2, Ellipsis } from 'lucide-react';
2
2
  import * as React5 from 'react';
3
3
  import { useImperativeHandle, createContext, useRef, useState, useMemo, useEffect, useContext } from 'react';
4
4
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
@@ -2061,7 +2061,70 @@ function createAgentWorkbenchActivityModel(viewModel) {
2061
2061
  run: projectRun(visibleEvents)
2062
2062
  };
2063
2063
  }
2064
- function JsonValue({ value, className }) {
2064
+ function JsonValue({ value }) {
2065
+ if (value === void 0) return null;
2066
+ const content = typeof value === "string" ? value : JSON.stringify(value, null, 2);
2067
+ return /* @__PURE__ */ jsx(
2068
+ "pre",
2069
+ {
2070
+ className: "max-h-64 overflow-auto whitespace-pre-wrap break-words rounded-md bg-muted p-3 font-mono text-xs text-foreground",
2071
+ tabIndex: 0,
2072
+ children: content
2073
+ }
2074
+ );
2075
+ }
2076
+ function AgentWorkbenchApproval({ approval, className, onDecision }) {
2077
+ const messages = useMonkeysLocaleMessages().agentWorkbench.approval;
2078
+ const requested = approval.status === "requested";
2079
+ const approved = approval.status === "approved";
2080
+ return /* @__PURE__ */ jsx(
2081
+ "article",
2082
+ {
2083
+ className: cn2("rounded-lg border border-border bg-card p-3 text-card-foreground", className),
2084
+ "data-agent-approval-status": approval.status,
2085
+ children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
2086
+ requested ? /* @__PURE__ */ jsx(Clock3, { className: "mt-0.5 size-4 shrink-0", "aria-hidden": "true" }) : approved ? /* @__PURE__ */ jsx(Check, { className: "mt-0.5 size-4 shrink-0 text-primary", "aria-hidden": "true" }) : /* @__PURE__ */ jsx(X, { className: "mt-0.5 size-4 shrink-0 text-destructive-text", "aria-hidden": "true" }),
2087
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
2088
+ /* @__PURE__ */ jsx("h3", { className: "break-words text-sm font-medium", children: approval.title }),
2089
+ approval.description ? /* @__PURE__ */ jsx("p", { className: "mt-1 whitespace-pre-wrap break-words text-sm text-muted-foreground", children: approval.description }) : null,
2090
+ approval.requestedAction !== void 0 ? /* @__PURE__ */ jsx("div", { className: "mt-3 min-w-0", children: /* @__PURE__ */ jsx(JsonValue, { value: approval.requestedAction }) }) : null,
2091
+ requested ? /* @__PURE__ */ jsxs("div", { className: "mt-3 flex flex-wrap gap-2", children: [
2092
+ /* @__PURE__ */ jsx(
2093
+ Button,
2094
+ {
2095
+ type: "button",
2096
+ size: "sm",
2097
+ className: "h-auto px-3 py-1.5 text-sm",
2098
+ disabled: !onDecision,
2099
+ onClick: () => onDecision?.({
2100
+ approvalId: approval.approvalId,
2101
+ approved: true
2102
+ }),
2103
+ children: messages.approve
2104
+ }
2105
+ ),
2106
+ /* @__PURE__ */ jsx(
2107
+ Button,
2108
+ {
2109
+ type: "button",
2110
+ variant: "outline",
2111
+ size: "sm",
2112
+ className: "h-auto px-3 py-1.5 text-sm",
2113
+ disabled: !onDecision,
2114
+ onClick: () => onDecision?.({
2115
+ approvalId: approval.approvalId,
2116
+ approved: false
2117
+ }),
2118
+ children: messages.reject
2119
+ }
2120
+ )
2121
+ ] }) : /* @__PURE__ */ jsx("p", { className: "mt-2 text-xs text-muted-foreground", children: approved ? messages.approved : messages.rejected })
2122
+ ] })
2123
+ ] })
2124
+ }
2125
+ );
2126
+ }
2127
+ function JsonValue2({ value, className }) {
2065
2128
  if (value === void 0) return null;
2066
2129
  const content = typeof value === "string" ? value : JSON.stringify(value, null, 2);
2067
2130
  return /* @__PURE__ */ jsx(
@@ -2148,11 +2211,11 @@ function AgentWorkbenchTool({
2148
2211
  /* @__PURE__ */ jsxs("div", { className: cn2("space-y-3 border-t border-border px-3 py-3 text-sm", classNames?.content), children: [
2149
2212
  event.payload.input !== void 0 ? /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
2150
2213
  /* @__PURE__ */ jsx("div", { className: "text-xs font-medium text-muted-foreground", children: messages.input }),
2151
- /* @__PURE__ */ jsx(JsonValue, { value: event.payload.input, className: classNames?.input })
2214
+ /* @__PURE__ */ jsx(JsonValue2, { value: event.payload.input, className: classNames?.input })
2152
2215
  ] }) : null,
2153
2216
  event.payload.output !== void 0 ? /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
2154
2217
  /* @__PURE__ */ jsx("div", { className: "text-xs font-medium text-muted-foreground", children: messages.output }),
2155
- /* @__PURE__ */ jsx(JsonValue, { value: event.payload.output, className: classNames?.output })
2218
+ /* @__PURE__ */ jsx(JsonValue2, { value: event.payload.output, className: classNames?.output })
2156
2219
  ] }) : null,
2157
2220
  event.payload.error ? /* @__PURE__ */ jsx("p", { className: "text-sm text-destructive-text", role: "alert", children: event.payload.error }) : null
2158
2221
  ] })
@@ -2225,11 +2288,6 @@ function StatusIcon({ status }) {
2225
2288
  }
2226
2289
  return /* @__PURE__ */ jsx(Circle, { className: "size-4 text-muted-foreground", "aria-hidden": "true" });
2227
2290
  }
2228
- function JsonValue2({ value }) {
2229
- if (value === void 0) return null;
2230
- const content = typeof value === "string" ? value : JSON.stringify(value, null, 2);
2231
- return /* @__PURE__ */ jsx("pre", { className: "max-h-64 overflow-auto whitespace-pre-wrap break-words rounded-md bg-muted p-3 font-mono text-xs text-foreground", children: content });
2232
- }
2233
2291
  function formatDuration(durationMs) {
2234
2292
  if (durationMs < 1e3) return "<1s";
2235
2293
  const totalSeconds = Math.floor(durationMs / 1e3);
@@ -2355,54 +2413,12 @@ function AgentWorkbenchActivity({
2355
2413
  event.payload.toolCallId
2356
2414
  )),
2357
2415
  approvals.map((event) => {
2358
- const requested = event.payload.status === "requested";
2359
- const approved = event.payload.status === "approved";
2360
2416
  return /* @__PURE__ */ jsx(
2361
- "article",
2417
+ AgentWorkbenchApproval,
2362
2418
  {
2363
- className: cn2(
2364
- "rounded-lg border border-border bg-card p-3 text-card-foreground",
2365
- classNames?.approval
2366
- ),
2367
- children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
2368
- requested ? /* @__PURE__ */ jsx(Clock3, { className: "mt-0.5 size-4 shrink-0", "aria-hidden": "true" }) : approved ? /* @__PURE__ */ jsx(Check, { className: "mt-0.5 size-4 shrink-0 text-primary", "aria-hidden": "true" }) : /* @__PURE__ */ jsx(X, { className: "mt-0.5 size-4 shrink-0 text-destructive-text", "aria-hidden": "true" }),
2369
- /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
2370
- /* @__PURE__ */ jsx("h3", { className: "text-sm font-medium", children: event.payload.title }),
2371
- event.payload.description ? /* @__PURE__ */ jsx("p", { className: "mt-1 text-sm text-muted-foreground", children: event.payload.description }) : null,
2372
- event.payload.requestedAction !== void 0 ? /* @__PURE__ */ jsx("div", { className: "mt-3", children: /* @__PURE__ */ jsx(JsonValue2, { value: event.payload.requestedAction }) }) : null,
2373
- requested ? /* @__PURE__ */ jsxs("div", { className: "mt-3 flex flex-wrap gap-2", children: [
2374
- /* @__PURE__ */ jsx(
2375
- Button,
2376
- {
2377
- type: "button",
2378
- size: "sm",
2379
- className: "h-auto px-3 py-1.5 text-sm",
2380
- disabled: !onApprovalDecision,
2381
- onClick: () => onApprovalDecision?.({
2382
- approvalId: event.payload.approvalId,
2383
- approved: true
2384
- }),
2385
- children: messages.approval.approve
2386
- }
2387
- ),
2388
- /* @__PURE__ */ jsx(
2389
- Button,
2390
- {
2391
- type: "button",
2392
- variant: "outline",
2393
- size: "sm",
2394
- className: "h-auto px-3 py-1.5 text-sm",
2395
- disabled: !onApprovalDecision,
2396
- onClick: () => onApprovalDecision?.({
2397
- approvalId: event.payload.approvalId,
2398
- approved: false
2399
- }),
2400
- children: messages.approval.reject
2401
- }
2402
- )
2403
- ] }) : /* @__PURE__ */ jsx("p", { className: "mt-2 text-xs text-muted-foreground", children: approved ? messages.approval.approved : messages.approval.rejected })
2404
- ] })
2405
- ] })
2419
+ approval: event.payload,
2420
+ className: classNames?.approval,
2421
+ onDecision: onApprovalDecision
2406
2422
  },
2407
2423
  event.payload.approvalId
2408
2424
  );
@@ -3649,6 +3665,6 @@ function AgentWorkbenchArtifactWorkspace({
3649
3665
  );
3650
3666
  }
3651
3667
 
3652
- export { AgentWorkbenchAction, AgentWorkbenchActivity, AgentWorkbenchArtifactSummary, AgentWorkbenchArtifactWorkspace, AgentWorkbenchComposer, AgentWorkbenchExploreCardMedia, AgentWorkbenchExploreSidebar, AgentWorkbenchProcess, AgentWorkbenchQuickStart, AgentWorkbenchSidebar, AgentWorkbenchTaskDetails, AgentWorkbenchThread, AgentWorkbenchTool, createAgentWorkbenchActivityModel, createAgentWorkbenchDetailsModel };
3668
+ export { AgentWorkbenchAction, AgentWorkbenchActivity, AgentWorkbenchApproval, AgentWorkbenchArtifactSummary, AgentWorkbenchArtifactWorkspace, AgentWorkbenchComposer, AgentWorkbenchExploreCardMedia, AgentWorkbenchExploreSidebar, AgentWorkbenchProcess, AgentWorkbenchQuickStart, AgentWorkbenchSidebar, AgentWorkbenchTaskDetails, AgentWorkbenchThread, AgentWorkbenchTool, createAgentWorkbenchActivityModel, createAgentWorkbenchDetailsModel };
3653
3669
  //# sourceMappingURL=index.mjs.map
3654
3670
  //# sourceMappingURL=index.mjs.map