zefiro 0.3.4 → 0.3.6

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.js CHANGED
@@ -7876,37 +7876,44 @@ async function migrateFromLegacy(projectRoot, nonInteractive) {
7876
7876
  // src/commands/init.ts
7877
7877
  function registerInit(program2) {
7878
7878
  program2.command("init").description("Initialize zefiro configuration for your project").option("--non-interactive", "Skip interactive prompts, use defaults").action(async (cmdOpts) => {
7879
- const projectRoot = getProjectRoot();
7880
- const nonInteractive = !!cmdOpts?.nonInteractive;
7881
- header("zefiro init");
7882
- await migrateFromLegacy(projectRoot, nonInteractive);
7883
- const qaiDir = join6(projectRoot, CONFIG_DIR);
7884
- const isReInit = existsSync5(join6(qaiDir, "agents"));
7885
- if (isReInit) {
7886
- info(`Existing ${CONFIG_DIR}/ detected — preserving config and context.
7887
- `);
7888
- await copyAgentsToLocal(projectRoot, nonInteractive);
7889
- await copyWorkflowGuide(projectRoot, nonInteractive);
7890
- } else {
7891
- const answers = nonInteractive ? getDefaultAnswers() : await askConfigQuestions();
7892
- await writeEnvVars(projectRoot, answers, nonInteractive);
7893
- await copyAgentsToLocal(projectRoot, nonInteractive);
7894
- await copyWorkflowGuide(projectRoot, nonInteractive);
7895
- }
7896
- console.log("");
7897
- success(`Initialization complete!
7879
+ try {
7880
+ const projectRoot = getProjectRoot();
7881
+ const nonInteractive = !!cmdOpts?.nonInteractive;
7882
+ header("zefiro init");
7883
+ await migrateFromLegacy(projectRoot, nonInteractive);
7884
+ const qaiDir = join6(projectRoot, CONFIG_DIR);
7885
+ const isReInit = existsSync5(join6(qaiDir, "agents"));
7886
+ if (isReInit) {
7887
+ info(`Existing ${CONFIG_DIR}/ detected — preserving config and context.
7898
7888
  `);
7899
- if (!isReInit) {
7900
- console.log(import_picocolors2.default.bold("Next steps:"));
7901
- console.log(` 1. Use the ${import_picocolors2.default.cyan("init-agent")} in your AI tool to generate ${import_picocolors2.default.cyan(`${CONFIG_DIR}/context.md`)}`);
7902
- console.log(` (or use the MCP server: ${import_picocolors2.default.cyan("zefiro_scan_codebase")} + ${import_picocolors2.default.cyan("zefiro_read_agent")})`);
7903
- console.log(` 2. Review the generated ${import_picocolors2.default.cyan(`${CONFIG_DIR}/context.md`)}`);
7904
- console.log(` 3. Run: ${import_picocolors2.default.cyan("zefiro scan")}`);
7889
+ await copyAgentsToLocal(projectRoot, nonInteractive);
7890
+ await copyWorkflowGuide(projectRoot, nonInteractive);
7891
+ } else {
7892
+ const answers = nonInteractive ? getDefaultAnswers() : await askConfigQuestions();
7893
+ await writeEnvVars(projectRoot, answers, nonInteractive);
7894
+ await copyAgentsToLocal(projectRoot, nonInteractive);
7895
+ await copyWorkflowGuide(projectRoot, nonInteractive);
7896
+ }
7905
7897
  console.log("");
7906
- console.log(import_picocolors2.default.dim("Tip: all QAI settings are in .env as QAI_* variables."));
7907
- console.log(import_picocolors2.default.dim(` For advanced config, create ${CONFIG_DIR}/config.ts (import { defineConfig } from 'zefiro')`));
7908
- } else {
7909
- console.log(import_picocolors2.default.dim("Config and context.md were preserved. Only agents and workflow were checked."));
7898
+ success(`Initialization complete!
7899
+ `);
7900
+ if (!isReInit) {
7901
+ console.log(import_picocolors2.default.bold("Next steps:"));
7902
+ console.log(` 1. Use the ${import_picocolors2.default.cyan("init-agent")} in your AI tool to generate ${import_picocolors2.default.cyan(`${CONFIG_DIR}/context.md`)}`);
7903
+ console.log(` (or use the MCP server: ${import_picocolors2.default.cyan("zefiro_scan_codebase")} + ${import_picocolors2.default.cyan("zefiro_read_agent")})`);
7904
+ console.log(` 2. Review the generated ${import_picocolors2.default.cyan(`${CONFIG_DIR}/context.md`)}`);
7905
+ console.log(` 3. Run: ${import_picocolors2.default.cyan("zefiro scan")}`);
7906
+ console.log("");
7907
+ console.log(import_picocolors2.default.dim("Tip: all QAI settings are in .env as QAI_* variables."));
7908
+ console.log(import_picocolors2.default.dim(` For advanced config, create ${CONFIG_DIR}/config.ts (import { defineConfig } from 'zefiro')`));
7909
+ } else {
7910
+ console.log(import_picocolors2.default.dim("Config and context.md were preserved. Only agents and workflow were checked."));
7911
+ }
7912
+ } catch (err) {
7913
+ if (err?.name === "ExitPromptError") {
7914
+ process.exit(0);
7915
+ }
7916
+ throw err;
7910
7917
  }
7911
7918
  });
7912
7919
  }
@@ -12291,7 +12298,7 @@ var hasFlags = userArgs.some((a) => a.startsWith("-"));
12291
12298
  var cols = process.stdout.columns || 80;
12292
12299
  var rows = process.stdout.rows || 24;
12293
12300
  if (!hasCommand && !hasFlags && process.stdout.isTTY && cols >= 60 && rows >= 20) {
12294
- const { launchTui } = await import("./App-mqm228ma.js");
12301
+ const { launchTui } = await import("./App-8jy21k5k.js");
12295
12302
  await launchTui(program2);
12296
12303
  } else {
12297
12304
  program2.parse();
package/dist/mcp.js CHANGED
@@ -15218,6 +15218,120 @@ You have access to Zefiro, an AI-powered codebase scanner and QA map generator.
15218
15218
  - \`zefiro_scan_ast_detail\` — drill into a specific AST category
15219
15219
  - \`zefiro_build_qa_map\` — validate + write QAMapV2Payload
15220
15220
  - \`zefiro_read_qa_map\` — read existing QA map
15221
+
15222
+ ---
15223
+
15224
+ ## QAMapV2Payload Schema Reference
15225
+
15226
+ The payload passed to \`zefiro_build_qa_map\` MUST conform exactly to this schema. All fields are required unless marked optional.
15227
+
15228
+ ### Top-level structure
15229
+ \`\`\`
15230
+ {
15231
+ features: Feature[] // required, may be []
15232
+ workflows: Workflow[] // required, may be []
15233
+ components: Component[] // required, may be []
15234
+ scenarios: Scenario[] // required, may be []
15235
+ commitSha?: string // optional, auto-injected by the tool
15236
+ metadata?: object // optional free-form
15237
+ }
15238
+ \`\`\`
15239
+
15240
+ ### Feature
15241
+ \`\`\`
15242
+ {
15243
+ id: string // unique, e.g. "feat-auth"
15244
+ name: string
15245
+ description: string
15246
+ routes: string[] // URL paths this feature covers, e.g. ["/login", "/register"]
15247
+ workflowIds: string[] // IDs of workflows that belong to this feature
15248
+ sourceFiles: string[] // relative file paths, e.g. ["src/app/login/page.tsx"]
15249
+ }
15250
+ \`\`\`
15251
+
15252
+ ### Workflow
15253
+ \`\`\`
15254
+ {
15255
+ id: string
15256
+ name: string
15257
+ featureId: string // must match an existing feature id
15258
+ type: "navigation" | "crud" | "multi-step" | "configuration" | "search-filter"
15259
+ preconditions: string[] // may be []
15260
+ steps: WorkflowStep[]
15261
+ componentIds: string[] // component ids used by this workflow, may be []
15262
+ }
15263
+ \`\`\`
15264
+
15265
+ ### WorkflowStep
15266
+ \`\`\`
15267
+ {
15268
+ id: string
15269
+ order: number // 1-based integer
15270
+ description: string
15271
+ componentIds: string[] // component ids involved in this step, may be []
15272
+ apiCalls: string[] // API endpoints called, e.g. ["POST /api/login"], may be []
15273
+ conditionalBranches: ConditionalBranch[] // may be []
15274
+ }
15275
+ \`\`\`
15276
+
15277
+ ### ConditionalBranch
15278
+ \`\`\`
15279
+ {
15280
+ condition: string // e.g. "invalid credentials"
15281
+ outcome: string // e.g. "show error message"
15282
+ type: "validation" | "permission" | "error" | "business-logic"
15283
+ }
15284
+ \`\`\`
15285
+
15286
+ ### Component
15287
+ \`\`\`
15288
+ {
15289
+ id: string
15290
+ name: string
15291
+ type: "form" | "display" | "navigation" | "modal" | "layout" | "feedback"
15292
+ sourceFiles: string[] // relative file paths
15293
+ props: string[] // prop names, may be []
15294
+ referencedByWorkflows: string[] // workflow ids that use this component, may be []
15295
+ }
15296
+ \`\`\`
15297
+
15298
+ ### Scenario
15299
+ \`\`\`
15300
+ {
15301
+ id: string
15302
+ workflowId: string // must match an existing workflow id
15303
+ featureId: string // must match an existing feature id
15304
+ name: string
15305
+ description: string
15306
+ category: "happy-path" | "permission" | "validation" | "error" | "edge-case" | "precondition"
15307
+ preconditions: string[] // may be []
15308
+ steps: ScenarioStep[]
15309
+ expectedOutcome: string
15310
+ componentIds: string[] // component ids exercised, may be []
15311
+ workflowStepIds: string[] // workflow step ids covered, may be []
15312
+ priority: "critical" | "high" | "medium" | "low"
15313
+ }
15314
+ \`\`\`
15315
+
15316
+ ### ScenarioStep
15317
+ \`\`\`
15318
+ {
15319
+ order: number // 1-based integer
15320
+ action: string // what the user/system does
15321
+ expectedResult: string // what should happen
15322
+ }
15323
+ \`\`\`
15324
+
15325
+ ### Referential integrity rules
15326
+ - Every \`workflow.featureId\` must exist in \`features[].id\`
15327
+ - Every \`feature.workflowIds[]\` entry must exist in \`workflows[].id\`
15328
+ - Every \`workflow.componentIds[]\` entry must exist in \`components[].id\`
15329
+ - Every \`scenario.workflowId\` must exist in \`workflows[].id\`
15330
+ - Every \`scenario.featureId\` must exist in \`features[].id\`
15331
+ - Every \`scenario.componentIds[]\` entry must exist in \`components[].id\`
15332
+ - Every \`scenario.workflowStepIds[]\` entry must exist in a \`workflow.steps[].id\`
15333
+ - Every \`component.referencedByWorkflows[]\` entry must exist in \`workflows[].id\`
15334
+ - All ids must be unique within their entity type
15221
15335
  `.trim();
15222
15336
  var server = new McpServer({ name: "zefiro", version: "0.3.2" }, { instructions: SERVER_INSTRUCTIONS });
15223
15337
  server.registerTool("zefiro_scan_codebase", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zefiro",
3
- "version": "0.3.4",
3
+ "version": "0.3.6",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "zefiro": "./dist/cli.js",