@alecsibilia/luca 13.0.0-alpha.5 → 13.0.0-alpha.7

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 (49) hide show
  1. package/dist/chunks/branch.mjs +6 -6
  2. package/dist/chunks/checks.mjs +6 -6
  3. package/dist/chunks/claim-verify.mjs +1 -1
  4. package/dist/chunks/classify.mjs +1 -1
  5. package/dist/chunks/confidence.mjs +6 -6
  6. package/dist/chunks/hook.mjs +4 -4
  7. package/dist/chunks/init.mjs +1 -1
  8. package/dist/chunks/muninn-mcp.mjs +3 -29
  9. package/dist/chunks/phase.mjs +8 -8
  10. package/dist/chunks/pr-review.mjs +6 -6
  11. package/dist/chunks/preferences.mjs +6 -6
  12. package/dist/chunks/repair.mjs +1 -1
  13. package/dist/chunks/repo.mjs +6 -6
  14. package/dist/chunks/retro.mjs +5 -5
  15. package/dist/chunks/roadmap.mjs +6 -6
  16. package/dist/chunks/rules.mjs +5 -5
  17. package/dist/chunks/state.mjs +6 -6
  18. package/dist/chunks/stray-local-install.mjs +1 -1
  19. package/dist/chunks/telemetry.mjs +1 -1
  20. package/dist/chunks/todo.mjs +6 -6
  21. package/dist/chunks/vault-init.mjs +37 -26
  22. package/dist/chunks/verification.mjs +4 -4
  23. package/dist/chunks/workflow.mjs +6 -6
  24. package/dist/claude/.claude/agents/architect.md +1 -1
  25. package/dist/claude/.claude/agents/finalize.md +30 -31
  26. package/dist/claude/.claude/agents/research.md +2 -2
  27. package/dist/claude/.claude/agents/review.md +26 -16
  28. package/dist/claude/.claude/agents/triage.md +3 -4
  29. package/dist/claude/.claude/commands/lu.md +4 -4
  30. package/dist/claude/.claude/commands/milestone-new.md +1 -1
  31. package/dist/claude/.claude/hooks/context-refresher.ts +13 -18
  32. package/dist/claude/.claude/hooks/continuation-messages.ts +13 -18
  33. package/dist/claude/.claude/hooks/pipeline-guard.ts +13 -18
  34. package/dist/claude/skills/autopilot/SKILL.md +3 -2
  35. package/dist/claude/skills/gh-prepare/SKILL.md +1 -1
  36. package/dist/claude/skills/lu/SKILL.md +4 -4
  37. package/dist/claude/skills/phase-execute/SKILL.md +3 -2
  38. package/dist/claude/skills/quick/SKILL.md +4 -3
  39. package/dist/index.mjs +1 -1
  40. package/dist/shared/{luca.DZxAJmyM.mjs → luca.B8ydzQ8S.mjs} +17 -21
  41. package/dist/shared/{luca.0ssL9rcP.mjs → luca.BV4noBW7.mjs} +2 -2
  42. package/dist/shared/{luca.BiHycbFi.mjs → luca.BeGsLJkq.mjs} +3 -3
  43. package/dist/shared/{luca.Cf93m-DM.mjs → luca.CWsqOppt.mjs} +1 -1
  44. package/dist/shared/luca.ChU85KSu.mjs +32 -0
  45. package/dist/shared/{luca.BTcIy-Mh.mjs → luca.CyQeErH2.mjs} +6 -5
  46. package/dist/shared/{luca.B-w_fieK.mjs → luca.Da5I_JVg.mjs} +1 -1
  47. package/dist/shared/{luca.D7w2gjQ5.mjs → luca.Dn7Gbruu.mjs} +2 -2
  48. package/dist/shared/{luca.lLQ2ZIAB.mjs → luca.ELUgu8AW.mjs} +8 -8
  49. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import { defineCommand } from 'citty';
2
2
  import 'zod';
3
- import '../shared/luca.DZxAJmyM.mjs';
3
+ import '../shared/luca.B8ydzQ8S.mjs';
4
4
  import 'node:fs';
5
5
  import 'node:fs/promises';
6
6
  import 'node:path';
@@ -8,12 +8,12 @@ import 'node:crypto';
8
8
  import 'node:module';
9
9
  import 'node:url';
10
10
  import 'node:child_process';
11
- import { r as runWriteHandler, u as lucaBranchGuardTool } from '../shared/luca.lLQ2ZIAB.mjs';
12
- import '../shared/luca.BTcIy-Mh.mjs';
11
+ import { r as runWriteHandler, u as lucaBranchGuardTool } from '../shared/luca.ELUgu8AW.mjs';
12
+ import '../shared/luca.CyQeErH2.mjs';
13
13
  import 'node:os';
14
- import '../shared/luca.Cf93m-DM.mjs';
15
- import '../shared/luca.D7w2gjQ5.mjs';
16
- import '../shared/luca.B-w_fieK.mjs';
14
+ import '../shared/luca.CWsqOppt.mjs';
15
+ import '../shared/luca.Dn7Gbruu.mjs';
16
+ import '../shared/luca.Da5I_JVg.mjs';
17
17
  import '../shared/luca.CQ3g1xrD.mjs';
18
18
 
