openfox 2.0.113 → 2.0.114
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/CHANGELOG.md +22 -0
- package/dist/CHANGELOG.md +22 -0
- package/dist/agent-defaults/builder.agent.md +1 -0
- package/dist/agent-defaults/planner.agent.md +1 -0
- package/dist/{backend-P3GHHLHJ.js → backend-LVYHLGQJ.js} +2 -2
- package/dist/{chat-handler-PEK5JDHO.js → chat-handler-KWXRSWXZ.js} +31 -25
- package/dist/{chunk-HKD4IMOE.js → chunk-2XD65L7M.js} +2 -2
- package/dist/{chunk-AZFZE36I.js → chunk-3O77NT4T.js} +17 -7
- package/dist/{chunk-HGOTZWON.js → chunk-7GWARYQC.js} +60 -1064
- package/dist/{chunk-YHEQTVFV.js → chunk-AZHWLLPP.js} +1 -1
- package/dist/{chunk-6UPBZ2ZR.js → chunk-BZVW77PI.js} +4 -4
- package/dist/{chunk-YGPPFVLJ.js → chunk-FW4NDUBL.js} +15 -15
- package/dist/{chunk-O2YSYW2F.js → chunk-GUHHUDNL.js} +6 -6
- package/dist/{chunk-WWTYWLDM.js → chunk-HP5CIB66.js} +2 -2
- package/dist/{chunk-ONONXV3N.js → chunk-HV6IALXF.js} +4 -4
- package/dist/{chunk-4NMGX5F2.js → chunk-I7FY2LTR.js} +2 -2
- package/dist/{chunk-Y64PEWKP.js → chunk-JP7NM545.js} +2 -2
- package/dist/{chunk-CP44U7BT.js → chunk-JXLRL5JR.js} +5 -5
- package/dist/{chunk-5VYSKVZT.js → chunk-K733B5T2.js} +254 -20
- package/dist/{chunk-SNLLOXCM.js → chunk-L63Q4JQJ.js} +3 -3
- package/dist/{chunk-43M7QZMX.js → chunk-LXYPMFTH.js} +3 -3
- package/dist/{chunk-TCGWZBTS.js → chunk-MUSPWEBB.js} +3 -3
- package/dist/chunk-NCZRWCJN.js +7 -0
- package/dist/{chunk-JR54MDZI.js → chunk-NLO64UE3.js} +2 -2
- package/dist/{chunk-3R43CMLS.js → chunk-NWJLWLKF.js} +8 -8
- package/dist/chunk-OSXPQSLW.js +128 -0
- package/dist/chunk-OTYAEEX3.js +1081 -0
- package/dist/{chunk-V4664YKR.js → chunk-OXSTNSCF.js} +2 -2
- package/dist/{chunk-R2MTWC7C.js → chunk-P5UANBBX.js} +6 -4
- package/dist/{chunk-PWXBIUEY.js → chunk-PBW3YC3G.js} +85 -1
- package/dist/{chunk-TEQEDOWI.js → chunk-QD7MRMCH.js} +245 -289
- package/dist/{chunk-BNFGDTEU.js → chunk-SA34STZ6.js} +2 -2
- package/dist/{chunk-VGRVPYZ5.js → chunk-SBSUDHL4.js} +2 -2
- package/dist/{chunk-XQR76MQ5.js → chunk-SFZGMB2G.js} +2 -2
- package/dist/{chunk-EC5T5A6O.js → chunk-TKKP56QK.js} +3 -3
- package/dist/{chunk-BYSUSSSC.js → chunk-UPBWEHIL.js} +30 -148
- package/dist/{chunk-YB6WYVNY.js → chunk-UTIQ7OO5.js} +2 -2
- package/dist/{chunk-EMI3YYLP.js → chunk-VPVLO436.js} +4 -4
- package/dist/chunk-W77NBJAZ.js +957 -0
- package/dist/{chunk-BKCW3JLL.js → chunk-X25Q6RAV.js} +1 -1
- package/dist/{chunk-FF2EKUQO.js → chunk-YGJIK3CG.js} +4 -4
- package/dist/cli/dev.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/{client-3LJGD6KY.js → client-EM7ISGUP.js} +6 -6
- package/dist/{compactor-ZBNKANHV.js → compactor-V3LR7APW.js} +13 -12
- package/dist/{dynamic-context-F2XTQJR5.js → dynamic-context-MVGOF5V2.js} +10 -9
- package/dist/{events-224IO5NJ.js → events-PI7IMPHT.js} +8 -7
- package/dist/{folding-YTTTVS56.js → folding-FO57K4JM.js} +6 -5
- package/dist/http-client-33EZ3BLR.js +11 -0
- package/dist/{inspect-proxy-B7LGGTM7.js → inspect-proxy-NHKQQ2CD.js} +4 -4
- package/dist/launch-L5ROVNI3.js +52 -0
- package/dist/{manager-4QGXI6WZ.js → manager-66YAEO7K.js} +5 -5
- package/dist/{model-overrides-OY2YKUNV.js → model-overrides-L53PZNZA.js} +4 -4
- package/dist/orchestrator-XK5K3RPL.js +63 -0
- package/dist/package.json +3 -3
- package/dist/{path-security-PFMZY7IA.js → path-security-RSEI3YKB.js} +12 -11
- package/dist/{platform-QNGCKX4L.js → platform-WA4GK5BO.js} +4 -4
- package/dist/{processor-NYPJ5PFA.js → processor-WDZSFBVO.js} +30 -24
- package/dist/{project-creator-AWP2JUFS.js → project-creator-676WQXVI.js} +3 -3
- package/dist/{projects-C4353IQK.js → projects-SSBWIYL4.js} +3 -3
- package/dist/{protocol-CBT1d98i.d.ts → protocol-BzHs024-.d.ts} +21 -3
- package/dist/{protocol-LZZ7C4VQ.js → protocol-RKSWKNXI.js} +3 -3
- package/dist/provider/index.d.ts +4 -4
- package/dist/{provider-PIRPN2CC.js → provider-PLIWRBCF.js} +7 -7
- package/dist/{provider-manager-GNEPR6UN.js → provider-manager-2QSJTPWS.js} +7 -7
- package/dist/{registry-VCKDSVKA.js → registry-ZP4TN2IN.js} +5 -4
- package/dist/{serve-6DRHQLCG.js → serve-MZ3BCCWC.js} +35 -32
- package/dist/server/index.d.ts +4 -4
- package/dist/server/index.js +34 -31
- package/dist/server-EPXODFMB.js +55 -0
- package/dist/service-54PGIPDQ.js +25 -0
- package/dist/{session-overrides-RNKV35MU.js → session-overrides-LXN6W7SA.js} +7 -6
- package/dist/{sessions-D5CEPQGU.js → sessions-CHPVUG6H.js} +6 -5
- package/dist/{settings-BNRNX6IW.js → settings-NEBM3GQX.js} +3 -3
- package/dist/shared/index.d.ts +3 -3
- package/dist/shared/index.js +1 -1
- package/dist/skill-defaults/workflows/SKILL.md +24 -6
- package/dist/tasks-TJXG2V3U.js +217 -0
- package/dist/{tools-2B363F7L.js → tools-CIM26IFB.js} +30 -22
- package/dist/{types-BAxh20ZL.d.ts → types-CMtHpDWT.d.ts} +74 -1
- package/dist/{types-cVfqOj6M.d.ts → types-CbggXFvR.d.ts} +1 -1
- package/dist/{update-IQMRYN7J.js → update-UZBBO42X.js} +2 -2
- package/dist/web/assets/{index-CjWC6EQ4.css → index-BmILAZrT.css} +1 -1
- package/dist/web/assets/index-rZHXkfMq.js +324 -0
- package/dist/web/index.html +2 -2
- package/dist/web/sw.js +1 -1
- package/dist/workflow-defaults/default.workflow.json +5 -3
- package/dist/{workspace-YUNHV4WS.js → workspace-2XODU4YJ.js} +4 -4
- package/package.json +3 -3
- package/dist/chunk-B2PHPBFU.js +0 -7
- package/dist/http-client-YC3UA5OZ.js +0 -11
- package/dist/orchestrator-JKBY7B3P.js +0 -57
- package/dist/server-HUHFJW7U.js +0 -48
- package/dist/web/assets/index-DBUtUSHK.js +0 -323
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SETTINGS_KEYS,
|
|
3
3
|
getSetting
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-HP5CIB66.js";
|
|
5
5
|
|
|
6
6
|
// src/server/utils/platform.ts
|
|
7
7
|
import os from "os";
|
|
@@ -63,4 +63,4 @@ export {
|
|
|
63
63
|
isWindowsPath,
|
|
64
64
|
isAbsolutePath
|
|
65
65
|
};
|
|
66
|
-
//# sourceMappingURL=chunk-
|
|
66
|
+
//# sourceMappingURL=chunk-SA34STZ6.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
getProjectByWorkdir,
|
|
6
6
|
updateProject
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-SFZGMB2G.js";
|
|
8
8
|
import {
|
|
9
9
|
logger
|
|
10
10
|
} from "./chunk-K44MW7JJ.js";
|
|
@@ -333,4 +333,4 @@ export {
|
|
|
333
333
|
deleteWorkspace,
|
|
334
334
|
isGitRepository
|
|
335
335
|
};
|
|
336
|
-
//# sourceMappingURL=chunk-
|
|
336
|
+
//# sourceMappingURL=chunk-SBSUDHL4.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getDatabase
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-PBW3YC3G.js";
|
|
4
4
|
|
|
5
5
|
// src/server/db/projects.ts
|
|
6
6
|
function createProject(name, workdir) {
|
|
@@ -129,4 +129,4 @@ export {
|
|
|
129
129
|
deleteProject,
|
|
130
130
|
toggleStar
|
|
131
131
|
};
|
|
132
|
-
//# sourceMappingURL=chunk-
|
|
132
|
+
//# sourceMappingURL=chunk-SFZGMB2G.js.map
|
|
@@ -11,11 +11,11 @@ import {
|
|
|
11
11
|
} from "./chunk-I72ACQ6R.js";
|
|
12
12
|
import {
|
|
13
13
|
getPlatformShell
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-SA34STZ6.js";
|
|
15
15
|
import {
|
|
16
16
|
SETTINGS_KEYS,
|
|
17
17
|
getSetting
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-HP5CIB66.js";
|
|
19
19
|
|
|
20
20
|
// src/server/utils/shell.ts
|
|
21
21
|
import { spawn } from "child_process";
|
|
@@ -214,4 +214,4 @@ export {
|
|
|
214
214
|
getSessionProcesses2 as getSessionProcesses,
|
|
215
215
|
getProcessLogs
|
|
216
216
|
};
|
|
217
|
-
//# sourceMappingURL=chunk-
|
|
217
|
+
//# sourceMappingURL=chunk-TKKP56QK.js.map
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
saveItemToDir
|
|
3
|
+
} from "./chunk-OSXPQSLW.js";
|
|
1
4
|
import {
|
|
2
5
|
SETTINGS_KEYS,
|
|
3
6
|
getSetting
|
|
4
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-HP5CIB66.js";
|
|
5
8
|
import {
|
|
6
9
|
logger
|
|
7
10
|
} from "./chunk-K44MW7JJ.js";
|
|
@@ -10,125 +13,11 @@ import {
|
|
|
10
13
|
} from "./chunk-CQGTEGKL.js";
|
|
11
14
|
|
|
12
15
|
// src/server/agents/registry.ts
|
|
13
|
-
import { readdir
|
|
14
|
-
import { join
|
|
15
|
-
import { constants as constants2 } from "fs";
|
|
16
|
-
import { fileURLToPath } from "url";
|
|
17
|
-
import matter2 from "gray-matter";
|
|
18
|
-
|
|
19
|
-
// src/server/shared/item-loader.ts
|
|
20
|
-
import { readdir, readFile, access, writeFile, mkdir, unlink } from "fs/promises";
|
|
21
|
-
import { join } from "path";
|
|
16
|
+
import { readdir, readFile, writeFile, mkdir, access, unlink } from "fs/promises";
|
|
17
|
+
import { join, dirname } from "path";
|
|
22
18
|
import { constants } from "fs";
|
|
19
|
+
import { fileURLToPath } from "url";
|
|
23
20
|
import matter from "gray-matter";
|
|
24
|
-
async function pathExists(path) {
|
|
25
|
-
try {
|
|
26
|
-
await access(path, constants.R_OK);
|
|
27
|
-
return true;
|
|
28
|
-
} catch {
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
async function getDefaultIds(dir, extension) {
|
|
33
|
-
try {
|
|
34
|
-
const files = (await readdir(dir)).filter((f) => f.endsWith(extension));
|
|
35
|
-
return files.map((f) => f.replace(extension, ""));
|
|
36
|
-
} catch {
|
|
37
|
-
return [];
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
async function loadItemsFromDir(dir, options) {
|
|
41
|
-
if (!await pathExists(dir)) {
|
|
42
|
-
return [];
|
|
43
|
-
}
|
|
44
|
-
let files;
|
|
45
|
-
try {
|
|
46
|
-
files = (await readdir(dir)).filter((f) => f.endsWith(options.extension));
|
|
47
|
-
} catch {
|
|
48
|
-
return [];
|
|
49
|
-
}
|
|
50
|
-
const items = [];
|
|
51
|
-
for (const file of files) {
|
|
52
|
-
try {
|
|
53
|
-
const raw = await readFile(join(dir, file), "utf-8");
|
|
54
|
-
const { data, content } = matter(raw);
|
|
55
|
-
if (data.id && content.trim()) {
|
|
56
|
-
items.push({
|
|
57
|
-
metadata: data,
|
|
58
|
-
prompt: content.trim()
|
|
59
|
-
});
|
|
60
|
-
} else {
|
|
61
|
-
logger.warn(`Skipping invalid ${options.logName} file`, { file });
|
|
62
|
-
}
|
|
63
|
-
} catch (err) {
|
|
64
|
-
logger.warn(`Failed to parse ${options.logName} file`, {
|
|
65
|
-
file,
|
|
66
|
-
error: err instanceof Error ? err.message : String(err)
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return items;
|
|
71
|
-
}
|
|
72
|
-
async function findFileByInternalId(dir, id, ext) {
|
|
73
|
-
if (!await pathExists(dir)) return null;
|
|
74
|
-
let files;
|
|
75
|
-
try {
|
|
76
|
-
files = await readdir(dir);
|
|
77
|
-
} catch {
|
|
78
|
-
return null;
|
|
79
|
-
}
|
|
80
|
-
for (const file of files) {
|
|
81
|
-
if (!file.endsWith(ext)) continue;
|
|
82
|
-
try {
|
|
83
|
-
const raw = await readFile(join(dir, file), "utf-8");
|
|
84
|
-
let parsedId;
|
|
85
|
-
if (ext === ".md" || ext === ".mdx") {
|
|
86
|
-
const { data } = matter(raw);
|
|
87
|
-
parsedId = data.id;
|
|
88
|
-
} else {
|
|
89
|
-
const parsed = JSON.parse(raw);
|
|
90
|
-
parsedId = parsed.metadata?.id ?? parsed.id;
|
|
91
|
-
}
|
|
92
|
-
if (parsedId === id) {
|
|
93
|
-
return join(dir, file);
|
|
94
|
-
}
|
|
95
|
-
} catch {
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
return null;
|
|
99
|
-
}
|
|
100
|
-
async function saveItemToDir(dir, item, ext, serialize) {
|
|
101
|
-
if (!await pathExists(dir)) {
|
|
102
|
-
await mkdir(dir, { recursive: true });
|
|
103
|
-
}
|
|
104
|
-
const meta = item.metadata;
|
|
105
|
-
const filePath = join(dir, `${meta.id}${ext}`);
|
|
106
|
-
const existing = await findFileByInternalId(dir, meta.id, ext);
|
|
107
|
-
if (existing && existing !== filePath) {
|
|
108
|
-
await unlink(existing).catch(() => {
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
await writeFile(filePath, serialize(item), "utf-8");
|
|
112
|
-
}
|
|
113
|
-
var jsonSerializer = (item) => JSON.stringify(item, null, 2) + "\n";
|
|
114
|
-
async function deleteItemFromDir(dir, id, ext) {
|
|
115
|
-
const fastPath = join(dir, `${id}${ext}`);
|
|
116
|
-
try {
|
|
117
|
-
await unlink(fastPath);
|
|
118
|
-
return { success: true };
|
|
119
|
-
} catch {
|
|
120
|
-
const found = await findFileByInternalId(dir, id, ext);
|
|
121
|
-
if (found) {
|
|
122
|
-
try {
|
|
123
|
-
await unlink(found);
|
|
124
|
-
return { success: true };
|
|
125
|
-
} catch {
|
|
126
|
-
return { success: false };
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
return { success: false };
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
21
|
|
|
133
22
|
// src/server/config.ts
|
|
134
23
|
import { z } from "zod";
|
|
@@ -202,25 +91,25 @@ function getRuntimeConfig() {
|
|
|
202
91
|
|
|
203
92
|
// src/server/agents/registry.ts
|
|
204
93
|
var __bundleDir = dirname(fileURLToPath(import.meta.url));
|
|
205
|
-
var DEFAULTS_DIR =
|
|
206
|
-
var DEFAULTS_DIR_ALT =
|
|
94
|
+
var DEFAULTS_DIR = join(__bundleDir, "defaults");
|
|
95
|
+
var DEFAULTS_DIR_ALT = join(__bundleDir, "agent-defaults");
|
|
207
96
|
var AGENT_EXTENSION = ".agent.md";
|
|
208
97
|
function getAgentsDir(configDir) {
|
|
209
|
-
return
|
|
98
|
+
return join(configDir, "agents");
|
|
210
99
|
}
|
|
211
100
|
function getProjectAgentsDir(projectDir) {
|
|
212
|
-
return
|
|
101
|
+
return join(projectDir, ".openfox", "agents");
|
|
213
102
|
}
|
|
214
|
-
async function
|
|
103
|
+
async function pathExists(path) {
|
|
215
104
|
try {
|
|
216
|
-
await
|
|
105
|
+
await access(path, constants.R_OK);
|
|
217
106
|
return true;
|
|
218
107
|
} catch {
|
|
219
108
|
return false;
|
|
220
109
|
}
|
|
221
110
|
}
|
|
222
111
|
function parseAgentFile(raw, filename) {
|
|
223
|
-
const { data, content } =
|
|
112
|
+
const { data, content } = matter(raw);
|
|
224
113
|
const meta = data;
|
|
225
114
|
if (!meta["id"] || !content.trim()) {
|
|
226
115
|
logger.warn("Skipping invalid agent file", { filename });
|
|
@@ -238,19 +127,19 @@ function parseAgentFile(raw, filename) {
|
|
|
238
127
|
return { metadata, prompt: content.trim() };
|
|
239
128
|
}
|
|
240
129
|
async function loadAgentsFromDir(dir) {
|
|
241
|
-
if (!await
|
|
130
|
+
if (!await pathExists(dir)) {
|
|
242
131
|
return [];
|
|
243
132
|
}
|
|
244
133
|
let files;
|
|
245
134
|
try {
|
|
246
|
-
files = (await
|
|
135
|
+
files = (await readdir(dir)).filter((f) => f.endsWith(AGENT_EXTENSION));
|
|
247
136
|
} catch {
|
|
248
137
|
return [];
|
|
249
138
|
}
|
|
250
139
|
const agents = [];
|
|
251
140
|
for (const file of files) {
|
|
252
141
|
try {
|
|
253
|
-
const raw = await
|
|
142
|
+
const raw = await readFile(join(dir, file), "utf-8");
|
|
254
143
|
const agent = parseAgentFile(raw, file);
|
|
255
144
|
if (agent) {
|
|
256
145
|
agents.push(agent);
|
|
@@ -294,7 +183,7 @@ async function saveAgentToProject(projectDir, agent) {
|
|
|
294
183
|
getProjectAgentsDir(projectDir),
|
|
295
184
|
agent,
|
|
296
185
|
AGENT_EXTENSION,
|
|
297
|
-
(a) =>
|
|
186
|
+
(a) => matter.stringify(a.prompt, a.metadata)
|
|
298
187
|
);
|
|
299
188
|
}
|
|
300
189
|
async function deleteProjectAgent(projectDir, agentId) {
|
|
@@ -302,7 +191,7 @@ async function deleteProjectAgent(projectDir, agentId) {
|
|
|
302
191
|
const paths = getAgentFilePaths(agentsDir, agentId);
|
|
303
192
|
for (const filePath of paths) {
|
|
304
193
|
try {
|
|
305
|
-
await
|
|
194
|
+
await unlink(filePath);
|
|
306
195
|
return { success: true };
|
|
307
196
|
} catch {
|
|
308
197
|
continue;
|
|
@@ -322,7 +211,7 @@ async function loadAllAgentsDefault() {
|
|
|
322
211
|
async function getDefaultAgentIds() {
|
|
323
212
|
for (const dir of [DEFAULTS_DIR, DEFAULTS_DIR_ALT]) {
|
|
324
213
|
try {
|
|
325
|
-
const files = (await
|
|
214
|
+
const files = (await readdir(dir)).filter((f) => f.endsWith(AGENT_EXTENSION));
|
|
326
215
|
return files.map((f) => f.replace(AGENT_EXTENSION, ""));
|
|
327
216
|
} catch {
|
|
328
217
|
}
|
|
@@ -339,7 +228,7 @@ async function isDefaultAgent(agentId) {
|
|
|
339
228
|
}
|
|
340
229
|
function getAgentFilePaths(agentsDir, agentId) {
|
|
341
230
|
const hyphenated = agentId.replace(/_/g, "-");
|
|
342
|
-
return [
|
|
231
|
+
return [join(agentsDir, `${agentId}${AGENT_EXTENSION}`), join(agentsDir, `${hyphenated}${AGENT_EXTENSION}`)];
|
|
343
232
|
}
|
|
344
233
|
function findAgentById(agentId, agents) {
|
|
345
234
|
return agents.find((a) => a.metadata.id === agentId);
|
|
@@ -354,14 +243,14 @@ async function agentExists(configDir, agentId, projectDir) {
|
|
|
354
243
|
const agentsDir = getAgentsDir(configDir);
|
|
355
244
|
const paths = getAgentFilePaths(agentsDir, agentId);
|
|
356
245
|
for (const filePath of paths) {
|
|
357
|
-
if (await
|
|
246
|
+
if (await pathExists(filePath)) {
|
|
358
247
|
return true;
|
|
359
248
|
}
|
|
360
249
|
}
|
|
361
250
|
if (projectDir) {
|
|
362
251
|
const projectPaths = getAgentFilePaths(getProjectAgentsDir(projectDir), agentId);
|
|
363
252
|
for (const filePath of projectPaths) {
|
|
364
|
-
if (await
|
|
253
|
+
if (await pathExists(filePath)) {
|
|
365
254
|
return true;
|
|
366
255
|
}
|
|
367
256
|
}
|
|
@@ -370,12 +259,12 @@ async function agentExists(configDir, agentId, projectDir) {
|
|
|
370
259
|
}
|
|
371
260
|
async function saveAgent(configDir, agent) {
|
|
372
261
|
const agentsDir = getAgentsDir(configDir);
|
|
373
|
-
if (!await
|
|
374
|
-
await
|
|
262
|
+
if (!await pathExists(agentsDir)) {
|
|
263
|
+
await mkdir(agentsDir, { recursive: true });
|
|
375
264
|
}
|
|
376
|
-
const filePath =
|
|
377
|
-
const content =
|
|
378
|
-
await
|
|
265
|
+
const filePath = join(agentsDir, `${agent.metadata.id}${AGENT_EXTENSION}`);
|
|
266
|
+
const content = matter.stringify(agent.prompt, agent.metadata);
|
|
267
|
+
await writeFile(filePath, content, "utf-8");
|
|
379
268
|
}
|
|
380
269
|
async function deleteAgent(configDir, agentId) {
|
|
381
270
|
const isDefault = await isDefaultAgent(agentId);
|
|
@@ -386,7 +275,7 @@ async function deleteAgent(configDir, agentId) {
|
|
|
386
275
|
const paths = getAgentFilePaths(agentsDir, agentId);
|
|
387
276
|
for (const filePath of paths) {
|
|
388
277
|
try {
|
|
389
|
-
await
|
|
278
|
+
await unlink(filePath);
|
|
390
279
|
return { success: true };
|
|
391
280
|
} catch {
|
|
392
281
|
continue;
|
|
@@ -426,13 +315,6 @@ function resolveDefaultAgentId() {
|
|
|
426
315
|
}
|
|
427
316
|
|
|
428
317
|
export {
|
|
429
|
-
pathExists,
|
|
430
|
-
getDefaultIds,
|
|
431
|
-
loadItemsFromDir,
|
|
432
|
-
findFileByInternalId,
|
|
433
|
-
saveItemToDir,
|
|
434
|
-
jsonSerializer,
|
|
435
|
-
deleteItemFromDir,
|
|
436
318
|
loadConfig,
|
|
437
319
|
setRuntimeConfig,
|
|
438
320
|
getRuntimeConfig,
|
|
@@ -455,4 +337,4 @@ export {
|
|
|
455
337
|
getOverrideAgentIds,
|
|
456
338
|
resolveDefaultAgentId
|
|
457
339
|
};
|
|
458
|
-
//# sourceMappingURL=chunk-
|
|
340
|
+
//# sourceMappingURL=chunk-UPBWEHIL.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-LCLH6ZUL.js";
|
|
4
4
|
import {
|
|
5
5
|
resolveDefaultAgentId
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-UPBWEHIL.js";
|
|
7
7
|
|
|
8
8
|
// src/server/events/apply-events.ts
|
|
9
9
|
function markComplete(msg, reason) {
|
|
@@ -965,4 +965,4 @@ export {
|
|
|
965
965
|
buildSnapshot,
|
|
966
966
|
buildSnapshotFromSessionState
|
|
967
967
|
};
|
|
968
|
-
//# sourceMappingURL=chunk-
|
|
968
|
+
//# sourceMappingURL=chunk-UTIQ7OO5.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createMessageStartEvent
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NLO64UE3.js";
|
|
4
4
|
import {
|
|
5
5
|
COMPACTION_PROMPT
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-2XD65L7M.js";
|
|
7
7
|
import {
|
|
8
8
|
getCurrentWindowMessageOptions
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-JXLRL5JR.js";
|
|
10
10
|
|
|
11
11
|
// src/server/context/compactor.ts
|
|
12
12
|
function appendCompactionPrompt(sessionId, append) {
|
|
@@ -36,4 +36,4 @@ export {
|
|
|
36
36
|
COMPACTION_MAX_RATIO,
|
|
37
37
|
shouldCompact
|
|
38
38
|
};
|
|
39
|
-
//# sourceMappingURL=chunk-
|
|
39
|
+
//# sourceMappingURL=chunk-VPVLO436.js.map
|