@agiflowai/aicode-toolkit 1.0.26 → 1.1.0

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/cli.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { r as MCP_SERVER_INFO, t as MCPServer } from "./mcp-CBcPdzNG.mjs";
3
- import { a as SPEC_TOOL_INFO, c as NewProjectService, i as TemplateSelectionService, l as CodingAgentService, o as SpecTool, s as SpecToolService, t as displayBanner } from "./utils-BTSpNlWu.mjs";
2
+ import { n as MCP_SERVER_INFO, t as MCPServer } from "./mcp-CwMcfNLE.mjs";
3
+ import { a as SPEC_TOOL_INFO, c as NewProjectService, i as TemplateSelectionService, l as CodingAgentService, o as SpecTool, s as SpecToolService, t as displayBanner } from "./utils-BM7-O0sC.mjs";
4
4
  import { ProjectType, TemplatesManagerService, cloneRepository, cloneSubdirectory, detectProjectType, ensureDir, findWorkspaceRoot, icons, messages, parseGitHubUrl, pathExists, print, sections } from "@agiflowai/aicode-utils";
5
5
  import { mkdir as mkdir$1, readFile as readFile$1, writeFile as writeFile$1 } from "node:fs/promises";
6
6
  import path from "node:path";
@@ -10,10 +10,8 @@ import { confirm, input, select } from "@inquirer/prompts";
10
10
  import ora from "ora";
11
11
  import { assign, createActor, createMachine, fromPromise } from "xstate";
12
12
  import yaml from "js-yaml";
13
-
14
13
  //#region package.json
15
- var version = "1.0.25";
16
-
14
+ var version = "1.0.26";
17
15
  //#endregion
18
16
  //#region src/commands/add.ts
