claude-alfred 0.5.2 → 0.5.3

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 (65) hide show
  1. package/dist/{audit-B2QNhw51.mjs → audit-CmbBNEzT.mjs} +108 -1
  2. package/dist/cli.mjs +10 -10
  3. package/dist/{directives-Yazh3ySl.mjs → directives-BM9nkHZV.mjs} +3 -3
  4. package/dist/{dispatcher-CraQKWM0.mjs → dispatcher-us-cOlZZ.mjs} +6 -6
  5. package/dist/{drift-DxfVeUaj.mjs → drift-CyqSWmja.mjs} +2 -1
  6. package/dist/{fts-DfQmFhBI.mjs → fts-CG3NjtDr.mjs} +1 -1
  7. package/dist/{knowledge-B223DHoC.mjs → knowledge-7gqtk8yz.mjs} +4 -1
  8. package/dist/{knowledge-io-DXbe0pqK.mjs → knowledge-io-CII6K2EO.mjs} +2 -2
  9. package/dist/lang-filter--xQlqF9A.mjs +137 -0
  10. package/dist/{living-spec-CWrn8rxB.mjs → living-spec-DEmgB4Gw.mjs} +3 -135
  11. package/dist/{post-tool-57oYX2B5.mjs → post-tool-CPUtuUxb.mjs} +150 -13
  12. package/dist/post-tool-DK48fw3G.mjs +11 -0
  13. package/dist/postinstall.mjs +1 -1
  14. package/dist/{pre-compact-WNhbJCHU.mjs → pre-compact-DBnEMJwf.mjs} +5 -5
  15. package/dist/{pre-tool-CH1uxnKe.mjs → pre-tool-6dYu2xfd.mjs} +2 -2
  16. package/dist/{review-gate-DCn6Pi0e.mjs → review-gate-PHUE_mEA.mjs} +10 -1
  17. package/dist/{schema-B_MIRZ5z.mjs → schema-BEv7jNnr.mjs} +15 -2
  18. package/dist/{server-CIyO9Got.mjs → server-BVV-C9mF.mjs} +39 -8
  19. package/dist/{server-EylDBQVy.mjs → server-Ciof8e8X.mjs} +95 -17
  20. package/dist/{session-start-CdMbY8_i.mjs → session-start-vtNhjJdP.mjs} +21 -5
  21. package/dist/{state-B9fOaSXy.mjs → state-7-p9AqA6.mjs} +2 -2
  22. package/dist/{stop-B2Fq_iz6.mjs → stop-DhNxcAvM.mjs} +2 -2
  23. package/dist/{store-BfLLTvmO.mjs → store-BhCFm1Tb.mjs} +15 -2
  24. package/dist/{user-prompt-DQ6J6PRA.mjs → user-prompt-n5VcQmRT.mjs} +55 -7
  25. package/package.json +1 -1
  26. package/web/dist/assets/activity-DS8gsAtD.js +1 -0
  27. package/web/dist/assets/api-CVUS-Ce3.js +3 -0
  28. package/web/dist/assets/badge-D8mApPpI.js +1 -0
  29. package/web/dist/assets/butler-empty-C3mWnDYa.js +1 -0
  30. package/web/dist/assets/dist-lzHifHMP.js +1 -0
  31. package/web/dist/assets/index-DgRGKS9D.js +14 -0
  32. package/web/dist/assets/index-DvBh5daN.css +1 -0
  33. package/web/dist/assets/knowledge-Cu6MXPyf.js +14 -0
  34. package/web/dist/assets/lib-BDTjEd1Q.js +14 -0
  35. package/web/dist/assets/link-ahHmGL6O.js +1 -0
  36. package/web/dist/assets/preload-helper-BIScuso2.js +1 -0
  37. package/web/dist/assets/projects-9xEJb6MC.js +1 -0
  38. package/web/dist/assets/routes-C8fI2lxb.js +1 -0
  39. package/web/dist/assets/skeleton-CEUF44ae.js +9 -0
  40. package/web/dist/assets/status-badge-BcYaeEpe.js +6 -0
  41. package/web/dist/assets/tasks-auOZy7oP.js +1 -0
  42. package/web/dist/assets/tasks._slug-B48aNnrZ.js +51 -0
  43. package/web/dist/assets/tooltip-B_wZunY1.js +41 -0
  44. package/web/dist/assets/{api-Dwg7xx7o.js → utils-CXfoJANe.js} +1934 -1936
  45. package/web/dist/index.html +8 -8
  46. package/dist/post-tool-C5wmKSwC.mjs +0 -11
  47. package/web/dist/assets/alert-dialog-BP6vC5Kl.js +0 -20
  48. package/web/dist/assets/badge-Btq-UVis.js +0 -1
  49. package/web/dist/assets/butler-empty-BiF_MhKG.js +0 -1
  50. package/web/dist/assets/button-CiajZ5z9.js +0 -1
  51. package/web/dist/assets/card-PuyGbPks.js +0 -1
  52. package/web/dist/assets/dist-D6Pq1SPT.js +0 -1
  53. package/web/dist/assets/index-B-UphFD8.js +0 -10
  54. package/web/dist/assets/index-BQuQuuj4.css +0 -1
  55. package/web/dist/assets/knowledge-DqeMxUQZ.js +0 -8
  56. package/web/dist/assets/link-DbNpq28y.js +0 -1
  57. package/web/dist/assets/preload-helper-B2yup0du.js +0 -1
  58. package/web/dist/assets/projects-NXuakcY7.js +0 -1
  59. package/web/dist/assets/routes-LFgKLTEI.js +0 -1
  60. package/web/dist/assets/skeleton-CVWO2QMX.js +0 -9
  61. package/web/dist/assets/status-badge-CUhuFXIA.js +0 -6
  62. package/web/dist/assets/tasks-Dxx6s9xK.js +0 -1
  63. package/web/dist/assets/tasks._slug-CSvqX2MA.js +0 -44
  64. package/web/dist/assets/tooltip-Ct2bkR4l.js +0 -45
  65. /package/dist/{spec-sync-0mFlrl3m.mjs → spec-sync-BYLLyRG3.mjs} +0 -0
