@ngocsangairvds/vsaf 5.1.12 → 5.1.13
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/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cursor.d.ts","sourceRoot":"","sources":["../../src/adapters/cursor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cursor.d.ts","sourceRoot":"","sources":["../../src/adapters/cursor.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,eAAe,EAAwD,MAAM,cAAc,CAAC;AAG1G,eAAO,MAAM,aAAa,EAAE,eAsE3B,CAAC"}
|
|
@@ -2,10 +2,14 @@
|
|
|
2
2
|
// packages/cli/src/adapters/cursor.ts
|
|
3
3
|
// Cursor adapter. Cursor has no native VSAF skill object, so it writes rule and
|
|
4
4
|
// command proxies that point at canonical .vsaf/skills instead of copying skills.
|
|
5
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
|
+
};
|
|
5
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
9
|
exports.cursorAdapter = void 0;
|
|
7
10
|
const fs_1 = require("fs");
|
|
8
11
|
const path_1 = require("path");
|
|
12
|
+
const js_yaml_1 = __importDefault(require("js-yaml"));
|
|
9
13
|
const adapter_js_1 = require("./adapter.js");
|
|
10
14
|
const shared_js_1 = require("./shared.js");
|
|
11
15
|
exports.cursorAdapter = {
|
|
@@ -24,7 +28,29 @@ exports.cursorAdapter = {
|
|
|
24
28
|
const commandsDir = (0, path_1.join)(cursorDir, 'commands');
|
|
25
29
|
(0, fs_1.mkdirSync)(rulesDir, { recursive: true });
|
|
26
30
|
(0, fs_1.mkdirSync)(commandsDir, { recursive: true });
|
|
27
|
-
//
|
|
31
|
+
// 1a. Workflow proxies (level 1/2 nodes: master-sdlc, sdlc-prd, …) — the
|
|
32
|
+
// primary entry points. Each command drives the run through the vsaf MCP
|
|
33
|
+
// engine; node content is always read from canonical .vsaf/.
|
|
34
|
+
for (const [filename, yamlContent] of Object.entries(ctx.packInfo.workflows ?? {})) {
|
|
35
|
+
const wfName = (0, path_1.basename)(filename, '.yaml');
|
|
36
|
+
let desc = `Run the VSAF ${wfName} workflow`;
|
|
37
|
+
try {
|
|
38
|
+
const parsed = js_yaml_1.default.load(yamlContent);
|
|
39
|
+
if (parsed?.description)
|
|
40
|
+
desc = parsed.description.trim().split('\n')[0];
|
|
41
|
+
}
|
|
42
|
+
catch { /* use fallback description */ }
|
|
43
|
+
const wfBody = `# /${wfName} — VSAF Workflow\n\n`
|
|
44
|
+
+ `Execute the VSAF workflow \`${ctx.packName}/${wfName}\` (definition: \`.vsaf/workflows/${ctx.packName}/${wfName}.yaml\`).\n\n`
|
|
45
|
+
+ `1. Call the \`vsaf\` MCP tool \`vsaf_start\` with \`workflow: "${ctx.packName}/${wfName}"\`, \`args: <user arguments>\`, \`projectPath: <project root>\`.\n`
|
|
46
|
+
+ `2. For each returned AI node, read \`.vsaf/commands/<node.command>.md\` and \`.vsaf/skills/<node.command>/SKILL.md\` (single source of truth) and execute the node.\n`
|
|
47
|
+
+ `3. Report results with \`vsaf_next\` and repeat until \`done: true\`. Check progress with \`vsaf_status\`; continue interrupted runs with \`vsaf_resume\`.\n`;
|
|
48
|
+
(0, fs_1.writeFileSync)((0, path_1.join)(commandsDir, `${wfName}.md`), `---\ndescription: ${desc}\n---\n\n${wfBody}`, 'utf-8');
|
|
49
|
+
result.commands.push(wfName);
|
|
50
|
+
}
|
|
51
|
+
// 1b. Top-level skill proxies → rule (.mdc) + command (.md) referencing .vsaf.
|
|
52
|
+
// Step-level skills (a/b/c) and bundled helpers stay engine-internal: the
|
|
53
|
+
// agent reaches them through workflow nodes, never as IDE entry points.
|
|
28
54
|
for (const name of proxySkillNames(ctx)) {
|
|
29
55
|
const description = `Run VSAF skill ${name}`;
|
|
30
56
|
const body = `# ${name}\n\nRead \`.vsaf/commands/${name}.md\` if it exists, then read \`.vsaf/skills/${name}/SKILL.md\` and any referenced files before acting. Treat \`.vsaf/skills/${name}\` as the single source of truth; do not copy or edit IDE-local skill folders.\n`;
|
|
@@ -36,7 +62,7 @@ exports.cursorAdapter = {
|
|
|
36
62
|
// 2. MCP (project-level JSON).
|
|
37
63
|
result.mcp = (0, shared_js_1.writeJsonMcp)((0, path_1.join)(cursorDir, 'mcp.json'), { vsaf: (0, shared_js_1.getVsafMcpEntry)(), gitnexus: (0, shared_js_1.getGitnexusMcpEntry)() });
|
|
38
64
|
// 3. Instruction marker block in AGENTS.md.
|
|
39
|
-
(0, shared_js_1.writeMarkerFile)((0, path_1.join)(ctx.projectPath, 'AGENTS.md'), `pack=${ctx.packName} ide=cursor`, `## VSAF \`${ctx.packName}\` (Cursor)\n\nRules: \`.cursor/rules/\` · Commands: \`.cursor/commands/\` · Canonical skills: \`.vsaf/skills/\` · MCP: \`.cursor/mcp.json\` (vsaf + gitnexus).\n\nCursor rules/commands are proxies only. When
|
|
65
|
+
(0, shared_js_1.writeMarkerFile)((0, path_1.join)(ctx.projectPath, 'AGENTS.md'), `pack=${ctx.packName} ide=cursor`, `## VSAF \`${ctx.packName}\` (Cursor)\n\nRules: \`.cursor/rules/\` · Commands: \`.cursor/commands/\` (workflows + top-level skills) · Canonical skills: \`.vsaf/skills/\` · Workflows: \`.vsaf/workflows/${ctx.packName}/\` · MCP: \`.cursor/mcp.json\` (vsaf + gitnexus).\n\nCursor rules/commands are proxies only. Workflow commands drive runs via the vsaf MCP tools (vsaf_start/vsaf_next/vsaf_status/vsaf_resume). When a node references a skill, read \`.vsaf/commands/<name>.md\` and \`.vsaf/skills/<name>/SKILL.md\`; do not install or copy skill directories into \`.cursor/skills/\`.\n\nArtifact boundary: generated knowledge/docs/artifacts stay at project root beside \`.vsaf\` or inside root \`.vsaf/\`; never auto-write them inside service/subproject folders unless explicitly authorized.`);
|
|
40
66
|
// 4. Binaries (best-effort; skipped in tests / --skip-deps).
|
|
41
67
|
if (!ctx.options._skipGraphify && !(0, shared_js_1.installGraphifyPlatform)('cursor')) {
|
|
42
68
|
result.warnings.push('graphify cursor install failed — run: graphify cursor install');
|
|
@@ -45,13 +71,8 @@ exports.cursorAdapter = {
|
|
|
45
71
|
},
|
|
46
72
|
};
|
|
47
73
|
function proxySkillNames(ctx) {
|
|
48
|
-
|
|
49
|
-
.filter(skill => !shared_js_1.SKIP_SKILLS.includes(skill))
|
|
50
|
-
.map(skill => `${ctx.packName}-${
|
|
51
|
-
const bundledSkills = ctx.packInfo.bundledNames.map(flattenSkillName);
|
|
52
|
-
return [...packSkills, ...bundledSkills];
|
|
53
|
-
}
|
|
54
|
-
function flattenSkillName(skill) {
|
|
55
|
-
return skill.split(/[\\/]/).filter(Boolean).join('-');
|
|
74
|
+
return ctx.packInfo.skillNames
|
|
75
|
+
.filter(skill => !shared_js_1.SKIP_SKILLS.includes(skill) && !/[\\/]/.test(skill))
|
|
76
|
+
.map(skill => `${ctx.packName}-${skill}`);
|
|
56
77
|
}
|
|
57
78
|
//# sourceMappingURL=cursor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cursor.js","sourceRoot":"","sources":["../../src/adapters/cursor.ts"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,gFAAgF;AAChF,kFAAkF
|
|
1
|
+
{"version":3,"file":"cursor.js","sourceRoot":"","sources":["../../src/adapters/cursor.ts"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,gFAAgF;AAChF,kFAAkF;;;;;;AAElF,2BAA0D;AAC1D,+BAAsC;AACtC,sDAA2B;AAC3B,6CAA0G;AAC1G,2CAAwI;AAE3H,QAAA,aAAa,GAAoB;IAC5C,EAAE,EAAE,QAAQ;IACZ,gBAAgB,EAAE,QAAQ;IAE1B,MAAM,CAAC,WAAmB;QACxB,OAAO,IAAA,eAAU,EAAC,IAAA,WAAI,EAAC,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC;IAClD,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