@proxysoul/soulforge 2.20.4 → 2.20.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +393 -312
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -65798,7 +65798,25 @@ function resolveModel(modelId) {
|
|
|
65798
65798
|
if (!provider) {
|
|
65799
65799
|
throw new Error(`Unknown provider "${providerId}"`);
|
|
65800
65800
|
}
|
|
65801
|
-
|
|
65801
|
+
const base = provider.createModel(model);
|
|
65802
|
+
const family = detectModelFamily(modelId);
|
|
65803
|
+
const NATIVE_REASONING_FAMILIES = new Set([
|
|
65804
|
+
"claude",
|
|
65805
|
+
"openai",
|
|
65806
|
+
"google",
|
|
65807
|
+
"xai",
|
|
65808
|
+
"deepseek-reasoner"
|
|
65809
|
+
]);
|
|
65810
|
+
if (NATIVE_REASONING_FAMILIES.has(family)) {
|
|
65811
|
+
return base;
|
|
65812
|
+
}
|
|
65813
|
+
return wrapLanguageModel({
|
|
65814
|
+
model: base,
|
|
65815
|
+
middleware: [
|
|
65816
|
+
extractReasoningMiddleware({ tagName: "think" }),
|
|
65817
|
+
extractReasoningMiddleware({ tagName: "thinking" })
|
|
65818
|
+
]
|
|
65819
|
+
});
|
|
65802
65820
|
}
|
|
65803
65821
|
function onProviderSwitch(listener) {
|
|
65804
65822
|
providerSwitchListeners.add(listener);
|
|
@@ -65808,7 +65826,9 @@ function onProviderSwitch(listener) {
|
|
|
65808
65826
|
}
|
|
65809
65827
|
var cachedStatuses = null, providerStatusListeners, activeProviderId = null, providerSwitchListeners;
|
|
65810
65828
|
var init_provider = __esm(() => {
|
|
65829
|
+
init_dist5();
|
|
65811
65830
|
init_secrets();
|
|
65831
|
+
init_provider_options();
|
|
65812
65832
|
init_providers();
|
|
65813
65833
|
providerStatusListeners = new Set;
|
|
65814
65834
|
providerSwitchListeners = new Set;
|
|
@@ -71927,7 +71947,7 @@ var package_default;
|
|
|
71927
71947
|
var init_package = __esm(() => {
|
|
71928
71948
|
package_default = {
|
|
71929
71949
|
name: "@proxysoul/soulforge",
|
|
71930
|
-
version: "2.20.
|
|
71950
|
+
version: "2.20.6",
|
|
71931
71951
|
description: "Graph-powered code intelligence \u2014 multi-agent coding with codebase-aware AI",
|
|
71932
71952
|
repository: {
|
|
71933
71953
|
type: "git",
|
|
@@ -403542,7 +403562,7 @@ async function start2(opts) {
|
|
|
403542
403562
|
}
|
|
403543
403563
|
try {
|
|
403544
403564
|
const { sendBeacon: sendBeacon2, maybeShowTelemetryNotice: maybeShowTelemetryNotice2 } = await Promise.resolve().then(() => (init_telemetry(), exports_telemetry));
|
|
403545
|
-
const { detectModelFamily, telemetryModelInfo } = await Promise.resolve().then(() => (init_provider_options(), exports_provider_options));
|
|
403565
|
+
const { detectModelFamily: detectModelFamily2, telemetryModelInfo } = await Promise.resolve().then(() => (init_provider_options(), exports_provider_options));
|
|
403546
403566
|
const { CURRENT_VERSION: CURRENT_VERSION2, detectInstallMethod: detectInstallMethod2 } = await Promise.resolve().then(() => (init_version(), exports_version));
|
|
403547
403567
|
const { loadConfig: loadConfig2, saveGlobalConfig: saveGlobalConfig2 } = await Promise.resolve().then(() => (init_config2(), exports_config2));
|
|
403548
403568
|
const cfg = loadConfig2();
|
|
@@ -403553,7 +403573,7 @@ async function start2(opts) {
|
|
|
403553
403573
|
surface: "tui",
|
|
403554
403574
|
version: CURRENT_VERSION2,
|
|
403555
403575
|
install: detectInstallMethod2(),
|
|
403556
|
-
family: hasModel ?
|
|
403576
|
+
family: hasModel ? detectModelFamily2(cfg.defaultModel) : undefined,
|
|
403557
403577
|
provider: info2?.provider,
|
|
403558
403578
|
model: info2?.model
|
|
403559
403579
|
}, cfg.telemetry);
|
|
@@ -406080,7 +406100,7 @@ var init_step_utils = __esm(() => {
|
|
|
406080
406100
|
|
|
406081
406101
|
// src/core/platform/clipboard.ts
|
|
406082
406102
|
import { execFile as execFile2, spawnSync as spawnSync6 } from "child_process";
|
|
406083
|
-
import { readFileSync as readFileSync20, unlinkSync as unlinkSync7 } from "fs";
|
|
406103
|
+
import { existsSync as existsSync36, readFileSync as readFileSync20, unlinkSync as unlinkSync7 } from "fs";
|
|
406084
406104
|
import { join as join38 } from "path";
|
|
406085
406105
|
function trySpawn(cmd, args2, text2) {
|
|
406086
406106
|
try {
|
|
@@ -406185,20 +406205,37 @@ function readImageLinux() {
|
|
|
406185
406205
|
});
|
|
406186
406206
|
});
|
|
406187
406207
|
}
|
|
406208
|
+
function resolveWindowsPowerShell() {
|
|
406209
|
+
const onPath = findOnPath("powershell");
|
|
406210
|
+
if (onPath)
|
|
406211
|
+
return onPath;
|
|
406212
|
+
const fullPath = join38(process.env.SystemRoot ?? "C:\\Windows", "System32", "WindowsPowerShell", "v1.0", "powershell.exe");
|
|
406213
|
+
if (existsSync36(fullPath))
|
|
406214
|
+
return fullPath;
|
|
406215
|
+
return findOnPath("pwsh");
|
|
406216
|
+
}
|
|
406188
406217
|
function readImageWindows() {
|
|
406218
|
+
const exe = resolveWindowsPowerShell();
|
|
406219
|
+
if (!exe)
|
|
406220
|
+
return Promise.resolve(null);
|
|
406189
406221
|
const tmpFile = join38(tmpDir(), `soulforge-clipboard-${Date.now()}-${Math.random().toString(36).slice(2, 8)}.png`);
|
|
406190
406222
|
const ps = [
|
|
406191
406223
|
"param([Parameter(Mandatory)][string]$OutFile)",
|
|
406192
406224
|
"$ErrorActionPreference = 'SilentlyContinue';",
|
|
406193
406225
|
"Add-Type -AssemblyName System.Windows.Forms;",
|
|
406194
406226
|
"Add-Type -AssemblyName System.Drawing;",
|
|
406227
|
+
"$png = [System.Windows.Forms.Clipboard]::GetData('PNG');",
|
|
406228
|
+
"if ($png -is [System.IO.MemoryStream]) {",
|
|
406229
|
+
" [System.IO.File]::WriteAllBytes($OutFile, $png.ToArray());",
|
|
406230
|
+
" Write-Output 'ok'; exit 0;",
|
|
406231
|
+
"}",
|
|
406195
406232
|
"$img = [System.Windows.Forms.Clipboard]::GetImage();",
|
|
406196
406233
|
"if ($img -eq $null) { Write-Output 'no-image'; exit 0 };",
|
|
406197
406234
|
"$img.Save($OutFile, [System.Drawing.Imaging.ImageFormat]::Png);",
|
|
406198
406235
|
"Write-Output 'ok'"
|
|
406199
406236
|
].join(" ");
|
|
406200
406237
|
return new Promise((resolve14) => {
|
|
406201
|
-
execFile2(
|
|
406238
|
+
execFile2(exe, ["-NoProfile", "-NonInteractive", "-STA", "-Command", ps, "-OutFile", tmpFile], { timeout: 1e4, windowsHide: true }, (err2, stdout) => {
|
|
406202
406239
|
if (err2 || !stdout.toString().trim().startsWith("ok")) {
|
|
406203
406240
|
cleanup(tmpFile);
|
|
406204
406241
|
resolve14(null);
|
|
@@ -406642,7 +406679,7 @@ var init_session = __esm(async () => {
|
|
|
406642
406679
|
|
|
406643
406680
|
// src/core/commands/storage.ts
|
|
406644
406681
|
import { Database as Database5 } from "bun:sqlite";
|
|
406645
|
-
import { existsSync as
|
|
406682
|
+
import { existsSync as existsSync37, rmSync as rmSync3 } from "fs";
|
|
406646
406683
|
import { join as join40 } from "path";
|
|
406647
406684
|
function openStorageMenu(ctx) {
|
|
406648
406685
|
const show = () => {
|
|
@@ -406757,7 +406794,7 @@ function openStorageMenu(ctx) {
|
|
|
406757
406794
|
sysMsg(ctx, `Cleared ${String(cleared)} sessions (freed ~${formatBytes(s.sessions)}).`);
|
|
406758
406795
|
} else if (value === "clear-history") {
|
|
406759
406796
|
const historyPath = join40(s.globalDir, "history.db");
|
|
406760
|
-
if (
|
|
406797
|
+
if (existsSync37(historyPath) && s.history > 0) {
|
|
406761
406798
|
const ok = await confirm({
|
|
406762
406799
|
title: "Clear search history?",
|
|
406763
406800
|
message: `Prompt history and stash entries (${formatBytes(s.history)}) will be deleted globally. This cannot be undone.`,
|
|
@@ -406777,7 +406814,7 @@ function openStorageMenu(ctx) {
|
|
|
406777
406814
|
}
|
|
406778
406815
|
} else if (value === "clear-plans") {
|
|
406779
406816
|
const plansDir = join40(s.projectDir, "plans");
|
|
406780
|
-
if (
|
|
406817
|
+
if (existsSync37(plansDir) && s.plans > 0) {
|
|
406781
406818
|
const ok = await confirm({
|
|
406782
406819
|
title: "Clear plans?",
|
|
406783
406820
|
message: `All saved plans (${formatBytes(s.plans)}) for this project will be deleted. This cannot be undone.`,
|
|
@@ -406797,7 +406834,7 @@ function openStorageMenu(ctx) {
|
|
|
406797
406834
|
join40(s.globalDir, "memory.db")
|
|
406798
406835
|
];
|
|
406799
406836
|
for (const dbPath of dbs) {
|
|
406800
|
-
if (!
|
|
406837
|
+
if (!existsSync37(dbPath))
|
|
406801
406838
|
continue;
|
|
406802
406839
|
try {
|
|
406803
406840
|
const before = fileSize(dbPath);
|
|
@@ -407869,7 +407906,7 @@ __export(exports_addons, {
|
|
|
407869
407906
|
autoInstallFromEnv: () => autoInstallFromEnv,
|
|
407870
407907
|
ADDON_NAMES: () => ADDON_NAMES
|
|
407871
407908
|
});
|
|
407872
|
-
import { existsSync as
|
|
407909
|
+
import { existsSync as existsSync38, rmSync as rmSync4 } from "fs";
|
|
407873
407910
|
import { join as join41 } from "path";
|
|
407874
407911
|
function isAddonInstalled(name39) {
|
|
407875
407912
|
if (name39 === "proxy") {
|
|
@@ -407957,7 +407994,7 @@ async function removeAddon(name39, onStatus) {
|
|
|
407957
407994
|
} catch {}
|
|
407958
407995
|
}
|
|
407959
407996
|
const binPath = join41(BIN_DIR2, ADDON_BIN[name39]);
|
|
407960
|
-
if (
|
|
407997
|
+
if (existsSync38(binPath)) {
|
|
407961
407998
|
try {
|
|
407962
407999
|
rmSync4(binPath, { force: true });
|
|
407963
408000
|
} catch (err2) {
|
|
@@ -407967,7 +408004,7 @@ async function removeAddon(name39, onStatus) {
|
|
|
407967
408004
|
const prefix = ADDON_INSTALL_PREFIX[name39];
|
|
407968
408005
|
try {
|
|
407969
408006
|
const { readdirSync: readdirSync10 } = await import("fs");
|
|
407970
|
-
if (
|
|
408007
|
+
if (existsSync38(INSTALLS_DIR2)) {
|
|
407971
408008
|
for (const entry of readdirSync10(INSTALLS_DIR2)) {
|
|
407972
408009
|
if (entry.startsWith(prefix) && /\d/.test(entry.slice(prefix.length, prefix.length + 1))) {
|
|
407973
408010
|
rmSync4(join41(INSTALLS_DIR2, entry), { recursive: true, force: true });
|
|
@@ -413227,7 +413264,7 @@ var init_embedder = __esm(() => {
|
|
|
413227
413264
|
|
|
413228
413265
|
// src/core/memory/db.ts
|
|
413229
413266
|
import { Database as Database6 } from "bun:sqlite";
|
|
413230
|
-
import { chmodSync as chmodSync4, existsSync as
|
|
413267
|
+
import { chmodSync as chmodSync4, existsSync as existsSync39, mkdirSync as mkdirSync22 } from "fs";
|
|
413231
413268
|
import { dirname as dirname15 } from "path";
|
|
413232
413269
|
|
|
413233
413270
|
class MemoryDB {
|
|
@@ -413238,7 +413275,7 @@ class MemoryDB {
|
|
|
413238
413275
|
this.scope = scope;
|
|
413239
413276
|
if (dbPath !== ":memory:") {
|
|
413240
413277
|
const dir = dirname15(dbPath);
|
|
413241
|
-
if (!
|
|
413278
|
+
if (!existsSync39(dir))
|
|
413242
413279
|
mkdirSync22(dir, { recursive: true });
|
|
413243
413280
|
}
|
|
413244
413281
|
this.legacyBackupPath = dbPath !== ":memory:" ? rotateLegacyDb(dbPath) : null;
|
|
@@ -414122,7 +414159,7 @@ function codePointCount(s) {
|
|
|
414122
414159
|
return n;
|
|
414123
414160
|
}
|
|
414124
414161
|
function rotateLegacyDb(dbPath) {
|
|
414125
|
-
if (!
|
|
414162
|
+
if (!existsSync39(dbPath))
|
|
414126
414163
|
return null;
|
|
414127
414164
|
let needsRotation = false;
|
|
414128
414165
|
let probe = null;
|
|
@@ -414144,7 +414181,7 @@ function rotateLegacyDb(dbPath) {
|
|
|
414144
414181
|
try {
|
|
414145
414182
|
safeRename(dbPath, backup);
|
|
414146
414183
|
for (const suffix of ["-wal", "-shm"]) {
|
|
414147
|
-
if (
|
|
414184
|
+
if (existsSync39(dbPath + suffix)) {
|
|
414148
414185
|
try {
|
|
414149
414186
|
safeRename(dbPath + suffix, backup + suffix);
|
|
414150
414187
|
} catch {}
|
|
@@ -414215,7 +414252,7 @@ var init_db2 = __esm(() => {
|
|
|
414215
414252
|
});
|
|
414216
414253
|
|
|
414217
414254
|
// src/core/memory/manager.ts
|
|
414218
|
-
import { existsSync as
|
|
414255
|
+
import { existsSync as existsSync40, mkdirSync as mkdirSync23, readFileSync as readFileSync21, rmSync as rmSync5, writeFileSync as writeFileSync17 } from "fs";
|
|
414219
414256
|
import { dirname as dirname16, join as join42 } from "path";
|
|
414220
414257
|
|
|
414221
414258
|
class MemoryManager {
|
|
@@ -414254,7 +414291,7 @@ class MemoryManager {
|
|
|
414254
414291
|
loadConfig() {
|
|
414255
414292
|
for (const scope of ["project", "global"]) {
|
|
414256
414293
|
const path = this.configPath(scope);
|
|
414257
|
-
if (!
|
|
414294
|
+
if (!existsSync40(path))
|
|
414258
414295
|
continue;
|
|
414259
414296
|
try {
|
|
414260
414297
|
const data = JSON.parse(readFileSync21(path, "utf-8"));
|
|
@@ -414271,7 +414308,7 @@ class MemoryManager {
|
|
|
414271
414308
|
saveConfig(to) {
|
|
414272
414309
|
const path = this.configPath(to);
|
|
414273
414310
|
const dir = dirname16(path);
|
|
414274
|
-
if (!
|
|
414311
|
+
if (!existsSync40(dir))
|
|
414275
414312
|
mkdirSync23(dir, { recursive: true });
|
|
414276
414313
|
const payload = { ...this._scopeConfig, cleanup: this._cleanup };
|
|
414277
414314
|
writeFileSync17(path, JSON.stringify(payload, null, 2), "utf-8");
|
|
@@ -414279,7 +414316,7 @@ class MemoryManager {
|
|
|
414279
414316
|
}
|
|
414280
414317
|
deleteConfig(from) {
|
|
414281
414318
|
const path = this.configPath(from);
|
|
414282
|
-
if (
|
|
414319
|
+
if (existsSync40(path))
|
|
414283
414320
|
rmSync5(path);
|
|
414284
414321
|
if (from === this._settingsScope) {
|
|
414285
414322
|
this._settingsScope = "project";
|
|
@@ -414504,7 +414541,7 @@ class MemoryManager {
|
|
|
414504
414541
|
}
|
|
414505
414542
|
deleteConfigOnly(from) {
|
|
414506
414543
|
const path = this.configPath(from);
|
|
414507
|
-
if (
|
|
414544
|
+
if (existsSync40(path)) {
|
|
414508
414545
|
try {
|
|
414509
414546
|
rmSync5(path);
|
|
414510
414547
|
} catch {}
|
|
@@ -435112,7 +435149,7 @@ var MAX_BYTES2 = 512, UTF8_BOUNDARY_RESERVE = 3;
|
|
|
435112
435149
|
var init_lib2 = () => {};
|
|
435113
435150
|
|
|
435114
435151
|
// src/core/tools/binary-detect.ts
|
|
435115
|
-
import { existsSync as
|
|
435152
|
+
import { existsSync as existsSync41, statSync as statSync7 } from "fs";
|
|
435116
435153
|
import { extname as extname3, resolve as resolve28 } from "path";
|
|
435117
435154
|
function binaryHint(ext) {
|
|
435118
435155
|
if (IMAGE_EXTS.has(ext))
|
|
@@ -435133,7 +435170,7 @@ function binaryHint(ext) {
|
|
|
435133
435170
|
}
|
|
435134
435171
|
function checkBinaryFile(filePath) {
|
|
435135
435172
|
try {
|
|
435136
|
-
if (!
|
|
435173
|
+
if (!existsSync41(filePath))
|
|
435137
435174
|
return null;
|
|
435138
435175
|
const stat5 = statSync7(filePath);
|
|
435139
435176
|
if (!stat5.isFile())
|
|
@@ -437119,7 +437156,7 @@ __export(exports_image, {
|
|
|
437119
437156
|
import { execSync as execSync3, spawn as spawn14 } from "child_process";
|
|
437120
437157
|
import {
|
|
437121
437158
|
closeSync as closeSync2,
|
|
437122
|
-
existsSync as
|
|
437159
|
+
existsSync as existsSync42,
|
|
437123
437160
|
openSync as openSync2,
|
|
437124
437161
|
readFileSync as readFileSync22,
|
|
437125
437162
|
statSync as statSync8,
|
|
@@ -437446,7 +437483,7 @@ function getPngDimensions(data) {
|
|
|
437446
437483
|
}
|
|
437447
437484
|
function safeUnlink(path) {
|
|
437448
437485
|
try {
|
|
437449
|
-
if (
|
|
437486
|
+
if (existsSync42(path))
|
|
437450
437487
|
unlinkSync8(path);
|
|
437451
437488
|
} catch {}
|
|
437452
437489
|
}
|
|
@@ -437625,7 +437662,7 @@ var init_tool_progress = __esm(() => {
|
|
|
437625
437662
|
// src/core/tools/show-image.ts
|
|
437626
437663
|
import { spawn as spawn15, spawnSync as spawnSync7 } from "child_process";
|
|
437627
437664
|
import {
|
|
437628
|
-
existsSync as
|
|
437665
|
+
existsSync as existsSync43,
|
|
437629
437666
|
readdirSync as readdirSync10,
|
|
437630
437667
|
readFileSync as readFileSync23,
|
|
437631
437668
|
statSync as statSync9,
|
|
@@ -437636,7 +437673,7 @@ import { tmpdir as tmpdir4 } from "os";
|
|
|
437636
437673
|
import { basename as basename7, extname as extname7, resolve as resolve34 } from "path";
|
|
437637
437674
|
function safeUnlink2(path) {
|
|
437638
437675
|
try {
|
|
437639
|
-
if (
|
|
437676
|
+
if (existsSync43(path))
|
|
437640
437677
|
unlinkSync9(path);
|
|
437641
437678
|
} catch {}
|
|
437642
437679
|
}
|
|
@@ -437655,7 +437692,7 @@ async function convertToPng(data, ext, signal) {
|
|
|
437655
437692
|
for (const [cmd, cmdArgs] of converters) {
|
|
437656
437693
|
try {
|
|
437657
437694
|
const result = await spawnAsync(cmd, cmdArgs, { timeout: 1e4, signal });
|
|
437658
|
-
if (result.code === 0 &&
|
|
437695
|
+
if (result.code === 0 && existsSync43(dstPath))
|
|
437659
437696
|
return readFileSync23(dstPath);
|
|
437660
437697
|
} catch {}
|
|
437661
437698
|
}
|
|
@@ -437745,7 +437782,7 @@ async function resizeImageToTarget(data, name39, targetBytes, signal) {
|
|
|
437745
437782
|
"2",
|
|
437746
437783
|
dstPath
|
|
437747
437784
|
], { timeout: 30000, signal });
|
|
437748
|
-
if (result.code === 0 &&
|
|
437785
|
+
if (result.code === 0 && existsSync43(dstPath)) {
|
|
437749
437786
|
const resized = readFileSync23(dstPath);
|
|
437750
437787
|
if (resized.length > 0 && resized.length <= targetBytes)
|
|
437751
437788
|
return resized;
|
|
@@ -437762,7 +437799,7 @@ async function resizeImageToTarget(data, name39, targetBytes, signal) {
|
|
|
437762
437799
|
for (const scale of scales) {
|
|
437763
437800
|
const targetWidth = Math.round(origWidth * scale);
|
|
437764
437801
|
const result = await spawnAsync("sips", ["--resampleWidth", String(targetWidth), srcPath, "--out", dstPath], { timeout: 30000, signal });
|
|
437765
|
-
if (result.code === 0 &&
|
|
437802
|
+
if (result.code === 0 && existsSync43(dstPath)) {
|
|
437766
437803
|
const resized = readFileSync23(dstPath);
|
|
437767
437804
|
if (resized.length > 0 && resized.length <= targetBytes)
|
|
437768
437805
|
return resized;
|
|
@@ -437860,7 +437897,7 @@ async function videoToGif(videoPath, toolCallId, maxDuration = MAX_GIF_DURATION,
|
|
|
437860
437897
|
"1",
|
|
437861
437898
|
palettePath
|
|
437862
437899
|
], { timeout: 60000, signal });
|
|
437863
|
-
if (pass1.code !== 0 || !
|
|
437900
|
+
if (pass1.code !== 0 || !existsSync43(palettePath))
|
|
437864
437901
|
return null;
|
|
437865
437902
|
progress(toolCallId, "FFMPEG", `${msg}\u2026 (encoding)`);
|
|
437866
437903
|
const pass2 = await spawnAsync("ffmpeg", [
|
|
@@ -437887,7 +437924,7 @@ async function videoToGif(videoPath, toolCallId, maxDuration = MAX_GIF_DURATION,
|
|
|
437887
437924
|
});
|
|
437888
437925
|
if (pass2.code !== 0)
|
|
437889
437926
|
return null;
|
|
437890
|
-
if (
|
|
437927
|
+
if (existsSync43(gifPath)) {
|
|
437891
437928
|
const data = readFileSync23(gifPath);
|
|
437892
437929
|
if (data.length > 0 && data.length <= MAX_IMAGE_SIZE2)
|
|
437893
437930
|
return data;
|
|
@@ -437908,7 +437945,7 @@ async function videoToFrame(videoPath, toolCallId, signal) {
|
|
|
437908
437945
|
try {
|
|
437909
437946
|
progress(toolCallId, "FFMPEG", "Extracting frame\u2026");
|
|
437910
437947
|
const result = await spawnAsync("ffmpeg", ["-y", "-i", videoPath, "-frames:v", "1", "-q:v", "2", framePath], { timeout: 15000, signal });
|
|
437911
|
-
if (result.code === 0 &&
|
|
437948
|
+
if (result.code === 0 && existsSync43(framePath)) {
|
|
437912
437949
|
const data = readFileSync23(framePath);
|
|
437913
437950
|
if (data.length > 0 && data.length <= MAX_IMAGE_SIZE2)
|
|
437914
437951
|
return data;
|
|
@@ -438005,7 +438042,7 @@ ${INSTALL_YTDLP}`
|
|
|
438005
438042
|
videoPath,
|
|
438006
438043
|
url2
|
|
438007
438044
|
], { timeout: 120000, signal, onStderr });
|
|
438008
|
-
if (dlResult.code !== 0 || !
|
|
438045
|
+
if (dlResult.code !== 0 || !existsSync43(videoPath)) {
|
|
438009
438046
|
safeUnlink2(videoPath);
|
|
438010
438047
|
progress(toolCallId, "YT-DL", `${dlMsg}\u2026 (retrying lowest quality)`);
|
|
438011
438048
|
dlResult = await spawnAsync("yt-dlp", ["-f", "worst", "-o", videoPath, url2], {
|
|
@@ -438014,7 +438051,7 @@ ${INSTALL_YTDLP}`
|
|
|
438014
438051
|
onStderr
|
|
438015
438052
|
});
|
|
438016
438053
|
}
|
|
438017
|
-
if (dlResult.code === 0 &&
|
|
438054
|
+
if (dlResult.code === 0 && existsSync43(videoPath)) {
|
|
438018
438055
|
if (supportsKittyAnimation()) {
|
|
438019
438056
|
for (let attempt = 0;attempt < 2; attempt++) {
|
|
438020
438057
|
const gif = await videoToGif(videoPath, toolCallId, MAX_GIF_DURATION, signal);
|
|
@@ -438043,7 +438080,7 @@ ${INSTALL_YTDLP}`
|
|
|
438043
438080
|
], { timeout: 30000, signal });
|
|
438044
438081
|
const thumbFile = `${thumbBase}.png`;
|
|
438045
438082
|
cleanupFiles.push(thumbFile);
|
|
438046
|
-
if (thumbResult.code === 0 &&
|
|
438083
|
+
if (thumbResult.code === 0 && existsSync43(thumbFile)) {
|
|
438047
438084
|
const data = readFileSync23(thumbFile);
|
|
438048
438085
|
if (data.length > 0 && data.length <= MAX_IMAGE_SIZE2) {
|
|
438049
438086
|
const suffix = hasFfmpeg() ? " (video download failed, showing thumbnail)" : " (install ffmpeg for animated GIF)";
|
|
@@ -438379,7 +438416,7 @@ async function restoreSessionImages(messages, cwd2) {
|
|
|
438379
438416
|
name39 = result.name;
|
|
438380
438417
|
} else {
|
|
438381
438418
|
const filePath = resolve34(cwd2, path);
|
|
438382
|
-
if (!
|
|
438419
|
+
if (!existsSync43(filePath))
|
|
438383
438420
|
continue;
|
|
438384
438421
|
const stat5 = statSync9(filePath);
|
|
438385
438422
|
if (!stat5.isFile() || stat5.size > MAX_IMAGE_SIZE2)
|
|
@@ -438471,7 +438508,7 @@ var init_show_image = __esm(() => {
|
|
|
438471
438508
|
});
|
|
438472
438509
|
|
|
438473
438510
|
// src/core/skills/manager.ts
|
|
438474
|
-
import { existsSync as
|
|
438511
|
+
import { existsSync as existsSync44, readdirSync as readdirSync11, readFileSync as readFileSync24, realpathSync as realpathSync4, rmSync as rmSync6, statSync as statSync10 } from "fs";
|
|
438475
438512
|
import { homedir as homedir13 } from "os";
|
|
438476
438513
|
import { dirname as dirname22, join as join47 } from "path";
|
|
438477
438514
|
async function searchSkills(query2) {
|
|
@@ -438596,7 +438633,7 @@ function loadSkill(path) {
|
|
|
438596
438633
|
function removeInstalledSkill(skill) {
|
|
438597
438634
|
try {
|
|
438598
438635
|
const dir = dirname22(skill.path);
|
|
438599
|
-
if (
|
|
438636
|
+
if (existsSync44(dir)) {
|
|
438600
438637
|
rmSync6(dir, { recursive: true });
|
|
438601
438638
|
return true;
|
|
438602
438639
|
}
|
|
@@ -439874,7 +439911,7 @@ ${enriched}`
|
|
|
439874
439911
|
|
|
439875
439912
|
// src/core/tools/soul-grep.ts
|
|
439876
439913
|
import { spawn as spawn17 } from "child_process";
|
|
439877
|
-
import { existsSync as
|
|
439914
|
+
import { existsSync as existsSync45 } from "fs";
|
|
439878
439915
|
function resolveDepSearch(dep, explicitPath) {
|
|
439879
439916
|
const noIgnoreFollow = ["--no-ignore", "--follow"];
|
|
439880
439917
|
if (explicitPath) {
|
|
@@ -439886,7 +439923,7 @@ function resolveDepSearch(dep, explicitPath) {
|
|
|
439886
439923
|
const FLAT_ROOTS = ["node_modules", "vendor", "bower_components"];
|
|
439887
439924
|
for (const root of FLAT_ROOTS) {
|
|
439888
439925
|
const candidate = `${root}/${dep}`;
|
|
439889
|
-
if (
|
|
439926
|
+
if (existsSync45(candidate)) {
|
|
439890
439927
|
return { searchPath: candidate, extraArgs: noIgnoreFollow, resolved: true, dep };
|
|
439891
439928
|
}
|
|
439892
439929
|
}
|
|
@@ -440473,7 +440510,7 @@ var init_soul_query = __esm(() => {
|
|
|
440473
440510
|
|
|
440474
440511
|
// src/core/tools/structural-edit.ts
|
|
440475
440512
|
import { spawn as spawn18 } from "child_process";
|
|
440476
|
-
import { existsSync as
|
|
440513
|
+
import { existsSync as existsSync46 } from "fs";
|
|
440477
440514
|
import { extname as extname9, join as join49, resolve as resolve37 } from "path";
|
|
440478
440515
|
function resolveAstGrep(cwd2) {
|
|
440479
440516
|
const vendored = getVendoredPath("ast-grep");
|
|
@@ -440483,13 +440520,13 @@ function resolveAstGrep(cwd2) {
|
|
|
440483
440520
|
const localCandidates = IS_WIN ? ["ast-grep.cmd", "ast-grep.exe", "ast-grep.ps1", "ast-grep", "sg.cmd", "sg.exe", "sg"] : ["ast-grep", "sg"];
|
|
440484
440521
|
for (const name39 of localCandidates) {
|
|
440485
440522
|
const candidate = join49(binDir, name39);
|
|
440486
|
-
if (
|
|
440523
|
+
if (existsSync46(candidate))
|
|
440487
440524
|
return candidate;
|
|
440488
440525
|
}
|
|
440489
440526
|
const nativeDir = join49(cwd2, "node_modules", "@ast-grep", "cli");
|
|
440490
440527
|
for (const name39 of [`ast-grep${EXE2}`, `sg${EXE2}`]) {
|
|
440491
440528
|
const candidate = join49(nativeDir, name39);
|
|
440492
|
-
if (
|
|
440529
|
+
if (existsSync46(candidate))
|
|
440493
440530
|
return candidate;
|
|
440494
440531
|
}
|
|
440495
440532
|
return findOnPath("ast-grep") ?? findOnPath("sg") ?? null;
|
|
@@ -440589,7 +440626,7 @@ var init_structural_edit = __esm(() => {
|
|
|
440589
440626
|
error: "forbidden"
|
|
440590
440627
|
};
|
|
440591
440628
|
}
|
|
440592
|
-
if (!
|
|
440629
|
+
if (!existsSync46(abs)) {
|
|
440593
440630
|
return { success: false, output: `File not found: ${args2.file}`, error: "not found" };
|
|
440594
440631
|
}
|
|
440595
440632
|
const ext = extname9(abs).toLowerCase();
|
|
@@ -443966,7 +444003,7 @@ var init_explore = __esm(() => {
|
|
|
443966
444003
|
|
|
443967
444004
|
// src/utils/image-compress.ts
|
|
443968
444005
|
import { spawn as spawn19 } from "child_process";
|
|
443969
|
-
import { existsSync as
|
|
444006
|
+
import { existsSync as existsSync47, readFileSync as readFileSync25, unlinkSync as unlinkSync10, writeFileSync as writeFileSync19 } from "fs";
|
|
443970
444007
|
import { tmpdir as tmpdir5 } from "os";
|
|
443971
444008
|
import { resolve as resolve40 } from "path";
|
|
443972
444009
|
async function compressImageForApi(data, mediaType) {
|
|
@@ -443982,7 +444019,7 @@ async function compressImageForApi(data, mediaType) {
|
|
|
443982
444019
|
for (const q2 of qualities) {
|
|
443983
444020
|
safeUnlink3(dstPath);
|
|
443984
444021
|
const ok2 = IS_DARWIN ? await trySips(srcPath, dstPath, q2) : await tryFfmpegOrMagick(srcPath, dstPath, q2);
|
|
443985
|
-
if (ok2 &&
|
|
444022
|
+
if (ok2 && existsSync47(dstPath)) {
|
|
443986
444023
|
const compressed = readFileSync25(dstPath);
|
|
443987
444024
|
if (compressed.length <= MAX_RAW_BYTES) {
|
|
443988
444025
|
return { data: compressed, mediaType: "image/jpeg" };
|
|
@@ -443991,7 +444028,7 @@ async function compressImageForApi(data, mediaType) {
|
|
|
443991
444028
|
}
|
|
443992
444029
|
safeUnlink3(dstPath);
|
|
443993
444030
|
const ok = IS_DARWIN ? await trySipsResize(srcPath, dstPath, 50, 30) : await tryFfmpegOrMagickResize(srcPath, dstPath, 50, 30);
|
|
443994
|
-
if (ok &&
|
|
444031
|
+
if (ok && existsSync47(dstPath)) {
|
|
443995
444032
|
const compressed = readFileSync25(dstPath);
|
|
443996
444033
|
if (compressed.length <= MAX_RAW_BYTES) {
|
|
443997
444034
|
return { data: compressed, mediaType: "image/jpeg" };
|
|
@@ -444128,7 +444165,7 @@ function spawnStdout(cmd, args2) {
|
|
|
444128
444165
|
}
|
|
444129
444166
|
function safeUnlink3(path) {
|
|
444130
444167
|
try {
|
|
444131
|
-
if (
|
|
444168
|
+
if (existsSync47(path))
|
|
444132
444169
|
unlinkSync10(path);
|
|
444133
444170
|
} catch {}
|
|
444134
444171
|
}
|
|
@@ -445310,10 +445347,10 @@ function buildSubagentTools(models) {
|
|
|
445310
445347
|
exists = true;
|
|
445311
445348
|
}
|
|
445312
445349
|
if (!exists) {
|
|
445313
|
-
const { existsSync:
|
|
445350
|
+
const { existsSync: existsSync48 } = __require("fs");
|
|
445314
445351
|
const { resolve: resolvePath, isAbsolute: isAbsolute2 } = __require("path");
|
|
445315
445352
|
const abs = isAbsolute2(norm) ? norm : resolvePath(cwd2, norm);
|
|
445316
|
-
if (
|
|
445353
|
+
if (existsSync48(abs))
|
|
445317
445354
|
exists = true;
|
|
445318
445355
|
}
|
|
445319
445356
|
if (exists) {
|
|
@@ -447649,11 +447686,11 @@ class SoulMapSnapshot {
|
|
|
447649
447686
|
var init_soul_map_snapshot = () => {};
|
|
447650
447687
|
|
|
447651
447688
|
// src/core/context/toolchain.ts
|
|
447652
|
-
import { existsSync as
|
|
447689
|
+
import { existsSync as existsSync48 } from "fs";
|
|
447653
447690
|
import { join as join53 } from "path";
|
|
447654
447691
|
function detectToolchain(cwd2) {
|
|
447655
447692
|
for (const [file2, tool4] of TOOLCHAIN_MARKERS) {
|
|
447656
|
-
if (
|
|
447693
|
+
if (existsSync48(join53(cwd2, file2)))
|
|
447657
447694
|
return tool4;
|
|
447658
447695
|
}
|
|
447659
447696
|
return null;
|
|
@@ -447911,7 +447948,7 @@ __export(exports_manager2, {
|
|
|
447911
447948
|
extractConversationTerms: () => extractConversationTerms,
|
|
447912
447949
|
ContextManager: () => ContextManager
|
|
447913
447950
|
});
|
|
447914
|
-
import { existsSync as
|
|
447951
|
+
import { existsSync as existsSync49 } from "fs";
|
|
447915
447952
|
import { readFile as readFile20 } from "fs/promises";
|
|
447916
447953
|
import { join as join54 } from "path";
|
|
447917
447954
|
var DEFAULT_CONTEXT_WINDOW2 = 200000, ContextManager;
|
|
@@ -448195,7 +448232,16 @@ var init_manager6 = __esm(() => {
|
|
|
448195
448232
|
} else {
|
|
448196
448233
|
semanticTask = this.repoMap.detectPersistedSemanticMode().then((persisted) => this.setSemanticSummaries(persisted === "off" ? "ast" : persisted));
|
|
448197
448234
|
}
|
|
448198
|
-
|
|
448235
|
+
try {
|
|
448236
|
+
await Promise.all([semanticTask, this.warmRepoMapCache()]);
|
|
448237
|
+
} catch (e) {
|
|
448238
|
+
logBackgroundError("context-manager", `post-scan semantic/cache task failed: ${e instanceof Error ? e.message : String(e)}`);
|
|
448239
|
+
const store = useRepoMapStore.getState();
|
|
448240
|
+
if (store.semanticProgress.includes("waiting for soul map")) {
|
|
448241
|
+
store.setSemanticStatus("off");
|
|
448242
|
+
store.setSemanticProgress("");
|
|
448243
|
+
}
|
|
448244
|
+
}
|
|
448199
448245
|
} else {
|
|
448200
448246
|
this.repoMapReady = false;
|
|
448201
448247
|
this.syncRepoMapStore("error");
|
|
@@ -449077,7 +449123,7 @@ ${skillBlocks}
|
|
|
449077
449123
|
const memoryMarkers = memoryMarkersForPaths(changed.slice(0, 15));
|
|
449078
449124
|
for (const file2 of changed.slice(0, 15)) {
|
|
449079
449125
|
const absPath = join54(this.cwd, file2);
|
|
449080
|
-
const fileExists =
|
|
449126
|
+
const fileExists = existsSync49(absPath);
|
|
449081
449127
|
const block = this.soulMapDiffBlocks.get(file2);
|
|
449082
449128
|
const provenance = this.classifyDeltaFile(absPath, file2, memoryMarkers.get(file2));
|
|
449083
449129
|
if (!fileExists) {
|
|
@@ -449116,7 +449162,7 @@ ${skillBlocks}
|
|
|
449116
449162
|
tags.push("[mentioned]");
|
|
449117
449163
|
if (this.editorFile === absPath)
|
|
449118
449164
|
tags.push("[open]");
|
|
449119
|
-
if (this.soulMapNewFilesEmitted.has(rel) &&
|
|
449165
|
+
if (this.soulMapNewFilesEmitted.has(rel) && existsSync49(absPath)) {
|
|
449120
449166
|
tags.push("[modified-since-new]");
|
|
449121
449167
|
}
|
|
449122
449168
|
const failure = this.recentToolFailures.find((f) => f.target === absPath || f.target === rel);
|
|
@@ -466647,7 +466693,7 @@ var init_output = __esm(() => {
|
|
|
466647
466693
|
});
|
|
466648
466694
|
|
|
466649
466695
|
// src/headless/run.ts
|
|
466650
|
-
import { existsSync as
|
|
466696
|
+
import { existsSync as existsSync50, readFileSync as readFileSync26 } from "fs";
|
|
466651
466697
|
import { resolve as resolve41 } from "path";
|
|
466652
466698
|
function reraiseOrExit(code) {
|
|
466653
466699
|
if (code === EXIT_ABORT) {
|
|
@@ -466994,7 +467040,7 @@ async function runPrompt(opts, merged) {
|
|
|
466994
467040
|
const fileParts = [];
|
|
466995
467041
|
for (const file2 of opts.include) {
|
|
466996
467042
|
const fullPath = resolve41(env.cwd, file2);
|
|
466997
|
-
if (!
|
|
467043
|
+
if (!existsSync50(fullPath)) {
|
|
466998
467044
|
stderrWarn(`--include file not found: ${file2}`);
|
|
466999
467045
|
continue;
|
|
467000
467046
|
}
|
|
@@ -467739,7 +467785,7 @@ var init_workspace = __esm(() => {
|
|
|
467739
467785
|
import {
|
|
467740
467786
|
appendFileSync as appendFileSync4,
|
|
467741
467787
|
chmodSync as chmodSync5,
|
|
467742
|
-
existsSync as
|
|
467788
|
+
existsSync as existsSync51,
|
|
467743
467789
|
mkdirSync as mkdirSync24,
|
|
467744
467790
|
readFileSync as readFileSync27,
|
|
467745
467791
|
unlinkSync as unlinkSync11,
|
|
@@ -467863,7 +467909,7 @@ class HearthDaemon {
|
|
|
467863
467909
|
await new Promise((res) => this.socketServer?.close(() => res()));
|
|
467864
467910
|
this.socketServer = null;
|
|
467865
467911
|
}
|
|
467866
|
-
if (
|
|
467912
|
+
if (existsSync51(this.config.daemon.socketPath)) {
|
|
467867
467913
|
try {
|
|
467868
467914
|
unlinkSync11(this.config.daemon.socketPath);
|
|
467869
467915
|
} catch (e) {
|
|
@@ -468004,7 +468050,7 @@ class HearthDaemon {
|
|
|
468004
468050
|
async startSocket() {
|
|
468005
468051
|
const path = this.config.daemon.socketPath;
|
|
468006
468052
|
mkdirSync24(dirname23(path), { recursive: true, mode: 448 });
|
|
468007
|
-
if (
|
|
468053
|
+
if (existsSync51(path)) {
|
|
468008
468054
|
try {
|
|
468009
468055
|
unlinkSync11(path);
|
|
468010
468056
|
} catch (e) {
|
|
@@ -468877,7 +468923,7 @@ class HearthDaemon {
|
|
|
468877
468923
|
}
|
|
468878
468924
|
restoreWorkspaces() {
|
|
468879
468925
|
const stateFile = this.config.daemon.stateFile;
|
|
468880
|
-
if (!
|
|
468926
|
+
if (!existsSync51(stateFile))
|
|
468881
468927
|
return;
|
|
468882
468928
|
try {
|
|
468883
468929
|
const parsed = JSON.parse(readFileSync27(stateFile, "utf-8"));
|
|
@@ -468930,7 +468976,7 @@ function createFileLogger(logPath) {
|
|
|
468930
468976
|
return () => {};
|
|
468931
468977
|
try {
|
|
468932
468978
|
const dir = dirname23(logPath);
|
|
468933
|
-
if (!
|
|
468979
|
+
if (!existsSync51(dir))
|
|
468934
468980
|
mkdirSync24(dir, { recursive: true });
|
|
468935
468981
|
} catch {}
|
|
468936
468982
|
return (line2) => {
|
|
@@ -468959,7 +469005,7 @@ __export(exports_cli, {
|
|
|
468959
469005
|
runHearthCli: () => runHearthCli,
|
|
468960
469006
|
parseHearthArgs: () => parseHearthArgs
|
|
468961
469007
|
});
|
|
468962
|
-
import { existsSync as
|
|
469008
|
+
import { existsSync as existsSync52 } from "fs";
|
|
468963
469009
|
function parseHearthArgs(argv) {
|
|
468964
469010
|
const [sub, ...rest] = argv;
|
|
468965
469011
|
if (!sub || sub === "help" || sub === "--help" || sub === "-h")
|
|
@@ -469064,7 +469110,7 @@ async function runStart(detach) {
|
|
|
469064
469110
|
async function runStop() {
|
|
469065
469111
|
const config2 = loadHearthConfig();
|
|
469066
469112
|
const sock = config2.daemon.socketPath;
|
|
469067
|
-
if (!
|
|
469113
|
+
if (!existsSync52(sock)) {
|
|
469068
469114
|
process.stderr.write(`daemon not running
|
|
469069
469115
|
`);
|
|
469070
469116
|
return 1;
|
|
@@ -469185,7 +469231,7 @@ async function runDoctor() {
|
|
|
469185
469231
|
lines.push(` chats: ${String(chats)} paired`);
|
|
469186
469232
|
}
|
|
469187
469233
|
lines.push("");
|
|
469188
|
-
lines.push(`daemon: ${
|
|
469234
|
+
lines.push(`daemon: ${existsSync52(config2.daemon.socketPath) ? "socket present" : "socket absent"}`);
|
|
469189
469235
|
const testToken = `bot123456:ABC-${"x".repeat(40)}`;
|
|
469190
469236
|
const { redact: redact2 } = await Promise.resolve().then(() => (init_redact(), exports_redact));
|
|
469191
469237
|
const scrubbed = redact2(testToken);
|
|
@@ -469198,7 +469244,7 @@ async function runDoctor() {
|
|
|
469198
469244
|
async function runLogs(follow) {
|
|
469199
469245
|
const config2 = loadHearthConfig();
|
|
469200
469246
|
const path = config2.daemon.logFile;
|
|
469201
|
-
if (!
|
|
469247
|
+
if (!existsSync52(path)) {
|
|
469202
469248
|
process.stderr.write(`log file missing: ${path}
|
|
469203
469249
|
`);
|
|
469204
469250
|
return 1;
|
|
@@ -469244,7 +469290,7 @@ var init_cli = __esm(() => {
|
|
|
469244
469290
|
|
|
469245
469291
|
// src/hearth/approve-cli.ts
|
|
469246
469292
|
var exports_approve_cli = {};
|
|
469247
|
-
import { existsSync as
|
|
469293
|
+
import { existsSync as existsSync53, readFileSync as readFileSync28 } from "fs";
|
|
469248
469294
|
import { join as join55, resolve as resolvePath } from "path";
|
|
469249
469295
|
function expandHome3(p2) {
|
|
469250
469296
|
return expandHome(p2);
|
|
@@ -469275,7 +469321,7 @@ function loadExtraDenylist(cwd2) {
|
|
|
469275
469321
|
const paths = [join55(configDir(), "hearth.json"), join55(cwd2, ".soulforge", "hearth.json")];
|
|
469276
469322
|
const extras = new Set;
|
|
469277
469323
|
for (const p2 of paths) {
|
|
469278
|
-
if (!
|
|
469324
|
+
if (!existsSync53(p2))
|
|
469279
469325
|
continue;
|
|
469280
469326
|
try {
|
|
469281
469327
|
const parsed = JSON.parse(readFileSync28(p2, "utf-8"));
|
|
@@ -469397,7 +469443,7 @@ async function runDenyRead(hook) {
|
|
|
469397
469443
|
}
|
|
469398
469444
|
async function runHealth() {
|
|
469399
469445
|
const sock = getSocketPath();
|
|
469400
|
-
if (!
|
|
469446
|
+
if (!existsSync53(sock)) {
|
|
469401
469447
|
process.stderr.write(`socket missing: ${sock}
|
|
469402
469448
|
`);
|
|
469403
469449
|
return 1;
|
|
@@ -469833,7 +469879,7 @@ var init_headless = __esm(() => {
|
|
|
469833
469879
|
});
|
|
469834
469880
|
|
|
469835
469881
|
// src/core/presets/registry.ts
|
|
469836
|
-
import { existsSync as
|
|
469882
|
+
import { existsSync as existsSync54, mkdirSync as mkdirSync25, readFileSync as readFileSync29, statSync as statSync11, writeFileSync as writeFileSync21 } from "fs";
|
|
469837
469883
|
import { join as join56 } from "path";
|
|
469838
469884
|
function getCacheDirInternal() {
|
|
469839
469885
|
return join56(configDir(), "presets");
|
|
@@ -469843,12 +469889,12 @@ function getRegistryCacheFile() {
|
|
|
469843
469889
|
}
|
|
469844
469890
|
function ensureCacheDir() {
|
|
469845
469891
|
const dir = getCacheDirInternal();
|
|
469846
|
-
if (!
|
|
469892
|
+
if (!existsSync54(dir))
|
|
469847
469893
|
mkdirSync25(dir, { recursive: true, mode: 448 });
|
|
469848
469894
|
}
|
|
469849
469895
|
function readCachedRegistry() {
|
|
469850
469896
|
const file2 = getRegistryCacheFile();
|
|
469851
|
-
if (!
|
|
469897
|
+
if (!existsSync54(file2))
|
|
469852
469898
|
return null;
|
|
469853
469899
|
try {
|
|
469854
469900
|
return JSON.parse(readFileSync29(file2, "utf-8"));
|
|
@@ -469858,7 +469904,7 @@ function readCachedRegistry() {
|
|
|
469858
469904
|
}
|
|
469859
469905
|
function cacheAge() {
|
|
469860
469906
|
const file2 = getRegistryCacheFile();
|
|
469861
|
-
if (!
|
|
469907
|
+
if (!existsSync54(file2))
|
|
469862
469908
|
return Number.POSITIVE_INFINITY;
|
|
469863
469909
|
try {
|
|
469864
469910
|
return Date.now() - statSync11(file2).mtimeMs;
|
|
@@ -469922,7 +469968,7 @@ var init_registry2 = __esm(() => {
|
|
|
469922
469968
|
});
|
|
469923
469969
|
|
|
469924
469970
|
// src/core/presets/loader.ts
|
|
469925
|
-
import { existsSync as
|
|
469971
|
+
import { existsSync as existsSync55, lstatSync as lstatSync2, readFileSync as readFileSync30, writeFileSync as writeFileSync22 } from "fs";
|
|
469926
469972
|
import { isAbsolute as isAbsolute2, join as join57, resolve as resolve42 } from "path";
|
|
469927
469973
|
function isUrl3(s2) {
|
|
469928
469974
|
return /^https?:\/\//i.test(s2);
|
|
@@ -469988,7 +470034,7 @@ async function fetchPresetFromUrl(url2) {
|
|
|
469988
470034
|
function resolveLocalPath(spec3) {
|
|
469989
470035
|
const expanded = expandHome(spec3);
|
|
469990
470036
|
const abs = resolve42(expanded);
|
|
469991
|
-
if (!
|
|
470037
|
+
if (!existsSync55(abs))
|
|
469992
470038
|
throw new Error(`Preset file not found: ${abs}`);
|
|
469993
470039
|
const stat5 = lstatSync2(abs);
|
|
469994
470040
|
if (stat5.isSymbolicLink()) {
|
|
@@ -470112,7 +470158,7 @@ var init_merge2 = __esm(() => {
|
|
|
470112
470158
|
});
|
|
470113
470159
|
|
|
470114
470160
|
// src/core/presets/init.ts
|
|
470115
|
-
import { existsSync as
|
|
470161
|
+
import { existsSync as existsSync56, readFileSync as readFileSync31 } from "fs";
|
|
470116
470162
|
import { join as join58 } from "path";
|
|
470117
470163
|
function getGlobalConfigFile() {
|
|
470118
470164
|
return join58(configDir(), "config.json");
|
|
@@ -470123,7 +470169,7 @@ function isValidPresetSpec(spec3) {
|
|
|
470123
470169
|
return VALID_SPEC.test(spec3);
|
|
470124
470170
|
}
|
|
470125
470171
|
function readPresetSpecs(file2) {
|
|
470126
|
-
if (!
|
|
470172
|
+
if (!existsSync56(file2))
|
|
470127
470173
|
return [];
|
|
470128
470174
|
try {
|
|
470129
470175
|
const cfg = JSON.parse(readFileSync31(file2, "utf-8"));
|
|
@@ -470222,7 +470268,7 @@ var init_init = __esm(() => {
|
|
|
470222
470268
|
});
|
|
470223
470269
|
|
|
470224
470270
|
// src/core/presets/persist.ts
|
|
470225
|
-
import { existsSync as
|
|
470271
|
+
import { existsSync as existsSync57, mkdirSync as mkdirSync26, readFileSync as readFileSync32, writeFileSync as writeFileSync23 } from "fs";
|
|
470226
470272
|
import { join as join59 } from "path";
|
|
470227
470273
|
function getGlobalDir() {
|
|
470228
470274
|
return configDir();
|
|
@@ -470233,7 +470279,7 @@ function getGlobalFile() {
|
|
|
470233
470279
|
function resolveScopeFile(scope, cwd2) {
|
|
470234
470280
|
if (scope === "global") {
|
|
470235
470281
|
const dir2 = getGlobalDir();
|
|
470236
|
-
if (!
|
|
470282
|
+
if (!existsSync57(dir2))
|
|
470237
470283
|
mkdirSync26(dir2, { recursive: true, mode: 448 });
|
|
470238
470284
|
return getGlobalFile();
|
|
470239
470285
|
}
|
|
@@ -470241,7 +470287,7 @@ function resolveScopeFile(scope, cwd2) {
|
|
|
470241
470287
|
return join59(dir, "config.json");
|
|
470242
470288
|
}
|
|
470243
470289
|
function readJsonObject(file2) {
|
|
470244
|
-
if (!
|
|
470290
|
+
if (!existsSync57(file2))
|
|
470245
470291
|
return {};
|
|
470246
470292
|
try {
|
|
470247
470293
|
const parsed = JSON.parse(readFileSync32(file2, "utf-8"));
|
|
@@ -470283,7 +470329,7 @@ function removePresets(scope, specs, cwd2 = process.cwd()) {
|
|
|
470283
470329
|
} else {
|
|
470284
470330
|
existing.presets = filtered;
|
|
470285
470331
|
}
|
|
470286
|
-
if (
|
|
470332
|
+
if (existsSync57(file2)) {
|
|
470287
470333
|
writeFileSync23(file2, JSON.stringify(existing, null, 2));
|
|
470288
470334
|
}
|
|
470289
470335
|
return { file: file2, before: current, after: filtered };
|
|
@@ -478051,14 +478097,18 @@ Proceeding without it will significantly reduce capabilities \u2014 no soul tool
|
|
|
478051
478097
|
stallAbortedAt = Date.now();
|
|
478052
478098
|
abortController.abort();
|
|
478053
478099
|
}, 1e4);
|
|
478054
|
-
let streamEventCount = 0;
|
|
478055
478100
|
let yieldBeforeNext = false;
|
|
478101
|
+
let lastYieldTs = Date.now();
|
|
478102
|
+
const YIELD_BUDGET_MS = 8;
|
|
478103
|
+
const hearthBridgeMod = await Promise.resolve().then(() => (init_bridge(), exports_bridge));
|
|
478104
|
+
const hearthLive = hearthBridgeMod.hearthBridge.listBindings().some((b5) => b5.tabId === tabId);
|
|
478056
478105
|
const streamIterator = result.fullStream[Symbol.asyncIterator]();
|
|
478057
478106
|
for await (const part of { [Symbol.asyncIterator]: () => streamIterator }) {
|
|
478058
478107
|
markActivity();
|
|
478059
|
-
if (yieldBeforeNext ||
|
|
478108
|
+
if (yieldBeforeNext || Date.now() - lastYieldTs >= YIELD_BUDGET_MS) {
|
|
478060
478109
|
yieldBeforeNext = false;
|
|
478061
|
-
|
|
478110
|
+
lastYieldTs = Date.now();
|
|
478111
|
+
await Promise.resolve();
|
|
478062
478112
|
}
|
|
478063
478113
|
switch (part.type) {
|
|
478064
478114
|
case "start-step": {
|
|
@@ -478080,9 +478130,8 @@ Proceeding without it will significantly reduce capabilities \u2014 no soul tool
|
|
|
478080
478130
|
case "reasoning-delta": {
|
|
478081
478131
|
gotFirstContent = true;
|
|
478082
478132
|
appendReasoningContent(part.text);
|
|
478083
|
-
|
|
478084
|
-
|
|
478085
|
-
});
|
|
478133
|
+
if (hearthLive)
|
|
478134
|
+
hearthBridgeMod.reasoningStreamEmitter.append(tabId, part.text);
|
|
478086
478135
|
break;
|
|
478087
478136
|
}
|
|
478088
478137
|
case "reasoning-end":
|
|
@@ -478091,9 +478140,11 @@ Proceeding without it will significantly reduce capabilities \u2014 no soul tool
|
|
|
478091
478140
|
case "text-delta": {
|
|
478092
478141
|
gotFirstContent = true;
|
|
478093
478142
|
appendText(part.text);
|
|
478094
|
-
|
|
478095
|
-
|
|
478096
|
-
|
|
478143
|
+
if (hearthLive)
|
|
478144
|
+
hearthBridgeMod.bridgeStreamEmitter.stream(tabId, {
|
|
478145
|
+
type: "text",
|
|
478146
|
+
content: part.text
|
|
478147
|
+
});
|
|
478097
478148
|
queueMicrotaskFlush();
|
|
478098
478149
|
break;
|
|
478099
478150
|
}
|
|
@@ -480299,7 +480350,7 @@ var init_ImageDisplay = __esm(() => {
|
|
|
480299
480350
|
});
|
|
480300
480351
|
|
|
480301
480352
|
// src/core/utils/syntax.ts
|
|
480302
|
-
import { existsSync as
|
|
480353
|
+
import { existsSync as existsSync58, readdirSync as readdirSync12 } from "fs";
|
|
480303
480354
|
import { dirname as dirname24, join as join61, resolve as resolve43 } from "path";
|
|
480304
480355
|
import {
|
|
480305
480356
|
addDefaultParsers,
|
|
@@ -480322,8 +480373,8 @@ function discoverParsers() {
|
|
|
480322
480373
|
continue;
|
|
480323
480374
|
const highlights = resolve43(langDir, "highlights.scm");
|
|
480324
480375
|
const injections = resolve43(langDir, "injections.scm");
|
|
480325
|
-
const hasHighlights =
|
|
480326
|
-
const hasInjections =
|
|
480376
|
+
const hasHighlights = existsSync58(highlights);
|
|
480377
|
+
const hasInjections = existsSync58(injections);
|
|
480327
480378
|
if (!hasHighlights)
|
|
480328
480379
|
continue;
|
|
480329
480380
|
const parser = {
|
|
@@ -480372,14 +480423,14 @@ var init_syntax = __esm(() => {
|
|
|
480372
480423
|
if (IS_COMPILED3) {
|
|
480373
480424
|
coreAssetsDir = bundledAssets;
|
|
480374
480425
|
} else if (IS_DIST3) {
|
|
480375
|
-
coreAssetsDir =
|
|
480426
|
+
coreAssetsDir = existsSync58(distAssets) ? distAssets : bundledAssets;
|
|
480376
480427
|
} else {
|
|
480377
480428
|
try {
|
|
480378
480429
|
coreAssetsDir = resolve43(dirname24(__require.resolve("@opentui/core")), "assets");
|
|
480379
480430
|
} catch {
|
|
480380
480431
|
coreAssetsDir = bundledAssets;
|
|
480381
480432
|
}
|
|
480382
|
-
if (!
|
|
480433
|
+
if (!existsSync58(coreAssetsDir))
|
|
480383
480434
|
coreAssetsDir = bundledAssets;
|
|
480384
480435
|
}
|
|
480385
480436
|
MARKDOWN_INJECTION_MAP = {
|
|
@@ -480414,13 +480465,13 @@ var init_syntax = __esm(() => {
|
|
|
480414
480465
|
addDefaultParsers(discoverParsers());
|
|
480415
480466
|
if (IS_COMPILED3) {
|
|
480416
480467
|
const worker = join61(dataDir(), "opentui-assets", "parser.worker.js");
|
|
480417
|
-
if (!process.env.OTUI_TREE_SITTER_WORKER_PATH &&
|
|
480468
|
+
if (!process.env.OTUI_TREE_SITTER_WORKER_PATH && existsSync58(worker)) {
|
|
480418
480469
|
process.env.OTUI_TREE_SITTER_WORKER_PATH = worker;
|
|
480419
480470
|
}
|
|
480420
480471
|
} else if (IS_DIST3) {
|
|
480421
480472
|
try {
|
|
480422
480473
|
const coreWorker = resolve43(dirname24(__require.resolve("@opentui/core")), "parser.worker.js");
|
|
480423
|
-
if (
|
|
480474
|
+
if (existsSync58(coreWorker)) {
|
|
480424
480475
|
process.env.OTUI_TREE_SITTER_WORKER_PATH = coreWorker;
|
|
480425
480476
|
}
|
|
480426
480477
|
} catch {}
|
|
@@ -486030,6 +486081,7 @@ var init_MessageList = __esm(() => {
|
|
|
486030
486081
|
const hasContent = msg.content.trim().length > 0;
|
|
486031
486082
|
const hasTools = msg.toolCalls && msg.toolCalls.length > 0;
|
|
486032
486083
|
const isEmpty = !hasSegments && !hasContent && !hasTools;
|
|
486084
|
+
const onlyHiddenReasoning = !isEmpty && !hasContent && !hasTools && !showReasoning && !!msg.segments?.length && msg.segments.every((s2) => s2.type === "reasoning");
|
|
486033
486085
|
const finalResponseSeed = import_react58.useMemo(() => {
|
|
486034
486086
|
let h3 = 0;
|
|
486035
486087
|
for (let i4 = 0;i4 < msg.id.length; i4++)
|
|
@@ -486154,6 +486206,10 @@ var init_MessageList = __esm(() => {
|
|
|
486154
486206
|
fg: t.textMuted,
|
|
486155
486207
|
attributes: TextAttributes9.ITALIC,
|
|
486156
486208
|
children: "Empty response \u2014 model returned no content."
|
|
486209
|
+
}, undefined, false, undefined, this) : onlyHiddenReasoning ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
486210
|
+
fg: t.textMuted,
|
|
486211
|
+
attributes: TextAttributes9.ITALIC,
|
|
486212
|
+
children: "Thinking\u2026 (reasoning hidden)"
|
|
486157
486213
|
}, undefined, false, undefined, this) : autoLayout ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(import_jsx_dev_runtime2.Fragment, {
|
|
486158
486214
|
children: [
|
|
486159
486215
|
autoLayout.opening ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
|
|
@@ -486668,6 +486724,7 @@ var init_useTextDrip = __esm(() => {
|
|
|
486668
486724
|
});
|
|
486669
486725
|
|
|
486670
486726
|
// src/components/chat/StreamSegmentList.tsx
|
|
486727
|
+
import { TextAttributes as TextAttributes10 } from "@opentui/core";
|
|
486671
486728
|
function trimToCompleteLines(text3) {
|
|
486672
486729
|
return text3;
|
|
486673
486730
|
}
|
|
@@ -486687,6 +486744,7 @@ function DripText({ content, streaming }) {
|
|
|
486687
486744
|
}
|
|
486688
486745
|
var import_react61, StreamSegmentList;
|
|
486689
486746
|
var init_StreamSegmentList = __esm(() => {
|
|
486747
|
+
init_store();
|
|
486690
486748
|
init_Markdown();
|
|
486691
486749
|
init_ReasoningBlock();
|
|
486692
486750
|
init_ToolCallDisplay();
|
|
@@ -486702,6 +486760,7 @@ var init_StreamSegmentList = __esm(() => {
|
|
|
486702
486760
|
showReasoning = true,
|
|
486703
486761
|
reasoningExpanded = false
|
|
486704
486762
|
}) {
|
|
486763
|
+
const t = useTheme();
|
|
486705
486764
|
const toolCallMap = import_react61.useMemo(() => {
|
|
486706
486765
|
const m5 = new Map;
|
|
486707
486766
|
for (const tc of toolCalls)
|
|
@@ -486761,71 +486820,79 @@ var init_StreamSegmentList = __esm(() => {
|
|
|
486761
486820
|
}
|
|
486762
486821
|
return -1;
|
|
486763
486822
|
}, [merged, streaming]);
|
|
486823
|
+
const hasVisibleContent = merged.some((seg) => seg.type === "reasoning" && showReasoning || seg.type === "text" && seg.content.trim().length > 0 || seg.type === "tools");
|
|
486764
486824
|
let lastVisibleType = null;
|
|
486765
486825
|
return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(import_jsx_dev_runtime2.Fragment, {
|
|
486766
|
-
children:
|
|
486767
|
-
|
|
486768
|
-
|
|
486769
|
-
|
|
486770
|
-
|
|
486771
|
-
|
|
486772
|
-
|
|
486773
|
-
|
|
486774
|
-
if (display.length === 0)
|
|
486826
|
+
children: [
|
|
486827
|
+
streaming && !hasVisibleContent ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
486828
|
+
fg: t.textMuted,
|
|
486829
|
+
attributes: TextAttributes10.ITALIC,
|
|
486830
|
+
children: "Thinking\u2026"
|
|
486831
|
+
}, undefined, false, undefined, this) : null,
|
|
486832
|
+
merged.map((seg, i4) => {
|
|
486833
|
+
if (seg.type === "reasoning" && !showReasoning)
|
|
486775
486834
|
return null;
|
|
486776
|
-
|
|
486835
|
+
const needsGap = lastVisibleType !== null && lastVisibleType !== seg.type ? 1 : 0;
|
|
486836
|
+
if (seg.type === "text") {
|
|
486837
|
+
lastVisibleType = seg.type;
|
|
486838
|
+
const isActiveSegment = i4 === lastTextIndex;
|
|
486839
|
+
const display = trimToCompleteLines(seg.content);
|
|
486840
|
+
if (display.length === 0)
|
|
486841
|
+
return null;
|
|
486842
|
+
if (isActiveSegment) {
|
|
486843
|
+
return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
|
|
486844
|
+
flexDirection: "column",
|
|
486845
|
+
marginTop: needsGap,
|
|
486846
|
+
children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(DripText, {
|
|
486847
|
+
content: display,
|
|
486848
|
+
streaming
|
|
486849
|
+
}, undefined, false, undefined, this)
|
|
486850
|
+
}, `text-${String(i4)}`, false, undefined, this);
|
|
486851
|
+
}
|
|
486777
486852
|
return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
|
|
486778
486853
|
flexDirection: "column",
|
|
486779
486854
|
marginTop: needsGap,
|
|
486780
|
-
children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(
|
|
486781
|
-
|
|
486782
|
-
streaming
|
|
486855
|
+
children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(Markdown, {
|
|
486856
|
+
text: display,
|
|
486857
|
+
streaming: true
|
|
486783
486858
|
}, undefined, false, undefined, this)
|
|
486784
486859
|
}, `text-${String(i4)}`, false, undefined, this);
|
|
486785
486860
|
}
|
|
486786
|
-
|
|
486787
|
-
|
|
486788
|
-
|
|
486789
|
-
|
|
486790
|
-
|
|
486791
|
-
|
|
486792
|
-
|
|
486793
|
-
|
|
486794
|
-
|
|
486795
|
-
|
|
486861
|
+
if (seg.type === "reasoning") {
|
|
486862
|
+
lastVisibleType = seg.type;
|
|
486863
|
+
const rkey = `${seg.id}-${reasoningExpanded ? "exp" : "col"}`;
|
|
486864
|
+
return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
|
|
486865
|
+
flexDirection: "column",
|
|
486866
|
+
marginTop: needsGap,
|
|
486867
|
+
children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(ReasoningBlock, {
|
|
486868
|
+
content: seg.content,
|
|
486869
|
+
expanded: reasoningExpanded,
|
|
486870
|
+
isStreaming: !seg.done,
|
|
486871
|
+
id: seg.id
|
|
486872
|
+
}, undefined, false, undefined, this)
|
|
486873
|
+
}, rkey, false, undefined, this);
|
|
486874
|
+
}
|
|
486875
|
+
const calls = seg.callIds.map((id) => toolCallMap.get(id)).filter((tc) => tc != null);
|
|
486876
|
+
if (calls.length === 0)
|
|
486877
|
+
return null;
|
|
486796
486878
|
lastVisibleType = seg.type;
|
|
486797
|
-
const rkey = `${seg.id}-${reasoningExpanded ? "exp" : "col"}`;
|
|
486798
486879
|
return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
|
|
486799
|
-
flexDirection: "column",
|
|
486800
486880
|
marginTop: needsGap,
|
|
486801
|
-
children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(
|
|
486802
|
-
|
|
486803
|
-
|
|
486804
|
-
|
|
486805
|
-
|
|
486881
|
+
children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(ToolCallDisplay, {
|
|
486882
|
+
calls,
|
|
486883
|
+
allCalls: toolCalls,
|
|
486884
|
+
verbose,
|
|
486885
|
+
diffStyle
|
|
486806
486886
|
}, undefined, false, undefined, this)
|
|
486807
|
-
},
|
|
486808
|
-
}
|
|
486809
|
-
|
|
486810
|
-
|
|
486811
|
-
return null;
|
|
486812
|
-
lastVisibleType = seg.type;
|
|
486813
|
-
return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
|
|
486814
|
-
marginTop: needsGap,
|
|
486815
|
-
children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(ToolCallDisplay, {
|
|
486816
|
-
calls,
|
|
486817
|
-
allCalls: toolCalls,
|
|
486818
|
-
verbose,
|
|
486819
|
-
diffStyle
|
|
486820
|
-
}, undefined, false, undefined, this)
|
|
486821
|
-
}, seg.callIds[0], false, undefined, this);
|
|
486822
|
-
})
|
|
486823
|
-
}, undefined, false, undefined, this);
|
|
486887
|
+
}, seg.callIds[0], false, undefined, this);
|
|
486888
|
+
})
|
|
486889
|
+
]
|
|
486890
|
+
}, undefined, true, undefined, this);
|
|
486824
486891
|
});
|
|
486825
486892
|
});
|
|
486826
486893
|
|
|
486827
486894
|
// src/components/chat/FinalResponseView.tsx
|
|
486828
|
-
import { TextAttributes as
|
|
486895
|
+
import { TextAttributes as TextAttributes11 } from "@opentui/core";
|
|
486829
486896
|
function filterQuietTools(name39) {
|
|
486830
486897
|
return !QUIET_TOOLS2.has(name39);
|
|
486831
486898
|
}
|
|
@@ -486902,6 +486969,7 @@ var init_FinalResponseView = __esm(() => {
|
|
|
486902
486969
|
init_useHover();
|
|
486903
486970
|
init_shared();
|
|
486904
486971
|
init_ImageDisplay();
|
|
486972
|
+
init_ReasoningBlock();
|
|
486905
486973
|
init_StreamSegmentList();
|
|
486906
486974
|
init_ToolCallDisplay();
|
|
486907
486975
|
init_tool_formatters();
|
|
@@ -487014,7 +487082,7 @@ var init_FinalResponseView = __esm(() => {
|
|
|
487014
487082
|
}, undefined, false, undefined, this),
|
|
487015
487083
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
487016
487084
|
fg: effectiveDone ? t.textSecondary : t.textPrimary,
|
|
487017
|
-
attributes: effectiveDone ? undefined :
|
|
487085
|
+
attributes: effectiveDone ? undefined : TextAttributes11.BOLD,
|
|
487018
487086
|
children: statusMsg
|
|
487019
487087
|
}, undefined, false, undefined, this),
|
|
487020
487088
|
effectiveDone ? null : /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(Spinner, {
|
|
@@ -487186,25 +487254,32 @@ var init_FinalResponseView = __esm(() => {
|
|
|
487186
487254
|
liveToolCalls,
|
|
487187
487255
|
loadingStartedAt,
|
|
487188
487256
|
messagesLength,
|
|
487189
|
-
finalResponseCalled
|
|
487257
|
+
finalResponseCalled,
|
|
487258
|
+
showReasoning = true,
|
|
487259
|
+
reasoningExpanded = false
|
|
487190
487260
|
}) {
|
|
487261
|
+
const t = useTheme();
|
|
487191
487262
|
const firstToolsIdx = import_react62.useMemo(() => segments.findIndex((s2) => s2.type === "tools"), [segments]);
|
|
487192
|
-
const
|
|
487193
|
-
|
|
487194
|
-
|
|
487263
|
+
const reasoningSegs = import_react62.useMemo(() => showReasoning ? segments.filter((s2) => s2.type === "reasoning") : [], [segments, showReasoning]);
|
|
487264
|
+
const reasoningNode = reasoningSegs.length > 0 ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
|
|
487265
|
+
flexDirection: "column",
|
|
487266
|
+
children: reasoningSegs.map((seg) => /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(ReasoningBlock, {
|
|
487267
|
+
content: seg.content,
|
|
487268
|
+
expanded: reasoningExpanded,
|
|
487269
|
+
isStreaming: !seg.done,
|
|
487270
|
+
id: seg.id
|
|
487271
|
+
}, seg.id, false, undefined, this))
|
|
487272
|
+
}, undefined, false, undefined, this) : null;
|
|
487273
|
+
const leading = import_react62.useMemo(() => {
|
|
487274
|
+
const end = firstToolsIdx < 0 ? segments.length : firstToolsIdx;
|
|
487195
487275
|
const parts2 = [];
|
|
487196
|
-
for (
|
|
487276
|
+
for (let i4 = 0;i4 < end; i4++) {
|
|
487277
|
+
const seg = segments[i4];
|
|
487197
487278
|
if (seg?.type === "text" && seg.content.length > 0)
|
|
487198
487279
|
parts2.push(seg.content);
|
|
487199
487280
|
}
|
|
487200
487281
|
return parts2.length > 0 ? parts2.join("") : null;
|
|
487201
487282
|
}, [segments, firstToolsIdx]);
|
|
487202
|
-
const opening2 = import_react62.useMemo(() => {
|
|
487203
|
-
if (firstToolsIdx <= 0)
|
|
487204
|
-
return null;
|
|
487205
|
-
const first = segments[0];
|
|
487206
|
-
return first?.type === "text" ? first.content : null;
|
|
487207
|
-
}, [segments, firstToolsIdx]);
|
|
487208
487283
|
const trailingText = import_react62.useMemo(() => {
|
|
487209
487284
|
if (!finalResponseCalled)
|
|
487210
487285
|
return null;
|
|
@@ -487258,24 +487333,24 @@ var init_FinalResponseView = __esm(() => {
|
|
|
487258
487333
|
const hasDispatch = import_react62.useMemo(() => liveToolCalls.some((tc) => SUBAGENT_NAMES.has(tc.toolName)), [liveToolCalls]);
|
|
487259
487334
|
const hasEdits = import_react62.useMemo(() => liveToolCalls.some((tc) => FINAL_RESPONSE_EDIT_TOOLS.has(tc.toolName)), [liveToolCalls]);
|
|
487260
487335
|
const dispatchActive = liveToolCalls.some((tc) => SUBAGENT_NAMES.has(tc.toolName) && tc.state === "running");
|
|
487261
|
-
const allToolsDone = tools.length > 0 && tools.every((
|
|
487336
|
+
const allToolsDone = tools.length > 0 && tools.every((t2) => t2.done);
|
|
487262
487337
|
const pendingNarration = allToolsDone && !dispatchActive && !trailingText;
|
|
487263
|
-
|
|
487264
|
-
|
|
487265
|
-
|
|
487266
|
-
|
|
487267
|
-
|
|
487268
|
-
|
|
487269
|
-
}, undefined, false, undefined, this)
|
|
487338
|
+
const hasVisibleBody = !!reasoningNode || tools.length > 0 || !!leading || !!trailingText;
|
|
487339
|
+
if (!hasVisibleBody) {
|
|
487340
|
+
return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
487341
|
+
fg: t.textMuted,
|
|
487342
|
+
attributes: TextAttributes11.ITALIC,
|
|
487343
|
+
children: "Thinking\u2026"
|
|
487270
487344
|
}, undefined, false, undefined, this);
|
|
487271
487345
|
}
|
|
487272
487346
|
return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
|
|
487273
487347
|
flexDirection: "column",
|
|
487274
487348
|
children: [
|
|
487275
|
-
|
|
487349
|
+
reasoningNode,
|
|
487350
|
+
leading ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
|
|
487276
487351
|
flexDirection: "column",
|
|
487277
487352
|
children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(DripText, {
|
|
487278
|
-
content:
|
|
487353
|
+
content: leading,
|
|
487279
487354
|
streaming: true
|
|
487280
487355
|
}, undefined, false, undefined, this)
|
|
487281
487356
|
}, undefined, false, undefined, this) : null,
|
|
@@ -487373,7 +487448,7 @@ var init_tips = __esm(() => {
|
|
|
487373
487448
|
});
|
|
487374
487449
|
|
|
487375
487450
|
// src/components/chat/InputBox.tsx
|
|
487376
|
-
import { decodePasteBytes as decodePasteBytes2, TextAttributes as
|
|
487451
|
+
import { decodePasteBytes as decodePasteBytes2, TextAttributes as TextAttributes12 } from "@opentui/core";
|
|
487377
487452
|
function getCommands() {
|
|
487378
487453
|
return getCommandDefs().filter((c) => !isDefHidden(c)).map((c) => ({ cmd: c.cmd, icon: icon(c.ic), desc: c.desc }));
|
|
487379
487454
|
}
|
|
@@ -487392,6 +487467,7 @@ var init_InputBox = __esm(async () => {
|
|
|
487392
487467
|
init_history();
|
|
487393
487468
|
init_icons();
|
|
487394
487469
|
init_theme();
|
|
487470
|
+
init_errors();
|
|
487395
487471
|
init_ui();
|
|
487396
487472
|
init_clipboard2();
|
|
487397
487473
|
init_image_compress();
|
|
@@ -487428,7 +487504,7 @@ var init_InputBox = __esm(async () => {
|
|
|
487428
487504
|
return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
487429
487505
|
children: spans.map((s2, i4) => /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
487430
487506
|
fg: s2.hl ? t.brandSecondary : t.textPrimary,
|
|
487431
|
-
attributes: s2.hl ?
|
|
487507
|
+
attributes: s2.hl ? TextAttributes12.BOLD : undefined,
|
|
487432
487508
|
children: s2.text
|
|
487433
487509
|
}, i4, false, undefined, this))
|
|
487434
487510
|
}, undefined, false, undefined, this);
|
|
@@ -487760,14 +487836,16 @@ var init_InputBox = __esm(async () => {
|
|
|
487760
487836
|
};
|
|
487761
487837
|
}, [isFocused, renderer2]);
|
|
487762
487838
|
useKeyboard((evt) => {
|
|
487763
|
-
if (isFocused && evt.ctrl && evt.name === "v") {
|
|
487839
|
+
if (isFocused && (evt.ctrl || evt.meta) && evt.name === "v") {
|
|
487764
487840
|
if (imageLoadingRef.current)
|
|
487765
487841
|
return;
|
|
487766
487842
|
imageLoadingRef.current = true;
|
|
487767
487843
|
readClipboardImageAsync().then(async (clipImg) => {
|
|
487768
487844
|
imageLoadingRef.current = false;
|
|
487769
|
-
if (!clipImg)
|
|
487845
|
+
if (!clipImg) {
|
|
487846
|
+
logBackgroundError("clipboard", "No image found on clipboard (or read failed)");
|
|
487770
487847
|
return;
|
|
487848
|
+
}
|
|
487771
487849
|
const ta = textareaRef.current;
|
|
487772
487850
|
if (!ta)
|
|
487773
487851
|
return;
|
|
@@ -487781,8 +487859,9 @@ var init_InputBox = __esm(async () => {
|
|
|
487781
487859
|
});
|
|
487782
487860
|
ta.insertText(`[${label}] `);
|
|
487783
487861
|
syncImageExtmarks(ta);
|
|
487784
|
-
}).catch(() => {
|
|
487862
|
+
}).catch((err2) => {
|
|
487785
487863
|
imageLoadingRef.current = false;
|
|
487864
|
+
logBackgroundError("clipboard", `Image paste failed: ${toErrorMessage(err2)}`);
|
|
487786
487865
|
});
|
|
487787
487866
|
return;
|
|
487788
487867
|
}
|
|
@@ -488028,7 +488107,7 @@ var init_InputBox = __esm(async () => {
|
|
|
488028
488107
|
}, undefined, false, undefined, this),
|
|
488029
488108
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
488030
488109
|
fg: isSelected ? t.info : t.borderSlash,
|
|
488031
|
-
attributes: isSelected ?
|
|
488110
|
+
attributes: isSelected ? TextAttributes12.BOLD : undefined,
|
|
488032
488111
|
children: match2.cmd
|
|
488033
488112
|
}, undefined, false, undefined, this),
|
|
488034
488113
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
@@ -488078,7 +488157,7 @@ var init_InputBox = __esm(async () => {
|
|
|
488078
488157
|
children: [
|
|
488079
488158
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
488080
488159
|
fg: t.warning,
|
|
488081
|
-
attributes:
|
|
488160
|
+
attributes: TextAttributes12.BOLD,
|
|
488082
488161
|
children: [
|
|
488083
488162
|
icon("clock_alt"),
|
|
488084
488163
|
" history"
|
|
@@ -488143,7 +488222,7 @@ var init_InputBox = __esm(async () => {
|
|
|
488143
488222
|
children: [
|
|
488144
488223
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
488145
488224
|
fg: t.warning,
|
|
488146
|
-
attributes:
|
|
488225
|
+
attributes: TextAttributes12.BOLD,
|
|
488147
488226
|
children: "search: "
|
|
488148
488227
|
}, undefined, false, undefined, this),
|
|
488149
488228
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
@@ -488161,7 +488240,7 @@ var init_InputBox = __esm(async () => {
|
|
|
488161
488240
|
children: [
|
|
488162
488241
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
488163
488242
|
fg: t.brandSecondary,
|
|
488164
|
-
attributes:
|
|
488243
|
+
attributes: TextAttributes12.BOLD,
|
|
488165
488244
|
flexShrink: 0,
|
|
488166
488245
|
children: [
|
|
488167
488246
|
">",
|
|
@@ -488186,7 +488265,7 @@ var init_InputBox = __esm(async () => {
|
|
|
488186
488265
|
}, undefined, false, undefined, this),
|
|
488187
488266
|
showBusy && !showAutocomplete ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
488188
488267
|
fg: t.error,
|
|
488189
|
-
attributes:
|
|
488268
|
+
attributes: TextAttributes12.BOLD,
|
|
488190
488269
|
flexShrink: 0,
|
|
488191
488270
|
children: " ^X stop"
|
|
488192
488271
|
}, undefined, false, undefined, this) : ghost ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
@@ -488223,7 +488302,7 @@ var init_InputBox = __esm(async () => {
|
|
|
488223
488302
|
});
|
|
488224
488303
|
|
|
488225
488304
|
// src/components/plan/TaskProgress.tsx
|
|
488226
|
-
import { TextAttributes as
|
|
488305
|
+
import { TextAttributes as TextAttributes13 } from "@opentui/core";
|
|
488227
488306
|
function InlineSpinner({ color }) {
|
|
488228
488307
|
return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(Spinner, {
|
|
488229
488308
|
inline: true,
|
|
@@ -488266,7 +488345,7 @@ function TaskList({ tasks, nested }) {
|
|
|
488266
488345
|
}, undefined, false, undefined, this),
|
|
488267
488346
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
488268
488347
|
fg: task.status === "done" ? theme2.textMuted : task.status === "in-progress" ? theme2.textPrimary : STATUS_COLORS[task.status] ?? theme2.textMuted,
|
|
488269
|
-
attributes: task.status === "in-progress" ?
|
|
488348
|
+
attributes: task.status === "in-progress" ? TextAttributes13.BOLD : undefined,
|
|
488270
488349
|
children: task.title
|
|
488271
488350
|
}, undefined, false, undefined, this)
|
|
488272
488351
|
]
|
|
@@ -488312,7 +488391,7 @@ function TaskList({ tasks, nested }) {
|
|
|
488312
488391
|
children: [
|
|
488313
488392
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
488314
488393
|
fg: theme2.brand,
|
|
488315
|
-
attributes:
|
|
488394
|
+
attributes: TextAttributes13.BOLD,
|
|
488316
488395
|
children: [
|
|
488317
488396
|
icon("plan"),
|
|
488318
488397
|
" Tasks"
|
|
@@ -488388,7 +488467,7 @@ var init_TaskProgress = __esm(() => {
|
|
|
488388
488467
|
});
|
|
488389
488468
|
|
|
488390
488469
|
// src/components/plan/PlanProgress.tsx
|
|
488391
|
-
import { TextAttributes as
|
|
488470
|
+
import { TextAttributes as TextAttributes14 } from "@opentui/core";
|
|
488392
488471
|
function PlanProgress({ plan, tasks }) {
|
|
488393
488472
|
const t = useTheme();
|
|
488394
488473
|
const STATUS_COLORS = {
|
|
@@ -488431,7 +488510,7 @@ function PlanProgress({ plan, tasks }) {
|
|
|
488431
488510
|
children: [
|
|
488432
488511
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
488433
488512
|
fg: allDone ? t.success : t.brandAlt,
|
|
488434
|
-
attributes:
|
|
488513
|
+
attributes: TextAttributes14.BOLD,
|
|
488435
488514
|
children: [
|
|
488436
488515
|
icon("plan"),
|
|
488437
488516
|
" ",
|
|
@@ -488468,7 +488547,7 @@ function PlanProgress({ plan, tasks }) {
|
|
|
488468
488547
|
}, undefined, false, undefined, this),
|
|
488469
488548
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
488470
488549
|
fg: step.status === "active" ? t.textPrimary : STATUS_COLORS[step.status],
|
|
488471
|
-
attributes: step.status === "active" ?
|
|
488550
|
+
attributes: step.status === "active" ? TextAttributes14.BOLD : undefined,
|
|
488472
488551
|
children: step.label
|
|
488473
488552
|
}, undefined, false, undefined, this)
|
|
488474
488553
|
]
|
|
@@ -489190,7 +489269,7 @@ var init_ui2 = __esm(() => {
|
|
|
489190
489269
|
});
|
|
489191
489270
|
|
|
489192
489271
|
// src/components/plan/PlanReviewPrompt.tsx
|
|
489193
|
-
import { TextAttributes as
|
|
489272
|
+
import { TextAttributes as TextAttributes15 } from "@opentui/core";
|
|
489194
489273
|
function PlanReviewPrompt({
|
|
489195
489274
|
onAccept,
|
|
489196
489275
|
onClearAndImplement,
|
|
@@ -489285,7 +489364,7 @@ function PlanReviewPrompt({
|
|
|
489285
489364
|
children: [
|
|
489286
489365
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
489287
489366
|
fg: ACCENT,
|
|
489288
|
-
attributes:
|
|
489367
|
+
attributes: TextAttributes15.BOLD,
|
|
489289
489368
|
children: [
|
|
489290
489369
|
icon("plan"),
|
|
489291
489370
|
" ",
|
|
@@ -489448,7 +489527,7 @@ function PlanReviewPrompt({
|
|
|
489448
489527
|
}, undefined, false, undefined, this),
|
|
489449
489528
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
489450
489529
|
fg: selected ? t.textPrimary : t.textSecondary,
|
|
489451
|
-
attributes: selected ?
|
|
489530
|
+
attributes: selected ? TextAttributes15.BOLD : undefined,
|
|
489452
489531
|
children: [
|
|
489453
489532
|
opt.icon,
|
|
489454
489533
|
" ",
|
|
@@ -489484,7 +489563,7 @@ var init_PlanReviewPrompt = __esm(async () => {
|
|
|
489484
489563
|
});
|
|
489485
489564
|
|
|
489486
489565
|
// src/components/QuestionPrompt.tsx
|
|
489487
|
-
import { TextAttributes as
|
|
489566
|
+
import { TextAttributes as TextAttributes16 } from "@opentui/core";
|
|
489488
489567
|
function OptionRow({
|
|
489489
489568
|
label,
|
|
489490
489569
|
isSelected,
|
|
@@ -489498,7 +489577,7 @@ function OptionRow({
|
|
|
489498
489577
|
}, undefined, false, undefined, this),
|
|
489499
489578
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
489500
489579
|
fg: isSelected ? t.textPrimary : t.textSecondary,
|
|
489501
|
-
attributes: isSelected ?
|
|
489580
|
+
attributes: isSelected ? TextAttributes16.BOLD : undefined,
|
|
489502
489581
|
children: label
|
|
489503
489582
|
}, undefined, false, undefined, this)
|
|
489504
489583
|
]
|
|
@@ -489581,7 +489660,7 @@ function QuestionPrompt({ question, isActive, onAnswer }) {
|
|
|
489581
489660
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
|
|
489582
489661
|
children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
489583
489662
|
fg: t.brand,
|
|
489584
|
-
attributes:
|
|
489663
|
+
attributes: TextAttributes16.BOLD,
|
|
489585
489664
|
children: [
|
|
489586
489665
|
icon("question"),
|
|
489587
489666
|
" Question"
|
|
@@ -489733,7 +489812,7 @@ var init_AnimatedBorder = __esm(() => {
|
|
|
489733
489812
|
});
|
|
489734
489813
|
|
|
489735
489814
|
// src/components/layout/NewFlameLogo.tsx
|
|
489736
|
-
import { fg as fgStyle2, StyledText as StyledText2, TextAttributes as
|
|
489815
|
+
import { fg as fgStyle2, StyledText as StyledText2, TextAttributes as TextAttributes17 } from "@opentui/core";
|
|
489737
489816
|
function heatToCell(h3) {
|
|
489738
489817
|
if (h3 >= 0.9)
|
|
489739
489818
|
return { ch: "#", color: "#fffae8" };
|
|
@@ -490339,12 +490418,12 @@ var init_NewFlameLogo = __esm(() => {
|
|
|
490339
490418
|
"\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D"
|
|
490340
490419
|
];
|
|
490341
490420
|
WM_W = WORDMARK2[0]?.length ?? 0;
|
|
490342
|
-
BOLD12 =
|
|
490421
|
+
BOLD12 = TextAttributes17.BOLD;
|
|
490343
490422
|
WORDMARK_ROWS = WORDMARK2.length;
|
|
490344
490423
|
});
|
|
490345
490424
|
|
|
490346
490425
|
// src/components/layout/LandingPage.tsx
|
|
490347
|
-
import { fg as fgStyle3, StyledText as StyledText3, TextAttributes as
|
|
490426
|
+
import { fg as fgStyle3, StyledText as StyledText3, TextAttributes as TextAttributes18 } from "@opentui/core";
|
|
490348
490427
|
function spawnParticle(cols, rows) {
|
|
490349
490428
|
return {
|
|
490350
490429
|
x: Math.floor(Math.random() * cols),
|
|
@@ -490736,8 +490815,8 @@ var init_LandingPage = __esm(async () => {
|
|
|
490736
490815
|
init_jsx_dev_runtime();
|
|
490737
490816
|
await init_react2();
|
|
490738
490817
|
import_react78 = __toESM(require_react(), 1);
|
|
490739
|
-
BOLD13 =
|
|
490740
|
-
ITALIC4 =
|
|
490818
|
+
BOLD13 = TextAttributes18.BOLD;
|
|
490819
|
+
ITALIC4 = TextAttributes18.ITALIC;
|
|
490741
490820
|
QUIPS = [
|
|
490742
490821
|
"The forge awaits your command.",
|
|
490743
490822
|
"The anvil is warm. What shall we build?",
|
|
@@ -490960,7 +491039,7 @@ var init_LoadingStatus = __esm(() => {
|
|
|
490960
491039
|
});
|
|
490961
491040
|
|
|
490962
491041
|
// src/components/layout/SystemBanner.tsx
|
|
490963
|
-
import { TextAttributes as
|
|
491042
|
+
import { TextAttributes as TextAttributes19 } from "@opentui/core";
|
|
490964
491043
|
function hexToRgb3(hex3) {
|
|
490965
491044
|
const h3 = hex3.replace("#", "");
|
|
490966
491045
|
const n = h3.length === 3 ? h3.split("").map((c) => c + c).join("") : h3;
|
|
@@ -491123,7 +491202,7 @@ function SystemBanner({ messages, expanded = false }) {
|
|
|
491123
491202
|
}, undefined, true, undefined, this),
|
|
491124
491203
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
491125
491204
|
fg: fAccent,
|
|
491126
|
-
attributes:
|
|
491205
|
+
attributes: TextAttributes19.BOLD,
|
|
491127
491206
|
children: err2 ? "Error" : "System"
|
|
491128
491207
|
}, undefined, false, undefined, this),
|
|
491129
491208
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
@@ -491394,7 +491473,7 @@ var init_TerminalList = __esm(() => {
|
|
|
491394
491473
|
// src/components/layout/TabInstance.tsx
|
|
491395
491474
|
import { unlink as unlink3 } from "fs/promises";
|
|
491396
491475
|
import { join as join63 } from "path";
|
|
491397
|
-
import { TextAttributes as
|
|
491476
|
+
import { TextAttributes as TextAttributes20 } from "@opentui/core";
|
|
491398
491477
|
function getScrollbarVisible(tk) {
|
|
491399
491478
|
return {
|
|
491400
491479
|
visible: true,
|
|
@@ -492055,7 +492134,9 @@ var init_TabInstance = __esm(async () => {
|
|
|
492055
492134
|
liveToolCalls: chat.liveToolCalls,
|
|
492056
492135
|
loadingStartedAt: loadingStartedAtRef.current,
|
|
492057
492136
|
messagesLength: chat.messages.length,
|
|
492058
|
-
finalResponseCalled: chat.finalResponseCalled
|
|
492137
|
+
finalResponseCalled: chat.finalResponseCalled,
|
|
492138
|
+
showReasoning,
|
|
492139
|
+
reasoningExpanded
|
|
492059
492140
|
}, undefined, false, undefined, this)
|
|
492060
492141
|
]
|
|
492061
492142
|
}, undefined, true, undefined, this)
|
|
@@ -492075,7 +492156,7 @@ var init_TabInstance = __esm(async () => {
|
|
|
492075
492156
|
flexShrink: 0,
|
|
492076
492157
|
children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
492077
492158
|
fg: t.error,
|
|
492078
|
-
attributes:
|
|
492159
|
+
attributes: TextAttributes20.BOLD,
|
|
492079
492160
|
children: [
|
|
492080
492161
|
icon("stop"),
|
|
492081
492162
|
" ^X to stop"
|
|
@@ -494484,7 +494565,7 @@ var init_CommandPalette = __esm(async () => {
|
|
|
494484
494565
|
});
|
|
494485
494566
|
|
|
494486
494567
|
// src/components/modals/CommandPicker.tsx
|
|
494487
|
-
import { TextAttributes as
|
|
494568
|
+
import { TextAttributes as TextAttributes21 } from "@opentui/core";
|
|
494488
494569
|
function useListScroll(maxVisible) {
|
|
494489
494570
|
const [cursor, setCursor] = import_react102.useState(0);
|
|
494490
494571
|
const [scrollOffset, setScrollOffset] = import_react102.useState(0);
|
|
@@ -494579,7 +494660,7 @@ function OptionRow2({
|
|
|
494579
494660
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
494580
494661
|
bg,
|
|
494581
494662
|
fg: labelFg,
|
|
494582
|
-
attributes: isActive && !isDisabled ?
|
|
494663
|
+
attributes: isActive && !isDisabled ? TextAttributes21.BOLD : undefined,
|
|
494583
494664
|
children: option2.label
|
|
494584
494665
|
}, undefined, false, undefined, this),
|
|
494585
494666
|
isCurrent && !isDisabled && /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
@@ -495636,11 +495717,11 @@ var init_data = __esm(() => {
|
|
|
495636
495717
|
});
|
|
495637
495718
|
|
|
495638
495719
|
// src/components/modals/wizard/theme.ts
|
|
495639
|
-
import { TextAttributes as
|
|
495720
|
+
import { TextAttributes as TextAttributes22 } from "@opentui/core";
|
|
495640
495721
|
var BOLD15, ITALIC5;
|
|
495641
495722
|
var init_theme2 = __esm(() => {
|
|
495642
|
-
BOLD15 =
|
|
495643
|
-
ITALIC5 =
|
|
495723
|
+
BOLD15 = TextAttributes22.BOLD;
|
|
495724
|
+
ITALIC5 = TextAttributes22.ITALIC;
|
|
495644
495725
|
});
|
|
495645
495726
|
|
|
495646
495727
|
// src/components/modals/wizard/primitives.tsx
|
|
@@ -496040,7 +496121,7 @@ var init_RemoteStep = __esm(() => {
|
|
|
496040
496121
|
});
|
|
496041
496122
|
|
|
496042
496123
|
// src/components/modals/wizard/steps/SetupStep.tsx
|
|
496043
|
-
import { decodePasteBytes as decodePasteBytes5, TextAttributes as
|
|
496124
|
+
import { decodePasteBytes as decodePasteBytes5, TextAttributes as TextAttributes23 } from "@opentui/core";
|
|
496044
496125
|
function hasKey(id) {
|
|
496045
496126
|
return getSecretSources(id, getDefaultKeyPriority()).active !== "none";
|
|
496046
496127
|
}
|
|
@@ -496527,7 +496608,7 @@ function SetupStep({
|
|
|
496527
496608
|
href: selectedProvider.url,
|
|
496528
496609
|
children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
496529
496610
|
fg: t.info,
|
|
496530
|
-
attributes:
|
|
496611
|
+
attributes: TextAttributes23.UNDERLINE,
|
|
496531
496612
|
children: selectedProvider.url.replace("https://", "").replace(/\?.*$/, "")
|
|
496532
496613
|
}, undefined, false, undefined, this)
|
|
496533
496614
|
}, undefined, false, undefined, this)
|
|
@@ -496596,7 +496677,7 @@ function SetupStep({
|
|
|
496596
496677
|
href: GATEWAY_REF,
|
|
496597
496678
|
children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
496598
496679
|
fg: t.info,
|
|
496599
|
-
attributes:
|
|
496680
|
+
attributes: TextAttributes23.UNDERLINE,
|
|
496600
496681
|
children: "llmgateway.io"
|
|
496601
496682
|
}, undefined, false, undefined, this)
|
|
496602
496683
|
}, undefined, false, undefined, this),
|
|
@@ -496783,7 +496864,7 @@ var init_ShortcutsStep = __esm(() => {
|
|
|
496783
496864
|
});
|
|
496784
496865
|
|
|
496785
496866
|
// src/components/modals/wizard/steps/ThemeStep.tsx
|
|
496786
|
-
import { TextAttributes as
|
|
496867
|
+
import { TextAttributes as TextAttributes24 } from "@opentui/core";
|
|
496787
496868
|
function opacityToIndex2(opacity) {
|
|
496788
496869
|
const idx = OPACITY_LEVELS2.indexOf(opacity);
|
|
496789
496870
|
return idx >= 0 ? idx : OPACITY_LEVELS2.length - 1;
|
|
@@ -496992,7 +497073,7 @@ function ThemeStep({ iw, setActive }) {
|
|
|
496992
497073
|
isCurrent && /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
496993
497074
|
bg,
|
|
496994
497075
|
fg: t.success,
|
|
496995
|
-
attributes:
|
|
497076
|
+
attributes: TextAttributes24.BOLD,
|
|
496996
497077
|
children: " \u2713"
|
|
496997
497078
|
}, undefined, false, undefined, this)
|
|
496998
497079
|
]
|
|
@@ -498709,7 +498790,7 @@ var init_SessionPicker = __esm(async () => {
|
|
|
498709
498790
|
});
|
|
498710
498791
|
|
|
498711
498792
|
// src/components/modals/StatusDashboard.tsx
|
|
498712
|
-
import { TextAttributes as
|
|
498793
|
+
import { TextAttributes as TextAttributes25 } from "@opentui/core";
|
|
498713
498794
|
function fmtTokens(n) {
|
|
498714
498795
|
if (n >= 1e6)
|
|
498715
498796
|
return `${(n / 1e6).toFixed(1)}M`;
|
|
@@ -498789,7 +498870,7 @@ function StatusDashboard({
|
|
|
498789
498870
|
Promise.resolve().then(() => (init_service(), exports_service))
|
|
498790
498871
|
]);
|
|
498791
498872
|
const cfg = loadHearthConfig2();
|
|
498792
|
-
const { existsSync:
|
|
498873
|
+
const { existsSync: existsSync59 } = await import("fs");
|
|
498793
498874
|
const svc = await getServiceStatus2();
|
|
498794
498875
|
const persistence = {
|
|
498795
498876
|
installed: svc.installed,
|
|
@@ -498797,7 +498878,7 @@ function StatusDashboard({
|
|
|
498797
498878
|
platform: svc.platform,
|
|
498798
498879
|
unitLabel: svc.unitLabel
|
|
498799
498880
|
};
|
|
498800
|
-
if (!
|
|
498881
|
+
if (!existsSync59(cfg.daemon.socketPath)) {
|
|
498801
498882
|
if (!stopped)
|
|
498802
498883
|
setHearth({
|
|
498803
498884
|
running: false,
|
|
@@ -499915,7 +499996,7 @@ var init_StatusDashboard = __esm(async () => {
|
|
|
499915
499996
|
init_jsx_dev_runtime();
|
|
499916
499997
|
await init_react2();
|
|
499917
499998
|
import_react132 = __toESM(require_react(), 1);
|
|
499918
|
-
BOLD16 =
|
|
499999
|
+
BOLD16 = TextAttributes25.BOLD;
|
|
499919
500000
|
TABS = ["Usage", "Prompt", "Cost", "Tabs", "Dispatch", "System"];
|
|
499920
500001
|
});
|
|
499921
500002
|
|
|
@@ -500758,7 +500839,7 @@ var init_UiDemo = __esm(async () => {
|
|
|
500758
500839
|
});
|
|
500759
500840
|
|
|
500760
500841
|
// src/components/modals/UpdateModal.tsx
|
|
500761
|
-
import { TextAttributes as
|
|
500842
|
+
import { TextAttributes as TextAttributes26 } from "@opentui/core";
|
|
500762
500843
|
function trunc(s2, max) {
|
|
500763
500844
|
return s2.length > max ? `${s2.slice(0, max - 1)}\u2026` : s2;
|
|
500764
500845
|
}
|
|
@@ -501563,9 +501644,9 @@ var init_UpdateModal = __esm(async () => {
|
|
|
501563
501644
|
"The record keeper is away from the anvil",
|
|
501564
501645
|
"The changelog embers have gone cold \u2014 GitHub unreachable"
|
|
501565
501646
|
];
|
|
501566
|
-
BOLD17 =
|
|
501567
|
-
ITALIC6 =
|
|
501568
|
-
DIM6 =
|
|
501647
|
+
BOLD17 = TextAttributes26.BOLD;
|
|
501648
|
+
ITALIC6 = TextAttributes26.ITALIC;
|
|
501649
|
+
DIM6 = TextAttributes26.DIM;
|
|
501569
501650
|
TYPE_BADGE = {
|
|
501570
501651
|
feat: { label: "feat", color: "success" },
|
|
501571
501652
|
fix: { label: "fix", color: "brandSecondary" },
|
|
@@ -501820,10 +501901,10 @@ var init_hearth2 = __esm(() => {
|
|
|
501820
501901
|
|
|
501821
501902
|
// src/components/settings/HearthSettings.tsx
|
|
501822
501903
|
import { spawn as spawn21 } from "child_process";
|
|
501823
|
-
import { appendFileSync as appendFileSync5, existsSync as
|
|
501904
|
+
import { appendFileSync as appendFileSync5, existsSync as existsSync59, readFileSync as readFileSync33, statSync as statSync12, watch as watch3 } from "fs";
|
|
501824
501905
|
import { tmpdir as tmpdir6 } from "os";
|
|
501825
501906
|
import { delimiter as delimiter2, dirname as dirname25, join as join64, resolve as resolve45 } from "path";
|
|
501826
|
-
import { decodePasteBytes as decodePasteBytes6, TextAttributes as
|
|
501907
|
+
import { decodePasteBytes as decodePasteBytes6, TextAttributes as TextAttributes27 } from "@opentui/core";
|
|
501827
501908
|
function surfaceIdFrom(kind, id) {
|
|
501828
501909
|
return `${kind}:${id}`;
|
|
501829
501910
|
}
|
|
@@ -501846,7 +501927,7 @@ function formatUptime(ms) {
|
|
|
501846
501927
|
return `${String(h3)}h ${String(m5 % 60)}m`;
|
|
501847
501928
|
}
|
|
501848
501929
|
async function probeDaemon(socketPath) {
|
|
501849
|
-
if (!
|
|
501930
|
+
if (!existsSync59(socketPath))
|
|
501850
501931
|
return { running: false };
|
|
501851
501932
|
try {
|
|
501852
501933
|
const res = await socketRequest({ op: "health", v: HEARTH_PROTOCOL_VERSION }, { path: socketPath, timeoutMs: 1200 });
|
|
@@ -501866,7 +501947,7 @@ async function probeDaemon(socketPath) {
|
|
|
501866
501947
|
}
|
|
501867
501948
|
}
|
|
501868
501949
|
async function issuePairingCodeViaDaemon(socketPath, surfaceId) {
|
|
501869
|
-
if (!
|
|
501950
|
+
if (!existsSync59(socketPath)) {
|
|
501870
501951
|
return { error: "Daemon not running \u2014 start it from the Daemon tab first." };
|
|
501871
501952
|
}
|
|
501872
501953
|
try {
|
|
@@ -501978,7 +502059,7 @@ function Divider3({ w: w6, label, t }) {
|
|
|
501978
502059
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
501979
502060
|
bg: t.bgPopup,
|
|
501980
502061
|
fg: t.brandAlt,
|
|
501981
|
-
attributes:
|
|
502062
|
+
attributes: TextAttributes27.BOLD,
|
|
501982
502063
|
children: [
|
|
501983
502064
|
" ",
|
|
501984
502065
|
label,
|
|
@@ -502051,7 +502132,7 @@ function FooterHints({
|
|
|
502051
502132
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
502052
502133
|
bg: t.bgPopup,
|
|
502053
502134
|
fg: t.brandAlt,
|
|
502054
|
-
attributes:
|
|
502135
|
+
attributes: TextAttributes27.BOLD,
|
|
502055
502136
|
children: h3.key
|
|
502056
502137
|
}, undefined, false, undefined, this),
|
|
502057
502138
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
@@ -502164,7 +502245,7 @@ function HearthSettings({ visible, onClose }) {
|
|
|
502164
502245
|
const path = config2.daemon.logFile;
|
|
502165
502246
|
const read = () => {
|
|
502166
502247
|
try {
|
|
502167
|
-
if (!
|
|
502248
|
+
if (!existsSync59(path)) {
|
|
502168
502249
|
setLogLines(["(log file not yet created \u2014 start the daemon from the Daemon tab)"]);
|
|
502169
502250
|
return;
|
|
502170
502251
|
}
|
|
@@ -502273,7 +502354,7 @@ function HearthSettings({ visible, onClose }) {
|
|
|
502273
502354
|
}
|
|
502274
502355
|
const pidPath = join64(configDir(), "hearth.pid");
|
|
502275
502356
|
let pid = null;
|
|
502276
|
-
if (
|
|
502357
|
+
if (existsSync59(pidPath)) {
|
|
502277
502358
|
const raw2 = readFileSync33(pidPath, "utf-8").trim();
|
|
502278
502359
|
const n = Number.parseInt(raw2, 10);
|
|
502279
502360
|
if (!Number.isNaN(n) && n > 0)
|
|
@@ -502310,7 +502391,7 @@ function HearthSettings({ visible, onClose }) {
|
|
|
502310
502391
|
logBackgroundError("hearth-settings", err2 instanceof Error ? err2.message : String(err2));
|
|
502311
502392
|
return;
|
|
502312
502393
|
}
|
|
502313
|
-
if (!
|
|
502394
|
+
if (!existsSync59(next.daemon.socketPath))
|
|
502314
502395
|
return;
|
|
502315
502396
|
socketRequest({ op: "reload", v: HEARTH_PROTOCOL_VERSION }, { path: next.daemon.socketPath, timeoutMs: 8000 }).then((res) => {
|
|
502316
502397
|
const parts2 = [];
|
|
@@ -503090,7 +503171,7 @@ function HearthSettings({ visible, onClose }) {
|
|
|
503090
503171
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
503091
503172
|
bg: t.bgPopup,
|
|
503092
503173
|
fg: t.brand,
|
|
503093
|
-
attributes:
|
|
503174
|
+
attributes: TextAttributes27.BOLD,
|
|
503094
503175
|
children: " \u2302 Hearth [experimental]"
|
|
503095
503176
|
}, undefined, false, undefined, this),
|
|
503096
503177
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(VSpacer3, {}, undefined, false, undefined, this),
|
|
@@ -503100,7 +503181,7 @@ function HearthSettings({ visible, onClose }) {
|
|
|
503100
503181
|
return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
503101
503182
|
bg,
|
|
503102
503183
|
fg: active ? t.brand : t.textPrimary,
|
|
503103
|
-
attributes: active ?
|
|
503184
|
+
attributes: active ? TextAttributes27.BOLD : undefined,
|
|
503104
503185
|
children: [
|
|
503105
503186
|
active ? " \u25B8 " : " ",
|
|
503106
503187
|
icon(TAB_ICON[tk]),
|
|
@@ -503319,7 +503400,7 @@ function renderSurfaces(w6, rows, t, entries2, cursor, status) {
|
|
|
503319
503400
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
503320
503401
|
bg: t.bgPopup,
|
|
503321
503402
|
fg: t.brandAlt,
|
|
503322
|
-
attributes:
|
|
503403
|
+
attributes: TextAttributes27.BOLD,
|
|
503323
503404
|
children: "Surfaces"
|
|
503324
503405
|
}, undefined, false, undefined, this),
|
|
503325
503406
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
@@ -503354,7 +503435,7 @@ function renderSurfaces(w6, rows, t, entries2, cursor, status) {
|
|
|
503354
503435
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
503355
503436
|
bg,
|
|
503356
503437
|
fg: t.textPrimary,
|
|
503357
|
-
attributes: isSel ?
|
|
503438
|
+
attributes: isSel ? TextAttributes27.BOLD : undefined,
|
|
503358
503439
|
children: [
|
|
503359
503440
|
" ",
|
|
503360
503441
|
truncateMid(sid, listW - 10)
|
|
@@ -503440,7 +503521,7 @@ function renderSurfaceDetail(w6, t, entry, status) {
|
|
|
503440
503521
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
503441
503522
|
bg: t.bgPopup,
|
|
503442
503523
|
fg: t.brandAlt,
|
|
503443
|
-
attributes:
|
|
503524
|
+
attributes: TextAttributes27.BOLD,
|
|
503444
503525
|
children: sid
|
|
503445
503526
|
}, undefined, false, undefined, this),
|
|
503446
503527
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
@@ -503682,7 +503763,7 @@ function renderDaemon(w6, rows, t, config2, status, logs, startupError, service)
|
|
|
503682
503763
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
503683
503764
|
bg: t.bgPopup,
|
|
503684
503765
|
fg: t.brandAlt,
|
|
503685
|
-
attributes:
|
|
503766
|
+
attributes: TextAttributes27.BOLD,
|
|
503686
503767
|
children: "Daemon"
|
|
503687
503768
|
}, undefined, false, undefined, this),
|
|
503688
503769
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
@@ -503709,7 +503790,7 @@ function renderDaemon(w6, rows, t, config2, status, logs, startupError, service)
|
|
|
503709
503790
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
503710
503791
|
bg: t.bgPopup,
|
|
503711
503792
|
fg: status.running ? t.success : t.warning,
|
|
503712
|
-
attributes:
|
|
503793
|
+
attributes: TextAttributes27.BOLD,
|
|
503713
503794
|
children: status.running ? "\u25CF RUNNING" : "\u25CB STOPPED"
|
|
503714
503795
|
}, undefined, false, undefined, this),
|
|
503715
503796
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
@@ -503803,7 +503884,7 @@ function renderDaemon(w6, rows, t, config2, status, logs, startupError, service)
|
|
|
503803
503884
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
503804
503885
|
bg: t.bgPopup,
|
|
503805
503886
|
fg: t.error,
|
|
503806
|
-
attributes:
|
|
503887
|
+
attributes: TextAttributes27.BOLD,
|
|
503807
503888
|
children: " boot failure"
|
|
503808
503889
|
}, undefined, false, undefined, this),
|
|
503809
503890
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
@@ -503904,7 +503985,7 @@ function renderDaemon(w6, rows, t, config2, status, logs, startupError, service)
|
|
|
503904
503985
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
503905
503986
|
bg: t.bgPopup,
|
|
503906
503987
|
fg: service?.installed ? t.success : t.textDim,
|
|
503907
|
-
attributes:
|
|
503988
|
+
attributes: TextAttributes27.BOLD,
|
|
503908
503989
|
children: service?.installed ? service.active ? "active on boot" : "installed (inactive)" : service?.platform === "unsupported" ? "not supported on this OS" : "not installed"
|
|
503909
503990
|
}, undefined, false, undefined, this),
|
|
503910
503991
|
service?.installed && service.unitLabel ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(import_jsx_dev_runtime2.Fragment, {
|
|
@@ -503934,7 +504015,7 @@ function renderDaemon(w6, rows, t, config2, status, logs, startupError, service)
|
|
|
503934
504015
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
503935
504016
|
bg: t.bgPopup,
|
|
503936
504017
|
fg: t.brandAlt,
|
|
503937
|
-
attributes:
|
|
504018
|
+
attributes: TextAttributes27.BOLD,
|
|
503938
504019
|
children: "[s]"
|
|
503939
504020
|
}, undefined, false, undefined, this),
|
|
503940
504021
|
" ",
|
|
@@ -503949,7 +504030,7 @@ function renderDaemon(w6, rows, t, config2, status, logs, startupError, service)
|
|
|
503949
504030
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
503950
504031
|
bg: t.bgPopup,
|
|
503951
504032
|
fg: t.brandAlt,
|
|
503952
|
-
attributes:
|
|
504033
|
+
attributes: TextAttributes27.BOLD,
|
|
503953
504034
|
children: "[b]"
|
|
503954
504035
|
}, undefined, false, undefined, this),
|
|
503955
504036
|
" ",
|
|
@@ -503964,7 +504045,7 @@ function renderDaemon(w6, rows, t, config2, status, logs, startupError, service)
|
|
|
503964
504045
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
503965
504046
|
bg: t.bgPopup,
|
|
503966
504047
|
fg: t.brandAlt,
|
|
503967
|
-
attributes:
|
|
504048
|
+
attributes: TextAttributes27.BOLD,
|
|
503968
504049
|
children: "[r]"
|
|
503969
504050
|
}, undefined, false, undefined, this),
|
|
503970
504051
|
" ",
|
|
@@ -504005,7 +504086,7 @@ function renderPairings(w6, _rows, t, pairings, cursor) {
|
|
|
504005
504086
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
504006
504087
|
bg: t.bgPopup,
|
|
504007
504088
|
fg: t.brandAlt,
|
|
504008
|
-
attributes:
|
|
504089
|
+
attributes: TextAttributes27.BOLD,
|
|
504009
504090
|
children: "Pairings"
|
|
504010
504091
|
}, undefined, false, undefined, this),
|
|
504011
504092
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(VSpacer3, {}, undefined, false, undefined, this),
|
|
@@ -504044,7 +504125,7 @@ function renderPairings(w6, _rows, t, pairings, cursor) {
|
|
|
504044
504125
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
504045
504126
|
bg: t.bgPopup,
|
|
504046
504127
|
fg: t.brandAlt,
|
|
504047
|
-
attributes:
|
|
504128
|
+
attributes: TextAttributes27.BOLD,
|
|
504048
504129
|
children: "Paired chats"
|
|
504049
504130
|
}, undefined, false, undefined, this),
|
|
504050
504131
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
@@ -504066,7 +504147,7 @@ function renderPairings(w6, _rows, t, pairings, cursor) {
|
|
|
504066
504147
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
504067
504148
|
bg: t.bgPopup,
|
|
504068
504149
|
fg: t.info,
|
|
504069
|
-
attributes:
|
|
504150
|
+
attributes: TextAttributes27.BOLD,
|
|
504070
504151
|
children: [
|
|
504071
504152
|
" \u25BE ",
|
|
504072
504153
|
sid
|
|
@@ -504114,7 +504195,7 @@ function renderPairings(w6, _rows, t, pairings, cursor) {
|
|
|
504114
504195
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
504115
504196
|
bg: t.bgPopup,
|
|
504116
504197
|
fg: t.brandAlt,
|
|
504117
|
-
attributes:
|
|
504198
|
+
attributes: TextAttributes27.BOLD,
|
|
504118
504199
|
children: selected.sid
|
|
504119
504200
|
}, undefined, false, undefined, this),
|
|
504120
504201
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
@@ -504194,7 +504275,7 @@ function renderLogs(w6, rows, t, lines, scroll, autoscroll, filter7, filterFocus
|
|
|
504194
504275
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
504195
504276
|
bg: t.bgPopup,
|
|
504196
504277
|
fg: t.brandAlt,
|
|
504197
|
-
attributes:
|
|
504278
|
+
attributes: TextAttributes27.BOLD,
|
|
504198
504279
|
children: "Logs"
|
|
504199
504280
|
}, undefined, false, undefined, this),
|
|
504200
504281
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
@@ -504276,7 +504357,7 @@ function renderAddSurface(_w, _rows, mode, t) {
|
|
|
504276
504357
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
504277
504358
|
bg: t.bgPopup,
|
|
504278
504359
|
fg: t.brandAlt,
|
|
504279
|
-
attributes:
|
|
504360
|
+
attributes: TextAttributes27.BOLD,
|
|
504280
504361
|
children: "Add surface"
|
|
504281
504362
|
}, undefined, false, undefined, this),
|
|
504282
504363
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
@@ -504340,7 +504421,7 @@ function renderAddChat(_w, _rows, mode, t) {
|
|
|
504340
504421
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
504341
504422
|
bg: t.bgPopup,
|
|
504342
504423
|
fg: t.brandAlt,
|
|
504343
|
-
attributes:
|
|
504424
|
+
attributes: TextAttributes27.BOLD,
|
|
504344
504425
|
children: "Bind chat"
|
|
504345
504426
|
}, undefined, false, undefined, this),
|
|
504346
504427
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
@@ -504397,7 +504478,7 @@ function renderTokenInput(_w, _rows, mode, t) {
|
|
|
504397
504478
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
504398
504479
|
bg: t.bgPopup,
|
|
504399
504480
|
fg: t.brandAlt,
|
|
504400
|
-
attributes:
|
|
504481
|
+
attributes: TextAttributes27.BOLD,
|
|
504401
504482
|
children: "Bot token"
|
|
504402
504483
|
}, undefined, false, undefined, this),
|
|
504403
504484
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
@@ -504456,7 +504537,7 @@ function renderPairCode(_w, _rows, mode, t) {
|
|
|
504456
504537
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
504457
504538
|
bg: t.bgPopup,
|
|
504458
504539
|
fg: t.brandAlt,
|
|
504459
|
-
attributes:
|
|
504540
|
+
attributes: TextAttributes27.BOLD,
|
|
504460
504541
|
children: "Pairing code"
|
|
504461
504542
|
}, undefined, false, undefined, this),
|
|
504462
504543
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
@@ -504473,7 +504554,7 @@ function renderPairCode(_w, _rows, mode, t) {
|
|
|
504473
504554
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
504474
504555
|
bg: t.bgPopup,
|
|
504475
504556
|
fg: t.brand,
|
|
504476
|
-
attributes:
|
|
504557
|
+
attributes: TextAttributes27.BOLD,
|
|
504477
504558
|
children: [
|
|
504478
504559
|
" ",
|
|
504479
504560
|
mode.code
|
|
@@ -504566,7 +504647,7 @@ function renderPickProvider(_w, _rows, mode, t) {
|
|
|
504566
504647
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
504567
504648
|
bg: t.bgPopup,
|
|
504568
504649
|
fg: t.brandAlt,
|
|
504569
|
-
attributes:
|
|
504650
|
+
attributes: TextAttributes27.BOLD,
|
|
504570
504651
|
children: "Add surface"
|
|
504571
504652
|
}, undefined, false, undefined, this),
|
|
504572
504653
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
@@ -504591,7 +504672,7 @@ function renderPickProvider(_w, _rows, mode, t) {
|
|
|
504591
504672
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
504592
504673
|
bg,
|
|
504593
504674
|
fg,
|
|
504594
|
-
attributes: active ?
|
|
504675
|
+
attributes: active ? TextAttributes27.BOLD : undefined,
|
|
504595
504676
|
children: [
|
|
504596
504677
|
active ? "\u25B8 " : " ",
|
|
504597
504678
|
p3.label,
|
|
@@ -504632,7 +504713,7 @@ function renderQuickTelegram(_w, _rows, mode, t) {
|
|
|
504632
504713
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
504633
504714
|
bg: t.bgPopup,
|
|
504634
504715
|
fg: t.brandAlt,
|
|
504635
|
-
attributes:
|
|
504716
|
+
attributes: TextAttributes27.BOLD,
|
|
504636
504717
|
children: "Telegram setup"
|
|
504637
504718
|
}, undefined, false, undefined, this),
|
|
504638
504719
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
@@ -504720,7 +504801,7 @@ function renderQuickDiscord(_w, _rows, mode, t) {
|
|
|
504720
504801
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
504721
504802
|
bg: t.bgPopup,
|
|
504722
504803
|
fg: t.brandAlt,
|
|
504723
|
-
attributes:
|
|
504804
|
+
attributes: TextAttributes27.BOLD,
|
|
504724
504805
|
children: "Discord setup"
|
|
504725
504806
|
}, undefined, false, undefined, this),
|
|
504726
504807
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
@@ -504769,7 +504850,7 @@ function renderQuickDiscord(_w, _rows, mode, t) {
|
|
|
504769
504850
|
sameChannelUser ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
504770
504851
|
bg: t.bgPopup,
|
|
504771
504852
|
fg: t.error,
|
|
504772
|
-
attributes:
|
|
504853
|
+
attributes: TextAttributes27.BOLD,
|
|
504773
504854
|
children: " \u2715 channel id = user id. Right-click YOUR name, not the channel."
|
|
504774
504855
|
}, undefined, false, undefined, this) : null,
|
|
504775
504856
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(FieldRow, {
|
|
@@ -504814,7 +504895,7 @@ function renderAddAllowed(_w, _rows, mode, t) {
|
|
|
504814
504895
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
504815
504896
|
bg: t.bgPopup,
|
|
504816
504897
|
fg: t.brandAlt,
|
|
504817
|
-
attributes:
|
|
504898
|
+
attributes: TextAttributes27.BOLD,
|
|
504818
504899
|
children: "Allow user"
|
|
504819
504900
|
}, undefined, false, undefined, this),
|
|
504820
504901
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
@@ -504875,7 +504956,7 @@ function renderAddAllowed(_w, _rows, mode, t) {
|
|
|
504875
504956
|
}
|
|
504876
504957
|
function resolveLauncher() {
|
|
504877
504958
|
const envOverride = process.env.SOULFORGE_HEARTH_LAUNCHER;
|
|
504878
|
-
if (envOverride &&
|
|
504959
|
+
if (envOverride && existsSync59(envOverride)) {
|
|
504879
504960
|
return { kind: "env", cmd: envOverride, args: [] };
|
|
504880
504961
|
}
|
|
504881
504962
|
const checkout = findSourceCheckout(process.argv[1] ?? process.cwd());
|
|
@@ -504883,14 +504964,14 @@ function resolveLauncher() {
|
|
|
504883
504964
|
const bootTsx = join64(checkout, "src", "boot.tsx");
|
|
504884
504965
|
const distEntry = join64(checkout, "dist", "bin.sh");
|
|
504885
504966
|
const bin = join64(checkout, "bin", "soulforge");
|
|
504886
|
-
if (
|
|
504967
|
+
if (existsSync59(bootTsx)) {
|
|
504887
504968
|
const bunBin = process.execPath.includes("bun") ? process.execPath : findBinaryOnPath("bun") ?? "bun";
|
|
504888
504969
|
return { kind: "dev-bun", cmd: bunBin, args: [bootTsx] };
|
|
504889
504970
|
}
|
|
504890
|
-
if (
|
|
504971
|
+
if (existsSync59(distEntry)) {
|
|
504891
504972
|
return { kind: "dist", cmd: distEntry, args: [] };
|
|
504892
504973
|
}
|
|
504893
|
-
if (
|
|
504974
|
+
if (existsSync59(bin) && isExecutable(bin)) {
|
|
504894
504975
|
return { kind: "dev-bin", cmd: bin, args: [] };
|
|
504895
504976
|
}
|
|
504896
504977
|
}
|
|
@@ -504900,10 +504981,10 @@ function resolveLauncher() {
|
|
|
504900
504981
|
return null;
|
|
504901
504982
|
}
|
|
504902
504983
|
function findSourceCheckout(startPath) {
|
|
504903
|
-
let dir = startPath &&
|
|
504984
|
+
let dir = startPath && existsSync59(startPath) ? resolve45(dirname25(startPath)) : resolve45(process.cwd());
|
|
504904
504985
|
for (let i4 = 0;i4 < 6; i4++) {
|
|
504905
504986
|
const pkg = join64(dir, "package.json");
|
|
504906
|
-
if (
|
|
504987
|
+
if (existsSync59(pkg)) {
|
|
504907
504988
|
try {
|
|
504908
504989
|
const parsed = JSON.parse(readFileSync33(pkg, "utf-8"));
|
|
504909
504990
|
if (parsed.name === "@proxysoul/soulforge" || parsed.module?.includes("boot.tsx")) {
|
|
@@ -504932,13 +505013,13 @@ function isExecutable(p3) {
|
|
|
504932
505013
|
}
|
|
504933
505014
|
function findBinaryOnPath(name39) {
|
|
504934
505015
|
const resolved = findOnPath(name39);
|
|
504935
|
-
if (resolved &&
|
|
505016
|
+
if (resolved && existsSync59(resolved) && isExecutable(resolved))
|
|
504936
505017
|
return resolved;
|
|
504937
505018
|
const exts = IS_WIN ? (process.env.PATHEXT ?? ".EXE;.CMD;.BAT;.COM").split(";").filter(Boolean) : [""];
|
|
504938
505019
|
for (const dir of (process.env.PATH ?? "").split(delimiter2)) {
|
|
504939
505020
|
for (const ext of exts) {
|
|
504940
505021
|
const candidate = join64(dir, name39 + ext);
|
|
504941
|
-
if (
|
|
505022
|
+
if (existsSync59(candidate) && isExecutable(candidate))
|
|
504942
505023
|
return candidate;
|
|
504943
505024
|
}
|
|
504944
505025
|
}
|
|
@@ -504946,7 +505027,7 @@ function findBinaryOnPath(name39) {
|
|
|
504946
505027
|
}
|
|
504947
505028
|
function readTailSafe(path, maxLines) {
|
|
504948
505029
|
try {
|
|
504949
|
-
if (!
|
|
505030
|
+
if (!existsSync59(path))
|
|
504950
505031
|
return null;
|
|
504951
505032
|
const raw2 = readFileSync33(path, "utf-8");
|
|
504952
505033
|
const lines = raw2.split(`
|
|
@@ -505027,7 +505108,7 @@ var init_HearthSettings = __esm(async () => {
|
|
|
505027
505108
|
|
|
505028
505109
|
// src/core/intelligence/backends/lsp/installer.ts
|
|
505029
505110
|
import { spawn as spawn22 } from "child_process";
|
|
505030
|
-
import { chmodSync as chmodSync6, existsSync as
|
|
505111
|
+
import { chmodSync as chmodSync6, existsSync as existsSync60, mkdirSync as mkdirSync27, readFileSync as readFileSync34, unlinkSync as unlinkSync12, writeFileSync as writeFileSync24 } from "fs";
|
|
505031
505112
|
import { homedir as homedir14 } from "os";
|
|
505032
505113
|
import { join as join65 } from "path";
|
|
505033
505114
|
function parsePurl(id) {
|
|
@@ -505095,14 +505176,14 @@ function getToolchainRequirement(method) {
|
|
|
505095
505176
|
function loadRegistry() {
|
|
505096
505177
|
if (registryCache)
|
|
505097
505178
|
return registryCache;
|
|
505098
|
-
if (
|
|
505179
|
+
if (existsSync60(MASON_REGISTRY_LOCAL)) {
|
|
505099
505180
|
try {
|
|
505100
505181
|
const raw2 = readFileSync34(MASON_REGISTRY_LOCAL, "utf-8");
|
|
505101
505182
|
registryCache = JSON.parse(raw2);
|
|
505102
505183
|
return registryCache;
|
|
505103
505184
|
} catch {}
|
|
505104
505185
|
}
|
|
505105
|
-
if (
|
|
505186
|
+
if (existsSync60(REGISTRY_CACHE)) {
|
|
505106
505187
|
try {
|
|
505107
505188
|
const raw2 = readFileSync34(REGISTRY_CACHE, "utf-8");
|
|
505108
505189
|
registryCache = JSON.parse(raw2);
|
|
@@ -505169,7 +505250,7 @@ function loadVersions() {
|
|
|
505169
505250
|
if (versionCache)
|
|
505170
505251
|
return versionCache;
|
|
505171
505252
|
try {
|
|
505172
|
-
if (
|
|
505253
|
+
if (existsSync60(VERSIONS_FILE)) {
|
|
505173
505254
|
versionCache = JSON.parse(readFileSync34(VERSIONS_FILE, "utf-8"));
|
|
505174
505255
|
return versionCache;
|
|
505175
505256
|
}
|
|
@@ -505207,7 +505288,7 @@ function checkPackageStatus(pkg) {
|
|
|
505207
505288
|
const winSuffixes = IS_WIN ? [EXE, CMD_EXT, ""] : [""];
|
|
505208
505289
|
const probe = (dir, bin) => {
|
|
505209
505290
|
for (const sfx of winSuffixes) {
|
|
505210
|
-
if (
|
|
505291
|
+
if (existsSync60(join65(dir, bin + sfx)))
|
|
505211
505292
|
return true;
|
|
505212
505293
|
}
|
|
505213
505294
|
return false;
|
|
@@ -505310,7 +505391,7 @@ async function installPackage(pkg, onProgress) {
|
|
|
505310
505391
|
if (commandExists("bun"))
|
|
505311
505392
|
return "bun";
|
|
505312
505393
|
const sfBin = join65(dataDir(), "bin", `bun${EXE}`);
|
|
505313
|
-
if (
|
|
505394
|
+
if (existsSync60(sfBin))
|
|
505314
505395
|
return sfBin;
|
|
505315
505396
|
return "bun";
|
|
505316
505397
|
})();
|
|
@@ -505409,7 +505490,7 @@ PYTHONPATH="${pipDir}:$PYTHONPATH" exec python3 -m ${moduleName} "$@"
|
|
|
505409
505490
|
}
|
|
505410
505491
|
}
|
|
505411
505492
|
for (const candidate of candidates) {
|
|
505412
|
-
if (
|
|
505493
|
+
if (existsSync60(candidate)) {
|
|
505413
505494
|
const { copyFileSync: copyFileSync2 } = await import("fs");
|
|
505414
505495
|
const srcExt = candidate.endsWith(".exe") ? ".exe" : candidate.endsWith(".cmd") ? ".cmd" : "";
|
|
505415
505496
|
const dest = join65(binDir, binName + (IS_WIN ? srcExt : ""));
|
|
@@ -505462,7 +505543,7 @@ async function uninstallPackage(pkg, onProgress) {
|
|
|
505462
505543
|
if (commandExists("bun"))
|
|
505463
505544
|
return "bun";
|
|
505464
505545
|
const sfBin = join65(dataDir(), "bin", `bun${EXE}`);
|
|
505465
|
-
if (
|
|
505546
|
+
if (existsSync60(sfBin))
|
|
505466
505547
|
return sfBin;
|
|
505467
505548
|
return "bun";
|
|
505468
505549
|
})();
|
|
@@ -505624,9 +505705,9 @@ var init_installer = __esm(() => {
|
|
|
505624
505705
|
});
|
|
505625
505706
|
|
|
505626
505707
|
// src/components/settings/LspInstallSearch.tsx
|
|
505627
|
-
import { existsSync as
|
|
505708
|
+
import { existsSync as existsSync61 } from "fs";
|
|
505628
505709
|
import { join as join66 } from "path";
|
|
505629
|
-
import { TextAttributes as
|
|
505710
|
+
import { TextAttributes as TextAttributes28 } from "@opentui/core";
|
|
505630
505711
|
function methodLabel(status) {
|
|
505631
505712
|
if (status.requiresToolchain && !status.toolchainAvailable) {
|
|
505632
505713
|
return `[requires ${status.requiresToolchain}]`;
|
|
@@ -505725,7 +505806,7 @@ function PackageRow({
|
|
|
505725
505806
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
505726
505807
|
bg,
|
|
505727
505808
|
fg: nameFg,
|
|
505728
|
-
attributes: isActive ?
|
|
505809
|
+
attributes: isActive ? TextAttributes28.BOLD : undefined,
|
|
505729
505810
|
children: status.pkg.name
|
|
505730
505811
|
}, undefined, false, undefined, this),
|
|
505731
505812
|
lang254 ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
@@ -505773,7 +505854,7 @@ function LspInstallSearch({
|
|
|
505773
505854
|
const defaultScopeCursor = detectScope("disabledLspServers") === "project" ? 0 : 1;
|
|
505774
505855
|
const [scopeCursor, setScopeCursor] = import_react144.useState(defaultScopeCursor);
|
|
505775
505856
|
const downloadAttemptedRef = import_react144.useRef(false);
|
|
505776
|
-
const isInProject =
|
|
505857
|
+
const isInProject = existsSync61(join66(cwd2, ".git"));
|
|
505777
505858
|
const { width: termCols, height: termRows } = useTerminalDimensions();
|
|
505778
505859
|
const containerRows = termRows - 2;
|
|
505779
505860
|
const popupWidth = Math.min(MAX_POPUP_WIDTH3, Math.floor(termCols * 0.9));
|
|
@@ -506183,7 +506264,7 @@ function LspInstallSearch({
|
|
|
506183
506264
|
backgroundColor: t.bgPopup,
|
|
506184
506265
|
children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
506185
506266
|
fg: t.textPrimary,
|
|
506186
|
-
attributes:
|
|
506267
|
+
attributes: TextAttributes28.BOLD,
|
|
506187
506268
|
bg: t.bgPopup,
|
|
506188
506269
|
children: [
|
|
506189
506270
|
disabledServers.includes(pendingToggle.pkg.name) ? "Enable" : "Disable",
|
|
@@ -506226,7 +506307,7 @@ var init_LspInstallSearch = __esm(async () => {
|
|
|
506226
506307
|
});
|
|
506227
506308
|
|
|
506228
506309
|
// src/components/settings/MCPSettings.tsx
|
|
506229
|
-
import { TextAttributes as
|
|
506310
|
+
import { TextAttributes as TextAttributes29 } from "@opentui/core";
|
|
506230
506311
|
function useListScroll2(maxVisible, totalItems) {
|
|
506231
506312
|
const [cursor, setCursor] = import_react146.useState(0);
|
|
506232
506313
|
const [scrollOffset, setScrollOffset] = import_react146.useState(0);
|
|
@@ -506775,7 +506856,7 @@ function MCPSettings({
|
|
|
506775
506856
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
506776
506857
|
bg: t.bgPopup,
|
|
506777
506858
|
fg: t.brandAlt,
|
|
506778
|
-
attributes:
|
|
506859
|
+
attributes: TextAttributes29.BOLD,
|
|
506779
506860
|
children: " P"
|
|
506780
506861
|
}, undefined, false, undefined, this),
|
|
506781
506862
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
@@ -506786,7 +506867,7 @@ function MCPSettings({
|
|
|
506786
506867
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
506787
506868
|
bg: t.bgPopup,
|
|
506788
506869
|
fg: t.textMuted,
|
|
506789
|
-
attributes:
|
|
506870
|
+
attributes: TextAttributes29.BOLD,
|
|
506790
506871
|
children: "G"
|
|
506791
506872
|
}, undefined, false, undefined, this),
|
|
506792
506873
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
@@ -506841,7 +506922,7 @@ function ServerDetail({
|
|
|
506841
506922
|
}, undefined, false, undefined, this),
|
|
506842
506923
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
506843
506924
|
fg: t.textPrimary,
|
|
506844
|
-
attributes:
|
|
506925
|
+
attributes: TextAttributes29.BOLD,
|
|
506845
506926
|
bg: t.bgPopup,
|
|
506846
506927
|
children: config2.name
|
|
506847
506928
|
}, undefined, false, undefined, this),
|
|
@@ -506926,7 +507007,7 @@ function ServerDetail({
|
|
|
506926
507007
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
506927
507008
|
bg: t.bgPopup,
|
|
506928
507009
|
fg: t.error,
|
|
506929
|
-
attributes:
|
|
507010
|
+
attributes: TextAttributes29.BOLD,
|
|
506930
507011
|
children: [
|
|
506931
507012
|
" ",
|
|
506932
507013
|
icon("error"),
|
|
@@ -507132,7 +507213,7 @@ function FormBody({
|
|
|
507132
507213
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
507133
507214
|
bg,
|
|
507134
507215
|
fg: active ? t.brand : t.textMuted,
|
|
507135
|
-
attributes: active ?
|
|
507216
|
+
attributes: active ? TextAttributes29.BOLD : undefined,
|
|
507136
507217
|
children: LABEL[field].padEnd(12)
|
|
507137
507218
|
}, undefined, false, undefined, this),
|
|
507138
507219
|
!active && /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
@@ -507270,7 +507351,7 @@ var init_MCPSettings = __esm(async () => {
|
|
|
507270
507351
|
}, undefined, false, undefined, this),
|
|
507271
507352
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
507272
507353
|
fg: t.success,
|
|
507273
|
-
attributes:
|
|
507354
|
+
attributes: TextAttributes29.BOLD,
|
|
507274
507355
|
children: "ctrl+a"
|
|
507275
507356
|
}, undefined, false, undefined, this),
|
|
507276
507357
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("span", {
|
|
@@ -507312,7 +507393,7 @@ var init_MCPSettings = __esm(async () => {
|
|
|
507312
507393
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
507313
507394
|
bg,
|
|
507314
507395
|
fg: scopeCol,
|
|
507315
|
-
attributes:
|
|
507396
|
+
attributes: TextAttributes29.BOLD,
|
|
507316
507397
|
children: scopeBadge
|
|
507317
507398
|
}, undefined, false, undefined, this),
|
|
507318
507399
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
@@ -507335,7 +507416,7 @@ var init_MCPSettings = __esm(async () => {
|
|
|
507335
507416
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
507336
507417
|
bg,
|
|
507337
507418
|
fg: isSelected ? "white" : t.textPrimary,
|
|
507338
|
-
attributes:
|
|
507419
|
+
attributes: TextAttributes29.BOLD,
|
|
507339
507420
|
children: config2.name
|
|
507340
507421
|
}, undefined, false, undefined, this),
|
|
507341
507422
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
@@ -507402,7 +507483,7 @@ var init_MCPSettings = __esm(async () => {
|
|
|
507402
507483
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
507403
507484
|
bg: deleteChoice === "no" ? t.bgPopupHighlight : bg,
|
|
507404
507485
|
fg: deleteChoice === "no" ? "white" : t.textDim,
|
|
507405
|
-
attributes: deleteChoice === "no" ?
|
|
507486
|
+
attributes: deleteChoice === "no" ? TextAttributes29.BOLD : undefined,
|
|
507406
507487
|
children: deleteChoice === "no" ? " \u25B8 No " : " No "
|
|
507407
507488
|
}, undefined, false, undefined, this),
|
|
507408
507489
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
@@ -507413,7 +507494,7 @@ var init_MCPSettings = __esm(async () => {
|
|
|
507413
507494
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
507414
507495
|
bg: deleteChoice === "yes" ? t.bgPopupHighlight : bg,
|
|
507415
507496
|
fg: deleteChoice === "yes" ? t.error : t.textDim,
|
|
507416
|
-
attributes: deleteChoice === "yes" ?
|
|
507497
|
+
attributes: deleteChoice === "yes" ? TextAttributes29.BOLD : undefined,
|
|
507417
507498
|
children: deleteChoice === "yes" ? " \u25B8 Yes " : " Yes "
|
|
507418
507499
|
}, undefined, false, undefined, this)
|
|
507419
507500
|
]
|
|
@@ -507518,7 +507599,7 @@ var init_MCPSettings = __esm(async () => {
|
|
|
507518
507599
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
507519
507600
|
bg,
|
|
507520
507601
|
fg: sel ? "white" : t.info,
|
|
507521
|
-
attributes:
|
|
507602
|
+
attributes: TextAttributes29.BOLD,
|
|
507522
507603
|
children: tool4.name
|
|
507523
507604
|
}, undefined, false, undefined, this)
|
|
507524
507605
|
]
|
|
@@ -509610,9 +509691,9 @@ var init_RouterSettings = __esm(async () => {
|
|
|
509610
509691
|
});
|
|
509611
509692
|
|
|
509612
509693
|
// src/components/settings/SkillSearch.tsx
|
|
509613
|
-
import { existsSync as
|
|
509694
|
+
import { existsSync as existsSync62 } from "fs";
|
|
509614
509695
|
import { join as join67 } from "path";
|
|
509615
|
-
import { TextAttributes as
|
|
509696
|
+
import { TextAttributes as TextAttributes30 } from "@opentui/core";
|
|
509616
509697
|
function SearchSkillRow({
|
|
509617
509698
|
skill,
|
|
509618
509699
|
isSelected,
|
|
@@ -509634,18 +509715,18 @@ function SearchSkillRow({
|
|
|
509634
509715
|
isLoaded ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
509635
509716
|
bg,
|
|
509636
509717
|
fg: t.info,
|
|
509637
|
-
attributes:
|
|
509718
|
+
attributes: TextAttributes30.BOLD,
|
|
509638
509719
|
children: "\u25CF "
|
|
509639
509720
|
}, undefined, false, undefined, this) : isInstalled ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
509640
509721
|
bg,
|
|
509641
509722
|
fg: t.success,
|
|
509642
|
-
attributes:
|
|
509723
|
+
attributes: TextAttributes30.BOLD,
|
|
509643
509724
|
children: "\u2713 "
|
|
509644
509725
|
}, undefined, false, undefined, this) : null,
|
|
509645
509726
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
509646
509727
|
bg,
|
|
509647
509728
|
fg: isSelected ? t.brand : t.textSecondary,
|
|
509648
|
-
attributes: isSelected ?
|
|
509729
|
+
attributes: isSelected ? TextAttributes30.BOLD : undefined,
|
|
509649
509730
|
children: skill.skillId
|
|
509650
509731
|
}, undefined, false, undefined, this),
|
|
509651
509732
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
@@ -509688,7 +509769,7 @@ function InstalledSkillRow({
|
|
|
509688
509769
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
509689
509770
|
bg,
|
|
509690
509771
|
fg: isSelected ? t.brand : t.textSecondary,
|
|
509691
|
-
attributes: isSelected ?
|
|
509772
|
+
attributes: isSelected ? TextAttributes30.BOLD : undefined,
|
|
509692
509773
|
children: skill.name
|
|
509693
509774
|
}, undefined, false, undefined, this),
|
|
509694
509775
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
@@ -509702,7 +509783,7 @@ function InstalledSkillRow({
|
|
|
509702
509783
|
isLoaded && /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
509703
509784
|
bg,
|
|
509704
509785
|
fg: t.info,
|
|
509705
|
-
attributes:
|
|
509786
|
+
attributes: TextAttributes30.BOLD,
|
|
509706
509787
|
children: [
|
|
509707
509788
|
" ",
|
|
509708
509789
|
"\u25CF"
|
|
@@ -509730,13 +509811,13 @@ function ActiveSkillRow({
|
|
|
509730
509811
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
509731
509812
|
bg,
|
|
509732
509813
|
fg: t.info,
|
|
509733
|
-
attributes:
|
|
509814
|
+
attributes: TextAttributes30.BOLD,
|
|
509734
509815
|
children: "\u25CF "
|
|
509735
509816
|
}, undefined, false, undefined, this),
|
|
509736
509817
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
509737
509818
|
bg,
|
|
509738
509819
|
fg: isSelected ? t.brand : t.textPrimary,
|
|
509739
|
-
attributes: isSelected ?
|
|
509820
|
+
attributes: isSelected ? TextAttributes30.BOLD : undefined,
|
|
509740
509821
|
children: name39
|
|
509741
509822
|
}, undefined, false, undefined, this)
|
|
509742
509823
|
]
|
|
@@ -509757,7 +509838,7 @@ function SkillSearch({ visible, contextManager, onClose, onSystemMessage }) {
|
|
|
509757
509838
|
const [pendingInstall, setPendingInstall] = import_react156.useState(null);
|
|
509758
509839
|
const [scopeCursor, setScopeCursor] = import_react156.useState(0);
|
|
509759
509840
|
const debounceRef = import_react156.useRef(null);
|
|
509760
|
-
const isInProject =
|
|
509841
|
+
const isInProject = existsSync62(join67(getCwd(), ".git"));
|
|
509761
509842
|
const { width: termCols, height: termRows } = useTerminalDimensions();
|
|
509762
509843
|
const containerRows = termRows - 2;
|
|
509763
509844
|
const popupWidth = Math.min(MAX_POPUP_WIDTH5, Math.floor(termCols * 0.88));
|
|
@@ -510071,7 +510152,7 @@ function SkillSearch({ visible, contextManager, onClose, onSystemMessage }) {
|
|
|
510071
510152
|
backgroundColor: popupBg,
|
|
510072
510153
|
children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
510073
510154
|
fg: t.textPrimary,
|
|
510074
|
-
attributes:
|
|
510155
|
+
attributes: TextAttributes30.BOLD,
|
|
510075
510156
|
bg: popupBg,
|
|
510076
510157
|
children: [
|
|
510077
510158
|
'Install "',
|
|
@@ -510232,7 +510313,7 @@ var init_ToolsPopup = __esm(async () => {
|
|
|
510232
510313
|
});
|
|
510233
510314
|
|
|
510234
510315
|
// src/components/modals/MemoryBrowser.tsx
|
|
510235
|
-
import { existsSync as
|
|
510316
|
+
import { existsSync as existsSync63 } from "fs";
|
|
510236
510317
|
import { join as join68 } from "path";
|
|
510237
510318
|
function timeAgo2(iso) {
|
|
510238
510319
|
const ms = Date.now() - Date.parse(iso);
|
|
@@ -510292,7 +510373,7 @@ function MemoryBrowser({ visible, contextManager, cwd: cwd2, onClose, onSystemMe
|
|
|
510292
510373
|
}, []);
|
|
510293
510374
|
const fileExists = import_react160.useCallback((p3) => {
|
|
510294
510375
|
try {
|
|
510295
|
-
return
|
|
510376
|
+
return existsSync63(join68(cwd2, p3));
|
|
510296
510377
|
} catch {
|
|
510297
510378
|
return false;
|
|
510298
510379
|
}
|
|
@@ -511038,12 +511119,12 @@ __export(exports_claim, {
|
|
|
511038
511119
|
bindClaimedSessions: () => bindClaimedSessions,
|
|
511039
511120
|
autoClaimDaemonWorkspaces: () => autoClaimDaemonWorkspaces
|
|
511040
511121
|
});
|
|
511041
|
-
import { existsSync as
|
|
511122
|
+
import { existsSync as existsSync64 } from "fs";
|
|
511042
511123
|
async function autoClaimDaemonWorkspaces(cwd2) {
|
|
511043
511124
|
const config2 = loadHearthConfig(cwd2);
|
|
511044
511125
|
const socketPath = config2.daemon.socketPath;
|
|
511045
511126
|
const out2 = { sessions: [], errors: [] };
|
|
511046
|
-
if (!
|
|
511127
|
+
if (!existsSync64(socketPath))
|
|
511047
511128
|
return out2;
|
|
511048
511129
|
let list;
|
|
511049
511130
|
try {
|
|
@@ -511111,7 +511192,7 @@ __export(exports_App, {
|
|
|
511111
511192
|
App: () => App
|
|
511112
511193
|
});
|
|
511113
511194
|
import { join as join69 } from "path";
|
|
511114
|
-
import { TextAttributes as
|
|
511195
|
+
import { TextAttributes as TextAttributes31 } from "@opentui/core";
|
|
511115
511196
|
function truncate5(str, max) {
|
|
511116
511197
|
return str.length > max ? `${str.slice(0, max - 1)}\u2026` : str;
|
|
511117
511198
|
}
|
|
@@ -511196,7 +511277,7 @@ function ShutdownSplash({
|
|
|
511196
511277
|
alignItems: "center",
|
|
511197
511278
|
children: [
|
|
511198
511279
|
wordmark.map((line2, idx) => /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
511199
|
-
attributes:
|
|
511280
|
+
attributes: TextAttributes31.BOLD,
|
|
511200
511281
|
children: renderRow(line2)
|
|
511201
511282
|
}, idx, false, undefined, this)),
|
|
511202
511283
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
|
|
@@ -512330,7 +512411,7 @@ function App({
|
|
|
512330
512411
|
children: [
|
|
512331
512412
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
512332
512413
|
fg: t.brand,
|
|
512333
|
-
attributes:
|
|
512414
|
+
attributes: TextAttributes31.BOLD,
|
|
512334
512415
|
children: [
|
|
512335
512416
|
icon("ghost"),
|
|
512336
512417
|
" SoulForge"
|
|
@@ -512436,7 +512517,7 @@ function App({
|
|
|
512436
512517
|
}, undefined, false, undefined, this),
|
|
512437
512518
|
/* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
|
|
512438
512519
|
fg: modeColor,
|
|
512439
|
-
attributes:
|
|
512520
|
+
attributes: TextAttributes31.BOLD,
|
|
512440
512521
|
children: [
|
|
512441
512522
|
"[",
|
|
512442
512523
|
modeLabel,
|
|
@@ -513139,7 +513220,7 @@ init_theme();
|
|
|
513139
513220
|
init_resolve_cwd();
|
|
513140
513221
|
init_splash();
|
|
513141
513222
|
init_errors();
|
|
513142
|
-
import { existsSync as
|
|
513223
|
+
import { existsSync as existsSync65, readFileSync as readFileSync35 } from "fs";
|
|
513143
513224
|
import { join as join70 } from "path";
|
|
513144
513225
|
globalThis.AI_SDK_LOG_WARNINGS = false;
|
|
513145
513226
|
installGlobalFetch();
|
|
@@ -513215,7 +513296,7 @@ if (cliArgs.includes("--presets") || cliArgs[0] === "presets") {
|
|
|
513215
513296
|
var IS_COMPILED4 = isCompiledBinary(import.meta.url);
|
|
513216
513297
|
if (IS_COMPILED4) {
|
|
513217
513298
|
const bundledWorker = join70(dataDir(), "opentui-assets", "parser.worker.js");
|
|
513218
|
-
if (!process.env.OTUI_TREE_SITTER_WORKER_PATH &&
|
|
513299
|
+
if (!process.env.OTUI_TREE_SITTER_WORKER_PATH && existsSync65(bundledWorker)) {
|
|
513219
513300
|
process.env.OTUI_TREE_SITTER_WORKER_PATH = bundledWorker;
|
|
513220
513301
|
}
|
|
513221
513302
|
}
|