19
17
  /**
@@ -75,11 +73,9 @@ const addCommand = new Command("add").description("Add a template to templates f
75
73
  process.exit(1);
76
74
  }
77
75
  });
78
-
79
76
  //#endregion
80
77
  //#region src/templates/settings.yaml.liquid?raw
81
78
  var settings_yaml_default = "# .toolkit/settings.yaml\n# Toolkit configuration for aicode-toolkit\n#\n# Local overrides go in .toolkit/settings.local.yaml (add to .gitignore).\n# Local settings are shallow-merged over this file — useful for per-developer\n# LLM tool preferences or API keys without committing them.\n#\n# All fields are optional. Uncomment and edit what you need.\n\n# ---------------------------------------------------------------------------\n# Project identity\n# ---------------------------------------------------------------------------\n\n{% comment %}Project type: monolith (single app) or monorepo (multiple packages/apps){% endcomment %}\n{% if projectType %}\nprojectType: {{ projectType }}\n{% else %}\n# projectType: monolith\n{% endif %}\n\n{% comment %}Path to the scaffold templates directory, relative to workspace root.{% endcomment %}\n{% if templatesPath %}\ntemplatesPath: {{ templatesPath }}\n{% else %}\n# templatesPath: ./templates\n{% endif %}\n\n{% comment %}Active template name (monolith only — monorepo reads from project.json).{% endcomment %}\n{% if sourceTemplate %}\nsourceTemplate: {{ sourceTemplate }}\n{% else %}\n# sourceTemplate: react-vite\n{% endif %}\n\n# Config schema version.\n# version: '1.0'\n\n# ---------------------------------------------------------------------------\n# scaffold-mcp — configuration for the scaffold-mcp CLI\n# CLI flags always take precedence over values set here.\n# ---------------------------------------------------------------------------\n\nscaffold-mcp:\n\n # -------------------------------------------------------------------------\n # mcp-serve — defaults for `scaffold-mcp mcp-serve`\n # -------------------------------------------------------------------------\n mcp-serve:\n # Transport type: stdio | http | sse (default: stdio)\n # type: stdio\n\n # Port for http/sse transport (default: 3000)\n # port: 3000\n\n # Host to bind for http/sse transport (default: localhost)\n # host: localhost\n\n # Enable admin tools such as generate-boilerplate (default: false)\n # adminEnable: false\n\n # Render prompts with skill front matter for Claude Code (default: false)\n # promptAsSkill: false\n\n # Fallback LLM tool used when scaffold-mcp needs AI assistance.\n # Supported: claude-code | gemini-cli | codex\n {% if fallbackTool %}\n fallbackTool: {{ fallbackTool }}\n {% if fallbackToolConfig %}\n # Config passed to the fallback LLM tool.\n fallbackToolConfig:\n {% for pair in fallbackToolConfig %}\n {{ pair[0] }}: {{ pair[1] }}\n {% endfor %}\n {% else %}\n # Config passed to the fallback LLM tool.\n # fallbackToolConfig:\n # model: gemini-2.0-flash\n {% endif %}\n {% else %}\n # fallbackTool: gemini-cli\n # Config passed to the fallback LLM tool.\n # fallbackToolConfig:\n # model: gemini-2.0-flash\n {% endif %}\n\n # Ordered fallback chain used when fallbackTool is not set.\n # The first valid entry wins.\n # fallbacks:\n # - tool: gemini-cli\n # config:\n # model: gemini-2.0-flash\n # - tool: codex\n # config:\n # model: gpt-5.2-mini\n\n # Extra CLI args merged into the mcp-serve command (key: value → --key value)\n # args:\n # review-tool: gemini-cli\n\n # -------------------------------------------------------------------------\n # hook — defaults for `scaffold-mcp hook`\n # Keyed by agent name, then by hook method.\n # Supported agents : claude-code | gemini-cli\n # Supported methods : preToolUse | postToolUse | userPromptSubmit | taskCompleted | stop\n # CLI flags --fallback-tool and --fallback-tool-config still take precedence.\n # -------------------------------------------------------------------------\n hook:\n\n claude-code:\n preToolUse:\n # LLM tool to use for this hook. Supported: claude-code | gemini-cli | codex\n {% if fallbackTool %}\n llm-tool: {{ fallbackTool }}\n {% if fallbackToolConfig %}\n tool-config:\n {% for pair in fallbackToolConfig %}\n {{ pair[0] }}: {{ pair[1] }}\n {% endfor %}\n {% endif %}\n {% else %}\n # llm-tool: gemini-cli\n # tool-config:\n # model: gemini-2.0-flash\n {% endif %}\n # fallbacks:\n # - tool: codex\n # config:\n # model: gpt-5.2-mini\n # matcher: Edit|MultiEdit|Write\n # Extra CLI args appended to the generated hook command (key: value → --key value)\n # args:\n # llm-tool: gemini-cli\n\n postToolUse:\n # matcher: Edit|MultiEdit|Write\n {% if fallbackTool %}\n llm-tool: {{ fallbackTool }}\n {% if fallbackToolConfig %}\n tool-config:\n {% for pair in fallbackToolConfig %}\n {{ pair[0] }}: {{ pair[1] }}\n {% endfor %}\n {% endif %}\n {% else %}\n # llm-tool: gemini-cli\n # tool-config:\n # model: gemini-2.0-flash\n {% endif %}\n # fallbacks:\n # - tool: codex\n # config:\n # model: gpt-5.2-mini\n # args:\n # llm-tool: gemini-cli\n\n userPromptSubmit:\n {% if fallbackTool %}\n llm-tool: {{ fallbackTool }}\n {% if fallbackToolConfig %}\n tool-config:\n {% for pair in fallbackToolConfig %}\n {{ pair[0] }}: {{ pair[1] }}\n {% endfor %}\n {% endif %}\n {% else %}\n # llm-tool: gemini-cli\n # tool-config:\n # model: gemini-2.0-flash\n {% endif %}\n # args:\n # llm-tool: gemini-cli\n\n taskCompleted:\n {% if fallbackTool %}\n llm-tool: {{ fallbackTool }}\n {% if fallbackToolConfig %}\n tool-config:\n {% for pair in fallbackToolConfig %}\n {{ pair[0] }}: {{ pair[1] }}\n {% endfor %}\n {% endif %}\n {% else %}\n # llm-tool: gemini-cli\n # tool-config:\n # model: gemini-2.0-flash\n {% endif %}\n # args:\n # llm-tool: gemini-cli\n\n stop:\n {% if fallbackTool %}\n llm-tool: {{ fallbackTool }}\n {% if fallbackToolConfig %}\n tool-config:\n {% for pair in fallbackToolConfig %}\n {{ pair[0] }}: {{ pair[1] }}\n {% endfor %}\n {% endif %}\n {% else %}\n # llm-tool: gemini-cli\n # tool-config:\n # model: gemini-2.0-flash\n {% endif %}\n # args:\n # llm-tool: gemini-cli\n\n gemini-cli:\n preToolUse:\n {% if fallbackTool %}\n llm-tool: {{ fallbackTool }}\n {% if fallbackToolConfig %}\n tool-config:\n {% for pair in fallbackToolConfig %}\n {{ pair[0] }}: {{ pair[1] }}\n {% endfor %}\n {% endif %}\n {% else %}\n # llm-tool: gemini-cli\n # tool-config:\n # model: gemini-2.0-flash\n {% endif %}\n\n postToolUse:\n {% if fallbackTool %}\n llm-tool: {{ fallbackTool }}\n {% if fallbackToolConfig %}\n tool-config:\n {% for pair in fallbackToolConfig %}\n {{ pair[0] }}: {{ pair[1] }}\n {% endfor %}\n {% endif %}\n {% else %}\n # llm-tool: gemini-cli\n # tool-config:\n # model: gemini-2.0-flash\n {% endif %}\n\n# ---------------------------------------------------------------------------\n# architect-mcp — configuration for the architect-mcp CLI\n# CLI flags always take precedence over values set here.\n# ---------------------------------------------------------------------------\n\narchitect-mcp:\n\n # -------------------------------------------------------------------------\n # mcp-serve — defaults for `architect-mcp mcp-serve`\n # -------------------------------------------------------------------------\n mcp-serve:\n # Transport type: stdio | http | sse (default: stdio)\n # type: stdio\n\n # Port for http/sse transport (default: 3000)\n # port: 3000\n\n # Host to bind for http/sse transport (default: localhost)\n # host: localhost\n\n # Enable admin tools such as add-design-pattern and add-rule (default: false)\n # adminEnable: false\n\n # Fallback LLM tool used for both design-pattern and review when specific tools are not set.\n # Supported: claude-code | gemini-cli | codex\n {% if fallbackTool %}\n fallbackTool: {{ fallbackTool }}\n {% if fallbackToolConfig %}\n # Config passed to the fallback LLM tool.\n fallbackToolConfig:\n {% for pair in fallbackToolConfig %}\n {{ pair[0] }}: {{ pair[1] }}\n {% endfor %}\n {% else %}\n # Config passed to the fallback LLM tool.\n # fallbackToolConfig:\n # model: gemini-2.0-flash\n {% endif %}\n {% else %}\n # fallbackTool: gemini-cli\n # Config passed to the fallback LLM tool.\n # fallbackToolConfig:\n # model: gemini-2.0-flash\n {% endif %}\n\n # Ordered fallback chain used when fallbackTool is not set.\n # The first valid entry wins.\n # fallbacks:\n # - tool: gemini-cli\n # config:\n # model: gemini-2.0-flash\n # - tool: codex\n # config:\n # model: gpt-5.2-mini\n\n # LLM tool used specifically for get-file-design-pattern analysis.\n # Overrides fallbackTool for design pattern operations.\n # designPatternTool: gemini-cli\n\n # Config passed to the design pattern LLM tool.\n # designPatternToolConfig:\n # model: gemini-2.0-flash\n\n # LLM tool used specifically for review-code-change analysis.\n # Overrides fallbackTool for code review operations.\n # reviewTool: gemini-cli\n\n # Config passed to the review LLM tool.\n # reviewToolConfig:\n # model: gemini-2.0-flash\n\n # Extra CLI args merged into the mcp-serve command (key: value → --key value)\n # args:\n # review-tool: gemini-cli\n\n # -------------------------------------------------------------------------\n # hook — defaults for `architect-mcp hook`\n # Keyed by agent name, then by hook method.\n # Supported agents : claude-code | gemini-cli\n # Supported methods : preToolUse | postToolUse\n # CLI flags --llm-tool, --fallback-tool, and --tool-config still take precedence.\n # -------------------------------------------------------------------------\n hook:\n\n claude-code:\n preToolUse:\n # Static pattern matching is usually enough here. Leave llm-tool unset unless\n # you want extra pattern filtering via LLM.\n {% if fallbackTool %}\n fallback-tool: {{ fallbackTool }}\n {% if fallbackToolConfig %}\n fallback-tool-config:\n {% for pair in fallbackToolConfig %}\n {{ pair[0] }}: {{ pair[1] }}\n {% endfor %}\n {% endif %}\n {% else %}\n # fallback-tool: gemini-cli\n # fallback-tool-config:\n # model: gemini-2.0-flash\n {% endif %}\n # fallbacks:\n # - tool: codex\n # config:\n # model: gpt-5.2-mini\n # matcher: Edit|MultiEdit|Write\n # Extra CLI args appended to the generated hook command (key: value → --key value)\n # args:\n # llm-tool: gemini-cli\n\n postToolUse:\n # matcher: Edit|MultiEdit|Write\n # Set llm-tool only if you want LLM-based review. A cheap model is recommended.\n {% if fallbackTool %}\n llm-tool: {{ fallbackTool }}\n {% if fallbackToolConfig %}\n tool-config:\n {% for pair in fallbackToolConfig %}\n {{ pair[0] }}: {{ pair[1] }}\n {% endfor %}\n {% endif %}\n {% else %}\n # llm-tool: gemini-cli\n # tool-config:\n # model: gemini-2.0-flash\n {% endif %}\n # fallbacks:\n # - tool: codex\n # config:\n # model: gpt-5.2-mini\n # args:\n # llm-tool: gemini-cli\n\n gemini-cli:\n preToolUse:\n {% if fallbackTool %}\n llm-tool: {{ fallbackTool }}\n {% if fallbackToolConfig %}\n tool-config:\n {% for pair in fallbackToolConfig %}\n {{ pair[0] }}: {{ pair[1] }}\n {% endfor %}\n {% endif %}\n {% else %}\n # llm-tool: gemini-cli\n # tool-config:\n # model: gemini-2.0-flash\n {% endif %}\n\n postToolUse:\n {% if fallbackTool %}\n llm-tool: {{ fallbackTool }}\n {% if fallbackToolConfig %}\n tool-config:\n {% for pair in fallbackToolConfig %}\n {{ pair[0] }}: {{ pair[1] }}\n {% endfor %}\n {% endif %}\n {% else %}\n # llm-tool: gemini-cli\n # tool-config:\n # model: gemini-2.0-flash\n {% endif %}\n\n# ---------------------------------------------------------------------------\n# mcp-config — generates mcp-config.yaml via `aicode sync --mcp`\n# Servers listed here become entries in mcp-config.yaml.\n# Run `aicode sync` to write the output file.\n# ---------------------------------------------------------------------------\n\n# mcp-config:\n# servers:\n# scaffold-mcp:\n# command: bun\n# args:\n# - run\n# - packages/scaffold-mcp/src/cli.ts\n# - mcp-serve\n# - --admin-enable\n# - --prompt-as-skill\n# instruction: \"Use this server for generating boilerplate code, scaffolding new projects, and adding features to existing projects.\"\n# architect-mcp:\n# command: bun\n# args:\n# - run\n# - packages/architect-mcp/src/cli.ts\n# - mcp-serve\n# instruction: \"Use this server for design pattern guidance and code review.\"\n# skills:\n# paths:\n# - docs/skills\n";
82
-
83
79
  //#endregion
84
80
  //#region src/states/init-machine.ts
85
81
  /**
@@ -91,7 +87,7 @@ const initMachine = createMachine({
91
87
  id: "init",
92
88
  types: {},
93
89
  initial: "displayingBanner",
94
- context: ({ input: input$1 }) => ({
90
+ context: ({ input }) => ({
95
91
  workspaceRoot: void 0,
96
92
  projectName: void 0,
97
93
  projectType: void 0,
@@ -106,7 +102,7 @@ const initMachine = createMachine({
106
102
  codingAgent: void 0,
107
103
  detectedSpecTool: void 0,
108
104
  useSpecDrivenApproach: void 0,
109
- options: input$1.options,
105
+ options: input.options,
110
106
  error: void 0
111
107
  }),
112
108
  states: {
@@ -431,7 +427,6 @@ const initMachine = createMachine({
431
427
  failed: { type: "final" }
432
428
  }
433
429
  }, { guards: {} });
434
-
435
430
  //#endregion
436
431
  //#region src/commands/init.ts
437
432
  const DEFAULT_TEMPLATE_REPO = {
@@ -459,10 +454,10 @@ const initActors = {
459
454
  }
460
455
  return { exists: false };
461
456
  }),
462
- detectProjectType: fromPromise(async ({ input: input$1 }) => {
457
+ detectProjectType: fromPromise(async ({ input }) => {
463
458
  print.divider();
464
459
  print.info("Detecting project type...");
465
- const result = await detectProjectType(input$1.workspaceRoot);
460
+ const result = await detectProjectType(input.workspaceRoot);
466
461
  if (result.projectType) print.success(`Detected ${result.projectType} project`);
467
462
  return result;
468
463
  }),
@@ -605,11 +600,11 @@ const initActors = {
605
600
  }),
606
601
  checkTemplatesFolder: fromPromise(async ({ input: actorInput }) => {
607
602
  try {
608
- const fs$1 = await import("node:fs/promises");
603
+ const fs = await import("node:fs/promises");
609
604
  const defaultTemplatesPath = path.join(actorInput.workspaceRoot, "templates");
610
605
  let templatesExists = false;
611
606
  try {
612
- await fs$1.access(defaultTemplatesPath);
607
+ await fs.access(defaultTemplatesPath);
613
608
  templatesExists = true;
614
609
  } catch {
615
610
  templatesExists = false;
@@ -637,7 +632,7 @@ const initActors = {
637
632
  print.info("");
638
633
  finalTemplatesPath = path.join(actorInput.workspaceRoot, customDir.trim());
639
634
  try {
640
- await fs$1.mkdir(finalTemplatesPath, { recursive: true });
635
+ await fs.mkdir(finalTemplatesPath, { recursive: true });
641
636
  print.success(`Created templates directory at: ${finalTemplatesPath}`);
642
637
  } catch (error) {
643
638
  throw new Error(`Failed to create templates directory at ${finalTemplatesPath}: ${error.message}`);
@@ -674,8 +669,8 @@ const initActors = {
674
669
  return null;
675
670
  }
676
671
  }),
677
- listTemplates: fromPromise(async ({ input: input$1 }) => {
678
- const templates = await new TemplateSelectionService(input$1.tmpTemplatesPath).listTemplates();
672
+ listTemplates: fromPromise(async ({ input }) => {
673
+ const templates = await new TemplateSelectionService(input.tmpTemplatesPath).listTemplates();
679
674
  print.header("\nAvailable templates:");
680
675
  for (const template of templates) print.item(`${template.name}${template.description ? ` - ${template.description}` : ""}`);
681
676
  return templates;
@@ -684,18 +679,18 @@ const initActors = {
684
679
  const templates = await new TemplateSelectionService(actorInput.tmpTemplatesPath).listTemplates();
685
680
  if (templates.length === 0) throw new Error("No templates available");
686
681
  if (actorInput.projectType === ProjectType.MONOLITH) {
687
- const choices$1 = templates.map((t) => ({
682
+ const choices = templates.map((t) => ({
688
683
  name: t.name,
689
684
  value: t.name,
690
685
  description: t.description ? `\n ${t.description}` : void 0
691
686
  }));
692
687
  print.divider();
693
- const selected$1 = await select({
688
+ const selected = await select({
694
689
  message: "Select template (monolith allows only one):",
695
- choices: choices$1
690
+ choices
696
691
  });
697
692
  print.info("");
698
- return [selected$1];
693
+ return [selected];
699
694
  }
700
695
  const checkbox = await import("@inquirer/prompts").then((m) => m.checkbox);
701
696
  const choices = templates.map((t) => ({
@@ -782,20 +777,20 @@ const initActors = {
782
777
  throw error;
783
778
  }
784
779
  }),
785
- cleanup: fromPromise(async ({ input: input$1 }) => {
786
- if (input$1.tmpTemplatesPath) {
780
+ cleanup: fromPromise(async ({ input }) => {
781
+ if (input.tmpTemplatesPath) {
787
782
  const spinner = ora("Cleaning up temporary files...").start();
788
783
  try {
789
- await new TemplateSelectionService(input$1.tmpTemplatesPath).cleanup();
784
+ await new TemplateSelectionService(input.tmpTemplatesPath).cleanup();
790
785
  spinner.succeed("Cleaned up temporary files");
791
786
  } catch (_error) {
792
787
  spinner.warn("Could not clean up all temporary files");
793
788
  }
794
789
  }
795
790
  }),
796
- detectSpecTool: fromPromise(async ({ input: input$1 }) => {
791
+ detectSpecTool: fromPromise(async ({ input }) => {
797
792
  print.info("\nDetecting spec tools...");
798
- const detectedTool = await new SpecToolService(input$1.workspaceRoot).detectSpecTool();
793
+ const detectedTool = await new SpecToolService(input.workspaceRoot).detectSpecTool();
799
794
  if (detectedTool) print.success(`Detected ${SPEC_TOOL_INFO[detectedTool].name} in workspace`);
800
795
  else print.info("No spec tool detected");
801
796
  return detectedTool;
@@ -803,12 +798,12 @@ const initActors = {
803
798
  promptSpecDrivenApproach: fromPromise(async ({ input: actorInput }) => {
804
799
  if (actorInput.detectedSpecTool) {
805
800
  print.divider();
806
- const result$1 = await confirm({
801
+ const result = await confirm({
807
802
  message: `${SPEC_TOOL_INFO[actorInput.detectedSpecTool].name} is installed. Would you like to update the agent instructions for spec-driven development?`,
808
803
  default: true
809
804
  });
810
805
  print.info("");
811
- return result$1;
806
+ return result;
812
807
  }
813
808
  print.divider();
814
809
  const result = await confirm({
@@ -818,18 +813,18 @@ const initActors = {
818
813
  print.info("");
819
814
  return result;
820
815
  }),
821
- setupSpec: fromPromise(async ({ input: input$1 }) => {
822
- const codingAgentService = new CodingAgentService(input$1.workspaceRoot);
823
- const specToolService = new SpecToolService(input$1.workspaceRoot, SpecTool.OPENSPEC, codingAgentService);
824
- if (input$1.isAlreadyInstalled) {
816
+ setupSpec: fromPromise(async ({ input }) => {
817
+ const codingAgentService = new CodingAgentService(input.workspaceRoot);
818
+ const specToolService = new SpecToolService(input.workspaceRoot, SpecTool.OPENSPEC, codingAgentService);
819
+ if (input.isAlreadyInstalled) {
825
820
  const spinner = ora("Updating OpenSpec agent instructions...").start();
826
821
  try {
827
822
  const enabledMcps = {
828
- scaffoldMcp: input$1.selectedMcpServers?.includes(MCPServer.SCAFFOLD) ?? false,
829
- architectMcp: input$1.selectedMcpServers?.includes(MCPServer.ARCHITECT) ?? false,
830
- projectType: input$1.projectType
823
+ scaffoldMcp: input.selectedMcpServers?.includes(MCPServer.SCAFFOLD) ?? false,
824
+ architectMcp: input.selectedMcpServers?.includes(MCPServer.ARCHITECT) ?? false,
825
+ projectType: input.projectType
831
826
  };
832
- await specToolService.updateInstructions(enabledMcps, input$1.codingAgent);
827
+ await specToolService.updateInstructions(enabledMcps, input.codingAgent);
833
828
  spinner.succeed("OpenSpec agent instructions updated");
834
829
  } catch (error) {
835
830
  spinner.fail("Failed to update OpenSpec instructions");
@@ -857,17 +852,17 @@ const initActors = {
857
852
  print.info("");
858
853
  return result;
859
854
  }),
860
- updateSpecInstructions: fromPromise(async ({ input: input$1 }) => {
855
+ updateSpecInstructions: fromPromise(async ({ input }) => {
861
856
  const spinner = ora("Updating OpenSpec agent instructions...").start();
862
857
  try {
863
- const codingAgentService = new CodingAgentService(input$1.workspaceRoot);
864
- const specToolService = new SpecToolService(input$1.workspaceRoot, SpecTool.OPENSPEC, codingAgentService);
858
+ const codingAgentService = new CodingAgentService(input.workspaceRoot);
859
+ const specToolService = new SpecToolService(input.workspaceRoot, SpecTool.OPENSPEC, codingAgentService);
865
860
  const enabledMcps = {
866
- scaffoldMcp: input$1.selectedMcpServers?.includes(MCPServer.SCAFFOLD) ?? false,
867
- architectMcp: input$1.selectedMcpServers?.includes(MCPServer.ARCHITECT) ?? false,
868
- projectType: input$1.projectType
861
+ scaffoldMcp: input.selectedMcpServers?.includes(MCPServer.SCAFFOLD) ?? false,
862
+ architectMcp: input.selectedMcpServers?.includes(MCPServer.ARCHITECT) ?? false,
863
+ projectType: input.projectType
869
864
  };
870
- await specToolService.updateInstructions(enabledMcps, input$1.codingAgent);
865
+ await specToolService.updateInstructions(enabledMcps, input.codingAgent);
871
866
  spinner.succeed("OpenSpec agent instructions updated");
872
867
  } catch (error) {
873
868
  spinner.fail("Failed to update OpenSpec instructions");
@@ -875,11 +870,11 @@ const initActors = {
875
870
  }
876
871
  })
877
872
  };
878
- function resolveGeneratedSettingsValues(input$1) {
879
- const resolvedTemplatesPath = input$1.templatesPath ?? path.join(input$1.workspaceRoot, TemplatesManagerService.getTemplatesFolderName());
873
+ function resolveGeneratedSettingsValues(input) {
874
+ const resolvedTemplatesPath = input.templatesPath ?? path.join(input.workspaceRoot, TemplatesManagerService.getTemplatesFolderName());
880
875
  return {
881
- relativeTemplatesPath: path.relative(input$1.workspaceRoot, resolvedTemplatesPath) || "templates",
882
- sourceTemplate: input$1.selectedTemplates?.[0]
876
+ relativeTemplatesPath: path.relative(input.workspaceRoot, resolvedTemplatesPath) || "templates",
877
+ sourceTemplate: input.selectedTemplates?.[0]
883
878
  };
884
879
  }
885
880
  /**
@@ -918,7 +913,6 @@ const initCommand = new Command("init").description("Initialize project with tem
918
913
  process.exit(1);
919
914
  }
920
915
  });
921
-
922
916
  //#endregion
923
917
  //#region src/commands/sync.ts
924
918
  /**
@@ -964,10 +958,10 @@ function buildHookCommand(server, hookType, extraFlags) {
964
958
  const serverArgs = server.args ?? [];
965
959
  const scriptIdx = serverArgs.findIndex((arg) => /\.(ts|js|mjs|cjs)$/.test(arg));
966
960
  if (scriptIdx >= 0) {
967
- const prefixArgs$1 = serverArgs.slice(0, scriptIdx + 1);
961
+ const prefixArgs = serverArgs.slice(0, scriptIdx + 1);
968
962
  return [
969
963
  server.command,
970
- ...prefixArgs$1,
964
+ ...prefixArgs,
971
965
  "hook",
972
966
  "--type",
973
967
  hookType,
@@ -1075,12 +1069,13 @@ async function writeClaudeSettings(config, workspaceRoot) {
1075
1069
  }
1076
1070
  if (!hasAny) {
1077
1071
  print.warning("No scaffold-mcp/architect-mcp hook.claude-code config found — skipping .claude/settings.json");
1078
- return;
1072
+ return false;
1079
1073
  }
1080
1074
  const settings = { hooks: hooksOutput };
1081
1075
  const claudeDir = path.join(workspaceRoot, CLAUDE_SETTINGS_DIR);
1082
1076
  await mkdir$1(claudeDir, { recursive: true });
1083
1077
  await writeFile$1(path.join(claudeDir, CLAUDE_SETTINGS_FILE), JSON.stringify(settings, null, 2), "utf-8");
1078
+ return true;
1084
1079
  } catch (err) {
1085
1080
  const message = err instanceof Error ? err.message : String(err);
1086
1081
  throw new Error(`Failed to write ${CLAUDE_SETTINGS_DIR}/${CLAUDE_SETTINGS_FILE}: ${message}`);
@@ -1091,9 +1086,10 @@ async function writeMcpConfig(config, workspaceRoot) {
1091
1086
  const mcpConfig = buildMcpConfigYaml(config);
1092
1087
  if (!mcpConfig) {
1093
1088
  print.warning("No mcp-config.servers or mcp-config.skills config found — skipping mcp-config.yaml");
1094
- return;
1089
+ return false;
1095
1090
  }
1096
1091
  await writeFile$1(path.join(workspaceRoot, MCP_CONFIG_FILE), yaml.dump(mcpConfig, { indent: 2 }), "utf-8");
1092
+ return true;
1097
1093
  } catch (err) {
1098
1094
  const message = err instanceof Error ? err.message : String(err);
1099
1095
  throw new Error(`Failed to write ${MCP_CONFIG_FILE}: ${message}`);
@@ -1109,12 +1105,10 @@ const syncCommand = new Command("sync").description("Generate .claude/settings.j
1109
1105
  const shouldWriteHooks = options.hooks || !options.hooks && !options.mcp;
1110
1106
  const shouldWriteMcp = options.mcp || !options.hooks && !options.mcp;
1111
1107
  if (shouldWriteHooks) if (hasHookConfig(config)) {
1112
- await writeClaudeSettings(config, workspaceRoot);
1113
- print.success("Written .claude/settings.json");
1108
+ if (await writeClaudeSettings(config, workspaceRoot)) print.success("Written .claude/settings.json");
1114
1109
  } else print.warning("No hook.claude-code config found in toolkit settings — skipping");
1115
1110
  if (shouldWriteMcp) if (buildMcpConfigYaml(config)) {
1116
- await writeMcpConfig(config, workspaceRoot);
1117
- print.success("Written mcp-config.yaml");
1111
+ if (await writeMcpConfig(config, workspaceRoot)) print.success("Written mcp-config.yaml");
1118
1112
  } else print.warning("No mcp-config.servers or mcp-config.skills config found — skipping mcp-config.yaml");
1119
1113
  } catch (error) {
1120
1114
  const message = error instanceof Error ? error.message : String(error);
@@ -1122,7 +1116,6 @@ const syncCommand = new Command("sync").description("Generate .claude/settings.j
1122
1116
  process.exit(1);
1123
1117
  }
1124
1118
  });
1125
-
1126
1119
  //#endregion
1127
1120
  //#region src/cli.ts
1128
1121
  /**
@@ -1143,6 +1136,5 @@ async function main() {
1143
1136
  }
1144
1137
  }
1145
1138
  main();
1146
-
1147
1139
  //#endregion
1148
- export { };
1140
+ export {};
package/dist/index.cjs CHANGED
@@ -1,6 +1,5 @@
1
- const require_utils = require('./utils-DMP5MQCv.cjs');
2
- require('./mcp--A-5zuBI.cjs');
3
-
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_utils = require("./utils-BCVXMGNF.cjs");
4
3
  exports.BANNER_GRADIENT = require_utils.BANNER_GRADIENT;
5
4
  exports.CodingAgentService = require_utils.CodingAgentService;
6
5
  exports.NewProjectService = require_utils.NewProjectService;
@@ -8,4 +7,4 @@ exports.THEME = require_utils.THEME;
8
7
  exports.TemplateSelectionService = require_utils.TemplateSelectionService;
9
8
  exports.TemplatesService = require_utils.TemplatesService;
10
9
  exports.displayBanner = require_utils.displayBanner;
11
- exports.displayCompactBanner = require_utils.displayCompactBanner;
10
+ exports.displayCompactBanner = require_utils.displayCompactBanner;
package/dist/index.d.cts CHANGED
@@ -60,7 +60,6 @@ declare const THEME: {
60
60
  declare const BANNER_GRADIENT: ("#10b981" | "#059669" | "#0d9488" | "#0f766e")[];
61
61
  //#endregion
62
62
  //#region src/services/CodingAgentService.d.ts
63
-
64
63
  type CodingAgent = CodingAgentId;
65
64
  declare class CodingAgentService {
66
65
  private workspaceRoot;
package/dist/index.d.mts CHANGED
@@ -60,7 +60,6 @@ declare const THEME: {
60
60
  declare const BANNER_GRADIENT: ("#10b981" | "#059669" | "#0d9488" | "#0f766e")[];
61
61
  //#endregion
62
62
  //#region src/services/CodingAgentService.d.ts
63
-
64
63
  type CodingAgent = CodingAgentId;
65
64
  declare class CodingAgentService {
66
65
  private workspaceRoot;
package/dist/index.mjs CHANGED
@@ -1,4 +1,2 @@
1
- import "./mcp-CBcPdzNG.mjs";
2
- import { c as NewProjectService, d as THEME, i as TemplateSelectionService, l as CodingAgentService, n as displayCompactBanner, r as TemplatesService, t as displayBanner, u as BANNER_GRADIENT } from "./utils-BTSpNlWu.mjs";
3
-
4
- export { BANNER_GRADIENT, CodingAgentService, NewProjectService, THEME, TemplateSelectionService, TemplatesService, displayBanner, displayCompactBanner };
1
+ import { c as NewProjectService, d as THEME, i as TemplateSelectionService, l as CodingAgentService, n as displayCompactBanner, r as TemplatesService, t as displayBanner, u as BANNER_GRADIENT } from "./utils-BM7-O0sC.mjs";
2
+ export { BANNER_GRADIENT, CodingAgentService, NewProjectService, THEME, TemplateSelectionService, TemplatesService, displayBanner, displayCompactBanner };
@@ -1,5 +1,21 @@
1
-
1
+ //#region \0rolldown/runtime.js
2
+ var __defProp = Object.defineProperty;
3
+ var __exportAll = (all, no_symbols) => {
4
+ let target = {};
5
+ for (var name in all) __defProp(target, name, {
6
+ get: all[name],
7
+ enumerable: true
8
+ });
9
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
10
+ return target;
11
+ };
12
+ //#endregion
2
13
  //#region src/constants/mcp.ts
14
+ var mcp_exports = /* @__PURE__ */ __exportAll({
15
+ MCPServer: () => MCPServer,
16
+ MCP_CONFIG_FILES: () => MCP_CONFIG_FILES,
17
+ MCP_SERVER_INFO: () => MCP_SERVER_INFO
18
+ });
3
19
  /**
4
20
  * MCP (Model Context Protocol) Server Constants
5
21
  *
@@ -14,11 +30,11 @@
14
30
  /**
15
31
  * Available MCP servers
16
32
  */
