openfox 1.6.79 → 1.6.81
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/{auto-compaction-KTA6H4HP.js → auto-compaction-JSO3ZWSE.js} +4 -4
- package/dist/{chat-handler-EKAO6CIB.js → chat-handler-RN662HKM.js} +12 -9
- package/dist/{chunk-3JU4NOQD.js → chunk-2MHHSLNY.js} +135 -80
- package/dist/{chunk-UCZSBKG7.js → chunk-42TLGPX4.js} +43 -26
- package/dist/{chunk-HOD7GVQ5.js → chunk-6FOC2GAY.js} +2 -2
- package/dist/{chunk-2IZMUXMP.js → chunk-A5W6JUYZ.js} +3 -3
- package/dist/{chunk-RJRG2VER.js → chunk-LHKXWUEK.js} +7 -1
- package/dist/{chunk-BG7QCFGG.js → chunk-SJHWJAJA.js} +3 -3
- package/dist/{chunk-STYHKCG7.js → chunk-UF6D2IPO.js} +25 -1
- package/dist/cli/dev.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/{events-ND5GZBT2.js → events-QDUOJQML.js} +2 -2
- package/dist/{orchestrator-5U4O4K7V.js → orchestrator-NJHSRHZI.js} +5 -5
- package/dist/package.json +1 -1
- package/dist/permissions-Z2IIV2V7.js +109 -0
- package/dist/{processor-O35Q3EZT.js → processor-3A32D5MI.js} +23 -16
- package/dist/project-creator-GPOIXKX4.js +111 -0
- package/dist/{protocol-4CTV7OZC.js → protocol-IXFNYZEX.js} +2 -2
- package/dist/{serve-55GF3KJW.js → serve-D4NO4GJF.js} +6 -6
- package/dist/server/index.js +5 -5
- package/dist/{tools-W6OPDFQV.js → tools-Y3S6BHBZ.js} +4 -4
- package/dist/web/assets/{index-BJtUJYiT.js → index-DuIE79t4.js} +55 -53
- package/dist/web/index.html +1 -1
- package/dist/web/sw.js +1 -1
- package/package.json +1 -1
- package/dist/project-creator-VD7MLOWE.js +0 -65
|
@@ -452,6 +452,12 @@ var EventStore = class {
|
|
|
452
452
|
return transaction();
|
|
453
453
|
} catch (error) {
|
|
454
454
|
const err = error instanceof Error ? error : new Error(String(error));
|
|
455
|
+
const errnoError = error;
|
|
456
|
+
const isFkError = errnoError.code === "SQLITE_CONSTRAINT_FOREIGNKEY";
|
|
457
|
+
if (isFkError || err.message.includes("FOREIGN KEY constraint failed")) {
|
|
458
|
+
logger.debug("Session no longer exists during consolidation", { sessionId });
|
|
459
|
+
return null;
|
|
460
|
+
}
|
|
455
461
|
logger.error("Failed to consolidate session", { sessionId, error: err.message, stack: err.stack });
|
|
456
462
|
return null;
|
|
457
463
|
}
|
|
@@ -1252,4 +1258,4 @@ export {
|
|
|
1252
1258
|
compactContext,
|
|
1253
1259
|
getRecentUserPromptsForSession
|
|
1254
1260
|
};
|
|
1255
|
-
//# sourceMappingURL=chunk-
|
|
1261
|
+
//# sourceMappingURL=chunk-LHKXWUEK.js.map
|
|
@@ -13,11 +13,11 @@ import {
|
|
|
13
13
|
getToolRegistryForAgent,
|
|
14
14
|
loadAllAgentsDefault,
|
|
15
15
|
runTopLevelAgentLoop
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-42TLGPX4.js";
|
|
17
17
|
import {
|
|
18
18
|
getCurrentContextWindowId,
|
|
19
19
|
getEventStore
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-LHKXWUEK.js";
|
|
21
21
|
import {
|
|
22
22
|
buildSnapshotFromSessionState
|
|
23
23
|
} from "./chunk-TS5XFQ2D.js";
|
|
@@ -327,4 +327,4 @@ export {
|
|
|
327
327
|
runBuilderTurn,
|
|
328
328
|
runVerifierTurn
|
|
329
329
|
};
|
|
330
|
-
//# sourceMappingURL=chunk-
|
|
330
|
+
//# sourceMappingURL=chunk-SJHWJAJA.js.map
|
|
@@ -226,6 +226,30 @@ function storedEventToServerMessage(event) {
|
|
|
226
226
|
const data = event.data;
|
|
227
227
|
return createServerMessage("task.completed", data);
|
|
228
228
|
}
|
|
229
|
+
case "session.initialized": {
|
|
230
|
+
const data = event.data;
|
|
231
|
+
const session = {
|
|
232
|
+
id: event.sessionId,
|
|
233
|
+
projectId: data.projectId,
|
|
234
|
+
workdir: data.workdir,
|
|
235
|
+
mode: "planner",
|
|
236
|
+
phase: "plan",
|
|
237
|
+
isRunning: false,
|
|
238
|
+
criteria: [],
|
|
239
|
+
summary: data.title || "Untitled Session",
|
|
240
|
+
metadata: {
|
|
241
|
+
totalTokensUsed: 0,
|
|
242
|
+
totalToolCalls: 0,
|
|
243
|
+
iterationCount: 0
|
|
244
|
+
},
|
|
245
|
+
createdAt: new Date(event.timestamp).toISOString(),
|
|
246
|
+
updatedAt: new Date(event.timestamp).toISOString(),
|
|
247
|
+
messages: [],
|
|
248
|
+
contextWindows: [],
|
|
249
|
+
executionState: null
|
|
250
|
+
};
|
|
251
|
+
return createSessionStateMessage(session, [], []);
|
|
252
|
+
}
|
|
229
253
|
case "mode.changed": {
|
|
230
254
|
const data = event.data;
|
|
231
255
|
return createModeChangedMessage(data.mode, data.auto, data.reason);
|
|
@@ -319,4 +343,4 @@ export {
|
|
|
319
343
|
createQueueStateMessage,
|
|
320
344
|
storedEventToServerMessage
|
|
321
345
|
};
|
|
322
|
-
//# sourceMappingURL=chunk-
|
|
346
|
+
//# sourceMappingURL=chunk-UF6D2IPO.js.map
|
package/dist/cli/dev.js
CHANGED
package/dist/cli/index.js
CHANGED
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
isStoredEvent,
|
|
38
38
|
isTurnEvent,
|
|
39
39
|
truncateSessionMessages
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-LHKXWUEK.js";
|
|
41
41
|
import "./chunk-KIOUKC3Z.js";
|
|
42
42
|
import {
|
|
43
43
|
buildContextMessagesFromEventHistory,
|
|
@@ -113,4 +113,4 @@ export {
|
|
|
113
113
|
isTurnEvent,
|
|
114
114
|
truncateSessionMessages
|
|
115
115
|
};
|
|
116
|
-
//# sourceMappingURL=events-
|
|
116
|
+
//# sourceMappingURL=events-QDUOJQML.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
runBuilderTurn,
|
|
4
4
|
runChatTurn,
|
|
5
5
|
runVerifierTurn
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-SJHWJAJA.js";
|
|
7
7
|
import {
|
|
8
8
|
TurnMetrics,
|
|
9
9
|
createChatDoneEvent,
|
|
@@ -11,17 +11,17 @@ import {
|
|
|
11
11
|
createMessageStartEvent,
|
|
12
12
|
createToolCallEvent,
|
|
13
13
|
createToolResultEvent
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-42TLGPX4.js";
|
|
15
15
|
import "./chunk-OXI26S7U.js";
|
|
16
16
|
import "./chunk-CMQCO27Y.js";
|
|
17
17
|
import "./chunk-DL6ZILAF.js";
|
|
18
18
|
import "./chunk-PBGOZMVY.js";
|
|
19
19
|
import "./chunk-VRGRAQDG.js";
|
|
20
20
|
import "./chunk-CUDAT6SS.js";
|
|
21
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-LHKXWUEK.js";
|
|
22
22
|
import "./chunk-KIOUKC3Z.js";
|
|
23
23
|
import "./chunk-TS5XFQ2D.js";
|
|
24
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-UF6D2IPO.js";
|
|
25
25
|
import "./chunk-BJYPTN5S.js";
|
|
26
26
|
import "./chunk-NDJ6FKSP.js";
|
|
27
27
|
import "./chunk-CQGTEGKL.js";
|
|
@@ -40,4 +40,4 @@ export {
|
|
|
40
40
|
runChatTurn,
|
|
41
41
|
runVerifierTurn
|
|
42
42
|
};
|
|
43
|
-
//# sourceMappingURL=orchestrator-
|
|
43
|
+
//# sourceMappingURL=orchestrator-NJHSRHZI.js.map
|
package/dist/package.json
CHANGED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
// src/server/utils/permissions.ts
|
|
2
|
+
import { execSync } from "child_process";
|
|
3
|
+
import { resolve } from "path";
|
|
4
|
+
import { access, stat } from "fs/promises";
|
|
5
|
+
import { constants } from "fs";
|
|
6
|
+
function sanitizeShellArg(arg) {
|
|
7
|
+
if (!/^[a-zA-Z0-9._-]+$/.test(arg)) {
|
|
8
|
+
throw new Error(`Invalid argument: ${arg}`);
|
|
9
|
+
}
|
|
10
|
+
return arg;
|
|
11
|
+
}
|
|
12
|
+
async function getDirInfo(targetPath) {
|
|
13
|
+
const resolvedPath = resolve(targetPath);
|
|
14
|
+
try {
|
|
15
|
+
await access(resolvedPath, constants.F_OK);
|
|
16
|
+
} catch {
|
|
17
|
+
throw new Error("Path not found");
|
|
18
|
+
}
|
|
19
|
+
let sudoAvailable;
|
|
20
|
+
try {
|
|
21
|
+
execSync("sudo -n true", { stdio: "pipe" });
|
|
22
|
+
sudoAvailable = true;
|
|
23
|
+
} catch {
|
|
24
|
+
sudoAvailable = false;
|
|
25
|
+
}
|
|
26
|
+
const dirStat = await stat(resolvedPath);
|
|
27
|
+
const groupGid = dirStat.gid;
|
|
28
|
+
const currentUser = sanitizeShellArg(execSync("id -un", { encoding: "utf-8" }).trim());
|
|
29
|
+
const groupsOutput = execSync(`id -Gn ${currentUser}`, { encoding: "utf-8" }).trim();
|
|
30
|
+
const userGroups = groupsOutput.split(/\s+/);
|
|
31
|
+
let groupName = null;
|
|
32
|
+
try {
|
|
33
|
+
const rawGroupName = execSync(`getent group ${groupGid}`, { encoding: "utf-8" }).split(":")[0]?.trim();
|
|
34
|
+
groupName = rawGroupName ? sanitizeShellArg(rawGroupName) : null;
|
|
35
|
+
} catch {
|
|
36
|
+
}
|
|
37
|
+
const userInGroup = groupName ? userGroups.includes(groupName) : false;
|
|
38
|
+
const groupHasWrite = (dirStat.mode & 16) !== 0;
|
|
39
|
+
return { resolvedPath, groupGid, groupName, userGroups, userInGroup, groupHasWrite, sudoAvailable };
|
|
40
|
+
}
|
|
41
|
+
async function checkPermissions(targetPath) {
|
|
42
|
+
try {
|
|
43
|
+
const info = await getDirInfo(targetPath);
|
|
44
|
+
return {
|
|
45
|
+
success: true,
|
|
46
|
+
sudoAvailable: info.sudoAvailable,
|
|
47
|
+
userInGroup: info.userInGroup,
|
|
48
|
+
groupHasWrite: info.groupHasWrite,
|
|
49
|
+
groupName: info.groupName
|
|
50
|
+
};
|
|
51
|
+
} catch (err) {
|
|
52
|
+
const message = err instanceof Error ? err.message : "Unknown error";
|
|
53
|
+
if (message === "Path not found") {
|
|
54
|
+
return { success: false, error: message, status: 404 };
|
|
55
|
+
}
|
|
56
|
+
return { success: false, error: err instanceof Error ? err.message : "Unknown error", status: 500 };
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
async function fixPermissions(targetPath, action) {
|
|
60
|
+
try {
|
|
61
|
+
const info = await getDirInfo(targetPath);
|
|
62
|
+
if (action === "group") {
|
|
63
|
+
if (!info.userInGroup) {
|
|
64
|
+
return {
|
|
65
|
+
success: false,
|
|
66
|
+
sudoAvailable: info.sudoAvailable,
|
|
67
|
+
error: 'You are not in the group that owns this directory. Use "Join group & extend group permissions" instead.'
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
execSync(`sudo chmod g+w "${info.resolvedPath}"`, { stdio: "pipe" });
|
|
71
|
+
return { success: true, sudoAvailable: info.sudoAvailable, method: "group" };
|
|
72
|
+
}
|
|
73
|
+
if (action === "join_group") {
|
|
74
|
+
if (!info.groupName) {
|
|
75
|
+
return { success: false, sudoAvailable: info.sudoAvailable, error: "Could not determine group name" };
|
|
76
|
+
}
|
|
77
|
+
const currentUser = execSync("id -un", { encoding: "utf-8" }).trim();
|
|
78
|
+
execSync(`sudo usermod -aG ${sanitizeShellArg(info.groupName)} ${sanitizeShellArg(currentUser)}`, {
|
|
79
|
+
stdio: "pipe"
|
|
80
|
+
});
|
|
81
|
+
return { success: true, sudoAvailable: info.sudoAvailable, method: "join_group" };
|
|
82
|
+
}
|
|
83
|
+
if (action === "join_group_and_group") {
|
|
84
|
+
if (!info.groupName) {
|
|
85
|
+
return { success: false, sudoAvailable: info.sudoAvailable, error: "Could not determine group name" };
|
|
86
|
+
}
|
|
87
|
+
execSync(`sudo chmod g+w "${info.resolvedPath}"`, { stdio: "pipe" });
|
|
88
|
+
const currentUser = execSync("id -un", { encoding: "utf-8" }).trim();
|
|
89
|
+
execSync(`sudo usermod -aG ${sanitizeShellArg(info.groupName)} ${sanitizeShellArg(currentUser)}`, {
|
|
90
|
+
stdio: "pipe"
|
|
91
|
+
});
|
|
92
|
+
return { success: true, sudoAvailable: info.sudoAvailable, method: "join_group_and_group" };
|
|
93
|
+
}
|
|
94
|
+
const ownerUser = execSync("id -un", { encoding: "utf-8" }).trim();
|
|
95
|
+
execSync(`sudo chown -R ${sanitizeShellArg(ownerUser)} "${info.resolvedPath}"`, { stdio: "pipe" });
|
|
96
|
+
return { success: true, sudoAvailable: info.sudoAvailable, method: "ownership" };
|
|
97
|
+
} catch (err) {
|
|
98
|
+
const message = err instanceof Error ? err.message : "Unknown error";
|
|
99
|
+
if (message === "Path not found") {
|
|
100
|
+
return { success: false, sudoAvailable: true, error: message, status: 404 };
|
|
101
|
+
}
|
|
102
|
+
return { success: false, sudoAvailable: true, error: message };
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
export {
|
|
106
|
+
checkPermissions,
|
|
107
|
+
fixPermissions
|
|
108
|
+
};
|
|
109
|
+
//# sourceMappingURL=permissions-Z2IIV2V7.js.map
|
|
@@ -5,16 +5,16 @@ import {
|
|
|
5
5
|
generateSessionName,
|
|
6
6
|
getSessionMessageCount,
|
|
7
7
|
needsNameGenerationCheck
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-A5W6JUYZ.js";
|
|
9
9
|
import {
|
|
10
10
|
getEventStore
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-LHKXWUEK.js";
|
|
12
12
|
import "./chunk-KIOUKC3Z.js";
|
|
13
13
|
import "./chunk-TS5XFQ2D.js";
|
|
14
14
|
import {
|
|
15
15
|
createChatMessageMessage,
|
|
16
16
|
createSessionRunningMessage
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-UF6D2IPO.js";
|
|
18
18
|
import "./chunk-NDJ6FKSP.js";
|
|
19
19
|
import "./chunk-B5AP3RSV.js";
|
|
20
20
|
import {
|
|
@@ -177,7 +177,7 @@ var QueueProcessor = class {
|
|
|
177
177
|
backend: provider?.backend ?? llmClient.getBackend(),
|
|
178
178
|
model: llmClient.getModel()
|
|
179
179
|
};
|
|
180
|
-
const { runChatTurn } = await import("./orchestrator-
|
|
180
|
+
const { runChatTurn } = await import("./orchestrator-NJHSRHZI.js");
|
|
181
181
|
const runChatTurnParams = buildRunChatTurnParams({
|
|
182
182
|
sessionManager,
|
|
183
183
|
sessionId,
|
|
@@ -193,18 +193,25 @@ var QueueProcessor = class {
|
|
|
193
193
|
logger.error("QueueProcessor turn error", { sessionId, error });
|
|
194
194
|
}).finally(() => {
|
|
195
195
|
this.activeAgents.delete(sessionId);
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
196
|
+
try {
|
|
197
|
+
const session2 = sessionManager.getSession(sessionId);
|
|
198
|
+
if (!session2) {
|
|
199
|
+
sessionManager.setRunning(sessionId, false);
|
|
200
|
+
broadcastForSession(sessionId, createSessionRunningMessage(false));
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
const hasMore = sessionManager.hasQueuedMessages(sessionId);
|
|
204
|
+
if (!hasMore) {
|
|
205
|
+
finalizeTurnCompletion(sessionId, sessionManager, broadcastForSession);
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
this.startTurn(sessionId);
|
|
209
|
+
} catch (error) {
|
|
210
|
+
logger.error("Error in turn completion cleanup", {
|
|
211
|
+
sessionId,
|
|
212
|
+
error: error instanceof Error ? error.message : String(error)
|
|
213
|
+
});
|
|
206
214
|
}
|
|
207
|
-
this.startTurn(sessionId);
|
|
208
215
|
});
|
|
209
216
|
}
|
|
210
217
|
getSessionMessageCount(sessionId) {
|
|
@@ -214,4 +221,4 @@ var QueueProcessor = class {
|
|
|
214
221
|
export {
|
|
215
222
|
QueueProcessor
|
|
216
223
|
};
|
|
217
|
-
//# sourceMappingURL=processor-
|
|
224
|
+
//# sourceMappingURL=processor-3A32D5MI.js.map
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createProject
|
|
3
|
+
} from "./chunk-CMQCO27Y.js";
|
|
4
|
+
import "./chunk-KIOUKC3Z.js";
|
|
5
|
+
import "./chunk-K44MW7JJ.js";
|
|
6
|
+
|
|
7
|
+
// src/server/utils/project-creator.ts
|
|
8
|
+
import { execSync } from "child_process";
|
|
9
|
+
import { join } from "path";
|
|
10
|
+
function validateProjectName(name) {
|
|
11
|
+
if (!name || name.trim() === "") {
|
|
12
|
+
return { valid: false, error: "Project name cannot be empty" };
|
|
13
|
+
}
|
|
14
|
+
if (!/^[a-zA-Z0-9._ -]+$/.test(name)) {
|
|
15
|
+
return {
|
|
16
|
+
valid: false,
|
|
17
|
+
error: "Project name can only contain letters, numbers, hyphens, underscores, dots, and spaces"
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
if (name.includes("/") || name.includes("\\") || name.includes("..")) {
|
|
21
|
+
return { valid: false, error: "Project name cannot contain path separators" };
|
|
22
|
+
}
|
|
23
|
+
return { valid: true };
|
|
24
|
+
}
|
|
25
|
+
async function directoryExists(path) {
|
|
26
|
+
try {
|
|
27
|
+
const { access } = await import("fs/promises");
|
|
28
|
+
const { constants } = await import("fs");
|
|
29
|
+
await access(path, constants.F_OK);
|
|
30
|
+
return true;
|
|
31
|
+
} catch {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
async function createDirectoryWithGit(projectName, workdir) {
|
|
36
|
+
const validation = validateProjectName(projectName);
|
|
37
|
+
if (!validation.valid) {
|
|
38
|
+
throw new Error(validation.error);
|
|
39
|
+
}
|
|
40
|
+
const fullPath = workdir.replace(/\/+$/, "");
|
|
41
|
+
const { stat, mkdir, rm, access, constants } = await import("fs/promises");
|
|
42
|
+
const dirAlreadyExisted = await access(fullPath, constants.F_OK).then(() => true).catch(() => false);
|
|
43
|
+
try {
|
|
44
|
+
const stats = await stat(fullPath);
|
|
45
|
+
if (!stats.isDirectory()) {
|
|
46
|
+
throw new Error(`A file named '${projectName}' already exists at ${fullPath}`);
|
|
47
|
+
}
|
|
48
|
+
} catch (err) {
|
|
49
|
+
if (err instanceof Error && "code" in err && err.code === "ENOENT") {
|
|
50
|
+
try {
|
|
51
|
+
await mkdir(fullPath, { recursive: true });
|
|
52
|
+
} catch (mkdirErr) {
|
|
53
|
+
if (mkdirErr instanceof Error && "code" in mkdirErr && mkdirErr.code === "EACCES") {
|
|
54
|
+
const eaccError = mkdirErr;
|
|
55
|
+
const permError = new Error(`Permission denied: cannot create directory at ${fullPath}`, {
|
|
56
|
+
cause: eaccError
|
|
57
|
+
});
|
|
58
|
+
permError.code = "EACCES";
|
|
59
|
+
throw permError;
|
|
60
|
+
}
|
|
61
|
+
throw mkdirErr;
|
|
62
|
+
}
|
|
63
|
+
} else if (err instanceof Error && "code" in err && err.code === "EACCES") {
|
|
64
|
+
const eaccError = err;
|
|
65
|
+
const permError = new Error(`Permission denied: cannot access directory at ${fullPath}`, {
|
|
66
|
+
cause: eaccError
|
|
67
|
+
});
|
|
68
|
+
permError.code = "EACCES";
|
|
69
|
+
throw permError;
|
|
70
|
+
} else {
|
|
71
|
+
throw err;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
if (!await directoryExists(join(fullPath, ".git"))) {
|
|
75
|
+
try {
|
|
76
|
+
execSync("git init", { cwd: fullPath, stdio: "pipe" });
|
|
77
|
+
} catch (gitErr) {
|
|
78
|
+
const errMsg = gitErr instanceof Error ? gitErr.message : "Unknown";
|
|
79
|
+
const exitCode = gitErr.status ?? gitErr.exitCode;
|
|
80
|
+
const isPermission = errMsg.includes("Permission denied") || exitCode === 128;
|
|
81
|
+
let sudoSuccess = false;
|
|
82
|
+
if (isPermission) {
|
|
83
|
+
try {
|
|
84
|
+
const currentUser = execSync("id -un", { encoding: "utf-8" }).trim();
|
|
85
|
+
execSync(`sudo -u ${currentUser} git init`, { cwd: fullPath, stdio: "pipe" });
|
|
86
|
+
sudoSuccess = true;
|
|
87
|
+
} catch {
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (!sudoSuccess) {
|
|
91
|
+
const permError = new Error(`Failed to initialize git: ${errMsg}`);
|
|
92
|
+
if (isPermission) {
|
|
93
|
+
permError.code = "EACCES";
|
|
94
|
+
}
|
|
95
|
+
if (!dirAlreadyExisted) {
|
|
96
|
+
try {
|
|
97
|
+
await rm(fullPath, { recursive: true, force: true });
|
|
98
|
+
} catch {
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
throw permError;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return createProject(projectName, fullPath);
|
|
106
|
+
}
|
|
107
|
+
export {
|
|
108
|
+
createDirectoryWithGit,
|
|
109
|
+
validateProjectName
|
|
110
|
+
};
|
|
111
|
+
//# sourceMappingURL=project-creator-GPOIXKX4.js.map
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
parseClientMessage,
|
|
36
36
|
serializeServerMessage,
|
|
37
37
|
storedEventToServerMessage
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-UF6D2IPO.js";
|
|
39
39
|
import "./chunk-NDJ6FKSP.js";
|
|
40
40
|
export {
|
|
41
41
|
createChatAskUserMessage,
|
|
@@ -75,4 +75,4 @@ export {
|
|
|
75
75
|
serializeServerMessage,
|
|
76
76
|
storedEventToServerMessage
|
|
77
77
|
};
|
|
78
|
-
//# sourceMappingURL=protocol-
|
|
78
|
+
//# sourceMappingURL=protocol-IXFNYZEX.js.map
|
|
@@ -6,9 +6,9 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
VERSION,
|
|
8
8
|
createServer
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-2MHHSLNY.js";
|
|
10
|
+
import "./chunk-SJHWJAJA.js";
|
|
11
|
+
import "./chunk-42TLGPX4.js";
|
|
12
12
|
import "./chunk-OXI26S7U.js";
|
|
13
13
|
import "./chunk-CMQCO27Y.js";
|
|
14
14
|
import "./chunk-DL6ZILAF.js";
|
|
@@ -17,10 +17,10 @@ import "./chunk-VRGRAQDG.js";
|
|
|
17
17
|
import "./chunk-WR6QCJJO.js";
|
|
18
18
|
import "./chunk-TGWEH2BC.js";
|
|
19
19
|
import "./chunk-CUDAT6SS.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-LHKXWUEK.js";
|
|
21
21
|
import "./chunk-KIOUKC3Z.js";
|
|
22
22
|
import "./chunk-TS5XFQ2D.js";
|
|
23
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-UF6D2IPO.js";
|
|
24
24
|
import "./chunk-BJYPTN5S.js";
|
|
25
25
|
import "./chunk-RGRBWDZP.js";
|
|
26
26
|
import "./chunk-NDJ6FKSP.js";
|
|
@@ -190,4 +190,4 @@ async function runServe(options) {
|
|
|
190
190
|
export {
|
|
191
191
|
runServe
|
|
192
192
|
};
|
|
193
|
-
//# sourceMappingURL=serve-
|
|
193
|
+
//# sourceMappingURL=serve-D4NO4GJF.js.map
|
package/dist/server/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createServer,
|
|
3
3
|
createServerHandle
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-2MHHSLNY.js";
|
|
5
|
+
import "../chunk-SJHWJAJA.js";
|
|
6
|
+
import "../chunk-42TLGPX4.js";
|
|
7
7
|
import "../chunk-OXI26S7U.js";
|
|
8
8
|
import "../chunk-CMQCO27Y.js";
|
|
9
9
|
import "../chunk-DL6ZILAF.js";
|
|
@@ -12,10 +12,10 @@ import "../chunk-VRGRAQDG.js";
|
|
|
12
12
|
import "../chunk-WR6QCJJO.js";
|
|
13
13
|
import "../chunk-TGWEH2BC.js";
|
|
14
14
|
import "../chunk-CUDAT6SS.js";
|
|
15
|
-
import "../chunk-
|
|
15
|
+
import "../chunk-LHKXWUEK.js";
|
|
16
16
|
import "../chunk-KIOUKC3Z.js";
|
|
17
17
|
import "../chunk-TS5XFQ2D.js";
|
|
18
|
-
import "../chunk-
|
|
18
|
+
import "../chunk-UF6D2IPO.js";
|
|
19
19
|
import "../chunk-BJYPTN5S.js";
|
|
20
20
|
import "../chunk-RGRBWDZP.js";
|
|
21
21
|
import "../chunk-NDJ6FKSP.js";
|
|
@@ -11,17 +11,17 @@ import {
|
|
|
11
11
|
requestPathAccess,
|
|
12
12
|
stepDoneTool,
|
|
13
13
|
validateToolAction
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-42TLGPX4.js";
|
|
15
15
|
import "./chunk-OXI26S7U.js";
|
|
16
16
|
import "./chunk-CMQCO27Y.js";
|
|
17
17
|
import "./chunk-DL6ZILAF.js";
|
|
18
18
|
import "./chunk-PBGOZMVY.js";
|
|
19
19
|
import "./chunk-VRGRAQDG.js";
|
|
20
20
|
import "./chunk-CUDAT6SS.js";
|
|
21
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-LHKXWUEK.js";
|
|
22
22
|
import "./chunk-KIOUKC3Z.js";
|
|
23
23
|
import "./chunk-TS5XFQ2D.js";
|
|
24
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-UF6D2IPO.js";
|
|
25
25
|
import {
|
|
26
26
|
AskUserInterrupt,
|
|
27
27
|
cancelQuestionsForSession,
|
|
@@ -49,4 +49,4 @@ export {
|
|
|
49
49
|
stepDoneTool,
|
|
50
50
|
validateToolAction
|
|
51
51
|
};
|
|
52
|
-
//# sourceMappingURL=tools-
|
|
52
|
+
//# sourceMappingURL=tools-Y3S6BHBZ.js.map
|