@devflow-tools/devflow 0.16.1 → 0.16.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 (126) hide show
  1. package/dist/cli.js +89 -62
  2. package/dist/hooks/hook-client.js +6 -6
  3. package/dist/hooks/hook-daemon.js +11 -11
  4. package/dist/hooks/post-tool-use-failure.js +2 -2
  5. package/dist/hooks/post-tool-use.js +3 -3
  6. package/dist/hooks/pre-compact.js +2 -2
  7. package/dist/hooks/pre-tool-use.js +2 -2
  8. package/dist/hooks/session-end.js +2 -2
  9. package/dist/hooks/stop.js +2 -2
  10. package/dist/hooks/user-prompt-submit.js +3 -2
  11. package/dist/plugin/.claude-plugin/plugin.json +2 -2
  12. package/dist/plugin/dist/hooks/hook-client.js +6 -6
  13. package/dist/plugin/dist/hooks/hook-daemon.js +11 -11
  14. package/dist/plugin/dist/hooks/post-tool-use-failure.js +2 -2
  15. package/dist/plugin/dist/hooks/post-tool-use.js +3 -3
  16. package/dist/plugin/dist/hooks/pre-compact.js +2 -2
  17. package/dist/plugin/dist/hooks/pre-tool-use.js +2 -2
  18. package/dist/plugin/dist/hooks/session-end.js +2 -2
  19. package/dist/plugin/dist/hooks/stop.js +2 -2
  20. package/dist/plugin/dist/hooks/user-prompt-submit.js +3 -2
  21. package/dist/plugin/dist/skills/devflow:react/SKILL.md +16 -3
  22. package/dist/plugin/hooks/session-start +37 -17
  23. package/dist/plugin/hooks/stop +3 -2
  24. package/dist/plugin/package.json +7 -8
  25. package/dist/plugin/skills/{devflow:react → react}/SKILL.md +16 -3
  26. package/dist/scripts/audit-session-data.js +6 -0
  27. package/package.json +14 -13
  28. package/plugin-registry.json +29 -29
  29. package/dist/dashboard/404.html +0 -1
  30. package/dist/dashboard/_next/static/PV20UFAxDva62WLq6zWVa/_buildManifest.js +0 -1
  31. package/dist/dashboard/_next/static/PV20UFAxDva62WLq6zWVa/_ssgManifest.js +0 -1
  32. package/dist/dashboard/_next/static/chunks/1dd3208c-f3e84932bdc53383.js +0 -1
  33. package/dist/dashboard/_next/static/chunks/221-893fab1a7d7d9317.js +0 -1
  34. package/dist/dashboard/_next/static/chunks/249-e04c1de6240fd78a.js +0 -1
  35. package/dist/dashboard/_next/static/chunks/343-09a7e255220705c5.js +0 -1
  36. package/dist/dashboard/_next/static/chunks/402-a2e4eb98bb6a524c.js +0 -1
  37. package/dist/dashboard/_next/static/chunks/429-eac85fdc49353ed8.js +0 -1
  38. package/dist/dashboard/_next/static/chunks/458-75822399a849befa.js +0 -1
  39. package/dist/dashboard/_next/static/chunks/528-7d4fc14903647f1e.js +0 -2
  40. package/dist/dashboard/_next/static/chunks/568-50487ea5e93fe11f.js +0 -1
  41. package/dist/dashboard/_next/static/chunks/697-05cf55b6c667773f.js +0 -1
  42. package/dist/dashboard/_next/static/chunks/6b3bb038-34d5cf36bd0210d6.js +0 -1
  43. package/dist/dashboard/_next/static/chunks/736-db1a009357c222d2.js +0 -1
  44. package/dist/dashboard/_next/static/chunks/806-195d4d5cc6c28f6c.js +0 -1
  45. package/dist/dashboard/_next/static/chunks/app/_not-found/page-5252c260804ee1ce.js +0 -1
  46. package/dist/dashboard/_next/static/chunks/app/accuracy/page-ca6a419d8b29eb4f.js +0 -1
  47. package/dist/dashboard/_next/static/chunks/app/benchmark/page-6c6d0acbcde4eb85.js +0 -1
  48. package/dist/dashboard/_next/static/chunks/app/context/page-1874ae1050524cb6.js +0 -1
  49. package/dist/dashboard/_next/static/chunks/app/doctor/page-d542f2ab8d6a1c59.js +0 -1
  50. package/dist/dashboard/_next/static/chunks/app/executions/page-b98ec834dcda8d93.js +0 -1
  51. package/dist/dashboard/_next/static/chunks/app/graph/page-f0e7e15288791e9c.js +0 -1
  52. package/dist/dashboard/_next/static/chunks/app/knowledge/page-86808abd0d47c026.js +0 -1
  53. package/dist/dashboard/_next/static/chunks/app/layout-4b78776412bd4fee.js +0 -1
  54. package/dist/dashboard/_next/static/chunks/app/memory/page-e169762426ac7a23.js +0 -1
  55. package/dist/dashboard/_next/static/chunks/app/page-c3e980fb2621470c.js +0 -1
  56. package/dist/dashboard/_next/static/chunks/app/replay/page-a8a465ed885df0cf.js +0 -1
  57. package/dist/dashboard/_next/static/chunks/app/runs/[id]/page-cc1d5182707fca5b.js +0 -1
  58. package/dist/dashboard/_next/static/chunks/app/runs/page-bbf0a58abd70430c.js +0 -1
  59. package/dist/dashboard/_next/static/chunks/app/settings/page-9602ff45892e7910.js +0 -1
  60. package/dist/dashboard/_next/static/chunks/app/timeline/page-a8eb3caf23be8a86.js +0 -1
  61. package/dist/dashboard/_next/static/chunks/app/tool-metrics/page-1f86f62b187f2b5e.js +0 -1
  62. package/dist/dashboard/_next/static/chunks/app/workflows/page-551939c9e86b26c6.js +0 -1
  63. package/dist/dashboard/_next/static/chunks/framework-58c3457e28c4602f.js +0 -1
  64. package/dist/dashboard/_next/static/chunks/main-3175faffdbfc3051.js +0 -1
  65. package/dist/dashboard/_next/static/chunks/main-app-202a5f91ead17fa7.js +0 -1
  66. package/dist/dashboard/_next/static/chunks/pages/_app-58c3f1a8a070bd35.js +0 -1
  67. package/dist/dashboard/_next/static/chunks/pages/_error-312a564ec7e2663f.js +0 -1
  68. package/dist/dashboard/_next/static/chunks/polyfills-42372ed130431b0a.js +0 -1
  69. package/dist/dashboard/_next/static/chunks/webpack-d6388c5dcd85b0c5.js +0 -1
  70. package/dist/dashboard/_next/static/css/322e14d06135256b.css +0 -31
  71. package/dist/dashboard/_next/static/css/7d4d1db5aa137b5a.css +0 -3
  72. package/dist/dashboard/accuracy.html +0 -1
  73. package/dist/dashboard/accuracy.txt +0 -7
  74. package/dist/dashboard/benchmark.html +0 -1
  75. package/dist/dashboard/benchmark.txt +0 -7
  76. package/dist/dashboard/context.html +0 -1
  77. package/dist/dashboard/context.txt +0 -7
  78. package/dist/dashboard/doctor.html +0 -1
  79. package/dist/dashboard/doctor.txt +0 -7
  80. package/dist/dashboard/executions.html +0 -1
  81. package/dist/dashboard/executions.txt +0 -7
  82. package/dist/dashboard/graph.html +0 -1
  83. package/dist/dashboard/graph.txt +0 -7
  84. package/dist/dashboard/index.html +0 -1
  85. package/dist/dashboard/index.txt +0 -7
  86. package/dist/dashboard/knowledge.html +0 -1
  87. package/dist/dashboard/knowledge.txt +0 -7
  88. package/dist/dashboard/locales/en.json +0 -335
  89. package/dist/dashboard/locales/zh.json +0 -335
  90. package/dist/dashboard/memory.html +0 -1
  91. package/dist/dashboard/memory.txt +0 -7
  92. package/dist/dashboard/replay.html +0 -1
  93. package/dist/dashboard/replay.txt +0 -7
  94. package/dist/dashboard/runs/_.html +0 -1
  95. package/dist/dashboard/runs/_.txt +0 -8
  96. package/dist/dashboard/runs.html +0 -1
  97. package/dist/dashboard/runs.txt +0 -7
  98. package/dist/dashboard/settings.html +0 -1
  99. package/dist/dashboard/settings.txt +0 -7
  100. package/dist/dashboard/timeline.html +0 -1
  101. package/dist/dashboard/timeline.txt +0 -7
  102. package/dist/dashboard/tool-metrics.html +0 -1
  103. package/dist/dashboard/tool-metrics.txt +0 -7
  104. package/dist/dashboard/workflows.html +0 -1
  105. package/dist/dashboard/workflows.txt +0 -7
  106. /package/dist/plugin/{hooks.json → hooks/hooks.json} +0 -0
  107. /package/dist/plugin/skills/{devflow:animation → animation}/SKILL.md +0 -0
  108. /package/dist/plugin/skills/{devflow:context → context}/SKILL.md +0 -0
  109. /package/dist/plugin/skills/{devflow:css → css}/SKILL.md +0 -0
  110. /package/dist/plugin/skills/{devflow:docker → docker}/SKILL.md +0 -0
  111. /package/dist/plugin/skills/{devflow:doctor → doctor}/SKILL.md +0 -0
  112. /package/dist/plugin/skills/{devflow:electron → electron}/SKILL.md +0 -0
  113. /package/dist/plugin/skills/{devflow:git → git}/SKILL.md +0 -0
  114. /package/dist/plugin/skills/{devflow:graph → graph}/SKILL.md +0 -0
  115. /package/dist/plugin/skills/{devflow:graphql → graphql}/SKILL.md +0 -0
  116. /package/dist/plugin/skills/{devflow:knowledge → knowledge}/SKILL.md +0 -0
  117. /package/dist/plugin/skills/{devflow:memory → memory}/SKILL.md +0 -0
  118. /package/dist/plugin/skills/{devflow:nest → nest}/SKILL.md +0 -0
  119. /package/dist/plugin/skills/{devflow:nextjs → nextjs}/SKILL.md +0 -0
  120. /package/dist/plugin/skills/{devflow:performance → performance}/SKILL.md +0 -0
  121. /package/dist/plugin/skills/{devflow:start → start}/SKILL.md +0 -0
  122. /package/dist/plugin/skills/{devflow:tailwind → tailwind}/SKILL.md +0 -0
  123. /package/dist/plugin/skills/{devflow:taro → taro}/SKILL.md +0 -0
  124. /package/dist/plugin/skills/{devflow:ui-layout → ui-layout}/SKILL.md +0 -0
  125. /package/dist/plugin/skills/{devflow:vue → vue}/SKILL.md +0 -0
  126. /package/dist/plugin/skills/{devflow:workflow → workflow}/SKILL.md +0 -0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devflow-tools/claude-code-plugin",
