feihong-code 7.0.0 → 7.5.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 (149) hide show
  1. package/.github/workflows/ci.yml +180 -140
  2. package/.github/workflows/release.yml +200 -0
  3. package/CHANGELOG.md +94 -65
  4. package/README.md +609 -586
  5. package/dist/agent/browser-agent.js +354 -0
  6. package/dist/agent/browser-agent.js.map +1 -0
  7. package/dist/agent/change-manager.js +433 -0
  8. package/dist/agent/change-manager.js.map +1 -0
  9. package/dist/agent/code-rag.js +293 -0
  10. package/dist/agent/code-rag.js.map +1 -0
  11. package/dist/agent/code-writer.js +13 -1
  12. package/dist/agent/code-writer.js.map +1 -1
  13. package/dist/agent/completion-engine.js +553 -0
  14. package/dist/agent/completion-engine.js.map +1 -0
  15. package/dist/agent/completion-postprocess.js +109 -0
  16. package/dist/agent/completion-postprocess.js.map +1 -0
  17. package/dist/agent/context-budget.js +121 -0
  18. package/dist/agent/context-budget.js.map +1 -0
  19. package/dist/agent/context-compactor.js +235 -10
  20. package/dist/agent/context-compactor.js.map +1 -1
  21. package/dist/agent/custom-agent.js +368 -0
  22. package/dist/agent/custom-agent.js.map +1 -0
  23. package/dist/agent/design-to-code.js +218 -0
  24. package/dist/agent/design-to-code.js.map +1 -0
  25. package/dist/agent/event-driven-agent.js +359 -0
  26. package/dist/agent/event-driven-agent.js.map +1 -0
  27. package/dist/agent/git-integration.js +324 -0
  28. package/dist/agent/git-integration.js.map +1 -0
  29. package/dist/agent/layered-memory.js +329 -0
  30. package/dist/agent/layered-memory.js.map +1 -0
  31. package/dist/agent/lint.js +121 -0
  32. package/dist/agent/lint.js.map +1 -0
  33. package/dist/agent/multi-agent.js +359 -0
  34. package/dist/agent/multi-agent.js.map +1 -0
  35. package/dist/agent/orchestrator.js +136 -25
  36. package/dist/agent/orchestrator.js.map +1 -1
  37. package/dist/agent/prompts.js +54 -54
  38. package/dist/agent/quality-gate.js +139 -0
  39. package/dist/agent/quality-gate.js.map +1 -1
  40. package/dist/agent/self-correction.js +274 -0
  41. package/dist/agent/self-correction.js.map +1 -0
  42. package/dist/agent/self-heal.js +47 -17
  43. package/dist/agent/self-heal.js.map +1 -1
  44. package/dist/agent/solo-agent.js +321 -0
  45. package/dist/agent/solo-agent.js.map +1 -0
  46. package/dist/agent/symbol-index.js +258 -28
  47. package/dist/agent/symbol-index.js.map +1 -1
  48. package/dist/agent/team-collaboration.js +252 -0
  49. package/dist/agent/team-collaboration.js.map +1 -0
  50. package/dist/agent/type-checker.js +229 -0
  51. package/dist/agent/type-checker.js.map +1 -0
  52. package/dist/cli/commands.js +9 -0
  53. package/dist/cli/commands.js.map +1 -1
  54. package/dist/cli/index.js +9 -0
  55. package/dist/cli/index.js.map +1 -1
  56. package/dist/cli/multi-pane-tui.js +217 -0
  57. package/dist/cli/multi-pane-tui.js.map +1 -0
  58. package/dist/cli/run.js +130 -40
  59. package/dist/cli/run.js.map +1 -1
  60. package/dist/cli/tui-run.js +79 -0
  61. package/dist/cli/tui-run.js.map +1 -0
  62. package/dist/cli/tui.js.map +1 -1
  63. package/dist/cli/version.js +1 -1
  64. package/dist/integrations/collaboration.js +219 -0
  65. package/dist/integrations/collaboration.js.map +1 -0
  66. package/dist/integrations/figma.js +307 -0
  67. package/dist/integrations/figma.js.map +1 -0
  68. package/dist/integrations/sso.js +327 -0
  69. package/dist/integrations/sso.js.map +1 -0
  70. package/dist/knowledge/library.js +301 -0
  71. package/dist/knowledge/library.js.map +1 -0
  72. package/dist/lsp/lsp-client.js +183 -0
  73. package/dist/lsp/lsp-client.js.map +1 -0
  74. package/dist/lsp/lsp-service.js +159 -0
  75. package/dist/lsp/lsp-service.js.map +1 -0
  76. package/dist/plugins/manager.js +380 -0
  77. package/dist/plugins/manager.js.map +1 -0
  78. package/dist/runtime/event-log.js.map +1 -1
  79. package/dist/shared/i18n.js +108 -100
  80. package/dist/shared/i18n.js.map +1 -1
  81. package/dist/tools/browser/browser.tool.js +217 -0
  82. package/dist/tools/browser/browser.tool.js.map +1 -0
  83. package/dist/tools/generator/code-generator.js +40 -40
  84. package/dist/tools/generator/test-generator.js +9 -9
  85. package/dist/tools/index.js +2 -0
  86. package/dist/tools/index.js.map +1 -1
  87. package/dist/tools/shell/exec.js +73 -11
  88. package/dist/tools/shell/exec.js.map +1 -1
  89. package/dist/tools/shell/run-shell.tool.js +8 -2
  90. package/dist/tools/shell/run-shell.tool.js.map +1 -1
  91. package/dist/training/completion-evaluator.js +213 -0
  92. package/dist/training/completion-evaluator.js.map +1 -0
  93. package/dist/training/fim-data.js +248 -0
  94. package/dist/training/fim-data.js.map +1 -0
  95. package/dist/voice/voice-programming.js +223 -0
  96. package/dist/voice/voice-programming.js.map +1 -0
  97. package/dist/web/extra-apis.js +440 -0
  98. package/dist/web/extra-apis.js.map +1 -0
  99. package/dist/web/public/css/style.css +1729 -1671
  100. package/dist/web/public/index.html +1242 -990
  101. package/dist/web/public/js/api.js +555 -382
  102. package/dist/web/public/js/app.js +2210 -2210
  103. package/dist/web/public/js/mock-api.js +234 -0
  104. package/dist/web/public/js/monaco-editor.js +363 -0
  105. package/dist/web/public/js/ui.js +2251 -1059
  106. package/dist/web/public/js/utils.js +214 -214
  107. package/dist/web/public/manifest.json +59 -0
  108. package/dist/web/public/service-worker.js +173 -0
  109. package/dist/web/server.js +1116 -45
  110. package/dist/web/server.js.map +1 -1
  111. package/dist/web/task-queue.js +22 -2
  112. package/dist/web/task-queue.js.map +1 -1
  113. package/docs/BENCHMARK_REPORT_en.md +386 -329
  114. package/docs/BENCHMARK_REPORT_zh.md +386 -329
  115. package/docs/DPA.md +63 -0
  116. package/docs/DPA/346/225/260/346/215/256/345/244/204/347/220/206/345/215/217/350/256/256/346/250/241/346/235/277_v1.0.md +67 -0
  117. package/docs/SECURITY_WHITEPAPER.md +74 -0
  118. package/docs/SWE_BENCH_REPORT.md +55 -0
  119. package/docs/TECHNICAL_SPEC_en.md +292 -292
  120. package/docs/TECHNICAL_SPEC_zh.md +292 -292
  121. package/docs/UPDATE_NOTES_en.md +159 -159
  122. package/docs/UPDATE_NOTES_zh.md +159 -159
  123. package/docs/UPGRADE_7.2.0.md +309 -0
  124. package/docs/UPGRADE_GUIDE_7_5.md +86 -0
  125. package/docs/geo-feihong-code.html +391 -0
  126. package/docs//345/205/250/351/235/242/345/244/215/347/233/230_50/350/275/256/346/267/261/345/272/246/345/256/241/350/256/241_v7.2.0.md +208 -0
  127. package/docs//345/205/250/351/235/242/345/244/215/347/233/230_6/351/241/271/351/207/215/347/202/271/346/240/270/346/237/245_v7.2.0.md +152 -0
  128. package/docs//345/205/250/351/235/242/345/244/215/347/233/230_/350/277/220/350/241/214/346/227/266/345/256/236/346/265/213/347/211/210_v7.2.0.md +271 -0
  129. package/docs//345/220/210/350/247/204/350/256/244/350/257/201/345/207/206/345/244/207/346/270/205/345/215/225_v7.2.0.md +59 -0
  130. package/docs//345/256/211/345/205/250/347/231/275/347/232/256/344/271/246_v7.2.0.md +82 -0
  131. package/electron/main.js +404 -404
  132. package/package.json +175 -167
  133. package/templates/skills/api-design/SKILL.md +27 -0
  134. package/templates/skills/code-review/SKILL.md +35 -0
  135. package/templates/skills/dependency-upgrade/SKILL.md +29 -0
  136. package/templates/skills/doc-gen/SKILL.md +29 -0
  137. package/templates/skills/git-flow/SKILL.md +26 -0
  138. package/templates/skills/onboarding/SKILL.md +27 -0
  139. package/templates/skills/performance/SKILL.md +29 -0
  140. package/templates/skills/refactor/SKILL.md +28 -0
  141. package/templates/skills/security-audit/SKILL.md +28 -0
  142. package/templates/skills/test-gen/SKILL.md +30 -0
  143. package/tool-schema.json +197 -197
  144. package/dist/hello.js +0 -14
  145. package/dist/hello.js.map +0 -1
  146. package/dist/self-evolve/hook.ts +0 -80
  147. package/dist/self-evolve/manager.d.ts +0 -8
  148. package/dist/web/web-config.js +0 -143
  149. package/dist/web/web-config.js.map +0 -1
