openfox 2.0.59 → 2.0.60
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-AS44EMQE.js → chat-handler-MBR6ZQTX.js} +4 -4
- package/dist/{chunk-FRU2X3IZ.js → chunk-3JRYK5UG.js} +265 -62
- package/dist/{chunk-LQFCQ6PY.js → chunk-DEWNWF2P.js} +469 -253
- package/dist/{chunk-5MDIKIMG.js → chunk-DOJKA4XO.js} +3 -3
- package/dist/{chunk-P7C6KF2H.js → chunk-MTBQQ5DN.js} +2 -2
- package/dist/{chunk-EKI5SZC7.js → chunk-NY6IGGKZ.js} +3 -3
- package/dist/{chunk-CDRQJDSJ.js → chunk-WNSAJCWT.js} +3 -2
- package/dist/cli/dev.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/{orchestrator-MH7J2YVP.js → orchestrator-PIZJ42J2.js} +4 -4
- package/dist/package.json +4 -2
- package/dist/{processor-34MVJZTD.js → processor-PKKTNKWY.js} +4 -4
- package/dist/{serve-NHF6B5RQ.js → serve-GKS55Y2C.js} +6 -6
- package/dist/server/index.js +5 -5
- package/dist/{server-KDGQZNYQ.js → server-LMH7ZH5X.js} +5 -5
- package/dist/{settings-X43DCM55.js → settings-2TQA7VTP.js} +2 -2
- package/dist/skill-defaults/{browser.skill.md → browser/SKILL.md} +5 -3
- package/dist/{tools-FQ54IAYG.js → tools-WGAZKL56.js} +3 -3
- package/dist/web/assets/index-C0YKw2cD.js +302 -0
- package/dist/web/assets/{index-DjfRXOO7.css → index-D4bVx84a.css} +1 -1
- package/dist/web/index.html +2 -2
- package/dist/web/sw.js +1 -1
- package/package.json +4 -2
- package/dist/web/assets/index-Dqqp_j-f.js +0 -302
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
} from "./chunk-NVPVDDQZ.js";
|
|
6
6
|
import {
|
|
7
7
|
runChatTurn
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-NY6IGGKZ.js";
|
|
9
|
+
import "./chunk-3JRYK5UG.js";
|
|
10
10
|
import "./chunk-LBGHZLLH.js";
|
|
11
11
|
import "./chunk-BGTEIA2S.js";
|
|
12
12
|
import "./chunk-PK2RMVMB.js";
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
createSessionRunningMessage
|
|
18
18
|
} from "./chunk-F4PMNP7S.js";
|
|
19
19
|
import "./chunk-EU3WWTFH.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-WNSAJCWT.js";
|
|
21
21
|
import "./chunk-YQ3SOPBI.js";
|
|
22
22
|
import "./chunk-6VDCH5ML.js";
|
|
23
23
|
import {
|
|
@@ -154,4 +154,4 @@ export {
|
|
|
154
154
|
startChatSession,
|
|
155
155
|
stopSessionExecution
|
|
156
156
|
};
|
|
157
|
-
//# sourceMappingURL=chat-handler-
|
|
157
|
+
//# sourceMappingURL=chat-handler-MBR6ZQTX.js.map
|
|
@@ -32,8 +32,9 @@ import {
|
|
|
32
32
|
import {
|
|
33
33
|
SETTINGS_KEYS,
|
|
34
34
|
deleteSetting,
|
|
35
|
-
getSetting
|
|
36
|
-
|
|
35
|
+
getSetting,
|
|
36
|
+
setSetting
|
|
37
|
+
} from "./chunk-WNSAJCWT.js";
|
|
37
38
|
import {
|
|
38
39
|
getProject
|
|
39
40
|
} from "./chunk-YQ3SOPBI.js";
|
|
@@ -1669,7 +1670,7 @@ ${Object.entries(schema.fields).map(([f, t]) => ` ${f}: ${t}`).join("\n")}`
|
|
|
1669
1670
|
);
|
|
1670
1671
|
|
|
1671
1672
|
// src/server/sub-agents/manager.ts
|
|
1672
|
-
import { readFile as
|
|
1673
|
+
import { readFile as readFile8, access as access4 } from "fs/promises";
|
|
1673
1674
|
import { join as join7, dirname as dirname5, isAbsolute as isAbsolute3 } from "path";
|
|
1674
1675
|
|
|
1675
1676
|
// src/server/agents/registry.ts
|
|
@@ -2034,62 +2035,173 @@ async function fileExists(path) {
|
|
|
2034
2035
|
}
|
|
2035
2036
|
|
|
2036
2037
|
// src/server/skills/registry.ts
|
|
2037
|
-
import { writeFile as writeFile5, mkdir as mkdir4, unlink as unlink3 } from "fs/promises";
|
|
2038
|
+
import { writeFile as writeFile5, mkdir as mkdir4, unlink as unlink3, readdir as readdir4, readFile as readFile7, realpath as realpath2, rm } from "fs/promises";
|
|
2038
2039
|
import { join as join6, dirname as dirname4 } from "path";
|
|
2039
2040
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
2041
|
+
import { homedir as homedir2 } from "os";
|
|
2040
2042
|
import matter3 from "gray-matter";
|
|
2041
2043
|
var __bundleDir2 = dirname4(fileURLToPath2(import.meta.url));
|
|
2042
2044
|
var DEFAULTS_DIR2 = join6(__bundleDir2, "defaults");
|
|
2043
2045
|
var DEFAULTS_DIR_ALT2 = join6(__bundleDir2, "skill-defaults");
|
|
2044
2046
|
var SKILL_EXTENSION = ".skill.md";
|
|
2045
2047
|
var SKILL_SETTING_PREFIX = "skill.enabled.";
|
|
2048
|
+
var PORTABLE_NAME_REGEX = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
2046
2049
|
function getSkillsDir(configDir) {
|
|
2047
2050
|
return join6(configDir, "skills");
|
|
2048
2051
|
}
|
|
2049
2052
|
function getProjectSkillsDir(projectDir) {
|
|
2050
2053
|
return join6(projectDir, ".openfox", "skills");
|
|
2051
2054
|
}
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2055
|
+
function portableDisplayName(data, id) {
|
|
2056
|
+
const metadata = data["metadata"];
|
|
2057
|
+
if (!metadata || typeof metadata !== "object" || Array.isArray(metadata)) return id;
|
|
2058
|
+
const openfox = metadata["openfox"];
|
|
2059
|
+
if (!openfox || typeof openfox !== "object" || Array.isArray(openfox)) return id;
|
|
2060
|
+
const displayName = openfox["displayName"];
|
|
2061
|
+
return typeof displayName === "string" && displayName.trim() ? displayName : id;
|
|
2062
|
+
}
|
|
2063
|
+
function portableVersion(data) {
|
|
2064
|
+
const metadata = data["metadata"];
|
|
2065
|
+
if (metadata && typeof metadata === "object" && !Array.isArray(metadata)) {
|
|
2066
|
+
const version = metadata["version"];
|
|
2067
|
+
if (version !== void 0) return String(version);
|
|
2068
|
+
}
|
|
2069
|
+
return data["version"] === void 0 ? "" : String(data["version"]);
|
|
2070
|
+
}
|
|
2071
|
+
async function loadPortableSkills(dir, source) {
|
|
2072
|
+
let entries;
|
|
2073
|
+
try {
|
|
2074
|
+
entries = await readdir4(dir, { withFileTypes: true });
|
|
2075
|
+
} catch {
|
|
2076
|
+
return [];
|
|
2077
|
+
}
|
|
2078
|
+
const skills = [];
|
|
2079
|
+
for (const entry of entries) {
|
|
2080
|
+
if (!entry.isDirectory() && !entry.isSymbolicLink()) continue;
|
|
2081
|
+
const packageDir = join6(dir, entry.name);
|
|
2082
|
+
const entrypoint = join6(packageDir, "SKILL.md");
|
|
2083
|
+
try {
|
|
2084
|
+
const content = await readFile7(entrypoint, "utf-8");
|
|
2085
|
+
const parsed = matter3(content);
|
|
2086
|
+
const data = parsed.data;
|
|
2087
|
+
const id = typeof data["name"] === "string" ? data["name"].trim() : "";
|
|
2088
|
+
const description = typeof data["description"] === "string" ? data["description"].trim() : "";
|
|
2089
|
+
const prompt = parsed.content.trim();
|
|
2090
|
+
if (!id || !description || !prompt) continue;
|
|
2091
|
+
const resolvedDirectory = await realpath2(packageDir);
|
|
2092
|
+
const warnings = [];
|
|
2093
|
+
if (id.length > 64 || !PORTABLE_NAME_REGEX.test(id)) {
|
|
2094
|
+
warnings.push("Skill name must use 1-64 lowercase letters, numbers, and single hyphens");
|
|
2095
|
+
}
|
|
2096
|
+
if (id !== entry.name) {
|
|
2097
|
+
warnings.push(`Skill name "${id}" does not match package directory "${entry.name}"`);
|
|
2098
|
+
}
|
|
2099
|
+
skills.push({
|
|
2100
|
+
metadata: {
|
|
2101
|
+
id,
|
|
2102
|
+
name: portableDisplayName(data, id),
|
|
2103
|
+
description,
|
|
2104
|
+
version: portableVersion(data)
|
|
2105
|
+
},
|
|
2106
|
+
prompt,
|
|
2107
|
+
rawMetadata: data,
|
|
2108
|
+
entrypoint,
|
|
2109
|
+
directory: resolvedDirectory,
|
|
2110
|
+
source,
|
|
2111
|
+
legacy: false,
|
|
2112
|
+
warnings
|
|
2113
|
+
});
|
|
2114
|
+
} catch {
|
|
2115
|
+
}
|
|
2062
2116
|
}
|
|
2063
|
-
return
|
|
2117
|
+
return skills;
|
|
2118
|
+
}
|
|
2119
|
+
async function annotateLegacySkills(skills, dir, source) {
|
|
2120
|
+
return Promise.all(
|
|
2121
|
+
skills.map(async (skill) => {
|
|
2122
|
+
const entrypoint = join6(dir, `${skill.metadata.id}${SKILL_EXTENSION}`);
|
|
2123
|
+
let resolvedEntrypoint = entrypoint;
|
|
2124
|
+
try {
|
|
2125
|
+
resolvedEntrypoint = await realpath2(entrypoint);
|
|
2126
|
+
} catch {
|
|
2127
|
+
}
|
|
2128
|
+
return {
|
|
2129
|
+
...skill,
|
|
2130
|
+
rawMetadata: { ...skill.metadata },
|
|
2131
|
+
entrypoint: resolvedEntrypoint,
|
|
2132
|
+
directory: dirname4(resolvedEntrypoint),
|
|
2133
|
+
source,
|
|
2134
|
+
legacy: true,
|
|
2135
|
+
warnings: ["Legacy .skill.md format"]
|
|
2136
|
+
};
|
|
2137
|
+
})
|
|
2138
|
+
);
|
|
2139
|
+
}
|
|
2140
|
+
async function loadSkillsDirectory(dir, source) {
|
|
2141
|
+
const [legacyRaw, portable] = await Promise.all([
|
|
2142
|
+
loadItemsFromDir(dir, { extension: SKILL_EXTENSION, logName: "skill" }),
|
|
2143
|
+
loadPortableSkills(dir, source)
|
|
2144
|
+
]);
|
|
2145
|
+
const legacy = await annotateLegacySkills(legacyRaw, dir, source);
|
|
2146
|
+
const merged = new Map(legacy.map((skill) => [skill.metadata.id, skill]));
|
|
2147
|
+
for (const skill of portable) merged.set(skill.metadata.id, skill);
|
|
2148
|
+
return [...merged.values()];
|
|
2149
|
+
}
|
|
2150
|
+
function getSelectedSkillDirectories() {
|
|
2151
|
+
const raw = getSetting("skills.directories");
|
|
2152
|
+
if (!raw) return [];
|
|
2153
|
+
try {
|
|
2154
|
+
const parsed = JSON.parse(raw);
|
|
2155
|
+
return Array.isArray(parsed) ? parsed.filter((value) => typeof value === "string") : [];
|
|
2156
|
+
} catch {
|
|
2157
|
+
return [];
|
|
2158
|
+
}
|
|
2159
|
+
}
|
|
2160
|
+
async function loadDefaultSkills() {
|
|
2161
|
+
const defaults = await loadSkillsDirectory(DEFAULTS_DIR2, "bundled");
|
|
2162
|
+
if (defaults.length) return defaults;
|
|
2163
|
+
return loadSkillsDirectory(DEFAULTS_DIR_ALT2, "bundled");
|
|
2064
2164
|
}
|
|
2065
2165
|
async function loadUserSkills(configDir) {
|
|
2066
|
-
return
|
|
2067
|
-
extension: SKILL_EXTENSION,
|
|
2068
|
-
logName: "skill"
|
|
2069
|
-
});
|
|
2166
|
+
return loadSkillsDirectory(getSkillsDir(configDir), "global-openfox");
|
|
2070
2167
|
}
|
|
2071
2168
|
async function loadProjectSkills(projectDir) {
|
|
2072
|
-
return
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2169
|
+
return loadSkillsDirectory(getProjectSkillsDir(projectDir), "project-openfox");
|
|
2170
|
+
}
|
|
2171
|
+
async function loadAllSkills(configDir, projectDir, options = {}) {
|
|
2172
|
+
return (await loadAllSkillsWithDiagnostics(configDir, projectDir, options)).skills;
|
|
2076
2173
|
}
|
|
2077
|
-
async function
|
|
2078
|
-
const
|
|
2174
|
+
async function loadAllSkillsWithDiagnostics(configDir, projectDir, options = {}) {
|
|
2175
|
+
const home = options.homeDir ?? homedir2();
|
|
2176
|
+
const selected = (options.selectedDirectories ?? getSelectedSkillDirectories()).map(
|
|
2177
|
+
(dir) => dir === "~" ? home : dir.startsWith("~/") ? join6(home, dir.slice(2)) : dir
|
|
2178
|
+
);
|
|
2179
|
+
const locations = [
|
|
2180
|
+
loadDefaultSkills(),
|
|
2181
|
+
loadSkillsDirectory(join6(home, ".agents", "skills"), "global-shared"),
|
|
2182
|
+
loadUserSkills(configDir),
|
|
2183
|
+
...selected.map((dir) => loadSkillsDirectory(dir, "selected")),
|
|
2184
|
+
...projectDir ? [loadSkillsDirectory(join6(projectDir, ".agents", "skills"), "project-shared"), loadProjectSkills(projectDir)] : []
|
|
2185
|
+
];
|
|
2186
|
+
const groups = await Promise.all(locations);
|
|
2079
2187
|
const skillMap = /* @__PURE__ */ new Map();
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2188
|
+
const diagnostics = [];
|
|
2189
|
+
for (const group of groups) {
|
|
2190
|
+
for (const skill of group) {
|
|
2191
|
+
const previous = skillMap.get(skill.metadata.id);
|
|
2192
|
+
if (previous) {
|
|
2193
|
+
if (previous.directory === skill.directory && previous.legacy === skill.legacy) {
|
|
2194
|
+
diagnostics.push(`Skill "${skill.metadata.id}" reached through multiple paths`);
|
|
2195
|
+
} else {
|
|
2196
|
+
diagnostics.push(
|
|
2197
|
+
`Skill "${skill.metadata.id}" from ${skill.source ?? "unknown"} overrides ${previous.source ?? "unknown"}`
|
|
2198
|
+
);
|
|
2199
|
+
}
|
|
2200
|
+
}
|
|
2089
2201
|
skillMap.set(skill.metadata.id, skill);
|
|
2090
2202
|
}
|
|
2091
2203
|
}
|
|
2092
|
-
return Array.from(skillMap.values());
|
|
2204
|
+
return { skills: Array.from(skillMap.values()), diagnostics };
|
|
2093
2205
|
}
|
|
2094
2206
|
async function getEnabledSkills(configDir, projectDir) {
|
|
2095
2207
|
const all = await loadAllSkills(configDir, projectDir);
|
|
@@ -2104,10 +2216,12 @@ function isSkillEnabled(skillId) {
|
|
|
2104
2216
|
if (value === null) return true;
|
|
2105
2217
|
return value === "true";
|
|
2106
2218
|
}
|
|
2219
|
+
function setSkillEnabled(skillId, enabled) {
|
|
2220
|
+
setSetting(`${SKILL_SETTING_PREFIX}${skillId}`, String(enabled));
|
|
2221
|
+
}
|
|
2107
2222
|
async function getDefaultSkillIds() {
|
|
2108
|
-
const
|
|
2109
|
-
|
|
2110
|
-
return getDefaultIds(DEFAULTS_DIR_ALT2, SKILL_EXTENSION);
|
|
2223
|
+
const defaults = await loadDefaultSkills();
|
|
2224
|
+
return defaults.map((s) => s.metadata.id);
|
|
2111
2225
|
}
|
|
2112
2226
|
async function isDefaultSkill(skillId) {
|
|
2113
2227
|
const defaultIds = await getDefaultSkillIds();
|
|
@@ -2118,26 +2232,104 @@ function findSkillById(skillId, skills) {
|
|
|
2118
2232
|
}
|
|
2119
2233
|
async function skillExists(configDir, skillId, projectDir) {
|
|
2120
2234
|
if (await pathExists(join6(getSkillsDir(configDir), `${skillId}${SKILL_EXTENSION}`))) return true;
|
|
2235
|
+
if (await pathExists(join6(getSkillsDir(configDir), skillId, "SKILL.md"))) return true;
|
|
2121
2236
|
if (projectDir && await pathExists(join6(getProjectSkillsDir(projectDir), `${skillId}${SKILL_EXTENSION}`)))
|
|
2122
2237
|
return true;
|
|
2238
|
+
if (projectDir && await pathExists(join6(getProjectSkillsDir(projectDir), skillId, "SKILL.md"))) return true;
|
|
2123
2239
|
return false;
|
|
2124
2240
|
}
|
|
2125
|
-
|
|
2126
|
-
const
|
|
2127
|
-
if (
|
|
2128
|
-
|
|
2241
|
+
function portableFrontmatter(skill) {
|
|
2242
|
+
const metadata = {};
|
|
2243
|
+
if (skill.metadata.version) metadata["version"] = skill.metadata.version;
|
|
2244
|
+
if (skill.metadata.name !== skill.metadata.id) {
|
|
2245
|
+
metadata["openfox"] = { displayName: skill.metadata.name };
|
|
2129
2246
|
}
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2247
|
+
return {
|
|
2248
|
+
name: skill.metadata.id,
|
|
2249
|
+
description: skill.metadata.description,
|
|
2250
|
+
...Object.keys(metadata).length ? { metadata } : {}
|
|
2251
|
+
};
|
|
2252
|
+
}
|
|
2253
|
+
async function savePortableSkill(dir, skill) {
|
|
2254
|
+
const packageDir = join6(dir, skill.metadata.id);
|
|
2255
|
+
await mkdir4(packageDir, { recursive: true });
|
|
2256
|
+
await writeFile5(join6(packageDir, "SKILL.md"), matter3.stringify(skill.prompt, portableFrontmatter(skill)), "utf-8");
|
|
2257
|
+
}
|
|
2258
|
+
async function saveSkill(configDir, skill) {
|
|
2259
|
+
await savePortableSkill(getSkillsDir(configDir), skill);
|
|
2133
2260
|
}
|
|
2134
2261
|
async function saveSkillToProject(projectDir, skill) {
|
|
2135
|
-
await
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2262
|
+
await savePortableSkill(getProjectSkillsDir(projectDir), skill);
|
|
2263
|
+
}
|
|
2264
|
+
function asRecord(value) {
|
|
2265
|
+
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
2266
|
+
}
|
|
2267
|
+
function updatedPortableFrontmatter(existing, metadata) {
|
|
2268
|
+
const frontmatter = { ...existing.rawMetadata ?? {} };
|
|
2269
|
+
const portableMetadata = { ...asRecord(frontmatter["metadata"]) };
|
|
2270
|
+
const openfox = { ...asRecord(portableMetadata["openfox"]) };
|
|
2271
|
+
frontmatter["name"] = existing.metadata.id;
|
|
2272
|
+
frontmatter["description"] = metadata.description;
|
|
2273
|
+
if (metadata.version) portableMetadata["version"] = metadata.version;
|
|
2274
|
+
else delete portableMetadata["version"];
|
|
2275
|
+
if (metadata.name !== existing.metadata.id) openfox["displayName"] = metadata.name;
|
|
2276
|
+
else delete openfox["displayName"];
|
|
2277
|
+
if (Object.keys(openfox).length) portableMetadata["openfox"] = openfox;
|
|
2278
|
+
else delete portableMetadata["openfox"];
|
|
2279
|
+
if (Object.keys(portableMetadata).length) frontmatter["metadata"] = portableMetadata;
|
|
2280
|
+
else delete frontmatter["metadata"];
|
|
2281
|
+
return frontmatter;
|
|
2282
|
+
}
|
|
2283
|
+
function canModifySkill(existing) {
|
|
2284
|
+
if (existing.source === "global-openfox" || existing.source === "project-openfox") return true;
|
|
2285
|
+
return !existing.legacy && (existing.source === "global-shared" || existing.source === "selected" || existing.source === "project-shared");
|
|
2286
|
+
}
|
|
2287
|
+
async function updateOwnedSkill(existing, changes) {
|
|
2288
|
+
if (!existing.entrypoint || !canModifySkill(existing)) return null;
|
|
2289
|
+
const normalizedMetadata = {
|
|
2290
|
+
...existing.metadata,
|
|
2291
|
+
...changes.metadata ?? {},
|
|
2292
|
+
id: existing.metadata.id
|
|
2293
|
+
};
|
|
2294
|
+
if (!existing.legacy) {
|
|
2295
|
+
const frontmatter = updatedPortableFrontmatter(existing, normalizedMetadata);
|
|
2296
|
+
const updated2 = {
|
|
2297
|
+
...existing,
|
|
2298
|
+
...changes,
|
|
2299
|
+
metadata: normalizedMetadata,
|
|
2300
|
+
rawMetadata: frontmatter,
|
|
2301
|
+
prompt: changes.prompt ?? existing.prompt
|
|
2302
|
+
};
|
|
2303
|
+
await writeFile5(existing.entrypoint, matter3.stringify(updated2.prompt, frontmatter), "utf-8");
|
|
2304
|
+
return updated2;
|
|
2305
|
+
}
|
|
2306
|
+
const metadata = {
|
|
2307
|
+
...existing.rawMetadata ?? existing.metadata,
|
|
2308
|
+
...changes.metadata ?? {},
|
|
2309
|
+
id: existing.metadata.id
|
|
2310
|
+
};
|
|
2311
|
+
const updated = {
|
|
2312
|
+
...existing,
|
|
2313
|
+
...changes,
|
|
2314
|
+
metadata,
|
|
2315
|
+
rawMetadata: metadata,
|
|
2316
|
+
prompt: changes.prompt ?? existing.prompt
|
|
2317
|
+
};
|
|
2318
|
+
await writeFile5(existing.entrypoint, matter3.stringify(updated.prompt, metadata), "utf-8");
|
|
2319
|
+
return updated;
|
|
2320
|
+
}
|
|
2321
|
+
async function deleteOwnedSkill(existing) {
|
|
2322
|
+
if (!existing.entrypoint || !canModifySkill(existing)) {
|
|
2323
|
+
return { success: false, reason: "This skill is read-only" };
|
|
2324
|
+
}
|
|
2325
|
+
try {
|
|
2326
|
+
if (existing.legacy) await unlink3(existing.entrypoint);
|
|
2327
|
+
else await rm(dirname4(existing.entrypoint), { recursive: true });
|
|
2328
|
+
deleteSetting(`${SKILL_SETTING_PREFIX}${existing.metadata.id}`);
|
|
2329
|
+
return { success: true };
|
|
2330
|
+
} catch {
|
|
2331
|
+
return { success: false, reason: "Cannot delete this skill" };
|
|
2332
|
+
}
|
|
2141
2333
|
}
|
|
2142
2334
|
async function deleteSkill(configDir, skillId) {
|
|
2143
2335
|
const isDefault = await isDefaultSkill(skillId);
|
|
@@ -3258,7 +3450,7 @@ async function loadGitIgnoreRules(workdir) {
|
|
|
3258
3450
|
const gitignorePath = join7(currentDir, ".gitignore");
|
|
3259
3451
|
try {
|
|
3260
3452
|
await access4(gitignorePath);
|
|
3261
|
-
const content = await
|
|
3453
|
+
const content = await readFile8(gitignorePath, "utf-8");
|
|
3262
3454
|
const trimmed = content.trim();
|
|
3263
3455
|
if (!trimmed) return "";
|
|
3264
3456
|
const lines = trimmed.split("\n");
|
|
@@ -3459,7 +3651,7 @@ var callSubAgentTool = {
|
|
|
3459
3651
|
};
|
|
3460
3652
|
}
|
|
3461
3653
|
try {
|
|
3462
|
-
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-
|
|
3654
|
+
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-WGAZKL56.js");
|
|
3463
3655
|
const toolRegistry = getToolRegistryForAgent2(agentDef);
|
|
3464
3656
|
const turnMetrics = new TurnMetrics();
|
|
3465
3657
|
const result = await executeSubAgent({
|
|
@@ -3497,6 +3689,13 @@ var callSubAgentTool = {
|
|
|
3497
3689
|
};
|
|
3498
3690
|
|
|
3499
3691
|
// src/server/tools/load-skill.ts
|
|
3692
|
+
function formatSkillPrompt(skill) {
|
|
3693
|
+
if (skill.legacy !== false || !skill.directory) return skill.prompt;
|
|
3694
|
+
return `Skill package directory: ${skill.directory}
|
|
3695
|
+
Resolve relative paths in these instructions from that directory.
|
|
3696
|
+
|
|
3697
|
+
${skill.prompt}`;
|
|
3698
|
+
}
|
|
3500
3699
|
var handler = async (args, _context, helpers) => {
|
|
3501
3700
|
const { skillId } = args;
|
|
3502
3701
|
if (!skillId) {
|
|
@@ -3513,7 +3712,7 @@ var handler = async (args, _context, helpers) => {
|
|
|
3513
3712
|
const available = allSkills.map((s) => s.metadata.id).join(", ");
|
|
3514
3713
|
return helpers.error(`Skill "${skillId}" not found. Available skills: ${available}`);
|
|
3515
3714
|
}
|
|
3516
|
-
return helpers.success(skill
|
|
3715
|
+
return helpers.success(formatSkillPrompt(skill));
|
|
3517
3716
|
};
|
|
3518
3717
|
var loadSkillTool = createTool(
|
|
3519
3718
|
"load_skill",
|
|
@@ -3710,7 +3909,7 @@ var webFetchTool = createTool(
|
|
|
3710
3909
|
|
|
3711
3910
|
// src/server/dev-server/manager.ts
|
|
3712
3911
|
import { spawn as spawn2 } from "child_process";
|
|
3713
|
-
import { readFile as
|
|
3912
|
+
import { readFile as readFile9, writeFile as writeFile6, mkdir as mkdir5 } from "fs/promises";
|
|
3714
3913
|
import { resolve as resolve5, join as join8 } from "path";
|
|
3715
3914
|
var MAX_LOG_LINES = 2e3;
|
|
3716
3915
|
var MAX_LOG_BYTES = 1e5;
|
|
@@ -3777,7 +3976,7 @@ var DevServerManager = class {
|
|
|
3777
3976
|
async loadConfig(workdir) {
|
|
3778
3977
|
try {
|
|
3779
3978
|
const configPath = getDevServerConfigPath(workdir);
|
|
3780
|
-
const raw = await
|
|
3979
|
+
const raw = await readFile9(configPath, "utf-8");
|
|
3781
3980
|
const parsed = JSON.parse(raw);
|
|
3782
3981
|
if (!parsed.command || !parsed.url) return null;
|
|
3783
3982
|
return {
|
|
@@ -4276,7 +4475,7 @@ function resolveAgentDef2(sessionManager, sessionId) {
|
|
|
4276
4475
|
}
|
|
4277
4476
|
async function buildCachedPrompt(sessionManager, sessionId, agentDef) {
|
|
4278
4477
|
const { instructionContent, skills } = await loadSessionContext(sessionManager, sessionId);
|
|
4279
|
-
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-
|
|
4478
|
+
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-WGAZKL56.js");
|
|
4280
4479
|
const tools = getToolRegistryForAgent2(agentDef).definitions;
|
|
4281
4480
|
const toolFingerprint = getToolFingerprint(tools);
|
|
4282
4481
|
const allAgents = await loadAllAgentsDefault();
|
|
@@ -4289,7 +4488,7 @@ async function buildCachedPrompt(sessionManager, sessionId, agentDef) {
|
|
|
4289
4488
|
async function computeSessionHash(sessionManager, sessionId) {
|
|
4290
4489
|
const { instructionContent, skills } = await loadSessionContext(sessionManager, sessionId);
|
|
4291
4490
|
const agentDef = await resolveAgentDef2(sessionManager, sessionId);
|
|
4292
|
-
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-
|
|
4491
|
+
const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-WGAZKL56.js");
|
|
4293
4492
|
const tools = getToolRegistryForAgent2(agentDef).definitions;
|
|
4294
4493
|
const toolFingerprint = getToolFingerprint(tools);
|
|
4295
4494
|
return computeDynamicContextHash(instructionContent, skills, toolFingerprint);
|
|
@@ -4400,7 +4599,7 @@ var mcpConfigTool = createTool(
|
|
|
4400
4599
|
await saveGlobalConfig(mcpConfigMode, { ...globalConfig, mcpServers: updated }, mcpConfigPath);
|
|
4401
4600
|
}
|
|
4402
4601
|
async function rebuildTools() {
|
|
4403
|
-
const { setMcpTools: setMcpTools2 } = await import("./tools-
|
|
4602
|
+
const { setMcpTools: setMcpTools2 } = await import("./tools-WGAZKL56.js");
|
|
4404
4603
|
const mcpTools = createMcpTools(mcpManagerForTools);
|
|
4405
4604
|
setMcpTools2(mcpTools);
|
|
4406
4605
|
}
|
|
@@ -4502,7 +4701,7 @@ var mcpConfigTool = createTool(
|
|
|
4502
4701
|
);
|
|
4503
4702
|
|
|
4504
4703
|
// src/server/tools/trace-code.ts
|
|
4505
|
-
import { stat as stat2, readFile as
|
|
4704
|
+
import { stat as stat2, readFile as readFile10 } from "fs/promises";
|
|
4506
4705
|
function graphNode(location, depth, relation, symbolName, symbolKind) {
|
|
4507
4706
|
const node = { location, depth, relation, symbolName };
|
|
4508
4707
|
if (symbolKind) node.symbolKind = symbolKind;
|
|
@@ -4534,7 +4733,7 @@ async function getCachedLines(path, approvedPaths) {
|
|
|
4534
4733
|
}
|
|
4535
4734
|
try {
|
|
4536
4735
|
const stats = await stat2(path);
|
|
4537
|
-
const content = await
|
|
4736
|
+
const content = await readFile10(path, "utf-8");
|
|
4538
4737
|
const lines = content.split("\n");
|
|
4539
4738
|
fileCache.set(path, { mtimeMs: stats.mtimeMs, lines });
|
|
4540
4739
|
if (fileCache.size > CACHE_MAX_SIZE) {
|
|
@@ -5036,14 +5235,18 @@ export {
|
|
|
5036
5235
|
loadUserSkills,
|
|
5037
5236
|
loadProjectSkills,
|
|
5038
5237
|
loadAllSkills,
|
|
5238
|
+
loadAllSkillsWithDiagnostics,
|
|
5039
5239
|
getEnabledSkillMetadata,
|
|
5040
5240
|
isSkillEnabled,
|
|
5241
|
+
setSkillEnabled,
|
|
5041
5242
|
getDefaultSkillIds,
|
|
5042
5243
|
isDefaultSkill,
|
|
5043
5244
|
findSkillById,
|
|
5044
5245
|
skillExists,
|
|
5045
5246
|
saveSkill,
|
|
5046
5247
|
saveSkillToProject,
|
|
5248
|
+
updateOwnedSkill,
|
|
5249
|
+
deleteOwnedSkill,
|
|
5047
5250
|
deleteSkill,
|
|
5048
5251
|
deleteProjectSkill,
|
|
5049
5252
|
runTopLevelAgentLoop,
|
|
@@ -5071,4 +5274,4 @@ export {
|
|
|
5071
5274
|
getToolRegistryForAgent,
|
|
5072
5275
|
createToolRegistry
|
|
5073
5276
|
};
|
|
5074
|
-
//# sourceMappingURL=chunk-
|
|
5277
|
+
//# sourceMappingURL=chunk-3JRYK5UG.js.map
|