@alecsibilia/luca 13.0.0 → 13.1.0-alpha.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.
Files changed (58) hide show
  1. package/dist/chunks/brain.mjs +8 -8
  2. package/dist/chunks/branch.mjs +8 -8
  3. package/dist/chunks/checks.mjs +8 -8
  4. package/dist/chunks/claim-verify.mjs +1 -1
  5. package/dist/chunks/classify.mjs +1 -1
  6. package/dist/chunks/confidence.mjs +8 -8
  7. package/dist/chunks/doctor.mjs +2 -0
  8. package/dist/chunks/graph.mjs +162 -0
  9. package/dist/chunks/hook.mjs +4 -4
  10. package/dist/chunks/init.mjs +9 -86
  11. package/dist/chunks/luca-gitignore.mjs +3 -2
  12. package/dist/chunks/phase.mjs +8 -8
  13. package/dist/chunks/plan.mjs +8 -8
  14. package/dist/chunks/pr-review.mjs +8 -8
  15. package/dist/chunks/preferences.mjs +8 -8
  16. package/dist/chunks/repair.mjs +1 -1
  17. package/dist/chunks/repo.mjs +8 -8
  18. package/dist/chunks/retro.mjs +6 -6
  19. package/dist/chunks/roadmap.mjs +8 -8
  20. package/dist/chunks/rules.mjs +6 -6
  21. package/dist/chunks/runner.mjs +289 -0
  22. package/dist/chunks/state.mjs +24 -9
  23. package/dist/chunks/statusline-registered.mjs +145 -0
  24. package/dist/chunks/statusline.mjs +64 -0
  25. package/dist/chunks/stray-local-install.mjs +2 -2
  26. package/dist/chunks/telemetry.mjs +8 -8
  27. package/dist/chunks/todo.mjs +8 -8
  28. package/dist/chunks/vault-init.mjs +2 -2
  29. package/dist/chunks/verification.mjs +6 -6
  30. package/dist/chunks/workflow.mjs +8 -8
  31. package/dist/claude/.claude/agents/architect.md +2 -0
  32. package/dist/claude/.claude/agents/execute.md +5 -7
  33. package/dist/claude/.claude/commands/lu.md +1 -1
  34. package/dist/claude/.claude/hooks/context-refresher.ts +4203 -47
  35. package/dist/claude/.claude/hooks/continuation-messages.ts +4202 -46
  36. package/dist/claude/.claude/hooks/pipeline-guard.ts +4202 -46
  37. package/dist/claude/.claude/luca-statusline.ts +14 -1
  38. package/dist/claude/skills/lu/SKILL.md +10 -2
  39. package/dist/claude/skills/phase-execute/SKILL.md +31 -394
  40. package/dist/claude/skills/trace-insights/SKILL.md +317 -0
  41. package/dist/index.mjs +7 -1
  42. package/dist/shared/{luca.F3D90t11.mjs → luca.4GAIaUJ9.mjs} +2 -2
  43. package/dist/shared/{luca.LXh1v8zr.mjs → luca.B0-3raH6.mjs} +1 -1
  44. package/dist/shared/luca.B2-XLiAh.mjs +5603 -0
  45. package/dist/shared/luca.BiqdeEXi.mjs +63 -0
  46. package/dist/shared/luca.BqmgwLb7.mjs +88 -0
  47. package/dist/shared/{luca.Dqloj2-2.mjs → luca.BvjJXX7X.mjs} +2 -2
  48. package/dist/shared/{luca.DDb4WHV5.mjs → luca.C-v36IzX.mjs} +1 -1
  49. package/dist/shared/{luca.Bdq1J16r.mjs → luca.CBjkiJav.mjs} +1 -1
  50. package/dist/shared/{luca.CIYP8N2e.mjs → luca.CPv3B14W.mjs} +2 -2
  51. package/dist/shared/{luca.raYjreBY.mjs → luca.CUbGKcdY.mjs} +1 -1
  52. package/dist/shared/{luca.DdFkobL1.mjs → luca.CpFpA7_C.mjs} +1 -1
  53. package/dist/shared/{luca.E5xdUA-2.mjs → luca.D0gueIEC.mjs} +122 -16
  54. package/dist/shared/{luca.41dcdyd6.mjs → luca.DJdV6_Fe.mjs} +140 -4
  55. package/dist/shared/{luca.X1ymL7m1.mjs → luca.X1IuR7-Y.mjs} +4 -4
  56. package/dist/shared/{luca.BIOOhA-l.mjs → luca.pgUeD_0M.mjs} +1 -1
  57. package/package.json +4 -4
  58. package/dist/shared/luca.CWvhdASW.mjs +0 -1369
@@ -1,7 +1,7 @@
1
1
  import { defineCommand } from 'citty';
2
- import { r as rejectUnknownFlags, a as runWriteHandler } from '../shared/luca.CIYP8N2e.mjs';
2
+ import { r as rejectUnknownFlags, a as runWriteHandler } from '../shared/luca.CPv3B14W.mjs';
3
3
  import 'zod';
