@inf-monkeys-tech/monkeys-design 1.0.62 → 1.0.63
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/agent-workbench/index.d.mts +14 -3
- package/dist/components/agent-workbench/index.d.ts +14 -3
- package/dist/components/agent-workbench/index.js +106 -50
- package/dist/components/agent-workbench/index.js.map +1 -1
- package/dist/components/agent-workbench/index.mjs +107 -51
- package/dist/components/agent-workbench/index.mjs.map +1 -1
- package/dist/{details-model-765193fe43be.d.mts → details-model-db4bd679f88e.d.mts} +5 -1
- package/dist/{details-model-765193fe43be.d.ts → details-model-db4bd679f88e.d.ts} +5 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +88 -50
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +89 -51
- package/dist/index.mjs.map +1 -1
- package/dist/provider/index.js +3 -0
- package/dist/provider/index.js.map +1 -1
- package/dist/provider/index.mjs +3 -0
- package/dist/provider/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/theme-system/index.js +3 -0
- package/dist/theme-system/index.js.map +1 -1
- package/dist/theme-system/index.mjs +3 -0
- package/dist/theme-system/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { AgentWorkbenchComposerViewModel, AgentSessionPermissionProfile, AgentSessionViewModel, AgentSessionEvent } from '@inf-monkeys-tech/monkeys';
|
|
3
|
-
import { d as AgentWorkbenchApprovalIntent, e as AgentWorkbenchArtifactIntent } from '../../details-model-
|
|
4
|
-
export { A as AgentWorkbenchActivity, a as AgentWorkbenchActivityClassNames, b as AgentWorkbenchActivityModel, c as AgentWorkbenchActivityProps, f as AgentWorkbenchDetailsIntent, g as AgentWorkbenchDetailsModel, h as AgentWorkbenchDetailsState, i as AgentWorkbenchDetailsTab, j as AgentWorkbenchEventOf, E as AgentWorkbenchExploreCardMedia, F as AgentWorkbenchExploreCardMediaProps, k as AgentWorkbenchExploreGroup, l as AgentWorkbenchExploreItem, G as AgentWorkbenchExploreMediaTreatment, H as AgentWorkbenchExploreMediaVariant, m as AgentWorkbenchExploreSidebar, n as AgentWorkbenchExploreSidebarIntent, o as AgentWorkbenchExploreSidebarLabels, p as AgentWorkbenchExploreSidebarProps, q as AgentWorkbenchSidebar, r as AgentWorkbenchSidebarClassNames, s as AgentWorkbenchSidebarIntent, t as AgentWorkbenchSidebarProps, u as AgentWorkbenchTaskDetails, v as AgentWorkbenchTaskDetailsClassNames, w as AgentWorkbenchTaskDetailsProps, x as AgentWorkbenchTerminalModel, y as AgentWorkbenchTool, z as AgentWorkbenchToolClassNames, B as AgentWorkbenchToolProps, C as createAgentWorkbenchActivityModel, D as createAgentWorkbenchDetailsModel } from '../../details-model-
|
|
3
|
+
import { d as AgentWorkbenchApprovalIntent, e as AgentWorkbenchArtifactIntent } from '../../details-model-db4bd679f88e.mjs';
|
|
4
|
+
export { A as AgentWorkbenchActivity, a as AgentWorkbenchActivityClassNames, b as AgentWorkbenchActivityModel, c as AgentWorkbenchActivityProps, f as AgentWorkbenchDetailsIntent, g as AgentWorkbenchDetailsModel, h as AgentWorkbenchDetailsState, i as AgentWorkbenchDetailsTab, j as AgentWorkbenchEventOf, E as AgentWorkbenchExploreCardMedia, F as AgentWorkbenchExploreCardMediaProps, k as AgentWorkbenchExploreGroup, l as AgentWorkbenchExploreItem, G as AgentWorkbenchExploreMediaTreatment, H as AgentWorkbenchExploreMediaVariant, m as AgentWorkbenchExploreSidebar, n as AgentWorkbenchExploreSidebarIntent, o as AgentWorkbenchExploreSidebarLabels, p as AgentWorkbenchExploreSidebarProps, q as AgentWorkbenchSidebar, r as AgentWorkbenchSidebarClassNames, s as AgentWorkbenchSidebarIntent, t as AgentWorkbenchSidebarProps, u as AgentWorkbenchTaskDetails, v as AgentWorkbenchTaskDetailsClassNames, w as AgentWorkbenchTaskDetailsProps, x as AgentWorkbenchTerminalModel, y as AgentWorkbenchTool, z as AgentWorkbenchToolClassNames, B as AgentWorkbenchToolProps, C as createAgentWorkbenchActivityModel, D as createAgentWorkbenchDetailsModel } from '../../details-model-db4bd679f88e.mjs';
|
|
5
5
|
import { ReactNode, ComponentType } from 'react';
|
|
6
6
|
type AgentWorkbenchComposerIntent = {
|
|
7
7
|
type: 'change-mode';
|
|
@@ -34,6 +34,9 @@ type AgentWorkbenchComposerIntent = {
|
|
|
34
34
|
files: File[];
|
|
35
35
|
} | {
|
|
36
36
|
type: 'request-voice-input';
|
|
37
|
+
} | {
|
|
38
|
+
type: 'select-input-action';
|
|
39
|
+
actionId: string;
|
|
37
40
|
} | {
|
|
38
41
|
type: 'select-model';
|
|
39
42
|
modelId: string;
|
|
@@ -54,13 +57,21 @@ interface AgentWorkbenchComposerClassNames {
|
|
|
54
57
|
toolbar?: string;
|
|
55
58
|
}
|
|
56
59
|
interface AgentWorkbenchComposerProps {
|
|
57
|
-
viewModel: AgentWorkbenchComposerViewModel
|
|
60
|
+
viewModel: AgentWorkbenchComposerViewModel & {
|
|
61
|
+
inputActions?: readonly ComposerInputAction[];
|
|
62
|
+
selectedInputActionId?: string;
|
|
63
|
+
};
|
|
58
64
|
modeSelectionEnabled?: boolean;
|
|
59
65
|
modeFilteringEnabled?: boolean;
|
|
60
66
|
className?: string;
|
|
61
67
|
classNames?: AgentWorkbenchComposerClassNames;
|
|
62
68
|
onIntent?: (intent: AgentWorkbenchComposerIntent) => void;
|
|
63
69
|
}
|
|
70
|
+
type ComposerInputAction = {
|
|
71
|
+
id: string;
|
|
72
|
+
label: string;
|
|
73
|
+
icon?: 'file-text' | 'image';
|
|
74
|
+
};
|
|
64
75
|
declare function AgentWorkbenchComposer({ viewModel, modeSelectionEnabled, modeFilteringEnabled, className, classNames, onIntent, }: AgentWorkbenchComposerProps): react_jsx_runtime.JSX.Element;
|
|
65
76
|
type AgentWorkbenchQuickStartIcon = 'code' | 'file-text' | 'palette' | 'search' | 'shopping-bag' | 'sparkles';
|
|
66
77
|
interface AgentWorkbenchQuickStartTemplate {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { AgentWorkbenchComposerViewModel, AgentSessionPermissionProfile, AgentSessionViewModel, AgentSessionEvent } from '@inf-monkeys-tech/monkeys';
|
|
3
|
-
import { d as AgentWorkbenchApprovalIntent, e as AgentWorkbenchArtifactIntent } from '../../details-model-
|
|
4
|
-
export { A as AgentWorkbenchActivity, a as AgentWorkbenchActivityClassNames, b as AgentWorkbenchActivityModel, c as AgentWorkbenchActivityProps, f as AgentWorkbenchDetailsIntent, g as AgentWorkbenchDetailsModel, h as AgentWorkbenchDetailsState, i as AgentWorkbenchDetailsTab, j as AgentWorkbenchEventOf, E as AgentWorkbenchExploreCardMedia, F as AgentWorkbenchExploreCardMediaProps, k as AgentWorkbenchExploreGroup, l as AgentWorkbenchExploreItem, G as AgentWorkbenchExploreMediaTreatment, H as AgentWorkbenchExploreMediaVariant, m as AgentWorkbenchExploreSidebar, n as AgentWorkbenchExploreSidebarIntent, o as AgentWorkbenchExploreSidebarLabels, p as AgentWorkbenchExploreSidebarProps, q as AgentWorkbenchSidebar, r as AgentWorkbenchSidebarClassNames, s as AgentWorkbenchSidebarIntent, t as AgentWorkbenchSidebarProps, u as AgentWorkbenchTaskDetails, v as AgentWorkbenchTaskDetailsClassNames, w as AgentWorkbenchTaskDetailsProps, x as AgentWorkbenchTerminalModel, y as AgentWorkbenchTool, z as AgentWorkbenchToolClassNames, B as AgentWorkbenchToolProps, C as createAgentWorkbenchActivityModel, D as createAgentWorkbenchDetailsModel } from '../../details-model-
|
|
3
|
+
import { d as AgentWorkbenchApprovalIntent, e as AgentWorkbenchArtifactIntent } from '../../details-model-db4bd679f88e.js';
|
|
4
|
+
export { A as AgentWorkbenchActivity, a as AgentWorkbenchActivityClassNames, b as AgentWorkbenchActivityModel, c as AgentWorkbenchActivityProps, f as AgentWorkbenchDetailsIntent, g as AgentWorkbenchDetailsModel, h as AgentWorkbenchDetailsState, i as AgentWorkbenchDetailsTab, j as AgentWorkbenchEventOf, E as AgentWorkbenchExploreCardMedia, F as AgentWorkbenchExploreCardMediaProps, k as AgentWorkbenchExploreGroup, l as AgentWorkbenchExploreItem, G as AgentWorkbenchExploreMediaTreatment, H as AgentWorkbenchExploreMediaVariant, m as AgentWorkbenchExploreSidebar, n as AgentWorkbenchExploreSidebarIntent, o as AgentWorkbenchExploreSidebarLabels, p as AgentWorkbenchExploreSidebarProps, q as AgentWorkbenchSidebar, r as AgentWorkbenchSidebarClassNames, s as AgentWorkbenchSidebarIntent, t as AgentWorkbenchSidebarProps, u as AgentWorkbenchTaskDetails, v as AgentWorkbenchTaskDetailsClassNames, w as AgentWorkbenchTaskDetailsProps, x as AgentWorkbenchTerminalModel, y as AgentWorkbenchTool, z as AgentWorkbenchToolClassNames, B as AgentWorkbenchToolProps, C as createAgentWorkbenchActivityModel, D as createAgentWorkbenchDetailsModel } from '../../details-model-db4bd679f88e.js';
|
|
5
5
|
import { ReactNode, ComponentType } from 'react';
|
|
6
6
|
type AgentWorkbenchComposerIntent = {
|
|
7
7
|
type: 'change-mode';
|
|
@@ -34,6 +34,9 @@ type AgentWorkbenchComposerIntent = {
|
|
|
34
34
|
files: File[];
|
|
35
35
|
} | {
|
|
36
36
|
type: 'request-voice-input';
|
|
37
|
+
} | {
|
|
38
|
+
type: 'select-input-action';
|
|
39
|
+
actionId: string;
|
|
37
40
|
} | {
|
|
38
41
|
type: 'select-model';
|
|
39
42
|
modelId: string;
|
|
@@ -54,13 +57,21 @@ interface AgentWorkbenchComposerClassNames {
|
|
|
54
57
|
toolbar?: string;
|
|
55
58
|
}
|
|
56
59
|
interface AgentWorkbenchComposerProps {
|
|
57
|
-
viewModel: AgentWorkbenchComposerViewModel
|
|
60
|
+
viewModel: AgentWorkbenchComposerViewModel & {
|
|
61
|
+
inputActions?: readonly ComposerInputAction[];
|
|
62
|
+
selectedInputActionId?: string;
|
|
63
|
+
};
|
|
58
64
|
modeSelectionEnabled?: boolean;
|
|
59
65
|
modeFilteringEnabled?: boolean;
|
|
60
66
|
className?: string;
|
|
61
67
|
classNames?: AgentWorkbenchComposerClassNames;
|
|
62
68
|
onIntent?: (intent: AgentWorkbenchComposerIntent) => void;
|
|
63
69
|
}
|
|
70
|
+
type ComposerInputAction = {
|
|
71
|
+
id: string;
|
|
72
|
+
label: string;
|
|
73
|
+
icon?: 'file-text' | 'image';
|
|
74
|
+
};
|
|
64
75
|
declare function AgentWorkbenchComposer({ viewModel, modeSelectionEnabled, modeFilteringEnabled, className, classNames, onIntent, }: AgentWorkbenchComposerProps): react_jsx_runtime.JSX.Element;
|
|
65
76
|
type AgentWorkbenchQuickStartIcon = 'code' | 'file-text' | 'palette' | 'search' | 'shopping-bag' | 'sparkles';
|
|
66
77
|
interface AgentWorkbenchQuickStartTemplate {
|
|
@@ -1019,6 +1019,8 @@ function AgentWorkbenchComposer({
|
|
|
1019
1019
|
const selected = visibleModelOptions.find((option) => option.id === viewModel.model.selectedId && option.mode === viewModel.mode);
|
|
1020
1020
|
return selected ? modelOptionValue(selected) : visibleModelOptions[0] ? modelOptionValue(visibleModelOptions[0]) : "";
|
|
1021
1021
|
}, [viewModel.mode, viewModel.model.selectedId, visibleModelOptions]);
|
|
1022
|
+
const inputActions = viewModel.inputActions || [];
|
|
1023
|
+
const selectedInputActionId = viewModel.selectedInputActionId;
|
|
1022
1024
|
React5.useEffect(() => {
|
|
1023
1025
|
const surface = surfaceRef.current;
|
|
1024
1026
|
if (!surface) return void 0;
|
|
@@ -1149,6 +1151,25 @@ function AgentWorkbenchComposer({
|
|
|
1149
1151
|
}
|
|
1150
1152
|
)
|
|
1151
1153
|
] }) : null,
|
|
1154
|
+
inputActions.map((action) => {
|
|
1155
|
+
const ActionIcon = action.icon === "image" ? lucideReact.Image : lucideReact.FileText;
|
|
1156
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1157
|
+
Button,
|
|
1158
|
+
{
|
|
1159
|
+
type: "button",
|
|
1160
|
+
variant: selectedInputActionId === action.id ? "secondary" : "ghost",
|
|
1161
|
+
size: "sm",
|
|
1162
|
+
className: "h-8 shrink-0 gap-1.5 px-2 text-xs",
|
|
1163
|
+
"aria-pressed": selectedInputActionId === action.id,
|
|
1164
|
+
onClick: () => onIntent?.({ type: "select-input-action", actionId: action.id }),
|
|
1165
|
+
children: [
|
|
1166
|
+
/* @__PURE__ */ jsxRuntime.jsx(ActionIcon, { className: "size-3.5" }),
|
|
1167
|
+
action.label
|
|
1168
|
+
]
|
|
1169
|
+
},
|
|
1170
|
+
action.id
|
|
1171
|
+
);
|
|
1172
|
+
}),
|
|
1152
1173
|
viewModel.capabilities.voiceInput ? /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "button", variant: "ghost", size: "icon", className: iconButtonClass, "aria-label": messages.composer.voice, onClick: () => onIntent?.({ type: "request-voice-input" }), children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Mic, { className: "size-4" }) }) : null,
|
|
1153
1174
|
viewModel.capabilities.webSearch ? /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex shrink-0 items-center gap-1.5 whitespace-nowrap px-1 text-xs font-medium text-foreground", children: [
|
|
1154
1175
|
messages.composer.webSearch,
|
|
@@ -1476,7 +1497,7 @@ function CollectionState({
|
|
|
1476
1497
|
}
|
|
1477
1498
|
if (status === "error") {
|
|
1478
1499
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-3 px-3 py-8 text-center", children: [
|
|
1479
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", role: "alert", children: error }),
|
|
1500
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "max-w-full break-words text-sm text-muted-foreground", role: "alert", children: error }),
|
|
1480
1501
|
/* @__PURE__ */ jsxRuntime.jsxs(Button, { type: "button", variant: "ghost", size: "sm", className: "gap-1.5 px-0 text-sm text-primary hover:text-primary", onClick: onRetry, children: [
|
|
1481
1502
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.RefreshCw, { className: "size-3.5", "aria-hidden": "true" }),
|
|
1482
1503
|
messages.retry
|
|
@@ -1580,7 +1601,7 @@ function AgentWorkbenchSidebar({
|
|
|
1580
1601
|
};
|
|
1581
1602
|
const renderSessionItems = (items) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-1", children: items.map((item) => {
|
|
1582
1603
|
const percent = item.contextUsage && item.contextUsage.maxTokens > 0 ? Math.min(100, Math.round(item.contextUsage.usedTokens / item.contextUsage.maxTokens * 100)) : void 0;
|
|
1583
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "aria-current": item.id === viewModel.selectedSessionItem ? "page" : void 0, className: cn2("group flex w-full items-center gap-3 rounded-lg border border-transparent px-3 py-2 text-left hover:bg-muted aria-[current=page]:border-primary aria-[current=page]:bg-muted", classNames?.item), children: [
|
|
1604
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "aria-current": item.id === viewModel.selectedSessionItem ? "page" : void 0, className: cn2("group flex w-full min-w-0 items-center gap-3 rounded-lg border border-transparent px-3 py-2 text-left hover:bg-muted aria-[current=page]:border-primary aria-[current=page]:bg-muted", classNames?.item), children: [
|
|
1584
1605
|
editingSessionId === item.id ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-3", children: [
|
|
1585
1606
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted", children: /* @__PURE__ */ jsxRuntime.jsx(SessionAvatar, { item }) }),
|
|
1586
1607
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "min-w-0 flex-1", children: [
|
|
@@ -1609,14 +1630,14 @@ function AgentWorkbenchSidebar({
|
|
|
1609
1630
|
),
|
|
1610
1631
|
/* @__PURE__ */ jsxRuntime.jsx(SessionMeta, { item, locale })
|
|
1611
1632
|
] })
|
|
1612
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: "flex min-w-0 flex-1 items-center gap-3 text-left", onClick: () => onIntent?.({ type: "select-session", sessionId: item.id }), children: [
|
|
1633
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", title: item.title, className: "flex min-w-0 flex-1 items-center gap-3 text-left", onClick: () => onIntent?.({ type: "select-session", sessionId: item.id }), children: [
|
|
1613
1634
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted", children: /* @__PURE__ */ jsxRuntime.jsx(SessionAvatar, { item }) }),
|
|
1614
1635
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "min-w-0 flex-1", children: [
|
|
1615
1636
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "block truncate text-sm font-medium", children: item.title }),
|
|
1616
1637
|
/* @__PURE__ */ jsxRuntime.jsx(SessionMeta, { item, locale })
|
|
1617
1638
|
] })
|
|
1618
1639
|
] }),
|
|
1619
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-1", children: [
|
|
1640
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { "data-agent-workbench-item-actions": true, className: "flex shrink-0 items-center gap-1", children: [
|
|
1620
1641
|
percent !== void 0 && item.status === "idle" ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xs text-foreground", "aria-label": messages.contextUsage({ percent }), children: [
|
|
1621
1642
|
percent,
|
|
1622
1643
|
"%"
|
|
@@ -1668,7 +1689,7 @@ function AgentWorkbenchSidebar({
|
|
|
1668
1689
|
headerActions ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex shrink-0 items-center", children: headerActions }) : null
|
|
1669
1690
|
] }) : null
|
|
1670
1691
|
] }),
|
|
1671
|
-
!sessionsOnly ? /* @__PURE__ */ jsxRuntime.jsxs(TabsContent, { value: "agents", className: cn2("mt-0 min-h-0 flex-1 overflow-y-auto px-4 pb-4", classNames?.body), children: [
|
|
1692
|
+
!sessionsOnly ? /* @__PURE__ */ jsxRuntime.jsxs(TabsContent, { value: "agents", "data-agent-workbench-scroll-region": true, className: cn2("mt-0 min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain px-4 pb-4", classNames?.body), children: [
|
|
1672
1693
|
viewModel.capabilities.createAgent ? /* @__PURE__ */ jsxRuntime.jsxs(Button, { type: "button", variant: "ghost", className: "mb-3 h-9 w-full justify-start gap-2 px-3 text-sm", onClick: () => onIntent?.({ type: "create-agent" }), children: [
|
|
1673
1694
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "size-4", "aria-hidden": "true" }),
|
|
1674
1695
|
messages.newAgent
|
|
@@ -1679,16 +1700,16 @@ function AgentWorkbenchSidebar({
|
|
|
1679
1700
|
"div",
|
|
1680
1701
|
{
|
|
1681
1702
|
"aria-current": item.id === viewModel.selectedAgentItem ? "page" : void 0,
|
|
1682
|
-
className: cn2("group flex w-full items-center gap-3 rounded-lg border border-transparent px-3 py-2 text-left hover:bg-muted aria-[current=page]:border-primary aria-[current=page]:bg-muted", classNames?.item),
|
|
1703
|
+
className: cn2("group flex w-full min-w-0 items-center gap-3 rounded-lg border border-transparent px-3 py-2 text-left hover:bg-muted aria-[current=page]:border-primary aria-[current=page]:bg-muted", classNames?.item),
|
|
1683
1704
|
children: [
|
|
1684
|
-
/* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: "flex min-w-0 flex-1 items-center gap-3 text-left", onClick: () => onIntent?.({ type: "select-agent", itemId: item.id }), children: [
|
|
1705
|
+
/* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", title: item.name, className: "flex min-w-0 flex-1 items-center gap-3 text-left", onClick: () => onIntent?.({ type: "select-agent", itemId: item.id }), children: [
|
|
1685
1706
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted", children: /* @__PURE__ */ jsxRuntime.jsx(ItemAvatar, { item }) }),
|
|
1686
1707
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "min-w-0 flex-1", children: [
|
|
1687
1708
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "block truncate text-sm font-medium", children: item.name }),
|
|
1688
1709
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "block truncate text-xs text-foreground/80", children: item.description || messages.noDescription })
|
|
1689
1710
|
] })
|
|
1690
1711
|
] }),
|
|
1691
|
-
item.builtIn ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rounded-full bg-muted px-1.5 py-1 text-[10px] text-foreground", children: messages.builtIn }) : null,
|
|
1712
|
+
item.builtIn ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 rounded-full bg-muted px-1.5 py-1 text-[10px] text-foreground", children: messages.builtIn }) : null,
|
|
1692
1713
|
viewModel.capabilities.pinAgents ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1693
1714
|
Button,
|
|
1694
1715
|
{
|
|
@@ -1716,7 +1737,7 @@ function AgentWorkbenchSidebar({
|
|
|
1716
1737
|
item.id
|
|
1717
1738
|
)) })
|
|
1718
1739
|
] }) : null,
|
|
1719
|
-
/* @__PURE__ */ jsxRuntime.jsxs(TabsContent, { value: "sessions", className: cn2("mt-0 min-h-0 flex-1 overflow-y-auto px-4 pb-4", classNames?.body), children: [
|
|
1740
|
+
/* @__PURE__ */ jsxRuntime.jsxs(TabsContent, { value: "sessions", "data-agent-workbench-scroll-region": true, className: cn2("mt-0 min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain px-4 pb-4", classNames?.body), children: [
|
|
1720
1741
|
viewModel.capabilities.createSession ? /* @__PURE__ */ jsxRuntime.jsxs(Button, { type: "button", variant: "ghost", className: "h-9 w-full justify-start gap-2 px-3 text-sm", onClick: () => onIntent?.({ type: "create-session" }), children: [
|
|
1721
1742
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.SquarePen, { className: "size-4", "aria-hidden": "true" }),
|
|
1722
1743
|
messages.newSession
|
|
@@ -1732,8 +1753,8 @@ function AgentWorkbenchSidebar({
|
|
|
1732
1753
|
{ id: "agent", label: messages.agents, icon: lucideReact.Bot, items: agentSessions }
|
|
1733
1754
|
].map(({ id, label, icon: Icon2, items }) => /* @__PURE__ */ jsxRuntime.jsxs("details", { open: true, "aria-label": label, children: [
|
|
1734
1755
|
/* @__PURE__ */ jsxRuntime.jsxs("summary", { className: "flex h-9 cursor-pointer list-none items-center gap-2 rounded-md px-3 text-sm font-semibold hover:bg-muted", children: [
|
|
1735
|
-
/* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "size-4 text-muted-foreground", "aria-hidden": "true" }),
|
|
1736
|
-
label
|
|
1756
|
+
/* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "size-4 shrink-0 text-muted-foreground", "aria-hidden": "true" }),
|
|
1757
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate", children: label })
|
|
1737
1758
|
] }),
|
|
1738
1759
|
renderSessionItems(items)
|
|
1739
1760
|
] }, id)) }) : !sessionsOnly ? renderSessionItems(sessions) : null
|
|
@@ -1762,7 +1783,7 @@ function AgentWorkbenchExploreCardMedia({
|
|
|
1762
1783
|
"span",
|
|
1763
1784
|
{
|
|
1764
1785
|
className: cn2(
|
|
1765
|
-
isLogo ? "flex size-full items-center justify-center bg-[var(--monkeys-color-
|
|
1786
|
+
isLogo ? "flex size-full items-center justify-center bg-[hsl(var(--monkeys-color-media-surface))] p-5" : "block size-full",
|
|
1766
1787
|
className
|
|
1767
1788
|
),
|
|
1768
1789
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1780,10 +1801,19 @@ function AgentWorkbenchExploreCardMedia({
|
|
|
1780
1801
|
)
|
|
1781
1802
|
}
|
|
1782
1803
|
),
|
|
1783
|
-
showLabel ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1804
|
+
showLabel ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1805
|
+
"span",
|
|
1806
|
+
{
|
|
1807
|
+
className: "pointer-events-none absolute inset-x-0 bottom-0 px-3 pb-2.5 pt-8 text-[hsl(var(--monkeys-color-media-foreground))]",
|
|
1808
|
+
style: {
|
|
1809
|
+
backgroundImage: "linear-gradient(to top, hsl(var(--monkeys-color-media-overlay) / 0.8), hsl(var(--monkeys-color-media-overlay) / 0.3), transparent)"
|
|
1810
|
+
},
|
|
1811
|
+
children: [
|
|
1812
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "block text-base font-semibold leading-tight", children: item.title }),
|
|
1813
|
+
item.subtitle ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mt-0.5 block text-[11px] leading-tight opacity-75", children: item.subtitle }) : null
|
|
1814
|
+
]
|
|
1815
|
+
}
|
|
1816
|
+
) : null
|
|
1787
1817
|
] });
|
|
1788
1818
|
}
|
|
1789
1819
|
function AgentWorkbenchExploreSidebar({
|
|
@@ -1793,6 +1823,7 @@ function AgentWorkbenchExploreSidebar({
|
|
|
1793
1823
|
selectedSessionId,
|
|
1794
1824
|
searchQuery = "",
|
|
1795
1825
|
loading = false,
|
|
1826
|
+
error,
|
|
1796
1827
|
showDraftSession = !selectedSessionId,
|
|
1797
1828
|
defaultGroupId,
|
|
1798
1829
|
className,
|
|
@@ -1871,34 +1902,59 @@ function AgentWorkbenchExploreSidebar({
|
|
|
1871
1902
|
}
|
|
1872
1903
|
)
|
|
1873
1904
|
] }),
|
|
1874
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1905
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1906
|
+
"div",
|
|
1907
|
+
{
|
|
1908
|
+
"data-agent-workbench-session-scroll-region": true,
|
|
1909
|
+
className: "min-h-[160px] flex-[0_1_280px] overflow-x-hidden overflow-y-auto overscroll-contain px-4 pb-3",
|
|
1910
|
+
children: error ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-h-24 flex-col items-center justify-center gap-2 px-3 py-6 text-center", role: "alert", children: [
|
|
1911
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircle, { className: "size-5 shrink-0 text-destructive-text", "aria-hidden": "true" }),
|
|
1912
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "max-w-full break-words text-sm text-muted-foreground", children: error }),
|
|
1913
|
+
labels.retry ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1914
|
+
Button,
|
|
1915
|
+
{
|
|
1916
|
+
type: "button",
|
|
1917
|
+
variant: "ghost",
|
|
1918
|
+
size: "sm",
|
|
1919
|
+
className: "gap-1.5 text-primary",
|
|
1920
|
+
onClick: () => onIntent?.({ type: "retry-sessions" }),
|
|
1921
|
+
children: [
|
|
1922
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.RefreshCw, { className: "size-3.5", "aria-hidden": "true" }),
|
|
1923
|
+
labels.retry
|
|
1924
|
+
]
|
|
1925
|
+
}
|
|
1926
|
+
) : null
|
|
1927
|
+
] }) : loading && sessions.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-24 items-center justify-center text-muted-foreground", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "size-5 animate-spin" }) }) : filteredSessions.length === 0 && !draftVisible ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-8 text-center text-sm text-muted-foreground", children: normalizedQuery ? labels.noResults : labels.emptySessions }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
1928
|
+
draftVisible ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1929
|
+
"button",
|
|
1930
|
+
{
|
|
1931
|
+
type: "button",
|
|
1932
|
+
"aria-current": "page",
|
|
1933
|
+
className: "block h-10 w-full min-w-0 truncate rounded-[var(--radius)] border border-primary bg-primary/10 px-3 text-left text-sm font-semibold text-foreground",
|
|
1934
|
+
onClick: () => onIntent?.({ type: "create-session" }),
|
|
1935
|
+
children: labels.draftSession
|
|
1936
|
+
}
|
|
1937
|
+
) : null,
|
|
1938
|
+
filteredSessions.map((session) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1939
|
+
"button",
|
|
1940
|
+
{
|
|
1941
|
+
type: "button",
|
|
1942
|
+
title: session.title,
|
|
1943
|
+
"aria-current": session.id === selectedSessionId ? "page" : void 0,
|
|
1944
|
+
className: "block h-10 w-full min-w-0 truncate rounded-[var(--radius)] border border-transparent bg-muted/60 px-3 text-left text-sm font-semibold text-foreground transition hover:bg-muted aria-[current=page]:border-primary aria-[current=page]:bg-primary/10",
|
|
1945
|
+
onClick: () => onIntent?.({ type: "select-session", sessionId: session.id }),
|
|
1946
|
+
children: session.title
|
|
1947
|
+
},
|
|
1948
|
+
session.id
|
|
1949
|
+
))
|
|
1950
|
+
] })
|
|
1951
|
+
}
|
|
1952
|
+
),
|
|
1953
|
+
activeGroup ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0 border-t border-border px-4 pb-4 pt-3", children: /* @__PURE__ */ jsxRuntime.jsxs(Tabs, { value: activeGroup.id, onValueChange: changeGroup, children: [
|
|
1954
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1899
1955
|
TabsList,
|
|
1900
1956
|
{
|
|
1901
|
-
className: "grid h-10 w-full rounded-[var(--radius)] bg-muted p-0.5 text-
|
|
1957
|
+
className: "grid h-10 w-full rounded-[var(--radius)] bg-muted p-0.5 text-foreground",
|
|
1902
1958
|
style: {
|
|
1903
1959
|
gridTemplateColumns: `repeat(${groups.length}, minmax(0, 1fr))`
|
|
1904
1960
|
},
|
|
@@ -1906,30 +1962,30 @@ function AgentWorkbenchExploreSidebar({
|
|
|
1906
1962
|
TabsTrigger,
|
|
1907
1963
|
{
|
|
1908
1964
|
value: group.id,
|
|
1909
|
-
className: "rounded-md text-sm font-semibold text-
|
|
1965
|
+
className: "rounded-md text-sm font-semibold text-foreground data-[state=active]:border data-[state=active]:border-border data-[state=active]:bg-background",
|
|
1910
1966
|
children: group.label
|
|
1911
1967
|
},
|
|
1912
1968
|
group.id
|
|
1913
1969
|
))
|
|
1914
1970
|
}
|
|
1915
|
-
)
|
|
1916
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1971
|
+
),
|
|
1972
|
+
groups.map((group) => /* @__PURE__ */ jsxRuntime.jsx(TabsContent, { value: group.id, className: "mt-3", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-2 gap-2", children: group.items.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1917
1973
|
"button",
|
|
1918
1974
|
{
|
|
1919
1975
|
type: "button",
|
|
1920
1976
|
"aria-label": item.title,
|
|
1921
1977
|
className: "group relative aspect-[1.27] overflow-hidden rounded-[var(--radius)] border border-border bg-card text-left transition hover:border-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
1922
|
-
style: Number.isFinite(
|
|
1978
|
+
style: Number.isFinite(group.itemAspectRatio) && Number(group.itemAspectRatio) > 0 ? { aspectRatio: group.itemAspectRatio } : void 0,
|
|
1923
1979
|
onClick: () => onIntent?.({
|
|
1924
1980
|
type: "select-item",
|
|
1925
|
-
groupId:
|
|
1981
|
+
groupId: group.id,
|
|
1926
1982
|
item
|
|
1927
1983
|
}),
|
|
1928
|
-
children: renderItemMedia?.(item,
|
|
1984
|
+
children: renderItemMedia?.(item, group) ?? /* @__PURE__ */ jsxRuntime.jsx(AgentWorkbenchExploreCardMedia, { item })
|
|
1929
1985
|
},
|
|
1930
1986
|
item.id
|
|
1931
|
-
)) })
|
|
1932
|
-
] }) : null
|
|
1987
|
+
)) }) }, group.id))
|
|
1988
|
+
] }) }) : null
|
|
1933
1989
|
]
|
|
1934
1990
|
}
|
|
1935
1991
|
);
|