@@ -0,0 +1,173 @@
1
+ /**
2
+ * 飞虹 Code Service Worker
3
+ * 支持离线缓存、PWA 安装、移动端适配
4
+ */
5
+
6
+ const CACHE_NAME = 'feihong-code-v1';
7
+ const STATIC_CACHE = 'feihong-static-v1';
8
+ const RUNTIME_CACHE = 'feihong-runtime-v1';
9
+
10
+ // 静态资源缓存列表
11
+ const STATIC_ASSETS = [
12
+ '/',
13
+ '/index.html',
14
+ '/manifest.json',
15
+ '/css/style.css',
16
+ '/js/app.js',
17
+ '/js/ui.js',
18
+ '/js/api.js',
19
+ '/js/utils.js',
20
+ '/js/monaco-editor.js',
21
+ ];
22
+
23
+ // 安装事件:预缓存静态资源
24
+ self.addEventListener('install', (event) => {
25
+ console.log('[SW] Installing...');
26
+ event.waitUntil(
27
+ caches.open(STATIC_CACHE).then((cache) => {
28
+ console.log('[SW] Pre-caching static assets');
29
+ return cache.addAll(STATIC_ASSETS).catch((err) => {
30
+ console.warn('[SW] Pre-cache failed:', err);
31
+ });
32
+ }).then(() => self.skipWaiting())
33
+ );
34
+ });
35
+
36
+ // 激活事件:清理旧缓存
37
+ self.addEventListener('activate', (event) => {
38
+ console.log('[SW] Activating...');
39
+ event.waitUntil(
40
+ caches.keys().then((cacheNames) => {
41
+ return Promise.all(
42
+ cacheNames
43
+ .filter((name) => name !== STATIC_CACHE && name !== RUNTIME_CACHE)
44
+ .map((name) => {
45
+ console.log('[SW] Deleting old cache:', name);
46
+ return caches.delete(name);
47
+ })
48
+ );
49
+ }).then(() => self.clients.claim())
50
+ );
51
+ });
52
+
53
+ // fetch 事件:缓存策略
54
+ self.addEventListener('fetch', (event) => {
55
+ const { request } = event;
56
+ const url = new URL(request.url);
57
+
58
+ // 只缓存同源请求
59
+ if (url.origin !== self.location.origin) {
60
+ return;
61
+ }
62
+
63
+ // API 请求:网络优先,失败时回退到缓存
64
+ if (url.pathname.startsWith('/api/')) {
65
+ event.respondWith(
66
+ fetch(request)
67
+ .then((response) => {
68
+ // 缓存成功的 API 响应
69
+ if (response.status === 200) {
70
+ const clone = response.clone();
71
+ caches.open(RUNTIME_CACHE).then((cache) => cache.put(request, clone));
72
+ }
73
+ return response;
74
+ })
75
+ .catch(() => {
76
+ return caches.match(request).then((cached) => {
77
+ if (cached) return cached;
78
+ // 返回离线错误
79
+ return new Response(JSON.stringify({
80
+ ok: false,
81
+ error: '网络连接失败,显示离线数据',
82
+ offline: true,
83
+ }), {
84
+ status: 503,
85
+ headers: { 'Content-Type': 'application/json' },
86
+ });
87
+ });
88
+ })
89
+ );
90
+ return;
91
+ }
92
+
93
+ // 静态资源:缓存优先,失败时回退到网络
94
+ if (request.method === 'GET') {
95
+ event.respondWith(
96
+ caches.match(request).then((cached) => {
97
+ if (cached) return cached;
98
+ return fetch(request).then((response) => {
99
+ if (response.status === 200) {
100
+ const clone = response.clone();
101
+ caches.open(RUNTIME_CACHE).then((cache) => cache.put(request, clone));
102
+ }
103
+ return response;
104
+ }).catch(() => {
105
+ // 对于 HTML 请求,返回离线页面
106
+ if (request.headers.get('accept')?.includes('text/html')) {
107
+ return caches.match('/index.html');
108
+ }
109
+ return new Response('Offline', { status: 503 });
110
+ });
111
+ })
112
+ );
113
+ }
114
+ });
115
+
116
+ // 消息事件:支持手动更新缓存
117
+ self.addEventListener('message', (event) => {
118
+ const { type } = event.data || {};
119
+
120
+ if (type === 'SKIP_WAITING') {
121
+ self.skipWaiting();
122
+ }
123
+
124
+ if (type === 'CLEAR_CACHE') {
125
+ caches.keys().then((names) => {
126
+ names.forEach((name) => caches.delete(name));
127
+ });
128
+ }
129
+
130
+ if (type === 'GET_VERSION') {
131
+ event.source.postMessage({
132
+ type: 'VERSION',
133
+ version: CACHE_NAME,
134
+ staticCache: STATIC_CACHE,
135
+ runtimeCache: RUNTIME_CACHE,
136
+ });
137
+ }
138
+ });
139
+
140
+ // 推送通知(预留)
141
+ self.addEventListener('push', (event) => {
142
+ if (event.data) {
143
+ const data = event.data.json();
144
+ const title = data.title || '飞虹 Code';
145
+ const options = {
146
+ body: data.body || '',
147
+ icon: '/icons/icon-192.png',
148
+ badge: '/icons/icon-192.png',
149
+ data: data.data || {},
150
+ };
151
+ event.waitUntil(self.registration.showNotification(title, options));
152
+ }
153
+ });
154
+
155
+ // 通知点击
156
+ self.addEventListener('notificationclick', (event) => {
157
+ event.notification.close();
158
+ const url = event.notification.data?.url || '/';
159
+ event.waitUntil(
160
+ clients.openWindow(url).catch(() => {
161
+ return clients.matchAll({ type: 'window' }).then((clientList) => {
162
+ for (const client of clientList) {
163
+ if (client.url === url && 'focus' in client) {
164
+ return client.focus();
165
+ }
166
+ }
167
+ if (clients.openWindow) return clients.openWindow(url);
168
+ });
169
+ })
170
+ );
171
+ });
172
+
173
+ console.log('[SW] Service Worker loaded');