@schoolai/shipyard 3.11.0-rc.20260610.0 → 3.11.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/electron-utility.js +1 -1
- package/dist/index.js +2 -2
- package/dist/{serve-MSZSF5JT.js → serve-D5GKV2RU.js} +217 -276
- package/dist/{serve-MSZSF5JT.js.map → serve-D5GKV2RU.js.map} +1 -1
- package/dist/{start-CVNCLJMM.js → start-JY26XC5R.js} +2 -2
- package/package.json +1 -1
- /package/dist/{start-CVNCLJMM.js.map → start-JY26XC5R.js.map} +0 -0
|
@@ -472,7 +472,7 @@ import "./chunk-2H7UOFLK.js";
|
|
|
472
472
|
// src/services/serve.ts
|
|
473
473
|
import { mkdir as mkdir44, realpath as realpath3 } from "fs/promises";
|
|
474
474
|
import { homedir as homedir14 } from "os";
|
|
475
|
-
import { join as
|
|
475
|
+
import { join as join86 } from "path";
|
|
476
476
|
import { query as query2 } from "@anthropic-ai/claude-agent-sdk";
|
|
477
477
|
|
|
478
478
|
// ../../node_modules/.pnpm/@logtape+logtape@1.3.7/node_modules/@logtape/logtape/dist/level.js
|
|
@@ -14307,7 +14307,7 @@ function runTaskSearch(args) {
|
|
|
14307
14307
|
}
|
|
14308
14308
|
|
|
14309
14309
|
// src/services/channels/control-channel-wiring.ts
|
|
14310
|
-
import { join as
|
|
14310
|
+
import { join as join34 } from "path";
|
|
14311
14311
|
|
|
14312
14312
|
// src/shared/type-utils.ts
|
|
14313
14313
|
function narrow(value) {
|
|
@@ -25666,7 +25666,7 @@ function spawnCodexLogout(callbacks) {
|
|
|
25666
25666
|
|
|
25667
25667
|
// src/services/serve-factory-helpers.ts
|
|
25668
25668
|
import { existsSync as existsSync3, readFileSync as readFileSync4 } from "fs";
|
|
25669
|
-
import { join as
|
|
25669
|
+
import { join as join28 } from "path";
|
|
25670
25670
|
|
|
25671
25671
|
// src/shared/capabilities/runtime/rate-limit-account-key.ts
|
|
25672
25672
|
function providerForProfile(profile) {
|
|
@@ -26959,7 +26959,6 @@ async function healGlobalDefault(settingsStore, workspaceRoot, detectedCount, lo
|
|
|
26959
26959
|
|
|
26960
26960
|
// src/services/session/anthropic-adapter.ts
|
|
26961
26961
|
import { spawn as spawn9 } from "child_process";
|
|
26962
|
-
import { join as join27 } from "path";
|
|
26963
26962
|
|
|
26964
26963
|
// src/shared/strip-ansi.ts
|
|
26965
26964
|
function stripAnsi(text) {
|
|
@@ -27688,13 +27687,6 @@ var AnthropicAgentSubprocess = class _AnthropicAgentSubprocess {
|
|
|
27688
27687
|
#onEvent;
|
|
27689
27688
|
#spawnMcpServers;
|
|
27690
27689
|
#harnessTaskIdSetter = null;
|
|
27691
|
-
/**
|
|
27692
|
-
* The epoch bound to this subprocess's in-process harness server at spawn
|
|
27693
|
-
* time (installed by serve-factory immediately after `setHarnessEpoch`).
|
|
27694
|
-
* Surfaced via the `harnessEpoch` getter so the pre-warm adoption handshake
|
|
27695
|
-
* writes the SAME epoch to the registry that the harness fence checks.
|
|
27696
|
-
*/
|
|
27697
|
-
#harnessEpoch = null;
|
|
27698
27690
|
/**
|
|
27699
27691
|
* Mutable slot for the CwdChanged handler. The SDK hook is registered
|
|
27700
27692
|
* unconditionally at spawn time and reads through this slot on each
|
|
@@ -27753,18 +27745,6 @@ var AnthropicAgentSubprocess = class _AnthropicAgentSubprocess {
|
|
|
27753
27745
|
installHarnessTaskIdSetter(setter) {
|
|
27754
27746
|
this.#harnessTaskIdSetter = setter;
|
|
27755
27747
|
}
|
|
27756
|
-
/**
|
|
27757
|
-
* Record the epoch serve-factory minted and bound to this subprocess's
|
|
27758
|
-
* in-process harness server (called right after `setHarnessEpoch`). The
|
|
27759
|
-
* pre-warm manager reads it back via `harnessEpoch` so adoption registers
|
|
27760
|
-
* the same epoch the fence will check — never a second, divergent UUID.
|
|
27761
|
-
*/
|
|
27762
|
-
installHarnessEpoch(epoch) {
|
|
27763
|
-
this.#harnessEpoch = epoch;
|
|
27764
|
-
}
|
|
27765
|
-
get harnessEpoch() {
|
|
27766
|
-
return this.#harnessEpoch;
|
|
27767
|
-
}
|
|
27768
27748
|
setHarnessTaskId(taskId) {
|
|
27769
27749
|
if (!this.#harnessTaskIdSetter) {
|
|
27770
27750
|
throw new Error("setHarnessTaskId called before installHarnessTaskIdSetter");
|
|
@@ -27923,24 +27903,7 @@ var AnthropicAgentSubprocess = class _AnthropicAgentSubprocess {
|
|
|
27923
27903
|
...process.env,
|
|
27924
27904
|
...options.env,
|
|
27925
27905
|
DISABLE_AUTO_COMPACT: "1",
|
|
27926
|
-
CLAUDE_CODE_ENTRYPOINT: "shipyard"
|
|
27927
|
-
/**
|
|
27928
|
-
* Isolate every `codex` binary the agent invokes (via Bash/shell
|
|
27929
|
-
* tool) from the user's real `~/.codex/auth.json`. The primary
|
|
27930
|
-
* codex engine (daemon-internal, spawned by `codex-facade.ts`'s
|
|
27931
|
-
* `getOrCreateCodexEngine`) reads `~/.codex` directly through its
|
|
27932
|
-
* own `resolveSpawnConfig` path and is NOT affected by this env.
|
|
27933
|
-
*
|
|
27934
|
-
* Value is keyed off `SHIPYARD_HOME` so in E2E tests it resolves
|
|
27935
|
-
* to the per-test isolated home (`${shipyardHome}/codex-isolated`),
|
|
27936
|
-
* and in the primary daemon it resolves to
|
|
27937
|
-
* `~/.shipyard/codex-isolated` — distinct from `~/.codex`.
|
|
27938
|
-
*
|
|
27939
|
-
* Must come AFTER the spread of `options.env` and `process.env`
|
|
27940
|
-
* so it always wins, preventing an ambient `CODEX_HOME` from the
|
|
27941
|
-
* developer's shell from leaking through to the agent subprocess.
|
|
27942
|
-
*/
|
|
27943
|
-
CODEX_HOME: join27(getShipyardHome(), "codex-isolated")
|
|
27906
|
+
CLAUDE_CODE_ENTRYPOINT: "shipyard"
|
|
27944
27907
|
},
|
|
27945
27908
|
disallowedTools: options.disallowedTools,
|
|
27946
27909
|
skills: options.skills,
|
|
@@ -28426,7 +28389,7 @@ import { homedir as homedir4 } from "os";
|
|
|
28426
28389
|
|
|
28427
28390
|
// src/shared/capabilities/capabilities-cache.ts
|
|
28428
28391
|
import { mkdir as mkdir13, readFile as readFile18, rename as rename11, unlink as unlink8, writeFile as writeFile14 } from "fs/promises";
|
|
28429
|
-
import { dirname as dirname15, join as
|
|
28392
|
+
import { dirname as dirname15, join as join27 } from "path";
|
|
28430
28393
|
var CAPABILITIES_CACHE_VERSION = 1;
|
|
28431
28394
|
var GitRepoInfoCacheSchema = external_exports.object({
|
|
28432
28395
|
path: external_exports.string(),
|
|
@@ -28460,7 +28423,7 @@ var CacheFileSchema = external_exports.object({
|
|
|
28460
28423
|
mcpServers: external_exports.array(MCPServerInfoCacheSchema)
|
|
28461
28424
|
});
|
|
28462
28425
|
function cacheFilePath() {
|
|
28463
|
-
return
|
|
28426
|
+
return join27(getShipyardHome(), "data", "capabilities-cache.json");
|
|
28464
28427
|
}
|
|
28465
28428
|
var EMPTY_ENVIRONMENTS = [];
|
|
28466
28429
|
var EMPTY_MCP_SERVERS = [];
|
|
@@ -28726,7 +28689,7 @@ function appendDynamicPrompt(base2, appendix) {
|
|
|
28726
28689
|
${appendix}` : base2;
|
|
28727
28690
|
}
|
|
28728
28691
|
function rehydrateVizRegistry(registry, vizWatcher, resolvedTaskId, vizDir, log) {
|
|
28729
|
-
const registryPath =
|
|
28692
|
+
const registryPath = join28(vizDir, resolvedTaskId, "registry.json");
|
|
28730
28693
|
if (!existsSync3(registryPath)) return Promise.resolve();
|
|
28731
28694
|
try {
|
|
28732
28695
|
const raw = readFileSync4(registryPath, "utf-8");
|
|
@@ -28963,7 +28926,7 @@ async function initializeVaultSync(vaultKey, deps, credentialsVaultStore, oauthS
|
|
|
28963
28926
|
});
|
|
28964
28927
|
}
|
|
28965
28928
|
function buildDefaultRepo(dataDir, identity) {
|
|
28966
|
-
const storage = new FileStorageAdapter(
|
|
28929
|
+
const storage = new FileStorageAdapter(join28(dataDir, "loro"));
|
|
28967
28930
|
return {
|
|
28968
28931
|
repo: new Repo({
|
|
28969
28932
|
identity,
|
|
@@ -29205,9 +29168,6 @@ function buildRejectionStubSubprocess(input) {
|
|
|
29205
29168
|
stopBackgroundTask: noop3,
|
|
29206
29169
|
setHarnessTaskId() {
|
|
29207
29170
|
},
|
|
29208
|
-
get harnessEpoch() {
|
|
29209
|
-
return null;
|
|
29210
|
-
},
|
|
29211
29171
|
setOnCwdChanged() {
|
|
29212
29172
|
},
|
|
29213
29173
|
async rollback(_numTurns) {
|
|
@@ -29752,12 +29712,12 @@ function createBestEffortSender(deps) {
|
|
|
29752
29712
|
|
|
29753
29713
|
// src/services/comments/github-ingest-pipeline.ts
|
|
29754
29714
|
import { readFile as readFile20 } from "fs/promises";
|
|
29755
|
-
import { join as
|
|
29715
|
+
import { join as join30 } from "path";
|
|
29756
29716
|
|
|
29757
29717
|
// src/services/harness/comment-server.ts
|
|
29758
29718
|
import { randomUUID as randomUUID9 } from "crypto";
|
|
29759
29719
|
import { access as access4, readFile as readFile19 } from "fs/promises";
|
|
29760
|
-
import { join as
|
|
29720
|
+
import { join as join29, relative as relative5 } from "path";
|
|
29761
29721
|
|
|
29762
29722
|
// src/shared/xml-utils.ts
|
|
29763
29723
|
function escapeXmlAttr(text) {
|
|
@@ -30646,7 +30606,7 @@ async function resolveDiffScopeForFile(cwd, normalizedPath) {
|
|
|
30646
30606
|
}
|
|
30647
30607
|
async function handleDiffComment(ctx, filePath, lineNumber, comment) {
|
|
30648
30608
|
const normalizedPath = normalizeToWorkspaceRelative(filePath, ctx.environmentKey);
|
|
30649
|
-
const absolutePath =
|
|
30609
|
+
const absolutePath = join29(ctx.environmentKey, normalizedPath);
|
|
30650
30610
|
const fileExists2 = await access4(absolutePath).then(
|
|
30651
30611
|
() => true,
|
|
30652
30612
|
() => false
|
|
@@ -30933,7 +30893,7 @@ function prCommentToAnnotation(prComment, ctx) {
|
|
|
30933
30893
|
// src/services/comments/github-ingest-pipeline.ts
|
|
30934
30894
|
async function readLocalFileContent(cwd, path5) {
|
|
30935
30895
|
try {
|
|
30936
|
-
return await readFile20(
|
|
30896
|
+
return await readFile20(join30(cwd, path5), "utf-8");
|
|
30937
30897
|
} catch {
|
|
30938
30898
|
return getFileAtRef(cwd, path5, "HEAD");
|
|
30939
30899
|
}
|
|
@@ -31741,12 +31701,12 @@ function createPRPoller(callbacks, log, resolveTopLevel = getGitTopLevel) {
|
|
|
31741
31701
|
|
|
31742
31702
|
// src/services/roi/commit-sweep.ts
|
|
31743
31703
|
import { stat as stat11 } from "fs/promises";
|
|
31744
|
-
import { join as
|
|
31704
|
+
import { join as join32 } from "path";
|
|
31745
31705
|
|
|
31746
31706
|
// src/services/git-checkpoint.ts
|
|
31747
31707
|
import { execFile as execFileCb2 } from "child_process";
|
|
31748
31708
|
import { readFile as readFile21, stat as stat10, unlink as unlink9, writeFile as writeFile15 } from "fs/promises";
|
|
31749
|
-
import { join as
|
|
31709
|
+
import { join as join31 } from "path";
|
|
31750
31710
|
import { promisify as promisify7 } from "util";
|
|
31751
31711
|
var execFile9 = promisify7(execFileCb2);
|
|
31752
31712
|
var NOT_A_GIT_REPO = "Not a git repository";
|
|
@@ -31758,10 +31718,10 @@ async function resolveGitPaths(repoDir, taskId) {
|
|
|
31758
31718
|
try {
|
|
31759
31719
|
const { stdout } = await execFile9("git", ["rev-parse", "--git-dir"], { cwd: repoDir });
|
|
31760
31720
|
const gitDir = stdout.trim();
|
|
31761
|
-
const absoluteGitDir = gitDir.startsWith("/") ? gitDir :
|
|
31721
|
+
const absoluteGitDir = gitDir.startsWith("/") ? gitDir : join31(repoDir, gitDir);
|
|
31762
31722
|
return {
|
|
31763
31723
|
gitDir: absoluteGitDir,
|
|
31764
|
-
shadowIndex:
|
|
31724
|
+
shadowIndex: join31(absoluteGitDir, `shipyard-index-${taskId}`)
|
|
31765
31725
|
};
|
|
31766
31726
|
} catch {
|
|
31767
31727
|
return null;
|
|
@@ -31856,7 +31816,7 @@ async function rewindToCheckpointImpl(repoDir, taskId, turnNo) {
|
|
|
31856
31816
|
const untrackedFiles = untrackedRaw.trim().split("\n").filter((f2) => f2.length > 0);
|
|
31857
31817
|
for (const file of untrackedFiles) {
|
|
31858
31818
|
try {
|
|
31859
|
-
const fullPath =
|
|
31819
|
+
const fullPath = join31(repoDir, file);
|
|
31860
31820
|
const s2 = await stat10(fullPath);
|
|
31861
31821
|
if (s2.isFile()) {
|
|
31862
31822
|
await unlink9(fullPath);
|
|
@@ -32123,7 +32083,7 @@ async function revertSingleFile(repoDir, file, restoreCommit, mode) {
|
|
|
32123
32083
|
const isDeletedByAgent = file.status === "deleted";
|
|
32124
32084
|
const shouldDelete = mode === "revert" && isAddedByAgent || mode === "unrevert" && isDeletedByAgent;
|
|
32125
32085
|
if (shouldDelete) {
|
|
32126
|
-
await unlink9(
|
|
32086
|
+
await unlink9(join31(repoDir, file.path)).catch((err3) => {
|
|
32127
32087
|
if (!isEnoent(err3)) throw err3;
|
|
32128
32088
|
});
|
|
32129
32089
|
await execFile9("git", ["reset", "HEAD", "--", file.path], { cwd: repoDir }).catch(() => {
|
|
@@ -32135,7 +32095,7 @@ async function revertSingleFile(repoDir, file, restoreCommit, mode) {
|
|
|
32135
32095
|
maxBuffer: 10 * 1024 * 1024,
|
|
32136
32096
|
encoding: "buffer"
|
|
32137
32097
|
});
|
|
32138
|
-
await writeFile15(
|
|
32098
|
+
await writeFile15(join31(repoDir, file.path), stdout);
|
|
32139
32099
|
await execFile9("git", ["reset", "HEAD", "--", file.path], { cwd: repoDir }).catch(() => {
|
|
32140
32100
|
});
|
|
32141
32101
|
return true;
|
|
@@ -32228,7 +32188,7 @@ async function diffCheckpointToWorkingTreeImpl(repoDir, taskId, fromTurnNo, scop
|
|
|
32228
32188
|
if (!line || statusMap.has(line)) continue;
|
|
32229
32189
|
let ins = 0;
|
|
32230
32190
|
try {
|
|
32231
|
-
ins = countLines(await readFile21(
|
|
32191
|
+
ins = countLines(await readFile21(join31(repoDir, line), "utf-8"));
|
|
32232
32192
|
} catch {
|
|
32233
32193
|
}
|
|
32234
32194
|
entries.push({ path: line, status: "added", insertions: ins, deletions: 0 });
|
|
@@ -32248,7 +32208,7 @@ async function getFileVsWorkingTreeImpl(repoDir, taskId, fromTurnNo, filePath) {
|
|
|
32248
32208
|
if (from2 === "error") return null;
|
|
32249
32209
|
let modifiedContent;
|
|
32250
32210
|
try {
|
|
32251
|
-
modifiedContent = await readFile21(
|
|
32211
|
+
modifiedContent = await readFile21(join31(repoDir, filePath), "utf-8");
|
|
32252
32212
|
} catch {
|
|
32253
32213
|
modifiedContent = "";
|
|
32254
32214
|
}
|
|
@@ -32529,7 +32489,7 @@ async function isGitBinaryMissing() {
|
|
|
32529
32489
|
}
|
|
32530
32490
|
async function isGitWorkingTree(cwd) {
|
|
32531
32491
|
try {
|
|
32532
|
-
await stat11(
|
|
32492
|
+
await stat11(join32(cwd, ".git"));
|
|
32533
32493
|
return true;
|
|
32534
32494
|
} catch {
|
|
32535
32495
|
return false;
|
|
@@ -33493,7 +33453,7 @@ async function sweepOrphanedNotifications(taskStateStore, log) {
|
|
|
33493
33453
|
|
|
33494
33454
|
// src/services/loro-recovery.ts
|
|
33495
33455
|
import { access as access5, mkdir as mkdir14, rename as rename12, rm as rm6 } from "fs/promises";
|
|
33496
|
-
import { join as
|
|
33456
|
+
import { join as join33 } from "path";
|
|
33497
33457
|
var DEFAULT_RECOVERY_TTL_MS = 6e4;
|
|
33498
33458
|
function createLoroRecoveryService(deps) {
|
|
33499
33459
|
const disabled = validateEnv().SHIPYARD_DISABLE_LORO_RECOVERY;
|
|
@@ -33544,9 +33504,9 @@ function createLoroRecoveryService(deps) {
|
|
|
33544
33504
|
}
|
|
33545
33505
|
async function quarantineAndSweep(docId, isoTs) {
|
|
33546
33506
|
const encDocId = encodeURIComponent(docId);
|
|
33547
|
-
const sourcePath =
|
|
33548
|
-
const quarantineRoot =
|
|
33549
|
-
const quarantinePath =
|
|
33507
|
+
const sourcePath = join33(deps.dataDir, "loro", encDocId);
|
|
33508
|
+
const quarantineRoot = join33(deps.dataDir, "loro-quarantine", isoTs);
|
|
33509
|
+
const quarantinePath = join33(quarantineRoot, encDocId);
|
|
33550
33510
|
const sourceExists = await pathExists3(sourcePath);
|
|
33551
33511
|
if (!sourceExists) return "";
|
|
33552
33512
|
await mkdir14(quarantineRoot, { recursive: true, mode: 448 });
|
|
@@ -33555,7 +33515,7 @@ function createLoroRecoveryService(deps) {
|
|
|
33555
33515
|
}
|
|
33556
33516
|
async function postDeleteSweep(docId) {
|
|
33557
33517
|
const encDocId = encodeURIComponent(docId);
|
|
33558
|
-
const sourcePath =
|
|
33518
|
+
const sourcePath = join33(deps.dataDir, "loro", encDocId);
|
|
33559
33519
|
if (await pathExists3(sourcePath)) {
|
|
33560
33520
|
try {
|
|
33561
33521
|
await rm6(sourcePath, { recursive: true, force: true });
|
|
@@ -35382,7 +35342,7 @@ function wireControlChannel(rawChannel, daemon, logAdapter, deps) {
|
|
|
35382
35342
|
const aloStreamId = controlChannelStreamId(deps.peerSourceId);
|
|
35383
35343
|
const aloOutboxChannelName = controlChannelOutboxChannel("daemon", deps.peerSourceId);
|
|
35384
35344
|
const channelEpoch = registerControlChannelEpoch(controlPeerId);
|
|
35385
|
-
const dataDir =
|
|
35345
|
+
const dataDir = join34(deps?.shipyardHome ?? getShipyardHome(), "data");
|
|
35386
35346
|
const aloOutbox = new JsonDocOutbox({
|
|
35387
35347
|
dataDir,
|
|
35388
35348
|
channel: aloOutboxChannelName,
|
|
@@ -35806,7 +35766,7 @@ function createPeerRoleRegistry() {
|
|
|
35806
35766
|
|
|
35807
35767
|
// src/services/epoch-pruning.ts
|
|
35808
35768
|
import { readdir as readdir14, rm as rm7 } from "fs/promises";
|
|
35809
|
-
import { join as
|
|
35769
|
+
import { join as join35 } from "path";
|
|
35810
35770
|
var LEGACY_PREFIXES = [
|
|
35811
35771
|
"task-meta",
|
|
35812
35772
|
"task-conv",
|
|
@@ -35846,7 +35806,7 @@ async function pruneOldEpochData(dataDir, currentEpoch, log) {
|
|
|
35846
35806
|
}
|
|
35847
35807
|
if (!shouldPrune(decoded, currentEpoch)) continue;
|
|
35848
35808
|
removals.push(
|
|
35849
|
-
rm7(
|
|
35809
|
+
rm7(join35(dataDir, entry.name), { recursive: true }).then(() => {
|
|
35850
35810
|
pruned++;
|
|
35851
35811
|
}).catch((err3) => {
|
|
35852
35812
|
log({
|
|
@@ -38071,7 +38031,7 @@ function onConnection(ws, deps, peers) {
|
|
|
38071
38031
|
|
|
38072
38032
|
// src/services/local-direct/local-direct-token.ts
|
|
38073
38033
|
import { chmod as chmod2, mkdir as mkdir15, rename as rename13, rm as rm8, writeFile as writeFile16 } from "fs/promises";
|
|
38074
|
-
import { dirname as dirname17, join as
|
|
38034
|
+
import { dirname as dirname17, join as join36 } from "path";
|
|
38075
38035
|
var ADVERTISEMENT_FILE = "local-direct.json";
|
|
38076
38036
|
var ADVERTISEMENT_MODE = 384;
|
|
38077
38037
|
var ADVERTISEMENT_DIR_MODE = 448;
|
|
@@ -38080,7 +38040,7 @@ function generateLocalDirectToken() {
|
|
|
38080
38040
|
return nanoid(TOKEN_LENGTH);
|
|
38081
38041
|
}
|
|
38082
38042
|
function advertisementPath(shipyardHome) {
|
|
38083
|
-
return
|
|
38043
|
+
return join36(shipyardHome, "data", ADVERTISEMENT_FILE);
|
|
38084
38044
|
}
|
|
38085
38045
|
async function writeAdvertisement(shipyardHome, ad) {
|
|
38086
38046
|
const target = advertisementPath(shipyardHome);
|
|
@@ -38347,7 +38307,7 @@ async function setupPluginEventWiring(deps) {
|
|
|
38347
38307
|
import { exec as execCb2 } from "child_process";
|
|
38348
38308
|
import { existsSync as existsSync5 } from "fs";
|
|
38349
38309
|
import { readdir as readdir15, readFile as readFile22, stat as stat12 } from "fs/promises";
|
|
38350
|
-
import { basename as basename7, dirname as dirname18, join as
|
|
38310
|
+
import { basename as basename7, dirname as dirname18, join as join37 } from "path";
|
|
38351
38311
|
import { pathToFileURL as pathToFileURL2 } from "url";
|
|
38352
38312
|
import { promisify as promisify8 } from "util";
|
|
38353
38313
|
|
|
@@ -38482,7 +38442,7 @@ var PluginFileWatcher = class {
|
|
|
38482
38442
|
}
|
|
38483
38443
|
const loaded = [];
|
|
38484
38444
|
for (const entry of entries) {
|
|
38485
|
-
const pluginDir =
|
|
38445
|
+
const pluginDir = join37(dir, entry);
|
|
38486
38446
|
let stats;
|
|
38487
38447
|
try {
|
|
38488
38448
|
stats = await stat12(pluginDir);
|
|
@@ -38497,7 +38457,7 @@ var PluginFileWatcher = class {
|
|
|
38497
38457
|
this.#reconcile(loaded);
|
|
38498
38458
|
}
|
|
38499
38459
|
async #loadPlugin(id, pluginDir) {
|
|
38500
|
-
const manifestPath =
|
|
38460
|
+
const manifestPath = join37(pluginDir, "plugin.json");
|
|
38501
38461
|
let manifestRaw;
|
|
38502
38462
|
try {
|
|
38503
38463
|
manifestRaw = await readFile22(manifestPath, "utf-8");
|
|
@@ -38534,7 +38494,7 @@ var PluginFileWatcher = class {
|
|
|
38534
38494
|
return null;
|
|
38535
38495
|
}
|
|
38536
38496
|
let template = "";
|
|
38537
|
-
const templatePath =
|
|
38497
|
+
const templatePath = join37(pluginDir, "template.html");
|
|
38538
38498
|
try {
|
|
38539
38499
|
template = await readFile22(templatePath, "utf-8");
|
|
38540
38500
|
} catch {
|
|
@@ -38549,7 +38509,7 @@ var PluginFileWatcher = class {
|
|
|
38549
38509
|
};
|
|
38550
38510
|
}
|
|
38551
38511
|
async #loadAndRegisterHandler(id, pluginDir, title, manifest) {
|
|
38552
|
-
const handlerPath =
|
|
38512
|
+
const handlerPath = join37(pluginDir, "handler.mjs");
|
|
38553
38513
|
const loaded = await this.#resolveHandler(id, handlerPath);
|
|
38554
38514
|
const { handlerFn, provideResourcesFn } = loaded;
|
|
38555
38515
|
if (manifest.provideResources && provideResourcesFn && this.#config.resourceResolver) {
|
|
@@ -38707,7 +38667,7 @@ async function findNativeDependencyMarker(pluginDir) {
|
|
|
38707
38667
|
}
|
|
38708
38668
|
async function scanNativeDependencyDir(dir, stack) {
|
|
38709
38669
|
for (const entry of await readNativeScanEntries(dir)) {
|
|
38710
|
-
const fullPath =
|
|
38670
|
+
const fullPath = join37(dir, entry.name);
|
|
38711
38671
|
if (isNativeDependencyMarker(entry, dir)) return fullPath;
|
|
38712
38672
|
if (shouldDescendForNativeScan(entry)) stack.push(fullPath);
|
|
38713
38673
|
}
|
|
@@ -38732,7 +38692,7 @@ function isNodeBuildReleaseDir(dir) {
|
|
|
38732
38692
|
|
|
38733
38693
|
// src/services/port-detection.ts
|
|
38734
38694
|
import { existsSync as existsSync6, readFileSync as readFileSync5 } from "fs";
|
|
38735
|
-
import { dirname as dirname19, join as
|
|
38695
|
+
import { dirname as dirname19, join as join38 } from "path";
|
|
38736
38696
|
var LSOF_TIMEOUT_MS = 8e3;
|
|
38737
38697
|
var LSOF_TTL_MS = 5e3;
|
|
38738
38698
|
var DEFAULT_POLL_INTERVAL_MS = 5e3;
|
|
@@ -38915,7 +38875,7 @@ function hasStringName(val) {
|
|
|
38915
38875
|
function resolveProjectRoot(cwd) {
|
|
38916
38876
|
let dir = cwd;
|
|
38917
38877
|
while (true) {
|
|
38918
|
-
const candidate =
|
|
38878
|
+
const candidate = join38(dir, "package.json");
|
|
38919
38879
|
if (existsSync6(candidate)) {
|
|
38920
38880
|
let packageName;
|
|
38921
38881
|
try {
|
|
@@ -39039,7 +38999,7 @@ import {
|
|
|
39039
38999
|
unlinkSync as unlinkSync2,
|
|
39040
39000
|
writeFileSync as writeFileSync2
|
|
39041
39001
|
} from "fs";
|
|
39042
|
-
import { join as
|
|
39002
|
+
import { join as join39 } from "path";
|
|
39043
39003
|
function isEnoent6(err3) {
|
|
39044
39004
|
return err3 instanceof Error && Reflect.get(err3, "code") === "ENOENT";
|
|
39045
39005
|
}
|
|
@@ -39049,7 +39009,7 @@ function atomicWriteSync(filePath, content) {
|
|
|
39049
39009
|
renameSync(tmpPath, filePath);
|
|
39050
39010
|
}
|
|
39051
39011
|
function recordFilePath2(rootDir, taskId, elementId) {
|
|
39052
|
-
return
|
|
39012
|
+
return join39(rootDir, taskId, `${elementId}.json`);
|
|
39053
39013
|
}
|
|
39054
39014
|
function parseRecord2(filePath, logger2) {
|
|
39055
39015
|
let raw;
|
|
@@ -39089,7 +39049,7 @@ function createPreviewStateStore(opts) {
|
|
|
39089
39049
|
return taskMap;
|
|
39090
39050
|
}
|
|
39091
39051
|
function scanTaskDir(taskId) {
|
|
39092
|
-
const taskPath =
|
|
39052
|
+
const taskPath = join39(rootDir, taskId);
|
|
39093
39053
|
let files;
|
|
39094
39054
|
try {
|
|
39095
39055
|
files = readdirSync4(taskPath);
|
|
@@ -39098,7 +39058,7 @@ function createPreviewStateStore(opts) {
|
|
|
39098
39058
|
}
|
|
39099
39059
|
for (const file of files) {
|
|
39100
39060
|
if (!file.endsWith(".json")) continue;
|
|
39101
|
-
const record = parseRecord2(
|
|
39061
|
+
const record = parseRecord2(join39(taskPath, file), logger2);
|
|
39102
39062
|
if (record) getTaskMap(taskId).set(record.elementId, record);
|
|
39103
39063
|
}
|
|
39104
39064
|
}
|
|
@@ -39124,7 +39084,7 @@ function createPreviewStateStore(opts) {
|
|
|
39124
39084
|
function writeToDisk(taskId, state) {
|
|
39125
39085
|
const filePath = recordFilePath2(rootDir, taskId, state.elementId);
|
|
39126
39086
|
try {
|
|
39127
|
-
mkdirSync3(
|
|
39087
|
+
mkdirSync3(join39(rootDir, taskId), { recursive: true });
|
|
39128
39088
|
atomicWriteSync(filePath, JSON.stringify(state));
|
|
39129
39089
|
} catch (err3) {
|
|
39130
39090
|
logger2.warn(
|
|
@@ -41465,7 +41425,7 @@ function wireThreadErrorFallback(daemon, dc, taskId, threadId, channelId, log) {
|
|
|
41465
41425
|
}
|
|
41466
41426
|
|
|
41467
41427
|
// src/services/terminal-handler.ts
|
|
41468
|
-
import { join as
|
|
41428
|
+
import { join as join40 } from "path";
|
|
41469
41429
|
|
|
41470
41430
|
// src/shared/pty-manager.ts
|
|
41471
41431
|
import { accessSync, chmodSync, constants as constants2, createWriteStream } from "fs";
|
|
@@ -41746,7 +41706,7 @@ function createPtyManager() {
|
|
|
41746
41706
|
// src/services/terminal-handler.ts
|
|
41747
41707
|
var MAX_PTYS_DEFAULT = 20;
|
|
41748
41708
|
function terminalLogPathFor(dir, terminalId) {
|
|
41749
|
-
return
|
|
41709
|
+
return join40(dir, `${terminalId}.log`);
|
|
41750
41710
|
}
|
|
41751
41711
|
function handleTerminalChannel(taskId, terminalId, cwd, send, log, deps) {
|
|
41752
41712
|
const maxPtys = deps.maxPtys ?? MAX_PTYS_DEFAULT;
|
|
@@ -42356,7 +42316,7 @@ function buildCollabRoomManager(deps) {
|
|
|
42356
42316
|
// src/services/serve-factory.ts
|
|
42357
42317
|
import { randomUUID as randomUUID25 } from "crypto";
|
|
42358
42318
|
import { mkdir as mkdir36 } from "fs/promises";
|
|
42359
|
-
import { join as
|
|
42319
|
+
import { join as join78 } from "path";
|
|
42360
42320
|
|
|
42361
42321
|
// src/shared/capabilities/cursor-boot-auth.ts
|
|
42362
42322
|
async function mergeCursorAuthFromVault(caps, detect, log) {
|
|
@@ -42397,12 +42357,12 @@ async function mergeCursorAuthFromVault(caps, detect, log) {
|
|
|
42397
42357
|
|
|
42398
42358
|
// src/shared/capabilities/cursor-hook-shim-path.ts
|
|
42399
42359
|
import { statSync as statSync3 } from "fs";
|
|
42400
|
-
import { join as
|
|
42360
|
+
import { join as join41 } from "path";
|
|
42401
42361
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
42402
42362
|
function getCursorHookShimPath() {
|
|
42403
42363
|
const resourcesPath = Reflect.get(process, "resourcesPath");
|
|
42404
42364
|
if (typeof resourcesPath === "string" && resourcesPath.length > 0) {
|
|
42405
|
-
return
|
|
42365
|
+
return join41(resourcesPath, "daemon", "cursor-hook-shim.js");
|
|
42406
42366
|
}
|
|
42407
42367
|
return fileURLToPath2(new URL("./cursor-hook-shim.js", import.meta.url));
|
|
42408
42368
|
}
|
|
@@ -42637,7 +42597,7 @@ function resolveRuntimeAuthIdentity(runtimeAuth, runtimeId) {
|
|
|
42637
42597
|
// src/shared/capabilities/spinner-verbs-reader.ts
|
|
42638
42598
|
import { readFile as readFile23 } from "fs/promises";
|
|
42639
42599
|
import { homedir as homedir5 } from "os";
|
|
42640
|
-
import { join as
|
|
42600
|
+
import { join as join42 } from "path";
|
|
42641
42601
|
var ClaudeSpinnerVerbsSchema = external_exports.object({
|
|
42642
42602
|
mode: external_exports.enum(["append", "replace"]),
|
|
42643
42603
|
verbs: external_exports.array(external_exports.string())
|
|
@@ -42662,8 +42622,8 @@ function toPersistedVerbs(resolved, defaults2) {
|
|
|
42662
42622
|
return resolved.every((v2, i) => v2 === defaults2[i]) ? [] : [...resolved];
|
|
42663
42623
|
}
|
|
42664
42624
|
async function readSpinnerVerbs() {
|
|
42665
|
-
const claudeDir =
|
|
42666
|
-
const paths = [
|
|
42625
|
+
const claudeDir = join42(homedir5(), ".claude");
|
|
42626
|
+
const paths = [join42(claudeDir, "settings.json"), join42(claudeDir, "settings.local.json")];
|
|
42667
42627
|
const parsed = await Promise.all(
|
|
42668
42628
|
paths.map(async (p2) => {
|
|
42669
42629
|
try {
|
|
@@ -42705,7 +42665,7 @@ async function reimportSpinnerVerbs(store, log) {
|
|
|
42705
42665
|
|
|
42706
42666
|
// src/shared/mcp/oauth-state-store.ts
|
|
42707
42667
|
import { readFile as readFile24 } from "fs/promises";
|
|
42708
|
-
import { join as
|
|
42668
|
+
import { join as join43 } from "path";
|
|
42709
42669
|
import {
|
|
42710
42670
|
OAuthClientInformationFullSchema as OAuthClientInformationFullSchema2,
|
|
42711
42671
|
OAuthClientInformationSchema as OAuthClientInformationSchema2,
|
|
@@ -42751,7 +42711,7 @@ var MCPOAuthStateStore = class {
|
|
|
42751
42711
|
this.#shipyardHome = shipyardHome;
|
|
42752
42712
|
}
|
|
42753
42713
|
#filePath() {
|
|
42754
|
-
return
|
|
42714
|
+
return join43(this.#shipyardHome, STATE_FILE);
|
|
42755
42715
|
}
|
|
42756
42716
|
#lockPath() {
|
|
42757
42717
|
return `${this.#filePath()}.lock`;
|
|
@@ -42850,11 +42810,11 @@ function getShipyardSubagentCatalog() {
|
|
|
42850
42810
|
|
|
42851
42811
|
// src/services/bootstrap/rehydrate.ts
|
|
42852
42812
|
import { readFile as readFile26, rename as rename16, writeFile as writeFile18 } from "fs/promises";
|
|
42853
|
-
import { join as
|
|
42813
|
+
import { join as join45 } from "path";
|
|
42854
42814
|
|
|
42855
42815
|
// src/services/collab/collab-queue-persistence.ts
|
|
42856
42816
|
import { appendFile as appendFile2, mkdir as mkdir16, readdir as readdir16, readFile as readFile25, rename as rename15, rm as rm9, writeFile as writeFile17 } from "fs/promises";
|
|
42857
|
-
import { join as
|
|
42817
|
+
import { join as join44 } from "path";
|
|
42858
42818
|
var PersistedQueueEntrySchema = external_exports.object({
|
|
42859
42819
|
content: external_exports.array(ContentBlockSchema),
|
|
42860
42820
|
settings: DaemonSettingsSchema.optional(),
|
|
@@ -42878,9 +42838,9 @@ function parsePersistedLine(line) {
|
|
|
42878
42838
|
};
|
|
42879
42839
|
}
|
|
42880
42840
|
function buildCollabQueuePersistence(dataDir) {
|
|
42881
|
-
const queuesDir =
|
|
42841
|
+
const queuesDir = join44(dataDir, "collab-queues");
|
|
42882
42842
|
function queuePath(queueKey) {
|
|
42883
|
-
return
|
|
42843
|
+
return join44(queuesDir, `${queueKey}.jsonl`);
|
|
42884
42844
|
}
|
|
42885
42845
|
async function ensureDir() {
|
|
42886
42846
|
await mkdir16(queuesDir, { recursive: true });
|
|
@@ -42973,7 +42933,7 @@ function buildCollabQueuePersistence(dataDir) {
|
|
|
42973
42933
|
}
|
|
42974
42934
|
for (const name of names) {
|
|
42975
42935
|
if (!name.includes(".tmp-")) continue;
|
|
42976
|
-
await rm9(
|
|
42936
|
+
await rm9(join44(queuesDir, name), { force: true }).catch(() => {
|
|
42977
42937
|
});
|
|
42978
42938
|
}
|
|
42979
42939
|
}
|
|
@@ -43292,7 +43252,7 @@ async function stripPinnedFieldFromTasksFile(tasksPath, envelope, records) {
|
|
|
43292
43252
|
}
|
|
43293
43253
|
}
|
|
43294
43254
|
async function migratePinnedToFavoriteTasks(dataDir, userSettingsStore, log) {
|
|
43295
|
-
const tasksPath =
|
|
43255
|
+
const tasksPath = join45(dataDir, "tasks.json");
|
|
43296
43256
|
const parsed = await readRawTasksEnvelope(tasksPath);
|
|
43297
43257
|
if (!parsed) return;
|
|
43298
43258
|
const { records, envelope, fromMigrated } = parsed;
|
|
@@ -43408,7 +43368,7 @@ async function sweepStaleTasks(taskStateStore, taskManager, log) {
|
|
|
43408
43368
|
|
|
43409
43369
|
// src/services/bootstrap/update-status.ts
|
|
43410
43370
|
import { readFile as readFile27, unlink as unlink11 } from "fs/promises";
|
|
43411
|
-
import { join as
|
|
43371
|
+
import { join as join46 } from "path";
|
|
43412
43372
|
var UPDATE_STATUS_FILENAME = "update-status.json";
|
|
43413
43373
|
var RAW_LOG_MAX_CHARS = 500;
|
|
43414
43374
|
var UpdateStatusSchema = external_exports.object({
|
|
@@ -43421,7 +43381,7 @@ var UpdateStatusSchema = external_exports.object({
|
|
|
43421
43381
|
rolledBack: external_exports.boolean()
|
|
43422
43382
|
});
|
|
43423
43383
|
async function readAndClearUpdateStatus(shipyardHome, log) {
|
|
43424
|
-
const path5 =
|
|
43384
|
+
const path5 = join46(shipyardHome, UPDATE_STATUS_FILENAME);
|
|
43425
43385
|
let raw;
|
|
43426
43386
|
try {
|
|
43427
43387
|
raw = await readFile27(path5, "utf-8");
|
|
@@ -43508,11 +43468,11 @@ function wireUpdateStatusForwarding(report, sink2, onMessage, log) {
|
|
|
43508
43468
|
|
|
43509
43469
|
// src/services/bootstrap/updates-cleanup.ts
|
|
43510
43470
|
import { readdir as readdir17, rm as rm10, stat as stat14, unlink as unlink13 } from "fs/promises";
|
|
43511
|
-
import { join as
|
|
43471
|
+
import { join as join48 } from "path";
|
|
43512
43472
|
|
|
43513
43473
|
// src/services/bootstrap/self-update-lock.ts
|
|
43514
43474
|
import { mkdir as mkdir17, readFile as readFile28, stat as stat13, unlink as unlink12, writeFile as writeFile19 } from "fs/promises";
|
|
43515
|
-
import { dirname as dirname21, join as
|
|
43475
|
+
import { dirname as dirname21, join as join47 } from "path";
|
|
43516
43476
|
var LOCK_FILENAME = ".lock";
|
|
43517
43477
|
var STALE_LOCK_MS = 10 * 60 * 1e3;
|
|
43518
43478
|
var LockFileSchema = external_exports.object({
|
|
@@ -43520,7 +43480,7 @@ var LockFileSchema = external_exports.object({
|
|
|
43520
43480
|
startedAt: external_exports.number()
|
|
43521
43481
|
});
|
|
43522
43482
|
function lockPath(shipyardHome) {
|
|
43523
|
-
return
|
|
43483
|
+
return join47(shipyardHome, "updates", LOCK_FILENAME);
|
|
43524
43484
|
}
|
|
43525
43485
|
function isStaleLock(lock, now, isProcessAlive2) {
|
|
43526
43486
|
const age = now - lock.startedAt;
|
|
@@ -43643,7 +43603,7 @@ async function cleanupUpdatesDir(shipyardHome, deps = {}) {
|
|
|
43643
43603
|
const now = deps.now ?? Date.now;
|
|
43644
43604
|
const isProcessAlive2 = deps.isProcessAlive ?? defaultIsProcessAlive;
|
|
43645
43605
|
const log = deps.log;
|
|
43646
|
-
const updatesDir =
|
|
43606
|
+
const updatesDir = join48(shipyardHome, "updates");
|
|
43647
43607
|
const empty2 = {
|
|
43648
43608
|
tarballsKept: [],
|
|
43649
43609
|
tarballsDeleted: [],
|
|
@@ -43767,7 +43727,7 @@ async function sortByMtimeDesc(baseDir, names, log) {
|
|
|
43767
43727
|
const rows = [];
|
|
43768
43728
|
for (const name of names) {
|
|
43769
43729
|
try {
|
|
43770
|
-
const s2 = await stat14(
|
|
43730
|
+
const s2 = await stat14(join48(baseDir, name));
|
|
43771
43731
|
rows.push({ name, mtimeMs: s2.mtimeMs });
|
|
43772
43732
|
} catch (err3) {
|
|
43773
43733
|
log?.info({ err: err3, entry: name }, "updates cleanup: stat failed, skipping entry");
|
|
@@ -43780,7 +43740,7 @@ async function filterOlderThan(baseDir, names, nowMs, thresholdMs, log) {
|
|
|
43780
43740
|
const out = [];
|
|
43781
43741
|
for (const name of names) {
|
|
43782
43742
|
try {
|
|
43783
|
-
const s2 = await stat14(
|
|
43743
|
+
const s2 = await stat14(join48(baseDir, name));
|
|
43784
43744
|
if (nowMs - s2.mtimeMs > thresholdMs) {
|
|
43785
43745
|
out.push(name);
|
|
43786
43746
|
}
|
|
@@ -43794,7 +43754,7 @@ async function deleteFiles(baseDir, names, log) {
|
|
|
43794
43754
|
const deleted = [];
|
|
43795
43755
|
for (const name of names) {
|
|
43796
43756
|
try {
|
|
43797
|
-
await unlink13(
|
|
43757
|
+
await unlink13(join48(baseDir, name));
|
|
43798
43758
|
deleted.push(name);
|
|
43799
43759
|
} catch (err3) {
|
|
43800
43760
|
if (isEnoent(err3)) {
|
|
@@ -43810,7 +43770,7 @@ async function deleteDirs(baseDir, names, log) {
|
|
|
43810
43770
|
const deleted = [];
|
|
43811
43771
|
for (const name of names) {
|
|
43812
43772
|
try {
|
|
43813
|
-
await rm10(
|
|
43773
|
+
await rm10(join48(baseDir, name), { recursive: true, force: true });
|
|
43814
43774
|
deleted.push(name);
|
|
43815
43775
|
} catch (err3) {
|
|
43816
43776
|
log?.info({ err: err3, entry: name }, "updates cleanup: rm -rf failed");
|
|
@@ -43819,7 +43779,7 @@ async function deleteDirs(baseDir, names, log) {
|
|
|
43819
43779
|
return deleted;
|
|
43820
43780
|
}
|
|
43821
43781
|
async function maybeClearLock(shipyardHome, nowMs, isProcessAlive2, log) {
|
|
43822
|
-
const lockFilePath =
|
|
43782
|
+
const lockFilePath = join48(shipyardHome, "updates", LOCK_FILENAME);
|
|
43823
43783
|
const outcome = await readLockFileWithOutcome(shipyardHome);
|
|
43824
43784
|
switch (outcome.kind) {
|
|
43825
43785
|
case "absent":
|
|
@@ -45120,7 +45080,7 @@ function wireDevServersAndTerminalsResolvers(deps) {
|
|
|
45120
45080
|
|
|
45121
45081
|
// src/services/file-resource-resolver.ts
|
|
45122
45082
|
import { readFile as readFile29, stat as stat15 } from "fs/promises";
|
|
45123
|
-
import { basename as basename8, join as
|
|
45083
|
+
import { basename as basename8, join as join49, normalize as normalize4, sep as sep3 } from "path";
|
|
45124
45084
|
var MAX_FILE_SIZE = 10 * 1024 * 1024;
|
|
45125
45085
|
var MIME_BY_EXT2 = {
|
|
45126
45086
|
".ts": "text/typescript",
|
|
@@ -45189,7 +45149,7 @@ function createFileResourceResolver(deps) {
|
|
|
45189
45149
|
const { taskId, relativePath } = parseFileUri2(uri);
|
|
45190
45150
|
const cwd = deps.getTaskCwd(taskId) ?? deps.workspaceRoot;
|
|
45191
45151
|
const normalizedCwd = normalize4(cwd);
|
|
45192
|
-
const absolutePath = normalize4(
|
|
45152
|
+
const absolutePath = normalize4(join49(cwd, relativePath));
|
|
45193
45153
|
const cwdPrefix = normalizedCwd.endsWith(sep3) ? normalizedCwd : `${normalizedCwd}${sep3}`;
|
|
45194
45154
|
if (!absolutePath.startsWith(cwdPrefix) && absolutePath !== normalizedCwd) {
|
|
45195
45155
|
throw new Error(`Path traversal rejected: ${relativePath}`);
|
|
@@ -45257,7 +45217,7 @@ function unregisterSubprocessEpoch(taskId, registry = subprocessEpochs) {
|
|
|
45257
45217
|
// src/services/harness/deliverable-server.ts
|
|
45258
45218
|
import { randomUUID as randomUUID12 } from "crypto";
|
|
45259
45219
|
import { copyFile, rm as fsRm, stat as fsStat3, mkdir as mkdir18 } from "fs/promises";
|
|
45260
|
-
import { basename as basename9, extname as extname2, join as
|
|
45220
|
+
import { basename as basename9, extname as extname2, join as join50, resolve as resolve8, sep as sep4 } from "path";
|
|
45261
45221
|
var TOOL_DESCRIPTION2 = [
|
|
45262
45222
|
"Register a proof-of-work deliverable for this task. Call this after producing an artifact (screenshot, video, log, markdown document, AX tree, DOM snapshot) so reviewers can see verifiable evidence of what the agent produced.",
|
|
45263
45223
|
"",
|
|
@@ -45317,7 +45277,7 @@ var RegisterDeliverableInput = {
|
|
|
45317
45277
|
};
|
|
45318
45278
|
var COPY_MAX_BYTES = 50 * 1024 * 1024;
|
|
45319
45279
|
function isInternedFile(dataDir, filePath) {
|
|
45320
|
-
const internBase = resolve8(
|
|
45280
|
+
const internBase = resolve8(join50(dataDir, "deliverable-files")) + sep4;
|
|
45321
45281
|
return resolve8(filePath).startsWith(internBase);
|
|
45322
45282
|
}
|
|
45323
45283
|
async function internDeliverableFile(deliverableId, taskId, filePath, storedSizeBytes, dataDir, prevInternedPath) {
|
|
@@ -45341,8 +45301,8 @@ async function internDeliverableFile(deliverableId, taskId, filePath, storedSize
|
|
|
45341
45301
|
};
|
|
45342
45302
|
}
|
|
45343
45303
|
const ext = extname2(filePath);
|
|
45344
|
-
const destDir =
|
|
45345
|
-
const destPath =
|
|
45304
|
+
const destDir = join50(dataDir, "deliverable-files", taskId);
|
|
45305
|
+
const destPath = join50(destDir, `${deliverableId}${ext}`);
|
|
45346
45306
|
try {
|
|
45347
45307
|
await mkdir18(destDir, { recursive: true });
|
|
45348
45308
|
await copyFile(filePath, destPath);
|
|
@@ -45768,7 +45728,7 @@ function createDeliverableTools(ctx) {
|
|
|
45768
45728
|
|
|
45769
45729
|
// src/services/harness/plugin-server.ts
|
|
45770
45730
|
import { mkdir as mkdir19, writeFile as writeFile20 } from "fs/promises";
|
|
45771
|
-
import { join as
|
|
45731
|
+
import { join as join51 } from "path";
|
|
45772
45732
|
|
|
45773
45733
|
// src/services/harness/sandbox-docs.ts
|
|
45774
45734
|
var SANDBOX_HTML_RULES = `## HTML Rules
|
|
@@ -46386,14 +46346,14 @@ ${addendum}`;
|
|
|
46386
46346
|
events: input.events,
|
|
46387
46347
|
provideResources: input.provideResources
|
|
46388
46348
|
});
|
|
46389
|
-
const pluginDir =
|
|
46349
|
+
const pluginDir = join51(ctx.pluginsDir, input.pluginId);
|
|
46390
46350
|
await mkdir19(pluginDir, { recursive: true });
|
|
46391
|
-
await writeFile20(
|
|
46351
|
+
await writeFile20(join51(pluginDir, "template.html"), input.template, "utf-8");
|
|
46392
46352
|
if (input.handler) {
|
|
46393
|
-
await writeFile20(
|
|
46353
|
+
await writeFile20(join51(pluginDir, "handler.mjs"), input.handler, "utf-8");
|
|
46394
46354
|
}
|
|
46395
46355
|
await writeFile20(
|
|
46396
|
-
|
|
46356
|
+
join51(pluginDir, "plugin.json"),
|
|
46397
46357
|
JSON.stringify(manifest, null, 2),
|
|
46398
46358
|
"utf-8"
|
|
46399
46359
|
);
|
|
@@ -56584,7 +56544,7 @@ import { pathToFileURL as pathToFileURL3 } from "url";
|
|
|
56584
56544
|
// src/services/lsp/language-server-registry.ts
|
|
56585
56545
|
import { existsSync as existsSync7, readFileSync as readFileSync7 } from "fs";
|
|
56586
56546
|
import { createRequire as createRequire3 } from "module";
|
|
56587
|
-
import { dirname as dirname22, isAbsolute as isAbsolute4, join as
|
|
56547
|
+
import { dirname as dirname22, isAbsolute as isAbsolute4, join as join52 } from "path";
|
|
56588
56548
|
function decideTypescriptServer(d) {
|
|
56589
56549
|
if (d.hasAngular || d.hasNest || d.hasTsserverPlugins) return "vtsls";
|
|
56590
56550
|
return "tsgo";
|
|
@@ -56674,11 +56634,11 @@ function isRecord7(value) {
|
|
|
56674
56634
|
return typeof value === "object" && value !== null;
|
|
56675
56635
|
}
|
|
56676
56636
|
function gatherTsDetection(cwd, deps) {
|
|
56677
|
-
const pkg = deps.readJsonFile(
|
|
56637
|
+
const pkg = deps.readJsonFile(join52(cwd, "package.json"));
|
|
56678
56638
|
const depNames = isRecord7(pkg) ? [...keysOf(pkg.dependencies), ...keysOf(pkg.devDependencies)] : [];
|
|
56679
|
-
const hasAngular = depNames.includes("@angular/core") || deps.fileExists(
|
|
56680
|
-
const hasNest = depNames.includes("@nestjs/core") || deps.fileExists(
|
|
56681
|
-
const tsconfig = deps.readJsonFile(
|
|
56639
|
+
const hasAngular = depNames.includes("@angular/core") || deps.fileExists(join52(cwd, "angular.json"));
|
|
56640
|
+
const hasNest = depNames.includes("@nestjs/core") || deps.fileExists(join52(cwd, "nest-cli.json"));
|
|
56641
|
+
const tsconfig = deps.readJsonFile(join52(cwd, "tsconfig.json"));
|
|
56682
56642
|
const compilerOptions = isRecord7(tsconfig) ? tsconfig.compilerOptions : void 0;
|
|
56683
56643
|
const plugins2 = isRecord7(compilerOptions) ? compilerOptions.plugins : void 0;
|
|
56684
56644
|
const hasTsserverPlugins = Array.isArray(plugins2) && plugins2.length > 0;
|
|
@@ -56693,11 +56653,11 @@ function detectPythonVenv(cwd, deps) {
|
|
|
56693
56653
|
if (envVenv && isAbsolute4(envVenv) && deps.fileExists(envVenv)) {
|
|
56694
56654
|
candidates.push(envVenv);
|
|
56695
56655
|
}
|
|
56696
|
-
candidates.push(
|
|
56656
|
+
candidates.push(join52(cwd, ".venv"), join52(cwd, "venv"));
|
|
56697
56657
|
const isWin = deps.platform === "win32";
|
|
56698
56658
|
for (const root of candidates) {
|
|
56699
|
-
const python = isWin ?
|
|
56700
|
-
const python3 = isWin ? python :
|
|
56659
|
+
const python = isWin ? join52(root, "Scripts", "python.exe") : join52(root, "bin", "python");
|
|
56660
|
+
const python3 = isWin ? python : join52(root, "bin", "python3");
|
|
56701
56661
|
if (deps.fileExists(python) || deps.fileExists(python3)) return root;
|
|
56702
56662
|
}
|
|
56703
56663
|
return null;
|
|
@@ -56730,8 +56690,8 @@ function resolveTsgoBinaryPath(req) {
|
|
|
56730
56690
|
`Unable to resolve ${platformPkg}: ${err3 instanceof Error ? err3.message : String(err3)}`
|
|
56731
56691
|
);
|
|
56732
56692
|
}
|
|
56733
|
-
const exeDir =
|
|
56734
|
-
const exe = process.platform === "win32" ?
|
|
56693
|
+
const exeDir = join52(dirname22(pkgJsonPath), "lib");
|
|
56694
|
+
const exe = process.platform === "win32" ? join52(exeDir, "tsgo.exe") : join52(exeDir, "tsgo");
|
|
56735
56695
|
if (!existsSync7(exe)) {
|
|
56736
56696
|
throw new Error(`tsgo native binary not found: ${exe}`);
|
|
56737
56697
|
}
|
|
@@ -56744,7 +56704,7 @@ function resolveBinViaPackageJson(pkg, binName, req) {
|
|
|
56744
56704
|
const named = isRecord7(binField) ? binField[binName] : void 0;
|
|
56745
56705
|
const bin = typeof binField === "string" ? binField : typeof named === "string" ? named : void 0;
|
|
56746
56706
|
if (!bin) throw new Error(`package '${pkg}' has no bin entry '${binName}'`);
|
|
56747
|
-
return
|
|
56707
|
+
return join52(dirname22(pkgJsonPath), bin);
|
|
56748
56708
|
}
|
|
56749
56709
|
function errorMessage3(err3) {
|
|
56750
56710
|
return err3 instanceof Error ? err3.message : String(err3);
|
|
@@ -59607,7 +59567,7 @@ import { execFile as execFileCb3 } from "child_process";
|
|
|
59607
59567
|
import { createHash as createHash3 } from "crypto";
|
|
59608
59568
|
import { readFile as readFile31 } from "fs/promises";
|
|
59609
59569
|
import { homedir as homedir6 } from "os";
|
|
59610
|
-
import { join as
|
|
59570
|
+
import { join as join53 } from "path";
|
|
59611
59571
|
import { promisify as promisify9 } from "util";
|
|
59612
59572
|
var execFile10 = promisify9(execFileCb3);
|
|
59613
59573
|
var CodexCredentialsEntrySchema = external_exports.object({
|
|
@@ -59668,10 +59628,10 @@ async function readKeychainStore() {
|
|
|
59668
59628
|
return null;
|
|
59669
59629
|
}
|
|
59670
59630
|
}
|
|
59671
|
-
async function readCodexMcpCredentials(serverName, serverUrl, codexHome =
|
|
59631
|
+
async function readCodexMcpCredentials(serverName, serverUrl, codexHome = join53(homedir6(), ".codex")) {
|
|
59672
59632
|
if (!serverUrl) return null;
|
|
59673
59633
|
try {
|
|
59674
|
-
const raw = await readFile31(
|
|
59634
|
+
const raw = await readFile31(join53(codexHome, FALLBACK_FILENAME), "utf-8");
|
|
59675
59635
|
const fileResult = CodexCredentialsFileSchema.safeParse(JSON.parse(raw));
|
|
59676
59636
|
if (fileResult.success) {
|
|
59677
59637
|
const entry = findEntry2(fileResult.data, serverName, serverUrl);
|
|
@@ -61868,7 +61828,7 @@ var HealthMetrics = class {
|
|
|
61868
61828
|
// src/services/metrics/stall-profiler.ts
|
|
61869
61829
|
import { mkdir as mkdir20, readdir as readdir18, unlink as unlink14, writeFile as writeFile21 } from "fs/promises";
|
|
61870
61830
|
import { Session as Session2 } from "inspector/promises";
|
|
61871
|
-
import { join as
|
|
61831
|
+
import { join as join54 } from "path";
|
|
61872
61832
|
import { monitorEventLoopDelay as monitorEventLoopDelay3 } from "perf_hooks";
|
|
61873
61833
|
function hasProfile2(value) {
|
|
61874
61834
|
return typeof value === "object" && value !== null && "profile" in value;
|
|
@@ -61978,7 +61938,7 @@ var StallProfiler = class {
|
|
|
61978
61938
|
const isoTs = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
61979
61939
|
const stallRounded = Math.round(stallMs);
|
|
61980
61940
|
const filename = `stall-${isoTs}-${stallRounded}ms.cpuprofile`;
|
|
61981
|
-
const profilePath =
|
|
61941
|
+
const profilePath = join54(this.#outDir, filename);
|
|
61982
61942
|
await mkdir20(this.#outDir, { recursive: true });
|
|
61983
61943
|
await writeFile21(profilePath, JSON.stringify(stopResult.profile));
|
|
61984
61944
|
this.#log({
|
|
@@ -62012,7 +61972,7 @@ var StallProfiler = class {
|
|
|
62012
61972
|
const entries = await readdir18(this.#outDir);
|
|
62013
61973
|
const toDelete = planProfileEviction(entries, this.#maxProfiles, STALL_PROFILE_PREFIX);
|
|
62014
61974
|
if (toDelete.length === 0) return;
|
|
62015
|
-
const results = await Promise.allSettled(toDelete.map((f2) => unlink14(
|
|
61975
|
+
const results = await Promise.allSettled(toDelete.map((f2) => unlink14(join54(this.#outDir, f2))));
|
|
62016
61976
|
const failures = results.filter((r) => r.status === "rejected").length;
|
|
62017
61977
|
if (failures > 0) {
|
|
62018
61978
|
this.#log({
|
|
@@ -63071,7 +63031,7 @@ function joinPoint(doc2, pos, dir = -1) {
|
|
|
63071
63031
|
pos = dir < 0 ? $pos.before(d) : $pos.after(d);
|
|
63072
63032
|
}
|
|
63073
63033
|
}
|
|
63074
|
-
function
|
|
63034
|
+
function join55(tr2, pos, depth) {
|
|
63075
63035
|
let convertNewlines = null;
|
|
63076
63036
|
let { linebreakReplacement } = tr2.doc.type.schema;
|
|
63077
63037
|
let $before = tr2.doc.resolve(pos - depth), beforeType = $before.node().type;
|
|
@@ -63757,7 +63717,7 @@ var Transform = class {
|
|
|
63757
63717
|
last and first siblings are also joined, and so on.
|
|
63758
63718
|
*/
|
|
63759
63719
|
join(pos, depth = 1) {
|
|
63760
|
-
|
|
63720
|
+
join55(this, pos, depth);
|
|
63761
63721
|
return this;
|
|
63762
63722
|
}
|
|
63763
63723
|
/**
|
|
@@ -84171,11 +84131,10 @@ var PreWarmManager = class {
|
|
|
84171
84131
|
#cwd = null;
|
|
84172
84132
|
#generation = 0;
|
|
84173
84133
|
/**
|
|
84174
|
-
*
|
|
84175
|
-
* spawn
|
|
84176
|
-
*
|
|
84177
|
-
*
|
|
84178
|
-
* `#teardown()` / `dispose()`.
|
|
84134
|
+
* Per-spawn epoch UUID — minted alongside each `#generation` increment in
|
|
84135
|
+
* `#spawn()`. Surfaced on `PreWarmClaim` so the adopting Thread can register
|
|
84136
|
+
* it with the subprocess-epoch registry (AGENTS.md Invariant #2b). Reset to
|
|
84137
|
+
* `null` on `#teardown()` / `dispose()`.
|
|
84179
84138
|
*/
|
|
84180
84139
|
#epoch = null;
|
|
84181
84140
|
#disposed = false;
|
|
@@ -84399,7 +84358,7 @@ var PreWarmManager = class {
|
|
|
84399
84358
|
this.#canUseToolSlot = null;
|
|
84400
84359
|
if (this.#epoch === null) {
|
|
84401
84360
|
throw new Error(
|
|
84402
|
-
`PreWarmManager.claim() invariant violated: warm subprocess has no
|
|
84361
|
+
`PreWarmManager.claim() invariant violated: warm subprocess has no #epoch (status=${this.#status}, cwd=${cwd})`
|
|
84403
84362
|
);
|
|
84404
84363
|
}
|
|
84405
84364
|
const epoch = this.#epoch;
|
|
@@ -84443,7 +84402,7 @@ var PreWarmManager = class {
|
|
|
84443
84402
|
return;
|
|
84444
84403
|
}
|
|
84445
84404
|
const generation = ++this.#generation;
|
|
84446
|
-
this.#epoch =
|
|
84405
|
+
this.#epoch = crypto.randomUUID();
|
|
84447
84406
|
this.#cwd = cwd;
|
|
84448
84407
|
this.#status = "spawning";
|
|
84449
84408
|
const slot = createEventSlot();
|
|
@@ -84481,7 +84440,6 @@ var PreWarmManager = class {
|
|
|
84481
84440
|
settings,
|
|
84482
84441
|
cwd
|
|
84483
84442
|
);
|
|
84484
|
-
this.#epoch = this.#subprocess.harnessEpoch;
|
|
84485
84443
|
emitStep("spawn_call", performance.now() - tSpawnCall);
|
|
84486
84444
|
this.#startWarmTimer(generation);
|
|
84487
84445
|
}
|
|
@@ -91949,10 +91907,6 @@ var CodexAgentSubprocess = class _CodexAgentSubprocess {
|
|
|
91949
91907
|
reason: "Codex prewarm not supported; taskId is set at thread/start only."
|
|
91950
91908
|
});
|
|
91951
91909
|
}
|
|
91952
|
-
/** Codex fences its harness MCP via the HTTP `x-shipyard-generation` header / per-runner bearer, not an in-process epoch. */
|
|
91953
|
-
get harnessEpoch() {
|
|
91954
|
-
return null;
|
|
91955
|
-
}
|
|
91956
91910
|
setOnCwdChanged(handler) {
|
|
91957
91911
|
this.#cwdHandler = handler;
|
|
91958
91912
|
}
|
|
@@ -92470,10 +92424,6 @@ function createCodexSubprocessFacade(options, log) {
|
|
|
92470
92424
|
}
|
|
92471
92425
|
pending.push({ kind: "setHarnessTaskId", taskId });
|
|
92472
92426
|
},
|
|
92473
|
-
/** Codex fences via HTTP header / per-runner bearer — always null (delegated for forward-compat). */
|
|
92474
|
-
get harnessEpoch() {
|
|
92475
|
-
return inner ? inner.harnessEpoch : null;
|
|
92476
|
-
},
|
|
92477
92427
|
setOnCwdChanged(handler) {
|
|
92478
92428
|
cwdHandler = handler;
|
|
92479
92429
|
if (inner) {
|
|
@@ -92552,10 +92502,6 @@ function createCodexFacadeApiBuilder(d) {
|
|
|
92552
92502
|
reconnectMcpServer: (serverName) => codexFacadeReconnectMcpServer(state, serverName),
|
|
92553
92503
|
stopBackgroundTask: (taskId) => codexFacadeStopBackgroundTask(state, taskId),
|
|
92554
92504
|
setHarnessTaskId: (taskId) => codexFacadeSetHarnessTaskId(state, taskId),
|
|
92555
|
-
/** Codex fences its harness via HTTP header / per-runner bearer — delegate (always null today). */
|
|
92556
|
-
get harnessEpoch() {
|
|
92557
|
-
return state.inner?.harnessEpoch ?? null;
|
|
92558
|
-
},
|
|
92559
92505
|
setOnCwdChanged: (handler) => codexFacadeSetOnCwdChanged(state, handler),
|
|
92560
92506
|
getContextUsage: () => state.inner?.getContextUsage() ?? Promise.resolve(null),
|
|
92561
92507
|
restartWithExtendedSandbox: (grant) => codexFacadeRestartWithExtendedSandbox(state, grant),
|
|
@@ -93670,12 +93616,12 @@ function handleTaskStoreBroadcast(deps, event) {
|
|
|
93670
93616
|
}
|
|
93671
93617
|
|
|
93672
93618
|
// src/services/serve-factory/viz-preview.ts
|
|
93673
|
-
import { join as
|
|
93619
|
+
import { join as join58 } from "path";
|
|
93674
93620
|
|
|
93675
93621
|
// src/services/harness/visualization-file-watcher.ts
|
|
93676
93622
|
import { randomUUID as randomUUID16 } from "crypto";
|
|
93677
93623
|
import { mkdir as mkdir21, readFile as readFile32, rename as rename17, writeFile as writeFile22 } from "fs/promises";
|
|
93678
|
-
import { basename as basename10, dirname as dirname23, join as
|
|
93624
|
+
import { basename as basename10, dirname as dirname23, join as join56 } from "path";
|
|
93679
93625
|
var PREVIEW_DEFAULT_W = 1200;
|
|
93680
93626
|
var PREVIEW_DEFAULT_H = 800;
|
|
93681
93627
|
function previewDataToLoroValue(data) {
|
|
@@ -93886,7 +93832,7 @@ var VisualizationFileWatcher = class {
|
|
|
93886
93832
|
}
|
|
93887
93833
|
case "persist_registry":
|
|
93888
93834
|
await atomicWrite2(
|
|
93889
|
-
|
|
93835
|
+
join56(this.#deps.vizDir, effect.taskId, "registry.json"),
|
|
93890
93836
|
JSON.stringify(effect.data, null, 2)
|
|
93891
93837
|
);
|
|
93892
93838
|
break;
|
|
@@ -94154,7 +94100,7 @@ var VisualizationFileWatcher = class {
|
|
|
94154
94100
|
|
|
94155
94101
|
// src/services/harness/visualization-registry.ts
|
|
94156
94102
|
import { createHash as createHash5 } from "crypto";
|
|
94157
|
-
import { join as
|
|
94103
|
+
import { join as join57 } from "path";
|
|
94158
94104
|
function hashContent(content) {
|
|
94159
94105
|
return createHash5("sha256").update(content).digest("hex");
|
|
94160
94106
|
}
|
|
@@ -94168,7 +94114,7 @@ var VisualizationRegistry = class {
|
|
|
94168
94114
|
return null;
|
|
94169
94115
|
}
|
|
94170
94116
|
const ext = vizFileExtension(vizType);
|
|
94171
|
-
const filePath =
|
|
94117
|
+
const filePath = join57(vizDir, taskId, `${slug}${ext}`);
|
|
94172
94118
|
const contentHash3 = hashContent(content);
|
|
94173
94119
|
const viz = {
|
|
94174
94120
|
slug,
|
|
@@ -94319,7 +94265,7 @@ var VisualizationRegistry = class {
|
|
|
94319
94265
|
// src/services/serve-factory/viz-preview.ts
|
|
94320
94266
|
function createVizPreviewRegistry(deps) {
|
|
94321
94267
|
const { canvasRepo } = deps;
|
|
94322
|
-
const vizDir =
|
|
94268
|
+
const vizDir = join58(deps.dataDir, "visualizations");
|
|
94323
94269
|
const vizWatchers = /* @__PURE__ */ new Map();
|
|
94324
94270
|
function getOrCreateVizWatcher(taskId) {
|
|
94325
94271
|
const existing = vizWatchers.get(taskId);
|
|
@@ -96529,10 +96475,6 @@ var CursorAgentSubprocess = class {
|
|
|
96529
96475
|
token: this.#harnessToken
|
|
96530
96476
|
});
|
|
96531
96477
|
}
|
|
96532
|
-
/** Cursor fences its harness MCP via the HTTP `x-shipyard-generation` header / per-runner bearer, not an in-process epoch. */
|
|
96533
|
-
get harnessEpoch() {
|
|
96534
|
-
return null;
|
|
96535
|
-
}
|
|
96536
96478
|
setOnCwdChanged(_handler) {
|
|
96537
96479
|
}
|
|
96538
96480
|
async rollback(_numTurns) {
|
|
@@ -97800,7 +97742,7 @@ function createShipyardResolver() {
|
|
|
97800
97742
|
|
|
97801
97743
|
// src/services/stack-detection.ts
|
|
97802
97744
|
import { access as access6 } from "fs/promises";
|
|
97803
|
-
import { join as
|
|
97745
|
+
import { join as join60 } from "path";
|
|
97804
97746
|
var STACK_TIMEOUT_MS = TIMEOUT_MS;
|
|
97805
97747
|
async function defaultIsCommandAvailable(command2) {
|
|
97806
97748
|
try {
|
|
@@ -97842,7 +97784,7 @@ async function detectStack(cwd, currentBranch, deps = {}) {
|
|
|
97842
97784
|
async function detectGraphite(cwd, currentBranch, isCommandAvailable, fileExists2, exec, getDefaultBranch2) {
|
|
97843
97785
|
const gtAvailable = await isCommandAvailable("gt");
|
|
97844
97786
|
if (!gtAvailable) return null;
|
|
97845
|
-
const markerPresent = await fileExists2(
|
|
97787
|
+
const markerPresent = await fileExists2(join60(cwd, ".git", ".graphite_repo_config"));
|
|
97846
97788
|
if (!markerPresent) return null;
|
|
97847
97789
|
const ancestor = await exec("gt", ["parent"], cwd).then((s2) => normalizeBranchName(s2)).catch(() => null);
|
|
97848
97790
|
const childrenRaw = await exec("gt", ["children"], cwd).then((s2) => s2).catch(() => "");
|
|
@@ -97855,7 +97797,7 @@ async function detectGraphite(cwd, currentBranch, isCommandAvailable, fileExists
|
|
|
97855
97797
|
return { ancestor: resolvedAncestor, descendants };
|
|
97856
97798
|
}
|
|
97857
97799
|
async function detectJujutsu(cwd, fileExists2, exec) {
|
|
97858
|
-
const jjPresent = await fileExists2(
|
|
97800
|
+
const jjPresent = await fileExists2(join60(cwd, ".jj"));
|
|
97859
97801
|
if (!jjPresent) return null;
|
|
97860
97802
|
const ancestorRaw = await exec(
|
|
97861
97803
|
"jj",
|
|
@@ -97904,7 +97846,7 @@ function parseJjLines(raw) {
|
|
|
97904
97846
|
|
|
97905
97847
|
// src/services/storage/annotation-store.ts
|
|
97906
97848
|
import { mkdir as mkdir22, readFile as readFile34 } from "fs/promises";
|
|
97907
|
-
import { dirname as dirname25, join as
|
|
97849
|
+
import { dirname as dirname25, join as join61 } from "path";
|
|
97908
97850
|
var LegacyBaseFields = external_exports.object({
|
|
97909
97851
|
commentId: external_exports.string(),
|
|
97910
97852
|
body: external_exports.string(),
|
|
@@ -97931,7 +97873,7 @@ var LegacyPlanStoreSchema = external_exports.object({
|
|
|
97931
97873
|
versions: external_exports.array(PlanVersionZodSchema)
|
|
97932
97874
|
});
|
|
97933
97875
|
function buildAnnotationStore(dataDir) {
|
|
97934
|
-
const baseDir =
|
|
97876
|
+
const baseDir = join61(dataDir, "annotations");
|
|
97935
97877
|
const cache2 = /* @__PURE__ */ new Map();
|
|
97936
97878
|
const listeners = /* @__PURE__ */ new Set();
|
|
97937
97879
|
const writeQueues = /* @__PURE__ */ new Map();
|
|
@@ -97944,7 +97886,7 @@ function buildAnnotationStore(dataDir) {
|
|
|
97944
97886
|
}
|
|
97945
97887
|
}
|
|
97946
97888
|
function filePath(taskId) {
|
|
97947
|
-
return
|
|
97889
|
+
return join61(baseDir, `${taskId}.json`);
|
|
97948
97890
|
}
|
|
97949
97891
|
function emptyData() {
|
|
97950
97892
|
return {
|
|
@@ -98009,9 +97951,9 @@ function buildAnnotationStore(dataDir) {
|
|
|
98009
97951
|
}
|
|
98010
97952
|
async function migrateLegacyFiles(taskId) {
|
|
98011
97953
|
const [diffRaw, previewRaw, planRaw] = await Promise.all([
|
|
98012
|
-
readLegacyFile(
|
|
98013
|
-
readLegacyFile(
|
|
98014
|
-
readLegacyFile(
|
|
97954
|
+
readLegacyFile(join61(dataDir, "diff-review", `${taskId}.json`)),
|
|
97955
|
+
readLegacyFile(join61(dataDir, "preview-annotations", `${taskId}.json`)),
|
|
97956
|
+
readLegacyFile(join61(dataDir, "plan-comments", `${taskId}.json`))
|
|
98015
97957
|
]);
|
|
98016
97958
|
if (diffRaw === null && previewRaw === null && planRaw === null) {
|
|
98017
97959
|
return null;
|
|
@@ -98214,7 +98156,7 @@ function buildAnnotationStore(dataDir) {
|
|
|
98214
98156
|
|
|
98215
98157
|
// src/services/storage/asset-store.ts
|
|
98216
98158
|
import { mkdir as mkdir23, readFile as readFile35, rename as rename18, writeFile as writeFile23 } from "fs/promises";
|
|
98217
|
-
import { join as
|
|
98159
|
+
import { join as join62 } from "path";
|
|
98218
98160
|
var UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
98219
98161
|
function isValidAssetId(id) {
|
|
98220
98162
|
return UUID_RE.test(id);
|
|
@@ -98240,10 +98182,10 @@ function buildAssetStore(assetsDir) {
|
|
|
98240
98182
|
}
|
|
98241
98183
|
}
|
|
98242
98184
|
function binaryPath(assetId) {
|
|
98243
|
-
return
|
|
98185
|
+
return join62(assetsDir, `${assetId}.bin`);
|
|
98244
98186
|
}
|
|
98245
98187
|
function metaPath(assetId) {
|
|
98246
|
-
return
|
|
98188
|
+
return join62(assetsDir, `${assetId}.meta.json`);
|
|
98247
98189
|
}
|
|
98248
98190
|
function parseMeta(raw) {
|
|
98249
98191
|
return AssetMetadataSchema.parse(JSON.parse(raw));
|
|
@@ -98267,8 +98209,8 @@ function buildAssetStore(assetsDir) {
|
|
|
98267
98209
|
size: data.byteLength,
|
|
98268
98210
|
createdAt: Date.now()
|
|
98269
98211
|
};
|
|
98270
|
-
const tmpBin =
|
|
98271
|
-
const tmpMeta =
|
|
98212
|
+
const tmpBin = join62(assetsDir, `${assetId}.bin.tmp`);
|
|
98213
|
+
const tmpMeta = join62(assetsDir, `${assetId}.meta.tmp`);
|
|
98272
98214
|
await writeFile23(tmpBin, data);
|
|
98273
98215
|
await writeFile23(tmpMeta, JSON.stringify(metadata), "utf-8");
|
|
98274
98216
|
await rename18(tmpBin, binaryPath(assetId));
|
|
@@ -98493,7 +98435,7 @@ function buildCredentialsVaultStore(filePath, corruptionLogger) {
|
|
|
98493
98435
|
|
|
98494
98436
|
// src/services/storage/deliverable-store.ts
|
|
98495
98437
|
import { mkdir as mkdir25, readFile as readFile37 } from "fs/promises";
|
|
98496
|
-
import { dirname as dirname27, join as
|
|
98438
|
+
import { dirname as dirname27, join as join63 } from "path";
|
|
98497
98439
|
var DELIVERABLE_STORE_VERSION = 1;
|
|
98498
98440
|
var DeliverableStoreSchema = external_exports.object({
|
|
98499
98441
|
schemaVersion: external_exports.number(),
|
|
@@ -98507,7 +98449,7 @@ function migrateDeliverableStore(raw) {
|
|
|
98507
98449
|
return { schemaVersion: DELIVERABLE_STORE_VERSION, records: [] };
|
|
98508
98450
|
}
|
|
98509
98451
|
function buildDeliverableStore(dataDir) {
|
|
98510
|
-
const baseDir =
|
|
98452
|
+
const baseDir = join63(dataDir, "deliverables");
|
|
98511
98453
|
const cache2 = /* @__PURE__ */ new Map();
|
|
98512
98454
|
const listeners = /* @__PURE__ */ new Set();
|
|
98513
98455
|
const writeQueues = /* @__PURE__ */ new Map();
|
|
@@ -98520,7 +98462,7 @@ function buildDeliverableStore(dataDir) {
|
|
|
98520
98462
|
}
|
|
98521
98463
|
}
|
|
98522
98464
|
function filePath(taskId) {
|
|
98523
|
-
return
|
|
98465
|
+
return join63(baseDir, `${taskId}.json`);
|
|
98524
98466
|
}
|
|
98525
98467
|
function emptyData() {
|
|
98526
98468
|
return { schemaVersion: DELIVERABLE_STORE_VERSION, records: [] };
|
|
@@ -98660,7 +98602,7 @@ function buildDeliverableStore(dataDir) {
|
|
|
98660
98602
|
|
|
98661
98603
|
// src/services/storage/jsonl-conversation-store.ts
|
|
98662
98604
|
import { appendFile as appendFile3, mkdir as mkdir26, open, readFile as readFile38, stat as stat16 } from "fs/promises";
|
|
98663
|
-
import { join as
|
|
98605
|
+
import { join as join64 } from "path";
|
|
98664
98606
|
var StoredMessageSchema = MessageSchema.omit({ seqNo: true, channelId: true });
|
|
98665
98607
|
function logPerf(entry) {
|
|
98666
98608
|
try {
|
|
@@ -98670,12 +98612,12 @@ function logPerf(entry) {
|
|
|
98670
98612
|
}
|
|
98671
98613
|
}
|
|
98672
98614
|
function buildJsonlConversationStore(dataDir, opts = {}) {
|
|
98673
|
-
const channelsDir =
|
|
98615
|
+
const channelsDir = join64(dataDir, "channels");
|
|
98674
98616
|
const seqCounters = /* @__PURE__ */ new Map();
|
|
98675
98617
|
const channelQueues = /* @__PURE__ */ new Map();
|
|
98676
98618
|
const readCache = /* @__PURE__ */ new Map();
|
|
98677
98619
|
function channelPath(channelId) {
|
|
98678
|
-
return
|
|
98620
|
+
return join64(channelsDir, `${channelId}.jsonl`);
|
|
98679
98621
|
}
|
|
98680
98622
|
async function ensureDir() {
|
|
98681
98623
|
await mkdir26(channelsDir, { recursive: true });
|
|
@@ -99447,7 +99389,7 @@ function buildProjectsStore(filePath) {
|
|
|
99447
99389
|
|
|
99448
99390
|
// src/services/storage/rate-limit-store.ts
|
|
99449
99391
|
import { mkdir as mkdir28, readFile as readFile40 } from "fs/promises";
|
|
99450
|
-
import { dirname as dirname29, join as
|
|
99392
|
+
import { dirname as dirname29, join as join65 } from "path";
|
|
99451
99393
|
var RATE_LIMIT_STORE_VERSION = 4;
|
|
99452
99394
|
var RateLimitRecordSchema = external_exports.object({
|
|
99453
99395
|
info: RateLimitInfoSchema,
|
|
@@ -99486,7 +99428,7 @@ function isWindowKey(x2) {
|
|
|
99486
99428
|
return x2 !== void 0 && WINDOW_KEYS.has(x2);
|
|
99487
99429
|
}
|
|
99488
99430
|
async function buildRateLimitStore(dataDir, opts) {
|
|
99489
|
-
const filePath =
|
|
99431
|
+
const filePath = join65(dataDir, "rate-limits.json");
|
|
99490
99432
|
const lockPath2 = `${filePath}.lock`;
|
|
99491
99433
|
const initial = await loadStoreFile(filePath, opts.logger);
|
|
99492
99434
|
const records = { ...initial.records };
|
|
@@ -99739,7 +99681,7 @@ async function atomicWrite4(filePath, data) {
|
|
|
99739
99681
|
}
|
|
99740
99682
|
|
|
99741
99683
|
// src/services/storage/schedule-store.ts
|
|
99742
|
-
import { join as
|
|
99684
|
+
import { join as join66 } from "path";
|
|
99743
99685
|
|
|
99744
99686
|
// src/services/storage/json-document-store.ts
|
|
99745
99687
|
import { mkdir as mkdir29, readFile as readFile41 } from "fs/promises";
|
|
@@ -99930,7 +99872,7 @@ function buildScheduleStore(dataDir) {
|
|
|
99930
99872
|
const store = buildJsonDocumentStore({
|
|
99931
99873
|
storeName: "schedules",
|
|
99932
99874
|
docType: "schedule",
|
|
99933
|
-
filePath:
|
|
99875
|
+
filePath: join66(dataDir, "schedules.json"),
|
|
99934
99876
|
recordSchema: ScheduleRecordSchema,
|
|
99935
99877
|
currentVersion: SCHEDULE_STORE_VERSION,
|
|
99936
99878
|
migrate(raw) {
|
|
@@ -99969,7 +99911,7 @@ function buildScheduleStore(dataDir) {
|
|
|
99969
99911
|
|
|
99970
99912
|
// src/services/storage/session-persistence.ts
|
|
99971
99913
|
import { mkdir as mkdir30, readdir as readdir19, readFile as readFile42, rm as rm12 } from "fs/promises";
|
|
99972
|
-
import { join as
|
|
99914
|
+
import { join as join67 } from "path";
|
|
99973
99915
|
var PersistedSessionSchema = external_exports.object({
|
|
99974
99916
|
sessionId: external_exports.string(),
|
|
99975
99917
|
channelId: external_exports.string(),
|
|
@@ -100026,9 +99968,9 @@ async function loadOneSessionFile(originalPath, corruptionLogger) {
|
|
|
100026
99968
|
}
|
|
100027
99969
|
}
|
|
100028
99970
|
function buildSessionPersistence(dataDir, corruptionLogger) {
|
|
100029
|
-
const channelsDir =
|
|
99971
|
+
const channelsDir = join67(dataDir, "channels");
|
|
100030
99972
|
function sessionPath(channelId) {
|
|
100031
|
-
return
|
|
99973
|
+
return join67(channelsDir, `${channelId}.session.json`);
|
|
100032
99974
|
}
|
|
100033
99975
|
async function ensureDir() {
|
|
100034
99976
|
await mkdir30(channelsDir, { recursive: true });
|
|
@@ -100086,7 +100028,7 @@ function buildSessionPersistence(dataDir, corruptionLogger) {
|
|
|
100086
100028
|
if (i >= sessionEntries.length) return;
|
|
100087
100029
|
const entry = sessionEntries[i];
|
|
100088
100030
|
if (!entry) return;
|
|
100089
|
-
results[i] = await loadOneSessionFile(
|
|
100031
|
+
results[i] = await loadOneSessionFile(join67(channelsDir, entry), corruptionLogger);
|
|
100090
100032
|
}
|
|
100091
100033
|
}
|
|
100092
100034
|
const workers = Array.from(
|
|
@@ -100100,12 +100042,12 @@ function buildSessionPersistence(dataDir, corruptionLogger) {
|
|
|
100100
100042
|
}
|
|
100101
100043
|
|
|
100102
100044
|
// src/services/storage/template-store.ts
|
|
100103
|
-
import { join as
|
|
100045
|
+
import { join as join68 } from "path";
|
|
100104
100046
|
function buildTemplateStore(dataDir) {
|
|
100105
100047
|
const store = buildJsonDocumentStore({
|
|
100106
100048
|
storeName: "templates",
|
|
100107
100049
|
docType: "template",
|
|
100108
|
-
filePath:
|
|
100050
|
+
filePath: join68(dataDir, "templates.json"),
|
|
100109
100051
|
recordSchema: TaskTemplateRecordSchema,
|
|
100110
100052
|
currentVersion: TEMPLATE_STORE_VERSION,
|
|
100111
100053
|
migrate(raw) {
|
|
@@ -105640,7 +105582,7 @@ import { randomUUID as randomUUID21 } from "crypto";
|
|
|
105640
105582
|
import { existsSync as existsSync10, readdirSync as readdirSync5, statSync as statSync4 } from "fs";
|
|
105641
105583
|
import { mkdir as mkdir32, readFile as readFile45, writeFile as writeFile25 } from "fs/promises";
|
|
105642
105584
|
import { homedir as homedir9 } from "os";
|
|
105643
|
-
import { dirname as dirname33, join as
|
|
105585
|
+
import { dirname as dirname33, join as join70 } from "path";
|
|
105644
105586
|
|
|
105645
105587
|
// src/services/plan/plan-detection-policy.ts
|
|
105646
105588
|
function decidePlanDetection(trigger, snapshot) {
|
|
@@ -106267,8 +106209,8 @@ function greedyLCS(a, b2) {
|
|
|
106267
106209
|
// src/services/plan/plan-file-watcher.ts
|
|
106268
106210
|
import { existsSync as existsSync9 } from "fs";
|
|
106269
106211
|
import { homedir as homedir8 } from "os";
|
|
106270
|
-
import { join as
|
|
106271
|
-
var DEFAULT_PLANS_DIR =
|
|
106212
|
+
import { join as join69 } from "path";
|
|
106213
|
+
var DEFAULT_PLANS_DIR = join69(homedir8(), ".claude", "plans");
|
|
106272
106214
|
var PLAN_WATCH_TIMEOUT_MS = 1e4;
|
|
106273
106215
|
var PLAN_WATCH_DEBOUNCE_MS = 250;
|
|
106274
106216
|
function createPlanFileWatcher(deps) {
|
|
@@ -106717,7 +106659,7 @@ var PlanHandler = class {
|
|
|
106717
106659
|
* Called when a Write tool result mentions a file in ~/.claude/plans/.
|
|
106718
106660
|
*/
|
|
106719
106661
|
trackCreatedFile(filePath) {
|
|
106720
|
-
const plansDir =
|
|
106662
|
+
const plansDir = join70(homedir9(), ".claude", "plans");
|
|
106721
106663
|
if (filePath.startsWith(plansDir) && filePath.endsWith(".md")) {
|
|
106722
106664
|
this.#createdPlanFiles.add(filePath);
|
|
106723
106665
|
this.#deps.log({
|
|
@@ -106749,7 +106691,7 @@ var PlanHandler = class {
|
|
|
106749
106691
|
}
|
|
106750
106692
|
async #runHandleCodexPlanReady(content) {
|
|
106751
106693
|
if (this.#deps.isDisposed()) return;
|
|
106752
|
-
const filePath =
|
|
106694
|
+
const filePath = join70(getShipyardHome(), "plans", `${this.#deps.taskId}.md`);
|
|
106753
106695
|
try {
|
|
106754
106696
|
await mkdir32(dirname33(filePath), { recursive: true });
|
|
106755
106697
|
await writeFile25(filePath, content, "utf-8");
|
|
@@ -107129,12 +107071,12 @@ var PlanHandler = class {
|
|
|
107129
107071
|
}).filter((f2) => f2 !== null).sort((a, b2) => b2.mtime - a.mtime)[0];
|
|
107130
107072
|
return newest?.path ?? null;
|
|
107131
107073
|
}
|
|
107132
|
-
const plansDir =
|
|
107074
|
+
const plansDir = join70(homedir9(), ".claude", "plans");
|
|
107133
107075
|
if (!existsSync10(plansDir)) return null;
|
|
107134
107076
|
try {
|
|
107135
107077
|
const files = readdirSync5(plansDir).filter((f2) => f2.endsWith(".md")).map((f2) => ({
|
|
107136
|
-
path:
|
|
107137
|
-
mtime: statSync4(
|
|
107078
|
+
path: join70(plansDir, f2),
|
|
107079
|
+
mtime: statSync4(join70(plansDir, f2)).mtimeMs
|
|
107138
107080
|
})).sort((a, b2) => b2.mtime - a.mtime);
|
|
107139
107081
|
const recent = files[0];
|
|
107140
107082
|
if (recent && Date.now() - recent.mtime < 3e4) return recent.path;
|
|
@@ -109475,7 +109417,7 @@ var RewindCheckpointHandler = class {
|
|
|
109475
109417
|
|
|
109476
109418
|
// src/services/task/side-thread-registry.ts
|
|
109477
109419
|
import { mkdir as mkdir33, readFile as readFile46, rename as rename20, writeFile as writeFile26 } from "fs/promises";
|
|
109478
|
-
import { dirname as dirname34, join as
|
|
109420
|
+
import { dirname as dirname34, join as join71 } from "path";
|
|
109479
109421
|
var ThreadFileSchema = external_exports.object({
|
|
109480
109422
|
threads: external_exports.record(external_exports.string(), ThreadMetadataSchema)
|
|
109481
109423
|
});
|
|
@@ -109851,7 +109793,7 @@ var SideThreadRegistry = class {
|
|
|
109851
109793
|
}
|
|
109852
109794
|
/** Persistence */
|
|
109853
109795
|
#filePath() {
|
|
109854
|
-
return
|
|
109796
|
+
return join71(this.#deps.dataDir, "threads", `${this.#deps.taskId}.json`);
|
|
109855
109797
|
}
|
|
109856
109798
|
async #ensureLoaded() {
|
|
109857
109799
|
if (this.#loadedFromDisk.has(this.#deps.taskId)) return;
|
|
@@ -112686,7 +112628,7 @@ async function resolveTaskListPrepend(ctx) {
|
|
|
112686
112628
|
// src/services/task/cc-task-file-store.ts
|
|
112687
112629
|
import { readdir as readdir20, readFile as readFile47 } from "fs/promises";
|
|
112688
112630
|
import { homedir as homedir10 } from "os";
|
|
112689
|
-
import { basename as basename12, dirname as dirname35, join as
|
|
112631
|
+
import { basename as basename12, dirname as dirname35, join as join72 } from "path";
|
|
112690
112632
|
var VALID_STATUSES = /* @__PURE__ */ new Set(["pending", "in_progress", "completed"]);
|
|
112691
112633
|
var IDLE_DETACH_MS = 5 * 60 * 1e3;
|
|
112692
112634
|
var IDLE_SWEEP_INTERVAL_MS = 6e4;
|
|
@@ -112702,7 +112644,7 @@ function isCCTaskFile(value) {
|
|
|
112702
112644
|
}
|
|
112703
112645
|
function createCCTaskFileWatcher(listId, log) {
|
|
112704
112646
|
const sanitizedId = sanitize(listId);
|
|
112705
|
-
const dir =
|
|
112647
|
+
const dir = join72(homedir10(), ".claude", "tasks", sanitizedId);
|
|
112706
112648
|
const targetDirName = basename12(dir);
|
|
112707
112649
|
const parentDir = dirname35(dir);
|
|
112708
112650
|
const watchState = {
|
|
@@ -112738,7 +112680,7 @@ function createCCTaskFileWatcher(listId, log) {
|
|
|
112738
112680
|
return tasks;
|
|
112739
112681
|
}
|
|
112740
112682
|
async function readTask(taskId) {
|
|
112741
|
-
const filePath =
|
|
112683
|
+
const filePath = join72(dir, `${taskId}.json`);
|
|
112742
112684
|
try {
|
|
112743
112685
|
const raw = await readFile47(filePath, "utf-8");
|
|
112744
112686
|
const parsed = JSON.parse(raw);
|
|
@@ -112805,7 +112747,7 @@ function createCCTaskFileWatcher(listId, log) {
|
|
|
112805
112747
|
watchState.parentSub = null;
|
|
112806
112748
|
return;
|
|
112807
112749
|
}
|
|
112808
|
-
if (ev.path.endsWith(targetDirName) || ev.path ===
|
|
112750
|
+
if (ev.path.endsWith(targetDirName) || ev.path === join72(parentDir, targetDirName)) {
|
|
112809
112751
|
void ensureDirWatcher();
|
|
112810
112752
|
break;
|
|
112811
112753
|
}
|
|
@@ -112921,7 +112863,7 @@ function createCCTaskFileWatcher(listId, log) {
|
|
|
112921
112863
|
// src/services/task/cc-task-file-writer.ts
|
|
112922
112864
|
import { createHash as createHash10 } from "crypto";
|
|
112923
112865
|
import { mkdir as mkdir34, readdir as readdir21, rename as rename21, unlink as unlink15, writeFile as writeFile27 } from "fs/promises";
|
|
112924
|
-
import { join as
|
|
112866
|
+
import { join as join73 } from "path";
|
|
112925
112867
|
function contentHash2(data) {
|
|
112926
112868
|
return createHash10("sha256").update(data).digest("hex").slice(0, 16);
|
|
112927
112869
|
}
|
|
@@ -112937,7 +112879,7 @@ async function writeTasks(dir, tasks, hashes) {
|
|
|
112937
112879
|
const json = JSON.stringify(structuredTaskToCCFile(task), null, 2);
|
|
112938
112880
|
const hash = contentHash2(json);
|
|
112939
112881
|
if (hashes.get(id) === hash) continue;
|
|
112940
|
-
await atomicWriteFile2(
|
|
112882
|
+
await atomicWriteFile2(join73(dir, `${id}.json`), json);
|
|
112941
112883
|
hashes.set(id, hash);
|
|
112942
112884
|
}
|
|
112943
112885
|
return targetIds;
|
|
@@ -112953,7 +112895,7 @@ async function removeStaleFiles(dir, targetIds, hashes) {
|
|
|
112953
112895
|
if (!entry.endsWith(".json")) continue;
|
|
112954
112896
|
const id = entry.slice(0, -".json".length);
|
|
112955
112897
|
if (!targetIds.has(id) && hashes.has(id)) {
|
|
112956
|
-
await unlink15(
|
|
112898
|
+
await unlink15(join73(dir, entry)).catch(() => {
|
|
112957
112899
|
});
|
|
112958
112900
|
hashes.delete(id);
|
|
112959
112901
|
}
|
|
@@ -113555,10 +113497,10 @@ var StructuredTaskTracker = class {
|
|
|
113555
113497
|
import { unwatchFile, watchFile } from "fs";
|
|
113556
113498
|
import { open as open2 } from "fs/promises";
|
|
113557
113499
|
import { homedir as homedir11 } from "os";
|
|
113558
|
-
import { join as
|
|
113500
|
+
import { join as join74 } from "path";
|
|
113559
113501
|
function computeTranscriptPath(cwd, sessionId, taskId) {
|
|
113560
113502
|
const cwdSlug = cwd.replace(/[^a-zA-Z0-9]/g, "-").slice(0, 200);
|
|
113561
|
-
return
|
|
113503
|
+
return join74(
|
|
113562
113504
|
homedir11(),
|
|
113563
113505
|
".claude",
|
|
113564
113506
|
"projects",
|
|
@@ -114273,7 +114215,7 @@ import { createHash as createHash11 } from "crypto";
|
|
|
114273
114215
|
import { unlink as unlink16, writeFile as writeFile28 } from "fs/promises";
|
|
114274
114216
|
import { createRequire as createRequire4 } from "module";
|
|
114275
114217
|
import { tmpdir } from "os";
|
|
114276
|
-
import { join as
|
|
114218
|
+
import { join as join75 } from "path";
|
|
114277
114219
|
import { promisify as promisify10 } from "util";
|
|
114278
114220
|
var execFileAsync4 = promisify10(execFile11);
|
|
114279
114221
|
function resolveDaemonNodeModules(log) {
|
|
@@ -114286,7 +114228,7 @@ function resolveDaemonNodeModules(log) {
|
|
|
114286
114228
|
} catch {
|
|
114287
114229
|
}
|
|
114288
114230
|
try {
|
|
114289
|
-
const cwdRequire = createRequire4(
|
|
114231
|
+
const cwdRequire = createRequire4(join75(process.cwd(), "package.json"));
|
|
114290
114232
|
const sdkPath = cwdRequire.resolve("@modelcontextprotocol/sdk/server/mcp.js");
|
|
114291
114233
|
const idx = sdkPath.lastIndexOf("node_modules");
|
|
114292
114234
|
if (idx >= 0) return sdkPath.slice(0, idx + "node_modules".length);
|
|
@@ -114296,7 +114238,7 @@ function resolveDaemonNodeModules(log) {
|
|
|
114296
114238
|
error: err3 instanceof Error ? err3.message : String(err3)
|
|
114297
114239
|
});
|
|
114298
114240
|
}
|
|
114299
|
-
return
|
|
114241
|
+
return join75(process.cwd(), "node_modules");
|
|
114300
114242
|
}
|
|
114301
114243
|
function planTokenCount(systemPrompt, metadata, cwd, model, mcpServers) {
|
|
114302
114244
|
return {
|
|
@@ -114493,7 +114435,7 @@ async function serializeMcpConfig(servers, allToolNames, daemonNodeModules, rese
|
|
|
114493
114435
|
if (isReservedMcpServerName(serverName, reservedServerNames)) continue;
|
|
114494
114436
|
const script = buildStubServerScript(serverName, tools);
|
|
114495
114437
|
if (!script) continue;
|
|
114496
|
-
const stubPath =
|
|
114438
|
+
const stubPath = join75(tmpdir(), `shipyard-mcp-stub-${serverName}-${Date.now()}.cjs`);
|
|
114497
114439
|
await writeFile28(stubPath, script, "utf-8");
|
|
114498
114440
|
stubPaths.push(stubPath);
|
|
114499
114441
|
mcpServers[serverName] = {
|
|
@@ -114519,7 +114461,7 @@ async function prepareTokenCountArgs(plan, log, reservedServerNames = SDK_RESERV
|
|
|
114519
114461
|
reservedServerNames
|
|
114520
114462
|
);
|
|
114521
114463
|
if (!serialized.config) return { args, mcpConfigPath: null, stubPaths: serialized.stubPaths };
|
|
114522
|
-
const mcpConfigPath =
|
|
114464
|
+
const mcpConfigPath = join75(tmpdir(), `shipyard-mcp-${Date.now()}.json`);
|
|
114523
114465
|
await writeFile28(mcpConfigPath, JSON.stringify(serialized.config), "utf-8");
|
|
114524
114466
|
args.push("--mcp-config", mcpConfigPath);
|
|
114525
114467
|
return { args, mcpConfigPath, stubPaths: serialized.stubPaths };
|
|
@@ -119788,11 +119730,11 @@ function pathExistsForLog2(path5) {
|
|
|
119788
119730
|
}
|
|
119789
119731
|
|
|
119790
119732
|
// src/services/task/manager/task-state-store.ts
|
|
119791
|
-
import { join as
|
|
119733
|
+
import { join as join77 } from "path";
|
|
119792
119734
|
|
|
119793
119735
|
// src/services/storage/directory-record-store.ts
|
|
119794
119736
|
import { mkdir as mkdir35, readdir as readdir22, readFile as readFile48, rename as rename22, stat as stat17, unlink as unlink17 } from "fs/promises";
|
|
119795
|
-
import { join as
|
|
119737
|
+
import { join as join76 } from "path";
|
|
119796
119738
|
var SCHEMA_VERSION_FILENAME = "__schema-version";
|
|
119797
119739
|
var RECORD_SUFFIX = ".json";
|
|
119798
119740
|
var SAFE_ID_RE = /^[A-Za-z0-9_-][A-Za-z0-9_.-]*$/;
|
|
@@ -119812,7 +119754,7 @@ function buildDirectoryRecordStore(opts) {
|
|
|
119812
119754
|
let writeQueue = Promise.resolve();
|
|
119813
119755
|
function recordPath(id) {
|
|
119814
119756
|
assertSafeRecordId(id);
|
|
119815
|
-
return
|
|
119757
|
+
return join76(dataDir, `${id}${RECORD_SUFFIX}`);
|
|
119816
119758
|
}
|
|
119817
119759
|
function notify(event) {
|
|
119818
119760
|
for (const listener of listeners) {
|
|
@@ -119827,7 +119769,7 @@ function buildDirectoryRecordStore(opts) {
|
|
|
119827
119769
|
}
|
|
119828
119770
|
async function readSchemaVersion() {
|
|
119829
119771
|
try {
|
|
119830
|
-
const raw = await readFile48(
|
|
119772
|
+
const raw = await readFile48(join76(dataDir, SCHEMA_VERSION_FILENAME), "utf-8");
|
|
119831
119773
|
const parsed = Number.parseInt(raw.trim(), 10);
|
|
119832
119774
|
return Number.isFinite(parsed) ? parsed : null;
|
|
119833
119775
|
} catch (err3) {
|
|
@@ -119836,7 +119778,7 @@ function buildDirectoryRecordStore(opts) {
|
|
|
119836
119778
|
}
|
|
119837
119779
|
}
|
|
119838
119780
|
async function writeSchemaVersion(version) {
|
|
119839
|
-
const path5 =
|
|
119781
|
+
const path5 = join76(dataDir, SCHEMA_VERSION_FILENAME);
|
|
119840
119782
|
await atomicWriteFile(path5, String(version));
|
|
119841
119783
|
}
|
|
119842
119784
|
async function legacyFileExists() {
|
|
@@ -119941,7 +119883,7 @@ function buildDirectoryRecordStore(opts) {
|
|
|
119941
119883
|
for (const entry of entries) {
|
|
119942
119884
|
if (!entry.endsWith(RECORD_SUFFIX)) continue;
|
|
119943
119885
|
const id = entry.slice(0, -RECORD_SUFFIX.length);
|
|
119944
|
-
const record = await loadOneRecord(
|
|
119886
|
+
const record = await loadOneRecord(join76(dataDir, entry), entry);
|
|
119945
119887
|
if (record !== null) records.set(id, record);
|
|
119946
119888
|
}
|
|
119947
119889
|
return records;
|
|
@@ -120242,8 +120184,8 @@ function computePaginatedPage(all, capturedVersion, opts) {
|
|
|
120242
120184
|
}
|
|
120243
120185
|
function buildTaskStateStore(dataDir) {
|
|
120244
120186
|
const store = buildDirectoryRecordStore({
|
|
120245
|
-
dataDir:
|
|
120246
|
-
legacyFilePath:
|
|
120187
|
+
dataDir: join77(dataDir, "tasks"),
|
|
120188
|
+
legacyFilePath: join77(dataDir, "tasks.json"),
|
|
120247
120189
|
recordSchema: TaskRecordSchema,
|
|
120248
120190
|
currentVersion: TASK_STORE_VERSION,
|
|
120249
120191
|
migrate(raw) {
|
|
@@ -121327,7 +121269,7 @@ async function createDaemon(deps) {
|
|
|
121327
121269
|
const annotationStore = buildAnnotationStore(deps.dataDir);
|
|
121328
121270
|
const deliverableStore = buildDeliverableStore(deps.dataDir);
|
|
121329
121271
|
const resourceRegistry = createResourceRegistry();
|
|
121330
|
-
const assetStore = buildAssetStore(
|
|
121272
|
+
const assetStore = buildAssetStore(join78(deps.dataDir, "assets"));
|
|
121331
121273
|
const shipyardResolver = createShipyardResolver();
|
|
121332
121274
|
shipyardResolver.addSubResolver("asset", createAssetResolver(assetStore));
|
|
121333
121275
|
const pluginResourceResolver = new PluginResourceResolver(deps.log);
|
|
@@ -121336,10 +121278,10 @@ async function createDaemon(deps) {
|
|
|
121336
121278
|
const capabilitiesRef = { current: null };
|
|
121337
121279
|
const rateLimitStoreRef = { current: null };
|
|
121338
121280
|
const gitCheckpoint = createGitCheckpointService();
|
|
121339
|
-
const userSettingsStore = buildUserSettingsStore(
|
|
121340
|
-
const projectsStore = buildProjectsStore(
|
|
121281
|
+
const userSettingsStore = buildUserSettingsStore(join78(deps.dataDir, "user-settings.json"));
|
|
121282
|
+
const projectsStore = buildProjectsStore(join78(deps.dataDir, "projects.json"));
|
|
121341
121283
|
const credentialsVaultStore = buildCredentialsVaultStore(
|
|
121342
|
-
|
|
121284
|
+
join78(deps.dataDir, "credentials-vault.json")
|
|
121343
121285
|
);
|
|
121344
121286
|
const cursorVaultKeyRef = { current: null };
|
|
121345
121287
|
let resolveCursorVaultKey;
|
|
@@ -121785,7 +121727,7 @@ async function createDaemon(deps) {
|
|
|
121785
121727
|
taskId: args.taskId,
|
|
121786
121728
|
agentSystem: args.agentSystem,
|
|
121787
121729
|
environmentKey: args.cwd,
|
|
121788
|
-
pluginsDir:
|
|
121730
|
+
pluginsDir: join78(deps.shipyardHome, "plugins"),
|
|
121789
121731
|
vizWatcher: getOrCreateVizWatcher(args.taskId).watcher,
|
|
121790
121732
|
mode: "task",
|
|
121791
121733
|
previewProxy: deps.previewProxy,
|
|
@@ -121878,7 +121820,7 @@ async function createDaemon(deps) {
|
|
|
121878
121820
|
/** Claude in-process harness — Codex uses the HTTP path with 'codex' above. */
|
|
121879
121821
|
agentSystem: AGENT_SYSTEM_CLAUDE_CODE,
|
|
121880
121822
|
environmentKey: args.cwd,
|
|
121881
|
-
pluginsDir:
|
|
121823
|
+
pluginsDir: join78(deps.shipyardHome, "plugins"),
|
|
121882
121824
|
vizWatcher: args.vizWatcher,
|
|
121883
121825
|
mode: args.mode ?? "task",
|
|
121884
121826
|
previewProxy: deps.previewProxy,
|
|
@@ -121965,7 +121907,6 @@ async function createDaemon(deps) {
|
|
|
121965
121907
|
deps.log
|
|
121966
121908
|
);
|
|
121967
121909
|
subprocess.installHarnessTaskIdSetter(setHarnessTaskId);
|
|
121968
|
-
subprocess.installHarnessEpoch(epoch);
|
|
121969
121910
|
return subprocess;
|
|
121970
121911
|
}
|
|
121971
121912
|
const lastUsageLimitBroadcastByTask = /* @__PURE__ */ new Map();
|
|
@@ -122893,7 +122834,7 @@ async function createDaemon(deps) {
|
|
|
122893
122834
|
const stallProfilerConfig = getStallProfilerConfig();
|
|
122894
122835
|
const stallProfiler = new StallProfiler({
|
|
122895
122836
|
log: deps.log,
|
|
122896
|
-
outDir:
|
|
122837
|
+
outDir: join78(deps.dataDir, "stall-profiles"),
|
|
122897
122838
|
thresholdMs: stallProfilerConfig.thresholdMs,
|
|
122898
122839
|
captureMs: stallProfilerConfig.captureMs,
|
|
122899
122840
|
rateLimitMs: stallProfilerConfig.rateLimitMs
|
|
@@ -123496,7 +123437,7 @@ import { existsSync as existsSync12 } from "fs";
|
|
|
123496
123437
|
import { execFile as execFile12, spawn as spawn13 } from "child_process";
|
|
123497
123438
|
import { createHash as createHash12 } from "crypto";
|
|
123498
123439
|
import { chmod as chmod3, mkdir as mkdir37, readFile as readFile49, rename as rename23, unlink as unlink18, writeFile as writeFile29 } from "fs/promises";
|
|
123499
|
-
import { join as
|
|
123440
|
+
import { join as join79 } from "path";
|
|
123500
123441
|
|
|
123501
123442
|
// src/services/bootstrap/self-update-installer-scripts.ts
|
|
123502
123443
|
function buildPosixInstallerScript(params) {
|
|
@@ -123898,7 +123839,7 @@ async function downloadTarball(url, destPath, fetchFn) {
|
|
|
123898
123839
|
throw new Error(`download failed: HTTP ${response.status} ${response.statusText}`);
|
|
123899
123840
|
}
|
|
123900
123841
|
const bytes = new Uint8Array(await response.arrayBuffer());
|
|
123901
|
-
await mkdir37(
|
|
123842
|
+
await mkdir37(join79(destPath, ".."), { recursive: true });
|
|
123902
123843
|
try {
|
|
123903
123844
|
await writeFile29(tmpPath, bytes);
|
|
123904
123845
|
await rename23(tmpPath, destPath);
|
|
@@ -123928,7 +123869,7 @@ async function verifyChecksum(path5, expectedHash) {
|
|
|
123928
123869
|
}
|
|
123929
123870
|
}
|
|
123930
123871
|
async function stageInstallerScript(scriptPath, params) {
|
|
123931
|
-
await mkdir37(
|
|
123872
|
+
await mkdir37(join79(scriptPath, ".."), { recursive: true });
|
|
123932
123873
|
const body = process.platform === "win32" ? buildWindowsInstallerScript(params) : buildPosixInstallerScript(params);
|
|
123933
123874
|
await writeFile29(scriptPath, body);
|
|
123934
123875
|
await chmod3(scriptPath, 493);
|
|
@@ -123978,16 +123919,16 @@ function buildInstallerParams(state, deps) {
|
|
|
123978
123919
|
targetVersion: state.resolved.version,
|
|
123979
123920
|
previousVersion: deps.currentVersion,
|
|
123980
123921
|
parentPid: deps.pid,
|
|
123981
|
-
statusFilePath:
|
|
123982
|
-
pidFilePath:
|
|
123983
|
-
logPath:
|
|
123984
|
-
snapshotPath:
|
|
123922
|
+
statusFilePath: join79(deps.shipyardHome, "update-status.json"),
|
|
123923
|
+
pidFilePath: join79(deps.shipyardHome, "daemon.pid"),
|
|
123924
|
+
logPath: join79(deps.shipyardHome, "updates", `install-${deps.pid}.log`),
|
|
123925
|
+
snapshotPath: join79(deps.shipyardHome, "updates", `rollback-${deps.currentVersion}`),
|
|
123985
123926
|
npmBin: "npm"
|
|
123986
123927
|
};
|
|
123987
123928
|
}
|
|
123988
123929
|
function tarballPathFor(shipyardHome, version, shasum) {
|
|
123989
123930
|
const shaPrefix = shasum.slice(0, 12);
|
|
123990
|
-
return
|
|
123931
|
+
return join79(shipyardHome, "updates", `${version}-${shaPrefix}.tgz`);
|
|
123991
123932
|
}
|
|
123992
123933
|
async function runResolveStep(step, state, deps) {
|
|
123993
123934
|
const resolver = deps.resolveVersion ?? defaultResolveVersion;
|
|
@@ -125062,7 +125003,7 @@ function buildLocalDirectChannelCallbacks(deps) {
|
|
|
125062
125003
|
|
|
125063
125004
|
// src/services/skills-cache/codex-skills-cache.ts
|
|
125064
125005
|
import { mkdir as mkdir38, readFile as readFile50, rename as rename24, writeFile as writeFile30 } from "fs/promises";
|
|
125065
|
-
import { dirname as dirname37, join as
|
|
125006
|
+
import { dirname as dirname37, join as join80 } from "path";
|
|
125066
125007
|
var CACHE_FILENAME = "codex-skills-cache.json";
|
|
125067
125008
|
var SkillInfoCacheEntrySchema = external_exports.object({
|
|
125068
125009
|
name: external_exports.string(),
|
|
@@ -125079,7 +125020,7 @@ var CodexSkillsCacheFileSchema = external_exports.object({
|
|
|
125079
125020
|
skills: external_exports.array(SkillInfoCacheEntrySchema)
|
|
125080
125021
|
});
|
|
125081
125022
|
function defaultCodexSkillsCachePath(shipyardHome) {
|
|
125082
|
-
return
|
|
125023
|
+
return join80(shipyardHome, "state", CACHE_FILENAME);
|
|
125083
125024
|
}
|
|
125084
125025
|
async function loadCodexSkillsCache(path5) {
|
|
125085
125026
|
let raw;
|
|
@@ -125143,11 +125084,11 @@ async function saveCodexSkillsCache(path5, cache2) {
|
|
|
125143
125084
|
// src/services/skills-mirror/manager.ts
|
|
125144
125085
|
import { lstat, mkdir as mkdir40, readlink, stat as stat18, symlink, unlink as unlink20 } from "fs/promises";
|
|
125145
125086
|
import { homedir as homedir13 } from "os";
|
|
125146
|
-
import { dirname as dirname39, join as
|
|
125087
|
+
import { dirname as dirname39, join as join82 } from "path";
|
|
125147
125088
|
|
|
125148
125089
|
// src/services/skills-mirror/manifest.ts
|
|
125149
125090
|
import { mkdir as mkdir39, readFile as readFile51, rename as rename25, unlink as unlink19, writeFile as writeFile31 } from "fs/promises";
|
|
125150
|
-
import { dirname as dirname38, join as
|
|
125091
|
+
import { dirname as dirname38, join as join81 } from "path";
|
|
125151
125092
|
var MANIFEST_VERSION = 1;
|
|
125152
125093
|
var ManifestEntrySchema = external_exports.object({
|
|
125153
125094
|
/** Display name of the skill (e.g. `qa`, or `plugin:name` when namespaced). */
|
|
@@ -125167,7 +125108,7 @@ function emptyManifest() {
|
|
|
125167
125108
|
return { version: MANIFEST_VERSION, entries: [] };
|
|
125168
125109
|
}
|
|
125169
125110
|
function defaultManifestPath(shipyardHome) {
|
|
125170
|
-
return
|
|
125111
|
+
return join81(shipyardHome, "state", "skill-mirror-manifest.json");
|
|
125171
125112
|
}
|
|
125172
125113
|
async function loadManifest(path5) {
|
|
125173
125114
|
try {
|
|
@@ -125198,15 +125139,15 @@ async function deleteManifest(path5) {
|
|
|
125198
125139
|
function defaultPaths() {
|
|
125199
125140
|
const home = homedir13();
|
|
125200
125141
|
return {
|
|
125201
|
-
claudeSkillsDir:
|
|
125202
|
-
codexSkillsDir:
|
|
125142
|
+
claudeSkillsDir: join82(home, ".claude", "skills"),
|
|
125143
|
+
codexSkillsDir: join82(home, ".agents", "skills"),
|
|
125203
125144
|
manifestPath: defaultManifestPath(getShipyardHome())
|
|
125204
125145
|
};
|
|
125205
125146
|
}
|
|
125206
125147
|
function plannedSymlinkPath(skill, paths) {
|
|
125207
125148
|
const linkName = skill.namespace ? `${skill.namespace}:${skill.name}` : skill.name;
|
|
125208
|
-
if (skill.sourceAgent === "claude-code") return
|
|
125209
|
-
if (skill.sourceAgent === "codex") return
|
|
125149
|
+
if (skill.sourceAgent === "claude-code") return join82(paths.codexSkillsDir, linkName);
|
|
125150
|
+
if (skill.sourceAgent === "codex") return join82(paths.claudeSkillsDir, linkName);
|
|
125210
125151
|
return null;
|
|
125211
125152
|
}
|
|
125212
125153
|
function isPermissionError(err3) {
|
|
@@ -125419,7 +125360,7 @@ async function ensureMirror(skills, config, paths = defaultPaths()) {
|
|
|
125419
125360
|
|
|
125420
125361
|
// src/services/skills-mirror/prefs.ts
|
|
125421
125362
|
import { mkdir as mkdir41, readFile as readFile52, rename as rename26, writeFile as writeFile32 } from "fs/promises";
|
|
125422
|
-
import { dirname as dirname40, join as
|
|
125363
|
+
import { dirname as dirname40, join as join83 } from "path";
|
|
125423
125364
|
var SkillsMirrorPrefsSchema = external_exports.object({
|
|
125424
125365
|
enabled: external_exports.boolean().default(true)
|
|
125425
125366
|
});
|
|
@@ -125428,7 +125369,7 @@ function defaultSkillsMirrorPrefs() {
|
|
|
125428
125369
|
return { enabled: true };
|
|
125429
125370
|
}
|
|
125430
125371
|
function prefsPath(dataDir) {
|
|
125431
|
-
return
|
|
125372
|
+
return join83(dataDir, FILENAME);
|
|
125432
125373
|
}
|
|
125433
125374
|
async function loadSkillsMirrorPrefs(dataDir) {
|
|
125434
125375
|
try {
|
|
@@ -125477,7 +125418,7 @@ async function reconcileSkillsMirror(args) {
|
|
|
125477
125418
|
// src/services/storage/daemon-settings-store.ts
|
|
125478
125419
|
import { createHash as createHash13 } from "crypto";
|
|
125479
125420
|
import { mkdir as mkdir42, readFile as readFile53 } from "fs/promises";
|
|
125480
|
-
import { join as
|
|
125421
|
+
import { join as join84 } from "path";
|
|
125481
125422
|
var ProjectSettingsSchema = external_exports.object({
|
|
125482
125423
|
disabledMcpServers: external_exports.array(external_exports.string()).optional(),
|
|
125483
125424
|
previewMigrationV36Done: external_exports.boolean().default(false)
|
|
@@ -125486,9 +125427,9 @@ function hashProjectPath(projectPath) {
|
|
|
125486
125427
|
return createHash13("sha256").update(projectPath).digest("hex").slice(0, 16);
|
|
125487
125428
|
}
|
|
125488
125429
|
function buildDaemonSettingsStore(dataDir) {
|
|
125489
|
-
const settingsDir =
|
|
125430
|
+
const settingsDir = join84(dataDir, "settings");
|
|
125490
125431
|
function settingsPath(projectPath) {
|
|
125491
|
-
return
|
|
125432
|
+
return join84(settingsDir, `${hashProjectPath(projectPath)}.json`);
|
|
125492
125433
|
}
|
|
125493
125434
|
async function ensureDir() {
|
|
125494
125435
|
await mkdir42(settingsDir, { recursive: true });
|
|
@@ -125513,12 +125454,12 @@ function buildDaemonSettingsStore(dataDir) {
|
|
|
125513
125454
|
|
|
125514
125455
|
// src/services/storage/plugin-config-store.ts
|
|
125515
125456
|
import { mkdir as mkdir43, readFile as readFile54 } from "fs/promises";
|
|
125516
|
-
import { join as
|
|
125457
|
+
import { join as join85 } from "path";
|
|
125517
125458
|
function buildPluginConfigStore(pluginsDir) {
|
|
125518
125459
|
const cache2 = /* @__PURE__ */ new Map();
|
|
125519
125460
|
const writeQueues = /* @__PURE__ */ new Map();
|
|
125520
125461
|
function configPath(pluginId) {
|
|
125521
|
-
return
|
|
125462
|
+
return join85(pluginsDir, pluginId, "config.json");
|
|
125522
125463
|
}
|
|
125523
125464
|
async function readConfigFromDisk(pluginId) {
|
|
125524
125465
|
const fp = configPath(pluginId);
|
|
@@ -125572,7 +125513,7 @@ function buildPluginConfigStore(pluginsDir) {
|
|
|
125572
125513
|
const fresh = await readConfigFromDisk(pluginId);
|
|
125573
125514
|
fresh[key] = value;
|
|
125574
125515
|
cache2.set(pluginId, fresh);
|
|
125575
|
-
await mkdir43(
|
|
125516
|
+
await mkdir43(join85(pluginsDir, pluginId), { recursive: true });
|
|
125576
125517
|
await atomicWriteFile(configPath(pluginId), JSON.stringify(fresh, null, 2));
|
|
125577
125518
|
})
|
|
125578
125519
|
);
|
|
@@ -125818,7 +125759,7 @@ async function serve(options = {}) {
|
|
|
125818
125759
|
}
|
|
125819
125760
|
async function runServeBody(options, captureRefs) {
|
|
125820
125761
|
const shipyardHome = options.shipyardHome ?? getShipyardHome();
|
|
125821
|
-
const dataDir =
|
|
125762
|
+
const dataDir = join86(shipyardHome, options.isDev ? "data-dev" : "data");
|
|
125822
125763
|
const log = createChildLogger({ mode: "serve" });
|
|
125823
125764
|
log.info(
|
|
125824
125765
|
{ event: "daemon_start", version: getDaemonVersion(), pid: process.pid },
|
|
@@ -125826,7 +125767,7 @@ async function runServeBody(options, captureRefs) {
|
|
|
125826
125767
|
);
|
|
125827
125768
|
const { workspaceRoot, unscopedWorkspace, unscopedReason } = await resolveWorkspaceScope();
|
|
125828
125769
|
registerBuiltinPlugins();
|
|
125829
|
-
const pluginConfigStore = buildPluginConfigStore(
|
|
125770
|
+
const pluginConfigStore = buildPluginConfigStore(join86(dataDir, "plugins"));
|
|
125830
125771
|
await mkdir44(dataDir, { recursive: true });
|
|
125831
125772
|
log.info(
|
|
125832
125773
|
{
|
|
@@ -125919,9 +125860,9 @@ async function runServeBody(options, captureRefs) {
|
|
|
125919
125860
|
await bootstrapPhase("pid_sweep_orphans", () => pidTracker.sweepOrphans(logAdapter));
|
|
125920
125861
|
await bootstrapPhase(
|
|
125921
125862
|
"legacy_epoch_prune",
|
|
125922
|
-
() => pruneOldEpochData(
|
|
125863
|
+
() => pruneOldEpochData(join86(dataDir, "loro"), LEGACY_EPOCH, logAdapter)
|
|
125923
125864
|
);
|
|
125924
|
-
const storage = new FileStorageAdapter(
|
|
125865
|
+
const storage = new FileStorageAdapter(join86(dataDir, "loro"));
|
|
125925
125866
|
const personalWebrtcAdapter = new WebRtcDataChannelAdapter();
|
|
125926
125867
|
const peerRoleRegistry = createPeerRoleRegistry();
|
|
125927
125868
|
const presencePoolRef = { pool: {} };
|
|
@@ -126029,14 +125970,14 @@ async function runServeBody(options, captureRefs) {
|
|
|
126029
125970
|
current: []
|
|
126030
125971
|
};
|
|
126031
125972
|
const terminalPtys = /* @__PURE__ */ new Map();
|
|
126032
|
-
const terminalLogsDir =
|
|
125973
|
+
const terminalLogsDir = join86(shipyardHome, "data", "terminals");
|
|
126033
125974
|
await mkdir44(terminalLogsDir, { recursive: true, mode: 448 });
|
|
126034
125975
|
const publishedArtifactStore = createPublishedArtifactStore({
|
|
126035
|
-
rootDir:
|
|
125976
|
+
rootDir: join86(dataDir, "published"),
|
|
126036
125977
|
log: logAdapter
|
|
126037
125978
|
});
|
|
126038
125979
|
const previewStateStore = createPreviewStateStore({
|
|
126039
|
-
rootDir:
|
|
125980
|
+
rootDir: join86(dataDir, "preview-state"),
|
|
126040
125981
|
logger: log
|
|
126041
125982
|
});
|
|
126042
125983
|
let codexSkillsApplyScopedPatchRef = null;
|
|
@@ -126115,7 +126056,7 @@ async function runServeBody(options, captureRefs) {
|
|
|
126115
126056
|
daemon.healthMetrics.start();
|
|
126116
126057
|
publishedArtifactStore.setSendControlMessage((msg) => daemon.taskManager.broadcastControl(msg));
|
|
126117
126058
|
previewStateStore.setSendControlMessage((msg) => daemon.taskManager.broadcastControl(msg));
|
|
126118
|
-
const pluginsDir =
|
|
126059
|
+
const pluginsDir = join86(shipyardHome, "plugins");
|
|
126119
126060
|
await mkdir44(pluginsDir, { recursive: true });
|
|
126120
126061
|
let loadedPlugins = [];
|
|
126121
126062
|
const loadedPluginsRef = {
|
|
@@ -126640,4 +126581,4 @@ export {
|
|
|
126640
126581
|
decideWorkspaceScope,
|
|
126641
126582
|
serve
|
|
126642
126583
|
};
|
|
126643
|
-
//# sourceMappingURL=serve-
|
|
126584
|
+
//# sourceMappingURL=serve-D5GKV2RU.js.map
|