4
- import '../shared/luca.CWvhdASW.mjs';
4
+ import '../shared/luca.B2-XLiAh.mjs';
5
5
  import 'node:fs';
6
6
  import 'node:fs/promises';
7
7
  import 'node:path';
@@ -9,15 +9,15 @@ import 'node:crypto';
9
9
  import 'node:module';
10
10
  import 'node:url';
11
11
  import 'node:child_process';
12
- import { t as lucaBrainRecallRootTool, u as lucaBrainSetRootTool } from '../shared/luca.E5xdUA-2.mjs';
13
- import '../shared/luca.LXh1v8zr.mjs';
14
- import '../shared/luca.raYjreBY.mjs';
12
+ import { t as lucaBrainRecallRootTool, u as lucaBrainSetRootTool } from '../shared/luca.D0gueIEC.mjs';
13
+ import '../shared/luca.B0-3raH6.mjs';
14
+ import '../shared/luca.CUbGKcdY.mjs';
15
15
  import 'node:os';
16
16
  import '../shared/luca.CQ3g1xrD.mjs';
17
- import '../shared/luca.Dqloj2-2.mjs';
18
- import '../shared/luca.DdFkobL1.mjs';
17
+ import '../shared/luca.BvjJXX7X.mjs';
18
+ import '../shared/luca.CpFpA7_C.mjs';
19
19
  import '../shared/luca.BpClq9Sj.mjs';
20
- import '../shared/luca.F3D90t11.mjs';
20
+ import '../shared/luca.4GAIaUJ9.mjs';
21
21
 
