@botiverse/raft-daemon 0.63.0 → 0.63.1

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.
@@ -1599,7 +1599,7 @@ var DISPLAY_PLAN_CONFIG = {
1599
1599
  var FREE_MONTHLY_FILE_UPLOAD_LIMIT_BYTES = 100 * 1024 * 1024;
1600
1600
 
1601
1601
  // src/agentProcessManager.ts
1602
- import { existsSync as existsSync9, mkdirSync as mkdirSync6, readFileSync as readFileSync6, readdirSync as readdirSync3, statSync, writeFileSync as writeFileSync4 } from "fs";
1602
+ import { existsSync as existsSync9, mkdirSync as mkdirSync5, readFileSync as readFileSync6, readdirSync as readdirSync3, statSync, writeFileSync as writeFileSync4 } from "fs";
1603
1603
  import { mkdir, writeFile, access, readdir as readdir2, stat as stat2, readFile, rm as rm2, lstat, realpath, open } from "fs/promises";
1604
1604
  import { createHash as createHash3, randomUUID as randomUUID5 } from "crypto";
1605
1605
  import path14 from "path";
@@ -5203,35 +5203,11 @@ import path7 from "path";
5203
5203
 
5204
5204
  // src/drivers/codexHome.ts
5205
5205
  import os3 from "os";
5206
- import { mkdirSync as mkdirSync3 } from "fs";
5207
5206
  import path6 from "path";
5208
5207
  function readConfiguredCodexHome(env) {
5209
5208
  const raw = env.CODEX_HOME;
5210
5209
  return typeof raw === "string" && raw.trim().length > 0 ? raw : null;
5211
5210
  }
5212
- function readNonEmpty(value) {
5213
- return typeof value === "string" && value.trim().length > 0 ? value : null;
5214
- }
5215
- function safeCodexHomePathPart(value) {
5216
- const safe = value.replace(/[^a-zA-Z0-9._-]/g, "_");
5217
- return safe.length > 0 ? safe : "agent";
5218
- }
5219
- function resolveSlockManagedCodexHome(slockHome, agentId) {
5220
- return path6.join(path6.resolve(slockHome), "codex-home", safeCodexHomePathPart(agentId));
5221
- }
5222
- function resolveDefaultCodexHomeRootForAgent(agentId, opts = {}) {
5223
- return resolveSlockManagedCodexHome(readNonEmpty(opts.slockHome) ?? resolveSlockHome(opts.env), agentId);
5224
- }
5225
- function applyDefaultCodexHomeToEnv(env, agentId, opts = {}) {
5226
- if (readConfiguredCodexHome(env)) return null;
5227
- const codexHome = resolveDefaultCodexHomeRootForAgent(agentId, {
5228
- slockHome: readNonEmpty(opts.slockHome) ?? readNonEmpty(env.SLOCK_HOME) ?? void 0,
5229
- env
5230
- });
5231
- mkdirSync3(codexHome, { recursive: true });
5232
- env.CODEX_HOME = codexHome;
5233
- return codexHome;
5234
- }
5235
5211
  function resolveCodexHomeRootFromEnv(env = process.env, opts = {}) {
5236
5212
  const raw = readConfiguredCodexHome(env);
5237
5213
  if (raw) {
@@ -5246,18 +5222,12 @@ function hasConfiguredCodexHome(config, baseEnv = process.env) {
5246
5222
  ...launchRuntimeFields?.envVars || {}
5247
5223
  }));
5248
5224
  }
