orion-super-agent-dev 0.1.26 → 0.1.28
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/out/brains/darwin-arm64/orion-brain +0 -0
- package/out/brains/darwin-x64/orion-brain +0 -0
- package/out/brains/linux-arm64/orion-brain +0 -0
- package/out/brains/linux-x64/orion-brain +0 -0
- package/out/brains/win32-x64/orion-brain.exe +0 -0
- package/out/main.js +685 -514
- package/package.json +1 -1
package/out/main.js
CHANGED
|
@@ -3106,10 +3106,10 @@ var require_react_jsx_runtime_development = __commonJS({
|
|
|
3106
3106
|
return jsxWithValidation(type, props, key, false);
|
|
3107
3107
|
}
|
|
3108
3108
|
}
|
|
3109
|
-
var
|
|
3109
|
+
var jsx79 = jsxWithValidationDynamic;
|
|
3110
3110
|
var jsxs56 = jsxWithValidationStatic;
|
|
3111
3111
|
exports2.Fragment = REACT_FRAGMENT_TYPE;
|
|
3112
|
-
exports2.jsx =
|
|
3112
|
+
exports2.jsx = jsx79;
|
|
3113
3113
|
exports2.jsxs = jsxs56;
|
|
3114
3114
|
})();
|
|
3115
3115
|
}
|
|
@@ -72629,10 +72629,10 @@ var require_subagentRow = __commonJS({
|
|
|
72629
72629
|
"../packages/orion-client-ui-core/dist/subagentRow.js"(exports2) {
|
|
72630
72630
|
"use strict";
|
|
72631
72631
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
72632
|
-
exports2.formatContextTokens =
|
|
72632
|
+
exports2.formatContextTokens = formatContextTokens2;
|
|
72633
72633
|
exports2.subagentTokenLabel = subagentTokenLabel2;
|
|
72634
72634
|
exports2.subagentRowMeta = subagentRowMeta2;
|
|
72635
|
-
function
|
|
72635
|
+
function formatContextTokens2(n) {
|
|
72636
72636
|
if (typeof n !== "number" || !Number.isFinite(n) || n <= 0)
|
|
72637
72637
|
return "";
|
|
72638
72638
|
if (n < 1e3)
|
|
@@ -72642,7 +72642,7 @@ var require_subagentRow = __commonJS({
|
|
|
72642
72642
|
return `${(n / 1e6).toFixed(1).replace(/\.0$/, "")}M`;
|
|
72643
72643
|
}
|
|
72644
72644
|
function subagentTokenLabel2(contextTokens) {
|
|
72645
|
-
const count =
|
|
72645
|
+
const count = formatContextTokens2(contextTokens);
|
|
72646
72646
|
return count ? `${count} tokens` : "";
|
|
72647
72647
|
}
|
|
72648
72648
|
function subagentRowMeta2(agent) {
|
|
@@ -72703,6 +72703,58 @@ ${draft.text}` : prefix;
|
|
|
72703
72703
|
}
|
|
72704
72704
|
});
|
|
72705
72705
|
|
|
72706
|
+
// ../packages/orion-client-ui-core/dist/contextGauge.js
|
|
72707
|
+
var require_contextGauge = __commonJS({
|
|
72708
|
+
"../packages/orion-client-ui-core/dist/contextGauge.js"(exports2) {
|
|
72709
|
+
"use strict";
|
|
72710
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
72711
|
+
exports2.COMPACT_OFFER_RATIO = exports2.DEFAULT_COMPACTION_TRIGGER_RATIO = void 0;
|
|
72712
|
+
exports2.sanitizeTriggerRatio = sanitizeTriggerRatio;
|
|
72713
|
+
exports2.reviveContextGauge = reviveContextGauge4;
|
|
72714
|
+
exports2.contextGaugePct = contextGaugePct2;
|
|
72715
|
+
exports2.assessResumeCompact = assessResumeCompact2;
|
|
72716
|
+
exports2.DEFAULT_COMPACTION_TRIGGER_RATIO = 0.9;
|
|
72717
|
+
exports2.COMPACT_OFFER_RATIO = 0.5;
|
|
72718
|
+
function sanitizeTriggerRatio(value) {
|
|
72719
|
+
return typeof value === "number" && Number.isFinite(value) && value > 0 && value <= 1 ? value : void 0;
|
|
72720
|
+
}
|
|
72721
|
+
function reviveContextGauge4(raw) {
|
|
72722
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw))
|
|
72723
|
+
return null;
|
|
72724
|
+
const { tokens, window: win, triggerRatio, breakdown } = raw;
|
|
72725
|
+
if (typeof tokens !== "number" || !Number.isFinite(tokens) || tokens <= 0)
|
|
72726
|
+
return null;
|
|
72727
|
+
if (typeof win !== "number" || !Number.isFinite(win) || win <= 0)
|
|
72728
|
+
return null;
|
|
72729
|
+
const revived = { tokens, window: win };
|
|
72730
|
+
const ratio = sanitizeTriggerRatio(triggerRatio);
|
|
72731
|
+
if (ratio !== void 0)
|
|
72732
|
+
revived.triggerRatio = ratio;
|
|
72733
|
+
if (breakdown && typeof breakdown === "object" && !Array.isArray(breakdown)) {
|
|
72734
|
+
const clean = {};
|
|
72735
|
+
for (const [key, value] of Object.entries(breakdown)) {
|
|
72736
|
+
if (typeof value === "number" && Number.isFinite(value) && value >= 0)
|
|
72737
|
+
clean[key] = value;
|
|
72738
|
+
}
|
|
72739
|
+
if (Object.keys(clean).length > 0)
|
|
72740
|
+
revived.breakdown = clean;
|
|
72741
|
+
}
|
|
72742
|
+
return revived;
|
|
72743
|
+
}
|
|
72744
|
+
function contextGaugePct2(gauge) {
|
|
72745
|
+
return Math.min(100, Math.round(Math.max(0, gauge.tokens) / gauge.window * 100));
|
|
72746
|
+
}
|
|
72747
|
+
function assessResumeCompact2(gauge, offerRatio = exports2.COMPACT_OFFER_RATIO) {
|
|
72748
|
+
if (!gauge)
|
|
72749
|
+
return "none";
|
|
72750
|
+
const ratio = gauge.tokens / gauge.window;
|
|
72751
|
+
if (ratio >= (gauge.triggerRatio ?? exports2.DEFAULT_COMPACTION_TRIGGER_RATIO))
|
|
72752
|
+
return "pending";
|
|
72753
|
+
return ratio >= offerRatio ? "offer" : "none";
|
|
72754
|
+
}
|
|
72755
|
+
}
|
|
72756
|
+
});
|
|
72757
|
+
|
|
72706
72758
|
// ../packages/orion-client-ui-core/dist/index.js
|
|
72707
72759
|
var require_dist2 = __commonJS({
|
|
72708
72760
|
"../packages/orion-client-ui-core/dist/index.js"(exports2) {
|
|
@@ -72737,6 +72789,7 @@ var require_dist2 = __commonJS({
|
|
|
72737
72789
|
__exportStar(require_toolVisibility(), exports2);
|
|
72738
72790
|
__exportStar(require_subagentRow(), exports2);
|
|
72739
72791
|
__exportStar(require_steerRow(), exports2);
|
|
72792
|
+
__exportStar(require_contextGauge(), exports2);
|
|
72740
72793
|
var client_core_1 = require_dist();
|
|
72741
72794
|
Object.defineProperty(exports2, "parseTrust", { enumerable: true, get: function() {
|
|
72742
72795
|
return client_core_1.parseTrust;
|
|
@@ -89119,6 +89172,7 @@ function defaults() {
|
|
|
89119
89172
|
statusline: "model,context,effort,tokensave",
|
|
89120
89173
|
autoApprovePermissions: false,
|
|
89121
89174
|
subagentsEnabled: true,
|
|
89175
|
+
resumeModePrompt: true,
|
|
89122
89176
|
brain: (0, import_client_core7.normalizeBrainMode)(process.env.ORION_BRAIN, "local"),
|
|
89123
89177
|
brainPath: process.env.ORION_BRAIN_PATH ?? "",
|
|
89124
89178
|
brainTopology: (0, import_client_core7.normalizeBrainTopology)(process.env.ORION_BRAIN_TOPOLOGY, "process"),
|
|
@@ -89150,6 +89204,7 @@ var FILE_OVERRIDABLE = [
|
|
|
89150
89204
|
"statusline",
|
|
89151
89205
|
"autoApprovePermissions",
|
|
89152
89206
|
"subagentsEnabled",
|
|
89207
|
+
"resumeModePrompt",
|
|
89153
89208
|
"brain",
|
|
89154
89209
|
"brainPath",
|
|
89155
89210
|
"brainTopology",
|
|
@@ -89894,7 +89949,8 @@ function initialTranscript() {
|
|
|
89894
89949
|
committedCount: 0,
|
|
89895
89950
|
evictedCount: 0,
|
|
89896
89951
|
live: null,
|
|
89897
|
-
goalActive: false
|
|
89952
|
+
goalActive: false,
|
|
89953
|
+
contextGauge: null
|
|
89898
89954
|
};
|
|
89899
89955
|
}
|
|
89900
89956
|
function evictSettled(s, count) {
|
|
@@ -90126,7 +90182,7 @@ function applyTurnInterrupted(s, prompt, partialReply = "") {
|
|
|
90126
90182
|
live: null
|
|
90127
90183
|
};
|
|
90128
90184
|
}
|
|
90129
|
-
function hydrate(sessionId, messages, clientState, transcript) {
|
|
90185
|
+
function hydrate(sessionId, messages, clientState, transcript, contextGauge) {
|
|
90130
90186
|
const msgs = Array.isArray(messages) ? messages : [];
|
|
90131
90187
|
const settled = reviveTranscript(transcript) ?? projectMessages(msgs);
|
|
90132
90188
|
return {
|
|
@@ -90140,7 +90196,8 @@ function hydrate(sessionId, messages, clientState, transcript) {
|
|
|
90140
90196
|
// fresh mount — the driver re-evicts after first layout
|
|
90141
90197
|
goalActive: false,
|
|
90142
90198
|
// a resumed conversation carries no live goal driver
|
|
90143
|
-
live: null
|
|
90199
|
+
live: null,
|
|
90200
|
+
contextGauge: (0, import_client_ui_core2.reviveContextGauge)(contextGauge)
|
|
90144
90201
|
};
|
|
90145
90202
|
}
|
|
90146
90203
|
var INTERRUPT_NOTE = "\u2298 turn interrupted";
|
|
@@ -90220,8 +90277,10 @@ function clearHistory(s) {
|
|
|
90220
90277
|
committedCount: 0,
|
|
90221
90278
|
evictedCount: 0,
|
|
90222
90279
|
live: null,
|
|
90223
|
-
goalActive: false
|
|
90280
|
+
goalActive: false,
|
|
90224
90281
|
// a cleared conversation takes its goal driver with it
|
|
90282
|
+
contextGauge: null
|
|
90283
|
+
// the reading described the dropped conversation
|
|
90225
90284
|
};
|
|
90226
90285
|
}
|
|
90227
90286
|
function createTranscriptStore(onChange) {
|
|
@@ -90236,22 +90295,157 @@ function transcriptSink(store) {
|
|
|
90236
90295
|
};
|
|
90237
90296
|
}
|
|
90238
90297
|
|
|
90239
|
-
// src/
|
|
90240
|
-
|
|
90298
|
+
// src/commands/builtin.ts
|
|
90299
|
+
var import_client_ui_core4 = __toESM(require_dist2(), 1);
|
|
90300
|
+
|
|
90301
|
+
// src/services/persistence.ts
|
|
90241
90302
|
import * as path6 from "path";
|
|
90303
|
+
import * as fs7 from "fs";
|
|
90304
|
+
function sessionsDir() {
|
|
90305
|
+
return path6.join(orionHome(), "sessions");
|
|
90306
|
+
}
|
|
90307
|
+
function indexFile() {
|
|
90308
|
+
return path6.join(orionHome(), "index.json");
|
|
90309
|
+
}
|
|
90310
|
+
function sessionFile(sessionId) {
|
|
90311
|
+
return path6.join(sessionsDir(), `${sessionId}.json`);
|
|
90312
|
+
}
|
|
90313
|
+
function ensureDirs() {
|
|
90314
|
+
fs7.mkdirSync(sessionsDir(), { recursive: true });
|
|
90315
|
+
}
|
|
90316
|
+
function deriveTitle(messages) {
|
|
90317
|
+
for (const m2 of messages) {
|
|
90318
|
+
if (!m2 || typeof m2 !== "object") continue;
|
|
90319
|
+
if (m2.role !== "user") continue;
|
|
90320
|
+
const content = m2.content;
|
|
90321
|
+
let text = "";
|
|
90322
|
+
if (typeof content === "string") text = content;
|
|
90323
|
+
else if (Array.isArray(content)) {
|
|
90324
|
+
const first = content.find(
|
|
90325
|
+
(b2) => b2 && typeof b2 === "object" && b2.type === "text"
|
|
90326
|
+
);
|
|
90327
|
+
if (first && typeof first.text === "string") text = first.text;
|
|
90328
|
+
}
|
|
90329
|
+
text = text.trim().replace(/\s+/g, " ");
|
|
90330
|
+
if (text) return text.length > 60 ? `${text.slice(0, 57)}\u2026` : text;
|
|
90331
|
+
}
|
|
90332
|
+
return "(untitled session)";
|
|
90333
|
+
}
|
|
90334
|
+
function loadIndex() {
|
|
90335
|
+
try {
|
|
90336
|
+
const raw = JSON.parse(fs7.readFileSync(indexFile(), "utf8"));
|
|
90337
|
+
return Array.isArray(raw) ? raw : [];
|
|
90338
|
+
} catch {
|
|
90339
|
+
return [];
|
|
90340
|
+
}
|
|
90341
|
+
}
|
|
90342
|
+
var tmpSeq = 0;
|
|
90343
|
+
function writeAtomic(file, data) {
|
|
90344
|
+
const tmp = `${file}.${process.pid}.${Date.now()}.${tmpSeq++}.tmp`;
|
|
90345
|
+
fs7.writeFileSync(tmp, data);
|
|
90346
|
+
fs7.renameSync(tmp, file);
|
|
90347
|
+
}
|
|
90348
|
+
var saveFailureWarned = false;
|
|
90349
|
+
function saveSession(rec2) {
|
|
90350
|
+
try {
|
|
90351
|
+
ensureDirs();
|
|
90352
|
+
writeAtomic(sessionFile(rec2.sessionId), `${JSON.stringify(rec2, null, 2)}
|
|
90353
|
+
`);
|
|
90354
|
+
const idx = loadIndex().filter((e) => e.sessionId !== rec2.sessionId);
|
|
90355
|
+
idx.unshift({ sessionId: rec2.sessionId, title: rec2.title, updatedAt: rec2.updatedAt });
|
|
90356
|
+
writeAtomic(indexFile(), `${JSON.stringify(idx.slice(0, 100), null, 2)}
|
|
90357
|
+
`);
|
|
90358
|
+
return true;
|
|
90359
|
+
} catch (e) {
|
|
90360
|
+
if (!saveFailureWarned) {
|
|
90361
|
+
saveFailureWarned = true;
|
|
90362
|
+
console.error(
|
|
90363
|
+
`orion: session save failed, continuing without persistence: ${e instanceof Error ? e.message : String(e)}`
|
|
90364
|
+
);
|
|
90365
|
+
}
|
|
90366
|
+
return false;
|
|
90367
|
+
}
|
|
90368
|
+
}
|
|
90369
|
+
function loadSession(sessionId) {
|
|
90370
|
+
try {
|
|
90371
|
+
return JSON.parse(fs7.readFileSync(sessionFile(sessionId), "utf8"));
|
|
90372
|
+
} catch {
|
|
90373
|
+
return null;
|
|
90374
|
+
}
|
|
90375
|
+
}
|
|
90376
|
+
function renameSession(sessionId, title) {
|
|
90377
|
+
const rec2 = loadSession(sessionId);
|
|
90378
|
+
if (!rec2) return false;
|
|
90379
|
+
return saveSession({ ...rec2, title, updatedAt: Date.now() });
|
|
90380
|
+
}
|
|
90381
|
+
var pendingModelTitles = /* @__PURE__ */ new Map();
|
|
90382
|
+
function applyModelSessionTitle(sessionId, title) {
|
|
90383
|
+
const record = loadSession(sessionId);
|
|
90384
|
+
if (record === null) {
|
|
90385
|
+
pendingModelTitles.set(sessionId, title);
|
|
90386
|
+
return true;
|
|
90387
|
+
}
|
|
90388
|
+
if (record.title !== deriveTitle(record.messages)) {
|
|
90389
|
+
return false;
|
|
90390
|
+
}
|
|
90391
|
+
pendingModelTitles.delete(sessionId);
|
|
90392
|
+
return saveSession({ ...record, title, updatedAt: Date.now() });
|
|
90393
|
+
}
|
|
90394
|
+
function resolveTitle(sessionId, messages) {
|
|
90395
|
+
const stored = loadSession(sessionId)?.title;
|
|
90396
|
+
if (stored !== void 0) {
|
|
90397
|
+
pendingModelTitles.delete(sessionId);
|
|
90398
|
+
return stored;
|
|
90399
|
+
}
|
|
90400
|
+
return pendingModelTitles.get(sessionId) ?? deriveTitle(messages);
|
|
90401
|
+
}
|
|
90402
|
+
|
|
90403
|
+
// src/services/resumeMode.ts
|
|
90404
|
+
var import_client_ui_core3 = __toESM(require_dist2(), 1);
|
|
90405
|
+
function sessionAgeLabel(ageMs) {
|
|
90406
|
+
const minutes = Math.max(0, Math.floor(ageMs / 6e4));
|
|
90407
|
+
const days = Math.floor(minutes / 1440);
|
|
90408
|
+
const hours = Math.floor(minutes % 1440 / 60);
|
|
90409
|
+
const mins = minutes % 60;
|
|
90410
|
+
if (days > 0) return hours > 0 ? `${days}d ${hours}h` : `${days}d`;
|
|
90411
|
+
if (hours > 0) return mins > 0 ? `${hours}h ${mins}m` : `${hours}h`;
|
|
90412
|
+
if (mins > 0) return `${mins}m`;
|
|
90413
|
+
return "under a minute";
|
|
90414
|
+
}
|
|
90415
|
+
function buildResumeModeDialog(gauge, ageMs) {
|
|
90416
|
+
const band = (0, import_client_ui_core3.assessResumeCompact)(gauge);
|
|
90417
|
+
const pct2 = (0, import_client_ui_core3.contextGaugePct)(gauge);
|
|
90418
|
+
const compactFirst = band !== "none";
|
|
90419
|
+
const title = `This chat is ${sessionAgeLabel(ageMs)} old and holds ${(0, import_client_ui_core3.formatContextTokens)(gauge.tokens)} tokens.`;
|
|
90420
|
+
const body2 = band === "pending" ? `Its context is past the compaction trigger (~${pct2}% full), so your next message would compact it automatically anyway. Compacting now summarizes the middle and keeps the original ask and the most recent turns verbatim, so your first message runs against a lighter conversation.` : band === "offer" ? `Resuming it in full replays ~${pct2}% of the context window with every message. Compacting summarizes the middle and keeps the original ask and the most recent turns verbatim.` : `It is only ~${pct2}% full, so resuming in full costs little. Compacting now would find little to summarize.`;
|
|
90421
|
+
const full = {
|
|
90422
|
+
label: `Resume full conversation${compactFirst ? "" : " (recommended)"}`,
|
|
90423
|
+
value: "full"
|
|
90424
|
+
};
|
|
90425
|
+
const compact = {
|
|
90426
|
+
label: `Compact & resume${compactFirst ? " (recommended)" : ""}`,
|
|
90427
|
+
value: "compact"
|
|
90428
|
+
};
|
|
90429
|
+
const neverAsk = { label: "Don't ask again \u2014 always resume in full", value: "never-ask" };
|
|
90430
|
+
return { title, body: body2, options: compactFirst ? [compact, full, neverAsk] : [full, compact, neverAsk] };
|
|
90431
|
+
}
|
|
90432
|
+
|
|
90433
|
+
// src/services/restoreWriter.ts
|
|
90434
|
+
import * as fs8 from "fs/promises";
|
|
90435
|
+
import * as path7 from "path";
|
|
90242
90436
|
async function applyRestore(workspaceRoot, files) {
|
|
90243
90437
|
let restored = 0;
|
|
90244
90438
|
let deleted = 0;
|
|
90245
90439
|
let failed = 0;
|
|
90246
90440
|
for (const [rel, info2] of Object.entries(files)) {
|
|
90247
|
-
const abs =
|
|
90441
|
+
const abs = path7.resolve(workspaceRoot, rel);
|
|
90248
90442
|
try {
|
|
90249
90443
|
if (info2.status === "restore") {
|
|
90250
|
-
await
|
|
90251
|
-
await
|
|
90444
|
+
await fs8.mkdir(path7.dirname(abs), { recursive: true });
|
|
90445
|
+
await fs8.writeFile(abs, info2.content ?? "", "utf8");
|
|
90252
90446
|
restored++;
|
|
90253
90447
|
} else if (info2.status === "delete") {
|
|
90254
|
-
await
|
|
90448
|
+
await fs8.rm(abs, { force: true });
|
|
90255
90449
|
deleted++;
|
|
90256
90450
|
}
|
|
90257
90451
|
} catch {
|
|
@@ -91235,8 +91429,8 @@ var import_client_core19 = __toESM(require_dist(), 1);
|
|
|
91235
91429
|
var import_client_core20 = __toESM(require_dist(), 1);
|
|
91236
91430
|
|
|
91237
91431
|
// src/keybindings/load.ts
|
|
91238
|
-
import * as
|
|
91239
|
-
import * as
|
|
91432
|
+
import * as fs9 from "fs";
|
|
91433
|
+
import * as path8 from "path";
|
|
91240
91434
|
|
|
91241
91435
|
// src/keybindings/defaults.ts
|
|
91242
91436
|
var DEFAULT_BINDINGS = {
|
|
@@ -91273,7 +91467,7 @@ var RESERVED = {
|
|
|
91273
91467
|
|
|
91274
91468
|
// src/keybindings/load.ts
|
|
91275
91469
|
function keybindingsPath() {
|
|
91276
|
-
return
|
|
91470
|
+
return path8.join(orionHome(), "keybindings.json");
|
|
91277
91471
|
}
|
|
91278
91472
|
function mergeBindings(base, overrides) {
|
|
91279
91473
|
const merged = JSON.parse(JSON.stringify(base));
|
|
@@ -91286,7 +91480,7 @@ function mergeBindings(base, overrides) {
|
|
|
91286
91480
|
function loadBindings() {
|
|
91287
91481
|
let user = {};
|
|
91288
91482
|
try {
|
|
91289
|
-
const raw = JSON.parse(
|
|
91483
|
+
const raw = JSON.parse(fs9.readFileSync(keybindingsPath(), "utf8"));
|
|
91290
91484
|
if (raw && typeof raw === "object") user = raw;
|
|
91291
91485
|
} catch {
|
|
91292
91486
|
}
|
|
@@ -91416,9 +91610,9 @@ function createMicCapture(spawnFn = spawn5, probe = soxAvailable) {
|
|
|
91416
91610
|
|
|
91417
91611
|
// src/voice/voicePack.ts
|
|
91418
91612
|
var import_client_core17 = __toESM(require_dist(), 1);
|
|
91419
|
-
import * as
|
|
91613
|
+
import * as fs10 from "fs";
|
|
91420
91614
|
import * as os4 from "os";
|
|
91421
|
-
import * as
|
|
91615
|
+
import * as path9 from "path";
|
|
91422
91616
|
import { spawn as spawn6, spawnSync as spawnSync2 } from "child_process";
|
|
91423
91617
|
import { createRequire as createRequire2 } from "node:module";
|
|
91424
91618
|
import { pathToFileURL } from "node:url";
|
|
@@ -91431,15 +91625,15 @@ var VOICE_MODELS = {
|
|
|
91431
91625
|
var DEFAULT_VOICE_MODEL = "moonshine-base";
|
|
91432
91626
|
var IDLE_UNLOAD_MS = 5 * 60 * 1e3;
|
|
91433
91627
|
function voicePackDir() {
|
|
91434
|
-
return
|
|
91628
|
+
return path9.join(os4.homedir(), ".orion", "voice-pack");
|
|
91435
91629
|
}
|
|
91436
91630
|
function modelsCacheDir() {
|
|
91437
|
-
return
|
|
91631
|
+
return path9.join(os4.homedir(), ".orion", "models");
|
|
91438
91632
|
}
|
|
91439
91633
|
function installedPackageJson() {
|
|
91440
|
-
return
|
|
91634
|
+
return path9.join(voicePackDir(), "node_modules", "@huggingface", "transformers", "package.json");
|
|
91441
91635
|
}
|
|
91442
|
-
function voicePackInstalled(fsLike =
|
|
91636
|
+
function voicePackInstalled(fsLike = fs10) {
|
|
91443
91637
|
try {
|
|
91444
91638
|
const pkg = JSON.parse(fsLike.readFileSync(installedPackageJson(), "utf8"));
|
|
91445
91639
|
return pkg.version === VOICE_PACK_VERSION;
|
|
@@ -91465,7 +91659,7 @@ async function installVoicePack(progress, io = {}) {
|
|
|
91465
91659
|
);
|
|
91466
91660
|
}
|
|
91467
91661
|
const dir = voicePackDir();
|
|
91468
|
-
|
|
91662
|
+
fs10.mkdirSync(dir, { recursive: true });
|
|
91469
91663
|
progress(`Installing the voice pack (${VOICE_PACK_PACKAGE}@${VOICE_PACK_VERSION})\u2026`);
|
|
91470
91664
|
await new Promise((resolve5, reject) => {
|
|
91471
91665
|
const npm = (0, import_client_core17.npmInvocation)([
|
|
@@ -91513,7 +91707,7 @@ function unloadVoiceEngine() {
|
|
|
91513
91707
|
}
|
|
91514
91708
|
}
|
|
91515
91709
|
async function loadTransformers() {
|
|
91516
|
-
const anchor =
|
|
91710
|
+
const anchor = path9.join(voicePackDir(), "node_modules", "__voice_pack_anchor__.cjs");
|
|
91517
91711
|
const req = createRequire2(anchor);
|
|
91518
91712
|
const entry = req.resolve(VOICE_PACK_PACKAGE);
|
|
91519
91713
|
let mod2;
|
|
@@ -91584,8 +91778,8 @@ async function prefetchVoiceModel(progress, model = DEFAULT_VOICE_MODEL) {
|
|
|
91584
91778
|
}
|
|
91585
91779
|
|
|
91586
91780
|
// src/commands/builtin.ts
|
|
91587
|
-
import * as
|
|
91588
|
-
import * as
|
|
91781
|
+
import * as fs11 from "fs";
|
|
91782
|
+
import * as path10 from "path";
|
|
91589
91783
|
var LIVE_METER_FRESH_MS = 5 * 6e4;
|
|
91590
91784
|
var ATTACH_MIME = {
|
|
91591
91785
|
".png": "image/png",
|
|
@@ -92057,7 +92251,7 @@ function registerBuiltins(registry) {
|
|
|
92057
92251
|
return;
|
|
92058
92252
|
}
|
|
92059
92253
|
if (arg.startsWith("remove ")) {
|
|
92060
|
-
const target =
|
|
92254
|
+
const target = path10.resolve(workspaceRoot ?? process.cwd(), arg.slice("remove ".length).trim());
|
|
92061
92255
|
const had = state.additionalDirectories.includes(target);
|
|
92062
92256
|
if (had) {
|
|
92063
92257
|
ctx.appStore.setState((s) => ({
|
|
@@ -93006,11 +93200,11 @@ ${(0, import_client_core20.duetRoutingSummaryLine)(await (0, import_client_core2
|
|
|
93006
93200
|
return;
|
|
93007
93201
|
}
|
|
93008
93202
|
try {
|
|
93009
|
-
const ext =
|
|
93010
|
-
const name2 =
|
|
93203
|
+
const ext = path10.extname(p).toLowerCase();
|
|
93204
|
+
const name2 = path10.basename(p);
|
|
93011
93205
|
if (ext in import_client_core18.VIDEO_EXT) {
|
|
93012
|
-
const abs =
|
|
93013
|
-
const st2 =
|
|
93206
|
+
const abs = path10.resolve(p);
|
|
93207
|
+
const st2 = fs11.statSync(abs);
|
|
93014
93208
|
ctx.appStore.setState((s) => ({
|
|
93015
93209
|
...s,
|
|
93016
93210
|
pendingAttachments: [
|
|
@@ -93021,7 +93215,7 @@ ${(0, import_client_core20.duetRoutingSummaryLine)(await (0, import_client_core2
|
|
|
93021
93215
|
ctx.print(`Attached video ${name2} \u2014 the agent will watch it with ffmpeg on this machine`, "success");
|
|
93022
93216
|
return;
|
|
93023
93217
|
}
|
|
93024
|
-
const data =
|
|
93218
|
+
const data = fs11.readFileSync(p).toString("base64");
|
|
93025
93219
|
const mime = ATTACH_MIME[ext] ?? "application/octet-stream";
|
|
93026
93220
|
ctx.appStore.setState((s) => ({
|
|
93027
93221
|
...s,
|
|
@@ -93276,10 +93470,10 @@ ${(0, import_client_core20.duetRoutingSummaryLine)(await (0, import_client_core2
|
|
|
93276
93470
|
const explicit = arg && arg.toLowerCase() !== "json" ? arg : "";
|
|
93277
93471
|
const root2 = ctx.config?.workspaceRoot ?? process.cwd();
|
|
93278
93472
|
const sid = (ctx.sessionId() ?? "local").slice(0, 8);
|
|
93279
|
-
const file = explicit ?
|
|
93473
|
+
const file = explicit ? path10.resolve(root2, explicit) : path10.resolve(root2, `orion-session-${sid}-${Date.now()}.${asJson ? "json" : "md"}`);
|
|
93280
93474
|
const content = asJson ? toJson(st2) : toMarkdown(st2.settled);
|
|
93281
93475
|
try {
|
|
93282
|
-
await
|
|
93476
|
+
await fs11.promises.writeFile(file, content, "utf8");
|
|
93283
93477
|
ctx.print(`Exported ${st2.settled.length} item(s) to ${file}`, "success");
|
|
93284
93478
|
} catch (e) {
|
|
93285
93479
|
ctx.print(`Export failed: ${e instanceof Error ? e.message : String(e)}`, "error");
|
|
@@ -93793,6 +93987,46 @@ Install "${arg}"?`,
|
|
|
93793
93987
|
const sessions = ctx.listSessions();
|
|
93794
93988
|
const resume = ctx.resumeSession;
|
|
93795
93989
|
const liveElsewhere = async (sessionId) => ctx.sessionLiveElsewhere ? await ctx.sessionLiveElsewhere(sessionId) : null;
|
|
93990
|
+
const resumeWithModeChoice = async (fullId2) => {
|
|
93991
|
+
const done2 = () => ctx.print(`Resumed session ${fullId2.slice(0, 8)}.`, "success");
|
|
93992
|
+
const saved = loadSession(fullId2);
|
|
93993
|
+
const gauge = (0, import_client_ui_core4.reviveContextGauge)(saved?.contextGauge);
|
|
93994
|
+
if (!gauge || !loadConfig().resumeModePrompt) {
|
|
93995
|
+
await resume(fullId2);
|
|
93996
|
+
done2();
|
|
93997
|
+
return;
|
|
93998
|
+
}
|
|
93999
|
+
const model = buildResumeModeDialog(gauge, Date.now() - (saved?.updatedAt ?? Date.now()));
|
|
94000
|
+
ctx.appStore.setState((s) => ({
|
|
94001
|
+
...s,
|
|
94002
|
+
activeDialog: {
|
|
94003
|
+
kind: "resume-mode",
|
|
94004
|
+
title: model.title,
|
|
94005
|
+
body: model.body,
|
|
94006
|
+
options: model.options,
|
|
94007
|
+
onSelect: (v2) => {
|
|
94008
|
+
ctx.appStore.setState((s2) => ({ ...s2, activeDialog: null }));
|
|
94009
|
+
if (!v2) return ctx.print("Resume cancelled.");
|
|
94010
|
+
if (v2 === "never-ask") {
|
|
94011
|
+
saveConfig({ resumeModePrompt: false });
|
|
94012
|
+
ctx.print(
|
|
94013
|
+
"Won't ask again \u2014 /resume opens chats in full. Set resumeModePrompt to true in ~/.orion/tui/config.json to bring the prompt back."
|
|
94014
|
+
);
|
|
94015
|
+
}
|
|
94016
|
+
void (async () => {
|
|
94017
|
+
await resume(fullId2);
|
|
94018
|
+
done2();
|
|
94019
|
+
if (v2 === "compact") {
|
|
94020
|
+
if (ctx.invokeSkill) ctx.invokeSkill("compact", "");
|
|
94021
|
+
else ctx.print("Run /compact to compact it now.", "warning");
|
|
94022
|
+
}
|
|
94023
|
+
})().catch(
|
|
94024
|
+
(e) => ctx.print(`Resume failed: ${e instanceof Error ? e.message : String(e)}`, "error")
|
|
94025
|
+
);
|
|
94026
|
+
}
|
|
94027
|
+
}
|
|
94028
|
+
}));
|
|
94029
|
+
};
|
|
93796
94030
|
if (!id) {
|
|
93797
94031
|
if (!sessions.length) return ctx.print("No saved sessions.", "warning");
|
|
93798
94032
|
const visible = sessions.slice(0, 20);
|
|
@@ -93810,7 +94044,9 @@ Install "${arg}"?`,
|
|
|
93810
94044
|
onSelect: (v2) => {
|
|
93811
94045
|
ctx.appStore.setState((s2) => ({ ...s2, activeDialog: null }));
|
|
93812
94046
|
if (v2)
|
|
93813
|
-
void
|
|
94047
|
+
void resumeWithModeChoice(v2).catch(
|
|
94048
|
+
(e) => ctx.print(`Resume failed: ${e instanceof Error ? e.message : String(e)}`, "error")
|
|
94049
|
+
);
|
|
93814
94050
|
}
|
|
93815
94051
|
}
|
|
93816
94052
|
}));
|
|
@@ -93822,8 +94058,7 @@ Install "${arg}"?`,
|
|
|
93822
94058
|
if (openIn) {
|
|
93823
94059
|
ctx.print(`This session is also open in ${openIn} \u2014 two drivers will interleave turns.`, "warning");
|
|
93824
94060
|
}
|
|
93825
|
-
await
|
|
93826
|
-
ctx.print(`Resumed session ${fullId.slice(0, 8)}.`, "success");
|
|
94061
|
+
await resumeWithModeChoice(fullId);
|
|
93827
94062
|
}
|
|
93828
94063
|
},
|
|
93829
94064
|
{
|
|
@@ -94360,115 +94595,20 @@ function resumedRouting(current2, saved) {
|
|
|
94360
94595
|
additionalDirectories: Array.isArray(saved.additionalDirectories) ? saved.additionalDirectories.filter((d2) => typeof d2 === "string") : []
|
|
94361
94596
|
};
|
|
94362
94597
|
}
|
|
94598
|
+
function resumedContextMeter(current2, gauge) {
|
|
94599
|
+
return {
|
|
94600
|
+
contextTokens: gauge?.tokens ?? 0,
|
|
94601
|
+
contextWindow: gauge?.window ?? 0,
|
|
94602
|
+
contextTriggerRatio: gauge?.triggerRatio ?? current2.contextTriggerRatio,
|
|
94603
|
+
contextBreakdown: gauge?.breakdown ?? null
|
|
94604
|
+
};
|
|
94605
|
+
}
|
|
94363
94606
|
|
|
94364
94607
|
// src/events/renderLane.ts
|
|
94365
94608
|
var import_client_core23 = __toESM(require_dist(), 1);
|
|
94609
|
+
var import_client_ui_core5 = __toESM(require_dist2(), 1);
|
|
94366
94610
|
var import_client_core24 = __toESM(require_dist(), 1);
|
|
94367
|
-
|
|
94368
|
-
// src/services/persistence.ts
|
|
94369
|
-
import * as path10 from "path";
|
|
94370
|
-
import * as fs11 from "fs";
|
|
94371
|
-
function sessionsDir() {
|
|
94372
|
-
return path10.join(orionHome(), "sessions");
|
|
94373
|
-
}
|
|
94374
|
-
function indexFile() {
|
|
94375
|
-
return path10.join(orionHome(), "index.json");
|
|
94376
|
-
}
|
|
94377
|
-
function sessionFile(sessionId) {
|
|
94378
|
-
return path10.join(sessionsDir(), `${sessionId}.json`);
|
|
94379
|
-
}
|
|
94380
|
-
function ensureDirs() {
|
|
94381
|
-
fs11.mkdirSync(sessionsDir(), { recursive: true });
|
|
94382
|
-
}
|
|
94383
|
-
function deriveTitle(messages) {
|
|
94384
|
-
for (const m2 of messages) {
|
|
94385
|
-
if (!m2 || typeof m2 !== "object") continue;
|
|
94386
|
-
if (m2.role !== "user") continue;
|
|
94387
|
-
const content = m2.content;
|
|
94388
|
-
let text = "";
|
|
94389
|
-
if (typeof content === "string") text = content;
|
|
94390
|
-
else if (Array.isArray(content)) {
|
|
94391
|
-
const first = content.find(
|
|
94392
|
-
(b2) => b2 && typeof b2 === "object" && b2.type === "text"
|
|
94393
|
-
);
|
|
94394
|
-
if (first && typeof first.text === "string") text = first.text;
|
|
94395
|
-
}
|
|
94396
|
-
text = text.trim().replace(/\s+/g, " ");
|
|
94397
|
-
if (text) return text.length > 60 ? `${text.slice(0, 57)}\u2026` : text;
|
|
94398
|
-
}
|
|
94399
|
-
return "(untitled session)";
|
|
94400
|
-
}
|
|
94401
|
-
function loadIndex() {
|
|
94402
|
-
try {
|
|
94403
|
-
const raw = JSON.parse(fs11.readFileSync(indexFile(), "utf8"));
|
|
94404
|
-
return Array.isArray(raw) ? raw : [];
|
|
94405
|
-
} catch {
|
|
94406
|
-
return [];
|
|
94407
|
-
}
|
|
94408
|
-
}
|
|
94409
|
-
var tmpSeq = 0;
|
|
94410
|
-
function writeAtomic(file, data) {
|
|
94411
|
-
const tmp = `${file}.${process.pid}.${Date.now()}.${tmpSeq++}.tmp`;
|
|
94412
|
-
fs11.writeFileSync(tmp, data);
|
|
94413
|
-
fs11.renameSync(tmp, file);
|
|
94414
|
-
}
|
|
94415
|
-
var saveFailureWarned = false;
|
|
94416
|
-
function saveSession(rec2) {
|
|
94417
|
-
try {
|
|
94418
|
-
ensureDirs();
|
|
94419
|
-
writeAtomic(sessionFile(rec2.sessionId), `${JSON.stringify(rec2, null, 2)}
|
|
94420
|
-
`);
|
|
94421
|
-
const idx = loadIndex().filter((e) => e.sessionId !== rec2.sessionId);
|
|
94422
|
-
idx.unshift({ sessionId: rec2.sessionId, title: rec2.title, updatedAt: rec2.updatedAt });
|
|
94423
|
-
writeAtomic(indexFile(), `${JSON.stringify(idx.slice(0, 100), null, 2)}
|
|
94424
|
-
`);
|
|
94425
|
-
return true;
|
|
94426
|
-
} catch (e) {
|
|
94427
|
-
if (!saveFailureWarned) {
|
|
94428
|
-
saveFailureWarned = true;
|
|
94429
|
-
console.error(
|
|
94430
|
-
`orion: session save failed, continuing without persistence: ${e instanceof Error ? e.message : String(e)}`
|
|
94431
|
-
);
|
|
94432
|
-
}
|
|
94433
|
-
return false;
|
|
94434
|
-
}
|
|
94435
|
-
}
|
|
94436
|
-
function loadSession(sessionId) {
|
|
94437
|
-
try {
|
|
94438
|
-
return JSON.parse(fs11.readFileSync(sessionFile(sessionId), "utf8"));
|
|
94439
|
-
} catch {
|
|
94440
|
-
return null;
|
|
94441
|
-
}
|
|
94442
|
-
}
|
|
94443
|
-
function renameSession(sessionId, title) {
|
|
94444
|
-
const rec2 = loadSession(sessionId);
|
|
94445
|
-
if (!rec2) return false;
|
|
94446
|
-
return saveSession({ ...rec2, title, updatedAt: Date.now() });
|
|
94447
|
-
}
|
|
94448
|
-
var pendingModelTitles = /* @__PURE__ */ new Map();
|
|
94449
|
-
function applyModelSessionTitle(sessionId, title) {
|
|
94450
|
-
const record = loadSession(sessionId);
|
|
94451
|
-
if (record === null) {
|
|
94452
|
-
pendingModelTitles.set(sessionId, title);
|
|
94453
|
-
return true;
|
|
94454
|
-
}
|
|
94455
|
-
if (record.title !== deriveTitle(record.messages)) {
|
|
94456
|
-
return false;
|
|
94457
|
-
}
|
|
94458
|
-
pendingModelTitles.delete(sessionId);
|
|
94459
|
-
return saveSession({ ...record, title, updatedAt: Date.now() });
|
|
94460
|
-
}
|
|
94461
|
-
function resolveTitle(sessionId, messages) {
|
|
94462
|
-
const stored = loadSession(sessionId)?.title;
|
|
94463
|
-
if (stored !== void 0) {
|
|
94464
|
-
pendingModelTitles.delete(sessionId);
|
|
94465
|
-
return stored;
|
|
94466
|
-
}
|
|
94467
|
-
return pendingModelTitles.get(sessionId) ?? deriveTitle(messages);
|
|
94468
|
-
}
|
|
94469
|
-
|
|
94470
|
-
// src/events/renderLane.ts
|
|
94471
|
-
var import_client_ui_core3 = __toESM(require_dist2(), 1);
|
|
94611
|
+
var import_client_ui_core6 = __toESM(require_dist2(), 1);
|
|
94472
94612
|
|
|
94473
94613
|
// src/services/loadingAnimation.ts
|
|
94474
94614
|
var LOADING_WORDS = [
|
|
@@ -94668,7 +94808,7 @@ function renderLane(transcript, app, ev) {
|
|
|
94668
94808
|
break;
|
|
94669
94809
|
case "tool_use_start": {
|
|
94670
94810
|
const name2 = typeof d2.name === "string" ? d2.name : "tool";
|
|
94671
|
-
if (!RICH_CARD_TOOLS.has(name2) && !(0,
|
|
94811
|
+
if (!RICH_CARD_TOOLS.has(name2) && !(0, import_client_ui_core6.isSilentTool)(name2)) {
|
|
94672
94812
|
transcript.setState((s) => startTool(s, name2, d2.input));
|
|
94673
94813
|
}
|
|
94674
94814
|
break;
|
|
@@ -94726,7 +94866,7 @@ function renderLane(transcript, app, ev) {
|
|
|
94726
94866
|
}
|
|
94727
94867
|
break;
|
|
94728
94868
|
}
|
|
94729
|
-
case "context_usage":
|
|
94869
|
+
case "context_usage": {
|
|
94730
94870
|
app.setState((s) => ({
|
|
94731
94871
|
...s,
|
|
94732
94872
|
contextTokens: typeof d2.tokens === "number" ? d2.tokens : s.contextTokens,
|
|
@@ -94737,7 +94877,17 @@ function renderLane(transcript, app, ev) {
|
|
|
94737
94877
|
contextTriggerRatio: typeof d2.trigger_ratio === "number" && Number.isFinite(d2.trigger_ratio) && d2.trigger_ratio > 0 && d2.trigger_ratio <= 1 ? d2.trigger_ratio : s.contextTriggerRatio,
|
|
94738
94878
|
contextBreakdown: d2.breakdown && typeof d2.breakdown === "object" ? d2.breakdown : s.contextBreakdown
|
|
94739
94879
|
}));
|
|
94880
|
+
const snapshot = (0, import_client_ui_core5.reviveContextGauge)({
|
|
94881
|
+
tokens: d2.tokens,
|
|
94882
|
+
window: d2.window,
|
|
94883
|
+
triggerRatio: d2.trigger_ratio,
|
|
94884
|
+
breakdown: d2.breakdown
|
|
94885
|
+
});
|
|
94886
|
+
if (snapshot) {
|
|
94887
|
+
transcript.setState((s) => ({ ...s, contextGauge: snapshot }));
|
|
94888
|
+
}
|
|
94740
94889
|
break;
|
|
94890
|
+
}
|
|
94741
94891
|
case "plan_updated":
|
|
94742
94892
|
app.setState((s) => ({
|
|
94743
94893
|
...s,
|
|
@@ -95057,7 +95207,7 @@ function makeGoalRunTurn(deps2) {
|
|
|
95057
95207
|
|
|
95058
95208
|
// src/events/boundaryHandlers.ts
|
|
95059
95209
|
var import_client_core26 = __toESM(require_dist(), 1);
|
|
95060
|
-
var
|
|
95210
|
+
var import_client_ui_core7 = __toESM(require_dist2(), 1);
|
|
95061
95211
|
function createBoundaryHandlers(deps2) {
|
|
95062
95212
|
const {
|
|
95063
95213
|
bridge,
|
|
@@ -95135,10 +95285,10 @@ function createBoundaryHandlers(deps2) {
|
|
|
95135
95285
|
},
|
|
95136
95286
|
onPlanApproval: (req) => {
|
|
95137
95287
|
if (deps2.planningRunActive?.(sid)) {
|
|
95138
|
-
return Promise.resolve((0,
|
|
95288
|
+
return Promise.resolve((0, import_client_ui_core7.planDeferredForGraph)());
|
|
95139
95289
|
}
|
|
95140
95290
|
if (deps2.agentsRunning?.(sid)) {
|
|
95141
|
-
return Promise.resolve((0,
|
|
95291
|
+
return Promise.resolve((0, import_client_ui_core7.planDeferredForAgents)());
|
|
95142
95292
|
}
|
|
95143
95293
|
const plan = typeof req.plan === "string" ? req.plan : "";
|
|
95144
95294
|
if (appStore.getState().mode === "duet") deps2.duetPlanPresented?.();
|
|
@@ -95195,7 +95345,7 @@ function createBoundaryHandlers(deps2) {
|
|
|
95195
95345
|
permissionResolvers.delete(requestId);
|
|
95196
95346
|
const pending = appStore.getState().pendingPermissions.find((p) => p.data.request_id === requestId);
|
|
95197
95347
|
const ctx = { workspaceRoot, homeDir };
|
|
95198
|
-
const resolved = (0,
|
|
95348
|
+
const resolved = (0, import_client_ui_core7.resolveCardChoice)(
|
|
95199
95349
|
outcome.kind === "allow" ? { kind: "allow" } : outcome,
|
|
95200
95350
|
ctx
|
|
95201
95351
|
);
|
|
@@ -95487,7 +95637,7 @@ var WorkPlanApprovalBridge = class {
|
|
|
95487
95637
|
};
|
|
95488
95638
|
|
|
95489
95639
|
// src/main.tsx
|
|
95490
|
-
var
|
|
95640
|
+
var import_client_ui_core23 = __toESM(require_dist2(), 1);
|
|
95491
95641
|
|
|
95492
95642
|
// src/components/layout/Transcript.tsx
|
|
95493
95643
|
var import_react28 = __toESM(require_react(), 1);
|
|
@@ -111216,7 +111366,7 @@ function Note({ text, tone, stats }) {
|
|
|
111216
111366
|
}
|
|
111217
111367
|
|
|
111218
111368
|
// src/components/tools/ToolLogLine.tsx
|
|
111219
|
-
var
|
|
111369
|
+
var import_client_ui_core8 = __toESM(require_dist2(), 1);
|
|
111220
111370
|
|
|
111221
111371
|
// src/components/tools/ResultRow.tsx
|
|
111222
111372
|
var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1);
|
|
@@ -111257,7 +111407,7 @@ function ToolLogLine({
|
|
|
111257
111407
|
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Box2, { flexDirection: "column", marginTop: 1, children: [
|
|
111258
111408
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Box2, { flexDirection: "row", children: [
|
|
111259
111409
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Box2, { minWidth: 2, flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ThemedText, { colorKey: toolMarkerColorKey(status), children: glyphs.tool }) }),
|
|
111260
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Box2, { flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ThemedText, { colorKey: "toolName", bold: true, children: (0,
|
|
111410
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Box2, { flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ThemedText, { colorKey: "toolName", bold: true, children: (0, import_client_ui_core8.toolDisplayName)(name2) }) }),
|
|
111261
111411
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Box2, { flexGrow: 1, flexShrink: 1, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Text2, { wrap: "wrap", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(ThemedText, { colorKey: "toolArgs", children: [
|
|
111262
111412
|
"(",
|
|
111263
111413
|
verbose ? args2 : truncate2(args2, 80),
|
|
@@ -111665,7 +111815,7 @@ function DiffCard({
|
|
|
111665
111815
|
}
|
|
111666
111816
|
|
|
111667
111817
|
// src/components/tools/TerminalCard.tsx
|
|
111668
|
-
var
|
|
111818
|
+
var import_client_ui_core9 = __toESM(require_dist2(), 1);
|
|
111669
111819
|
var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1);
|
|
111670
111820
|
var MAX_LINES = 200;
|
|
111671
111821
|
var PREVIEW_LINES = 3;
|
|
@@ -111701,7 +111851,7 @@ function TerminalCard({
|
|
|
111701
111851
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Box2, { flexDirection: "column", marginTop: 1, children: [
|
|
111702
111852
|
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Box2, { flexDirection: "row", children: [
|
|
111703
111853
|
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Box2, { minWidth: 2, flexShrink: 0, children: running ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(RunningMarker, {}) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ThemedText, { colorKey: terminalMarkerColorKey(exitCode), children: glyphs.tool }) }),
|
|
111704
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Box2, { flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ThemedText, { colorKey: "toolName", bold: true, children: (0,
|
|
111854
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Box2, { flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ThemedText, { colorKey: "toolName", bold: true, children: (0, import_client_ui_core9.toolDisplayName)("bash") }) }),
|
|
111705
111855
|
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Box2, { flexGrow: 1, flexShrink: 1, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(ThemedText, { colorKey: "toolArgs", wrap: "wrap", children: [
|
|
111706
111856
|
"(",
|
|
111707
111857
|
verbose ? command : collapseCommand(command),
|
|
@@ -111735,7 +111885,7 @@ function TerminalCard({
|
|
|
111735
111885
|
}
|
|
111736
111886
|
|
|
111737
111887
|
// src/components/tools/WebSearchCard.tsx
|
|
111738
|
-
var
|
|
111888
|
+
var import_client_ui_core10 = __toESM(require_dist2(), 1);
|
|
111739
111889
|
var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1);
|
|
111740
111890
|
function WebSearchCard({
|
|
111741
111891
|
query,
|
|
@@ -111744,7 +111894,7 @@ function WebSearchCard({
|
|
|
111744
111894
|
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Box2, { flexDirection: "column", marginTop: 1, children: [
|
|
111745
111895
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Box2, { flexDirection: "row", children: [
|
|
111746
111896
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Box2, { minWidth: 2, flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ThemedText, { colorKey: "chatMarker", children: glyphs.tool }) }),
|
|
111747
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Box2, { flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ThemedText, { colorKey: "toolName", bold: true, children: (0,
|
|
111897
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Box2, { flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ThemedText, { colorKey: "toolName", bold: true, children: (0, import_client_ui_core10.toolDisplayName)("web_search") }) }),
|
|
111748
111898
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Box2, { flexGrow: 1, flexShrink: 1, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(ThemedText, { colorKey: "toolArgs", wrap: "wrap", children: [
|
|
111749
111899
|
"(",
|
|
111750
111900
|
query,
|
|
@@ -111827,14 +111977,14 @@ function QuotaWarning({ refusal }) {
|
|
|
111827
111977
|
// src/components/tools/SubAgentTree.tsx
|
|
111828
111978
|
var import_react22 = __toESM(require_react(), 1);
|
|
111829
111979
|
var import_client_core28 = __toESM(require_dist(), 1);
|
|
111830
|
-
var
|
|
111980
|
+
var import_client_ui_core11 = __toESM(require_dist2(), 1);
|
|
111831
111981
|
var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1);
|
|
111832
111982
|
function agentLabel(agent) {
|
|
111833
111983
|
const type = agent.agentType.trim();
|
|
111834
111984
|
if (type && type !== "general" && type !== "agent") return type;
|
|
111835
111985
|
return typeof agent.ordinal === "number" ? `subagent ${agent.ordinal}` : "subagent";
|
|
111836
111986
|
}
|
|
111837
|
-
var rowMeta =
|
|
111987
|
+
var rowMeta = import_client_ui_core11.subagentRowMeta;
|
|
111838
111988
|
function rowStatus(agent) {
|
|
111839
111989
|
if (agent.phase === "finished") {
|
|
111840
111990
|
if (agent.status === "failed") return "Failed";
|
|
@@ -112102,7 +112252,7 @@ function OrionRing() {
|
|
|
112102
112252
|
|
|
112103
112253
|
// src/services/version.ts
|
|
112104
112254
|
function tuiVersion() {
|
|
112105
|
-
return "0.1.
|
|
112255
|
+
return "0.1.28".length > 0 ? "0.1.28" : null;
|
|
112106
112256
|
}
|
|
112107
112257
|
|
|
112108
112258
|
// src/components/layout/WelcomeCard.tsx
|
|
@@ -112137,7 +112287,7 @@ function WelcomeCard({ cwd, signedIn }) {
|
|
|
112137
112287
|
}
|
|
112138
112288
|
|
|
112139
112289
|
// src/components/layout/LiveTurn.tsx
|
|
112140
|
-
var
|
|
112290
|
+
var import_client_ui_core12 = __toESM(require_dist2(), 1);
|
|
112141
112291
|
var import_client_core29 = __toESM(require_dist(), 1);
|
|
112142
112292
|
|
|
112143
112293
|
// src/components/messages/Thinking.tsx
|
|
@@ -112214,7 +112364,7 @@ function LiveTurn({
|
|
|
112214
112364
|
assistantText.trim() ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(AssistantText, { text: assistantText, accent: live.assistantAccent }) : null,
|
|
112215
112365
|
showRunningTool && live.runningTool ? /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(Box2, { flexDirection: "row", marginTop: 1, children: [
|
|
112216
112366
|
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Box2, { minWidth: 2, flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ThemedText, { colorKey: runningMarkerColorKey(spinner), children: glyphs.tool }) }),
|
|
112217
|
-
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Box2, { flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ThemedText, { colorKey: "toolName", bold: true, children: (0,
|
|
112367
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Box2, { flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ThemedText, { colorKey: "toolName", bold: true, children: (0, import_client_ui_core12.toolDisplayName)(live.runningTool.name) }) }),
|
|
112218
112368
|
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Box2, { flexGrow: 1, flexShrink: 1, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(Text2, { wrap: "wrap", children: [
|
|
112219
112369
|
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(ThemedText, { colorKey: "toolArgs", children: [
|
|
112220
112370
|
"(",
|
|
@@ -112253,7 +112403,7 @@ function LiveCode({
|
|
|
112253
112403
|
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(Box2, { flexDirection: "column", marginTop: 1, children: [
|
|
112254
112404
|
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(Box2, { flexDirection: "row", children: [
|
|
112255
112405
|
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Box2, { minWidth: 2, flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ThemedText, { colorKey: runningMarkerColorKey(spinner), children: glyphs.tool }) }),
|
|
112256
|
-
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Box2, { flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ThemedText, { colorKey: "toolName", bold: true, children: (0,
|
|
112406
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Box2, { flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ThemedText, { colorKey: "toolName", bold: true, children: (0, import_client_ui_core12.toolDisplayName)(code.name) }) }),
|
|
112257
112407
|
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Box2, { flexGrow: 1, flexShrink: 1, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(Text2, { wrap: "wrap", children: [
|
|
112258
112408
|
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(ThemedText, { colorKey: "toolArgs", children: [
|
|
112259
112409
|
"(",
|
|
@@ -112485,11 +112635,11 @@ function PlanCard({ plan }) {
|
|
|
112485
112635
|
// src/components/tools/SubAgentCard.tsx
|
|
112486
112636
|
var import_react30 = __toESM(require_react(), 1);
|
|
112487
112637
|
var import_client_core30 = __toESM(require_dist(), 1);
|
|
112488
|
-
var
|
|
112638
|
+
var import_client_ui_core13 = __toESM(require_dist2(), 1);
|
|
112489
112639
|
var import_jsx_runtime44 = __toESM(require_jsx_runtime(), 1);
|
|
112490
112640
|
function SubAgentCard({ agent, now: now2 }) {
|
|
112491
112641
|
const elapsed = (0, import_client_core30.formatElapsed)((now2 ?? Date.now()) - agent.startedAt);
|
|
112492
|
-
const metrics = [elapsed, (0,
|
|
112642
|
+
const metrics = [elapsed, (0, import_client_ui_core13.subagentTokenLabel)(agent.contextTokens)].filter(Boolean).join(" \xB7 ");
|
|
112493
112643
|
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(Box2, { flexDirection: "row", children: [
|
|
112494
112644
|
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Box2, { flexShrink: 0, marginRight: 1, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ThemedText, { colorKey: "dim", children: glyphs.subagent }) }),
|
|
112495
112645
|
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Box2, { flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ThemedText, { colorKey: rowColorKey(agent), bold: true, wrap: "truncate", children: agentLabel(agent) }) }),
|
|
@@ -114271,7 +114421,7 @@ function StatusBar({
|
|
|
114271
114421
|
|
|
114272
114422
|
// src/components/dialogs/AskUserPrompt.tsx
|
|
114273
114423
|
var import_react34 = __toESM(require_react(), 1);
|
|
114274
|
-
var
|
|
114424
|
+
var import_client_ui_core14 = __toESM(require_dist2(), 1);
|
|
114275
114425
|
|
|
114276
114426
|
// src/components/dialogs/LineEditor.tsx
|
|
114277
114427
|
var import_jsx_runtime51 = __toESM(require_jsx_runtime(), 1);
|
|
@@ -114310,7 +114460,7 @@ function QuestionChips({
|
|
|
114310
114460
|
selections
|
|
114311
114461
|
}) {
|
|
114312
114462
|
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Box2, { flexDirection: "row", children: questions.map((question, i2) => {
|
|
114313
|
-
const mark = (0,
|
|
114463
|
+
const mark = (0, import_client_ui_core14.isAnswered)(selections[i2] ?? import_client_ui_core14.EMPTY_SELECTION) ? "\u2713 " : "";
|
|
114314
114464
|
const label = `${mark}${question.header}`;
|
|
114315
114465
|
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Box2, { marginRight: 2, children: i2 === index ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(GradientText, { text: `[${label}]` }) : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ThemedText, { dim: true, children: ` ${label} ` }) }, `${question.header}-${i2}`);
|
|
114316
114466
|
}) });
|
|
@@ -114322,10 +114472,10 @@ function AskUserPrompt({
|
|
|
114322
114472
|
guardMs = 250
|
|
114323
114473
|
}) {
|
|
114324
114474
|
const { requestId, sessionId } = pending;
|
|
114325
|
-
const card = (0, import_react34.useMemo)(() => (0,
|
|
114475
|
+
const card = (0, import_react34.useMemo)(() => (0, import_client_ui_core14.buildAskCard)(pending.request), [pending.request]);
|
|
114326
114476
|
const questions = card.questions;
|
|
114327
114477
|
const [selections, setSelections] = (0, import_react34.useState)(
|
|
114328
|
-
() => questions.map(() =>
|
|
114478
|
+
() => questions.map(() => import_client_ui_core14.EMPTY_SELECTION)
|
|
114329
114479
|
);
|
|
114330
114480
|
const [index, setIndex] = (0, import_react34.useState)(0);
|
|
114331
114481
|
const [cursor, setCursor] = (0, import_react34.useState)(0);
|
|
@@ -114339,7 +114489,7 @@ function AskUserPrompt({
|
|
|
114339
114489
|
const theme = useTheme();
|
|
114340
114490
|
const ruleWidth = Math.max(20, Math.min(MAX_RULE, columns - 8));
|
|
114341
114491
|
const question = questions[index];
|
|
114342
|
-
const submit = (finalSelections) => onRespond(requestId, (0,
|
|
114492
|
+
const submit = (finalSelections) => onRespond(requestId, (0, import_client_ui_core14.buildAnswers)(card, finalSelections), sessionId);
|
|
114343
114493
|
const commit = (next) => {
|
|
114344
114494
|
const updated = selections.map((s, i2) => i2 === index ? next : s);
|
|
114345
114495
|
setSelections(updated);
|
|
@@ -114365,7 +114515,7 @@ function AskUserPrompt({
|
|
|
114365
114515
|
setDraft(selections[index]?.writeIn ?? "");
|
|
114366
114516
|
return;
|
|
114367
114517
|
}
|
|
114368
|
-
const next = (0,
|
|
114518
|
+
const next = (0, import_client_ui_core14.toggleChoice)(selections[index] ?? import_client_ui_core14.EMPTY_SELECTION, choice, question.multiSelect);
|
|
114369
114519
|
if (question.multiSelect) {
|
|
114370
114520
|
setSelections(selections.map((s, i2) => i2 === index ? next : s));
|
|
114371
114521
|
return;
|
|
@@ -114387,8 +114537,8 @@ function AskUserPrompt({
|
|
|
114387
114537
|
if (input === " " && question.multiSelect) return activate(cursor);
|
|
114388
114538
|
if (key.return) {
|
|
114389
114539
|
if (question.multiSelect) {
|
|
114390
|
-
const current2 = selections[index] ??
|
|
114391
|
-
if ((0,
|
|
114540
|
+
const current2 = selections[index] ?? import_client_ui_core14.EMPTY_SELECTION;
|
|
114541
|
+
if ((0, import_client_ui_core14.isAnswered)(current2)) return commit(current2);
|
|
114392
114542
|
if (question.choices[cursor]?.isWriteIn) return activate(cursor);
|
|
114393
114543
|
return;
|
|
114394
114544
|
}
|
|
@@ -114398,7 +114548,7 @@ function AskUserPrompt({
|
|
|
114398
114548
|
if (!question) {
|
|
114399
114549
|
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Box2, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ThemedText, { dim: true, children: "(no question to answer \u2014 press esc)" }) });
|
|
114400
114550
|
}
|
|
114401
|
-
const answeredHere = (0,
|
|
114551
|
+
const answeredHere = (0, import_client_ui_core14.isAnswered)(selections[index] ?? import_client_ui_core14.EMPTY_SELECTION);
|
|
114402
114552
|
const step = questions.length > 1 ? `${index + 1} of ${questions.length}` : "";
|
|
114403
114553
|
const hint = question.multiSelect ? `space toggle \xB7 enter confirm${questions.length > 1 ? " \xB7 tab next" : ""} \xB7 esc dismiss` : `enter select \xB7 \u2191\u2193 move${questions.length > 1 ? " \xB7 tab next" : ""} \xB7 esc dismiss`;
|
|
114404
114554
|
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
@@ -114417,8 +114567,8 @@ function AskUserPrompt({
|
|
|
114417
114567
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ThemedText, { bold: true, wrap: "wrap", children: question.question }),
|
|
114418
114568
|
draft === null ? /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(Box2, { flexDirection: "column", marginTop: 1, children: [
|
|
114419
114569
|
question.choices.map((choice, i2) => {
|
|
114420
|
-
const picked = (selections[index] ??
|
|
114421
|
-
const writtenIn = choice.isWriteIn && (selections[index] ??
|
|
114570
|
+
const picked = (selections[index] ?? import_client_ui_core14.EMPTY_SELECTION).picked.includes(choice.value);
|
|
114571
|
+
const writtenIn = choice.isWriteIn && (selections[index] ?? import_client_ui_core14.EMPTY_SELECTION).writeIn !== "";
|
|
114422
114572
|
const box = question.multiSelect ? picked ? "[x] " : "[ ] " : "";
|
|
114423
114573
|
const mark = !question.multiSelect && (picked || writtenIn) ? "\u2713 " : "";
|
|
114424
114574
|
const label = `${box}${mark}${i2 + 1}. ${choice.label}`;
|
|
@@ -114441,12 +114591,12 @@ function AskUserPrompt({
|
|
|
114441
114591
|
hint: "enter save \xB7 esc back",
|
|
114442
114592
|
onChange: setDraft,
|
|
114443
114593
|
onSubmit: () => {
|
|
114444
|
-
const next = (0,
|
|
114445
|
-
selections[index] ??
|
|
114594
|
+
const next = (0, import_client_ui_core14.setWriteIn)(
|
|
114595
|
+
selections[index] ?? import_client_ui_core14.EMPTY_SELECTION,
|
|
114446
114596
|
draft,
|
|
114447
114597
|
question.multiSelect
|
|
114448
114598
|
);
|
|
114449
|
-
if (!(0,
|
|
114599
|
+
if (!(0, import_client_ui_core14.isAnswered)(next)) return setDraft(null);
|
|
114450
114600
|
if (question.multiSelect) {
|
|
114451
114601
|
setSelections(selections.map((s, i2) => i2 === index ? next : s));
|
|
114452
114602
|
setDraft(null);
|
|
@@ -114477,7 +114627,7 @@ function writtenInPreview(selection) {
|
|
|
114477
114627
|
|
|
114478
114628
|
// src/components/dialogs/FeedbackPrompt.tsx
|
|
114479
114629
|
var import_react35 = __toESM(require_react(), 1);
|
|
114480
|
-
var
|
|
114630
|
+
var import_client_ui_core15 = __toESM(require_dist2(), 1);
|
|
114481
114631
|
var import_jsx_runtime53 = __toESM(require_jsx_runtime(), 1);
|
|
114482
114632
|
function FeedbackPrompt({
|
|
114483
114633
|
pending,
|
|
@@ -114513,15 +114663,15 @@ function FeedbackPrompt({
|
|
|
114513
114663
|
borderColor: theme.planMode,
|
|
114514
114664
|
paddingX: 1,
|
|
114515
114665
|
children: [
|
|
114516
|
-
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ThemedText, { bold: true, children:
|
|
114666
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ThemedText, { bold: true, children: import_client_ui_core15.FEEDBACK_WORDING.title }),
|
|
114517
114667
|
why === null ? /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_jsx_runtime53.Fragment, { children: [
|
|
114518
114668
|
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Box2, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(GradientText, { text: " 1 2 3 4 5" }) }),
|
|
114519
|
-
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ThemedText, { dim: true, children: ` ${
|
|
114669
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ThemedText, { dim: true, children: ` ${import_client_ui_core15.FEEDBACK_WORDING.scoreHint}` }),
|
|
114520
114670
|
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Box2, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ThemedText, { dim: true, children: "press 1-5 \xB7 esc dismiss \xB7 any key skip" }) })
|
|
114521
114671
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
114522
114672
|
LineEditor,
|
|
114523
114673
|
{
|
|
114524
|
-
label: (0,
|
|
114674
|
+
label: (0, import_client_ui_core15.feedbackWhyLabel)(score),
|
|
114525
114675
|
value: why,
|
|
114526
114676
|
hint: "enter send \xB7 esc back",
|
|
114527
114677
|
onChange: setWhy,
|
|
@@ -114539,8 +114689,8 @@ function FeedbackPrompt({
|
|
|
114539
114689
|
|
|
114540
114690
|
// src/components/dialogs/PermissionPrompt.tsx
|
|
114541
114691
|
var import_react37 = __toESM(require_react(), 1);
|
|
114542
|
-
var
|
|
114543
|
-
var
|
|
114692
|
+
var import_client_ui_core16 = __toESM(require_dist2(), 1);
|
|
114693
|
+
var import_client_ui_core17 = __toESM(require_dist2(), 1);
|
|
114544
114694
|
var import_client_core34 = __toESM(require_dist(), 1);
|
|
114545
114695
|
|
|
114546
114696
|
// src/components/dialogs/SelectList.tsx
|
|
@@ -114548,6 +114698,7 @@ var import_react36 = __toESM(require_react(), 1);
|
|
|
114548
114698
|
var import_jsx_runtime54 = __toESM(require_jsx_runtime(), 1);
|
|
114549
114699
|
function SelectList({
|
|
114550
114700
|
title,
|
|
114701
|
+
body: body2,
|
|
114551
114702
|
options,
|
|
114552
114703
|
onSelect,
|
|
114553
114704
|
columns = false,
|
|
@@ -114607,6 +114758,7 @@ function SelectList({
|
|
|
114607
114758
|
const totalSelectable = filterable ? options.filter((o) => !o.separator).length : 0;
|
|
114608
114759
|
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(Box2, { flexDirection: "column", marginTop: 1, children: [
|
|
114609
114760
|
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ThemedText, { colorKey: "listSelection", bold: true, children: title }),
|
|
114761
|
+
body2 ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Box2, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ThemedText, { children: body2 }) }) : null,
|
|
114610
114762
|
filterable ? /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(Box2, { children: [
|
|
114611
114763
|
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ThemedText, { dim: true, children: "Search: " }),
|
|
114612
114764
|
query.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ThemedText, { children: query }) : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ThemedText, { dim: true, children: "type to filter" }),
|
|
@@ -114668,7 +114820,7 @@ function PermissionPrompt({
|
|
|
114668
114820
|
}) {
|
|
114669
114821
|
const { data, sessionId } = pending;
|
|
114670
114822
|
const model = (0, import_react37.useMemo)(
|
|
114671
|
-
() => (0,
|
|
114823
|
+
() => (0, import_client_ui_core16.buildPermissionCard)(data, { agentLabel: pending.agentLabel ?? null }),
|
|
114672
114824
|
[data, pending.agentLabel]
|
|
114673
114825
|
);
|
|
114674
114826
|
const [stage, setStage] = (0, import_react37.useState)({ kind: "choose" });
|
|
@@ -114726,7 +114878,7 @@ function PermissionPrompt({
|
|
|
114726
114878
|
] });
|
|
114727
114879
|
}
|
|
114728
114880
|
if (body2.kind === "edit") {
|
|
114729
|
-
const { shown, more } = cap((0,
|
|
114881
|
+
const { shown, more } = cap((0, import_client_ui_core17.editDiffLines)(body2, 60));
|
|
114730
114882
|
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Box2, { flexDirection: "column", children: [
|
|
114731
114883
|
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(ThemedText, { dim: true, wrap: "truncate-middle", children: body2.path }),
|
|
114732
114884
|
shown.map((line2, i2) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
@@ -114815,7 +114967,7 @@ function PermissionPrompt({
|
|
|
114815
114967
|
SelectList,
|
|
114816
114968
|
{
|
|
114817
114969
|
title: `Save "${stage.rule}" to\u2026`,
|
|
114818
|
-
options:
|
|
114970
|
+
options: import_client_ui_core16.DESTINATIONS.map((d2) => ({
|
|
114819
114971
|
value: d2.source,
|
|
114820
114972
|
label: d2.source === stage.defaultDestination ? `${d2.label} (default)` : d2.label
|
|
114821
114973
|
})),
|
|
@@ -115391,7 +115543,7 @@ function EndpointsPanel({
|
|
|
115391
115543
|
// src/components/dialogs/PermissionRulesPanel.tsx
|
|
115392
115544
|
var import_react39 = __toESM(require_react(), 1);
|
|
115393
115545
|
var import_client_core35 = __toESM(require_dist(), 1);
|
|
115394
|
-
var
|
|
115546
|
+
var import_client_ui_core18 = __toESM(require_dist2(), 1);
|
|
115395
115547
|
var import_jsx_runtime57 = __toESM(require_jsx_runtime(), 1);
|
|
115396
115548
|
function PermissionRulesPanel({
|
|
115397
115549
|
rules,
|
|
@@ -115451,7 +115603,7 @@ function PermissionRulesPanel({
|
|
|
115451
115603
|
SelectList,
|
|
115452
115604
|
{
|
|
115453
115605
|
title: `Save "${stage.rule}" to\u2026`,
|
|
115454
|
-
options:
|
|
115606
|
+
options: import_client_ui_core18.DESTINATIONS.map((d2) => ({ value: d2.source, label: d2.label })),
|
|
115455
115607
|
onSelect: (value) => {
|
|
115456
115608
|
if (value === null) return setStage({ kind: "list" });
|
|
115457
115609
|
void add(stage.rule, stage.behavior, value).then(
|
|
@@ -115595,34 +115747,49 @@ function ModelPicker({ dialog }) {
|
|
|
115595
115747
|
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(SelectList, { title: dialog.title, options: dialog.options, onSelect: dialog.onSelect, filterable: true });
|
|
115596
115748
|
}
|
|
115597
115749
|
|
|
115598
|
-
// src/components/dialogs/
|
|
115750
|
+
// src/components/dialogs/ResumeModeDialog.tsx
|
|
115599
115751
|
var import_jsx_runtime61 = __toESM(require_jsx_runtime(), 1);
|
|
115752
|
+
function ResumeModeDialog({ dialog }) {
|
|
115753
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
115754
|
+
SelectList,
|
|
115755
|
+
{
|
|
115756
|
+
title: dialog.title,
|
|
115757
|
+
body: dialog.body,
|
|
115758
|
+
options: dialog.options,
|
|
115759
|
+
onSelect: dialog.onSelect,
|
|
115760
|
+
numbered: true
|
|
115761
|
+
}
|
|
115762
|
+
);
|
|
115763
|
+
}
|
|
115764
|
+
|
|
115765
|
+
// src/components/dialogs/ResumePicker.tsx
|
|
115766
|
+
var import_jsx_runtime62 = __toESM(require_jsx_runtime(), 1);
|
|
115600
115767
|
function ResumePicker({ dialog }) {
|
|
115601
|
-
return /* @__PURE__ */ (0,
|
|
115768
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(SelectList, { title: dialog.title, options: dialog.options, onSelect: dialog.onSelect, filterable: true });
|
|
115602
115769
|
}
|
|
115603
115770
|
|
|
115604
115771
|
// src/components/dialogs/ConfirmDialog.tsx
|
|
115605
|
-
var
|
|
115772
|
+
var import_jsx_runtime63 = __toESM(require_jsx_runtime(), 1);
|
|
115606
115773
|
function ConfirmDialog({ dialog }) {
|
|
115607
115774
|
use_input_default((input, key) => {
|
|
115608
115775
|
const c3 = (input ?? "").toLowerCase();
|
|
115609
115776
|
if (c3 === "y" || key.return) dialog.onSelect("yes");
|
|
115610
115777
|
else if (c3 === "n" || key.escape) dialog.onSelect("no");
|
|
115611
115778
|
});
|
|
115612
|
-
return /* @__PURE__ */ (0,
|
|
115613
|
-
/* @__PURE__ */ (0,
|
|
115614
|
-
/* @__PURE__ */ (0,
|
|
115615
|
-
/* @__PURE__ */ (0,
|
|
115616
|
-
/* @__PURE__ */ (0,
|
|
115617
|
-
/* @__PURE__ */ (0,
|
|
115618
|
-
/* @__PURE__ */ (0,
|
|
115779
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(Box2, { flexDirection: "column", marginTop: 1, children: [
|
|
115780
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(ThemedText, { colorKey: "warning", bold: true, children: dialog.title }),
|
|
115781
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(Box2, { marginTop: 1, flexDirection: "row", children: [
|
|
115782
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(ThemedText, { colorKey: "success", bold: true, children: "[y]" }),
|
|
115783
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(ThemedText, { dim: true, children: " yes\xA0\xA0\xA0" }),
|
|
115784
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(ThemedText, { colorKey: "error", bold: true, children: "[n]" }),
|
|
115785
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(ThemedText, { dim: true, children: " no" })
|
|
115619
115786
|
] })
|
|
115620
115787
|
] });
|
|
115621
115788
|
}
|
|
115622
115789
|
|
|
115623
115790
|
// src/components/dialogs/HooksBrowser.tsx
|
|
115624
115791
|
var import_react42 = __toESM(require_react(), 1);
|
|
115625
|
-
var
|
|
115792
|
+
var import_jsx_runtime64 = __toESM(require_jsx_runtime(), 1);
|
|
115626
115793
|
function matcherLabel(m2) {
|
|
115627
115794
|
if (!m2 || typeof m2 !== "object") return "(any)";
|
|
115628
115795
|
const parts2 = Object.entries(m2).map(([k, v2]) => `${k}=${String(v2)}`);
|
|
@@ -115641,48 +115808,48 @@ function HookDetail({ hook, onBack }) {
|
|
|
115641
115808
|
if (key.escape || key.return) onBack();
|
|
115642
115809
|
});
|
|
115643
115810
|
const cmd = commandLabel2(hook.command);
|
|
115644
|
-
return /* @__PURE__ */ (0,
|
|
115645
|
-
/* @__PURE__ */ (0,
|
|
115646
|
-
/* @__PURE__ */ (0,
|
|
115647
|
-
/* @__PURE__ */ (0,
|
|
115811
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(Box2, { flexDirection: "column", marginTop: 1, children: [
|
|
115812
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(ThemedText, { colorKey: "listSelection", bold: true, children: "Hook detail" }),
|
|
115813
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(Box2, { flexDirection: "column", marginTop: 1, children: [
|
|
115814
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(ThemedText, { children: [
|
|
115648
115815
|
"event: ",
|
|
115649
115816
|
hook.event ?? "\u2014"
|
|
115650
115817
|
] }),
|
|
115651
|
-
/* @__PURE__ */ (0,
|
|
115818
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(ThemedText, { children: [
|
|
115652
115819
|
"type: ",
|
|
115653
115820
|
hook.type ?? "command"
|
|
115654
115821
|
] }),
|
|
115655
|
-
/* @__PURE__ */ (0,
|
|
115822
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(ThemedText, { children: [
|
|
115656
115823
|
"matcher: ",
|
|
115657
115824
|
matcherLabel(hook.matcher)
|
|
115658
115825
|
] }),
|
|
115659
|
-
cmd ? /* @__PURE__ */ (0,
|
|
115826
|
+
cmd ? /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(ThemedText, { children: [
|
|
115660
115827
|
"command: ",
|
|
115661
115828
|
cmd
|
|
115662
115829
|
] }) : null,
|
|
115663
|
-
hook.url ? /* @__PURE__ */ (0,
|
|
115830
|
+
hook.url ? /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(ThemedText, { children: [
|
|
115664
115831
|
"url: ",
|
|
115665
115832
|
hook.url
|
|
115666
115833
|
] }) : null,
|
|
115667
|
-
hook.model ? /* @__PURE__ */ (0,
|
|
115834
|
+
hook.model ? /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(ThemedText, { children: [
|
|
115668
115835
|
"model: ",
|
|
115669
115836
|
hook.model
|
|
115670
115837
|
] }) : null,
|
|
115671
|
-
hook.agent_kind ? /* @__PURE__ */ (0,
|
|
115838
|
+
hook.agent_kind ? /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(ThemedText, { children: [
|
|
115672
115839
|
"agent: ",
|
|
115673
115840
|
hook.agent_kind
|
|
115674
115841
|
] }) : null,
|
|
115675
|
-
/* @__PURE__ */ (0,
|
|
115842
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(ThemedText, { children: [
|
|
115676
115843
|
"blocking: ",
|
|
115677
115844
|
hook.blocking ? "yes" : "no"
|
|
115678
115845
|
] }),
|
|
115679
|
-
hook.timeout_ms != null ? /* @__PURE__ */ (0,
|
|
115846
|
+
hook.timeout_ms != null ? /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(ThemedText, { children: [
|
|
115680
115847
|
"timeout: ",
|
|
115681
115848
|
hook.timeout_ms,
|
|
115682
115849
|
"ms"
|
|
115683
115850
|
] }) : null
|
|
115684
115851
|
] }),
|
|
115685
|
-
/* @__PURE__ */ (0,
|
|
115852
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(ThemedText, { dim: true, children: "esc back" })
|
|
115686
115853
|
] });
|
|
115687
115854
|
}
|
|
115688
115855
|
function HooksBrowser({
|
|
@@ -115698,7 +115865,7 @@ function HooksBrowser({
|
|
|
115698
115865
|
const n = hooks.filter((h) => (h.event ?? "(unknown)") === e).length;
|
|
115699
115866
|
return { label: e, value: e, hint: `${n} hook${n === 1 ? "" : "s"}` };
|
|
115700
115867
|
});
|
|
115701
|
-
return /* @__PURE__ */ (0,
|
|
115868
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
115702
115869
|
SelectList,
|
|
115703
115870
|
{
|
|
115704
115871
|
title: "Hooks \u2014 select an event",
|
|
@@ -115714,7 +115881,7 @@ function HooksBrowser({
|
|
|
115714
115881
|
const n = inEvent.filter((h) => matcherLabel(h.matcher) === m2).length;
|
|
115715
115882
|
return { label: m2, value: m2, hint: `${n} hook${n === 1 ? "" : "s"}` };
|
|
115716
115883
|
});
|
|
115717
|
-
return /* @__PURE__ */ (0,
|
|
115884
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
115718
115885
|
SelectList,
|
|
115719
115886
|
{
|
|
115720
115887
|
title: `Hooks \xB7 ${event} \u2014 select a matcher`,
|
|
@@ -115726,7 +115893,7 @@ function HooksBrowser({
|
|
|
115726
115893
|
const inMatcher = inEvent.filter((h) => matcherLabel(h.matcher) === matcher);
|
|
115727
115894
|
if (hookIdx === null) {
|
|
115728
115895
|
const options = inMatcher.map((h, i2) => ({ label: hookSummary(h), value: String(i2) }));
|
|
115729
|
-
return /* @__PURE__ */ (0,
|
|
115896
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
115730
115897
|
SelectList,
|
|
115731
115898
|
{
|
|
115732
115899
|
title: `Hooks \xB7 ${event} \xB7 ${matcher} \u2014 select a hook`,
|
|
@@ -115738,15 +115905,15 @@ function HooksBrowser({
|
|
|
115738
115905
|
const hook = inMatcher[hookIdx];
|
|
115739
115906
|
if (!hook) {
|
|
115740
115907
|
setHookIdx(null);
|
|
115741
|
-
return /* @__PURE__ */ (0,
|
|
115908
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Box2, {});
|
|
115742
115909
|
}
|
|
115743
|
-
return /* @__PURE__ */ (0,
|
|
115910
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(HookDetail, { hook, onBack: () => setHookIdx(null) });
|
|
115744
115911
|
}
|
|
115745
115912
|
|
|
115746
115913
|
// src/components/dialogs/PluginManager.tsx
|
|
115747
115914
|
var import_react43 = __toESM(require_react(), 1);
|
|
115748
115915
|
var import_client_core37 = __toESM(require_dist(), 1);
|
|
115749
|
-
var
|
|
115916
|
+
var import_jsx_runtime65 = __toESM(require_jsx_runtime(), 1);
|
|
115750
115917
|
function pluginId(p) {
|
|
115751
115918
|
return p.id ?? p.name ?? "";
|
|
115752
115919
|
}
|
|
@@ -115773,11 +115940,11 @@ function PluginManager({
|
|
|
115773
115940
|
});
|
|
115774
115941
|
};
|
|
115775
115942
|
if (busy) {
|
|
115776
|
-
return /* @__PURE__ */ (0,
|
|
115943
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Box2, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(ThemedText, { dim: true, children: "Working\u2026" }) });
|
|
115777
115944
|
}
|
|
115778
115945
|
if (view.at === "installed" && view.confirmingUninstall) {
|
|
115779
115946
|
const selected = plugins.find((p) => pluginId(p) === view.id);
|
|
115780
|
-
return /* @__PURE__ */ (0,
|
|
115947
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
115781
115948
|
ConfirmDialog,
|
|
115782
115949
|
{
|
|
115783
115950
|
dialog: {
|
|
@@ -115800,7 +115967,7 @@ function PluginManager({
|
|
|
115800
115967
|
{ label: "Update", value: "update" },
|
|
115801
115968
|
{ label: "Uninstall", value: "uninstall" }
|
|
115802
115969
|
];
|
|
115803
|
-
return /* @__PURE__ */ (0,
|
|
115970
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
115804
115971
|
SelectList,
|
|
115805
115972
|
{
|
|
115806
115973
|
title: `Plugin: ${pluginLabel(selected)} (${selected.enabled ? "enabled" : "disabled"}, ${selected.scope ?? "global"} scope${contributionSummary(selected) ? ` \u2014 contributes ${contributionSummary(selected)}` : ""})`,
|
|
@@ -115815,7 +115982,7 @@ function PluginManager({
|
|
|
115815
115982
|
}
|
|
115816
115983
|
if (view.at === "entry" && view.confirmingScope) {
|
|
115817
115984
|
const scope = view.confirmingScope;
|
|
115818
|
-
return /* @__PURE__ */ (0,
|
|
115985
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
115819
115986
|
ConfirmDialog,
|
|
115820
115987
|
{
|
|
115821
115988
|
dialog: {
|
|
@@ -115840,7 +116007,7 @@ Install "${view.id}" from "${view.catalog}" (${scope} scope)?`,
|
|
|
115840
116007
|
entry.description,
|
|
115841
116008
|
entry.tags.length ? `tags: ${entry.tags.join(", ")}` : ""
|
|
115842
116009
|
].filter(Boolean).join("\n");
|
|
115843
|
-
return /* @__PURE__ */ (0,
|
|
116010
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
115844
116011
|
SelectList,
|
|
115845
116012
|
{
|
|
115846
116013
|
title,
|
|
@@ -115859,7 +116026,7 @@ Install "${view.id}" from "${view.catalog}" (${scope} scope)?`,
|
|
|
115859
116026
|
const catalog = catalogs.find((c3) => c3.name === view.name);
|
|
115860
116027
|
if (!catalog) return listView();
|
|
115861
116028
|
if (catalog.error) {
|
|
115862
|
-
return /* @__PURE__ */ (0,
|
|
116029
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
115863
116030
|
SelectList,
|
|
115864
116031
|
{
|
|
115865
116032
|
title: `${catalog.name}: ${catalog.error}`,
|
|
@@ -115873,7 +116040,7 @@ Install "${view.id}" from "${view.catalog}" (${scope} scope)?`,
|
|
|
115873
116040
|
value: e.id,
|
|
115874
116041
|
hint: e.installed ? "installed" : e.description
|
|
115875
116042
|
}));
|
|
115876
|
-
return /* @__PURE__ */ (0,
|
|
116043
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
115877
116044
|
SelectList,
|
|
115878
116045
|
{
|
|
115879
116046
|
title: `Marketplace: ${catalog.name}${catalog.description ? ` \u2014 ${catalog.description}` : ""}`,
|
|
@@ -115901,7 +116068,7 @@ Install "${view.id}" from "${view.catalog}" (${scope} scope)?`,
|
|
|
115901
116068
|
hint: c3.error ? "unavailable" : `${c3.entries.length} plugin${c3.entries.length === 1 ? "" : "s"}`
|
|
115902
116069
|
}))
|
|
115903
116070
|
];
|
|
115904
|
-
return /* @__PURE__ */ (0,
|
|
116071
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
115905
116072
|
SelectList,
|
|
115906
116073
|
{
|
|
115907
116074
|
title: plugins.length ? "Plugins \u2014 select one to manage" : "Plugins \u2014 browse a marketplace to install",
|
|
@@ -115918,7 +116085,7 @@ Install "${view.id}" from "${view.catalog}" (${scope} scope)?`,
|
|
|
115918
116085
|
|
|
115919
116086
|
// src/components/dialogs/RewindPicker.tsx
|
|
115920
116087
|
var import_react44 = __toESM(require_react(), 1);
|
|
115921
|
-
var
|
|
116088
|
+
var import_jsx_runtime66 = __toESM(require_jsx_runtime(), 1);
|
|
115922
116089
|
function statLabel(t) {
|
|
115923
116090
|
if (!t.files) return "no code changes";
|
|
115924
116091
|
return `${t.files} file${t.files === 1 ? "" : "s"} +${t.insertions}/-${t.deletions}`;
|
|
@@ -115935,7 +116102,7 @@ function RewindPicker({
|
|
|
115935
116102
|
const [picked, setPicked] = (0, import_react44.useState)(null);
|
|
115936
116103
|
const [busy, setBusy] = (0, import_react44.useState)(false);
|
|
115937
116104
|
if (busy) {
|
|
115938
|
-
return /* @__PURE__ */ (0,
|
|
116105
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Box2, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(ThemedText, { dim: true, children: "Working\u2026" }) });
|
|
115939
116106
|
}
|
|
115940
116107
|
if (picked !== null) {
|
|
115941
116108
|
const turn = turns[picked];
|
|
@@ -115946,7 +116113,7 @@ function RewindPicker({
|
|
|
115946
116113
|
...hasCode ? [{ label: "Restore code", value: "code" }] : [],
|
|
115947
116114
|
{ label: "Never mind", value: "cancel" }
|
|
115948
116115
|
];
|
|
115949
|
-
return /* @__PURE__ */ (0,
|
|
116116
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
115950
116117
|
SelectList,
|
|
115951
116118
|
{
|
|
115952
116119
|
title: `Rewind to: ${preview(turn?.prompt ?? "")}`,
|
|
@@ -115960,7 +116127,7 @@ function RewindPicker({
|
|
|
115960
116127
|
);
|
|
115961
116128
|
}
|
|
115962
116129
|
const options = turns.map((t, i2) => ({ t, i: i2 })).reverse().map(({ t, i: i2 }) => ({ label: preview(t.prompt), value: String(i2), hint: statLabel(t) }));
|
|
115963
|
-
return /* @__PURE__ */ (0,
|
|
116130
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
115964
116131
|
SelectList,
|
|
115965
116132
|
{
|
|
115966
116133
|
title: "Rewind \u2014 pick a turn to return to",
|
|
@@ -115972,7 +116139,7 @@ function RewindPicker({
|
|
|
115972
116139
|
|
|
115973
116140
|
// src/components/dialogs/McpManager.tsx
|
|
115974
116141
|
var import_react45 = __toESM(require_react(), 1);
|
|
115975
|
-
var
|
|
116142
|
+
var import_jsx_runtime67 = __toESM(require_jsx_runtime(), 1);
|
|
115976
116143
|
function statusLabel(s) {
|
|
115977
116144
|
return s.status === "needs_auth" ? "needs auth" : s.status ?? "?";
|
|
115978
116145
|
}
|
|
@@ -115999,12 +116166,12 @@ function McpManager({
|
|
|
115999
116166
|
});
|
|
116000
116167
|
};
|
|
116001
116168
|
if (busy) {
|
|
116002
|
-
return /* @__PURE__ */ (0,
|
|
116169
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Box2, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(ThemedText, { dim: true, children: "Working\u2026" }) });
|
|
116003
116170
|
}
|
|
116004
116171
|
if (view.at === "trust") {
|
|
116005
116172
|
const server = servers.find((s) => s.name === view.name);
|
|
116006
116173
|
if (!server) return listView();
|
|
116007
|
-
return /* @__PURE__ */ (0,
|
|
116174
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
116008
116175
|
SelectList,
|
|
116009
116176
|
{
|
|
116010
116177
|
title: `"${server.name}" is configured by this workspace and runs with your permissions.
|
|
@@ -116028,7 +116195,7 @@ Only use servers you trust.`,
|
|
|
116028
116195
|
if (view.at === "removeConfirm") {
|
|
116029
116196
|
const server = servers.find((s) => s.name === view.name);
|
|
116030
116197
|
if (!server) return listView();
|
|
116031
|
-
return /* @__PURE__ */ (0,
|
|
116198
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
116032
116199
|
ConfirmDialog,
|
|
116033
116200
|
{
|
|
116034
116201
|
dialog: {
|
|
@@ -116057,35 +116224,35 @@ Only use servers you trust.`,
|
|
|
116057
116224
|
...fromPlugin ? [] : [{ label: "Remove", value: "removeConfirm" }],
|
|
116058
116225
|
{ label: "Back", value: "back" }
|
|
116059
116226
|
];
|
|
116060
|
-
return /* @__PURE__ */ (0,
|
|
116061
|
-
/* @__PURE__ */ (0,
|
|
116062
|
-
/* @__PURE__ */ (0,
|
|
116063
|
-
/* @__PURE__ */ (0,
|
|
116227
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(Box2, { flexDirection: "column", marginTop: 1, children: [
|
|
116228
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(ThemedText, { colorKey: "listSelection", bold: true, children: server.name }),
|
|
116229
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(Box2, { flexDirection: "column", marginTop: 1, children: [
|
|
116230
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(ThemedText, { children: [
|
|
116064
116231
|
"status: ",
|
|
116065
116232
|
statusLabel(server)
|
|
116066
116233
|
] }),
|
|
116067
|
-
server.transport ? /* @__PURE__ */ (0,
|
|
116234
|
+
server.transport ? /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(ThemedText, { children: [
|
|
116068
116235
|
"transport: ",
|
|
116069
116236
|
server.transport
|
|
116070
116237
|
] }) : null,
|
|
116071
|
-
server.scope ? /* @__PURE__ */ (0,
|
|
116238
|
+
server.scope ? /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(ThemedText, { children: [
|
|
116072
116239
|
"scope: ",
|
|
116073
116240
|
server.scope
|
|
116074
116241
|
] }) : null,
|
|
116075
|
-
server.tools_count != null && server.status === "ready" ? /* @__PURE__ */ (0,
|
|
116242
|
+
server.tools_count != null && server.status === "ready" ? /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(ThemedText, { children: [
|
|
116076
116243
|
"tools: ",
|
|
116077
116244
|
server.tools_count
|
|
116078
116245
|
] }) : null,
|
|
116079
|
-
/* @__PURE__ */ (0,
|
|
116246
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(ThemedText, { children: [
|
|
116080
116247
|
"approved: ",
|
|
116081
116248
|
server.approved ? "yes" : "no"
|
|
116082
116249
|
] }),
|
|
116083
|
-
server.error ? /* @__PURE__ */ (0,
|
|
116250
|
+
server.error ? /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(ThemedText, { colorKey: "error", children: [
|
|
116084
116251
|
"error: ",
|
|
116085
116252
|
server.error
|
|
116086
116253
|
] }) : null
|
|
116087
116254
|
] }),
|
|
116088
|
-
/* @__PURE__ */ (0,
|
|
116255
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
116089
116256
|
SelectList,
|
|
116090
116257
|
{
|
|
116091
116258
|
title: "Actions",
|
|
@@ -116103,7 +116270,7 @@ Only use servers you trust.`,
|
|
|
116103
116270
|
return listView();
|
|
116104
116271
|
function listView() {
|
|
116105
116272
|
const options = servers.map((s) => ({ label: s.name ?? "?", value: s.name ?? "", hint: serverHint(s) }));
|
|
116106
|
-
return /* @__PURE__ */ (0,
|
|
116273
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
116107
116274
|
SelectList,
|
|
116108
116275
|
{
|
|
116109
116276
|
title: "MCP servers \u2014 select one to manage",
|
|
@@ -116115,7 +116282,7 @@ Only use servers you trust.`,
|
|
|
116115
116282
|
}
|
|
116116
116283
|
|
|
116117
116284
|
// src/components/dialogs/ModalFrame.tsx
|
|
116118
|
-
var
|
|
116285
|
+
var import_jsx_runtime68 = __toESM(require_jsx_runtime(), 1);
|
|
116119
116286
|
var RAIL_BORDER2 = {
|
|
116120
116287
|
topLeft: "\u258C",
|
|
116121
116288
|
top: " ",
|
|
@@ -116128,7 +116295,7 @@ var RAIL_BORDER2 = {
|
|
|
116128
116295
|
};
|
|
116129
116296
|
function ModalFrame({ children }) {
|
|
116130
116297
|
const theme = useTheme();
|
|
116131
|
-
return /* @__PURE__ */ (0,
|
|
116298
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
116132
116299
|
Box2,
|
|
116133
116300
|
{
|
|
116134
116301
|
flexDirection: "column",
|
|
@@ -116145,7 +116312,7 @@ function ModalFrame({ children }) {
|
|
|
116145
116312
|
|
|
116146
116313
|
// src/components/dialogs/UsageMetricsPanel.tsx
|
|
116147
116314
|
var import_client_core38 = __toESM(require_dist(), 1);
|
|
116148
|
-
var
|
|
116315
|
+
var import_jsx_runtime69 = __toESM(require_jsx_runtime(), 1);
|
|
116149
116316
|
function compactInt(value) {
|
|
116150
116317
|
if (value >= 1e6) return `${(value / 1e6).toFixed(1)}m`;
|
|
116151
116318
|
if (value >= 1e3) return `${(value / 1e3).toFixed(1)}k`;
|
|
@@ -116215,9 +116382,9 @@ function MetricBar({
|
|
|
116215
116382
|
tone
|
|
116216
116383
|
}) {
|
|
116217
116384
|
const cells = barCells(value, max);
|
|
116218
|
-
return /* @__PURE__ */ (0,
|
|
116219
|
-
/* @__PURE__ */ (0,
|
|
116220
|
-
/* @__PURE__ */ (0,
|
|
116385
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(Box2, { flexShrink: 0, children: [
|
|
116386
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ThemedText, { colorKey: BAR_TONES3[tone % BAR_TONES3.length], children: "\u2588".repeat(cells.filled) }),
|
|
116387
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ThemedText, { dim: true, children: "\u2591".repeat(cells.empty) })
|
|
116221
116388
|
] });
|
|
116222
116389
|
}
|
|
116223
116390
|
function BarRow({
|
|
@@ -116227,25 +116394,25 @@ function BarRow({
|
|
|
116227
116394
|
tone,
|
|
116228
116395
|
children
|
|
116229
116396
|
}) {
|
|
116230
|
-
return /* @__PURE__ */ (0,
|
|
116231
|
-
/* @__PURE__ */ (0,
|
|
116232
|
-
/* @__PURE__ */ (0,
|
|
116233
|
-
/* @__PURE__ */ (0,
|
|
116397
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(Box2, { children: [
|
|
116398
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Box2, { width: 18, flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ThemedText, { wrap: "truncate", children: label }) }),
|
|
116399
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(MetricBar, { value, max, tone }),
|
|
116400
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Box2, { marginLeft: 1, flexShrink: 1, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ThemedText, { dim: true, children }) })
|
|
116234
116401
|
] });
|
|
116235
116402
|
}
|
|
116236
116403
|
function SummaryBlock({
|
|
116237
116404
|
title,
|
|
116238
116405
|
summary
|
|
116239
116406
|
}) {
|
|
116240
|
-
return /* @__PURE__ */ (0,
|
|
116241
|
-
/* @__PURE__ */ (0,
|
|
116242
|
-
/* @__PURE__ */ (0,
|
|
116407
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(Box2, { flexDirection: "column", marginTop: 1, children: [
|
|
116408
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ThemedText, { colorKey: "listSelection", bold: true, children: title }),
|
|
116409
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(ThemedText, { children: [
|
|
116243
116410
|
summary.events,
|
|
116244
116411
|
" turns \xB7 ",
|
|
116245
116412
|
summary.calls,
|
|
116246
116413
|
" model calls"
|
|
116247
116414
|
] }),
|
|
116248
|
-
/* @__PURE__ */ (0,
|
|
116415
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ThemedText, { dim: true, children: tokenLine(summary) })
|
|
116249
116416
|
] });
|
|
116250
116417
|
}
|
|
116251
116418
|
function BreakdownRows({
|
|
@@ -116255,11 +116422,11 @@ function BreakdownRows({
|
|
|
116255
116422
|
const rows = topRows(group);
|
|
116256
116423
|
if (rows.length === 0) return null;
|
|
116257
116424
|
const max = Math.max(...rows.map(([, item]) => (0, import_client_core38.meteredTokens)(item.tokens)), 1);
|
|
116258
|
-
return /* @__PURE__ */ (0,
|
|
116259
|
-
/* @__PURE__ */ (0,
|
|
116425
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(Box2, { flexDirection: "column", marginTop: 1, children: [
|
|
116426
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ThemedText, { bold: true, children: title }),
|
|
116260
116427
|
rows.map(([key, item], index) => {
|
|
116261
116428
|
const tokens = (0, import_client_core38.meteredTokens)(item.tokens);
|
|
116262
|
-
return /* @__PURE__ */ (0,
|
|
116429
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(BarRow, { label: key, value: tokens, max, tone: index, children: [
|
|
116263
116430
|
item.calls,
|
|
116264
116431
|
" calls \xB7 in ",
|
|
116265
116432
|
compactInt(item.tokens.input_tokens ?? 0),
|
|
@@ -116279,9 +116446,9 @@ function ContextRows({
|
|
|
116279
116446
|
const rows = topContextRows(group);
|
|
116280
116447
|
if (rows.length === 0) return null;
|
|
116281
116448
|
const max = Math.max(...rows.map(([, value]) => value), 1);
|
|
116282
|
-
return /* @__PURE__ */ (0,
|
|
116283
|
-
/* @__PURE__ */ (0,
|
|
116284
|
-
rows.map(([key, value], index) => /* @__PURE__ */ (0,
|
|
116449
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(Box2, { flexDirection: "column", marginTop: 1, children: [
|
|
116450
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ThemedText, { bold: true, children: title }),
|
|
116451
|
+
rows.map(([key, value], index) => /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(BarRow, { label: contextLabel(key), value, max, tone: index, children: [
|
|
116285
116452
|
compactInt(value),
|
|
116286
116453
|
" tokens"
|
|
116287
116454
|
] }, key))
|
|
@@ -116294,11 +116461,11 @@ function SavingsRows({
|
|
|
116294
116461
|
const rows = topSavingsRows(group);
|
|
116295
116462
|
if (rows.length === 0) return null;
|
|
116296
116463
|
const max = Math.max(...rows.map(([, item]) => totalSaved(item)), 1);
|
|
116297
|
-
return /* @__PURE__ */ (0,
|
|
116298
|
-
/* @__PURE__ */ (0,
|
|
116464
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(Box2, { flexDirection: "column", marginTop: 1, children: [
|
|
116465
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ThemedText, { bold: true, children: title }),
|
|
116299
116466
|
rows.map(([key, item], index) => {
|
|
116300
116467
|
const saved = totalSaved(item);
|
|
116301
|
-
return /* @__PURE__ */ (0,
|
|
116468
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(BarRow, { label: key, value: saved, max, tone: index, children: [
|
|
116302
116469
|
"saved ",
|
|
116303
116470
|
compactInt(saved),
|
|
116304
116471
|
" \xB7 in ",
|
|
@@ -116323,9 +116490,9 @@ function ActivityRows({
|
|
|
116323
116490
|
const rows = topActivityRows(group);
|
|
116324
116491
|
if (rows.length === 0) return null;
|
|
116325
116492
|
const max = Math.max(...rows.map(([, item]) => item.calls), 1);
|
|
116326
|
-
return /* @__PURE__ */ (0,
|
|
116327
|
-
/* @__PURE__ */ (0,
|
|
116328
|
-
rows.map(([key, item], index) => /* @__PURE__ */ (0,
|
|
116493
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(Box2, { flexDirection: "column", marginTop: 1, children: [
|
|
116494
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ThemedText, { bold: true, children: title }),
|
|
116495
|
+
rows.map(([key, item], index) => /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(BarRow, { label: key, value: item.calls, max, tone: index, children: [
|
|
116329
116496
|
item.calls,
|
|
116330
116497
|
" calls \xB7 ",
|
|
116331
116498
|
item.failures,
|
|
@@ -116339,14 +116506,14 @@ function EfficiencyRows({ summary }) {
|
|
|
116339
116506
|
const rows = topEfficiencyRows(summary.efficiency.byModel);
|
|
116340
116507
|
if (rows.length === 0) return null;
|
|
116341
116508
|
const max = Math.max(...rows.map(([, item]) => item.calls), 1);
|
|
116342
|
-
return /* @__PURE__ */ (0,
|
|
116343
|
-
/* @__PURE__ */ (0,
|
|
116344
|
-
/* @__PURE__ */ (0,
|
|
116509
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(Box2, { flexDirection: "column", marginTop: 1, children: [
|
|
116510
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ThemedText, { bold: true, children: "Model efficiency" }),
|
|
116511
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(ThemedText, { dim: true, children: [
|
|
116345
116512
|
"retry ",
|
|
116346
116513
|
Math.round(summary.efficiency.retryRatePercent),
|
|
116347
116514
|
"%"
|
|
116348
116515
|
] }),
|
|
116349
|
-
rows.map(([key, item], index) => /* @__PURE__ */ (0,
|
|
116516
|
+
rows.map(([key, item], index) => /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(BarRow, { label: key, value: item.calls, max, tone: index, children: [
|
|
116350
116517
|
item.calls,
|
|
116351
116518
|
" calls \xB7 ",
|
|
116352
116519
|
compactInt(item.outputTokensPerCall),
|
|
@@ -116364,11 +116531,11 @@ function RecentTurns({ rows }) {
|
|
|
116364
116531
|
...recent.map((turn) => turn.savedInputTokens + turn.savedOutputTokens + turn.savedToolResultTokens),
|
|
116365
116532
|
1
|
|
116366
116533
|
);
|
|
116367
|
-
return /* @__PURE__ */ (0,
|
|
116368
|
-
/* @__PURE__ */ (0,
|
|
116534
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(Box2, { flexDirection: "column", marginTop: 1, children: [
|
|
116535
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ThemedText, { bold: true, children: "Recent token-saving turns" }),
|
|
116369
116536
|
recent.map((turn, index) => {
|
|
116370
116537
|
const saved = turn.savedInputTokens + turn.savedOutputTokens + turn.savedToolResultTokens;
|
|
116371
|
-
return /* @__PURE__ */ (0,
|
|
116538
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
116372
116539
|
BarRow,
|
|
116373
116540
|
{
|
|
116374
116541
|
label: turn.tokenSavingLevel || "off",
|
|
@@ -116392,9 +116559,9 @@ function DailyRows({ summary }) {
|
|
|
116392
116559
|
const rows = summary.daily.slice(-5);
|
|
116393
116560
|
if (rows.length === 0) return null;
|
|
116394
116561
|
const max = Math.max(...rows.map((day) => (0, import_client_core38.meteredTokens)(day.tokens)), 1);
|
|
116395
|
-
return /* @__PURE__ */ (0,
|
|
116396
|
-
/* @__PURE__ */ (0,
|
|
116397
|
-
rows.map((day, index) => /* @__PURE__ */ (0,
|
|
116562
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(Box2, { flexDirection: "column", marginTop: 1, children: [
|
|
116563
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ThemedText, { bold: true, children: "Daily history" }),
|
|
116564
|
+
rows.map((day, index) => /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(BarRow, { label: day.date, value: (0, import_client_core38.meteredTokens)(day.tokens), max, tone: index, children: [
|
|
116398
116565
|
day.calls,
|
|
116399
116566
|
" calls \xB7 in ",
|
|
116400
116567
|
compactInt(day.tokens.input_tokens ?? 0),
|
|
@@ -116412,34 +116579,34 @@ function UsageMetricsPanel({
|
|
|
116412
116579
|
use_input_default((input, key) => {
|
|
116413
116580
|
if (key.escape || input === "q") onClose();
|
|
116414
116581
|
});
|
|
116415
|
-
return /* @__PURE__ */ (0,
|
|
116416
|
-
/* @__PURE__ */ (0,
|
|
116582
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(Box2, { flexDirection: "column", marginTop: 1, children: [
|
|
116583
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(ThemedText, { colorKey: "listSelection", bold: true, children: [
|
|
116417
116584
|
"Token usage \xB7 ",
|
|
116418
116585
|
workspace.period
|
|
116419
116586
|
] }),
|
|
116420
|
-
/* @__PURE__ */ (0,
|
|
116421
|
-
/* @__PURE__ */ (0,
|
|
116422
|
-
/* @__PURE__ */ (0,
|
|
116423
|
-
/* @__PURE__ */ (0,
|
|
116424
|
-
/* @__PURE__ */ (0,
|
|
116425
|
-
/* @__PURE__ */ (0,
|
|
116426
|
-
/* @__PURE__ */ (0,
|
|
116427
|
-
/* @__PURE__ */ (0,
|
|
116428
|
-
/* @__PURE__ */ (0,
|
|
116429
|
-
/* @__PURE__ */ (0,
|
|
116430
|
-
/* @__PURE__ */ (0,
|
|
116431
|
-
/* @__PURE__ */ (0,
|
|
116432
|
-
/* @__PURE__ */ (0,
|
|
116433
|
-
/* @__PURE__ */ (0,
|
|
116434
|
-
/* @__PURE__ */ (0,
|
|
116435
|
-
/* @__PURE__ */ (0,
|
|
116436
|
-
/* @__PURE__ */ (0,
|
|
116587
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(SummaryBlock, { title: "Workspace", summary: workspace }),
|
|
116588
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(SummaryBlock, { title: "All Orion tools", summary: global3 }),
|
|
116589
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(BreakdownRows, { title: "Workspace by model", group: workspace.byModel }),
|
|
116590
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(BreakdownRows, { title: "Workspace by token saving", group: workspace.byTokenSaving }),
|
|
116591
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(SavingsRows, { title: "Savings by feature", group: workspace.savings.byFeature }),
|
|
116592
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(SavingsRows, { title: "Savings by mode", group: workspace.savings.byTokenSavingLevel }),
|
|
116593
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ActivityRows, { title: "Tool activity", group: workspace.activity.byCategory }),
|
|
116594
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(EfficiencyRows, { summary: workspace }),
|
|
116595
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(BreakdownRows, { title: "Workspace by agent type", group: workspace.byAgentType }),
|
|
116596
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(BreakdownRows, { title: "Workspace by reasoning", group: workspace.byReasoningEffort }),
|
|
116597
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(BreakdownRows, { title: "Workspace by task type", group: workspace.byTaskType }),
|
|
116598
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ContextRows, { title: "Workspace context", group: workspace.context }),
|
|
116599
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(RecentTurns, { rows: workspace.recentTurns }),
|
|
116600
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(DailyRows, { summary: workspace }),
|
|
116601
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(BreakdownRows, { title: "Global by app", group: global3.byApp }),
|
|
116602
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(BreakdownRows, { title: "Global by workspace", group: global3.byWorkspace }),
|
|
116603
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ThemedText, { dim: true, children: "esc/q close" })
|
|
116437
116604
|
] });
|
|
116438
116605
|
}
|
|
116439
116606
|
|
|
116440
116607
|
// src/components/status/WorkingStatus.tsx
|
|
116441
116608
|
var import_react46 = __toESM(require_react(), 1);
|
|
116442
|
-
var
|
|
116609
|
+
var import_jsx_runtime70 = __toESM(require_jsx_runtime(), 1);
|
|
116443
116610
|
var FRAME_MS = 50;
|
|
116444
116611
|
function WorkingStatus({
|
|
116445
116612
|
store,
|
|
@@ -116476,10 +116643,10 @@ function WorkingStatus({
|
|
|
116476
116643
|
const last = cells.length - 1;
|
|
116477
116644
|
const hint = meterText(turnElapsed, tokens);
|
|
116478
116645
|
const orb = orbCell(turnElapsed);
|
|
116479
|
-
return /* @__PURE__ */ (0,
|
|
116480
|
-
/* @__PURE__ */ (0,
|
|
116481
|
-
/* @__PURE__ */ (0,
|
|
116482
|
-
hint ? /* @__PURE__ */ (0,
|
|
116646
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(Box2, { flexDirection: "row", marginTop: 1, marginLeft: 1, children: [
|
|
116647
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(Box2, { width: 2, flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(Text2, { color: orb.color, children: orb.ch }) }),
|
|
116648
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(Text2, { children: cells.map((c3, i2) => /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(Text2, { color: shimmerColor(n, i2, last), children: c3.ch }, i2)) }),
|
|
116649
|
+
hint ? /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(ThemedText, { dim: true, children: [
|
|
116483
116650
|
"\xA0(",
|
|
116484
116651
|
hint,
|
|
116485
116652
|
")"
|
|
@@ -116488,13 +116655,13 @@ function WorkingStatus({
|
|
|
116488
116655
|
}
|
|
116489
116656
|
|
|
116490
116657
|
// src/state/inputQueue.ts
|
|
116491
|
-
var
|
|
116658
|
+
var import_client_ui_core19 = __toESM(require_dist2(), 1);
|
|
116492
116659
|
function isEditable(entry) {
|
|
116493
|
-
return (0,
|
|
116660
|
+
return (0, import_client_ui_core19.isEditableSteer)(entry);
|
|
116494
116661
|
}
|
|
116495
116662
|
function popEditableQueue(app, draft) {
|
|
116496
116663
|
const queued = app.getState().queuedMessages;
|
|
116497
|
-
const merged = (0,
|
|
116664
|
+
const merged = (0, import_client_ui_core19.mergeIntoDraft)(
|
|
116498
116665
|
queued.filter(isEditable).map((entry) => entry.text),
|
|
116499
116666
|
draft
|
|
116500
116667
|
);
|
|
@@ -116503,38 +116670,38 @@ function popEditableQueue(app, draft) {
|
|
|
116503
116670
|
return merged;
|
|
116504
116671
|
}
|
|
116505
116672
|
function queueRows(queued) {
|
|
116506
|
-
const { shown, hidden } = (0,
|
|
116673
|
+
const { shown, hidden } = (0, import_client_ui_core19.capMachineRows)(queued);
|
|
116507
116674
|
const rows = shown.map((entry) => ({ kind: "entry", entry }));
|
|
116508
116675
|
if (hidden > 0) rows.push({ kind: "overflow", hidden });
|
|
116509
116676
|
return rows;
|
|
116510
116677
|
}
|
|
116511
116678
|
|
|
116512
116679
|
// src/components/input/QueuedMessages.tsx
|
|
116513
|
-
var
|
|
116680
|
+
var import_jsx_runtime71 = __toESM(require_jsx_runtime(), 1);
|
|
116514
116681
|
function QueuedMessages({ store }) {
|
|
116515
116682
|
const queued = useStoreSelector(store, (s) => s.queuedMessages);
|
|
116516
116683
|
if (queued.length === 0) return null;
|
|
116517
116684
|
const rows = queueRows(queued);
|
|
116518
116685
|
if (rows.length === 0) return null;
|
|
116519
|
-
return /* @__PURE__ */ (0,
|
|
116520
|
-
(row, i2) => row.kind === "overflow" ? /* @__PURE__ */ (0,
|
|
116521
|
-
/* @__PURE__ */ (0,
|
|
116522
|
-
row.entry.kind === "command" ? /* @__PURE__ */ (0,
|
|
116686
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Box2, { flexDirection: "column", children: rows.map(
|
|
116687
|
+
(row, i2) => row.kind === "overflow" ? /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(ThemedText, { colorKey: "dim", children: ` +${row.hidden} more queued` }, `overflow-${i2}`) : /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(Box2, { flexDirection: "column", children: [
|
|
116688
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(UserText, { text: queuedInputLabel(row.entry), pending: true }),
|
|
116689
|
+
row.entry.kind === "command" ? /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(ThemedText, { colorKey: "dim", children: " runs when this turn ends" }) : null
|
|
116523
116690
|
] }, i2)
|
|
116524
116691
|
) });
|
|
116525
116692
|
}
|
|
116526
116693
|
|
|
116527
116694
|
// src/components/input/PendingAttachments.tsx
|
|
116528
|
-
var
|
|
116695
|
+
var import_jsx_runtime72 = __toESM(require_jsx_runtime(), 1);
|
|
116529
116696
|
function PendingAttachments({ items: all }) {
|
|
116530
116697
|
const items = all.filter((a) => a.inlineId === void 0);
|
|
116531
116698
|
if (items.length === 0) return null;
|
|
116532
116699
|
let imageN = 0;
|
|
116533
|
-
return /* @__PURE__ */ (0,
|
|
116534
|
-
/* @__PURE__ */ (0,
|
|
116700
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(Box2, { flexDirection: "row", marginTop: 1, children: [
|
|
116701
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(ThemedText, { dim: true, children: "Attachments\xA0\xA0" }),
|
|
116535
116702
|
items.map((a, i2) => {
|
|
116536
116703
|
const label = a.kind === "video" ? a.name : a.mime.startsWith("image/") ? `Image ${++imageN}` : a.name;
|
|
116537
|
-
return /* @__PURE__ */ (0,
|
|
116704
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Box2, { flexDirection: "row", marginRight: 1, children: /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(ThemedText, { colorKey: "attachmentBadge", children: [
|
|
116538
116705
|
"[",
|
|
116539
116706
|
label,
|
|
116540
116707
|
"]"
|
|
@@ -116545,7 +116712,7 @@ function PendingAttachments({ items: all }) {
|
|
|
116545
116712
|
|
|
116546
116713
|
// src/components/layout/ReplFooter.tsx
|
|
116547
116714
|
var import_client_core39 = __toESM(require_dist(), 1);
|
|
116548
|
-
var
|
|
116715
|
+
var import_jsx_runtime73 = __toESM(require_jsx_runtime(), 1);
|
|
116549
116716
|
function ReplFooter({
|
|
116550
116717
|
appStore,
|
|
116551
116718
|
onSubmit,
|
|
@@ -116610,24 +116777,24 @@ function ReplFooter({
|
|
|
116610
116777
|
[appStore]
|
|
116611
116778
|
);
|
|
116612
116779
|
const [menuOpen, setMenuOpen] = import_react47.default.useState(false);
|
|
116613
|
-
return /* @__PURE__ */ (0,
|
|
116614
|
-
streaming && !parked && /* @__PURE__ */ (0,
|
|
116615
|
-
plan && /* @__PURE__ */ (0,
|
|
116616
|
-
pendingWorkPlan ? /* @__PURE__ */ (0,
|
|
116780
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(import_jsx_runtime73.Fragment, { children: [
|
|
116781
|
+
streaming && !parked && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(WorkingStatus, { store: appStore }),
|
|
116782
|
+
plan && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(PlanCard, { plan }),
|
|
116783
|
+
pendingWorkPlan ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
116617
116784
|
WorkPlanApprovalPrompt,
|
|
116618
116785
|
{
|
|
116619
116786
|
pending: pendingWorkPlan,
|
|
116620
116787
|
onRespond: onWorkPlanApproval ?? (() => void 0),
|
|
116621
116788
|
onCancel: onInterrupt
|
|
116622
116789
|
}
|
|
116623
|
-
) : pendingPlanApproval ? /* @__PURE__ */ (0,
|
|
116790
|
+
) : pendingPlanApproval ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
116624
116791
|
PlanApprovalPrompt,
|
|
116625
116792
|
{
|
|
116626
116793
|
pending: pendingPlanApproval,
|
|
116627
116794
|
onRespond: onPlanApproval ?? (() => void 0),
|
|
116628
116795
|
onCancel: onInterrupt
|
|
116629
116796
|
}
|
|
116630
|
-
) : pendingAskUser ? /* @__PURE__ */ (0,
|
|
116797
|
+
) : pendingAskUser ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
116631
116798
|
AskUserPrompt,
|
|
116632
116799
|
{
|
|
116633
116800
|
pending: pendingAskUser,
|
|
@@ -116635,14 +116802,14 @@ function ReplFooter({
|
|
|
116635
116802
|
onCancel: onInterrupt
|
|
116636
116803
|
},
|
|
116637
116804
|
pendingAskUser.requestId
|
|
116638
|
-
) : pendingPermissions.length > 0 ? /* @__PURE__ */ (0,
|
|
116805
|
+
) : pendingPermissions.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
116639
116806
|
PermissionPrompt,
|
|
116640
116807
|
{
|
|
116641
116808
|
pending: pendingPermissions[0],
|
|
116642
116809
|
count: pendingPermissions.length,
|
|
116643
116810
|
onRespond: onPermission ?? (() => void 0)
|
|
116644
116811
|
}
|
|
116645
|
-
) : activePanel ? /* @__PURE__ */ (0,
|
|
116812
|
+
) : activePanel ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(ModalFrame, { children: activePanel.kind === "hooks" ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(HooksBrowser, { hooks: activePanel.hooks, onClose: closePanel }) : activePanel.kind === "permissions" ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
116646
116813
|
PermissionRulesPanel,
|
|
116647
116814
|
{
|
|
116648
116815
|
rules: activePanel.rules,
|
|
@@ -116650,7 +116817,7 @@ function ReplFooter({
|
|
|
116650
116817
|
add: activePanel.add,
|
|
116651
116818
|
onClose: closePanel
|
|
116652
116819
|
}
|
|
116653
|
-
) : activePanel.kind === "plugin" ? /* @__PURE__ */ (0,
|
|
116820
|
+
) : activePanel.kind === "plugin" ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
116654
116821
|
PluginManager,
|
|
116655
116822
|
{
|
|
116656
116823
|
plugins: activePanel.plugins,
|
|
@@ -116659,7 +116826,7 @@ function ReplFooter({
|
|
|
116659
116826
|
install: activePanel.install,
|
|
116660
116827
|
onClose: closePanel
|
|
116661
116828
|
}
|
|
116662
|
-
) : activePanel.kind === "rewind" ? /* @__PURE__ */ (0,
|
|
116829
|
+
) : activePanel.kind === "rewind" ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(RewindPicker, { turns: activePanel.turns, apply: activePanel.apply, onClose: closePanel }) : activePanel.kind === "mcp" ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(McpManager, { servers: activePanel.servers, act: activePanel.act, onClose: closePanel }) : activePanel.kind === "usage" ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(UsageMetricsPanel, { workspace: activePanel.workspace, global: activePanel.global, onClose: closePanel }) : activePanel.kind === "endpoints" ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(EndpointsPanel, { deps: activePanel.deps, onClose: closePanel }) : null }) : activeDialog ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(ModalFrame, { children: activeDialog.kind === "model" ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(ModelPicker, { dialog: activeDialog }) : activeDialog.kind === "resume" ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(ResumePicker, { dialog: activeDialog }) : activeDialog.kind === "resume-mode" ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(ResumeModeDialog, { dialog: activeDialog }) : activeDialog.kind === "select" ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
116663
116830
|
SelectList,
|
|
116664
116831
|
{
|
|
116665
116832
|
title: activeDialog.title,
|
|
@@ -116667,12 +116834,12 @@ function ReplFooter({
|
|
|
116667
116834
|
onSelect: activeDialog.onSelect,
|
|
116668
116835
|
filterable: true
|
|
116669
116836
|
}
|
|
116670
|
-
) : /* @__PURE__ */ (0,
|
|
116837
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(ConfirmDialog, { dialog: activeDialog }) }) : pendingFeedback ? (
|
|
116671
116838
|
// The LOWEST ladder entrant: every parked boundary, panel, and dialog outranks
|
|
116672
116839
|
// the feedback card, so it only ever appears at turn-complete idle. It takes the
|
|
116673
116840
|
// input slot (never rendered beside PromptInput — stacked useInput handlers would
|
|
116674
116841
|
// leak digits into the composer) and any stray keystroke gives the slot back.
|
|
116675
|
-
/* @__PURE__ */ (0,
|
|
116842
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
116676
116843
|
FeedbackPrompt,
|
|
116677
116844
|
{
|
|
116678
116845
|
pending: pendingFeedback,
|
|
@@ -116681,14 +116848,14 @@ function ReplFooter({
|
|
|
116681
116848
|
},
|
|
116682
116849
|
pendingFeedback.requestId
|
|
116683
116850
|
)
|
|
116684
|
-
) : /* @__PURE__ */ (0,
|
|
116685
|
-
/* @__PURE__ */ (0,
|
|
116686
|
-
/* @__PURE__ */ (0,
|
|
116687
|
-
status === "error" && statusText ? /* @__PURE__ */ (0,
|
|
116851
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(import_jsx_runtime73.Fragment, { children: [
|
|
116852
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(QueuedMessages, { store: appStore }),
|
|
116853
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(PendingAttachments, { items: pendingAttachments }),
|
|
116854
|
+
status === "error" && statusText ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Box2, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(ThemedText, { colorKey: "error", bold: true, children: [
|
|
116688
116855
|
"Error: ",
|
|
116689
116856
|
statusText
|
|
116690
116857
|
] }) }) : null,
|
|
116691
|
-
/* @__PURE__ */ (0,
|
|
116858
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
116692
116859
|
PromptInput,
|
|
116693
116860
|
{
|
|
116694
116861
|
onSubmit,
|
|
@@ -116718,15 +116885,15 @@ function ReplFooter({
|
|
|
116718
116885
|
}
|
|
116719
116886
|
)
|
|
116720
116887
|
] }),
|
|
116721
|
-
menuOpen ? null : /* @__PURE__ */ (0,
|
|
116722
|
-
workRun ? /* @__PURE__ */ (0,
|
|
116723
|
-
/* @__PURE__ */ (0,
|
|
116888
|
+
menuOpen ? null : /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(StatusBar, { store: appStore, indexBadge }),
|
|
116889
|
+
workRun ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(WorkRunGraph, { view: workRun.view }) : null,
|
|
116890
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(SubAgentList, { agents: subAgents, awaiting: subagentsAwaiting > 0 })
|
|
116724
116891
|
] });
|
|
116725
116892
|
}
|
|
116726
116893
|
|
|
116727
116894
|
// src/components/layout/FullscreenLayout.tsx
|
|
116728
116895
|
var import_react48 = __toESM(require_react(), 1);
|
|
116729
|
-
var
|
|
116896
|
+
var import_jsx_runtime74 = __toESM(require_jsx_runtime(), 1);
|
|
116730
116897
|
function FullscreenLayout({
|
|
116731
116898
|
appStore,
|
|
116732
116899
|
transcriptStore,
|
|
@@ -116754,9 +116921,9 @@ function FullscreenLayout({
|
|
|
116754
116921
|
if (delta <= -1e6) sb.scrollToBottom();
|
|
116755
116922
|
else sb.scrollBy(-delta);
|
|
116756
116923
|
};
|
|
116757
|
-
return /* @__PURE__ */ (0,
|
|
116758
|
-
/* @__PURE__ */ (0,
|
|
116759
|
-
/* @__PURE__ */ (0,
|
|
116924
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(Box2, { flexDirection: "column", width: columns, height: rows, children: [
|
|
116925
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(ScrollBox2, { ref: scrollRef, flexGrow: 1, flexShrink: 1, flexDirection: "column", stickyScroll: true, children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Transcript, { appStore, transcriptStore }) }),
|
|
116926
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Box2, { flexShrink: 0, flexDirection: "column", children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
116760
116927
|
ReplFooter,
|
|
116761
116928
|
{
|
|
116762
116929
|
appStore,
|
|
@@ -116784,9 +116951,9 @@ function FullscreenLayout({
|
|
|
116784
116951
|
// src/components/dialogs/AgentsDashboard.tsx
|
|
116785
116952
|
var import_react49 = __toESM(require_react(), 1);
|
|
116786
116953
|
var import_client_core40 = __toESM(require_dist(), 1);
|
|
116787
|
-
var
|
|
116954
|
+
var import_client_ui_core20 = __toESM(require_dist2(), 1);
|
|
116788
116955
|
var import_strip_ansi4 = __toESM(require_strip_ansi(), 1);
|
|
116789
|
-
var
|
|
116956
|
+
var import_jsx_runtime75 = __toESM(require_jsx_runtime(), 1);
|
|
116790
116957
|
var POLL_MS = 2500;
|
|
116791
116958
|
var FIELDS = ["repo_url", "task", "ticket_ref", "target_branch"];
|
|
116792
116959
|
var FIELD_LABEL = {
|
|
@@ -117292,15 +117459,15 @@ function AgentsDashboard({
|
|
|
117292
117459
|
return runAction(() => panel.cancel(here.id));
|
|
117293
117460
|
}
|
|
117294
117461
|
});
|
|
117295
|
-
return /* @__PURE__ */ (0,
|
|
117296
|
-
/* @__PURE__ */ (0,
|
|
117297
|
-
/* @__PURE__ */ (0,
|
|
117298
|
-
/* @__PURE__ */ (0,
|
|
117299
|
-
busy ? /* @__PURE__ */ (0,
|
|
117462
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(Box2, { flexDirection: "column", height: rows, paddingX: 1, children: [
|
|
117463
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(Box2, { flexShrink: 0, marginBottom: 1, children: [
|
|
117464
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { colorKey: "welcomeBanner", bold: true, children: "Cloud Agents" }),
|
|
117465
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { dim: true, children: ` ${jobs.length} ${jobs.length === 1 ? "agent" : "agents"}` }),
|
|
117466
|
+
busy ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { colorKey: "spinner", children: " working\u2026" }) : null
|
|
117300
117467
|
] }),
|
|
117301
|
-
/* @__PURE__ */ (0,
|
|
117302
|
-
error ? /* @__PURE__ */ (0,
|
|
117303
|
-
screen.kind === "launch" ? /* @__PURE__ */ (0,
|
|
117468
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(Box2, { flexGrow: 1, flexDirection: "column", children: [
|
|
117469
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Box2, { marginBottom: 1, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { colorKey: "error", children: error }) }) : null,
|
|
117470
|
+
screen.kind === "launch" ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(LaunchFormView, { form, field: field2 }) : screen.kind === "detail" ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
117304
117471
|
JobDetailView,
|
|
117305
117472
|
{
|
|
117306
117473
|
job: detailJob,
|
|
@@ -117323,7 +117490,7 @@ function AgentsDashboard({
|
|
|
117323
117490
|
complete: detailJob?.status === "complete"
|
|
117324
117491
|
}
|
|
117325
117492
|
}
|
|
117326
|
-
) : screen.kind === "connections" ? /* @__PURE__ */ (0,
|
|
117493
|
+
) : screen.kind === "connections" ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
117327
117494
|
ConnectionsView,
|
|
117328
117495
|
{
|
|
117329
117496
|
token: {
|
|
@@ -117335,9 +117502,9 @@ function AgentsDashboard({
|
|
|
117335
117502
|
},
|
|
117336
117503
|
jira: { status: jiraStatus, busy: jiraBusy, input: jiraInput, note: jiraNote }
|
|
117337
117504
|
}
|
|
117338
|
-
) : /* @__PURE__ */ (0,
|
|
117505
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(JobListView, { jobs, cursor: safeCursor, rows })
|
|
117339
117506
|
] }),
|
|
117340
|
-
/* @__PURE__ */ (0,
|
|
117507
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Box2, { flexShrink: 0, marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { dim: true, children: footerHint(screen, screen.kind === "detail" ? detailJob : jobs[safeCursor] ?? null, messaging, {
|
|
117341
117508
|
input: tokenInput || jiraInput !== null,
|
|
117342
117509
|
token: tokenStatus,
|
|
117343
117510
|
jira: jiraStatus
|
|
@@ -117377,9 +117544,9 @@ function ConnectionsView({
|
|
|
117377
117544
|
token,
|
|
117378
117545
|
jira
|
|
117379
117546
|
}) {
|
|
117380
|
-
return /* @__PURE__ */ (0,
|
|
117381
|
-
/* @__PURE__ */ (0,
|
|
117382
|
-
/* @__PURE__ */ (0,
|
|
117547
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(Box2, { flexDirection: "column", children: [
|
|
117548
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { dim: true, children: "Connect the accounts your agents use. Both are optional \u2014 public repos need neither." }),
|
|
117549
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Box2, { marginTop: 1, children: token.status && token.status.storage_available ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
117383
117550
|
TokenLine,
|
|
117384
117551
|
{
|
|
117385
117552
|
status: token.status,
|
|
@@ -117388,8 +117555,8 @@ function ConnectionsView({
|
|
|
117388
117555
|
draft: token.draft,
|
|
117389
117556
|
note: token.note
|
|
117390
117557
|
}
|
|
117391
|
-
) : /* @__PURE__ */ (0,
|
|
117392
|
-
/* @__PURE__ */ (0,
|
|
117558
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { dim: true, children: "GitHub connections are unavailable on this server." }) }),
|
|
117559
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Box2, { marginTop: 1, children: jira.status && jira.status.storage_available ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(JiraLine, { status: jira.status, busy: jira.busy, input: jira.input, note: jira.note }) : /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { dim: true, children: "Jira connections are unavailable on this server." }) })
|
|
117393
117560
|
] });
|
|
117394
117561
|
}
|
|
117395
117562
|
function TokenLine({
|
|
@@ -117400,23 +117567,23 @@ function TokenLine({
|
|
|
117400
117567
|
note
|
|
117401
117568
|
}) {
|
|
117402
117569
|
if (input) {
|
|
117403
|
-
return /* @__PURE__ */ (0,
|
|
117404
|
-
/* @__PURE__ */ (0,
|
|
117570
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(ThemedText, { children: [
|
|
117571
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { dim: true, children: "GitHub token: " }),
|
|
117405
117572
|
"\u2022".repeat(draft.length),
|
|
117406
|
-
/* @__PURE__ */ (0,
|
|
117407
|
-
/* @__PURE__ */ (0,
|
|
117573
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { colorKey: "chatInputBox", children: "\u258F" }),
|
|
117574
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { dim: true, children: " enter save \xB7 esc cancel" })
|
|
117408
117575
|
] });
|
|
117409
117576
|
}
|
|
117410
117577
|
if (status.configured) {
|
|
117411
|
-
return /* @__PURE__ */ (0,
|
|
117412
|
-
/* @__PURE__ */ (0,
|
|
117413
|
-
/* @__PURE__ */ (0,
|
|
117414
|
-
note ? /* @__PURE__ */ (0,
|
|
117578
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(ThemedText, { children: [
|
|
117579
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { colorKey: "success", children: "\u2713 GitHub connected" }),
|
|
117580
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { dim: true, children: ` ${status.hint ?? "saved"} \xB7 x to remove` }),
|
|
117581
|
+
note ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { colorKey: "info", children: ` ${note}` }) : null
|
|
117415
117582
|
] });
|
|
117416
117583
|
}
|
|
117417
|
-
return /* @__PURE__ */ (0,
|
|
117418
|
-
/* @__PURE__ */ (0,
|
|
117419
|
-
note ? /* @__PURE__ */ (0,
|
|
117584
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(ThemedText, { children: [
|
|
117585
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { colorKey: "warning", children: "GitHub not connected" }),
|
|
117586
|
+
note ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { dim: true, children: ` ${note}` }) : /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { dim: true, children: busy ? " working\u2026" : status.oauth_available ? " \xB7 o to connect with GitHub (recommended) \xB7 g for a token" : " \xB7 g to connect for private repos" })
|
|
117420
117587
|
] });
|
|
117421
117588
|
}
|
|
117422
117589
|
function JiraLine({
|
|
@@ -117428,23 +117595,23 @@ function JiraLine({
|
|
|
117428
117595
|
if (input) {
|
|
117429
117596
|
const label = input.step === "url" ? "Jira URL (https://\u2026): " : input.step === "email" ? "Jira email (empty = Server PAT): " : "Jira API token: ";
|
|
117430
117597
|
const shown = input.step === "token" ? "\u2022".repeat(input.draft.length) : input.draft;
|
|
117431
|
-
return /* @__PURE__ */ (0,
|
|
117432
|
-
/* @__PURE__ */ (0,
|
|
117598
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(ThemedText, { children: [
|
|
117599
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { dim: true, children: label }),
|
|
117433
117600
|
shown,
|
|
117434
|
-
/* @__PURE__ */ (0,
|
|
117435
|
-
/* @__PURE__ */ (0,
|
|
117601
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { colorKey: "chatInputBox", children: "\u258F" }),
|
|
117602
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { dim: true, children: " enter next \xB7 esc cancel" })
|
|
117436
117603
|
] });
|
|
117437
117604
|
}
|
|
117438
117605
|
if (status.configured) {
|
|
117439
|
-
return /* @__PURE__ */ (0,
|
|
117440
|
-
/* @__PURE__ */ (0,
|
|
117441
|
-
/* @__PURE__ */ (0,
|
|
117442
|
-
note ? /* @__PURE__ */ (0,
|
|
117606
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(ThemedText, { children: [
|
|
117607
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { colorKey: "success", children: "\u2713 Jira connected" }),
|
|
117608
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { dim: true, children: ` ${status.base_url ?? ""} ${status.hint ?? ""} \xB7 t replace \xB7 T remove` }),
|
|
117609
|
+
note ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { colorKey: "info", children: ` ${note}` }) : null
|
|
117443
117610
|
] });
|
|
117444
117611
|
}
|
|
117445
|
-
return /* @__PURE__ */ (0,
|
|
117446
|
-
/* @__PURE__ */ (0,
|
|
117447
|
-
note ? /* @__PURE__ */ (0,
|
|
117612
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(ThemedText, { children: [
|
|
117613
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { dim: true, children: "Jira not connected" }),
|
|
117614
|
+
note ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { dim: true, children: ` ${note}` }) : /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { dim: true, children: busy ? " working\u2026" : " \xB7 t to connect (launch agents from tickets)" })
|
|
117448
117615
|
] });
|
|
117449
117616
|
}
|
|
117450
117617
|
function JobListView({
|
|
@@ -117453,14 +117620,14 @@ function JobListView({
|
|
|
117453
117620
|
rows
|
|
117454
117621
|
}) {
|
|
117455
117622
|
if (jobs.length === 0) {
|
|
117456
|
-
return /* @__PURE__ */ (0,
|
|
117623
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { dim: true, children: "No cloud agents yet. Press n to launch one." });
|
|
117457
117624
|
}
|
|
117458
117625
|
const maxRows = Math.max(3, rows - 6);
|
|
117459
117626
|
const windowed = jobs.length > maxRows;
|
|
117460
117627
|
const start2 = windowed ? Math.max(0, Math.min(cursor - Math.floor(maxRows / 2), jobs.length - maxRows)) : 0;
|
|
117461
117628
|
const end = windowed ? Math.min(start2 + maxRows, jobs.length) : jobs.length;
|
|
117462
|
-
return /* @__PURE__ */ (0,
|
|
117463
|
-
windowed && start2 > 0 ? /* @__PURE__ */ (0,
|
|
117629
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(Box2, { flexDirection: "column", children: [
|
|
117630
|
+
windowed && start2 > 0 ? /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(ThemedText, { dim: true, children: [
|
|
117464
117631
|
"\u2191 ",
|
|
117465
117632
|
start2,
|
|
117466
117633
|
" more"
|
|
@@ -117470,14 +117637,14 @@ function JobListView({
|
|
|
117470
117637
|
const selected = i2 === cursor;
|
|
117471
117638
|
const label = jobTitle(job);
|
|
117472
117639
|
const repo = job.repo_url ? ` ${job.repo_url}` : "";
|
|
117473
|
-
return /* @__PURE__ */ (0,
|
|
117474
|
-
selected ? /* @__PURE__ */ (0,
|
|
117475
|
-
/* @__PURE__ */ (0,
|
|
117476
|
-
/* @__PURE__ */ (0,
|
|
117477
|
-
repo ? /* @__PURE__ */ (0,
|
|
117640
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(Box2, { flexDirection: "row", children: [
|
|
117641
|
+
selected ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(GradientText, { text: "\u276F " }) : /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { children: " " }),
|
|
117642
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Box2, { width: 18, flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { colorKey: statusColorKey(job.status), wrap: "truncate", children: job.status }) }),
|
|
117643
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { wrap: "truncate-end", children: label }),
|
|
117644
|
+
repo ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { dim: true, wrap: "truncate-end", children: repo }) : null
|
|
117478
117645
|
] }, job.id);
|
|
117479
117646
|
}),
|
|
117480
|
-
windowed && end < jobs.length ? /* @__PURE__ */ (0,
|
|
117647
|
+
windowed && end < jobs.length ? /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(ThemedText, { dim: true, children: [
|
|
117481
117648
|
"\u2193 ",
|
|
117482
117649
|
jobs.length - end,
|
|
117483
117650
|
" more"
|
|
@@ -117485,12 +117652,12 @@ function JobListView({
|
|
|
117485
117652
|
] });
|
|
117486
117653
|
}
|
|
117487
117654
|
function ChangedFileRow({ file }) {
|
|
117488
|
-
return /* @__PURE__ */ (0,
|
|
117489
|
-
/* @__PURE__ */ (0,
|
|
117655
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(ThemedText, { wrap: "truncate-end", children: [
|
|
117656
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { colorKey: fileStatusColor(file.status), bold: true, children: (file.status[0] ?? "?").toUpperCase() }),
|
|
117490
117657
|
` ${file.path} `,
|
|
117491
|
-
file.additions > 0 ? /* @__PURE__ */ (0,
|
|
117658
|
+
file.additions > 0 ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { colorKey: "success", children: `+${file.additions}` }) : null,
|
|
117492
117659
|
file.additions > 0 && file.deletions > 0 ? " " : "",
|
|
117493
|
-
file.deletions > 0 ? /* @__PURE__ */ (0,
|
|
117660
|
+
file.deletions > 0 ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { colorKey: "error", children: `\u2212${file.deletions}` }) : null
|
|
117494
117661
|
] });
|
|
117495
117662
|
}
|
|
117496
117663
|
function JobDetailView({
|
|
@@ -117503,103 +117670,103 @@ function JobDetailView({
|
|
|
117503
117670
|
frames,
|
|
117504
117671
|
composer
|
|
117505
117672
|
}) {
|
|
117506
|
-
if (!job) return /* @__PURE__ */ (0,
|
|
117673
|
+
if (!job) return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { dim: true, children: "Job not found." });
|
|
117507
117674
|
const terminal = (0, import_client_core40.isTerminal)(job.status);
|
|
117508
|
-
return /* @__PURE__ */ (0,
|
|
117509
|
-
/* @__PURE__ */ (0,
|
|
117510
|
-
/* @__PURE__ */ (0,
|
|
117511
|
-
/* @__PURE__ */ (0,
|
|
117675
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(Box2, { flexDirection: "column", children: [
|
|
117676
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { colorKey: "listSelection", bold: true, children: jobTitle(job) }),
|
|
117677
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(Box2, { flexDirection: "column", marginTop: 1, children: [
|
|
117678
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(ThemedText, { children: [
|
|
117512
117679
|
"status:",
|
|
117513
117680
|
" ",
|
|
117514
|
-
/* @__PURE__ */ (0,
|
|
117681
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { colorKey: statusColorKey(job.status), bold: true, children: job.status }),
|
|
117515
117682
|
` \xB7 iteration ${job.iteration}`
|
|
117516
117683
|
] }),
|
|
117517
|
-
job.repo_url ? /* @__PURE__ */ (0,
|
|
117684
|
+
job.repo_url ? /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(ThemedText, { dim: true, children: [
|
|
117518
117685
|
"repo: ",
|
|
117519
117686
|
job.repo_url
|
|
117520
117687
|
] }) : null,
|
|
117521
|
-
job.target_branch ? /* @__PURE__ */ (0,
|
|
117688
|
+
job.target_branch ? /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(ThemedText, { dim: true, children: [
|
|
117522
117689
|
"target: ",
|
|
117523
117690
|
job.target_branch
|
|
117524
117691
|
] }) : null,
|
|
117525
|
-
job.branch_name ? /* @__PURE__ */ (0,
|
|
117692
|
+
job.branch_name ? /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(ThemedText, { dim: true, children: [
|
|
117526
117693
|
"branch: ",
|
|
117527
117694
|
job.branch_name
|
|
117528
117695
|
] }) : null,
|
|
117529
|
-
job.pr_url ? /* @__PURE__ */ (0,
|
|
117696
|
+
job.pr_url ? /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(ThemedText, { colorKey: "info", underline: true, children: [
|
|
117530
117697
|
"PR: ",
|
|
117531
117698
|
job.pr_url
|
|
117532
117699
|
] }) : null,
|
|
117533
|
-
job.error ? /* @__PURE__ */ (0,
|
|
117700
|
+
job.error ? /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(ThemedText, { colorKey: "error", children: [
|
|
117534
117701
|
"error: ",
|
|
117535
117702
|
job.error
|
|
117536
117703
|
] }) : null
|
|
117537
117704
|
] }),
|
|
117538
|
-
job.report ? /* @__PURE__ */ (0,
|
|
117539
|
-
/* @__PURE__ */ (0,
|
|
117540
|
-
/* @__PURE__ */ (0,
|
|
117705
|
+
job.report ? /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(Box2, { flexShrink: 0, flexDirection: "column", marginTop: 1, children: [
|
|
117706
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { bold: true, children: "Summary" }),
|
|
117707
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { children: job.report })
|
|
117541
117708
|
] }) : null,
|
|
117542
|
-
job.branch_name ? /* @__PURE__ */ (0,
|
|
117543
|
-
/* @__PURE__ */ (0,
|
|
117709
|
+
job.branch_name ? /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(Box2, { flexDirection: "column", marginTop: 1, children: [
|
|
117710
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(ThemedText, { bold: true, children: [
|
|
117544
117711
|
"Changed files",
|
|
117545
117712
|
diff3 ? ` (${diff3.total})` : ""
|
|
117546
117713
|
] }),
|
|
117547
|
-
!diff3 ? /* @__PURE__ */ (0,
|
|
117548
|
-
diff3.files.map((f) => /* @__PURE__ */ (0,
|
|
117549
|
-
diff3.truncated ? /* @__PURE__ */ (0,
|
|
117714
|
+
!diff3 ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { dim: true, children: "loading\u2026" }) : diff3.files.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { dim: true, children: "No file changes." }) : /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [
|
|
117715
|
+
diff3.files.map((f) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ChangedFileRow, { file: f }, `${f.old_path ?? ""}:${f.path}`)),
|
|
117716
|
+
diff3.truncated ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { dim: true, children: "\u2026more files changed than shown." }) : null
|
|
117550
117717
|
] })
|
|
117551
117718
|
] }) : null,
|
|
117552
|
-
!terminal ? /* @__PURE__ */ (0,
|
|
117553
|
-
/* @__PURE__ */ (0,
|
|
117554
|
-
live.length === 0 ? /* @__PURE__ */ (0,
|
|
117719
|
+
!terminal ? /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(Box2, { flexDirection: "column", marginTop: 1, children: [
|
|
117720
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { bold: true, children: "Live" }),
|
|
117721
|
+
live.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { dim: true, children: "Waiting for the agent\u2026" }) : (
|
|
117555
117722
|
// The detail view lives inside a fixed-height column (`height={rows}`) — when the
|
|
117556
117723
|
// terminal tail is showing, the thread cedes rows to it so yoga never has to
|
|
117557
117724
|
// shrink the section headers away on a small terminal.
|
|
117558
117725
|
live.slice(term ? -4 : -8).map(
|
|
117559
|
-
(it) => it.kind === "text" ? /* @__PURE__ */ (0,
|
|
117726
|
+
(it) => it.kind === "text" ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { wrap: "truncate-end", children: it.text.length > 500 ? `\u2026${it.text.slice(-500)}` : it.text }, it.id) : /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { dim: true, children: `\u2192 ${(0, import_client_ui_core20.toolDisplayName)(it.name)}` }, it.id)
|
|
117560
117727
|
)
|
|
117561
117728
|
),
|
|
117562
|
-
frames > 0 ? /* @__PURE__ */ (0,
|
|
117563
|
-
term ? /* @__PURE__ */ (0,
|
|
117564
|
-
/* @__PURE__ */ (0,
|
|
117565
|
-
term.split("\n").slice(-4).map((line, i2) => /* @__PURE__ */ (0,
|
|
117729
|
+
frames > 0 ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { dim: true, children: `\u{1F5A5} screen streaming \xB7 ${frames} frame${frames === 1 ? "" : "s"} (view in the desktop app)` }) : null,
|
|
117730
|
+
term ? /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [
|
|
117731
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { bold: true, children: "Terminal" }),
|
|
117732
|
+
term.split("\n").slice(-4).map((line, i2) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { dim: true, wrap: "truncate-end", children: (line.split("\r").pop() ?? "").replace(
|
|
117566
117733
|
// eslint-disable-next-line no-control-regex
|
|
117567
117734
|
/[\u0000-\u0008\u000b-\u001f\u007f]/g,
|
|
117568
117735
|
""
|
|
117569
117736
|
) || " " }, i2))
|
|
117570
117737
|
] }) : null
|
|
117571
117738
|
] }) : null,
|
|
117572
|
-
/* @__PURE__ */ (0,
|
|
117573
|
-
/* @__PURE__ */ (0,
|
|
117574
|
-
events.length === 0 ? /* @__PURE__ */ (0,
|
|
117575
|
-
!terminal ? /* @__PURE__ */ (0,
|
|
117739
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(Box2, { flexDirection: "column", marginTop: 1, children: [
|
|
117740
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { bold: true, children: "Timeline" }),
|
|
117741
|
+
events.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { dim: true, children: terminal ? "No events." : "Waiting for events\u2026" }) : events.map((e) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { wrap: "truncate-end", children: `\u2022 ${formatEvent(e)}` }, e.id)),
|
|
117742
|
+
!terminal ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { dim: true, children: pollError ? `polling\u2026 (${pollError})` : "polling\u2026" }) : null
|
|
117576
117743
|
] }),
|
|
117577
|
-
composer.live ? /* @__PURE__ */ (0,
|
|
117578
|
-
/* @__PURE__ */ (0,
|
|
117579
|
-
composer.messaging ? /* @__PURE__ */ (0,
|
|
117744
|
+
composer.live ? /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(Box2, { flexDirection: "column", marginTop: 1, children: [
|
|
117745
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { bold: true, children: composer.complete ? "Follow up on this run" : composer.parked ? "Resume the agent" : "Message the agent" }),
|
|
117746
|
+
composer.messaging ? /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(ThemedText, { children: [
|
|
117580
117747
|
"\u276F ",
|
|
117581
117748
|
composer.text,
|
|
117582
|
-
/* @__PURE__ */ (0,
|
|
117583
|
-
] }) : /* @__PURE__ */ (0,
|
|
117584
|
-
composer.note ? /* @__PURE__ */ (0,
|
|
117749
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { colorKey: "chatInputBox", children: "\u258F" })
|
|
117750
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { dim: true, children: composer.complete ? "press m to start a follow-up run (same branch/PR while it's open)" : composer.parked ? "press m to resume with an optional direction" : "press m to steer the agent without stopping it" }),
|
|
117751
|
+
composer.note ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { colorKey: "info", children: composer.note }) : null
|
|
117585
117752
|
] }) : null
|
|
117586
117753
|
] });
|
|
117587
117754
|
}
|
|
117588
117755
|
function LaunchFormView({ form, field: field2 }) {
|
|
117589
|
-
return /* @__PURE__ */ (0,
|
|
117590
|
-
/* @__PURE__ */ (0,
|
|
117591
|
-
/* @__PURE__ */ (0,
|
|
117756
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(Box2, { flexDirection: "column", children: [
|
|
117757
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { colorKey: "listSelection", bold: true, children: "Launch a cloud agent" }),
|
|
117758
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Box2, { flexDirection: "column", marginTop: 1, children: FIELDS.map((name2, i2) => {
|
|
117592
117759
|
const focused = i2 === field2;
|
|
117593
117760
|
const value = form[name2];
|
|
117594
|
-
return /* @__PURE__ */ (0,
|
|
117595
|
-
focused ? /* @__PURE__ */ (0,
|
|
117596
|
-
/* @__PURE__ */ (0,
|
|
117597
|
-
value ? /* @__PURE__ */ (0,
|
|
117761
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(Box2, { flexDirection: "row", children: [
|
|
117762
|
+
focused ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(GradientText, { text: "\u276F " }) : /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { children: " " }),
|
|
117763
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Box2, { width: 26, flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { colorKey: focused ? "accent" : void 0, children: FIELD_LABEL[name2] }) }),
|
|
117764
|
+
value ? /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(ThemedText, { children: [
|
|
117598
117765
|
value,
|
|
117599
|
-
focused ? /* @__PURE__ */ (0,
|
|
117600
|
-
] }) : /* @__PURE__ */ (0,
|
|
117601
|
-
focused ? /* @__PURE__ */ (0,
|
|
117602
|
-
/* @__PURE__ */ (0,
|
|
117766
|
+
focused ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { colorKey: "chatInputBox", children: "\u258F" }) : null
|
|
117767
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [
|
|
117768
|
+
focused ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ThemedText, { colorKey: "chatInputBox", children: "\u258F" }) : null,
|
|
117769
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(ThemedText, { dim: true, children: [
|
|
117603
117770
|
" ",
|
|
117604
117771
|
focused ? "type a value" : "\u2014"
|
|
117605
117772
|
] })
|
|
@@ -117657,20 +117824,20 @@ function TerminalTitle({ appStore }) {
|
|
|
117657
117824
|
}
|
|
117658
117825
|
|
|
117659
117826
|
// src/components/layout/ReplLayout.tsx
|
|
117660
|
-
var
|
|
117827
|
+
var import_jsx_runtime76 = __toESM(require_jsx_runtime(), 1);
|
|
117661
117828
|
function ReplLayout(props) {
|
|
117662
117829
|
const panel = useStoreSelector(props.appStore, (s) => s.activePanel);
|
|
117663
|
-
const title = /* @__PURE__ */ (0,
|
|
117830
|
+
const title = /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(TerminalTitle, { appStore: props.appStore });
|
|
117664
117831
|
if (panel?.kind === "agents") {
|
|
117665
117832
|
const closePanel = () => props.appStore.setState((s) => ({ ...s, activePanel: null }));
|
|
117666
|
-
return /* @__PURE__ */ (0,
|
|
117833
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_jsx_runtime76.Fragment, { children: [
|
|
117667
117834
|
title,
|
|
117668
|
-
/* @__PURE__ */ (0,
|
|
117835
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(AgentsDashboard, { panel, onClose: closePanel })
|
|
117669
117836
|
] });
|
|
117670
117837
|
}
|
|
117671
|
-
return /* @__PURE__ */ (0,
|
|
117838
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_jsx_runtime76.Fragment, { children: [
|
|
117672
117839
|
title,
|
|
117673
|
-
isFullscreen() ? /* @__PURE__ */ (0,
|
|
117840
|
+
isFullscreen() ? /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(FullscreenLayout, { ...props }) : /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(NativeLayout, { ...props })
|
|
117674
117841
|
] });
|
|
117675
117842
|
}
|
|
117676
117843
|
function NativeLayout({
|
|
@@ -117696,9 +117863,9 @@ function NativeLayout({
|
|
|
117696
117863
|
onCycleMode
|
|
117697
117864
|
}) {
|
|
117698
117865
|
const { columns } = useTerminalSize();
|
|
117699
|
-
return /* @__PURE__ */ (0,
|
|
117700
|
-
/* @__PURE__ */ (0,
|
|
117701
|
-
/* @__PURE__ */ (0,
|
|
117866
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(Box2, { flexDirection: "column", width: columns, children: [
|
|
117867
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Transcript, { appStore, transcriptStore, evictionEnabled: true }),
|
|
117868
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Box2, { flexShrink: 0, flexDirection: "column", children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
117702
117869
|
ReplFooter,
|
|
117703
117870
|
{
|
|
117704
117871
|
appStore,
|
|
@@ -117726,10 +117893,10 @@ function NativeLayout({
|
|
|
117726
117893
|
}
|
|
117727
117894
|
|
|
117728
117895
|
// src/app.tsx
|
|
117729
|
-
var
|
|
117896
|
+
var import_jsx_runtime77 = __toESM(require_jsx_runtime(), 1);
|
|
117730
117897
|
function App2(props) {
|
|
117731
117898
|
const themeName = useStoreSelector(props.appStore, (s) => s.themeName);
|
|
117732
|
-
return /* @__PURE__ */ (0,
|
|
117899
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(ThemeProvider, { value: getTheme(themeName), children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(ReplLayout, { ...props }) });
|
|
117733
117900
|
}
|
|
117734
117901
|
|
|
117735
117902
|
// src/components/Root.tsx
|
|
@@ -118039,7 +118206,7 @@ function toSpans(row) {
|
|
|
118039
118206
|
}
|
|
118040
118207
|
|
|
118041
118208
|
// src/components/layout/splash/Splash.tsx
|
|
118042
|
-
var
|
|
118209
|
+
var import_jsx_runtime78 = __toESM(require_jsx_runtime(), 1);
|
|
118043
118210
|
var TONE = {
|
|
118044
118211
|
starBright: "welcomeBanner",
|
|
118045
118212
|
starMid: "accent",
|
|
@@ -118068,16 +118235,16 @@ function Splash({ columns, rows, frame, copy }) {
|
|
|
118068
118235
|
const height = splashHeight(rows);
|
|
118069
118236
|
const shell2 = import_react52.default.useMemo(() => orbShell(), []);
|
|
118070
118237
|
const grid = splashFrame({ width: columns, rows: height, frame, shell: shell2, copy });
|
|
118071
|
-
return /* @__PURE__ */ (0,
|
|
118238
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Box2, { flexDirection: "column", children: grid.map((spans, y2) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Text2, { wrap: "truncate", children: spans.length === 0 ? " " : spans.map((span, i2) => renderSpan(span, i2, theme)) }, y2)) });
|
|
118072
118239
|
}
|
|
118073
118240
|
function renderSpan(span, key, theme) {
|
|
118074
|
-
if (span.tone === void 0) return /* @__PURE__ */ (0,
|
|
118241
|
+
if (span.tone === void 0) return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Text2, { children: span.text }, key);
|
|
118075
118242
|
if (span.tone === "tagline") {
|
|
118076
118243
|
const chars = [...span.text];
|
|
118077
118244
|
const last = Math.max(1, chars.length - 1);
|
|
118078
|
-
return /* @__PURE__ */ (0,
|
|
118245
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Text2, { children: chars.map((ch, i2) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Text2, { color: gradientAt(i2 / last), children: ch }, i2)) }, key);
|
|
118079
118246
|
}
|
|
118080
|
-
return /* @__PURE__ */ (0,
|
|
118247
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Text2, { color: theme[TONE[span.tone]], bold: span.bold, children: span.text }, key);
|
|
118081
118248
|
}
|
|
118082
118249
|
|
|
118083
118250
|
// src/services/terminal.ts
|
|
@@ -118099,7 +118266,7 @@ function detectTerminal2(env3 = process.env, platform2 = process.platform) {
|
|
|
118099
118266
|
}
|
|
118100
118267
|
|
|
118101
118268
|
// src/components/layout/SignInScreen.tsx
|
|
118102
|
-
var
|
|
118269
|
+
var import_jsx_runtime79 = __toESM(require_jsx_runtime(), 1);
|
|
118103
118270
|
var TICK_MS = 150;
|
|
118104
118271
|
function splashDisabled() {
|
|
118105
118272
|
const v2 = (process.env.ORION_SPLASH ?? "").toLowerCase();
|
|
@@ -118152,9 +118319,9 @@ function SignInScreen({
|
|
|
118152
118319
|
if (key.ctrl && input === "c") exit();
|
|
118153
118320
|
});
|
|
118154
118321
|
if (useSplash) {
|
|
118155
|
-
return /* @__PURE__ */ (0,
|
|
118322
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(ThemeProvider, { value: darkTheme, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Splash, { columns, rows, frame, copy }) });
|
|
118156
118323
|
}
|
|
118157
|
-
return /* @__PURE__ */ (0,
|
|
118324
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(ThemeProvider, { value: darkTheme, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(SignInCard, { phase, url, error }) });
|
|
118158
118325
|
}
|
|
118159
118326
|
function splashCopy(phase, error, url, columns) {
|
|
118160
118327
|
const version = tuiVersion();
|
|
@@ -118200,39 +118367,39 @@ function SignInCard({
|
|
|
118200
118367
|
error
|
|
118201
118368
|
}) {
|
|
118202
118369
|
const version = tuiVersion();
|
|
118203
|
-
return /* @__PURE__ */ (0,
|
|
118204
|
-
/* @__PURE__ */ (0,
|
|
118205
|
-
/* @__PURE__ */ (0,
|
|
118206
|
-
/* @__PURE__ */ (0,
|
|
118207
|
-
/* @__PURE__ */ (0,
|
|
118370
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(Box2, { flexDirection: "column", marginTop: 1, marginBottom: 1, children: [
|
|
118371
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(Box2, { flexDirection: "row", children: [
|
|
118372
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Box2, { marginRight: 2, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(OrionRing, {}) }),
|
|
118373
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(Box2, { flexDirection: "column", justifyContent: "center", children: [
|
|
118374
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(ThemedText, { colorKey: "welcomeBanner", bold: true, children: [
|
|
118208
118375
|
CHANNEL.displayName,
|
|
118209
|
-
version ? /* @__PURE__ */ (0,
|
|
118376
|
+
version ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(ThemedText, { dim: true, children: ` v${version}` }) : null
|
|
118210
118377
|
] }),
|
|
118211
|
-
/* @__PURE__ */ (0,
|
|
118378
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GradientText, { text: "Your engineering team all in one" })
|
|
118212
118379
|
] })
|
|
118213
118380
|
] }),
|
|
118214
|
-
/* @__PURE__ */ (0,
|
|
118215
|
-
phase === "idle" ? /* @__PURE__ */ (0,
|
|
118216
|
-
/* @__PURE__ */ (0,
|
|
118217
|
-
/* @__PURE__ */ (0,
|
|
118218
|
-
/* @__PURE__ */ (0,
|
|
118219
|
-
/* @__PURE__ */ (0,
|
|
118381
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(Box2, { flexDirection: "column", marginTop: 1, children: [
|
|
118382
|
+
phase === "idle" ? /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_jsx_runtime79.Fragment, { children: [
|
|
118383
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(ThemedText, { children: "Sign in with your Orion account to start." }),
|
|
118384
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(Box2, { flexDirection: "row", marginTop: 1, children: [
|
|
118385
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(ThemedText, { colorKey: "accent", bold: true, children: "\u203A Press Enter" }),
|
|
118386
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(ThemedText, { dim: true, children: " to sign in via your browser" })
|
|
118220
118387
|
] })
|
|
118221
118388
|
] }) : null,
|
|
118222
|
-
phase === "signing" ? /* @__PURE__ */ (0,
|
|
118223
|
-
/* @__PURE__ */ (0,
|
|
118224
|
-
url ? /* @__PURE__ */ (0,
|
|
118225
|
-
/* @__PURE__ */ (0,
|
|
118226
|
-
/* @__PURE__ */ (0,
|
|
118389
|
+
phase === "signing" ? /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_jsx_runtime79.Fragment, { children: [
|
|
118390
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(ThemedText, { children: "Opening your browser\u2026" }),
|
|
118391
|
+
url ? /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(Box2, { flexDirection: "column", marginTop: 1, children: [
|
|
118392
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(ThemedText, { dim: true, children: "If it didn't open, open this link to finish signing in:" }),
|
|
118393
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(ThemedText, { colorKey: "accent", children: url })
|
|
118227
118394
|
] }) : null,
|
|
118228
|
-
/* @__PURE__ */ (0,
|
|
118395
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Box2, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(ThemedText, { dim: true, children: "Press Esc to cancel." }) })
|
|
118229
118396
|
] }) : null,
|
|
118230
|
-
phase === "error" ? /* @__PURE__ */ (0,
|
|
118231
|
-
/* @__PURE__ */ (0,
|
|
118397
|
+
phase === "error" ? /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_jsx_runtime79.Fragment, { children: [
|
|
118398
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(ThemedText, { colorKey: "error", children: [
|
|
118232
118399
|
"Sign-in failed: ",
|
|
118233
118400
|
error
|
|
118234
118401
|
] }),
|
|
118235
|
-
/* @__PURE__ */ (0,
|
|
118402
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Box2, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(ThemedText, { dim: true, children: "\u203A Press Enter to try again." }) })
|
|
118236
118403
|
] }) : null
|
|
118237
118404
|
] })
|
|
118238
118405
|
] });
|
|
@@ -118258,6 +118425,9 @@ function createSessionAutosave(deps2) {
|
|
|
118258
118425
|
messages: s.messages,
|
|
118259
118426
|
clientState: s.clientState,
|
|
118260
118427
|
transcript: s.settled,
|
|
118428
|
+
// The reading rides the SNAPSHOT (not a store read), so a deferred
|
|
118429
|
+
// save for a swapped-away session persists that session's own gauge.
|
|
118430
|
+
...s.contextGauge ? { contextGauge: s.contextGauge } : {},
|
|
118261
118431
|
config: deps2.buildConfig()
|
|
118262
118432
|
});
|
|
118263
118433
|
} catch {
|
|
@@ -118881,7 +119051,7 @@ function shouldAutoApprove(fullyAutomatic, configAutoApprove) {
|
|
|
118881
119051
|
|
|
118882
119052
|
// src/headless/runHeadless.ts
|
|
118883
119053
|
var import_client_core46 = __toESM(require_dist(), 1);
|
|
118884
|
-
var
|
|
119054
|
+
var import_client_ui_core21 = __toESM(require_dist2(), 1);
|
|
118885
119055
|
import * as os7 from "os";
|
|
118886
119056
|
import { randomUUID } from "crypto";
|
|
118887
119057
|
var HEADLESS_RESULT_PREFIX = "ORION_HEADLESS_RESULT ";
|
|
@@ -119081,7 +119251,7 @@ async function runHeadless(flags2) {
|
|
|
119081
119251
|
};
|
|
119082
119252
|
const sessionId = randomUUID();
|
|
119083
119253
|
let messages = [];
|
|
119084
|
-
const clientState = (0,
|
|
119254
|
+
const clientState = (0, import_client_ui_core21.emptyClientState)();
|
|
119085
119255
|
const runTurn = async (prompt) => {
|
|
119086
119256
|
const ac = new AbortController();
|
|
119087
119257
|
const snapshot = [...messages];
|
|
@@ -119157,7 +119327,7 @@ async function runHeadless(flags2) {
|
|
|
119157
119327
|
|
|
119158
119328
|
// src/services/feedbackGate.ts
|
|
119159
119329
|
var import_client_core47 = __toESM(require_dist(), 1);
|
|
119160
|
-
var
|
|
119330
|
+
var import_client_ui_core22 = __toESM(require_dist2(), 1);
|
|
119161
119331
|
import { randomUUID as randomUUID2 } from "crypto";
|
|
119162
119332
|
var TuiFeedbackGate = class {
|
|
119163
119333
|
constructor(deps2) {
|
|
@@ -119177,13 +119347,13 @@ var TuiFeedbackGate = class {
|
|
|
119177
119347
|
maybeOffer(sessionId, turnId) {
|
|
119178
119348
|
const now2 = this.now();
|
|
119179
119349
|
const config = this.deps.loadConfig();
|
|
119180
|
-
let state = (0,
|
|
119350
|
+
let state = (0, import_client_ui_core22.feedbackStateFromScalars)(config, now2);
|
|
119181
119351
|
if (config.feedbackFirstSeenAt <= 0 || config.feedbackSeed === 0) {
|
|
119182
|
-
state = { ...state, seed: (0,
|
|
119183
|
-
this.safeSave((0,
|
|
119352
|
+
state = { ...state, seed: (0, import_client_ui_core22.mintFeedbackSeed)() };
|
|
119353
|
+
this.safeSave((0, import_client_ui_core22.feedbackScalarsFromState)(state));
|
|
119184
119354
|
}
|
|
119185
119355
|
const pendings = this.deps.getPendings();
|
|
119186
|
-
const offer = (0,
|
|
119356
|
+
const offer = (0, import_client_ui_core22.shouldOfferFeedback)(state, {
|
|
119187
119357
|
now: now2,
|
|
119188
119358
|
completedTurnsThisSession: this.turnsBySession.get(sessionId) ?? 0,
|
|
119189
119359
|
turnCompletedCleanly: true,
|
|
@@ -119194,8 +119364,8 @@ var TuiFeedbackGate = class {
|
|
|
119194
119364
|
forced: this.deps.forced
|
|
119195
119365
|
});
|
|
119196
119366
|
if (!offer) return;
|
|
119197
|
-
state = (0,
|
|
119198
|
-
this.safeSave((0,
|
|
119367
|
+
state = (0, import_client_ui_core22.applyFeedbackShown)(state, now2);
|
|
119368
|
+
this.safeSave((0, import_client_ui_core22.feedbackScalarsFromState)(state));
|
|
119199
119369
|
const routing = this.deps.getRouting();
|
|
119200
119370
|
const requestId = randomUUID2();
|
|
119201
119371
|
this.pendingId = requestId;
|
|
@@ -119217,10 +119387,10 @@ var TuiFeedbackGate = class {
|
|
|
119217
119387
|
const snapshot = this.deps.getMessages().slice();
|
|
119218
119388
|
const now2 = this.now();
|
|
119219
119389
|
const config = this.deps.loadConfig();
|
|
119220
|
-
const state = (0,
|
|
119221
|
-
this.safeSave((0,
|
|
119222
|
-
const card = (0,
|
|
119223
|
-
const body2 = (0,
|
|
119390
|
+
const state = (0, import_client_ui_core22.applyFeedbackSubmitted)((0, import_client_ui_core22.feedbackStateFromScalars)(config, now2), now2);
|
|
119391
|
+
this.safeSave((0, import_client_ui_core22.feedbackScalarsFromState)(state));
|
|
119392
|
+
const card = (0, import_client_ui_core22.feedbackSetWhy)((0, import_client_ui_core22.feedbackSelectScore)((0, import_client_ui_core22.createFeedbackCard)(), score), why);
|
|
119393
|
+
const body2 = (0, import_client_ui_core22.buildFeedbackSubmission)(card, {
|
|
119224
119394
|
submissionId: randomUUID2(),
|
|
119225
119395
|
sessionId: meta.sessionId,
|
|
119226
119396
|
turnId: meta.turnId,
|
|
@@ -119235,7 +119405,7 @@ var TuiFeedbackGate = class {
|
|
|
119235
119405
|
conversation,
|
|
119236
119406
|
conversation_truncated: truncated
|
|
119237
119407
|
});
|
|
119238
|
-
this.deps.appendNote(
|
|
119408
|
+
this.deps.appendNote(import_client_ui_core22.FEEDBACK_WORDING.transcriptNote);
|
|
119239
119409
|
return true;
|
|
119240
119410
|
}
|
|
119241
119411
|
/** The session/transcript under a pending card is going away (new chat, resume) —
|
|
@@ -119254,11 +119424,11 @@ var TuiFeedbackGate = class {
|
|
|
119254
119424
|
this.deps.setPendingFeedback(null);
|
|
119255
119425
|
if (explicit) {
|
|
119256
119426
|
const now2 = this.now();
|
|
119257
|
-
const state = (0,
|
|
119258
|
-
(0,
|
|
119427
|
+
const state = (0, import_client_ui_core22.applyFeedbackDismissed)(
|
|
119428
|
+
(0, import_client_ui_core22.feedbackStateFromScalars)(this.deps.loadConfig(), now2),
|
|
119259
119429
|
now2
|
|
119260
119430
|
);
|
|
119261
|
-
this.safeSave((0,
|
|
119431
|
+
this.safeSave((0, import_client_ui_core22.feedbackScalarsFromState)(state));
|
|
119262
119432
|
void (0, import_client_core47.sendFeedbackImpression)(this.deps.submit, "dismissed", "tui");
|
|
119263
119433
|
}
|
|
119264
119434
|
return true;
|
|
@@ -119272,7 +119442,7 @@ var TuiFeedbackGate = class {
|
|
|
119272
119442
|
};
|
|
119273
119443
|
|
|
119274
119444
|
// src/main.tsx
|
|
119275
|
-
var
|
|
119445
|
+
var import_jsx_runtime80 = __toESM(require_jsx_runtime(), 1);
|
|
119276
119446
|
var SANDBOX_AVAILABLE = (0, import_client_core48.probeSandboxAvailable)();
|
|
119277
119447
|
async function main() {
|
|
119278
119448
|
let headlessFlags = null;
|
|
@@ -119498,7 +119668,7 @@ async function main() {
|
|
|
119498
119668
|
// the store's referential stability: unchanged state returns the same object.
|
|
119499
119669
|
(relPath) => transcriptStore.setState((s) => {
|
|
119500
119670
|
const clientState = { ...s.clientState };
|
|
119501
|
-
if (!(0,
|
|
119671
|
+
if (!(0, import_client_ui_core23.dropSeenPath)(clientState, relPath)) return s;
|
|
119502
119672
|
return { ...s, clientState };
|
|
119503
119673
|
}),
|
|
119504
119674
|
{ rgPath: ripgrep.locate(), mode: config.indexMode }
|
|
@@ -119548,10 +119718,11 @@ async function main() {
|
|
|
119548
119718
|
}
|
|
119549
119719
|
};
|
|
119550
119720
|
const seedAppFromResumedState = () => {
|
|
119551
|
-
const
|
|
119721
|
+
const ts = transcriptStore.getState();
|
|
119552
119722
|
appStore.setState((s) => ({
|
|
119553
119723
|
...s,
|
|
119554
|
-
plan:
|
|
119724
|
+
plan: ts.clientState.plan ?? s.plan,
|
|
119725
|
+
...resumedContextMeter(s, ts.contextGauge)
|
|
119555
119726
|
}));
|
|
119556
119727
|
};
|
|
119557
119728
|
let sessionId;
|
|
@@ -119560,7 +119731,7 @@ async function main() {
|
|
|
119560
119731
|
const saved = loadSession(resumeId);
|
|
119561
119732
|
if (saved) {
|
|
119562
119733
|
transcriptStore.setState(
|
|
119563
|
-
() => hydrate(saved.sessionId, saved.messages, saved.clientState, saved.transcript)
|
|
119734
|
+
() => hydrate(saved.sessionId, saved.messages, saved.clientState, saved.transcript, saved.contextGauge)
|
|
119564
119735
|
);
|
|
119565
119736
|
appStore.setState((s) => ({ ...s, ...resumedRouting(s, saved.config) }));
|
|
119566
119737
|
setSessionTitle(saved.title ?? "");
|
|
@@ -119733,7 +119904,7 @@ async function main() {
|
|
|
119733
119904
|
let restoredRouting = sessionRoutingFromApp(appStore.getState());
|
|
119734
119905
|
if (saved) {
|
|
119735
119906
|
transcriptStore.setState(
|
|
119736
|
-
() => hydrate(saved.sessionId, saved.messages, saved.clientState, saved.transcript)
|
|
119907
|
+
() => hydrate(saved.sessionId, saved.messages, saved.clientState, saved.transcript, saved.contextGauge)
|
|
119737
119908
|
);
|
|
119738
119909
|
const restored = resumedRouting(appStore.getState(), saved.config);
|
|
119739
119910
|
appStore.setState((s) => ({ ...s, ...restored }));
|
|
@@ -121007,11 +121178,11 @@ async function main() {
|
|
|
121007
121178
|
altScreen = enterAltScreen();
|
|
121008
121179
|
stopSignInWatch = watchForExternalSignIn(session, appStore);
|
|
121009
121180
|
app = await root_default2(
|
|
121010
|
-
/* @__PURE__ */ (0,
|
|
121181
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
121011
121182
|
Root,
|
|
121012
121183
|
{
|
|
121013
121184
|
appStore,
|
|
121014
|
-
app: /* @__PURE__ */ (0,
|
|
121185
|
+
app: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
121015
121186
|
App2,
|
|
121016
121187
|
{
|
|
121017
121188
|
appStore,
|
|
@@ -121046,7 +121217,7 @@ async function main() {
|
|
|
121046
121217
|
onScroll
|
|
121047
121218
|
}
|
|
121048
121219
|
),
|
|
121049
|
-
signInScreen: /* @__PURE__ */ (0,
|
|
121220
|
+
signInScreen: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
121050
121221
|
SignInScreen,
|
|
121051
121222
|
{
|
|
121052
121223
|
session,
|