@@ -95,6 +95,113 @@ async function syncAuditJsonl(store, projectId, projectPath) {
95
95
  skipped
96
96
  };
97
97
  }
98
+ /**
99
+ * Read rework rates from audit_log (SQL only, no git).
100
+ * - Confirmed: rework.checked events (21+ days past completion)
101
+ * - Pending: spec.complete with changed_files but no rework.checked yet
102
+ */
103
+ function getReworkRates(store, opts) {
104
+ const results = [];
105
+ const projectFilter = opts?.projectId ? "AND project_id = ?" : "";
106
+ const params = opts?.projectId ? [opts.projectId] : [];
107
+ const checkedRows = store.db.prepare(`
108
+ SELECT slug, detail FROM audit_log
109
+ WHERE event = 'rework.checked' ${projectFilter}
110
+ `).all(...params);
111
+ const checkedSlugs = /* @__PURE__ */ new Set();
112
+ for (const r of checkedRows) try {
113
+ const d = JSON.parse(r.detail);
114
+ checkedSlugs.add(r.slug);
115
+ results.push({
116
+ slug: r.slug,
117
+ size: d.size ?? "M",
118
+ completedAt: d.completed_at ?? "",
119
+ reworkRate: d.rework_rate ?? 0,
120
+ reworkedCount: d.reworked_count ?? 0,
121
+ totalCount: d.total_count ?? 0,
122
+ pending: false
123
+ });
124
+ } catch {}
125
+ const completedRows = store.db.prepare(`
126
+ SELECT slug, timestamp, detail FROM audit_log
127
+ WHERE event = 'spec.complete' ${projectFilter}
128
+ ORDER BY timestamp DESC
129
+ `).all(...params);
130
+ const now = Date.now();
131
+ const TWENTY_ONE_DAYS = 504 * 60 * 60 * 1e3;
132
+ for (const r of completedRows) {
133
+ if (checkedSlugs.has(r.slug)) continue;
134
+ try {
135
+ const d = JSON.parse(r.detail);
136
+ if (!d.changed_files || d.changed_files.length === 0) continue;
137
+ if (!(now - new Date(r.timestamp).getTime() < TWENTY_ONE_DAYS)) continue;
138
+ results.push({
139
+ slug: r.slug,
140
+ size: d.size ?? "M",
141
+ completedAt: r.timestamp,
142
+ reworkRate: 0,
143
+ reworkedCount: 0,
144
+ totalCount: d.changed_files.length,
145
+ pending: true
146
+ });
147
+ } catch {}
148
+ }
149
+ return results;
150
+ }
151
+ /**
152
+ * Compute cycle time breakdown from audit_log (SQL only).
153
+ * Phases: init → approved → first_commit → complete
154
+ */
155
+ function getCycleTimeBreakdown(store, opts) {
156
+ const projectFilter = opts?.projectId ? "AND project_id = ?" : "";
157
+ const params = opts?.projectId ? [opts.projectId] : [];
158
+ return store.db.prepare(`
159
+ SELECT
160
+ slug,
161
+ MIN(CASE WHEN event = 'spec.init' THEN timestamp END) as init_ts,
162
+ MIN(CASE WHEN event = 'spec.complete' THEN timestamp END) as complete_ts,
163
+ MIN(CASE WHEN event = 'spec.complete' THEN detail END) as complete_detail,
164
+ MIN(CASE WHEN event = 'first_commit' THEN timestamp END) as first_commit_ts,
165
+ MIN(CASE WHEN event = 'review.submit' AND detail LIKE '%"approved"%' THEN timestamp END) as approved_ts
166
+ FROM audit_log
167
+ WHERE event IN ('spec.init', 'spec.complete', 'first_commit', 'review.submit')
168
+ ${projectFilter}
169
+ GROUP BY slug
170
+ HAVING init_ts IS NOT NULL AND complete_ts IS NOT NULL
171
+ `).all(...params).map((r) => {
172
+ const initMs = new Date(r.init_ts).getTime();
173
+ const completeMs = new Date(r.complete_ts).getTime();
174
+ const firstCommitMs = r.first_commit_ts ? new Date(r.first_commit_ts).getTime() : null;
175
+ const approvedMs = r.approved_ts ? new Date(r.approved_ts).getTime() : null;
176
+ const daysDiff = (a, b) => Math.round((b - a) / (1e3 * 60 * 60 * 24) * 10) / 10;
177
+ let size = "M";
178
+ try {
179
+ const d = JSON.parse(r.complete_detail ?? "{}");
180
+ if (d.size) size = d.size;
181
+ } catch {}
182
+ let planning = null;
183
+ let approvalWait = null;
184
+ let implementation = null;
185
+ if (approvedMs && firstCommitMs) {
186
+ planning = daysDiff(initMs, approvedMs);
187
+ approvalWait = daysDiff(approvedMs, firstCommitMs);
188
+ implementation = daysDiff(firstCommitMs, completeMs);
189
+ } else if (firstCommitMs) {
190
+ planning = daysDiff(initMs, firstCommitMs);
191
+ implementation = daysDiff(firstCommitMs, completeMs);
192
+ }
193
+ return {
194
+ slug: r.slug,
195
+ size,
196
+ phases: {
197
+ planning,
198
+ approvalWait,
199
+ implementation,
200
+ total: daysDiff(initMs, completeMs)
201
+ }
202
+ };
203
+ });
204
+ }
98
205
  function getKnowledgeHitRanking(store, opts) {
99
206
  const limit = opts?.limit ?? 10;
100
207
  const projectFilter = opts?.projectId ? "AND ki.project_id = ?" : "";
@@ -151,4 +258,4 @@ function getSpecCompletionStats(store, opts) {
151
258
  }));
