@nomad-e/bluma-cli 0.6.7 → 0.6.8
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/main.js +826 -567
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -24816,6 +24816,12 @@ function sanitizeConversationForProvider(conversationHistory) {
|
|
|
24816
24816
|
}
|
|
24817
24817
|
droppingCorruptTurn = false;
|
|
24818
24818
|
}
|
|
24819
|
+
if (msg?.role === "user" && msg?.name === "ui_slash_command") {
|
|
24820
|
+
continue;
|
|
24821
|
+
}
|
|
24822
|
+
if (msg?.role === "user" && msg?.name === "ui_slash_command_local") {
|
|
24823
|
+
continue;
|
|
24824
|
+
}
|
|
24819
24825
|
const toolCalls = Array.isArray(msg?.tool_calls) ? msg.tool_calls : null;
|
|
24820
24826
|
if (msg?.role === "assistant" && toolCalls && toolCalls.length > 0) {
|
|
24821
24827
|
const invalidCalls = toolCalls.filter(
|
|
@@ -24838,7 +24844,7 @@ function sanitizeConversationForProvider(conversationHistory) {
|
|
|
24838
24844
|
function partitionConversationIntoTurnSlices(conversationHistory) {
|
|
24839
24845
|
const turns = [];
|
|
24840
24846
|
let current = [];
|
|
24841
|
-
const isDevOverlay = (m) => m?.role === "user" && m?.name === "user_overlay";
|
|
24847
|
+
const isDevOverlay = (m) => m?.role === "user" && (m?.name === "user_overlay" || m?.name === "ui_slash_command" || m?.name === "ui_slash_command_local");
|
|
24842
24848
|
for (const msg of conversationHistory) {
|
|
24843
24849
|
if (msg.role === "user" && !isDevOverlay(msg) && current.length > 0) {
|
|
24844
24850
|
turns.push(current);
|
|
@@ -25858,6 +25864,16 @@ var BluMaAgent = class _BluMaAgent {
|
|
|
25858
25864
|
if (!this.sessionFile) return;
|
|
25859
25865
|
void saveSessionHistory(this.sessionFile, this.history, this.getMemorySnapshot());
|
|
25860
25866
|
}
|
|
25867
|
+
recordUiSlashCommand(command, mode = "visible_only") {
|
|
25868
|
+
const text = String(command ?? "").trim();
|
|
25869
|
+
if (!text) return;
|
|
25870
|
+
this.history.push({
|
|
25871
|
+
role: "user",
|
|
25872
|
+
name: mode === "with_internal_prompt" ? "ui_slash_command" : "ui_slash_command_local",
|
|
25873
|
+
content: text
|
|
25874
|
+
});
|
|
25875
|
+
this.persistSession();
|
|
25876
|
+
}
|
|
25861
25877
|
async handleInvalidToolCallRetry(message2) {
|
|
25862
25878
|
this.invalidToolCallRetrySteps += 1;
|
|
25863
25879
|
if (this.history[this.history.length - 1] === message2) {
|
|
@@ -25939,6 +25955,15 @@ var BluMaAgent = class _BluMaAgent {
|
|
|
25939
25955
|
}
|
|
25940
25956
|
}
|
|
25941
25957
|
this.persistSession();
|
|
25958
|
+
const uiHistory = this.history.filter(
|
|
25959
|
+
(m) => m.role !== "system"
|
|
25960
|
+
);
|
|
25961
|
+
if (uiHistory.length > 0) {
|
|
25962
|
+
this.eventBus.emit("backend_message", {
|
|
25963
|
+
type: "session_history",
|
|
25964
|
+
messages: uiHistory
|
|
25965
|
+
});
|
|
25966
|
+
}
|
|
25942
25967
|
}
|
|
25943
25968
|
getAvailableTools() {
|
|
25944
25969
|
return this.mcpClient.getAvailableTools();
|
|
@@ -25971,7 +25996,7 @@ var BluMaAgent = class _BluMaAgent {
|
|
|
25971
25996
|
*
|
|
25972
25997
|
* Smoke manual sugerido: mensagem normal com `message`+`result`; Ctrl+C; erro LLM; loop sem resposta útil.
|
|
25973
25998
|
*/
|
|
25974
|
-
async processTurn(userInput, userContextInput) {
|
|
25999
|
+
async processTurn(userInput, userContextInput, options) {
|
|
25975
26000
|
this.isInterrupted = false;
|
|
25976
26001
|
this.factorRouterTurnClosed = false;
|
|
25977
26002
|
const inputText = String(userInput.content || "").trim();
|
|
@@ -25990,7 +26015,11 @@ var BluMaAgent = class _BluMaAgent {
|
|
|
25990
26015
|
companyName: this.activeTurnContext.companyName ?? null
|
|
25991
26016
|
});
|
|
25992
26017
|
const userContent = buildUserMessageContent(inputText, process.cwd());
|
|
25993
|
-
this.history.push({
|
|
26018
|
+
this.history.push({
|
|
26019
|
+
role: "user",
|
|
26020
|
+
content: userContent,
|
|
26021
|
+
...options?.historyName ? { name: options.historyName } : {}
|
|
26022
|
+
});
|
|
25994
26023
|
this.emptyAssistantReplySteps = 0;
|
|
25995
26024
|
this.invalidToolCallRetrySteps = 0;
|
|
25996
26025
|
this.eventBus.emit(
|
|
@@ -28131,13 +28160,13 @@ var RouteManager = class {
|
|
|
28131
28160
|
}
|
|
28132
28161
|
async handleRoute(payload) {
|
|
28133
28162
|
const inputText = String(payload.content || "").trim();
|
|
28134
|
-
const { userContext } = payload;
|
|
28163
|
+
const { userContext, options } = payload;
|
|
28135
28164
|
for (const [path50, handler] of this.routeHandlers) {
|
|
28136
28165
|
if (inputText === path50 || inputText.startsWith(`${path50} `)) {
|
|
28137
28166
|
return handler({ content: inputText, userContext });
|
|
28138
28167
|
}
|
|
28139
28168
|
}
|
|
28140
|
-
await this.core.processTurn({ content: inputText }, userContext);
|
|
28169
|
+
await this.core.processTurn({ content: inputText }, userContext, options);
|
|
28141
28170
|
}
|
|
28142
28171
|
};
|
|
28143
28172
|
|
|
@@ -28298,7 +28327,7 @@ var Agent = class {
|
|
|
28298
28327
|
getFeedbackScore() {
|
|
28299
28328
|
return this.core.getFeedbackScore();
|
|
28300
28329
|
}
|
|
28301
|
-
async processTurn(userInput, userContextInput) {
|
|
28330
|
+
async processTurn(userInput, userContextInput, options) {
|
|
28302
28331
|
const inputText = String(userInput.content || "").trim();
|
|
28303
28332
|
const resolvedUserContext = userContextInput ?? defaultInteractiveCliUserContextInput(this.sessionId, inputText.slice(0, 300));
|
|
28304
28333
|
if (this.factorAiAppContext && !resolvedUserContext.appContext) {
|
|
@@ -28310,7 +28339,14 @@ var Agent = class {
|
|
|
28310
28339
|
if (inputText === "/coordinator" || inputText.startsWith("/coordinator ")) {
|
|
28311
28340
|
this.routeManager.registerRoute("/coordinator", this.handleCoordinatorCommand.bind(this));
|
|
28312
28341
|
}
|
|
28313
|
-
await this.routeManager.handleRoute({
|
|
28342
|
+
await this.routeManager.handleRoute({
|
|
28343
|
+
content: inputText,
|
|
28344
|
+
userContext: resolvedUserContext,
|
|
28345
|
+
options
|
|
28346
|
+
});
|
|
28347
|
+
}
|
|
28348
|
+
recordUiSlashCommand(command, mode = "visible_only") {
|
|
28349
|
+
this.core.recordUiSlashCommand(command, mode);
|
|
28314
28350
|
}
|
|
28315
28351
|
/** Fecha o turno ativo no FactorRouter (idempotente). */
|
|
28316
28352
|
async closeActiveTurn(reason = "worker_exit") {
|
|
@@ -29201,7 +29237,7 @@ var StreamingTextComponent = ({
|
|
|
29201
29237
|
return null;
|
|
29202
29238
|
}
|
|
29203
29239
|
return /* @__PURE__ */ jsx15(ChatBlock, { marginBottom: 1, children: /* @__PURE__ */ jsx15(MessageResponse, { children: hasVisibleContent ? /* @__PURE__ */ jsxs7(Box_default, { flexDirection: "row", alignItems: "flex-start", flexGrow: 1, children: [
|
|
29204
|
-
/* @__PURE__ */ jsx15(Text, { color: BLUMA_TERMINAL.
|
|
29240
|
+
/* @__PURE__ */ jsx15(Text, { color: BLUMA_TERMINAL.subtle, children: "\u2022" }),
|
|
29205
29241
|
/* @__PURE__ */ jsx15(Box_default, { flexDirection: "column", marginLeft: 1, flexGrow: 1, children: /* @__PURE__ */ jsx15(
|
|
29206
29242
|
StreamingMarkdown,
|
|
29207
29243
|
{
|
|
@@ -29619,8 +29655,8 @@ var BlumaShellComponent = ({
|
|
|
29619
29655
|
return /* @__PURE__ */ jsxs11(Box_default, { flexDirection: "column", flexGrow: 1, minHeight: 0, children: [
|
|
29620
29656
|
/* @__PURE__ */ jsx22(Box_default, { flexShrink: 0, children: header }),
|
|
29621
29657
|
/* @__PURE__ */ jsx22(Box_default, { flexDirection: "column", flexGrow: 1, minHeight: 0, width: "100%", children: transcript }),
|
|
29622
|
-
/* @__PURE__ */ jsx22(Box_default, { flexShrink: 0, width: "100%", children:
|
|
29623
|
-
|
|
29658
|
+
floating && /* @__PURE__ */ jsx22(Box_default, { flexShrink: 0, width: "100%", children: floating }),
|
|
29659
|
+
/* @__PURE__ */ jsx22(Box_default, { flexShrink: 0, width: "100%", children: bottomDock })
|
|
29624
29660
|
] });
|
|
29625
29661
|
};
|
|
29626
29662
|
var BlumaShell = memo8(BlumaShellComponent);
|
|
@@ -29959,7 +29995,7 @@ function createTool(entry) {
|
|
|
29959
29995
|
// src/app/ui/components/ToolUseLoader.tsx
|
|
29960
29996
|
import { useEffect as useEffect12, useState as useState13 } from "react";
|
|
29961
29997
|
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
29962
|
-
var BLACK_CIRCLE = "\
|
|
29998
|
+
var BLACK_CIRCLE = "\u2022";
|
|
29963
29999
|
var BLINK_INTERVAL_MS = 400;
|
|
29964
30000
|
function ToolUseLoader({ state: state2 }) {
|
|
29965
30001
|
const [isBlinking, setIsBlinking] = useState13(false);
|
|
@@ -29973,7 +30009,7 @@ function ToolUseLoader({ state: state2 }) {
|
|
|
29973
30009
|
}, BLINK_INTERVAL_MS);
|
|
29974
30010
|
return () => clearInterval(timer);
|
|
29975
30011
|
}, [state2]);
|
|
29976
|
-
const color = state2 === "success" ? BLUMA_TERMINAL.
|
|
30012
|
+
const color = state2 === "success" ? BLUMA_TERMINAL.m3OnSurface : state2 === "error" ? BLUMA_TERMINAL.err : state2 === "running" ? BLUMA_TERMINAL.dim : BLUMA_TERMINAL.muted;
|
|
29977
30013
|
const showDot = state2 !== "running" || isBlinking;
|
|
29978
30014
|
return /* @__PURE__ */ jsx26(Box_default, { minWidth: 2, children: /* @__PURE__ */ jsx26(Text, { color, dimColor: state2 === "pending", children: showDot ? BLACK_CIRCLE : " " }) });
|
|
29979
30015
|
}
|
|
@@ -36845,12 +36881,187 @@ var AssistantMessageDisplayComponent = ({
|
|
|
36845
36881
|
const text = String(content ?? "").trim();
|
|
36846
36882
|
if (!text) return null;
|
|
36847
36883
|
return /* @__PURE__ */ jsx85(MessageResponse2, { children: /* @__PURE__ */ jsxs68(Box_default, { flexDirection: "row", alignItems: "flex-start", children: [
|
|
36848
|
-
/* @__PURE__ */ jsx85(Text, { color: BLUMA_TERMINAL.
|
|
36884
|
+
/* @__PURE__ */ jsx85(Text, { color: BLUMA_TERMINAL.subtle, children: "\u2022" }),
|
|
36849
36885
|
/* @__PURE__ */ jsx85(Box_default, { flexDirection: "column", marginLeft: 1, flexGrow: 1, children: /* @__PURE__ */ jsx85(MarkdownRenderer, { markdown: text }) })
|
|
36850
36886
|
] }) });
|
|
36851
36887
|
};
|
|
36852
36888
|
var AssistantMessageDisplay = memo19(AssistantMessageDisplayComponent);
|
|
36853
36889
|
|
|
36890
|
+
// src/app/ui/utils/sessionHistoryRender.tsx
|
|
36891
|
+
import { jsx as jsx86, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
36892
|
+
function isRecord2(value) {
|
|
36893
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
36894
|
+
}
|
|
36895
|
+
function parseJsonMaybe(value) {
|
|
36896
|
+
if (typeof value !== "string") return value;
|
|
36897
|
+
const trimmed = value.trim();
|
|
36898
|
+
if (!trimmed) return value;
|
|
36899
|
+
try {
|
|
36900
|
+
return JSON.parse(trimmed);
|
|
36901
|
+
} catch {
|
|
36902
|
+
return value;
|
|
36903
|
+
}
|
|
36904
|
+
}
|
|
36905
|
+
function extractTextParts(content) {
|
|
36906
|
+
if (typeof content === "string") {
|
|
36907
|
+
const trimmed = content.trim();
|
|
36908
|
+
if (!trimmed) return "";
|
|
36909
|
+
if (trimmed.startsWith("[") && trimmed.endsWith("]") || trimmed.startsWith("{") && trimmed.endsWith("}")) {
|
|
36910
|
+
try {
|
|
36911
|
+
return extractTextParts(JSON.parse(trimmed));
|
|
36912
|
+
} catch {
|
|
36913
|
+
return trimmed;
|
|
36914
|
+
}
|
|
36915
|
+
}
|
|
36916
|
+
return trimmed;
|
|
36917
|
+
}
|
|
36918
|
+
if (!Array.isArray(content)) {
|
|
36919
|
+
return "";
|
|
36920
|
+
}
|
|
36921
|
+
const parts = [];
|
|
36922
|
+
for (const part of content) {
|
|
36923
|
+
if (!isRecord2(part)) continue;
|
|
36924
|
+
if (part.type === "text" && typeof part.text === "string") {
|
|
36925
|
+
const text = part.text.trim();
|
|
36926
|
+
if (text) parts.push(text);
|
|
36927
|
+
}
|
|
36928
|
+
}
|
|
36929
|
+
return parts.join("\n").trim();
|
|
36930
|
+
}
|
|
36931
|
+
function renderUserContent(content) {
|
|
36932
|
+
if (typeof content === "string") {
|
|
36933
|
+
const raw = content.trim();
|
|
36934
|
+
if (!raw) return null;
|
|
36935
|
+
const paths2 = collectImagePathStrings(raw);
|
|
36936
|
+
const stripped = paths2.length > 0 ? stripImagePathStrings(raw, paths2) : raw;
|
|
36937
|
+
return /* @__PURE__ */ jsx86(ChatUserMessage, { children: paths2.length > 0 ? /* @__PURE__ */ jsx86(
|
|
36938
|
+
ChatUserImageBlock,
|
|
36939
|
+
{
|
|
36940
|
+
imageCount: paths2.length,
|
|
36941
|
+
caption: stripped.trim().length > 0 ? stripped : null,
|
|
36942
|
+
captionDim: true
|
|
36943
|
+
}
|
|
36944
|
+
) : /* @__PURE__ */ jsx86(Text, { color: BLUMA_TERMINAL.m3OnSurface, wrap: "wrap", children: raw }) });
|
|
36945
|
+
}
|
|
36946
|
+
if (!Array.isArray(content)) {
|
|
36947
|
+
const fallback = String(content ?? "").trim();
|
|
36948
|
+
if (!fallback || fallback === "[]") return null;
|
|
36949
|
+
return /* @__PURE__ */ jsx86(ChatUserMessage, { children: /* @__PURE__ */ jsx86(Text, { color: BLUMA_TERMINAL.m3OnSurface, wrap: "wrap", children: fallback }) });
|
|
36950
|
+
}
|
|
36951
|
+
const imageParts = content.filter((part) => {
|
|
36952
|
+
if (!isRecord2(part)) return false;
|
|
36953
|
+
return part.type === "image_url" || part.type === "input_image" || "image_url" in part;
|
|
36954
|
+
});
|
|
36955
|
+
const text = extractTextParts(content);
|
|
36956
|
+
if (imageParts.length === 0 && !text) {
|
|
36957
|
+
return null;
|
|
36958
|
+
}
|
|
36959
|
+
return /* @__PURE__ */ jsx86(ChatUserMessage, { children: imageParts.length > 0 ? /* @__PURE__ */ jsx86(
|
|
36960
|
+
ChatUserImageBlock,
|
|
36961
|
+
{
|
|
36962
|
+
imageCount: imageParts.length,
|
|
36963
|
+
caption: text.length > 0 ? text : null,
|
|
36964
|
+
captionDim: true
|
|
36965
|
+
}
|
|
36966
|
+
) : /* @__PURE__ */ jsx86(Text, { color: BLUMA_TERMINAL.m3OnSurface, wrap: "wrap", children: text }) });
|
|
36967
|
+
}
|
|
36968
|
+
function renderSlashCommand(content) {
|
|
36969
|
+
const raw = String(content ?? "").trim();
|
|
36970
|
+
if (!raw) return null;
|
|
36971
|
+
return /* @__PURE__ */ jsx86(ChatUserMessage, { children: /* @__PURE__ */ jsx86(Text, { color: BLUMA_TERMINAL.m3OnSurface, wrap: "wrap", children: raw }) });
|
|
36972
|
+
}
|
|
36973
|
+
function renderAssistantContent(content) {
|
|
36974
|
+
const text = extractTextParts(content);
|
|
36975
|
+
if (!text) return null;
|
|
36976
|
+
return /* @__PURE__ */ jsx86(AssistantMessageDisplay, { content: text });
|
|
36977
|
+
}
|
|
36978
|
+
function renderToolResultFallback(toolName, result) {
|
|
36979
|
+
const text = (() => {
|
|
36980
|
+
if (typeof result === "string") return result.trim() || "Tool execution completed.";
|
|
36981
|
+
if (result == null) return "Tool execution completed.";
|
|
36982
|
+
try {
|
|
36983
|
+
return JSON.stringify(result, null, 2) || "Tool execution completed.";
|
|
36984
|
+
} catch {
|
|
36985
|
+
return String(result);
|
|
36986
|
+
}
|
|
36987
|
+
})();
|
|
36988
|
+
return /* @__PURE__ */ jsx86(ChatBlock, { marginBottom: 1, children: /* @__PURE__ */ jsx86(MessageResponse, { children: /* @__PURE__ */ jsxs69(Box_default, { flexDirection: "column", children: [
|
|
36989
|
+
/* @__PURE__ */ jsx86(Text, { bold: true, color: BLUMA_TERMINAL.m3OnSurface, children: toolName }),
|
|
36990
|
+
/* @__PURE__ */ jsx86(Box_default, { paddingLeft: 1, marginTop: 0, children: /* @__PURE__ */ jsx86(Text, { color: BLUMA_TERMINAL.m3OnSurface, wrap: "wrap", children: text }) })
|
|
36991
|
+
] }) }) });
|
|
36992
|
+
}
|
|
36993
|
+
function buildRestoredHistoryItems(messages, startId) {
|
|
36994
|
+
const items = [];
|
|
36995
|
+
const toolRegistry = /* @__PURE__ */ new Map();
|
|
36996
|
+
let nextId2 = startId;
|
|
36997
|
+
let skipNextUserAfterSlashMarker = false;
|
|
36998
|
+
for (const rawMsg of messages) {
|
|
36999
|
+
const msg = rawMsg;
|
|
37000
|
+
const role = String(msg?.role ?? "");
|
|
37001
|
+
const name = String(msg?.name ?? "");
|
|
37002
|
+
if (role === "user" && name === "ui_internal_prompt") {
|
|
37003
|
+
continue;
|
|
37004
|
+
}
|
|
37005
|
+
if (role === "user") {
|
|
37006
|
+
if (skipNextUserAfterSlashMarker) {
|
|
37007
|
+
skipNextUserAfterSlashMarker = false;
|
|
37008
|
+
continue;
|
|
37009
|
+
}
|
|
37010
|
+
const component = name === "ui_slash_command" || name === "ui_slash_command_local" ? (() => {
|
|
37011
|
+
skipNextUserAfterSlashMarker = name === "ui_slash_command";
|
|
37012
|
+
return renderSlashCommand(msg.content);
|
|
37013
|
+
})() : renderUserContent(msg.content);
|
|
37014
|
+
if (component) {
|
|
37015
|
+
items.push({ id: nextId2++, component });
|
|
37016
|
+
}
|
|
37017
|
+
continue;
|
|
37018
|
+
}
|
|
37019
|
+
if (role === "assistant") {
|
|
37020
|
+
const toolCalls = Array.isArray(msg.tool_calls) ? msg.tool_calls : [];
|
|
37021
|
+
for (const call of toolCalls) {
|
|
37022
|
+
const toolCallId = String(call?.id ?? "").trim();
|
|
37023
|
+
const toolName = String(call?.function?.name ?? "").trim();
|
|
37024
|
+
const args = parseJsonMaybe(call?.function?.arguments);
|
|
37025
|
+
if (toolCallId && toolName) {
|
|
37026
|
+
toolRegistry.set(toolCallId, { name: toolName, args });
|
|
37027
|
+
}
|
|
37028
|
+
}
|
|
37029
|
+
const assistantComponent = renderAssistantContent(msg.content);
|
|
37030
|
+
if (assistantComponent) {
|
|
37031
|
+
items.push({ id: nextId2++, component: assistantComponent });
|
|
37032
|
+
}
|
|
37033
|
+
continue;
|
|
37034
|
+
}
|
|
37035
|
+
if (role === "tool") {
|
|
37036
|
+
const toolCallId = String(msg.tool_call_id ?? "").trim();
|
|
37037
|
+
const registryEntry = toolCallId ? toolRegistry.get(toolCallId) : void 0;
|
|
37038
|
+
const toolName = String(msg.name ?? registryEntry?.name ?? "tool").trim() || "tool";
|
|
37039
|
+
const args = registryEntry?.args;
|
|
37040
|
+
items.push({
|
|
37041
|
+
id: nextId2++,
|
|
37042
|
+
component: /* @__PURE__ */ jsx86(
|
|
37043
|
+
ToolMessage,
|
|
37044
|
+
{
|
|
37045
|
+
toolName,
|
|
37046
|
+
args,
|
|
37047
|
+
result: msg.content,
|
|
37048
|
+
toolCallId: toolCallId || void 0
|
|
37049
|
+
}
|
|
37050
|
+
)
|
|
37051
|
+
});
|
|
37052
|
+
continue;
|
|
37053
|
+
}
|
|
37054
|
+
const genericText = extractTextParts(msg.content) || String(msg.content ?? "").trim();
|
|
37055
|
+
if (genericText) {
|
|
37056
|
+
items.push({
|
|
37057
|
+
id: nextId2++,
|
|
37058
|
+
component: renderToolResultFallback(role || "message", genericText)
|
|
37059
|
+
});
|
|
37060
|
+
}
|
|
37061
|
+
}
|
|
37062
|
+
return items;
|
|
37063
|
+
}
|
|
37064
|
+
|
|
36854
37065
|
// src/app/ui/components/SlashCommands.tsx
|
|
36855
37066
|
import { useEffect as useEffect17, useRef as useRef7, useState as useState19 } from "react";
|
|
36856
37067
|
|
|
@@ -36861,18 +37072,18 @@ var HEADER_PANEL_HISTORY_ID = 0;
|
|
|
36861
37072
|
var COMMAND_HEADER_COLOR = BLUMA_TERMINAL.accent;
|
|
36862
37073
|
|
|
36863
37074
|
// src/app/ui/components/slash-commands/commandHelpers.tsx
|
|
36864
|
-
import { Fragment as Fragment11, jsx as
|
|
36865
|
-
var outBox = (children) => /* @__PURE__ */
|
|
37075
|
+
import { Fragment as Fragment11, jsx as jsx87, jsxs as jsxs70 } from "react/jsx-runtime";
|
|
37076
|
+
var outBox = (children) => /* @__PURE__ */ jsx87(ChatBlock, { marginBottom: 0, children: /* @__PURE__ */ jsx87(MessageResponse, { children: /* @__PURE__ */ jsx87(Box_default, { paddingLeft: 1, flexDirection: "column", children }) }) });
|
|
36866
37077
|
var usageBox = (title, body) => outBox(
|
|
36867
|
-
/* @__PURE__ */
|
|
36868
|
-
/* @__PURE__ */
|
|
36869
|
-
/* @__PURE__ */
|
|
37078
|
+
/* @__PURE__ */ jsxs70(Fragment11, { children: [
|
|
37079
|
+
/* @__PURE__ */ jsx87(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: title }),
|
|
37080
|
+
/* @__PURE__ */ jsx87(Text, { dimColor: true, children: body })
|
|
36870
37081
|
] })
|
|
36871
37082
|
);
|
|
36872
37083
|
|
|
36873
37084
|
// src/app/ui/components/slash-commands/SlashCommandMenu.tsx
|
|
36874
37085
|
import { memo as memo20, useEffect as useEffect16, useMemo as useMemo6, useState as useState18 } from "react";
|
|
36875
|
-
import { jsx as
|
|
37086
|
+
import { jsx as jsx88, jsxs as jsxs71 } from "react/jsx-runtime";
|
|
36876
37087
|
function normalizeOptions(options) {
|
|
36877
37088
|
return Array.isArray(options) ? options.filter((option) => option && typeof option.label === "string") : [];
|
|
36878
37089
|
}
|
|
@@ -36920,7 +37131,7 @@ var SlashCommandMenuComponent = ({
|
|
|
36920
37131
|
}
|
|
36921
37132
|
}, { isActive: true });
|
|
36922
37133
|
if (normalizedOptions.length === 0) {
|
|
36923
|
-
return /* @__PURE__ */
|
|
37134
|
+
return /* @__PURE__ */ jsx88(
|
|
36924
37135
|
Box_default,
|
|
36925
37136
|
{
|
|
36926
37137
|
flexDirection: "column",
|
|
@@ -36930,11 +37141,11 @@ var SlashCommandMenuComponent = ({
|
|
|
36930
37141
|
backgroundColor: BLUMA_TERMINAL.surfaceVariant,
|
|
36931
37142
|
paddingX: 2,
|
|
36932
37143
|
paddingY: 1,
|
|
36933
|
-
children: /* @__PURE__ */
|
|
37144
|
+
children: /* @__PURE__ */ jsx88(Text, { color: BLUMA_TERMINAL.err, children: "No options available" })
|
|
36934
37145
|
}
|
|
36935
37146
|
);
|
|
36936
37147
|
}
|
|
36937
|
-
return /* @__PURE__ */
|
|
37148
|
+
return /* @__PURE__ */ jsxs71(
|
|
36938
37149
|
Box_default,
|
|
36939
37150
|
{
|
|
36940
37151
|
flexDirection: "column",
|
|
@@ -36945,32 +37156,32 @@ var SlashCommandMenuComponent = ({
|
|
|
36945
37156
|
paddingX: 2,
|
|
36946
37157
|
paddingY: 1,
|
|
36947
37158
|
children: [
|
|
36948
|
-
/* @__PURE__ */
|
|
36949
|
-
/* @__PURE__ */
|
|
36950
|
-
/* @__PURE__ */
|
|
37159
|
+
/* @__PURE__ */ jsxs71(Box_default, { flexDirection: "row", justifyContent: "space-between", flexWrap: "wrap", children: [
|
|
37160
|
+
/* @__PURE__ */ jsx88(Text, { bold: true, color: BLUMA_TERMINAL.blue, children: title }),
|
|
37161
|
+
/* @__PURE__ */ jsxs71(Text, { dimColor: true, children: [
|
|
36951
37162
|
selectedIndex + 1,
|
|
36952
37163
|
"/",
|
|
36953
37164
|
normalizedOptions.length
|
|
36954
37165
|
] })
|
|
36955
37166
|
] }),
|
|
36956
|
-
subtitle ? /* @__PURE__ */
|
|
36957
|
-
/* @__PURE__ */
|
|
37167
|
+
subtitle ? /* @__PURE__ */ jsx88(Text, { dimColor: true, wrap: "wrap", children: subtitle }) : null,
|
|
37168
|
+
/* @__PURE__ */ jsx88(Box_default, { marginTop: 1, flexDirection: "column", children: normalizedOptions.map((option, index) => {
|
|
36958
37169
|
const isSelected = index === selectedIndex;
|
|
36959
|
-
return /* @__PURE__ */
|
|
36960
|
-
/* @__PURE__ */
|
|
37170
|
+
return /* @__PURE__ */ jsxs71(Box_default, { flexDirection: "column", marginBottom: 0, children: [
|
|
37171
|
+
/* @__PURE__ */ jsxs71(Text, { color: isSelected ? BLUMA_TERMINAL.blue : void 0, bold: isSelected, dimColor: !isSelected, wrap: "wrap", children: [
|
|
36961
37172
|
"(",
|
|
36962
37173
|
index + 1,
|
|
36963
37174
|
") ",
|
|
36964
37175
|
option.label
|
|
36965
37176
|
] }),
|
|
36966
|
-
option.description ? /* @__PURE__ */
|
|
37177
|
+
option.description ? /* @__PURE__ */ jsxs71(Text, { dimColor: true, wrap: "wrap", children: [
|
|
36967
37178
|
" ",
|
|
36968
37179
|
option.description
|
|
36969
37180
|
] }) : null
|
|
36970
37181
|
] }, `${option.label}-${index}`);
|
|
36971
37182
|
}) }),
|
|
36972
|
-
/* @__PURE__ */
|
|
36973
|
-
footer ? /* @__PURE__ */
|
|
37183
|
+
/* @__PURE__ */ jsx88(Box_default, { marginTop: 1, children: /* @__PURE__ */ jsx88(Text, { dimColor: true, children: "Enter to confirm \xB7 \u2191\u2193 choose \xB7 Esc cancel" }) }),
|
|
37184
|
+
footer ? /* @__PURE__ */ jsx88(Box_default, { marginTop: 1, children: /* @__PURE__ */ jsx88(Text, { dimColor: true, wrap: "wrap", children: footer }) }) : null
|
|
36974
37185
|
]
|
|
36975
37186
|
}
|
|
36976
37187
|
);
|
|
@@ -36982,20 +37193,20 @@ init_runtime_config();
|
|
|
36982
37193
|
|
|
36983
37194
|
// src/app/ui/components/slash-commands/renderers/sessionRenderers.tsx
|
|
36984
37195
|
init_session_registry();
|
|
36985
|
-
import { Fragment as Fragment12, jsx as
|
|
37196
|
+
import { Fragment as Fragment12, jsx as jsx89, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
36986
37197
|
var renderSessionsSnapshot = () => {
|
|
36987
37198
|
const sessions = listSessions();
|
|
36988
37199
|
return outBox(
|
|
36989
|
-
/* @__PURE__ */
|
|
36990
|
-
/* @__PURE__ */
|
|
36991
|
-
/* @__PURE__ */
|
|
36992
|
-
/* @__PURE__ */
|
|
37200
|
+
/* @__PURE__ */ jsxs72(Fragment12, { children: [
|
|
37201
|
+
/* @__PURE__ */ jsxs72(Box_default, { marginBottom: 1, children: [
|
|
37202
|
+
/* @__PURE__ */ jsx89(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "Sessions" }),
|
|
37203
|
+
/* @__PURE__ */ jsxs72(Text, { dimColor: true, children: [
|
|
36993
37204
|
" \xB7 ",
|
|
36994
37205
|
sessions.length,
|
|
36995
37206
|
" total"
|
|
36996
37207
|
] })
|
|
36997
37208
|
] }),
|
|
36998
|
-
/* @__PURE__ */
|
|
37209
|
+
/* @__PURE__ */ jsx89(Box_default, { flexDirection: "column", children: sessions.length === 0 ? /* @__PURE__ */ jsx89(Text, { dimColor: true, children: "No sessions registered." }) : sessions.map((session) => /* @__PURE__ */ jsxs72(Text, { dimColor: true, children: [
|
|
36999
37210
|
session.sessionId,
|
|
37000
37211
|
" \xB7 ",
|
|
37001
37212
|
session.status,
|
|
@@ -37012,27 +37223,27 @@ var renderSessionStatus = (sessionId) => {
|
|
|
37012
37223
|
return usageBox("Status", `Session not found: ${sessionId}`);
|
|
37013
37224
|
}
|
|
37014
37225
|
return outBox(
|
|
37015
|
-
/* @__PURE__ */
|
|
37016
|
-
/* @__PURE__ */
|
|
37017
|
-
/* @__PURE__ */
|
|
37018
|
-
/* @__PURE__ */
|
|
37226
|
+
/* @__PURE__ */ jsxs72(Fragment12, { children: [
|
|
37227
|
+
/* @__PURE__ */ jsxs72(Box_default, { marginBottom: 1, children: [
|
|
37228
|
+
/* @__PURE__ */ jsx89(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "Session Status" }),
|
|
37229
|
+
/* @__PURE__ */ jsxs72(Text, { dimColor: true, children: [
|
|
37019
37230
|
" \xB7 ",
|
|
37020
37231
|
session.sessionId
|
|
37021
37232
|
] })
|
|
37022
37233
|
] }),
|
|
37023
|
-
/* @__PURE__ */
|
|
37234
|
+
/* @__PURE__ */ jsxs72(Text, { dimColor: true, children: [
|
|
37024
37235
|
"status: ",
|
|
37025
37236
|
session.status
|
|
37026
37237
|
] }),
|
|
37027
|
-
/* @__PURE__ */
|
|
37238
|
+
/* @__PURE__ */ jsxs72(Text, { dimColor: true, children: [
|
|
37028
37239
|
"started: ",
|
|
37029
37240
|
new Date(session.startedAt).toISOString()
|
|
37030
37241
|
] }),
|
|
37031
|
-
session.updatedAt && /* @__PURE__ */
|
|
37242
|
+
session.updatedAt && /* @__PURE__ */ jsxs72(Text, { dimColor: true, children: [
|
|
37032
37243
|
"updated: ",
|
|
37033
37244
|
new Date(session.updatedAt).toISOString()
|
|
37034
37245
|
] }),
|
|
37035
|
-
session.pid && /* @__PURE__ */
|
|
37246
|
+
session.pid && /* @__PURE__ */ jsxs72(Text, { dimColor: true, children: [
|
|
37036
37247
|
"pid: ",
|
|
37037
37248
|
session.pid
|
|
37038
37249
|
] })
|
|
@@ -37047,10 +37258,10 @@ var renderSessionLogs = (sessionId, lines = 20) => {
|
|
|
37047
37258
|
}
|
|
37048
37259
|
const logLines = readSessionLog(sessionId);
|
|
37049
37260
|
return outBox(
|
|
37050
|
-
/* @__PURE__ */
|
|
37051
|
-
/* @__PURE__ */
|
|
37052
|
-
/* @__PURE__ */
|
|
37053
|
-
/* @__PURE__ */
|
|
37261
|
+
/* @__PURE__ */ jsxs72(Fragment12, { children: [
|
|
37262
|
+
/* @__PURE__ */ jsxs72(Box_default, { marginBottom: 1, children: [
|
|
37263
|
+
/* @__PURE__ */ jsx89(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "Session Logs" }),
|
|
37264
|
+
/* @__PURE__ */ jsxs72(Text, { dimColor: true, children: [
|
|
37054
37265
|
" \xB7 ",
|
|
37055
37266
|
sessionId,
|
|
37056
37267
|
" \xB7 last ",
|
|
@@ -37058,7 +37269,7 @@ var renderSessionLogs = (sessionId, lines = 20) => {
|
|
|
37058
37269
|
" lines"
|
|
37059
37270
|
] })
|
|
37060
37271
|
] }),
|
|
37061
|
-
/* @__PURE__ */
|
|
37272
|
+
/* @__PURE__ */ jsx89(Box_default, { flexDirection: "column", children: logLines.map((line, i) => /* @__PURE__ */ jsx89(Text, { dimColor: true, children: line }, i)) })
|
|
37062
37273
|
] })
|
|
37063
37274
|
);
|
|
37064
37275
|
};
|
|
@@ -37072,23 +37283,23 @@ var renderAttachFollow = (action, sessionId) => {
|
|
|
37072
37283
|
return usageBox(action, `Session not found: ${sessionId}`);
|
|
37073
37284
|
}
|
|
37074
37285
|
return outBox(
|
|
37075
|
-
/* @__PURE__ */
|
|
37076
|
-
/* @__PURE__ */
|
|
37077
|
-
/* @__PURE__ */
|
|
37078
|
-
/* @__PURE__ */
|
|
37286
|
+
/* @__PURE__ */ jsxs72(Fragment12, { children: [
|
|
37287
|
+
/* @__PURE__ */ jsxs72(Box_default, { marginBottom: 1, children: [
|
|
37288
|
+
/* @__PURE__ */ jsx89(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: action === "attach" ? "Attach" : action === "follow" ? "Follow" : action === "kill" ? "Kill" : action === "resume" ? "Resume" : "Bridge" }),
|
|
37289
|
+
/* @__PURE__ */ jsxs72(Text, { dimColor: true, children: [
|
|
37079
37290
|
" \xB7 ",
|
|
37080
37291
|
sessionId
|
|
37081
37292
|
] })
|
|
37082
37293
|
] }),
|
|
37083
|
-
/* @__PURE__ */
|
|
37294
|
+
/* @__PURE__ */ jsxs72(Text, { dimColor: true, children: [
|
|
37084
37295
|
"status: ",
|
|
37085
37296
|
session.status
|
|
37086
37297
|
] }),
|
|
37087
|
-
/* @__PURE__ */
|
|
37298
|
+
/* @__PURE__ */ jsxs72(Text, { dimColor: true, children: [
|
|
37088
37299
|
"pid: ",
|
|
37089
37300
|
session.pid || "n/a"
|
|
37090
37301
|
] }),
|
|
37091
|
-
/* @__PURE__ */
|
|
37302
|
+
/* @__PURE__ */ jsxs72(Text, { dimColor: true, children: [
|
|
37092
37303
|
"workspace: ",
|
|
37093
37304
|
session.metadata?.workspaceRoot || "n/a"
|
|
37094
37305
|
] })
|
|
@@ -37103,23 +37314,23 @@ var renderBridgePanel = () => {
|
|
|
37103
37314
|
const sessions = listSessions();
|
|
37104
37315
|
const running = sessions.filter((session) => session.status === "running");
|
|
37105
37316
|
return outBox(
|
|
37106
|
-
/* @__PURE__ */
|
|
37107
|
-
/* @__PURE__ */
|
|
37108
|
-
/* @__PURE__ */
|
|
37109
|
-
/* @__PURE__ */
|
|
37317
|
+
/* @__PURE__ */ jsxs72(Fragment12, { children: [
|
|
37318
|
+
/* @__PURE__ */ jsxs72(Box_default, { marginBottom: 1, children: [
|
|
37319
|
+
/* @__PURE__ */ jsx89(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "Bridge" }),
|
|
37320
|
+
/* @__PURE__ */ jsxs72(Text, { dimColor: true, children: [
|
|
37110
37321
|
" \xB7 ",
|
|
37111
37322
|
sessions.length,
|
|
37112
37323
|
" sessions"
|
|
37113
37324
|
] })
|
|
37114
37325
|
] }),
|
|
37115
|
-
/* @__PURE__ */
|
|
37326
|
+
/* @__PURE__ */ jsxs72(Text, { dimColor: true, children: [
|
|
37116
37327
|
"running: ",
|
|
37117
37328
|
running.length
|
|
37118
37329
|
] }),
|
|
37119
|
-
/* @__PURE__ */
|
|
37120
|
-
/* @__PURE__ */
|
|
37121
|
-
/* @__PURE__ */
|
|
37122
|
-
/* @__PURE__ */
|
|
37330
|
+
/* @__PURE__ */ jsx89(Text, { dimColor: true, children: "attach: bluma attach <session-id>" }),
|
|
37331
|
+
/* @__PURE__ */ jsx89(Text, { dimColor: true, children: "follow: bluma follow <session-id>" }),
|
|
37332
|
+
/* @__PURE__ */ jsx89(Text, { dimColor: true, children: "logs: bluma logs <session-id>" }),
|
|
37333
|
+
/* @__PURE__ */ jsx89(Box_default, { marginTop: 1, flexDirection: "column", children: sessions.slice(0, 8).map((session) => /* @__PURE__ */ jsxs72(Text, { dimColor: true, children: [
|
|
37123
37334
|
session.sessionId,
|
|
37124
37335
|
" \xB7 ",
|
|
37125
37336
|
session.status,
|
|
@@ -37132,15 +37343,15 @@ var renderBridgePanel = () => {
|
|
|
37132
37343
|
|
|
37133
37344
|
// src/app/ui/components/slash-commands/renderers/taskRenderers.tsx
|
|
37134
37345
|
init_task_store();
|
|
37135
|
-
import { Fragment as Fragment13, jsx as
|
|
37346
|
+
import { Fragment as Fragment13, jsx as jsx90, jsxs as jsxs73 } from "react/jsx-runtime";
|
|
37136
37347
|
var renderMasonSnapshot = () => {
|
|
37137
37348
|
const snapshot = buildTaskSnapshot();
|
|
37138
37349
|
const stats = snapshot.stats;
|
|
37139
37350
|
return outBox(
|
|
37140
|
-
/* @__PURE__ */
|
|
37141
|
-
/* @__PURE__ */
|
|
37142
|
-
/* @__PURE__ */
|
|
37143
|
-
/* @__PURE__ */
|
|
37351
|
+
/* @__PURE__ */ jsxs73(Fragment13, { children: [
|
|
37352
|
+
/* @__PURE__ */ jsxs73(Box_default, { marginBottom: 1, children: [
|
|
37353
|
+
/* @__PURE__ */ jsx90(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "Mason" }),
|
|
37354
|
+
/* @__PURE__ */ jsxs73(Text, { dimColor: true, children: [
|
|
37144
37355
|
" \xB7 ",
|
|
37145
37356
|
stats.total,
|
|
37146
37357
|
" total \xB7 ",
|
|
@@ -37148,35 +37359,35 @@ var renderMasonSnapshot = () => {
|
|
|
37148
37359
|
"%"
|
|
37149
37360
|
] })
|
|
37150
37361
|
] }),
|
|
37151
|
-
snapshot.activeTask ? /* @__PURE__ */
|
|
37152
|
-
/* @__PURE__ */
|
|
37362
|
+
snapshot.activeTask ? /* @__PURE__ */ jsxs73(Box_default, { marginBottom: 1, flexDirection: "column", children: [
|
|
37363
|
+
/* @__PURE__ */ jsxs73(Text, { dimColor: true, children: [
|
|
37153
37364
|
"active ",
|
|
37154
37365
|
snapshot.activeTask.mode,
|
|
37155
37366
|
" \xB7 ",
|
|
37156
37367
|
snapshot.activeTask.taskName
|
|
37157
37368
|
] }),
|
|
37158
|
-
/* @__PURE__ */
|
|
37159
|
-
/* @__PURE__ */
|
|
37160
|
-
] }) : /* @__PURE__ */
|
|
37161
|
-
/* @__PURE__ */
|
|
37369
|
+
/* @__PURE__ */ jsx90(Text, { dimColor: true, children: snapshot.activeTask.status }),
|
|
37370
|
+
/* @__PURE__ */ jsx90(Text, { dimColor: true, children: snapshot.activeTask.summary || "No summary." })
|
|
37371
|
+
] }) : /* @__PURE__ */ jsx90(Text, { dimColor: true, children: "No active task." }),
|
|
37372
|
+
/* @__PURE__ */ jsxs73(Box_default, { flexDirection: "column", marginTop: 1, children: [
|
|
37162
37373
|
snapshot.tasks.slice(0, 12).map((task) => {
|
|
37163
37374
|
const done = task.status === "completed";
|
|
37164
37375
|
const prefix = done ? "\u25A0" : task.status === "in_progress" ? "\u25A3" : "\u25A1";
|
|
37165
|
-
return /* @__PURE__ */
|
|
37376
|
+
return /* @__PURE__ */ jsxs73(Text, { dimColor: done, color: done ? void 0 : void 0, children: [
|
|
37166
37377
|
prefix,
|
|
37167
37378
|
" #",
|
|
37168
37379
|
task.id,
|
|
37169
37380
|
" ",
|
|
37170
37381
|
task.description,
|
|
37171
37382
|
" ",
|
|
37172
|
-
/* @__PURE__ */
|
|
37383
|
+
/* @__PURE__ */ jsxs73(Text, { dimColor: true, children: [
|
|
37173
37384
|
"(",
|
|
37174
37385
|
task.priority,
|
|
37175
37386
|
")"
|
|
37176
37387
|
] })
|
|
37177
37388
|
] }, task.id);
|
|
37178
37389
|
}),
|
|
37179
|
-
snapshot.tasks.length > 12 ? /* @__PURE__ */
|
|
37390
|
+
snapshot.tasks.length > 12 ? /* @__PURE__ */ jsxs73(Text, { dimColor: true, children: [
|
|
37180
37391
|
"\u2026 +",
|
|
37181
37392
|
snapshot.tasks.length - 12,
|
|
37182
37393
|
" more"
|
|
@@ -37250,7 +37461,7 @@ init_runtime_config();
|
|
|
37250
37461
|
init_sessionPermissionState();
|
|
37251
37462
|
init_sandbox_policy();
|
|
37252
37463
|
init_task_store();
|
|
37253
|
-
import { Fragment as Fragment14, jsx as
|
|
37464
|
+
import { Fragment as Fragment14, jsx as jsx91, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
37254
37465
|
var renderStatusline = () => {
|
|
37255
37466
|
const cfg = getRuntimeConfig();
|
|
37256
37467
|
const policy = getSandboxPolicy();
|
|
@@ -37265,9 +37476,9 @@ var renderStatusline = () => {
|
|
|
37265
37476
|
`${snapshot.stats.completed}/${snapshot.stats.total}`
|
|
37266
37477
|
];
|
|
37267
37478
|
return outBox(
|
|
37268
|
-
/* @__PURE__ */
|
|
37269
|
-
/* @__PURE__ */
|
|
37270
|
-
/* @__PURE__ */
|
|
37479
|
+
/* @__PURE__ */ jsxs74(Fragment14, { children: [
|
|
37480
|
+
/* @__PURE__ */ jsx91(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "Statusline" }),
|
|
37481
|
+
/* @__PURE__ */ jsx91(Text, { dimColor: true, children: parts.filter(Boolean).join(" - ") })
|
|
37271
37482
|
] })
|
|
37272
37483
|
);
|
|
37273
37484
|
};
|
|
@@ -37275,15 +37486,15 @@ var renderModelConfig = (subcommand, rest) => {
|
|
|
37275
37486
|
const cfg = getRuntimeConfig();
|
|
37276
37487
|
if (!subcommand || subcommand === "show") {
|
|
37277
37488
|
return outBox(
|
|
37278
|
-
/* @__PURE__ */
|
|
37279
|
-
/* @__PURE__ */
|
|
37280
|
-
/* @__PURE__ */
|
|
37281
|
-
/* @__PURE__ */
|
|
37489
|
+
/* @__PURE__ */ jsxs74(Fragment14, { children: [
|
|
37490
|
+
/* @__PURE__ */ jsxs74(Box_default, { marginBottom: 1, children: [
|
|
37491
|
+
/* @__PURE__ */ jsx91(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "Model" }),
|
|
37492
|
+
/* @__PURE__ */ jsxs74(Text, { dimColor: true, children: [
|
|
37282
37493
|
" - current: ",
|
|
37283
37494
|
cfg.model
|
|
37284
37495
|
] })
|
|
37285
37496
|
] }),
|
|
37286
|
-
/* @__PURE__ */
|
|
37497
|
+
/* @__PURE__ */ jsx91(Text, { dimColor: true, children: "Use /model list to browse built-in presets, or type a model name directly." })
|
|
37287
37498
|
] })
|
|
37288
37499
|
);
|
|
37289
37500
|
}
|
|
@@ -37298,15 +37509,15 @@ var renderEffortConfig = (subcommand) => {
|
|
|
37298
37509
|
const cfg = getRuntimeConfig();
|
|
37299
37510
|
if (!subcommand) {
|
|
37300
37511
|
return outBox(
|
|
37301
|
-
/* @__PURE__ */
|
|
37302
|
-
/* @__PURE__ */
|
|
37303
|
-
/* @__PURE__ */
|
|
37304
|
-
/* @__PURE__ */
|
|
37512
|
+
/* @__PURE__ */ jsxs74(Fragment14, { children: [
|
|
37513
|
+
/* @__PURE__ */ jsxs74(Box_default, { marginBottom: 1, children: [
|
|
37514
|
+
/* @__PURE__ */ jsx91(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "Effort" }),
|
|
37515
|
+
/* @__PURE__ */ jsxs74(Text, { dimColor: true, children: [
|
|
37305
37516
|
" - current: ",
|
|
37306
37517
|
cfg.reasoningEffort
|
|
37307
37518
|
] })
|
|
37308
37519
|
] }),
|
|
37309
|
-
/* @__PURE__ */
|
|
37520
|
+
/* @__PURE__ */ jsx91(Text, { dimColor: true, children: "Open /effort to choose low, medium, or high." })
|
|
37310
37521
|
] })
|
|
37311
37522
|
);
|
|
37312
37523
|
}
|
|
@@ -37320,15 +37531,15 @@ var renderStyleConfig = (subcommand) => {
|
|
|
37320
37531
|
const cfg = getRuntimeConfig();
|
|
37321
37532
|
if (!subcommand) {
|
|
37322
37533
|
return outBox(
|
|
37323
|
-
/* @__PURE__ */
|
|
37324
|
-
/* @__PURE__ */
|
|
37325
|
-
/* @__PURE__ */
|
|
37326
|
-
/* @__PURE__ */
|
|
37534
|
+
/* @__PURE__ */ jsxs74(Fragment14, { children: [
|
|
37535
|
+
/* @__PURE__ */ jsxs74(Box_default, { marginBottom: 1, children: [
|
|
37536
|
+
/* @__PURE__ */ jsx91(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "Style" }),
|
|
37537
|
+
/* @__PURE__ */ jsxs74(Text, { dimColor: true, children: [
|
|
37327
37538
|
" - current: ",
|
|
37328
37539
|
cfg.outputStyle
|
|
37329
37540
|
] })
|
|
37330
37541
|
] }),
|
|
37331
|
-
/* @__PURE__ */
|
|
37542
|
+
/* @__PURE__ */ jsx91(Text, { dimColor: true, children: "Open /style to choose default, compact, or brief." })
|
|
37332
37543
|
] })
|
|
37333
37544
|
);
|
|
37334
37545
|
}
|
|
@@ -37342,15 +37553,15 @@ var renderSandboxConfig = (subcommand) => {
|
|
|
37342
37553
|
const cfg = getRuntimeConfig();
|
|
37343
37554
|
if (!subcommand) {
|
|
37344
37555
|
return outBox(
|
|
37345
|
-
/* @__PURE__ */
|
|
37346
|
-
/* @__PURE__ */
|
|
37347
|
-
/* @__PURE__ */
|
|
37348
|
-
/* @__PURE__ */
|
|
37556
|
+
/* @__PURE__ */ jsxs74(Fragment14, { children: [
|
|
37557
|
+
/* @__PURE__ */ jsxs74(Box_default, { marginBottom: 1, children: [
|
|
37558
|
+
/* @__PURE__ */ jsx91(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "Sandbox" }),
|
|
37559
|
+
/* @__PURE__ */ jsxs74(Text, { dimColor: true, children: [
|
|
37349
37560
|
" - ",
|
|
37350
37561
|
cfg.sandboxEnabled ? "enabled" : "disabled"
|
|
37351
37562
|
] })
|
|
37352
37563
|
] }),
|
|
37353
|
-
/* @__PURE__ */
|
|
37564
|
+
/* @__PURE__ */ jsx91(Text, { dimColor: true, children: "Open /sandbox to toggle on or off." })
|
|
37354
37565
|
] })
|
|
37355
37566
|
);
|
|
37356
37567
|
}
|
|
@@ -37363,22 +37574,22 @@ var renderAgentConfig = (subcommand) => {
|
|
|
37363
37574
|
const validModes = ["default", "coordinator", "plan", "agent"];
|
|
37364
37575
|
if (!subcommand) {
|
|
37365
37576
|
return outBox(
|
|
37366
|
-
/* @__PURE__ */
|
|
37367
|
-
/* @__PURE__ */
|
|
37368
|
-
/* @__PURE__ */
|
|
37369
|
-
/* @__PURE__ */
|
|
37577
|
+
/* @__PURE__ */ jsxs74(Fragment14, { children: [
|
|
37578
|
+
/* @__PURE__ */ jsxs74(Box_default, { marginBottom: 1, children: [
|
|
37579
|
+
/* @__PURE__ */ jsx91(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "Agent Mode" }),
|
|
37580
|
+
/* @__PURE__ */ jsxs74(Text, { dimColor: true, children: [
|
|
37370
37581
|
" - current: ",
|
|
37371
37582
|
cfg.agentMode
|
|
37372
37583
|
] })
|
|
37373
37584
|
] }),
|
|
37374
|
-
/* @__PURE__ */
|
|
37375
|
-
/* @__PURE__ */
|
|
37376
|
-
/* @__PURE__ */
|
|
37377
|
-
/* @__PURE__ */
|
|
37378
|
-
/* @__PURE__ */
|
|
37379
|
-
/* @__PURE__ */
|
|
37585
|
+
/* @__PURE__ */ jsxs74(Box_default, { flexDirection: "column", marginTop: 1, children: [
|
|
37586
|
+
/* @__PURE__ */ jsx91(Text, { dimColor: true, children: /* @__PURE__ */ jsx91(Text, { bold: true, children: "Available modes:" }) }),
|
|
37587
|
+
/* @__PURE__ */ jsx91(Text, { dimColor: true, children: " - default: responds directly, no delegation" }),
|
|
37588
|
+
/* @__PURE__ */ jsx91(Text, { dimColor: true, children: " - coordinator: delegates to workers (parallel execution)" }),
|
|
37589
|
+
/* @__PURE__ */ jsx91(Text, { dimColor: true, children: " - plan: structured planning (3 phases)" }),
|
|
37590
|
+
/* @__PURE__ */ jsx91(Text, { dimColor: true, children: " - agent: headless mode for API/programmatic use" })
|
|
37380
37591
|
] }),
|
|
37381
|
-
/* @__PURE__ */
|
|
37592
|
+
/* @__PURE__ */ jsx91(Box_default, { marginTop: 1, children: /* @__PURE__ */ jsx91(Text, { dimColor: true, children: "Open /agent to choose a mode from the menu." }) })
|
|
37382
37593
|
] })
|
|
37383
37594
|
);
|
|
37384
37595
|
}
|
|
@@ -37399,12 +37610,12 @@ var renderFeatures = () => {
|
|
|
37399
37610
|
const cfg = getRuntimeConfig();
|
|
37400
37611
|
const features = cfg.features || {};
|
|
37401
37612
|
return outBox(
|
|
37402
|
-
/* @__PURE__ */
|
|
37403
|
-
/* @__PURE__ */
|
|
37404
|
-
/* @__PURE__ */
|
|
37405
|
-
/* @__PURE__ */
|
|
37613
|
+
/* @__PURE__ */ jsxs74(Fragment14, { children: [
|
|
37614
|
+
/* @__PURE__ */ jsxs74(Box_default, { marginBottom: 1, children: [
|
|
37615
|
+
/* @__PURE__ */ jsx91(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "Features" }),
|
|
37616
|
+
/* @__PURE__ */ jsx91(Text, { dimColor: true, children: " - runtime flags" })
|
|
37406
37617
|
] }),
|
|
37407
|
-
Object.keys(features).length === 0 ? /* @__PURE__ */
|
|
37618
|
+
Object.keys(features).length === 0 ? /* @__PURE__ */ jsx91(Text, { dimColor: true, children: "No features enabled." }) : Object.entries(features).map(([key, value]) => /* @__PURE__ */ jsxs74(Text, { dimColor: true, children: [
|
|
37408
37619
|
key,
|
|
37409
37620
|
": ",
|
|
37410
37621
|
String(value)
|
|
@@ -37473,21 +37684,21 @@ var runAgentSet = (_agentRef, mode, _setIsProcessing, _markTurnStarted) => {
|
|
|
37473
37684
|
// src/app/ui/components/slash-commands/renderers/permissionRenderers.tsx
|
|
37474
37685
|
init_runtime_config();
|
|
37475
37686
|
init_sessionPermissionState();
|
|
37476
|
-
import { jsx as
|
|
37687
|
+
import { jsx as jsx92, jsxs as jsxs75 } from "react/jsx-runtime";
|
|
37477
37688
|
var renderPermissionsSnapshot = (sessionId) => {
|
|
37478
37689
|
const cfg = getRuntimeConfig();
|
|
37479
37690
|
const permissionMode = sessionId ? getEffectivePermissionMode(sessionId) : cfg.permissionMode;
|
|
37480
37691
|
const modeDescription = permissionMode === "full" ? "full - all tools auto-approved" : permissionMode === "accept_edits" ? "accept_edits - auto-approve edits" : permissionMode === "plan" ? "plan - plan before mutations" : "default";
|
|
37481
37692
|
return outBox(
|
|
37482
|
-
/* @__PURE__ */
|
|
37483
|
-
/* @__PURE__ */
|
|
37693
|
+
/* @__PURE__ */ jsxs75(Box_default, { flexDirection: "column", children: [
|
|
37694
|
+
/* @__PURE__ */ jsxs75(Text, { dimColor: true, children: [
|
|
37484
37695
|
"permission mode: ",
|
|
37485
|
-
/* @__PURE__ */
|
|
37696
|
+
/* @__PURE__ */ jsx92(Text, { color: "green", children: permissionMode }),
|
|
37486
37697
|
" ",
|
|
37487
37698
|
sessionId ? `(session: ${sessionId.slice(0, 8)})` : ""
|
|
37488
37699
|
] }),
|
|
37489
|
-
/* @__PURE__ */
|
|
37490
|
-
/* @__PURE__ */
|
|
37700
|
+
/* @__PURE__ */ jsx92(Text, { dimColor: true, children: modeDescription }),
|
|
37701
|
+
/* @__PURE__ */ jsxs75(Text, { dimColor: true, children: [
|
|
37491
37702
|
"sandbox: ",
|
|
37492
37703
|
cfg.sandboxEnabled ? "enabled" : "disabled",
|
|
37493
37704
|
" (global)"
|
|
@@ -37549,29 +37760,29 @@ function buildDiagnosticsSnapshot(feedbackScore) {
|
|
|
37549
37760
|
}
|
|
37550
37761
|
|
|
37551
37762
|
// src/app/ui/components/slash-commands/renderers/pluginRenderers.tsx
|
|
37552
|
-
import { Fragment as Fragment15, jsx as
|
|
37763
|
+
import { Fragment as Fragment15, jsx as jsx93, jsxs as jsxs76 } from "react/jsx-runtime";
|
|
37553
37764
|
var renderPluginsSnapshot = () => {
|
|
37554
37765
|
const plugins = listPlugins();
|
|
37555
37766
|
const dirs = getPluginDirs();
|
|
37556
37767
|
return outBox(
|
|
37557
|
-
/* @__PURE__ */
|
|
37558
|
-
/* @__PURE__ */
|
|
37559
|
-
/* @__PURE__ */
|
|
37560
|
-
/* @__PURE__ */
|
|
37768
|
+
/* @__PURE__ */ jsxs76(Fragment15, { children: [
|
|
37769
|
+
/* @__PURE__ */ jsxs76(Box_default, { marginBottom: 1, children: [
|
|
37770
|
+
/* @__PURE__ */ jsx93(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "Plugins" }),
|
|
37771
|
+
/* @__PURE__ */ jsxs76(Text, { dimColor: true, children: [
|
|
37561
37772
|
" \xB7 ",
|
|
37562
37773
|
plugins.length,
|
|
37563
37774
|
" installed"
|
|
37564
37775
|
] })
|
|
37565
37776
|
] }),
|
|
37566
|
-
/* @__PURE__ */
|
|
37777
|
+
/* @__PURE__ */ jsxs76(Text, { dimColor: true, children: [
|
|
37567
37778
|
"project: ",
|
|
37568
37779
|
dirs.project
|
|
37569
37780
|
] }),
|
|
37570
|
-
/* @__PURE__ */
|
|
37781
|
+
/* @__PURE__ */ jsxs76(Text, { dimColor: true, children: [
|
|
37571
37782
|
"global: ",
|
|
37572
37783
|
dirs.global
|
|
37573
37784
|
] }),
|
|
37574
|
-
/* @__PURE__ */
|
|
37785
|
+
/* @__PURE__ */ jsx93(Box_default, { marginTop: 1, flexDirection: "column", children: plugins.length === 0 ? /* @__PURE__ */ jsx93(Text, { dimColor: true, children: "No plugins installed." }) : plugins.slice(0, 12).map((plugin) => /* @__PURE__ */ jsxs76(Text, { dimColor: true, children: [
|
|
37575
37786
|
plugin.name,
|
|
37576
37787
|
" \xB7 ",
|
|
37577
37788
|
plugin.source,
|
|
@@ -37589,35 +37800,35 @@ var renderPluginDetails = (name) => {
|
|
|
37589
37800
|
return usageBox("Plugin", `Unknown plugin: ${name}`);
|
|
37590
37801
|
}
|
|
37591
37802
|
return outBox(
|
|
37592
|
-
/* @__PURE__ */
|
|
37593
|
-
/* @__PURE__ */
|
|
37594
|
-
/* @__PURE__ */
|
|
37595
|
-
/* @__PURE__ */
|
|
37803
|
+
/* @__PURE__ */ jsxs76(Fragment15, { children: [
|
|
37804
|
+
/* @__PURE__ */ jsxs76(Box_default, { marginBottom: 1, children: [
|
|
37805
|
+
/* @__PURE__ */ jsx93(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "Plugin" }),
|
|
37806
|
+
/* @__PURE__ */ jsxs76(Text, { dimColor: true, children: [
|
|
37596
37807
|
" \xB7 ",
|
|
37597
37808
|
plugin.name
|
|
37598
37809
|
] })
|
|
37599
37810
|
] }),
|
|
37600
|
-
/* @__PURE__ */
|
|
37811
|
+
/* @__PURE__ */ jsxs76(Text, { dimColor: true, children: [
|
|
37601
37812
|
"source: ",
|
|
37602
37813
|
plugin.source
|
|
37603
37814
|
] }),
|
|
37604
|
-
/* @__PURE__ */
|
|
37815
|
+
/* @__PURE__ */ jsxs76(Text, { dimColor: true, children: [
|
|
37605
37816
|
"root: ",
|
|
37606
37817
|
plugin.root
|
|
37607
37818
|
] }),
|
|
37608
|
-
/* @__PURE__ */
|
|
37819
|
+
/* @__PURE__ */ jsxs76(Text, { dimColor: true, children: [
|
|
37609
37820
|
"manifest: ",
|
|
37610
37821
|
plugin.manifestPath
|
|
37611
37822
|
] }),
|
|
37612
|
-
/* @__PURE__ */
|
|
37823
|
+
/* @__PURE__ */ jsxs76(Text, { dimColor: true, children: [
|
|
37613
37824
|
"version: ",
|
|
37614
37825
|
plugin.manifest.version || "n/a"
|
|
37615
37826
|
] }),
|
|
37616
|
-
/* @__PURE__ */
|
|
37827
|
+
/* @__PURE__ */ jsxs76(Text, { dimColor: true, children: [
|
|
37617
37828
|
"entry: ",
|
|
37618
37829
|
plugin.manifest.entry || "n/a"
|
|
37619
37830
|
] }),
|
|
37620
|
-
/* @__PURE__ */
|
|
37831
|
+
/* @__PURE__ */ jsxs76(Text, { dimColor: true, children: [
|
|
37621
37832
|
"description: ",
|
|
37622
37833
|
plugin.manifest.description || "n/a"
|
|
37623
37834
|
] })
|
|
@@ -37628,67 +37839,67 @@ var renderHooksSnapshot = () => {
|
|
|
37628
37839
|
const state2 = getHookState();
|
|
37629
37840
|
const recent = state2.events.slice(-12).reverse();
|
|
37630
37841
|
return outBox(
|
|
37631
|
-
/* @__PURE__ */
|
|
37632
|
-
/* @__PURE__ */
|
|
37633
|
-
/* @__PURE__ */
|
|
37634
|
-
/* @__PURE__ */
|
|
37842
|
+
/* @__PURE__ */ jsxs76(Fragment15, { children: [
|
|
37843
|
+
/* @__PURE__ */ jsxs76(Box_default, { marginBottom: 1, children: [
|
|
37844
|
+
/* @__PURE__ */ jsx93(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "Hooks" }),
|
|
37845
|
+
/* @__PURE__ */ jsxs76(Text, { dimColor: true, children: [
|
|
37635
37846
|
" \xB7 ",
|
|
37636
37847
|
state2.enabled ? "enabled" : "disabled"
|
|
37637
37848
|
] })
|
|
37638
37849
|
] }),
|
|
37639
|
-
/* @__PURE__ */
|
|
37850
|
+
/* @__PURE__ */ jsxs76(Text, { dimColor: true, children: [
|
|
37640
37851
|
"state: ",
|
|
37641
37852
|
getHookStatePath()
|
|
37642
37853
|
] }),
|
|
37643
|
-
/* @__PURE__ */
|
|
37854
|
+
/* @__PURE__ */ jsxs76(Text, { dimColor: true, children: [
|
|
37644
37855
|
"max events: ",
|
|
37645
37856
|
state2.maxEvents
|
|
37646
37857
|
] }),
|
|
37647
|
-
/* @__PURE__ */
|
|
37858
|
+
/* @__PURE__ */ jsxs76(Text, { dimColor: true, children: [
|
|
37648
37859
|
"stored: ",
|
|
37649
37860
|
state2.events.length
|
|
37650
37861
|
] }),
|
|
37651
|
-
/* @__PURE__ */
|
|
37862
|
+
/* @__PURE__ */ jsx93(Box_default, { marginTop: 1, flexDirection: "column", children: recent.length === 0 ? /* @__PURE__ */ jsx93(Text, { dimColor: true, children: "No hook events recorded yet." }) : recent.map((event) => /* @__PURE__ */ jsx93(Text, { dimColor: true, children: formatHookEventLine(event) }, event.id)) })
|
|
37652
37863
|
] })
|
|
37653
37864
|
);
|
|
37654
37865
|
};
|
|
37655
37866
|
var renderDiagnostics = (feedbackScore) => {
|
|
37656
37867
|
const snapshot = buildDiagnosticsSnapshot(feedbackScore);
|
|
37657
37868
|
return outBox(
|
|
37658
|
-
/* @__PURE__ */
|
|
37659
|
-
/* @__PURE__ */
|
|
37660
|
-
/* @__PURE__ */
|
|
37661
|
-
/* @__PURE__ */
|
|
37869
|
+
/* @__PURE__ */ jsxs76(Fragment15, { children: [
|
|
37870
|
+
/* @__PURE__ */ jsxs76(Box_default, { marginBottom: 1, children: [
|
|
37871
|
+
/* @__PURE__ */ jsx93(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "Diagnostics" }),
|
|
37872
|
+
/* @__PURE__ */ jsx93(Text, { dimColor: true, children: " \xB7 health snapshot" })
|
|
37662
37873
|
] }),
|
|
37663
|
-
/* @__PURE__ */
|
|
37874
|
+
/* @__PURE__ */ jsxs76(Text, { dimColor: true, children: [
|
|
37664
37875
|
"model: ",
|
|
37665
37876
|
snapshot.runtime.model
|
|
37666
37877
|
] }),
|
|
37667
|
-
/* @__PURE__ */
|
|
37878
|
+
/* @__PURE__ */ jsxs76(Text, { dimColor: true, children: [
|
|
37668
37879
|
"effort: ",
|
|
37669
37880
|
snapshot.runtime.effort
|
|
37670
37881
|
] }),
|
|
37671
|
-
/* @__PURE__ */
|
|
37882
|
+
/* @__PURE__ */ jsxs76(Text, { dimColor: true, children: [
|
|
37672
37883
|
"style: ",
|
|
37673
37884
|
snapshot.runtime.style
|
|
37674
37885
|
] }),
|
|
37675
|
-
/* @__PURE__ */
|
|
37886
|
+
/* @__PURE__ */ jsxs76(Text, { dimColor: true, children: [
|
|
37676
37887
|
"permission: ",
|
|
37677
37888
|
snapshot.runtime.permissionMode
|
|
37678
37889
|
] }),
|
|
37679
|
-
/* @__PURE__ */
|
|
37890
|
+
/* @__PURE__ */ jsxs76(Text, { dimColor: true, children: [
|
|
37680
37891
|
"agent: ",
|
|
37681
37892
|
snapshot.runtime.agentMode
|
|
37682
37893
|
] }),
|
|
37683
|
-
/* @__PURE__ */
|
|
37894
|
+
/* @__PURE__ */ jsxs76(Text, { dimColor: true, children: [
|
|
37684
37895
|
"sandbox: ",
|
|
37685
37896
|
snapshot.runtime.sandbox
|
|
37686
37897
|
] }),
|
|
37687
|
-
/* @__PURE__ */
|
|
37898
|
+
/* @__PURE__ */ jsxs76(Text, { dimColor: true, children: [
|
|
37688
37899
|
"workspace: ",
|
|
37689
37900
|
snapshot.runtime.workspaceRoot
|
|
37690
37901
|
] }),
|
|
37691
|
-
/* @__PURE__ */
|
|
37902
|
+
/* @__PURE__ */ jsxs76(Text, { dimColor: true, children: [
|
|
37692
37903
|
"mason: ",
|
|
37693
37904
|
snapshot.tasks.total,
|
|
37694
37905
|
" total \xB7 ",
|
|
@@ -37696,7 +37907,7 @@ var renderDiagnostics = (feedbackScore) => {
|
|
|
37696
37907
|
"% \xB7 active ",
|
|
37697
37908
|
snapshot.tasks.active || "none"
|
|
37698
37909
|
] }),
|
|
37699
|
-
/* @__PURE__ */
|
|
37910
|
+
/* @__PURE__ */ jsxs76(Text, { dimColor: true, children: [
|
|
37700
37911
|
"hooks: ",
|
|
37701
37912
|
snapshot.hooks.enabled ? "enabled" : "disabled",
|
|
37702
37913
|
" \xB7 ",
|
|
@@ -37704,7 +37915,7 @@ var renderDiagnostics = (feedbackScore) => {
|
|
|
37704
37915
|
"/",
|
|
37705
37916
|
snapshot.hooks.maxEvents
|
|
37706
37917
|
] }),
|
|
37707
|
-
/* @__PURE__ */
|
|
37918
|
+
/* @__PURE__ */ jsxs76(Text, { dimColor: true, children: [
|
|
37708
37919
|
"plugins: ",
|
|
37709
37920
|
snapshot.plugins.total,
|
|
37710
37921
|
" total \xB7 ",
|
|
@@ -37713,7 +37924,7 @@ var renderDiagnostics = (feedbackScore) => {
|
|
|
37713
37924
|
snapshot.plugins.global,
|
|
37714
37925
|
" global"
|
|
37715
37926
|
] }),
|
|
37716
|
-
/* @__PURE__ */
|
|
37927
|
+
/* @__PURE__ */ jsxs76(Text, { dimColor: true, children: [
|
|
37717
37928
|
"sessions: ",
|
|
37718
37929
|
snapshot.sessions.total,
|
|
37719
37930
|
" total \xB7 ",
|
|
@@ -37726,7 +37937,7 @@ var renderDiagnostics = (feedbackScore) => {
|
|
|
37726
37937
|
snapshot.sessions.error,
|
|
37727
37938
|
" error"
|
|
37728
37939
|
] }),
|
|
37729
|
-
/* @__PURE__ */
|
|
37940
|
+
/* @__PURE__ */ jsxs76(Text, { dimColor: true, children: [
|
|
37730
37941
|
"feedback: ",
|
|
37731
37942
|
typeof feedbackScore === "number" ? feedbackScore.toFixed(1) : "n/a"
|
|
37732
37943
|
] })
|
|
@@ -37802,33 +38013,33 @@ var runPluginsPaths = (agentRef, paths2, setIsProcessing, markTurnStarted) => {
|
|
|
37802
38013
|
};
|
|
37803
38014
|
|
|
37804
38015
|
// src/app/ui/components/slash-commands/renderers/infoRenderers.tsx
|
|
37805
|
-
import { Fragment as Fragment16, jsx as
|
|
38016
|
+
import { Fragment as Fragment16, jsx as jsx94, jsxs as jsxs77 } from "react/jsx-runtime";
|
|
37806
38017
|
var getMcpTools = () => [];
|
|
37807
38018
|
var renderHelp = () => {
|
|
37808
38019
|
const lines = formatSlashHelpLines();
|
|
37809
38020
|
return outBox(
|
|
37810
|
-
/* @__PURE__ */
|
|
37811
|
-
/* @__PURE__ */
|
|
37812
|
-
/* @__PURE__ */
|
|
37813
|
-
/* @__PURE__ */
|
|
38021
|
+
/* @__PURE__ */ jsxs77(Fragment16, { children: [
|
|
38022
|
+
/* @__PURE__ */ jsxs77(Box_default, { marginBottom: 1, children: [
|
|
38023
|
+
/* @__PURE__ */ jsx94(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "Slash Commands" }),
|
|
38024
|
+
/* @__PURE__ */ jsx94(Text, { dimColor: true, children: " \xB7 grouped by category" })
|
|
37814
38025
|
] }),
|
|
37815
|
-
/* @__PURE__ */
|
|
38026
|
+
/* @__PURE__ */ jsx94(Box_default, { flexDirection: "column", children: lines.map((line, i) => /* @__PURE__ */ jsx94(Text, { dimColor: line === "", children: line === "" ? " " : line }, i)) })
|
|
37816
38027
|
] })
|
|
37817
38028
|
);
|
|
37818
38029
|
};
|
|
37819
38030
|
var renderSkills = () => {
|
|
37820
38031
|
const skills = listAvailableSkills();
|
|
37821
38032
|
return outBox(
|
|
37822
|
-
/* @__PURE__ */
|
|
37823
|
-
/* @__PURE__ */
|
|
37824
|
-
/* @__PURE__ */
|
|
37825
|
-
/* @__PURE__ */
|
|
38033
|
+
/* @__PURE__ */ jsxs77(Fragment16, { children: [
|
|
38034
|
+
/* @__PURE__ */ jsxs77(Box_default, { marginBottom: 1, children: [
|
|
38035
|
+
/* @__PURE__ */ jsx94(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "Skills" }),
|
|
38036
|
+
/* @__PURE__ */ jsxs77(Text, { dimColor: true, children: [
|
|
37826
38037
|
" \xB7 ",
|
|
37827
38038
|
skills.length,
|
|
37828
38039
|
" available"
|
|
37829
38040
|
] })
|
|
37830
38041
|
] }),
|
|
37831
|
-
/* @__PURE__ */
|
|
38042
|
+
/* @__PURE__ */ jsx94(Box_default, { flexDirection: "column", children: skills.length === 0 ? /* @__PURE__ */ jsx94(Text, { dimColor: true, children: "No skills available." }) : skills.map((skill) => /* @__PURE__ */ jsxs77(Text, { dimColor: true, children: [
|
|
37832
38043
|
skill.name,
|
|
37833
38044
|
" \xB7 ",
|
|
37834
38045
|
skill.source,
|
|
@@ -37842,23 +38053,23 @@ var renderMcp = (filter) => {
|
|
|
37842
38053
|
const mcpTools = getMcpTools();
|
|
37843
38054
|
const filtered = filter ? mcpTools.filter((t) => t.name?.toLowerCase().includes(filter.toLowerCase())) : mcpTools;
|
|
37844
38055
|
return outBox(
|
|
37845
|
-
/* @__PURE__ */
|
|
37846
|
-
/* @__PURE__ */
|
|
37847
|
-
/* @__PURE__ */
|
|
37848
|
-
/* @__PURE__ */
|
|
38056
|
+
/* @__PURE__ */ jsxs77(Fragment16, { children: [
|
|
38057
|
+
/* @__PURE__ */ jsxs77(Box_default, { marginBottom: 1, children: [
|
|
38058
|
+
/* @__PURE__ */ jsx94(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "MCP Tools" }),
|
|
38059
|
+
/* @__PURE__ */ jsxs77(Text, { dimColor: true, children: [
|
|
37849
38060
|
" \xB7 ",
|
|
37850
38061
|
filtered.length,
|
|
37851
38062
|
" ",
|
|
37852
38063
|
filter ? `matching "${filter}"` : "total"
|
|
37853
38064
|
] })
|
|
37854
38065
|
] }),
|
|
37855
|
-
/* @__PURE__ */
|
|
37856
|
-
filtered.length === 0 ? /* @__PURE__ */
|
|
38066
|
+
/* @__PURE__ */ jsxs77(Box_default, { flexDirection: "column", children: [
|
|
38067
|
+
filtered.length === 0 ? /* @__PURE__ */ jsx94(Text, { dimColor: true, children: "No MCP tools found." }) : filtered.slice(0, 15).map((tool) => /* @__PURE__ */ jsxs77(Text, { dimColor: true, children: [
|
|
37857
38068
|
tool.name,
|
|
37858
38069
|
" \xB7 ",
|
|
37859
38070
|
tool.description || "no description"
|
|
37860
38071
|
] }, tool.name)),
|
|
37861
|
-
filtered.length > 15 && /* @__PURE__ */
|
|
38072
|
+
filtered.length > 15 && /* @__PURE__ */ jsxs77(Text, { dimColor: true, children: [
|
|
37862
38073
|
"\u2026 +",
|
|
37863
38074
|
filtered.length - 15,
|
|
37864
38075
|
" more"
|
|
@@ -37871,23 +38082,23 @@ var renderTools = (filter) => {
|
|
|
37871
38082
|
const nativeTools = getAllNativeToolMetadata();
|
|
37872
38083
|
const filtered = filter ? nativeTools.filter((t) => t.name.toLowerCase().includes(filter.toLowerCase())) : nativeTools;
|
|
37873
38084
|
return outBox(
|
|
37874
|
-
/* @__PURE__ */
|
|
37875
|
-
/* @__PURE__ */
|
|
37876
|
-
/* @__PURE__ */
|
|
37877
|
-
/* @__PURE__ */
|
|
38085
|
+
/* @__PURE__ */ jsxs77(Fragment16, { children: [
|
|
38086
|
+
/* @__PURE__ */ jsxs77(Box_default, { marginBottom: 1, children: [
|
|
38087
|
+
/* @__PURE__ */ jsx94(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "Native Tools" }),
|
|
38088
|
+
/* @__PURE__ */ jsxs77(Text, { dimColor: true, children: [
|
|
37878
38089
|
" \xB7 ",
|
|
37879
38090
|
filtered.length,
|
|
37880
38091
|
" ",
|
|
37881
38092
|
filter ? `matching "${filter}"` : "total"
|
|
37882
38093
|
] })
|
|
37883
38094
|
] }),
|
|
37884
|
-
/* @__PURE__ */
|
|
37885
|
-
filtered.length === 0 ? /* @__PURE__ */
|
|
38095
|
+
/* @__PURE__ */ jsxs77(Box_default, { flexDirection: "column", children: [
|
|
38096
|
+
filtered.length === 0 ? /* @__PURE__ */ jsx94(Text, { dimColor: true, children: "No native tools found." }) : filtered.slice(0, 15).map((tool) => /* @__PURE__ */ jsxs77(Text, { dimColor: true, children: [
|
|
37886
38097
|
tool.name,
|
|
37887
38098
|
" \xB7 ",
|
|
37888
38099
|
tool.description || "no description"
|
|
37889
38100
|
] }, tool.name)),
|
|
37890
|
-
filtered.length > 15 && /* @__PURE__ */
|
|
38101
|
+
filtered.length > 15 && /* @__PURE__ */ jsxs77(Text, { dimColor: true, children: [
|
|
37891
38102
|
"\u2026 +",
|
|
37892
38103
|
filtered.length - 15,
|
|
37893
38104
|
" more"
|
|
@@ -37898,105 +38109,105 @@ var renderTools = (filter) => {
|
|
|
37898
38109
|
};
|
|
37899
38110
|
var renderStats = () => {
|
|
37900
38111
|
return outBox(
|
|
37901
|
-
/* @__PURE__ */
|
|
37902
|
-
/* @__PURE__ */
|
|
37903
|
-
/* @__PURE__ */
|
|
37904
|
-
/* @__PURE__ */
|
|
38112
|
+
/* @__PURE__ */ jsxs77(Fragment16, { children: [
|
|
38113
|
+
/* @__PURE__ */ jsxs77(Box_default, { marginBottom: 1, children: [
|
|
38114
|
+
/* @__PURE__ */ jsx94(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "Stats" }),
|
|
38115
|
+
/* @__PURE__ */ jsx94(Text, { dimColor: true, children: " \xB7 session statistics" })
|
|
37905
38116
|
] }),
|
|
37906
|
-
/* @__PURE__ */
|
|
38117
|
+
/* @__PURE__ */ jsx94(Text, { dimColor: true, children: "Use /stats for detailed statistics" })
|
|
37907
38118
|
] })
|
|
37908
38119
|
);
|
|
37909
38120
|
};
|
|
37910
38121
|
var renderTheme = () => {
|
|
37911
38122
|
return outBox(
|
|
37912
|
-
/* @__PURE__ */
|
|
37913
|
-
/* @__PURE__ */
|
|
37914
|
-
/* @__PURE__ */
|
|
37915
|
-
/* @__PURE__ */
|
|
38123
|
+
/* @__PURE__ */ jsxs77(Fragment16, { children: [
|
|
38124
|
+
/* @__PURE__ */ jsxs77(Box_default, { marginBottom: 1, children: [
|
|
38125
|
+
/* @__PURE__ */ jsx94(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "Theme" }),
|
|
38126
|
+
/* @__PURE__ */ jsx94(Text, { dimColor: true, children: " \xB7 current theme" })
|
|
37916
38127
|
] }),
|
|
37917
|
-
/* @__PURE__ */
|
|
38128
|
+
/* @__PURE__ */ jsx94(Text, { dimColor: true, children: "Use /theme to change theme" })
|
|
37918
38129
|
] })
|
|
37919
38130
|
);
|
|
37920
38131
|
};
|
|
37921
38132
|
var renderAgents = () => {
|
|
37922
38133
|
return outBox(
|
|
37923
|
-
/* @__PURE__ */
|
|
37924
|
-
/* @__PURE__ */
|
|
37925
|
-
/* @__PURE__ */
|
|
37926
|
-
/* @__PURE__ */
|
|
38134
|
+
/* @__PURE__ */ jsxs77(Fragment16, { children: [
|
|
38135
|
+
/* @__PURE__ */ jsxs77(Box_default, { marginBottom: 1, children: [
|
|
38136
|
+
/* @__PURE__ */ jsx94(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "Agents" }),
|
|
38137
|
+
/* @__PURE__ */ jsx94(Text, { dimColor: true, children: " \xB7 active agent sessions" })
|
|
37927
38138
|
] }),
|
|
37928
|
-
/* @__PURE__ */
|
|
38139
|
+
/* @__PURE__ */ jsx94(Text, { dimColor: true, children: "Use /agents to see active sessions" })
|
|
37929
38140
|
] })
|
|
37930
38141
|
);
|
|
37931
38142
|
};
|
|
37932
38143
|
var renderDebugWorkers = () => {
|
|
37933
38144
|
return outBox(
|
|
37934
|
-
/* @__PURE__ */
|
|
37935
|
-
/* @__PURE__ */
|
|
37936
|
-
/* @__PURE__ */
|
|
37937
|
-
/* @__PURE__ */
|
|
38145
|
+
/* @__PURE__ */ jsxs77(Fragment16, { children: [
|
|
38146
|
+
/* @__PURE__ */ jsxs77(Box_default, { marginBottom: 1, children: [
|
|
38147
|
+
/* @__PURE__ */ jsx94(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "Debug Workers" }),
|
|
38148
|
+
/* @__PURE__ */ jsx94(Text, { dimColor: true, children: " \xB7 worker debugging info" })
|
|
37938
38149
|
] }),
|
|
37939
|
-
/* @__PURE__ */
|
|
38150
|
+
/* @__PURE__ */ jsx94(Text, { dimColor: true, children: "Use /debug-workers to see worker status" })
|
|
37940
38151
|
] })
|
|
37941
38152
|
);
|
|
37942
38153
|
};
|
|
37943
38154
|
|
|
37944
38155
|
// src/app/ui/components/slash-commands/renderers/staticRenderers.tsx
|
|
37945
|
-
import { Fragment as Fragment17, jsx as
|
|
38156
|
+
import { Fragment as Fragment17, jsx as jsx95, jsxs as jsxs78 } from "react/jsx-runtime";
|
|
37946
38157
|
var renderCompact = () => {
|
|
37947
38158
|
return outBox(
|
|
37948
|
-
/* @__PURE__ */
|
|
37949
|
-
/* @__PURE__ */
|
|
37950
|
-
/* @__PURE__ */
|
|
38159
|
+
/* @__PURE__ */ jsxs78(Fragment17, { children: [
|
|
38160
|
+
/* @__PURE__ */ jsx95(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "Compact" }),
|
|
38161
|
+
/* @__PURE__ */ jsx95(Text, { dimColor: true, children: " \xB7 manually compact conversation context" })
|
|
37951
38162
|
] })
|
|
37952
38163
|
);
|
|
37953
38164
|
};
|
|
37954
38165
|
var renderCost = () => {
|
|
37955
38166
|
return outBox(
|
|
37956
|
-
/* @__PURE__ */
|
|
37957
|
-
/* @__PURE__ */
|
|
37958
|
-
/* @__PURE__ */
|
|
38167
|
+
/* @__PURE__ */ jsxs78(Fragment17, { children: [
|
|
38168
|
+
/* @__PURE__ */ jsx95(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "Cost" }),
|
|
38169
|
+
/* @__PURE__ */ jsx95(Text, { dimColor: true, children: " \xB7 show session cost and token usage" })
|
|
37959
38170
|
] })
|
|
37960
38171
|
);
|
|
37961
38172
|
};
|
|
37962
38173
|
var renderExport = () => {
|
|
37963
38174
|
return outBox(
|
|
37964
|
-
/* @__PURE__ */
|
|
37965
|
-
/* @__PURE__ */
|
|
37966
|
-
/* @__PURE__ */
|
|
38175
|
+
/* @__PURE__ */ jsxs78(Fragment17, { children: [
|
|
38176
|
+
/* @__PURE__ */ jsx95(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "Export" }),
|
|
38177
|
+
/* @__PURE__ */ jsx95(Text, { dimColor: true, children: " \xB7 export conversation as markdown" })
|
|
37967
38178
|
] })
|
|
37968
38179
|
);
|
|
37969
38180
|
};
|
|
37970
38181
|
var renderMemory = () => {
|
|
37971
38182
|
return outBox(
|
|
37972
|
-
/* @__PURE__ */
|
|
37973
|
-
/* @__PURE__ */
|
|
37974
|
-
/* @__PURE__ */
|
|
38183
|
+
/* @__PURE__ */ jsxs78(Fragment17, { children: [
|
|
38184
|
+
/* @__PURE__ */ jsx95(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "Memory" }),
|
|
38185
|
+
/* @__PURE__ */ jsx95(Text, { dimColor: true, children: " \xB7 manage session memories" })
|
|
37975
38186
|
] })
|
|
37976
38187
|
);
|
|
37977
38188
|
};
|
|
37978
38189
|
var renderToken = () => {
|
|
37979
38190
|
return outBox(
|
|
37980
|
-
/* @__PURE__ */
|
|
37981
|
-
/* @__PURE__ */
|
|
37982
|
-
/* @__PURE__ */
|
|
38191
|
+
/* @__PURE__ */ jsxs78(Fragment17, { children: [
|
|
38192
|
+
/* @__PURE__ */ jsx95(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "Token" }),
|
|
38193
|
+
/* @__PURE__ */ jsx95(Text, { dimColor: true, children: " \xB7 show real-time token usage and budget" })
|
|
37983
38194
|
] })
|
|
37984
38195
|
);
|
|
37985
38196
|
};
|
|
37986
38197
|
var renderHistory = () => {
|
|
37987
38198
|
return outBox(
|
|
37988
|
-
/* @__PURE__ */
|
|
37989
|
-
/* @__PURE__ */
|
|
37990
|
-
/* @__PURE__ */
|
|
38199
|
+
/* @__PURE__ */ jsxs78(Fragment17, { children: [
|
|
38200
|
+
/* @__PURE__ */ jsx95(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "History" }),
|
|
38201
|
+
/* @__PURE__ */ jsx95(Text, { dimColor: true, children: " \xB7 show recent command history in this session" })
|
|
37991
38202
|
] })
|
|
37992
38203
|
);
|
|
37993
38204
|
};
|
|
37994
38205
|
var renderAlias = (subcommand) => {
|
|
37995
38206
|
if (!subcommand) {
|
|
37996
38207
|
return outBox(
|
|
37997
|
-
/* @__PURE__ */
|
|
37998
|
-
/* @__PURE__ */
|
|
37999
|
-
/* @__PURE__ */
|
|
38208
|
+
/* @__PURE__ */ jsxs78(Fragment17, { children: [
|
|
38209
|
+
/* @__PURE__ */ jsx95(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "Alias" }),
|
|
38210
|
+
/* @__PURE__ */ jsx95(Text, { dimColor: true, children: " \xB7 create or manage command aliases" })
|
|
38000
38211
|
] })
|
|
38001
38212
|
);
|
|
38002
38213
|
}
|
|
@@ -38004,41 +38215,41 @@ var renderAlias = (subcommand) => {
|
|
|
38004
38215
|
};
|
|
38005
38216
|
var renderCopy = () => {
|
|
38006
38217
|
return outBox(
|
|
38007
|
-
/* @__PURE__ */
|
|
38008
|
-
/* @__PURE__ */
|
|
38009
|
-
/* @__PURE__ */
|
|
38218
|
+
/* @__PURE__ */ jsxs78(Fragment17, { children: [
|
|
38219
|
+
/* @__PURE__ */ jsx95(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "Copy" }),
|
|
38220
|
+
/* @__PURE__ */ jsx95(Text, { dimColor: true, children: " \xB7 copy last output or selected text to clipboard" })
|
|
38010
38221
|
] })
|
|
38011
38222
|
);
|
|
38012
38223
|
};
|
|
38013
38224
|
var renderTerminal = () => {
|
|
38014
38225
|
return outBox(
|
|
38015
|
-
/* @__PURE__ */
|
|
38016
|
-
/* @__PURE__ */
|
|
38017
|
-
/* @__PURE__ */
|
|
38226
|
+
/* @__PURE__ */ jsxs78(Fragment17, { children: [
|
|
38227
|
+
/* @__PURE__ */ jsx95(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "Terminal" }),
|
|
38228
|
+
/* @__PURE__ */ jsx95(Text, { dimColor: true, children: " \xB7 open interactive terminal session" })
|
|
38018
38229
|
] })
|
|
38019
38230
|
);
|
|
38020
38231
|
};
|
|
38021
38232
|
var renderContext = () => {
|
|
38022
38233
|
return outBox(
|
|
38023
|
-
/* @__PURE__ */
|
|
38024
|
-
/* @__PURE__ */
|
|
38025
|
-
/* @__PURE__ */
|
|
38234
|
+
/* @__PURE__ */ jsxs78(Fragment17, { children: [
|
|
38235
|
+
/* @__PURE__ */ jsx95(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "Context" }),
|
|
38236
|
+
/* @__PURE__ */ jsx95(Text, { dimColor: true, children: " \xB7 inspect and manage current conversation context" })
|
|
38026
38237
|
] })
|
|
38027
38238
|
);
|
|
38028
38239
|
};
|
|
38029
38240
|
var renderKeybindings = () => {
|
|
38030
38241
|
return outBox(
|
|
38031
|
-
/* @__PURE__ */
|
|
38032
|
-
/* @__PURE__ */
|
|
38033
|
-
/* @__PURE__ */
|
|
38242
|
+
/* @__PURE__ */ jsxs78(Fragment17, { children: [
|
|
38243
|
+
/* @__PURE__ */ jsx95(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "Keybindings" }),
|
|
38244
|
+
/* @__PURE__ */ jsx95(Text, { dimColor: true, children: " \xB7 show or configure keybindings" })
|
|
38034
38245
|
] })
|
|
38035
38246
|
);
|
|
38036
38247
|
};
|
|
38037
38248
|
var renderVim = () => {
|
|
38038
38249
|
return outBox(
|
|
38039
|
-
/* @__PURE__ */
|
|
38040
|
-
/* @__PURE__ */
|
|
38041
|
-
/* @__PURE__ */
|
|
38250
|
+
/* @__PURE__ */ jsxs78(Fragment17, { children: [
|
|
38251
|
+
/* @__PURE__ */ jsx95(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "Vim" }),
|
|
38252
|
+
/* @__PURE__ */ jsx95(Text, { dimColor: true, children: " \xB7 toggle vim mode" })
|
|
38042
38253
|
] })
|
|
38043
38254
|
);
|
|
38044
38255
|
};
|
|
@@ -38050,17 +38261,17 @@ var renderSettingsEditUsage = () => {
|
|
|
38050
38261
|
};
|
|
38051
38262
|
var renderChat = () => {
|
|
38052
38263
|
return outBox(
|
|
38053
|
-
/* @__PURE__ */
|
|
38054
|
-
/* @__PURE__ */
|
|
38055
|
-
/* @__PURE__ */
|
|
38264
|
+
/* @__PURE__ */ jsxs78(Fragment17, { children: [
|
|
38265
|
+
/* @__PURE__ */ jsx95(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "Chat" }),
|
|
38266
|
+
/* @__PURE__ */ jsx95(Text, { dimColor: true, children: " \xB7 switch to conversational chat mode (no code execution)" })
|
|
38056
38267
|
] })
|
|
38057
38268
|
);
|
|
38058
38269
|
};
|
|
38059
38270
|
var renderCode = () => {
|
|
38060
38271
|
return outBox(
|
|
38061
|
-
/* @__PURE__ */
|
|
38062
|
-
/* @__PURE__ */
|
|
38063
|
-
/* @__PURE__ */
|
|
38272
|
+
/* @__PURE__ */ jsxs78(Fragment17, { children: [
|
|
38273
|
+
/* @__PURE__ */ jsx95(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "Code" }),
|
|
38274
|
+
/* @__PURE__ */ jsx95(Text, { dimColor: true, children: " \xB7 switch to code mode (agent can edit files and run commands)" })
|
|
38064
38275
|
] })
|
|
38065
38276
|
);
|
|
38066
38277
|
};
|
|
@@ -38723,7 +38934,7 @@ function getThreadManager() {
|
|
|
38723
38934
|
}
|
|
38724
38935
|
|
|
38725
38936
|
// src/app/ui/components/slash-commands/renderers/threadRenderers.tsx
|
|
38726
|
-
import { Fragment as Fragment18, jsx as
|
|
38937
|
+
import { Fragment as Fragment18, jsx as jsx96, jsxs as jsxs79 } from "react/jsx-runtime";
|
|
38727
38938
|
function formatDate(iso) {
|
|
38728
38939
|
const d = new Date(iso);
|
|
38729
38940
|
return d.toLocaleString("pt-PT", {
|
|
@@ -38754,45 +38965,45 @@ async function renderCurrentThread() {
|
|
|
38754
38965
|
const manager = getThreadManager();
|
|
38755
38966
|
const metadata = await manager.getActiveThread();
|
|
38756
38967
|
if (!metadata) {
|
|
38757
|
-
return /* @__PURE__ */
|
|
38758
|
-
/* @__PURE__ */
|
|
38759
|
-
/* @__PURE__ */
|
|
38968
|
+
return /* @__PURE__ */ jsx96(MessageResponse, { children: /* @__PURE__ */ jsxs79(Box_default, { flexDirection: "column", gap: 1, children: [
|
|
38969
|
+
/* @__PURE__ */ jsx96(Text, { color: BLUMA_TERMINAL.err, children: "Nenhuma thread ativa" }),
|
|
38970
|
+
/* @__PURE__ */ jsx96(Text, { dimColor: true, children: "Cria uma nova com: /thread new [nome]" })
|
|
38760
38971
|
] }) });
|
|
38761
38972
|
}
|
|
38762
|
-
return /* @__PURE__ */
|
|
38763
|
-
/* @__PURE__ */
|
|
38764
|
-
/* @__PURE__ */
|
|
38765
|
-
/* @__PURE__ */
|
|
38766
|
-
/* @__PURE__ */
|
|
38767
|
-
/* @__PURE__ */
|
|
38973
|
+
return /* @__PURE__ */ jsx96(MessageResponse, { children: /* @__PURE__ */ jsxs79(Box_default, { flexDirection: "column", gap: 1, children: [
|
|
38974
|
+
/* @__PURE__ */ jsx96(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "Thread Atual" }),
|
|
38975
|
+
/* @__PURE__ */ jsxs79(Box_default, { flexDirection: "column", paddingLeft: 2, children: [
|
|
38976
|
+
/* @__PURE__ */ jsxs79(Text, { children: [
|
|
38977
|
+
/* @__PURE__ */ jsx96(Text, { dimColor: true, children: "ID: " }),
|
|
38978
|
+
/* @__PURE__ */ jsx96(Text, { color: BLUMA_TERMINAL.accent, children: metadata.threadId })
|
|
38768
38979
|
] }),
|
|
38769
|
-
/* @__PURE__ */
|
|
38770
|
-
/* @__PURE__ */
|
|
38771
|
-
/* @__PURE__ */
|
|
38980
|
+
/* @__PURE__ */ jsxs79(Text, { children: [
|
|
38981
|
+
/* @__PURE__ */ jsx96(Text, { dimColor: true, children: "Nome: " }),
|
|
38982
|
+
/* @__PURE__ */ jsx96(Text, { children: metadata.name || "(sem nome)" })
|
|
38772
38983
|
] }),
|
|
38773
|
-
/* @__PURE__ */
|
|
38774
|
-
/* @__PURE__ */
|
|
38775
|
-
/* @__PURE__ */
|
|
38984
|
+
/* @__PURE__ */ jsxs79(Text, { children: [
|
|
38985
|
+
/* @__PURE__ */ jsx96(Text, { dimColor: true, children: "Preview: " }),
|
|
38986
|
+
/* @__PURE__ */ jsx96(Text, { dimColor: true, children: truncate3(metadata.preview, 60) })
|
|
38776
38987
|
] }),
|
|
38777
|
-
/* @__PURE__ */
|
|
38778
|
-
/* @__PURE__ */
|
|
38779
|
-
/* @__PURE__ */
|
|
38988
|
+
/* @__PURE__ */ jsxs79(Text, { children: [
|
|
38989
|
+
/* @__PURE__ */ jsx96(Text, { dimColor: true, children: "Modelo: " }),
|
|
38990
|
+
/* @__PURE__ */ jsx96(Text, { children: metadata.model })
|
|
38780
38991
|
] }),
|
|
38781
|
-
/* @__PURE__ */
|
|
38782
|
-
/* @__PURE__ */
|
|
38783
|
-
/* @__PURE__ */
|
|
38992
|
+
/* @__PURE__ */ jsxs79(Text, { children: [
|
|
38993
|
+
/* @__PURE__ */ jsx96(Text, { dimColor: true, children: "CWD: " }),
|
|
38994
|
+
/* @__PURE__ */ jsx96(Text, { dimColor: true, children: metadata.cwd })
|
|
38784
38995
|
] }),
|
|
38785
|
-
metadata.gitInfo && /* @__PURE__ */
|
|
38786
|
-
/* @__PURE__ */
|
|
38787
|
-
/* @__PURE__ */
|
|
38996
|
+
metadata.gitInfo && /* @__PURE__ */ jsxs79(Text, { children: [
|
|
38997
|
+
/* @__PURE__ */ jsx96(Text, { dimColor: true, children: "Git: " }),
|
|
38998
|
+
/* @__PURE__ */ jsxs79(Text, { dimColor: true, children: [
|
|
38788
38999
|
metadata.gitInfo.branch || "?",
|
|
38789
39000
|
" @ ",
|
|
38790
39001
|
truncate3(metadata.gitInfo.sha || "?", 8)
|
|
38791
39002
|
] })
|
|
38792
39003
|
] }),
|
|
38793
|
-
/* @__PURE__ */
|
|
38794
|
-
/* @__PURE__ */
|
|
38795
|
-
/* @__PURE__ */
|
|
39004
|
+
/* @__PURE__ */ jsxs79(Text, { children: [
|
|
39005
|
+
/* @__PURE__ */ jsx96(Text, { dimColor: true, children: "Tokens: " }),
|
|
39006
|
+
/* @__PURE__ */ jsxs79(Text, { children: [
|
|
38796
39007
|
metadata.tokenUsage.totalTokens.toLocaleString(),
|
|
38797
39008
|
" (",
|
|
38798
39009
|
metadata.tokenUsage.inputTokens.toLocaleString(),
|
|
@@ -38802,17 +39013,17 @@ async function renderCurrentThread() {
|
|
|
38802
39013
|
" out)"
|
|
38803
39014
|
] })
|
|
38804
39015
|
] }),
|
|
38805
|
-
/* @__PURE__ */
|
|
38806
|
-
/* @__PURE__ */
|
|
38807
|
-
/* @__PURE__ */
|
|
39016
|
+
/* @__PURE__ */ jsxs79(Text, { children: [
|
|
39017
|
+
/* @__PURE__ */ jsx96(Text, { dimColor: true, children: "Criada: " }),
|
|
39018
|
+
/* @__PURE__ */ jsx96(Text, { dimColor: true, children: formatDate(metadata.createdAt) })
|
|
38808
39019
|
] }),
|
|
38809
|
-
/* @__PURE__ */
|
|
38810
|
-
/* @__PURE__ */
|
|
38811
|
-
/* @__PURE__ */
|
|
39020
|
+
/* @__PURE__ */ jsxs79(Text, { children: [
|
|
39021
|
+
/* @__PURE__ */ jsx96(Text, { dimColor: true, children: "Atualizada: " }),
|
|
39022
|
+
/* @__PURE__ */ jsx96(Text, { dimColor: true, children: formatRelativeTime(metadata.updatedAt) })
|
|
38812
39023
|
] }),
|
|
38813
|
-
metadata.forkedFromId && /* @__PURE__ */
|
|
38814
|
-
/* @__PURE__ */
|
|
38815
|
-
/* @__PURE__ */
|
|
39024
|
+
metadata.forkedFromId && /* @__PURE__ */ jsxs79(Text, { children: [
|
|
39025
|
+
/* @__PURE__ */ jsx96(Text, { dimColor: true, children: "Fork de: " }),
|
|
39026
|
+
/* @__PURE__ */ jsx96(Text, { color: BLUMA_TERMINAL.accent, children: metadata.forkedFromId })
|
|
38816
39027
|
] })
|
|
38817
39028
|
] })
|
|
38818
39029
|
] }) });
|
|
@@ -38829,20 +39040,20 @@ async function renderThreadList(args) {
|
|
|
38829
39040
|
searchTerm
|
|
38830
39041
|
});
|
|
38831
39042
|
if (result.threads.length === 0) {
|
|
38832
|
-
return /* @__PURE__ */
|
|
38833
|
-
/* @__PURE__ */
|
|
38834
|
-
/* @__PURE__ */
|
|
39043
|
+
return /* @__PURE__ */ jsx96(MessageResponse, { children: /* @__PURE__ */ jsxs79(Box_default, { flexDirection: "column", gap: 1, children: [
|
|
39044
|
+
/* @__PURE__ */ jsx96(Text, { dimColor: true, children: "Nenhuma thread encontrada" }),
|
|
39045
|
+
/* @__PURE__ */ jsx96(Text, { dimColor: true, children: "Cria uma nova com: /thread new [nome]" })
|
|
38835
39046
|
] }) });
|
|
38836
39047
|
}
|
|
38837
|
-
return /* @__PURE__ */
|
|
38838
|
-
/* @__PURE__ */
|
|
39048
|
+
return /* @__PURE__ */ jsx96(MessageResponse, { children: /* @__PURE__ */ jsxs79(Box_default, { flexDirection: "column", gap: 1, children: [
|
|
39049
|
+
/* @__PURE__ */ jsxs79(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: [
|
|
38839
39050
|
"Threads (",
|
|
38840
39051
|
result.total,
|
|
38841
39052
|
" total",
|
|
38842
39053
|
result.hasMore ? "+" : "",
|
|
38843
39054
|
")"
|
|
38844
39055
|
] }),
|
|
38845
|
-
/* @__PURE__ */
|
|
39056
|
+
/* @__PURE__ */ jsx96(Box_default, { flexDirection: "column", gap: 1, children: result.threads.map((thread, idx) => /* @__PURE__ */ jsx96(
|
|
38846
39057
|
ThreadListItem,
|
|
38847
39058
|
{
|
|
38848
39059
|
thread,
|
|
@@ -38856,18 +39067,18 @@ async function renderThreadList(args) {
|
|
|
38856
39067
|
var ThreadListItem = ({ thread, isActive, index }) => {
|
|
38857
39068
|
const statusColor = thread.status === "archived" ? BLUMA_TERMINAL.warning : BLUMA_TERMINAL.success;
|
|
38858
39069
|
const name = thread.name || truncate3(thread.preview, 40);
|
|
38859
|
-
return /* @__PURE__ */
|
|
38860
|
-
/* @__PURE__ */
|
|
38861
|
-
/* @__PURE__ */
|
|
39070
|
+
return /* @__PURE__ */ jsxs79(Box_default, { flexDirection: "column", children: [
|
|
39071
|
+
/* @__PURE__ */ jsxs79(Box_default, { gap: 1, children: [
|
|
39072
|
+
/* @__PURE__ */ jsxs79(Text, { dimColor: true, children: [
|
|
38862
39073
|
index,
|
|
38863
39074
|
"."
|
|
38864
39075
|
] }),
|
|
38865
|
-
isActive && /* @__PURE__ */
|
|
38866
|
-
/* @__PURE__ */
|
|
38867
|
-
thread.status === "archived" && /* @__PURE__ */
|
|
38868
|
-
thread.forkedFromId && /* @__PURE__ */
|
|
39076
|
+
isActive && /* @__PURE__ */ jsx96(Text, { color: BLUMA_TERMINAL.accent, children: "\u25CF" }),
|
|
39077
|
+
/* @__PURE__ */ jsx96(Text, { bold: isActive, color: isActive ? BLUMA_TERMINAL.accent : void 0, children: name }),
|
|
39078
|
+
thread.status === "archived" && /* @__PURE__ */ jsx96(Text, { color: BLUMA_TERMINAL.warning, children: "[arquivada]" }),
|
|
39079
|
+
thread.forkedFromId && /* @__PURE__ */ jsx96(Text, { dimColor: true, children: "(fork)" })
|
|
38869
39080
|
] }),
|
|
38870
|
-
/* @__PURE__ */
|
|
39081
|
+
/* @__PURE__ */ jsx96(Box_default, { paddingLeft: 4, children: /* @__PURE__ */ jsxs79(Text, { dimColor: true, children: [
|
|
38871
39082
|
"ID: ",
|
|
38872
39083
|
thread.threadId,
|
|
38873
39084
|
" \u2022 ",
|
|
@@ -38889,19 +39100,19 @@ async function runThreadNew(args) {
|
|
|
38889
39100
|
// Será definido pelo agent
|
|
38890
39101
|
cwd: process.cwd()
|
|
38891
39102
|
});
|
|
38892
|
-
return /* @__PURE__ */
|
|
38893
|
-
/* @__PURE__ */
|
|
38894
|
-
/* @__PURE__ */
|
|
38895
|
-
/* @__PURE__ */
|
|
38896
|
-
/* @__PURE__ */
|
|
39103
|
+
return /* @__PURE__ */ jsx96(MessageResponse, { children: /* @__PURE__ */ jsxs79(Box_default, { flexDirection: "column", gap: 1, children: [
|
|
39104
|
+
/* @__PURE__ */ jsx96(Text, { color: BLUMA_TERMINAL.success, children: "\u2713 Nova thread criada" }),
|
|
39105
|
+
/* @__PURE__ */ jsx96(Box_default, { paddingLeft: 2, children: /* @__PURE__ */ jsxs79(Text, { children: [
|
|
39106
|
+
/* @__PURE__ */ jsx96(Text, { dimColor: true, children: "ID: " }),
|
|
39107
|
+
/* @__PURE__ */ jsx96(Text, { color: BLUMA_TERMINAL.accent, children: metadata.threadId })
|
|
38897
39108
|
] }) }),
|
|
38898
|
-
metadata.name && /* @__PURE__ */
|
|
38899
|
-
/* @__PURE__ */
|
|
38900
|
-
/* @__PURE__ */
|
|
39109
|
+
metadata.name && /* @__PURE__ */ jsx96(Box_default, { paddingLeft: 2, children: /* @__PURE__ */ jsxs79(Text, { children: [
|
|
39110
|
+
/* @__PURE__ */ jsx96(Text, { dimColor: true, children: "Nome: " }),
|
|
39111
|
+
/* @__PURE__ */ jsx96(Text, { children: metadata.name })
|
|
38901
39112
|
] }) })
|
|
38902
39113
|
] }) });
|
|
38903
39114
|
} catch (e) {
|
|
38904
|
-
return /* @__PURE__ */
|
|
39115
|
+
return /* @__PURE__ */ jsx96(MessageResponse, { children: /* @__PURE__ */ jsxs79(Text, { color: BLUMA_TERMINAL.err, children: [
|
|
38905
39116
|
"Erro ao criar thread: ",
|
|
38906
39117
|
e.message
|
|
38907
39118
|
] }) });
|
|
@@ -38909,31 +39120,31 @@ async function runThreadNew(args) {
|
|
|
38909
39120
|
}
|
|
38910
39121
|
async function runThreadResume(args) {
|
|
38911
39122
|
if (args.length === 0) {
|
|
38912
|
-
return /* @__PURE__ */
|
|
39123
|
+
return /* @__PURE__ */ jsx96(MessageResponse, { children: /* @__PURE__ */ jsx96(Text, { color: BLUMA_TERMINAL.err, children: "Uso: /thread resume <id>" }) });
|
|
38913
39124
|
}
|
|
38914
39125
|
const threadId = args[0];
|
|
38915
39126
|
const manager = getThreadManager();
|
|
38916
39127
|
try {
|
|
38917
39128
|
const metadata = await manager.loadThread(threadId);
|
|
38918
39129
|
if (!metadata) {
|
|
38919
|
-
return /* @__PURE__ */
|
|
39130
|
+
return /* @__PURE__ */ jsx96(MessageResponse, { children: /* @__PURE__ */ jsxs79(Text, { color: BLUMA_TERMINAL.err, children: [
|
|
38920
39131
|
"Thread n\xE3o encontrada: ",
|
|
38921
39132
|
threadId
|
|
38922
39133
|
] }) });
|
|
38923
39134
|
}
|
|
38924
|
-
return /* @__PURE__ */
|
|
38925
|
-
/* @__PURE__ */
|
|
38926
|
-
/* @__PURE__ */
|
|
38927
|
-
/* @__PURE__ */
|
|
38928
|
-
/* @__PURE__ */
|
|
39135
|
+
return /* @__PURE__ */ jsx96(MessageResponse, { children: /* @__PURE__ */ jsxs79(Box_default, { flexDirection: "column", gap: 1, children: [
|
|
39136
|
+
/* @__PURE__ */ jsx96(Text, { color: BLUMA_TERMINAL.success, children: "\u2713 Thread retomada" }),
|
|
39137
|
+
/* @__PURE__ */ jsx96(Box_default, { paddingLeft: 2, children: /* @__PURE__ */ jsxs79(Text, { children: [
|
|
39138
|
+
/* @__PURE__ */ jsx96(Text, { dimColor: true, children: "ID: " }),
|
|
39139
|
+
/* @__PURE__ */ jsx96(Text, { color: BLUMA_TERMINAL.accent, children: metadata.threadId })
|
|
38929
39140
|
] }) }),
|
|
38930
|
-
/* @__PURE__ */
|
|
38931
|
-
/* @__PURE__ */
|
|
38932
|
-
/* @__PURE__ */
|
|
39141
|
+
/* @__PURE__ */ jsx96(Box_default, { paddingLeft: 2, children: /* @__PURE__ */ jsxs79(Text, { children: [
|
|
39142
|
+
/* @__PURE__ */ jsx96(Text, { dimColor: true, children: "Mensagens: " }),
|
|
39143
|
+
/* @__PURE__ */ jsx96(Text, { children: manager.getActiveHistory()?.messages.length || 0 })
|
|
38933
39144
|
] }) })
|
|
38934
39145
|
] }) });
|
|
38935
39146
|
} catch (e) {
|
|
38936
|
-
return /* @__PURE__ */
|
|
39147
|
+
return /* @__PURE__ */ jsx96(MessageResponse, { children: /* @__PURE__ */ jsxs79(Text, { color: BLUMA_TERMINAL.err, children: [
|
|
38937
39148
|
"Erro ao retomar thread: ",
|
|
38938
39149
|
e.message
|
|
38939
39150
|
] }) });
|
|
@@ -38945,21 +39156,21 @@ async function runThreadFork(args) {
|
|
|
38945
39156
|
try {
|
|
38946
39157
|
const metadata = await manager.forkActiveThread(name);
|
|
38947
39158
|
if (!metadata) {
|
|
38948
|
-
return /* @__PURE__ */
|
|
39159
|
+
return /* @__PURE__ */ jsx96(MessageResponse, { children: /* @__PURE__ */ jsx96(Text, { color: BLUMA_TERMINAL.err, children: "Nenhuma thread ativa para fazer fork" }) });
|
|
38949
39160
|
}
|
|
38950
|
-
return /* @__PURE__ */
|
|
38951
|
-
/* @__PURE__ */
|
|
38952
|
-
/* @__PURE__ */
|
|
38953
|
-
/* @__PURE__ */
|
|
38954
|
-
/* @__PURE__ */
|
|
39161
|
+
return /* @__PURE__ */ jsx96(MessageResponse, { children: /* @__PURE__ */ jsxs79(Box_default, { flexDirection: "column", gap: 1, children: [
|
|
39162
|
+
/* @__PURE__ */ jsx96(Text, { color: BLUMA_TERMINAL.success, children: "\u2713 Thread fork criada" }),
|
|
39163
|
+
/* @__PURE__ */ jsx96(Box_default, { paddingLeft: 2, children: /* @__PURE__ */ jsxs79(Text, { children: [
|
|
39164
|
+
/* @__PURE__ */ jsx96(Text, { dimColor: true, children: "Nova ID: " }),
|
|
39165
|
+
/* @__PURE__ */ jsx96(Text, { color: BLUMA_TERMINAL.accent, children: metadata.threadId })
|
|
38955
39166
|
] }) }),
|
|
38956
|
-
/* @__PURE__ */
|
|
38957
|
-
/* @__PURE__ */
|
|
38958
|
-
/* @__PURE__ */
|
|
39167
|
+
/* @__PURE__ */ jsx96(Box_default, { paddingLeft: 2, children: /* @__PURE__ */ jsxs79(Text, { children: [
|
|
39168
|
+
/* @__PURE__ */ jsx96(Text, { dimColor: true, children: "Original: " }),
|
|
39169
|
+
/* @__PURE__ */ jsx96(Text, { color: BLUMA_TERMINAL.accent, children: metadata.forkedFromId })
|
|
38959
39170
|
] }) })
|
|
38960
39171
|
] }) });
|
|
38961
39172
|
} catch (e) {
|
|
38962
|
-
return /* @__PURE__ */
|
|
39173
|
+
return /* @__PURE__ */ jsx96(MessageResponse, { children: /* @__PURE__ */ jsxs79(Text, { color: BLUMA_TERMINAL.err, children: [
|
|
38963
39174
|
"Erro ao fazer fork: ",
|
|
38964
39175
|
e.message
|
|
38965
39176
|
] }) });
|
|
@@ -38967,18 +39178,18 @@ async function runThreadFork(args) {
|
|
|
38967
39178
|
}
|
|
38968
39179
|
async function runThreadRename(args) {
|
|
38969
39180
|
if (args.length === 0) {
|
|
38970
|
-
return /* @__PURE__ */
|
|
39181
|
+
return /* @__PURE__ */ jsx96(MessageResponse, { children: /* @__PURE__ */ jsx96(Text, { color: BLUMA_TERMINAL.err, children: "Uso: /thread rename <nome>" }) });
|
|
38971
39182
|
}
|
|
38972
39183
|
const name = args.join(" ");
|
|
38973
39184
|
const manager = getThreadManager();
|
|
38974
39185
|
try {
|
|
38975
39186
|
await manager.renameThread(name);
|
|
38976
|
-
return /* @__PURE__ */
|
|
39187
|
+
return /* @__PURE__ */ jsx96(MessageResponse, { children: /* @__PURE__ */ jsxs79(Text, { color: BLUMA_TERMINAL.success, children: [
|
|
38977
39188
|
"\u2713 Thread renomeada para: ",
|
|
38978
39189
|
name
|
|
38979
39190
|
] }) });
|
|
38980
39191
|
} catch (e) {
|
|
38981
|
-
return /* @__PURE__ */
|
|
39192
|
+
return /* @__PURE__ */ jsx96(MessageResponse, { children: /* @__PURE__ */ jsxs79(Text, { color: BLUMA_TERMINAL.err, children: [
|
|
38982
39193
|
"Erro ao renomear: ",
|
|
38983
39194
|
e.message
|
|
38984
39195
|
] }) });
|
|
@@ -38989,11 +39200,11 @@ async function runThreadArchive() {
|
|
|
38989
39200
|
try {
|
|
38990
39201
|
const result = await manager.archiveActiveThread();
|
|
38991
39202
|
if (!result) {
|
|
38992
|
-
return /* @__PURE__ */
|
|
39203
|
+
return /* @__PURE__ */ jsx96(MessageResponse, { children: /* @__PURE__ */ jsx96(Text, { color: BLUMA_TERMINAL.err, children: "Nenhuma thread ativa para arquivar" }) });
|
|
38993
39204
|
}
|
|
38994
|
-
return /* @__PURE__ */
|
|
39205
|
+
return /* @__PURE__ */ jsx96(MessageResponse, { children: /* @__PURE__ */ jsx96(Text, { color: BLUMA_TERMINAL.success, children: "\u2713 Thread arquivada" }) });
|
|
38995
39206
|
} catch (e) {
|
|
38996
|
-
return /* @__PURE__ */
|
|
39207
|
+
return /* @__PURE__ */ jsx96(MessageResponse, { children: /* @__PURE__ */ jsxs79(Text, { color: BLUMA_TERMINAL.err, children: [
|
|
38997
39208
|
"Erro ao arquivar: ",
|
|
38998
39209
|
e.message
|
|
38999
39210
|
] }) });
|
|
@@ -39001,21 +39212,21 @@ async function runThreadArchive() {
|
|
|
39001
39212
|
}
|
|
39002
39213
|
async function runThreadUnarchive(args) {
|
|
39003
39214
|
if (args.length === 0) {
|
|
39004
|
-
return /* @__PURE__ */
|
|
39215
|
+
return /* @__PURE__ */ jsx96(MessageResponse, { children: /* @__PURE__ */ jsx96(Text, { color: BLUMA_TERMINAL.err, children: "Uso: /thread unarchive <id>" }) });
|
|
39005
39216
|
}
|
|
39006
39217
|
const threadId = args[0];
|
|
39007
39218
|
const manager = getThreadManager();
|
|
39008
39219
|
try {
|
|
39009
39220
|
const result = await manager.unarchiveThread(threadId);
|
|
39010
39221
|
if (!result) {
|
|
39011
|
-
return /* @__PURE__ */
|
|
39222
|
+
return /* @__PURE__ */ jsx96(MessageResponse, { children: /* @__PURE__ */ jsxs79(Text, { color: BLUMA_TERMINAL.err, children: [
|
|
39012
39223
|
"Thread n\xE3o encontrada: ",
|
|
39013
39224
|
threadId
|
|
39014
39225
|
] }) });
|
|
39015
39226
|
}
|
|
39016
|
-
return /* @__PURE__ */
|
|
39227
|
+
return /* @__PURE__ */ jsx96(MessageResponse, { children: /* @__PURE__ */ jsx96(Text, { color: BLUMA_TERMINAL.success, children: "\u2713 Thread desarquivada" }) });
|
|
39017
39228
|
} catch (e) {
|
|
39018
|
-
return /* @__PURE__ */
|
|
39229
|
+
return /* @__PURE__ */ jsx96(MessageResponse, { children: /* @__PURE__ */ jsxs79(Text, { color: BLUMA_TERMINAL.err, children: [
|
|
39019
39230
|
"Erro ao desarquivar: ",
|
|
39020
39231
|
e.message
|
|
39021
39232
|
] }) });
|
|
@@ -39023,24 +39234,24 @@ async function runThreadUnarchive(args) {
|
|
|
39023
39234
|
}
|
|
39024
39235
|
async function runThreadDelete(args) {
|
|
39025
39236
|
if (args.length === 0) {
|
|
39026
|
-
return /* @__PURE__ */
|
|
39237
|
+
return /* @__PURE__ */ jsx96(MessageResponse, { children: /* @__PURE__ */ jsx96(Text, { color: BLUMA_TERMINAL.err, children: "Uso: /thread delete <id>" }) });
|
|
39027
39238
|
}
|
|
39028
39239
|
const threadId = args[0];
|
|
39029
39240
|
const store2 = getThreadStore();
|
|
39030
39241
|
try {
|
|
39031
39242
|
const result = await store2.deleteThread(threadId);
|
|
39032
39243
|
if (!result) {
|
|
39033
|
-
return /* @__PURE__ */
|
|
39244
|
+
return /* @__PURE__ */ jsx96(MessageResponse, { children: /* @__PURE__ */ jsxs79(Text, { color: BLUMA_TERMINAL.err, children: [
|
|
39034
39245
|
"Thread n\xE3o encontrada: ",
|
|
39035
39246
|
threadId
|
|
39036
39247
|
] }) });
|
|
39037
39248
|
}
|
|
39038
|
-
return /* @__PURE__ */
|
|
39249
|
+
return /* @__PURE__ */ jsx96(MessageResponse, { children: /* @__PURE__ */ jsxs79(Text, { color: BLUMA_TERMINAL.success, children: [
|
|
39039
39250
|
"\u2713 Thread apagada: ",
|
|
39040
39251
|
threadId
|
|
39041
39252
|
] }) });
|
|
39042
39253
|
} catch (e) {
|
|
39043
|
-
return /* @__PURE__ */
|
|
39254
|
+
return /* @__PURE__ */ jsx96(MessageResponse, { children: /* @__PURE__ */ jsxs79(Text, { color: BLUMA_TERMINAL.err, children: [
|
|
39044
39255
|
"Erro ao apagar: ",
|
|
39045
39256
|
e.message
|
|
39046
39257
|
] }) });
|
|
@@ -39053,35 +39264,35 @@ async function renderThreadStats() {
|
|
|
39053
39264
|
try {
|
|
39054
39265
|
const stats = await store2.getStats();
|
|
39055
39266
|
const active = await manager.getActiveThread();
|
|
39056
|
-
return /* @__PURE__ */
|
|
39057
|
-
/* @__PURE__ */
|
|
39058
|
-
/* @__PURE__ */
|
|
39059
|
-
/* @__PURE__ */
|
|
39060
|
-
/* @__PURE__ */
|
|
39061
|
-
/* @__PURE__ */
|
|
39267
|
+
return /* @__PURE__ */ jsx96(MessageResponse, { children: /* @__PURE__ */ jsxs79(Box_default, { flexDirection: "column", gap: 1, children: [
|
|
39268
|
+
/* @__PURE__ */ jsx96(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "Estat\xEDsticas de Threads" }),
|
|
39269
|
+
/* @__PURE__ */ jsxs79(Box_default, { flexDirection: "column", paddingLeft: 2, children: [
|
|
39270
|
+
/* @__PURE__ */ jsxs79(Text, { children: [
|
|
39271
|
+
/* @__PURE__ */ jsx96(Text, { dimColor: true, children: "Total: " }),
|
|
39272
|
+
/* @__PURE__ */ jsx96(Text, { children: stats.total })
|
|
39062
39273
|
] }),
|
|
39063
|
-
/* @__PURE__ */
|
|
39064
|
-
/* @__PURE__ */
|
|
39065
|
-
/* @__PURE__ */
|
|
39274
|
+
/* @__PURE__ */ jsxs79(Text, { children: [
|
|
39275
|
+
/* @__PURE__ */ jsx96(Text, { dimColor: true, children: "Ativas: " }),
|
|
39276
|
+
/* @__PURE__ */ jsx96(Text, { color: BLUMA_TERMINAL.success, children: stats.active })
|
|
39066
39277
|
] }),
|
|
39067
|
-
/* @__PURE__ */
|
|
39068
|
-
/* @__PURE__ */
|
|
39069
|
-
/* @__PURE__ */
|
|
39278
|
+
/* @__PURE__ */ jsxs79(Text, { children: [
|
|
39279
|
+
/* @__PURE__ */ jsx96(Text, { dimColor: true, children: "Arquivadas: " }),
|
|
39280
|
+
/* @__PURE__ */ jsx96(Text, { color: BLUMA_TERMINAL.warning, children: stats.archived })
|
|
39070
39281
|
] }),
|
|
39071
|
-
active && /* @__PURE__ */
|
|
39072
|
-
/* @__PURE__ */
|
|
39073
|
-
/* @__PURE__ */
|
|
39074
|
-
/* @__PURE__ */
|
|
39282
|
+
active && /* @__PURE__ */ jsxs79(Fragment18, { children: [
|
|
39283
|
+
/* @__PURE__ */ jsxs79(Text, { children: [
|
|
39284
|
+
/* @__PURE__ */ jsx96(Text, { dimColor: true, children: "Thread ativa: " }),
|
|
39285
|
+
/* @__PURE__ */ jsx96(Text, { color: BLUMA_TERMINAL.accent, children: active.threadId })
|
|
39075
39286
|
] }),
|
|
39076
|
-
/* @__PURE__ */
|
|
39077
|
-
/* @__PURE__ */
|
|
39078
|
-
/* @__PURE__ */
|
|
39287
|
+
/* @__PURE__ */ jsxs79(Text, { children: [
|
|
39288
|
+
/* @__PURE__ */ jsx96(Text, { dimColor: true, children: "Tokens usados: " }),
|
|
39289
|
+
/* @__PURE__ */ jsx96(Text, { children: active.tokenUsage.totalTokens.toLocaleString() })
|
|
39079
39290
|
] })
|
|
39080
39291
|
] })
|
|
39081
39292
|
] })
|
|
39082
39293
|
] }) });
|
|
39083
39294
|
} catch (e) {
|
|
39084
|
-
return /* @__PURE__ */
|
|
39295
|
+
return /* @__PURE__ */ jsx96(MessageResponse, { children: /* @__PURE__ */ jsxs79(Text, { color: BLUMA_TERMINAL.err, children: [
|
|
39085
39296
|
"Erro: ",
|
|
39086
39297
|
e.message
|
|
39087
39298
|
] }) });
|
|
@@ -39089,7 +39300,37 @@ async function renderThreadStats() {
|
|
|
39089
39300
|
}
|
|
39090
39301
|
|
|
39091
39302
|
// src/app/ui/components/SlashCommands.tsx
|
|
39092
|
-
import { Fragment as Fragment19, jsx as
|
|
39303
|
+
import { Fragment as Fragment19, jsx as jsx97, jsxs as jsxs80 } from "react/jsx-runtime";
|
|
39304
|
+
var SLASH_COMMANDS_WITH_INTERNAL_PROMPTS = /* @__PURE__ */ new Set([
|
|
39305
|
+
"review",
|
|
39306
|
+
"commit",
|
|
39307
|
+
"pr",
|
|
39308
|
+
"release",
|
|
39309
|
+
"bug",
|
|
39310
|
+
"ctx",
|
|
39311
|
+
"snip",
|
|
39312
|
+
"dream",
|
|
39313
|
+
"collapse",
|
|
39314
|
+
"brief",
|
|
39315
|
+
"undo",
|
|
39316
|
+
"redo",
|
|
39317
|
+
"diff",
|
|
39318
|
+
"explain",
|
|
39319
|
+
"fix",
|
|
39320
|
+
"editor",
|
|
39321
|
+
"debug",
|
|
39322
|
+
"test",
|
|
39323
|
+
"optimize",
|
|
39324
|
+
"refactor",
|
|
39325
|
+
"document",
|
|
39326
|
+
"summarize",
|
|
39327
|
+
"file",
|
|
39328
|
+
"search",
|
|
39329
|
+
"macro",
|
|
39330
|
+
"template",
|
|
39331
|
+
"share"
|
|
39332
|
+
]);
|
|
39333
|
+
var SLASH_COMMANDS_PASSTHROUGH = /* @__PURE__ */ new Set(["tasks", "hooks", "plugins"]);
|
|
39093
39334
|
var SlashCommands = ({
|
|
39094
39335
|
input,
|
|
39095
39336
|
setHistory,
|
|
@@ -39101,6 +39342,7 @@ var SlashCommands = ({
|
|
|
39101
39342
|
const [cmd, ...args] = input.slice(1).trim().split(/\s+/);
|
|
39102
39343
|
const clearAppliedRef = useRef7(false);
|
|
39103
39344
|
const timerStartedRef = useRef7(false);
|
|
39345
|
+
const lastRecordedSlashInputRef = useRef7(null);
|
|
39104
39346
|
const [renderedContent, setRenderedContent] = useState19(null);
|
|
39105
39347
|
const [permissionsMenuResolved, setPermissionsMenuResolved] = useState19(false);
|
|
39106
39348
|
const [agentMenuResolved, setAgentMenuResolved] = useState19(false);
|
|
@@ -39119,6 +39361,7 @@ var SlashCommands = ({
|
|
|
39119
39361
|
const openEffortMenu = cmd === "effort" && !effortMenuResolved && !args[0];
|
|
39120
39362
|
const openStyleMenu = cmd === "style" && !styleMenuResolved && !args[0];
|
|
39121
39363
|
const anySlashMenuOpen = openPermissionsMenu || openAgentMenu || openSandboxMenu || openEffortMenu || openStyleMenu;
|
|
39364
|
+
const shouldPreserveSlashInRestore = Boolean(cmd) && !SLASH_COMMANDS_PASSTHROUGH.has(cmd);
|
|
39122
39365
|
useEffect17(() => {
|
|
39123
39366
|
if (anySlashMenuOpen) {
|
|
39124
39367
|
uiEventBus.emit("slash_command_menu_open", {
|
|
@@ -39131,6 +39374,15 @@ var SlashCommands = ({
|
|
|
39131
39374
|
uiEventBus.emit("slash_command_menu_close");
|
|
39132
39375
|
};
|
|
39133
39376
|
}, [anySlashMenuOpen, cmd]);
|
|
39377
|
+
useEffect17(() => {
|
|
39378
|
+
if (!shouldPreserveSlashInRestore || !input) return;
|
|
39379
|
+
if (lastRecordedSlashInputRef.current === input) return;
|
|
39380
|
+
lastRecordedSlashInputRef.current = input;
|
|
39381
|
+
agentRef.current?.recordUiSlashCommand(
|
|
39382
|
+
input,
|
|
39383
|
+
SLASH_COMMANDS_WITH_INTERNAL_PROMPTS.has(cmd) ? "with_internal_prompt" : "visible_only"
|
|
39384
|
+
);
|
|
39385
|
+
}, [agentRef, input, shouldPreserveSlashInRestore]);
|
|
39134
39386
|
useEffect17(() => {
|
|
39135
39387
|
if (timerStartedRef.current) return;
|
|
39136
39388
|
const fullCommandName = cmd ? `/${[cmd, ...args].join(" ").trim()}` : "";
|
|
@@ -39152,9 +39404,9 @@ var SlashCommands = ({
|
|
|
39152
39404
|
{
|
|
39153
39405
|
id: Date.now(),
|
|
39154
39406
|
component: outBox(
|
|
39155
|
-
/* @__PURE__ */
|
|
39156
|
-
/* @__PURE__ */
|
|
39157
|
-
/* @__PURE__ */
|
|
39407
|
+
/* @__PURE__ */ jsxs80(Box_default, { children: [
|
|
39408
|
+
/* @__PURE__ */ jsx97(Text, { color: "green", children: "[ok]" }),
|
|
39409
|
+
/* @__PURE__ */ jsx97(Text, { dimColor: true, children: " History cleared" })
|
|
39158
39410
|
] })
|
|
39159
39411
|
)
|
|
39160
39412
|
}
|
|
@@ -39367,7 +39619,7 @@ var SlashCommands = ({
|
|
|
39367
39619
|
setHistory((prev) => prev.concat({
|
|
39368
39620
|
id: Date.now(),
|
|
39369
39621
|
component: outBox(
|
|
39370
|
-
/* @__PURE__ */
|
|
39622
|
+
/* @__PURE__ */ jsx97(Text, { dimColor: true, children: formatTodoResult(result) })
|
|
39371
39623
|
)
|
|
39372
39624
|
}));
|
|
39373
39625
|
})();
|
|
@@ -39396,9 +39648,9 @@ var SlashCommands = ({
|
|
|
39396
39648
|
setHistory((prev) => prev.concat({
|
|
39397
39649
|
id: Date.now(),
|
|
39398
39650
|
component: outBox(
|
|
39399
|
-
/* @__PURE__ */
|
|
39400
|
-
/* @__PURE__ */
|
|
39401
|
-
result.activeTask ? /* @__PURE__ */
|
|
39651
|
+
/* @__PURE__ */ jsxs80(Fragment19, { children: [
|
|
39652
|
+
/* @__PURE__ */ jsx97(Text, { dimColor: true, children: result.message }),
|
|
39653
|
+
result.activeTask ? /* @__PURE__ */ jsxs80(Text, { dimColor: true, children: [
|
|
39402
39654
|
result.activeTask.mode,
|
|
39403
39655
|
" \xB7 ",
|
|
39404
39656
|
result.activeTask.taskName,
|
|
@@ -39428,7 +39680,7 @@ var SlashCommands = ({
|
|
|
39428
39680
|
const modes = ["default", "plan", "accept_edits"];
|
|
39429
39681
|
if (!sub || sub === "show" || sub === "menu") {
|
|
39430
39682
|
if (openPermissionsMenu) {
|
|
39431
|
-
return /* @__PURE__ */
|
|
39683
|
+
return /* @__PURE__ */ jsx97(
|
|
39432
39684
|
SlashCommandMenu,
|
|
39433
39685
|
{
|
|
39434
39686
|
title: "Permissions",
|
|
@@ -39489,7 +39741,7 @@ var SlashCommands = ({
|
|
|
39489
39741
|
const modes = ["default", "coordinator", "plan", "agent"];
|
|
39490
39742
|
if (!sub || sub === "show" || sub === "menu") {
|
|
39491
39743
|
if (openAgentMenu) {
|
|
39492
|
-
return /* @__PURE__ */
|
|
39744
|
+
return /* @__PURE__ */ jsx97(
|
|
39493
39745
|
SlashCommandMenu,
|
|
39494
39746
|
{
|
|
39495
39747
|
title: "Agent Mode",
|
|
@@ -39575,7 +39827,7 @@ var SlashCommands = ({
|
|
|
39575
39827
|
const normalized = value === "show" || value === "menu" ? "" : value;
|
|
39576
39828
|
if (!normalized) {
|
|
39577
39829
|
if (openEffortMenu) {
|
|
39578
|
-
return /* @__PURE__ */
|
|
39830
|
+
return /* @__PURE__ */ jsx97(
|
|
39579
39831
|
SlashCommandMenu,
|
|
39580
39832
|
{
|
|
39581
39833
|
title: "Effort",
|
|
@@ -39625,7 +39877,7 @@ var SlashCommands = ({
|
|
|
39625
39877
|
const normalized = value === "show" || value === "menu" ? "" : value;
|
|
39626
39878
|
if (!normalized) {
|
|
39627
39879
|
if (openStyleMenu) {
|
|
39628
|
-
return /* @__PURE__ */
|
|
39880
|
+
return /* @__PURE__ */ jsx97(
|
|
39629
39881
|
SlashCommandMenu,
|
|
39630
39882
|
{
|
|
39631
39883
|
title: "Style",
|
|
@@ -39675,7 +39927,7 @@ var SlashCommands = ({
|
|
|
39675
39927
|
const normalized = value === "show" || value === "menu" ? "" : value;
|
|
39676
39928
|
if (!normalized) {
|
|
39677
39929
|
if (openSandboxMenu) {
|
|
39678
|
-
return /* @__PURE__ */
|
|
39930
|
+
return /* @__PURE__ */ jsx97(
|
|
39679
39931
|
SlashCommandMenu,
|
|
39680
39932
|
{
|
|
39681
39933
|
title: "Sandbox",
|
|
@@ -39830,12 +40082,12 @@ Then follow the skill's workflow:
|
|
|
39830
40082
|
6. Verify: \`git log -1 --format=fuller\`
|
|
39831
40083
|
|
|
39832
40084
|
Report the commit hash and summary when done.`;
|
|
39833
|
-
await agentRef.current?.processTurn({ content: commitPrompt });
|
|
40085
|
+
await agentRef.current?.processTurn({ content: commitPrompt }, void 0, { historyName: "ui_internal_prompt" });
|
|
39834
40086
|
} catch (e) {
|
|
39835
40087
|
setHistory((prev) => prev.concat({
|
|
39836
40088
|
id: Date.now(),
|
|
39837
40089
|
component: outBox(
|
|
39838
|
-
/* @__PURE__ */
|
|
40090
|
+
/* @__PURE__ */ jsx97(Box_default, { children: /* @__PURE__ */ jsxs80(Text, { color: "red", children: [
|
|
39839
40091
|
"Failed to execute /commit: ",
|
|
39840
40092
|
e?.message || String(e)
|
|
39841
40093
|
] }) })
|
|
@@ -39924,12 +40176,12 @@ ${draftFlag ? "Create as DRAFT PR." : ""}
|
|
|
39924
40176
|
- Report the PR URL and number
|
|
39925
40177
|
|
|
39926
40178
|
Report the PR URL, number, title, and summary when done.`;
|
|
39927
|
-
await agentRef.current?.processTurn({ content: prPrompt });
|
|
40179
|
+
await agentRef.current?.processTurn({ content: prPrompt }, void 0, { historyName: "ui_internal_prompt" });
|
|
39928
40180
|
} catch (e) {
|
|
39929
40181
|
setHistory((prev) => prev.concat({
|
|
39930
40182
|
id: Date.now(),
|
|
39931
40183
|
component: outBox(
|
|
39932
|
-
/* @__PURE__ */
|
|
40184
|
+
/* @__PURE__ */ jsx97(Box_default, { children: /* @__PURE__ */ jsxs80(Text, { color: "red", children: [
|
|
39933
40185
|
"Failed to execute /pr: ",
|
|
39934
40186
|
e?.message || String(e)
|
|
39935
40187
|
] }) })
|
|
@@ -40085,12 +40337,12 @@ Instead, show a DETAILED PREVIEW of everything that WOULD happen:
|
|
|
40085
40337
|
Report this as a "Release Preview" so the user can review before executing.` : ""}
|
|
40086
40338
|
|
|
40087
40339
|
Report the release version, tag, changelog summary, and verification results when done.`;
|
|
40088
|
-
await agentRef.current?.processTurn({ content: releasePrompt });
|
|
40340
|
+
await agentRef.current?.processTurn({ content: releasePrompt }, void 0, { historyName: "ui_internal_prompt" });
|
|
40089
40341
|
} catch (e) {
|
|
40090
40342
|
setHistory((prev) => prev.concat({
|
|
40091
40343
|
id: Date.now(),
|
|
40092
40344
|
component: outBox(
|
|
40093
|
-
/* @__PURE__ */
|
|
40345
|
+
/* @__PURE__ */ jsx97(Box_default, { children: /* @__PURE__ */ jsxs80(Text, { color: "red", children: [
|
|
40094
40346
|
"Failed to execute /release: ",
|
|
40095
40347
|
e?.message || String(e)
|
|
40096
40348
|
] }) })
|
|
@@ -40101,9 +40353,9 @@ Report the release version, tag, changelog summary, and verification results whe
|
|
|
40101
40353
|
const bumpType = args.find((a) => ["major", "minor", "patch", "premajor", "preminor", "prepatch", "prerelease"].includes(a)) || "auto-detect";
|
|
40102
40354
|
const dryRun = args.includes("--dry-run") || args.includes("--dryrun");
|
|
40103
40355
|
return outBox(
|
|
40104
|
-
/* @__PURE__ */
|
|
40105
|
-
/* @__PURE__ */
|
|
40106
|
-
/* @__PURE__ */
|
|
40356
|
+
/* @__PURE__ */ jsxs80(Box_default, { children: [
|
|
40357
|
+
/* @__PURE__ */ jsx97(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "Release" }),
|
|
40358
|
+
/* @__PURE__ */ jsxs80(Text, { dimColor: true, children: [
|
|
40107
40359
|
" \xB7 ",
|
|
40108
40360
|
bumpType,
|
|
40109
40361
|
dryRun ? " (dry-run)" : ""
|
|
@@ -40243,12 +40495,12 @@ Compile a concise but rigorous review report:
|
|
|
40243
40495
|
Start the review now.`;
|
|
40244
40496
|
await agentRef.current?.processTurn({
|
|
40245
40497
|
content: reviewPrompt
|
|
40246
|
-
});
|
|
40498
|
+
}, void 0, { historyName: "ui_internal_prompt" });
|
|
40247
40499
|
} catch (e) {
|
|
40248
40500
|
setHistory((prev) => prev.concat({
|
|
40249
40501
|
id: Date.now(),
|
|
40250
40502
|
component: outBox(
|
|
40251
|
-
/* @__PURE__ */
|
|
40503
|
+
/* @__PURE__ */ jsx97(Box_default, { children: /* @__PURE__ */ jsxs80(Text, { color: "red", children: [
|
|
40252
40504
|
"Failed to execute /review: ",
|
|
40253
40505
|
e?.message || String(e)
|
|
40254
40506
|
] }) })
|
|
@@ -40267,12 +40519,12 @@ Start the review now.`;
|
|
|
40267
40519
|
try {
|
|
40268
40520
|
await agentRef.current?.processTurn({
|
|
40269
40521
|
content: `Inspect the current conversation context. Use the ctx_inspect tool with mode="${ctxMode}" and lastN=${lastN}. Report the findings clearly.`
|
|
40270
|
-
});
|
|
40522
|
+
}, void 0, { historyName: "ui_internal_prompt" });
|
|
40271
40523
|
} catch (e) {
|
|
40272
40524
|
setHistory((prev) => prev.concat({
|
|
40273
40525
|
id: Date.now(),
|
|
40274
40526
|
component: outBox(
|
|
40275
|
-
/* @__PURE__ */
|
|
40527
|
+
/* @__PURE__ */ jsx97(Box_default, { children: /* @__PURE__ */ jsxs80(Text, { color: "red", children: [
|
|
40276
40528
|
"Failed to execute /ctx: ",
|
|
40277
40529
|
e?.message || String(e)
|
|
40278
40530
|
] }) })
|
|
@@ -40291,12 +40543,12 @@ Start the review now.`;
|
|
|
40291
40543
|
try {
|
|
40292
40544
|
await agentRef.current?.processTurn({
|
|
40293
40545
|
content: `Use the snip tool with action="${snipAction}" and keepRecent=${keepRecent} to manage conversation history. Report what was done.`
|
|
40294
|
-
});
|
|
40546
|
+
}, void 0, { historyName: "ui_internal_prompt" });
|
|
40295
40547
|
} catch (e) {
|
|
40296
40548
|
setHistory((prev) => prev.concat({
|
|
40297
40549
|
id: Date.now(),
|
|
40298
40550
|
component: outBox(
|
|
40299
|
-
/* @__PURE__ */
|
|
40551
|
+
/* @__PURE__ */ jsx97(Box_default, { children: /* @__PURE__ */ jsxs80(Text, { color: "red", children: [
|
|
40300
40552
|
"Failed to execute /snip: ",
|
|
40301
40553
|
e?.message || String(e)
|
|
40302
40554
|
] }) })
|
|
@@ -40311,12 +40563,12 @@ Start the review now.`;
|
|
|
40311
40563
|
try {
|
|
40312
40564
|
await agentRef.current?.processTurn({
|
|
40313
40565
|
content: `Run the dream tool to consolidate coding memory. Deduplicate, merge similar entries, prune stale entries, and enrich with metadata. Report the results: entries before/after, merged, pruned, enriched.`
|
|
40314
|
-
});
|
|
40566
|
+
}, void 0, { historyName: "ui_internal_prompt" });
|
|
40315
40567
|
} catch (e) {
|
|
40316
40568
|
setHistory((prev) => prev.concat({
|
|
40317
40569
|
id: Date.now(),
|
|
40318
40570
|
component: outBox(
|
|
40319
|
-
/* @__PURE__ */
|
|
40571
|
+
/* @__PURE__ */ jsx97(Box_default, { children: /* @__PURE__ */ jsxs80(Text, { color: "red", children: [
|
|
40320
40572
|
"Failed to execute /dream: ",
|
|
40321
40573
|
e?.message || String(e)
|
|
40322
40574
|
] }) })
|
|
@@ -40334,12 +40586,12 @@ Start the review now.`;
|
|
|
40334
40586
|
try {
|
|
40335
40587
|
await agentRef.current?.processTurn({
|
|
40336
40588
|
content: `Use the context_collapse tool with strategy="${collapseStrategy}" to compact the conversation history. Report tokens saved and messages before/after.`
|
|
40337
|
-
});
|
|
40589
|
+
}, void 0, { historyName: "ui_internal_prompt" });
|
|
40338
40590
|
} catch (e) {
|
|
40339
40591
|
setHistory((prev) => prev.concat({
|
|
40340
40592
|
id: Date.now(),
|
|
40341
40593
|
component: outBox(
|
|
40342
|
-
/* @__PURE__ */
|
|
40594
|
+
/* @__PURE__ */ jsx97(Box_default, { children: /* @__PURE__ */ jsxs80(Text, { color: "red", children: [
|
|
40343
40595
|
"Failed to execute /collapse: ",
|
|
40344
40596
|
e?.message || String(e)
|
|
40345
40597
|
] }) })
|
|
@@ -40353,12 +40605,12 @@ Start the review now.`;
|
|
|
40353
40605
|
const messageText = args?.join(" ") || "";
|
|
40354
40606
|
if (!messageText) {
|
|
40355
40607
|
return outBox(
|
|
40356
|
-
/* @__PURE__ */
|
|
40357
|
-
/* @__PURE__ */
|
|
40358
|
-
/* @__PURE__ */
|
|
40359
|
-
/* @__PURE__ */
|
|
40360
|
-
/* @__PURE__ */
|
|
40361
|
-
/* @__PURE__ */
|
|
40608
|
+
/* @__PURE__ */ jsxs80(Fragment19, { children: [
|
|
40609
|
+
/* @__PURE__ */ jsx97(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "/brief" }),
|
|
40610
|
+
/* @__PURE__ */ jsx97(Text, { dimColor: true, children: "Send a structured message to the user." }),
|
|
40611
|
+
/* @__PURE__ */ jsx97(Text, { dimColor: true, children: "Usage: /brief <message> [--proactive] [--attach file1 file2]" }),
|
|
40612
|
+
/* @__PURE__ */ jsx97(Text, { dimColor: true, children: " --proactive Mark as proactive notification" }),
|
|
40613
|
+
/* @__PURE__ */ jsx97(Text, { dimColor: true, children: " --attach <f> Attach files to the message" })
|
|
40362
40614
|
] })
|
|
40363
40615
|
);
|
|
40364
40616
|
}
|
|
@@ -40376,12 +40628,12 @@ Start the review now.`;
|
|
|
40376
40628
|
const cleanMessage = messageText.replace(/--proactive/g, "").replace(/--attach\s+\S+/g, "").trim();
|
|
40377
40629
|
await agentRef.current?.processTurn({
|
|
40378
40630
|
content: `Use the brief tool to send this message to the user: "${cleanMessage}" with status="${isProactive ? "proactive" : "normal"}"${attachments.length > 0 ? ` and attachments: ${attachments.join(", ")}` : ""}.`
|
|
40379
|
-
});
|
|
40631
|
+
}, void 0, { historyName: "ui_internal_prompt" });
|
|
40380
40632
|
} catch (e) {
|
|
40381
40633
|
setHistory((prev) => prev.concat({
|
|
40382
40634
|
id: Date.now(),
|
|
40383
40635
|
component: outBox(
|
|
40384
|
-
/* @__PURE__ */
|
|
40636
|
+
/* @__PURE__ */ jsx97(Box_default, { children: /* @__PURE__ */ jsxs80(Text, { color: "red", children: [
|
|
40385
40637
|
"Failed to execute /brief: ",
|
|
40386
40638
|
e?.message || String(e)
|
|
40387
40639
|
] }) })
|
|
@@ -40396,12 +40648,12 @@ Start the review now.`;
|
|
|
40396
40648
|
try {
|
|
40397
40649
|
await agentRef.current?.processTurn({
|
|
40398
40650
|
content: `Undo the last action. Run \`git diff HEAD\` to see recent changes, then \`git checkout -- <files>\` to revert uncommitted changes, or \`git revert HEAD\` to undo the last commit. Report what was undone.`
|
|
40399
|
-
});
|
|
40651
|
+
}, void 0, { historyName: "ui_internal_prompt" });
|
|
40400
40652
|
} catch (e) {
|
|
40401
40653
|
setHistory((prev) => prev.concat({
|
|
40402
40654
|
id: Date.now(),
|
|
40403
40655
|
component: outBox(
|
|
40404
|
-
/* @__PURE__ */
|
|
40656
|
+
/* @__PURE__ */ jsx97(Box_default, { children: /* @__PURE__ */ jsxs80(Text, { color: "red", children: [
|
|
40405
40657
|
"Failed to execute /undo: ",
|
|
40406
40658
|
e?.message || String(e)
|
|
40407
40659
|
] }) })
|
|
@@ -40416,12 +40668,12 @@ Start the review now.`;
|
|
|
40416
40668
|
try {
|
|
40417
40669
|
await agentRef.current?.processTurn({
|
|
40418
40670
|
content: `Redo the last undone action. Check \`git reflog\` for recent operations and restore the most recent undone change. Report what was redone.`
|
|
40419
|
-
});
|
|
40671
|
+
}, void 0, { historyName: "ui_internal_prompt" });
|
|
40420
40672
|
} catch (e) {
|
|
40421
40673
|
setHistory((prev) => prev.concat({
|
|
40422
40674
|
id: Date.now(),
|
|
40423
40675
|
component: outBox(
|
|
40424
|
-
/* @__PURE__ */
|
|
40676
|
+
/* @__PURE__ */ jsx97(Box_default, { children: /* @__PURE__ */ jsxs80(Text, { color: "red", children: [
|
|
40425
40677
|
"Failed to execute /redo: ",
|
|
40426
40678
|
e?.message || String(e)
|
|
40427
40679
|
] }) })
|
|
@@ -40436,12 +40688,12 @@ Start the review now.`;
|
|
|
40436
40688
|
try {
|
|
40437
40689
|
await agentRef.current?.processTurn({
|
|
40438
40690
|
content: `Show the current diff. Run \`git diff HEAD\` for unstaged changes, \`git diff --cached HEAD\` for staged changes, and \`git diff --stat HEAD\` for a summary. Present the diff clearly.`
|
|
40439
|
-
});
|
|
40691
|
+
}, void 0, { historyName: "ui_internal_prompt" });
|
|
40440
40692
|
} catch (e) {
|
|
40441
40693
|
setHistory((prev) => prev.concat({
|
|
40442
40694
|
id: Date.now(),
|
|
40443
40695
|
component: outBox(
|
|
40444
|
-
/* @__PURE__ */
|
|
40696
|
+
/* @__PURE__ */ jsx97(Box_default, { children: /* @__PURE__ */ jsxs80(Text, { color: "red", children: [
|
|
40445
40697
|
"Failed to execute /diff: ",
|
|
40446
40698
|
e?.message || String(e)
|
|
40447
40699
|
] }) })
|
|
@@ -40455,10 +40707,10 @@ Start the review now.`;
|
|
|
40455
40707
|
const target = args.join(" ") || "";
|
|
40456
40708
|
if (!target) {
|
|
40457
40709
|
return outBox(
|
|
40458
|
-
/* @__PURE__ */
|
|
40459
|
-
/* @__PURE__ */
|
|
40460
|
-
/* @__PURE__ */
|
|
40461
|
-
/* @__PURE__ */
|
|
40710
|
+
/* @__PURE__ */ jsxs80(Fragment19, { children: [
|
|
40711
|
+
/* @__PURE__ */ jsx97(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "/explain" }),
|
|
40712
|
+
/* @__PURE__ */ jsx97(Text, { dimColor: true, children: "Explain a file, function, or code snippet." }),
|
|
40713
|
+
/* @__PURE__ */ jsx97(Text, { dimColor: true, children: "Usage: /explain <file> [line-range or function-name]" })
|
|
40462
40714
|
] })
|
|
40463
40715
|
);
|
|
40464
40716
|
}
|
|
@@ -40466,12 +40718,12 @@ Start the review now.`;
|
|
|
40466
40718
|
try {
|
|
40467
40719
|
await agentRef.current?.processTurn({
|
|
40468
40720
|
content: `Explain the following code in detail: ${target}. Read the file, understand the structure, and provide a clear explanation of what it does, how it works, and any notable patterns or concerns.`
|
|
40469
|
-
});
|
|
40721
|
+
}, void 0, { historyName: "ui_internal_prompt" });
|
|
40470
40722
|
} catch (e) {
|
|
40471
40723
|
setHistory((prev) => prev.concat({
|
|
40472
40724
|
id: Date.now(),
|
|
40473
40725
|
component: outBox(
|
|
40474
|
-
/* @__PURE__ */
|
|
40726
|
+
/* @__PURE__ */ jsx97(Box_default, { children: /* @__PURE__ */ jsxs80(Text, { color: "red", children: [
|
|
40475
40727
|
"Failed to execute /explain: ",
|
|
40476
40728
|
e?.message || String(e)
|
|
40477
40729
|
] }) })
|
|
@@ -40487,12 +40739,12 @@ Start the review now.`;
|
|
|
40487
40739
|
try {
|
|
40488
40740
|
await agentRef.current?.processTurn({
|
|
40489
40741
|
content: `Fix errors and issues${target ? ` in: ${target}` : " in the current project"}. Run lint checks, identify issues, and fix them. Run tests after fixing to verify. Report all changes made.`
|
|
40490
|
-
});
|
|
40742
|
+
}, void 0, { historyName: "ui_internal_prompt" });
|
|
40491
40743
|
} catch (e) {
|
|
40492
40744
|
setHistory((prev) => prev.concat({
|
|
40493
40745
|
id: Date.now(),
|
|
40494
40746
|
component: outBox(
|
|
40495
|
-
/* @__PURE__ */
|
|
40747
|
+
/* @__PURE__ */ jsx97(Box_default, { children: /* @__PURE__ */ jsxs80(Text, { color: "red", children: [
|
|
40496
40748
|
"Failed to execute /fix: ",
|
|
40497
40749
|
e?.message || String(e)
|
|
40498
40750
|
] }) })
|
|
@@ -40506,10 +40758,10 @@ Start the review now.`;
|
|
|
40506
40758
|
const filePath = args.join(" ") || "";
|
|
40507
40759
|
if (!filePath) {
|
|
40508
40760
|
return outBox(
|
|
40509
|
-
/* @__PURE__ */
|
|
40510
|
-
/* @__PURE__ */
|
|
40511
|
-
/* @__PURE__ */
|
|
40512
|
-
/* @__PURE__ */
|
|
40761
|
+
/* @__PURE__ */ jsxs80(Fragment19, { children: [
|
|
40762
|
+
/* @__PURE__ */ jsx97(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "/editor" }),
|
|
40763
|
+
/* @__PURE__ */ jsx97(Text, { dimColor: true, children: "Open a file in the external editor ($EDITOR or configured editor)." }),
|
|
40764
|
+
/* @__PURE__ */ jsx97(Text, { dimColor: true, children: "Usage: /editor <file-path>" })
|
|
40513
40765
|
] })
|
|
40514
40766
|
);
|
|
40515
40767
|
}
|
|
@@ -40517,12 +40769,12 @@ Start the review now.`;
|
|
|
40517
40769
|
try {
|
|
40518
40770
|
await agentRef.current?.processTurn({
|
|
40519
40771
|
content: `Open the file "${filePath}" in the external editor. Check the $EDITOR environment variable or use the default editor. Report which editor was used and the file opened.`
|
|
40520
|
-
});
|
|
40772
|
+
}, void 0, { historyName: "ui_internal_prompt" });
|
|
40521
40773
|
} catch (e) {
|
|
40522
40774
|
setHistory((prev) => prev.concat({
|
|
40523
40775
|
id: Date.now(),
|
|
40524
40776
|
component: outBox(
|
|
40525
|
-
/* @__PURE__ */
|
|
40777
|
+
/* @__PURE__ */ jsx97(Box_default, { children: /* @__PURE__ */ jsxs80(Text, { color: "red", children: [
|
|
40526
40778
|
"Failed to execute /editor: ",
|
|
40527
40779
|
e?.message || String(e)
|
|
40528
40780
|
] }) })
|
|
@@ -40556,17 +40808,17 @@ Start the review now.`;
|
|
|
40556
40808
|
const description = args.join(" ") || "";
|
|
40557
40809
|
if (!description) {
|
|
40558
40810
|
return outBox(
|
|
40559
|
-
/* @__PURE__ */
|
|
40560
|
-
/* @__PURE__ */
|
|
40561
|
-
/* @__PURE__ */
|
|
40562
|
-
/* @__PURE__ */
|
|
40563
|
-
/* @__PURE__ */
|
|
40564
|
-
/* @__PURE__ */
|
|
40565
|
-
/* @__PURE__ */
|
|
40566
|
-
/* @__PURE__ */
|
|
40567
|
-
/* @__PURE__ */
|
|
40568
|
-
/* @__PURE__ */
|
|
40569
|
-
/* @__PURE__ */
|
|
40811
|
+
/* @__PURE__ */ jsxs80(Fragment19, { children: [
|
|
40812
|
+
/* @__PURE__ */ jsx97(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "/debug" }),
|
|
40813
|
+
/* @__PURE__ */ jsx97(Text, { dimColor: true, children: "Debug Coordinator mode \u2014 spawn workers to investigate, fix & verify in parallel." }),
|
|
40814
|
+
/* @__PURE__ */ jsx97(Text, { dimColor: true, children: "Usage: /debug <describe the problem, symptom, or error>" }),
|
|
40815
|
+
/* @__PURE__ */ jsx97(Text, { dimColor: true, children: " " }),
|
|
40816
|
+
/* @__PURE__ */ jsx97(Text, { dimColor: true, children: "The agent will:" }),
|
|
40817
|
+
/* @__PURE__ */ jsx97(Text, { dimColor: true, children: " \u2022 Act as Debug Coordinator \u2014 orchestrate a team of workers" }),
|
|
40818
|
+
/* @__PURE__ */ jsx97(Text, { dimColor: true, children: " \u2022 Spawn parallel researchers to investigate different hypotheses" }),
|
|
40819
|
+
/* @__PURE__ */ jsx97(Text, { dimColor: true, children: " \u2022 Synthesize findings and direct the fix" }),
|
|
40820
|
+
/* @__PURE__ */ jsx97(Text, { dimColor: true, children: " \u2022 Spawn a fix worker + verification worker" }),
|
|
40821
|
+
/* @__PURE__ */ jsx97(Text, { dimColor: true, children: " \u2022 Not stop until root cause is found, fixed, and proven" })
|
|
40570
40822
|
] })
|
|
40571
40823
|
);
|
|
40572
40824
|
}
|
|
@@ -40718,12 +40970,12 @@ When all workers complete, synthesize the full debug session:
|
|
|
40718
40970
|
- **Clean up** \u2014 ensure all temporary debug logs are removed
|
|
40719
40971
|
|
|
40720
40972
|
Start coordinating now. Triage the problem, then spawn your research workers.`
|
|
40721
|
-
});
|
|
40973
|
+
}, void 0, { historyName: "ui_internal_prompt" });
|
|
40722
40974
|
} catch (e) {
|
|
40723
40975
|
setHistory((prev) => prev.concat({
|
|
40724
40976
|
id: Date.now(),
|
|
40725
40977
|
component: outBox(
|
|
40726
|
-
/* @__PURE__ */
|
|
40978
|
+
/* @__PURE__ */ jsx97(Box_default, { children: /* @__PURE__ */ jsxs80(Text, { color: "red", children: [
|
|
40727
40979
|
"Failed to execute /debug: ",
|
|
40728
40980
|
e?.message || String(e)
|
|
40729
40981
|
] }) })
|
|
@@ -40737,10 +40989,10 @@ Start coordinating now. Triage the problem, then spawn your research workers.`
|
|
|
40737
40989
|
const description = args.join(" ") || "";
|
|
40738
40990
|
if (!description) {
|
|
40739
40991
|
return outBox(
|
|
40740
|
-
/* @__PURE__ */
|
|
40741
|
-
/* @__PURE__ */
|
|
40742
|
-
/* @__PURE__ */
|
|
40743
|
-
/* @__PURE__ */
|
|
40992
|
+
/* @__PURE__ */ jsxs80(Fragment19, { children: [
|
|
40993
|
+
/* @__PURE__ */ jsx97(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "/bug" }),
|
|
40994
|
+
/* @__PURE__ */ jsx97(Text, { dimColor: true, children: "Alias for /debug \u2014 Debug Coordinator mode." }),
|
|
40995
|
+
/* @__PURE__ */ jsx97(Text, { dimColor: true, children: "Usage: /bug <describe the problem> (or use /debug)" })
|
|
40744
40996
|
] })
|
|
40745
40997
|
);
|
|
40746
40998
|
}
|
|
@@ -40892,12 +41144,12 @@ When all workers complete, synthesize the full debug session:
|
|
|
40892
41144
|
- **Clean up** \u2014 ensure all temporary debug logs are removed
|
|
40893
41145
|
|
|
40894
41146
|
Start coordinating now. Triage the problem, then spawn your research workers.`
|
|
40895
|
-
});
|
|
41147
|
+
}, void 0, { historyName: "ui_internal_prompt" });
|
|
40896
41148
|
} catch (e) {
|
|
40897
41149
|
setHistory((prev) => prev.concat({
|
|
40898
41150
|
id: Date.now(),
|
|
40899
41151
|
component: outBox(
|
|
40900
|
-
/* @__PURE__ */
|
|
41152
|
+
/* @__PURE__ */ jsx97(Box_default, { children: /* @__PURE__ */ jsxs80(Text, { color: "red", children: [
|
|
40901
41153
|
"Failed to execute /bug: ",
|
|
40902
41154
|
e?.message || String(e)
|
|
40903
41155
|
] }) })
|
|
@@ -40918,12 +41170,12 @@ Start coordinating now. Triage the problem, then spawn your research workers.`
|
|
|
40918
41170
|
2. Run the appropriate test command (npm test, npx jest, npx vitest, etc.)
|
|
40919
41171
|
3. Report results: passed, failed, skipped
|
|
40920
41172
|
4. If any tests failed, show the failure details and suggest fixes.`
|
|
40921
|
-
});
|
|
41173
|
+
}, void 0, { historyName: "ui_internal_prompt" });
|
|
40922
41174
|
} catch (e) {
|
|
40923
41175
|
setHistory((prev) => prev.concat({
|
|
40924
41176
|
id: Date.now(),
|
|
40925
41177
|
component: outBox(
|
|
40926
|
-
/* @__PURE__ */
|
|
41178
|
+
/* @__PURE__ */ jsx97(Box_default, { children: /* @__PURE__ */ jsxs80(Text, { color: "red", children: [
|
|
40927
41179
|
"Failed to execute /test: ",
|
|
40928
41180
|
e?.message || String(e)
|
|
40929
41181
|
] }) })
|
|
@@ -40947,12 +41199,12 @@ Focus on:
|
|
|
40947
41199
|
- Memory usage
|
|
40948
41200
|
|
|
40949
41201
|
Read the relevant files, identify optimization opportunities, and suggest specific improvements with before/after examples.`
|
|
40950
|
-
});
|
|
41202
|
+
}, void 0, { historyName: "ui_internal_prompt" });
|
|
40951
41203
|
} catch (e) {
|
|
40952
41204
|
setHistory((prev) => prev.concat({
|
|
40953
41205
|
id: Date.now(),
|
|
40954
41206
|
component: outBox(
|
|
40955
|
-
/* @__PURE__ */
|
|
41207
|
+
/* @__PURE__ */ jsx97(Box_default, { children: /* @__PURE__ */ jsxs80(Text, { color: "red", children: [
|
|
40956
41208
|
"Failed to execute /optimize: ",
|
|
40957
41209
|
e?.message || String(e)
|
|
40958
41210
|
] }) })
|
|
@@ -40966,10 +41218,10 @@ Read the relevant files, identify optimization opportunities, and suggest specif
|
|
|
40966
41218
|
const target = args.join(" ") || "";
|
|
40967
41219
|
if (!target) {
|
|
40968
41220
|
return outBox(
|
|
40969
|
-
/* @__PURE__ */
|
|
40970
|
-
/* @__PURE__ */
|
|
40971
|
-
/* @__PURE__ */
|
|
40972
|
-
/* @__PURE__ */
|
|
41221
|
+
/* @__PURE__ */ jsxs80(Fragment19, { children: [
|
|
41222
|
+
/* @__PURE__ */ jsx97(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "/refactor" }),
|
|
41223
|
+
/* @__PURE__ */ jsx97(Text, { dimColor: true, children: "Refactor code to improve structure without changing behavior." }),
|
|
41224
|
+
/* @__PURE__ */ jsx97(Text, { dimColor: true, children: "Usage: /refactor <file or description of refactoring>" })
|
|
40973
41225
|
] })
|
|
40974
41226
|
);
|
|
40975
41227
|
}
|
|
@@ -40983,12 +41235,12 @@ Read the relevant files, identify optimization opportunities, and suggest specif
|
|
|
40983
41235
|
3. Apply refactoring while preserving behavior
|
|
40984
41236
|
4. Run tests to verify nothing broke
|
|
40985
41237
|
5. Report what was changed and why`
|
|
40986
|
-
});
|
|
41238
|
+
}, void 0, { historyName: "ui_internal_prompt" });
|
|
40987
41239
|
} catch (e) {
|
|
40988
41240
|
setHistory((prev) => prev.concat({
|
|
40989
41241
|
id: Date.now(),
|
|
40990
41242
|
component: outBox(
|
|
40991
|
-
/* @__PURE__ */
|
|
41243
|
+
/* @__PURE__ */ jsx97(Box_default, { children: /* @__PURE__ */ jsxs80(Text, { color: "red", children: [
|
|
40992
41244
|
"Failed to execute /refactor: ",
|
|
40993
41245
|
e?.message || String(e)
|
|
40994
41246
|
] }) })
|
|
@@ -41002,10 +41254,10 @@ Read the relevant files, identify optimization opportunities, and suggest specif
|
|
|
41002
41254
|
const target = args.join(" ") || "";
|
|
41003
41255
|
if (!target) {
|
|
41004
41256
|
return outBox(
|
|
41005
|
-
/* @__PURE__ */
|
|
41006
|
-
/* @__PURE__ */
|
|
41007
|
-
/* @__PURE__ */
|
|
41008
|
-
/* @__PURE__ */
|
|
41257
|
+
/* @__PURE__ */ jsxs80(Fragment19, { children: [
|
|
41258
|
+
/* @__PURE__ */ jsx97(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "/document" }),
|
|
41259
|
+
/* @__PURE__ */ jsx97(Text, { dimColor: true, children: "Generate documentation for a file, module, or function." }),
|
|
41260
|
+
/* @__PURE__ */ jsx97(Text, { dimColor: true, children: "Usage: /document <file or module> [--format jsdoc|markdown|readme]" })
|
|
41009
41261
|
] })
|
|
41010
41262
|
);
|
|
41011
41263
|
}
|
|
@@ -41019,12 +41271,12 @@ Read the relevant files, identify optimization opportunities, and suggest specif
|
|
|
41019
41271
|
3. Include: purpose, parameters, return values, examples, and edge cases
|
|
41020
41272
|
4. Write the documentation to the appropriate location
|
|
41021
41273
|
5. Report what was documented`
|
|
41022
|
-
});
|
|
41274
|
+
}, void 0, { historyName: "ui_internal_prompt" });
|
|
41023
41275
|
} catch (e) {
|
|
41024
41276
|
setHistory((prev) => prev.concat({
|
|
41025
41277
|
id: Date.now(),
|
|
41026
41278
|
component: outBox(
|
|
41027
|
-
/* @__PURE__ */
|
|
41279
|
+
/* @__PURE__ */ jsx97(Box_default, { children: /* @__PURE__ */ jsxs80(Text, { color: "red", children: [
|
|
41028
41280
|
"Failed to execute /document: ",
|
|
41029
41281
|
e?.message || String(e)
|
|
41030
41282
|
] }) })
|
|
@@ -41045,12 +41297,12 @@ Read the relevant files, identify optimization opportunities, and suggest specif
|
|
|
41045
41297
|
- Files that were modified
|
|
41046
41298
|
- Current state of the work
|
|
41047
41299
|
- Next steps or pending tasks`
|
|
41048
|
-
});
|
|
41300
|
+
}, void 0, { historyName: "ui_internal_prompt" });
|
|
41049
41301
|
} catch (e) {
|
|
41050
41302
|
setHistory((prev) => prev.concat({
|
|
41051
41303
|
id: Date.now(),
|
|
41052
41304
|
component: outBox(
|
|
41053
|
-
/* @__PURE__ */
|
|
41305
|
+
/* @__PURE__ */ jsx97(Box_default, { children: /* @__PURE__ */ jsxs80(Text, { color: "red", children: [
|
|
41054
41306
|
"Failed to execute /summarize: ",
|
|
41055
41307
|
e?.message || String(e)
|
|
41056
41308
|
] }) })
|
|
@@ -41073,10 +41325,10 @@ Read the relevant files, identify optimization opportunities, and suggest specif
|
|
|
41073
41325
|
const filePath = args.join(" ") || "";
|
|
41074
41326
|
if (!filePath) {
|
|
41075
41327
|
return outBox(
|
|
41076
|
-
/* @__PURE__ */
|
|
41077
|
-
/* @__PURE__ */
|
|
41078
|
-
/* @__PURE__ */
|
|
41079
|
-
/* @__PURE__ */
|
|
41328
|
+
/* @__PURE__ */ jsxs80(Fragment19, { children: [
|
|
41329
|
+
/* @__PURE__ */ jsx97(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "/file" }),
|
|
41330
|
+
/* @__PURE__ */ jsx97(Text, { dimColor: true, children: "Create, open, or navigate to a file." }),
|
|
41331
|
+
/* @__PURE__ */ jsx97(Text, { dimColor: true, children: "Usage: /file <path>" })
|
|
41080
41332
|
] })
|
|
41081
41333
|
);
|
|
41082
41334
|
}
|
|
@@ -41089,12 +41341,12 @@ Read the relevant files, identify optimization opportunities, and suggest specif
|
|
|
41089
41341
|
2. If it exists, read and display its contents
|
|
41090
41342
|
3. If it doesn't exist, ask the user if they want to create it
|
|
41091
41343
|
4. Show the file path, size, and last modified date`
|
|
41092
|
-
});
|
|
41344
|
+
}, void 0, { historyName: "ui_internal_prompt" });
|
|
41093
41345
|
} catch (e) {
|
|
41094
41346
|
setHistory((prev) => prev.concat({
|
|
41095
41347
|
id: Date.now(),
|
|
41096
41348
|
component: outBox(
|
|
41097
|
-
/* @__PURE__ */
|
|
41349
|
+
/* @__PURE__ */ jsx97(Box_default, { children: /* @__PURE__ */ jsxs80(Text, { color: "red", children: [
|
|
41098
41350
|
"Failed to execute /file: ",
|
|
41099
41351
|
e?.message || String(e)
|
|
41100
41352
|
] }) })
|
|
@@ -41108,10 +41360,10 @@ Read the relevant files, identify optimization opportunities, and suggest specif
|
|
|
41108
41360
|
const query = args.join(" ") || "";
|
|
41109
41361
|
if (!query) {
|
|
41110
41362
|
return outBox(
|
|
41111
|
-
/* @__PURE__ */
|
|
41112
|
-
/* @__PURE__ */
|
|
41113
|
-
/* @__PURE__ */
|
|
41114
|
-
/* @__PURE__ */
|
|
41363
|
+
/* @__PURE__ */ jsxs80(Fragment19, { children: [
|
|
41364
|
+
/* @__PURE__ */ jsx97(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "/search" }),
|
|
41365
|
+
/* @__PURE__ */ jsx97(Text, { dimColor: true, children: "Search the codebase for a pattern." }),
|
|
41366
|
+
/* @__PURE__ */ jsx97(Text, { dimColor: true, children: "Usage: /search <query> [--files <glob>]" })
|
|
41115
41367
|
] })
|
|
41116
41368
|
);
|
|
41117
41369
|
}
|
|
@@ -41124,12 +41376,12 @@ Read the relevant files, identify optimization opportunities, and suggest specif
|
|
|
41124
41376
|
2. Show matching files and lines with context
|
|
41125
41377
|
3. Summarize the results: how many files matched, which files had the most relevant matches
|
|
41126
41378
|
4. If too many results, suggest a more specific search`
|
|
41127
|
-
});
|
|
41379
|
+
}, void 0, { historyName: "ui_internal_prompt" });
|
|
41128
41380
|
} catch (e) {
|
|
41129
41381
|
setHistory((prev) => prev.concat({
|
|
41130
41382
|
id: Date.now(),
|
|
41131
41383
|
component: outBox(
|
|
41132
|
-
/* @__PURE__ */
|
|
41384
|
+
/* @__PURE__ */ jsx97(Box_default, { children: /* @__PURE__ */ jsxs80(Text, { color: "red", children: [
|
|
41133
41385
|
"Failed to execute /search: ",
|
|
41134
41386
|
e?.message || String(e)
|
|
41135
41387
|
] }) })
|
|
@@ -41173,11 +41425,11 @@ Read the relevant files, identify optimization opportunities, and suggest specif
|
|
|
41173
41425
|
const name = args[0] || "";
|
|
41174
41426
|
if (!name) {
|
|
41175
41427
|
return outBox(
|
|
41176
|
-
/* @__PURE__ */
|
|
41177
|
-
/* @__PURE__ */
|
|
41178
|
-
/* @__PURE__ */
|
|
41179
|
-
/* @__PURE__ */
|
|
41180
|
-
/* @__PURE__ */
|
|
41428
|
+
/* @__PURE__ */ jsxs80(Fragment19, { children: [
|
|
41429
|
+
/* @__PURE__ */ jsx97(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "Macros" }),
|
|
41430
|
+
/* @__PURE__ */ jsx97(Text, { dimColor: true, children: "No macros configured yet." }),
|
|
41431
|
+
/* @__PURE__ */ jsx97(Text, { dimColor: true, children: "Usage: /macro <name>" }),
|
|
41432
|
+
/* @__PURE__ */ jsx97(Text, { dimColor: true, children: 'Macros are defined in ~/.bluma/settings.json under "macros".' })
|
|
41181
41433
|
] })
|
|
41182
41434
|
);
|
|
41183
41435
|
}
|
|
@@ -41185,12 +41437,12 @@ Read the relevant files, identify optimization opportunities, and suggest specif
|
|
|
41185
41437
|
try {
|
|
41186
41438
|
await agentRef.current?.processTurn({
|
|
41187
41439
|
content: `Run the macro named "${name}". Look up the macro definition in settings and execute each command in sequence. Report the results of each step.`
|
|
41188
|
-
});
|
|
41440
|
+
}, void 0, { historyName: "ui_internal_prompt" });
|
|
41189
41441
|
} catch (e) {
|
|
41190
41442
|
setHistory((prev) => prev.concat({
|
|
41191
41443
|
id: Date.now(),
|
|
41192
41444
|
component: outBox(
|
|
41193
|
-
/* @__PURE__ */
|
|
41445
|
+
/* @__PURE__ */ jsx97(Box_default, { children: /* @__PURE__ */ jsxs80(Text, { color: "red", children: [
|
|
41194
41446
|
"Failed to execute /macro: ",
|
|
41195
41447
|
e?.message || String(e)
|
|
41196
41448
|
] }) })
|
|
@@ -41204,11 +41456,11 @@ Read the relevant files, identify optimization opportunities, and suggest specif
|
|
|
41204
41456
|
const name = args.join(" ") || "";
|
|
41205
41457
|
if (!name) {
|
|
41206
41458
|
return outBox(
|
|
41207
|
-
/* @__PURE__ */
|
|
41208
|
-
/* @__PURE__ */
|
|
41209
|
-
/* @__PURE__ */
|
|
41210
|
-
/* @__PURE__ */
|
|
41211
|
-
/* @__PURE__ */
|
|
41459
|
+
/* @__PURE__ */ jsxs80(Fragment19, { children: [
|
|
41460
|
+
/* @__PURE__ */ jsx97(Text, { bold: true, color: COMMAND_HEADER_COLOR, children: "Templates" }),
|
|
41461
|
+
/* @__PURE__ */ jsx97(Text, { dimColor: true, children: "Create a project from a template." }),
|
|
41462
|
+
/* @__PURE__ */ jsx97(Text, { dimColor: true, children: "Usage: /template <name>" }),
|
|
41463
|
+
/* @__PURE__ */ jsx97(Text, { dimColor: true, children: "Available templates: react, nextjs, node-api, cli, library" })
|
|
41212
41464
|
] })
|
|
41213
41465
|
);
|
|
41214
41466
|
}
|
|
@@ -41222,12 +41474,12 @@ Read the relevant files, identify optimization opportunities, and suggest specif
|
|
|
41222
41474
|
3. Install dependencies if needed
|
|
41223
41475
|
4. Set up basic configuration (tsconfig, eslint, prettier, etc.)
|
|
41224
41476
|
5. Report the project structure and next steps`
|
|
41225
|
-
});
|
|
41477
|
+
}, void 0, { historyName: "ui_internal_prompt" });
|
|
41226
41478
|
} catch (e) {
|
|
41227
41479
|
setHistory((prev) => prev.concat({
|
|
41228
41480
|
id: Date.now(),
|
|
41229
41481
|
component: outBox(
|
|
41230
|
-
/* @__PURE__ */
|
|
41482
|
+
/* @__PURE__ */ jsx97(Box_default, { children: /* @__PURE__ */ jsxs80(Text, { color: "red", children: [
|
|
41231
41483
|
"Failed to execute /template: ",
|
|
41232
41484
|
e?.message || String(e)
|
|
41233
41485
|
] }) })
|
|
@@ -41247,12 +41499,12 @@ Read the relevant files, identify optimization opportunities, and suggest specif
|
|
|
41247
41499
|
1. Export the conversation as ${format2}
|
|
41248
41500
|
2. Save to .bluma/artifacts/shared/session-export-${Date.now()}.${format2 === "html" ? "html" : "md"}
|
|
41249
41501
|
3. Show the user the file path so they can share it`
|
|
41250
|
-
});
|
|
41502
|
+
}, void 0, { historyName: "ui_internal_prompt" });
|
|
41251
41503
|
} catch (e) {
|
|
41252
41504
|
setHistory((prev) => prev.concat({
|
|
41253
41505
|
id: Date.now(),
|
|
41254
41506
|
component: outBox(
|
|
41255
|
-
/* @__PURE__ */
|
|
41507
|
+
/* @__PURE__ */ jsx97(Box_default, { children: /* @__PURE__ */ jsxs80(Text, { color: "red", children: [
|
|
41256
41508
|
"Failed to execute /share: ",
|
|
41257
41509
|
e?.message || String(e)
|
|
41258
41510
|
] }) })
|
|
@@ -41265,12 +41517,12 @@ Read the relevant files, identify optimization opportunities, and suggest specif
|
|
|
41265
41517
|
if (cmd === "copy") {
|
|
41266
41518
|
return renderCopy();
|
|
41267
41519
|
}
|
|
41268
|
-
return outBox(/* @__PURE__ */
|
|
41520
|
+
return outBox(/* @__PURE__ */ jsxs80(Text, { color: "red", children: [
|
|
41269
41521
|
"Command not recognized: /",
|
|
41270
41522
|
cmd
|
|
41271
41523
|
] }));
|
|
41272
41524
|
};
|
|
41273
|
-
return /* @__PURE__ */
|
|
41525
|
+
return /* @__PURE__ */ jsxs80(Fragment19, { children: [
|
|
41274
41526
|
render(),
|
|
41275
41527
|
renderedContent
|
|
41276
41528
|
] });
|
|
@@ -41374,7 +41626,7 @@ Run: npm i -g ${BLUMA_PACKAGE_NAME} to update.`;
|
|
|
41374
41626
|
init_sandbox_policy();
|
|
41375
41627
|
|
|
41376
41628
|
// src/app/ui/components/UpdateNotice.tsx
|
|
41377
|
-
import { jsx as
|
|
41629
|
+
import { jsx as jsx98, jsxs as jsxs81 } from "react/jsx-runtime";
|
|
41378
41630
|
function parseUpdateMessage(msg) {
|
|
41379
41631
|
const lines = msg.split(/\r?\n/).map((l) => l.trim());
|
|
41380
41632
|
const first = lines[0] || "";
|
|
@@ -41390,24 +41642,24 @@ function parseUpdateMessage(msg) {
|
|
|
41390
41642
|
}
|
|
41391
41643
|
var UpdateNotice = ({ message: message2 }) => {
|
|
41392
41644
|
const { name, current, latest: latest2, hint } = parseUpdateMessage(message2);
|
|
41393
|
-
return /* @__PURE__ */
|
|
41394
|
-
name && current && latest2 ? /* @__PURE__ */
|
|
41395
|
-
name && current && latest2 ? /* @__PURE__ */
|
|
41645
|
+
return /* @__PURE__ */ jsx98(ChatBlock, { marginBottom: 0, children: /* @__PURE__ */ jsx98(MessageResponse, { children: /* @__PURE__ */ jsxs81(Box_default, { flexDirection: "column", paddingLeft: 2, children: [
|
|
41646
|
+
name && current && latest2 ? /* @__PURE__ */ jsx98(Text, { color: BLUMA_TERMINAL.accent, bold: true, children: name }) : null,
|
|
41647
|
+
name && current && latest2 ? /* @__PURE__ */ jsxs81(Text, { dimColor: true, children: [
|
|
41396
41648
|
current,
|
|
41397
41649
|
" \u2192 ",
|
|
41398
41650
|
latest2
|
|
41399
|
-
] }) : /* @__PURE__ */
|
|
41400
|
-
hint ? /* @__PURE__ */
|
|
41651
|
+
] }) : /* @__PURE__ */ jsx98(Text, { dimColor: true, children: message2 }),
|
|
41652
|
+
hint ? /* @__PURE__ */ jsx98(Box_default, { marginTop: 1, children: /* @__PURE__ */ jsx98(Text, { dimColor: true, children: hint }) }) : null
|
|
41401
41653
|
] }) }) });
|
|
41402
41654
|
};
|
|
41403
41655
|
var UpdateNotice_default = UpdateNotice;
|
|
41404
41656
|
|
|
41405
41657
|
// src/app/ui/components/ErrorMessage.tsx
|
|
41406
|
-
import { jsx as
|
|
41407
|
-
var ErrorMessage = ({ message: message2, details, hint }) => /* @__PURE__ */
|
|
41408
|
-
/* @__PURE__ */
|
|
41409
|
-
details ? /* @__PURE__ */
|
|
41410
|
-
hint ? /* @__PURE__ */
|
|
41658
|
+
import { jsx as jsx99, jsxs as jsxs82 } from "react/jsx-runtime";
|
|
41659
|
+
var ErrorMessage = ({ message: message2, details, hint }) => /* @__PURE__ */ jsx99(ChatBlock, { marginBottom: 0, children: /* @__PURE__ */ jsx99(MessageResponse, { children: /* @__PURE__ */ jsxs82(Box_default, { flexDirection: "column", paddingLeft: 2, children: [
|
|
41660
|
+
/* @__PURE__ */ jsx99(Text, { color: BLUMA_TERMINAL.err, children: message2 }),
|
|
41661
|
+
details ? /* @__PURE__ */ jsx99(Box_default, { marginTop: 1, children: /* @__PURE__ */ jsx99(Text, { dimColor: true, children: details }) }) : null,
|
|
41662
|
+
hint ? /* @__PURE__ */ jsx99(Box_default, { marginTop: 1, children: /* @__PURE__ */ jsxs82(Text, { dimColor: true, children: [
|
|
41411
41663
|
"hint: ",
|
|
41412
41664
|
hint
|
|
41413
41665
|
] }) }) : null
|
|
@@ -41437,7 +41689,7 @@ function collapseRepeatedReasoningLines(text) {
|
|
|
41437
41689
|
}
|
|
41438
41690
|
|
|
41439
41691
|
// src/app/ui/components/ReasoningDisplay.tsx
|
|
41440
|
-
import { jsx as
|
|
41692
|
+
import { jsx as jsx100 } from "react/jsx-runtime";
|
|
41441
41693
|
var ReasoningDisplayComponent = ({
|
|
41442
41694
|
reasoning,
|
|
41443
41695
|
collapsed = false
|
|
@@ -41446,13 +41698,13 @@ var ReasoningDisplayComponent = ({
|
|
|
41446
41698
|
if (!normalized) {
|
|
41447
41699
|
return null;
|
|
41448
41700
|
}
|
|
41449
|
-
return /* @__PURE__ */
|
|
41701
|
+
return /* @__PURE__ */ jsx100(MessageResponse2, { children: /* @__PURE__ */ jsx100(Box_default, { flexDirection: "row", alignItems: "flex-start", width: "100%", marginBottom: 1, children: /* @__PURE__ */ jsx100(Box_default, { flexDirection: "column", flexGrow: 1, children: /* @__PURE__ */ jsx100(Text, { color: BLUMA_TERMINAL.dim, children: normalized }) }) }) });
|
|
41450
41702
|
};
|
|
41451
41703
|
var ReasoningDisplay = memo21(ReasoningDisplayComponent);
|
|
41452
41704
|
|
|
41453
41705
|
// src/app/ui/components/ExpandedPreviewBlock.tsx
|
|
41454
41706
|
import { memo as memo22 } from "react";
|
|
41455
|
-
import { jsx as
|
|
41707
|
+
import { jsx as jsx101, jsxs as jsxs83 } from "react/jsx-runtime";
|
|
41456
41708
|
function ExpandedPreviewBlockComponent({ data }) {
|
|
41457
41709
|
const cols = typeof process.stdout?.columns === "number" ? process.stdout.columns : 80;
|
|
41458
41710
|
const rule = TERMINAL_RULE_CHAR.repeat(Math.max(8, cols));
|
|
@@ -41460,28 +41712,28 @@ function ExpandedPreviewBlockComponent({ data }) {
|
|
|
41460
41712
|
const cap = EXPAND_OVERLAY_MAX_LINES;
|
|
41461
41713
|
const shown = lines.slice(0, cap);
|
|
41462
41714
|
const rest = lines.length - cap;
|
|
41463
|
-
return /* @__PURE__ */
|
|
41464
|
-
/* @__PURE__ */
|
|
41465
|
-
/* @__PURE__ */
|
|
41466
|
-
/* @__PURE__ */
|
|
41467
|
-
/* @__PURE__ */
|
|
41468
|
-
/* @__PURE__ */
|
|
41715
|
+
return /* @__PURE__ */ jsx101(ChatBlock, { marginBottom: 0, children: /* @__PURE__ */ jsxs83(MessageResponse, { children: [
|
|
41716
|
+
/* @__PURE__ */ jsx101(Text, { color: "white", children: rule }),
|
|
41717
|
+
/* @__PURE__ */ jsxs83(Box_default, { flexDirection: "column", paddingLeft: 1, children: [
|
|
41718
|
+
/* @__PURE__ */ jsx101(Text, { color: BLUMA_TERMINAL.accent, bold: true, children: "expand (Ctrl+O)" }),
|
|
41719
|
+
/* @__PURE__ */ jsx101(Text, { dimColor: true, children: data.title }),
|
|
41720
|
+
/* @__PURE__ */ jsxs83(Text, { dimColor: true, children: [
|
|
41469
41721
|
"+",
|
|
41470
41722
|
data.linesHidden,
|
|
41471
41723
|
" lines were clipped in chat \xB7 below: up to ",
|
|
41472
41724
|
cap,
|
|
41473
41725
|
" lines \xB7 use read_file_lines before edit_tool"
|
|
41474
41726
|
] }),
|
|
41475
|
-
/* @__PURE__ */
|
|
41476
|
-
shown.map((line, i) => /* @__PURE__ */
|
|
41477
|
-
rest > 0 ? /* @__PURE__ */
|
|
41727
|
+
/* @__PURE__ */ jsxs83(Box_default, { flexDirection: "column", marginTop: 1, children: [
|
|
41728
|
+
shown.map((line, i) => /* @__PURE__ */ jsx101(Text, { dimColor: true, children: line.slice(0, 200) }, i)),
|
|
41729
|
+
rest > 0 ? /* @__PURE__ */ jsxs83(Text, { dimColor: true, children: [
|
|
41478
41730
|
"\u2026 +",
|
|
41479
41731
|
rest,
|
|
41480
41732
|
" more lines in this chunk"
|
|
41481
41733
|
] }) : null
|
|
41482
41734
|
] })
|
|
41483
41735
|
] }),
|
|
41484
|
-
/* @__PURE__ */
|
|
41736
|
+
/* @__PURE__ */ jsx101(Text, { color: "white", children: rule })
|
|
41485
41737
|
] }) });
|
|
41486
41738
|
}
|
|
41487
41739
|
var ExpandedPreviewBlock = memo22(ExpandedPreviewBlockComponent);
|
|
@@ -42203,7 +42455,7 @@ function useAgentMode() {
|
|
|
42203
42455
|
|
|
42204
42456
|
// src/ink/components/ScrollBox.tsx
|
|
42205
42457
|
import { useImperativeHandle, useRef as useRef10, useState as useState23 } from "react";
|
|
42206
|
-
import { jsx as
|
|
42458
|
+
import { jsx as jsx102 } from "react/jsx-runtime";
|
|
42207
42459
|
function ScrollBox({
|
|
42208
42460
|
children,
|
|
42209
42461
|
ref,
|
|
@@ -42310,7 +42562,7 @@ function ScrollBox({
|
|
|
42310
42562
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
42311
42563
|
[]
|
|
42312
42564
|
);
|
|
42313
|
-
return /* @__PURE__ */
|
|
42565
|
+
return /* @__PURE__ */ jsx102("ink-box", { ref: (el) => {
|
|
42314
42566
|
domRef.current = el;
|
|
42315
42567
|
if (el) el.scrollTop ??= 0;
|
|
42316
42568
|
}, style: {
|
|
@@ -42323,12 +42575,12 @@ function ScrollBox({
|
|
|
42323
42575
|
overflowY: "scroll"
|
|
42324
42576
|
}, ...stickyScroll ? {
|
|
42325
42577
|
stickyScroll: true
|
|
42326
|
-
} : {}, children: /* @__PURE__ */
|
|
42578
|
+
} : {}, children: /* @__PURE__ */ jsx102(Box_default, { flexDirection: "column", flexGrow: 1, flexShrink: 0, width: "100%", children }) });
|
|
42327
42579
|
}
|
|
42328
42580
|
var ScrollBox_default = ScrollBox;
|
|
42329
42581
|
|
|
42330
42582
|
// src/app/ui/BlumaSession.tsx
|
|
42331
|
-
import { Fragment as Fragment20, jsx as
|
|
42583
|
+
import { Fragment as Fragment20, jsx as jsx103, jsxs as jsxs84 } from "react/jsx-runtime";
|
|
42332
42584
|
var blumaUpdateRegistryCheckStarted = false;
|
|
42333
42585
|
var BLOCKING_COMMANDS = /* @__PURE__ */ new Set(["init"]);
|
|
42334
42586
|
var COMMAND_HEADER_COLOR2 = BLUMA_TERMINAL.accent;
|
|
@@ -42371,25 +42623,25 @@ function UserMessageWithOptionalImages({
|
|
|
42371
42623
|
const cap = stripped2.trim();
|
|
42372
42624
|
const capDisp = cap.length > 800 ? `${cap.slice(0, 800)}\u2026` : cap;
|
|
42373
42625
|
const fallbackDisp = raw.length > 800 ? `${raw.slice(0, 800)}\u2026` : raw;
|
|
42374
|
-
return /* @__PURE__ */
|
|
42626
|
+
return /* @__PURE__ */ jsx103(ChatUserMessage, { children: pathStrs.length > 0 ? /* @__PURE__ */ jsx103(
|
|
42375
42627
|
ChatUserImageBlock,
|
|
42376
42628
|
{
|
|
42377
42629
|
imageCount: pathStrs.length,
|
|
42378
42630
|
caption: cap.length > 0 ? capDisp : null,
|
|
42379
42631
|
captionDim: true
|
|
42380
42632
|
}
|
|
42381
|
-
) : /* @__PURE__ */
|
|
42633
|
+
) : /* @__PURE__ */ jsx103(Text, { color: BLUMA_TERMINAL.m3OnSurface, wrap: "wrap", children: fallbackDisp }) });
|
|
42382
42634
|
}
|
|
42383
42635
|
const displayRaw = raw.length > 1e4 ? `${raw.substring(0, 1e4)}...` : raw;
|
|
42384
42636
|
const paths2 = collectImagePathStrings(displayRaw);
|
|
42385
42637
|
const stripped = paths2.length > 0 ? stripImagePathStrings(displayRaw, paths2) : displayRaw;
|
|
42386
|
-
return /* @__PURE__ */
|
|
42638
|
+
return /* @__PURE__ */ jsx103(ChatUserMessage, { children: paths2.length > 0 ? /* @__PURE__ */ jsx103(
|
|
42387
42639
|
ChatUserImageBlock,
|
|
42388
42640
|
{
|
|
42389
42641
|
imageCount: paths2.length,
|
|
42390
42642
|
caption: stripped.trim().length > 0 ? stripped : null
|
|
42391
42643
|
}
|
|
42392
|
-
) : /* @__PURE__ */
|
|
42644
|
+
) : /* @__PURE__ */ jsx103(Text, { color: BLUMA_TERMINAL.m3OnSurface, wrap: "wrap", children: displayRaw }) });
|
|
42393
42645
|
}
|
|
42394
42646
|
var BlumaSessionComponent = ({ eventBus, sessionId, cliVersion }) => {
|
|
42395
42647
|
const agentInstance = useRef11(null);
|
|
@@ -42471,7 +42723,7 @@ var BlumaSessionComponent = ({ eventBus, sessionId, cliVersion }) => {
|
|
|
42471
42723
|
...prev,
|
|
42472
42724
|
{
|
|
42473
42725
|
id,
|
|
42474
|
-
component: /* @__PURE__ */
|
|
42726
|
+
component: /* @__PURE__ */ jsx103(ChatMeta, { children: "Ctrl+O: no truncated preview to expand" }, id)
|
|
42475
42727
|
}
|
|
42476
42728
|
];
|
|
42477
42729
|
}
|
|
@@ -42479,7 +42731,7 @@ var BlumaSessionComponent = ({ eventBus, sessionId, cliVersion }) => {
|
|
|
42479
42731
|
...prev,
|
|
42480
42732
|
{
|
|
42481
42733
|
id,
|
|
42482
|
-
component: /* @__PURE__ */
|
|
42734
|
+
component: /* @__PURE__ */ jsx103(ExpandedPreviewBlock, { data: p }, id)
|
|
42483
42735
|
}
|
|
42484
42736
|
];
|
|
42485
42737
|
});
|
|
@@ -42501,7 +42753,7 @@ var BlumaSessionComponent = ({ eventBus, sessionId, cliVersion }) => {
|
|
|
42501
42753
|
...prev,
|
|
42502
42754
|
{
|
|
42503
42755
|
id: nextId2,
|
|
42504
|
-
component: /* @__PURE__ */
|
|
42756
|
+
component: /* @__PURE__ */ jsx103(UpdateNotice_default, { message: msg })
|
|
42505
42757
|
}
|
|
42506
42758
|
];
|
|
42507
42759
|
});
|
|
@@ -42519,7 +42771,7 @@ var BlumaSessionComponent = ({ eventBus, sessionId, cliVersion }) => {
|
|
|
42519
42771
|
...prev,
|
|
42520
42772
|
{
|
|
42521
42773
|
id,
|
|
42522
|
-
component: /* @__PURE__ */
|
|
42774
|
+
component: /* @__PURE__ */ jsx103(ChatMeta, { children: "cancelled (Esc)" })
|
|
42523
42775
|
}
|
|
42524
42776
|
];
|
|
42525
42777
|
});
|
|
@@ -42545,7 +42797,7 @@ var BlumaSessionComponent = ({ eventBus, sessionId, cliVersion }) => {
|
|
|
42545
42797
|
...prev,
|
|
42546
42798
|
{
|
|
42547
42799
|
id,
|
|
42548
|
-
component: /* @__PURE__ */
|
|
42800
|
+
component: /* @__PURE__ */ jsx103(ChatUserMessage, { children: /* @__PURE__ */ jsx103(Text, { color: BLUMA_TERMINAL.m3OnSurface, wrap: "wrap", children: text }) })
|
|
42549
42801
|
}
|
|
42550
42802
|
];
|
|
42551
42803
|
});
|
|
@@ -42561,7 +42813,7 @@ var BlumaSessionComponent = ({ eventBus, sessionId, cliVersion }) => {
|
|
|
42561
42813
|
...prev,
|
|
42562
42814
|
{
|
|
42563
42815
|
id,
|
|
42564
|
-
component: /* @__PURE__ */
|
|
42816
|
+
component: /* @__PURE__ */ jsxs84(ChatMeta, { children: [
|
|
42565
42817
|
"Failed to initialize: ",
|
|
42566
42818
|
error instanceof Error ? error.message : String(error)
|
|
42567
42819
|
] })
|
|
@@ -42579,7 +42831,7 @@ var BlumaSessionComponent = ({ eventBus, sessionId, cliVersion }) => {
|
|
|
42579
42831
|
...prev,
|
|
42580
42832
|
{
|
|
42581
42833
|
id,
|
|
42582
|
-
component: /* @__PURE__ */
|
|
42834
|
+
component: /* @__PURE__ */ jsx103(
|
|
42583
42835
|
ErrorMessage_default,
|
|
42584
42836
|
{
|
|
42585
42837
|
message: "Slash command cannot be executed while Bluma is working."
|
|
@@ -42605,7 +42857,7 @@ var BlumaSessionComponent = ({ eventBus, sessionId, cliVersion }) => {
|
|
|
42605
42857
|
...prev,
|
|
42606
42858
|
{
|
|
42607
42859
|
id,
|
|
42608
|
-
component: /* @__PURE__ */
|
|
42860
|
+
component: /* @__PURE__ */ jsx103(ChatMeta, { children: "Usage: /img ./screenshot.png \u2014 optional text after the path is sent too" })
|
|
42609
42861
|
}
|
|
42610
42862
|
];
|
|
42611
42863
|
});
|
|
@@ -42624,7 +42876,7 @@ var BlumaSessionComponent = ({ eventBus, sessionId, cliVersion }) => {
|
|
|
42624
42876
|
...prev,
|
|
42625
42877
|
{
|
|
42626
42878
|
id,
|
|
42627
|
-
component: /* @__PURE__ */
|
|
42879
|
+
component: /* @__PURE__ */ jsx103(UserMessageWithOptionalImages, { raw: payload, variant: "slash-img" })
|
|
42628
42880
|
}
|
|
42629
42881
|
];
|
|
42630
42882
|
});
|
|
@@ -42662,11 +42914,11 @@ var BlumaSessionComponent = ({ eventBus, sessionId, cliVersion }) => {
|
|
|
42662
42914
|
...prev,
|
|
42663
42915
|
{
|
|
42664
42916
|
id: firstId,
|
|
42665
|
-
component: /* @__PURE__ */
|
|
42917
|
+
component: /* @__PURE__ */ jsx103(ChatUserMessage, { children: /* @__PURE__ */ jsx103(Text, { color: BLUMA_TERMINAL.m3OnSurface, wrap: "wrap", children: text }) })
|
|
42666
42918
|
},
|
|
42667
42919
|
{
|
|
42668
42920
|
id: secondId,
|
|
42669
|
-
component: /* @__PURE__ */
|
|
42921
|
+
component: /* @__PURE__ */ jsx103(
|
|
42670
42922
|
SlashCommands_default,
|
|
42671
42923
|
{
|
|
42672
42924
|
input: text,
|
|
@@ -42701,7 +42953,7 @@ var BlumaSessionComponent = ({ eventBus, sessionId, cliVersion }) => {
|
|
|
42701
42953
|
...prev,
|
|
42702
42954
|
{
|
|
42703
42955
|
id,
|
|
42704
|
-
component: /* @__PURE__ */
|
|
42956
|
+
component: /* @__PURE__ */ jsx103(ChatUserMessage, { children: /* @__PURE__ */ jsxs84(Text, { bold: true, color: "white", children: [
|
|
42705
42957
|
"$ !",
|
|
42706
42958
|
command
|
|
42707
42959
|
] }) })
|
|
@@ -42727,7 +42979,7 @@ Please use command_status to check the result and report back to the user.`;
|
|
|
42727
42979
|
...prev,
|
|
42728
42980
|
{
|
|
42729
42981
|
id,
|
|
42730
|
-
component: /* @__PURE__ */
|
|
42982
|
+
component: /* @__PURE__ */ jsxs84(Text, { color: "red", children: [
|
|
42731
42983
|
"Failed to execute: ",
|
|
42732
42984
|
result.error || result.message
|
|
42733
42985
|
] })
|
|
@@ -42745,7 +42997,7 @@ Please use command_status to check the result and report back to the user.`;
|
|
|
42745
42997
|
...prev,
|
|
42746
42998
|
{
|
|
42747
42999
|
id,
|
|
42748
|
-
component: /* @__PURE__ */
|
|
43000
|
+
component: /* @__PURE__ */ jsxs84(Text, { color: "red", children: [
|
|
42749
43001
|
"Error: ",
|
|
42750
43002
|
err.message
|
|
42751
43003
|
] })
|
|
@@ -42765,7 +43017,7 @@ Please use command_status to check the result and report back to the user.`;
|
|
|
42765
43017
|
...prev,
|
|
42766
43018
|
{
|
|
42767
43019
|
id,
|
|
42768
|
-
component: /* @__PURE__ */
|
|
43020
|
+
component: /* @__PURE__ */ jsx103(UserMessageWithOptionalImages, { raw: text, variant: "plain" })
|
|
42769
43021
|
}
|
|
42770
43022
|
];
|
|
42771
43023
|
});
|
|
@@ -42787,7 +43039,7 @@ Please use command_status to check the result and report back to the user.`;
|
|
|
42787
43039
|
...prev,
|
|
42788
43040
|
{
|
|
42789
43041
|
id,
|
|
42790
|
-
component: /* @__PURE__ */
|
|
43042
|
+
component: /* @__PURE__ */ jsx103(UserMessageWithOptionalImages, { raw: message2.content, variant: "plain" })
|
|
42791
43043
|
}
|
|
42792
43044
|
];
|
|
42793
43045
|
});
|
|
@@ -42833,7 +43085,7 @@ Please use command_status to check the result and report back to the user.`;
|
|
|
42833
43085
|
const r = String(reasoning ?? "").trim();
|
|
42834
43086
|
if (!r) return;
|
|
42835
43087
|
setHistory((prev) => {
|
|
42836
|
-
const component = /* @__PURE__ */
|
|
43088
|
+
const component = /* @__PURE__ */ jsx103(ReasoningDisplay, { reasoning: r });
|
|
42837
43089
|
if (activeReasoningHistoryIdRef.current !== null) {
|
|
42838
43090
|
const index = prev.findIndex((item) => item.id === activeReasoningHistoryIdRef.current);
|
|
42839
43091
|
if (index >= 0) {
|
|
@@ -42853,7 +43105,7 @@ Please use command_status to check the result and report back to the user.`;
|
|
|
42853
43105
|
const key = reasoningDedupeKey(t);
|
|
42854
43106
|
lastStreamAssistantKeyRef.current = key;
|
|
42855
43107
|
setHistory((prev) => {
|
|
42856
|
-
const nextComponent = /* @__PURE__ */
|
|
43108
|
+
const nextComponent = /* @__PURE__ */ jsx103(AssistantMessageDisplay, { content });
|
|
42857
43109
|
const lastAssistantIndex = findLastHistoryIndex(
|
|
42858
43110
|
prev,
|
|
42859
43111
|
(item) => item.component.type === AssistantMessageDisplay
|
|
@@ -42909,6 +43161,13 @@ Please use command_status to check the result and report back to the user.`;
|
|
|
42909
43161
|
setStatusMessage(parsed.message);
|
|
42910
43162
|
return;
|
|
42911
43163
|
}
|
|
43164
|
+
if (parsed.type === "session_history" && Array.isArray(parsed.messages)) {
|
|
43165
|
+
setHistory((prev) => {
|
|
43166
|
+
if (prev.length > 0) return prev;
|
|
43167
|
+
return buildRestoredHistoryItems(parsed.messages, nextHistoryId(prev));
|
|
43168
|
+
});
|
|
43169
|
+
return;
|
|
43170
|
+
}
|
|
42912
43171
|
if (parsed.type === "turn_start") {
|
|
42913
43172
|
const preview = String(parsed.userPromptPreview ?? "").trim();
|
|
42914
43173
|
appendHookEvent({
|
|
@@ -43021,14 +43280,14 @@ Please use command_status to check the result and report back to the user.`;
|
|
|
43021
43280
|
}
|
|
43022
43281
|
let newComponent = null;
|
|
43023
43282
|
if (parsed.type === "debug") {
|
|
43024
|
-
newComponent = /* @__PURE__ */
|
|
43283
|
+
newComponent = /* @__PURE__ */ jsx103(ChatMeta, { children: parsed.message });
|
|
43025
43284
|
} else if (parsed.type === "protocol_violation") {
|
|
43026
|
-
newComponent = /* @__PURE__ */
|
|
43027
|
-
/* @__PURE__ */
|
|
43028
|
-
/* @__PURE__ */
|
|
43285
|
+
newComponent = /* @__PURE__ */ jsx103(ChatBlock, { marginBottom: 0, children: /* @__PURE__ */ jsx103(MessageResponse, { children: /* @__PURE__ */ jsxs84(Box_default, { flexDirection: "column", paddingLeft: 2, children: [
|
|
43286
|
+
/* @__PURE__ */ jsx103(Text, { dimColor: true, children: parsed.content }),
|
|
43287
|
+
/* @__PURE__ */ jsx103(Text, { dimColor: true, children: parsed.message })
|
|
43029
43288
|
] }) }) });
|
|
43030
43289
|
} else if (parsed.type === "error") {
|
|
43031
|
-
newComponent = /* @__PURE__ */
|
|
43290
|
+
newComponent = /* @__PURE__ */ jsx103(
|
|
43032
43291
|
ErrorMessage_default,
|
|
43033
43292
|
{
|
|
43034
43293
|
message: parsed.message,
|
|
@@ -43052,7 +43311,7 @@ Please use command_status to check the result and report back to the user.`;
|
|
|
43052
43311
|
if (parsed.tool_call_id) {
|
|
43053
43312
|
setToolResultStatus(parsed.tool_call_id, "running");
|
|
43054
43313
|
}
|
|
43055
|
-
newComponent = tn ? /* @__PURE__ */
|
|
43314
|
+
newComponent = tn ? /* @__PURE__ */ jsx103(
|
|
43056
43315
|
ToolMessage,
|
|
43057
43316
|
{
|
|
43058
43317
|
toolName: tn,
|
|
@@ -43078,11 +43337,11 @@ Please use command_status to check the result and report back to the user.`;
|
|
|
43078
43337
|
}
|
|
43079
43338
|
newComponent = null;
|
|
43080
43339
|
} else if (parsed.type === "user_overlay") {
|
|
43081
|
-
newComponent = /* @__PURE__ */
|
|
43340
|
+
newComponent = /* @__PURE__ */ jsx103(ChatUserMessage, { children: /* @__PURE__ */ jsx103(Text, { color: BLUMA_TERMINAL.m3OnSurface, bold: true, wrap: "wrap", children: parsed.payload }) });
|
|
43082
43341
|
} else if (parsed.type === "reasoning") {
|
|
43083
43342
|
setIsReasoning(true);
|
|
43084
43343
|
} else if (parsed.type === "log") {
|
|
43085
|
-
newComponent = /* @__PURE__ */
|
|
43344
|
+
newComponent = /* @__PURE__ */ jsxs84(ChatMeta, { children: [
|
|
43086
43345
|
parsed.message,
|
|
43087
43346
|
parsed.payload ? `: ${parsed.payload}` : ""
|
|
43088
43347
|
] });
|
|
@@ -43093,7 +43352,7 @@ Please use command_status to check the result and report back to the user.`;
|
|
|
43093
43352
|
newComponent = null;
|
|
43094
43353
|
} else {
|
|
43095
43354
|
lastStreamAssistantKeyRef.current = key || null;
|
|
43096
|
-
newComponent = /* @__PURE__ */
|
|
43355
|
+
newComponent = /* @__PURE__ */ jsx103(AssistantMessageDisplay, { content: body });
|
|
43097
43356
|
}
|
|
43098
43357
|
}
|
|
43099
43358
|
if (newComponent) {
|
|
@@ -43135,7 +43394,7 @@ Please use command_status to check the result and report back to the user.`;
|
|
|
43135
43394
|
if (!msg) return;
|
|
43136
43395
|
setHistory((prev) => {
|
|
43137
43396
|
const id = nextHistoryId(prev);
|
|
43138
|
-
return [...prev, { id, component: /* @__PURE__ */
|
|
43397
|
+
return [...prev, { id, component: /* @__PURE__ */ jsx103(ChatMeta, { children: msg }) }];
|
|
43139
43398
|
});
|
|
43140
43399
|
};
|
|
43141
43400
|
uiEventBus.on("user_overlay", handleUiOverlay);
|
|
@@ -43188,9 +43447,9 @@ Please use command_status to check the result and report back to the user.`;
|
|
|
43188
43447
|
setIsProcessing(false);
|
|
43189
43448
|
}
|
|
43190
43449
|
}, [handleConfirmation, pendingConfirmation]);
|
|
43191
|
-
const transcript = useMemo7(() => /* @__PURE__ */
|
|
43192
|
-
history.map((item) => /* @__PURE__ */
|
|
43193
|
-
/* @__PURE__ */
|
|
43450
|
+
const transcript = useMemo7(() => /* @__PURE__ */ jsx103(Fragment20, { children: /* @__PURE__ */ jsx103(ScrollBox_default, { stickyScroll: true, flexDirection: "column", flexGrow: 1, minHeight: 0, width: "100%", children: /* @__PURE__ */ jsxs84(Box_default, { flexDirection: "column", minHeight: 0, width: "100%", children: [
|
|
43451
|
+
history.map((item) => /* @__PURE__ */ jsx103(React35.Fragment, { children: item.component }, item.id)),
|
|
43452
|
+
/* @__PURE__ */ jsx103(
|
|
43194
43453
|
StreamingText,
|
|
43195
43454
|
{
|
|
43196
43455
|
eventBus,
|
|
@@ -43205,7 +43464,7 @@ Please use command_status to check the result and report back to the user.`;
|
|
|
43205
43464
|
history,
|
|
43206
43465
|
liveToolName
|
|
43207
43466
|
]);
|
|
43208
|
-
const bottomDock = useMemo7(() => /* @__PURE__ */
|
|
43467
|
+
const bottomDock = useMemo7(() => /* @__PURE__ */ jsx103(
|
|
43209
43468
|
BlumaBottomDock,
|
|
43210
43469
|
{
|
|
43211
43470
|
eventBus,
|
|
@@ -43255,10 +43514,10 @@ Please use command_status to check the result and report back to the user.`;
|
|
|
43255
43514
|
statusMessage,
|
|
43256
43515
|
workdir
|
|
43257
43516
|
]);
|
|
43258
|
-
const header = useMemo7(() => /* @__PURE__ */
|
|
43259
|
-
const overlay = useMemo7(() => /* @__PURE__ */
|
|
43260
|
-
const floating = useMemo7(() => /* @__PURE__ */
|
|
43261
|
-
return /* @__PURE__ */
|
|
43517
|
+
const header = useMemo7(() => /* @__PURE__ */ jsx103(Header, { sessionId, workdir, cliVersion }), [cliVersion, sessionId, workdir]);
|
|
43518
|
+
const overlay = useMemo7(() => /* @__PURE__ */ jsx103(BlumaWorkersOverlay, { sessionId }), [sessionId]);
|
|
43519
|
+
const floating = useMemo7(() => /* @__PURE__ */ jsx103(CoordinatorTaskPanel, {}), []);
|
|
43520
|
+
return /* @__PURE__ */ jsx103(
|
|
43262
43521
|
BlumaViewport,
|
|
43263
43522
|
{
|
|
43264
43523
|
header,
|