22
22
  const setRootCommand = defineCommand({
23
23
  meta: {
@@ -1,7 +1,7 @@
1
1
  import { defineCommand } from 'citty';
2
- import { r as rejectUnknownFlags, a as runWriteHandler } from '../shared/luca.CIYP8N2e.mjs';
2
+ import { r as rejectUnknownFlags, a as runWriteHandler } from '../shared/luca.CPv3B14W.mjs';
3
3
  import 'zod';
4
- import '../shared/luca.CWvhdASW.mjs';
4
+ import '../shared/luca.B2-XLiAh.mjs';
5
5
  import 'node:fs';
6
6
  import 'node:fs/promises';
7
7
  import 'node:path';
@@ -9,15 +9,15 @@ import 'node:crypto';
9
9
  import 'node:module';
10
10
  import 'node:url';
11
11
  import 'node:child_process';
12
- import { A as lucaBranchGuardTool } from '../shared/luca.E5xdUA-2.mjs';
13
- import '../shared/luca.LXh1v8zr.mjs';
14
- import '../shared/luca.raYjreBY.mjs';
12
+ import { A as lucaBranchGuardTool } from '../shared/luca.D0gueIEC.mjs';
13
+ import '../shared/luca.B0-3raH6.mjs';
14
+ import '../shared/luca.CUbGKcdY.mjs';
15
15
  import 'node:os';
16
16
  import '../shared/luca.CQ3g1xrD.mjs';
17
- import '../shared/luca.Dqloj2-2.mjs';
18
- import '../shared/luca.DdFkobL1.mjs';
17
+ import '../shared/luca.BvjJXX7X.mjs';
18
+ import '../shared/luca.CpFpA7_C.mjs';
19
19
  import '../shared/luca.BpClq9Sj.mjs';
20
- import '../shared/luca.F3D90t11.mjs';
20
+ import '../shared/luca.4GAIaUJ9.mjs';
21
21
 
22
22
  const guardCommand = defineCommand({
23
23
  meta: {
@@ -1,7 +1,7 @@
1
1
  import { defineCommand } from 'citty';
2
- import { r as rejectUnknownFlags, b as readJsonPayload, a as runWriteHandler } from '../shared/luca.CIYP8N2e.mjs';
2
+ import { r as rejectUnknownFlags, b as readJsonPayload, a as runWriteHandler } from '../shared/luca.CPv3B14W.mjs';
3
3
  import 'zod';
4
- import '../shared/luca.CWvhdASW.mjs';
4
+ import '../shared/luca.B2-XLiAh.mjs';
5
5
  import 'node:fs';
6
6
  import 'node:fs/promises';
7
7
  import 'node:path';
@@ -9,15 +9,15 @@ import 'node:crypto';
9
9
  import 'node:module';
10
10
  import 'node:url';
11
11
  import 'node:child_process';
12
- import { z as lucaChecksRunTool } from '../shared/luca.E5xdUA-2.mjs';
13
- import '../shared/luca.LXh1v8zr.mjs';
14
- import '../shared/luca.raYjreBY.mjs';
12
+ import { z as lucaChecksRunTool } from '../shared/luca.D0gueIEC.mjs';
13
+ import '../shared/luca.B0-3raH6.mjs';
14
+ import '../shared/luca.CUbGKcdY.mjs';
15
15
  import 'node:os';
16
16
  import '../shared/luca.CQ3g1xrD.mjs';
17
- import '../shared/luca.Dqloj2-2.mjs';
18
- import '../shared/luca.DdFkobL1.mjs';
17
+ import '../shared/luca.BvjJXX7X.mjs';
18
+ import '../shared/luca.CpFpA7_C.mjs';
19
19
  import '../shared/luca.BpClq9Sj.mjs';
20
- import '../shared/luca.F3D90t11.mjs';
20
+ import '../shared/luca.4GAIaUJ9.mjs';
21
21
 
22
22
  const runCommand = defineCommand({
23
23
  meta: {
@@ -1,4 +1,4 @@
1
- import { v as verifyFile } from '../shared/luca.CWvhdASW.mjs';
1
+ import { v as verifyFile } from '../shared/luca.B2-XLiAh.mjs';
2
2
  import 'node:fs';
3
3
  import 'node:fs/promises';
4
4
  import 'node:path';
@@ -1,4 +1,4 @@
1
- import { C as ClassifyComplexityInputSchema } from '../shared/luca.CWvhdASW.mjs';
1
+ import { C as ClassifyComplexityInputSchema } from '../shared/luca.B2-XLiAh.mjs';
2
2
  import 'node:fs';
3
3
  import 'node:fs/promises';
4
4
  import 'node:path';
@@ -1,5 +1,5 @@
1
- import '../shared/luca.CWvhdASW.mjs';
2
- import { l as loadCurrentState, r as resolveActiveSlug } from '../shared/luca.raYjreBY.mjs';
1
+ import '../shared/luca.B2-XLiAh.mjs';
2
+ import { l as loadCurrentState, r as resolveActiveSlug } from '../shared/luca.CUbGKcdY.mjs';
3
3
  import 'node:fs';
4
4
  import 'node:fs/promises';
5
5
  import 'node:path';
@@ -7,19 +7,19 @@ import 'node:crypto';
7
7
  import 'node:module';
8
8
  import 'node:url';
9
9
  import 'node:child_process';
10
- import { r as readConfidenceJournal, b as renderConfidenceJournalMarkdown, g as getConfidenceSummary } from '../shared/luca.Dqloj2-2.mjs';
10
+ import { r as readConfidenceJournal, b as renderConfidenceJournalMarkdown, g as getConfidenceSummary } from '../shared/luca.BvjJXX7X.mjs';
11
11
  import { defineCommand } from 'citty';
12
- import { r as rejectUnknownFlags, b as readJsonPayload, a as runWriteHandler } from '../shared/luca.CIYP8N2e.mjs';
12
+ import { r as rejectUnknownFlags, b as readJsonPayload, a as runWriteHandler } from '../shared/luca.CPv3B14W.mjs';
13
13
  import { l as logger } from '../shared/luca.dM-MKlNE.mjs';
14
14
  import 'zod';
15
- import { C as lucaConfidenceLogTool } from '../shared/luca.E5xdUA-2.mjs';
16
- import '../shared/luca.LXh1v8zr.mjs';
15
+ import { C as lucaConfidenceLogTool } from '../shared/luca.D0gueIEC.mjs';
16
+ import '../shared/luca.B0-3raH6.mjs';
17
17
  import 'node:os';
18
- import '../shared/luca.DdFkobL1.mjs';
18
+ import '../shared/luca.CpFpA7_C.mjs';
19
19
  import 'consola';
20
20
  import '../shared/luca.CQ3g1xrD.mjs';
21
21
  import '../shared/luca.BpClq9Sj.mjs';
22
- import '../shared/luca.F3D90t11.mjs';
22
+ import '../shared/luca.4GAIaUJ9.mjs';
23
23
 
24
24
  function selectConfidenceGateActions(entries) {
25
25
  const auto = [];
@@ -17,6 +17,7 @@ async function executeDoctor(options = {}) {
17
17
  const { lucaGitignoreCheck } = await import('./luca-gitignore.mjs');
18
18
  const { configVersionSkewCheck } = await import('./config-version-skew.mjs');
19
19
  const { vaultConfigLocationCheck } = await import('./vault-config-location.mjs');
20
+ const { statuslineRegisteredCheck } = await import('./statusline-registered.mjs');
20
21
  const allChecks = [
21
22
  // Prerequisites
22
23
  bunRuntimeCheck,
@@ -28,6 +29,7 @@ async function executeDoctor(options = {}) {
28
29
  legacyPackageCheck,
29
30
  legacyClaudeArtifactsCheck,
30
31
  sharedTmpPayloadsCheck,
32
+ statuslineRegisteredCheck,
31
33
  // Project (cwd-dependent)
32
34
  strayLocalInstallCheck,
33
35
  configVersionSkewCheck,
@@ -0,0 +1,162 @@
1
+ import { S as StateMachine, p as pipelineMachine } from '../shared/luca.B2-XLiAh.mjs';
2
+ import 'node:fs';
3
+ import 'node:fs/promises';
4
+ import 'node:path';
5
+ import 'node:crypto';
6
+ import 'node:module';
7
+ import 'node:url';
8
+ import 'node:child_process';
9
+ import { defineCommand } from 'citty';
10
+ import 'zod';
11
+ import 'node:os';
12
+
13
+ function getChildren(stateNode) {
14
+ if (!stateNode.states) {
15
+ return [];
16
+ }
17
+ const children = Object.keys(stateNode.states).map(key => {
18
+ return stateNode.states[key];
19
+ });
20
+ return children;
21
+ }
22
+ function toDirectedGraph(stateMachine) {
23
+ const stateNode = stateMachine instanceof StateMachine ? stateMachine.root : stateMachine; // TODO: accept only machines
24
+
25
+ const edges = [...stateNode.transitions.values()].flat().flatMap((t, transitionIndex) => {
26
+ const targets = t.target ? t.target : [stateNode];
27
+ return targets.map((target, targetIndex) => {
28
+ const edge = {
29
+ id: `${stateNode.id}:${transitionIndex}:${targetIndex}`,
30
+ source: stateNode,
31
+ target: target,
32
+ transition: t,
33
+ label: {
34
+ text: t.eventType,
35
+ toJSON: () => ({
36
+ text: t.eventType
37
+ })
38
+ },
39
+ toJSON: () => {
40
+ const {
41
+ label
42
+ } = edge;
43
+ return {
44
+ source: stateNode.id,
45
+ target: target.id,
46
+ label
47
+ };
48
+ }
49
+ };
50
+ return edge;
51
+ });
52
+ });
53
+ const graph = {
54
+ id: stateNode.id,
55
+ stateNode: stateNode,
56
+ children: getChildren(stateNode).map(toDirectedGraph),
57
+ edges,
58
+ toJSON: () => {
59
+ const {
60
+ id,
61
+ children,
62
+ edges: graphEdges
63
+ } = graph;
64
+ return {
65
+ id,
66
+ children,
67
+ edges: graphEdges
68
+ };
69
+ }
70
+ };
71
+ return graph;
72
+ }
73
+
74
+ function collectEdges(node, acc) {
75
+ for (const edge of node.edges ?? []) acc.push(edge);
76
+ for (const child of node.children ?? []) collectEdges(child, acc);
77
+ }
78
+ function directedGraph() {
79
+ return toDirectedGraph(pipelineMachine);
80
+ }
81
+ function edgeActionLabels(edge) {
82
+ return (edge.transition.actions ?? []).map((a) => a.type);
83
+ }
84
+ function edgeLine(edge, annotate, indent) {
85
+ const labels = edgeActionLabels(edge);
86
+ const suffix = annotate && labels.length > 0 ? ` / ${labels.join(", ")}` : "";
87
+ return `${indent}${edge.source.key} --> ${edge.target.key} : ADVANCE${suffix}`;
88
+ }
89
+ function renderPipelineMermaid(opts) {
90
+ const annotate = opts?.annotate ?? false;
91
+ const root = directedGraph();
92
+ const children = root.children ?? [];
93
+ const leafParent = /* @__PURE__ */ new Map();
94
+ const composites = [];
95
+ for (const child of children) {
96
+ const grandkids = child.children ?? [];
97
+ if (grandkids.length === 0) {
98
+ leafParent.set(child.stateNode.key, null);
99
+ } else {
100
+ const leaves = grandkids.map((g) => g.stateNode.key);
101
+ for (const leaf of leaves) leafParent.set(leaf, child.stateNode.key);
102
+ composites.push({ key: child.stateNode.key, leaves });
103
+ }
104
+ }
105
+ const allEdges = [];
106
+ collectEdges(root, allEdges);
107
+ const isIntra = (edge) => {
108
+ const from = leafParent.get(edge.source.key) ?? null;
109
+ const to = leafParent.get(edge.target.key) ?? null;
110
+ return from !== null && from === to;
111
+ };
112
+ const lines = ["stateDiagram-v2", " [*] --> idle"];
113
+ for (const composite of composites) {
114
+ lines.push(` state ${composite.key} {`);
115
+ for (const leaf of composite.leaves) lines.push(` ${leaf}`);
116
+ for (const edge of allEdges) {
117
+ if (leafParent.get(edge.source.key) !== composite.key) continue;
118
+ if (!isIntra(edge)) continue;
119
+ lines.push(edgeLine(edge, annotate, " "));
120
+ }
121
+ lines.push(" }");
122
+ }
123
+ for (const edge of allEdges) {
124
+ if (isIntra(edge)) continue;
125
+ lines.push(edgeLine(edge, annotate, " "));
126
+ }
127
+ return lines.join("\n");
128
+ }
129
+ function pipelineDefinitionJson() {
130
+ return JSON.stringify(pipelineMachine.toJSON(), null, 2);
131
+ }
132
+
133
+ const FORMATS = /* @__PURE__ */ new Set(["mermaid", "json"]);
134
+ const graphCommand = defineCommand({
135
+ meta: {
136
+ name: "graph",
137
+ description: "Visualize the pipeline state machine (Mermaid stateDiagram-v2 or JSON)."
138
+ },
139
+ args: {
140
+ format: {
141
+ type: "string",
142
+ default: "mermaid",
143
+ description: "Output format: mermaid (default) or json."
144
+ },
145
+ annotate: {
146
+ type: "boolean",
147
+ default: false,
148
+ description: "Annotate Mermaid edges with fix-loop action labels (mermaid only)."
149
+ }
150
+ },
151
+ run({ args }) {
152
+ if (!FORMATS.has(args.format)) {
153
+ process.exitCode = 1;
154
+ return;
155
+ }
156
+ const out = args.format === "json" ? pipelineDefinitionJson() : renderPipelineMermaid({ annotate: args.annotate });
157
+ process.stdout.write(`${out}
158
+ `);
159
+ }
160
+ });
161
+
162
+ export { graphCommand };
@@ -1,17 +1,17 @@
1
1
  import { defineCommand } from 'citty';
2
2
  import { tmpdir } from 'node:os';
3
- import { c as coarsePhaseOf, t as toLucaRelative, a as classifyWritePath, T as TMP_PATH_PATTERN, A as AUDIT_PATH_PATTERN, W as WAVE_FILE_RE } from '../shared/luca.CWvhdASW.mjs';
4
- import { l as loadCurrentState, S as STEP_ARTIFACTS, r as resolveActiveSlug } from '../shared/luca.raYjreBY.mjs';
3
+ import { c as coarsePhaseOf, t as toLucaRelative, a as classifyWritePath, T as TMP_PATH_PATTERN, A as AUDIT_PATH_PATTERN, W as WAVE_FILE_RE } from '../shared/luca.B2-XLiAh.mjs';
4
+ import { l as loadCurrentState, S as STEP_ARTIFACTS, r as resolveActiveSlug } from '../shared/luca.CUbGKcdY.mjs';
5
5
  import 'node:fs';
6
6
  import 'node:fs/promises';
7
7
  import 'node:path';
8
- import { p as phasePathFor } from '../shared/luca.DdFkobL1.mjs';
8
+ import { p as phasePathFor } from '../shared/luca.CpFpA7_C.mjs';
9
9
  import 'node:crypto';
10
10
  import 'node:module';
11
11
  import 'node:url';
12
12
  import 'node:child_process';
13
13
  import { parse } from 'shell-quote';
14
- import { l as lucaStateClaimOwnerTool } from '../shared/luca.LXh1v8zr.mjs';
14
+ import { l as lucaStateClaimOwnerTool } from '../shared/luca.B0-3raH6.mjs';
15
15
  import 'zod';
16
16
 
17
17
  const STAGE_TOOL_MATRIX = {
@@ -1,17 +1,18 @@
1
1
  import * as p from '@clack/prompts';
2
2
  import { defineCommand, runMain } from 'citty';
3
3
  import { join } from 'pathe';
4
- import { w as writeProjectSkeleton } from '../shared/luca.DDb4WHV5.mjs';
4
+ import { w as writeProjectSkeleton } from '../shared/luca.C-v36IzX.mjs';
5
5
  import { existsSync, statSync, chmodSync } from 'node:fs';
6
6
  import { readFile, writeFile, rename, unlink, mkdir, readdir, copyFile } from 'node:fs/promises';
7
7
  import { homedir } from 'node:os';
8
8
  import { join as join$1, dirname, delimiter } from 'node:path';
9
- import { d as defaultClaudeHome, a as defaultAntigravityHome, r as resolveBundledArtifactsForHooks, i as installSkills } from '../shared/luca.41dcdyd6.mjs';
10
- import { d as detectProjectContext, s as suggestVaultName, a as autoCreateVault, w as writeVaultConfig } from '../shared/luca.BIOOhA-l.mjs';
9
+ import { d as defaultClaudeHome, a as defaultAntigravityHome, r as resolveBundledArtifactsForHooks, i as installSkills, e as enrichTraceMetadata } from '../shared/luca.DJdV6_Fe.mjs';
10
+ import { i as installStatusline } from '../shared/luca.BqmgwLb7.mjs';
11
+ import { d as detectProjectContext, s as suggestVaultName, a as autoCreateVault, w as writeVaultConfig } from '../shared/luca.pgUeD_0M.mjs';
11
12
  import { l as logger } from '../shared/luca.dM-MKlNE.mjs';
12
13
  import { M as MuninndbInstallResultSchema, r as resolvePlatformTarget, g as getLucaHomePaths, a as MUNINNDB_BINARY_NAME, b as getCommonBinaryPaths, c as resolveMuninndbPort, d as checkMuninndbService, e as MuninndbServiceStatusSchema, w as waitForMuninndbHealthy, f as ensureLucaHome, h as checkMuninndbBinary } from '../shared/luca.BfjhRHhj.mjs';
13
14
  import { c as checkPrerequisites, p as promptBunInstall } from '../shared/luca.DTomPq7I.mjs';
14
- import '../shared/luca.CWvhdASW.mjs';
15
+ import '../shared/luca.B2-XLiAh.mjs';
15
16
  import 'zod';
16
17
  import 'node:child_process';
17
18
  import 'node:crypto';
@@ -309,88 +310,6 @@ function mergeLucaHookSettings(existing, bundled) {
309
310
  return next;
310
311
  }
311
312
 
312
- const STATUSLINE_SCRIPT_NAME = "luca-statusline.ts";
313
- async function installStatusline(opts) {
314
- const log = opts.log ?? (() => {
315
- });
316
- const claudeHome = opts.home ?? opts.claudeHome ?? defaultClaudeHome();
317
- const src = opts.bundledScriptPath ?? resolveBundledStatuslineScript();
318
- if (src === null || !existsSync(src)) {
319
- log(
320
- " skip: bundled statusline script not found (running from a non-bundled dev tree? did the umbrella build run?)"
321
- );
322
- return;
323
- }
324
- await mkdir(claudeHome, { recursive: true });
325
- const dest = join$1(claudeHome, STATUSLINE_SCRIPT_NAME);
326
- await copyFile(src, dest);
327
- log(` write: ${dest}`);
328
- const settingsPath = join$1(claudeHome, "settings.json");
329
- const existing = await readSettings(settingsPath);
330
- if (existing === null) {
331
- log(
332
- ` skip: could not parse ${settingsPath} \u2014 statusline not registered (repair the file and re-run \`luca init\`)`
333
- );
334
- return;
335
- }
336
- const { next, action } = mergeStatuslineRegistration(existing, dest);
337
- if (action === "kept-user") {
338
- log(
339
- ` skip: existing custom statusLine preserved \u2014 run \`bun ${dest}\` from your own statusline to opt in`
340
- );
341
- return;
342
- }
343
- await writeFile(settingsPath, JSON.stringify(next, null, 2) + "\n");
344
- log(` write: ${settingsPath} (statusLine ${action})`);
345
- }
346
- async function readSettings(settingsPath) {
347
- if (!existsSync(settingsPath)) return {};
348
- try {
349
- const parsed = JSON.parse(
350
- await readFile(settingsPath, "utf-8")
351
- );
352
- if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
353
- return null;
354
- }
355
- return parsed;
356
- } catch {
357
- return null;
358
- }
359
- }
360
- function mergeStatuslineRegistration(settings, scriptPath) {
361
- const command = `bun "${scriptPath}"`;
362
- const entry = {
363
- type: "command",
364
- command,
365
- padding: 0
366
- };
367
- const existing = settings.statusLine;
368
- if (existing === void 0) {
369
- return { next: { ...settings, statusLine: entry }, action: "installed" };
370
- }
371
- if (existing === null) {
372
- return { next: settings, action: "kept-user" };
373
- }
374
- const canonicalForms = [command, `bun ${scriptPath}`];
375
- if (typeof existing.command === "string" && canonicalForms.includes(existing.command.trim())) {
376
- return {
377
- // Refresh only the fields luca owns; user tweaks on the
378
- // luca-owned entry (e.g. padding) survive the update.
379
- next: {
380
- ...settings,
381
- statusLine: { ...existing, type: "command", command }
382
- },
383
- action: "updated"
384
- };
385
- }
386
- return { next: settings, action: "kept-user" };
387
- }
388
- function resolveBundledStatuslineScript() {
389
- const claudeRoot = resolveBundledArtifactsForHooks();
390
- if (claudeRoot === null) return null;
391
- return join$1(claudeRoot, STATUSLINE_SCRIPT_NAME);
392
- }
393
-
394
313
  const claudeHarness = {
395
314
  id: "claude",
396
315
  displayName: "Claude Code",
@@ -912,6 +831,10 @@ const initCommand = defineCommand({
912
831
  cwd: projectCwd,
913
832
  log: (msg) => p.log.info(msg)
914
833
  });
834
+ await enrichTraceMetadata({
835
+ cwd: projectCwd,
836
+ log: (msg) => p.log.info(msg)
837
+ });
915
838
  if (muninndbHealthy) {
916
839
  const context = await detectProjectContext(projectCwd);
917
840
  automatedVaultName = suggestVaultName(context, projectCwd);
@@ -1,11 +1,12 @@
1
1
  import { existsSync } from 'node:fs';
2
2
  import { readFile } from 'node:fs/promises';
3
3
  import { join } from 'node:path';
4
- import { e as ensureLucaGitignore, L as LUCA_GITIGNORE_ENTRIES } from '../shared/luca.DDb4WHV5.mjs';
4
+ import { e as ensureLucaGitignore, L as LUCA_GITIGNORE_ENTRIES } from '../shared/luca.C-v36IzX.mjs';
5
5
  import 'node:os';
6
6
  import 'node:url';
7
7
  import 'pathe';
8
- import '../shared/luca.CWvhdASW.mjs';
8
+ import '../shared/luca.DJdV6_Fe.mjs';
9
+ import '../shared/luca.B2-XLiAh.mjs';
9
10
  import 'zod';
10
11
  import 'node:child_process';
11
12
  import 'node:crypto';
@@ -1,7 +1,7 @@
1
1
  import { defineCommand } from 'citty';
2
- import { r as rejectUnknownFlags, a as runWriteHandler } from '../shared/luca.CIYP8N2e.mjs';
2
+ import { r as rejectUnknownFlags, a as runWriteHandler } from '../shared/luca.CPv3B14W.mjs';
3
3
  import 'zod';
4
- import '../shared/luca.CWvhdASW.mjs';
4
+ import '../shared/luca.B2-XLiAh.mjs';
5
5
  import 'node:fs';
6
6
  import 'node:fs/promises';
7
7
  import 'node:path';
@@ -9,15 +9,15 @@ import 'node:crypto';
9
9
  import 'node:module';
10
10
  import 'node:url';
11
11
  import 'node:child_process';
12
- import { e as lucaPhaseCurrentTool, f as lucaPhaseAdvanceTool, g as lucaPhaseArchiveTool } from '../shared/luca.E5xdUA-2.mjs';
13
- import '../shared/luca.LXh1v8zr.mjs';
14
- import '../shared/luca.raYjreBY.mjs';
12
+ import { e as lucaPhaseCurrentTool, f as lucaPhaseAdvanceTool, g as lucaPhaseArchiveTool } from '../shared/luca.D0gueIEC.mjs';
13
+ import '../shared/luca.B0-3raH6.mjs';
14
+ import '../shared/luca.CUbGKcdY.mjs';
15
15
  import 'node:os';
16
16
  import '../shared/luca.CQ3g1xrD.mjs';
17
- import '../shared/luca.Dqloj2-2.mjs';
18
- import '../shared/luca.DdFkobL1.mjs';
17
+ import '../shared/luca.BvjJXX7X.mjs';
18
+ import '../shared/luca.CpFpA7_C.mjs';
19
19
  import '../shared/luca.BpClq9Sj.mjs';
20
- import '../shared/luca.F3D90t11.mjs';
20
+ import '../shared/luca.4GAIaUJ9.mjs';
21
21
 
22
22
  const currentCommand = defineCommand({
23
23
  meta: {
@@ -1,7 +1,7 @@
1
1
  import { defineCommand } from 'citty';
2
- import { r as rejectUnknownFlags, a as runWriteHandler } from '../shared/luca.CIYP8N2e.mjs';
2
+ import { r as rejectUnknownFlags, a as runWriteHandler } from '../shared/luca.CPv3B14W.mjs';
3
3
  import 'zod';
4
- import '../shared/luca.CWvhdASW.mjs';
4
+ import '../shared/luca.B2-XLiAh.mjs';
5
5
  import 'node:fs';
6
6
  import 'node:fs/promises';
7
7
  import 'node:path';
@@ -9,15 +9,15 @@ import 'node:crypto';
9
9
  import 'node:module';
10
10
  import 'node:url';
11
11
  import 'node:child_process';
12
- import { h as lucaPlanLintTool } from '../shared/luca.E5xdUA-2.mjs';
13
- import '../shared/luca.LXh1v8zr.mjs';
14
- import '../shared/luca.raYjreBY.mjs';
12
+ import { h as lucaPlanLintTool } from '../shared/luca.D0gueIEC.mjs';
13
+ import '../shared/luca.B0-3raH6.mjs';
14
+ import '../shared/luca.CUbGKcdY.mjs';
15
15
  import 'node:os';
16
16
  import '../shared/luca.CQ3g1xrD.mjs';
17
- import '../shared/luca.Dqloj2-2.mjs';
18
- import '../shared/luca.DdFkobL1.mjs';
17
+ import '../shared/luca.BvjJXX7X.mjs';
18
+ import '../shared/luca.CpFpA7_C.mjs';
19
19
  import '../shared/luca.BpClq9Sj.mjs';
20
- import '../shared/luca.F3D90t11.mjs';
20
+ import '../shared/luca.4GAIaUJ9.mjs';
21
21
 
22
22
  const lintCommand = defineCommand({
23
23
  meta: {
@@ -1,7 +1,7 @@
1
1
  import { defineCommand } from 'citty';
2
- import { r as rejectUnknownFlags, b as readJsonPayload, a as runWriteHandler } from '../shared/luca.CIYP8N2e.mjs';
2
+ import { r as rejectUnknownFlags, b as readJsonPayload, a as runWriteHandler } from '../shared/luca.CPv3B14W.mjs';
3
3
  import 'zod';
4
- import '../shared/luca.CWvhdASW.mjs';
4
+ import '../shared/luca.B2-XLiAh.mjs';
5
5
  import 'node:fs';
6
6
  import 'node:fs/promises';
7
7
  import 'node:path';
@@ -9,15 +9,15 @@ import 'node:crypto';
9
9
  import 'node:module';
10
10
  import 'node:url';
11
11
  import 'node:child_process';
12
- import { v as lucaPrReviewDetectConvergenceTool, w as lucaPrReviewFilterStaleTool, x as lucaPrReviewRegressionCheckTool } from '../shared/luca.E5xdUA-2.mjs';
13
- import '../shared/luca.LXh1v8zr.mjs';
14
- import '../shared/luca.raYjreBY.mjs';
12
+ import { v as lucaPrReviewDetectConvergenceTool, w as lucaPrReviewFilterStaleTool, x as lucaPrReviewRegressionCheckTool } from '../shared/luca.D0gueIEC.mjs';
13
+ import '../shared/luca.B0-3raH6.mjs';
14
+ import '../shared/luca.CUbGKcdY.mjs';
15
15
  import 'node:os';
16
16
  import '../shared/luca.CQ3g1xrD.mjs';
17
- import '../shared/luca.Dqloj2-2.mjs';
18
- import '../shared/luca.DdFkobL1.mjs';
17
+ import '../shared/luca.BvjJXX7X.mjs';
18
+ import '../shared/luca.CpFpA7_C.mjs';
19
19
  import '../shared/luca.BpClq9Sj.mjs';
20
- import '../shared/luca.F3D90t11.mjs';
20
+ import '../shared/luca.4GAIaUJ9.mjs';
21
21
 
22
22
  const filterStaleCommand = defineCommand({
23
23
  meta: {
@@ -1,7 +1,7 @@
1
1
  import { defineCommand } from 'citty';
2
- import { r as rejectUnknownFlags, b as readJsonPayload, a as runWriteHandler } from '../shared/luca.CIYP8N2e.mjs';
2
+ import { r as rejectUnknownFlags, b as readJsonPayload, a as runWriteHandler } from '../shared/luca.CPv3B14W.mjs';
3
3
  import 'zod';
4
- import '../shared/luca.CWvhdASW.mjs';
4
+ import '../shared/luca.B2-XLiAh.mjs';
5
5
  import 'node:fs';
6
6
  import 'node:fs/promises';
7
7
  import 'node:path';
@@ -9,15 +9,15 @@ import 'node:crypto';
9
9
  import 'node:module';
10
10
  import 'node:url';
11
11
  import 'node:child_process';
12
- import { k as lucaPreferencesReadTool, m as lucaPreferencesWriteTool } from '../shared/luca.E5xdUA-2.mjs';
13
- import '../shared/luca.LXh1v8zr.mjs';
14
- import '../shared/luca.raYjreBY.mjs';
12
+ import { k as lucaPreferencesReadTool, m as lucaPreferencesWriteTool } from '../shared/luca.D0gueIEC.mjs';
13
+ import '../shared/luca.B0-3raH6.mjs';
14
+ import '../shared/luca.CUbGKcdY.mjs';
15
15
  import 'node:os';
16
16
  import '../shared/luca.CQ3g1xrD.mjs';
17
- import '../shared/luca.Dqloj2-2.mjs';
18
- import '../shared/luca.DdFkobL1.mjs';
17
+ import '../shared/luca.BvjJXX7X.mjs';
18
+ import '../shared/luca.CpFpA7_C.mjs';
19
19
  import '../shared/luca.BpClq9Sj.mjs';
20
- import '../shared/luca.F3D90t11.mjs';
20
+ import '../shared/luca.4GAIaUJ9.mjs';
21
21
 
22
22
  const readCommand = defineCommand({
23
23
  meta: {
@@ -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.CWvhdASW.mjs';
5
+ import { l as lucaStateSchema } from '../shared/luca.B2-XLiAh.mjs';
6
6
  import 'node:crypto';
7
7
  import 'node:module';
8
8
  import 'node:url';
@@ -1,7 +1,7 @@
1
1
  import { defineCommand } from 'citty';
2
- import { r as rejectUnknownFlags, b as readJsonPayload, a as runWriteHandler } from '../shared/luca.CIYP8N2e.mjs';
2
+ import { r as rejectUnknownFlags, b as readJsonPayload, a as runWriteHandler } from '../shared/luca.CPv3B14W.mjs';
3
3
  import 'zod';
4
- import '../shared/luca.CWvhdASW.mjs';
4
+ import '../shared/luca.B2-XLiAh.mjs';
5
5
  import 'node:fs';
6
6
  import 'node:fs/promises';
7
7
  import 'node:path';
@@ -9,15 +9,15 @@ import 'node:crypto';
9
9
  import 'node:module';
10
10
  import 'node:url';
11
11
  import 'node:child_process';
12
- import { y as lucaRepoCleanupApplyTool } from '../shared/luca.E5xdUA-2.mjs';
13
- import '../shared/luca.LXh1v8zr.mjs';
14
- import '../shared/luca.raYjreBY.mjs';
12
+ import { y as lucaRepoCleanupApplyTool } from '../shared/luca.D0gueIEC.mjs';
13
+ import '../shared/luca.B0-3raH6.mjs';
14
+ import '../shared/luca.CUbGKcdY.mjs';
15
15
  import 'node:os';
16
16
  import '../shared/luca.CQ3g1xrD.mjs';
17
- import '../shared/luca.Dqloj2-2.mjs';
18
- import '../shared/luca.DdFkobL1.mjs';
17
+ import '../shared/luca.BvjJXX7X.mjs';
18
+ import '../shared/luca.CpFpA7_C.mjs';
19
19
  import '../shared/luca.BpClq9Sj.mjs';
20
- import '../shared/luca.F3D90t11.mjs';
20
+ import '../shared/luca.4GAIaUJ9.mjs';
21
21
 
22
22
  const cleanupApplyCommand = defineCommand({
23
23
  meta: {