@moxxy/cli 0.31.0 → 0.32.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/bin.js +490 -413
- package/package.json +2 -2
package/dist/bin.js
CHANGED
|
@@ -18540,8 +18540,8 @@ var init_catalog = __esm({
|
|
|
18540
18540
|
},
|
|
18541
18541
|
{
|
|
18542
18542
|
id: "browser",
|
|
18543
|
-
label: "
|
|
18544
|
-
description: "
|
|
18543
|
+
label: "Web & browser tools",
|
|
18544
|
+
description: "Local web_search fallback, web_fetch, and Playwright browser_session tools.",
|
|
18545
18545
|
packageName: "@moxxy/plugin-browser",
|
|
18546
18546
|
installSpec: "@moxxy/plugin-browser"
|
|
18547
18547
|
},
|
|
@@ -32882,9 +32882,9 @@ var require_react_reconciler_development = __commonJS({
|
|
|
32882
32882
|
if (process.env.NODE_ENV !== "production") {
|
|
32883
32883
|
module.exports = function $$$reconciler($$$hostConfig) {
|
|
32884
32884
|
var exports2 = {};
|
|
32885
|
-
var
|
|
32885
|
+
var React58 = require_react();
|
|
32886
32886
|
var Scheduler = require_scheduler();
|
|
32887
|
-
var ReactSharedInternals =
|
|
32887
|
+
var ReactSharedInternals = React58.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
32888
32888
|
var suppressWarning = false;
|
|
32889
32889
|
function setSuppressWarning(newSuppressWarning) {
|
|
32890
32890
|
{
|
|
@@ -52799,7 +52799,7 @@ var require_react_jsx_runtime_development = __commonJS({
|
|
|
52799
52799
|
"../../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.development.js"(exports) {
|
|
52800
52800
|
if (process.env.NODE_ENV !== "production") {
|
|
52801
52801
|
(function() {
|
|
52802
|
-
var
|
|
52802
|
+
var React58 = require_react();
|
|
52803
52803
|
var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.element");
|
|
52804
52804
|
var REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal");
|
|
52805
52805
|
var REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
@@ -52825,7 +52825,7 @@ var require_react_jsx_runtime_development = __commonJS({
|
|
|
52825
52825
|
}
|
|
52826
52826
|
return null;
|
|
52827
52827
|
}
|
|
52828
|
-
var ReactSharedInternals =
|
|
52828
|
+
var ReactSharedInternals = React58.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
52829
52829
|
function error2(format) {
|
|
52830
52830
|
{
|
|
52831
52831
|
{
|
|
@@ -54814,10 +54814,30 @@ function formatValue(v3) {
|
|
|
54814
54814
|
return "[\u2026]";
|
|
54815
54815
|
}
|
|
54816
54816
|
}
|
|
54817
|
-
function
|
|
54818
|
-
if (
|
|
54819
|
-
return
|
|
54820
|
-
|
|
54817
|
+
function stringField(input, key) {
|
|
54818
|
+
if (!input || typeof input !== "object")
|
|
54819
|
+
return null;
|
|
54820
|
+
const value = input[key];
|
|
54821
|
+
return typeof value === "string" && value.trim() ? oneLine(value) : null;
|
|
54822
|
+
}
|
|
54823
|
+
function formatToolActivity(name, input, running) {
|
|
54824
|
+
const normalized = name.toLowerCase();
|
|
54825
|
+
if (normalized === "read")
|
|
54826
|
+
return `${running ? "Reading" : "Read"} ${stringField(input, "file_path") ?? "file"}`;
|
|
54827
|
+
if (normalized === "grep") {
|
|
54828
|
+
const pattern = stringField(input, "pattern") ?? "pattern";
|
|
54829
|
+
const cwd2 = stringField(input, "cwd");
|
|
54830
|
+
return `${running ? "Searching for" : "Searched for"} ${pattern}${cwd2 ? ` in ${cwd2}` : ""}`;
|
|
54831
|
+
}
|
|
54832
|
+
if (normalized === "glob")
|
|
54833
|
+
return `${running ? "Listing" : "Listed"} ${stringField(input, "pattern") ?? "files"}`;
|
|
54834
|
+
if (normalized === "bash")
|
|
54835
|
+
return `${running ? "Running" : "Ran"} ${stringField(input, "command") ?? "command"}`;
|
|
54836
|
+
if (normalized.includes("search")) {
|
|
54837
|
+
return `${running ? "Searching for" : "Searched for"} ${stringField(input, "query") ?? summarizeArgs(input)}`;
|
|
54838
|
+
}
|
|
54839
|
+
const summary = summarizeArgs(input);
|
|
54840
|
+
return `${running ? "Running" : "Ran"} ${name}${summary ? ` \xB7 ${summary}` : ""}`;
|
|
54821
54841
|
}
|
|
54822
54842
|
function buildCompactSummary(calls, inFlight) {
|
|
54823
54843
|
if (calls.length === 0)
|
|
@@ -54839,7 +54859,8 @@ function buildCompactSummary(calls, inFlight) {
|
|
|
54839
54859
|
const phrases = [];
|
|
54840
54860
|
let first = true;
|
|
54841
54861
|
for (const g2 of groups.values()) {
|
|
54842
|
-
const
|
|
54862
|
+
const stateVerb = inFlight ? g2.verb : completedCompactVerb(g2.verb);
|
|
54863
|
+
const verb = first ? stateVerb : stateVerb.toLowerCase();
|
|
54843
54864
|
const noun = g2.count === 1 ? g2.one : g2.other;
|
|
54844
54865
|
phrases.push(`${verb} ${g2.count} ${noun}`);
|
|
54845
54866
|
first = false;
|
|
@@ -54847,6 +54868,18 @@ function buildCompactSummary(calls, inFlight) {
|
|
|
54847
54868
|
const joined = phrases.join(", ");
|
|
54848
54869
|
return inFlight ? `${joined}\u2026` : joined;
|
|
54849
54870
|
}
|
|
54871
|
+
function completedCompactVerb(verb) {
|
|
54872
|
+
const known = {
|
|
54873
|
+
Reading: "Read",
|
|
54874
|
+
"Searching for": "Searched for",
|
|
54875
|
+
"Searching the web for": "Searched the web for",
|
|
54876
|
+
Listing: "Listed",
|
|
54877
|
+
Waiting: "Waited",
|
|
54878
|
+
Writing: "Wrote",
|
|
54879
|
+
Editing: "Edited"
|
|
54880
|
+
};
|
|
54881
|
+
return known[verb] ?? verb;
|
|
54882
|
+
}
|
|
54850
54883
|
function compactPreviewLine(call) {
|
|
54851
54884
|
const key = call.compact.previewKey;
|
|
54852
54885
|
if (key) {
|
|
@@ -56056,70 +56089,102 @@ var init_motion = __esm({
|
|
|
56056
56089
|
})();
|
|
56057
56090
|
}
|
|
56058
56091
|
});
|
|
56059
|
-
|
|
56060
|
-
|
|
56061
|
-
|
|
56092
|
+
|
|
56093
|
+
// ../plugin-cli/dist/components/chat/ShimmerText.js
|
|
56094
|
+
function shimmerSlices(text, frame, width = 6) {
|
|
56095
|
+
if (!text)
|
|
56096
|
+
return { before: "", glow: "", after: "" };
|
|
56097
|
+
const safeWidth = Math.max(1, Math.min(width, text.length));
|
|
56098
|
+
const start = frame % (text.length + safeWidth) - safeWidth;
|
|
56099
|
+
const from = Math.max(0, start);
|
|
56100
|
+
const to = Math.min(text.length, start + safeWidth);
|
|
56101
|
+
return {
|
|
56102
|
+
before: text.slice(0, from),
|
|
56103
|
+
glow: to > from ? text.slice(from, to) : "",
|
|
56104
|
+
after: text.slice(Math.max(from, to))
|
|
56105
|
+
};
|
|
56106
|
+
}
|
|
56107
|
+
var import_jsx_runtime14, import_react35, ShimmerText;
|
|
56108
|
+
var init_ShimmerText = __esm({
|
|
56109
|
+
async "../plugin-cli/dist/components/chat/ShimmerText.js"() {
|
|
56062
56110
|
import_jsx_runtime14 = __toESM(require_jsx_runtime());
|
|
56063
56111
|
import_react35 = __toESM(require_react());
|
|
56064
56112
|
await init_build2();
|
|
56065
|
-
init_theme();
|
|
56066
|
-
init_dist7();
|
|
56067
|
-
await init_FileDiffView();
|
|
56068
56113
|
init_motion();
|
|
56069
|
-
|
|
56070
|
-
const [
|
|
56114
|
+
ShimmerText = ({ text, active: active2 }) => {
|
|
56115
|
+
const [frame, setFrame] = (0, import_react35.useState)(0);
|
|
56071
56116
|
(0, import_react35.useEffect)(() => {
|
|
56072
|
-
if (!MOTION_ENABLED)
|
|
56117
|
+
if (!active2 || !MOTION_ENABLED)
|
|
56073
56118
|
return;
|
|
56074
|
-
const
|
|
56075
|
-
return () => clearInterval(
|
|
56076
|
-
}, []);
|
|
56077
|
-
|
|
56078
|
-
|
|
56119
|
+
const timer = setInterval(() => setFrame((value) => value + 1), 90);
|
|
56120
|
+
return () => clearInterval(timer);
|
|
56121
|
+
}, [active2]);
|
|
56122
|
+
if (!active2 || !MOTION_ENABLED)
|
|
56123
|
+
return (0, import_jsx_runtime14.jsx)(Text, { dimColor: true, children: text });
|
|
56124
|
+
const slices = shimmerSlices(text, frame);
|
|
56125
|
+
return (0, import_jsx_runtime14.jsxs)(Text, { children: [(0, import_jsx_runtime14.jsx)(Text, { dimColor: true, children: slices.before }), (0, import_jsx_runtime14.jsx)(Text, { bold: true, children: slices.glow }), (0, import_jsx_runtime14.jsx)(Text, { dimColor: true, children: slices.after })] });
|
|
56126
|
+
};
|
|
56127
|
+
}
|
|
56128
|
+
});
|
|
56129
|
+
function toolGlyph(name) {
|
|
56130
|
+
const normalized = name.toLowerCase();
|
|
56131
|
+
if (normalized === "read" || normalized === "glob")
|
|
56132
|
+
return "\u25B1";
|
|
56133
|
+
if (normalized === "grep" || normalized.includes("search"))
|
|
56134
|
+
return "\u2315";
|
|
56135
|
+
if (normalized === "bash" || normalized.includes("command"))
|
|
56136
|
+
return "\u203A";
|
|
56137
|
+
return "\u25C7";
|
|
56138
|
+
}
|
|
56139
|
+
var import_jsx_runtime15, NAME_DISPLAY_MAX, ToolCallBlock, OutcomeText;
|
|
56140
|
+
var init_ToolCallBlock = __esm({
|
|
56141
|
+
async "../plugin-cli/dist/components/chat/ToolCallBlock.js"() {
|
|
56142
|
+
import_jsx_runtime15 = __toESM(require_jsx_runtime());
|
|
56143
|
+
__toESM(require_react());
|
|
56144
|
+
await init_build2();
|
|
56145
|
+
init_theme();
|
|
56146
|
+
init_dist7();
|
|
56147
|
+
await init_FileDiffView();
|
|
56148
|
+
await init_ShimmerText();
|
|
56079
56149
|
NAME_DISPLAY_MAX = 48;
|
|
56080
56150
|
ToolCallBlock = ({ request, outcome, expanded = false }) => {
|
|
56081
56151
|
if (isFileDiffResult(outcome)) {
|
|
56082
56152
|
const display = outcome.output.display;
|
|
56083
56153
|
if (isFileDiffDisplay(display)) {
|
|
56084
|
-
return (0,
|
|
56154
|
+
return (0, import_jsx_runtime15.jsx)(FileDiffView, { display, expanded });
|
|
56085
56155
|
}
|
|
56086
56156
|
}
|
|
56087
56157
|
const status = outcome === null ? "pending" : outcome.type === "denied" ? "err" : outcome.ok ? "ok" : "err";
|
|
56088
|
-
const
|
|
56089
|
-
|
|
56090
|
-
const detail = argSummary ? `${nameLabel}, ${argSummary}` : nameLabel;
|
|
56091
|
-
return (0, import_jsx_runtime14.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [(0, import_jsx_runtime14.jsxs)(Box_default, { children: [status === "pending" ? (0, import_jsx_runtime14.jsx)(PendingBullet, {}) : status === "err" ? (
|
|
56092
|
-
// Distinct glyph (✗), not color alone, so a failed call is
|
|
56093
|
-
// distinguishable from a successful one in a no-color / colorblind
|
|
56094
|
-
// terminal — the dots were otherwise an identical filled '●'.
|
|
56095
|
-
(0, import_jsx_runtime14.jsx)(Text, { color: Colors.danger, children: "\u2717 " })
|
|
56096
|
-
) : (0, import_jsx_runtime14.jsxs)(Text, { color: dotColorForTool(request.name), children: [Glyphs.filled, " "] }), (0, import_jsx_runtime14.jsx)(Text, { bold: true, children: "Tool" }), (0, import_jsx_runtime14.jsx)(Text, { dimColor: true, children: ` (${detail})` })] }), outcome ? (0, import_jsx_runtime14.jsxs)(Box_default, { children: [(0, import_jsx_runtime14.jsx)(Text, { dimColor: true, children: " \u2514 " }), (0, import_jsx_runtime14.jsx)(OutcomeText, { outcome })] }) : null] });
|
|
56158
|
+
const detail = truncate3(formatToolActivity(request.name, request.input, status === "pending"), NAME_DISPLAY_MAX + 70);
|
|
56159
|
+
return (0, import_jsx_runtime15.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [(0, import_jsx_runtime15.jsxs)(Box_default, { children: [(0, import_jsx_runtime15.jsxs)(Text, { color: status === "err" ? Colors.danger : void 0, dimColor: status !== "err", children: [status === "err" ? "\u2717" : toolGlyph(request.name), " "] }), (0, import_jsx_runtime15.jsx)(ShimmerText, { text: detail, active: status === "pending" }), status === "err" ? (0, import_jsx_runtime15.jsx)(Text, { color: Colors.danger, children: " failed" }) : null] }), outcome && (expanded || status === "err") ? (0, import_jsx_runtime15.jsxs)(Box_default, { children: [(0, import_jsx_runtime15.jsx)(Text, { dimColor: true, children: " \u2514 " }), (0, import_jsx_runtime15.jsx)(OutcomeText, { outcome })] }) : null] });
|
|
56097
56160
|
};
|
|
56098
56161
|
OutcomeText = ({ outcome }) => {
|
|
56099
56162
|
if (outcome.type === "denied") {
|
|
56100
|
-
return (0,
|
|
56163
|
+
return (0, import_jsx_runtime15.jsxs)(Text, { color: Colors.danger, children: ["denied: ", outcome.reason] });
|
|
56101
56164
|
}
|
|
56102
56165
|
if (!outcome.ok) {
|
|
56103
|
-
return (0,
|
|
56166
|
+
return (0, import_jsx_runtime15.jsxs)(Text, { color: Colors.danger, children: [outcome.error?.kind ?? "error", ": ", outcome.error?.message] });
|
|
56104
56167
|
}
|
|
56105
56168
|
const preview = oneLine(stringify(outcome.output));
|
|
56106
|
-
return (0,
|
|
56169
|
+
return (0, import_jsx_runtime15.jsx)(Text, { dimColor: true, children: truncate3(preview, 100) });
|
|
56107
56170
|
};
|
|
56108
56171
|
}
|
|
56109
56172
|
});
|
|
56110
56173
|
|
|
56111
56174
|
// ../plugin-cli/dist/components/chat/LiveToolBlock.js
|
|
56112
|
-
var
|
|
56175
|
+
var import_jsx_runtime16, LiveToolBlock;
|
|
56113
56176
|
var init_LiveToolBlock = __esm({
|
|
56114
56177
|
async "../plugin-cli/dist/components/chat/LiveToolBlock.js"() {
|
|
56115
|
-
|
|
56178
|
+
import_jsx_runtime16 = __toESM(require_jsx_runtime());
|
|
56116
56179
|
__toESM(require_react());
|
|
56117
56180
|
await init_build2();
|
|
56118
56181
|
init_theme();
|
|
56119
56182
|
await init_ToolCallBlock();
|
|
56183
|
+
await init_ShimmerText();
|
|
56120
56184
|
init_dist7();
|
|
56121
56185
|
LiveToolBlock = ({ block, expanded }) => {
|
|
56122
|
-
const inFlight = !block.closed;
|
|
56186
|
+
const inFlight = !block.closed || block.calls.some((call) => call.outcome === null);
|
|
56187
|
+
const showDetails = expanded || inFlight;
|
|
56123
56188
|
const summary = buildCompactSummary(block.calls, inFlight);
|
|
56124
56189
|
const latest = block.calls[block.calls.length - 1];
|
|
56125
56190
|
const errorCount = block.calls.reduce((n2, c2) => {
|
|
@@ -56130,25 +56195,25 @@ var init_LiveToolBlock = __esm({
|
|
|
56130
56195
|
return n2 + 1;
|
|
56131
56196
|
return n2 + (o2.ok ? 0 : 1);
|
|
56132
56197
|
}, 0);
|
|
56133
|
-
return (0,
|
|
56198
|
+
return (0, import_jsx_runtime16.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [(0, import_jsx_runtime16.jsxs)(Box_default, { children: [(0, import_jsx_runtime16.jsxs)(Text, { dimColor: true, children: [latest ? toolGlyph(latest.request.name) : Glyphs.pending, " "] }), (0, import_jsx_runtime16.jsx)(ShimmerText, { text: summary, active: inFlight }), !showDetails ? (0, import_jsx_runtime16.jsx)(Text, { dimColor: true, children: " \u203A" }) : null] }), errorCount > 0 && !showDetails ? (0, import_jsx_runtime16.jsx)(Box_default, { marginLeft: 2, children: (0, import_jsx_runtime16.jsxs)(Text, { color: Colors.danger, children: [errorCount, " ", errorCount === 1 ? "call" : "calls", " failed \u2014 press ctrl+o for detail"] }) }) : null, !showDetails && latest ? (0, import_jsx_runtime16.jsxs)(Box_default, { marginLeft: 2, children: [(0, import_jsx_runtime16.jsx)(Text, { dimColor: true, children: "\u2514 " }), (0, import_jsx_runtime16.jsx)(Text, { dimColor: true, children: compactPreviewLine(latest) })] }) : null, showDetails ? (0, import_jsx_runtime16.jsx)(Box_default, { flexDirection: "column", marginLeft: 2, children: block.calls.map((c2) => (0, import_jsx_runtime16.jsx)(ToolCallBlock, { request: c2.request, outcome: c2.outcome }, c2.id)) }) : null] });
|
|
56134
56199
|
};
|
|
56135
56200
|
}
|
|
56136
56201
|
});
|
|
56137
56202
|
|
|
56138
56203
|
// ../plugin-cli/dist/components/chat/SubagentScopeView.js
|
|
56139
|
-
var
|
|
56204
|
+
var import_jsx_runtime17, import_react38, SubagentScopeView;
|
|
56140
56205
|
var init_SubagentScopeView = __esm({
|
|
56141
56206
|
async "../plugin-cli/dist/components/chat/SubagentScopeView.js"() {
|
|
56142
|
-
|
|
56143
|
-
|
|
56207
|
+
import_jsx_runtime17 = __toESM(require_jsx_runtime());
|
|
56208
|
+
import_react38 = __toESM(require_react());
|
|
56144
56209
|
await init_build2();
|
|
56145
56210
|
init_theme();
|
|
56146
56211
|
init_dist7();
|
|
56147
56212
|
init_motion();
|
|
56148
56213
|
SubagentScopeView = ({ scope }) => {
|
|
56149
|
-
const [now, setNow] = (0,
|
|
56214
|
+
const [now, setNow] = (0, import_react38.useState)(() => Date.now());
|
|
56150
56215
|
const running = scope.completedAtMs == null && scope.error == null;
|
|
56151
|
-
(0,
|
|
56216
|
+
(0, import_react38.useEffect)(() => {
|
|
56152
56217
|
if (!running || !MOTION_ENABLED)
|
|
56153
56218
|
return;
|
|
56154
56219
|
const t2 = setInterval(() => setNow(Date.now()), 1e3);
|
|
@@ -56159,16 +56224,16 @@ var init_SubagentScopeView = __esm({
|
|
|
56159
56224
|
const toolPart = `${scope.toolCallCount} tool call${scope.toolCallCount === 1 ? "" : "s"}`;
|
|
56160
56225
|
const dotColor = scope.error ? Colors.danger : running ? Colors.busy : DotColors.subagent;
|
|
56161
56226
|
const state = scope.error ? "failed" : running ? "running" : "done";
|
|
56162
|
-
return (0,
|
|
56227
|
+
return (0, import_jsx_runtime17.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [(0, import_jsx_runtime17.jsxs)(Box_default, { children: [(0, import_jsx_runtime17.jsxs)(Text, { color: dotColor, children: [Glyphs.filled, " "] }), (0, import_jsx_runtime17.jsx)(Text, { bold: true, children: `agent ` }), (0, import_jsx_runtime17.jsx)(Text, { children: scope.label }), (0, import_jsx_runtime17.jsx)(Text, { dimColor: true, children: ` ${state} ${elapsed} \xB7 ${toolPart}` })] }), scope.error ? (0, import_jsx_runtime17.jsxs)(Box_default, { marginLeft: 2, children: [(0, import_jsx_runtime17.jsx)(Text, { dimColor: true, children: "\u2514 " }), (0, import_jsx_runtime17.jsx)(Text, { color: Colors.danger, children: truncate3(scope.error, 100) })] }) : scope.finalPreview && !running ? (0, import_jsx_runtime17.jsx)(Box_default, { marginLeft: 2, children: (0, import_jsx_runtime17.jsx)(Text, { dimColor: true, children: `\u2514 ${truncate3(scope.finalPreview, 100)}` }) }) : null] });
|
|
56163
56228
|
};
|
|
56164
56229
|
}
|
|
56165
56230
|
});
|
|
56166
56231
|
|
|
56167
56232
|
// ../plugin-cli/dist/components/chat/SubagentGroupView.js
|
|
56168
|
-
var
|
|
56233
|
+
var import_jsx_runtime18, LABEL_MAX, ERROR_MAX, SubagentGroupView, SubagentRow;
|
|
56169
56234
|
var init_SubagentGroupView = __esm({
|
|
56170
56235
|
async "../plugin-cli/dist/components/chat/SubagentGroupView.js"() {
|
|
56171
|
-
|
|
56236
|
+
import_jsx_runtime18 = __toESM(require_jsx_runtime());
|
|
56172
56237
|
__toESM(require_react());
|
|
56173
56238
|
await init_build2();
|
|
56174
56239
|
init_theme();
|
|
@@ -56188,9 +56253,9 @@ var init_SubagentGroupView = __esm({
|
|
|
56188
56253
|
const failTail = failed > 0 ? ` (${failed} failed)` : "";
|
|
56189
56254
|
const header = `${total} ${typeWord}${noun} ${verb}${failTail}`;
|
|
56190
56255
|
if (!expandToolOutputs) {
|
|
56191
|
-
return (0,
|
|
56256
|
+
return (0, import_jsx_runtime18.jsxs)(Box_default, { marginTop: 1, children: [(0, import_jsx_runtime18.jsxs)(Text, { color: dotColor, children: [Glyphs.filled, " "] }), (0, import_jsx_runtime18.jsx)(Text, { children: header }), (0, import_jsx_runtime18.jsx)(Text, { dimColor: true, children: " (ctrl+o to expand)" })] });
|
|
56192
56257
|
}
|
|
56193
|
-
return (0,
|
|
56258
|
+
return (0, import_jsx_runtime18.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [(0, import_jsx_runtime18.jsxs)(Box_default, { children: [(0, import_jsx_runtime18.jsxs)(Text, { color: dotColor, children: [Glyphs.filled, " "] }), (0, import_jsx_runtime18.jsx)(Text, { children: header })] }), (0, import_jsx_runtime18.jsx)(Box_default, { flexDirection: "column", marginLeft: 2, children: agents.map((a2) => (0, import_jsx_runtime18.jsx)(SubagentRow, { agent: a2 }, a2.id)) })] });
|
|
56194
56259
|
};
|
|
56195
56260
|
SubagentRow = ({ agent }) => {
|
|
56196
56261
|
const running = agent.completedAtMs == null && agent.error == null;
|
|
@@ -56198,17 +56263,17 @@ var init_SubagentGroupView = __esm({
|
|
|
56198
56263
|
const toolPart = `${agent.toolCallCount} tool use${agent.toolCallCount === 1 ? "" : "s"}`;
|
|
56199
56264
|
const statusColor = agent.error ? Colors.danger : running ? Colors.busy : DotColors.subagent;
|
|
56200
56265
|
const statusText = agent.error ? truncate3(agent.error, ERROR_MAX) : running ? "running" : "Done";
|
|
56201
|
-
return (0,
|
|
56266
|
+
return (0, import_jsx_runtime18.jsxs)(Box_default, { flexDirection: "column", children: [(0, import_jsx_runtime18.jsxs)(Box_default, { children: [(0, import_jsx_runtime18.jsx)(Text, { dimColor: true, children: "\u251C " }), (0, import_jsx_runtime18.jsx)(Text, { children: truncate3(agent.label, LABEL_MAX) }), (0, import_jsx_runtime18.jsx)(Text, { dimColor: true, children: ` \xB7 ${toolPart}` }), tokens ? (0, import_jsx_runtime18.jsx)(Text, { dimColor: true, children: ` \xB7 ${tokens} tokens` }) : null] }), (0, import_jsx_runtime18.jsxs)(Box_default, { children: [(0, import_jsx_runtime18.jsx)(Text, { dimColor: true, children: "\u2502 \u2514 " }), (0, import_jsx_runtime18.jsx)(Text, { color: statusColor, children: statusText })] })] });
|
|
56202
56267
|
};
|
|
56203
56268
|
}
|
|
56204
56269
|
});
|
|
56205
56270
|
|
|
56206
56271
|
// ../plugin-cli/dist/components/chat/CollabScopeView.js
|
|
56207
|
-
var
|
|
56272
|
+
var import_jsx_runtime19, import_react40, MAX_AGENTS, MAX_TASKS, MAX_MSGS, CollabScopeView;
|
|
56208
56273
|
var init_CollabScopeView = __esm({
|
|
56209
56274
|
async "../plugin-cli/dist/components/chat/CollabScopeView.js"() {
|
|
56210
|
-
|
|
56211
|
-
|
|
56275
|
+
import_jsx_runtime19 = __toESM(require_jsx_runtime());
|
|
56276
|
+
import_react40 = __toESM(require_react());
|
|
56212
56277
|
await init_build2();
|
|
56213
56278
|
init_theme();
|
|
56214
56279
|
init_dist7();
|
|
@@ -56217,9 +56282,9 @@ var init_CollabScopeView = __esm({
|
|
|
56217
56282
|
MAX_TASKS = 6;
|
|
56218
56283
|
MAX_MSGS = 6;
|
|
56219
56284
|
CollabScopeView = ({ scope }) => {
|
|
56220
|
-
const [now, setNow] = (0,
|
|
56285
|
+
const [now, setNow] = (0, import_react40.useState)(() => Date.now());
|
|
56221
56286
|
const running = scope.completedAtMs == null;
|
|
56222
|
-
(0,
|
|
56287
|
+
(0, import_react40.useEffect)(() => {
|
|
56223
56288
|
if (!running || !MOTION_ENABLED)
|
|
56224
56289
|
return;
|
|
56225
56290
|
const t2 = setInterval(() => setNow(Date.now()), 1e3);
|
|
@@ -56229,51 +56294,60 @@ var init_CollabScopeView = __esm({
|
|
|
56229
56294
|
const done = scope.agents.filter((a2) => a2.status === "done").length;
|
|
56230
56295
|
const state = running ? scope.control?.paused ? "paused" : "running" : scope.conflicts.length > 0 ? "done \xB7 conflicts" : "done";
|
|
56231
56296
|
const headColor = scope.conflicts.length > 0 ? Colors.danger : Colors.busy;
|
|
56232
|
-
return (0,
|
|
56297
|
+
return (0, import_jsx_runtime19.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [(0, import_jsx_runtime19.jsxs)(Box_default, { children: [(0, import_jsx_runtime19.jsxs)(Text, { color: headColor, children: [Glyphs.filled, " "] }), (0, import_jsx_runtime19.jsx)(Text, { bold: true, children: "collab " }), (0, import_jsx_runtime19.jsx)(Text, { children: truncate3(scope.task, 50) }), (0, import_jsx_runtime19.jsx)(Text, { dimColor: true, children: ` ${state} ${elapsed} \xB7 ${done}/${scope.agents.length} done` })] }), scope.fallbackReason ? (0, import_jsx_runtime19.jsx)(Box_default, { marginLeft: 2, children: (0, import_jsx_runtime19.jsx)(Text, { dimColor: true, children: `! ${truncate3(scope.fallbackReason, 90)}` }) }) : null, (0, import_jsx_runtime19.jsxs)(Box_default, { flexDirection: "column", marginLeft: 2, children: [scope.agents.slice(0, MAX_AGENTS).map((a2) => {
|
|
56233
56298
|
const glyph = a2.status === "done" ? "\u2713" : a2.status === "working" ? "\u25CF" : a2.status === "crashed" ? "\u2717" : "\u25CB";
|
|
56234
56299
|
const statusProps = a2.status === "working" ? { color: Colors.busy } : a2.status === "crashed" ? { color: Colors.danger } : { dimColor: true };
|
|
56235
|
-
return (0,
|
|
56236
|
-
}), scope.agents.length > MAX_AGENTS ? (0,
|
|
56300
|
+
return (0, import_jsx_runtime19.jsxs)(Box_default, { children: [(0, import_jsx_runtime19.jsxs)(Text, { ...statusProps, children: [glyph, " "] }), (0, import_jsx_runtime19.jsx)(Text, { children: a2.name }), (0, import_jsx_runtime19.jsx)(Text, { dimColor: true, children: ` ${a2.role} \xB7 ${a2.status}` })] }, a2.id);
|
|
56301
|
+
}), scope.agents.length > MAX_AGENTS ? (0, import_jsx_runtime19.jsx)(Text, { dimColor: true, children: ` +${scope.agents.length - MAX_AGENTS} more` }) : null] }), scope.tasks.length > 0 ? (0, import_jsx_runtime19.jsxs)(Box_default, { flexDirection: "column", marginLeft: 2, children: [(0, import_jsx_runtime19.jsx)(Text, { dimColor: true, children: `board (${scope.tasks.filter((t2) => t2.status === "done").length}/${scope.tasks.length})` }), scope.tasks.slice(0, MAX_TASKS).map((t2) => (0, import_jsx_runtime19.jsx)(Text, { dimColor: true, children: ` [${t2.status}] ${truncate3(t2.title, 40)}${t2.owner ? ` @${t2.owner}` : ""}` }, t2.id))] }) : null, scope.contracts.length > 0 ? (0, import_jsx_runtime19.jsx)(Box_default, { marginLeft: 2, children: (0, import_jsx_runtime19.jsx)(Text, { dimColor: true, children: `contracts: ${truncate3(scope.contracts.map((c2) => c2.title).join(", "), 80)}` }) }) : null, scope.messages.length > 0 ? (0, import_jsx_runtime19.jsx)(Box_default, { flexDirection: "column", marginLeft: 2, children: scope.messages.slice(-MAX_MSGS).map((m3) => (0, import_jsx_runtime19.jsx)(Text, { dimColor: true, children: ` ${m3.from} \u2192 ${m3.to}: ${truncate3(m3.body, 70)}` }, m3.id)) }) : null] });
|
|
56237
56302
|
};
|
|
56238
56303
|
}
|
|
56239
56304
|
});
|
|
56240
56305
|
|
|
56241
56306
|
// ../plugin-cli/dist/components/chat/BlockLine.js
|
|
56242
|
-
|
|
56307
|
+
function hasRunningTool(block) {
|
|
56308
|
+
if (block.kind === "tool-call")
|
|
56309
|
+
return block.outcome === null;
|
|
56310
|
+
if (block.kind === "live-tools")
|
|
56311
|
+
return block.calls.some((call) => call.outcome === null);
|
|
56312
|
+
if (block.kind === "skill-scope")
|
|
56313
|
+
return block.children.some(hasRunningTool);
|
|
56314
|
+
return false;
|
|
56315
|
+
}
|
|
56316
|
+
var import_jsx_runtime20, import_react41, NAME_DISPLAY_MAX2, BlockLine, SkillScopeView;
|
|
56243
56317
|
var init_BlockLine = __esm({
|
|
56244
56318
|
async "../plugin-cli/dist/components/chat/BlockLine.js"() {
|
|
56245
|
-
|
|
56246
|
-
|
|
56319
|
+
import_jsx_runtime20 = __toESM(require_jsx_runtime());
|
|
56320
|
+
import_react41 = __toESM(require_react());
|
|
56247
56321
|
await init_build2();
|
|
56248
|
-
init_theme();
|
|
56249
56322
|
await init_EventLine();
|
|
56250
56323
|
await init_LiveToolBlock();
|
|
56251
56324
|
await init_ToolCallBlock();
|
|
56252
56325
|
await init_SubagentScopeView();
|
|
56253
56326
|
await init_SubagentGroupView();
|
|
56254
56327
|
await init_CollabScopeView();
|
|
56328
|
+
await init_ShimmerText();
|
|
56255
56329
|
init_dist7();
|
|
56256
56330
|
NAME_DISPLAY_MAX2 = 48;
|
|
56257
|
-
BlockLine = (0,
|
|
56331
|
+
BlockLine = (0, import_react41.memo)(
|
|
56258
56332
|
function BlockLine2({ block, expandToolOutputs }) {
|
|
56259
56333
|
if (block.kind === "event")
|
|
56260
|
-
return (0,
|
|
56334
|
+
return (0, import_jsx_runtime20.jsx)(EventLine, { event: block.event, expandToolOutputs });
|
|
56261
56335
|
if (block.kind === "tool-call") {
|
|
56262
|
-
return (0,
|
|
56336
|
+
return (0, import_jsx_runtime20.jsx)(ToolCallBlock, { request: block.request, outcome: block.outcome, expanded: expandToolOutputs });
|
|
56263
56337
|
}
|
|
56264
56338
|
if (block.kind === "subagent-group") {
|
|
56265
|
-
return (0,
|
|
56339
|
+
return (0, import_jsx_runtime20.jsx)(SubagentGroupView, { group: block, expandToolOutputs });
|
|
56266
56340
|
}
|
|
56267
56341
|
if (block.kind === "subagent") {
|
|
56268
|
-
return (0,
|
|
56342
|
+
return (0, import_jsx_runtime20.jsx)(SubagentScopeView, { scope: block });
|
|
56269
56343
|
}
|
|
56270
56344
|
if (block.kind === "live-tools") {
|
|
56271
|
-
return (0,
|
|
56345
|
+
return (0, import_jsx_runtime20.jsx)(LiveToolBlock, { block, expanded: expandToolOutputs });
|
|
56272
56346
|
}
|
|
56273
56347
|
if (block.kind === "collab") {
|
|
56274
|
-
return (0,
|
|
56348
|
+
return (0, import_jsx_runtime20.jsx)(CollabScopeView, { scope: block });
|
|
56275
56349
|
}
|
|
56276
|
-
return (0,
|
|
56350
|
+
return (0, import_jsx_runtime20.jsx)(SkillScopeView, { scope: block, expandToolOutputs });
|
|
56277
56351
|
},
|
|
56278
56352
|
// Blocks are mutated in-place by `pairToolEvents` (tool outcome
|
|
56279
56353
|
// arrives, scope closes, subagent counter ticks). Compare the
|
|
@@ -56289,7 +56363,10 @@ var init_BlockLine = __esm({
|
|
|
56289
56363
|
const childToolCount = countToolCalls(scope.children);
|
|
56290
56364
|
const nameLabel = truncate3(scope.skillEvent.name, NAME_DISPLAY_MAX2);
|
|
56291
56365
|
const callLabel = `${childToolCount} tool call${childToolCount === 1 ? "" : "s"}`;
|
|
56292
|
-
|
|
56366
|
+
const active2 = !scope.closed || scope.children.some(hasRunningTool);
|
|
56367
|
+
const showChildren = active2 || expandToolOutputs;
|
|
56368
|
+
const label3 = `${active2 ? "Using" : "Used"} skill ${nameLabel}${active2 ? "\u2026" : ""}`;
|
|
56369
|
+
return (0, import_jsx_runtime20.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [(0, import_jsx_runtime20.jsxs)(Box_default, { children: [(0, import_jsx_runtime20.jsx)(Text, { dimColor: true, children: "\u2726 " }), (0, import_jsx_runtime20.jsx)(ShimmerText, { text: label3, active: active2 }), (0, import_jsx_runtime20.jsx)(Text, { dimColor: true, children: ` \xB7 ${callLabel}${showChildren ? "" : " \u203A"}` })] }), showChildren ? (0, import_jsx_runtime20.jsx)(Box_default, { flexDirection: "column", marginLeft: 2, children: scope.children.map((c2) => (0, import_jsx_runtime20.jsx)(BlockLine, { block: c2, expandToolOutputs }, c2.id)) }) : null] });
|
|
56293
56370
|
};
|
|
56294
56371
|
}
|
|
56295
56372
|
});
|
|
@@ -56323,36 +56400,36 @@ function lastNonEmptyLineShown(content, innerCols) {
|
|
|
56323
56400
|
function tailForViewport(content) {
|
|
56324
56401
|
return content;
|
|
56325
56402
|
}
|
|
56326
|
-
var
|
|
56403
|
+
var import_jsx_runtime21, import_react42, StreamingPreview;
|
|
56327
56404
|
var init_StreamingPreview = __esm({
|
|
56328
56405
|
async "../plugin-cli/dist/components/chat/StreamingPreview.js"() {
|
|
56329
|
-
|
|
56330
|
-
|
|
56406
|
+
import_jsx_runtime21 = __toESM(require_jsx_runtime());
|
|
56407
|
+
import_react42 = __toESM(require_react());
|
|
56331
56408
|
await init_build2();
|
|
56332
56409
|
init_theme();
|
|
56333
|
-
StreamingPreview = (0,
|
|
56410
|
+
StreamingPreview = (0, import_react42.memo)(function StreamingPreview2({ content, dim }) {
|
|
56334
56411
|
const cols = process.stdout.columns ?? 80;
|
|
56335
56412
|
const innerCols = Math.max(20, cols - 4);
|
|
56336
56413
|
const shown = lastNonEmptyLineShown(content, innerCols);
|
|
56337
|
-
return (0,
|
|
56414
|
+
return (0, import_jsx_runtime21.jsxs)(Box_default, { flexDirection: "row", marginTop: 1, children: [(0, import_jsx_runtime21.jsx)(Box_default, { marginRight: 1, children: (0, import_jsx_runtime21.jsx)(Text, { dimColor: true, children: Glyphs.filled }) }), (0, import_jsx_runtime21.jsx)(Text, { dimColor: dim, children: shown || " " })] });
|
|
56338
56415
|
});
|
|
56339
56416
|
}
|
|
56340
56417
|
});
|
|
56341
56418
|
|
|
56342
56419
|
// ../plugin-cli/dist/components/ChatView.js
|
|
56343
|
-
var
|
|
56420
|
+
var import_jsx_runtime22, import_react43, ChatView;
|
|
56344
56421
|
var init_ChatView = __esm({
|
|
56345
56422
|
async "../plugin-cli/dist/components/ChatView.js"() {
|
|
56346
|
-
|
|
56347
|
-
|
|
56423
|
+
import_jsx_runtime22 = __toESM(require_jsx_runtime());
|
|
56424
|
+
import_react43 = __toESM(require_react());
|
|
56348
56425
|
await init_build2();
|
|
56349
56426
|
await init_BlockLine();
|
|
56350
56427
|
init_dist7();
|
|
56351
56428
|
await init_StreamingPreview();
|
|
56352
56429
|
ChatView = ({ events, streamingDelta, reasoningDelta, expandToolOutputs, compactTools, hideLive }) => {
|
|
56353
|
-
const foldRef = (0,
|
|
56354
|
-
const compactRef = (0,
|
|
56355
|
-
const blocks = (0,
|
|
56430
|
+
const foldRef = (0, import_react43.useRef)(null);
|
|
56431
|
+
const compactRef = (0, import_react43.useRef)(void 0);
|
|
56432
|
+
const blocks = (0, import_react43.useMemo)(() => {
|
|
56356
56433
|
if (typeof IncrementalFold !== "function")
|
|
56357
56434
|
return pairToolEvents(events, compactTools);
|
|
56358
56435
|
if (!foldRef.current || compactRef.current !== compactTools) {
|
|
@@ -56361,8 +56438,8 @@ var init_ChatView = __esm({
|
|
|
56361
56438
|
}
|
|
56362
56439
|
return foldRef.current.syncTo(events).slice();
|
|
56363
56440
|
}, [events, compactTools]);
|
|
56364
|
-
const settledRef = (0,
|
|
56365
|
-
const clearGenerationRef = (0,
|
|
56441
|
+
const settledRef = (0, import_react43.useRef)([]);
|
|
56442
|
+
const clearGenerationRef = (0, import_react43.useRef)(0);
|
|
56366
56443
|
if (blocks.length < settledRef.current.length) {
|
|
56367
56444
|
settledRef.current = [];
|
|
56368
56445
|
clearGenerationRef.current += 1;
|
|
@@ -56382,57 +56459,57 @@ var init_ChatView = __esm({
|
|
|
56382
56459
|
settledRef.current = next;
|
|
56383
56460
|
}
|
|
56384
56461
|
const liveBlocks = blocks.slice(settledRef.current.length);
|
|
56385
|
-
return (0,
|
|
56462
|
+
return (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [(0, import_jsx_runtime22.jsx)(Static, { items: settledRef.current, children: (block) => (0, import_jsx_runtime22.jsx)(BlockLine, { block, expandToolOutputs: !!expandToolOutputs }, block.id) }, clearGenerationRef.current), hideLive ? null : (0, import_jsx_runtime22.jsxs)(Box_default, { flexDirection: "column", children: [liveBlocks.map((b3) => (0, import_jsx_runtime22.jsx)(BlockLine, { block: b3, expandToolOutputs: !!expandToolOutputs }, b3.id)), streamingDelta && streamingDelta.trim() ? (0, import_jsx_runtime22.jsx)(StreamingPreview, { content: tailForViewport(streamingDelta) }) : reasoningDelta && reasoningDelta.trim() ? (
|
|
56386
56463
|
// Dim live-thinking preview, only while there's no assistant text
|
|
56387
56464
|
// yet. Prefix lands on the same single visual row as the content
|
|
56388
56465
|
// tail, preserving StreamingPreview's no-stacking invariant.
|
|
56389
|
-
(0,
|
|
56466
|
+
(0, import_jsx_runtime22.jsx)(StreamingPreview, { content: `thinking \xB7 ${tailForViewport(reasoningDelta)}`, dim: true })
|
|
56390
56467
|
) : null] })] });
|
|
56391
56468
|
};
|
|
56392
56469
|
}
|
|
56393
56470
|
});
|
|
56394
56471
|
|
|
56395
56472
|
// ../plugin-cli/dist/components/Spinner.js
|
|
56396
|
-
var
|
|
56473
|
+
var import_jsx_runtime23, import_react44, FRAMES, Spinner;
|
|
56397
56474
|
var init_Spinner = __esm({
|
|
56398
56475
|
async "../plugin-cli/dist/components/Spinner.js"() {
|
|
56399
|
-
|
|
56400
|
-
|
|
56476
|
+
import_jsx_runtime23 = __toESM(require_jsx_runtime());
|
|
56477
|
+
import_react44 = __toESM(require_react());
|
|
56401
56478
|
await init_build2();
|
|
56402
56479
|
init_motion();
|
|
56403
56480
|
FRAMES = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
|
|
56404
56481
|
Spinner = ({ label: label3, color = "cyan", intervalMs = 80 }) => {
|
|
56405
|
-
const [frame, setFrame] = (0,
|
|
56406
|
-
(0,
|
|
56482
|
+
const [frame, setFrame] = (0, import_react44.useState)(0);
|
|
56483
|
+
(0, import_react44.useEffect)(() => {
|
|
56407
56484
|
if (!MOTION_ENABLED)
|
|
56408
56485
|
return;
|
|
56409
56486
|
const t2 = setInterval(() => setFrame((f3) => (f3 + 1) % FRAMES.length), intervalMs);
|
|
56410
56487
|
return () => clearInterval(t2);
|
|
56411
56488
|
}, [intervalMs]);
|
|
56412
56489
|
const glyph = FRAMES[frame];
|
|
56413
|
-
return (0,
|
|
56490
|
+
return (0, import_jsx_runtime23.jsxs)(Text, { color, children: [glyph, label3 ? ` ${label3}` : ""] });
|
|
56414
56491
|
};
|
|
56415
56492
|
}
|
|
56416
56493
|
});
|
|
56417
56494
|
|
|
56418
56495
|
// ../plugin-cli/dist/components/ModeFooter.js
|
|
56419
|
-
var
|
|
56496
|
+
var import_jsx_runtime24, ModeFooter;
|
|
56420
56497
|
var init_ModeFooter = __esm({
|
|
56421
56498
|
async "../plugin-cli/dist/components/ModeFooter.js"() {
|
|
56422
|
-
|
|
56499
|
+
import_jsx_runtime24 = __toESM(require_jsx_runtime());
|
|
56423
56500
|
__toESM(require_react());
|
|
56424
56501
|
await init_build2();
|
|
56425
56502
|
init_theme();
|
|
56426
|
-
ModeFooter = ({ modeName }) => (0,
|
|
56503
|
+
ModeFooter = ({ modeName }) => (0, import_jsx_runtime24.jsxs)(Box_default, { children: [(0, import_jsx_runtime24.jsx)(Text, { color: Colors.mode, children: "\u25B8\u25B8 " }), (0, import_jsx_runtime24.jsxs)(Text, { color: Colors.mode, bold: true, children: ["mode: ", modeName] }), (0, import_jsx_runtime24.jsx)(Text, { color: Colors.chrome, dimColor: true, children: " (shift+tab to change)" })] });
|
|
56427
56504
|
}
|
|
56428
56505
|
});
|
|
56429
56506
|
|
|
56430
56507
|
// ../plugin-cli/dist/components/StatusLine.js
|
|
56431
|
-
var
|
|
56508
|
+
var import_jsx_runtime25, import_react46, StatusLine, ProviderBadge, ModeBadgePill, BusyMarker, CONTEXT_BAR_WIDTH, ContextMeter;
|
|
56432
56509
|
var init_StatusLine = __esm({
|
|
56433
56510
|
async "../plugin-cli/dist/components/StatusLine.js"() {
|
|
56434
|
-
|
|
56435
|
-
|
|
56511
|
+
import_jsx_runtime25 = __toESM(require_jsx_runtime());
|
|
56512
|
+
import_react46 = __toESM(require_react());
|
|
56436
56513
|
await init_build2();
|
|
56437
56514
|
init_dist7();
|
|
56438
56515
|
init_theme();
|
|
@@ -56444,25 +56521,25 @@ var init_StatusLine = __esm({
|
|
|
56444
56521
|
const showQueue = (queueCount ?? 0) > 0;
|
|
56445
56522
|
const showMcp = !!(mcp && mcp.enabled > 0);
|
|
56446
56523
|
const showCtx = !!(contextWindow && contextWindow > 0);
|
|
56447
|
-
const queuedTail = showQueue ? (0,
|
|
56448
|
-
return (0,
|
|
56524
|
+
const queuedTail = showQueue ? (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [(0, import_jsx_runtime25.jsx)(Text, { dimColor: true, children: " " }), (0, import_jsx_runtime25.jsx)(Text, { dimColor: true, children: `${Glyphs.contextUp} ${queueCount} queued` })] }) : null;
|
|
56525
|
+
return (0, import_jsx_runtime25.jsxs)(Box_default, { justifyContent: "space-between", children: [(0, import_jsx_runtime25.jsx)(Box_default, { children: modeBadge ? (
|
|
56449
56526
|
// Badged (autonomous) mode: the pill is pinned left at all times,
|
|
56450
56527
|
// with the busy marker / idle hint trailing it — so the user always
|
|
56451
56528
|
// sees the mode even mid-run, when a plain footer would be hidden.
|
|
56452
|
-
(0,
|
|
56453
|
-
) : busy2 ? (0,
|
|
56529
|
+
(0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [(0, import_jsx_runtime25.jsx)(ModeBadgePill, { badge: modeBadge }), (0, import_jsx_runtime25.jsx)(Text, { children: " " }), busy2 ? (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [(0, import_jsx_runtime25.jsx)(BusyMarker, { startedAt: busyStartedAt }), queuedTail] }) : (0, import_jsx_runtime25.jsx)(Text, { color: Colors.chrome, dimColor: true, children: "Esc stops \xB7 shift+tab to change" })] })
|
|
56530
|
+
) : busy2 ? (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [(0, import_jsx_runtime25.jsx)(BusyMarker, { startedAt: busyStartedAt }), queuedTail] }) : (0, import_jsx_runtime25.jsx)(ModeFooter, { modeName }) }), (0, import_jsx_runtime25.jsxs)(Box_default, { children: [(0, import_jsx_runtime25.jsx)(ProviderBadge, { name: provider }), (0, import_jsx_runtime25.jsx)(Text, { dimColor: true, children: ` ${model}` }), showMcp ? (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [(0, import_jsx_runtime25.jsx)(Text, { dimColor: true, children: ` ${Glyphs.midDot} ` }), (0, import_jsx_runtime25.jsx)(Text, { dimColor: true, children: "mcp " }), (0, import_jsx_runtime25.jsx)(Text, { children: `${mcp.connected}/${mcp.enabled}` })] }) : null, showCtx ? (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [(0, import_jsx_runtime25.jsx)(Text, { dimColor: true, children: ` ${Glyphs.midDot} ` }), (0, import_jsx_runtime25.jsx)(ContextMeter, { used: contextUsed ?? 0, total: contextWindow })] }) : null, version ? (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [(0, import_jsx_runtime25.jsx)(Text, { dimColor: true, children: ` ${Glyphs.midDot} ` }), updateLatest ? (0, import_jsx_runtime25.jsx)(Text, { color: "yellow", children: `v${version} ${Glyphs.contextUp}${updateLatest}` }) : (0, import_jsx_runtime25.jsx)(Text, { dimColor: true, children: `v${version}` })] }) : null] })] });
|
|
56454
56531
|
};
|
|
56455
|
-
ProviderBadge = ({ name }) => (0,
|
|
56456
|
-
ModeBadgePill = ({ badge }) => (0,
|
|
56532
|
+
ProviderBadge = ({ name }) => (0, import_jsx_runtime25.jsx)(Text, { backgroundColor: Colors.chrome, color: "black", bold: true, children: ` ${name} ` });
|
|
56533
|
+
ModeBadgePill = ({ badge }) => (0, import_jsx_runtime25.jsx)(Text, { backgroundColor: badgeBackground(badge.tone), color: "black", bold: true, children: ` ${badgeMarker(badge.tone)}${badge.label} ` });
|
|
56457
56534
|
BusyMarker = ({ startedAt }) => {
|
|
56458
|
-
const [now, setNow] = (0,
|
|
56459
|
-
(0,
|
|
56535
|
+
const [now, setNow] = (0, import_react46.useState)(() => Date.now());
|
|
56536
|
+
(0, import_react46.useEffect)(() => {
|
|
56460
56537
|
if (!MOTION_ENABLED)
|
|
56461
56538
|
return;
|
|
56462
56539
|
const t2 = setInterval(() => setNow(Date.now()), 1e3);
|
|
56463
56540
|
return () => clearInterval(t2);
|
|
56464
56541
|
}, []);
|
|
56465
|
-
return (0,
|
|
56542
|
+
return (0, import_jsx_runtime25.jsxs)(Box_default, { children: [(0, import_jsx_runtime25.jsx)(Spinner, { color: Colors.busy }), (0, import_jsx_runtime25.jsx)(Text, { color: Colors.busy, children: " Thinking" }), (0, import_jsx_runtime25.jsx)(Text, { dimColor: true, children: ` [${formatElapsed(now - startedAt)}]` })] });
|
|
56466
56543
|
};
|
|
56467
56544
|
CONTEXT_BAR_WIDTH = 10;
|
|
56468
56545
|
ContextMeter = ({ used, total }) => {
|
|
@@ -56470,7 +56547,7 @@ var init_StatusLine = __esm({
|
|
|
56470
56547
|
const color = contextColor(pct2);
|
|
56471
56548
|
const filled = Math.round(pct2 / 100 * CONTEXT_BAR_WIDTH);
|
|
56472
56549
|
const empty = CONTEXT_BAR_WIDTH - filled;
|
|
56473
|
-
return (0,
|
|
56550
|
+
return (0, import_jsx_runtime25.jsxs)(Box_default, { children: [(0, import_jsx_runtime25.jsx)(Text, { ...color ? { color } : {}, children: "\u2588".repeat(filled) }), (0, import_jsx_runtime25.jsx)(Text, { dimColor: true, children: "\u2591".repeat(empty) }), (0, import_jsx_runtime25.jsx)(Text, { ...color ? { color } : { dimColor: true }, children: ` ${pct2}%${contextMarker(pct2)}` })] });
|
|
56474
56551
|
};
|
|
56475
56552
|
}
|
|
56476
56553
|
});
|
|
@@ -56701,8 +56778,8 @@ var init_helpers = __esm({
|
|
|
56701
56778
|
|
|
56702
56779
|
// ../plugin-cli/dist/session/use-mcp-status.js
|
|
56703
56780
|
function useMcpStatus(session) {
|
|
56704
|
-
const [mcpStatus, setMcpStatus] = (0,
|
|
56705
|
-
const probeMcpStatus =
|
|
56781
|
+
const [mcpStatus, setMcpStatus] = (0, import_react47.useState)({ connected: 0, enabled: 0 });
|
|
56782
|
+
const probeMcpStatus = import_react47.default.useCallback(async () => {
|
|
56706
56783
|
const api = session.mcpAdmin;
|
|
56707
56784
|
if (!api?.listServers)
|
|
56708
56785
|
return 0;
|
|
@@ -56718,10 +56795,10 @@ function useMcpStatus(session) {
|
|
|
56718
56795
|
return 0;
|
|
56719
56796
|
}
|
|
56720
56797
|
}, [session]);
|
|
56721
|
-
const refreshMcpStatus =
|
|
56798
|
+
const refreshMcpStatus = import_react47.default.useCallback(async () => {
|
|
56722
56799
|
await probeMcpStatus();
|
|
56723
56800
|
}, [probeMcpStatus]);
|
|
56724
|
-
(0,
|
|
56801
|
+
(0, import_react47.useEffect)(() => {
|
|
56725
56802
|
let timer = null;
|
|
56726
56803
|
let cancelled = false;
|
|
56727
56804
|
void (async () => {
|
|
@@ -56738,10 +56815,10 @@ function useMcpStatus(session) {
|
|
|
56738
56815
|
}, [probeMcpStatus]);
|
|
56739
56816
|
return { mcpStatus, refreshMcpStatus };
|
|
56740
56817
|
}
|
|
56741
|
-
var
|
|
56818
|
+
var import_react47;
|
|
56742
56819
|
var init_use_mcp_status = __esm({
|
|
56743
56820
|
"../plugin-cli/dist/session/use-mcp-status.js"() {
|
|
56744
|
-
|
|
56821
|
+
import_react47 = __toESM(require_react());
|
|
56745
56822
|
}
|
|
56746
56823
|
});
|
|
56747
56824
|
|
|
@@ -56751,14 +56828,14 @@ function seedFromLog(log) {
|
|
|
56751
56828
|
return held.length > MAX_RENDERED_EVENTS ? held.slice(held.length - MAX_RENDERED_EVENTS) : held;
|
|
56752
56829
|
}
|
|
56753
56830
|
function useEventStream(session) {
|
|
56754
|
-
const [events, setEvents] = (0,
|
|
56755
|
-
const [streamingDelta, setStreamingDelta] = (0,
|
|
56756
|
-
const streamingBufferRef = (0,
|
|
56757
|
-
const streamFlushRef = (0,
|
|
56758
|
-
const [reasoningDelta, setReasoningDelta] = (0,
|
|
56759
|
-
const reasoningBufferRef = (0,
|
|
56760
|
-
const reasoningFlushRef = (0,
|
|
56761
|
-
const scheduleStreamFlush =
|
|
56831
|
+
const [events, setEvents] = (0, import_react48.useState)([]);
|
|
56832
|
+
const [streamingDelta, setStreamingDelta] = (0, import_react48.useState)("");
|
|
56833
|
+
const streamingBufferRef = (0, import_react48.useRef)("");
|
|
56834
|
+
const streamFlushRef = (0, import_react48.useRef)(null);
|
|
56835
|
+
const [reasoningDelta, setReasoningDelta] = (0, import_react48.useState)("");
|
|
56836
|
+
const reasoningBufferRef = (0, import_react48.useRef)("");
|
|
56837
|
+
const reasoningFlushRef = (0, import_react48.useRef)(null);
|
|
56838
|
+
const scheduleStreamFlush = import_react48.default.useCallback(() => {
|
|
56762
56839
|
if (streamFlushRef.current)
|
|
56763
56840
|
return;
|
|
56764
56841
|
streamFlushRef.current = setTimeout(() => {
|
|
@@ -56766,7 +56843,7 @@ function useEventStream(session) {
|
|
|
56766
56843
|
setStreamingDelta(streamingBufferRef.current);
|
|
56767
56844
|
}, 33);
|
|
56768
56845
|
}, []);
|
|
56769
|
-
const scheduleReasoningFlush =
|
|
56846
|
+
const scheduleReasoningFlush = import_react48.default.useCallback(() => {
|
|
56770
56847
|
if (reasoningFlushRef.current)
|
|
56771
56848
|
return;
|
|
56772
56849
|
reasoningFlushRef.current = setTimeout(() => {
|
|
@@ -56774,7 +56851,7 @@ function useEventStream(session) {
|
|
|
56774
56851
|
setReasoningDelta(reasoningBufferRef.current);
|
|
56775
56852
|
}, 33);
|
|
56776
56853
|
}, []);
|
|
56777
|
-
const cancelStreamFlush =
|
|
56854
|
+
const cancelStreamFlush = import_react48.default.useCallback(() => {
|
|
56778
56855
|
if (streamFlushRef.current) {
|
|
56779
56856
|
clearTimeout(streamFlushRef.current);
|
|
56780
56857
|
streamFlushRef.current = null;
|
|
@@ -56784,12 +56861,12 @@ function useEventStream(session) {
|
|
|
56784
56861
|
reasoningFlushRef.current = null;
|
|
56785
56862
|
}
|
|
56786
56863
|
}, []);
|
|
56787
|
-
(0,
|
|
56864
|
+
(0, import_react48.useEffect)(() => {
|
|
56788
56865
|
return () => {
|
|
56789
56866
|
cancelStreamFlush();
|
|
56790
56867
|
};
|
|
56791
56868
|
}, [cancelStreamFlush]);
|
|
56792
|
-
(0,
|
|
56869
|
+
(0, import_react48.useEffect)(() => {
|
|
56793
56870
|
setEvents(seedFromLog(session.log));
|
|
56794
56871
|
const unsub = session.log.subscribe((event) => {
|
|
56795
56872
|
if (event.type === "assistant_chunk") {
|
|
@@ -56830,10 +56907,10 @@ function useEventStream(session) {
|
|
|
56830
56907
|
cancelStreamFlush
|
|
56831
56908
|
};
|
|
56832
56909
|
}
|
|
56833
|
-
var
|
|
56910
|
+
var import_react48, MAX_RENDERED_EVENTS;
|
|
56834
56911
|
var init_use_event_stream = __esm({
|
|
56835
56912
|
"../plugin-cli/dist/session/use-event-stream.js"() {
|
|
56836
|
-
|
|
56913
|
+
import_react48 = __toESM(require_react());
|
|
56837
56914
|
MAX_RENDERED_EVENTS = 5e3;
|
|
56838
56915
|
}
|
|
56839
56916
|
});
|
|
@@ -57047,8 +57124,8 @@ var init_clipboard_image = __esm({
|
|
|
57047
57124
|
|
|
57048
57125
|
// ../plugin-cli/dist/session/use-image-attachments.js
|
|
57049
57126
|
function useImageAttachments(onError2) {
|
|
57050
|
-
const imageAttachmentsRef = (0,
|
|
57051
|
-
const nextImageIdRef = (0,
|
|
57127
|
+
const imageAttachmentsRef = (0, import_react49.useRef)(/* @__PURE__ */ new Map());
|
|
57128
|
+
const nextImageIdRef = (0, import_react49.useRef)(1);
|
|
57052
57129
|
const registerImage = (detected) => {
|
|
57053
57130
|
if (!detected)
|
|
57054
57131
|
return "";
|
|
@@ -57100,10 +57177,10 @@ function useImageAttachments(onError2) {
|
|
|
57100
57177
|
};
|
|
57101
57178
|
return { registerImage, handlePasteText, resolveAttachments };
|
|
57102
57179
|
}
|
|
57103
|
-
var
|
|
57180
|
+
var import_react49;
|
|
57104
57181
|
var init_use_image_attachments = __esm({
|
|
57105
57182
|
"../plugin-cli/dist/session/use-image-attachments.js"() {
|
|
57106
|
-
|
|
57183
|
+
import_react49 = __toESM(require_react());
|
|
57107
57184
|
init_image_attachments();
|
|
57108
57185
|
init_clipboard_image();
|
|
57109
57186
|
}
|
|
@@ -57111,18 +57188,18 @@ var init_use_image_attachments = __esm({
|
|
|
57111
57188
|
|
|
57112
57189
|
// ../plugin-cli/dist/session/use-turn-runner.js
|
|
57113
57190
|
function useTurnRunner(opts) {
|
|
57114
|
-
const [busy2, setBusy] = (0,
|
|
57115
|
-
const [busyStartedAt, setBusyStartedAt] = (0,
|
|
57116
|
-
const queueRef = (0,
|
|
57117
|
-
const [queueCount, setQueueCount] = (0,
|
|
57118
|
-
const [priorityMessage, setPriorityMessage] = (0,
|
|
57119
|
-
const priorityRef = (0,
|
|
57191
|
+
const [busy2, setBusy] = (0, import_react50.useState)(false);
|
|
57192
|
+
const [busyStartedAt, setBusyStartedAt] = (0, import_react50.useState)(null);
|
|
57193
|
+
const queueRef = (0, import_react50.useRef)([]);
|
|
57194
|
+
const [queueCount, setQueueCount] = (0, import_react50.useState)(0);
|
|
57195
|
+
const [priorityMessage, setPriorityMessage] = (0, import_react50.useState)(null);
|
|
57196
|
+
const priorityRef = (0, import_react50.useRef)(null);
|
|
57120
57197
|
const setPriority = (value) => {
|
|
57121
57198
|
priorityRef.current = value;
|
|
57122
57199
|
setPriorityMessage(value);
|
|
57123
57200
|
};
|
|
57124
|
-
const busyRef = (0,
|
|
57125
|
-
const turnControllerRef = (0,
|
|
57201
|
+
const busyRef = (0, import_react50.useRef)(false);
|
|
57202
|
+
const turnControllerRef = (0, import_react50.useRef)(null);
|
|
57126
57203
|
const runTurnWith = async (text, attachments) => {
|
|
57127
57204
|
setBusy(true);
|
|
57128
57205
|
busyRef.current = true;
|
|
@@ -57211,10 +57288,10 @@ function useTurnRunner(opts) {
|
|
|
57211
57288
|
setPriority
|
|
57212
57289
|
};
|
|
57213
57290
|
}
|
|
57214
|
-
var
|
|
57291
|
+
var import_react50, MAX_DRAIN_MESSAGES, MAX_DRAIN_CHARS;
|
|
57215
57292
|
var init_use_turn_runner = __esm({
|
|
57216
57293
|
"../plugin-cli/dist/session/use-turn-runner.js"() {
|
|
57217
|
-
|
|
57294
|
+
import_react50 = __toESM(require_react());
|
|
57218
57295
|
MAX_DRAIN_MESSAGES = 50;
|
|
57219
57296
|
MAX_DRAIN_CHARS = 2e5;
|
|
57220
57297
|
}
|
|
@@ -57222,10 +57299,10 @@ var init_use_turn_runner = __esm({
|
|
|
57222
57299
|
|
|
57223
57300
|
// ../plugin-cli/dist/session/use-permission-queue.js
|
|
57224
57301
|
function usePermissionQueue(session, registerInteractiveResolver) {
|
|
57225
|
-
const [pendingPermissions, setPendingPermissions] = (0,
|
|
57226
|
-
const [pendingApproval, setPendingApproval] = (0,
|
|
57227
|
-
const yoloRef = (0,
|
|
57228
|
-
(0,
|
|
57302
|
+
const [pendingPermissions, setPendingPermissions] = (0, import_react51.useState)([]);
|
|
57303
|
+
const [pendingApproval, setPendingApproval] = (0, import_react51.useState)(null);
|
|
57304
|
+
const yoloRef = (0, import_react51.useRef)(false);
|
|
57305
|
+
(0, import_react51.useEffect)(() => {
|
|
57229
57306
|
registerInteractiveResolver(async (call, ctx) => {
|
|
57230
57307
|
if (yoloRef.current) {
|
|
57231
57308
|
return { mode: "allow", reason: "yolo mode" };
|
|
@@ -57253,10 +57330,10 @@ function usePermissionQueue(session, registerInteractiveResolver) {
|
|
|
57253
57330
|
yoloRef
|
|
57254
57331
|
};
|
|
57255
57332
|
}
|
|
57256
|
-
var
|
|
57333
|
+
var import_react51;
|
|
57257
57334
|
var init_use_permission_queue = __esm({
|
|
57258
57335
|
"../plugin-cli/dist/session/use-permission-queue.js"() {
|
|
57259
|
-
|
|
57336
|
+
import_react51 = __toESM(require_react());
|
|
57260
57337
|
}
|
|
57261
57338
|
});
|
|
57262
57339
|
|
|
@@ -57469,19 +57546,19 @@ function useVoiceInput(opts) {
|
|
|
57469
57546
|
const { session, setSystemNotice } = opts;
|
|
57470
57547
|
const startRecording = opts.startRecording ?? startVoiceRecording;
|
|
57471
57548
|
const checkCaptureAvailable = opts.checkCaptureAvailable ?? checkVoiceCaptureAvailable;
|
|
57472
|
-
const phaseRef = (0,
|
|
57473
|
-
const [phase, setPhase] = (0,
|
|
57474
|
-
const setVoicePhase = (0,
|
|
57549
|
+
const phaseRef = (0, import_react52.useRef)("idle");
|
|
57550
|
+
const [phase, setPhase] = (0, import_react52.useState)("idle");
|
|
57551
|
+
const setVoicePhase = (0, import_react52.useCallback)((next) => {
|
|
57475
57552
|
phaseRef.current = next;
|
|
57476
57553
|
setPhase(next);
|
|
57477
57554
|
}, []);
|
|
57478
|
-
const recordingRef = (0,
|
|
57479
|
-
const insertIdRef = (0,
|
|
57480
|
-
const [externalInsert, setExternalInsert] = (0,
|
|
57481
|
-
const [captureReadiness, setCaptureReadiness] = (0,
|
|
57555
|
+
const recordingRef = (0, import_react52.useRef)(null);
|
|
57556
|
+
const insertIdRef = (0, import_react52.useRef)(0);
|
|
57557
|
+
const [externalInsert, setExternalInsert] = (0, import_react52.useState)();
|
|
57558
|
+
const [captureReadiness, setCaptureReadiness] = (0, import_react52.useState)(() => unavailableVoiceCaptureCheck());
|
|
57482
57559
|
const readiness = combineVoiceInputReadiness(checkCodexVoiceInputReady(session), captureReadiness);
|
|
57483
57560
|
const ready = readiness.ready;
|
|
57484
|
-
(0,
|
|
57561
|
+
(0, import_react52.useEffect)(() => {
|
|
57485
57562
|
let cancelled = false;
|
|
57486
57563
|
void (async () => {
|
|
57487
57564
|
try {
|
|
@@ -57497,7 +57574,7 @@ function useVoiceInput(opts) {
|
|
|
57497
57574
|
cancelled = true;
|
|
57498
57575
|
};
|
|
57499
57576
|
}, [checkCaptureAvailable]);
|
|
57500
|
-
(0,
|
|
57577
|
+
(0, import_react52.useEffect)(() => {
|
|
57501
57578
|
return () => {
|
|
57502
57579
|
const recording = recordingRef.current;
|
|
57503
57580
|
recordingRef.current = null;
|
|
@@ -57505,7 +57582,7 @@ function useVoiceInput(opts) {
|
|
|
57505
57582
|
});
|
|
57506
57583
|
};
|
|
57507
57584
|
}, []);
|
|
57508
|
-
const toggleVoiceInput = (0,
|
|
57585
|
+
const toggleVoiceInput = (0, import_react52.useCallback)(() => {
|
|
57509
57586
|
void (async () => {
|
|
57510
57587
|
if (phaseRef.current === "transcribing") {
|
|
57511
57588
|
setSystemNotice("voice: transcription is still running");
|
|
@@ -57629,10 +57706,10 @@ function formatVoiceError(err) {
|
|
|
57629
57706
|
return `voice: ${message}`;
|
|
57630
57707
|
return `voice: ${message || "failed"}`;
|
|
57631
57708
|
}
|
|
57632
|
-
var
|
|
57709
|
+
var import_react52, CODEX_TRANSCRIBER_NAME;
|
|
57633
57710
|
var init_use_voice_input = __esm({
|
|
57634
57711
|
"../plugin-cli/dist/session/use-voice-input.js"() {
|
|
57635
|
-
|
|
57712
|
+
import_react52 = __toESM(require_react());
|
|
57636
57713
|
init_voice_input();
|
|
57637
57714
|
CODEX_TRANSCRIBER_NAME = "openai-codex-transcribe";
|
|
57638
57715
|
}
|
|
@@ -58194,21 +58271,21 @@ ${READ_ALOUD_NO_SYNTH_HINT}`;
|
|
|
58194
58271
|
// ../plugin-cli/dist/session/use-read-aloud.js
|
|
58195
58272
|
function useReadAloud(opts) {
|
|
58196
58273
|
const { session, setSystemNotice } = opts;
|
|
58197
|
-
const ref = (0,
|
|
58274
|
+
const ref = (0, import_react53.useRef)(null);
|
|
58198
58275
|
if (ref.current === null) {
|
|
58199
58276
|
ref.current = createReadAloud({ session, setSystemNotice });
|
|
58200
58277
|
}
|
|
58201
|
-
(0,
|
|
58278
|
+
(0, import_react53.useEffect)(() => {
|
|
58202
58279
|
return () => {
|
|
58203
58280
|
ref.current?.dispose();
|
|
58204
58281
|
};
|
|
58205
58282
|
}, []);
|
|
58206
58283
|
return ref.current;
|
|
58207
58284
|
}
|
|
58208
|
-
var
|
|
58285
|
+
var import_react53;
|
|
58209
58286
|
var init_use_read_aloud = __esm({
|
|
58210
58287
|
"../plugin-cli/dist/session/use-read-aloud.js"() {
|
|
58211
|
-
|
|
58288
|
+
import_react53 = __toESM(require_react());
|
|
58212
58289
|
init_read_aloud();
|
|
58213
58290
|
}
|
|
58214
58291
|
});
|
|
@@ -73597,10 +73674,10 @@ function composeHints({ hints, hasClose, tabsNavigable }) {
|
|
|
73597
73674
|
return null;
|
|
73598
73675
|
return parts.join(" \xB7 ");
|
|
73599
73676
|
}
|
|
73600
|
-
var
|
|
73677
|
+
var import_jsx_runtime26, Modal, ACTIVE_TAB_BG, ACTIVE_TAB_FG, INACTIVE_TAB_FG, HeaderBand;
|
|
73601
73678
|
var init_Modal = __esm({
|
|
73602
73679
|
async "../plugin-cli/dist/components/Modal.js"() {
|
|
73603
|
-
|
|
73680
|
+
import_jsx_runtime26 = __toESM(require_jsx_runtime());
|
|
73604
73681
|
__toESM(require_react());
|
|
73605
73682
|
await init_build2();
|
|
73606
73683
|
init_theme();
|
|
@@ -73624,7 +73701,7 @@ var init_Modal = __esm({
|
|
|
73624
73701
|
}
|
|
73625
73702
|
}, { isActive: !!(onClose || tabsNavigable) });
|
|
73626
73703
|
const composedHints = composeHints({ hints, hasClose: !!onClose, tabsNavigable });
|
|
73627
|
-
return (0,
|
|
73704
|
+
return (0, import_jsx_runtime26.jsx)(Box_default, { width: "100%", marginTop: 1, children: (0, import_jsx_runtime26.jsxs)(Box_default, { flexDirection: "column", width: "100%", borderStyle: Border.style, borderColor: Border.color, borderDimColor: Border.dim, children: [(0, import_jsx_runtime26.jsx)(HeaderBand, { title, tabs, activeTabId }), (0, import_jsx_runtime26.jsxs)(Box_default, { flexDirection: "column", paddingX: 1, children: [subtitle ? (0, import_jsx_runtime26.jsx)(Box_default, { marginTop: 1, children: (0, import_jsx_runtime26.jsx)(Text, { dimColor: true, children: subtitle }) }) : null, (0, import_jsx_runtime26.jsx)(Box_default, { flexDirection: "column", marginTop: 1, children }), composedHints ? (0, import_jsx_runtime26.jsx)(Box_default, { marginTop: 1, children: (0, import_jsx_runtime26.jsx)(Text, { dimColor: true, children: composedHints }) }) : null] })] }) });
|
|
73628
73705
|
};
|
|
73629
73706
|
ACTIVE_TAB_BG = "white";
|
|
73630
73707
|
ACTIVE_TAB_FG = "black";
|
|
@@ -73634,21 +73711,21 @@ var init_Modal = __esm({
|
|
|
73634
73711
|
if (tabs && tabs.length > 0) {
|
|
73635
73712
|
tabs.forEach((tab2, i2) => {
|
|
73636
73713
|
if (i2 > 0)
|
|
73637
|
-
tabNodes.push((0,
|
|
73714
|
+
tabNodes.push((0, import_jsx_runtime26.jsx)(Text, { children: " " }, `gap-${tab2.id}`));
|
|
73638
73715
|
const focused = tab2.id === activeTabId;
|
|
73639
|
-
tabNodes.push(focused ? (0,
|
|
73716
|
+
tabNodes.push(focused ? (0, import_jsx_runtime26.jsx)(Text, { backgroundColor: ACTIVE_TAB_BG, color: ACTIVE_TAB_FG, bold: true, children: ` ${tab2.label} ` }, tab2.id) : (0, import_jsx_runtime26.jsx)(Text, { color: INACTIVE_TAB_FG, children: tab2.label }, tab2.id));
|
|
73640
73717
|
});
|
|
73641
73718
|
}
|
|
73642
|
-
return (0,
|
|
73719
|
+
return (0, import_jsx_runtime26.jsxs)(Box_default, { width: "100%", paddingX: 1, marginTop: 1, children: [(0, import_jsx_runtime26.jsx)(Text, { color: "white", bold: true, children: title }), tabNodes.length > 0 ? (0, import_jsx_runtime26.jsx)(Text, { children: " " }) : null, tabNodes] });
|
|
73643
73720
|
};
|
|
73644
73721
|
}
|
|
73645
73722
|
});
|
|
73646
73723
|
|
|
73647
73724
|
// ../plugin-cli/dist/components/useScrollableList.js
|
|
73648
73725
|
function useScrollableList({ total, windowSize = 15, onClose, onSelect, isActive = true }) {
|
|
73649
|
-
const [cursor, setCursor] = (0,
|
|
73650
|
-
const [offset, setOffset] = (0,
|
|
73651
|
-
(0,
|
|
73726
|
+
const [cursor, setCursor] = (0, import_react55.useState)(0);
|
|
73727
|
+
const [offset, setOffset] = (0, import_react55.useState)(0);
|
|
73728
|
+
(0, import_react55.useEffect)(() => {
|
|
73652
73729
|
if (cursor >= total)
|
|
73653
73730
|
setCursor(Math.max(0, total - 1));
|
|
73654
73731
|
if (offset > Math.max(0, total - windowSize)) {
|
|
@@ -73696,10 +73773,10 @@ function useScrollableList({ total, windowSize = 15, onClose, onSelect, isActive
|
|
|
73696
73773
|
canScrollDown: offset + windowSize < total
|
|
73697
73774
|
};
|
|
73698
73775
|
}
|
|
73699
|
-
var
|
|
73776
|
+
var import_react55;
|
|
73700
73777
|
var init_useScrollableList = __esm({
|
|
73701
73778
|
async "../plugin-cli/dist/components/useScrollableList.js"() {
|
|
73702
|
-
|
|
73779
|
+
import_react55 = __toESM(require_react());
|
|
73703
73780
|
await init_build2();
|
|
73704
73781
|
}
|
|
73705
73782
|
});
|
|
@@ -73743,11 +73820,11 @@ function orderByScope(skills) {
|
|
|
73743
73820
|
}
|
|
73744
73821
|
return out;
|
|
73745
73822
|
}
|
|
73746
|
-
var
|
|
73823
|
+
var import_jsx_runtime27, import_react56, NAME_COL, SCOPE_COL, USED_COL, WINDOW, ORDER, SkillsPanel;
|
|
73747
73824
|
var init_SkillsPanel = __esm({
|
|
73748
73825
|
async "../plugin-cli/dist/components/SkillsPanel.js"() {
|
|
73749
|
-
|
|
73750
|
-
|
|
73826
|
+
import_jsx_runtime27 = __toESM(require_jsx_runtime());
|
|
73827
|
+
import_react56 = __toESM(require_react());
|
|
73751
73828
|
await init_build2();
|
|
73752
73829
|
init_dist7();
|
|
73753
73830
|
await init_Modal();
|
|
@@ -73759,9 +73836,9 @@ var init_SkillsPanel = __esm({
|
|
|
73759
73836
|
ORDER = ["user", "project", "builtin", "plugin"];
|
|
73760
73837
|
SkillsPanel = ({ skills, mcpServers, usage, onClose }) => {
|
|
73761
73838
|
const hasMcp = !!mcpServers && mcpServers.length > 0;
|
|
73762
|
-
const [activeTab, setActiveTab] =
|
|
73763
|
-
const skillRows =
|
|
73764
|
-
const mcpRows =
|
|
73839
|
+
const [activeTab, setActiveTab] = import_react56.default.useState("skills");
|
|
73840
|
+
const skillRows = import_react56.default.useMemo(() => buildSkillRows(skills, usage), [skills, usage]);
|
|
73841
|
+
const mcpRows = import_react56.default.useMemo(() => {
|
|
73765
73842
|
if (!hasMcp)
|
|
73766
73843
|
return [];
|
|
73767
73844
|
return mcpServers.map((srv) => ({
|
|
@@ -73785,11 +73862,11 @@ var init_SkillsPanel = __esm({
|
|
|
73785
73862
|
const slice = rows.slice(scroll.visible.start, scroll.visible.end);
|
|
73786
73863
|
const termWidth = process.stdout.columns ?? 80;
|
|
73787
73864
|
const descWidth = Math.max(20, termWidth - NAME_COL - SCOPE_COL - USED_COL - 12);
|
|
73788
|
-
return (0,
|
|
73865
|
+
return (0, import_jsx_runtime27.jsxs)(Modal, { title: "Skills", subtitle, hints, ...tabs ? { tabs, activeTabId: activeTab, onTabChange: (id) => setActiveTab(id) } : {}, ...onClose ? { onClose } : {}, children: [rows.length === 0 ? (0, import_jsx_runtime27.jsx)(Text, { dimColor: true, children: activeTab === "mcp" ? "(no MCP servers attached)" : "(no skills discovered)" }) : null, scroll.canScrollUp ? (0, import_jsx_runtime27.jsx)(Text, { dimColor: true, children: ` \u2191 ${scroll.offset} more above` }) : null, slice.map((row, i2) => {
|
|
73789
73866
|
const absoluteIndex = scroll.visible.start + i2;
|
|
73790
73867
|
const focused = absoluteIndex === scroll.cursor;
|
|
73791
|
-
return (0,
|
|
73792
|
-
}), scroll.canScrollDown ? (0,
|
|
73868
|
+
return (0, import_jsx_runtime27.jsxs)(Box_default, { children: [(0, import_jsx_runtime27.jsx)(Text, { ...focused ? {} : { dimColor: true }, children: focused ? "\u203A " : " " }), (0, import_jsx_runtime27.jsx)(Box_default, { width: NAME_COL, children: (0, import_jsx_runtime27.jsx)(Text, { bold: true, children: truncate3(row.name, NAME_COL - 2) }) }), (0, import_jsx_runtime27.jsx)(Box_default, { width: SCOPE_COL, children: (0, import_jsx_runtime27.jsx)(Text, { dimColor: true, children: row.scope }) }), (0, import_jsx_runtime27.jsx)(Box_default, { width: descWidth, children: (0, import_jsx_runtime27.jsx)(Text, { dimColor: true, wrap: "truncate", children: oneLine(row.description) }) }), (0, import_jsx_runtime27.jsx)(Box_default, { width: USED_COL, justifyContent: "flex-end", children: row.used ? (0, import_jsx_runtime27.jsx)(Text, { dimColor: true, children: `\xD7${row.used}` }) : null })] }, row.key);
|
|
73869
|
+
}), scroll.canScrollDown ? (0, import_jsx_runtime27.jsx)(Text, { dimColor: true, children: ` \u2193 ${rows.length - scroll.visible.end} more below` }) : null] });
|
|
73793
73870
|
};
|
|
73794
73871
|
}
|
|
73795
73872
|
});
|
|
@@ -73805,11 +73882,11 @@ function matchesTab(tool, tab2) {
|
|
|
73805
73882
|
return action === "prompt";
|
|
73806
73883
|
return action === "deny";
|
|
73807
73884
|
}
|
|
73808
|
-
var
|
|
73885
|
+
var import_jsx_runtime28, import_react57, NAME_COL2, BADGE_COL, WINDOW2, ToolsPanel, ToolRow, PermissionBadge;
|
|
73809
73886
|
var init_ToolsPanel = __esm({
|
|
73810
73887
|
async "../plugin-cli/dist/components/ToolsPanel.js"() {
|
|
73811
|
-
|
|
73812
|
-
|
|
73888
|
+
import_jsx_runtime28 = __toESM(require_jsx_runtime());
|
|
73889
|
+
import_react57 = __toESM(require_react());
|
|
73813
73890
|
await init_build2();
|
|
73814
73891
|
init_dist7();
|
|
73815
73892
|
init_theme();
|
|
@@ -73819,8 +73896,8 @@ var init_ToolsPanel = __esm({
|
|
|
73819
73896
|
BADGE_COL = 9;
|
|
73820
73897
|
WINDOW2 = 15;
|
|
73821
73898
|
ToolsPanel = ({ tools, onClose }) => {
|
|
73822
|
-
const sorted =
|
|
73823
|
-
const counts =
|
|
73899
|
+
const sorted = import_react57.default.useMemo(() => [...tools].sort((a2, b3) => a2.name.localeCompare(b3.name)), [tools]);
|
|
73900
|
+
const counts = import_react57.default.useMemo(() => {
|
|
73824
73901
|
let auto2 = 0;
|
|
73825
73902
|
let prompt = 0;
|
|
73826
73903
|
let deny = 0;
|
|
@@ -73835,8 +73912,8 @@ var init_ToolsPanel = __esm({
|
|
|
73835
73912
|
}
|
|
73836
73913
|
return { auto: auto2, prompt, deny };
|
|
73837
73914
|
}, [sorted]);
|
|
73838
|
-
const [activeTab, setActiveTab] =
|
|
73839
|
-
const filtered =
|
|
73915
|
+
const [activeTab, setActiveTab] = import_react57.default.useState("all");
|
|
73916
|
+
const filtered = import_react57.default.useMemo(() => sorted.filter((t2) => matchesTab(t2, activeTab)), [sorted, activeTab]);
|
|
73840
73917
|
const scroll = useScrollableList({
|
|
73841
73918
|
total: filtered.length,
|
|
73842
73919
|
windowSize: WINDOW2
|
|
@@ -73848,30 +73925,30 @@ var init_ToolsPanel = __esm({
|
|
|
73848
73925
|
{ id: "deny", label: `Deny (${counts.deny})` }
|
|
73849
73926
|
];
|
|
73850
73927
|
if (sorted.length === 0) {
|
|
73851
|
-
return (0,
|
|
73928
|
+
return (0, import_jsx_runtime28.jsx)(Modal, { title: "Tools", subtitle: "none registered", ...onClose ? { onClose } : {}, children: (0, import_jsx_runtime28.jsx)(Text, { dimColor: true, children: "(no tools registered)" }) });
|
|
73852
73929
|
}
|
|
73853
73930
|
const slice = filtered.slice(scroll.visible.start, scroll.visible.end);
|
|
73854
73931
|
const termWidth = process.stdout.columns ?? 80;
|
|
73855
73932
|
const descWidth = Math.max(20, termWidth - NAME_COL2 - BADGE_COL - 12);
|
|
73856
73933
|
const subtitle = filtered.length === 0 ? `0 of ${sorted.length} \xB7 no tools in this filter` : `${scroll.cursor + 1} of ${filtered.length} \xB7 ${filtered.length} shown`;
|
|
73857
73934
|
const hints = "\u2191\u2193 navigate \xB7 PgUp/PgDn fast \xB7 g/G top/bottom";
|
|
73858
|
-
return (0,
|
|
73935
|
+
return (0, import_jsx_runtime28.jsxs)(Modal, { title: "Tools", subtitle, hints, tabs, activeTabId: activeTab, onTabChange: (id) => setActiveTab(id), ...onClose ? { onClose } : {}, children: [filtered.length === 0 ? (0, import_jsx_runtime28.jsx)(Text, { dimColor: true, children: "(no tools match this filter)" }) : null, scroll.canScrollUp ? (0, import_jsx_runtime28.jsx)(Text, { dimColor: true, children: ` \u2191 ${scroll.offset} more above` }) : null, slice.map((t2, i2) => {
|
|
73859
73936
|
const absoluteIndex = scroll.visible.start + i2;
|
|
73860
73937
|
const focused = absoluteIndex === scroll.cursor;
|
|
73861
|
-
return (0,
|
|
73862
|
-
}), scroll.canScrollDown ? (0,
|
|
73938
|
+
return (0, import_jsx_runtime28.jsx)(ToolRow, { tool: t2, focused, descWidth }, t2.name);
|
|
73939
|
+
}), scroll.canScrollDown ? (0, import_jsx_runtime28.jsx)(Text, { dimColor: true, children: ` \u2193 ${filtered.length - scroll.visible.end} more below` }) : null] });
|
|
73863
73940
|
};
|
|
73864
73941
|
ToolRow = ({ tool, focused, descWidth }) => {
|
|
73865
73942
|
const perm = tool.permission?.action ?? "allow";
|
|
73866
73943
|
const desc = oneLine(tool.description ?? "");
|
|
73867
|
-
return (0,
|
|
73944
|
+
return (0, import_jsx_runtime28.jsxs)(Box_default, { children: [(0, import_jsx_runtime28.jsx)(Text, { ...focused ? {} : { dimColor: true }, children: focused ? "\u203A " : " " }), (0, import_jsx_runtime28.jsx)(Box_default, { width: NAME_COL2, children: (0, import_jsx_runtime28.jsx)(Text, { bold: true, children: truncate3(tool.name, NAME_COL2 - 2) }) }), (0, import_jsx_runtime28.jsx)(Box_default, { width: BADGE_COL, children: (0, import_jsx_runtime28.jsx)(PermissionBadge, { action: perm }) }), (0, import_jsx_runtime28.jsx)(Box_default, { width: descWidth, children: (0, import_jsx_runtime28.jsx)(Text, { dimColor: true, wrap: "truncate", children: desc }) })] });
|
|
73868
73945
|
};
|
|
73869
73946
|
PermissionBadge = ({ action }) => {
|
|
73870
73947
|
if (action === "allow")
|
|
73871
|
-
return (0,
|
|
73948
|
+
return (0, import_jsx_runtime28.jsx)(Text, { dimColor: true, children: "[auto] " });
|
|
73872
73949
|
if (action === "deny")
|
|
73873
|
-
return (0,
|
|
73874
|
-
return (0,
|
|
73950
|
+
return (0, import_jsx_runtime28.jsx)(Text, { color: Colors.danger, children: "[deny] " });
|
|
73951
|
+
return (0, import_jsx_runtime28.jsx)(Text, { color: Colors.busy, children: "[prompt]" });
|
|
73875
73952
|
};
|
|
73876
73953
|
}
|
|
73877
73954
|
});
|
|
@@ -73996,11 +74073,11 @@ function oneLine2(s2) {
|
|
|
73996
74073
|
function truncate5(s2, n2) {
|
|
73997
74074
|
return s2.length <= n2 ? s2 : s2.slice(0, n2 - 1) + "\u2026";
|
|
73998
74075
|
}
|
|
73999
|
-
var
|
|
74076
|
+
var import_jsx_runtime29, import_react58, SUBAGENT_PLUGIN_ID3, WINDOW3, AgentsPanel, KindsList, AgentSummary;
|
|
74000
74077
|
var init_AgentsPanel = __esm({
|
|
74001
74078
|
async "../plugin-cli/dist/components/AgentsPanel.js"() {
|
|
74002
|
-
|
|
74003
|
-
|
|
74079
|
+
import_jsx_runtime29 = __toESM(require_jsx_runtime());
|
|
74080
|
+
import_react58 = __toESM(require_react());
|
|
74004
74081
|
await init_build2();
|
|
74005
74082
|
init_dist7();
|
|
74006
74083
|
init_theme();
|
|
@@ -74010,8 +74087,8 @@ var init_AgentsPanel = __esm({
|
|
|
74010
74087
|
SUBAGENT_PLUGIN_ID3 = "@moxxy/subagents";
|
|
74011
74088
|
WINDOW3 = 16;
|
|
74012
74089
|
AgentsPanel = ({ events, availableKinds = [], onClose }) => {
|
|
74013
|
-
const agents =
|
|
74014
|
-
const rows =
|
|
74090
|
+
const agents = import_react58.default.useMemo(() => collectAgents(events), [events]);
|
|
74091
|
+
const rows = import_react58.default.useMemo(() => {
|
|
74015
74092
|
const out = [];
|
|
74016
74093
|
for (const agent of agents) {
|
|
74017
74094
|
for (const row of agent.activity)
|
|
@@ -74020,7 +74097,7 @@ var init_AgentsPanel = __esm({
|
|
|
74020
74097
|
out.sort((a2, b3) => a2.row.atMs - b3.row.atMs);
|
|
74021
74098
|
return out;
|
|
74022
74099
|
}, [agents]);
|
|
74023
|
-
const [activeTab, setActiveTab] =
|
|
74100
|
+
const [activeTab, setActiveTab] = import_react58.default.useState(agents.length > 0 ? "active" : "available");
|
|
74024
74101
|
const scroll = useScrollableList({
|
|
74025
74102
|
total: rows.length,
|
|
74026
74103
|
windowSize: WINDOW3,
|
|
@@ -74031,10 +74108,10 @@ var init_AgentsPanel = __esm({
|
|
|
74031
74108
|
{ id: "available", label: `Available (${availableKinds.length + 1})` }
|
|
74032
74109
|
];
|
|
74033
74110
|
if (activeTab === "available") {
|
|
74034
|
-
return (0,
|
|
74111
|
+
return (0, import_jsx_runtime29.jsx)(Modal, { title: "Agents", subtitle: `${availableKinds.length + 1} kind${availableKinds.length === 0 ? "" : "s"} installed`, tabs, activeTabId: activeTab, onTabChange: (id) => setActiveTab(id), ...onClose ? { onClose } : {}, children: (0, import_jsx_runtime29.jsx)(KindsList, { kinds: availableKinds }) });
|
|
74035
74112
|
}
|
|
74036
74113
|
if (agents.length === 0) {
|
|
74037
|
-
return (0,
|
|
74114
|
+
return (0, import_jsx_runtime29.jsx)(Modal, { title: "Agents", subtitle: "no subagents spawned this session", tabs, activeTabId: activeTab, onTabChange: (id) => setActiveTab(id), ...onClose ? { onClose } : {}, children: (0, import_jsx_runtime29.jsx)(Text, { dimColor: true, children: "(spawn agents via the `dispatch_agent` tool)" }) });
|
|
74038
74115
|
}
|
|
74039
74116
|
const running = agents.filter((a2) => a2.state === "running").length;
|
|
74040
74117
|
const summary = `${agents.length} agent${agents.length === 1 ? "" : "s"}` + (running > 0 ? ` \xB7 ${running} running` : "");
|
|
@@ -74042,25 +74119,25 @@ var init_AgentsPanel = __esm({
|
|
|
74042
74119
|
const hints = "\u2191\u2193 scroll \xB7 PgUp/PgDn fast \xB7 g/G top/bottom";
|
|
74043
74120
|
const slice = rows.slice(scroll.visible.start, scroll.visible.end);
|
|
74044
74121
|
const labelColWidth = Math.min(18, agents.reduce((m3, a2) => Math.max(m3, a2.label.length), 0) + 2);
|
|
74045
|
-
return (0,
|
|
74122
|
+
return (0, import_jsx_runtime29.jsxs)(Modal, { title: "Agents", subtitle, hints, tabs, activeTabId: activeTab, onTabChange: (id) => setActiveTab(id), ...onClose ? { onClose } : {}, children: [(0, import_jsx_runtime29.jsx)(Box_default, { flexDirection: "column", marginBottom: 1, children: agents.map((a2) => (0, import_jsx_runtime29.jsx)(AgentSummary, { agent: a2 }, a2.childSessionId)) }), scroll.canScrollUp ? (0, import_jsx_runtime29.jsx)(Text, { dimColor: true, children: ` \u2191 ${scroll.offset} more above` }) : null, slice.map((entry, i2) => {
|
|
74046
74123
|
const absoluteIndex = scroll.visible.start + i2;
|
|
74047
74124
|
const focused = absoluteIndex === scroll.cursor;
|
|
74048
74125
|
const time = new Date(entry.row.atMs).toISOString().slice(11, 19);
|
|
74049
|
-
return (0,
|
|
74050
|
-
}), scroll.canScrollDown ? (0,
|
|
74126
|
+
return (0, import_jsx_runtime29.jsxs)(Box_default, { children: [(0, import_jsx_runtime29.jsx)(Text, { ...focused ? {} : { dimColor: true }, children: focused ? "\u203A " : " " }), (0, import_jsx_runtime29.jsx)(Box_default, { width: 10, children: (0, import_jsx_runtime29.jsx)(Text, { dimColor: true, children: time }) }), (0, import_jsx_runtime29.jsx)(Box_default, { width: labelColWidth, children: (0, import_jsx_runtime29.jsx)(Text, { dimColor: true, children: truncate5(entry.agent.label, labelColWidth - 1) }) }), (0, import_jsx_runtime29.jsx)(Box_default, { flexGrow: 1, children: (0, import_jsx_runtime29.jsx)(Text, { ...entry.row.color ? { color: entry.row.color } : {}, wrap: "truncate", children: entry.row.text }) })] }, `${entry.agent.childSessionId}:${absoluteIndex}`);
|
|
74127
|
+
}), scroll.canScrollDown ? (0, import_jsx_runtime29.jsx)(Text, { dimColor: true, children: ` \u2193 ${rows.length - scroll.visible.end} more below` }) : null] });
|
|
74051
74128
|
};
|
|
74052
74129
|
KindsList = ({ kinds }) => {
|
|
74053
74130
|
const termWidth = process.stdout.columns ?? 80;
|
|
74054
74131
|
const nameCol = 20;
|
|
74055
74132
|
const descCol = Math.max(20, termWidth - nameCol - 12);
|
|
74056
|
-
return (0,
|
|
74133
|
+
return (0, import_jsx_runtime29.jsxs)(Box_default, { flexDirection: "column", children: [(0, import_jsx_runtime29.jsxs)(Box_default, { marginLeft: 2, children: [(0, import_jsx_runtime29.jsx)(Box_default, { width: nameCol, children: (0, import_jsx_runtime29.jsx)(Text, { bold: true, children: "default" }) }), (0, import_jsx_runtime29.jsx)(Box_default, { width: descCol, children: (0, import_jsx_runtime29.jsx)(Text, { dimColor: true, wrap: "truncate", children: "generic tool-use loop (built-in fallback)" }) })] }), kinds.map((k3) => (0, import_jsx_runtime29.jsxs)(Box_default, { marginLeft: 2, children: [(0, import_jsx_runtime29.jsx)(Box_default, { width: nameCol, children: (0, import_jsx_runtime29.jsx)(Text, { bold: true, children: truncate5(k3.name, nameCol - 1) }) }), (0, import_jsx_runtime29.jsx)(Box_default, { width: descCol, children: (0, import_jsx_runtime29.jsx)(Text, { dimColor: true, wrap: "truncate", children: k3.description }) })] }, k3.name)), kinds.length === 0 ? (0, import_jsx_runtime29.jsx)(Box_default, { marginLeft: 2, marginTop: 1, children: (0, import_jsx_runtime29.jsx)(Text, { dimColor: true, children: "install an agent plugin to add kinds" }) }) : null] });
|
|
74057
74134
|
};
|
|
74058
74135
|
AgentSummary = ({ agent }) => {
|
|
74059
74136
|
const elapsedMs = (agent.completedAtMs ?? Date.now()) - agent.startedAtMs;
|
|
74060
74137
|
const elapsed = formatElapsed(elapsedMs);
|
|
74061
74138
|
const dot = agent.state === "running" ? Colors.busy : agent.state === "failed" ? Colors.danger : "blue";
|
|
74062
74139
|
const toolCount = agent.activity.filter((r2) => r2.text.startsWith("\u2192 tool ")).length;
|
|
74063
|
-
return (0,
|
|
74140
|
+
return (0, import_jsx_runtime29.jsxs)(Box_default, { children: [(0, import_jsx_runtime29.jsx)(Text, { color: dot, children: "\u25CF " }), (0, import_jsx_runtime29.jsx)(Box_default, { width: 20, children: (0, import_jsx_runtime29.jsx)(Text, { bold: true, children: truncate5(agent.label, 19) }) }), (0, import_jsx_runtime29.jsx)(Text, { dimColor: true, children: `${agent.state} ${elapsed} \xB7 ${toolCount} tool call${toolCount === 1 ? "" : "s"}` })] });
|
|
74064
74141
|
};
|
|
74065
74142
|
}
|
|
74066
74143
|
});
|
|
@@ -74119,11 +74196,11 @@ function sparkline(series, maxCols = 48) {
|
|
|
74119
74196
|
const max = peak(tail, 1);
|
|
74120
74197
|
return tail.map((v3) => SPARKS[Math.min(SPARKS.length - 1, Math.round(v3 / max * (SPARKS.length - 1)))]).join("");
|
|
74121
74198
|
}
|
|
74122
|
-
var
|
|
74199
|
+
var import_jsx_runtime30, import_react59, BAR_WIDTH, LABEL_COL, SPARKS, Bar, CompRow, MetricRow, MODEL_COL, ModelRow, UsagePanel;
|
|
74123
74200
|
var init_UsagePanel = __esm({
|
|
74124
74201
|
async "../plugin-cli/dist/components/UsagePanel.js"() {
|
|
74125
|
-
|
|
74126
|
-
|
|
74202
|
+
import_jsx_runtime30 = __toESM(require_jsx_runtime());
|
|
74203
|
+
import_react59 = __toESM(require_react());
|
|
74127
74204
|
await init_build2();
|
|
74128
74205
|
init_dist();
|
|
74129
74206
|
init_theme();
|
|
@@ -74133,20 +74210,20 @@ var init_UsagePanel = __esm({
|
|
|
74133
74210
|
SPARKS = "\u2581\u2582\u2583\u2584\u2585\u2586\u2587\u2588";
|
|
74134
74211
|
Bar = ({ frac, color, width = BAR_WIDTH }) => {
|
|
74135
74212
|
const filled = Math.round(clamp2(frac) * width);
|
|
74136
|
-
return (0,
|
|
74213
|
+
return (0, import_jsx_runtime30.jsxs)(Text, { children: [(0, import_jsx_runtime30.jsx)(Text, { ...color ? { color } : {}, children: "\u2588".repeat(filled) }), (0, import_jsx_runtime30.jsx)(Text, { dimColor: true, children: "\u2591".repeat(width - filled) })] });
|
|
74137
74214
|
};
|
|
74138
|
-
CompRow = ({ label: label3, frac, value, color }) => (0,
|
|
74139
|
-
MetricRow = ({ label: label3, frac, color, suffix }) => (0,
|
|
74215
|
+
CompRow = ({ label: label3, frac, value, color }) => (0, import_jsx_runtime30.jsxs)(Box_default, { children: [(0, import_jsx_runtime30.jsx)(Box_default, { width: LABEL_COL, children: (0, import_jsx_runtime30.jsx)(Text, { dimColor: true, children: label3 }) }), (0, import_jsx_runtime30.jsx)(Bar, { frac, color }), (0, import_jsx_runtime30.jsx)(Text, { children: ` ${pct(frac).padStart(4)}` }), (0, import_jsx_runtime30.jsx)(Text, { dimColor: true, children: ` ${fmt(value)}` })] });
|
|
74216
|
+
MetricRow = ({ label: label3, frac, color, suffix }) => (0, import_jsx_runtime30.jsxs)(Box_default, { children: [(0, import_jsx_runtime30.jsx)(Box_default, { width: LABEL_COL, children: (0, import_jsx_runtime30.jsx)(Text, { bold: true, children: label3 }) }), (0, import_jsx_runtime30.jsx)(Bar, { frac, color }), (0, import_jsx_runtime30.jsx)(Text, { children: ` ${pct(frac).padStart(4)}` }), suffix ? (0, import_jsx_runtime30.jsx)(Text, { dimColor: true, children: ` ${suffix}` }) : null] });
|
|
74140
74217
|
MODEL_COL = 26;
|
|
74141
74218
|
ModelRow = ({ name, calls, prompt, output, dim }) => {
|
|
74142
74219
|
const label3 = name.length > MODEL_COL - 1 ? `${name.slice(0, MODEL_COL - 2)}\u2026` : name;
|
|
74143
|
-
return (0,
|
|
74220
|
+
return (0, import_jsx_runtime30.jsxs)(Box_default, { children: [(0, import_jsx_runtime30.jsx)(Box_default, { width: MODEL_COL, children: (0, import_jsx_runtime30.jsx)(Text, { dimColor: dim, children: label3 }) }), (0, import_jsx_runtime30.jsx)(Text, { dimColor: true, children: `${String(calls).padStart(4)} calls ${fmt(prompt).padStart(7)} prompt ${fmt(output).padStart(6)} out` })] });
|
|
74144
74221
|
};
|
|
74145
74222
|
UsagePanel = ({ events, contextWindow, contextTokens, onClose }) => {
|
|
74146
|
-
const s2 =
|
|
74147
|
-
const series =
|
|
74148
|
-
const [lifetime, setLifetime] =
|
|
74149
|
-
|
|
74223
|
+
const s2 = import_react59.default.useMemo(() => summarizeSessionTokensFromEvents(events), [events]);
|
|
74224
|
+
const series = import_react59.default.useMemo(() => perCallPrompt(events), [events]);
|
|
74225
|
+
const [lifetime, setLifetime] = import_react59.default.useState(null);
|
|
74226
|
+
import_react59.default.useEffect(() => {
|
|
74150
74227
|
let alive = true;
|
|
74151
74228
|
void loadUsageStats().then((f3) => {
|
|
74152
74229
|
if (alive)
|
|
@@ -74156,19 +74233,19 @@ var init_UsagePanel = __esm({
|
|
|
74156
74233
|
alive = false;
|
|
74157
74234
|
};
|
|
74158
74235
|
}, []);
|
|
74159
|
-
const liveByModel =
|
|
74160
|
-
const lifeRows =
|
|
74236
|
+
const liveByModel = import_react59.default.useMemo(() => summarizeTokensByModel(events), [events]);
|
|
74237
|
+
const lifeRows = import_react59.default.useMemo(() => modelBreakdownRows(lifetime, liveByModel), [lifetime, liveByModel]);
|
|
74161
74238
|
const hasModels = lifeRows.length > 0;
|
|
74162
|
-
const lifeTotal =
|
|
74239
|
+
const lifeTotal = import_react59.default.useMemo(() => lifeRows.reduce((acc, r2) => ({
|
|
74163
74240
|
calls: acc.calls + r2.calls,
|
|
74164
74241
|
prompt: acc.prompt + r2.prompt,
|
|
74165
74242
|
output: acc.output + r2.output
|
|
74166
74243
|
}), { calls: 0, prompt: 0, output: 0 }), [lifeRows]);
|
|
74167
74244
|
const hasSession = s2.calls > 0;
|
|
74168
|
-
const [activeTab, setActiveTab] =
|
|
74245
|
+
const [activeTab, setActiveTab] = import_react59.default.useState(hasSession ? "session" : "lifetime");
|
|
74169
74246
|
if (!hasSession && !hasModels) {
|
|
74170
74247
|
const loading = lifetime === null;
|
|
74171
|
-
return (0,
|
|
74248
|
+
return (0, import_jsx_runtime30.jsx)(Modal, { title: "Usage", subtitle: loading ? "loading\u2026" : "no usage recorded yet", ...onClose ? { onClose } : {}, children: (0, import_jsx_runtime30.jsx)(Text, { dimColor: true, children: loading ? "(reading saved usage\u2026)" : "(no token usage yet \u2014 run a turn, then reopen /usage)" }) });
|
|
74172
74249
|
}
|
|
74173
74250
|
const tabs = hasSession && hasModels ? [
|
|
74174
74251
|
{ id: "session", label: "This session" },
|
|
@@ -74184,7 +74261,7 @@ var init_UsagePanel = __esm({
|
|
|
74184
74261
|
const subtitle = hasSession ? `${s2.calls} calls \xB7 ${fmt(s2.totalPrompt)} prompt \xB7 ${fmt(s2.totalOutput)} output` : "saved across sessions";
|
|
74185
74262
|
const showSession = hasSession && (!tabs || activeTab === "session");
|
|
74186
74263
|
const showLifetime = hasModels && (!tabs || activeTab === "lifetime");
|
|
74187
|
-
return (0,
|
|
74264
|
+
return (0, import_jsx_runtime30.jsxs)(Modal, { title: "Usage", subtitle, ...tabs ? { tabs, activeTabId: activeTab, onTabChange: (id) => setActiveTab(id) } : {}, ...onClose ? { onClose } : {}, children: [showSession ? (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [(0, import_jsx_runtime30.jsx)(Text, { bold: true, children: "Prompt composition" }), (0, import_jsx_runtime30.jsx)(CompRow, { label: "cache read", frac: readFrac, value: s2.totalCacheRead, color: Colors.active }), (0, import_jsx_runtime30.jsx)(CompRow, { label: "fresh input", frac: freshFrac, value: s2.totalInput }), (0, import_jsx_runtime30.jsx)(CompRow, { label: "cache write", frac: writeFrac, value: s2.totalCacheCreation, color: Colors.busy }), (0, import_jsx_runtime30.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [(0, import_jsx_runtime30.jsx)(MetricRow, { label: "Cache hit", frac: s2.cacheHitRate, color: s2.cacheHitRate >= 0.5 ? Colors.active : Colors.busy }), ctxFrac != null ? (0, import_jsx_runtime30.jsx)(MetricRow, { label: "Context fill", frac: ctxFrac, color: ctxColor, suffix: `${fmt(contextTokens ?? 0)} / ${fmt(contextWindow ?? 0)}` }) : null] }), (0, import_jsx_runtime30.jsxs)(Box_default, { marginTop: 1, children: [(0, import_jsx_runtime30.jsx)(Box_default, { width: LABEL_COL, children: (0, import_jsx_runtime30.jsx)(Text, { bold: true, children: "Input cost" }) }), (0, import_jsx_runtime30.jsxs)(Text, { children: [fmt(s2.billedInputEq), " billed-eq"] }), saved > 5e-3 ? (0, import_jsx_runtime30.jsx)(Text, { color: Colors.active, bold: true, children: ` saved ${pct(saved)}` }) : (0, import_jsx_runtime30.jsx)(Text, { dimColor: true, children: " no cache savings yet" })] }), (0, import_jsx_runtime30.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [(0, import_jsx_runtime30.jsxs)(Box_default, { children: [(0, import_jsx_runtime30.jsx)(Text, { bold: true, children: "Per-call prompt " }), (0, import_jsx_runtime30.jsx)(Text, { dimColor: true, children: `peak ${fmt(peak(series))}` })] }), (0, import_jsx_runtime30.jsxs)(Box_default, { children: [(0, import_jsx_runtime30.jsx)(Text, { children: sparkline(series) }), trend ? (0, import_jsx_runtime30.jsx)(Text, { color: trend === "growing" ? Colors.busy : Colors.active, children: trend === "growing" ? " \u2191 growing" : " \u2248 bounded" }) : null] })] }), !s2.cacheEffective ? (0, import_jsx_runtime30.jsx)(Box_default, { marginTop: 1, children: (0, import_jsx_runtime30.jsx)(Text, { color: Colors.danger, children: "\u26A0 cache ineffective \u2014 writing cache but not reading it back (prefix likely unstable)" }) }) : null] }) : null, showLifetime ? (0, import_jsx_runtime30.jsxs)(Box_default, { marginTop: showSession ? 1 : 0, flexDirection: "column", children: [(0, import_jsx_runtime30.jsxs)(Box_default, { children: [(0, import_jsx_runtime30.jsx)(Text, { bold: true, children: "By model " }), (0, import_jsx_runtime30.jsx)(Text, { dimColor: true, children: `(saved + this session \xB7 ${lifeRows.length} model${lifeRows.length === 1 ? "" : "s"})` })] }), lifeRows.slice(0, 8).map((r2) => (0, import_jsx_runtime30.jsx)(ModelRow, { name: r2.name, calls: r2.calls, prompt: r2.prompt, output: r2.output }, r2.name)), lifeRows.length > 1 ? (0, import_jsx_runtime30.jsx)(ModelRow, { name: "total", calls: lifeTotal.calls, prompt: lifeTotal.prompt, output: lifeTotal.output, dim: true }) : null, (0, import_jsx_runtime30.jsx)(Text, { dimColor: true, children: " /usage clear resets saved history" })] }) : null] });
|
|
74188
74265
|
};
|
|
74189
74266
|
}
|
|
74190
74267
|
});
|
|
@@ -74193,11 +74270,11 @@ var init_UsagePanel = __esm({
|
|
|
74193
74270
|
function stepMark(status) {
|
|
74194
74271
|
return status === "completed" ? "\u2713" : status === "skipped" ? "\u2013" : status === "failed" ? "\u2717" : "\xB7";
|
|
74195
74272
|
}
|
|
74196
|
-
var
|
|
74273
|
+
var import_jsx_runtime31, import_react60, NAME_COL3, SCOPE_COL2, TRIG_COL, WINDOW4, WorkflowsPanel;
|
|
74197
74274
|
var init_WorkflowsPanel = __esm({
|
|
74198
74275
|
async "../plugin-cli/dist/components/WorkflowsPanel.js"() {
|
|
74199
|
-
|
|
74200
|
-
|
|
74276
|
+
import_jsx_runtime31 = __toESM(require_jsx_runtime());
|
|
74277
|
+
import_react60 = __toESM(require_react());
|
|
74201
74278
|
await init_build2();
|
|
74202
74279
|
init_dist7();
|
|
74203
74280
|
init_theme();
|
|
@@ -74208,13 +74285,13 @@ var init_WorkflowsPanel = __esm({
|
|
|
74208
74285
|
TRIG_COL = 20;
|
|
74209
74286
|
WINDOW4 = 12;
|
|
74210
74287
|
WorkflowsPanel = ({ view, onClose }) => {
|
|
74211
|
-
const [rows, setRows] =
|
|
74212
|
-
const [loading, setLoading] =
|
|
74213
|
-
const [busy2, setBusy] =
|
|
74214
|
-
const [status, setStatus] =
|
|
74215
|
-
const [pending, setPending] =
|
|
74216
|
-
const [reply, setReply] =
|
|
74217
|
-
const reload =
|
|
74288
|
+
const [rows, setRows] = import_react60.default.useState([]);
|
|
74289
|
+
const [loading, setLoading] = import_react60.default.useState(true);
|
|
74290
|
+
const [busy2, setBusy] = import_react60.default.useState(false);
|
|
74291
|
+
const [status, setStatus] = import_react60.default.useState(null);
|
|
74292
|
+
const [pending, setPending] = import_react60.default.useState(null);
|
|
74293
|
+
const [reply, setReply] = import_react60.default.useState("");
|
|
74294
|
+
const reload = import_react60.default.useCallback(async () => {
|
|
74218
74295
|
if (!view) {
|
|
74219
74296
|
setLoading(false);
|
|
74220
74297
|
return;
|
|
@@ -74228,11 +74305,11 @@ var init_WorkflowsPanel = __esm({
|
|
|
74228
74305
|
setLoading(false);
|
|
74229
74306
|
}
|
|
74230
74307
|
}, [view]);
|
|
74231
|
-
|
|
74308
|
+
import_react60.default.useEffect(() => {
|
|
74232
74309
|
void reload();
|
|
74233
74310
|
}, [reload]);
|
|
74234
74311
|
const active2 = !busy2 && !pending && !!view && rows.length > 0;
|
|
74235
|
-
const run2 =
|
|
74312
|
+
const run2 = import_react60.default.useCallback(async (wf) => {
|
|
74236
74313
|
if (!view || busy2)
|
|
74237
74314
|
return;
|
|
74238
74315
|
if (!wf.enabled) {
|
|
@@ -74263,7 +74340,7 @@ var init_WorkflowsPanel = __esm({
|
|
|
74263
74340
|
void reload();
|
|
74264
74341
|
}
|
|
74265
74342
|
}, [view, busy2, reload]);
|
|
74266
|
-
const submitReply =
|
|
74343
|
+
const submitReply = import_react60.default.useCallback(async (pendingRun, text) => {
|
|
74267
74344
|
if (!view?.resume) {
|
|
74268
74345
|
setStatus("resume not supported by this session");
|
|
74269
74346
|
return;
|
|
@@ -74342,11 +74419,11 @@ var init_WorkflowsPanel = __esm({
|
|
|
74342
74419
|
const slice = rows.slice(scroll.visible.start, scroll.visible.end);
|
|
74343
74420
|
const subtitle = rows.length === 0 ? "none" : `${scroll.cursor + 1} of ${rows.length} \xB7 ${rows.length} workflow${rows.length === 1 ? "" : "s"}`;
|
|
74344
74421
|
const hints = "d enable/disable \xB7 Enter/r run \xB7 \u2191\u2193 navigate \xB7 Esc close";
|
|
74345
|
-
return (0,
|
|
74422
|
+
return (0, import_jsx_runtime31.jsxs)(Modal, { title: "Workflows", subtitle, hints, ...onClose ? { onClose } : {}, children: [!view ? (0, import_jsx_runtime31.jsx)(Text, { dimColor: true, children: "(workflows unavailable in this session)" }) : loading ? (0, import_jsx_runtime31.jsx)(Text, { dimColor: true, children: "loading\u2026" }) : rows.length === 0 ? (0, import_jsx_runtime31.jsx)(Text, { dimColor: true, children: "(no workflows \u2014 ask the agent to \u201Ccreate a workflow that\u2026\u201D, or scaffold one in chat)" }) : null, scroll.canScrollUp ? (0, import_jsx_runtime31.jsx)(Text, { dimColor: true, children: ` \u2191 ${scroll.offset} more above` }) : null, slice.map((wf, i2) => {
|
|
74346
74423
|
const absoluteIndex = scroll.visible.start + i2;
|
|
74347
74424
|
const focused = absoluteIndex === scroll.cursor;
|
|
74348
|
-
return (0,
|
|
74349
|
-
}), scroll.canScrollDown ? (0,
|
|
74425
|
+
return (0, import_jsx_runtime31.jsxs)(Box_default, { children: [(0, import_jsx_runtime31.jsx)(Text, { ...focused ? {} : { dimColor: true }, children: focused ? "\u203A " : " " }), (0, import_jsx_runtime31.jsx)(Text, { color: wf.enabled ? Colors.active : void 0, dimColor: !wf.enabled, children: wf.enabled ? "\u25CF " : "\u25CB " }), (0, import_jsx_runtime31.jsx)(Box_default, { width: NAME_COL3, children: (0, import_jsx_runtime31.jsx)(Text, { bold: focused, children: truncate3(wf.name, NAME_COL3 - 2) }) }), (0, import_jsx_runtime31.jsx)(Box_default, { width: SCOPE_COL2, children: (0, import_jsx_runtime31.jsx)(Text, { dimColor: true, children: wf.scope }) }), (0, import_jsx_runtime31.jsx)(Box_default, { width: TRIG_COL, children: (0, import_jsx_runtime31.jsx)(Text, { dimColor: true, wrap: "truncate", children: wf.triggers }) }), (0, import_jsx_runtime31.jsx)(Box_default, { width: descWidth, children: (0, import_jsx_runtime31.jsx)(Text, { dimColor: true, wrap: "truncate", children: oneLine(wf.description) }) })] }, wf.name);
|
|
74426
|
+
}), scroll.canScrollDown ? (0, import_jsx_runtime31.jsx)(Text, { dimColor: true, children: ` \u2193 ${rows.length - scroll.visible.end} more below` }) : null, pending ? (0, import_jsx_runtime31.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, borderStyle: "round", borderColor: Colors.active, paddingX: 1, children: [(0, import_jsx_runtime31.jsxs)(Text, { color: Colors.active, children: ["\u23F8 Workflow waiting \xB7 ", pending.label] }), pending.prompt ? (0, import_jsx_runtime31.jsx)(Text, { wrap: "wrap", children: oneLine(pending.prompt).slice(0, 280) }) : null, (0, import_jsx_runtime31.jsxs)(Box_default, { marginTop: 1, children: [(0, import_jsx_runtime31.jsx)(Text, { children: "reply \u203A " }), (0, import_jsx_runtime31.jsx)(Text, { children: reply || " " })] }), (0, import_jsx_runtime31.jsx)(Text, { dimColor: true, children: "Enter send \xB7 Esc cancel" })] }) : null, status ? (0, import_jsx_runtime31.jsx)(Box_default, { marginTop: 1, children: (0, import_jsx_runtime31.jsx)(Text, { wrap: "truncate-end", children: status }) }) : null] });
|
|
74350
74427
|
};
|
|
74351
74428
|
}
|
|
74352
74429
|
});
|
|
@@ -74382,11 +74459,11 @@ function formatUptime(startedAt) {
|
|
|
74382
74459
|
function errMsg(err) {
|
|
74383
74460
|
return err instanceof Error ? err.message : String(err);
|
|
74384
74461
|
}
|
|
74385
|
-
var
|
|
74462
|
+
var import_jsx_runtime32, import_react61, WINDOW5, STATUS_POLL_MS, START_TIMEOUT_MS, STOP_GRACE_MS, ACTION_POLL_MS, ChannelsPanel, ConfigForm;
|
|
74386
74463
|
var init_ChannelsPanel = __esm({
|
|
74387
74464
|
async "../plugin-cli/dist/components/ChannelsPanel.js"() {
|
|
74388
|
-
|
|
74389
|
-
|
|
74465
|
+
import_jsx_runtime32 = __toESM(require_jsx_runtime());
|
|
74466
|
+
import_react61 = __toESM(require_react());
|
|
74390
74467
|
await init_build2();
|
|
74391
74468
|
init_theme();
|
|
74392
74469
|
await init_Modal();
|
|
@@ -74397,29 +74474,29 @@ var init_ChannelsPanel = __esm({
|
|
|
74397
74474
|
STOP_GRACE_MS = 4e3;
|
|
74398
74475
|
ACTION_POLL_MS = 350;
|
|
74399
74476
|
ChannelsPanel = ({ channels, vault, onClose }) => {
|
|
74400
|
-
const rows =
|
|
74401
|
-
const [statuses, setStatuses] =
|
|
74402
|
-
const [configured, setConfigured] =
|
|
74403
|
-
const [status, setStatus] =
|
|
74404
|
-
const [busy2, setBusy] =
|
|
74405
|
-
const [editing, setEditing] =
|
|
74406
|
-
const [fieldIdx, setFieldIdx] =
|
|
74407
|
-
const [buffer, setBuffer] =
|
|
74408
|
-
const [savedKeys, setSavedKeys] =
|
|
74409
|
-
const pollRef =
|
|
74477
|
+
const rows = import_react61.default.useMemo(() => channels.filter((c2) => c2.config).sort((a2, b3) => a2.name.localeCompare(b3.name)), [channels]);
|
|
74478
|
+
const [statuses, setStatuses] = import_react61.default.useState({});
|
|
74479
|
+
const [configured, setConfigured] = import_react61.default.useState({});
|
|
74480
|
+
const [status, setStatus] = import_react61.default.useState(null);
|
|
74481
|
+
const [busy2, setBusy] = import_react61.default.useState(false);
|
|
74482
|
+
const [editing, setEditing] = import_react61.default.useState(null);
|
|
74483
|
+
const [fieldIdx, setFieldIdx] = import_react61.default.useState(0);
|
|
74484
|
+
const [buffer, setBuffer] = import_react61.default.useState("");
|
|
74485
|
+
const [savedKeys, setSavedKeys] = import_react61.default.useState({});
|
|
74486
|
+
const pollRef = import_react61.default.useRef(null);
|
|
74410
74487
|
const clearPoll = () => {
|
|
74411
74488
|
if (pollRef.current) {
|
|
74412
74489
|
clearInterval(pollRef.current);
|
|
74413
74490
|
pollRef.current = null;
|
|
74414
74491
|
}
|
|
74415
74492
|
};
|
|
74416
|
-
const refreshStatuses =
|
|
74493
|
+
const refreshStatuses = import_react61.default.useCallback(() => {
|
|
74417
74494
|
const next = {};
|
|
74418
74495
|
for (const c2 of rows)
|
|
74419
74496
|
next[c2.name] = liveChannelStatus(c2.name);
|
|
74420
74497
|
setStatuses(next);
|
|
74421
74498
|
}, [rows]);
|
|
74422
|
-
const refreshConfigured =
|
|
74499
|
+
const refreshConfigured = import_react61.default.useCallback(async () => {
|
|
74423
74500
|
if (!vault) {
|
|
74424
74501
|
setConfigured({});
|
|
74425
74502
|
return;
|
|
@@ -74438,7 +74515,7 @@ var init_ChannelsPanel = __esm({
|
|
|
74438
74515
|
}
|
|
74439
74516
|
setConfigured(next);
|
|
74440
74517
|
}, [rows, vault]);
|
|
74441
|
-
|
|
74518
|
+
import_react61.default.useEffect(() => {
|
|
74442
74519
|
refreshStatuses();
|
|
74443
74520
|
void refreshConfigured();
|
|
74444
74521
|
const t2 = setInterval(refreshStatuses, STATUS_POLL_MS);
|
|
@@ -74447,7 +74524,7 @@ var init_ChannelsPanel = __esm({
|
|
|
74447
74524
|
clearPoll();
|
|
74448
74525
|
};
|
|
74449
74526
|
}, [refreshStatuses, refreshConfigured]);
|
|
74450
|
-
const startChannel2 =
|
|
74527
|
+
const startChannel2 = import_react61.default.useCallback((c2) => {
|
|
74451
74528
|
if (busy2)
|
|
74452
74529
|
return;
|
|
74453
74530
|
if (statuses[c2.name]) {
|
|
@@ -74484,7 +74561,7 @@ var init_ChannelsPanel = __esm({
|
|
|
74484
74561
|
}
|
|
74485
74562
|
}, ACTION_POLL_MS);
|
|
74486
74563
|
}, [busy2, statuses, configured, vault, refreshStatuses]);
|
|
74487
|
-
const stopChannel =
|
|
74564
|
+
const stopChannel = import_react61.default.useCallback((c2) => {
|
|
74488
74565
|
if (busy2)
|
|
74489
74566
|
return;
|
|
74490
74567
|
const before = statuses[c2.name];
|
|
@@ -74518,7 +74595,7 @@ var init_ChannelsPanel = __esm({
|
|
|
74518
74595
|
}
|
|
74519
74596
|
}, ACTION_POLL_MS);
|
|
74520
74597
|
}, [busy2, statuses, refreshStatuses]);
|
|
74521
|
-
const openConfig =
|
|
74598
|
+
const openConfig = import_react61.default.useCallback((c2) => {
|
|
74522
74599
|
if (!vault) {
|
|
74523
74600
|
setStatus(`configuring needs a local vault \u2014 set secrets via the desktop panel or \`moxxy ${c2.name} setup\`.`);
|
|
74524
74601
|
return;
|
|
@@ -74534,7 +74611,7 @@ var init_ChannelsPanel = __esm({
|
|
|
74534
74611
|
setStatus(null);
|
|
74535
74612
|
})();
|
|
74536
74613
|
}, [vault]);
|
|
74537
|
-
const saveField =
|
|
74614
|
+
const saveField = import_react61.default.useCallback((c2, field, value) => {
|
|
74538
74615
|
if (!vault)
|
|
74539
74616
|
return;
|
|
74540
74617
|
const v3 = value.trim();
|
|
@@ -74617,25 +74694,25 @@ var init_ChannelsPanel = __esm({
|
|
|
74617
74694
|
}, { isActive: !!editing && !busy2 });
|
|
74618
74695
|
const modalClose = editing ? void 0 : onClose;
|
|
74619
74696
|
if (editing) {
|
|
74620
|
-
return (0,
|
|
74697
|
+
return (0, import_jsx_runtime32.jsxs)(Modal, { title: `Configure ${editing.name}`, subtitle: vault ? "secrets are stored encrypted in your vault" : void 0, hints: "type value \xB7 Enter save \xB7 \u2191\u2193 field \xB7 Esc back", ...modalClose ? { onClose: modalClose } : {}, children: [(0, import_jsx_runtime32.jsx)(ConfigForm, { def: editing, fieldIdx, buffer, savedKeys }), status ? (0, import_jsx_runtime32.jsx)(Box_default, { marginTop: 1, children: (0, import_jsx_runtime32.jsx)(Text, { wrap: "truncate-end", children: status }) }) : null] });
|
|
74621
74698
|
}
|
|
74622
74699
|
const subtitle = rows.length === 0 ? "none" : `${Math.min(scroll.cursor + 1, rows.length)} of ${rows.length} \xB7 bots on their own runner`;
|
|
74623
74700
|
const slice = rows.slice(scroll.visible.start, scroll.visible.end);
|
|
74624
|
-
return (0,
|
|
74701
|
+
return (0, import_jsx_runtime32.jsxs)(Modal, { title: "Channels", subtitle, hints: "s start \xB7 x stop \xB7 c configure \xB7 \u2191\u2193 navigate", ...modalClose ? { onClose: modalClose } : {}, children: [rows.length === 0 ? (0, import_jsx_runtime32.jsx)(Text, { dimColor: true, children: "(no configurable channels \u2014 the Slack / Telegram plugins aren\u2019t loaded)" }) : null, scroll.canScrollUp ? (0, import_jsx_runtime32.jsx)(Text, { dimColor: true, children: ` \u2191 ${scroll.offset} more above` }) : null, slice.map((c2, i2) => {
|
|
74625
74702
|
const absoluteIndex = scroll.visible.start + i2;
|
|
74626
74703
|
const focused = absoluteIndex === scroll.cursor;
|
|
74627
74704
|
const st4 = statuses[c2.name] ?? null;
|
|
74628
74705
|
const running = !!st4;
|
|
74629
74706
|
const isConfigured = configured[c2.name];
|
|
74630
|
-
return (0,
|
|
74631
|
-
}), scroll.canScrollDown ? (0,
|
|
74707
|
+
return (0, import_jsx_runtime32.jsxs)(Box_default, { flexDirection: "column", children: [(0, import_jsx_runtime32.jsxs)(Box_default, { children: [(0, import_jsx_runtime32.jsx)(Text, { ...focused ? {} : { dimColor: true }, children: focused ? "\u203A " : " " }), (0, import_jsx_runtime32.jsx)(Text, { color: running ? Colors.active : void 0, dimColor: !running, children: running ? "\u25CF " : "\u25CB " }), (0, import_jsx_runtime32.jsx)(Box_default, { width: 12, children: (0, import_jsx_runtime32.jsx)(Text, { bold: focused, children: c2.name }) }), (0, import_jsx_runtime32.jsx)(Text, { dimColor: true, children: statusLabel(st4, isConfigured, vault != null) })] }), running && st4?.requestUrl ? (0, import_jsx_runtime32.jsx)(Box_default, { marginLeft: 6, children: (0, import_jsx_runtime32.jsx)(Text, { dimColor: true, wrap: "truncate-end", children: `Request URL: ${st4.requestUrl}` }) }) : null] }, c2.name);
|
|
74708
|
+
}), scroll.canScrollDown ? (0, import_jsx_runtime32.jsx)(Text, { dimColor: true, children: ` \u2193 ${rows.length - scroll.visible.end} more below` }) : null, status ? (0, import_jsx_runtime32.jsx)(Box_default, { marginTop: 1, children: (0, import_jsx_runtime32.jsx)(Text, { wrap: "truncate-end", children: status }) }) : null] });
|
|
74632
74709
|
};
|
|
74633
74710
|
ConfigForm = ({ def, fieldIdx, buffer, savedKeys }) => {
|
|
74634
74711
|
const fields = def.config?.fields ?? [];
|
|
74635
|
-
return (0,
|
|
74712
|
+
return (0, import_jsx_runtime32.jsx)(Box_default, { flexDirection: "column", children: fields.map((f3, i2) => {
|
|
74636
74713
|
const focused = i2 === fieldIdx;
|
|
74637
74714
|
const isSet = savedKeys[f3.vaultKey];
|
|
74638
|
-
return (0,
|
|
74715
|
+
return (0, import_jsx_runtime32.jsxs)(Box_default, { flexDirection: "column", children: [(0, import_jsx_runtime32.jsxs)(Box_default, { children: [(0, import_jsx_runtime32.jsx)(Text, { ...focused ? {} : { dimColor: true }, children: focused ? "\u203A " : " " }), (0, import_jsx_runtime32.jsx)(Text, { color: isSet ? Colors.active : void 0, dimColor: !isSet, children: isSet ? "\u2713 " : "\u25E6 " }), (0, import_jsx_runtime32.jsx)(Box_default, { width: 18, children: (0, import_jsx_runtime32.jsx)(Text, { bold: focused, children: f3.label }) }), (0, import_jsx_runtime32.jsx)(Text, { dimColor: true, children: isSet ? "set" : f3.required ? "required" : "optional" })] }), focused ? (0, import_jsx_runtime32.jsxs)(Box_default, { marginLeft: 4, children: [(0, import_jsx_runtime32.jsx)(Text, { children: "\u203A " }), (0, import_jsx_runtime32.jsx)(Text, { children: renderBuffer(buffer, f3.secret) })] }) : null, focused && f3.help ? (0, import_jsx_runtime32.jsx)(Box_default, { marginLeft: 4, children: (0, import_jsx_runtime32.jsx)(Text, { dimColor: true, wrap: "truncate-end", children: f3.help }) }) : null] }, f3.vaultKey);
|
|
74639
74716
|
}) });
|
|
74640
74717
|
};
|
|
74641
74718
|
}
|
|
@@ -74661,11 +74738,11 @@ function classifyVoiceNotice(notice) {
|
|
|
74661
74738
|
}
|
|
74662
74739
|
return { label: " \u2717 VOICE ", accent: Colors.danger, textColor: "black", body };
|
|
74663
74740
|
}
|
|
74664
|
-
var
|
|
74741
|
+
var import_jsx_runtime33, import_react62, OverlayOrNotice, SystemNotice;
|
|
74665
74742
|
var init_OverlayOrNotice = __esm({
|
|
74666
74743
|
async "../plugin-cli/dist/session/OverlayOrNotice.js"() {
|
|
74667
|
-
|
|
74668
|
-
|
|
74744
|
+
import_jsx_runtime33 = __toESM(require_jsx_runtime());
|
|
74745
|
+
import_react62 = __toESM(require_react());
|
|
74669
74746
|
await init_build2();
|
|
74670
74747
|
init_dist();
|
|
74671
74748
|
await init_SkillsPanel();
|
|
@@ -74677,8 +74754,8 @@ var init_OverlayOrNotice = __esm({
|
|
|
74677
74754
|
init_theme();
|
|
74678
74755
|
await init_helpers();
|
|
74679
74756
|
OverlayOrNotice = ({ overlay, systemNotice, session, events, contextWindow, contextTokens, getVault, getChannels, onClose }) => {
|
|
74680
|
-
const [skillUsage, setSkillUsage] =
|
|
74681
|
-
|
|
74757
|
+
const [skillUsage, setSkillUsage] = import_react62.default.useState({});
|
|
74758
|
+
import_react62.default.useEffect(() => {
|
|
74682
74759
|
if (overlay?.kind !== "skills")
|
|
74683
74760
|
return;
|
|
74684
74761
|
let cancelled = false;
|
|
@@ -74696,25 +74773,25 @@ var init_OverlayOrNotice = __esm({
|
|
|
74696
74773
|
};
|
|
74697
74774
|
}, [overlay?.kind]);
|
|
74698
74775
|
if (overlay?.kind === "skills") {
|
|
74699
|
-
return (0,
|
|
74776
|
+
return (0, import_jsx_runtime33.jsx)(SkillsPanel, { skills: session.skills.list(), mcpServers: deriveMcpServers(session.tools.list()), usage: skillUsage, onClose });
|
|
74700
74777
|
}
|
|
74701
74778
|
if (overlay?.kind === "tools") {
|
|
74702
|
-
return (0,
|
|
74779
|
+
return (0, import_jsx_runtime33.jsx)(ToolsPanel, { tools: session.tools.list(), onClose });
|
|
74703
74780
|
}
|
|
74704
74781
|
if (overlay?.kind === "workflows") {
|
|
74705
|
-
return (0,
|
|
74782
|
+
return (0, import_jsx_runtime33.jsx)(WorkflowsPanel, { view: session.workflows ?? null, onClose });
|
|
74706
74783
|
}
|
|
74707
74784
|
if (overlay?.kind === "channels") {
|
|
74708
|
-
return (0,
|
|
74785
|
+
return (0, import_jsx_runtime33.jsx)(ChannelsPanel, { channels: getChannels?.() ?? [], vault: getVault?.() ?? null, onClose });
|
|
74709
74786
|
}
|
|
74710
74787
|
if (overlay?.kind === "agents") {
|
|
74711
|
-
return (0,
|
|
74788
|
+
return (0, import_jsx_runtime33.jsx)(AgentsPanel, { events, availableKinds: session.agents.list(), onClose });
|
|
74712
74789
|
}
|
|
74713
74790
|
if (overlay?.kind === "usage") {
|
|
74714
|
-
return (0,
|
|
74791
|
+
return (0, import_jsx_runtime33.jsx)(UsagePanel, { events, contextWindow: contextWindow ?? null, contextTokens: contextTokens ?? null, onClose });
|
|
74715
74792
|
}
|
|
74716
74793
|
if (systemNotice) {
|
|
74717
|
-
return (0,
|
|
74794
|
+
return (0, import_jsx_runtime33.jsx)(SystemNotice, { notice: systemNotice });
|
|
74718
74795
|
}
|
|
74719
74796
|
return null;
|
|
74720
74797
|
};
|
|
@@ -74724,9 +74801,9 @@ var init_OverlayOrNotice = __esm({
|
|
|
74724
74801
|
const lines = voice.body.split("\n");
|
|
74725
74802
|
const [first, ...rest] = lines;
|
|
74726
74803
|
const plain = noColor();
|
|
74727
|
-
return (0,
|
|
74804
|
+
return (0, import_jsx_runtime33.jsxs)(Box_default, { marginTop: 1, marginBottom: 1, flexDirection: "column", children: [(0, import_jsx_runtime33.jsxs)(Box_default, { children: [plain ? (0, import_jsx_runtime33.jsx)(Text, { bold: true, children: `[${voice.label.trim()}]` }) : (0, import_jsx_runtime33.jsx)(Text, { backgroundColor: voice.accent, color: voice.textColor, bold: true, children: voice.label }), (0, import_jsx_runtime33.jsx)(Text, { ...plain ? { bold: true } : { color: voice.accent, bold: true }, children: ` ${first ?? ""}` })] }), rest.map((line, i2) => (0, import_jsx_runtime33.jsxs)(Text, { dimColor: true, children: [" ".repeat(voice.label.length + 1), line] }, i2))] });
|
|
74728
74805
|
}
|
|
74729
|
-
return (0,
|
|
74806
|
+
return (0, import_jsx_runtime33.jsx)(Box_default, { marginTop: 1, marginBottom: 1, flexDirection: "column", children: notice.split("\n").map((line, i2) => (0, import_jsx_runtime33.jsx)(Text, { children: line }, i2)) });
|
|
74730
74807
|
};
|
|
74731
74808
|
}
|
|
74732
74809
|
});
|
|
@@ -74739,10 +74816,10 @@ function previewToolInput(input) {
|
|
|
74739
74816
|
return "[unserializable]";
|
|
74740
74817
|
}
|
|
74741
74818
|
}
|
|
74742
|
-
var
|
|
74819
|
+
var import_jsx_runtime34, PermissionDialog;
|
|
74743
74820
|
var init_PermissionDialog = __esm({
|
|
74744
74821
|
async "../plugin-cli/dist/components/PermissionDialog.js"() {
|
|
74745
|
-
|
|
74822
|
+
import_jsx_runtime34 = __toESM(require_jsx_runtime());
|
|
74746
74823
|
__toESM(require_react());
|
|
74747
74824
|
await init_build2();
|
|
74748
74825
|
init_theme();
|
|
@@ -74761,7 +74838,7 @@ var init_PermissionDialog = __esm({
|
|
|
74761
74838
|
onDecide({ mode: "deny", reason: "user declined" });
|
|
74762
74839
|
});
|
|
74763
74840
|
const title = queueDepth > 0 ? `Tool permission requested (${queueDepth} more queued)` : "Tool permission requested";
|
|
74764
|
-
return (0,
|
|
74841
|
+
return (0, import_jsx_runtime34.jsxs)(Modal, { title, hints: "y allow \xB7 a session \xB7 p always \xB7 n deny", children: [(0, import_jsx_runtime34.jsxs)(Text, { children: ["Tool: ", (0, import_jsx_runtime34.jsx)(Text, { bold: true, children: call.name }), toolDescription ? (0, import_jsx_runtime34.jsxs)(Text, { dimColor: true, children: [" \u2014 ", toolDescription] }) : null] }), (0, import_jsx_runtime34.jsxs)(Text, { dimColor: true, children: ["Input: ", previewToolInput(call.input)] }), (0, import_jsx_runtime34.jsxs)(Text, { children: [(0, import_jsx_runtime34.jsx)(Text, { children: "[y]" }), (0, import_jsx_runtime34.jsx)(Text, { dimColor: true, children: " allow once \xB7 " }), (0, import_jsx_runtime34.jsx)(Text, { children: "[a]" }), (0, import_jsx_runtime34.jsx)(Text, { dimColor: true, children: " allow session \xB7 " }), (0, import_jsx_runtime34.jsx)(Text, { children: "[p]" }), (0, import_jsx_runtime34.jsx)(Text, { dimColor: true, children: " always \xB7 " }), (0, import_jsx_runtime34.jsx)(Text, { color: Colors.danger, children: "[n]" }), (0, import_jsx_runtime34.jsx)(Text, { dimColor: true, children: " deny" })] })] });
|
|
74765
74842
|
};
|
|
74766
74843
|
}
|
|
74767
74844
|
});
|
|
@@ -74810,11 +74887,11 @@ function renderDiffLines(bodyLines) {
|
|
|
74810
74887
|
}
|
|
74811
74888
|
return out;
|
|
74812
74889
|
}
|
|
74813
|
-
var
|
|
74890
|
+
var import_jsx_runtime35, import_react64, MAX_BODY_LINES, ApprovalDialog;
|
|
74814
74891
|
var init_ApprovalDialog = __esm({
|
|
74815
74892
|
async "../plugin-cli/dist/components/ApprovalDialog.js"() {
|
|
74816
|
-
|
|
74817
|
-
|
|
74893
|
+
import_jsx_runtime35 = __toESM(require_jsx_runtime());
|
|
74894
|
+
import_react64 = __toESM(require_react());
|
|
74818
74895
|
await init_build2();
|
|
74819
74896
|
init_theme();
|
|
74820
74897
|
await init_Modal();
|
|
@@ -74828,9 +74905,9 @@ var init_ApprovalDialog = __esm({
|
|
|
74828
74905
|
}
|
|
74829
74906
|
return 0;
|
|
74830
74907
|
})();
|
|
74831
|
-
const [cursor, setCursor] = (0,
|
|
74832
|
-
const [textEntry, setTextEntry] = (0,
|
|
74833
|
-
const [scrollOffset, setScrollOffset] = (0,
|
|
74908
|
+
const [cursor, setCursor] = (0, import_react64.useState)(initialCursor);
|
|
74909
|
+
const [textEntry, setTextEntry] = (0, import_react64.useState)(null);
|
|
74910
|
+
const [scrollOffset, setScrollOffset] = (0, import_react64.useState)(0);
|
|
74834
74911
|
const rawLines = request.body.split("\n");
|
|
74835
74912
|
const diffMode = isDiffBody(request.body);
|
|
74836
74913
|
const rendered = diffMode ? renderDiffLines(rawLines) : rawLines.map((text) => ({ text }));
|
|
@@ -74918,12 +74995,12 @@ var init_ApprovalDialog = __esm({
|
|
|
74918
74995
|
const hiddenAfter = Math.max(0, rendered.length - offset - visible.length);
|
|
74919
74996
|
const baseHints = textEntry ? "Enter submit \xB7 Esc back" : "\u2191\u2193 navigate \xB7 Enter select \xB7 digit jumps \xB7 Esc cancel";
|
|
74920
74997
|
const hints = !textEntry && rendered.length > MAX_BODY_LINES ? `${baseHints} \xB7 j/k scroll` : baseHints;
|
|
74921
|
-
return (0,
|
|
74998
|
+
return (0, import_jsx_runtime35.jsxs)(Modal, { title: request.title, hints, children: [rendered.length > 0 && rendered[0]?.text !== "" ? (0, import_jsx_runtime35.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [hiddenBefore > 0 ? (0, import_jsx_runtime35.jsxs)(Text, { dimColor: true, children: ["\u2191 ", hiddenBefore, " earlier line(s) \u2014 k/PgUp"] }) : null, visible.map((line, i2) => (0, import_jsx_runtime35.jsx)(Text, { ...line.color ? { color: line.color } : {}, ...line.dim ? { dimColor: true } : {}, children: line.text }, i2)), hiddenAfter > 0 ? (0, import_jsx_runtime35.jsxs)(Text, { dimColor: true, children: ["\u2193 ", hiddenAfter, " more line(s) \u2014 j/PgDn"] }) : null] }) : null, textEntry ? (0, import_jsx_runtime35.jsxs)(Box_default, { flexDirection: "column", children: [(0, import_jsx_runtime35.jsx)(Text, { dimColor: true, children: request.options.find((o2) => o2.id === textEntry.optionId)?.textPrompt ?? "Type your message and press Enter (Esc to back out):" }), (0, import_jsx_runtime35.jsxs)(Box_default, { children: [(0, import_jsx_runtime35.jsx)(Text, { children: "\u203A " }), (0, import_jsx_runtime35.jsx)(Text, { children: textEntry.buffer }), (0, import_jsx_runtime35.jsx)(Text, { inverse: true, children: " " })] })] }) : (0, import_jsx_runtime35.jsx)(Box_default, { flexDirection: "column", children: request.options.map((opt, i2) => {
|
|
74922
74999
|
const active2 = i2 === cursor;
|
|
74923
75000
|
const isDanger = !!opt.danger;
|
|
74924
75001
|
const radio = active2 ? "\u25CF" : "\u25CB";
|
|
74925
75002
|
const numLabel = opt.hotkey ?? String(i2 + 1);
|
|
74926
|
-
return (0,
|
|
75003
|
+
return (0, import_jsx_runtime35.jsxs)(Box_default, { children: [(0, import_jsx_runtime35.jsx)(Box_default, { width: 4, children: (0, import_jsx_runtime35.jsx)(Text, { ...active2 ? {} : { dimColor: true }, children: numLabel }) }), (0, import_jsx_runtime35.jsx)(Text, { ...isDanger ? { color: Colors.danger } : active2 ? {} : { dimColor: true }, children: `(${radio}) ` }), (0, import_jsx_runtime35.jsx)(Box_default, { width: 24, children: (0, import_jsx_runtime35.jsx)(Text, { bold: active2, ...isDanger ? { color: Colors.danger } : active2 ? {} : { dimColor: true }, children: opt.label }) }), opt.description ? (0, import_jsx_runtime35.jsx)(Text, { dimColor: true, children: opt.description }) : null] }, opt.id);
|
|
74927
75004
|
}) })] });
|
|
74928
75005
|
};
|
|
74929
75006
|
}
|
|
@@ -75065,20 +75142,20 @@ var init_provider_connect_flow = __esm({
|
|
|
75065
75142
|
});
|
|
75066
75143
|
|
|
75067
75144
|
// ../plugin-cli/dist/components/ProviderConnectDialog.js
|
|
75068
|
-
var
|
|
75145
|
+
var import_jsx_runtime36, import_react65, ProviderConnectDialog;
|
|
75069
75146
|
var init_ProviderConnectDialog = __esm({
|
|
75070
75147
|
async "../plugin-cli/dist/components/ProviderConnectDialog.js"() {
|
|
75071
|
-
|
|
75072
|
-
|
|
75148
|
+
import_jsx_runtime36 = __toESM(require_jsx_runtime());
|
|
75149
|
+
import_react65 = __toESM(require_react());
|
|
75073
75150
|
await init_build2();
|
|
75074
75151
|
init_theme();
|
|
75075
75152
|
await init_Modal();
|
|
75076
75153
|
init_provider_connect_flow();
|
|
75077
75154
|
ProviderConnectDialog = ({ providerId, setup, onSuccess, onCancel }) => {
|
|
75078
|
-
const [phase, setPhase] =
|
|
75079
|
-
const [buffer, setBuffer] =
|
|
75080
|
-
const flowRef =
|
|
75081
|
-
|
|
75155
|
+
const [phase, setPhase] = import_react65.default.useState({ kind: "installing" });
|
|
75156
|
+
const [buffer, setBuffer] = import_react65.default.useState("");
|
|
75157
|
+
const flowRef = import_react65.default.useRef(null);
|
|
75158
|
+
import_react65.default.useEffect(() => {
|
|
75082
75159
|
const flow = createConnectFlow({
|
|
75083
75160
|
setup,
|
|
75084
75161
|
providerId,
|
|
@@ -75126,7 +75203,7 @@ var init_ProviderConnectDialog = __esm({
|
|
|
75126
75203
|
});
|
|
75127
75204
|
const masked = phase.kind === "key-entry" || phase.kind === "oauth" && phase.prompt?.mask === true;
|
|
75128
75205
|
const echo = masked ? "\u2022".repeat(buffer.length) : buffer;
|
|
75129
|
-
return (0,
|
|
75206
|
+
return (0, import_jsx_runtime36.jsxs)(Modal, { title: `connect ${providerId}`, children: [phase.kind === "installing" ? (0, import_jsx_runtime36.jsxs)(Text, { color: Colors.chrome, children: ["installing ", providerId, " \u2014 this can take a minute\u2026"] }) : null, phase.kind === "key-entry" ? (0, import_jsx_runtime36.jsxs)(Box_default, { flexDirection: "column", children: [phase.error ? (0, import_jsx_runtime36.jsx)(Text, { color: Colors.danger, children: phase.error }) : null, phase.validating ? (0, import_jsx_runtime36.jsx)(Text, { color: Colors.chrome, children: "validating key\u2026" }) : (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [(0, import_jsx_runtime36.jsxs)(Text, { children: ["API key: ", (0, import_jsx_runtime36.jsx)(Text, { color: Colors.active, children: echo }), (0, import_jsx_runtime36.jsx)(Text, { color: Colors.chrome, children: "\u258F" })] }), (0, import_jsx_runtime36.jsx)(Text, { color: Colors.chrome, children: "enter save \xB7 esc cancel \u2014 stored in the vault, never in config" })] })] }) : null, phase.kind === "oauth" ? (0, import_jsx_runtime36.jsxs)(Box_default, { flexDirection: "column", children: [phase.lines.slice(-8).map((line, i2) => (0, import_jsx_runtime36.jsx)(Text, { color: Colors.chrome, wrap: "truncate-end", children: line }, `${i2}-${line.slice(0, 12)}`)), phase.prompt ? (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [(0, import_jsx_runtime36.jsx)(Text, { children: phase.prompt.question }), (0, import_jsx_runtime36.jsxs)(Text, { children: [(0, import_jsx_runtime36.jsx)(Text, { color: Colors.active, children: echo }), (0, import_jsx_runtime36.jsx)(Text, { color: Colors.chrome, children: "\u258F" })] })] }) : (0, import_jsx_runtime36.jsx)(Text, { color: Colors.chrome, children: "waiting for sign-in to complete\u2026 esc to cancel" })] }) : null, phase.kind === "done" ? (0, import_jsx_runtime36.jsxs)(Text, { color: Colors.active, children: ["\u2713 connected", phase.note ? ` \u2014 ${phase.note}` : ""] }) : null, phase.kind === "failed" ? (0, import_jsx_runtime36.jsxs)(Box_default, { flexDirection: "column", children: [(0, import_jsx_runtime36.jsx)(Text, { color: Colors.danger, children: phase.message }), (0, import_jsx_runtime36.jsx)(Text, { color: Colors.chrome, children: phase.retryable ? "r retry \xB7 esc close" : "esc close" })] }) : null] });
|
|
75130
75207
|
};
|
|
75131
75208
|
}
|
|
75132
75209
|
});
|
|
@@ -75193,24 +75270,24 @@ var init_plugin_setup_flow = __esm({
|
|
|
75193
75270
|
});
|
|
75194
75271
|
|
|
75195
75272
|
// ../plugin-cli/dist/components/PluginSetupDialog.js
|
|
75196
|
-
var
|
|
75273
|
+
var import_jsx_runtime37, import_react66, PluginSetupDialog;
|
|
75197
75274
|
var init_PluginSetupDialog = __esm({
|
|
75198
75275
|
async "../plugin-cli/dist/components/PluginSetupDialog.js"() {
|
|
75199
|
-
|
|
75200
|
-
|
|
75276
|
+
import_jsx_runtime37 = __toESM(require_jsx_runtime());
|
|
75277
|
+
import_react66 = __toESM(require_react());
|
|
75201
75278
|
await init_build2();
|
|
75202
75279
|
init_theme();
|
|
75203
75280
|
await init_Modal();
|
|
75204
75281
|
init_plugin_setup_flow();
|
|
75205
75282
|
PluginSetupDialog = ({ packageName, spec, onFinish }) => {
|
|
75206
|
-
const flowRef =
|
|
75283
|
+
const flowRef = import_react66.default.useRef(null);
|
|
75207
75284
|
if (flowRef.current === null) {
|
|
75208
75285
|
flowRef.current = createPluginSetupFlow(spec, onFinish);
|
|
75209
75286
|
}
|
|
75210
75287
|
const flow = flowRef.current;
|
|
75211
|
-
const [, bump] =
|
|
75212
|
-
const [buffer, setBuffer] =
|
|
75213
|
-
const [selectIndex, setSelectIndex] =
|
|
75288
|
+
const [, bump] = import_react66.default.useReducer((n2) => n2 + 1, 0);
|
|
75289
|
+
const [buffer, setBuffer] = import_react66.default.useState("");
|
|
75290
|
+
const [selectIndex, setSelectIndex] = import_react66.default.useState(0);
|
|
75214
75291
|
const field = flow.current();
|
|
75215
75292
|
const state = flow.state();
|
|
75216
75293
|
use_input_default((input, key) => {
|
|
@@ -75266,7 +75343,7 @@ var init_PluginSetupDialog = __esm({
|
|
|
75266
75343
|
}
|
|
75267
75344
|
});
|
|
75268
75345
|
const progress = `${Math.min(state.index + 1, spec.fields.length)}/${spec.fields.length}`;
|
|
75269
|
-
return (0,
|
|
75346
|
+
return (0, import_jsx_runtime37.jsxs)(Modal, { title: `setup ${packageName}`, subtitle: spec.title, children: [spec.description ? (0, import_jsx_runtime37.jsx)(Text, { color: Colors.chrome, children: spec.description }) : null, field ? (0, import_jsx_runtime37.jsxs)(Box_default, { flexDirection: "column", children: [state.error ? (0, import_jsx_runtime37.jsx)(Text, { color: Colors.danger, children: state.error }) : null, (0, import_jsx_runtime37.jsxs)(Text, { children: [(0, import_jsx_runtime37.jsxs)(Text, { color: Colors.chrome, children: ["[", progress, "] "] }), field.label, field.required === false ? (0, import_jsx_runtime37.jsx)(Text, { color: Colors.chrome, children: " (optional)" }) : null] }), field.description ? (0, import_jsx_runtime37.jsx)(Text, { color: Colors.chrome, children: field.description }) : null, field.kind === "boolean" ? (0, import_jsx_runtime37.jsx)(Text, { color: Colors.chrome, children: "y yes \xB7 n no \xB7 tab skip \xB7 esc cancel" }) : field.kind === "select" ? (0, import_jsx_runtime37.jsxs)(Box_default, { flexDirection: "column", children: [(field.options ?? []).map((c2, i2) => (0, import_jsx_runtime37.jsxs)(Text, { color: i2 === selectIndex ? Colors.active : void 0, children: [i2 === selectIndex ? "\u203A " : " ", c2] }, c2)), (0, import_jsx_runtime37.jsx)(Text, { color: Colors.chrome, children: "\u2191\u2193 choose \xB7 enter confirm \xB7 esc cancel" })] }) : (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [(0, import_jsx_runtime37.jsxs)(Text, { children: [(0, import_jsx_runtime37.jsx)(Text, { color: Colors.active, children: field.kind === "secret" ? "\u2022".repeat(buffer.length) : buffer }), (0, import_jsx_runtime37.jsx)(Text, { color: Colors.chrome, children: "\u258F" })] }), (0, import_jsx_runtime37.jsx)(Text, { color: Colors.chrome, children: field.kind === "secret" ? "enter save (empty keeps an existing value) \xB7 esc cancel" : "enter save \xB7 tab skip \xB7 esc cancel" })] })] }) : (0, import_jsx_runtime37.jsx)(Text, { color: Colors.chrome, children: "saving\u2026" })] });
|
|
75270
75347
|
};
|
|
75271
75348
|
}
|
|
75272
75349
|
});
|
|
@@ -75283,17 +75360,17 @@ function buildHints(searchable, hasTabs) {
|
|
|
75283
75360
|
parts.push("Esc close");
|
|
75284
75361
|
return parts.join(" \xB7 ");
|
|
75285
75362
|
}
|
|
75286
|
-
var
|
|
75363
|
+
var import_jsx_runtime38, import_react67, ListPicker, SearchBar;
|
|
75287
75364
|
var init_ListPicker = __esm({
|
|
75288
75365
|
async "../plugin-cli/dist/components/ListPicker.js"() {
|
|
75289
|
-
|
|
75290
|
-
|
|
75366
|
+
import_jsx_runtime38 = __toESM(require_jsx_runtime());
|
|
75367
|
+
import_react67 = __toESM(require_react());
|
|
75291
75368
|
await init_build2();
|
|
75292
75369
|
init_theme();
|
|
75293
75370
|
await init_Modal();
|
|
75294
75371
|
ListPicker = ({ title, options, tabs, initialTabId, searchable, searchPlaceholder, onSelect, onCancel }) => {
|
|
75295
75372
|
const hasTabs = !!(tabs && tabs.length > 0);
|
|
75296
|
-
const defaultTabId = (0,
|
|
75373
|
+
const defaultTabId = (0, import_react67.useMemo)(() => {
|
|
75297
75374
|
if (!hasTabs)
|
|
75298
75375
|
return void 0;
|
|
75299
75376
|
if (initialTabId && tabs.some((t2) => t2.id === initialTabId))
|
|
@@ -75301,13 +75378,13 @@ var init_ListPicker = __esm({
|
|
|
75301
75378
|
const tabWithCurrent = tabs.find((t2) => t2.options.some((o2) => o2.current));
|
|
75302
75379
|
return (tabWithCurrent ?? tabs[0]).id;
|
|
75303
75380
|
}, [hasTabs, initialTabId, tabs]);
|
|
75304
|
-
const [activeTabId, setActiveTabId] = (0,
|
|
75305
|
-
const [query, setQuery] = (0,
|
|
75306
|
-
const [cursor, setCursor] = (0,
|
|
75307
|
-
const [noSelectNotice, setNoSelectNotice] = (0,
|
|
75308
|
-
const activeTab = (0,
|
|
75381
|
+
const [activeTabId, setActiveTabId] = (0, import_react67.useState)(defaultTabId);
|
|
75382
|
+
const [query, setQuery] = (0, import_react67.useState)("");
|
|
75383
|
+
const [cursor, setCursor] = (0, import_react67.useState)(0);
|
|
75384
|
+
const [noSelectNotice, setNoSelectNotice] = (0, import_react67.useState)(false);
|
|
75385
|
+
const activeTab = (0, import_react67.useMemo)(() => hasTabs ? tabs.find((t2) => t2.id === activeTabId) ?? tabs[0] : null, [hasTabs, tabs, activeTabId]);
|
|
75309
75386
|
const sourceOptions = activeTab ? activeTab.options : options ?? [];
|
|
75310
|
-
const filtered = (0,
|
|
75387
|
+
const filtered = (0, import_react67.useMemo)(() => {
|
|
75311
75388
|
if (!searchable || !query.trim())
|
|
75312
75389
|
return sourceOptions;
|
|
75313
75390
|
const q4 = query.trim().toLowerCase();
|
|
@@ -75321,19 +75398,19 @@ var init_ListPicker = __esm({
|
|
|
75321
75398
|
return false;
|
|
75322
75399
|
});
|
|
75323
75400
|
}, [searchable, query, sourceOptions]);
|
|
75324
|
-
(0,
|
|
75401
|
+
(0, import_react67.useEffect)(() => {
|
|
75325
75402
|
setQuery("");
|
|
75326
75403
|
setCursor(0);
|
|
75327
75404
|
}, [activeTabId]);
|
|
75328
|
-
(0,
|
|
75405
|
+
(0, import_react67.useEffect)(() => {
|
|
75329
75406
|
if (cursor >= filtered.length)
|
|
75330
75407
|
setCursor(Math.max(0, filtered.length - 1));
|
|
75331
75408
|
}, [filtered.length, cursor]);
|
|
75332
|
-
(0,
|
|
75409
|
+
(0, import_react67.useEffect)(() => {
|
|
75333
75410
|
if (noSelectNotice)
|
|
75334
75411
|
setNoSelectNotice(false);
|
|
75335
75412
|
}, [query, filtered.length]);
|
|
75336
|
-
(0,
|
|
75413
|
+
(0, import_react67.useEffect)(() => {
|
|
75337
75414
|
if (query)
|
|
75338
75415
|
return;
|
|
75339
75416
|
const idx = filtered.findIndex((o2) => o2.current);
|
|
@@ -75395,15 +75472,15 @@ var init_ListPicker = __esm({
|
|
|
75395
75472
|
const subtitle = filtered.length === 0 ? query ? `no matches for "${query}"` : "no options" : `${cursor + 1} of ${filtered.length}` + (searchable && query ? ` \xB7 filtered from ${sourceOptions.length}` : "");
|
|
75396
75473
|
const hints = buildHints(searchable, hasTabs);
|
|
75397
75474
|
const modalTabs = hasTabs ? tabs.map((t2) => ({ id: t2.id, label: t2.label })) : void 0;
|
|
75398
|
-
return (0,
|
|
75475
|
+
return (0, import_jsx_runtime38.jsxs)(Modal, { title, subtitle, hints, ...modalTabs ? { tabs: modalTabs, activeTabId, onTabChange: setActiveTabId } : {}, children: [searchable ? (0, import_jsx_runtime38.jsx)(SearchBar, { query, placeholder: searchPlaceholder ?? "type to filter" }) : null, (0, import_jsx_runtime38.jsxs)(Box_default, { flexDirection: "column", children: [filtered.length === 0 ? (0, import_jsx_runtime38.jsx)(Text, { ...noSelectNotice ? { color: Colors.busy } : { dimColor: true }, children: noSelectNotice ? "nothing to select \u2014 clear the filter or press Esc" : query ? `(no options match "${query}")` : "(no options)" }) : null, moreAbove > 0 ? (0, import_jsx_runtime38.jsx)(Text, { dimColor: true, children: ` \u2191 ${moreAbove} more` }) : null, filtered.slice(start, end).map((opt, idx) => {
|
|
75399
75476
|
const i2 = start + idx;
|
|
75400
75477
|
const prevGroup = i2 > 0 ? filtered[i2 - 1].group : void 0;
|
|
75401
75478
|
const showHeader = !hasTabs && opt.group != null && opt.group !== prevGroup;
|
|
75402
75479
|
const focused = i2 === cursor;
|
|
75403
|
-
return (0,
|
|
75404
|
-
}), moreBelow > 0 ? (0,
|
|
75480
|
+
return (0, import_jsx_runtime38.jsxs)(import_react67.default.Fragment, { children: [showHeader ? (0, import_jsx_runtime38.jsx)(Box_default, { marginTop: idx === 0 ? 0 : 1, children: (0, import_jsx_runtime38.jsx)(Text, { dimColor: true, children: opt.group }) }) : null, (0, import_jsx_runtime38.jsxs)(Box_default, { children: [(0, import_jsx_runtime38.jsx)(Text, { ...focused ? {} : { dimColor: true }, children: focused ? "\u203A " : " " }), (0, import_jsx_runtime38.jsx)(Text, { ...focused ? { bold: true } : {}, children: opt.label }), opt.current ? (0, import_jsx_runtime38.jsx)(Text, { dimColor: true, children: " (current)" }) : null, opt.badge ? (0, import_jsx_runtime38.jsx)(Text, { color: opt.badgeColor === "red" ? Colors.danger : opt.badgeColor ?? Colors.danger, children: ` [${opt.badge}]` }) : null, opt.description ? (0, import_jsx_runtime38.jsx)(Text, { dimColor: true, children: ` \u2014 ${opt.description}` }) : null] })] }, opt.id);
|
|
75481
|
+
}), moreBelow > 0 ? (0, import_jsx_runtime38.jsx)(Text, { dimColor: true, children: ` \u2193 ${moreBelow} more` }) : null] })] });
|
|
75405
75482
|
};
|
|
75406
|
-
SearchBar = ({ query, placeholder }) => (0,
|
|
75483
|
+
SearchBar = ({ query, placeholder }) => (0, import_jsx_runtime38.jsxs)(Box_default, { marginBottom: 1, children: [(0, import_jsx_runtime38.jsx)(Text, { dimColor: true, children: "/ " }), query ? (0, import_jsx_runtime38.jsx)(Text, { children: query }) : (0, import_jsx_runtime38.jsx)(Text, { dimColor: true, children: placeholder }), (0, import_jsx_runtime38.jsx)(Text, { children: "\u258C" })] });
|
|
75407
75484
|
}
|
|
75408
75485
|
});
|
|
75409
75486
|
|
|
@@ -75412,10 +75489,10 @@ function oneLinePreview(s2) {
|
|
|
75412
75489
|
const flat = s2.replace(/\s+/g, " ").trim();
|
|
75413
75490
|
return flat.length <= PREVIEW_MAX ? flat : flat.slice(0, PREVIEW_MAX) + "\u2026";
|
|
75414
75491
|
}
|
|
75415
|
-
var
|
|
75492
|
+
var import_jsx_runtime39, PREVIEW_MAX, QueueView;
|
|
75416
75493
|
var init_QueueView = __esm({
|
|
75417
75494
|
async "../plugin-cli/dist/components/QueueView.js"() {
|
|
75418
|
-
|
|
75495
|
+
import_jsx_runtime39 = __toESM(require_jsx_runtime());
|
|
75419
75496
|
__toESM(require_react());
|
|
75420
75497
|
await init_build2();
|
|
75421
75498
|
init_theme();
|
|
@@ -75436,7 +75513,7 @@ var init_QueueView = __esm({
|
|
|
75436
75513
|
restCount = messages.length - 1;
|
|
75437
75514
|
}
|
|
75438
75515
|
const restPart = restCount > 0 ? ` \xB7 +${restCount} more` : "";
|
|
75439
|
-
return (0,
|
|
75516
|
+
return (0, import_jsx_runtime39.jsx)(Box_default, { flexDirection: "column", borderStyle: "single", borderBottom: false, borderLeft: false, borderRight: false, borderColor: "blackBright", borderDimColor: true, children: (0, import_jsx_runtime39.jsxs)(Box_default, { children: [(0, import_jsx_runtime39.jsxs)(Text, { color: "blackBright", dimColor: true, children: [Glyphs.contextUp, " "] }), (0, import_jsx_runtime39.jsxs)(Text, { dimColor: true, children: [headLabel, ": ", oneLinePreview(headText), restPart, " \xB7 \u2303t send \xB7 \u2303b drop"] })] }) });
|
|
75440
75517
|
};
|
|
75441
75518
|
}
|
|
75442
75519
|
});
|
|
@@ -75447,10 +75524,10 @@ function buildPromptPlaceholder(busy2, voiceReady = true) {
|
|
|
75447
75524
|
return "type to queue a message \u2014 sent after the current turn (ctrl+t to force-send first)";
|
|
75448
75525
|
return voiceReady ? "type a prompt, / for commands, Ctrl+R voice" : "type a prompt, / for commands";
|
|
75449
75526
|
}
|
|
75450
|
-
var
|
|
75527
|
+
var import_jsx_runtime40, InteractiveZone;
|
|
75451
75528
|
var init_InteractiveZone = __esm({
|
|
75452
75529
|
async "../plugin-cli/dist/session/InteractiveZone.js"() {
|
|
75453
|
-
|
|
75530
|
+
import_jsx_runtime40 = __toESM(require_jsx_runtime());
|
|
75454
75531
|
__toESM(require_react());
|
|
75455
75532
|
await init_build2();
|
|
75456
75533
|
await init_PermissionDialog();
|
|
@@ -75462,29 +75539,29 @@ var init_InteractiveZone = __esm({
|
|
|
75462
75539
|
await init_QueueView();
|
|
75463
75540
|
InteractiveZone = ({ session, pendingPermission, pendingPermissionDepth, pendingApproval, picker, pluginSetup, onPluginSetupFinish, providerConnect, onProviderConnectSuccess, onProviderConnectCancel, busy: busy2, voiceReady, voicePhase, yolo, slashCommands, queueMessages, priorityMessage, commandHotkeys, onCycleMode, externalInsert, onPermissionDecide, onApprovalDecide, onPickerSelect, onPickerCancel, onSubmit, onPasteText }) => {
|
|
75464
75541
|
if (pendingPermission) {
|
|
75465
|
-
return (0,
|
|
75542
|
+
return (0, import_jsx_runtime40.jsx)(PermissionDialog, { call: pendingPermission.call, toolDescription: session.tools.get(pendingPermission.call.name)?.description, queueDepth: pendingPermissionDepth, onDecide: (decision) => onPermissionDecide(pendingPermission, decision) });
|
|
75466
75543
|
}
|
|
75467
75544
|
if (pendingApproval) {
|
|
75468
|
-
return (0,
|
|
75545
|
+
return (0, import_jsx_runtime40.jsx)(ApprovalDialog, { request: pendingApproval.request, onDecide: (decision) => onApprovalDecide(decision) });
|
|
75469
75546
|
}
|
|
75470
75547
|
if (pluginSetup) {
|
|
75471
|
-
return (0,
|
|
75548
|
+
return (0, import_jsx_runtime40.jsx)(PluginSetupDialog, { packageName: pluginSetup.packageName, spec: pluginSetup.spec, onFinish: onPluginSetupFinish }, pluginSetup.packageName);
|
|
75472
75549
|
}
|
|
75473
75550
|
if (providerConnect && session.providerSetup) {
|
|
75474
|
-
return (0,
|
|
75551
|
+
return (0, import_jsx_runtime40.jsx)(ProviderConnectDialog, { providerId: providerConnect.providerId, setup: session.providerSetup, onSuccess: onProviderConnectSuccess, onCancel: onProviderConnectCancel }, providerConnect.providerId);
|
|
75475
75552
|
}
|
|
75476
75553
|
if (picker) {
|
|
75477
|
-
return picker.kind === "model" || picker.kind === "plugins" ? (0,
|
|
75554
|
+
return picker.kind === "model" || picker.kind === "plugins" ? (0, import_jsx_runtime40.jsx)(ListPicker, { title: picker.title, tabs: picker.tabs, ...picker.initialTabId ? { initialTabId: picker.initialTabId } : {}, searchable: picker.searchable ?? true, ...picker.searchPlaceholder ? { searchPlaceholder: picker.searchPlaceholder } : {}, onSelect: (id) => onPickerSelect(picker, id), onCancel: onPickerCancel }) : (0, import_jsx_runtime40.jsx)(ListPicker, { title: picker.title, options: picker.options, ...picker.kind === "sessions" && picker.searchable ? { searchable: true } : {}, ...picker.kind === "sessions" && picker.searchPlaceholder ? { searchPlaceholder: picker.searchPlaceholder } : {}, onSelect: (id) => onPickerSelect(picker, id), onCancel: onPickerCancel });
|
|
75478
75555
|
}
|
|
75479
|
-
return (0,
|
|
75556
|
+
return (0, import_jsx_runtime40.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [(0, import_jsx_runtime40.jsx)(QueueView, { messages: queueMessages, priority: priorityMessage }), (0, import_jsx_runtime40.jsx)(InputBox, { onSubmit, disabled: false, yolo, voicePhase, slashCommands, placeholder: buildPromptPlaceholder(busy2, voiceReady), onPasteText, commandHotkeys, onShiftTab: onCycleMode, externalInsert })] });
|
|
75480
75557
|
};
|
|
75481
75558
|
}
|
|
75482
75559
|
});
|
|
75483
|
-
var
|
|
75560
|
+
var import_jsx_runtime41, import_react70, SessionView;
|
|
75484
75561
|
var init_SessionView = __esm({
|
|
75485
75562
|
async "../plugin-cli/dist/session/SessionView.js"() {
|
|
75486
|
-
|
|
75487
|
-
|
|
75563
|
+
import_jsx_runtime41 = __toESM(require_jsx_runtime());
|
|
75564
|
+
import_react70 = __toESM(require_react());
|
|
75488
75565
|
await init_build2();
|
|
75489
75566
|
await init_build2();
|
|
75490
75567
|
init_dist2();
|
|
@@ -75507,18 +75584,18 @@ var init_SessionView = __esm({
|
|
|
75507
75584
|
SessionView = ({ session, registerInteractiveResolver, getVault, getChannels, model, version, updateAvailable, initialPrompt, initialNotice, canSwitchSession, onSwitchSession }) => {
|
|
75508
75585
|
const { exit } = use_app_default();
|
|
75509
75586
|
const stream = useEventStream(session);
|
|
75510
|
-
const [systemNotice, setSystemNotice] = (0,
|
|
75511
|
-
const [overlay, setOverlay] = (0,
|
|
75512
|
-
const [expandToolOutputs, setExpandToolOutputs] = (0,
|
|
75513
|
-
const [yolo, setYolo] = (0,
|
|
75587
|
+
const [systemNotice, setSystemNotice] = (0, import_react70.useState)(initialNotice ?? null);
|
|
75588
|
+
const [overlay, setOverlay] = (0, import_react70.useState)(null);
|
|
75589
|
+
const [expandToolOutputs, setExpandToolOutputs] = (0, import_react70.useState)(false);
|
|
75590
|
+
const [yolo, setYolo] = (0, import_react70.useState)(false);
|
|
75514
75591
|
const { mcpStatus, refreshMcpStatus } = useMcpStatus(session);
|
|
75515
|
-
const [activeModelOverride, setActiveModelOverride] = (0,
|
|
75516
|
-
const [picker, setPicker] = (0,
|
|
75592
|
+
const [activeModelOverride, setActiveModelOverride] = (0, import_react70.useState)(null);
|
|
75593
|
+
const [picker, setPicker] = (0, import_react70.useState)(null);
|
|
75517
75594
|
const permissions = usePermissionQueue(session, registerInteractiveResolver);
|
|
75518
75595
|
const images = useImageAttachments((msg) => setSystemNotice(msg));
|
|
75519
75596
|
const voice = useVoiceInput({ session, setSystemNotice });
|
|
75520
75597
|
const readAloud = useReadAloud({ session, setSystemNotice });
|
|
75521
|
-
(0,
|
|
75598
|
+
(0, import_react70.useEffect)(() => {
|
|
75522
75599
|
permissions.yoloRef.current = yolo;
|
|
75523
75600
|
}, [yolo, permissions.yoloRef]);
|
|
75524
75601
|
const turn = useTurnRunner({
|
|
@@ -75557,7 +75634,7 @@ var init_SessionView = __esm({
|
|
|
75557
75634
|
},
|
|
75558
75635
|
r: voice.toggleVoiceInput
|
|
75559
75636
|
};
|
|
75560
|
-
const compactTools = (0,
|
|
75637
|
+
const compactTools = (0, import_react70.useMemo)(() => {
|
|
75561
75638
|
const m3 = /* @__PURE__ */ new Map();
|
|
75562
75639
|
for (const tool of session.tools.list()) {
|
|
75563
75640
|
if (tool.compact)
|
|
@@ -75571,7 +75648,7 @@ var init_SessionView = __esm({
|
|
|
75571
75648
|
const contextUsed = estimateContextTokens(session.log);
|
|
75572
75649
|
const modeName = getModeName(session);
|
|
75573
75650
|
const modeBadge = getModeBadge(session);
|
|
75574
|
-
const cycleMode =
|
|
75651
|
+
const cycleMode = import_react70.default.useCallback(() => {
|
|
75575
75652
|
const modes = session.modes.list().filter(isSelectableMode);
|
|
75576
75653
|
if (modes.length === 0)
|
|
75577
75654
|
return;
|
|
@@ -75590,12 +75667,12 @@ var init_SessionView = __esm({
|
|
|
75590
75667
|
} catch {
|
|
75591
75668
|
}
|
|
75592
75669
|
}, [session]);
|
|
75593
|
-
const slashSuggestions =
|
|
75594
|
-
const installInFlightRef =
|
|
75595
|
-
const [providerConnect, setProviderConnect] =
|
|
75596
|
-
const [pluginSetup, setPluginSetup] =
|
|
75597
|
-
const rerunSlashRef =
|
|
75598
|
-
const handlePickerSelect =
|
|
75670
|
+
const slashSuggestions = import_react70.default.useMemo(() => buildSlashSuggestions(session), [session]);
|
|
75671
|
+
const installInFlightRef = import_react70.default.useRef(false);
|
|
75672
|
+
const [providerConnect, setProviderConnect] = import_react70.default.useState(null);
|
|
75673
|
+
const [pluginSetup, setPluginSetup] = import_react70.default.useState(null);
|
|
75674
|
+
const rerunSlashRef = import_react70.default.useRef(() => void 0);
|
|
75675
|
+
const handlePickerSelect = import_react70.default.useMemo(() => makePickerHandler({
|
|
75599
75676
|
session,
|
|
75600
75677
|
providerName: providerName2,
|
|
75601
75678
|
setPicker,
|
|
@@ -75713,8 +75790,8 @@ var init_SessionView = __esm({
|
|
|
75713
75790
|
rerunSlashRef.current = (line) => {
|
|
75714
75791
|
void handleSubmit(line);
|
|
75715
75792
|
};
|
|
75716
|
-
const firedInitial = (0,
|
|
75717
|
-
(0,
|
|
75793
|
+
const firedInitial = (0, import_react70.useRef)(false);
|
|
75794
|
+
(0, import_react70.useEffect)(() => {
|
|
75718
75795
|
if (firedInitial.current)
|
|
75719
75796
|
return;
|
|
75720
75797
|
if (!initialPrompt)
|
|
@@ -75722,14 +75799,14 @@ var init_SessionView = __esm({
|
|
|
75722
75799
|
firedInitial.current = true;
|
|
75723
75800
|
void handleSubmit(initialPrompt);
|
|
75724
75801
|
}, [initialPrompt]);
|
|
75725
|
-
const firedUpdateNotice = (0,
|
|
75726
|
-
(0,
|
|
75802
|
+
const firedUpdateNotice = (0, import_react70.useRef)(false);
|
|
75803
|
+
(0, import_react70.useEffect)(() => {
|
|
75727
75804
|
if (firedUpdateNotice.current || !updateAvailable || initialPrompt)
|
|
75728
75805
|
return;
|
|
75729
75806
|
firedUpdateNotice.current = true;
|
|
75730
75807
|
setSystemNotice(`\u2728 moxxy ${updateAvailable.latest} available \u2014 run \`moxxy update\``);
|
|
75731
75808
|
}, [updateAvailable, initialPrompt]);
|
|
75732
|
-
return (0,
|
|
75809
|
+
return (0, import_jsx_runtime41.jsxs)(Box_default, { flexDirection: "column", children: [(0, import_jsx_runtime41.jsx)(ChatView, { events: stream.events, streamingDelta: stream.streamingDelta, reasoningDelta: stream.reasoningDelta, expandToolOutputs, compactTools, hideLive: overlay != null || picker != null || pendingPermission != null || pendingApproval != null }), (0, import_jsx_runtime41.jsx)(OverlayOrNotice, { overlay, systemNotice, session, events: stream.events, contextWindow, contextTokens: contextUsed, ...getVault ? { getVault } : {}, ...getChannels ? { getChannels } : {}, onClose: () => setOverlay(null) }), (0, import_jsx_runtime41.jsx)(InteractiveZone, { session, pendingPermission, pendingPermissionDepth: Math.max(0, permissions.pendingPermissions.length - 1), pendingApproval, picker, pluginSetup, onPluginSetupFinish: (values) => {
|
|
75733
75810
|
const target = pluginSetup;
|
|
75734
75811
|
setPluginSetup(null);
|
|
75735
75812
|
if (!target)
|
|
@@ -75785,7 +75862,7 @@ var init_SessionView = __esm({
|
|
|
75785
75862
|
return;
|
|
75786
75863
|
}
|
|
75787
75864
|
setPicker(null);
|
|
75788
|
-
}, onSubmit: handleSubmit, onPasteText: images.handlePasteText }), (0,
|
|
75865
|
+
}, onSubmit: handleSubmit, onPasteText: images.handlePasteText }), (0, import_jsx_runtime41.jsx)(StatusLine, { busyStartedAt: turn.busy && !pendingPermission && !pendingApproval ? turn.busyStartedAt : null, queueCount: turn.queueCount, modeName, modeBadge, provider: providerName2, model: activeModel2, mcp: mcpStatus, contextUsed, ...contextWindow ? { contextWindow } : {}, ...version ? { version } : {}, ...updateAvailable ? { updateLatest: updateAvailable.latest } : {} })] });
|
|
75789
75866
|
};
|
|
75790
75867
|
}
|
|
75791
75868
|
});
|
|
@@ -75794,11 +75871,11 @@ var init_SessionView = __esm({
|
|
|
75794
75871
|
function buildBootPlaceholder(voiceReady) {
|
|
75795
75872
|
return voiceReady ? "type a prompt to begin \xB7 / for commands \xB7 Ctrl+R voice" : "type a prompt to begin \xB7 / for commands";
|
|
75796
75873
|
}
|
|
75797
|
-
var
|
|
75874
|
+
var import_jsx_runtime42, import_react71, InteractiveSession, BootInputArea, DisabledBootInput;
|
|
75798
75875
|
var init_BootShell = __esm({
|
|
75799
75876
|
async "../plugin-cli/dist/session/BootShell.js"() {
|
|
75800
|
-
|
|
75801
|
-
|
|
75877
|
+
import_jsx_runtime42 = __toESM(require_jsx_runtime());
|
|
75878
|
+
import_react71 = __toESM(require_react());
|
|
75802
75879
|
await init_build2();
|
|
75803
75880
|
await init_BootScreen();
|
|
75804
75881
|
await init_InputBox();
|
|
@@ -75808,15 +75885,15 @@ var init_BootShell = __esm({
|
|
|
75808
75885
|
init_use_voice_input();
|
|
75809
75886
|
await init_helpers();
|
|
75810
75887
|
InteractiveSession = ({ session: eagerSession, bootstrap, registerInteractiveResolver, getVault, getChannels, model, version, updateAvailable, resumed, switchSession }) => {
|
|
75811
|
-
const [session, setSession] = (0,
|
|
75812
|
-
const [bootEvents, setBootEvents] = (0,
|
|
75813
|
-
const [bootError, setBootError] = (0,
|
|
75814
|
-
const [initialPrompt, setInitialPrompt] = (0,
|
|
75815
|
-
const [landedViaSwitch, setLandedViaSwitch] = (0,
|
|
75816
|
-
const switchingRef = (0,
|
|
75817
|
-
const [switchNotice, setSwitchNotice] = (0,
|
|
75818
|
-
const startedAt =
|
|
75819
|
-
const handleSwitchSession = (0,
|
|
75888
|
+
const [session, setSession] = (0, import_react71.useState)(eagerSession ?? null);
|
|
75889
|
+
const [bootEvents, setBootEvents] = (0, import_react71.useState)([]);
|
|
75890
|
+
const [bootError, setBootError] = (0, import_react71.useState)(null);
|
|
75891
|
+
const [initialPrompt, setInitialPrompt] = (0, import_react71.useState)(null);
|
|
75892
|
+
const [landedViaSwitch, setLandedViaSwitch] = (0, import_react71.useState)(false);
|
|
75893
|
+
const switchingRef = (0, import_react71.useRef)(false);
|
|
75894
|
+
const [switchNotice, setSwitchNotice] = (0, import_react71.useState)(null);
|
|
75895
|
+
const startedAt = import_react71.default.useMemo(() => Date.now(), []);
|
|
75896
|
+
const handleSwitchSession = (0, import_react71.useCallback)(async (target) => {
|
|
75820
75897
|
if (!switchSession)
|
|
75821
75898
|
throw new Error("switching sessions is not available");
|
|
75822
75899
|
if (switchingRef.current)
|
|
@@ -75833,7 +75910,7 @@ var init_BootShell = __esm({
|
|
|
75833
75910
|
switchingRef.current = false;
|
|
75834
75911
|
}
|
|
75835
75912
|
}, [switchSession]);
|
|
75836
|
-
(0,
|
|
75913
|
+
(0, import_react71.useEffect)(() => {
|
|
75837
75914
|
if (eagerSession || !bootstrap)
|
|
75838
75915
|
return;
|
|
75839
75916
|
let cancelled = false;
|
|
@@ -75877,28 +75954,28 @@ var init_BootShell = __esm({
|
|
|
75877
75954
|
};
|
|
75878
75955
|
}, [eagerSession, bootstrap]);
|
|
75879
75956
|
if (!session || initialPrompt == null && !resumed && !landedViaSwitch) {
|
|
75880
|
-
return (0,
|
|
75957
|
+
return (0, import_jsx_runtime42.jsxs)(Box_default, { flexDirection: "column", children: [(0, import_jsx_runtime42.jsx)(BootScreen, { events: bootEvents, startedAt, ...bootError ? { error: bootError } : {} }), session ? (0, import_jsx_runtime42.jsx)(BootInputArea, { session, ready: bootError == null, bootError, onSubmit: (text) => setInitialPrompt(text) }) : (0, import_jsx_runtime42.jsx)(DisabledBootInput, { placeholder: bootError ? "Bootstrap failed \u2014 quit and run `moxxy init`" : "Initializing\u2026" })] });
|
|
75881
75958
|
}
|
|
75882
75959
|
return (
|
|
75883
75960
|
// Key by session id so switching fully re-mounts the view — every
|
|
75884
75961
|
// session-keyed hook (event stream, turn runner, permission queue) resets to
|
|
75885
75962
|
// the new session instead of carrying the prior one's state across.
|
|
75886
|
-
(0,
|
|
75963
|
+
(0, import_jsx_runtime42.jsx)(SessionView, { session, registerInteractiveResolver, ...getVault ? { getVault } : {}, ...getChannels ? { getChannels } : {}, ...initialPrompt ? { initialPrompt } : {}, ...switchNotice ? { initialNotice: switchNotice } : {}, ...model ? { model } : {}, ...version ? { version } : {}, ...updateAvailable ? { updateAvailable } : {}, canSwitchSession: Boolean(switchSession), onSwitchSession: handleSwitchSession }, session.id)
|
|
75887
75964
|
);
|
|
75888
75965
|
};
|
|
75889
75966
|
BootInputArea = ({ session, ready, bootError, onSubmit }) => {
|
|
75890
|
-
const [systemNotice, setSystemNotice] = (0,
|
|
75967
|
+
const [systemNotice, setSystemNotice] = (0, import_react71.useState)(null);
|
|
75891
75968
|
const voice = useVoiceInput({ session, setSystemNotice });
|
|
75892
75969
|
const commandHotkeys = ready ? { r: voice.toggleVoiceInput } : {};
|
|
75893
|
-
return (0,
|
|
75970
|
+
return (0, import_jsx_runtime42.jsxs)(Box_default, { flexDirection: "column", children: [(0, import_jsx_runtime42.jsx)(Box_default, { marginTop: 2, children: (0, import_jsx_runtime42.jsx)(InputBox, { disabled: !ready, voicePhase: voice.phase, externalInsert: voice.externalInsert, commandHotkeys, placeholder: ready ? buildBootPlaceholder(voice.ready) : bootError ? "Bootstrap failed \u2014 quit and run `moxxy init`" : "Initializing\u2026", onSubmit: (text) => {
|
|
75894
75971
|
if (!ready)
|
|
75895
75972
|
return;
|
|
75896
75973
|
const trimmed = text.trim();
|
|
75897
75974
|
if (trimmed)
|
|
75898
75975
|
onSubmit(trimmed);
|
|
75899
|
-
} }) }), systemNotice ? (0,
|
|
75976
|
+
} }) }), systemNotice ? (0, import_jsx_runtime42.jsx)(SystemNotice, { notice: systemNotice }) : null, (0, import_jsx_runtime42.jsx)(Box_default, { children: (0, import_jsx_runtime42.jsx)(FooterHints, { mode: "boot", voiceReady: voice.ready }) })] });
|
|
75900
75977
|
};
|
|
75901
|
-
DisabledBootInput = ({ placeholder }) => (0,
|
|
75978
|
+
DisabledBootInput = ({ placeholder }) => (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [(0, import_jsx_runtime42.jsx)(Box_default, { marginTop: 2, children: (0, import_jsx_runtime42.jsx)(InputBox, { disabled: true, placeholder, onSubmit: () => void 0 }) }), (0, import_jsx_runtime42.jsx)(Box_default, { children: (0, import_jsx_runtime42.jsx)(FooterHints, { mode: "boot" }) })] });
|
|
75902
75979
|
}
|
|
75903
75980
|
});
|
|
75904
75981
|
|
|
@@ -75910,10 +75987,10 @@ var init_InteractiveSession = __esm({
|
|
|
75910
75987
|
});
|
|
75911
75988
|
|
|
75912
75989
|
// ../plugin-cli/dist/TuiChannel.js
|
|
75913
|
-
var
|
|
75990
|
+
var import_react72, TuiChannel;
|
|
75914
75991
|
var init_TuiChannel = __esm({
|
|
75915
75992
|
async "../plugin-cli/dist/TuiChannel.js"() {
|
|
75916
|
-
|
|
75993
|
+
import_react72 = __toESM(require_react());
|
|
75917
75994
|
await init_build2();
|
|
75918
75995
|
init_resolver();
|
|
75919
75996
|
await init_InteractiveSession();
|
|
@@ -75940,7 +76017,7 @@ var init_TuiChannel = __esm({
|
|
|
75940
76017
|
const registerInteractiveResolver = (handler) => {
|
|
75941
76018
|
this.promptHandler = handler;
|
|
75942
76019
|
};
|
|
75943
|
-
this.inkInstance = render_default(
|
|
76020
|
+
this.inkInstance = render_default(import_react72.default.createElement(InteractiveSession, {
|
|
75944
76021
|
...opts.session ? { session: opts.session } : {},
|
|
75945
76022
|
...opts.bootstrap ? { bootstrap: opts.bootstrap } : {},
|
|
75946
76023
|
registerInteractiveResolver,
|
|
@@ -75989,22 +76066,22 @@ function toRows(engine) {
|
|
|
75989
76066
|
out.push({ kind: "allow", name: r2.name, reason: r2.reason });
|
|
75990
76067
|
return out;
|
|
75991
76068
|
}
|
|
75992
|
-
var
|
|
76069
|
+
var import_jsx_runtime43, import_react73, PermissionEditor;
|
|
75993
76070
|
var init_PermissionEditor = __esm({
|
|
75994
76071
|
async "../plugin-cli/dist/components/PermissionEditor.js"() {
|
|
75995
|
-
|
|
75996
|
-
|
|
76072
|
+
import_jsx_runtime43 = __toESM(require_jsx_runtime());
|
|
76073
|
+
import_react73 = __toESM(require_react());
|
|
75997
76074
|
await init_build2();
|
|
75998
76075
|
init_dist();
|
|
75999
76076
|
PermissionEditor = ({ policyPath: policyPath2 }) => {
|
|
76000
76077
|
const { exit } = use_app_default();
|
|
76001
|
-
const [engine, setEngine] = (0,
|
|
76002
|
-
const [rows, setRows] = (0,
|
|
76003
|
-
const [cursor, setCursor] = (0,
|
|
76004
|
-
const [dirty, setDirty] = (0,
|
|
76005
|
-
const [mode, setMode] = (0,
|
|
76006
|
-
const [status, setStatus] = (0,
|
|
76007
|
-
(0,
|
|
76078
|
+
const [engine, setEngine] = (0, import_react73.useState)(null);
|
|
76079
|
+
const [rows, setRows] = (0, import_react73.useState)([]);
|
|
76080
|
+
const [cursor, setCursor] = (0, import_react73.useState)(0);
|
|
76081
|
+
const [dirty, setDirty] = (0, import_react73.useState)(false);
|
|
76082
|
+
const [mode, setMode] = (0, import_react73.useState)({ kind: "list" });
|
|
76083
|
+
const [status, setStatus] = (0, import_react73.useState)("");
|
|
76084
|
+
(0, import_react73.useEffect)(() => {
|
|
76008
76085
|
let cancelled = false;
|
|
76009
76086
|
(async () => {
|
|
76010
76087
|
const e3 = await PermissionEngine.load(policyPath2);
|
|
@@ -76131,28 +76208,28 @@ var init_PermissionEditor = __esm({
|
|
|
76131
76208
|
exit();
|
|
76132
76209
|
}
|
|
76133
76210
|
});
|
|
76134
|
-
return (0,
|
|
76211
|
+
return (0, import_jsx_runtime43.jsxs)(Box_default, { flexDirection: "column", padding: 1, children: [(0, import_jsx_runtime43.jsxs)(Box_default, { marginBottom: 1, children: [(0, import_jsx_runtime43.jsx)(Text, { bold: true, color: "magenta", children: "moxxy perms editor" }), (0, import_jsx_runtime43.jsxs)(Text, { dimColor: true, children: [" (", policyPath2, ")"] })] }), rows.length === 0 ? (0, import_jsx_runtime43.jsx)(Text, { dimColor: true, children: "(no rules \u2014 press `a` to add an allow rule, `D` for deny)" }) : rows.map((row, i2) => {
|
|
76135
76212
|
const focused = i2 === cursor;
|
|
76136
|
-
return (0,
|
|
76137
|
-
}), (0,
|
|
76213
|
+
return (0, import_jsx_runtime43.jsxs)(Box_default, { children: [(0, import_jsx_runtime43.jsx)(Text, { color: focused ? "cyan" : void 0, children: focused ? "\u203A " : " " }), (0, import_jsx_runtime43.jsx)(Text, { color: row.kind === "allow" ? "green" : "red", children: row.kind.padEnd(5) }), (0, import_jsx_runtime43.jsxs)(Text, { children: [" ", row.name] }), row.reason ? (0, import_jsx_runtime43.jsxs)(Text, { dimColor: true, children: [" \u2014 ", row.reason] }) : null] }, `${row.kind}:${row.name}:${i2}`);
|
|
76214
|
+
}), (0, import_jsx_runtime43.jsx)(Box_default, { marginTop: 1, children: mode.kind === "add" ? (0, import_jsx_runtime43.jsxs)(Text, { children: ["new ", mode.bucket, " rule: ", (0, import_jsx_runtime43.jsx)(Text, { color: "cyan", children: mode.buffer }), (0, import_jsx_runtime43.jsx)(Text, { dimColor: true, children: " (enter to confirm, esc to cancel)" })] }) : mode.kind === "confirm-delete" ? (0, import_jsx_runtime43.jsxs)(Text, { color: "yellow", children: ["delete `", mode.row.name, "` (", mode.row.kind, ")? [y/N]"] }) : mode.kind === "message" ? (0, import_jsx_runtime43.jsxs)(Text, { color: /FAILED/i.test(mode.text) ? "red" : "green", children: [mode.text, " (press any key)"] }) : (0, import_jsx_runtime43.jsxs)(Text, { dimColor: true, children: ["\u2191/\u2193 move \xB7 space/enter flip \xB7 a add allow \xB7 D add deny \xB7 d delete \xB7 q quit", dirty || /FAILED/i.test(status) ? (0, import_jsx_runtime43.jsx)(Text, { color: /FAILED/i.test(status) ? "red" : "green", children: ` \xB7 ${status}` }) : null] }) })] });
|
|
76138
76215
|
};
|
|
76139
76216
|
}
|
|
76140
76217
|
});
|
|
76141
76218
|
|
|
76142
76219
|
// ../plugin-cli/dist/components/Logo.js
|
|
76143
|
-
var
|
|
76220
|
+
var import_jsx_runtime44, import_react74, Logo;
|
|
76144
76221
|
var init_Logo = __esm({
|
|
76145
76222
|
async "../plugin-cli/dist/components/Logo.js"() {
|
|
76146
|
-
|
|
76147
|
-
|
|
76223
|
+
import_jsx_runtime44 = __toESM(require_jsx_runtime());
|
|
76224
|
+
import_react74 = __toESM(require_react());
|
|
76148
76225
|
await init_build2();
|
|
76149
76226
|
init_logo_data();
|
|
76150
76227
|
await init_LogoLine();
|
|
76151
76228
|
Logo = ({ subtitle }) => {
|
|
76152
76229
|
const width = process.stdout.columns ?? 80;
|
|
76153
|
-
const slogan = (0,
|
|
76230
|
+
const slogan = (0, import_react74.useMemo)(() => pickSlogan(), []);
|
|
76154
76231
|
const { lines } = selectLogo(width);
|
|
76155
|
-
return (0,
|
|
76232
|
+
return (0, import_jsx_runtime44.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [lines.map((line, i2) => (0, import_jsx_runtime44.jsx)(LogoLine, { text: line }, i2)), (0, import_jsx_runtime44.jsx)(Box_default, { marginTop: 1, children: (0, import_jsx_runtime44.jsx)(Text, { dimColor: true, italic: true, children: slogan }) }), subtitle ? (0, import_jsx_runtime44.jsx)(Box_default, { children: (0, import_jsx_runtime44.jsxs)(Text, { dimColor: true, children: [" ", subtitle] }) }) : null] });
|
|
76156
76233
|
};
|
|
76157
76234
|
}
|
|
76158
76235
|
});
|
|
@@ -125693,7 +125770,7 @@ async function readStdinIfPiped() {
|
|
|
125693
125770
|
await init_dist12();
|
|
125694
125771
|
init_dist2();
|
|
125695
125772
|
await init_build2();
|
|
125696
|
-
var
|
|
125773
|
+
var import_react75 = __toESM(require_react());
|
|
125697
125774
|
var REMOTE_CHANNELS = /* @__PURE__ */ new Set(["telegram"]);
|
|
125698
125775
|
async function coAttachWebSurface(opts) {
|
|
125699
125776
|
const { primary, session, vault, config } = opts;
|
|
@@ -126561,7 +126638,7 @@ async function runAttachedTui(argv, tuiOpts) {
|
|
|
126561
126638
|
await remote.close().catch(() => void 0);
|
|
126562
126639
|
};
|
|
126563
126640
|
const instance = render_default(
|
|
126564
|
-
|
|
126641
|
+
import_react75.default.createElement(InteractiveSession, {
|
|
126565
126642
|
session: remote,
|
|
126566
126643
|
registerInteractiveResolver: (handler) => {
|
|
126567
126644
|
promptHandler = handler;
|
|
@@ -126763,7 +126840,7 @@ async function runSelfHostedTui(argv, tuiOpts, standalone) {
|
|
|
126763
126840
|
}
|
|
126764
126841
|
};
|
|
126765
126842
|
const { waitUntilExit } = render_default(
|
|
126766
|
-
|
|
126843
|
+
import_react75.default.createElement(InteractiveSession, {
|
|
126767
126844
|
bootstrap: async (progress) => bootSession2(
|
|
126768
126845
|
tuiOpts.resumeSessionId ? { resumeSessionId: tuiOpts.resumeSessionId } : {},
|
|
126769
126846
|
progress
|
|
@@ -129268,13 +129345,13 @@ function policyPath() {
|
|
|
129268
129345
|
async function runPermsCommand(argv) {
|
|
129269
129346
|
const sub = argv.positional[0];
|
|
129270
129347
|
if (!sub && process.stdin.isTTY) {
|
|
129271
|
-
const [{ render: render2 },
|
|
129348
|
+
const [{ render: render2 }, React58, { PermissionEditor: PermissionEditor2 }] = await Promise.all([
|
|
129272
129349
|
init_build2().then(() => build_exports),
|
|
129273
129350
|
Promise.resolve().then(() => __toESM(require_react())),
|
|
129274
129351
|
init_dist12().then(() => dist_exports4)
|
|
129275
129352
|
]);
|
|
129276
129353
|
const { waitUntilExit } = render2(
|
|
129277
|
-
|
|
129354
|
+
React58.createElement(PermissionEditor2, { policyPath: policyPath() })
|
|
129278
129355
|
);
|
|
129279
129356
|
await waitUntilExit();
|
|
129280
129357
|
return 0;
|