3
- "version": "0.16.1",
3
+ "version": "0.16.3",
4
4
  "description": "DevFlow — Developer Intelligence Platform for Claude Code",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -8,18 +8,18 @@
8
8
  "deploy": "npx tsx scripts/inject-gates.ts --deploy"
9
9
  },
10
10
  "dependencies": {
11
- "@devflow-tools/database": "0.16.0",
12
- "@devflow-tools/memory-engine": "0.16.1",
13
- "@devflow-tools/sdk": "0.16.1",
14
- "@devflow-tools/telemetry": "0.16.1",
15
- "@devflow-tools/workflow-engine": "0.16.1"
11
+ "@devflow-tools/database": "0.16.3",
12
+ "@devflow-tools/memory-engine": "0.16.3",
13
+ "@devflow-tools/sdk": "0.16.3",
14
+ "@devflow-tools/telemetry": "0.16.3",
15
+ "@devflow-tools/workflow-engine": "0.16.3"
16
16
  },
17
17
  "allowScripts": {
18
18
  "better-sqlite3@12.11.1": true,
19
19
  "sharp@0.32.6": true
20
20
  },
21
21
  "devDependencies": {
22
- "@devflow-tools/mcp-server": "0.16.1"
22
+ "@devflow-tools/mcp-server": "0.16.3"
23
23
  },
