open-agents-ai 0.14.9 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +75 -138
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -232,7 +232,6 @@ var init_output = __esm({
|
|
|
232
232
|
});
|
|
233
233
|
|
|
234
234
|
// packages/cli/dist/updater.js
|
|
235
|
-
import { execSync } from "node:child_process";
|
|
236
235
|
import { existsSync as existsSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
|
|
237
236
|
import { join as join2 } from "node:path";
|
|
238
237
|
import { homedir as homedir2 } from "node:os";
|
|
@@ -297,50 +296,6 @@ async function checkForUpdate(currentVersion, forceCheck = false) {
|
|
|
297
296
|
latestVersion: latest
|
|
298
297
|
};
|
|
299
298
|
}
|
|
300
|
-
function performUpdate() {
|
|
301
|
-
try {
|
|
302
|
-
execSync(`npm cache clean --force ${PACKAGE_NAME} 2>/dev/null; npm install -g ${PACKAGE_NAME}@latest --force`, {
|
|
303
|
-
stdio: "inherit",
|
|
304
|
-
timeout: 12e4,
|
|
305
|
-
shell: "/bin/bash"
|
|
306
|
-
});
|
|
307
|
-
try {
|
|
308
|
-
const installed = execSync(`npm list -g ${PACKAGE_NAME} --depth=0 --json`, {
|
|
309
|
-
encoding: "utf-8",
|
|
310
|
-
stdio: ["pipe", "pipe", "pipe"],
|
|
311
|
-
timeout: 1e4
|
|
312
|
-
});
|
|
313
|
-
const parsed = JSON.parse(installed);
|
|
314
|
-
const ver = parsed?.dependencies?.[PACKAGE_NAME]?.version;
|
|
315
|
-
if (ver) {
|
|
316
|
-
console.log(` Verified: ${PACKAGE_NAME}@${ver} installed globally.`);
|
|
317
|
-
}
|
|
318
|
-
} catch {
|
|
319
|
-
}
|
|
320
|
-
return true;
|
|
321
|
-
} catch {
|
|
322
|
-
return false;
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
function performSilentUpdate() {
|
|
326
|
-
try {
|
|
327
|
-
execSync(`npm install -g ${PACKAGE_NAME}@latest --prefer-online`, {
|
|
328
|
-
stdio: "pipe",
|
|
329
|
-
timeout: 12e4
|
|
330
|
-
});
|
|
331
|
-
return true;
|
|
332
|
-
} catch {
|
|
333
|
-
return false;
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
function restartProcess() {
|
|
337
|
-
const args = process.argv.slice(1);
|
|
338
|
-
try {
|
|
339
|
-
execSync([process.execPath, ...args].map((a) => `"${a}"`).join(" "), { stdio: "inherit", timeout: 0 });
|
|
340
|
-
} catch {
|
|
341
|
-
}
|
|
342
|
-
process.exit(0);
|
|
343
|
-
}
|
|
344
299
|
function formatUpdateBanner(info) {
|
|
345
300
|
return `
|
|
346
301
|
Update available: v${info.currentVersion} \u2192 v${info.latestVersion}
|
|
@@ -2122,7 +2077,7 @@ var init_list_directory = __esm({
|
|
|
2122
2077
|
});
|
|
2123
2078
|
|
|
2124
2079
|
// packages/execution/dist/tools/aiwg-setup.js
|
|
2125
|
-
import { execSync
|
|
2080
|
+
import { execSync } from "node:child_process";
|
|
2126
2081
|
var AiwgSetupTool;
|
|
2127
2082
|
var init_aiwg_setup = __esm({
|
|
2128
2083
|
"packages/execution/dist/tools/aiwg-setup.js"() {
|
|
@@ -2161,7 +2116,7 @@ var init_aiwg_setup = __esm({
|
|
|
2161
2116
|
};
|
|
2162
2117
|
}
|
|
2163
2118
|
try {
|
|
2164
|
-
const output =
|
|
2119
|
+
const output = execSync(`aiwg use ${framework}`, {
|
|
2165
2120
|
cwd: projectDir,
|
|
2166
2121
|
encoding: "utf8",
|
|
2167
2122
|
timeout: 6e4,
|
|
@@ -2185,7 +2140,7 @@ ${output}`,
|
|
|
2185
2140
|
}
|
|
2186
2141
|
isAiwgInstalled() {
|
|
2187
2142
|
try {
|
|
2188
|
-
|
|
2143
|
+
execSync("aiwg --version", {
|
|
2189
2144
|
encoding: "utf8",
|
|
2190
2145
|
timeout: 5e3,
|
|
2191
2146
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -2200,7 +2155,7 @@ ${output}`,
|
|
|
2200
2155
|
});
|
|
2201
2156
|
|
|
2202
2157
|
// packages/execution/dist/tools/aiwg-health.js
|
|
2203
|
-
import { execSync as
|
|
2158
|
+
import { execSync as execSync2 } from "node:child_process";
|
|
2204
2159
|
import { existsSync as existsSync3, readdirSync as readdirSync2, readFileSync as readFileSync3, statSync as statSync2 } from "node:fs";
|
|
2205
2160
|
import { join as join6 } from "node:path";
|
|
2206
2161
|
var AiwgHealthTool;
|
|
@@ -2280,7 +2235,7 @@ var init_aiwg_health = __esm({
|
|
|
2280
2235
|
}
|
|
2281
2236
|
if (this.isAiwgInstalled()) {
|
|
2282
2237
|
try {
|
|
2283
|
-
const runtimeInfo =
|
|
2238
|
+
const runtimeInfo = execSync2("aiwg runtime-info 2>/dev/null", {
|
|
2284
2239
|
cwd: projectDir,
|
|
2285
2240
|
encoding: "utf8",
|
|
2286
2241
|
timeout: 15e3
|
|
@@ -2401,7 +2356,7 @@ var init_aiwg_health = __esm({
|
|
|
2401
2356
|
}
|
|
2402
2357
|
isAiwgInstalled() {
|
|
2403
2358
|
try {
|
|
2404
|
-
|
|
2359
|
+
execSync2("aiwg --version", { encoding: "utf8", timeout: 5e3, stdio: ["pipe", "pipe", "pipe"] });
|
|
2405
2360
|
return true;
|
|
2406
2361
|
} catch {
|
|
2407
2362
|
return false;
|
|
@@ -2412,7 +2367,7 @@ var init_aiwg_health = __esm({
|
|
|
2412
2367
|
});
|
|
2413
2368
|
|
|
2414
2369
|
// packages/execution/dist/tools/aiwg-workflow.js
|
|
2415
|
-
import { execSync as
|
|
2370
|
+
import { execSync as execSync3 } from "node:child_process";
|
|
2416
2371
|
var AiwgWorkflowTool;
|
|
2417
2372
|
var init_aiwg_workflow = __esm({
|
|
2418
2373
|
"packages/execution/dist/tools/aiwg-workflow.js"() {
|
|
@@ -2460,7 +2415,7 @@ var init_aiwg_workflow = __esm({
|
|
|
2460
2415
|
}
|
|
2461
2416
|
const sanitized = command.replace(/[;&|`$()]/g, "");
|
|
2462
2417
|
try {
|
|
2463
|
-
const output =
|
|
2418
|
+
const output = execSync3(`aiwg ${sanitized}`, {
|
|
2464
2419
|
cwd: projectDir,
|
|
2465
2420
|
encoding: "utf8",
|
|
2466
2421
|
timeout: 12e4,
|
|
@@ -2486,7 +2441,7 @@ var init_aiwg_workflow = __esm({
|
|
|
2486
2441
|
}
|
|
2487
2442
|
isAiwgInstalled() {
|
|
2488
2443
|
try {
|
|
2489
|
-
|
|
2444
|
+
execSync3("aiwg --version", { encoding: "utf8", timeout: 5e3, stdio: ["pipe", "pipe", "pipe"] });
|
|
2490
2445
|
return true;
|
|
2491
2446
|
} catch {
|
|
2492
2447
|
return false;
|
|
@@ -3083,7 +3038,7 @@ var init_codebase_map = __esm({
|
|
|
3083
3038
|
});
|
|
3084
3039
|
|
|
3085
3040
|
// packages/execution/dist/tools/diagnostic.js
|
|
3086
|
-
import { execSync as
|
|
3041
|
+
import { execSync as execSync4 } from "node:child_process";
|
|
3087
3042
|
import { existsSync as existsSync5, readFileSync as readFileSync5 } from "node:fs";
|
|
3088
3043
|
import { join as join8 } from "node:path";
|
|
3089
3044
|
var DiagnosticTool;
|
|
@@ -3198,7 +3153,7 @@ var init_diagnostic = __esm({
|
|
|
3198
3153
|
runStep(step, command, cwd4) {
|
|
3199
3154
|
const start = performance.now();
|
|
3200
3155
|
try {
|
|
3201
|
-
const output =
|
|
3156
|
+
const output = execSync4(command, {
|
|
3202
3157
|
cwd: cwd4,
|
|
3203
3158
|
encoding: "utf8",
|
|
3204
3159
|
timeout: 12e4,
|
|
@@ -3228,7 +3183,7 @@ ${err.stderr ?? ""}`.trim(),
|
|
|
3228
3183
|
});
|
|
3229
3184
|
|
|
3230
3185
|
// packages/execution/dist/tools/git-info.js
|
|
3231
|
-
import { execSync as
|
|
3186
|
+
import { execSync as execSync5 } from "node:child_process";
|
|
3232
3187
|
import { existsSync as existsSync6 } from "node:fs";
|
|
3233
3188
|
import { join as join9 } from "node:path";
|
|
3234
3189
|
var GitInfoTool;
|
|
@@ -3344,7 +3299,7 @@ var init_git_info = __esm({
|
|
|
3344
3299
|
}
|
|
3345
3300
|
git(cwd4, cmd) {
|
|
3346
3301
|
try {
|
|
3347
|
-
return
|
|
3302
|
+
return execSync5(`git ${cmd}`, {
|
|
3348
3303
|
cwd: cwd4,
|
|
3349
3304
|
encoding: "utf8",
|
|
3350
3305
|
timeout: 1e4,
|
|
@@ -3649,7 +3604,7 @@ Exit code: ${task.exitCode ?? "N/A"}`,
|
|
|
3649
3604
|
// packages/execution/dist/tools/image.js
|
|
3650
3605
|
import { existsSync as existsSync7, readFileSync as readFileSync6, statSync as statSync4 } from "node:fs";
|
|
3651
3606
|
import { resolve as resolve11, extname as extname2, basename } from "node:path";
|
|
3652
|
-
import { execSync as
|
|
3607
|
+
import { execSync as execSync6 } from "node:child_process";
|
|
3653
3608
|
import { tmpdir } from "node:os";
|
|
3654
3609
|
import { join as join10 } from "node:path";
|
|
3655
3610
|
function isImagePath(path) {
|
|
@@ -3676,7 +3631,7 @@ function getMimeType(filePath) {
|
|
|
3676
3631
|
}
|
|
3677
3632
|
function getImageDimensions(filePath) {
|
|
3678
3633
|
try {
|
|
3679
|
-
const out =
|
|
3634
|
+
const out = execSync6(`identify -format "%w %h" ${JSON.stringify(filePath)}`, {
|
|
3680
3635
|
encoding: "utf8",
|
|
3681
3636
|
stdio: ["pipe", "pipe", "pipe"],
|
|
3682
3637
|
timeout: 5e3
|
|
@@ -3687,7 +3642,7 @@ function getImageDimensions(filePath) {
|
|
|
3687
3642
|
} catch {
|
|
3688
3643
|
}
|
|
3689
3644
|
try {
|
|
3690
|
-
const out =
|
|
3645
|
+
const out = execSync6(`file ${JSON.stringify(filePath)}`, {
|
|
3691
3646
|
encoding: "utf8",
|
|
3692
3647
|
stdio: ["pipe", "pipe", "pipe"],
|
|
3693
3648
|
timeout: 5e3
|
|
@@ -3701,7 +3656,7 @@ function getImageDimensions(filePath) {
|
|
|
3701
3656
|
}
|
|
3702
3657
|
function hasTesseract() {
|
|
3703
3658
|
try {
|
|
3704
|
-
|
|
3659
|
+
execSync6("tesseract --version", { stdio: "pipe", timeout: 5e3 });
|
|
3705
3660
|
return true;
|
|
3706
3661
|
} catch {
|
|
3707
3662
|
return false;
|
|
@@ -3709,7 +3664,7 @@ function hasTesseract() {
|
|
|
3709
3664
|
}
|
|
3710
3665
|
function runOCR(filePath) {
|
|
3711
3666
|
try {
|
|
3712
|
-
return
|
|
3667
|
+
return execSync6(`tesseract ${JSON.stringify(filePath)} stdout 2>/dev/null`, {
|
|
3713
3668
|
encoding: "utf8",
|
|
3714
3669
|
stdio: ["pipe", "pipe", "pipe"],
|
|
3715
3670
|
timeout: 3e4
|
|
@@ -3842,7 +3797,7 @@ ${ocrText}`);
|
|
|
3842
3797
|
};
|
|
3843
3798
|
}
|
|
3844
3799
|
try {
|
|
3845
|
-
|
|
3800
|
+
execSync6(cmd, { stdio: "pipe", timeout: 1e4 });
|
|
3846
3801
|
} catch (err) {
|
|
3847
3802
|
return {
|
|
3848
3803
|
success: false,
|
|
@@ -3890,7 +3845,7 @@ ${ocrText}`);
|
|
|
3890
3845
|
if (plat === "linux") {
|
|
3891
3846
|
for (const tool of ["scrot", "gnome-screenshot", "import"]) {
|
|
3892
3847
|
try {
|
|
3893
|
-
|
|
3848
|
+
execSync6(`which ${tool}`, { stdio: "pipe" });
|
|
3894
3849
|
if (tool === "scrot") {
|
|
3895
3850
|
if (region === "active")
|
|
3896
3851
|
return `scrot -u ${out}`;
|
|
@@ -3967,14 +3922,14 @@ ${ocrText}`);
|
|
|
3967
3922
|
if (x != null && y != null && w != null && h != null) {
|
|
3968
3923
|
const croppedPath = join10(tmpdir(), `oa-ocr-crop-${Date.now()}.png`);
|
|
3969
3924
|
try {
|
|
3970
|
-
|
|
3925
|
+
execSync6(`convert ${JSON.stringify(fullPath)} -crop ${w}x${h}+${x}+${y} +repage ${JSON.stringify(croppedPath)}`, { stdio: "pipe", timeout: 1e4 });
|
|
3971
3926
|
inputPath = croppedPath;
|
|
3972
3927
|
} catch {
|
|
3973
3928
|
}
|
|
3974
3929
|
}
|
|
3975
3930
|
}
|
|
3976
3931
|
try {
|
|
3977
|
-
const text =
|
|
3932
|
+
const text = execSync6(`tesseract ${JSON.stringify(inputPath)} stdout -l ${language} --psm ${psm} 2>/dev/null`, { encoding: "utf8", stdio: ["pipe", "pipe", "pipe"], timeout: 3e4 }).trim();
|
|
3978
3933
|
if (!text) {
|
|
3979
3934
|
return { success: true, output: "(no text detected in image)", durationMs: Date.now() - start };
|
|
3980
3935
|
}
|
|
@@ -4509,7 +4464,7 @@ var init_tool_creator = __esm({
|
|
|
4509
4464
|
import { existsSync as existsSync9, readdirSync as readdirSync5, readFileSync as readFileSync8 } from "node:fs";
|
|
4510
4465
|
import { join as join12, basename as basename2, dirname as dirname2 } from "node:path";
|
|
4511
4466
|
import { homedir as homedir4 } from "node:os";
|
|
4512
|
-
import { execSync as
|
|
4467
|
+
import { execSync as execSync7 } from "node:child_process";
|
|
4513
4468
|
function getAiwgPaths() {
|
|
4514
4469
|
const dataDir = join12(homedir4(), ".local", "share", "ai-writing-guide");
|
|
4515
4470
|
return {
|
|
@@ -4522,7 +4477,7 @@ function findAiwgPackageRoot() {
|
|
|
4522
4477
|
if (_cachedAiwgPkgRoot !== void 0)
|
|
4523
4478
|
return _cachedAiwgPkgRoot;
|
|
4524
4479
|
try {
|
|
4525
|
-
const globalRoot =
|
|
4480
|
+
const globalRoot = execSync7("npm root -g", {
|
|
4526
4481
|
encoding: "utf-8",
|
|
4527
4482
|
timeout: 5e3,
|
|
4528
4483
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -4858,7 +4813,7 @@ ${content}`,
|
|
|
4858
4813
|
import { existsSync as existsSync10, mkdirSync as mkdirSync4, writeFileSync as writeFileSync4, readFileSync as readFileSync9, unlinkSync } from "node:fs";
|
|
4859
4814
|
import { join as join13, basename as basename3, extname as extname3, resolve as resolve12 } from "node:path";
|
|
4860
4815
|
import { homedir as homedir5 } from "node:os";
|
|
4861
|
-
import { execSync as
|
|
4816
|
+
import { execSync as execSync8, spawn as spawn4 } from "node:child_process";
|
|
4862
4817
|
function isTranscribable(path) {
|
|
4863
4818
|
const ext = extname3(path).toLowerCase();
|
|
4864
4819
|
return AUDIO_EXTS.has(ext) || VIDEO_EXTS.has(ext);
|
|
@@ -4868,7 +4823,7 @@ async function loadTranscribeCli() {
|
|
|
4868
4823
|
return _tcModule;
|
|
4869
4824
|
_tcChecked = true;
|
|
4870
4825
|
try {
|
|
4871
|
-
const globalRoot =
|
|
4826
|
+
const globalRoot = execSync8("npm root -g", {
|
|
4872
4827
|
encoding: "utf-8",
|
|
4873
4828
|
timeout: 5e3,
|
|
4874
4829
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -5033,7 +4988,7 @@ var init_transcribe_tool = __esm({
|
|
|
5033
4988
|
const args = [filePath, "-m", model, "-f", "txt"];
|
|
5034
4989
|
if (diarize)
|
|
5035
4990
|
args.push("--diarize");
|
|
5036
|
-
const output =
|
|
4991
|
+
const output = execSync8(`transcribe-cli ${args.join(" ")}`, {
|
|
5037
4992
|
encoding: "utf-8",
|
|
5038
4993
|
timeout: 3e5,
|
|
5039
4994
|
// 5 min max
|
|
@@ -5100,12 +5055,12 @@ var init_transcribe_tool = __esm({
|
|
|
5100
5055
|
const tmpFile = join13(tmpDir, `download-${Date.now()}${ext}`);
|
|
5101
5056
|
try {
|
|
5102
5057
|
try {
|
|
5103
|
-
|
|
5058
|
+
execSync8(`curl -sL -o "${tmpFile}" "${url}"`, {
|
|
5104
5059
|
timeout: 12e4,
|
|
5105
5060
|
stdio: ["pipe", "pipe", "pipe"]
|
|
5106
5061
|
});
|
|
5107
5062
|
} catch {
|
|
5108
|
-
|
|
5063
|
+
execSync8(`wget -q -O "${tmpFile}" "${url}"`, {
|
|
5109
5064
|
timeout: 12e4,
|
|
5110
5065
|
stdio: ["pipe", "pipe", "pipe"]
|
|
5111
5066
|
});
|
|
@@ -9051,7 +9006,7 @@ var init_dist5 = __esm({
|
|
|
9051
9006
|
});
|
|
9052
9007
|
|
|
9053
9008
|
// packages/cli/dist/tui/listen.js
|
|
9054
|
-
import { spawn as spawn5, execSync as
|
|
9009
|
+
import { spawn as spawn5, execSync as execSync9 } from "node:child_process";
|
|
9055
9010
|
import { existsSync as existsSync11, mkdirSync as mkdirSync5, writeFileSync as writeFileSync5 } from "node:fs";
|
|
9056
9011
|
import { join as join16 } from "node:path";
|
|
9057
9012
|
import { homedir as homedir6 } from "node:os";
|
|
@@ -9071,7 +9026,7 @@ function findMicCaptureCommand() {
|
|
|
9071
9026
|
const platform3 = process.platform;
|
|
9072
9027
|
if (platform3 === "linux") {
|
|
9073
9028
|
try {
|
|
9074
|
-
|
|
9029
|
+
execSync9("which arecord", { stdio: "pipe" });
|
|
9075
9030
|
return {
|
|
9076
9031
|
cmd: "arecord",
|
|
9077
9032
|
args: ["-f", "S16_LE", "-r", "16000", "-c", "1", "-t", "raw", "-q", "-"]
|
|
@@ -9081,7 +9036,7 @@ function findMicCaptureCommand() {
|
|
|
9081
9036
|
}
|
|
9082
9037
|
if (platform3 === "darwin") {
|
|
9083
9038
|
try {
|
|
9084
|
-
|
|
9039
|
+
execSync9("which sox", { stdio: "pipe" });
|
|
9085
9040
|
return {
|
|
9086
9041
|
cmd: "sox",
|
|
9087
9042
|
args: ["-d", "-t", "raw", "-r", "16000", "-c", "1", "-b", "16", "-e", "signed-integer", "-"]
|
|
@@ -9090,7 +9045,7 @@ function findMicCaptureCommand() {
|
|
|
9090
9045
|
}
|
|
9091
9046
|
}
|
|
9092
9047
|
try {
|
|
9093
|
-
|
|
9048
|
+
execSync9("which ffmpeg", { stdio: "pipe" });
|
|
9094
9049
|
if (platform3 === "linux") {
|
|
9095
9050
|
return {
|
|
9096
9051
|
cmd: "ffmpeg",
|
|
@@ -9139,7 +9094,7 @@ function ensureTranscribeCliBackground() {
|
|
|
9139
9094
|
return;
|
|
9140
9095
|
_bgInstallPromise = (async () => {
|
|
9141
9096
|
try {
|
|
9142
|
-
const globalRoot =
|
|
9097
|
+
const globalRoot = execSync9("npm root -g", {
|
|
9143
9098
|
encoding: "utf-8",
|
|
9144
9099
|
timeout: 5e3,
|
|
9145
9100
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -9246,7 +9201,7 @@ var init_listen = __esm({
|
|
|
9246
9201
|
}
|
|
9247
9202
|
if (!this.transcribeCliAvailable) {
|
|
9248
9203
|
try {
|
|
9249
|
-
|
|
9204
|
+
execSync9("which transcribe-cli", { stdio: "pipe" });
|
|
9250
9205
|
this.transcribeCliAvailable = true;
|
|
9251
9206
|
} catch {
|
|
9252
9207
|
this.transcribeCliAvailable = false;
|
|
@@ -9263,7 +9218,7 @@ var init_listen = __esm({
|
|
|
9263
9218
|
} catch {
|
|
9264
9219
|
}
|
|
9265
9220
|
try {
|
|
9266
|
-
const globalRoot =
|
|
9221
|
+
const globalRoot = execSync9("npm root -g", {
|
|
9267
9222
|
encoding: "utf-8",
|
|
9268
9223
|
timeout: 5e3,
|
|
9269
9224
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -9314,7 +9269,7 @@ var init_listen = __esm({
|
|
|
9314
9269
|
if (!tc) {
|
|
9315
9270
|
this.emit("info", "Installing transcribe-cli...");
|
|
9316
9271
|
try {
|
|
9317
|
-
|
|
9272
|
+
execSync9("npm i -g transcribe-cli", { stdio: "pipe", timeout: 18e4 });
|
|
9318
9273
|
this.transcribeCliAvailable = null;
|
|
9319
9274
|
tc = await this.loadTranscribeCli();
|
|
9320
9275
|
} catch {
|
|
@@ -9451,7 +9406,7 @@ var init_listen = __esm({
|
|
|
9451
9406
|
}
|
|
9452
9407
|
if (!tc) {
|
|
9453
9408
|
try {
|
|
9454
|
-
|
|
9409
|
+
execSync9("npm i -g transcribe-cli", { stdio: "pipe", timeout: 18e4 });
|
|
9455
9410
|
this.transcribeCliAvailable = null;
|
|
9456
9411
|
tc = await this.loadTranscribeCli();
|
|
9457
9412
|
} catch {
|
|
@@ -10534,7 +10489,7 @@ async function handleSlashCommand(input, ctx) {
|
|
|
10534
10489
|
return "handled";
|
|
10535
10490
|
case "update":
|
|
10536
10491
|
case "upgrade":
|
|
10537
|
-
await handleUpdate(arg, ctx.repoRoot
|
|
10492
|
+
await handleUpdate(arg, ctx.repoRoot);
|
|
10538
10493
|
return "handled";
|
|
10539
10494
|
case "voice": {
|
|
10540
10495
|
const save = hasLocal ? ctx.saveLocalSettings.bind(ctx) : ctx.saveSettings.bind(ctx);
|
|
@@ -10804,7 +10759,7 @@ async function handleEndpoint(arg, ctx, local = false) {
|
|
|
10804
10759
|
}
|
|
10805
10760
|
process.stdout.write("\n");
|
|
10806
10761
|
}
|
|
10807
|
-
async function handleUpdate(subcommand, repoRoot
|
|
10762
|
+
async function handleUpdate(subcommand, repoRoot) {
|
|
10808
10763
|
if (subcommand === "auto") {
|
|
10809
10764
|
const settings = { updateMode: "auto" };
|
|
10810
10765
|
saveProjectSettings(repoRoot, settings);
|
|
@@ -10855,26 +10810,17 @@ async function handleUpdate(subcommand, repoRoot, savePendingTaskState) {
|
|
|
10855
10810
|
}
|
|
10856
10811
|
process.stdout.write(` ${c2.yellow("\u26A0")} Update available: v${info.currentVersion} \u2192 v${c2.bold(c2.green(info.latestVersion))}
|
|
10857
10812
|
`);
|
|
10858
|
-
process.stdout.write(` ${c2.cyan("\u25CF")} Installing
|
|
10813
|
+
process.stdout.write(` ${c2.cyan("\u25CF")} Installing in background...
|
|
10859
10814
|
|
|
10860
10815
|
`);
|
|
10861
|
-
const
|
|
10862
|
-
|
|
10863
|
-
|
|
10864
|
-
|
|
10865
|
-
|
|
10866
|
-
|
|
10867
|
-
try {
|
|
10868
|
-
savePendingTaskState();
|
|
10869
|
-
} catch {
|
|
10816
|
+
const { exec } = await import("node:child_process");
|
|
10817
|
+
exec(`npm cache clean --force open-agents-ai 2>/dev/null; npm install -g open-agents-ai@latest --force`, { timeout: 18e4 }, (err) => {
|
|
10818
|
+
if (err) {
|
|
10819
|
+
renderWarning("Update install failed. Try manually: npm i -g open-agents-ai");
|
|
10820
|
+
} else {
|
|
10821
|
+
renderInfo(`${c2.green("\u2714")} Updated to v${info.latestVersion}. Takes effect next session.`);
|
|
10870
10822
|
}
|
|
10871
|
-
}
|
|
10872
|
-
process.env.__OA_RESUMED = "1";
|
|
10873
|
-
process.stdout.write(`
|
|
10874
|
-
${c2.green("\u2714")} Updated to v${info.latestVersion}. Restarting...
|
|
10875
|
-
|
|
10876
|
-
`);
|
|
10877
|
-
restartProcess();
|
|
10823
|
+
});
|
|
10878
10824
|
}
|
|
10879
10825
|
async function switchModel(query, ctx, local = false) {
|
|
10880
10826
|
try {
|
|
@@ -10917,7 +10863,7 @@ var init_commands = __esm({
|
|
|
10917
10863
|
|
|
10918
10864
|
// packages/cli/dist/tui/setup.js
|
|
10919
10865
|
import * as readline from "node:readline";
|
|
10920
|
-
import { execSync as
|
|
10866
|
+
import { execSync as execSync10 } from "node:child_process";
|
|
10921
10867
|
import { existsSync as existsSync13, writeFileSync as writeFileSync7, mkdirSync as mkdirSync7 } from "node:fs";
|
|
10922
10868
|
import { join as join18 } from "node:path";
|
|
10923
10869
|
import { homedir as homedir8 } from "node:os";
|
|
@@ -10927,7 +10873,7 @@ function detectSystemSpecs() {
|
|
|
10927
10873
|
let gpuVramGB = 0;
|
|
10928
10874
|
let gpuName = "";
|
|
10929
10875
|
try {
|
|
10930
|
-
const memInfo =
|
|
10876
|
+
const memInfo = execSync10("free -b 2>/dev/null || sysctl -n hw.memsize 2>/dev/null", {
|
|
10931
10877
|
encoding: "utf8",
|
|
10932
10878
|
timeout: 5e3
|
|
10933
10879
|
});
|
|
@@ -10947,7 +10893,7 @@ function detectSystemSpecs() {
|
|
|
10947
10893
|
} catch {
|
|
10948
10894
|
}
|
|
10949
10895
|
try {
|
|
10950
|
-
const nvidiaSmi =
|
|
10896
|
+
const nvidiaSmi = execSync10("nvidia-smi --query-gpu=memory.total,name --format=csv,noheader,nounits 2>/dev/null", { encoding: "utf8", timeout: 5e3 });
|
|
10951
10897
|
const lines = nvidiaSmi.trim().split("\n");
|
|
10952
10898
|
if (lines.length > 0) {
|
|
10953
10899
|
for (const line of lines) {
|
|
@@ -11009,7 +10955,7 @@ function ask(rl, question) {
|
|
|
11009
10955
|
}
|
|
11010
10956
|
function pullModelWithAutoUpdate(tag) {
|
|
11011
10957
|
try {
|
|
11012
|
-
|
|
10958
|
+
execSync10(`ollama pull ${tag}`, {
|
|
11013
10959
|
stdio: "inherit",
|
|
11014
10960
|
timeout: 36e5
|
|
11015
10961
|
// 1 hour max
|
|
@@ -11026,7 +10972,7 @@ function pullModelWithAutoUpdate(tag) {
|
|
|
11026
10972
|
|
|
11027
10973
|
`);
|
|
11028
10974
|
try {
|
|
11029
|
-
|
|
10975
|
+
execSync10("curl -fsSL https://ollama.com/install.sh | sh", {
|
|
11030
10976
|
stdio: "inherit",
|
|
11031
10977
|
timeout: 3e5
|
|
11032
10978
|
// 5 min max for install
|
|
@@ -11037,7 +10983,7 @@ function pullModelWithAutoUpdate(tag) {
|
|
|
11037
10983
|
process.stdout.write(` ${c2.cyan("\u25CF")} Retrying pull of ${c2.bold(tag)}...
|
|
11038
10984
|
|
|
11039
10985
|
`);
|
|
11040
|
-
|
|
10986
|
+
execSync10(`ollama pull ${tag}`, {
|
|
11041
10987
|
stdio: "inherit",
|
|
11042
10988
|
timeout: 36e5
|
|
11043
10989
|
});
|
|
@@ -11220,7 +11166,7 @@ async function doSetup(config, rl) {
|
|
|
11220
11166
|
const modelfilePath = join18(modelDir2, `Modelfile.${customName}`);
|
|
11221
11167
|
writeFileSync7(modelfilePath, modelfileContent + "\n", "utf8");
|
|
11222
11168
|
process.stdout.write(` ${c2.dim("Creating model...")} `);
|
|
11223
|
-
|
|
11169
|
+
execSync10(`ollama create ${customName} -f ${modelfilePath}`, {
|
|
11224
11170
|
stdio: "pipe",
|
|
11225
11171
|
timeout: 12e4
|
|
11226
11172
|
});
|
|
@@ -11305,7 +11251,7 @@ var init_setup = __esm({
|
|
|
11305
11251
|
// packages/cli/dist/tui/project-context.js
|
|
11306
11252
|
import { existsSync as existsSync14, readFileSync as readFileSync11, readdirSync as readdirSync7 } from "node:fs";
|
|
11307
11253
|
import { join as join19, basename as basename5 } from "node:path";
|
|
11308
|
-
import { execSync as
|
|
11254
|
+
import { execSync as execSync11 } from "node:child_process";
|
|
11309
11255
|
import { homedir as homedir9, platform, release } from "node:os";
|
|
11310
11256
|
function loadProjectFiles(repoRoot) {
|
|
11311
11257
|
const discovered = discoverContextFiles(repoRoot);
|
|
@@ -11336,19 +11282,19 @@ function loadProjectMap(repoRoot) {
|
|
|
11336
11282
|
}
|
|
11337
11283
|
function getGitInfo(repoRoot) {
|
|
11338
11284
|
try {
|
|
11339
|
-
|
|
11285
|
+
execSync11("git rev-parse --is-inside-work-tree", { cwd: repoRoot, stdio: "pipe" });
|
|
11340
11286
|
} catch {
|
|
11341
11287
|
return "";
|
|
11342
11288
|
}
|
|
11343
11289
|
const lines = [];
|
|
11344
11290
|
try {
|
|
11345
|
-
const branch =
|
|
11291
|
+
const branch = execSync11("git branch --show-current", { cwd: repoRoot, encoding: "utf-8", stdio: "pipe" }).trim();
|
|
11346
11292
|
if (branch)
|
|
11347
11293
|
lines.push(`Branch: ${branch}`);
|
|
11348
11294
|
} catch {
|
|
11349
11295
|
}
|
|
11350
11296
|
try {
|
|
11351
|
-
const status =
|
|
11297
|
+
const status = execSync11("git status --porcelain", { cwd: repoRoot, encoding: "utf-8", stdio: "pipe" }).trim();
|
|
11352
11298
|
if (status) {
|
|
11353
11299
|
const changed = status.split("\n").length;
|
|
11354
11300
|
lines.push(`Working tree: ${changed} changed file(s)`);
|
|
@@ -11358,7 +11304,7 @@ function getGitInfo(repoRoot) {
|
|
|
11358
11304
|
} catch {
|
|
11359
11305
|
}
|
|
11360
11306
|
try {
|
|
11361
|
-
const log =
|
|
11307
|
+
const log = execSync11("git log --oneline -5 --no-decorate", { cwd: repoRoot, encoding: "utf-8", stdio: "pipe" }).trim();
|
|
11362
11308
|
if (log)
|
|
11363
11309
|
lines.push(`Recent commits:
|
|
11364
11310
|
${log}`);
|
|
@@ -12406,7 +12352,7 @@ var init_carousel = __esm({
|
|
|
12406
12352
|
import { existsSync as existsSync15, mkdirSync as mkdirSync8, writeFileSync as writeFileSync8, readFileSync as readFileSync12, unlinkSync as unlinkSync3 } from "node:fs";
|
|
12407
12353
|
import { join as join20 } from "node:path";
|
|
12408
12354
|
import { homedir as homedir10, tmpdir as tmpdir2, platform as platform2 } from "node:os";
|
|
12409
|
-
import { execSync as
|
|
12355
|
+
import { execSync as execSync12, spawn as nodeSpawn } from "node:child_process";
|
|
12410
12356
|
import { createRequire } from "node:module";
|
|
12411
12357
|
function voiceDir() {
|
|
12412
12358
|
return join20(homedir10(), ".open-agents", "voice");
|
|
@@ -12824,7 +12770,7 @@ var init_voice = __esm({
|
|
|
12824
12770
|
}
|
|
12825
12771
|
for (const player of ["paplay", "pw-play", "aplay"]) {
|
|
12826
12772
|
try {
|
|
12827
|
-
|
|
12773
|
+
execSync12(`which ${player}`, { stdio: "pipe" });
|
|
12828
12774
|
return [player, path];
|
|
12829
12775
|
} catch {
|
|
12830
12776
|
}
|
|
@@ -12875,7 +12821,7 @@ var init_voice = __esm({
|
|
|
12875
12821
|
} catch {
|
|
12876
12822
|
renderInfo("Installing ONNX runtime for voice synthesis...");
|
|
12877
12823
|
try {
|
|
12878
|
-
|
|
12824
|
+
execSync12("npm install --no-audit --no-fund", {
|
|
12879
12825
|
cwd: voiceDir(),
|
|
12880
12826
|
stdio: "pipe",
|
|
12881
12827
|
timeout: 12e4
|
|
@@ -12892,7 +12838,7 @@ Error: ${err instanceof Error ? err.message : String(err)}`);
|
|
|
12892
12838
|
} catch {
|
|
12893
12839
|
renderInfo("Installing phonemizer for voice synthesis...");
|
|
12894
12840
|
try {
|
|
12895
|
-
|
|
12841
|
+
execSync12("npm install --no-audit --no-fund", {
|
|
12896
12842
|
cwd: voiceDir(),
|
|
12897
12843
|
stdio: "pipe",
|
|
12898
12844
|
timeout: 12e4
|
|
@@ -13539,7 +13485,7 @@ var init_edit_history = __esm({
|
|
|
13539
13485
|
// packages/cli/dist/tui/dream-engine.js
|
|
13540
13486
|
import { mkdirSync as mkdirSync10, writeFileSync as writeFileSync9, readFileSync as readFileSync13, existsSync as existsSync16, cpSync, rmSync, readdirSync as readdirSync8 } from "node:fs";
|
|
13541
13487
|
import { join as join22, basename as basename6 } from "node:path";
|
|
13542
|
-
import { execSync as
|
|
13488
|
+
import { execSync as execSync13 } from "node:child_process";
|
|
13543
13489
|
function adaptTool(tool) {
|
|
13544
13490
|
return {
|
|
13545
13491
|
name: tool.name,
|
|
@@ -13792,7 +13738,7 @@ var init_dream_engine = __esm({
|
|
|
13792
13738
|
}
|
|
13793
13739
|
}
|
|
13794
13740
|
try {
|
|
13795
|
-
const output =
|
|
13741
|
+
const output = execSync13(cmd, {
|
|
13796
13742
|
cwd: this.repoRoot,
|
|
13797
13743
|
timeout: 3e4,
|
|
13798
13744
|
encoding: "utf-8",
|
|
@@ -14012,17 +13958,17 @@ Dreams directory: ${this.dreamsDir}`);
|
|
|
14012
13958
|
try {
|
|
14013
13959
|
mkdirSync10(checkpointDir, { recursive: true });
|
|
14014
13960
|
try {
|
|
14015
|
-
const gitStatus =
|
|
13961
|
+
const gitStatus = execSync13("git status --porcelain", {
|
|
14016
13962
|
cwd: this.repoRoot,
|
|
14017
13963
|
encoding: "utf-8",
|
|
14018
13964
|
timeout: 1e4
|
|
14019
13965
|
});
|
|
14020
|
-
const gitDiff =
|
|
13966
|
+
const gitDiff = execSync13("git diff", {
|
|
14021
13967
|
cwd: this.repoRoot,
|
|
14022
13968
|
encoding: "utf-8",
|
|
14023
13969
|
timeout: 1e4
|
|
14024
13970
|
});
|
|
14025
|
-
const gitHash =
|
|
13971
|
+
const gitHash = execSync13("git rev-parse HEAD 2>/dev/null || echo 'no-git'", {
|
|
14026
13972
|
cwd: this.repoRoot,
|
|
14027
13973
|
encoding: "utf-8",
|
|
14028
13974
|
timeout: 5e3
|
|
@@ -15330,21 +15276,12 @@ Summarize or analyze this transcription as appropriate.`;
|
|
|
15330
15276
|
try {
|
|
15331
15277
|
const updateInfo = await checkForUpdate(version);
|
|
15332
15278
|
if (updateInfo) {
|
|
15333
|
-
|
|
15334
|
-
|
|
15335
|
-
|
|
15336
|
-
|
|
15337
|
-
|
|
15338
|
-
|
|
15339
|
-
statusBar.deactivate();
|
|
15340
|
-
if (carousel.isRunning)
|
|
15341
|
-
carousel.stop();
|
|
15342
|
-
voiceEngine.dispose();
|
|
15343
|
-
rl.close();
|
|
15344
|
-
restartProcess();
|
|
15345
|
-
} else {
|
|
15346
|
-
writeContent(() => renderWarning("Auto-update failed. Use /update to retry manually."));
|
|
15347
|
-
}
|
|
15279
|
+
const { exec } = await import("node:child_process");
|
|
15280
|
+
exec(`npm install -g open-agents-ai@latest --prefer-online`, { timeout: 18e4 }, (err) => {
|
|
15281
|
+
if (!err) {
|
|
15282
|
+
writeContent(() => renderInfo(`Updated to v${updateInfo.latestVersion} in background. Takes effect next session.`));
|
|
15283
|
+
}
|
|
15284
|
+
});
|
|
15348
15285
|
}
|
|
15349
15286
|
} catch {
|
|
15350
15287
|
}
|
package/package.json
CHANGED