@inf-monkeys-tech/monkeys-design 1.0.32 → 1.0.33-canary.121.1.e143e73
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.js +65 -52
- package/dist/components/agent-workbench/index.js.map +1 -1
- package/dist/components/agent-workbench/index.mjs +66 -53
- package/dist/components/agent-workbench/index.mjs.map +1 -1
- package/dist/components/base/index.js +1 -0
- package/dist/components/base/index.js.map +1 -1
- package/dist/components/base/index.mjs +1 -0
- package/dist/components/base/index.mjs.map +1 -1
- package/dist/components/data-explorer/index.js +1 -0
- package/dist/components/data-explorer/index.js.map +1 -1
- package/dist/components/data-explorer/index.mjs +1 -0
- package/dist/components/data-explorer/index.mjs.map +1 -1
- package/dist/components/layout/index.js +1 -0
- package/dist/components/layout/index.js.map +1 -1
- package/dist/components/layout/index.mjs +1 -0
- package/dist/components/layout/index.mjs.map +1 -1
- package/dist/components/runtime/index.js +1 -0
- package/dist/components/runtime/index.js.map +1 -1
- package/dist/components/runtime/index.mjs +1 -0
- package/dist/components/runtime/index.mjs.map +1 -1
- package/dist/components/toast/index.d.mts +1 -1
- package/dist/components/toast/index.d.ts +1 -1
- package/dist/components/toast/index.js +1 -0
- package/dist/components/toast/index.js.map +1 -1
- package/dist/components/toast/index.mjs +1 -0
- package/dist/components/toast/index.mjs.map +1 -1
- package/dist/components/toolbar/index.js +1 -0
- package/dist/components/toolbar/index.js.map +1 -1
- package/dist/components/toolbar/index.mjs +1 -0
- package/dist/components/toolbar/index.mjs.map +1 -1
- package/dist/components/workbench/index.js +1 -0
- package/dist/components/workbench/index.js.map +1 -1
- package/dist/components/workbench/index.mjs +1 -0
- package/dist/components/workbench/index.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +66 -52
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +67 -53
- package/dist/index.mjs.map +1 -1
- package/dist/locale/index.d.mts +4 -2
- package/dist/locale/index.d.ts +4 -2
- package/dist/locale/index.js +2 -0
- package/dist/locale/index.js.map +1 -1
- package/dist/locale/index.mjs +2 -0
- package/dist/locale/index.mjs.map +1 -1
- package/dist/provider/index.d.mts +2 -2
- package/dist/provider/index.d.ts +2 -2
- package/dist/provider/index.js +2 -0
- package/dist/provider/index.js.map +1 -1
- package/dist/provider/index.mjs +2 -0
- package/dist/provider/index.mjs.map +1 -1
- package/dist/{types-8f8d24939b8e.d.mts → types-055c43c39002.d.mts} +1 -0
- package/dist/{types-8f8d24939b8e.d.ts → types-055c43c39002.d.ts} +1 -0
- package/package.json +1 -1
|
@@ -240,6 +240,7 @@ var enUS = {
|
|
|
240
240
|
recentSessions: "Recent Sessions",
|
|
241
241
|
chat: "Chat",
|
|
242
242
|
work: "Work",
|
|
243
|
+
chats: "Chats",
|
|
243
244
|
builtIn: "Built-in",
|
|
244
245
|
noDescription: "No description",
|
|
245
246
|
loading: "Loading...",
|
|
@@ -988,7 +989,7 @@ function SessionMeta({ item, locale }) {
|
|
|
988
989
|
const messages = useMonkeysLocaleMessages().agentWorkbench.navigation;
|
|
989
990
|
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 items-center gap-1.5", children: [
|
|
990
991
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate text-xs text-foreground/80", children: new Intl.DateTimeFormat(locale, { dateStyle: "medium", timeStyle: "short" }).format(new Date(item.updatedAt)) }),
|
|
991
|
-
item.mode ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn2("shrink-0 rounded-full px-1.5 py-0.5 text-[10px] font-medium leading-none", item.mode === "work" ? "bg-primary/10 text-primary" : "bg-muted text-
|
|
992
|
+
item.mode ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn2("shrink-0 rounded-full px-1.5 py-0.5 text-[10px] font-medium leading-none", item.mode === "work" ? "bg-primary/10 text-primary" : "bg-muted text-foreground"), children: item.mode === "work" ? messages.work : messages.chat }) : null
|
|
992
993
|
] });
|
|
993
994
|
}
|
|
994
995
|
function CollectionState({
|
|
@@ -1076,6 +1077,8 @@ function AgentWorkbenchSidebar({
|
|
|
1076
1077
|
() => viewModel.sessions.items.filter((item) => !query || item.title.toLocaleLowerCase().includes(query)),
|
|
1077
1078
|
[query, viewModel.sessions.items]
|
|
1078
1079
|
);
|
|
1080
|
+
const chatbotSessions = React2.useMemo(() => sessions.filter((item) => item.mode !== "work"), [sessions]);
|
|
1081
|
+
const agentSessions = React2.useMemo(() => sessions.filter((item) => item.mode === "work"), [sessions]);
|
|
1079
1082
|
React2.useEffect(() => {
|
|
1080
1083
|
const handleShortcut = (event) => {
|
|
1081
1084
|
if (!(event.ctrlKey || event.metaKey) || event.key.toLocaleLowerCase() !== "k") return;
|
|
@@ -1106,6 +1109,56 @@ function AgentWorkbenchSidebar({
|
|
|
1106
1109
|
}
|
|
1107
1110
|
cancelRenameSession();
|
|
1108
1111
|
};
|
|
1112
|
+
const renderSessionItems = (items) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-1", children: items.map((item) => {
|
|
1113
|
+
const percent = item.contextUsage && item.contextUsage.maxTokens > 0 ? Math.min(100, Math.round(item.contextUsage.usedTokens / item.contextUsage.maxTokens * 100)) : void 0;
|
|
1114
|
+
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: [
|
|
1115
|
+
editingSessionId === item.id ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-3", children: [
|
|
1116
|
+
/* @__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 }) }),
|
|
1117
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "min-w-0 flex-1", children: [
|
|
1118
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1119
|
+
"input",
|
|
1120
|
+
{
|
|
1121
|
+
ref: renameInputRef,
|
|
1122
|
+
value: editingTitle,
|
|
1123
|
+
"aria-label": messages.rename,
|
|
1124
|
+
className: "h-6 w-full rounded border border-primary bg-background px-1.5 text-sm font-medium outline-none",
|
|
1125
|
+
onChange: (event) => setEditingTitle(event.target.value),
|
|
1126
|
+
onClick: (event) => event.stopPropagation(),
|
|
1127
|
+
onBlur: () => saveRenameSession(item),
|
|
1128
|
+
onKeyDown: (event) => {
|
|
1129
|
+
event.stopPropagation();
|
|
1130
|
+
if (event.key === "Enter") {
|
|
1131
|
+
event.preventDefault();
|
|
1132
|
+
saveRenameSession(item);
|
|
1133
|
+
} else if (event.key === "Escape") {
|
|
1134
|
+
event.preventDefault();
|
|
1135
|
+
cancelRenameSession();
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
),
|
|
1140
|
+
/* @__PURE__ */ jsxRuntime.jsx(SessionMeta, { item, locale })
|
|
1141
|
+
] })
|
|
1142
|
+
] }) : /* @__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: [
|
|
1143
|
+
/* @__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 }) }),
|
|
1144
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "min-w-0 flex-1", children: [
|
|
1145
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "block truncate text-sm font-medium", children: item.title }),
|
|
1146
|
+
/* @__PURE__ */ jsxRuntime.jsx(SessionMeta, { item, locale })
|
|
1147
|
+
] })
|
|
1148
|
+
] }),
|
|
1149
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-1", children: [
|
|
1150
|
+
percent !== void 0 && item.status === "idle" ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xs text-foreground", "aria-label": messages.contextUsage({ percent }), children: [
|
|
1151
|
+
percent,
|
|
1152
|
+
"%"
|
|
1153
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx(StatusIndicator, { status: item.status }),
|
|
1154
|
+
viewModel.capabilities.pinSessions ? /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", "aria-label": item.pinned ? messages.unpin : messages.pin, className: cn2("flex size-8 items-center justify-center rounded-md text-muted-foreground opacity-0 hover:bg-muted group-hover:opacity-100", item.pinned && "text-primary opacity-100"), onClick: (event) => {
|
|
1155
|
+
event.stopPropagation();
|
|
1156
|
+
onIntent?.({ type: "toggle-session-pin", sessionId: item.id, pinned: !item.pinned });
|
|
1157
|
+
}, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Pin, { className: cn2("size-4", item.pinned && "fill-current") }) }) : null,
|
|
1158
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { onClick: (event) => event.stopPropagation(), onKeyDown: (event) => event.stopPropagation(), children: /* @__PURE__ */ jsxRuntime.jsx(SessionActions, { item, capabilities: viewModel.capabilities, onIntent: (intent) => intent.type === "rename-session" ? beginRenameSession(item) : onIntent?.(intent) }) })
|
|
1159
|
+
] })
|
|
1160
|
+
] }, item.id);
|
|
1161
|
+
}) });
|
|
1109
1162
|
return /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": messages.tabsLabel, className: cn2("h-full min-h-0", classNames?.root, className), children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1110
1163
|
Tabs,
|
|
1111
1164
|
{
|
|
@@ -1200,58 +1253,18 @@ function AgentWorkbenchSidebar({
|
|
|
1200
1253
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Blocks, { className: "size-4", "aria-hidden": "true" }),
|
|
1201
1254
|
messages.capabilities
|
|
1202
1255
|
] }) : null,
|
|
1203
|
-
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "mb-2 px-3 text-xs font-medium text-muted-foreground", children: messages.recentSessions }),
|
|
1256
|
+
!sessionsOnly ? /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "mb-2 px-3 text-xs font-medium text-muted-foreground", children: messages.recentSessions }) : null,
|
|
1204
1257
|
/* @__PURE__ */ jsxRuntime.jsx(CollectionState, { status: viewModel.sessions.status, empty: messages.emptySessions, noResults: messages.noResults, hasItems: sessions.length > 0, query, error: viewModel.sessions.error, onRetry: () => onIntent?.({ type: "retry-sessions" }) }),
|
|
1205
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
value: editingTitle,
|
|
1216
|
-
"aria-label": messages.rename,
|
|
1217
|
-
className: "h-6 w-full rounded border border-primary bg-background px-1.5 text-sm font-medium outline-none",
|
|
1218
|
-
onChange: (event) => setEditingTitle(event.target.value),
|
|
1219
|
-
onClick: (event) => event.stopPropagation(),
|
|
1220
|
-
onBlur: () => saveRenameSession(item),
|
|
1221
|
-
onKeyDown: (event) => {
|
|
1222
|
-
event.stopPropagation();
|
|
1223
|
-
if (event.key === "Enter") {
|
|
1224
|
-
event.preventDefault();
|
|
1225
|
-
saveRenameSession(item);
|
|
1226
|
-
} else if (event.key === "Escape") {
|
|
1227
|
-
event.preventDefault();
|
|
1228
|
-
cancelRenameSession();
|
|
1229
|
-
}
|
|
1230
|
-
}
|
|
1231
|
-
}
|
|
1232
|
-
),
|
|
1233
|
-
/* @__PURE__ */ jsxRuntime.jsx(SessionMeta, { item, locale })
|
|
1234
|
-
] })
|
|
1235
|
-
] }) : /* @__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: [
|
|
1236
|
-
/* @__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 }) }),
|
|
1237
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "min-w-0 flex-1", children: [
|
|
1238
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "block truncate text-sm font-medium", children: item.title }),
|
|
1239
|
-
/* @__PURE__ */ jsxRuntime.jsx(SessionMeta, { item, locale })
|
|
1240
|
-
] })
|
|
1241
|
-
] }),
|
|
1242
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-1", children: [
|
|
1243
|
-
percent !== void 0 && item.status === "idle" ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xs text-foreground", "aria-label": messages.contextUsage({ percent }), children: [
|
|
1244
|
-
percent,
|
|
1245
|
-
"%"
|
|
1246
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsx(StatusIndicator, { status: item.status }),
|
|
1247
|
-
viewModel.capabilities.pinSessions ? /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", "aria-label": item.pinned ? messages.unpin : messages.pin, className: cn2("flex size-8 items-center justify-center rounded-md text-muted-foreground opacity-0 hover:bg-muted group-hover:opacity-100", item.pinned && "text-primary opacity-100"), onClick: (event) => {
|
|
1248
|
-
event.stopPropagation();
|
|
1249
|
-
onIntent?.({ type: "toggle-session-pin", sessionId: item.id, pinned: !item.pinned });
|
|
1250
|
-
}, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Pin, { className: cn2("size-4", item.pinned && "fill-current") }) }) : null,
|
|
1251
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { onClick: (event) => event.stopPropagation(), onKeyDown: (event) => event.stopPropagation(), children: /* @__PURE__ */ jsxRuntime.jsx(SessionActions, { item, capabilities: viewModel.capabilities, onIntent: (intent) => intent.type === "rename-session" ? beginRenameSession(item) : onIntent?.(intent) }) })
|
|
1252
|
-
] })
|
|
1253
|
-
] }, item.id);
|
|
1254
|
-
}) })
|
|
1258
|
+
sessionsOnly && sessions.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2", children: [
|
|
1259
|
+
{ id: "chatbot", label: messages.chats, icon: lucideReact.SquarePen, items: chatbotSessions },
|
|
1260
|
+
{ id: "agent", label: messages.agents, icon: lucideReact.Bot, items: agentSessions }
|
|
1261
|
+
].map(({ id, label, icon: Icon2, items }) => /* @__PURE__ */ jsxRuntime.jsxs("details", { open: true, "aria-label": label, children: [
|
|
1262
|
+
/* @__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: [
|
|
1263
|
+
/* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "size-4 text-muted-foreground", "aria-hidden": "true" }),
|
|
1264
|
+
label
|
|
1265
|
+
] }),
|
|
1266
|
+
renderSessionItems(items)
|
|
1267
|
+
] }, id)) }) : !sessionsOnly ? renderSessionItems(sessions) : null
|
|
1255
1268
|
] }),
|
|
1256
1269
|
!sessionsOnly && viewModel.capabilities.manageAgentSettings ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn2("shrink-0 border-t border-border p-4", classNames?.footer), children: /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: "flex h-10 w-full items-center gap-2 rounded-md px-3 text-left text-sm font-medium hover:bg-muted", onClick: () => onIntent?.({ type: "open-agent-settings" }), children: [
|
|
1257
1270
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Settings, { className: "size-4", "aria-hidden": "true" }),
|