runcastle 1.3.5 → 1.3.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/bin/runcastle.js +70 -82
- package/index.js +70 -82
- package/package.json +1 -1
- package/web/assets/{index-Vbh17gX3.js → index-jbVdnCzO.js} +49 -49
- package/web/index.html +1 -1
package/bin/runcastle.js
CHANGED
|
@@ -834,51 +834,15 @@ var init_src = __esm(() => {
|
|
|
834
834
|
});
|
|
835
835
|
|
|
836
836
|
// ../core/src/paths.ts
|
|
837
|
-
var exports_paths = {};
|
|
838
|
-
__export(exports_paths, {
|
|
839
|
-
worktreeDir: () => worktreeDir,
|
|
840
|
-
sessionDir: () => sessionDir,
|
|
841
|
-
sandboxBuildDir: () => sandboxBuildDir,
|
|
842
|
-
sameDataDir: () => sameDataDir,
|
|
843
|
-
reviewWalkthroughPath: () => reviewWalkthroughPath,
|
|
844
|
-
reviewDir: () => reviewDir,
|
|
845
|
-
projectWorktreesDir: () => projectWorktreesDir,
|
|
846
|
-
prodDataDir: () => prodDataDir,
|
|
847
|
-
logsDir: () => logsDir,
|
|
848
|
-
installIdPath: () => installIdPath,
|
|
849
|
-
featureDocsRel: () => featureDocsRel,
|
|
850
|
-
envPath: () => envPath,
|
|
851
|
-
devDataDir: () => devDataDir,
|
|
852
|
-
dbPath: () => dbPath,
|
|
853
|
-
dataDir: () => dataDir,
|
|
854
|
-
configPath: () => configPath,
|
|
855
|
-
burnCacheDir: () => burnCacheDir,
|
|
856
|
-
attachmentRelPath: () => attachmentRelPath,
|
|
857
|
-
annotationsDir: () => annotationsDir,
|
|
858
|
-
annotationPath: () => annotationPath,
|
|
859
|
-
PROJECT_WORKTREE_SLUG: () => PROJECT_WORKTREE_SLUG,
|
|
860
|
-
ATTACHMENTS_DIR: () => ATTACHMENTS_DIR
|
|
861
|
-
});
|
|
862
837
|
import { homedir } from "os";
|
|
863
838
|
import { join, resolve } from "path";
|
|
864
839
|
function prodDataDir() {
|
|
865
840
|
return join(homedir(), ".runcastle");
|
|
866
841
|
}
|
|
867
|
-
function devDataDir() {
|
|
868
|
-
const override = process.env.RUNCASTLE_DEV_DATA_DIR;
|
|
869
|
-
return override ? resolve(override) : join(homedir(), ".runcastle-dev");
|
|
870
|
-
}
|
|
871
842
|
function dataDir() {
|
|
872
843
|
const override = process.env.RUNCASTLE_DATA_DIR;
|
|
873
844
|
return override ? resolve(override) : prodDataDir();
|
|
874
845
|
}
|
|
875
|
-
function sameDataDir(a, b) {
|
|
876
|
-
const canon = (p) => {
|
|
877
|
-
const abs = resolve(p).replace(/[\\/]+$/, "");
|
|
878
|
-
return process.platform === "win32" ? abs.toLowerCase().replace(/\//g, "\\") : abs;
|
|
879
|
-
};
|
|
880
|
-
return canon(a) === canon(b);
|
|
881
|
-
}
|
|
882
846
|
function dbPath() {
|
|
883
847
|
return join(dataDir(), "runcastle.db");
|
|
884
848
|
}
|
|
@@ -931,11 +895,6 @@ var ATTACHMENTS_DIR = ".runcastle-attachments", PROJECT_WORKTREE_SLUG = "__proje
|
|
|
931
895
|
var init_paths = () => {};
|
|
932
896
|
|
|
933
897
|
// ../core/src/config-load.ts
|
|
934
|
-
var exports_config_load = {};
|
|
935
|
-
__export(exports_config_load, {
|
|
936
|
-
loadConfig: () => loadConfig,
|
|
937
|
-
hostLogicalCpus: () => hostLogicalCpus
|
|
938
|
-
});
|
|
939
898
|
import { existsSync, readFileSync } from "fs";
|
|
940
899
|
import { availableParallelism } from "os";
|
|
941
900
|
function loadConfig(env = process.env, logicalCpus = hostLogicalCpus()) {
|
|
@@ -6209,7 +6168,7 @@ function toml(value) {
|
|
|
6209
6168
|
return JSON.stringify(value);
|
|
6210
6169
|
}
|
|
6211
6170
|
function approvalPolicyFor(permissionMode) {
|
|
6212
|
-
return permissionMode === undefined || permissionMode === "acceptEdits" ? "never" : "
|
|
6171
|
+
return permissionMode === undefined || permissionMode === "acceptEdits" ? "never" : "on-request";
|
|
6213
6172
|
}
|
|
6214
6173
|
function renderCodexConfig(input) {
|
|
6215
6174
|
const { session, config: config2, model, worktreePath, inheritedMcpServers, permissionMode } = input;
|
|
@@ -6859,22 +6818,46 @@ var init_reconcile = __esm(() => {
|
|
|
6859
6818
|
});
|
|
6860
6819
|
|
|
6861
6820
|
// src/launcher/runtime.ts
|
|
6821
|
+
import { readFileSync as readFileSync6 } from "fs";
|
|
6862
6822
|
function setRuntimeCtx(ctx) {
|
|
6863
6823
|
current = ctx;
|
|
6864
6824
|
}
|
|
6825
|
+
function followConfigFile(ctx) {
|
|
6826
|
+
followed = { ctx, raw: readConfigFile() };
|
|
6827
|
+
}
|
|
6828
|
+
function readConfigFile() {
|
|
6829
|
+
try {
|
|
6830
|
+
return readFileSync6(configPath(), "utf8");
|
|
6831
|
+
} catch {
|
|
6832
|
+
return "";
|
|
6833
|
+
}
|
|
6834
|
+
}
|
|
6835
|
+
function syncFollowedConfig() {
|
|
6836
|
+
if (!followed)
|
|
6837
|
+
return;
|
|
6838
|
+
const raw = readConfigFile();
|
|
6839
|
+
if (raw === followed.raw)
|
|
6840
|
+
return;
|
|
6841
|
+
followed.raw = raw;
|
|
6842
|
+
try {
|
|
6843
|
+
followed.ctx.config = loadConfig();
|
|
6844
|
+
} catch {}
|
|
6845
|
+
}
|
|
6865
6846
|
async function getRuntimeCtx() {
|
|
6866
|
-
if (current)
|
|
6847
|
+
if (current) {
|
|
6848
|
+
syncFollowedConfig();
|
|
6867
6849
|
return current;
|
|
6868
|
-
|
|
6869
|
-
|
|
6870
|
-
|
|
6871
|
-
|
|
6872
|
-
]);
|
|
6873
|
-
const db = createDb2(dbPath2());
|
|
6874
|
-
current = { db, config: loadConfig2() };
|
|
6850
|
+
}
|
|
6851
|
+
const { createDb: createDb2 } = await Promise.resolve().then(() => (init_client(), exports_client));
|
|
6852
|
+
const db = createDb2(dbPath());
|
|
6853
|
+
current = { db, config: loadConfig() };
|
|
6875
6854
|
return current;
|
|
6876
6855
|
}
|
|
6877
|
-
var current = null;
|
|
6856
|
+
var current = null, followed = null;
|
|
6857
|
+
var init_runtime = __esm(() => {
|
|
6858
|
+
init_config_load();
|
|
6859
|
+
init_paths();
|
|
6860
|
+
});
|
|
6878
6861
|
|
|
6879
6862
|
// src/services/gates.ts
|
|
6880
6863
|
import { existsSync as existsSync12 } from "fs";
|
|
@@ -7017,7 +7000,7 @@ var init_gates = __esm(() => {
|
|
|
7017
7000
|
});
|
|
7018
7001
|
|
|
7019
7002
|
// src/services/knowledge.ts
|
|
7020
|
-
import { existsSync as existsSync13, mkdirSync as mkdirSync5, readFileSync as
|
|
7003
|
+
import { existsSync as existsSync13, mkdirSync as mkdirSync5, readFileSync as readFileSync7, readdirSync as readdirSync3, statSync as statSync3, writeFileSync as writeFileSync4 } from "fs";
|
|
7021
7004
|
import { join as join12, relative as relative2, resolve as resolve8, sep } from "path";
|
|
7022
7005
|
function scaffoldDocs(ctx, feature, opts = {}) {
|
|
7023
7006
|
const project = projectForFeature(ctx, feature);
|
|
@@ -7075,7 +7058,7 @@ function readCharter(repoRoot) {
|
|
|
7075
7058
|
if (!existsSync13(path))
|
|
7076
7059
|
return;
|
|
7077
7060
|
try {
|
|
7078
|
-
return
|
|
7061
|
+
return readFileSync7(path, "utf8");
|
|
7079
7062
|
} catch {
|
|
7080
7063
|
return;
|
|
7081
7064
|
}
|
|
@@ -7090,7 +7073,7 @@ function listLiveAdrs(repoRoot) {
|
|
|
7090
7073
|
continue;
|
|
7091
7074
|
let content;
|
|
7092
7075
|
try {
|
|
7093
|
-
content =
|
|
7076
|
+
content = readFileSync7(join12(dir, entry.name), "utf8");
|
|
7094
7077
|
} catch {
|
|
7095
7078
|
continue;
|
|
7096
7079
|
}
|
|
@@ -7121,7 +7104,7 @@ function readDoc(ctx, feature, relPath) {
|
|
|
7121
7104
|
}
|
|
7122
7105
|
if (!existsSync13(target))
|
|
7123
7106
|
throw new NotFoundError(`doc not found: ${relPath}`);
|
|
7124
|
-
return { content:
|
|
7107
|
+
return { content: readFileSync7(target, "utf8") };
|
|
7125
7108
|
}
|
|
7126
7109
|
function writtenAt(path) {
|
|
7127
7110
|
try {
|
|
@@ -7132,7 +7115,7 @@ function writtenAt(path) {
|
|
|
7132
7115
|
}
|
|
7133
7116
|
function readTitle(path, fallback) {
|
|
7134
7117
|
try {
|
|
7135
|
-
const firstLine =
|
|
7118
|
+
const firstLine = readFileSync7(path, "utf8").split(`
|
|
7136
7119
|
`, 1)[0] ?? "";
|
|
7137
7120
|
const heading = firstLine.match(/^#\s+(.+)$/);
|
|
7138
7121
|
return heading ? heading[1].trim() : fallback;
|
|
@@ -55327,7 +55310,7 @@ var init_dist = __esm(() => {
|
|
|
55327
55310
|
});
|
|
55328
55311
|
|
|
55329
55312
|
// src/services/settings.ts
|
|
55330
|
-
import { existsSync as existsSync15, mkdirSync as mkdirSync7, readFileSync as
|
|
55313
|
+
import { existsSync as existsSync15, mkdirSync as mkdirSync7, readFileSync as readFileSync8, writeFileSync as writeFileSync5 } from "fs";
|
|
55331
55314
|
import { dirname as dirname8 } from "path";
|
|
55332
55315
|
import * as z3 from "zod";
|
|
55333
55316
|
import { eq as eq10 } from "drizzle-orm";
|
|
@@ -55338,7 +55321,7 @@ function readRawConfig(configFile) {
|
|
|
55338
55321
|
if (!existsSync15(configFile))
|
|
55339
55322
|
return {};
|
|
55340
55323
|
try {
|
|
55341
|
-
const parsed = JSON.parse(
|
|
55324
|
+
const parsed = JSON.parse(readFileSync8(configFile, "utf8"));
|
|
55342
55325
|
if (typeof parsed !== "object" || parsed === null)
|
|
55343
55326
|
return {};
|
|
55344
55327
|
return foldLegacyModelConfig(parsed);
|
|
@@ -55710,7 +55693,7 @@ var init_settings = __esm(() => {
|
|
|
55710
55693
|
});
|
|
55711
55694
|
|
|
55712
55695
|
// src/services/setup.ts
|
|
55713
|
-
import { copyFileSync as copyFileSync2, existsSync as existsSync16, mkdirSync as mkdirSync8, readFileSync as
|
|
55696
|
+
import { copyFileSync as copyFileSync2, existsSync as existsSync16, mkdirSync as mkdirSync8, readFileSync as readFileSync9, readdirSync as readdirSync4, writeFileSync as writeFileSync6 } from "fs";
|
|
55714
55697
|
import { dirname as dirname9, join as join16 } from "path";
|
|
55715
55698
|
async function writeGitIdentity(exec3, identity4) {
|
|
55716
55699
|
const name = identity4.name.trim();
|
|
@@ -55865,7 +55848,7 @@ function createCredentialVerifier(exec3, runtime5 = DEFAULT_RUNTIME) {
|
|
|
55865
55848
|
function fileAfkTokenIo(exec3, runtime5 = DEFAULT_RUNTIME) {
|
|
55866
55849
|
const path2 = envPath();
|
|
55867
55850
|
return {
|
|
55868
|
-
read: () => existsSync16(path2) ?
|
|
55851
|
+
read: () => existsSync16(path2) ? readFileSync9(path2, "utf8") : "",
|
|
55869
55852
|
write: (content) => {
|
|
55870
55853
|
mkdirSync8(dirname9(path2), { recursive: true });
|
|
55871
55854
|
writeFileSync6(path2, content, "utf8");
|
|
@@ -56109,13 +56092,13 @@ var init_no_sandbox = __esm(() => {
|
|
|
56109
56092
|
});
|
|
56110
56093
|
|
|
56111
56094
|
// src/workflows/review-ticket.ts
|
|
56112
|
-
import { existsSync as existsSync17, mkdirSync as mkdirSync9, readFileSync as
|
|
56095
|
+
import { existsSync as existsSync17, mkdirSync as mkdirSync9, readFileSync as readFileSync10, rmSync as rmSync2, writeFileSync as writeFileSync7 } from "fs";
|
|
56113
56096
|
import { delimiter, join as join17 } from "path";
|
|
56114
56097
|
function reviewTemplatePath(ticket) {
|
|
56115
56098
|
return burnerAssetPath(ticket?.passKind === "verification" ? "verify-fixes.md" : "review-ticket.md");
|
|
56116
56099
|
}
|
|
56117
56100
|
function renderReviewPrompt(templateOrTicket, values) {
|
|
56118
|
-
const template = typeof templateOrTicket === "string" ? templateOrTicket :
|
|
56101
|
+
const template = typeof templateOrTicket === "string" ? templateOrTicket : readFileSync10(reviewTemplatePath(templateOrTicket), "utf8");
|
|
56119
56102
|
return renderTemplate(template, values);
|
|
56120
56103
|
}
|
|
56121
56104
|
function findOnPath(bin, env = process.env, platform = process.platform) {
|
|
@@ -56878,7 +56861,7 @@ var init_podman = __esm(() => {
|
|
|
56878
56861
|
});
|
|
56879
56862
|
|
|
56880
56863
|
// src/workflows/ticket-burner.ts
|
|
56881
|
-
import { existsSync as existsSync18, mkdirSync as mkdirSync10, readFileSync as
|
|
56864
|
+
import { existsSync as existsSync18, mkdirSync as mkdirSync10, readFileSync as readFileSync11, readdirSync as readdirSync5, rmSync as rmSync3 } from "fs";
|
|
56882
56865
|
import { dirname as dirname10, join as join18, posix as posixPath, win32 as winPath } from "path";
|
|
56883
56866
|
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
56884
56867
|
function missingImageRuntimeMessage(runtime5, image) {
|
|
@@ -57335,7 +57318,7 @@ function takeSetupMarker(worktreePath) {
|
|
|
57335
57318
|
const file = join18(worktreePath, SETUP_MARKER_FILE);
|
|
57336
57319
|
let text3;
|
|
57337
57320
|
try {
|
|
57338
|
-
text3 =
|
|
57321
|
+
text3 = readFileSync11(file, "utf8");
|
|
57339
57322
|
} catch {
|
|
57340
57323
|
return;
|
|
57341
57324
|
}
|
|
@@ -57455,7 +57438,7 @@ function readRepoToolchain(repoPath) {
|
|
|
57455
57438
|
let packageManagerField;
|
|
57456
57439
|
if (hasPackageJson) {
|
|
57457
57440
|
try {
|
|
57458
|
-
const pkg = JSON.parse(
|
|
57441
|
+
const pkg = JSON.parse(readFileSync11(pkgPath, "utf8"));
|
|
57459
57442
|
if (typeof pkg.packageManager === "string")
|
|
57460
57443
|
packageManagerField = pkg.packageManager;
|
|
57461
57444
|
} catch {}
|
|
@@ -58167,7 +58150,7 @@ function readDocsDigest(projectId, slug) {
|
|
|
58167
58150
|
}
|
|
58168
58151
|
let content;
|
|
58169
58152
|
try {
|
|
58170
|
-
content =
|
|
58153
|
+
content = readFileSync11(join18(docsDir, ...name.split("/")), "utf8");
|
|
58171
58154
|
} catch {
|
|
58172
58155
|
continue;
|
|
58173
58156
|
}
|
|
@@ -58216,7 +58199,7 @@ function readAgentFile(dirs, file) {
|
|
|
58216
58199
|
const p = join18(dir, file);
|
|
58217
58200
|
if (existsSync18(p)) {
|
|
58218
58201
|
try {
|
|
58219
|
-
return
|
|
58202
|
+
return readFileSync11(p, "utf8");
|
|
58220
58203
|
} catch {}
|
|
58221
58204
|
}
|
|
58222
58205
|
}
|
|
@@ -58360,7 +58343,7 @@ async function burnTicket(ctx, ticket, config2, token, model, land, ensureIsolat
|
|
|
58360
58343
|
const guardInstalled = config2.burnGuard && config2.sandbox !== "noSandbox";
|
|
58361
58344
|
const prepared = resolvePreparedSettings(config2, project3);
|
|
58362
58345
|
const verifyNotes = buildVerifyNotes(prepared);
|
|
58363
|
-
const basePrompt = renderTicketPrompt(
|
|
58346
|
+
const basePrompt = renderTicketPrompt(readFileSync11(burnerTemplatePath(), "utf8"), {
|
|
58364
58347
|
WORKSPACE_NOTES: workspaceNotes,
|
|
58365
58348
|
PROJECT_STANDARDS: blocks.projectStandards,
|
|
58366
58349
|
FEATURE_BRIEF: featureBrief,
|
|
@@ -58484,7 +58467,7 @@ async function burnTicket(ctx, ticket, config2, token, model, land, ensureIsolat
|
|
|
58484
58467
|
const resolveBranch = ticketBranchName(feature.slug, ticket.seq, newId("r").slice(2, 10));
|
|
58485
58468
|
const containerName = burnContainerName(ctx.runId, ticket.seq, "resolve");
|
|
58486
58469
|
const otherSide = await commitSummaries(project3.repoPath, input.branch, feature.branch);
|
|
58487
|
-
const prompt = renderTemplate(
|
|
58470
|
+
const prompt = renderTemplate(readFileSync11(resolverTemplatePath(), "utf8"), {
|
|
58488
58471
|
TICKET_JSON: ticketJson,
|
|
58489
58472
|
FEATURE_BRIEF: featureBrief,
|
|
58490
58473
|
DOCS_DIGEST: docsDigest,
|
|
@@ -58869,7 +58852,7 @@ function readTokenFromEnvFile(path2, runtime5) {
|
|
|
58869
58852
|
let fromFile;
|
|
58870
58853
|
if (existsSync18(path2)) {
|
|
58871
58854
|
try {
|
|
58872
|
-
fromFile = parseEnvFile3(
|
|
58855
|
+
fromFile = parseEnvFile3(readFileSync11(path2, "utf8"))[key];
|
|
58873
58856
|
} catch {
|
|
58874
58857
|
fromFile = undefined;
|
|
58875
58858
|
}
|
|
@@ -59040,7 +59023,7 @@ var init_ticket_burner = __esm(() => {
|
|
|
59040
59023
|
});
|
|
59041
59024
|
|
|
59042
59025
|
// src/workflows/research.ts
|
|
59043
|
-
import { mkdirSync as mkdirSync11, readFileSync as
|
|
59026
|
+
import { mkdirSync as mkdirSync11, readFileSync as readFileSync12 } from "fs";
|
|
59044
59027
|
import { dirname as dirname11, join as join19 } from "path";
|
|
59045
59028
|
import { fileURLToPath as fileURLToPath7 } from "url";
|
|
59046
59029
|
function waypointSlug(waypoint) {
|
|
@@ -59126,7 +59109,7 @@ async function realExecuteResearchRun(ctx, waypoint, config2, token, model) {
|
|
|
59126
59109
|
const { project: project3, feature } = ctx;
|
|
59127
59110
|
const docRelPath = researchDocRel(feature.slug, waypoint);
|
|
59128
59111
|
const tempBranch = researchBranchName(feature.slug, waypoint.seq, newId("b").slice(2, 10));
|
|
59129
|
-
const template =
|
|
59112
|
+
const template = readFileSync12(researchTemplatePath(), "utf8");
|
|
59130
59113
|
const prompt = renderResearchPrompt(template, {
|
|
59131
59114
|
WAYPOINT_JSON: buildWaypointJson(waypoint),
|
|
59132
59115
|
FEATURE_BRIEF: buildFeatureBrief(feature),
|
|
@@ -60230,7 +60213,7 @@ var init_test_notes = __esm(() => {
|
|
|
60230
60213
|
});
|
|
60231
60214
|
|
|
60232
60215
|
// src/mcp/server.ts
|
|
60233
|
-
import { existsSync as existsSync21, readFileSync as
|
|
60216
|
+
import { existsSync as existsSync21, readFileSync as readFileSync13 } from "fs";
|
|
60234
60217
|
import { join as join20, relative as relative4, resolve as resolve10, sep as sep2 } from "path";
|
|
60235
60218
|
import { StreamableHTTPTransport } from "@hono/mcp";
|
|
60236
60219
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
@@ -60686,7 +60669,7 @@ function toolReadAdr(ctx, session, input) {
|
|
|
60686
60669
|
}
|
|
60687
60670
|
if (!existsSync21(target))
|
|
60688
60671
|
throw new NotFoundError(`adr not found: ${input.relPath}`);
|
|
60689
|
-
return { relPath: `${ADR_DIR_REL}/${name}`, content:
|
|
60672
|
+
return { relPath: `${ADR_DIR_REL}/${name}`, content: readFileSync13(target, "utf8") };
|
|
60690
60673
|
}
|
|
60691
60674
|
function featureIndexLine(feature) {
|
|
60692
60675
|
if (feature.status === "shipped") {
|
|
@@ -61175,6 +61158,7 @@ var init_server = __esm(() => {
|
|
|
61175
61158
|
init_paths();
|
|
61176
61159
|
init_errors();
|
|
61177
61160
|
init_artifacts();
|
|
61161
|
+
init_runtime();
|
|
61178
61162
|
init_sessions();
|
|
61179
61163
|
init_features();
|
|
61180
61164
|
init_carried_work();
|
|
@@ -61529,6 +61513,7 @@ function sessionStartContext(ctx, feature) {
|
|
|
61529
61513
|
var hooks, hooks_default;
|
|
61530
61514
|
var init_hooks = __esm(() => {
|
|
61531
61515
|
init_edit_guard();
|
|
61516
|
+
init_runtime();
|
|
61532
61517
|
init_sessions();
|
|
61533
61518
|
init_events();
|
|
61534
61519
|
init_git();
|
|
@@ -61653,6 +61638,7 @@ var init_reviews = __esm(() => {
|
|
|
61653
61638
|
init_src();
|
|
61654
61639
|
init_paths();
|
|
61655
61640
|
init_errors();
|
|
61641
|
+
init_runtime();
|
|
61656
61642
|
init_test_notes();
|
|
61657
61643
|
init_tickets();
|
|
61658
61644
|
reviews = new Hono3;
|
|
@@ -61869,7 +61855,7 @@ var init_web = __esm(() => {
|
|
|
61869
61855
|
});
|
|
61870
61856
|
|
|
61871
61857
|
// src/version.ts
|
|
61872
|
-
import { readFileSync as
|
|
61858
|
+
import { readFileSync as readFileSync14 } from "fs";
|
|
61873
61859
|
import { dirname as dirname13, join as join23 } from "path";
|
|
61874
61860
|
import { fileURLToPath as fileURLToPath8 } from "url";
|
|
61875
61861
|
function runcastleVersion() {
|
|
@@ -61878,7 +61864,7 @@ function runcastleVersion() {
|
|
|
61878
61864
|
const here = dirname13(fileURLToPath8(import.meta.url));
|
|
61879
61865
|
for (const pkgPath of [join23(here, "..", "package.json"), join23(here, "package.json")]) {
|
|
61880
61866
|
try {
|
|
61881
|
-
const pkg = JSON.parse(
|
|
61867
|
+
const pkg = JSON.parse(readFileSync14(pkgPath, "utf8"));
|
|
61882
61868
|
if (typeof pkg.version === "string") {
|
|
61883
61869
|
cached4 = pkg.version;
|
|
61884
61870
|
return cached4;
|
|
@@ -61893,13 +61879,13 @@ var init_version = () => {};
|
|
|
61893
61879
|
|
|
61894
61880
|
// src/services/install-id.ts
|
|
61895
61881
|
import { randomUUID as randomUUID3 } from "crypto";
|
|
61896
|
-
import { existsSync as existsSync23, mkdirSync as mkdirSync13, readFileSync as
|
|
61882
|
+
import { existsSync as existsSync23, mkdirSync as mkdirSync13, readFileSync as readFileSync15, writeFileSync as writeFileSync9 } from "fs";
|
|
61897
61883
|
import { dirname as dirname14 } from "path";
|
|
61898
61884
|
function getInstallId() {
|
|
61899
61885
|
const file = installIdPath();
|
|
61900
61886
|
try {
|
|
61901
61887
|
if (existsSync23(file)) {
|
|
61902
|
-
const existing =
|
|
61888
|
+
const existing = readFileSync15(file, "utf8").trim();
|
|
61903
61889
|
if (UUID_RE.test(existing))
|
|
61904
61890
|
return existing;
|
|
61905
61891
|
}
|
|
@@ -63132,7 +63118,7 @@ var init_fsbrowse = __esm(() => {
|
|
|
63132
63118
|
});
|
|
63133
63119
|
|
|
63134
63120
|
// src/services/transcripts.ts
|
|
63135
|
-
import { readFileSync as
|
|
63121
|
+
import { readFileSync as readFileSync16 } from "fs";
|
|
63136
63122
|
function* entries(jsonl) {
|
|
63137
63123
|
for (const line of jsonl.split(`
|
|
63138
63124
|
`)) {
|
|
@@ -63213,7 +63199,7 @@ function readTranscript2(path2, runtime5) {
|
|
|
63213
63199
|
if (!path2)
|
|
63214
63200
|
return { status: "ok", turns: [] };
|
|
63215
63201
|
try {
|
|
63216
|
-
return parseTranscript(
|
|
63202
|
+
return parseTranscript(readFileSync16(path2, "utf8"), runtime5);
|
|
63217
63203
|
} catch {
|
|
63218
63204
|
return { status: "ok", turns: [] };
|
|
63219
63205
|
}
|
|
@@ -63557,13 +63543,13 @@ var init_settings2 = __esm(() => {
|
|
|
63557
63543
|
});
|
|
63558
63544
|
|
|
63559
63545
|
// src/doctor/afk-env.ts
|
|
63560
|
-
import { existsSync as existsSync27, readFileSync as
|
|
63546
|
+
import { existsSync as existsSync27, readFileSync as readFileSync17 } from "fs";
|
|
63561
63547
|
function envWithAfkCredentials() {
|
|
63562
63548
|
const merged = { ...process.env };
|
|
63563
63549
|
try {
|
|
63564
63550
|
const path2 = envPath();
|
|
63565
63551
|
if (existsSync27(path2)) {
|
|
63566
|
-
const fromFile = parseEnvFile3(
|
|
63552
|
+
const fromFile = parseEnvFile3(readFileSync17(path2, "utf8"));
|
|
63567
63553
|
for (const runtime5 of AGENT_RUNTIMES) {
|
|
63568
63554
|
const key = RUNTIME_SPECS[runtime5].afkKey;
|
|
63569
63555
|
const value = fromFile[key];
|
|
@@ -63969,6 +63955,7 @@ async function startServer() {
|
|
|
63969
63955
|
runMigrations(db);
|
|
63970
63956
|
const ctx = { db, config: config2 };
|
|
63971
63957
|
const app = buildApp(ctx);
|
|
63958
|
+
followConfigFile(ctx);
|
|
63972
63959
|
const reconciled = reconcileStaleSessions(ctx);
|
|
63973
63960
|
if (reconciled.length > 0) {
|
|
63974
63961
|
console.log(`reconciled ${reconciled.length} stale session(s) from a previous server run`);
|
|
@@ -64010,6 +63997,7 @@ var init_src2 = __esm(() => {
|
|
|
64010
63997
|
init_client();
|
|
64011
63998
|
init_migrate();
|
|
64012
63999
|
init_reconcile();
|
|
64000
|
+
init_runtime();
|
|
64013
64001
|
init_server();
|
|
64014
64002
|
init_registry();
|
|
64015
64003
|
init_ws();
|