5249
- function resolveCodexHomeRootFromConfig(config, defaultHomeDir, cwd, baseEnv = process.env, opts = {}) {
5225
+ function resolveCodexHomeRootFromConfig(config, defaultHomeDir, cwd, baseEnv = process.env, _opts = {}) {
5250
5226
  const launchRuntimeFields = runtimeConfigToLaunchFields(config);
5251
5227
  const env = {
5252
5228
  ...baseEnv,
5253
5229
  ...launchRuntimeFields.envVars || {}
5254
5230
  };
5255
- if (readConfiguredCodexHome(env)) {
5256
- return resolveCodexHomeRootFromEnv(env, { defaultHomeDir, cwd });
5257
- }
5258
- if (opts.agentId) {
5259
- return resolveDefaultCodexHomeRootForAgent(opts.agentId, { slockHome: opts.slockHome, env });
5260
- }
5261
5231
  return resolveCodexHomeRootFromEnv(env, { defaultHomeDir, cwd });
5262
5232
  }
5263
5233
  function codexStateRootCandidates(homeDirOrCodexRoot) {
@@ -6209,7 +6179,6 @@ var CodexDriver = class {
6209
6179
  }
6210
6180
  async spawn(ctx) {
6211
6181
  const { spawnEnv } = await prepareCliTransport(ctx, { NO_COLOR: "1" });
6212
- applyDefaultCodexHomeToEnv(spawnEnv, ctx.agentId, { slockHome: ctx.slockHome });
6213
6182
  this.process = null;
6214
6183
  this.requestId = 0;
6215
6184
  this.pendingInitialPrompt = ctx.prompt;
@@ -7530,7 +7499,7 @@ function detectKimiModels(home = os5.homedir()) {
7530
7499
  // src/drivers/kimi-sdk.ts
7531
7500
  import { randomUUID as randomUUID3 } from "crypto";
7532
7501
  import { EventEmitter } from "events";
7533
- import { mkdirSync as mkdirSync4, readFileSync as readFileSync4 } from "fs";
7502
+ import { mkdirSync as mkdirSync3, readFileSync as readFileSync4 } from "fs";
7534
7503
  import path10 from "path";
7535
7504
  import { createRequire as createRequire2 } from "module";
7536
7505
  import {
@@ -7679,12 +7648,12 @@ var KIMI_SDK_RUNTIME_SESSION_DESCRIPTOR = {
7679
7648
  };
7680
7649
  async function createKimiAgentSessionForContext(ctx, sessionId) {
7681
7650
  const sessionDir = buildKimiSessionDir(ctx.workingDirectory);
7682
- mkdirSync4(sessionDir, { recursive: true });
7651
+ mkdirSync3(sessionDir, { recursive: true });
7683
7652
  const cliTransport = await prepareCliTransport(ctx, { NO_COLOR: "1" });
7684
7653
  const spawnEnv = cliTransport.spawnEnv;
7685
7654
  const wrapperPath = cliTransport.wrapperPath;
7686
7655
  const homeDir = spawnEnv.KIMI_HOME || (process.env.HOME ? path10.join(process.env.HOME, ".kimi") : path10.join(ctx.workingDirectory, ".kimi"));
7687
- mkdirSync4(homeDir, { recursive: true });
7656
+ mkdirSync3(homeDir, { recursive: true });
7688
7657
  const harness = createKimiHarness({
7689
7658
  homeDir,
7690
7659
  identity: {
@@ -8491,7 +8460,7 @@ var OpenCodeDriver = class {
8491
8460
  // src/drivers/pi.ts
8492
8461
  import { randomUUID as randomUUID4 } from "crypto";
8493
8462
  import { EventEmitter as EventEmitter2 } from "events";
8494
- import { mkdirSync as mkdirSync5, readdirSync as readdirSync2 } from "fs";
8463
+ import { mkdirSync as mkdirSync4, readdirSync as readdirSync2 } from "fs";
8495
8464
  import path12 from "path";
8496
8465
  import {
8497
8466
  AuthStorage,
@@ -8759,7 +8728,7 @@ var PI_IDLE_PROMPT_RETRY_MS = 25;
8759
8728
  var PI_IDLE_PROMPT_MAX_WAIT_MS = 1e3;
8760
8729
  async function createPiAgentSessionForContext(ctx, sessionId) {
8761
8730
  const sessionDir = buildPiSessionDir(ctx.workingDirectory);
8762
- mkdirSync5(sessionDir, { recursive: true });
8731
+ mkdirSync4(sessionDir, { recursive: true });
8763
8732
  const launchRuntimeFields = runtimeConfigToLaunchFields(ctx.config);
8764
8733
  const requestedModel = launchRuntimeFields.model || "default";
8765
8734
  const traceSpan = ctx.tracer?.startSpan("daemon.pi.session.create", {
@@ -10062,7 +10031,7 @@ function safeSessionFilename(value) {
10062
10031
  function writeRuntimeSessionHandoff(runtime, sessionId, fallbackDir) {
10063
10032
  try {
10064
10033
  const dir = path14.join(fallbackDir, ".slock", "runtime-sessions");
10065
- mkdirSync6(dir, { recursive: true });
10034
+ mkdirSync5(dir, { recursive: true });
10066
10035
  const filePath = path14.join(dir, `${runtime}-${safeSessionFilename(sessionId)}.jsonl`);
10067
10036
  writeFileSync4(filePath, JSON.stringify({
10068
10037
  type: "runtime_session_handoff",
@@ -10098,7 +10067,7 @@ function ensureRuntimeHomeDir(config, defaultHomeDir, workspacePath, opts = {})
10098
10067
  if (config.runtime === "codex") {
10099
10068
  const home = resolveCodexHomeRootFromConfig(config, defaultHomeDir, workspacePath, process.env, opts);
10100
10069
  if (opts.agentId) {
10101
- mkdirSync6(home, { recursive: true });
10070
+ mkdirSync5(home, { recursive: true });
10102
10071
  }
10103
10072
  return home;
10104
10073
  }
@@ -14168,7 +14137,7 @@ Use ${communicationCommand("read_history")} to catch up on the channels listed a
14168
14137
  const runtime = runtimeHint || config?.runtime || "claude";
14169
14138
  const workspaceDir = path14.join(this.dataDir, agentId);
14170
14139
  const hostHome = os7.homedir();
14171
- const home = agent?.runtime.currentRuntimeHomeDir || (config ? ensureRuntimeHomeDir(config, hostHome, workspaceDir, { agentId, slockHome: this.slockHome }) : runtime === "codex" ? resolveDefaultCodexHomeRootForAgent(agentId, { slockHome: this.slockHome }) : hostHome);
14140
+ const home = agent?.runtime.currentRuntimeHomeDir || (config ? ensureRuntimeHomeDir(config, hostHome, workspaceDir, { agentId, slockHome: this.slockHome }) : runtime === "codex" ? resolveCodexHomeRootFromEnv(process.env, { defaultHomeDir: hostHome, cwd: workspaceDir }) : hostHome);
14172
14141
  const paths = _AgentProcessManager.SKILL_PATHS[runtime] || _AgentProcessManager.SKILL_PATHS.claude;
14173
14142
  const globalDirs = runtime === "codex" ? [
14174
14143
  path14.join(home, "skills"),
@@ -16261,7 +16230,7 @@ var ReminderCache = class {
16261
16230
 
16262
16231
  // src/machineLock.ts
16263
16232
  import { createHash as createHash4, randomUUID as randomUUID6 } from "crypto";
16264
- import { mkdirSync as mkdirSync7, readFileSync as readFileSync7, rmSync as rmSync3, statSync as statSync2, writeFileSync as writeFileSync5 } from "fs";
16233
+ import { mkdirSync as mkdirSync6, readFileSync as readFileSync7, rmSync as rmSync3, statSync as statSync2, writeFileSync as writeFileSync5 } from "fs";
16265
16234
  import os8 from "os";
16266
16235
  import path15 from "path";
16267
16236
  var INCOMPLETE_LOCK_STALE_MS = 3e4;
@@ -16318,10 +16287,10 @@ function acquireDaemonMachineLock(options) {
16318
16287
  const machineDir = path15.join(rootDir, lockId);
16319
16288
  const lockDir = path15.join(machineDir, "daemon.lock");
16320
16289
  const token = randomUUID6();
16321
- mkdirSync7(machineDir, { recursive: true });
16290
+ mkdirSync6(machineDir, { recursive: true });
16322
16291
  for (let attempt = 0; attempt < 2; attempt += 1) {
16323
16292
  try {
16324
- mkdirSync7(lockDir);
16293
+ mkdirSync6(lockDir);
16325
16294
  const owner = {
16326
16295
  pid: process.pid,
16327
16296
  token,
@@ -16376,7 +16345,7 @@ function acquireDaemonMachineLock(options) {
16376
16345
  }
16377
16346
 
16378
16347
  // src/localTraceSink.ts
16379
- import { appendFileSync, mkdirSync as mkdirSync8, readdirSync as readdirSync4, rmSync as rmSync4, statSync as statSync3, writeFileSync as writeFileSync6 } from "fs";
16348
+ import { appendFileSync, mkdirSync as mkdirSync7, readdirSync as readdirSync4, rmSync as rmSync4, statSync as statSync3, writeFileSync as writeFileSync6 } from "fs";
16380
16349
  import path16 from "path";
16381
16350
  var DEFAULT_MAX_FILE_BYTES = 5 * 1024 * 1024;
16382
16351
  var DEFAULT_MAX_FILE_AGE_MS = 5 * 60 * 1e3;
@@ -16440,7 +16409,7 @@ var LocalRotatingTraceSink = class {
16440
16409
  return this.currentFile;
16441
16410
  }
16442
16411
  ensureFile(nextBytes) {
16443
- mkdirSync8(this.traceDir, { recursive: true, mode: 448 });
16412
+ mkdirSync7(this.traceDir, { recursive: true, mode: 448 });
16444
16413
  const nowMs = this.nowMsProvider();
16445
16414
  const shouldRotateForAge = this.currentFileOpenedAtMs !== null && nowMs - this.currentFileOpenedAtMs >= this.maxFileAgeMs;
16446
16415
  if (!this.currentFile || this.currentSize + nextBytes > this.maxFileBytes || shouldRotateForAge) {
package/dist/core.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  runBundledSlockCli,
12
12
  scanWorkspaceDirectories,
13
13
  subscribeDaemonLogs
14
- } from "./chunk-W2KSMJ4G.js";
14
+ } from "./chunk-RENPNQK3.js";
15
15
  export {
16
16
  DAEMON_CLI_USAGE,
17
17
  DaemonCore,
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  DAEMON_CLI_USAGE,
4
4
  DaemonCore,
5
5
  parseDaemonCliArgs
6
- } from "./chunk-W2KSMJ4G.js";
6
+ } from "./chunk-RENPNQK3.js";
7
7
 
8
8
  // src/index.ts
9
9
  var parsedArgs = parseDaemonCliArgs(process.argv.slice(2));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botiverse/raft-daemon",
3
- "version": "0.63.0",
3
+ "version": "0.63.1",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "raft-daemon": "dist/raft-daemon.js",