openfox 2.0.71 → 2.0.72
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/{chat-handler-IKLQ3ZUN.js → chat-handler-LK5RUAGO.js} +15 -15
- package/dist/{chunk-NEL2REUM.js → chunk-2DCJERYX.js} +4 -4
- package/dist/chunk-2M6JM7OR.js +7 -0
- package/dist/{chunk-6V7DU7ID.js → chunk-4LBSC4R3.js} +3 -3
- package/dist/{chunk-TFDK6VSG.js → chunk-6XKM25OT.js} +13 -13
- package/dist/{chunk-TQGGMWS6.js → chunk-CHPRGEY5.js} +3 -3
- package/dist/{chunk-C3VLGVSQ.js → chunk-DJASQ2ZB.js} +11 -2
- package/dist/{chunk-4QBDV6LX.js → chunk-E5LLEO3C.js} +2 -2
- package/dist/{chunk-OLXHRPAD.js → chunk-FILRB5QX.js} +243 -285
- package/dist/{chunk-Y4YESMVA.js → chunk-GMF36EZ3.js} +81 -92
- package/dist/{chunk-GMXKJGJ2.js → chunk-I4RWK2L2.js} +8 -4
- package/dist/{chunk-F4PMNP7S.js → chunk-NOU2QIL5.js} +3 -2
- package/dist/{chunk-X7OCC37J.js → chunk-O2BE7KVQ.js} +8 -8
- package/dist/{chunk-PVUBCGAT.js → chunk-PYB2UEC3.js} +10 -4
- package/dist/{chunk-XUPKS5FL.js → chunk-QNKXZH3Z.js} +2 -2
- package/dist/{chunk-X5DOUA3Z.js → chunk-S7O77CVO.js} +2 -2
- package/dist/{chunk-Z42YTK3O.js → chunk-TK4BZIXA.js} +34 -23
- package/dist/{chunk-KXVFHMSM.js → chunk-UV3EMWL4.js} +2 -2
- package/dist/chunk-X2Y3AJPP.js +216 -0
- package/dist/{chunk-RKD2FML3.js → chunk-XWBNYU2L.js} +2 -2
- package/dist/cli/dev.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/{compactor-MXXF5WQR.js → compactor-4UKYWC5F.js} +8 -8
- package/dist/{events-CDQ4HASP.js → events-AEQ6GQXI.js} +4 -4
- package/dist/{folding-V2K34EGN.js → folding-ONH3D4OK.js} +2 -2
- package/dist/{inspect-proxy-OVEFBJ26.js → inspect-proxy-PHVZBZUO.js} +4 -4
- package/dist/{manager-EHIQCIUP.js → manager-24C2AXVF.js} +5 -5
- package/dist/{orchestrator-YGCZZNNV.js → orchestrator-RTZVMWQV.js} +14 -14
- package/dist/package.json +1 -1
- package/dist/{platform-AB3GIEGO.js → platform-XQ7BS3KQ.js} +4 -4
- package/dist/{processor-K6UPVMIP.js → processor-3O26I7DO.js} +15 -15
- package/dist/{project-creator-EMGRSPYS.js → project-creator-FQRBN3RG.js} +3 -3
- package/dist/{projects-7HSBZY2D.js → projects-LHRNCUGW.js} +3 -3
- package/dist/{protocol-CTNE3ANP.js → protocol-4QFU7WAI.js} +2 -2
- package/dist/{protocol-DIhV-tAc.d.ts → protocol-DGQWVFcP.d.ts} +1 -1
- package/dist/provider/index.d.ts +4 -4
- package/dist/{serve-5IOKFKGL.js → serve-6PSAQ2YH.js} +18 -18
- package/dist/server/index.d.ts +12 -22
- package/dist/server/index.js +17 -17
- package/dist/{server-T5QDCUBN.js → server-G2J4RAXL.js} +16 -16
- package/dist/{settings-6ZPWOBWL.js → settings-PFXRYXZU.js} +3 -3
- package/dist/shared/index.d.ts +3 -3
- package/dist/{tools-K3SNGBI2.js → tools-X52DFUS6.js} +13 -13
- package/dist/{types-BsfYpEai.d.ts → types-C4cG9CtC.d.ts} +3 -2
- package/dist/{types-CBC6lLqc.d.ts → types-DSZhFA8O.d.ts} +1 -1
- package/dist/{update-734IDLKT.js → update-I2M2RG4Q.js} +2 -2
- package/dist/web/assets/index-C7SW16F7.js +305 -0
- package/dist/web/assets/{index-BVTG7SRG.css → index-CmechlaK.css} +1 -1
- package/dist/web/index.html +2 -2
- package/dist/web/sw.js +1 -1
- package/dist/workspace-ET3FHZYN.js +32 -0
- package/package.json +1 -1
- package/dist/chunk-7NMOWPNY.js +0 -7
- package/dist/chunk-VLV3XWZS.js +0 -191
- package/dist/web/assets/index-HTzupfR0.js +0 -305
- package/dist/worktree-6U45P63P.js +0 -30
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
computeSessionHash,
|
|
4
4
|
runAgentTurn,
|
|
5
5
|
runChatTurn
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-O2BE7KVQ.js";
|
|
7
7
|
import {
|
|
8
8
|
deleteItemFromDir,
|
|
9
9
|
devServerManager,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
jsonSerializer,
|
|
14
14
|
loadAllAgentsDefault,
|
|
15
15
|
saveItemToDir
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-GMF36EZ3.js";
|
|
17
17
|
import {
|
|
18
18
|
gitSpawnEnv
|
|
19
19
|
} from "./chunk-WGMJCFCE.js";
|
|
@@ -23,28 +23,29 @@ import {
|
|
|
23
23
|
} from "./chunk-EU3WWTFH.js";
|
|
24
24
|
import {
|
|
25
25
|
appendCompactionPrompt
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-CHPRGEY5.js";
|
|
27
27
|
import {
|
|
28
28
|
TurnMetrics,
|
|
29
29
|
createMessageStartEvent
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-XWBNYU2L.js";
|
|
31
31
|
import {
|
|
32
32
|
checkAborted,
|
|
33
33
|
onProcessEvent,
|
|
34
34
|
spawnShellProcess
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-PYB2UEC3.js";
|
|
36
36
|
import {
|
|
37
|
+
killProcessTree,
|
|
37
38
|
terminateProcessTree
|
|
38
39
|
} from "./chunk-I72ACQ6R.js";
|
|
39
40
|
import {
|
|
40
41
|
getCurrentContextWindowId,
|
|
41
42
|
getEventStore,
|
|
42
43
|
getRuntimeConfig
|
|
43
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-6XKM25OT.js";
|
|
44
45
|
import {
|
|
45
46
|
buildMessagesFromStoredEvents,
|
|
46
47
|
foldPendingConfirmations
|
|
47
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-DJASQ2ZB.js";
|
|
48
49
|
import {
|
|
49
50
|
createChatErrorMessage,
|
|
50
51
|
createChatMessageMessage,
|
|
@@ -59,10 +60,10 @@ import {
|
|
|
59
60
|
parseClientMessage,
|
|
60
61
|
serializeServerMessage,
|
|
61
62
|
storedEventToServerMessage
|
|
62
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-NOU2QIL5.js";
|
|
63
64
|
import {
|
|
64
65
|
getPlatformShell
|
|
65
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-S7O77CVO.js";
|
|
66
67
|
import {
|
|
67
68
|
logger
|
|
68
69
|
} from "./chunk-K44MW7JJ.js";
|
|
@@ -87,6 +88,17 @@ import WebSocket from "ws";
|
|
|
87
88
|
// src/server/terminal/manager.ts
|
|
88
89
|
import * as pty from "node-pty";
|
|
89
90
|
import os from "os";
|
|
91
|
+
async function killPty(ptyProcess) {
|
|
92
|
+
if (process.platform === "win32" && ptyProcess.pid) {
|
|
93
|
+
await killProcessTree(ptyProcess.pid);
|
|
94
|
+
try {
|
|
95
|
+
ptyProcess.kill();
|
|
96
|
+
} catch {
|
|
97
|
+
}
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
ptyProcess.kill();
|
|
101
|
+
}
|
|
90
102
|
var TerminalManager = class {
|
|
91
103
|
sessions = /* @__PURE__ */ new Map();
|
|
92
104
|
outputCallbacks = /* @__PURE__ */ new Set();
|
|
@@ -175,7 +187,7 @@ var TerminalManager = class {
|
|
|
175
187
|
if (!session) {
|
|
176
188
|
return false;
|
|
177
189
|
}
|
|
178
|
-
session.pty
|
|
190
|
+
void killPty(session.pty);
|
|
179
191
|
this.sessions.delete(sessionId);
|
|
180
192
|
logger.info("Terminal session killed", { id: sessionId });
|
|
181
193
|
return true;
|
|
@@ -205,11 +217,10 @@ var TerminalManager = class {
|
|
|
205
217
|
this.exitCallbacks.delete(callback);
|
|
206
218
|
};
|
|
207
219
|
}
|
|
208
|
-
killAll() {
|
|
209
|
-
|
|
210
|
-
session.pty.kill();
|
|
211
|
-
}
|
|
220
|
+
async killAll() {
|
|
221
|
+
const kills = Array.from(this.sessions.values()).map((session) => killPty(session.pty));
|
|
212
222
|
this.sessions.clear();
|
|
223
|
+
await Promise.all(kills);
|
|
213
224
|
logger.info("All terminal sessions killed");
|
|
214
225
|
}
|
|
215
226
|
};
|
|
@@ -614,7 +625,7 @@ function formatCriteriaList(entries) {
|
|
|
614
625
|
}).join("\n");
|
|
615
626
|
}
|
|
616
627
|
async function formatModifiedFiles(session) {
|
|
617
|
-
const effectiveWorkdir = session.
|
|
628
|
+
const effectiveWorkdir = session.workspace ?? session.workdir;
|
|
618
629
|
return formatGitDiffFiles(effectiveWorkdir);
|
|
619
630
|
}
|
|
620
631
|
function resolveTemplate(template, ctx) {
|
|
@@ -791,7 +802,7 @@ async function executeWorkflow(workflow, options, subGroup) {
|
|
|
791
802
|
const currentWindowMessageOptions = getCurrentWindowMessageOptions(sessionId);
|
|
792
803
|
const criteriaEntries = session.metadataEntries["criteria"] ?? [];
|
|
793
804
|
const templateCtx = {
|
|
794
|
-
workdir: session.
|
|
805
|
+
workdir: session.workspace ?? session.workdir,
|
|
795
806
|
reason: buildReason(session.metadataEntries),
|
|
796
807
|
verifierFindings: lastStepOutput["content"] ?? "",
|
|
797
808
|
previousStepOutput: lastStepOutput["stdout"] ?? "",
|
|
@@ -963,7 +974,7 @@ async function executeWorkflow(workflow, options, subGroup) {
|
|
|
963
974
|
})
|
|
964
975
|
);
|
|
965
976
|
}
|
|
966
|
-
const result = await executeShellCommand(command, session.
|
|
977
|
+
const result = await executeShellCommand(command, session.workspace ?? session.workdir, timeout, signal);
|
|
967
978
|
const output = [result.stdout, result.stderr].filter(Boolean).join("\n").trim();
|
|
968
979
|
lastStepOutput = { stdout: result.stdout ?? "", stderr: result.stderr ?? "", exitCode: String(result.exitCode) };
|
|
969
980
|
const outputContent = output ? `Exit code: ${result.exitCode}
|
|
@@ -1613,11 +1624,11 @@ function createWebSocketServer(httpServer, _config, getLLMClient, getActiveProvi
|
|
|
1613
1624
|
const messages = buildMessagesFromStoredEvents(events);
|
|
1614
1625
|
const pendingConfirmations = foldPendingConfirmations(events);
|
|
1615
1626
|
const pendingQuestions = getPendingQuestionsForSession(updatedSession.id);
|
|
1616
|
-
const effectiveWorkdir = updatedSession.
|
|
1617
|
-
let
|
|
1627
|
+
const effectiveWorkdir = updatedSession.workspace ?? updatedSession.workdir;
|
|
1628
|
+
let workspaceChanged = false;
|
|
1618
1629
|
for (const [, client] of clients) {
|
|
1619
1630
|
if (client.activeSessionId === updatedSession.id && client.activeWorkdir !== effectiveWorkdir) {
|
|
1620
|
-
|
|
1631
|
+
workspaceChanged = true;
|
|
1621
1632
|
const prevWorkdir = client.activeWorkdir;
|
|
1622
1633
|
client.activeWorkdir = effectiveWorkdir;
|
|
1623
1634
|
if (prevWorkdir) moduleStopGitPolling(prevWorkdir);
|
|
@@ -1628,7 +1639,7 @@ function createWebSocketServer(httpServer, _config, getLLMClient, getActiveProvi
|
|
|
1628
1639
|
updatedSession.id,
|
|
1629
1640
|
createSessionStateMessage(updatedSession, messages, pendingConfirmations, pendingQuestions)
|
|
1630
1641
|
);
|
|
1631
|
-
if (
|
|
1642
|
+
if (workspaceChanged && effectiveWorkdir) {
|
|
1632
1643
|
;
|
|
1633
1644
|
(async () => {
|
|
1634
1645
|
const branch = await moduleGitBranch(effectiveWorkdir);
|
|
@@ -1835,7 +1846,7 @@ async function handleClientMessage(ws, client, message, _getLLMClient, _getActiv
|
|
|
1835
1846
|
return;
|
|
1836
1847
|
}
|
|
1837
1848
|
client.activeSessionId = session.id;
|
|
1838
|
-
const effectiveWorkdir = session.
|
|
1849
|
+
const effectiveWorkdir = session.workspace ?? session.workdir;
|
|
1839
1850
|
client.activeWorkdir = effectiveWorkdir;
|
|
1840
1851
|
if (effectiveWorkdir) {
|
|
1841
1852
|
const branch = await moduleGitBranch(effectiveWorkdir);
|
|
@@ -2161,4 +2172,4 @@ export {
|
|
|
2161
2172
|
signalMcpReady,
|
|
2162
2173
|
createWebSocketServer
|
|
2163
2174
|
};
|
|
2164
|
-
//# sourceMappingURL=chunk-
|
|
2175
|
+
//# sourceMappingURL=chunk-TK4BZIXA.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getDatabase
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-I4RWK2L2.js";
|
|
4
4
|
|
|
5
5
|
// src/server/db/projects.ts
|
|
6
6
|
function createProject(name, workdir) {
|
|
@@ -117,4 +117,4 @@ export {
|
|
|
117
117
|
deleteProject,
|
|
118
118
|
toggleStar
|
|
119
119
|
};
|
|
120
|
-
//# sourceMappingURL=chunk-
|
|
120
|
+
//# sourceMappingURL=chunk-UV3EMWL4.js.map
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import {
|
|
2
|
+
gitSpawnEnv
|
|
3
|
+
} from "./chunk-WGMJCFCE.js";
|
|
4
|
+
import {
|
|
5
|
+
logger
|
|
6
|
+
} from "./chunk-K44MW7JJ.js";
|
|
7
|
+
|
|
8
|
+
// src/server/git/workspace.ts
|
|
9
|
+
import { spawn, execSync } from "child_process";
|
|
10
|
+
import { mkdir as mkdir2 } from "fs/promises";
|
|
11
|
+
import { resolve as resolve2, join as join2 } from "path";
|
|
12
|
+
import { homedir, platform } from "os";
|
|
13
|
+
|
|
14
|
+
// src/server/git/workspace-config.ts
|
|
15
|
+
import { readFile, writeFile, mkdir } from "fs/promises";
|
|
16
|
+
import { resolve, join } from "path";
|
|
17
|
+
var CONFIG_FILENAME = ".openfox/workspace.json";
|
|
18
|
+
function getConfigPath(workdir) {
|
|
19
|
+
return join(resolve(workdir), CONFIG_FILENAME);
|
|
20
|
+
}
|
|
21
|
+
async function loadWorkspaceConfig(workdir) {
|
|
22
|
+
try {
|
|
23
|
+
const configPath = getConfigPath(workdir);
|
|
24
|
+
const raw = await readFile(configPath, "utf-8");
|
|
25
|
+
const parsed = JSON.parse(raw);
|
|
26
|
+
if (!parsed.setup) return null;
|
|
27
|
+
return { setup: parsed.setup };
|
|
28
|
+
} catch {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
async function saveWorkspaceConfig(workdir, config) {
|
|
33
|
+
const resolved = resolve(workdir);
|
|
34
|
+
const dirPath = join(resolved, ".openfox");
|
|
35
|
+
await mkdir(dirPath, { recursive: true });
|
|
36
|
+
const configPath = getConfigPath(workdir);
|
|
37
|
+
await writeFile(configPath, JSON.stringify(config, null, 2) + "\n", "utf-8");
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// src/server/git/workspace.ts
|
|
41
|
+
function captureStdout(cwd, args) {
|
|
42
|
+
return new Promise((resolvePromise) => {
|
|
43
|
+
const proc = spawn("git", args, { cwd, env: gitSpawnEnv(), stdio: ["ignore", "pipe", "ignore"] });
|
|
44
|
+
let out = "";
|
|
45
|
+
proc.stdout.on("data", (d) => {
|
|
46
|
+
out += d.toString();
|
|
47
|
+
});
|
|
48
|
+
proc.on("close", (code) => resolvePromise(code === 0 ? out : null));
|
|
49
|
+
proc.on("error", () => resolvePromise(null));
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
function runGit(cwd, args) {
|
|
53
|
+
return new Promise((resolvePromise, reject) => {
|
|
54
|
+
const proc = spawn("git", args, { cwd, env: gitSpawnEnv(), stdio: ["ignore", "pipe", "pipe"] });
|
|
55
|
+
let stderr = "";
|
|
56
|
+
proc.stderr.on("data", (d) => {
|
|
57
|
+
stderr += d.toString();
|
|
58
|
+
});
|
|
59
|
+
proc.on("close", (code) => {
|
|
60
|
+
if (code === 0) resolvePromise();
|
|
61
|
+
else reject(new Error(stderr.trim() || `git ${args[0]} failed (code ${code})`));
|
|
62
|
+
});
|
|
63
|
+
proc.on("error", (err) => reject(err));
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
function getServerMode() {
|
|
67
|
+
return process.env["OPENFOX_DEV"] === "true" ? "development" : "production";
|
|
68
|
+
}
|
|
69
|
+
function getGlobalDataDir() {
|
|
70
|
+
const mode = getServerMode();
|
|
71
|
+
const suffix = mode === "development" ? "-dev" : "";
|
|
72
|
+
const home = homedir();
|
|
73
|
+
switch (platform()) {
|
|
74
|
+
case "darwin":
|
|
75
|
+
return join2(home, "Library", "Application Support", `openfox${suffix}`);
|
|
76
|
+
case "win32":
|
|
77
|
+
return join2(process.env["LOCALAPPDATA"] ?? join2(home, "AppData", "Local"), `openfox${suffix}`);
|
|
78
|
+
default:
|
|
79
|
+
return join2(process.env["XDG_DATA_HOME"] ?? join2(home, ".local", "share"), `openfox${suffix}`);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
function getWorkspacesDir(projectName) {
|
|
83
|
+
return join2(getGlobalDataDir(), "workspaces", projectName);
|
|
84
|
+
}
|
|
85
|
+
function getGitBranch(cwd) {
|
|
86
|
+
return captureStdout(cwd, ["rev-parse", "--abbrev-ref", "HEAD"]).then((r) => r?.trim() ?? null);
|
|
87
|
+
}
|
|
88
|
+
function listBranches(cwd) {
|
|
89
|
+
return captureStdout(cwd, ["branch", "--format", "%(refname:short)%09%(HEAD)"]).then((out) => {
|
|
90
|
+
if (!out) return [];
|
|
91
|
+
const branches = [];
|
|
92
|
+
for (const line of out.trim().split("\n")) {
|
|
93
|
+
if (!line) continue;
|
|
94
|
+
const [name, head] = line.split(" ");
|
|
95
|
+
if (name) branches.push({ name, current: head === "*" });
|
|
96
|
+
}
|
|
97
|
+
return branches;
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
async function getCommitsBehind(cwd, branch) {
|
|
101
|
+
const out = await captureStdout(cwd, ["rev-list", "--count", "HEAD..origin/" + branch, "--"]);
|
|
102
|
+
if (out === null) return null;
|
|
103
|
+
const count = parseInt(out.trim(), 10);
|
|
104
|
+
return Number.isNaN(count) ? null : count;
|
|
105
|
+
}
|
|
106
|
+
function validateRef(cwd, name) {
|
|
107
|
+
return runGit(cwd, ["check-ref-format", `refs/heads/${name}`]);
|
|
108
|
+
}
|
|
109
|
+
function checkoutBranch(cwd, name) {
|
|
110
|
+
return runGit(cwd, ["checkout", name]);
|
|
111
|
+
}
|
|
112
|
+
function createBranch(cwd, name) {
|
|
113
|
+
return runGit(cwd, ["checkout", "-b", name]);
|
|
114
|
+
}
|
|
115
|
+
async function workspaceExists(projectName, name) {
|
|
116
|
+
const dir = getWorkspacesDir(projectName);
|
|
117
|
+
const wsPath = resolve2(dir, name);
|
|
118
|
+
const st = await statSafe(wsPath);
|
|
119
|
+
if (!st?.isDirectory()) return false;
|
|
120
|
+
const gitDir = join2(wsPath, ".git");
|
|
121
|
+
const gitSt = await statSafe(gitDir);
|
|
122
|
+
return gitSt?.isDirectory() ?? false;
|
|
123
|
+
}
|
|
124
|
+
async function listWorkspaces(projectName) {
|
|
125
|
+
const dir = getWorkspacesDir(projectName);
|
|
126
|
+
try {
|
|
127
|
+
const { readdir } = await import("fs/promises");
|
|
128
|
+
const entries = await readdir(dir, { withFileTypes: true });
|
|
129
|
+
const workspaces = [];
|
|
130
|
+
for (const entry of entries) {
|
|
131
|
+
if (entry.isDirectory()) {
|
|
132
|
+
const wsPath = resolve2(dir, entry.name);
|
|
133
|
+
const branch = await getGitBranch(wsPath);
|
|
134
|
+
workspaces.push({ path: wsPath, name: entry.name, branch });
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return workspaces.sort((a, b) => a.name.localeCompare(b.name));
|
|
138
|
+
} catch {
|
|
139
|
+
return [];
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
async function ensureWorkspace(projectDir, name, projectName, branch) {
|
|
143
|
+
const workspacesDir = getWorkspacesDir(projectName);
|
|
144
|
+
const wsPath = resolve2(workspacesDir, name);
|
|
145
|
+
await mkdir2(workspacesDir, { recursive: true });
|
|
146
|
+
const existing = await statSafe(wsPath);
|
|
147
|
+
if (existing?.isDirectory()) {
|
|
148
|
+
const gitDir = join2(wsPath, ".git");
|
|
149
|
+
const gitStat = await statSafe(gitDir);
|
|
150
|
+
if (!gitStat?.isDirectory()) {
|
|
151
|
+
throw new Error("Existing path is not a valid workspace: " + wsPath);
|
|
152
|
+
}
|
|
153
|
+
logger.info("Workspace directory already exists, reusing", { path: wsPath });
|
|
154
|
+
} else {
|
|
155
|
+
await runGit(projectDir, ["clone", "--shared", projectDir, wsPath]);
|
|
156
|
+
}
|
|
157
|
+
const st = await statSafe(wsPath);
|
|
158
|
+
if (!st?.isDirectory()) {
|
|
159
|
+
throw new Error("Failed to clone workspace");
|
|
160
|
+
}
|
|
161
|
+
if (branch) {
|
|
162
|
+
await runGit(wsPath, ["checkout", branch]).catch(async () => {
|
|
163
|
+
const sourceBranch = await getGitBranch(projectDir) ?? "main";
|
|
164
|
+
await runGit(wsPath, ["checkout", "-b", branch, sourceBranch]);
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
const config = await loadWorkspaceConfig(projectDir);
|
|
168
|
+
if (config?.setup && config.setup.length > 0) {
|
|
169
|
+
for (const cmd of config.setup) {
|
|
170
|
+
logger.info("Running workspace setup command", { command: cmd, cwd: wsPath });
|
|
171
|
+
try {
|
|
172
|
+
execSync(cmd, { cwd: wsPath, stdio: "inherit", env: { ...process.env } });
|
|
173
|
+
} catch (err) {
|
|
174
|
+
logger.warn("Workspace setup command failed", { command: cmd, error: String(err) });
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
return { path: wsPath, name };
|
|
179
|
+
}
|
|
180
|
+
async function deleteWorkspace(projectName, name) {
|
|
181
|
+
const dir = getWorkspacesDir(projectName);
|
|
182
|
+
const wsPath = resolve2(dir, name);
|
|
183
|
+
const st = await statSafe(wsPath);
|
|
184
|
+
if (!st?.isDirectory()) {
|
|
185
|
+
throw new Error(`Workspace "${name}" does not exist`);
|
|
186
|
+
}
|
|
187
|
+
const { rm } = await import("fs/promises");
|
|
188
|
+
await rm(wsPath, { recursive: true, force: true });
|
|
189
|
+
logger.info("Deleted workspace", { projectName, name, path: wsPath });
|
|
190
|
+
}
|
|
191
|
+
async function statSafe(p) {
|
|
192
|
+
try {
|
|
193
|
+
const { stat } = await import("fs/promises");
|
|
194
|
+
return await stat(p);
|
|
195
|
+
} catch {
|
|
196
|
+
return null;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export {
|
|
201
|
+
loadWorkspaceConfig,
|
|
202
|
+
saveWorkspaceConfig,
|
|
203
|
+
runGit,
|
|
204
|
+
getWorkspacesDir,
|
|
205
|
+
getGitBranch,
|
|
206
|
+
listBranches,
|
|
207
|
+
getCommitsBehind,
|
|
208
|
+
validateRef,
|
|
209
|
+
checkoutBranch,
|
|
210
|
+
createBranch,
|
|
211
|
+
workspaceExists,
|
|
212
|
+
listWorkspaces,
|
|
213
|
+
ensureWorkspace,
|
|
214
|
+
deleteWorkspace
|
|
215
|
+
};
|
|
216
|
+
//# sourceMappingURL=chunk-X2Y3AJPP.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getPlatformShell
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-S7O77CVO.js";
|
|
4
4
|
import {
|
|
5
5
|
streamWithSegments
|
|
6
6
|
} from "./chunk-J2GP3J3X.js";
|
|
@@ -678,4 +678,4 @@ export {
|
|
|
678
678
|
createChatDoneEvent,
|
|
679
679
|
consumeStreamGenerator
|
|
680
680
|
};
|
|
681
|
-
//# sourceMappingURL=chunk-
|
|
681
|
+
//# sourceMappingURL=chunk-XWBNYU2L.js.map
|
package/dist/cli/dev.js
CHANGED
package/dist/cli/index.js
CHANGED
|
@@ -2,13 +2,13 @@ import {
|
|
|
2
2
|
appendCompactionPrompt,
|
|
3
3
|
getCompactionTarget,
|
|
4
4
|
shouldCompact
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-CHPRGEY5.js";
|
|
6
|
+
import "./chunk-XWBNYU2L.js";
|
|
7
|
+
import "./chunk-6XKM25OT.js";
|
|
8
|
+
import "./chunk-DJASQ2ZB.js";
|
|
9
|
+
import "./chunk-S7O77CVO.js";
|
|
10
|
+
import "./chunk-QNKXZH3Z.js";
|
|
11
|
+
import "./chunk-I4RWK2L2.js";
|
|
12
12
|
import "./chunk-J2GP3J3X.js";
|
|
13
13
|
import "./chunk-V4IE7HJY.js";
|
|
14
14
|
import "./chunk-YHEQTVFV.js";
|
|
@@ -20,4 +20,4 @@ export {
|
|
|
20
20
|
getCompactionTarget,
|
|
21
21
|
shouldCompact
|
|
22
22
|
};
|
|
23
|
-
//# sourceMappingURL=compactor-
|
|
23
|
+
//# sourceMappingURL=compactor-4UKYWC5F.js.map
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
isStoredEvent,
|
|
39
39
|
isTurnEvent,
|
|
40
40
|
truncateSessionMessages
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-6XKM25OT.js";
|
|
42
42
|
import {
|
|
43
43
|
buildContextMessagesFromEventHistory,
|
|
44
44
|
buildContextMessagesFromMessages,
|
|
@@ -55,8 +55,8 @@ import {
|
|
|
55
55
|
foldTodos,
|
|
56
56
|
foldTurnEventsToSnapshotMessages,
|
|
57
57
|
getMessagesForWindow
|
|
58
|
-
} from "./chunk-
|
|
59
|
-
import "./chunk-
|
|
58
|
+
} from "./chunk-DJASQ2ZB.js";
|
|
59
|
+
import "./chunk-I4RWK2L2.js";
|
|
60
60
|
import "./chunk-K44MW7JJ.js";
|
|
61
61
|
import "./chunk-5WRI5ZAA.js";
|
|
62
62
|
export {
|
|
@@ -115,4 +115,4 @@ export {
|
|
|
115
115
|
isTurnEvent,
|
|
116
116
|
truncateSessionMessages
|
|
117
117
|
};
|
|
118
|
-
//# sourceMappingURL=events-
|
|
118
|
+
//# sourceMappingURL=events-AEQ6GQXI.js.map
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
reorderToolMessages,
|
|
25
25
|
spreadOptionalMessageFields,
|
|
26
26
|
stripOrphanedToolCalls
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-DJASQ2ZB.js";
|
|
28
28
|
import "./chunk-5WRI5ZAA.js";
|
|
29
29
|
export {
|
|
30
30
|
buildContextMessagesFromEventHistory,
|
|
@@ -53,4 +53,4 @@ export {
|
|
|
53
53
|
spreadOptionalMessageFields,
|
|
54
54
|
stripOrphanedToolCalls
|
|
55
55
|
};
|
|
56
|
-
//# sourceMappingURL=folding-
|
|
56
|
+
//# sourceMappingURL=folding-ONH3D4OK.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
startInspectProxy,
|
|
3
3
|
stopAllInspectProxies
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-E5LLEO3C.js";
|
|
5
|
+
import "./chunk-UV3EMWL4.js";
|
|
6
|
+
import "./chunk-I4RWK2L2.js";
|
|
7
7
|
import "./chunk-K44MW7JJ.js";
|
|
8
8
|
import "./chunk-5WRI5ZAA.js";
|
|
9
9
|
export {
|
|
10
10
|
startInspectProxy,
|
|
11
11
|
stopAllInspectProxies
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=inspect-proxy-
|
|
13
|
+
//# sourceMappingURL=inspect-proxy-PHVZBZUO.js.map
|
|
@@ -6,11 +6,11 @@ import {
|
|
|
6
6
|
onProcessEvent,
|
|
7
7
|
startProcessCommand,
|
|
8
8
|
stopProcess
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-PYB2UEC3.js";
|
|
10
10
|
import "./chunk-I72ACQ6R.js";
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-S7O77CVO.js";
|
|
12
|
+
import "./chunk-QNKXZH3Z.js";
|
|
13
|
+
import "./chunk-I4RWK2L2.js";
|
|
14
14
|
import "./chunk-K44MW7JJ.js";
|
|
15
15
|
import "./chunk-5WRI5ZAA.js";
|
|
16
16
|
export {
|
|
@@ -22,4 +22,4 @@ export {
|
|
|
22
22
|
startProcessCommand,
|
|
23
23
|
stopProcess
|
|
24
24
|
};
|
|
25
|
-
//# sourceMappingURL=manager-
|
|
25
|
+
//# sourceMappingURL=manager-24C2AXVF.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runAgentTurn,
|
|
3
3
|
runChatTurn
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-O2BE7KVQ.js";
|
|
5
|
+
import "./chunk-GMF36EZ3.js";
|
|
6
|
+
import "./chunk-X2Y3AJPP.js";
|
|
7
7
|
import "./chunk-WGMJCFCE.js";
|
|
8
8
|
import "./chunk-EU3WWTFH.js";
|
|
9
9
|
import {
|
|
@@ -13,19 +13,19 @@ import {
|
|
|
13
13
|
createMessageStartEvent,
|
|
14
14
|
createToolCallEvent,
|
|
15
15
|
createToolResultEvent
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-XWBNYU2L.js";
|
|
17
|
+
import "./chunk-E5LLEO3C.js";
|
|
18
|
+
import "./chunk-UV3EMWL4.js";
|
|
19
|
+
import "./chunk-PYB2UEC3.js";
|
|
20
20
|
import "./chunk-I72ACQ6R.js";
|
|
21
21
|
import "./chunk-NWO6GRYE.js";
|
|
22
22
|
import "./chunk-UN26GIQG.js";
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-6XKM25OT.js";
|
|
24
|
+
import "./chunk-DJASQ2ZB.js";
|
|
25
|
+
import "./chunk-NOU2QIL5.js";
|
|
26
|
+
import "./chunk-S7O77CVO.js";
|
|
27
|
+
import "./chunk-QNKXZH3Z.js";
|
|
28
|
+
import "./chunk-I4RWK2L2.js";
|
|
29
29
|
import "./chunk-J2GP3J3X.js";
|
|
30
30
|
import "./chunk-V4IE7HJY.js";
|
|
31
31
|
import "./chunk-YHEQTVFV.js";
|
|
@@ -45,4 +45,4 @@ export {
|
|
|
45
45
|
runAgentTurn,
|
|
46
46
|
runChatTurn
|
|
47
47
|
};
|
|
48
|
-
//# sourceMappingURL=orchestrator-
|
|
48
|
+
//# sourceMappingURL=orchestrator-RTZVMWQV.js.map
|
package/dist/package.json
CHANGED
|
@@ -5,9 +5,9 @@ import {
|
|
|
5
5
|
isAbsolutePath,
|
|
6
6
|
isWindowsPath,
|
|
7
7
|
listAvailableShells
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-S7O77CVO.js";
|
|
9
|
+
import "./chunk-QNKXZH3Z.js";
|
|
10
|
+
import "./chunk-I4RWK2L2.js";
|
|
11
11
|
import "./chunk-K44MW7JJ.js";
|
|
12
12
|
import "./chunk-5WRI5ZAA.js";
|
|
13
13
|
export {
|
|
@@ -18,4 +18,4 @@ export {
|
|
|
18
18
|
isWindowsPath,
|
|
19
19
|
listAvailableShells
|
|
20
20
|
};
|
|
21
|
-
//# sourceMappingURL=platform-
|
|
21
|
+
//# sourceMappingURL=platform-XQ7BS3KQ.js.map
|