17
- let MCPServer = /* @__PURE__ */ function(MCPServer$1) {
18
- MCPServer$1["ONE_MCP"] = "one-mcp";
19
- MCPServer$1["ARCHITECT"] = "architect-mcp";
20
- MCPServer$1["SCAFFOLD"] = "scaffold-mcp";
21
- return MCPServer$1;
33
+ let MCPServer = /* @__PURE__ */ function(MCPServer) {
34
+ MCPServer["ONE_MCP"] = "one-mcp";
35
+ MCPServer["ARCHITECT"] = "architect-mcp";
36
+ MCPServer["SCAFFOLD"] = "scaffold-mcp";
37
+ return MCPServer;
22
38
  }({});
23
39
  /**
24
40
  * MCP server configuration files
@@ -50,23 +66,5 @@ const MCP_SERVER_INFO = {
50
66
  description: "Project scaffolding, boilerplates, and feature generation"
51
67
  }
52
68
  };
53
-
54
69
  //#endregion
55
- Object.defineProperty(exports, 'MCPServer', {
56
- enumerable: true,
57
- get: function () {
58
- return MCPServer;
59
- }
60
- });
61
- Object.defineProperty(exports, 'MCP_CONFIG_FILES', {
62
- enumerable: true,
63
- get: function () {
64
- return MCP_CONFIG_FILES;
65
- }
66
- });
67
- Object.defineProperty(exports, 'MCP_SERVER_INFO', {
68
- enumerable: true,
69
- get: function () {
70
- return MCP_SERVER_INFO;
71
- }
72
- });
70
+ export { MCP_SERVER_INFO as n, mcp_exports as r, MCPServer as t };
@@ -13,11 +13,11 @@
13
13
  /**
14
14
  * Available MCP servers
15
15
  */
16
- let MCPServer = /* @__PURE__ */ function(MCPServer$1) {
17
- MCPServer$1["ONE_MCP"] = "one-mcp";
18
- MCPServer$1["ARCHITECT"] = "architect-mcp";
19
- MCPServer$1["SCAFFOLD"] = "scaffold-mcp";
20
- return MCPServer$1;
16
+ let MCPServer = /* @__PURE__ */ function(MCPServer) {
17
+ MCPServer["ONE_MCP"] = "one-mcp";
18
+ MCPServer["ARCHITECT"] = "architect-mcp";
19
+ MCPServer["SCAFFOLD"] = "scaffold-mcp";
20
+ return MCPServer;
21
21
  }({});
22
22
  /**
23
23
  * MCP server configuration files
@@ -49,6 +49,22 @@ const MCP_SERVER_INFO = {
49
49
  description: "Project scaffolding, boilerplates, and feature generation"
50
50
  }
51
51
  };
52
-
53
52
  //#endregion
54
- export { MCP_CONFIG_FILES as n, MCP_SERVER_INFO as r, MCPServer as t };
53
+ Object.defineProperty(exports, "MCPServer", {
54
+ enumerable: true,
55
+ get: function() {
56
+ return MCPServer;
57
+ }
58
+ });
59
+ Object.defineProperty(exports, "MCP_CONFIG_FILES", {
60
+ enumerable: true,
61
+ get: function() {
62
+ return MCP_CONFIG_FILES;
63
+ }
64
+ });
65
+ Object.defineProperty(exports, "MCP_SERVER_INFO", {
66
+ enumerable: true,
67
+ get: function() {
68
+ return MCP_SERVER_INFO;
69
+ }
70
+ });
@@ -0,0 +1,3 @@
1
+ const require_mcp = require("./mcp-HNZY6MpT.cjs");
2
+ exports.MCPServer = require_mcp.MCPServer;
3
+ exports.MCP_CONFIG_FILES = require_mcp.MCP_CONFIG_FILES;