24
24
  "keywords": [
25
25
  "pi-package",
@@ -38,7 +38,6 @@
38
38
  "CLAUDE.md",
39
39
  "dist",
40
40
  "hooks",
41
- "hooks.json",
42
41
  "skills"
43
42
  ]
44
43
  }
@@ -13,7 +13,7 @@ description: React 18 专家能力 — Bug 诊断、组件重构、性能优化
13
13
 
14
14
  **新功能开发:** 需要加组件或页面 → 先确认现有实现模式,再做影响范围评估,然后生成符合项目约定的组件/Hook/类型代码,最后通过类型检查和测试。
15
15
 
16
- **性能卡顿:** 列表页滚动掉帧、输入响应慢 → Profiler 分析渲染次数和耗时,检查 memo/useMemo/useCallback 使用情况,检测不必要重渲染,生成优化方案并对比前后基准。
16
+ **性能卡顿:** 列表页滚动掉帧、输入响应慢 → 先用静态工具生成候选,再用 Profiler、浏览器 Performance trace 或可复现 benchmark 测量渲染次数、耗时和 CPU;只有测量后才能确认影响和排序优化。
17
17
 
18
18
  **Hooks 审查:** lint 警告、useEffect 循环触发 → 全量扫描所有 Hooks 调用位置,检查顶层调用规则、依赖数组完整性、清理函数缺失、反模式(渲染中创建组件、过大 useEffect),自动修复安全项。
19
19
 
@@ -26,9 +26,10 @@ description: React 18 专家能力 — Bug 诊断、组件重构、性能优化
26
26
  - 使用函数组件 + Hooks,不使用 Class 组件
27
27
  - 每个文件只导出一个组件
28
28
  - Props 使用 TypeScript interface 定义
29
- - 使用 React.memo 优化纯展示组件
29
+ - 仅在父组件重复渲染、props 稳定且组件渲染成本可观时评估 React.memo;React.memo 不会阻止组件自身 state 或所消费 Context 变化引发的更新
30
30
  - 自定义 Hooks 命名以 use 开头
31
- - 避免在渲染中创建新对象/函数(使用 useMemo / useCallback)
31
+ - 内联 DOM style 默认是低影响静态发现;只有测量证明位于热点路径时才升级影响等级
32
+ - requestAnimationFrame 只对齐浏览器绘制时机;没有明确采样频率、合并和丢弃策略时,不得把它描述为通用节流
32
33
  - 遇到不确定的 API 时先查 React 官方文档再回答
33
34
  - 修复 Bug 前先查 git log 找最近变更
34
35
  - 生成代码后必须通过 TypeScript 类型检查
@@ -48,3 +49,15 @@ description: React 18 专家能力 — Bug 诊断、组件重构、性能优化
48
49
  | Hooks 审查: | 调用 MCP 工具 `react_review_hooks` |
49
50
  | 组件拆分: | 调用 MCP 工具 `react_refactor_component` |
50
51
  | 新建组件: | 调用 MCP 工具 `react_new_component` |
