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