152
259
  }
153
260
  //#endregion
154
- export { getKnowledgeHitRanking, getSpecCompletionStats, queryAuditLog, syncAuditJsonl };
261
+ export { getCycleTimeBreakdown, getKnowledgeHitRanking, getReworkRates, getSpecCompletionStats, queryAuditLog, syncAuditJsonl };
package/dist/cli.mjs CHANGED
@@ -369,9 +369,9 @@ const main = defineCommand({
369
369
  serve: defineCommand({
370
370
  meta: { description: "Start MCP server (stdio)" },
371
371
  async run() {
372
- const { Store } = await import("./store-BfLLTvmO.mjs").then((n) => (n.t(), n.r));
372
+ const { Store } = await import("./store-BhCFm1Tb.mjs").then((n) => (n.t(), n.r));
373
373
  const { Embedder } = await import("./embedder-9lsjLVC6.mjs");
374
- const { serveMCP } = await import("./server-EylDBQVy.mjs");
374
+ const { serveMCP } = await import("./server-Ciof8e8X.mjs");
375
375
  const store = Store.openDefault();
376
376
  let emb = null;
377
377
  try {
@@ -399,11 +399,11 @@ const main = defineCommand({
399
399
  async run({ args }) {
400
400
  const { existsSync } = await import("node:fs");
401
401
  const { join } = await import("node:path");
402
- const { Store } = await import("./store-BfLLTvmO.mjs").then((n) => (n.t(), n.r));
402
+ const { Store } = await import("./store-BhCFm1Tb.mjs").then((n) => (n.t(), n.r));
403
403
  const { Embedder } = await import("./embedder-9lsjLVC6.mjs");
404
- const { startDashboard } = await import("./server-CIyO9Got.mjs");
404
+ const { startDashboard } = await import("./server-BVV-C9mF.mjs");
405
405
  const { resolveOrRegisterProject } = await import("./project-DKLV_Zw3.mjs").then((n) => (n.n(), n.a));
406
- const { syncAllProjectSpecs } = await import("./spec-sync-0mFlrl3m.mjs");
406
+ const { syncAllProjectSpecs } = await import("./spec-sync-BYLLyRG3.mjs");
407
407
  const cwd = process.cwd();
408
408
  const store = Store.openDefault();
409
409
  let emb = null;
@@ -413,7 +413,7 @@ const main = defineCommand({
413
413
  if (emb) store.expectedDims = emb.dims;
414
414
  if (existsSync(join(cwd, ".alfred"))) resolveOrRegisterProject(store, cwd);
415
415
  await syncAllProjectSpecs(store, emb);
416
- const { syncAuditJsonl } = await import("./audit-B2QNhw51.mjs");
416
+ const { syncAuditJsonl } = await import("./audit-CmbBNEzT.mjs");
417
417
  const { listActiveProjects } = await import("./project-DKLV_Zw3.mjs").then((n) => (n.n(), n.a));
418
418
  for (const p of listActiveProjects(store)) if (existsSync(join(p.path, ".alfred"))) await syncAuditJsonl(store, p.id, p.path);
419
419
  const version = await resolveVersion();
@@ -431,7 +431,7 @@ const main = defineCommand({
431
431
  description: "Event name"
432
432
  } },
433
433
  async run({ args }) {
434
- const { runHook } = await import("./dispatcher-CraQKWM0.mjs").then((n) => (n.i(), n.t));
434
+ const { runHook } = await import("./dispatcher-us-cOlZZ.mjs").then((n) => (n.i(), n.t));
435
435
  await runHook(args.event);
436
436
  }
437
437
  }),
@@ -485,7 +485,7 @@ const main = defineCommand({
485
485
  export: defineCommand({
486
486
  meta: { description: "Export knowledge as JSON" },
487
487
  async run() {
488
- const { exportKnowledge } = await import("./knowledge-io-DXbe0pqK.mjs");
488
+ const { exportKnowledge } = await import("./knowledge-io-CII6K2EO.mjs");
489
489
  const result = exportKnowledge(process.cwd());
490
490
  process.stdout.write(JSON.stringify(result.entries, null, 2) + "\n");
491
491
  process.stderr.write(`Exported ${result.count} entries\n`);
@@ -494,7 +494,7 @@ const main = defineCommand({
494
494
  import: defineCommand({
495
495
  meta: { description: "Import knowledge from JSON (stdin)" },
496
496
  async run() {
497
- const { importKnowledge } = await import("./knowledge-io-DXbe0pqK.mjs");
497
+ const { importKnowledge } = await import("./knowledge-io-CII6K2EO.mjs");
498
498
  const chunks = [];
499
499
  const MAX_SIZE = 50 * 1024 * 1024;
500
500
  let totalSize = 0;
@@ -522,7 +522,7 @@ const main = defineCommand({
522
522
  diff: defineCommand({
523
523
  meta: { description: "Show uncommitted knowledge changes" },
524
524
  async run() {
525
- const { showKnowledgeDiff } = await import("./knowledge-io-DXbe0pqK.mjs");
525
+ const { showKnowledgeDiff } = await import("./knowledge-io-CII6K2EO.mjs");
526
526
  const result = showKnowledgeDiff(process.cwd());
527
527
  if (result.added.length === 0 && result.modified.length === 0 && result.deleted.length === 0) {
528
528
  console.log("変更なし");
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import { n as __esmMin } from "./chunk-CAm0Jl7e.mjs";
3
- import { a as getKnowledgeByIDs, l as incrementHitCount, p as searchKnowledgeKeyword, u as init_knowledge } from "./knowledge-B223DHoC.mjs";
3
+ import { a as getKnowledgeByIDs, l as incrementHitCount, p as searchKnowledgeKeyword, u as init_knowledge } from "./knowledge-7gqtk8yz.mjs";
4
4
  import { r as vectorSearchKnowledge, t as init_vectors } from "./vectors-BVQ0dz9J.mjs";
5
- import { a as subTypeBoost, o as subTypeHalfLife, r as searchKnowledgeFTS, t as init_fts } from "./fts-DfQmFhBI.mjs";
6
- import { i as init_dispatcher, n as emitAdditionalContext } from "./dispatcher-CraQKWM0.mjs";
5
+ import { a as subTypeBoost, o as subTypeHalfLife, r as searchKnowledgeFTS, t as init_fts } from "./fts-CG3NjtDr.mjs";
6
+ import { i as init_dispatcher, n as emitAdditionalContext } from "./dispatcher-us-cOlZZ.mjs";
7
7
  //#region src/mcp/helpers.ts
8
8
  function truncate(s, maxLen) {
9
9
  const runes = [...s];
@@ -89,27 +89,27 @@ async function runHook(event) {
89
89
  }
90
90
  }
91
91
  async function handleSessionStart(ev, signal) {
92
- const { sessionStart } = await import("./session-start-CdMbY8_i.mjs");
92
+ const { sessionStart } = await import("./session-start-vtNhjJdP.mjs");
93
93
  await sessionStart(ev, signal);
94
94
  }
95
95
  async function handlePreCompact(ev, signal) {
96
- const { preCompact } = await import("./pre-compact-WNhbJCHU.mjs");
96
+ const { preCompact } = await import("./pre-compact-DBnEMJwf.mjs");
97
97
  await preCompact(ev, signal);
98
98
  }
99
99
  async function handleUserPromptSubmit(ev, signal) {
100
- const { userPromptSubmit } = await import("./user-prompt-DQ6J6PRA.mjs");
100
+ const { userPromptSubmit } = await import("./user-prompt-n5VcQmRT.mjs");
101
101
  await userPromptSubmit(ev, signal);
102
102
  }
103
103
  async function handlePostToolUse(ev, signal) {
104
- const { postToolUse } = await import("./post-tool-C5wmKSwC.mjs");
104
+ const { postToolUse } = await import("./post-tool-DK48fw3G.mjs");
105
105
  await postToolUse(ev, signal);
106
106
  }
107
107
  async function handlePreToolUse(ev, _signal) {
108
- const { preToolUse } = await import("./pre-tool-CH1uxnKe.mjs");
108
+ const { preToolUse } = await import("./pre-tool-6dYu2xfd.mjs");
109
109
  await preToolUse(ev);
110
110
  }
111
111
  async function handleStop(ev, _signal) {
112
- const { stop } = await import("./stop-B2Fq_iz6.mjs");
112
+ const { stop } = await import("./stop-DhNxcAvM.mjs");
113
113
  await stop(ev);
114
114
  }
115
115
  var init_dispatcher = __esmMin((() => {}));
@@ -2,7 +2,8 @@
2
2
  import { n as __esmMin } from "./chunk-CAm0Jl7e.mjs";
3
3
  import { c as readActive, s as init_types, t as SpecDir } from "./types-BucChDqv.mjs";
4
4
  import { n as init_audit, t as appendAudit } from "./audit-tp3tpgzR.mjs";
5
- import { extractChangedFiles, n as init_lang_filter, parseDesignFileRefs, r as shouldAutoAppend, t as init_living_spec } from "./living-spec-CWrn8rxB.mjs";
5
+ import { n as shouldAutoAppend, t as init_lang_filter } from "./lang-filter--xQlqF9A.mjs";
6
+ import { extractChangedFiles, parseDesignFileRefs, t as init_living_spec } from "./living-spec-DEmgB4Gw.mjs";
6
7
  //#region src/hooks/drift.ts
7
8
  /**
8
9
  * Detect source files changed in the last commit that are not referenced in the active spec.
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { n as __esmMin } from "./chunk-CAm0Jl7e.mjs";
3
- import { d as mapRow, p as searchKnowledgeKeyword, u as init_knowledge } from "./knowledge-B223DHoC.mjs";
3
+ import { d as mapRow, p as searchKnowledgeKeyword, u as init_knowledge } from "./knowledge-7gqtk8yz.mjs";
4
4
  //#region src/store/fts.ts
5
5
  function subTypeHalfLife(subType) {
6
6
  switch (subType) {
@@ -160,7 +160,10 @@ function mapRow(r) {
160
160
  updatedAt: r.updated_at,
161
161
  hitCount: r.hit_count,
162
162
  lastAccessed: r.last_accessed,
163
- enabled: r.enabled === 1
163
+ enabled: r.enabled === 1,
164
+ verificationDue: r.verification_due ?? null,
165
+ lastVerified: r.last_verified ?? null,
166
+ verificationCount: r.verification_count ?? 0
164
167
  };
165
168
  }
166
169
  var init_knowledge = __esmMin((() => {}));
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { t as contentHash, u as init_knowledge } from "./knowledge-B223DHoC.mjs";
3
- import { n as levenshtein, t as init_fts } from "./fts-DfQmFhBI.mjs";
2
+ import { t as contentHash, u as init_knowledge } from "./knowledge-7gqtk8yz.mjs";
3
+ import { n as levenshtein, t as init_fts } from "./fts-CG3NjtDr.mjs";
4
4
  import { existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from "node:fs";
5
5
  import { join, relative } from "node:path";
6
6
  import { execFileSync, execSync } from "node:child_process";
@@ -0,0 +1,137 @@
1
+ #!/usr/bin/env node
2
+ import { n as __esmMin } from "./chunk-CAm0Jl7e.mjs";
3
+ import { basename, extname } from "node:path";
4
+ //#region src/hooks/lang-filter.ts
5
+ /**
6
+ * Language filter for Living Spec auto-append.
7
+ * Determines which source files should be tracked in design.md.
8
+ */
9
+ /** Check if a source file should be auto-appended to design.md. */
10
+ function shouldAutoAppend(filePath) {
11
+ for (const dir of DIR_EXCLUSIONS) if (filePath.startsWith(dir) || filePath.includes(`/${dir}`)) return false;
12
+ const ext = extname(filePath);
13
+ const name = basename(filePath);
14
+ for (const lang of LANGUAGES) {
15
+ if (!lang.extensions.includes(ext)) continue;
16
+ for (const suffix of lang.excludeSuffixes) if (filePath.endsWith(suffix)) return false;
17
+ for (const prefix of lang.excludePrefixes) if (name.startsWith(prefix)) return false;
18
+ return true;
19
+ }
20
+ return false;
21
+ }
22
+ var LANGUAGES, DIR_EXCLUSIONS;
23
+ var init_lang_filter = __esmMin((() => {
24
+ LANGUAGES = [
25
+ {
26
+ extensions: [
27
+ ".js",
28
+ ".jsx",
29
+ ".ts",
30
+ ".tsx",
31
+ ".mjs",
32
+ ".mts"
33
+ ],
34
+ excludeSuffixes: [
35
+ ".test.ts",
36
+ ".spec.ts",
37
+ ".test.js",
38
+ ".spec.js",
39
+ ".test.tsx",
40
+ ".spec.tsx",
41
+ ".test.mts",
42
+ ".spec.mts",
43
+ ".d.ts",
44
+ ".min.js",
45
+ ".bundle.js"
46
+ ],
47
+ excludePrefixes: []
48
+ },
49
+ {
50
+ extensions: [".py"],
51
+ excludeSuffixes: [
52
+ "_test.py",
53
+ "_pb2.py",
54
+ "_pb2_grpc.py"
55
+ ],
56
+ excludePrefixes: ["test_", "conftest"]
57
+ },
58
+ {
59
+ extensions: [".go"],
60
+ excludeSuffixes: [
61
+ "_test.go",
62
+ "_gen.go",
63
+ ".pb.go",
64
+ "_mock.go",
65
+ "_string.go"
66
+ ],
67
+ excludePrefixes: []
68
+ },
69
+ {
70
+ extensions: [".rb"],
71
+ excludeSuffixes: ["_test.rb", "_spec.rb"],
72
+ excludePrefixes: []
73
+ },
74
+ {
75
+ extensions: [".rs"],
76
+ excludeSuffixes: [
77
+ "_test.rs",
78
+ "_bench.rs",
79
+ ".generated.rs"
80
+ ],
81
+ excludePrefixes: ["test_"]
82
+ },
83
+ {
84
+ extensions: [".java"],
85
+ excludeSuffixes: [
86
+ "Test.java",
87
+ "Tests.java",
88
+ "IT.java"
89
+ ],
90
+ excludePrefixes: []
91
+ },
92
+ {
93
+ extensions: [".cs"],
94
+ excludeSuffixes: [
95
+ ".Tests.cs",
96
+ ".Test.cs",
97
+ "Tests.cs"
98
+ ],
99
+ excludePrefixes: []
100
+ },
101
+ {
102
+ extensions: [".swift"],
103
+ excludeSuffixes: [
104
+ "Tests.swift",
105
+ "Spec.swift",
106
+ "Test.swift"
107
+ ],
108
+ excludePrefixes: []
109
+ },
110
+ {
111
+ extensions: [".kt", ".kts"],
112
+ excludeSuffixes: [
113
+ "Test.kt",
114
+ "Tests.kt",
115
+ "Test.kts"
116
+ ],
117
+ excludePrefixes: []
118
+ }
119
+ ];
120
+ DIR_EXCLUSIONS = [
121
+ "vendor/",
122
+ "node_modules/",
123
+ ".alfred/",
124
+ "dist/",
125
+ "build/",
126
+ "__pycache__/",
127
+ ".venv/",
128
+ "plugin/",
129
+ "tests/",
130
+ "src/test/",
131
+ ".build/",
132
+ "obj/",
133
+ "bin/"
134
+ ];
135
+ }));
136
+ //#endregion
137
+ export { shouldAutoAppend as n, init_lang_filter as t };
@@ -2,141 +2,9 @@
2
2
  import { n as __esmMin } from "./chunk-CAm0Jl7e.mjs";
3
3
  import { c as readActive, s as init_types, t as SpecDir } from "./types-BucChDqv.mjs";
4
4
  import { n as init_audit, t as appendAudit } from "./audit-tp3tpgzR.mjs";
5
- import { basename, dirname, extname } from "node:path";
5
+ import { n as shouldAutoAppend, t as init_lang_filter } from "./lang-filter--xQlqF9A.mjs";
6
+ import { dirname } from "node:path";
6
7
  import { execSync } from "node:child_process";
7
- //#region src/hooks/lang-filter.ts
8
- /**
9
- * Language filter for Living Spec auto-append.
10
- * Determines which source files should be tracked in design.md.
11
- */
12
- /** Check if a source file should be auto-appended to design.md. */
13
- function shouldAutoAppend(filePath) {
14
- for (const dir of DIR_EXCLUSIONS) if (filePath.startsWith(dir) || filePath.includes(`/${dir}`)) return false;
15
- const ext = extname(filePath);
16
- const name = basename(filePath);
17
- for (const lang of LANGUAGES) {
18
- if (!lang.extensions.includes(ext)) continue;
19
- for (const suffix of lang.excludeSuffixes) if (filePath.endsWith(suffix)) return false;
20
- for (const prefix of lang.excludePrefixes) if (name.startsWith(prefix)) return false;
21
- return true;
22
- }
23
- return false;
24
- }
25
- var LANGUAGES, DIR_EXCLUSIONS;
26
- var init_lang_filter = __esmMin((() => {
27
- LANGUAGES = [
28
- {
29
- extensions: [
30
- ".js",
31
- ".jsx",
32
- ".ts",
33
- ".tsx",
34
- ".mjs",
35
- ".mts"
36
- ],
37
- excludeSuffixes: [
38
- ".test.ts",
39
- ".spec.ts",
40
- ".test.js",
41
- ".spec.js",
42
- ".test.tsx",
43
- ".spec.tsx",
44
- ".test.mts",
45
- ".spec.mts",
46
- ".d.ts",
47
- ".min.js",
48
- ".bundle.js"
49
- ],
50
- excludePrefixes: []
51
- },
52
- {
53
- extensions: [".py"],
54
- excludeSuffixes: [
55
- "_test.py",
56
- "_pb2.py",
57
- "_pb2_grpc.py"
58
- ],
59
- excludePrefixes: ["test_", "conftest"]
60
- },
61
- {
62
- extensions: [".go"],
63
- excludeSuffixes: [
64
- "_test.go",
65
- "_gen.go",
66
- ".pb.go",
67
- "_mock.go",
68
- "_string.go"
69
- ],
70
- excludePrefixes: []
71
- },
72
- {
73
- extensions: [".rb"],
74
- excludeSuffixes: ["_test.rb", "_spec.rb"],
75
- excludePrefixes: []
76
- },
77
- {
78
- extensions: [".rs"],
79
- excludeSuffixes: [
80
- "_test.rs",
81
- "_bench.rs",
82
- ".generated.rs"
83
- ],
84
- excludePrefixes: ["test_"]
85
- },
86
- {
87
- extensions: [".java"],
88
- excludeSuffixes: [
89
- "Test.java",
90
- "Tests.java",
91
- "IT.java"
92
- ],
93
- excludePrefixes: []
94
- },
95
- {
96
- extensions: [".cs"],
97
- excludeSuffixes: [
98
- ".Tests.cs",
99
- ".Test.cs",
100
- "Tests.cs"
101
- ],
102
- excludePrefixes: []
103
- },
104
- {
105
- extensions: [".swift"],
106
- excludeSuffixes: [
107
- "Tests.swift",
108
- "Spec.swift",
109
- "Test.swift"
110
- ],
111
- excludePrefixes: []
112
- },
113
- {
114
- extensions: [".kt", ".kts"],
115
- excludeSuffixes: [
116
- "Test.kt",
117
- "Tests.kt",
118
- "Test.kts"
119
- ],
120
- excludePrefixes: []
121
- }
122
- ];
123
- DIR_EXCLUSIONS = [
124
- "vendor/",
125
- "node_modules/",
126
- ".alfred/",
127
- "dist/",
128
- "build/",
129
- "__pycache__/",
130
- ".venv/",
131
- "plugin/",
132
- "tests/",
133
- "src/test/",
134
- ".build/",
135
- "obj/",
136
- "bin/"
137
- ];
138
- }));
139
- //#endregion
140
8
  //#region src/hooks/living-spec.ts
141
9
  /**
142
10
  * Living Spec auto-append: after git commit, detect changed source files
@@ -276,4 +144,4 @@ var init_living_spec = __esmMin((() => {
276
144
  }));
277
145
  //#endregion
278
146
  init_living_spec();
279
- export { extractChangedFiles, handleLivingSpec, init_lang_filter as n, parseDesignFileRefs, shouldAutoAppend as r, init_living_spec as t };
147
+ export { extractChangedFiles, handleLivingSpec, parseDesignFileRefs, init_living_spec as t };