cogpit 2.4.2 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +276 -73
- package/dist/web/assets/{CommandPaletteHost-DJghey7B.js → CommandPaletteHost-D43icOGh.js} +1 -1
- package/dist/web/assets/{ConfigBrowser-x0UdXG0K.js → ConfigBrowser-BailHbYr.js} +1 -1
- package/dist/web/assets/{HighlightedEditor-D0TDZx8S.js → HighlightedEditor-Kf1cQYyg.js} +1 -1
- package/dist/web/assets/{KeyboardShortcutsDialog-2606YXAx.js → KeyboardShortcutsDialog-CHb_hQuK.js} +1 -1
- package/dist/web/assets/{MobileFileChanges-B4dwGXMS.js → MobileFileChanges-C9Xk9gfg.js} +1 -1
- package/dist/web/assets/{PreviewPanel-CJdf-VLC.js → PreviewPanel-Djv1bZZJ.js} +1 -1
- package/dist/web/assets/ProjectFilesPanel-DuBqjGFA.js +4 -0
- package/dist/web/assets/{ProjectSwitcherModal-D8boI2Qx.js → ProjectSwitcherModal-CxQ6p2B4.js} +1 -1
- package/dist/web/assets/{TerminalOutput-C-6RWc6C.js → TerminalOutput-Cm-dLkUR.js} +1 -1
- package/dist/web/assets/ThemeSelectorModal-CTuOdp5Q.js +1 -0
- package/dist/web/assets/WorkflowsPanel-P7HtcaDf.js +1 -0
- package/dist/web/assets/{WorktreePanel-D-BUTFL2.js → WorktreePanel-DcjYVMuA.js} +1 -1
- package/dist/web/assets/index-CEBq1nya.js +1 -0
- package/dist/web/assets/{index-ztb2qsgi.js → index-CVfvPIib.js} +4 -4
- package/dist/web/assets/index-CWj7TiFf.css +1 -0
- package/dist/web/assets/{index-BBKPLXTq.js → index-D2LNKOXE.js} +1 -1
- package/dist/web/assets/index-DFiPbdIb.js +153 -0
- package/dist/web/assets/session-parser.worker-SrNyVFwl.js +29 -0
- package/dist/web/assets/{vendor-ui-RwWl1mlR.js → vendor-ui-DUTyrBOX.js} +1 -1
- package/dist/web/index.html +3 -3
- package/package.json +1 -1
- package/dist/web/assets/ProjectFilesPanel-3GzuQyp3.js +0 -4
- package/dist/web/assets/ThemeSelectorModal-DZ9JuT6j.js +0 -1
- package/dist/web/assets/WorkflowsPanel-i3GanFyN.js +0 -1
- package/dist/web/assets/index-CMQcske6.js +0 -1
- package/dist/web/assets/index-C_0XOtqJ.css +0 -1
- package/dist/web/assets/index-D6p4gVB_.js +0 -154
- package/dist/web/assets/session-parser.worker-D3MwyNH5.js +0 -29
package/dist/cli.js
CHANGED
|
@@ -8151,8 +8151,21 @@ function resolveAssignedArgument(source, invocationStart, argumentSource) {
|
|
|
8151
8151
|
const identifier = argumentSource.trim().match(/^([A-Za-z_$][\w$]*)$/)?.[1];
|
|
8152
8152
|
if (!identifier) return argumentSource;
|
|
8153
8153
|
const prefix = source.slice(0, invocationStart);
|
|
8154
|
-
const assignment = new RegExp(`\\b(?:const|let|var)\\s+${identifier.replace(/[$]/g, "\\$")}\\s*=`, "
|
|
8155
|
-
|
|
8154
|
+
const assignment = new RegExp(`\\b(?:const|let|var)\\s+${identifier.replace(/[$]/g, "\\$")}\\s*=`, "y");
|
|
8155
|
+
let lastMatch = null;
|
|
8156
|
+
for (let index = 0; index < prefix.length; index++) {
|
|
8157
|
+
const skipped = skipStringOrComment(prefix, index);
|
|
8158
|
+
if (skipped) {
|
|
8159
|
+
index = skipped.endIndex - 1;
|
|
8160
|
+
continue;
|
|
8161
|
+
}
|
|
8162
|
+
assignment.lastIndex = index;
|
|
8163
|
+
const match = assignment.exec(prefix);
|
|
8164
|
+
if (match) {
|
|
8165
|
+
lastMatch = match;
|
|
8166
|
+
index += match[0].length - 1;
|
|
8167
|
+
}
|
|
8168
|
+
}
|
|
8156
8169
|
if (!lastMatch || lastMatch.index === void 0) return argumentSource;
|
|
8157
8170
|
const valueStart = skipTrivia(prefix, lastMatch.index + lastMatch[0].length);
|
|
8158
8171
|
const opening = prefix[valueStart];
|
|
@@ -8166,13 +8179,17 @@ function resolveAssignedArgument(source, invocationStart, argumentSource) {
|
|
|
8166
8179
|
}
|
|
8167
8180
|
function extractCodexExecInvocations(source) {
|
|
8168
8181
|
const calls = [];
|
|
8182
|
+
let previousSignificant = "";
|
|
8169
8183
|
for (let index = 0; index < source.length; index++) {
|
|
8170
8184
|
const skipped = skipStringOrComment(source, index);
|
|
8171
8185
|
if (skipped) {
|
|
8186
|
+
if (skipped.isString) previousSignificant = "literal";
|
|
8172
8187
|
index = skipped.endIndex - 1;
|
|
8173
8188
|
continue;
|
|
8174
8189
|
}
|
|
8175
|
-
|
|
8190
|
+
const isPropertyAccess = previousSignificant === ".";
|
|
8191
|
+
if (!/\s/.test(source[index])) previousSignificant = source[index];
|
|
8192
|
+
if (isPropertyAccess || !source.startsWith("tools", index) || isIdentifierPart(source[index - 1]) || isIdentifierPart(source[index + 5])) {
|
|
8176
8193
|
continue;
|
|
8177
8194
|
}
|
|
8178
8195
|
let cursor = skipTrivia(source, index + 5);
|
|
@@ -8520,8 +8537,9 @@ function isObject(value) {
|
|
|
8520
8537
|
return typeof value === "object" && value !== null;
|
|
8521
8538
|
}
|
|
8522
8539
|
function normalizeFunctionName(rawName) {
|
|
8540
|
+
if (rawName.startsWith("mcp__")) return rawName;
|
|
8523
8541
|
const leaf = rawName.split(/(?:__|[.:/])+/).filter(Boolean).at(-1) ?? rawName;
|
|
8524
|
-
return COLLABORATION_TOOL_NAMES.get(leaf) ?? rawName;
|
|
8542
|
+
return COLLABORATION_TOOL_NAMES.get(leaf) ?? (NATIVE_TOOL_NAMES.has(leaf) ? leaf : rawName);
|
|
8525
8543
|
}
|
|
8526
8544
|
function inferToolError(output) {
|
|
8527
8545
|
if (!output) return false;
|
|
@@ -8539,25 +8557,53 @@ function normalizePlanToTodos(input) {
|
|
|
8539
8557
|
}));
|
|
8540
8558
|
return { todos };
|
|
8541
8559
|
}
|
|
8542
|
-
function
|
|
8543
|
-
if (
|
|
8544
|
-
|
|
8545
|
-
|
|
8560
|
+
function outputImage(block) {
|
|
8561
|
+
if (block.type !== "image" && block.type !== "input_image" && block.type !== "image_url") return null;
|
|
8562
|
+
const source = isObject(block.source) ? block.source : block;
|
|
8563
|
+
const mediaType = source.media_type ?? source.mimeType;
|
|
8564
|
+
if (typeof mediaType === "string" && mediaType.startsWith("image/") && typeof source.data === "string" && source.data) {
|
|
8565
|
+
return { type: "image", source: { type: "base64", media_type: mediaType, data: source.data } };
|
|
8566
|
+
}
|
|
8567
|
+
const url = isObject(block.image_url) ? block.image_url.url : block.image_url;
|
|
8568
|
+
const match = typeof url === "string" ? /^data:(image\/[^;,]+);base64,(.+)$/is.exec(url) : null;
|
|
8569
|
+
return match ? { type: "image", source: { type: "base64", media_type: match[1].toLowerCase(), data: match[2] } } : null;
|
|
8570
|
+
}
|
|
8571
|
+
function outputContent(output) {
|
|
8572
|
+
if (typeof output === "string") return { text: output, images: [] };
|
|
8573
|
+
if (!Array.isArray(output)) {
|
|
8574
|
+
return { text: output == null ? "" : JSON.stringify(output), images: [] };
|
|
8575
|
+
}
|
|
8576
|
+
const text2 = [];
|
|
8577
|
+
const images = [];
|
|
8578
|
+
for (const block of output) {
|
|
8579
|
+
if (!isObject(block)) continue;
|
|
8580
|
+
if (typeof block.text === "string") text2.push(block.text);
|
|
8581
|
+
const image = outputImage(block);
|
|
8582
|
+
if (image) images.push(image);
|
|
8583
|
+
}
|
|
8584
|
+
return { text: text2.join(""), images };
|
|
8546
8585
|
}
|
|
8547
8586
|
function parseCustomToolOutput(output) {
|
|
8548
|
-
const
|
|
8549
|
-
|
|
8587
|
+
const original = outputContent(output);
|
|
8588
|
+
let envelope = isObject(output) && !Array.isArray(output) ? output : null;
|
|
8550
8589
|
try {
|
|
8551
|
-
const parsed = JSON.parse(
|
|
8552
|
-
|
|
8553
|
-
const meta = isObject(parsed.metadata) ? parsed.metadata : null;
|
|
8554
|
-
const isError = meta ? meta.exit_code !== 0 && meta.exit_code !== void 0 : inferToolError(text2);
|
|
8555
|
-
return { text: text2, isError };
|
|
8590
|
+
const parsed = envelope ?? JSON.parse(original.text);
|
|
8591
|
+
if (isObject(parsed) && !Array.isArray(parsed)) envelope = parsed;
|
|
8556
8592
|
} catch {
|
|
8557
|
-
return { text: rawOutput, isError: inferToolError(rawOutput) };
|
|
8558
8593
|
}
|
|
8594
|
+
const content = envelope && ("output" in envelope || "content" in envelope) ? outputContent(envelope.output ?? envelope.content) : original;
|
|
8595
|
+
const images = content === original ? original.images : [...original.images, ...content.images];
|
|
8596
|
+
const metadata = isObject(envelope?.metadata) ? envelope.metadata : null;
|
|
8597
|
+
const exitCode = metadata?.exit_code ?? envelope?.exit_code;
|
|
8598
|
+
const explicitError = typeof envelope?.isError === "boolean" ? envelope.isError : typeof envelope?.is_error === "boolean" ? envelope.is_error : void 0;
|
|
8599
|
+
const isError = explicitError === true || (typeof exitCode === "number" ? exitCode !== 0 : explicitError ?? inferToolError(content.text));
|
|
8600
|
+
return {
|
|
8601
|
+
text: content.text,
|
|
8602
|
+
isError,
|
|
8603
|
+
...images.length > 0 ? { images } : {}
|
|
8604
|
+
};
|
|
8559
8605
|
}
|
|
8560
|
-
var COLLABORATION_TOOL_NAMES;
|
|
8606
|
+
var COLLABORATION_TOOL_NAMES, NATIVE_TOOL_NAMES;
|
|
8561
8607
|
var init_codex_tool_normalization = __esm({
|
|
8562
8608
|
"../../shared/session/codex-tool-normalization.ts"() {
|
|
8563
8609
|
COLLABORATION_TOOL_NAMES = /* @__PURE__ */ new Map([
|
|
@@ -8574,6 +8620,25 @@ var init_codex_tool_normalization = __esm({
|
|
|
8574
8620
|
["interrupt_agent", "interrupt_agent"],
|
|
8575
8621
|
["interruptAgent", "interrupt_agent"]
|
|
8576
8622
|
]);
|
|
8623
|
+
NATIVE_TOOL_NAMES = /* @__PURE__ */ new Set([
|
|
8624
|
+
"exec",
|
|
8625
|
+
"exec_command",
|
|
8626
|
+
"write_stdin",
|
|
8627
|
+
"apply_patch",
|
|
8628
|
+
"update_plan",
|
|
8629
|
+
"view_image",
|
|
8630
|
+
"request_user_input",
|
|
8631
|
+
"request_user_input_async",
|
|
8632
|
+
"tool_search",
|
|
8633
|
+
"list_mcp_resources",
|
|
8634
|
+
"list_mcp_resource_templates",
|
|
8635
|
+
"read_mcp_resource",
|
|
8636
|
+
"request_plugin_install",
|
|
8637
|
+
"create_goal",
|
|
8638
|
+
"get_goal",
|
|
8639
|
+
"update_goal",
|
|
8640
|
+
"wait"
|
|
8641
|
+
]);
|
|
8577
8642
|
}
|
|
8578
8643
|
});
|
|
8579
8644
|
|
|
@@ -8772,11 +8837,12 @@ function parseMcpEventResult(value) {
|
|
|
8772
8837
|
if ("Err" in value) return { text: safeStringify(value.Err), isError: true };
|
|
8773
8838
|
const ok = isObject2(value.Ok) ? value.Ok : null;
|
|
8774
8839
|
if (!ok) return { text: safeStringify(value), isError: false };
|
|
8775
|
-
const parsedContent = parseCustomToolOutput(ok.content);
|
|
8776
|
-
const text2 = parsedContent.text || (ok.structuredContent !== void 0 ? safeStringify(ok.structuredContent) : safeStringify(ok));
|
|
8840
|
+
const parsedContent = parseCustomToolOutput({ ...ok, content: ok.content });
|
|
8841
|
+
const text2 = parsedContent.text || (parsedContent.images?.length ? "" : ok.structuredContent !== void 0 ? safeStringify(ok.structuredContent) : safeStringify(ok));
|
|
8777
8842
|
return {
|
|
8843
|
+
...parsedContent,
|
|
8778
8844
|
text: text2,
|
|
8779
|
-
isError:
|
|
8845
|
+
isError: parsedContent.isError
|
|
8780
8846
|
};
|
|
8781
8847
|
}
|
|
8782
8848
|
function createTurn(turnId, timestamp2, model) {
|
|
@@ -9104,6 +9170,7 @@ function walkCodexRecords(records, options) {
|
|
|
9104
9170
|
if (existing) {
|
|
9105
9171
|
existing.result = result.text;
|
|
9106
9172
|
existing.isError = result.isError;
|
|
9173
|
+
if (result.images) existing.resultImages = result.images;
|
|
9107
9174
|
pendingToolCalls.delete(payload.call_id);
|
|
9108
9175
|
} else if (!isCodeModeChild(payload.call_id)) {
|
|
9109
9176
|
appendToolCall(current, {
|
|
@@ -9112,6 +9179,7 @@ function walkCodexRecords(records, options) {
|
|
|
9112
9179
|
input,
|
|
9113
9180
|
result: result.text,
|
|
9114
9181
|
isError: result.isError,
|
|
9182
|
+
...result.images ? { resultImages: result.images } : {},
|
|
9115
9183
|
timestamp: timestamp2
|
|
9116
9184
|
}, timestamp2);
|
|
9117
9185
|
}
|
|
@@ -9278,9 +9346,11 @@ function walkCodexRecords(records, options) {
|
|
|
9278
9346
|
if (payload.type === "function_call_output" && typeof payload.call_id === "string") {
|
|
9279
9347
|
const toolCall = pendingToolCalls.get(payload.call_id);
|
|
9280
9348
|
if (!toolCall) continue;
|
|
9281
|
-
const
|
|
9349
|
+
const parsedOutput = parseCustomToolOutput(payload.output);
|
|
9350
|
+
const output = parsedOutput.text;
|
|
9282
9351
|
toolCall.result = output;
|
|
9283
|
-
toolCall.isError =
|
|
9352
|
+
toolCall.isError = parsedOutput.isError;
|
|
9353
|
+
if (parsedOutput.images) toolCall.resultImages = parsedOutput.images;
|
|
9284
9354
|
pendingToolCalls.delete(payload.call_id);
|
|
9285
9355
|
if (toolCall.name === "spawn_agent" && output) {
|
|
9286
9356
|
try {
|
|
@@ -9342,7 +9412,7 @@ function walkCodexRecords(records, options) {
|
|
|
9342
9412
|
continue;
|
|
9343
9413
|
}
|
|
9344
9414
|
if (payload.type === "custom_tool_call" && typeof payload.call_id === "string") {
|
|
9345
|
-
const name = typeof payload.name === "string" ? payload.name : "tool";
|
|
9415
|
+
const name = normalizeFunctionName(typeof payload.name === "string" ? payload.name : "tool");
|
|
9346
9416
|
const rawInput = typeof payload.input === "string" ? payload.input : "";
|
|
9347
9417
|
const callId = payload.call_id;
|
|
9348
9418
|
const perFileCalls = rawInput ? parseCodexToolPatches(name, rawInput, callId, timestamp2, metadata.cwd) : [];
|
|
@@ -9372,7 +9442,7 @@ function walkCodexRecords(records, options) {
|
|
|
9372
9442
|
}
|
|
9373
9443
|
if (payload.type === "custom_tool_call_output" && typeof payload.call_id === "string") {
|
|
9374
9444
|
const callId = payload.call_id;
|
|
9375
|
-
const { text: text2, isError } = parseCustomToolOutput(payload.output);
|
|
9445
|
+
const { text: text2, isError, images } = parseCustomToolOutput(payload.output);
|
|
9376
9446
|
const patchCalls = patchCallIds.get(callId);
|
|
9377
9447
|
if (patchCalls) {
|
|
9378
9448
|
const failedIds = patchCalls.direct && isError ? new Set(patchCalls.calls.map((call) => call.id)) : findFailedNestedPatchCallIds(text2, isError, patchCalls.calls);
|
|
@@ -9390,6 +9460,7 @@ function walkCodexRecords(records, options) {
|
|
|
9390
9460
|
if (toolCall) {
|
|
9391
9461
|
toolCall.result = text2;
|
|
9392
9462
|
toolCall.isError = isError;
|
|
9463
|
+
if (images) toolCall.resultImages = images;
|
|
9393
9464
|
pendingToolCalls.delete(callId);
|
|
9394
9465
|
}
|
|
9395
9466
|
continue;
|
|
@@ -13208,7 +13279,7 @@ var init_package = __esm({
|
|
|
13208
13279
|
package_default = {
|
|
13209
13280
|
name: "cogpit",
|
|
13210
13281
|
private: true,
|
|
13211
|
-
version: "2.
|
|
13282
|
+
version: "2.5.0",
|
|
13212
13283
|
description: "Control center for Claude Code, OpenAI Codex, and GitHub Copilot CLI sessions",
|
|
13213
13284
|
license: "MIT",
|
|
13214
13285
|
author: {
|
|
@@ -23589,6 +23660,16 @@ function isObject9(value) {
|
|
|
23589
23660
|
function firstString3(...values) {
|
|
23590
23661
|
return values.find((value) => typeof value === "string") ?? "";
|
|
23591
23662
|
}
|
|
23663
|
+
function readableToolText(value) {
|
|
23664
|
+
if (typeof value !== "string") return "";
|
|
23665
|
+
return /^gAAAAA[A-Za-z0-9_-]+={0,2}$/.test(value.trim()) ? "Encrypted message" : value;
|
|
23666
|
+
}
|
|
23667
|
+
function getCommandText(input) {
|
|
23668
|
+
const command = input.command ?? input.cmd;
|
|
23669
|
+
if (typeof command === "string") return command;
|
|
23670
|
+
if (!Array.isArray(command) || !command.every((value) => typeof value === "string")) return "";
|
|
23671
|
+
return command.map((value) => /^[A-Za-z0-9_./:@%+=,-]+$/.test(value) ? value : `'${value.replace(/'/g, `'"'"'`)}'`).join(" ");
|
|
23672
|
+
}
|
|
23592
23673
|
function truncate(value, length = 140) {
|
|
23593
23674
|
const singleLine = value.replace(/\s+/g, " ").trim();
|
|
23594
23675
|
return singleLine.length > length ? `${singleLine.slice(0, length - 1)}\u2026` : singleLine;
|
|
@@ -23743,7 +23824,7 @@ function patchSummary(args) {
|
|
|
23743
23824
|
}
|
|
23744
23825
|
function presentExecInvocation(invocation) {
|
|
23745
23826
|
const args = invocation.argumentSource;
|
|
23746
|
-
switch (invocation.name) {
|
|
23827
|
+
switch (normalizeFunctionName(invocation.name)) {
|
|
23747
23828
|
case "exec_command":
|
|
23748
23829
|
return { label: "Run command", summary: argumentString(args, "cmd", "command"), styleName: "Bash" };
|
|
23749
23830
|
case "write_stdin": {
|
|
@@ -23774,7 +23855,7 @@ function presentExecInvocation(invocation) {
|
|
|
23774
23855
|
case "create_goal":
|
|
23775
23856
|
return { label: "Create goal", summary: argumentString(args, "objective"), styleName: "TodoWrite" };
|
|
23776
23857
|
case "get_goal":
|
|
23777
|
-
return { label: "Check goal", summary: "", styleName: "
|
|
23858
|
+
return { label: "Check goal", summary: "", styleName: "TaskList" };
|
|
23778
23859
|
case "update_goal":
|
|
23779
23860
|
return { label: "Update goal", summary: argumentString(args, "status"), styleName: "TodoWrite" };
|
|
23780
23861
|
case "list_mcp_resources":
|
|
@@ -23793,12 +23874,23 @@ function presentExecInvocation(invocation) {
|
|
|
23793
23874
|
return { label: "Find tools", summary: argumentString(args, "query"), styleName: "ToolSearch" };
|
|
23794
23875
|
case "image_gen__imagegen":
|
|
23795
23876
|
return { label: "Generate image", summary: argumentString(args, "prompt"), styleName: "Image" };
|
|
23796
|
-
|
|
23797
|
-
return
|
|
23798
|
-
|
|
23799
|
-
|
|
23800
|
-
|
|
23877
|
+
case "spawn_agent":
|
|
23878
|
+
return { label: "Spawn agent", summary: readableToolText(argumentString(args, "task_name", "message")), styleName: "Task" };
|
|
23879
|
+
case "send_message":
|
|
23880
|
+
case "followup_task":
|
|
23881
|
+
return {
|
|
23882
|
+
...TOOL_LABELS[normalizeFunctionName(invocation.name)],
|
|
23883
|
+
summary: [argumentString(args, "target"), readableToolText(argumentString(args, "message"))].filter(Boolean).join(" \xB7 ")
|
|
23884
|
+
};
|
|
23885
|
+
default: {
|
|
23886
|
+
const name = normalizeFunctionName(invocation.name);
|
|
23887
|
+
const definition = TOOL_LABELS[name];
|
|
23888
|
+
return name.startsWith("mcp__") ? presentMcpInvocation(name, args) : {
|
|
23889
|
+
label: definition?.label ?? humanizeIdentifier(name),
|
|
23890
|
+
summary: readableToolText(invocationDetail(args)),
|
|
23891
|
+
styleName: definition?.styleName ?? name
|
|
23801
23892
|
};
|
|
23893
|
+
}
|
|
23802
23894
|
}
|
|
23803
23895
|
}
|
|
23804
23896
|
function isCodexExecCall(tc) {
|
|
@@ -23870,11 +23962,27 @@ function workflowSummary(input) {
|
|
|
23870
23962
|
return metaName || firstString3(input.scriptPath);
|
|
23871
23963
|
}
|
|
23872
23964
|
function firstStringValue(input) {
|
|
23873
|
-
const
|
|
23874
|
-
|
|
23875
|
-
|
|
23876
|
-
|
|
23877
|
-
|
|
23965
|
+
const detail = firstString3(...[
|
|
23966
|
+
"description",
|
|
23967
|
+
"summary",
|
|
23968
|
+
"query",
|
|
23969
|
+
"q",
|
|
23970
|
+
"command",
|
|
23971
|
+
"cmd",
|
|
23972
|
+
"file_path",
|
|
23973
|
+
"path",
|
|
23974
|
+
"url",
|
|
23975
|
+
"uri",
|
|
23976
|
+
"pattern",
|
|
23977
|
+
"prompt",
|
|
23978
|
+
"objective",
|
|
23979
|
+
"message",
|
|
23980
|
+
"title",
|
|
23981
|
+
"name"
|
|
23982
|
+
].map((key2) => input[key2]));
|
|
23983
|
+
if (detail) return truncate(detail);
|
|
23984
|
+
const entry = Object.entries(input).find(([key2, value]) => key2 !== "raw" && key2 !== "script" && typeof value === "string");
|
|
23985
|
+
return entry ? truncate(entry[1]) : "";
|
|
23878
23986
|
}
|
|
23879
23987
|
function defaultToolSummary(tc) {
|
|
23880
23988
|
const input = tc.input;
|
|
@@ -23884,13 +23992,23 @@ function defaultToolSummary(tc) {
|
|
|
23884
23992
|
case "Edit":
|
|
23885
23993
|
return String(input.file_path ?? input.path ?? "");
|
|
23886
23994
|
case "Bash":
|
|
23887
|
-
|
|
23995
|
+
case "exec_command":
|
|
23996
|
+
return getCommandText(input);
|
|
23997
|
+
case "write_stdin":
|
|
23998
|
+
return [input.session_id !== void 0 ? `session ${input.session_id}` : "", firstString3(input.chars)].filter(Boolean).join(" \xB7 ");
|
|
23999
|
+
case "apply_patch":
|
|
24000
|
+
return patchSummary(firstString3(input.patch, input.raw, input.input));
|
|
24001
|
+
case "TodoWrite":
|
|
24002
|
+
case "update_plan": {
|
|
24003
|
+
const steps = Array.isArray(input.todos) ? input.todos : Array.isArray(input.plan) ? input.plan : [];
|
|
24004
|
+
return steps.length > 0 ? plural(steps.length, "step") : firstString3(input.explanation);
|
|
24005
|
+
}
|
|
23888
24006
|
case "Grep":
|
|
23889
24007
|
case "Glob":
|
|
23890
24008
|
return String(input.pattern ?? "");
|
|
23891
24009
|
case "Task":
|
|
23892
24010
|
case "Agent":
|
|
23893
|
-
return
|
|
24011
|
+
return readableToolText(input.description ?? input.prompt);
|
|
23894
24012
|
case "WebFetch":
|
|
23895
24013
|
return String(input.url ?? "");
|
|
23896
24014
|
case "NotebookEdit":
|
|
@@ -23899,9 +24017,11 @@ function defaultToolSummary(tc) {
|
|
|
23899
24017
|
return "Entered plan mode";
|
|
23900
24018
|
case "ExitPlanMode":
|
|
23901
24019
|
return "Waiting for plan approval";
|
|
23902
|
-
case "AskUserQuestion":
|
|
23903
|
-
|
|
23904
|
-
|
|
24020
|
+
case "AskUserQuestion":
|
|
24021
|
+
case "request_user_input":
|
|
24022
|
+
case "request_user_input_async": {
|
|
24023
|
+
const question = Array.isArray(input.questions) ? input.questions.find(isObject9) : null;
|
|
24024
|
+
return firstString3(question?.question, question?.title);
|
|
23905
24025
|
}
|
|
23906
24026
|
case "Monitor": {
|
|
23907
24027
|
const bashId = String(input.bash_id ?? "");
|
|
@@ -23945,7 +24065,7 @@ function defaultToolSummary(tc) {
|
|
|
23945
24065
|
return String(input.query ?? "");
|
|
23946
24066
|
case "SendMessage": {
|
|
23947
24067
|
const recipient = firstString3(input.to, input.recipient);
|
|
23948
|
-
const gist = truncate(firstString3(input.summary, input.message, input.content));
|
|
24068
|
+
const gist = truncate(readableToolText(firstString3(input.summary, input.message, input.content)));
|
|
23949
24069
|
return [recipient, gist].filter(Boolean).join(" \xB7 ");
|
|
23950
24070
|
}
|
|
23951
24071
|
case "ListAgents":
|
|
@@ -23971,14 +24091,14 @@ function defaultToolSummary(tc) {
|
|
|
23971
24091
|
case "LSP":
|
|
23972
24092
|
return schemaFreeSummary(input) || firstStringValue(input);
|
|
23973
24093
|
case "spawn_agent":
|
|
23974
|
-
return
|
|
24094
|
+
return readableToolText(input.task_name ?? input.message);
|
|
23975
24095
|
case "wait_agent": {
|
|
23976
24096
|
const targets = Array.isArray(input.ids) ? input.ids.filter((id) => typeof id === "string") : [];
|
|
23977
24097
|
return compactValues(targets);
|
|
23978
24098
|
}
|
|
23979
24099
|
case "send_message":
|
|
23980
24100
|
case "followup_task":
|
|
23981
|
-
return [input.target, input.message].filter((value) => typeof value === "string").join(" \xB7 ");
|
|
24101
|
+
return [input.target, readableToolText(input.message)].filter((value) => typeof value === "string" && value.length > 0).join(" \xB7 ");
|
|
23982
24102
|
case "list_agents":
|
|
23983
24103
|
return String(input.path_prefix ?? "");
|
|
23984
24104
|
case "interrupt_agent":
|
|
@@ -24002,7 +24122,9 @@ function defaultToolSummary(tc) {
|
|
|
24002
24122
|
}
|
|
24003
24123
|
function getToolPresentation(tc) {
|
|
24004
24124
|
if (isCodexExecCall(tc)) return presentExecScript(tc.input.raw);
|
|
24005
|
-
|
|
24125
|
+
const name = normalizeFunctionName(tc.name);
|
|
24126
|
+
if (name === "WebSearch" || name === "web_search") return nativeWebPresentation(tc.input);
|
|
24127
|
+
if (name === "web__run" || name === "web.run") return presentWebInvocation(JSON.stringify(tc.input));
|
|
24006
24128
|
const mcp = mcpParts(tc.name);
|
|
24007
24129
|
if (mcp) {
|
|
24008
24130
|
return {
|
|
@@ -24011,26 +24133,60 @@ function getToolPresentation(tc) {
|
|
|
24011
24133
|
styleName: "Mcp"
|
|
24012
24134
|
};
|
|
24013
24135
|
}
|
|
24014
|
-
const
|
|
24136
|
+
const definition = TOOL_LABELS[name];
|
|
24015
24137
|
return {
|
|
24016
|
-
label:
|
|
24017
|
-
summary: defaultToolSummary(tc),
|
|
24018
|
-
styleName:
|
|
24138
|
+
label: definition?.label ?? humanizeIdentifier(name),
|
|
24139
|
+
summary: truncate(defaultToolSummary({ name, input: tc.input })),
|
|
24140
|
+
styleName: definition?.styleName ?? name
|
|
24019
24141
|
};
|
|
24020
24142
|
}
|
|
24021
24143
|
function getToolSummary(tc) {
|
|
24022
24144
|
return getToolPresentation(tc).summary;
|
|
24023
24145
|
}
|
|
24024
|
-
var
|
|
24146
|
+
var TOOL_LABELS, WORD_SPELLINGS, WEB_OPERATIONS, SCHEMA_FREE_GIST_KEYS;
|
|
24025
24147
|
var init_toolSummary = __esm({
|
|
24026
24148
|
"../../shared/session/toolSummary.ts"() {
|
|
24027
24149
|
init_codex_exec();
|
|
24028
|
-
|
|
24150
|
+
init_codex_tool_normalization();
|
|
24151
|
+
TOOL_LABELS = {
|
|
24152
|
+
Read: { label: "Read file", styleName: "Read" },
|
|
24153
|
+
Write: { label: "Write file", styleName: "Write" },
|
|
24154
|
+
Edit: { label: "Edit file", styleName: "Edit" },
|
|
24155
|
+
Bash: { label: "Run command", styleName: "Bash" },
|
|
24156
|
+
Grep: { label: "Search files", styleName: "Grep" },
|
|
24157
|
+
Glob: { label: "Find files", styleName: "Glob" },
|
|
24158
|
+
Task: { label: "Spawn agent", styleName: "Task" },
|
|
24159
|
+
Agent: { label: "Spawn agent", styleName: "Task" },
|
|
24160
|
+
WebFetch: { label: "Open page", styleName: "WebFetch" },
|
|
24161
|
+
TodoWrite: { label: "Update plan", styleName: "TodoWrite" },
|
|
24162
|
+
AskUserQuestion: { label: "Ask question", styleName: "AskUserQuestion" },
|
|
24163
|
+
Skill: { label: "Use skill", styleName: "Skill" },
|
|
24164
|
+
ToolSearch: { label: "Find tools", styleName: "ToolSearch" },
|
|
24165
|
+
SendMessage: { label: "Message agent", styleName: "SendMessage" },
|
|
24166
|
+
ListAgents: { label: "List agents", styleName: "ListAgents" },
|
|
24167
|
+
TaskCreate: { label: "Create task", styleName: "TaskCreate" },
|
|
24168
|
+
TaskUpdate: { label: "Update task", styleName: "TaskUpdate" },
|
|
24169
|
+
TaskList: { label: "List tasks", styleName: "TaskList" },
|
|
24170
|
+
TaskOutput: { label: "Read task output", styleName: "TaskOutput" },
|
|
24171
|
+
TaskStop: { label: "Stop task", styleName: "TaskStop" },
|
|
24172
|
+
NotebookEdit: { label: "Edit notebook", styleName: "Edit" },
|
|
24173
|
+
EnterPlanMode: { label: "Enter plan mode", styleName: "EnterPlanMode" },
|
|
24174
|
+
ExitPlanMode: { label: "Exit plan mode", styleName: "ExitPlanMode" },
|
|
24175
|
+
EnterWorktree: { label: "Enter worktree", styleName: "EnterWorktree" },
|
|
24176
|
+
ExitWorktree: { label: "Exit worktree", styleName: "ExitWorktree" },
|
|
24177
|
+
Workflow: { label: "Run workflow", styleName: "Workflow" },
|
|
24178
|
+
exec_command: { label: "Run command", styleName: "Bash" },
|
|
24179
|
+
write_stdin: { label: "Continue command", styleName: "Bash" },
|
|
24180
|
+
apply_patch: { label: "Apply patch", styleName: "Edit" },
|
|
24181
|
+
update_plan: { label: "Update plan", styleName: "TodoWrite" },
|
|
24182
|
+
request_user_input: { label: "Ask question", styleName: "AskUserQuestion" },
|
|
24183
|
+
request_user_input_async: { label: "Ask question", styleName: "AskUserQuestion" },
|
|
24184
|
+
wait: { label: "Wait for tools", styleName: "Mcp" },
|
|
24029
24185
|
spawn_agent: { label: "Spawn agent", styleName: "Task" },
|
|
24030
|
-
wait_agent: { label: "Wait for agents", styleName: "
|
|
24031
|
-
send_message: { label: "Message agent", styleName: "
|
|
24186
|
+
wait_agent: { label: "Wait for agents", styleName: "TaskOutput" },
|
|
24187
|
+
send_message: { label: "Message agent", styleName: "SendMessage" },
|
|
24032
24188
|
followup_task: { label: "Follow up", styleName: "Task" },
|
|
24033
|
-
list_agents: { label: "List agents", styleName: "
|
|
24189
|
+
list_agents: { label: "List agents", styleName: "ListAgents" },
|
|
24034
24190
|
interrupt_agent: { label: "Interrupt agent", styleName: "Task" },
|
|
24035
24191
|
tool_search: { label: "Find tools", styleName: "ToolSearch" },
|
|
24036
24192
|
list_mcp_resources: { label: "List MCP resources", styleName: "Mcp" },
|
|
@@ -24038,7 +24194,7 @@ var init_toolSummary = __esm({
|
|
|
24038
24194
|
read_mcp_resource: { label: "Read MCP resource", styleName: "Mcp" },
|
|
24039
24195
|
request_plugin_install: { label: "Install plugin", styleName: "Mcp" },
|
|
24040
24196
|
create_goal: { label: "Create goal", styleName: "TodoWrite" },
|
|
24041
|
-
get_goal: { label: "Check goal", styleName: "
|
|
24197
|
+
get_goal: { label: "Check goal", styleName: "TaskList" },
|
|
24042
24198
|
update_goal: { label: "Update goal", styleName: "TodoWrite" },
|
|
24043
24199
|
view_image: { label: "View image", styleName: "Read" }
|
|
24044
24200
|
};
|
|
@@ -26349,30 +26505,77 @@ async function listProjectFiles(root, { skipCache = false } = {}) {
|
|
|
26349
26505
|
fileCache.set(root, { expiresAt: Date.now() + CACHE_TTL_MS3, files });
|
|
26350
26506
|
return files;
|
|
26351
26507
|
}
|
|
26508
|
+
function listDirectoryEntries(files, directory) {
|
|
26509
|
+
const prefix = directory ? `${directory.replace(/\/+$/, "")}/` : "";
|
|
26510
|
+
const children = directChildren(files, prefix);
|
|
26511
|
+
return [
|
|
26512
|
+
...children.directories.map((name) => ({ name: compactChain(files, prefix, name), type: "directory" })),
|
|
26513
|
+
...children.files.map((name) => ({ name, type: "file" }))
|
|
26514
|
+
];
|
|
26515
|
+
}
|
|
26516
|
+
function directChildren(files, prefix) {
|
|
26517
|
+
const directories = /* @__PURE__ */ new Set();
|
|
26518
|
+
const plainFiles = /* @__PURE__ */ new Set();
|
|
26519
|
+
for (const file of files) {
|
|
26520
|
+
if (!file.startsWith(prefix)) continue;
|
|
26521
|
+
const rest = file.slice(prefix.length);
|
|
26522
|
+
const slash = rest.indexOf("/");
|
|
26523
|
+
if (slash === -1) plainFiles.add(rest);
|
|
26524
|
+
else directories.add(rest.slice(0, slash));
|
|
26525
|
+
}
|
|
26526
|
+
const byName = (a, b) => a.localeCompare(b);
|
|
26527
|
+
return { directories: [...directories].sort(byName), files: [...plainFiles].sort(byName) };
|
|
26528
|
+
}
|
|
26529
|
+
function compactChain(files, prefix, name) {
|
|
26530
|
+
let chain = name;
|
|
26531
|
+
for (; ; ) {
|
|
26532
|
+
const children = directChildren(files, `${prefix}${chain}/`);
|
|
26533
|
+
if (children.files.length > 0 || children.directories.length !== 1) return chain;
|
|
26534
|
+
chain = `${chain}/${children.directories[0]}`;
|
|
26535
|
+
}
|
|
26536
|
+
}
|
|
26537
|
+
async function resolveProjectRoot(cwd) {
|
|
26538
|
+
if (!isAbsolute12(cwd)) return { error: "cwd must be an absolute path", status: 400 };
|
|
26539
|
+
try {
|
|
26540
|
+
const root = resolve18(cwd);
|
|
26541
|
+
const info = await stat17(root);
|
|
26542
|
+
if (!info.isDirectory()) return { error: "cwd must be a directory", status: 400 };
|
|
26543
|
+
return { root: await realpath12(root) };
|
|
26544
|
+
} catch {
|
|
26545
|
+
return { error: "Project directory not found", status: 404 };
|
|
26546
|
+
}
|
|
26547
|
+
}
|
|
26352
26548
|
function registerProjectFileRoutes(use) {
|
|
26549
|
+
use("/api/project-files/tree", async (req, res, next) => {
|
|
26550
|
+
if (req.method !== "GET") return next();
|
|
26551
|
+
const url = new URL(req.url || "", "http://localhost");
|
|
26552
|
+
const directory = (url.searchParams.get("dir") ?? "").replace(/^\/+|\/+$/g, "");
|
|
26553
|
+
if (directory.split("/").some((segment) => segment === "..")) {
|
|
26554
|
+
return sendJson(res, 400, { error: "dir must stay inside the project" });
|
|
26555
|
+
}
|
|
26556
|
+
const resolved = await resolveProjectRoot(url.searchParams.get("cwd") ?? "");
|
|
26557
|
+
if ("error" in resolved) return sendJson(res, resolved.status, { error: resolved.error });
|
|
26558
|
+
const files = await listProjectFiles(resolved.root, { skipCache: url.searchParams.get("refresh") === "1" });
|
|
26559
|
+
return sendJson(res, 200, {
|
|
26560
|
+
entries: listDirectoryEntries(files, directory),
|
|
26561
|
+
scanLimited: files.length >= MAX_FILES
|
|
26562
|
+
});
|
|
26563
|
+
});
|
|
26353
26564
|
use("/api/project-files", async (req, res, next) => {
|
|
26354
26565
|
if (req.method !== "GET") return next();
|
|
26355
26566
|
const url = new URL(req.url || "", "http://localhost");
|
|
26356
|
-
const cwd = url.searchParams.get("cwd") ?? "";
|
|
26357
26567
|
const query4 = url.searchParams.get("q") ?? "";
|
|
26358
26568
|
const limit = Math.min(Math.max(Number(url.searchParams.get("limit")) || 30, 1), 100);
|
|
26359
26569
|
const skipCache = url.searchParams.get("refresh") === "1";
|
|
26360
|
-
|
|
26361
|
-
|
|
26362
|
-
|
|
26363
|
-
|
|
26364
|
-
|
|
26365
|
-
|
|
26366
|
-
|
|
26367
|
-
|
|
26368
|
-
|
|
26369
|
-
files: ranked.files,
|
|
26370
|
-
totalMatches: ranked.totalMatches,
|
|
26371
|
-
scanLimited: files.length >= MAX_FILES
|
|
26372
|
-
});
|
|
26373
|
-
} catch {
|
|
26374
|
-
return sendJson(res, 404, { error: "Project directory not found" });
|
|
26375
|
-
}
|
|
26570
|
+
const resolved = await resolveProjectRoot(url.searchParams.get("cwd") ?? "");
|
|
26571
|
+
if ("error" in resolved) return sendJson(res, resolved.status, { error: resolved.error });
|
|
26572
|
+
const files = await listProjectFiles(resolved.root, { skipCache });
|
|
26573
|
+
const ranked = rankProjectFiles(files, query4, limit);
|
|
26574
|
+
return sendJson(res, 200, {
|
|
26575
|
+
files: ranked.files,
|
|
26576
|
+
totalMatches: ranked.totalMatches,
|
|
26577
|
+
scanLimited: files.length >= MAX_FILES
|
|
26578
|
+
});
|
|
26376
26579
|
});
|
|
26377
26580
|
}
|
|
26378
26581
|
var MAX_FILES, CACHE_TTL_MS3, IGNORED_DIRECTORIES, fileCache, execFile8;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as oe,j as u,r as H}from"./vendor-react-gGw_S5I_.js";import{ar as h,as as Q,a3 as le,O as ce,J as re,at as de,au as me,P as ue,C as he,N as ge,x as fe,av as ve,aw as Y,ax as W,ay as we,az as Ce,aA as je,aB as Se,w as ye}from"./index-D6p4gVB_.js";import{S as xe,p as Z,q as be,P as Pe,L as Te,H as Oe,F as Ne,r as ke,d as ee,G as Ee,l as Fe,h as Ie,s as $e,t as Re,u as Ae,v as De,w as te,x as Le,y as He,z as Me,K as qe,E as Be,A as Ke,B as pe,D as ne,I as ze,J as Ge,N as Ue}from"./vendor-ui-RwWl1mlR.js";import"./vendor-shiki-DOn6sF-i.js";import"./vendor-markdown-BE1gYnO9.js";function a(t,e,s,c,i,m,d){return{id:t,label:e,icon:c,run:i,shortcut:m,description:d,value:`${e} ${s}`}}function _(...t){return t.filter(e=>e!==!1&&e!==void 0)}function We(t){const e=oe.c(40);let s,c,i,m,d,v,w,r,C,g,y,f,x,k,b;if(e[0]!==t){const $=_(a("home","Go to dashboard","home overview",Oe,t.onGoHome),a("mission-control",t.showMission?"Exit Mission Control":"Open Mission Control","live sessions blocked waiting answer everything at once",Te,t.onToggleMissionControl,h("missionControl")),a("new-session","Start a new session","project agent chat create",Pe,t.onNewSession,h("newSession")),t.onDuplicateSession&&a("duplicate-session","Duplicate this session","copy fork clone branch thread",be,t.onDuplicateSession),t.canFocusComposer&&a("focus-composer","Focus message composer","chat prompt input",Z,t.onFocusComposer,h("focusComposer")),t.onFindInConversation&&a("find-in-conversation","Find in conversation","search text transcript turns matches",xe,t.onFindInConversation,h("findInConversation"))),F=(t.projects??[]).slice(0,8).map(n=>a(`project-${n.dirName}`,n.shortName,`${n.path} ${n.dirName} project workspace`,Ne,()=>{var l;return(l=t.onOpenProject)==null?void 0:l.call(t,n.dirName)},void 0,`${n.path} · ${n.sessionCount} session${n.sessionCount===1?"":"s"}`)),o=(t.recentSessions??[]).slice(0,10).map(n=>{const j=(n.aiTitle||n.name||n.slug||n.lastUserMessage||n.firstUserMessage||n.sessionId).replace(/\s+/g," ").trim().slice(0,160)||n.sessionId,p=[n.projectShortName,n.gitBranch].filter(Boolean).join(" · ");return a(`session-${n.dirName}-${n.fileName}`,j,`${n.projectShortName} ${n.cwd??""} ${n.gitBranch??""} ${n.sessionId} recent thread conversation`,Z,()=>{var q;return(q=t.onOpenSession)==null?void 0:q.call(t,n.dirName,n.fileName)},void 0,p)}),I=t.devices??[],P=I.length>1&&t.onSwitchDevice?I.slice(0,Q.length).map((n,l)=>a(`device-${n.id}`,n.isActive?`${n.name} (current)`:`Switch to ${n.name}`,`device machine host remote ${n.id}`,n.isLocal?ke:ee,()=>{var j;return(j=t.onSwitchDevice)==null?void 0:j.call(t,n.id)},h(Q[l]))):[],R=_(a("toggle-sidebar",t.showSidebar?"Hide session sidebar":"Show session sidebar","projects navigation panel",Re,t.onToggleSidebar,h("toggleSidebar")),t.hasSession&&a("toggle-stats",t.showStats?"Hide session details":"Show session details","stats tokens usage panel",$e,t.onToggleStats,h("toggleStats")),t.onToggleProjectFiles&&a("project-files",t.showProjectFiles?"Close project files":"Open project files","browse edit save workspace source code",Ie,t.onToggleProjectFiles,h("projectFiles")),t.hasFileChanges&&a("toggle-file-changes",t.showFileChanges?"Hide file changes":"Show file changes","diff edits review panel",Fe,t.onToggleFileChanges),t.supportsWorktrees&&t.canOpenTerminal&&a("toggle-worktrees",t.showWorktrees?"Hide worktrees":"Show worktrees","git branches panel",Ee,t.onToggleWorktrees)),A=_(t.onOpenProjectInEditor&&a("open-project-editor","Open project in editor","code cursor vscode zed workspace",Ge,t.onOpenProjectInEditor),t.onRevealProject&&a("reveal-project","Reveal project in file manager","finder explorer folder directory",ze,t.onRevealProject),t.onCopyResumeCommand&&a("copy-resume-command","Copy resume command","cli claude codex copilot terminal clipboard continue session",ne,t.onCopyResumeCommand),t.onCopyProjectPath&&a("copy-project-path","Copy project path","workspace directory clipboard",ne,t.onCopyProjectPath),t.onOpenIntegratedTerminal&&a("integrated-terminal","New integrated terminal","embedded shell command line process panel",pe,t.onOpenIntegratedTerminal,h("newIntegratedTerminal")),t.canOpenTerminal&&a("terminal","Open in system terminal","external shell command line app",Ke,t.onOpenTerminal,h("systemTerminal")),t.onTogglePreview&&a("preview","Toggle development preview","browser localhost dev server website",Be,t.onTogglePreview,h("preview")),t.onOpenKeyboardShortcuts&&a("keyboard-shortcuts","Customize keyboard shortcuts","keybindings hotkeys settings",qe,t.onOpenKeyboardShortcuts),t.onOpenConfig&&a("config",t.showConfig?"Close agent configuration":"Open agent configuration","skills commands claude settings files",Me,t.onOpenConfig),a("settings","Open Cogpit settings","preferences network",He,t.onOpenSettings),a("theme","Change theme & chat width","appearance light dark oled width narrow wide",Le,t.onOpenTheme,h("themeSelector")),a("expand","Expand all groups","conversation details",te,t.onExpandAll,h("expandAll")),a("expand-payloads","Expand all tool payloads","raw input result diff conversation details",te,t.onExpandToolPayloads,h("expandToolPayloads")),a("collapse","Collapse all","conversation groups payloads details",De,t.onCollapseAll),t.onKillAll&&a("kill-all","Kill all agent processes","stop terminate halt everything runaway",Ae,t.onKillAll),t.onOpenDevices&&a("manage-devices","Manage devices…","remote machines hub hosts edit rename remove switch",Ue,()=>{var n;return(n=t.onOpenDevices)==null?void 0:n.call(t,"manage")}),t.onOpenDevices&&a("add-device","Add device…","remote machine hub host connect pair new",ee,()=>{var n;return(n=t.onOpenDevices)==null?void 0:n.call(t,"add")})),D=[{value:"Navigation",items:$},...o.length>0?[{value:"Recent sessions",items:o}]:[],...F.length>0?[{value:"Projects",items:F}]:[],...P.length>0?[{value:"Devices",items:P}]:[],{value:"View",items:R},{value:"Tools",items:A}],E=function(l){t.onOpenChange(!1),l.run()};i=me,x=t.open,k=t.onOpenChange,b="Command palette",v="Search for a Cogpit action to run.",w="max-w-xl",c=ue,C="Search commands",g=!0,e[16]===Symbol.for("react.memo_cache_sentinel")?(y=u.jsx(he,{"aria-label":"Search commands",autoFocus:!0,placeholder:"Search commands..."}),e[16]=y):y=e[16],e[17]!==t.loadingNavigation?(f=t.loadingNavigation&&u.jsxs("div",{className:"motion-enter flex items-center gap-2 px-3 py-2 text-xs text-muted-foreground",role:"status",children:[u.jsx(le,{className:"size-3.5"}),"Loading projects and sessions..."]}),e[17]=t.loadingNavigation,e[18]=f):f=e[18],s=ge,m="max-h-[min(26rem,60vh)]",e[19]===Symbol.for("react.memo_cache_sentinel")?(d=u.jsx(fe,{children:"No matching actions."}),e[19]=d):d=e[19],r=D.map(n=>u.jsx(ce,{heading:n.value,children:n.items.map(l=>{const j=l.icon;return u.jsxs(re,{value:l.value,onSelect:()=>E(l),children:[u.jsx(j,{"aria-hidden":"true"}),u.jsxs("span",{className:"min-w-0 flex-1",children:[u.jsx("span",{className:"block truncate",children:l.label}),l.description&&u.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:l.description})]}),l.shortcut&&u.jsx(de,{children:l.shortcut})]},l.id)})},n.value)),e[0]=t,e[1]=s,e[2]=c,e[3]=i,e[4]=m,e[5]=d,e[6]=v,e[7]=w,e[8]=r,e[9]=C,e[10]=g,e[11]=y,e[12]=f,e[13]=x,e[14]=k,e[15]=b}else s=e[1],c=e[2],i=e[3],m=e[4],d=e[5],v=e[6],w=e[7],r=e[8],C=e[9],g=e[10],y=e[11],f=e[12],x=e[13],k=e[14],b=e[15];let T;e[20]!==s||e[21]!==m||e[22]!==d||e[23]!==r?(T=u.jsxs(s,{className:m,children:[d,r]}),e[20]=s,e[21]=m,e[22]=d,e[23]=r,e[24]=T):T=e[24];let O;e[25]!==c||e[26]!==T||e[27]!==C||e[28]!==g||e[29]!==y||e[30]!==f?(O=u.jsxs(c,{label:C,loop:g,children:[y,f,T]}),e[25]=c,e[26]=T,e[27]=C,e[28]=g,e[29]=y,e[30]=f,e[31]=O):O=e[31];let N;return e[32]!==i||e[33]!==v||e[34]!==w||e[35]!==O||e[36]!==x||e[37]!==k||e[38]!==b?(N=u.jsx(i,{open:x,onOpenChange:k,title:b,description:v,className:w,children:O}),e[32]=i,e[33]=v,e[34]=w,e[35]=O,e[36]=x,e[37]=k,e[38]=b,e[39]=N):N=e[39],N}async function ae(t,e){const s=await ye(t,{signal:e});if(!s.ok)throw new Error(`Request failed (${s.status})`);const c=await s.json();return Array.isArray(c)?c:[]}function Ye(t){var J;const e=oe.c(48);let s,c,i,m,d,v;e[0]!==t?({open:i,currentProjectDirName:s,projectCwd:d,onProcessStarted:c,launchTerminalRequest:v,...m}=t,e[0]=t,e[1]=s,e[2]=c,e[3]=i,e[4]=m,e[5]=d,e[6]=v):(s=e[1],c=e[2],i=e[3],m=e[4],d=e[5],v=e[6]);const w=v===void 0?0:v,r=ve();let C;e[7]===Symbol.for("react.memo_cache_sentinel")?(C=[],e[7]=C):C=e[7];const[g,y]=H.useState(C);let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=[],e[8]=f):f=e[8];const[x,k]=H.useState(f),[b,T]=H.useState(!1),O=H.useRef(0);let N,$;e[9]!==i?(N=()=>{if(!i)return;const S=new AbortController;return T(!0),Promise.allSettled([ae("/api/projects",S.signal),ae("/api/active-sessions?limit=12&perProject=3",S.signal)]).then(M=>{const[V,X]=M;S.signal.aborted||(y(V.status==="fulfilled"?V.value:[]),k(X.status==="fulfilled"?X.value:[]),T(!1))}),()=>S.abort()},$=[i],e[9]=i,e[10]=N,e[11]=$):(N=e[10],$=e[11]),H.useEffect(N,$);let F;e:{if(d){F=d;break e}if(!s){F=null;break e}let S;e[12]!==s||e[13]!==g?(S=((J=g.find(M=>M.dirName===s))==null?void 0:J.path)??null,e[12]=s,e[13]=g,e[14]=S):S=e[14],F=S}const o=F;let I;e[15]!==c||e[16]!==r||e[17]!==o?(I=()=>{if(!o)return;const S=r.spawnTerminal({cwd:o}),M=o.replace(/\/+$/,"").split("/").at(-1)||"Terminal";c({id:S,name:M,type:"terminal",status:"running",source:o})},e[15]=c,e[16]=r,e[17]=o,e[18]=I):I=e[18];const P=I;let R,A;e[19]!==P||e[20]!==w||e[21]!==r.status||e[22]!==o?(R=()=>{w<=O.current||!o||r.status!=="connected"||(O.current=w,P())},A=[P,w,r.status,o],e[19]=P,e[20]=w,e[21]=r.status,e[22]=o,e[23]=R,e[24]=A):(R=e[23],A=e[24]),H.useEffect(R,A);let D;e[25]!==s||e[26]!==o?(D={path:o,dirName:s},e[25]=s,e[26]=o,e[27]=D):D=e[27];const E=D;let n;e[28]!==E?(n=()=>Ce(E),e[28]=E,e[29]=n):n=e[29];const l=n;let j;e[30]!==E?(j=()=>je(E),e[30]=E,e[31]=j):j=e[31];const p=j,q=!Y()&&W("hostFiles"),se=W("hostFiles")&&(!Y()||we());let B;e[32]!==o?(B=()=>{o&&Se(o)},e[32]=o,e[33]=B):B=e[33];const ie=B;let L;e[34]!==P||e[35]!==r.status||e[36]!==o?(L=o&&r.status==="connected"&&W("terminal")?P:void 0,e[34]=P,e[35]=r.status,e[36]=o,e[37]=L):L=e[37];const z=o&&se?l:void 0,G=o&&q?p:void 0,U=o?ie:void 0;let K;return e[38]!==b||e[39]!==i||e[40]!==m||e[41]!==g||e[42]!==x||e[43]!==L||e[44]!==z||e[45]!==G||e[46]!==U?(K=u.jsx(We,{...m,open:i,projects:g,recentSessions:x,loadingNavigation:b,onOpenIntegratedTerminal:L,onOpenProjectInEditor:z,onRevealProject:G,onCopyProjectPath:U}),e[38]=b,e[39]=i,e[40]=m,e[41]=g,e[42]=x,e[43]=L,e[44]=z,e[45]=G,e[46]=U,e[47]=K):K=e[47],K}export{Ye as CommandPaletteHost};
|
|
1
|
+
import{c as oe,j as u,r as H}from"./vendor-react-gGw_S5I_.js";import{aj as h,ak as Q,al as le,O as ce,J as re,am as de,an as me,P as ue,C as he,N as ge,x as fe,ao as ve,ap as Y,aq as W,ar as we,as as Ce,at as je,au as Se,w as ye}from"./index-DFiPbdIb.js";import{S as xe,l as Z,m as be,P as Pe,L as Te,H as Oe,F as Ne,n as ke,d as ee,G as Ee,k as Fe,o as Ie,p as $e,q as Re,r as De,s as Ae,t as te,u as Le,v as He,w as Me,K as qe,E as pe,x as Ke,y as Be,z as ne,A as Ge,B as ze,D as Ue}from"./vendor-ui-DUTyrBOX.js";import"./vendor-shiki-DOn6sF-i.js";import"./vendor-markdown-BE1gYnO9.js";function a(t,e,s,c,i,m,d){return{id:t,label:e,icon:c,run:i,shortcut:m,description:d,value:`${e} ${s}`}}function _(...t){return t.filter(e=>e!==!1&&e!==void 0)}function We(t){const e=oe.c(40);let s,c,i,m,d,v,w,r,C,g,y,f,x,k,b;if(e[0]!==t){const $=_(a("home","Go to dashboard","home overview",Oe,t.onGoHome),a("mission-control",t.showMission?"Exit Mission Control":"Open Mission Control","live sessions blocked waiting answer everything at once",Te,t.onToggleMissionControl,h("missionControl")),a("new-session","Start a new session","project agent chat create",Pe,t.onNewSession,h("newSession")),t.onDuplicateSession&&a("duplicate-session","Duplicate this session","copy fork clone branch thread",be,t.onDuplicateSession),t.canFocusComposer&&a("focus-composer","Focus message composer","chat prompt input",Z,t.onFocusComposer,h("focusComposer")),t.onFindInConversation&&a("find-in-conversation","Find in conversation","search text transcript turns matches",xe,t.onFindInConversation,h("findInConversation"))),F=(t.projects??[]).slice(0,8).map(n=>a(`project-${n.dirName}`,n.shortName,`${n.path} ${n.dirName} project workspace`,Ne,()=>{var l;return(l=t.onOpenProject)==null?void 0:l.call(t,n.dirName)},void 0,`${n.path} · ${n.sessionCount} session${n.sessionCount===1?"":"s"}`)),o=(t.recentSessions??[]).slice(0,10).map(n=>{const j=(n.aiTitle||n.name||n.slug||n.lastUserMessage||n.firstUserMessage||n.sessionId).replace(/\s+/g," ").trim().slice(0,160)||n.sessionId,B=[n.projectShortName,n.gitBranch].filter(Boolean).join(" · ");return a(`session-${n.dirName}-${n.fileName}`,j,`${n.projectShortName} ${n.cwd??""} ${n.gitBranch??""} ${n.sessionId} recent thread conversation`,Z,()=>{var q;return(q=t.onOpenSession)==null?void 0:q.call(t,n.dirName,n.fileName)},void 0,B)}),I=t.devices??[],P=I.length>1&&t.onSwitchDevice?I.slice(0,Q.length).map((n,l)=>a(`device-${n.id}`,n.isActive?`${n.name} (current)`:`Switch to ${n.name}`,`device machine host remote ${n.id}`,n.isLocal?ke:ee,()=>{var j;return(j=t.onSwitchDevice)==null?void 0:j.call(t,n.id)},h(Q[l]))):[],R=_(a("toggle-sidebar",t.showSidebar?"Hide session sidebar":"Show session sidebar","projects navigation panel",Re,t.onToggleSidebar,h("toggleSidebar")),t.hasSession&&a("toggle-stats",t.showStats?"Hide session details":"Show session details","stats tokens usage panel",$e,t.onToggleStats,h("toggleStats")),t.onToggleProjectFiles&&a("project-files",t.showProjectFiles?"Close project files":"Open project files","browse edit save workspace source code",Ie,t.onToggleProjectFiles,h("projectFiles")),t.hasFileChanges&&a("toggle-file-changes",t.showFileChanges?"Hide file changes":"Show file changes","diff edits review panel",Fe,t.onToggleFileChanges),t.supportsWorktrees&&t.canOpenTerminal&&a("toggle-worktrees",t.showWorktrees?"Hide worktrees":"Show worktrees","git branches panel",Ee,t.onToggleWorktrees)),D=_(t.onOpenProjectInEditor&&a("open-project-editor","Open project in editor","code cursor vscode zed workspace",ze,t.onOpenProjectInEditor),t.onRevealProject&&a("reveal-project","Reveal project in file manager","finder explorer folder directory",Ge,t.onRevealProject),t.onCopyResumeCommand&&a("copy-resume-command","Copy resume command","cli claude codex copilot terminal clipboard continue session",ne,t.onCopyResumeCommand),t.onCopyProjectPath&&a("copy-project-path","Copy project path","workspace directory clipboard",ne,t.onCopyProjectPath),t.onOpenIntegratedTerminal&&a("integrated-terminal","New integrated terminal","embedded shell command line process panel",Be,t.onOpenIntegratedTerminal,h("newIntegratedTerminal")),t.canOpenTerminal&&a("terminal","Open in system terminal","external shell command line app",Ke,t.onOpenTerminal,h("systemTerminal")),t.onTogglePreview&&a("preview","Toggle development preview","browser localhost dev server website",pe,t.onTogglePreview,h("preview")),t.onOpenKeyboardShortcuts&&a("keyboard-shortcuts","Customize keyboard shortcuts","keybindings hotkeys settings",qe,t.onOpenKeyboardShortcuts),t.onOpenConfig&&a("config",t.showConfig?"Close agent configuration":"Open agent configuration","skills commands claude settings files",Me,t.onOpenConfig),a("settings","Open Cogpit settings","preferences network",He,t.onOpenSettings),a("theme","Change theme & chat width","appearance light dark oled width narrow wide",Le,t.onOpenTheme,h("themeSelector")),a("expand","Expand all groups","conversation details",te,t.onExpandAll,h("expandAll")),a("expand-payloads","Expand all tool payloads","raw input result diff conversation details",te,t.onExpandToolPayloads,h("expandToolPayloads")),a("collapse","Collapse all","conversation groups payloads details",Ae,t.onCollapseAll),t.onKillAll&&a("kill-all","Kill all agent processes","stop terminate halt everything runaway",De,t.onKillAll),t.onOpenDevices&&a("manage-devices","Manage devices…","remote machines hub hosts edit rename remove switch",Ue,()=>{var n;return(n=t.onOpenDevices)==null?void 0:n.call(t,"manage")}),t.onOpenDevices&&a("add-device","Add device…","remote machine hub host connect pair new",ee,()=>{var n;return(n=t.onOpenDevices)==null?void 0:n.call(t,"add")})),A=[{value:"Navigation",items:$},...o.length>0?[{value:"Recent sessions",items:o}]:[],...F.length>0?[{value:"Projects",items:F}]:[],...P.length>0?[{value:"Devices",items:P}]:[],{value:"View",items:R},{value:"Tools",items:D}],E=function(l){t.onOpenChange(!1),l.run()};i=me,x=t.open,k=t.onOpenChange,b="Command palette",v="Search for a Cogpit action to run.",w="max-w-xl",c=ue,C="Search commands",g=!0,e[16]===Symbol.for("react.memo_cache_sentinel")?(y=u.jsx(he,{"aria-label":"Search commands",autoFocus:!0,placeholder:"Search commands..."}),e[16]=y):y=e[16],e[17]!==t.loadingNavigation?(f=t.loadingNavigation&&u.jsxs("div",{className:"motion-enter flex items-center gap-2 px-3 py-2 text-xs text-muted-foreground",role:"status",children:[u.jsx(le,{className:"size-3.5"}),"Loading projects and sessions..."]}),e[17]=t.loadingNavigation,e[18]=f):f=e[18],s=ge,m="max-h-[min(26rem,60vh)]",e[19]===Symbol.for("react.memo_cache_sentinel")?(d=u.jsx(fe,{children:"No matching actions."}),e[19]=d):d=e[19],r=A.map(n=>u.jsx(ce,{heading:n.value,children:n.items.map(l=>{const j=l.icon;return u.jsxs(re,{value:l.value,onSelect:()=>E(l),children:[u.jsx(j,{"aria-hidden":"true"}),u.jsxs("span",{className:"min-w-0 flex-1",children:[u.jsx("span",{className:"block truncate",children:l.label}),l.description&&u.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:l.description})]}),l.shortcut&&u.jsx(de,{children:l.shortcut})]},l.id)})},n.value)),e[0]=t,e[1]=s,e[2]=c,e[3]=i,e[4]=m,e[5]=d,e[6]=v,e[7]=w,e[8]=r,e[9]=C,e[10]=g,e[11]=y,e[12]=f,e[13]=x,e[14]=k,e[15]=b}else s=e[1],c=e[2],i=e[3],m=e[4],d=e[5],v=e[6],w=e[7],r=e[8],C=e[9],g=e[10],y=e[11],f=e[12],x=e[13],k=e[14],b=e[15];let T;e[20]!==s||e[21]!==m||e[22]!==d||e[23]!==r?(T=u.jsxs(s,{className:m,children:[d,r]}),e[20]=s,e[21]=m,e[22]=d,e[23]=r,e[24]=T):T=e[24];let O;e[25]!==c||e[26]!==T||e[27]!==C||e[28]!==g||e[29]!==y||e[30]!==f?(O=u.jsxs(c,{label:C,loop:g,children:[y,f,T]}),e[25]=c,e[26]=T,e[27]=C,e[28]=g,e[29]=y,e[30]=f,e[31]=O):O=e[31];let N;return e[32]!==i||e[33]!==v||e[34]!==w||e[35]!==O||e[36]!==x||e[37]!==k||e[38]!==b?(N=u.jsx(i,{open:x,onOpenChange:k,title:b,description:v,className:w,children:O}),e[32]=i,e[33]=v,e[34]=w,e[35]=O,e[36]=x,e[37]=k,e[38]=b,e[39]=N):N=e[39],N}async function ae(t,e){const s=await ye(t,{signal:e});if(!s.ok)throw new Error(`Request failed (${s.status})`);const c=await s.json();return Array.isArray(c)?c:[]}function Ye(t){var V;const e=oe.c(48);let s,c,i,m,d,v;e[0]!==t?({open:i,currentProjectDirName:s,projectCwd:d,onProcessStarted:c,launchTerminalRequest:v,...m}=t,e[0]=t,e[1]=s,e[2]=c,e[3]=i,e[4]=m,e[5]=d,e[6]=v):(s=e[1],c=e[2],i=e[3],m=e[4],d=e[5],v=e[6]);const w=v===void 0?0:v,r=ve();let C;e[7]===Symbol.for("react.memo_cache_sentinel")?(C=[],e[7]=C):C=e[7];const[g,y]=H.useState(C);let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=[],e[8]=f):f=e[8];const[x,k]=H.useState(f),[b,T]=H.useState(!1),O=H.useRef(0);let N,$;e[9]!==i?(N=()=>{if(!i)return;const S=new AbortController;return T(!0),Promise.allSettled([ae("/api/projects",S.signal),ae("/api/active-sessions?limit=12&perProject=3",S.signal)]).then(M=>{const[J,X]=M;S.signal.aborted||(y(J.status==="fulfilled"?J.value:[]),k(X.status==="fulfilled"?X.value:[]),T(!1))}),()=>S.abort()},$=[i],e[9]=i,e[10]=N,e[11]=$):(N=e[10],$=e[11]),H.useEffect(N,$);let F;e:{if(d){F=d;break e}if(!s){F=null;break e}let S;e[12]!==s||e[13]!==g?(S=((V=g.find(M=>M.dirName===s))==null?void 0:V.path)??null,e[12]=s,e[13]=g,e[14]=S):S=e[14],F=S}const o=F;let I;e[15]!==c||e[16]!==r||e[17]!==o?(I=()=>{if(!o)return;const S=r.spawnTerminal({cwd:o}),M=o.replace(/\/+$/,"").split("/").at(-1)||"Terminal";c({id:S,name:M,type:"terminal",status:"running",source:o})},e[15]=c,e[16]=r,e[17]=o,e[18]=I):I=e[18];const P=I;let R,D;e[19]!==P||e[20]!==w||e[21]!==r.status||e[22]!==o?(R=()=>{w<=O.current||!o||r.status!=="connected"||(O.current=w,P())},D=[P,w,r.status,o],e[19]=P,e[20]=w,e[21]=r.status,e[22]=o,e[23]=R,e[24]=D):(R=e[23],D=e[24]),H.useEffect(R,D);let A;e[25]!==s||e[26]!==o?(A={path:o,dirName:s},e[25]=s,e[26]=o,e[27]=A):A=e[27];const E=A;let n;e[28]!==E?(n=()=>Ce(E),e[28]=E,e[29]=n):n=e[29];const l=n;let j;e[30]!==E?(j=()=>je(E),e[30]=E,e[31]=j):j=e[31];const B=j,q=!Y()&&W("hostFiles"),se=W("hostFiles")&&(!Y()||we());let p;e[32]!==o?(p=()=>{o&&Se(o)},e[32]=o,e[33]=p):p=e[33];const ie=p;let L;e[34]!==P||e[35]!==r.status||e[36]!==o?(L=o&&r.status==="connected"&&W("terminal")?P:void 0,e[34]=P,e[35]=r.status,e[36]=o,e[37]=L):L=e[37];const G=o&&se?l:void 0,z=o&&q?B:void 0,U=o?ie:void 0;let K;return e[38]!==b||e[39]!==i||e[40]!==m||e[41]!==g||e[42]!==x||e[43]!==L||e[44]!==G||e[45]!==z||e[46]!==U?(K=u.jsx(We,{...m,open:i,projects:g,recentSessions:x,loadingNavigation:b,onOpenIntegratedTerminal:L,onOpenProjectInEditor:G,onRevealProject:z,onCopyProjectPath:U}),e[38]=b,e[39]=i,e[40]=m,e[41]=g,e[42]=x,e[43]=L,e[44]=G,e[45]=z,e[46]=U,e[47]=K):K=e[47],K}export{Ye as CommandPaletteHost};
|