19
19
  const guardCommand = defineCommand({
@@ -1,6 +1,6 @@
1
1
  import { defineCommand } from 'citty';
2
2
  import 'zod';
3
- import '../shared/luca.DZxAJmyM.mjs';
3
+ import '../shared/luca.B8ydzQ8S.mjs';
4
4
  import 'node:fs';
5
5
  import 'node:fs/promises';
6
6
  import 'node:path';
@@ -8,12 +8,12 @@ import 'node:crypto';
8
8
  import 'node:module';
9
9
  import 'node:url';
10
10
  import 'node:child_process';
11
- import { f as readJsonPayload, r as runWriteHandler, t as lucaChecksRunTool } from '../shared/luca.lLQ2ZIAB.mjs';
12
- import '../shared/luca.BTcIy-Mh.mjs';
11
+ import { f as readJsonPayload, r as runWriteHandler, t as lucaChecksRunTool } from '../shared/luca.ELUgu8AW.mjs';
12
+ import '../shared/luca.CyQeErH2.mjs';
13
13
  import 'node:os';
14
- import '../shared/luca.Cf93m-DM.mjs';
15
- import '../shared/luca.D7w2gjQ5.mjs';
16
- import '../shared/luca.B-w_fieK.mjs';
14
+ import '../shared/luca.CWsqOppt.mjs';
15
+ import '../shared/luca.Dn7Gbruu.mjs';
16
+ import '../shared/luca.Da5I_JVg.mjs';
17
17
  import '../shared/luca.CQ3g1xrD.mjs';
18
18
 
19
19
  const runCommand = defineCommand({
@@ -1,6 +1,6 @@
1
1
  import { defineCommand } from 'citty';
2
2
  import { resolve } from 'pathe';
3
- import '../shared/luca.DZxAJmyM.mjs';
3
+ import '../shared/luca.B8ydzQ8S.mjs';
4
4
  import { readFileSync, existsSync, readdirSync, statSync } from 'node:fs';
5
5
  import 'node:fs/promises';
6
6
  import { join } from 'node:path';
@@ -1,5 +1,5 @@
1
1
  import { defineCommand } from 'citty';
2
- import { C as ClassifyComplexityInputSchema } from '../shared/luca.DZxAJmyM.mjs';
2
+ import { C as ClassifyComplexityInputSchema } from '../shared/luca.B8ydzQ8S.mjs';
3
3
  import 'node:fs';
4
4
  import 'node:fs/promises';
5
5
  import 'node:path';
@@ -1,6 +1,6 @@
1
1
  import { defineCommand } from 'citty';
2
- import '../shared/luca.DZxAJmyM.mjs';
3
- import { l as loadCurrentState, r as resolveActiveSlug } from '../shared/luca.Cf93m-DM.mjs';
2
+ import '../shared/luca.B8ydzQ8S.mjs';
3
+ import { l as loadCurrentState, r as resolveActiveSlug } from '../shared/luca.CWsqOppt.mjs';
4
4
  import 'node:fs';
5
5
  import 'node:fs/promises';
6
6
  import 'node:path';
@@ -8,13 +8,13 @@ import 'node:crypto';
8
8
  import 'node:module';
9
9
  import 'node:url';
10
10
  import 'node:child_process';
11
- import { b as renderConfidenceJournalMarkdown, r as readConfidenceJournal, g as getConfidenceSummary } from '../shared/luca.D7w2gjQ5.mjs';
11
+ import { b as renderConfidenceJournalMarkdown, r as readConfidenceJournal, g as getConfidenceSummary } from '../shared/luca.Dn7Gbruu.mjs';
12
12
  import { l as logger } from '../shared/luca.dM-MKlNE.mjs';
13
13
  import 'zod';
14
- import { f as readJsonPayload, r as runWriteHandler, w as lucaConfidenceLogTool } from '../shared/luca.lLQ2ZIAB.mjs';
15
- import '../shared/luca.BTcIy-Mh.mjs';
14
+ import { f as readJsonPayload, r as runWriteHandler, w as lucaConfidenceLogTool } from '../shared/luca.ELUgu8AW.mjs';
15
+ import '../shared/luca.CyQeErH2.mjs';
16
16
  import 'node:os';
17
- import '../shared/luca.B-w_fieK.mjs';
17
+ import '../shared/luca.Da5I_JVg.mjs';
18
18
  import 'consola';
19
19
  import '../shared/luca.CQ3g1xrD.mjs';
20
20
 
@@ -1,11 +1,11 @@
1
1
  import { defineCommand } from 'citty';
2
- import { c as coarsePhaseOf, t as toLucaRelative, a as classifyWritePath, A as AUDIT_PATH_PATTERN, W as WAVE_FILE_RE } from '../shared/luca.DZxAJmyM.mjs';
3
- import { l as loadCurrentState, r as resolveActiveSlug } from '../shared/luca.Cf93m-DM.mjs';
2
+ import { c as coarsePhaseOf, t as toLucaRelative, a as classifyWritePath, A as AUDIT_PATH_PATTERN, W as WAVE_FILE_RE } from '../shared/luca.B8ydzQ8S.mjs';
3
+ import { l as loadCurrentState, r as resolveActiveSlug } from '../shared/luca.CWsqOppt.mjs';
4
4
  import 'node:fs';
5
5
  import 'node:fs/promises';
6
6
  import 'node:path';
7
- import { l as lucaStateClaimOwnerTool, S as STEP_ARTIFACTS } from '../shared/luca.BTcIy-Mh.mjs';
8
- import { p as phasePathFor } from '../shared/luca.B-w_fieK.mjs';
7
+ import { l as lucaStateClaimOwnerTool, S as STEP_ARTIFACTS } from '../shared/luca.CyQeErH2.mjs';
8
+ import { p as phasePathFor } from '../shared/luca.Da5I_JVg.mjs';
9
9
  import 'node:crypto';
10
10
  import 'node:module';
11
11
  import 'node:url';
@@ -3,7 +3,7 @@ import { defineCommand, runMain } from 'citty';
3
3
  import { existsSync, chmodSync } from 'node:fs';
4
4
  import { mkdir, readFile, writeFile, readdir, copyFile } from 'node:fs/promises';
5
5
  import { join, dirname, delimiter } from 'node:path';
6
- import { l as lucaStateSchema } from '../shared/luca.DZxAJmyM.mjs';
6
+ import { l as lucaStateSchema } from '../shared/luca.B8ydzQ8S.mjs';
7
7
  import 'node:crypto';
8
8
  import 'node:module';
9
9
  import 'node:url';
@@ -1,36 +1,10 @@
1
- import { homedir } from 'node:os';
2
- import { join } from 'node:path';
1
+ import { i as isMuninnRegistered } from '../shared/luca.ChU85KSu.mjs';
2
+ import 'node:os';
3
+ import 'node:path';
3
4
 
4
5
  const CHECK_NAME = "MuninnDB MCP wiring";
5
6
  const MCP_URL = "http://127.0.0.1:8750/mcp";
6
7
  const ADD_COMMAND = 'claude mcp add --transport sse muninn http://localhost:8750/mcp --header "Authorization: Bearer <your-muninn-api-key>"';
7
- async function readJsonObject(path) {
8
- try {
9
- const file = Bun.file(path);
10
- if (!await file.exists()) return null;
11
- const parsed = JSON.parse(await file.text());
12
- return parsed !== null && typeof parsed === "object" ? parsed : null;
13
- } catch {
14
- return null;
15
- }
16
- }
17
- function hasMuninnEntry(mcpServers) {
18
- return mcpServers !== null && typeof mcpServers === "object" && "muninn" in mcpServers;
19
- }
20
- async function isMuninnRegistered(cwd) {
21
- const projectMcp = await readJsonObject(join(cwd, ".mcp.json"));
22
- if (hasMuninnEntry(projectMcp?.mcpServers)) return true;
23
- const userConfig = await readJsonObject(join(homedir(), ".claude.json"));
24
- if (hasMuninnEntry(userConfig?.mcpServers)) return true;
25
- const projects = userConfig?.projects;
26
- if (projects !== null && typeof projects === "object") {
27
- const project = projects[cwd];
28
- if (project !== null && typeof project === "object" && hasMuninnEntry(project.mcpServers)) {
29
- return true;
30
- }
31
- }
32
- return false;
33
- }
34
8
  async function isMcpReachable() {
35
9
  try {
36
10
  const res = await fetch(MCP_URL, {
@@ -1,6 +1,6 @@
1
1
  import { defineCommand } from 'citty';
2
2
  import 'zod';
3
- import '../shared/luca.DZxAJmyM.mjs';
3
+ import '../shared/luca.B8ydzQ8S.mjs';
4
4
  import 'node:fs';
5
5
  import 'node:fs/promises';
6
6
  import 'node:path';
@@ -8,12 +8,12 @@ import 'node:crypto';
8
8
  import 'node:module';
9
9
  import 'node:url';
10
10
  import 'node:child_process';
11
- import { r as runWriteHandler, c as lucaPhaseCurrentTool, d as lucaPhaseAdvanceTool, e as lucaPhaseArchiveTool } from '../shared/luca.lLQ2ZIAB.mjs';
12
- import '../shared/luca.BTcIy-Mh.mjs';
11
+ import { r as runWriteHandler, c as lucaPhaseCurrentTool, d as lucaPhaseAdvanceTool, e as lucaPhaseArchiveTool } from '../shared/luca.ELUgu8AW.mjs';
12
+ import '../shared/luca.CyQeErH2.mjs';
13
13
  import 'node:os';
14
- import '../shared/luca.Cf93m-DM.mjs';
15
- import '../shared/luca.D7w2gjQ5.mjs';
16
- import '../shared/luca.B-w_fieK.mjs';
14
+ import '../shared/luca.CWsqOppt.mjs';
15
+ import '../shared/luca.Dn7Gbruu.mjs';
16
+ import '../shared/luca.Da5I_JVg.mjs';
17
17
  import '../shared/luca.CQ3g1xrD.mjs';
18
18
 
19
19
  const currentCommand = defineCommand({
@@ -28,7 +28,7 @@ const currentCommand = defineCommand({
28
28
  const advanceCommand = defineCommand({
29
29
  meta: {
30
30
  name: "advance",
31
- description: "Advance the active roadmap phase by one (currentPhase \u2192 currentPhase+1), marking the completed phase done and the next in-progress. Call at the phase boundary (learn step) when more phases remain; the final phase routes to the milestone step."
31
+ description: "Advance the active roadmap phase by one (currentPhase \u2192 currentPhase+1), marking the completed phase done and the next in-progress. Call at the phase boundary (learn step) when more phases remain; the final phase routes to the finalize step."
32
32
  },
33
33
  async run() {
34
34
  await runWriteHandler("phase advance", lucaPhaseAdvanceTool, {});
@@ -37,7 +37,7 @@ const advanceCommand = defineCommand({
37
37
  const archiveCommand = defineCommand({
38
38
  meta: {
39
39
  name: "archive",
40
- description: "Archive all active phase directories (.luca/phases/<slug>/ \u2192 .luca/archive/<slug>/) at milestone close, so the next milestone starts from an empty phases/ dir. Idempotent; skips slugs already archived. Allowed only in the milestone/complete steps."
40
+ description: "Archive all active phase directories (.luca/phases/<slug>/ \u2192 .luca/archive/<slug>/) at milestone close, so the next milestone starts from an empty phases/ dir. Idempotent; skips slugs already archived. Allowed only in the finalize step."
41
41
  },
42
42
  async run() {
43
43
  await runWriteHandler("phase archive", lucaPhaseArchiveTool, {});
@@ -1,6 +1,6 @@
1
1
  import { defineCommand } from 'citty';
2
2
  import 'zod';
3
- import '../shared/luca.DZxAJmyM.mjs';
3
+ import '../shared/luca.B8ydzQ8S.mjs';
4
4
  import 'node:fs';
5
5
  import 'node:fs/promises';
6
6
  import 'node:path';
@@ -8,12 +8,12 @@ import 'node:crypto';
8
8
  import 'node:module';
9
9
  import 'node:url';
10
10
  import 'node:child_process';
11
- import { f as readJsonPayload, r as runWriteHandler, o as lucaPrReviewDetectConvergenceTool, p as lucaPrReviewFilterStaleTool, q as lucaPrReviewRegressionCheckTool } from '../shared/luca.lLQ2ZIAB.mjs';
12
- import '../shared/luca.BTcIy-Mh.mjs';
11
+ import { f as readJsonPayload, r as runWriteHandler, o as lucaPrReviewDetectConvergenceTool, p as lucaPrReviewFilterStaleTool, q as lucaPrReviewRegressionCheckTool } from '../shared/luca.ELUgu8AW.mjs';
12
+ import '../shared/luca.CyQeErH2.mjs';
13
13
  import 'node:os';
14
- import '../shared/luca.Cf93m-DM.mjs';
15
- import '../shared/luca.D7w2gjQ5.mjs';
16
- import '../shared/luca.B-w_fieK.mjs';
14
+ import '../shared/luca.CWsqOppt.mjs';
15
+ import '../shared/luca.Dn7Gbruu.mjs';
16
+ import '../shared/luca.Da5I_JVg.mjs';
17
17
  import '../shared/luca.CQ3g1xrD.mjs';
18
18
 
19
19
  const filterStaleCommand = defineCommand({
@@ -1,6 +1,6 @@
1
1
  import { defineCommand } from 'citty';
2
2
  import 'zod';
3
- import '../shared/luca.DZxAJmyM.mjs';
3
+ import '../shared/luca.B8ydzQ8S.mjs';
4
4
  import 'node:fs';
5
5
  import 'node:fs/promises';
6
6
  import 'node:path';
@@ -8,12 +8,12 @@ import 'node:crypto';
8
8
  import 'node:module';
9
9
  import 'node:url';
10
10
  import 'node:child_process';
11
- import { f as readJsonPayload, r as runWriteHandler, i as lucaPreferencesReadTool, j as lucaPreferencesWriteTool } from '../shared/luca.lLQ2ZIAB.mjs';
12
- import '../shared/luca.BTcIy-Mh.mjs';
11
+ import { f as readJsonPayload, r as runWriteHandler, i as lucaPreferencesReadTool, j as lucaPreferencesWriteTool } from '../shared/luca.ELUgu8AW.mjs';
12
+ import '../shared/luca.CyQeErH2.mjs';
13
13
  import 'node:os';
14
- import '../shared/luca.Cf93m-DM.mjs';
15
- import '../shared/luca.D7w2gjQ5.mjs';
16
- import '../shared/luca.B-w_fieK.mjs';
14
+ import '../shared/luca.CWsqOppt.mjs';
15
+ import '../shared/luca.Dn7Gbruu.mjs';
16
+ import '../shared/luca.Da5I_JVg.mjs';
17
17
  import '../shared/luca.CQ3g1xrD.mjs';
18
18
 
19
19
  const readCommand = defineCommand({
@@ -2,7 +2,7 @@ import { defineCommand } from 'citty';
2
2
  import { existsSync } from 'node:fs';
3
3
  import { readFile, rm } from 'node:fs/promises';
4
4
  import { join } from 'node:path';
5
- import { l as lucaStateSchema } from '../shared/luca.DZxAJmyM.mjs';
5
+ import { l as lucaStateSchema } from '../shared/luca.B8ydzQ8S.mjs';
6
6
  import 'node:crypto';
7
7
  import 'node:module';
8
8
  import 'node:url';
@@ -1,6 +1,6 @@
1
1
  import { defineCommand } from 'citty';
2
2
  import 'zod';
3
- import '../shared/luca.DZxAJmyM.mjs';
3
+ import '../shared/luca.B8ydzQ8S.mjs';
4
4
  import 'node:fs';
5
5
  import 'node:fs/promises';
6
6
  import 'node:path';
@@ -8,12 +8,12 @@ import 'node:crypto';
8
8
  import 'node:module';
9
9
  import 'node:url';
10
10
  import 'node:child_process';
11
- import { f as readJsonPayload, r as runWriteHandler, s as lucaRepoCleanupApplyTool } from '../shared/luca.lLQ2ZIAB.mjs';
12
- import '../shared/luca.BTcIy-Mh.mjs';
11
+ import { f as readJsonPayload, r as runWriteHandler, s as lucaRepoCleanupApplyTool } from '../shared/luca.ELUgu8AW.mjs';
12
+ import '../shared/luca.CyQeErH2.mjs';
13
13
  import 'node:os';
14
- import '../shared/luca.Cf93m-DM.mjs';
15
- import '../shared/luca.D7w2gjQ5.mjs';
16
- import '../shared/luca.B-w_fieK.mjs';
14
+ import '../shared/luca.CWsqOppt.mjs';
15
+ import '../shared/luca.Dn7Gbruu.mjs';
16
+ import '../shared/luca.Da5I_JVg.mjs';
17
17
  import '../shared/luca.CQ3g1xrD.mjs';
18
18
 
19
19
  const cleanupApplyCommand = defineCommand({
@@ -1,5 +1,5 @@
1
1
  import { defineCommand } from 'citty';
2
- import '../shared/luca.DZxAJmyM.mjs';
2
+ import '../shared/luca.B8ydzQ8S.mjs';
3
3
  import 'node:fs';
4
4
  import 'node:fs/promises';
5
5
  import 'node:path';
@@ -7,13 +7,13 @@ import 'node:crypto';
7
7
  import 'node:module';
8
8
  import 'node:url';
9
9
  import 'node:child_process';
10
- import { a as analyzeRun, g as gatherRunArtifacts, r as renderPostmortemMarkdown, c as computePostmortemExitCode } from '../shared/luca.BiHycbFi.mjs';
11
- import { l as listRuns } from '../shared/luca.D7w2gjQ5.mjs';
10
+ import { a as analyzeRun, g as gatherRunArtifacts, r as renderPostmortemMarkdown, c as computePostmortemExitCode } from '../shared/luca.BeGsLJkq.mjs';
11
+ import { l as listRuns } from '../shared/luca.Dn7Gbruu.mjs';
12
12
  import { l as logger } from '../shared/luca.dM-MKlNE.mjs';
13
13
  import 'zod';
14
14
  import 'node:os';
15
- import '../shared/luca.0ssL9rcP.mjs';
16
- import '../shared/luca.B-w_fieK.mjs';
15
+ import '../shared/luca.BV4noBW7.mjs';
16
+ import '../shared/luca.Da5I_JVg.mjs';
17
17
  import 'pathe';
18
18
  import 'consola';
19
19
 
@@ -1,6 +1,6 @@
1
1
  import { defineCommand } from 'citty';
2
2
  import 'zod';
3
- import '../shared/luca.DZxAJmyM.mjs';
3
+ import '../shared/luca.B8ydzQ8S.mjs';
4
4
  import 'node:fs';
5
5
  import 'node:fs/promises';
6
6
  import 'node:path';
@@ -8,12 +8,12 @@ import 'node:crypto';
8
8
  import 'node:module';
9
9
  import 'node:url';
10
10
  import 'node:child_process';
11
- import { f as readJsonPayload, r as runWriteHandler, g as lucaRoadmapReadTool, h as lucaRoadmapCreateTool } from '../shared/luca.lLQ2ZIAB.mjs';
12
- import '../shared/luca.BTcIy-Mh.mjs';
11
+ import { f as readJsonPayload, r as runWriteHandler, g as lucaRoadmapReadTool, h as lucaRoadmapCreateTool } from '../shared/luca.ELUgu8AW.mjs';
12
+ import '../shared/luca.CyQeErH2.mjs';
13
13
  import 'node:os';
14
- import '../shared/luca.Cf93m-DM.mjs';
15
- import '../shared/luca.D7w2gjQ5.mjs';
16
- import '../shared/luca.B-w_fieK.mjs';
14
+ import '../shared/luca.CWsqOppt.mjs';
15
+ import '../shared/luca.Dn7Gbruu.mjs';
16
+ import '../shared/luca.Da5I_JVg.mjs';
17
17
  import '../shared/luca.CQ3g1xrD.mjs';
18
18
 
19
19
  const readCommand = defineCommand({
@@ -1,6 +1,6 @@
1
1
  import { defineCommand } from 'citty';
2
2
  import { join as join$1 } from 'pathe';
3
- import '../shared/luca.DZxAJmyM.mjs';
3
+ import '../shared/luca.B8ydzQ8S.mjs';
4
4
  import { existsSync, readdirSync, statSync, readFileSync } from 'node:fs';
5
5
  import 'node:fs/promises';
6
6
  import { isAbsolute, resolve, join, extname } from 'node:path';
@@ -8,13 +8,13 @@ import 'node:crypto';
8
8
  import { createRequire } from 'node:module';
9
9
  import { pathToFileURL } from 'node:url';
10
10
  import 'node:child_process';
11
- import { a as analyzeRun, g as gatherRunArtifacts } from '../shared/luca.BiHycbFi.mjs';
12
- import { l as listRuns } from '../shared/luca.D7w2gjQ5.mjs';
11
+ import { a as analyzeRun, g as gatherRunArtifacts } from '../shared/luca.BeGsLJkq.mjs';
12
+ import { l as listRuns } from '../shared/luca.Dn7Gbruu.mjs';
13
13
  import { l as logger } from '../shared/luca.dM-MKlNE.mjs';
14
14
  import 'zod';
15
15
  import 'node:os';
16
- import '../shared/luca.0ssL9rcP.mjs';
17
- import '../shared/luca.B-w_fieK.mjs';
16
+ import '../shared/luca.BV4noBW7.mjs';
17
+ import '../shared/luca.Da5I_JVg.mjs';
18
18
  import 'consola';
19
19
 
20
20
  let tsModuleCache = void 0;
@@ -1,6 +1,6 @@
1
1
  import { defineCommand } from 'citty';
2
2
  import 'zod';
3
- import '../shared/luca.DZxAJmyM.mjs';
3
+ import '../shared/luca.B8ydzQ8S.mjs';
4
4
  import 'node:fs';
5
5
  import 'node:fs/promises';
6
6
  import 'node:path';
@@ -8,12 +8,12 @@ import 'node:crypto';
8
8
  import 'node:module';
9
9
  import 'node:url';
10
10
  import 'node:child_process';
11
- import { r as runWriteHandler, l as lucaStateSetCurrentPhaseTool, a as lucaStateAdvanceTool, b as lucaStateReadTool } from '../shared/luca.lLQ2ZIAB.mjs';
12
- import { l as lucaStateClaimOwnerTool } from '../shared/luca.BTcIy-Mh.mjs';
11
+ import { r as runWriteHandler, l as lucaStateSetCurrentPhaseTool, a as lucaStateAdvanceTool, b as lucaStateReadTool } from '../shared/luca.ELUgu8AW.mjs';
12
+ import { l as lucaStateClaimOwnerTool } from '../shared/luca.CyQeErH2.mjs';
13
13
  import 'node:os';
14
- import '../shared/luca.Cf93m-DM.mjs';
15
- import '../shared/luca.D7w2gjQ5.mjs';
16
- import '../shared/luca.B-w_fieK.mjs';
14
+ import '../shared/luca.CWsqOppt.mjs';
15
+ import '../shared/luca.Dn7Gbruu.mjs';
16
+ import '../shared/luca.Da5I_JVg.mjs';
17
17
  import '../shared/luca.CQ3g1xrD.mjs';
18
18
 
19
19
  const readCommand = defineCommand({
@@ -1,7 +1,7 @@
1
1
  import { existsSync, lstatSync } from 'node:fs';
2
2
  import { rm, writeFile, readdir, rmdir } from 'node:fs/promises';
3
3
  import { join } from 'node:path';
4
- import '../shared/luca.DZxAJmyM.mjs';
4
+ import '../shared/luca.B8ydzQ8S.mjs';
5
5
  import 'node:crypto';
6
6
  import 'node:module';
7
7
  import 'node:url';
@@ -1,5 +1,5 @@
1
1
  import { defineCommand } from 'citty';
2
- import { R as RunIdSchema, L as LUCA_DIR_ROOT, T as TelemetryRecordSchema } from '../shared/luca.DZxAJmyM.mjs';
2
+ import { R as RunIdSchema, L as LUCA_DIR_ROOT, T as TelemetryRecordSchema } from '../shared/luca.B8ydzQ8S.mjs';
3
3
  import { mkdirSync, appendFileSync } from 'node:fs';
4
4
  import 'node:fs/promises';
5
5
  import { join, dirname } from 'node:path';
@@ -1,6 +1,6 @@
1
1
  import { defineCommand } from 'citty';
2
2
  import 'zod';
3
- import '../shared/luca.DZxAJmyM.mjs';
3
+ import '../shared/luca.B8ydzQ8S.mjs';
4
4
  import 'node:fs';
5
5
  import 'node:fs/promises';
6
6
  import 'node:path';
@@ -8,12 +8,12 @@ import 'node:crypto';
8
8
  import 'node:module';
9
9
  import 'node:url';
10
10
  import 'node:child_process';
11
- import { f as readJsonPayload, r as runWriteHandler, k as lucaTodoUpdateTool, m as lucaTodoListTool, n as lucaTodoAddTool } from '../shared/luca.lLQ2ZIAB.mjs';
12
- import '../shared/luca.BTcIy-Mh.mjs';
11
+ import { f as readJsonPayload, r as runWriteHandler, k as lucaTodoUpdateTool, m as lucaTodoListTool, n as lucaTodoAddTool } from '../shared/luca.ELUgu8AW.mjs';
12
+ import '../shared/luca.CyQeErH2.mjs';
13
13
  import 'node:os';
14
- import '../shared/luca.Cf93m-DM.mjs';
15
- import '../shared/luca.D7w2gjQ5.mjs';
16
- import '../shared/luca.B-w_fieK.mjs';
14
+ import '../shared/luca.CWsqOppt.mjs';
15
+ import '../shared/luca.Dn7Gbruu.mjs';
16
+ import '../shared/luca.Da5I_JVg.mjs';
17
17
  import '../shared/luca.CQ3g1xrD.mjs';
18
18
 
19
19
  const addCommand = defineCommand({
@@ -1,5 +1,5 @@
1
1
  import { existsSync, chmodSync, mkdirSync } from 'node:fs';
2
- import '../shared/luca.DZxAJmyM.mjs';
2
+ import '../shared/luca.B8ydzQ8S.mjs';
3
3
  import 'node:fs/promises';
4
4
  import 'node:path';
5
5
  import { l as loadCurrentConfig } from '../shared/luca.CQ3g1xrD.mjs';
@@ -12,6 +12,7 @@ import { defineCommand } from 'citty';
12
12
  import { join, basename } from 'pathe';
13
13
  import { z } from 'zod';
14
14
  import { d as checkMuninndbService, c as resolveMuninndbPort } from '../shared/luca.BfjhRHhj.mjs';
15
+ import { i as isMuninnRegistered } from '../shared/luca.ChU85KSu.mjs';
15
16
  import 'node:os';
16
17
  import '../shared/luca.DTomPq7I.mjs';
17
18
  import 'semver';
@@ -84,8 +85,14 @@ function sanitizeJsonParse(json) {
84
85
  const VaultConfigSchema = z.object({
85
86
  /** Sanitized vault name in lowercase kebab-case. */
86
87
  vaultName: z.string().min(1),
87
- /** MuninnDB API key for authentication. */
88
- apiKey: z.string().min(1)
88
+ /**
89
+ * MuninnDB API key. OPTIONAL — it is an instance-level credential needed
90
+ * only ONCE to register the MuninnDB MCP server, which then reaches every
91
+ * vault (the vault is a per-tool-call parameter). When a `muninn` MCP
92
+ * server is already registered, the wizard records just the vault name and
93
+ * leaves this unset.
94
+ */
95
+ apiKey: z.string().min(1).optional()
89
96
  });
90
97
  function muninndbWebUiUrl() {
91
98
  return `http://127.0.0.1:${resolveMuninndbPort()}`;
@@ -123,16 +130,26 @@ async function runVaultWizard(context, cwd = process.cwd()) {
123
130
  });
124
131
  if (p.isCancel(vaultName)) return null;
125
132
  const finalVaultName = sanitizeVaultName(String(vaultName));
133
+ if (await isMuninnRegistered(cwd)) {
134
+ p.log.success(
135
+ "MuninnDB MCP server already registered \u2014 it reaches every vault, so no API key is needed here."
136
+ );
137
+ return { vaultName: finalVaultName };
138
+ }
126
139
  p.note(
127
140
  [
128
- "To generate an API key, open the MuninnDB Web UI:",
141
+ "No MuninnDB MCP server is registered with Claude Code yet. The key",
142
+ "below is an INSTANCE-level credential, captured once to register",
143
+ "the server \u2014 that single registration then reaches every vault.",
144
+ "",
145
+ "Generate one in the MuninnDB Web UI:",
129
146
  "",
130
147
  ` ${muninndbWebUiUrl()}`,
131
148
  "",
132
- "Navigate to Settings > API Keys and create a new key.",
133
- "If MuninnDB is not running, you can set this up later."
149
+ "Settings > API Keys > create a new key. You can also skip this and",
150
+ "register the server later (see `luca doctor`)."
134
151
  ].join("\n"),
135
- "API Key"
152
+ "API Key (one-time)"
136
153
  );
137
154
  const apiKey = await p.password({
138
155
  message: "MuninnDB API key (leave empty to skip)"
@@ -141,12 +158,12 @@ async function runVaultWizard(context, cwd = process.cwd()) {
141
158
  const trimmedKey = String(apiKey ?? "").trim();
142
159
  if (trimmedKey.length === 0) {
143
160
  p.log.warn(
144
- "No API key provided. You can set MUNINN_API_KEY in .env later."
161
+ "No API key provided. Vault name recorded; register the MuninnDB MCP server later (see `luca doctor`)."
145
162
  );
146
- return null;
163
+ return { vaultName: finalVaultName };
147
164
  }
148
165
  const confirmed = await p.confirm({
149
- message: `Set vault "${finalVaultName}" with the provided API key?`,
166
+ message: `Set vault "${finalVaultName}" and write the API key to .env?`,
150
167
  initialValue: true
151
168
  });
152
169
  if (p.isCancel(confirmed) || !confirmed) return null;
@@ -173,14 +190,8 @@ async function writeVaultConfig(vaultName, configPath) {
173
190
  config.muninn = { ...existing, vault: vaultName };
174
191
  await Bun.write(configPath, JSON.stringify(config, null, 2) + "\n");
175
192
  }
176
- async function writeApiKeyToEnv(apiKey, envPath, vaultName) {
177
- const vaultKey = vaultName ? `MUNINN_DB_${vaultName.toUpperCase().replace(/[^A-Z0-9]/g, "_")}_API_KEY` : "MUNINN_DB_API_KEY";
178
- const envLines = [
179
- `${vaultKey}=${apiKey}`,
180
- // Default vault key is always needed for cross-cutting memories
181
- ...vaultName && vaultName !== "default" ? [`MUNINN_DB_DEFAULT_API_KEY=${apiKey}`] : [],
182
- `MUNINN_DB_API_KEY=${apiKey}`
183
- ];
193
+ async function writeApiKeyToEnv(apiKey, envPath) {
194
+ const envLines = [`MUNINN_DB_API_KEY=${apiKey}`];
184
195
  const file = Bun.file(envPath);
185
196
  if (await file.exists()) {
186
197
  let content = await file.text();
@@ -277,14 +288,14 @@ const vaultInitCommand = defineCommand({
277
288
  const envPath = join(cwd, ".env");
278
289
  await writeVaultConfig(vaultResult.vaultName, configPath);
279
290
  p.log.success("Vault name written to .luca/config.json");
280
- await writeApiKeyToEnv(
281
- vaultResult.apiKey,
282
- envPath,
283
- vaultResult.vaultName
284
- );
285
- p.log.success("API key written to .env");
286
- await ensureEnvInGitignore(cwd);
287
- p.log.success(".env protected in .gitignore");
291
+ if (vaultResult.apiKey) {
292
+ await writeApiKeyToEnv(vaultResult.apiKey, envPath);
293
+ p.log.success("API key written to .env");
294
+ }
295
+ if (existsSync(envPath)) {
296
+ await ensureEnvInGitignore(cwd);
297
+ p.log.success(".env protected in .gitignore");
298
+ }
288
299
  const reachable = await verifyVaultConnection(vaultResult.vaultName);
289
300
  if (reachable) {
290
301
  p.log.success(
@@ -1,6 +1,6 @@
1
1
  import { defineCommand } from 'citty';
2
- import '../shared/luca.DZxAJmyM.mjs';
3
- import { l as loadCurrentState, r as resolveActiveSlug } from '../shared/luca.Cf93m-DM.mjs';
2
+ import '../shared/luca.B8ydzQ8S.mjs';
3
+ import { l as loadCurrentState, r as resolveActiveSlug } from '../shared/luca.CWsqOppt.mjs';
4
4
  import 'node:fs';
5
5
  import 'node:fs/promises';
6
6
  import 'node:path';
@@ -8,11 +8,11 @@ import 'node:crypto';
8
8
  import 'node:module';
9
9
  import 'node:url';
10
10
  import 'node:child_process';
11
- import { l as listPhaseSlugs, r as readVerificationResult, a as aggregateVerificationResults } from '../shared/luca.0ssL9rcP.mjs';
11
+ import { l as listPhaseSlugs, r as readVerificationResult, a as aggregateVerificationResults } from '../shared/luca.BV4noBW7.mjs';
12
12
  import { l as logger } from '../shared/luca.dM-MKlNE.mjs';
13
13
  import 'zod';
14
14
  import 'node:os';
15
- import '../shared/luca.B-w_fieK.mjs';
15
+ import '../shared/luca.Da5I_JVg.mjs';
16
16
  import 'pathe';
17
17
  import 'consola';
18
18
 
@@ -1,6 +1,6 @@
1
1
  import { defineCommand } from 'citty';
2
2
  import 'zod';
3
- import '../shared/luca.DZxAJmyM.mjs';
3
+ import '../shared/luca.B8ydzQ8S.mjs';
4
4
  import 'node:fs';
5
5
  import 'node:fs/promises';
6
6
  import 'node:path';
@@ -8,12 +8,12 @@ import 'node:crypto';
8
8
  import 'node:module';
9
9
  import 'node:url';
10
10
  import 'node:child_process';
11
- import { r as runWriteHandler, v as lucaWorkflowResetTool } from '../shared/luca.lLQ2ZIAB.mjs';
12
- import '../shared/luca.BTcIy-Mh.mjs';
11
+ import { r as runWriteHandler, v as lucaWorkflowResetTool } from '../shared/luca.ELUgu8AW.mjs';
12
+ import '../shared/luca.CyQeErH2.mjs';
13
13
  import 'node:os';
14
- import '../shared/luca.Cf93m-DM.mjs';
15
- import '../shared/luca.D7w2gjQ5.mjs';
16
- import '../shared/luca.B-w_fieK.mjs';
14
+ import '../shared/luca.CWsqOppt.mjs';
15
+ import '../shared/luca.Dn7Gbruu.mjs';
16
+ import '../shared/luca.Da5I_JVg.mjs';
17
17
  import '../shared/luca.CQ3g1xrD.mjs';
18
18
 
19
19
  const resetCommand = defineCommand({
@@ -342,7 +342,7 @@ If changes requested, revise and re-submit. In **full-auto**, skip approval —
342
342
  When the plan is approved (or auto-approved in full-auto):
343
343
 
344
344
  1. The plan file is the canonical `.luca/phases/<currentPhaseSlug>/plan.md` written via `luca` artifact write semantics. Downstream stages resolve it deterministically from the phase slug and the LUCA_DIR_CONTRACT; no separate `planFile` state field is needed.
345
- 2. Transition to **Execute** mode via `luca state advance --to-step execute`.
345
+ 2. Transition to the **plan** step via `luca state advance --to-step plan` (the only legal next step from `architect`; planning then flows plan → plan-review → execute per the pipeline-transitions table).
346
346
 
347
347
  ---
348
348