@wrongstack/core 0.277.2 → 0.280.1
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/{agent-bridge-BFJ2ODzI.d.ts → agent-bridge-DXC6QDJ4.d.ts} +1 -1
- package/dist/{agent-subagent-runner-BimKihiC.d.ts → agent-subagent-runner-PoqNKiR4.d.ts} +563 -471
- package/dist/{compactor-D3BGw26y.d.ts → compactor-U3agvUIG.d.ts} +1 -1
- package/dist/{config-DAOjriz9.d.ts → config-Cr3312zc.d.ts} +102 -4
- package/dist/coordination/index.d.ts +1087 -998
- package/dist/coordination/index.js +12235 -12052
- package/dist/coordination/index.js.map +1 -1
- package/dist/defaults/index.d.ts +31 -30
- package/dist/defaults/index.js +403 -189
- package/dist/defaults/index.js.map +1 -1
- package/dist/{brain-CCfuEOdp.d.ts → events-Bs2fmldo.d.ts} +117 -112
- package/dist/execution/index.d.ts +27 -19
- package/dist/execution/index.js +216 -63
- package/dist/execution/index.js.map +1 -1
- package/dist/execution/prompt-enhancer.d.ts +1 -1
- package/dist/execution/prompt-enhancer.js.map +1 -1
- package/dist/extension/index.d.ts +8 -7
- package/dist/{global-mailbox-Dr4cTKqL.d.ts → global-mailbox-Ct7IorLJ.d.ts} +84 -6
- package/dist/{goal-store-C1uH4srH.d.ts → goal-store-C4F6DjC0.d.ts} +1 -1
- package/dist/hq/index.d.ts +504 -7
- package/dist/hq/index.js +1069 -20
- package/dist/hq/index.js.map +1 -1
- package/dist/{index-DJXj-dcr.d.ts → index-kidebiDh.d.ts} +8 -5
- package/dist/{index-cMEmzCVN.d.ts → index-nP09-oP2.d.ts} +2 -2
- package/dist/index.d.ts +153 -76
- package/dist/index.js +5791 -3163
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/index.d.ts +7 -6
- package/dist/kernel/index.d.ts +14 -13
- package/dist/kernel/index.js +31 -15
- package/dist/kernel/index.js.map +1 -1
- package/dist/{mailbox-types-DTl7bRH3.d.ts → mailbox-types-BGZWrYTJ.d.ts} +38 -0
- package/dist/{mcp-servers-CFb60-pH.d.ts → mcp-servers-D910X5_r.d.ts} +3 -3
- package/dist/models/index.d.ts +5 -5
- package/dist/models/index.js.map +1 -1
- package/dist/{models-registry-5Ufn7f2m.d.ts → models-registry-CLkoOcHk.d.ts} +1 -1
- package/dist/{multi-agent-coordinator-CcrcncvG.d.ts → multi-agent-coordinator-CieyUoEL.d.ts} +1 -1
- package/dist/{null-fleet-bus-C9KsYyrI.d.ts → null-fleet-bus-DkdmZJ_W.d.ts} +464 -464
- package/dist/observability/index.d.ts +3 -2
- package/dist/{path-resolver-CEeX9I7O.d.ts → path-resolver-XfZ9eLxG.d.ts} +3 -3
- package/dist/{permission-DbsGOA1C.d.ts → permission-Dx6dIqS2.d.ts} +2 -7
- package/dist/{permission-policy-BpEea3r7.d.ts → permission-policy-C8vJcnX5.d.ts} +2 -2
- package/dist/{pipeline-CEjBjzVA.d.ts → pipeline-BwAP21_4.d.ts} +9 -4
- package/dist/{provider-model-resolve-BpfXp3Jj.d.ts → provider-model-resolve-CwQNZWt_.d.ts} +3 -3
- package/dist/{provider-runner-CnOSr5BN.d.ts → provider-runner-CYHFImzV.d.ts} +3 -3
- package/dist/{retry-policy-Git9WF6d.d.ts → retry-policy-D4feSLk3.d.ts} +1 -1
- package/dist/sdd/index.d.ts +11 -10
- package/dist/sdd/index.js +2 -2
- package/dist/sdd/index.js.map +1 -1
- package/dist/secret-scrubber-3MHDDAtm.d.ts +6 -0
- package/dist/{secret-vault-DDSMHqIm.d.ts → secret-vault-CImt2XrR.d.ts} +1 -1
- package/dist/security/index.d.ts +6 -5
- package/dist/security/index.js.map +1 -1
- package/dist/{selector-Cq72C0Oy.d.ts → selector-Dy-MzKp1.d.ts} +1 -1
- package/dist/{session-event-bridge-DG94B3Bk.d.ts → session-event-bridge-CqdiGnfU.d.ts} +1 -1
- package/dist/{session-reader-BzT-iMQT.d.ts → session-reader-Hk0WbNm9.d.ts} +1 -1
- package/dist/{skill-DGIXCtdv.d.ts → skill-DHniprNl.d.ts} +15 -1
- package/dist/skills/index.d.ts +472 -26
- package/dist/skills/index.js +872 -129
- package/dist/skills/index.js.map +1 -1
- package/dist/storage/index.d.ts +27 -14
- package/dist/storage/index.js +264 -85
- package/dist/storage/index.js.map +1 -1
- package/dist/{strategy-compactor-Bt_ZH6R0.d.ts → strategy-compactor-CQwhbErd.d.ts} +32 -17
- package/dist/{todos-checkpoint-CH1pcua9.d.ts → todos-checkpoint-Bk2uP7Ex.d.ts} +6 -6
- package/dist/{context-DPlA6kid.d.ts → tool-BkOgs_KL.d.ts} +306 -286
- package/dist/{tool-executor-SVFq7IOR.d.ts → tool-executor-SiE1wlZo.d.ts} +9 -9
- package/dist/tools/index.d.ts +2 -2
- package/dist/tools/index.js.map +1 -1
- package/dist/types/index.d.ts +22 -21
- package/dist/types/index.js +7 -9
- package/dist/types/index.js.map +1 -1
- package/dist/utils/index.d.ts +30 -4
- package/dist/utils/index.js +50 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/{worktree-manager-C4YIf1Fa.d.ts → worktree-manager-BjOFF6bt.d.ts} +1 -1
- package/dist/{wstack-paths-_NrRovdr.d.ts → wstack-paths-CMl_cYgq.d.ts} +8 -0
- package/package.json +1 -1
- package/skills/mailbox-bridge/SKILL.md +1 -0
- package/skills/plugin-author/SKILL.md +350 -0
- package/skills/sdd/SKILL.md +134 -134
- package/skills/skill-creator/SKILL.md +45 -7
- package/skills/wrongstack-mailbox/SKILL.md +40 -21
package/dist/execution/index.js
CHANGED
|
@@ -37,8 +37,8 @@ async function atomicWrite(targetPath, content, opts = {}) {
|
|
|
37
37
|
}
|
|
38
38
|
let mode;
|
|
39
39
|
try {
|
|
40
|
-
const
|
|
41
|
-
mode =
|
|
40
|
+
const stat3 = await fs.stat(targetPath);
|
|
41
|
+
mode = stat3.mode & 511;
|
|
42
42
|
} catch {
|
|
43
43
|
mode = opts.mode;
|
|
44
44
|
}
|
|
@@ -95,6 +95,7 @@ function createContextEvidenceState() {
|
|
|
95
95
|
toolCalls: [],
|
|
96
96
|
fileGraph: {},
|
|
97
97
|
repeatedReads: [],
|
|
98
|
+
completedWork: [],
|
|
98
99
|
updatedAt: Date.now()
|
|
99
100
|
};
|
|
100
101
|
}
|
|
@@ -157,6 +158,7 @@ function ensureEvidence(ctx) {
|
|
|
157
158
|
if (!ctx.contextEvidence) {
|
|
158
159
|
ctx.contextEvidence = createContextEvidenceState();
|
|
159
160
|
}
|
|
161
|
+
ctx.contextEvidence.completedWork ??= [];
|
|
160
162
|
return ctx.contextEvidence;
|
|
161
163
|
}
|
|
162
164
|
|
|
@@ -1414,16 +1416,20 @@ function wstackGlobalRoot() {
|
|
|
1414
1416
|
}
|
|
1415
1417
|
function resolveWstackPaths(opts) {
|
|
1416
1418
|
const globalRoot = opts.globalRoot ?? (opts.userHome ? path3.join(opts.userHome, ".wrongstack") : wstackGlobalRoot());
|
|
1419
|
+
const homeDir = opts.userHome ?? os.homedir();
|
|
1417
1420
|
const hash = projectHash(opts.projectRoot);
|
|
1418
1421
|
const slug = projectSlug(opts.projectRoot);
|
|
1419
1422
|
const projectDir = path3.join(globalRoot, "projects", slug);
|
|
1420
1423
|
return {
|
|
1421
1424
|
globalRoot,
|
|
1425
|
+
projectRoot: opts.projectRoot,
|
|
1426
|
+
homeDir,
|
|
1422
1427
|
configDir: globalRoot,
|
|
1423
1428
|
globalConfig: path3.join(globalRoot, "config.json"),
|
|
1424
1429
|
secretsKey: path3.join(globalRoot, ".key"),
|
|
1425
1430
|
globalMemory: path3.join(globalRoot, "memory.md"),
|
|
1426
1431
|
globalSkills: path3.join(globalRoot, "skills"),
|
|
1432
|
+
globalClaudeSkills: path3.join(homeDir, ".claude", "skills"),
|
|
1427
1433
|
globalDesignKits: path3.join(globalRoot, "design-kits"),
|
|
1428
1434
|
globalPrompts: path3.join(globalRoot, "prompts"),
|
|
1429
1435
|
globalInstructions: path3.join(globalRoot, "instructions"),
|
|
@@ -1443,6 +1449,7 @@ function resolveWstackPaths(opts) {
|
|
|
1443
1449
|
inProjectConfig: path3.join(opts.projectRoot, ".wrongstack", "config.json"),
|
|
1444
1450
|
inProjectAgentsFile: path3.join(opts.projectRoot, ".wrongstack", "AGENTS.md"),
|
|
1445
1451
|
inProjectSkills: path3.join(opts.projectRoot, ".wrongstack", "skills"),
|
|
1452
|
+
inProjectClaudeSkills: path3.join(opts.projectRoot, ".claude", "skills"),
|
|
1446
1453
|
inProjectPrompts: path3.join(opts.projectRoot, ".wrongstack", "prompts"),
|
|
1447
1454
|
inProjectInstructions: path3.join(opts.projectRoot, ".wrongstack", "instructions"),
|
|
1448
1455
|
inProjectDesignKits: path3.join(opts.projectRoot, ".wrongstack", "design-kits"),
|
|
@@ -2142,7 +2149,7 @@ function readBundledInstructionText(relativePath) {
|
|
|
2142
2149
|
function renderInstructionTemplate(template, values) {
|
|
2143
2150
|
return template.replace(
|
|
2144
2151
|
/\{\{\s*([a-zA-Z0-9_.-]+)\s*\}\}/g,
|
|
2145
|
-
(match, key) => Object.
|
|
2152
|
+
(match, key) => Object.hasOwn(values, key) ? values[key] ?? "" : match
|
|
2146
2153
|
);
|
|
2147
2154
|
}
|
|
2148
2155
|
function instructionRootCandidates() {
|
|
@@ -4783,6 +4790,17 @@ var IntelligentCompactor = class {
|
|
|
4783
4790
|
};
|
|
4784
4791
|
|
|
4785
4792
|
// src/execution/model-runtime.ts
|
|
4793
|
+
function mergeModelRuntime(base, override) {
|
|
4794
|
+
if (!base) return override;
|
|
4795
|
+
if (!override) return base;
|
|
4796
|
+
return {
|
|
4797
|
+
...base,
|
|
4798
|
+
...override,
|
|
4799
|
+
reasoning: base.reasoning || override.reasoning ? { ...base.reasoning, ...override.reasoning } : void 0,
|
|
4800
|
+
cache: base.cache || override.cache ? { ...base.cache, ...override.cache } : void 0,
|
|
4801
|
+
parameters: base.parameters || override.parameters ? { ...base.parameters, ...override.parameters } : void 0
|
|
4802
|
+
};
|
|
4803
|
+
}
|
|
4786
4804
|
function resolveModelRuntime(settings, reasoning, capabilities) {
|
|
4787
4805
|
const warnings = [];
|
|
4788
4806
|
if (!settings) {
|
|
@@ -9073,6 +9091,134 @@ Summarize the following message range:`;
|
|
|
9073
9091
|
return estimateMessages(messages);
|
|
9074
9092
|
}
|
|
9075
9093
|
};
|
|
9094
|
+
|
|
9095
|
+
// src/skills/foreign-sources.ts
|
|
9096
|
+
var FOREIGN_SKILL_TOOLS = [
|
|
9097
|
+
{ id: "agents", subdir: "skills" },
|
|
9098
|
+
// shared store (asm / agentskills.io ecosystem)
|
|
9099
|
+
{ id: "codex", subdir: "skills" },
|
|
9100
|
+
// OpenAI Codex CLI
|
|
9101
|
+
{ id: "gemini", subdir: "skills" },
|
|
9102
|
+
// Gemini CLI
|
|
9103
|
+
{ id: "cursor", subdir: "skills" },
|
|
9104
|
+
// Cursor (standard subdir, aligned with skills.sh ecosystem)
|
|
9105
|
+
{ id: "qwen", subdir: "skills" },
|
|
9106
|
+
// Qwen Code
|
|
9107
|
+
{ id: "trae", subdir: "skills" },
|
|
9108
|
+
// Trae
|
|
9109
|
+
{ id: "windsurf", subdir: "skills" }
|
|
9110
|
+
// Windsurf
|
|
9111
|
+
];
|
|
9112
|
+
var KNOWN_FOREIGN_IDS = new Set(FOREIGN_SKILL_TOOLS.map((t) => t.id));
|
|
9113
|
+
function resolveForeignToolIds(opt) {
|
|
9114
|
+
return resolveForeignToolIdsWithWarnings(opt).ids;
|
|
9115
|
+
}
|
|
9116
|
+
function resolveForeignToolIdsWithWarnings(opt) {
|
|
9117
|
+
if (opt === false) return { ids: [], unknownIds: [] };
|
|
9118
|
+
if (Array.isArray(opt)) {
|
|
9119
|
+
const ids = [];
|
|
9120
|
+
const unknownIds = [];
|
|
9121
|
+
for (const id of opt) {
|
|
9122
|
+
if (KNOWN_FOREIGN_IDS.has(id)) ids.push(id);
|
|
9123
|
+
else unknownIds.push(id);
|
|
9124
|
+
}
|
|
9125
|
+
return { ids, unknownIds };
|
|
9126
|
+
}
|
|
9127
|
+
return { ids: FOREIGN_SKILL_TOOLS.map((t) => t.id), unknownIds: [] };
|
|
9128
|
+
}
|
|
9129
|
+
|
|
9130
|
+
// src/skills/frontmatter.ts
|
|
9131
|
+
var SCALAR_KEYS = /* @__PURE__ */ new Set(["name", "description", "version", "license", "compatibility"]);
|
|
9132
|
+
function parseSkillFrontmatter(raw) {
|
|
9133
|
+
const text = normalizeLineEndings(raw);
|
|
9134
|
+
if (!text.startsWith("---")) return {};
|
|
9135
|
+
const end = text.indexOf("\n---", 4);
|
|
9136
|
+
if (end === -1) return {};
|
|
9137
|
+
return parseFrontmatterBlock(text.slice(4, end));
|
|
9138
|
+
}
|
|
9139
|
+
function normalizeLineEndings(s) {
|
|
9140
|
+
return s.replace(/\r\n?/g, "\n");
|
|
9141
|
+
}
|
|
9142
|
+
function parseFrontmatterBlock(block) {
|
|
9143
|
+
const out = {};
|
|
9144
|
+
const lines = block.split("\n");
|
|
9145
|
+
let i = 0;
|
|
9146
|
+
while (i < lines.length) {
|
|
9147
|
+
const line = lines[i] ?? "";
|
|
9148
|
+
const m = /^([a-zA-Z][a-zA-Z0-9_-]*):\s*(.*)$/.exec(line);
|
|
9149
|
+
if (!m) {
|
|
9150
|
+
i++;
|
|
9151
|
+
continue;
|
|
9152
|
+
}
|
|
9153
|
+
const key = m[1] ?? "";
|
|
9154
|
+
const rest = (m[2] ?? "").trim();
|
|
9155
|
+
if (key === "metadata") {
|
|
9156
|
+
const map = {};
|
|
9157
|
+
i++;
|
|
9158
|
+
while (i < lines.length) {
|
|
9159
|
+
const sub = lines[i] ?? "";
|
|
9160
|
+
const sm = /^\s+([a-zA-Z0-9_.-]+):\s*(.*)$/.exec(sub);
|
|
9161
|
+
if (!sm) break;
|
|
9162
|
+
map[sm[1] ?? ""] = unquote((sm[2] ?? "").trim());
|
|
9163
|
+
i++;
|
|
9164
|
+
}
|
|
9165
|
+
if (Object.keys(map).length > 0) out.metadata = map;
|
|
9166
|
+
continue;
|
|
9167
|
+
}
|
|
9168
|
+
if (rest === "|" || rest === ">") {
|
|
9169
|
+
const collected = [];
|
|
9170
|
+
i++;
|
|
9171
|
+
while (i < lines.length) {
|
|
9172
|
+
const sub = lines[i] ?? "";
|
|
9173
|
+
if (sub === "" || sub.startsWith(" ") || sub.startsWith(" ")) {
|
|
9174
|
+
collected.push(sub.replace(/^\s+/, ""));
|
|
9175
|
+
i++;
|
|
9176
|
+
} else break;
|
|
9177
|
+
}
|
|
9178
|
+
out[normalizeKey(key)] = collected.join("\n").trim();
|
|
9179
|
+
continue;
|
|
9180
|
+
}
|
|
9181
|
+
if (key === "allowed-tools" || key === "allowedTools") {
|
|
9182
|
+
out.allowedTools = rest.split(/[\s,]+/).filter(Boolean);
|
|
9183
|
+
i++;
|
|
9184
|
+
continue;
|
|
9185
|
+
}
|
|
9186
|
+
if (SCALAR_KEYS.has(key)) {
|
|
9187
|
+
out[key] = unquote(rest);
|
|
9188
|
+
i++;
|
|
9189
|
+
continue;
|
|
9190
|
+
}
|
|
9191
|
+
i++;
|
|
9192
|
+
}
|
|
9193
|
+
return out;
|
|
9194
|
+
}
|
|
9195
|
+
function normalizeKey(key) {
|
|
9196
|
+
return key === "allowed-tools" ? "allowedTools" : key;
|
|
9197
|
+
}
|
|
9198
|
+
function unquote(s) {
|
|
9199
|
+
if (s.length >= 2 && (s.startsWith('"') && s.endsWith('"') || s.startsWith("'") && s.endsWith("'"))) {
|
|
9200
|
+
return s.slice(1, -1);
|
|
9201
|
+
}
|
|
9202
|
+
return s;
|
|
9203
|
+
}
|
|
9204
|
+
function isValidSkillNameFormat(name) {
|
|
9205
|
+
return name.length >= 1 && name.length <= 64 && /^[a-z0-9]+(-[a-z0-9]+)*$/.test(name);
|
|
9206
|
+
}
|
|
9207
|
+
|
|
9208
|
+
// src/skills/limits.ts
|
|
9209
|
+
var SKILL_LIMITS = {
|
|
9210
|
+
/**
|
|
9211
|
+
* Auto-compact body limits (the token-saving fallback used when a skill has
|
|
9212
|
+
* no hand-crafted `SKILL.save.md`). The Overview and Rules sections are
|
|
9213
|
+
* extracted and trimmed to these char budgets, then the total is capped.
|
|
9214
|
+
*
|
|
9215
|
+
* Consumer: `DefaultSkillLoader.compactSkillBody`.
|
|
9216
|
+
*/
|
|
9217
|
+
COMPACT_OVERVIEW_MAX: 200,
|
|
9218
|
+
COMPACT_RULES_MAX: 350,
|
|
9219
|
+
COMPACT_TOTAL_MAX: 450};
|
|
9220
|
+
|
|
9221
|
+
// src/execution/skill-loader.ts
|
|
9076
9222
|
function stripFrontmatter2(raw) {
|
|
9077
9223
|
if (!raw.startsWith("---")) return raw;
|
|
9078
9224
|
const end = raw.indexOf("\n---", 4);
|
|
@@ -9086,21 +9232,33 @@ function compactSkillBody(body) {
|
|
|
9086
9232
|
const overviewMatch = body.match(/##\s*Overview\s*\n([\s\S]*?)(?=\n##|\n$|$)/i);
|
|
9087
9233
|
const overview = overviewMatch?.[1];
|
|
9088
9234
|
if (overview?.trim()) {
|
|
9089
|
-
sections.push(overview.trim().slice(0,
|
|
9235
|
+
sections.push(overview.trim().slice(0, SKILL_LIMITS.COMPACT_OVERVIEW_MAX));
|
|
9090
9236
|
}
|
|
9091
9237
|
const rulesMatch = body.match(/##\s*Rules\s*\n([\s\S]*?)(?=\n##|\n$|$)/i);
|
|
9092
9238
|
const rules = rulesMatch?.[1];
|
|
9093
9239
|
if (rules?.trim()) {
|
|
9094
|
-
const trimmed = rules.trim().slice(0,
|
|
9240
|
+
const trimmed = rules.trim().slice(0, SKILL_LIMITS.COMPACT_RULES_MAX);
|
|
9095
9241
|
const ruleLines = trimmed.split("\n").filter((l) => /^\s*[-*]\s/.test(l) || /^\s*\d+[.)]\s/.test(l)).slice(0, 6).join("\n");
|
|
9096
9242
|
if (ruleLines) sections.push(ruleLines);
|
|
9097
9243
|
}
|
|
9098
9244
|
if (sections.length === 0) {
|
|
9099
|
-
const first = body.trim().slice(0,
|
|
9245
|
+
const first = body.trim().slice(0, SKILL_LIMITS.COMPACT_OVERVIEW_MAX);
|
|
9100
9246
|
if (first) sections.push(first);
|
|
9101
9247
|
}
|
|
9102
9248
|
const result = sections.join("\n\n");
|
|
9103
|
-
|
|
9249
|
+
const total = SKILL_LIMITS.COMPACT_TOTAL_MAX;
|
|
9250
|
+
return result.length > total ? result.slice(0, total - 3) + "\u2026" : result;
|
|
9251
|
+
}
|
|
9252
|
+
async function entryIsDirectory(dir, entry) {
|
|
9253
|
+
if (entry.isDirectory()) return true;
|
|
9254
|
+
if (entry.isSymbolicLink()) {
|
|
9255
|
+
try {
|
|
9256
|
+
return (await fs.stat(path3.join(dir, entry.name))).isDirectory();
|
|
9257
|
+
} catch {
|
|
9258
|
+
return false;
|
|
9259
|
+
}
|
|
9260
|
+
}
|
|
9261
|
+
return false;
|
|
9104
9262
|
}
|
|
9105
9263
|
var DefaultSkillLoader = class {
|
|
9106
9264
|
dirs;
|
|
@@ -9108,36 +9266,58 @@ var DefaultSkillLoader = class {
|
|
|
9108
9266
|
entriesCache;
|
|
9109
9267
|
bodyCache = /* @__PURE__ */ new Map();
|
|
9110
9268
|
constructor(opts) {
|
|
9111
|
-
|
|
9112
|
-
|
|
9113
|
-
|
|
9114
|
-
|
|
9115
|
-
|
|
9116
|
-
|
|
9117
|
-
|
|
9269
|
+
const readClaude = opts.readClaudeSkills !== false;
|
|
9270
|
+
const foreignIds = resolveForeignToolIds(opts.foreignSources);
|
|
9271
|
+
const dirs = [];
|
|
9272
|
+
const pushForeign = (root) => {
|
|
9273
|
+
if (!root) return;
|
|
9274
|
+
for (const tool of FOREIGN_SKILL_TOOLS) {
|
|
9275
|
+
if (!foreignIds.includes(tool.id)) continue;
|
|
9276
|
+
dirs.push({
|
|
9277
|
+
dir: path3.join(root, "." + tool.id, tool.subdir),
|
|
9278
|
+
source: "foreign",
|
|
9279
|
+
originTool: tool.id
|
|
9280
|
+
});
|
|
9281
|
+
}
|
|
9282
|
+
};
|
|
9283
|
+
dirs.push({ dir: opts.paths.inProjectSkills, source: "project" });
|
|
9284
|
+
if (readClaude) dirs.push({ dir: opts.paths.inProjectClaudeSkills, source: "claude-project" });
|
|
9285
|
+
pushForeign(opts.paths.projectRoot);
|
|
9286
|
+
dirs.push({ dir: opts.paths.globalSkills, source: "user" });
|
|
9287
|
+
if (readClaude) dirs.push({ dir: opts.paths.globalClaudeSkills, source: "claude-user" });
|
|
9288
|
+
pushForeign(opts.paths.homeDir);
|
|
9289
|
+
for (const d of opts.extraDirs ?? []) dirs.push({ dir: d, source: "extra" });
|
|
9290
|
+
if (opts.bundledDir) dirs.push({ dir: opts.bundledDir, source: "bundled" });
|
|
9291
|
+
this.dirs = dirs;
|
|
9118
9292
|
}
|
|
9119
9293
|
async list() {
|
|
9120
9294
|
if (this.cache) return this.cache;
|
|
9121
9295
|
const found = [];
|
|
9122
9296
|
const seen = /* @__PURE__ */ new Set();
|
|
9123
|
-
for (const { dir, source } of this.dirs) {
|
|
9297
|
+
for (const { dir, source, originTool } of this.dirs) {
|
|
9124
9298
|
try {
|
|
9125
9299
|
const entries = await fs.readdir(dir, { withFileTypes: true });
|
|
9126
9300
|
for (const e of entries) {
|
|
9127
|
-
if (!e
|
|
9301
|
+
if (!await entryIsDirectory(dir, e)) continue;
|
|
9128
9302
|
const skillFile = path3.join(dir, e.name, "SKILL.md");
|
|
9129
9303
|
try {
|
|
9130
9304
|
const raw = await fs.readFile(skillFile, "utf8");
|
|
9131
|
-
const
|
|
9132
|
-
if (!
|
|
9133
|
-
if (
|
|
9134
|
-
seen.
|
|
9305
|
+
const fm = parseSkillFrontmatter(raw);
|
|
9306
|
+
if (!fm.name || !fm.description) continue;
|
|
9307
|
+
if (!isValidSkillNameFormat(fm.name)) continue;
|
|
9308
|
+
if (seen.has(fm.name)) continue;
|
|
9309
|
+
seen.add(fm.name);
|
|
9135
9310
|
found.push({
|
|
9136
|
-
name:
|
|
9137
|
-
description:
|
|
9138
|
-
version:
|
|
9311
|
+
name: fm.name,
|
|
9312
|
+
description: fm.description,
|
|
9313
|
+
version: fm.version,
|
|
9314
|
+
license: fm.license,
|
|
9315
|
+
compatibility: fm.compatibility,
|
|
9316
|
+
metadata: fm.metadata,
|
|
9317
|
+
allowedTools: fm.allowedTools,
|
|
9139
9318
|
path: skillFile,
|
|
9140
|
-
source
|
|
9319
|
+
source,
|
|
9320
|
+
originTool
|
|
9141
9321
|
});
|
|
9142
9322
|
} catch {
|
|
9143
9323
|
}
|
|
@@ -9170,7 +9350,14 @@ var DefaultSkillLoader = class {
|
|
|
9170
9350
|
const entries = [];
|
|
9171
9351
|
for (const s of skills) {
|
|
9172
9352
|
const { trigger, scope } = parseDescriptionFromText(s.description ?? "");
|
|
9173
|
-
entries.push({
|
|
9353
|
+
entries.push({
|
|
9354
|
+
name: s.name,
|
|
9355
|
+
trigger,
|
|
9356
|
+
scope,
|
|
9357
|
+
source: s.source,
|
|
9358
|
+
originTool: s.originTool,
|
|
9359
|
+
path: s.path
|
|
9360
|
+
});
|
|
9174
9361
|
}
|
|
9175
9362
|
this.entriesCache = entries;
|
|
9176
9363
|
return entries;
|
|
@@ -9216,42 +9403,6 @@ ${compact}`;
|
|
|
9216
9403
|
return result;
|
|
9217
9404
|
}
|
|
9218
9405
|
};
|
|
9219
|
-
function parseFrontmatter(raw) {
|
|
9220
|
-
if (!raw.startsWith("---")) return {};
|
|
9221
|
-
const end = raw.indexOf("\n---", 4);
|
|
9222
|
-
if (end === -1) return {};
|
|
9223
|
-
const block = raw.slice(4, end);
|
|
9224
|
-
const out = {};
|
|
9225
|
-
let key = null;
|
|
9226
|
-
let value = [];
|
|
9227
|
-
const flush = () => {
|
|
9228
|
-
if (key) {
|
|
9229
|
-
out[key] = value.join("\n").trim();
|
|
9230
|
-
}
|
|
9231
|
-
key = null;
|
|
9232
|
-
value = [];
|
|
9233
|
-
};
|
|
9234
|
-
for (const line of block.split("\n")) {
|
|
9235
|
-
const m = /^([a-zA-Z_]+):\s*(\|?)\s*(.*)$/.exec(line);
|
|
9236
|
-
if (m) {
|
|
9237
|
-
flush();
|
|
9238
|
-
key = m[1] ?? "";
|
|
9239
|
-
const pipe = m[2];
|
|
9240
|
-
const rest = m[3] ?? "";
|
|
9241
|
-
if (pipe === "|") {
|
|
9242
|
-
value = [];
|
|
9243
|
-
} else if (rest) {
|
|
9244
|
-
value = [rest];
|
|
9245
|
-
} else {
|
|
9246
|
-
value = [];
|
|
9247
|
-
}
|
|
9248
|
-
} else if (key) {
|
|
9249
|
-
value.push(line.replace(/^\s+/, ""));
|
|
9250
|
-
}
|
|
9251
|
-
}
|
|
9252
|
-
flush();
|
|
9253
|
-
return out;
|
|
9254
|
-
}
|
|
9255
9406
|
function parseDescriptionFromText(desc) {
|
|
9256
9407
|
const firstSentenceEnd = desc.indexOf(". ");
|
|
9257
9408
|
const trigger = firstSentenceEnd !== -1 ? desc.slice(0, firstSentenceEnd + 1).trim() : desc.trim().split("\n")[0] ?? "";
|
|
@@ -10003,7 +10154,9 @@ ${errorDetails}`,
|
|
|
10003
10154
|
toolUseId: use.id,
|
|
10004
10155
|
toolName: tool.name,
|
|
10005
10156
|
input: use.input,
|
|
10006
|
-
suggestedPattern
|
|
10157
|
+
suggestedPattern,
|
|
10158
|
+
decisionSource: decision.source,
|
|
10159
|
+
riskTier: decision.riskTier ?? tool.riskTier
|
|
10007
10160
|
};
|
|
10008
10161
|
return { result: pending, tool, durationMs: Date.now() - start };
|
|
10009
10162
|
}
|
|
@@ -10468,6 +10621,6 @@ async function maybePersistLargeToolOutput(toolName, content, budget) {
|
|
|
10468
10621
|
}
|
|
10469
10622
|
}
|
|
10470
10623
|
|
|
10471
|
-
export { AutoCompactionMiddleware, AutonomousRunner, DefaultDesignKitLoader, DefaultErrorHandler, DefaultPromptLoader, DefaultRetryPolicy, DefaultSkillLoader, DoneConditionChecker, EternalAutonomyEngine, HybridCompactor, IntelligentCompactor, ParallelEternalEngine, SelectiveCompactor, ToolExecutor, _resetDesignKitLoaderMemo, _resetDesignRulesCache, activateDesign, applyModelRuntime, buildGoalPreamble, clearActiveKit, clearPersistedActiveKit, createAutonomyBrain, createStrategyCompactor, createTieredBrainArbiter, designProjectDir, detectFrontendFile, detectFrontendIntent, formatDecisionSummary, getDesignKitLoader, getDesignState, installDesignStudioMiddleware, loadActiveKit, loadProjectDesignRules, makeAutonomyPromptContributor, makeDesignDetectToolCallMiddleware, makeDesignDetectUserInputMiddleware, makeDesignStudioRequestMiddleware, recordKitChoice, renderPrompt, resolveBundledDesignKitsDir, resolveCacheForRequest, resolveModelRuntime, resolveReasoningForRequest, setActiveKit };
|
|
10624
|
+
export { AutoCompactionMiddleware, AutonomousRunner, DefaultDesignKitLoader, DefaultErrorHandler, DefaultPromptLoader, DefaultRetryPolicy, DefaultSkillLoader, DoneConditionChecker, EternalAutonomyEngine, HybridCompactor, IntelligentCompactor, ParallelEternalEngine, SelectiveCompactor, ToolExecutor, _resetDesignKitLoaderMemo, _resetDesignRulesCache, activateDesign, applyModelRuntime, buildGoalPreamble, clearActiveKit, clearPersistedActiveKit, createAutonomyBrain, createStrategyCompactor, createTieredBrainArbiter, designProjectDir, detectFrontendFile, detectFrontendIntent, formatDecisionSummary, getDesignKitLoader, getDesignState, installDesignStudioMiddleware, loadActiveKit, loadProjectDesignRules, makeAutonomyPromptContributor, makeDesignDetectToolCallMiddleware, makeDesignDetectUserInputMiddleware, makeDesignStudioRequestMiddleware, mergeModelRuntime, recordKitChoice, renderPrompt, resolveBundledDesignKitsDir, resolveCacheForRequest, resolveModelRuntime, resolveReasoningForRequest, setActiveKit };
|
|
10472
10625
|
//# sourceMappingURL=index.js.map
|
|
10473
10626
|
//# sourceMappingURL=index.js.map
|