secufusion-mcp 1.0.15 → 1.0.16

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.
Files changed (2) hide show
  1. package/index.js +21 -3
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -842,8 +842,26 @@ server.tool("manage_project_spec", "Manages the .secufusion-project-spec.json fi
842
842
  // ─── Task management helpers ──────────────────────────────────────────────────
843
843
  const TASKS_DIR = ".secufusion/tasks";
844
844
  const REGISTRY_FILE = ".secufusion/registry.json";
845
- function taskDir(workItemId) {
846
- return resolve(`${TASKS_DIR}/WI-${workItemId}`);
845
+ function taskDir(workItemId, title) {
846
+ const baseDir = resolve(TASKS_DIR);
847
+ const prefixes = [workItemId + "-", "WI-" + workItemId + "-"];
848
+ if (fs.existsSync(baseDir)) {
849
+ const folders = fs.readdirSync(baseDir);
850
+ // Find an existing folder that starts with the workItemId
851
+ const match = folders.find(f => f === workItemId ||
852
+ f === `WI-${workItemId}` ||
853
+ prefixes.some(p => f.startsWith(p)));
854
+ if (match) {
855
+ return resolve(`${TASKS_DIR}/${match}`);
856
+ }
857
+ }
858
+ // If no folder exists, generate a new one
859
+ if (title) {
860
+ const slug = title.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '').substring(0, 50);
861
+ return resolve(`${TASKS_DIR}/${workItemId}-${slug}`);
862
+ }
863
+ // Fallback if no title is provided and folder doesn't exist
864
+ return resolve(`${TASKS_DIR}/${workItemId}`);
847
865
  }
848
866
  function readJson(filePath) {
849
867
  const raw = readFileSafe(filePath);
@@ -892,7 +910,7 @@ server.tool("manage_task", "Manages structured task records in .secufusion/tasks
892
910
  scenario_type: z.enum(["unit", "integration", "e2e", "manual"]).optional().describe("Test scenario type. Used with 'add_scenario'."),
893
911
  }, async ({ action, work_item_id, title, description, acceptance_criteria, pending_acs, completed_acs, next_step, tags, file_path, change_summary, decision, rationale, scenario, scenario_type }) => {
894
912
  const inputChars = JSON.stringify({ action, work_item_id, title, description, acceptance_criteria, pending_acs, completed_acs, next_step, tags, file_path, change_summary, decision, rationale, scenario, scenario_type }).length;
895
- const dir = taskDir(work_item_id);
913
+ const dir = taskDir(work_item_id, action === "initialize" ? title : undefined);
896
914
  const specPath = path.join(dir, "spec.json");
897
915
  const progressPath = path.join(dir, "progress.json");
898
916
  const decisionsPath = path.join(dir, "decisions.json");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "secufusion-mcp",
3
- "version": "1.0.15",
3
+ "version": "1.0.16",
4
4
  "type": "module",
5
5
  "description": "SecuFusion MCP server - developer workflow tooling with guardrails",
6
6
  "main": "index.js",