open-agents-ai 0.103.14 → 0.103.15
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 +76 -42
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -18258,10 +18258,10 @@ ${marker}` : marker);
|
|
|
18258
18258
|
if (!this._workingDirectory)
|
|
18259
18259
|
return;
|
|
18260
18260
|
try {
|
|
18261
|
-
const { mkdirSync:
|
|
18261
|
+
const { mkdirSync: mkdirSync20, writeFileSync: writeFileSync18 } = __require("node:fs");
|
|
18262
18262
|
const { join: join55 } = __require("node:path");
|
|
18263
18263
|
const sessionDir = join55(this._workingDirectory, ".oa", "session", this._sessionId);
|
|
18264
|
-
|
|
18264
|
+
mkdirSync20(sessionDir, { recursive: true });
|
|
18265
18265
|
const checkpoint = {
|
|
18266
18266
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
18267
18267
|
sessionId: this._sessionId,
|
|
@@ -26203,7 +26203,7 @@ import { EventEmitter as EventEmitter3 } from "node:events";
|
|
|
26203
26203
|
import { randomBytes as randomBytes7 } from "node:crypto";
|
|
26204
26204
|
import { URL as URL2 } from "node:url";
|
|
26205
26205
|
import { loadavg, cpus, totalmem, freemem } from "node:os";
|
|
26206
|
-
import { existsSync as existsSync26, readFileSync as readFileSync18, writeFileSync as writeFileSync8, unlinkSync as unlinkSync3 } from "node:fs";
|
|
26206
|
+
import { existsSync as existsSync26, readFileSync as readFileSync18, writeFileSync as writeFileSync8, unlinkSync as unlinkSync3, mkdirSync as mkdirSync8 } from "node:fs";
|
|
26207
26207
|
import { join as join35 } from "node:path";
|
|
26208
26208
|
function cleanForwardHeaders(raw, targetHost) {
|
|
26209
26209
|
const out = {};
|
|
@@ -26239,6 +26239,7 @@ function readExposeState(stateDir) {
|
|
|
26239
26239
|
}
|
|
26240
26240
|
function writeExposeState(stateDir, state) {
|
|
26241
26241
|
try {
|
|
26242
|
+
mkdirSync8(stateDir, { recursive: true });
|
|
26242
26243
|
writeFileSync8(join35(stateDir, STATE_FILE_NAME), JSON.stringify(state, null, 2));
|
|
26243
26244
|
} catch {
|
|
26244
26245
|
}
|
|
@@ -26334,6 +26335,8 @@ var init_expose = __esm({
|
|
|
26334
26335
|
cloudflaredProcess = null;
|
|
26335
26336
|
/** PID of detached cloudflared (for killing on stop, even across OA restarts) */
|
|
26336
26337
|
_cloudflaredPid = null;
|
|
26338
|
+
/** Periodic PID watchdog for reconnect mode (no ChildProcess close event) */
|
|
26339
|
+
_pidWatchdog = null;
|
|
26337
26340
|
_tunnelUrl = null;
|
|
26338
26341
|
_authKey;
|
|
26339
26342
|
_targetUrl;
|
|
@@ -26425,9 +26428,11 @@ var init_expose = __esm({
|
|
|
26425
26428
|
});
|
|
26426
26429
|
this._stats.status = "active";
|
|
26427
26430
|
this.emitStats();
|
|
26431
|
+
this.startPidWatchdog();
|
|
26428
26432
|
return this._tunnelUrl;
|
|
26429
26433
|
}
|
|
26430
26434
|
async stop() {
|
|
26435
|
+
this.stopPidWatchdog();
|
|
26431
26436
|
if (this._cloudflaredPid && isProcessAlive(this._cloudflaredPid)) {
|
|
26432
26437
|
try {
|
|
26433
26438
|
process.kill(this._cloudflaredPid, "SIGTERM");
|
|
@@ -26476,8 +26481,10 @@ var init_expose = __esm({
|
|
|
26476
26481
|
});
|
|
26477
26482
|
try {
|
|
26478
26483
|
await gateway.reconnect(state);
|
|
26484
|
+
options.onInfo?.(`Expose tunnel reconnected: ${state.tunnelUrl}`);
|
|
26479
26485
|
return gateway;
|
|
26480
|
-
} catch {
|
|
26486
|
+
} catch (err) {
|
|
26487
|
+
options.onError?.(`Expose reconnect failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
26481
26488
|
return null;
|
|
26482
26489
|
}
|
|
26483
26490
|
}
|
|
@@ -26702,7 +26709,8 @@ var init_expose = __esm({
|
|
|
26702
26709
|
this._tunnelUrl = await this.startCloudflared(this._proxyPort);
|
|
26703
26710
|
this._stats.status = "active";
|
|
26704
26711
|
this.emitStats();
|
|
26705
|
-
this.options.onInfo?.(`Tunnel restarted:
|
|
26712
|
+
this.options.onInfo?.(`Tunnel restarted with new URL \u2014 share with consumers:
|
|
26713
|
+
${this.formatConnectionInfo()}`);
|
|
26706
26714
|
if (this._stateDir) {
|
|
26707
26715
|
writeExposeState(this._stateDir, {
|
|
26708
26716
|
pid: this._cloudflaredPid,
|
|
@@ -26718,6 +26726,32 @@ var init_expose = __esm({
|
|
|
26718
26726
|
this.options.onError?.(`Tunnel restart failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
26719
26727
|
}
|
|
26720
26728
|
}
|
|
26729
|
+
/**
|
|
26730
|
+
* Periodically check if the cloudflared PID is still alive.
|
|
26731
|
+
* Used in reconnect mode where we don't have a ChildProcess close event.
|
|
26732
|
+
* If cloudflared dies, triggers auto-restart.
|
|
26733
|
+
*/
|
|
26734
|
+
startPidWatchdog() {
|
|
26735
|
+
this.stopPidWatchdog();
|
|
26736
|
+
this._pidWatchdog = setInterval(() => {
|
|
26737
|
+
if (!this._cloudflaredPid || !isProcessAlive(this._cloudflaredPid)) {
|
|
26738
|
+
this.stopPidWatchdog();
|
|
26739
|
+
if (this._stats.status === "active") {
|
|
26740
|
+
this.options.onInfo?.("Cloudflared tunnel died (detected by watchdog) \u2014 restarting...");
|
|
26741
|
+
this._stats.status = "error";
|
|
26742
|
+
this.emitStats();
|
|
26743
|
+
this.restartCloudflared();
|
|
26744
|
+
}
|
|
26745
|
+
}
|
|
26746
|
+
}, 1e4);
|
|
26747
|
+
this._pidWatchdog.unref();
|
|
26748
|
+
}
|
|
26749
|
+
stopPidWatchdog() {
|
|
26750
|
+
if (this._pidWatchdog) {
|
|
26751
|
+
clearInterval(this._pidWatchdog);
|
|
26752
|
+
this._pidWatchdog = null;
|
|
26753
|
+
}
|
|
26754
|
+
}
|
|
26721
26755
|
// ── Helpers ─────────────────────────────────────────────────────────────
|
|
26722
26756
|
findFreePort() {
|
|
26723
26757
|
return new Promise((resolve31, reject) => {
|
|
@@ -26792,7 +26826,7 @@ var init_types = __esm({
|
|
|
26792
26826
|
|
|
26793
26827
|
// packages/cli/dist/tui/p2p/secret-vault.js
|
|
26794
26828
|
import { createCipheriv as createCipheriv2, createDecipheriv as createDecipheriv2, randomBytes as randomBytes8, scryptSync as scryptSync2, createHash as createHash2 } from "node:crypto";
|
|
26795
|
-
import { readFileSync as readFileSync19, writeFileSync as writeFileSync9, existsSync as existsSync27, mkdirSync as
|
|
26829
|
+
import { readFileSync as readFileSync19, writeFileSync as writeFileSync9, existsSync as existsSync27, mkdirSync as mkdirSync9 } from "node:fs";
|
|
26796
26830
|
import { join as join36, dirname as dirname13 } from "node:path";
|
|
26797
26831
|
var PLACEHOLDER_PREFIX, PLACEHOLDER_SUFFIX, CIPHER_ALGO, SALT_LEN, IV_LEN, KEY_LEN, SecretVault;
|
|
26798
26832
|
var init_secret_vault = __esm({
|
|
@@ -27006,7 +27040,7 @@ var init_secret_vault = __esm({
|
|
|
27006
27040
|
const blob = Buffer.concat([salt, iv, tag, encrypted]);
|
|
27007
27041
|
const dir = dirname13(this.storePath);
|
|
27008
27042
|
if (!existsSync27(dir))
|
|
27009
|
-
|
|
27043
|
+
mkdirSync9(dir, { recursive: true });
|
|
27010
27044
|
writeFileSync9(this.storePath, blob, { mode: 384 });
|
|
27011
27045
|
}
|
|
27012
27046
|
/**
|
|
@@ -28388,13 +28422,13 @@ var init_dist6 = __esm({
|
|
|
28388
28422
|
});
|
|
28389
28423
|
|
|
28390
28424
|
// packages/cli/dist/tui/oa-directory.js
|
|
28391
|
-
import { existsSync as existsSync29, mkdirSync as
|
|
28425
|
+
import { existsSync as existsSync29, mkdirSync as mkdirSync10, readFileSync as readFileSync21, writeFileSync as writeFileSync10, readdirSync as readdirSync7, statSync as statSync9, unlinkSync as unlinkSync4 } from "node:fs";
|
|
28392
28426
|
import { join as join39, relative as relative2, basename as basename9, extname as extname8 } from "node:path";
|
|
28393
28427
|
import { homedir as homedir9 } from "node:os";
|
|
28394
28428
|
function initOaDirectory(repoRoot) {
|
|
28395
28429
|
const oaPath = join39(repoRoot, OA_DIR);
|
|
28396
28430
|
for (const sub of SUBDIRS) {
|
|
28397
|
-
|
|
28431
|
+
mkdirSync10(join39(oaPath, sub), { recursive: true });
|
|
28398
28432
|
}
|
|
28399
28433
|
try {
|
|
28400
28434
|
const gitignorePath = join39(repoRoot, ".gitignore");
|
|
@@ -28424,7 +28458,7 @@ function loadProjectSettings(repoRoot) {
|
|
|
28424
28458
|
}
|
|
28425
28459
|
function saveProjectSettings(repoRoot, settings) {
|
|
28426
28460
|
const oaPath = join39(repoRoot, OA_DIR);
|
|
28427
|
-
|
|
28461
|
+
mkdirSync10(oaPath, { recursive: true });
|
|
28428
28462
|
const existing = loadProjectSettings(repoRoot);
|
|
28429
28463
|
const merged = { ...existing, ...settings };
|
|
28430
28464
|
writeFileSync10(join39(oaPath, "settings.json"), JSON.stringify(merged, null, 2) + "\n", { encoding: "utf-8", mode: 384 });
|
|
@@ -28441,7 +28475,7 @@ function loadGlobalSettings() {
|
|
|
28441
28475
|
}
|
|
28442
28476
|
function saveGlobalSettings(settings) {
|
|
28443
28477
|
const dir = join39(homedir9(), ".open-agents");
|
|
28444
|
-
|
|
28478
|
+
mkdirSync10(dir, { recursive: true });
|
|
28445
28479
|
const existing = loadGlobalSettings();
|
|
28446
28480
|
const merged = { ...existing, ...settings };
|
|
28447
28481
|
writeFileSync10(join39(dir, "settings.json"), JSON.stringify(merged, null, 2) + "\n", { encoding: "utf-8", mode: 384 });
|
|
@@ -28566,13 +28600,13 @@ ${tree}\`\`\`
|
|
|
28566
28600
|
}
|
|
28567
28601
|
const content = sections.join("\n");
|
|
28568
28602
|
const contextDir = join39(repoRoot, OA_DIR, "context");
|
|
28569
|
-
|
|
28603
|
+
mkdirSync10(contextDir, { recursive: true });
|
|
28570
28604
|
writeFileSync10(join39(contextDir, "project-map.md"), content, "utf-8");
|
|
28571
28605
|
return content;
|
|
28572
28606
|
}
|
|
28573
28607
|
function saveSession(repoRoot, session) {
|
|
28574
28608
|
const historyDir = join39(repoRoot, OA_DIR, "history");
|
|
28575
|
-
|
|
28609
|
+
mkdirSync10(historyDir, { recursive: true });
|
|
28576
28610
|
writeFileSync10(join39(historyDir, `${session.id}.json`), JSON.stringify(session, null, 2), "utf-8");
|
|
28577
28611
|
}
|
|
28578
28612
|
function loadRecentSessions(repoRoot, limit = 5) {
|
|
@@ -28597,7 +28631,7 @@ function loadRecentSessions(repoRoot, limit = 5) {
|
|
|
28597
28631
|
}
|
|
28598
28632
|
function savePendingTask(repoRoot, task) {
|
|
28599
28633
|
const historyDir = join39(repoRoot, OA_DIR, "history");
|
|
28600
|
-
|
|
28634
|
+
mkdirSync10(historyDir, { recursive: true });
|
|
28601
28635
|
writeFileSync10(join39(historyDir, PENDING_TASK_FILE), JSON.stringify(task, null, 2) + "\n", "utf-8");
|
|
28602
28636
|
}
|
|
28603
28637
|
function loadPendingTask(repoRoot) {
|
|
@@ -28617,7 +28651,7 @@ function loadPendingTask(repoRoot) {
|
|
|
28617
28651
|
}
|
|
28618
28652
|
function saveSessionContext(repoRoot, entry) {
|
|
28619
28653
|
const contextDir = join39(repoRoot, OA_DIR, "context");
|
|
28620
|
-
|
|
28654
|
+
mkdirSync10(contextDir, { recursive: true });
|
|
28621
28655
|
const filePath = join39(contextDir, CONTEXT_SAVE_FILE);
|
|
28622
28656
|
let ctx;
|
|
28623
28657
|
try {
|
|
@@ -28774,7 +28808,7 @@ function loadUsageFile(filePath) {
|
|
|
28774
28808
|
}
|
|
28775
28809
|
function saveUsageFile(filePath, data) {
|
|
28776
28810
|
const dir = join39(filePath, "..");
|
|
28777
|
-
|
|
28811
|
+
mkdirSync10(dir, { recursive: true });
|
|
28778
28812
|
writeFileSync10(filePath, JSON.stringify(data, null, 2) + "\n", { encoding: "utf-8", mode: 384 });
|
|
28779
28813
|
}
|
|
28780
28814
|
function recordUsage(kind, value, opts) {
|
|
@@ -28880,7 +28914,7 @@ var init_oa_directory = __esm({
|
|
|
28880
28914
|
import * as readline from "node:readline";
|
|
28881
28915
|
import { execSync as execSync25, spawn as spawn15, exec as exec2 } from "node:child_process";
|
|
28882
28916
|
import { promisify as promisify5 } from "node:util";
|
|
28883
|
-
import { existsSync as existsSync30, writeFileSync as writeFileSync11, mkdirSync as
|
|
28917
|
+
import { existsSync as existsSync30, writeFileSync as writeFileSync11, mkdirSync as mkdirSync11 } from "node:fs";
|
|
28884
28918
|
import { join as join40 } from "node:path";
|
|
28885
28919
|
import { homedir as homedir10, platform } from "node:os";
|
|
28886
28920
|
function detectSystemSpecs() {
|
|
@@ -29913,7 +29947,7 @@ async function doSetup(config, rl) {
|
|
|
29913
29947
|
`PARAMETER stop "<|endoftext|>"`
|
|
29914
29948
|
].join("\n");
|
|
29915
29949
|
const modelDir2 = join40(homedir10(), ".open-agents", "models");
|
|
29916
|
-
|
|
29950
|
+
mkdirSync11(modelDir2, { recursive: true });
|
|
29917
29951
|
const modelfilePath = join40(modelDir2, `Modelfile.${customName}`);
|
|
29918
29952
|
writeFileSync11(modelfilePath, modelfileContent + "\n", "utf8");
|
|
29919
29953
|
process.stdout.write(` ${c2.dim("Creating model...")} `);
|
|
@@ -30022,7 +30056,7 @@ function ensureVenv(log) {
|
|
|
30022
30056
|
return null;
|
|
30023
30057
|
}
|
|
30024
30058
|
try {
|
|
30025
|
-
|
|
30059
|
+
mkdirSync11(join40(homedir10(), ".open-agents"), { recursive: true });
|
|
30026
30060
|
execSync25(`python3 -m venv "${venvDir}"`, { stdio: "pipe", timeout: 3e4 });
|
|
30027
30061
|
execSync25(`"${join40(venvDir, "bin", "pip")}" install --upgrade pip`, {
|
|
30028
30062
|
stdio: "pipe",
|
|
@@ -30355,7 +30389,7 @@ async function createExpandedVariantAsync(baseModel, specs, sizeGB) {
|
|
|
30355
30389
|
`PARAMETER stop "<|endoftext|>"`
|
|
30356
30390
|
].join("\n");
|
|
30357
30391
|
const modelDir2 = join40(homedir10(), ".open-agents", "models");
|
|
30358
|
-
|
|
30392
|
+
mkdirSync11(modelDir2, { recursive: true });
|
|
30359
30393
|
const modelfilePath = join40(modelDir2, `Modelfile.${customName}`);
|
|
30360
30394
|
writeFileSync11(modelfilePath, modelfileContent + "\n", "utf8");
|
|
30361
30395
|
await execAsync(`ollama create ${customName} -f ${modelfilePath}`, {
|
|
@@ -33712,7 +33746,7 @@ var init_carousel = __esm({
|
|
|
33712
33746
|
});
|
|
33713
33747
|
|
|
33714
33748
|
// packages/cli/dist/tui/carousel-descriptors.js
|
|
33715
|
-
import { existsSync as existsSync32, readFileSync as readFileSync23, writeFileSync as writeFileSync12, mkdirSync as
|
|
33749
|
+
import { existsSync as existsSync32, readFileSync as readFileSync23, writeFileSync as writeFileSync12, mkdirSync as mkdirSync12, readdirSync as readdirSync9 } from "node:fs";
|
|
33716
33750
|
import { join as join42, basename as basename11 } from "node:path";
|
|
33717
33751
|
function loadToolProfile(repoRoot) {
|
|
33718
33752
|
const filePath = join42(repoRoot, OA_DIR, "context", TOOL_PROFILE_FILE);
|
|
@@ -33726,7 +33760,7 @@ function loadToolProfile(repoRoot) {
|
|
|
33726
33760
|
}
|
|
33727
33761
|
function saveToolProfile(repoRoot, profile) {
|
|
33728
33762
|
const contextDir = join42(repoRoot, OA_DIR, "context");
|
|
33729
|
-
|
|
33763
|
+
mkdirSync12(contextDir, { recursive: true });
|
|
33730
33764
|
writeFileSync12(join42(contextDir, TOOL_PROFILE_FILE), JSON.stringify(profile, null, 2), "utf-8");
|
|
33731
33765
|
}
|
|
33732
33766
|
function categorizeToolCall(toolName) {
|
|
@@ -33797,7 +33831,7 @@ function loadCachedDescriptors(repoRoot) {
|
|
|
33797
33831
|
}
|
|
33798
33832
|
function saveCachedDescriptors(repoRoot, phrases, sourceHash) {
|
|
33799
33833
|
const contextDir = join42(repoRoot, OA_DIR, "context");
|
|
33800
|
-
|
|
33834
|
+
mkdirSync12(contextDir, { recursive: true });
|
|
33801
33835
|
const cached = {
|
|
33802
33836
|
phrases,
|
|
33803
33837
|
generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -34065,7 +34099,7 @@ var init_carousel_descriptors = __esm({
|
|
|
34065
34099
|
});
|
|
34066
34100
|
|
|
34067
34101
|
// packages/cli/dist/tui/voice.js
|
|
34068
|
-
import { existsSync as existsSync33, mkdirSync as
|
|
34102
|
+
import { existsSync as existsSync33, mkdirSync as mkdirSync13, writeFileSync as writeFileSync13, readFileSync as readFileSync24, unlinkSync as unlinkSync5 } from "node:fs";
|
|
34069
34103
|
import { join as join43 } from "node:path";
|
|
34070
34104
|
import { homedir as homedir12, tmpdir as tmpdir6, platform as platform3 } from "node:os";
|
|
34071
34105
|
import { execSync as execSync27, spawn as nodeSpawn } from "node:child_process";
|
|
@@ -35336,7 +35370,7 @@ Error: ${err2 instanceof Error ? err2.message : String(err2)}`);
|
|
|
35336
35370
|
if (this.ort)
|
|
35337
35371
|
return;
|
|
35338
35372
|
const arch = process.arch;
|
|
35339
|
-
|
|
35373
|
+
mkdirSync13(voiceDir(), { recursive: true });
|
|
35340
35374
|
const pkgPath = join43(voiceDir(), "package.json");
|
|
35341
35375
|
const expectedDeps = {
|
|
35342
35376
|
"onnxruntime-node": "^1.21.0",
|
|
@@ -35430,7 +35464,7 @@ Error: ${err instanceof Error ? err.message : String(err)}`);
|
|
|
35430
35464
|
const configPath = modelConfigPath(id);
|
|
35431
35465
|
if (existsSync33(onnxPath) && existsSync33(configPath))
|
|
35432
35466
|
return;
|
|
35433
|
-
|
|
35467
|
+
mkdirSync13(dir, { recursive: true });
|
|
35434
35468
|
if (!existsSync33(configPath)) {
|
|
35435
35469
|
renderInfo(`Downloading ${model.label} voice config...`);
|
|
35436
35470
|
const configResp = await fetch(model.configUrl);
|
|
@@ -36340,13 +36374,13 @@ var init_stream_renderer = __esm({
|
|
|
36340
36374
|
});
|
|
36341
36375
|
|
|
36342
36376
|
// packages/cli/dist/tui/edit-history.js
|
|
36343
|
-
import { appendFileSync as appendFileSync2, mkdirSync as
|
|
36377
|
+
import { appendFileSync as appendFileSync2, mkdirSync as mkdirSync14 } from "node:fs";
|
|
36344
36378
|
import { join as join44 } from "node:path";
|
|
36345
36379
|
function createEditHistoryLogger(repoRoot, sessionId) {
|
|
36346
36380
|
const historyDir = join44(repoRoot, ".oa", "history");
|
|
36347
36381
|
const logPath = join44(historyDir, "edits.jsonl");
|
|
36348
36382
|
try {
|
|
36349
|
-
|
|
36383
|
+
mkdirSync14(historyDir, { recursive: true });
|
|
36350
36384
|
} catch {
|
|
36351
36385
|
}
|
|
36352
36386
|
function logToolCall(toolName, toolArgs, success) {
|
|
@@ -36486,7 +36520,7 @@ var init_promptLoader3 = __esm({
|
|
|
36486
36520
|
});
|
|
36487
36521
|
|
|
36488
36522
|
// packages/cli/dist/tui/dream-engine.js
|
|
36489
|
-
import { mkdirSync as
|
|
36523
|
+
import { mkdirSync as mkdirSync15, writeFileSync as writeFileSync14, readFileSync as readFileSync26, existsSync as existsSync35, cpSync, rmSync, readdirSync as readdirSync10 } from "node:fs";
|
|
36490
36524
|
import { join as join46, basename as basename12 } from "node:path";
|
|
36491
36525
|
import { execSync as execSync28 } from "node:child_process";
|
|
36492
36526
|
function loadAutoresearchMemory(repoRoot) {
|
|
@@ -36690,7 +36724,7 @@ var init_dream_engine = __esm({
|
|
|
36690
36724
|
}
|
|
36691
36725
|
try {
|
|
36692
36726
|
const dir = join46(targetPath, "..");
|
|
36693
|
-
|
|
36727
|
+
mkdirSync15(dir, { recursive: true });
|
|
36694
36728
|
writeFileSync14(targetPath, content, "utf-8");
|
|
36695
36729
|
return { success: true, output: `Wrote ${content.length} bytes to ${rawPath}`, durationMs: Date.now() - start };
|
|
36696
36730
|
} catch (err) {
|
|
@@ -36779,7 +36813,7 @@ var init_dream_engine = __esm({
|
|
|
36779
36813
|
}
|
|
36780
36814
|
try {
|
|
36781
36815
|
const dir = join46(targetPath, "..");
|
|
36782
|
-
|
|
36816
|
+
mkdirSync15(dir, { recursive: true });
|
|
36783
36817
|
writeFileSync14(targetPath, content, "utf-8");
|
|
36784
36818
|
return { success: true, output: `Wrote ${content.length} bytes to ${rawPath}`, durationMs: Date.now() - start };
|
|
36785
36819
|
} catch (err) {
|
|
@@ -36906,7 +36940,7 @@ var init_dream_engine = __esm({
|
|
|
36906
36940
|
startedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
36907
36941
|
results: []
|
|
36908
36942
|
};
|
|
36909
|
-
|
|
36943
|
+
mkdirSync15(this.dreamsDir, { recursive: true });
|
|
36910
36944
|
this.saveDreamState();
|
|
36911
36945
|
try {
|
|
36912
36946
|
for (let cycle = 1; cycle <= totalCycles; cycle++) {
|
|
@@ -37558,7 +37592,7 @@ ${summaryResult}
|
|
|
37558
37592
|
*Generated by open-agents autoresearch swarm*
|
|
37559
37593
|
`;
|
|
37560
37594
|
try {
|
|
37561
|
-
|
|
37595
|
+
mkdirSync15(this.dreamsDir, { recursive: true });
|
|
37562
37596
|
writeFileSync14(reportPath, report, "utf-8");
|
|
37563
37597
|
} catch {
|
|
37564
37598
|
}
|
|
@@ -37627,7 +37661,7 @@ ${summaryResult}
|
|
|
37627
37661
|
saveVersionCheckpoint(cycle) {
|
|
37628
37662
|
const checkpointDir = join46(this.dreamsDir, "checkpoints", `cycle-${cycle}`);
|
|
37629
37663
|
try {
|
|
37630
|
-
|
|
37664
|
+
mkdirSync15(checkpointDir, { recursive: true });
|
|
37631
37665
|
try {
|
|
37632
37666
|
const gitStatus = execSync28("git status --porcelain", {
|
|
37633
37667
|
cwd: this.repoRoot,
|
|
@@ -38094,7 +38128,7 @@ var init_bless_engine = __esm({
|
|
|
38094
38128
|
});
|
|
38095
38129
|
|
|
38096
38130
|
// packages/cli/dist/tui/dmn-engine.js
|
|
38097
|
-
import { existsSync as existsSync36, readFileSync as readFileSync27, writeFileSync as writeFileSync15, mkdirSync as
|
|
38131
|
+
import { existsSync as existsSync36, readFileSync as readFileSync27, writeFileSync as writeFileSync15, mkdirSync as mkdirSync16, readdirSync as readdirSync11, unlinkSync as unlinkSync6 } from "node:fs";
|
|
38098
38132
|
import { join as join47, basename as basename13 } from "node:path";
|
|
38099
38133
|
function buildDMNGatherPrompt(recentTaskSummaries, dueReminders, attentionItems, memoryTopics, capabilities, competence, reflectionBuffer) {
|
|
38100
38134
|
const competenceReport = competence.length > 0 ? competence.map((c3) => {
|
|
@@ -38210,7 +38244,7 @@ var init_dmn_engine = __esm({
|
|
|
38210
38244
|
this.repoRoot = repoRoot;
|
|
38211
38245
|
this.stateDir = join47(repoRoot, ".oa", "dmn");
|
|
38212
38246
|
this.historyDir = join47(repoRoot, ".oa", "dmn", "cycles");
|
|
38213
|
-
|
|
38247
|
+
mkdirSync16(this.historyDir, { recursive: true });
|
|
38214
38248
|
this.loadState();
|
|
38215
38249
|
}
|
|
38216
38250
|
get stats() {
|
|
@@ -39675,7 +39709,7 @@ var init_tool_policy = __esm({
|
|
|
39675
39709
|
});
|
|
39676
39710
|
|
|
39677
39711
|
// packages/cli/dist/tui/telegram-bridge.js
|
|
39678
|
-
import { mkdirSync as
|
|
39712
|
+
import { mkdirSync as mkdirSync17, existsSync as existsSync38, unlinkSync as unlinkSync7, readdirSync as readdirSync13, statSync as statSync10 } from "node:fs";
|
|
39679
39713
|
import { join as join49, resolve as resolve27 } from "node:path";
|
|
39680
39714
|
import { writeFile as writeFileAsync } from "node:fs/promises";
|
|
39681
39715
|
function convertMarkdownToTelegramHTML(md) {
|
|
@@ -40004,7 +40038,7 @@ with summary "no_reply" to silently skip without responding.
|
|
|
40004
40038
|
this.polling = true;
|
|
40005
40039
|
this.abortController = new AbortController();
|
|
40006
40040
|
try {
|
|
40007
|
-
|
|
40041
|
+
mkdirSync17(this.mediaCacheDir, { recursive: true });
|
|
40008
40042
|
} catch {
|
|
40009
40043
|
}
|
|
40010
40044
|
this.mediaCacheCleanupTimer = setInterval(() => this.cleanupMediaCache(), 5 * 60 * 1e3);
|
|
@@ -42277,7 +42311,7 @@ import { cwd } from "node:process";
|
|
|
42277
42311
|
import { resolve as resolve28, join as join50, dirname as dirname17, extname as extname9 } from "node:path";
|
|
42278
42312
|
import { createRequire as createRequire2 } from "node:module";
|
|
42279
42313
|
import { fileURLToPath as fileURLToPath12 } from "node:url";
|
|
42280
|
-
import { readFileSync as readFileSync29, writeFileSync as writeFileSync16, appendFileSync as appendFileSync3, rmSync as rmSync2, readdirSync as readdirSync14, mkdirSync as
|
|
42314
|
+
import { readFileSync as readFileSync29, writeFileSync as writeFileSync16, appendFileSync as appendFileSync3, rmSync as rmSync2, readdirSync as readdirSync14, mkdirSync as mkdirSync18 } from "node:fs";
|
|
42281
42315
|
import { existsSync as existsSync39 } from "node:fs";
|
|
42282
42316
|
import { homedir as homedir13 } from "node:os";
|
|
42283
42317
|
function formatTimeAgo(date) {
|
|
@@ -43479,7 +43513,7 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
|
|
|
43479
43513
|
if (!line.trim())
|
|
43480
43514
|
return;
|
|
43481
43515
|
try {
|
|
43482
|
-
|
|
43516
|
+
mkdirSync18(HISTORY_DIR, { recursive: true });
|
|
43483
43517
|
appendFileSync3(HISTORY_FILE, line + "\n", "utf8");
|
|
43484
43518
|
if (Math.random() < 0.02) {
|
|
43485
43519
|
const all = readFileSync29(HISTORY_FILE, "utf8").trim().split("\n");
|
|
@@ -46114,7 +46148,7 @@ __export(eval_exports, {
|
|
|
46114
46148
|
evalCommand: () => evalCommand
|
|
46115
46149
|
});
|
|
46116
46150
|
import { tmpdir as tmpdir7 } from "node:os";
|
|
46117
|
-
import { mkdirSync as
|
|
46151
|
+
import { mkdirSync as mkdirSync19, writeFileSync as writeFileSync17 } from "node:fs";
|
|
46118
46152
|
import { join as join53 } from "node:path";
|
|
46119
46153
|
async function evalCommand(opts, config) {
|
|
46120
46154
|
const suiteName = opts.suite ?? "basic";
|
|
@@ -46241,7 +46275,7 @@ async function evalCommand(opts, config) {
|
|
|
46241
46275
|
}
|
|
46242
46276
|
function createTempEvalRepo() {
|
|
46243
46277
|
const dir = join53(tmpdir7(), `open-agents-eval-${Date.now()}`);
|
|
46244
|
-
|
|
46278
|
+
mkdirSync19(dir, { recursive: true });
|
|
46245
46279
|
writeFileSync17(join53(dir, "package.json"), JSON.stringify({ name: "eval-repo", version: "0.0.0" }, null, 2) + "\n", "utf8");
|
|
46246
46280
|
return dir;
|
|
46247
46281
|
}
|
package/package.json
CHANGED