52
+
53
+ ## 性能证据契约
54
+
55
+ `react_audit_performance` 返回静态候选,并通过 `runtimeProfilingOccurred` 明确说明是否执行过运行时 profiling。每条发现必须保留 `evidenceMode`、`detectionMethod`、`confidence`、`impact` 和 `limitations`,不得省略限制条件。
56
+
57
+ 最终答复必须按以下三个标题分开陈述:
58
+
59
+ 1. **工具发现**:只复述工具实际返回的证据、位置和限制,不扩写为已测事实。
60
+ 2. **模型假设**:明确标注基于代码上下文的推断,不与工具发现混写。
61
+ 3. **需要运行时验证**:列出复现场景、Profiler/trace/benchmark 方法和待采集指标。
62
+
63
+ 没有运行时测量时,不得把任何静态发现标为 P0,不得声称已观察到 jank/卡顿或 CPU 影响,也不得称其为性能瓶颈。只有包含场景、指标、数值和单位的 Profiler、Performance trace 或 benchmark 结果,才能支持这些结论。
@@ -0,0 +1,6 @@
1
+ import {execFileSync}from'node:child_process';import {createRequire}from'node:module';import {existsSync,readdirSync,readFileSync}from'node:fs';import {homedir}from'node:os';import {join}from'node:path';var L=6e4,R;function P(){if(R)return R;let e=createRequire(import.meta.url)("node:sqlite");if(typeof e.DatabaseSync!="function")throw new Error("audit-session-data requires Node.js with node:sqlite (Node.js >=22.13.0)");return R=e.DatabaseSync,R}function V(e){let t,n,o=false;for(let i=0;i<e.length;i+=1){let l=e[i];if(l==="--json")o=true;else if(l==="--project")t=e[++i];else if(l==="--session")n=e[++i];else throw new Error(`Unknown argument: ${l}`)}if(!t)throw new Error("--project is required");if(!n)throw new Error("--session is required");return {project:t,session:n,json:o}}function u(e){return typeof e=="string"&&e.length>0?e:null}function j(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function h(e){return e===true||e===1}function d(e,t){return !!e.prepare("SELECT 1 FROM sqlite_master WHERE type IN ('table', 'view') AND name = ?").get(t)}function E(e,t,n){return d(e,t)?e.prepare(`PRAGMA table_info(${t})`).all().some(o=>o.name===n):false}function k(e,t,n=[]){let o=e.prepare(t).get(...n);return Number(o?.count??0)}function A(e){if(typeof e!="string"||e.length===0)return e??null;try{return JSON.parse(e)}catch{return e}}function w(e){return e===null||typeof e!="object"?JSON.stringify(e)??String(e):Array.isArray(e)?`[${e.map(w).join(",")}]`:`{${Object.entries(e).sort(([t],[n])=>t.localeCompare(n)).map(([t,n])=>`${JSON.stringify(t)}:${w(n)}`).join(",")}}`}function F(e){return w({tool:e.tool,command:e.command,kind:e.kind,input:e.input})}function _(e){let t=new Map;for(let n of e){if(n.toolUseId){let l=`tool_use_id:${n.toolUseId}`,a=t.get(l)??{reason:"canonical_tool_use_id",events:[]};a.events.push(n),t.set(l,a);continue}let o=`payload:${F(n)}`,i=t.get(o)??{reason:"normalized_payload",events:[]};i.events.push(n),t.set(o,i);}return [...t.entries()].map(([n,o])=>{let i=o.events.map(a=>a.timestamp).filter(a=>a!==null),l=i.length>1?Math.max(...i)-Math.min(...i):null;return {key:n,reason:o.reason,count:o.events.length,eventIds:o.events.map(a=>a.id),timeSpanMs:l,tool:o.events[0]?.tool??null}}).filter(n=>n.count>1&&(n.reason==="canonical_tool_use_id"||n.timeSpanMs===null||n.timeSpanMs<=L)).sort((n,o)=>o.count-n.count||n.key.localeCompare(o.key))}function O(e){return existsSync(e)?new(P())(e,{readOnly:true,timeout:1e3}):null}function I(e,t){if(!existsSync(e))return {path:e,exists:false,sessions:[],executions:[],events:[],duplicateCandidates:[]};let n=null;try{if(n=O(e),!n)return {path:e,exists:!1,sessions:[],executions:[],events:[],duplicateCandidates:[]};let o=d(n,"sessions")?n.prepare("SELECT * FROM sessions WHERE id = ?").all(t):[],i=E(n,"skill_executions","session_id"),l=d(n,"skill_executions")?n.prepare(i?"SELECT * FROM skill_executions WHERE session_id = ? OR execution_id = ? ORDER BY started_at":"SELECT * FROM skill_executions WHERE execution_id = ? ORDER BY started_at").all(...i?[t,t]:[t]):[],a=l.map(s=>u(s.execution_id)).filter(s=>s!==null),m=E(n,"tool_call_events","tool_use_id"),c=E(n,"tool_call_events","session_id"),b=E(n,"tool_call_events","kind"),C=a.length>0?`execution_id IN (${a.map(()=>"?").join(",")})`:"execution_id = ?",y=a.length>0?a:[t],r=(d(n,"tool_call_events")?n.prepare(`SELECT * FROM tool_call_events WHERE ${c?"session_id = ? OR ":""}${C} ORDER BY timestamp`).all(...c?[t,...y]:y):[]).map(s=>({id:u(s.event_id)??"unknown",sessionId:u(s.session_id),executionId:u(s.execution_id),timestamp:j(s.timestamp),tool:u(s.tool_name),toolType:u(s.tool_type),toolUseId:m?u(s.tool_use_id):null,input:A(s.input),command:null,kind:b?u(s.kind):null,fallback:h(s.mcp_fallback),blocked:h(s.blocked),processed:!1}));return {path:e,exists:!0,sessions:o,executions:l,events:r,duplicateCandidates:_(r)}}catch(o){return {path:e,exists:true,sessions:[],executions:[],events:[],duplicateCandidates:[],error:o instanceof Error?o.message:String(o)}}finally{n?.close();}}function N(e,t){let n=join(e,".devflow","memory","memories.db"),o={databasePath:n,session:null,eventCount:0,processedEventCount:0,pendingEventCount:0,eventsByTool:[],duplicateCandidates:[],projectObservationCount:0,sessionObservationCount:0,sessionObservationVectorCount:0,projectObservationVectorCount:0,projectObservationVectorRowCount:0,pendingLeaseCount:0,activeSessionCount:0};if(!existsSync(n))return o;let i=null;try{if(i=O(n),!i)return o;let a=(d(i,"session_events")?i.prepare("SELECT * FROM session_events WHERE session_id = ? ORDER BY created_at").all(t):[]).map(r=>({id:u(r.id)??"unknown",sessionId:u(r.session_id),executionId:null,timestamp:j(r.created_at),tool:u(r.tool),toolType:null,toolUseId:null,input:A(r.payload),command:u(r.command),kind:u(r.kind),fallback:!1,blocked:!1,processed:h(r.processed)})),m=d(i,"observations")?i.prepare("SELECT id, session_id, embedding FROM observations").all():[],c=d(i,"sessions")?i.prepare("SELECT * FROM sessions WHERE id = ?").get(t)??null:null,b=new Map;for(let r of a){let s=`${r.tool??""}\0${r.kind??""}`,f=b.get(s)??{tool:r.tool,kind:r.kind,count:0};f.count+=1,b.set(s,f);}let C=d(i,"memories_vec_rowids")?new Set(i.prepare("SELECT id FROM memories_vec_rowids").all().map(r=>u(r.id)).filter(r=>r!==null)):new Set,y=m.filter(r=>r.session_id===t),v=r=>r.embedding!==null&&r.embedding!==void 0;return {databasePath:n,session:c,eventCount:a.length,processedEventCount:a.filter(r=>r.processed).length,pendingEventCount:a.filter(r=>!r.processed).length,eventsByTool:[...b.values()].sort((r,s)=>s.count-r.count),duplicateCandidates:_(a),projectObservationCount:m.length,sessionObservationCount:y.length,sessionObservationVectorCount:y.filter(v).length,projectObservationVectorCount:m.filter(v).length,projectObservationVectorRowCount:m.filter(r=>C.has(String(r.id))).length,pendingLeaseCount:d(i,"distill_leases")?k(i,"SELECT COUNT(*) AS count FROM distill_leases WHERE status = 'pending'"):0,activeSessionCount:d(i,"sessions")?k(i,"SELECT COUNT(*) AS count FROM sessions WHERE status = 'active'"):0}}catch(l){return {...o,error:l instanceof Error?l.message:String(l)}}finally{i?.close();}}function U(e){let t=join(e,".devflow","knowledge","knowledge.db"),n={databasePath:t,documentCount:0,chunkCount:0,emptyTitleCount:0,vectorRowCount:0,sourceCounts:[]};if(!existsSync(t))return n;let o=null;try{if(o=O(t),!o)return n;let i=d(o,"knowledge_docs")?k(o,"SELECT COUNT(*) AS count FROM knowledge_docs"):0,l=d(o,"knowledge_chunks")?k(o,"SELECT COUNT(*) AS count FROM knowledge_chunks"):0,a=d(o,"knowledge_docs")?k(o,"SELECT COUNT(*) AS count FROM knowledge_docs WHERE TRIM(COALESCE(title, '')) = ''"):0,m=d(o,"knowledge_docs")?o.prepare("SELECT source, COUNT(*) AS count FROM knowledge_docs GROUP BY source ORDER BY count DESC").all().map(c=>({source:u(c.source),count:Number(c.count??0)})):[];return {databasePath:t,documentCount:i,chunkCount:l,emptyTitleCount:a,vectorRowCount:d(o,"knowledge_vec_rowids")?k(o,"SELECT COUNT(*) AS count FROM knowledge_vec_rowids"):0,sourceCounts:m}}catch(i){return {...n,error:i instanceof Error?i.message:String(i)}}finally{o?.close();}}function W(){let e=join(homedir(),".claude","plugins","cache","devflow-local","devflow");if(!existsSync(e))return null;let t=readdirSync(e,{withFileTypes:true}).filter(n=>n.isDirectory()).map(n=>n.name).sort();return t.length>0?join(e,t[t.length-1]):null}function x(e){if(!e)return null;try{let t=JSON.parse(readFileSync(join(e,".claude-plugin","plugin.json"),"utf8"));return u(t.version)}catch{return null}}function q(e,t){try{return execFileSync(e,t,{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()||null}catch{return null}}function B(e,t,n){let o=join(e,".devflow","logs","traces");if(!existsSync(o))return null;let i=[];for(let l of readdirSync(o,{withFileTypes:true})){if(!l.isDirectory())continue;for(let m of t){let c=join(o,l.name,`${m}.jsonl`);existsSync(c)&&i.push(c);}let a=join(o,l.name,`${n}.jsonl`);existsSync(a)&&i.push(a);}return i[0]??null}function H(e){if(!e)return null;try{return readFileSync(e,"utf8").split(`
2
+ `).filter(t=>t.trim().length>0).length}catch{return null}}function Y(e){try{return execFileSync("git",["-C",e,"status","--short","--branch"],{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()}catch{return "unavailable"}}function J(e,t){let n=process.env.DEVFLOW_STATE_DIR??join(homedir(),".devflow","global"),o=[join(n,"devflow.db"),join(e,".devflow","devflow.db")],i=o.filter((s,f)=>o.indexOf(s)===f).map(s=>I(s,t)),l=i.flatMap(s=>s.events),a=[...new Set(i.flatMap(s=>s.executions).map(s=>u(s.execution_id)).filter(s=>s!==null))],m=new Map;for(let s of l)m.set(s.tool,(m.get(s.tool)??0)+1);let c=W(),b=B(e,a,t),C=N(e,t),y=U(e),v=join(homedir(),".claude","skills","devflow:react","SKILL.md"),r=i.find(s=>s.executions.length>0)??i.find(s=>s.sessions.length>0);return {schemaVersion:1,readOnly:true,generatedAt:new Date().toISOString(),project:{root:e,gitStatus:Y(e)},query:{sessionId:t,executionIds:a},runtime:{nodeVersion:process.version,claudeVersion:q("claude",["--version"]),devflowVersion:x(c),activePluginPath:c,activePluginVersion:x(c),activeReactSkillPath:c?join(c,"skills","react","SKILL.md"):null,activeReactSkillExists:c?existsSync(join(c,"skills","react","SKILL.md")):false,legacyReactSkillPath:v,legacyReactSkillExists:existsSync(v),tracePath:b,traceEventCount:H(b)},telemetry:{databases:i,eventCount:l.length,mcpEventCount:l.filter(s=>s.toolType==="mcp").length,fallbackCount:l.filter(s=>s.fallback).length,blockedCount:l.filter(s=>s.blocked).length,duplicateCandidates:_(l),byTool:[...m.entries()].map(([s,f])=>({tool:s,count:f})).sort((s,f)=>f.count-s.count||String(s.tool).localeCompare(String(f.tool)))},memory:C,knowledge:y,lifecycle:{telemetrySession:r?.sessions[0]??null,telemetryExecution:r?.executions[0]??null,memorySession:C.session}}}function K(e){let t=e.telemetry,n=e.memory,o=e.lifecycle;return [`Session audit: ${e.query.sessionId}`,`Project: ${e.project.root}`,`Git: ${e.project.gitStatus||"(clean)"}`,`Telemetry: ${t.eventCount} events (${t.mcpEventCount} MCP, ${t.fallbackCount} fallback, ${t.blockedCount} blocked)`,`Memory events: ${n.eventCount} (${n.processedEventCount} processed, ${n.pendingEventCount} pending)`,`Observations: ${n.sessionObservationCount} for session / ${n.projectObservationCount} for project; vectors ${n.sessionObservationVectorCount}/${n.sessionObservationCount} for session, ${n.projectObservationVectorCount}/${n.projectObservationCount} by blob, ${n.projectObservationVectorRowCount} indexed`,`Duplicates: ${t.duplicateCandidates.length} telemetry candidate groups, ${n.duplicateCandidates.length} Memory candidate groups`,`Lifecycle: telemetry ${u(o.telemetrySession?.status)??"missing"}, execution ${u(o.telemetryExecution?.status)??"missing"}, memory ${u(o.memorySession?.status)??"missing"}`,`Knowledge: ${e.knowledge.documentCount} docs, ${e.knowledge.chunkCount} chunks, ${e.knowledge.vectorRowCount} vectors, ${e.knowledge.emptyTitleCount} empty titles`,`Runtime: Claude ${e.runtime.claudeVersion??"unknown"}, DevFlow ${e.runtime.devflowVersion??"unknown"}, trace events ${e.runtime.traceEventCount??"unknown"}`].join(`
3
+ `)}function z(){try{let e=V(process.argv.slice(2)),t=J(e.project,e.session);process.stdout.write(e.json?`${JSON.stringify(t,null,2)}
4
+ `:`${K(t)}
5
+ `);}catch(e){process.stderr.write(`${e instanceof Error?e.message:String(e)}
6
+ `),process.exitCode=1;}}z();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devflow-tools/devflow",
3
- "version": "0.16.1",
3
+ "version": "0.16.3",
4
4
  "type": "module",
5
5
  "description": "DevFlow - Developer Intelligence Platform (Distribution Package)",
6
6
  "bin": {
@@ -8,6 +8,7 @@
8
8
  },
9
9
  "scripts": {
10
10
  "build": "tsup",
11
+ "audit-session-data": "tsx scripts/audit-session-data.ts",
11
12
  "build:watch": "tsup --watch",
12
13
  "clean": "rm -rf dist",
13
14
  "postbuild": "cp ../../apps/server/public/fallback.html dist/fallback.html && npx tsx scripts/bundle-plugin.ts && mkdir -p ../../plugins/claude-code/dist/hooks && cp dist/hooks/*.js ../../plugins/claude-code/dist/hooks/",
@@ -15,17 +16,17 @@
15
16
  },
16
17
  "dependencies": {
17
18
  "@colbymchenry/codegraph": "^1.1.1",
18
- "@devflow-tools/adapters": "0.16.1",
19
- "@devflow-tools/benchmark": "0.16.1",
20
- "@devflow-tools/context-engine": "0.16.1",
21
- "@devflow-tools/database": "0.16.0",
22
- "@devflow-tools/knowledge-engine": "0.16.1",
23
- "@devflow-tools/mcp-server": "0.16.1",
24
- "@devflow-tools/memory-engine": "0.16.1",
25
- "@devflow-tools/sdk": "0.16.1",
26
- "@devflow-tools/server": "0.16.1",
27
- "@devflow-tools/telemetry": "0.16.1",
28
- "@devflow-tools/workflow-engine": "0.16.1",
19
+ "@devflow-tools/adapters": "0.16.3",
20
+ "@devflow-tools/benchmark": "0.16.3",
21
+ "@devflow-tools/context-engine": "0.16.3",
22
+ "@devflow-tools/database": "0.16.3",
23
+ "@devflow-tools/knowledge-engine": "0.16.3",
24
+ "@devflow-tools/mcp-server": "0.16.3",
25
+ "@devflow-tools/memory-engine": "0.16.3",
26
+ "@devflow-tools/sdk": "0.16.3",
27
+ "@devflow-tools/server": "0.16.3",
28
+ "@devflow-tools/telemetry": "0.16.3",
29
+ "@devflow-tools/workflow-engine": "0.16.3",
29
30
  "@inquirer/prompts": "^7.10.1",
30
31
  "@modelcontextprotocol/sdk": "^1.0.0",
31
32
  "@nestjs/common": "^10.4.0",
@@ -53,5 +54,5 @@
53
54
  "plugin-registry.json",
54
55
  "scripts/postinstall.js"
55
56
  ],
56
- "gitHead": "dfaeb66efe9c87c388fbe6f1b706e9fcf087ce6d"
57
+ "gitHead": "5f49cf58702ee94ad9e4ab585e58f824e8633721"
57
58
  }
@@ -1,172 +1,172 @@
1
1
  {
2
2
  "version": "1.0.0",
3
- "lastUpdated": "2026-07-22T03:28:02.463Z",
3
+ "lastUpdated": "2026-07-22T07:30:34.667Z",
4
4
  "plugins": [
5
5
  {
6
6
  "name": "@devflow-tools/plugin-animation",
7
- "version": "0.16.1",
7
+ "version": "0.16.2",
8
8
  "description": "",
9
9
  "tags": [],
10
10
  "compatibleStacks": [
11
11
  "animation"
12
12
  ],
13
- "size": "120876 B",
13
+ "size": "120597 B",
14
14
  "author": "DevFlow Team",
15
15
  "homepage": ""
16
16
  },
17
17
  {
18
18
  "name": "@devflow-tools/plugin-css",
19
- "version": "0.16.1",
19
+ "version": "0.16.2",
20
20
  "description": "",
21
21
  "tags": [],
22
22
  "compatibleStacks": [
23
23
  "css"
24
24
  ],
25
- "size": "108397 B",
25
+ "size": "108112 B",
26
26
  "author": "DevFlow Team",
27
27
  "homepage": ""
28
28
  },
29
29
  {
30
30
  "name": "@devflow-tools/plugin-docker",
31
- "version": "0.16.1",
31
+ "version": "0.16.2",
32
32
  "description": "",
33
33
  "tags": [],
34
34
  "compatibleStacks": [
35
35
  "docker"
36
36
  ],
37
- "size": "137194 B",
37
+ "size": "136912 B",
38
38
  "author": "DevFlow Team",
39
39
  "homepage": ""
40
40
  },
41
41
  {
42
42
  "name": "@devflow-tools/plugin-electron",
43
- "version": "0.16.1",
43
+ "version": "0.16.2",
44
44
  "description": "",
45
45
  "tags": [],
46
46
  "compatibleStacks": [
47
47
  "electron"
48
48
  ],
49
- "size": "152863 B",
49
+ "size": "152583 B",
50
50
  "author": "DevFlow Team",
51
51
  "homepage": ""
52
52
  },
53
53
  {
54
54
  "name": "@devflow-tools/plugin-git",
55
- "version": "0.16.1",
55
+ "version": "0.16.2",
56
56
  "description": "",
57
57
  "tags": [],
58
58
  "compatibleStacks": [
59
59
  "git"
60
60
  ],
61
- "size": "118745 B",
61
+ "size": "118460 B",
62
62
  "author": "DevFlow Team",
63
63
  "homepage": ""
64
64
  },
65
65
  {
66
66
  "name": "@devflow-tools/plugin-graphql",
67
- "version": "0.16.1",
67
+ "version": "0.16.2",
68
68
  "description": "",
69
69
  "tags": [],
70
70
  "compatibleStacks": [
71
71
  "graphql"
72
72
  ],
73
- "size": "120874 B",
73
+ "size": "120593 B",
74
74
  "author": "DevFlow Team",
75
75
  "homepage": ""
76
76
  },
77
77
  {
78
78
  "name": "@devflow-tools/plugin-nest",
79
- "version": "0.16.1",
79
+ "version": "0.16.2",
80
80
  "description": "",
81
81
  "tags": [],
82
82
  "compatibleStacks": [
83
83
  "nest"
84
84
  ],
85
- "size": "157982 B",
85
+ "size": "157697 B",
86
86
  "author": "DevFlow Team",
87
87
  "homepage": ""
88
88
  },
89
89
  {
90
90
  "name": "@devflow-tools/plugin-nextjs",
91
- "version": "0.16.1",
91
+ "version": "0.16.2",
92
92
  "description": "",
93
93
  "tags": [],
94
94
  "compatibleStacks": [
95
95
  "nextjs"
96
96
  ],
97
- "size": "119527 B",
97
+ "size": "119244 B",
98
98
  "author": "DevFlow Team",
99
99
  "homepage": ""
100
100
  },
101
101
  {
102
102
  "name": "@devflow-tools/plugin-performance",
103
- "version": "0.16.1",
103
+ "version": "0.16.2",
104
104
  "description": "",
105
105
  "tags": [],
106
106
  "compatibleStacks": [
107
107
  "performance"
108
108
  ],
109
- "size": "169348 B",
109
+ "size": "169071 B",
110
110
  "author": "DevFlow Team",
111
111
  "homepage": ""
112
112
  },
113
113
  {
114
114
  "name": "@devflow-tools/plugin-react",
115
- "version": "0.16.1",
115
+ "version": "0.16.2",
116
116
  "description": "",
117
117
  "tags": [],
118
118
  "compatibleStacks": [
119
119
  "react"
120
120
  ],
121
- "size": "255955 B",
121
+ "size": "264634 B",
122
122
  "author": "DevFlow Team",
123
123
  "homepage": ""
124
124
  },
125
125
  {
126
126
  "name": "@devflow-tools/plugin-tailwind",
127
- "version": "0.16.1",
127
+ "version": "0.16.2",
128
128
  "description": "",
129
129
  "tags": [],
130
130
  "compatibleStacks": [
131
131
  "tailwind"
132
132
  ],
133
- "size": "125530 B",
133
+ "size": "125250 B",
134
134
  "author": "DevFlow Team",
135
135
  "homepage": ""
136
136
  },
137
137
  {
138
138
  "name": "@devflow-tools/plugin-taro",
139
- "version": "0.16.1",
139
+ "version": "0.16.2",
140
140
  "description": "",
141
141
  "tags": [],
142
142
  "compatibleStacks": [
143
143
  "taro"
144
144
  ],
145
- "size": "129169 B",
145
+ "size": "128885 B",
146
146
  "author": "DevFlow Team",
147
147
  "homepage": ""
148
148
  },
149
149
  {
150
150
  "name": "@devflow-tools/plugin-ui-layout",
151
- "version": "0.16.1",
151
+ "version": "0.16.2",
152
152
  "description": "",
153
153
  "tags": [],
154
154
  "compatibleStacks": [
155
155
  "ui-layout"
156
156
  ],
157
- "size": "106245 B",
157
+ "size": "105966 B",
158
158
  "author": "DevFlow Team",
159
159
  "homepage": ""
160
160
  },
161
161
  {
162
162
  "name": "@devflow-tools/plugin-vue",
163
- "version": "0.16.1",
163
+ "version": "0.16.2",
164
164
  "description": "",
165
165
  "tags": [],
166
166
  "compatibleStacks": [
167
167
  "vue"
168
168
  ],
169
- "size": "137821 B",
169
+ "size": "137536 B",
170
170
  "author": "DevFlow Team",
171
171
  "homepage": ""
172
172
  }
@@ -1 +0,0 @@
1
- <!DOCTYPE html><html lang="zh" class="dark"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/7d4d1db5aa137b5a.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-d6388c5dcd85b0c5.js"/><script src="/_next/static/chunks/1dd3208c-f3e84932bdc53383.js" async=""></script><script src="/_next/static/chunks/528-7d4fc14903647f1e.js" async=""></script><script src="/_next/static/chunks/main-app-202a5f91ead17fa7.js" async=""></script><script src="/_next/static/chunks/736-db1a009357c222d2.js" async=""></script><script src="/_next/static/chunks/806-195d4d5cc6c28f6c.js" async=""></script><script src="/_next/static/chunks/697-05cf55b6c667773f.js" async=""></script><script src="/_next/static/chunks/458-75822399a849befa.js" async=""></script><script src="/_next/static/chunks/249-e04c1de6240fd78a.js" async=""></script><script src="/_next/static/chunks/429-eac85fdc49353ed8.js" async=""></script><script src="/_next/static/chunks/app/layout-4b78776412bd4fee.js" async=""></script><meta name="robots" content="noindex"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="h-dvh overflow-hidden"><div class="flex h-dvh items-center justify-center text-sm text-muted-foreground">Loading...</div><script src="/_next/static/chunks/webpack-d6388c5dcd85b0c5.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/css/7d4d1db5aa137b5a.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"2:I[11815,[],\"\"]\n4:I[55092,[],\"\"]\n5:I[82023,[],\"\"]\n6:I[68762,[\"736\",\"static/chunks/736-db1a009357c222d2.js\",\"806\",\"static/chunks/806-195d4d5cc6c28f6c.js\",\"697\",\"static/chunks/697-05cf55b6c667773f.js\",\"458\",\"static/chunks/458-75822399a849befa.js\",\"249\",\"static/chunks/249-e04c1de6240fd78a.js\",\"429\",\"static/chunks/429-eac85fdc49353ed8.js\",\"185\",\"static/chunks/app/layout-4b78776412bd4fee.js\"],\"default\",1]\nc:I[91584,[],\"\"]\n7:{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"}\n8:{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"}\n9:{\"display\":\"inline-block\"}\na:{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0}\nd:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L2\",null,{\"buildId\":\"PV20UFAxDva62WLq6zWVa\",\"assetPrefix\":\"\",\"urlParts\":[\"\",\"_not-found\"],\"initialTree\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{},[[\"$L3\",[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null],null],null]},[null,[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"/_not-found\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/7d4d1db5aa137b5a.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"$L6\",null,{\"children\":[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$7\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$8\",\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":\"$9\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$a\",\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}],\"params\":{}}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],\"$Lb\"],\"globalErrorComponent\":\"$c\",\"missingSlots\":\"$Wd\"}]\n"])</script><script>self.__next_f.push([1,"b:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}]]\n3:null\n"])</script></body></html>
@@ -1 +0,0 @@
1
- self.__BUILD_MANIFEST={__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/_error":["static/chunks/pages/_error-312a564ec7e2663f.js"],sortedPages:["/_app","/_error"]},self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
@@ -1 +0,0 @@
1
- self.__SSG_MANIFEST=new Set(["\u002Fruns\u002F[id]"]);self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB()