openfox 2.0.82 → 2.0.84
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/{branch.api-3YJSWOZG.js → branch.api-XVTYACSH.js} +2 -2
- package/dist/{chat-handler-73HNN7TQ.js → chat-handler-377ZHEDW.js} +5 -5
- package/dist/{chunk-ATU2X6EP.js → chunk-55L4SHCO.js} +3 -3
- package/dist/{chunk-37WF2Z3T.js → chunk-7PZBCATU.js} +19 -5
- package/dist/{chunk-7QCJCIVB.js → chunk-CKWD5V4W.js} +18 -11
- package/dist/{chunk-4VDEVDMG.js → chunk-G4PVYDVM.js} +4 -4
- package/dist/{chunk-KC7NXZHK.js → chunk-J5E6ZE7O.js} +54 -28
- package/dist/chunk-J7GAZGZT.js +57 -0
- package/dist/{chunk-KSVE7RMK.js → chunk-XIVQNOXU.js} +4 -4
- package/dist/chunk-YWBJRUDI.js +7 -0
- package/dist/cli/dev.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/{orchestrator-CMKIFPOS.js → orchestrator-LRKFV4MN.js} +5 -5
- package/dist/package.json +1 -1
- package/dist/{processor-XNFEP2DV.js → processor-LXVRVPBN.js} +5 -5
- package/dist/{serve-PHRKCACD.js → serve-SYGARZPL.js} +8 -8
- package/dist/server/index.js +7 -7
- package/dist/{server-OLE7676B.js → server-ZU3IU7WH.js} +6 -6
- package/dist/{tools-NXEKDL2V.js → tools-6NVILBHW.js} +4 -4
- package/dist/{update-BGQRA2UG.js → update-VHU2XFPH.js} +2 -2
- package/dist/web/assets/{index-V9yNKJy4.js → index-BhxPPOY-.js} +60 -60
- package/dist/web/assets/{index-DfmXvFVe.css → index-CsWZt1m8.css} +1 -1
- package/dist/web/index.html +2 -2
- package/dist/web/sw.js +1 -1
- package/dist/{workspace-J74ZMSOJ.js → workspace-MMV6V5P4.js} +5 -3
- package/package.json +1 -1
- package/dist/chunk-UFX46Z5J.js +0 -7
- package/dist/chunk-WGMJCFCE.js +0 -14
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
gitSpawnEnv
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-J7GAZGZT.js";
|
|
4
4
|
import {
|
|
5
5
|
logger
|
|
6
6
|
} from "./chunk-K44MW7JJ.js";
|
|
@@ -51,4 +51,4 @@ function getGitBranch(cwd) {
|
|
|
51
51
|
export {
|
|
52
52
|
getCurrentBranch
|
|
53
53
|
};
|
|
54
|
-
//# sourceMappingURL=branch.api-
|
|
54
|
+
//# sourceMappingURL=branch.api-XVTYACSH.js.map
|
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
} from "./chunk-WL6AOKRD.js";
|
|
6
6
|
import {
|
|
7
7
|
runChatTurn
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-G4PVYDVM.js";
|
|
9
|
+
import "./chunk-CKWD5V4W.js";
|
|
10
10
|
import "./chunk-JKZPMRH2.js";
|
|
11
11
|
import "./chunk-NWO6GRYE.js";
|
|
12
12
|
import "./chunk-VPFUXGMM.js";
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-7PZBCATU.js";
|
|
14
|
+
import "./chunk-J7GAZGZT.js";
|
|
15
15
|
import "./chunk-3D3N2PXI.js";
|
|
16
16
|
import {
|
|
17
17
|
createChatMessageMessage,
|
|
@@ -160,4 +160,4 @@ export {
|
|
|
160
160
|
startChatSession,
|
|
161
161
|
stopSessionExecution
|
|
162
162
|
};
|
|
163
|
-
//# sourceMappingURL=chat-handler-
|
|
163
|
+
//# sourceMappingURL=chat-handler-377ZHEDW.js.map
|
|
@@ -200,7 +200,7 @@ async function runCli(options) {
|
|
|
200
200
|
break;
|
|
201
201
|
}
|
|
202
202
|
case "update": {
|
|
203
|
-
const { runUpdate } = await import("./update-
|
|
203
|
+
const { runUpdate } = await import("./update-VHU2XFPH.js");
|
|
204
204
|
const code = await runUpdate();
|
|
205
205
|
if (code !== 0) {
|
|
206
206
|
process.exit(code);
|
|
@@ -213,7 +213,7 @@ async function runCli(options) {
|
|
|
213
213
|
if (!configExists) {
|
|
214
214
|
await runNetworkSetup(mode);
|
|
215
215
|
}
|
|
216
|
-
const { runServe } = await import("./serve-
|
|
216
|
+
const { runServe } = await import("./serve-SYGARZPL.js");
|
|
217
217
|
const serveOptions = { mode };
|
|
218
218
|
if (values.port) serveOptions.port = parseInt(values.port);
|
|
219
219
|
if (values["no-browser"] === true) serveOptions.openBrowser = false;
|
|
@@ -225,4 +225,4 @@ async function runCli(options) {
|
|
|
225
225
|
export {
|
|
226
226
|
runCli
|
|
227
227
|
};
|
|
228
|
-
//# sourceMappingURL=chunk-
|
|
228
|
+
//# sourceMappingURL=chunk-55L4SHCO.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
gitSpawnEnv
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-J7GAZGZT.js";
|
|
4
4
|
import {
|
|
5
5
|
logger
|
|
6
6
|
} from "./chunk-K44MW7JJ.js";
|
|
@@ -129,8 +129,11 @@ async function getDefaultBranch(projectDir) {
|
|
|
129
129
|
const branch = originHead.trim().replace("refs/remotes/origin/", "");
|
|
130
130
|
if (branch) return branch;
|
|
131
131
|
}
|
|
132
|
-
const
|
|
133
|
-
if (
|
|
132
|
+
const remoteHead = await captureStdout(projectDir, ["ls-remote", "--symref", "origin", "HEAD"]);
|
|
133
|
+
if (remoteHead) {
|
|
134
|
+
const match = remoteHead.match(/^ref: refs\/heads\/(\S+)\tHEAD$/m);
|
|
135
|
+
if (match?.[1]) return match[1];
|
|
136
|
+
}
|
|
134
137
|
return "main";
|
|
135
138
|
}
|
|
136
139
|
async function resolveAndValidateSourceBranch(cwd, sourceBranch, projectDir) {
|
|
@@ -256,6 +259,16 @@ async function deleteWorkspace(projectName, name, projectDir) {
|
|
|
256
259
|
}
|
|
257
260
|
logger.info("Deleted workspace", { projectName, name, path: wsPath });
|
|
258
261
|
}
|
|
262
|
+
async function isGitRepository(cwd) {
|
|
263
|
+
const { stat } = await import("fs/promises");
|
|
264
|
+
try {
|
|
265
|
+
const st = await stat(join2(cwd, ".git"));
|
|
266
|
+
if (st.isDirectory()) return true;
|
|
267
|
+
} catch {
|
|
268
|
+
}
|
|
269
|
+
const result = await captureStdout(cwd, ["rev-parse", "--git-dir"]);
|
|
270
|
+
return result !== null;
|
|
271
|
+
}
|
|
259
272
|
async function statSafe(p) {
|
|
260
273
|
try {
|
|
261
274
|
const { stat } = await import("fs/promises");
|
|
@@ -286,6 +299,7 @@ export {
|
|
|
286
299
|
workspaceExists,
|
|
287
300
|
listWorkspaces,
|
|
288
301
|
ensureWorkspace,
|
|
289
|
-
deleteWorkspace
|
|
302
|
+
deleteWorkspace,
|
|
303
|
+
isGitRepository
|
|
290
304
|
};
|
|
291
|
-
//# sourceMappingURL=chunk-
|
|
305
|
+
//# sourceMappingURL=chunk-7PZBCATU.js.map
|
|
@@ -17,8 +17,9 @@ import {
|
|
|
17
17
|
} from "./chunk-VPFUXGMM.js";
|
|
18
18
|
import {
|
|
19
19
|
getGitBranch,
|
|
20
|
+
isGitRepository,
|
|
20
21
|
listWorkspaces
|
|
21
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-7PZBCATU.js";
|
|
22
23
|
import {
|
|
23
24
|
PathAccessDeniedError,
|
|
24
25
|
extractAbsolutePathsFromCommand,
|
|
@@ -114,7 +115,7 @@ import { extname, join } from "path";
|
|
|
114
115
|
|
|
115
116
|
// src/server/tools/tool-helpers.ts
|
|
116
117
|
import { randomUUID } from "crypto";
|
|
117
|
-
import { resolve
|
|
118
|
+
import { resolve } from "path";
|
|
118
119
|
var confirmationSeqCounter = 0;
|
|
119
120
|
async function requestUserConfirmation(context, toolLabel, desc) {
|
|
120
121
|
if (context.dangerLevel === "dangerous") return Promise.resolve(true);
|
|
@@ -199,7 +200,7 @@ function createTool(name, definition, handler2) {
|
|
|
199
200
|
async execute(args, context) {
|
|
200
201
|
const startTime = Date.now();
|
|
201
202
|
const helpers = {
|
|
202
|
-
resolvePath: (path) =>
|
|
203
|
+
resolvePath: (path) => resolve(context.workdir, path),
|
|
203
204
|
checkPathAccess: async (paths, command) => {
|
|
204
205
|
if (context.onEvent) {
|
|
205
206
|
await requestPathAccess(
|
|
@@ -1031,7 +1032,7 @@ Make sure whitespace and indentation match exactly.`
|
|
|
1031
1032
|
|
|
1032
1033
|
// src/server/tools/shell.ts
|
|
1033
1034
|
import { spawn } from "child_process";
|
|
1034
|
-
import { resolve as resolve3, isAbsolute
|
|
1035
|
+
import { resolve as resolve3, isAbsolute } from "path";
|
|
1035
1036
|
import { access } from "fs/promises";
|
|
1036
1037
|
import stripAnsi from "strip-ansi";
|
|
1037
1038
|
|
|
@@ -1143,12 +1144,12 @@ var runCommandTool = createTool(
|
|
|
1143
1144
|
const pathsToCheck = [workingDir];
|
|
1144
1145
|
const commandPaths = extractAbsolutePathsFromCommand(args.command);
|
|
1145
1146
|
for (const cmdPath of commandPaths) {
|
|
1146
|
-
const resolved =
|
|
1147
|
+
const resolved = isAbsolute(cmdPath) ? cmdPath : resolve3(workingDir, cmdPath);
|
|
1147
1148
|
pathsToCheck.push(resolved);
|
|
1148
1149
|
}
|
|
1149
1150
|
const sensitivePaths = extractSensitivePathsFromCommand(args.command);
|
|
1150
1151
|
for (const sensitivePath of sensitivePaths) {
|
|
1151
|
-
const resolved =
|
|
1152
|
+
const resolved = isAbsolute(sensitivePath) ? sensitivePath : resolve3(workingDir, sensitivePath);
|
|
1152
1153
|
pathsToCheck.push(resolved);
|
|
1153
1154
|
}
|
|
1154
1155
|
await helpers.checkPathAccess(pathsToCheck, args.command);
|
|
@@ -1469,7 +1470,7 @@ ${Object.entries(schema.fields).map(([f, t]) => ` ${f}: ${t}`).join("\n")}`
|
|
|
1469
1470
|
|
|
1470
1471
|
// src/server/sub-agents/manager.ts
|
|
1471
1472
|
import { readFile as readFile8, access as access5 } from "fs/promises";
|
|
1472
|
-
import { join as join6, dirname as dirname5, isAbsolute as
|
|
1473
|
+
import { join as join6, dirname as dirname5, isAbsolute as isAbsolute2 } from "path";
|
|
1473
1474
|
|
|
1474
1475
|
// src/server/agents/registry.ts
|
|
1475
1476
|
import { readdir as readdir3, readFile as readFile5, writeFile as writeFile4, mkdir as mkdir3, access as access3, unlink as unlink2 } from "fs/promises";
|
|
@@ -3307,7 +3308,7 @@ function getWindowOptions(sessionId) {
|
|
|
3307
3308
|
return id ? { contextWindowId: id } : void 0;
|
|
3308
3309
|
}
|
|
3309
3310
|
async function loadGitIgnoreRules(workdir) {
|
|
3310
|
-
if (!
|
|
3311
|
+
if (!isAbsolute2(workdir)) return "";
|
|
3311
3312
|
let currentDir = workdir;
|
|
3312
3313
|
while (true) {
|
|
3313
3314
|
const gitignorePath = join6(currentDir, ".gitignore");
|
|
@@ -3515,7 +3516,7 @@ var callSubAgentTool = {
|
|
|
3515
3516
|
};
|
|
3516
3517
|
}
|
|
3517
3518
|
try {
|
|
3518
|
-
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-
|
|
3519
|
+
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-6NVILBHW.js");
|
|
3519
3520
|
const toolRegistry = getToolRegistryForAgent2(agentDef);
|
|
3520
3521
|
const turnMetrics = new TurnMetrics();
|
|
3521
3522
|
const result = await executeSubAgent({
|
|
@@ -4518,7 +4519,7 @@ var mcpConfigTool = createTool(
|
|
|
4518
4519
|
mcpNotifyChanged?.(sessionId);
|
|
4519
4520
|
}
|
|
4520
4521
|
async function rebuildTools() {
|
|
4521
|
-
const { setMcpTools: setMcpTools2 } = await import("./tools-
|
|
4522
|
+
const { setMcpTools: setMcpTools2 } = await import("./tools-6NVILBHW.js");
|
|
4522
4523
|
const mcpTools = createMcpTools(mcpManagerForTools);
|
|
4523
4524
|
setMcpTools2(mcpTools);
|
|
4524
4525
|
}
|
|
@@ -4834,6 +4835,9 @@ var workspaceTool = createTool(
|
|
|
4834
4835
|
if (!args.target || typeof args.target !== "string") {
|
|
4835
4836
|
return helpers.error('Parameter "target" is required for action=switch ("original" or a workspace name)');
|
|
4836
4837
|
}
|
|
4838
|
+
if (await isGitRepository(context.workdir) === false) {
|
|
4839
|
+
return helpers.error("Project is not a git repository");
|
|
4840
|
+
}
|
|
4837
4841
|
const currentSession = sessionManager.getSession(sessionId);
|
|
4838
4842
|
const isBranchChange = args.branch !== void 0 && currentSession != null && args.target !== "original" && currentSession.workspace?.split("/").pop() === args.target;
|
|
4839
4843
|
const label = args.target === "original" ? "original project" : `workspace "${args.target}"`;
|
|
@@ -4879,6 +4883,9 @@ var workspaceTool = createTool(
|
|
|
4879
4883
|
return helpers.error('Parameter "target" is required for action=delete (the workspace name)');
|
|
4880
4884
|
}
|
|
4881
4885
|
if (args.target === "original") return helpers.error("Cannot delete the original workspace");
|
|
4886
|
+
if (await isGitRepository(context.workdir) === false) {
|
|
4887
|
+
return helpers.error("Project is not a git repository");
|
|
4888
|
+
}
|
|
4882
4889
|
const approved = await requestUserConfirmation(context, "workspace", `Delete workspace "${args.target}"`);
|
|
4883
4890
|
if (!approved) return helpers.error(`User denied: delete workspace "${args.target}"`);
|
|
4884
4891
|
await sessionManager.deleteWorkspace(sessionId, args.target);
|
|
@@ -5181,4 +5188,4 @@ export {
|
|
|
5181
5188
|
getToolRegistryForAgent,
|
|
5182
5189
|
createToolRegistry
|
|
5183
5190
|
};
|
|
5184
|
-
//# sourceMappingURL=chunk-
|
|
5191
|
+
//# sourceMappingURL=chunk-CKWD5V4W.js.map
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
loadAllAgentsDefault,
|
|
10
10
|
processEventsForConversation,
|
|
11
11
|
runTopLevelAgentLoop
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-CKWD5V4W.js";
|
|
13
13
|
import {
|
|
14
14
|
PathAccessDeniedError
|
|
15
15
|
} from "./chunk-3D3N2PXI.js";
|
|
@@ -66,7 +66,7 @@ function resolveAgentDef(sessionManager, sessionId) {
|
|
|
66
66
|
}
|
|
67
67
|
async function buildCachedPrompt(sessionManager, sessionId, agentDef) {
|
|
68
68
|
const { instructionContent, skills } = await loadSessionContext(sessionManager, sessionId);
|
|
69
|
-
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-
|
|
69
|
+
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-6NVILBHW.js");
|
|
70
70
|
const tools = getToolRegistryForAgent2(agentDef).definitions;
|
|
71
71
|
const toolFingerprint = getToolFingerprint(tools);
|
|
72
72
|
const allAgents = await loadAllAgentsDefault();
|
|
@@ -79,7 +79,7 @@ async function buildCachedPrompt(sessionManager, sessionId, agentDef) {
|
|
|
79
79
|
async function computeSessionHash(sessionManager, sessionId) {
|
|
80
80
|
const { instructionContent, skills } = await loadSessionContext(sessionManager, sessionId);
|
|
81
81
|
const agentDef = await resolveAgentDef(sessionManager, sessionId);
|
|
82
|
-
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-
|
|
82
|
+
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-6NVILBHW.js");
|
|
83
83
|
const tools = getToolRegistryForAgent2(agentDef).definitions;
|
|
84
84
|
const toolFingerprint = getToolFingerprint(tools);
|
|
85
85
|
return computeDynamicContextHash(instructionContent, skills, toolFingerprint);
|
|
@@ -359,4 +359,4 @@ export {
|
|
|
359
359
|
runChatTurn,
|
|
360
360
|
runAgentTurn
|
|
361
361
|
};
|
|
362
|
-
//# sourceMappingURL=chunk-
|
|
362
|
+
//# sourceMappingURL=chunk-G4PVYDVM.js.map
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
tokenFromPassword,
|
|
22
22
|
verifyPassword,
|
|
23
23
|
workflowExists
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-XIVQNOXU.js";
|
|
25
25
|
import {
|
|
26
26
|
agentExists,
|
|
27
27
|
createToolRegistry,
|
|
@@ -66,7 +66,7 @@ import {
|
|
|
66
66
|
setSkillEnabled,
|
|
67
67
|
skillExists,
|
|
68
68
|
updateOwnedSkill
|
|
69
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-CKWD5V4W.js";
|
|
70
70
|
import {
|
|
71
71
|
createMcpTools
|
|
72
72
|
} from "./chunk-NWO6GRYE.js";
|
|
@@ -85,7 +85,7 @@ import {
|
|
|
85
85
|
validateRef,
|
|
86
86
|
validateWorkspaceName,
|
|
87
87
|
workspaceExists
|
|
88
|
-
} from "./chunk-
|
|
88
|
+
} from "./chunk-7PZBCATU.js";
|
|
89
89
|
import {
|
|
90
90
|
createContextStateMessage
|
|
91
91
|
} from "./chunk-SJTG56CH.js";
|
|
@@ -106,7 +106,7 @@ import {
|
|
|
106
106
|
} from "./chunk-6AE3JPDJ.js";
|
|
107
107
|
import {
|
|
108
108
|
VERSION
|
|
109
|
-
} from "./chunk-
|
|
109
|
+
} from "./chunk-YWBJRUDI.js";
|
|
110
110
|
import {
|
|
111
111
|
emitAssistantMessageStart,
|
|
112
112
|
emitContextState,
|
|
@@ -5396,7 +5396,7 @@ async function createServerHandle(config3) {
|
|
|
5396
5396
|
setMcpTools(mcpTools);
|
|
5397
5397
|
logger.info("MCP tools registered", { count: mcpTools.length });
|
|
5398
5398
|
}
|
|
5399
|
-
const { signalMcpReady } = await import("./server-
|
|
5399
|
+
const { signalMcpReady } = await import("./server-ZU3IU7WH.js");
|
|
5400
5400
|
signalMcpReady();
|
|
5401
5401
|
});
|
|
5402
5402
|
const app = express();
|
|
@@ -5557,7 +5557,7 @@ async function createServerHandle(config3) {
|
|
|
5557
5557
|
const { getProject: getProject2 } = await import("./projects-ZGJGICGT.js");
|
|
5558
5558
|
const project = getProject2(req.params.id);
|
|
5559
5559
|
if (!project) return res.status(404).json({ error: "Project not found" });
|
|
5560
|
-
const { listBranches } = await import("./workspace-
|
|
5560
|
+
const { listBranches } = await import("./workspace-MMV6V5P4.js");
|
|
5561
5561
|
const branches = await listBranches(project.workdir);
|
|
5562
5562
|
res.json({ branches });
|
|
5563
5563
|
});
|
|
@@ -5567,7 +5567,10 @@ async function createServerHandle(config3) {
|
|
|
5567
5567
|
if (!project) return res.status(404).json({ error: "Project not found" });
|
|
5568
5568
|
const { branch } = req.body;
|
|
5569
5569
|
if (!branch || typeof branch !== "string") return res.status(400).json({ error: "branch is required" });
|
|
5570
|
-
const { checkoutBranch } = await import("./workspace-
|
|
5570
|
+
const { checkoutBranch, isGitRepository } = await import("./workspace-MMV6V5P4.js");
|
|
5571
|
+
if (!await isGitRepository(project.workdir)) {
|
|
5572
|
+
return res.status(400).json({ error: "Project is not a git repository" });
|
|
5573
|
+
}
|
|
5571
5574
|
try {
|
|
5572
5575
|
await checkoutBranch(project.workdir, branch);
|
|
5573
5576
|
const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-SFG42M4W.js");
|
|
@@ -5589,12 +5592,21 @@ async function createServerHandle(config3) {
|
|
|
5589
5592
|
if (!project) return res.status(404).json({ error: "Project not found" });
|
|
5590
5593
|
const { name, sourceBranch } = req.body;
|
|
5591
5594
|
if (!name || typeof name !== "string") return res.status(400).json({ error: "name is required" });
|
|
5592
|
-
const { createBranch, resolveAndValidateSourceBranch: resolveAndValidateSourceBranch2, validateRef: validateRef2 } = await import("./workspace-
|
|
5595
|
+
const { createBranch, resolveAndValidateSourceBranch: resolveAndValidateSourceBranch2, validateRef: validateRef2, getDefaultBranch: getDefaultBranch2, isGitRepository } = await import("./workspace-MMV6V5P4.js");
|
|
5596
|
+
if (!await isGitRepository(project.workdir)) {
|
|
5597
|
+
return res.status(400).json({ error: "Project is not a git repository" });
|
|
5598
|
+
}
|
|
5593
5599
|
try {
|
|
5594
5600
|
await validateRef2(project.workdir, name);
|
|
5595
5601
|
let sb;
|
|
5596
5602
|
if (sourceBranch) {
|
|
5597
5603
|
sb = await resolveAndValidateSourceBranch2(project.workdir, sourceBranch, project.workdir);
|
|
5604
|
+
} else {
|
|
5605
|
+
sb = await resolveAndValidateSourceBranch2(
|
|
5606
|
+
project.workdir,
|
|
5607
|
+
await getDefaultBranch2(project.workdir),
|
|
5608
|
+
project.workdir
|
|
5609
|
+
);
|
|
5598
5610
|
}
|
|
5599
5611
|
await createBranch(project.workdir, name, sb);
|
|
5600
5612
|
const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-SFG42M4W.js");
|
|
@@ -5614,7 +5626,7 @@ async function createServerHandle(config3) {
|
|
|
5614
5626
|
const session = sessionManager.getSession(req.params.id);
|
|
5615
5627
|
if (!session) return res.status(404).json({ error: "Session not found" });
|
|
5616
5628
|
const effectiveWorkdir = sessionManager.getEffectiveWorkdir(req.params.id);
|
|
5617
|
-
const { listBranches, getDefaultBranch: getDefaultBranch2 } = await import("./workspace-
|
|
5629
|
+
const { listBranches, getDefaultBranch: getDefaultBranch2 } = await import("./workspace-MMV6V5P4.js");
|
|
5618
5630
|
const [branches, defaultBranch] = await Promise.all([
|
|
5619
5631
|
listBranches(effectiveWorkdir),
|
|
5620
5632
|
getDefaultBranch2(session.workdir)
|
|
@@ -5628,7 +5640,7 @@ async function createServerHandle(config3) {
|
|
|
5628
5640
|
const { branch } = req.body;
|
|
5629
5641
|
if (!branch || typeof branch !== "string") return res.status(400).json({ error: "branch is required" });
|
|
5630
5642
|
const effectiveWorkdir = sessionManager.getEffectiveWorkdir(req.params.id);
|
|
5631
|
-
const { checkoutBranch, validateRef: validateRef2 } = await import("./workspace-
|
|
5643
|
+
const { checkoutBranch, validateRef: validateRef2 } = await import("./workspace-MMV6V5P4.js");
|
|
5632
5644
|
const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-SFG42M4W.js");
|
|
5633
5645
|
try {
|
|
5634
5646
|
await validateRef2(effectiveWorkdir, branch);
|
|
@@ -5671,17 +5683,19 @@ All file and git operations should use this branch.
|
|
|
5671
5683
|
const { name, sourceBranch } = req.body;
|
|
5672
5684
|
if (!name || typeof name !== "string") return res.status(400).json({ error: "name is required" });
|
|
5673
5685
|
const effectiveWorkdir = sessionManager.getEffectiveWorkdir(req.params.id);
|
|
5674
|
-
const { validateRef: validateRef2 } = await import("./workspace-
|
|
5686
|
+
const { validateRef: validateRef2 } = await import("./workspace-MMV6V5P4.js");
|
|
5675
5687
|
const { updateSessionBranch: updateSessionBranch2 } = await import("./sessions-SFG42M4W.js");
|
|
5676
5688
|
try {
|
|
5677
5689
|
await validateRef2(effectiveWorkdir, name);
|
|
5678
5690
|
if (sourceBranch) {
|
|
5679
|
-
const { resolveAndValidateSourceBranch: resolveAndValidateSourceBranch2, createBranch } = await import("./workspace-
|
|
5691
|
+
const { resolveAndValidateSourceBranch: resolveAndValidateSourceBranch2, createBranch } = await import("./workspace-MMV6V5P4.js");
|
|
5680
5692
|
const sb = await resolveAndValidateSourceBranch2(effectiveWorkdir, sourceBranch, session.workdir);
|
|
5681
5693
|
await createBranch(effectiveWorkdir, name, sb);
|
|
5682
5694
|
} else {
|
|
5683
|
-
const { createBranch } = await import("./workspace-
|
|
5684
|
-
await
|
|
5695
|
+
const { createBranch, getDefaultBranch: getDefaultBranch2, resolveAndValidateSourceBranch: resolveAndValidateSourceBranch2 } = await import("./workspace-MMV6V5P4.js");
|
|
5696
|
+
const defaultBranch = await getDefaultBranch2(session.workdir);
|
|
5697
|
+
const sb = await resolveAndValidateSourceBranch2(effectiveWorkdir, defaultBranch, session.workdir);
|
|
5698
|
+
await createBranch(effectiveWorkdir, name, sb);
|
|
5685
5699
|
}
|
|
5686
5700
|
updateSessionBranch2(req.params.id, name);
|
|
5687
5701
|
if (session.workspace) {
|
|
@@ -5719,7 +5733,7 @@ All file and git operations should use this branch.
|
|
|
5719
5733
|
const { getProject: getProject2 } = await import("./projects-ZGJGICGT.js");
|
|
5720
5734
|
const project = getProject2(req.params.id);
|
|
5721
5735
|
if (!project) return res.status(404).json({ error: "Project not found" });
|
|
5722
|
-
const { listWorkspaces } = await import("./workspace-
|
|
5736
|
+
const { listWorkspaces } = await import("./workspace-MMV6V5P4.js");
|
|
5723
5737
|
const all = await listWorkspaces(project.name, project.workdir);
|
|
5724
5738
|
const workspacesList = all.filter((ws) => ws.path !== project.workdir);
|
|
5725
5739
|
res.json({ workspaces: workspacesList });
|
|
@@ -5794,6 +5808,12 @@ All file and git operations should use this branch.
|
|
|
5794
5808
|
if (!session) return res.status(404).json({ error: "Session not found" });
|
|
5795
5809
|
const { target, branch, sourceBranch } = req.body;
|
|
5796
5810
|
if (!target || typeof target !== "string") return res.status(400).json({ error: "target is required" });
|
|
5811
|
+
const project = sessionManager.getProject(session.projectId);
|
|
5812
|
+
if (!project) return res.status(404).json({ error: "Project not found" });
|
|
5813
|
+
const { isGitRepository } = await import("./workspace-MMV6V5P4.js");
|
|
5814
|
+
if (!await isGitRepository(project.workdir)) {
|
|
5815
|
+
return res.status(400).json({ error: "Project is not a git repository" });
|
|
5816
|
+
}
|
|
5797
5817
|
try {
|
|
5798
5818
|
const updated = await sessionManager.switchWorkspace(req.params.id, target, branch, sourceBranch);
|
|
5799
5819
|
res.json({ session: updated });
|
|
@@ -5806,6 +5826,12 @@ All file and git operations should use this branch.
|
|
|
5806
5826
|
if (!session) return res.status(404).json({ error: "Session not found" });
|
|
5807
5827
|
const { target } = req.body;
|
|
5808
5828
|
if (!target || typeof target !== "string") return res.status(400).json({ error: "target is required" });
|
|
5829
|
+
const project = sessionManager.getProject(session.projectId);
|
|
5830
|
+
if (!project) return res.status(404).json({ error: "Project not found" });
|
|
5831
|
+
const { isGitRepository } = await import("./workspace-MMV6V5P4.js");
|
|
5832
|
+
if (!await isGitRepository(project.workdir)) {
|
|
5833
|
+
return res.status(400).json({ error: "Project is not a git repository" });
|
|
5834
|
+
}
|
|
5809
5835
|
try {
|
|
5810
5836
|
const updated = await sessionManager.deleteWorkspace(req.params.id, target);
|
|
5811
5837
|
res.json({ session: updated });
|
|
@@ -5816,7 +5842,7 @@ All file and git operations should use this branch.
|
|
|
5816
5842
|
app.get("/api/sessions/:id", async (req, res) => {
|
|
5817
5843
|
const { getEventStore: getEventStore2, combineEventsWithSnapshot } = await import("./events-GF2WNELM.js");
|
|
5818
5844
|
const { buildMessagesFromStoredEvents, foldPendingConfirmations } = await import("./folding-UACKBHUZ.js");
|
|
5819
|
-
const { getPendingQuestionsForSession } = await import("./tools-
|
|
5845
|
+
const { getPendingQuestionsForSession } = await import("./tools-6NVILBHW.js");
|
|
5820
5846
|
const { getMaxVisibleItems } = await import("./settings-6TJIHDVX.js");
|
|
5821
5847
|
const session = sessionManager.getSession(req.params.id);
|
|
5822
5848
|
if (!session) {
|
|
@@ -5847,8 +5873,8 @@ All file and git operations should use this branch.
|
|
|
5847
5873
|
if (!session) {
|
|
5848
5874
|
return res.status(404).json({ error: "Session not found" });
|
|
5849
5875
|
}
|
|
5850
|
-
const { stopSessionExecution } = await import("./chat-handler-
|
|
5851
|
-
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-
|
|
5876
|
+
const { stopSessionExecution } = await import("./chat-handler-377ZHEDW.js");
|
|
5877
|
+
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-6NVILBHW.js");
|
|
5852
5878
|
sessionManager.clearMessageQueue(sessionId);
|
|
5853
5879
|
stopSessionExecution(sessionId, sessionManager);
|
|
5854
5880
|
abortSession(sessionId);
|
|
@@ -6055,7 +6081,7 @@ All file and git operations should use this branch.
|
|
|
6055
6081
|
if (alwaysAllow !== void 0 && typeof alwaysAllow !== "boolean") {
|
|
6056
6082
|
return res.status(400).json({ error: "alwaysAllow must be a boolean if provided" });
|
|
6057
6083
|
}
|
|
6058
|
-
const { providePathConfirmation, getConfirmationSessionId } = await import("./tools-
|
|
6084
|
+
const { providePathConfirmation, getConfirmationSessionId } = await import("./tools-6NVILBHW.js");
|
|
6059
6085
|
const pendingSessionId = getConfirmationSessionId(callId);
|
|
6060
6086
|
if (!pendingSessionId) {
|
|
6061
6087
|
return res.status(404).json({ error: "No pending path confirmation with that ID" });
|
|
@@ -6070,7 +6096,7 @@ All file and git operations should use this branch.
|
|
|
6070
6096
|
const { getEventStore: getEventStore2, combineEventsWithSnapshot: combineEvents } = await import("./events-GF2WNELM.js");
|
|
6071
6097
|
const { buildMessagesFromStoredEvents, foldPendingConfirmations } = await import("./folding-UACKBHUZ.js");
|
|
6072
6098
|
const { createSessionStateMessage } = await import("./protocol-Q7X4NEME.js");
|
|
6073
|
-
const { getPendingQuestionsForSession } = await import("./tools-
|
|
6099
|
+
const { getPendingQuestionsForSession } = await import("./tools-6NVILBHW.js");
|
|
6074
6100
|
const { getMaxVisibleItems } = await import("./settings-6TJIHDVX.js");
|
|
6075
6101
|
const eventStore = getEventStore2();
|
|
6076
6102
|
const { snapshot, events: eventsSinceSnapshot } = eventStore.getEventsSinceSnapshot(sessionId);
|
|
@@ -6107,7 +6133,7 @@ All file and git operations should use this branch.
|
|
|
6107
6133
|
if (!skip && typeof answer !== "string") {
|
|
6108
6134
|
return res.status(400).json({ error: "answer is required when not skipping" });
|
|
6109
6135
|
}
|
|
6110
|
-
const { provideAnswer } = await import("./tools-
|
|
6136
|
+
const { provideAnswer } = await import("./tools-6NVILBHW.js");
|
|
6111
6137
|
const found = provideAnswer(callId, answer ?? "", skip ?? false);
|
|
6112
6138
|
if (!found) {
|
|
6113
6139
|
return res.status(404).json({ error: "No pending question with that ID" });
|
|
@@ -6167,7 +6193,7 @@ All file and git operations should use this branch.
|
|
|
6167
6193
|
backend: activeProvider?.backend ?? llmClient.getBackend(),
|
|
6168
6194
|
model: llmClient.getModel()
|
|
6169
6195
|
};
|
|
6170
|
-
const { runAgentTurn, TurnMetrics } = await import("./orchestrator-
|
|
6196
|
+
const { runAgentTurn, TurnMetrics } = await import("./orchestrator-LRKFV4MN.js");
|
|
6171
6197
|
runAgentTurn(
|
|
6172
6198
|
{
|
|
6173
6199
|
sessionManager,
|
|
@@ -6205,8 +6231,8 @@ All file and git operations should use this branch.
|
|
|
6205
6231
|
if (!session) {
|
|
6206
6232
|
return res.status(404).json({ error: "Session not found" });
|
|
6207
6233
|
}
|
|
6208
|
-
const { stopSessionExecution } = await import("./chat-handler-
|
|
6209
|
-
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-
|
|
6234
|
+
const { stopSessionExecution } = await import("./chat-handler-377ZHEDW.js");
|
|
6235
|
+
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-6NVILBHW.js");
|
|
6210
6236
|
const queuedMessages = sessionManager.getQueueState(sessionId);
|
|
6211
6237
|
sessionManager.clearMessageQueue(sessionId);
|
|
6212
6238
|
stopSessionExecution(sessionId, sessionManager);
|
|
@@ -6856,7 +6882,7 @@ All file and git operations should use this branch.
|
|
|
6856
6882
|
});
|
|
6857
6883
|
async function rebuildMcpTools() {
|
|
6858
6884
|
const { createMcpTools: createMcpTools2 } = await import("./tool-adapter-MOGEI6TP.js");
|
|
6859
|
-
const { setMcpTools: setMcpTools2 } = await import("./tools-
|
|
6885
|
+
const { setMcpTools: setMcpTools2 } = await import("./tools-6NVILBHW.js");
|
|
6860
6886
|
const mcpTools = createMcpTools2(mcpManager);
|
|
6861
6887
|
setMcpTools2(mcpTools);
|
|
6862
6888
|
}
|
|
@@ -7123,7 +7149,7 @@ All file and git operations should use this branch.
|
|
|
7123
7149
|
res.status(500).json({ error: err instanceof Error ? err.message : "Failed to stop process" });
|
|
7124
7150
|
}
|
|
7125
7151
|
});
|
|
7126
|
-
const { getCurrentBranch } = await import("./branch.api-
|
|
7152
|
+
const { getCurrentBranch } = await import("./branch.api-XVTYACSH.js");
|
|
7127
7153
|
app.get("/api/branch", async (req, res) => {
|
|
7128
7154
|
await getCurrentBranch(req, res);
|
|
7129
7155
|
});
|
|
@@ -7252,7 +7278,7 @@ All file and git operations should use this branch.
|
|
|
7252
7278
|
const state = sessionManager.getContextState(sessionId);
|
|
7253
7279
|
wssExports.broadcastForSession(sessionId, createContextStateMessage(state));
|
|
7254
7280
|
});
|
|
7255
|
-
const { QueueProcessor } = await import("./processor-
|
|
7281
|
+
const { QueueProcessor } = await import("./processor-LXVRVPBN.js");
|
|
7256
7282
|
const queueProcessor = new QueueProcessor({
|
|
7257
7283
|
sessionManager,
|
|
7258
7284
|
providerManager,
|
|
@@ -7332,4 +7358,4 @@ export {
|
|
|
7332
7358
|
createServerHandle,
|
|
7333
7359
|
createServer
|
|
7334
7360
|
};
|
|
7335
|
-
//# sourceMappingURL=chunk-
|
|
7361
|
+
//# sourceMappingURL=chunk-J5E6ZE7O.js.map
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// src/server/git/env.ts
|
|
2
|
+
var GIT_ENV_VARS = [
|
|
3
|
+
"GIT_DIR",
|
|
4
|
+
"GIT_INDEX_FILE",
|
|
5
|
+
"GIT_WORK_TREE",
|
|
6
|
+
"GIT_PREFIX",
|
|
7
|
+
"GIT_OBJECT_DIRECTORY",
|
|
8
|
+
"GIT_ALTERNATE_OBJECT_DIRECTORIES",
|
|
9
|
+
"GIT_COMMON_DIR",
|
|
10
|
+
"GIT_CEILING_DIRECTORIES",
|
|
11
|
+
"GIT_DISCOVERY_ACROSS_FILESYSTEM",
|
|
12
|
+
"GIT_NAMESPACE",
|
|
13
|
+
"GIT_SHALLOW_FILE",
|
|
14
|
+
"GIT_CONFIG_SYSTEM",
|
|
15
|
+
"GIT_CONFIG_GLOBAL",
|
|
16
|
+
"GIT_CONFIG_NOSYSTEM",
|
|
17
|
+
"GIT_CONFIG_COUNT",
|
|
18
|
+
"GIT_SSH",
|
|
19
|
+
"GIT_SSH_COMMAND",
|
|
20
|
+
"GIT_SSL_NO_VERIFY",
|
|
21
|
+
"GIT_TERMINAL_PROMPT",
|
|
22
|
+
"GIT_PROTOCOL_FROM_USER",
|
|
23
|
+
"GIT_ALLOW_PROTOCOL",
|
|
24
|
+
"GIT_LITERAL_PATHSPECS",
|
|
25
|
+
"GIT_GLOB_PATHSPECS",
|
|
26
|
+
"GIT_NOGLOB_PATHSPECS",
|
|
27
|
+
"GIT_ICASE_PATHSPECS",
|
|
28
|
+
"GIT_FLUSH",
|
|
29
|
+
"GIT_REFLOG_ACTION",
|
|
30
|
+
"GIT_SEQUENCE_EDITOR",
|
|
31
|
+
"GIT_EDITOR",
|
|
32
|
+
"GIT_PAGER",
|
|
33
|
+
"GIT_EXTERNAL_DIFF",
|
|
34
|
+
"GIT_DIFF_OPTS",
|
|
35
|
+
"GIT_NOTES_REF",
|
|
36
|
+
"GIT_NOTES_DISPLAY_REF",
|
|
37
|
+
"GIT_NOTES_REWRITE_MODE",
|
|
38
|
+
"GIT_NOTES_REWRITE_REF",
|
|
39
|
+
"GIT_MERGE_AUTOEDIT"
|
|
40
|
+
];
|
|
41
|
+
function gitSpawnEnv() {
|
|
42
|
+
const env = { ...process.env };
|
|
43
|
+
for (const key of GIT_ENV_VARS) {
|
|
44
|
+
delete env[key];
|
|
45
|
+
}
|
|
46
|
+
for (const key of Object.keys(env)) {
|
|
47
|
+
if (/^GIT_CONFIG_(KEY|VALUE)_\d+$/.test(key)) {
|
|
48
|
+
delete env[key];
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return env;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export {
|
|
55
|
+
gitSpawnEnv
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=chunk-J7GAZGZT.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
computeSessionHash,
|
|
4
4
|
runAgentTurn,
|
|
5
5
|
runChatTurn
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-G4PVYDVM.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-CKWD5V4W.js";
|
|
17
17
|
import {
|
|
18
18
|
checkAborted,
|
|
19
19
|
onProcessEvent,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
} from "./chunk-JKZPMRH2.js";
|
|
22
22
|
import {
|
|
23
23
|
gitSpawnEnv
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-J7GAZGZT.js";
|
|
25
25
|
import {
|
|
26
26
|
createChatErrorMessage,
|
|
27
27
|
createChatMessageMessage,
|
|
@@ -2217,4 +2217,4 @@ export {
|
|
|
2217
2217
|
signalMcpReady,
|
|
2218
2218
|
createWebSocketServer
|
|
2219
2219
|
};
|
|
2220
|
-
//# sourceMappingURL=chunk-
|
|
2220
|
+
//# sourceMappingURL=chunk-XIVQNOXU.js.map
|
package/dist/cli/dev.js
CHANGED
package/dist/cli/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runAgentTurn,
|
|
3
3
|
runChatTurn
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-G4PVYDVM.js";
|
|
5
|
+
import "./chunk-CKWD5V4W.js";
|
|
6
6
|
import "./chunk-JKZPMRH2.js";
|
|
7
7
|
import "./chunk-NWO6GRYE.js";
|
|
8
8
|
import "./chunk-VPFUXGMM.js";
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-7PZBCATU.js";
|
|
10
|
+
import "./chunk-J7GAZGZT.js";
|
|
11
11
|
import "./chunk-3D3N2PXI.js";
|
|
12
12
|
import "./chunk-SJTG56CH.js";
|
|
13
13
|
import "./chunk-EU3WWTFH.js";
|
|
@@ -47,4 +47,4 @@ export {
|
|
|
47
47
|
runAgentTurn,
|
|
48
48
|
runChatTurn
|
|
49
49
|
};
|
|
50
|
-
//# sourceMappingURL=orchestrator-
|
|
50
|
+
//# sourceMappingURL=orchestrator-LRKFV4MN.js.map
|