autosnippet 3.0.10 → 3.0.13

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 (56) hide show
  1. package/bin/cli.js +64 -1
  2. package/config/default.json +9 -0
  3. package/dashboard/dist/assets/{index-I2ySoCmF.js → index-Bnm26ulL.js} +47 -47
  4. package/dashboard/dist/index.html +1 -1
  5. package/lib/cli/SetupService.js +92 -5
  6. package/lib/cli/UpgradeService.js +14 -5
  7. package/lib/core/discovery/GenericDiscoverer.js +4 -28
  8. package/lib/external/mcp/handlers/bootstrap/base-dimensions.js +246 -0
  9. package/lib/external/mcp/handlers/bootstrap/pipeline/checkpoint.js +80 -0
  10. package/lib/external/mcp/handlers/bootstrap/pipeline/dimension-configs.js +275 -0
  11. package/lib/external/mcp/handlers/bootstrap/pipeline/noAiFallback.js +600 -0
  12. package/lib/external/mcp/handlers/bootstrap/pipeline/orchestrator.js +125 -342
  13. package/lib/external/mcp/handlers/bootstrap/refine.js +362 -0
  14. package/lib/external/mcp/handlers/bootstrap.js +6 -590
  15. package/lib/external/mcp/handlers/browse.js +119 -9
  16. package/lib/external/mcp/handlers/guard.js +25 -6
  17. package/lib/external/mcp/handlers/search.js +56 -24
  18. package/lib/http/routes/guardRules.js +9 -17
  19. package/lib/injection/ServiceContainer.js +12 -3
  20. package/lib/platform/ios/xcode/XcodeImportResolver.js +434 -0
  21. package/lib/platform/ios/xcode/XcodeIntegration.js +40 -659
  22. package/lib/platform/ios/xcode/XcodeWriteUtils.js +220 -0
  23. package/lib/service/chat/ChatAgent.js +39 -418
  24. package/lib/service/chat/ChatAgentPrompts.js +149 -0
  25. package/lib/service/chat/ChatAgentTasks.js +297 -0
  26. package/lib/service/chat/tools/_shared.js +61 -0
  27. package/lib/service/chat/tools/ai-analysis.js +284 -0
  28. package/lib/service/chat/tools/ast-graph.js +681 -0
  29. package/lib/service/chat/tools/composite.js +496 -0
  30. package/lib/service/chat/tools/guard.js +265 -0
  31. package/lib/service/chat/tools/index.js +250 -0
  32. package/lib/service/chat/tools/infrastructure.js +222 -0
  33. package/lib/service/chat/tools/knowledge-graph.js +234 -0
  34. package/lib/service/chat/tools/lifecycle.js +469 -0
  35. package/lib/service/chat/tools/project-access.js +923 -0
  36. package/lib/service/chat/tools/query.js +264 -0
  37. package/lib/service/chat/tools.js +14 -3994
  38. package/lib/service/cursor/AgentInstructionsGenerator.js +395 -0
  39. package/lib/service/cursor/CursorDeliveryPipeline.js +70 -11
  40. package/lib/service/cursor/FileProtection.js +116 -0
  41. package/lib/service/cursor/KnowledgeCompressor.js +61 -11
  42. package/lib/service/cursor/SkillsSyncer.js +5 -3
  43. package/lib/service/cursor/TopicClassifier.js +19 -3
  44. package/lib/service/guard/ExclusionManager.js +26 -2
  45. package/lib/service/guard/GuardCheckEngine.js +38 -370
  46. package/lib/service/guard/GuardCodeChecks.js +362 -0
  47. package/lib/service/guard/GuardCrossFileChecks.js +307 -0
  48. package/lib/service/guard/GuardPatternUtils.js +180 -0
  49. package/lib/service/guard/GuardService.js +80 -38
  50. package/lib/service/module/ModuleService.js +1 -0
  51. package/lib/service/search/SearchEngine.js +10 -2
  52. package/lib/service/wiki/WikiGenerator.js +226 -1532
  53. package/lib/service/wiki/WikiRenderers.js +1878 -0
  54. package/lib/service/wiki/WikiUtils.js +907 -0
  55. package/lib/shared/LanguageService.js +299 -0
  56. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -14,9 +14,10 @@
14
14
  * asd server - 启动 API 服务
15
15
  * asd status - 环境状态
16
16
  * asd ui - 启动 Dashboard UI
17
+ * asd mirror - 镜像 .cursor/ → .qoder/ .trae/
17
18
  */
18
19
 
19
- import { existsSync, readFileSync, readdirSync } from 'node:fs';
20
+ import { existsSync, readFileSync, readdirSync, copyFileSync, mkdirSync } from 'node:fs';
20
21
  import { dirname, join, resolve } from 'node:path';
21
22
  import { fileURLToPath } from 'node:url';
22
23
  import { Command } from 'commander';
@@ -854,6 +855,68 @@ program
854
855
  }
855
856
  });
856
857
 
858
+ // ─────────────────────────────────────────────────────
859
+ // mirror 命令
860
+ // ─────────────────────────────────────────────────────
861
+ program
862
+ .command('mirror')
863
+ .description('镜像 .cursor/ 交付物料到其他兼容 IDE 目录(Qoder / Trae)')
864
+ .option('-d, --dir <path>', '项目目录', '.')
865
+ .option('--target <ide>', '目标 IDE:qoder, trae, all(默认 all)', 'all')
866
+ .action(async (opts) => {
867
+ const projectRoot = resolve(opts.dir);
868
+ const targets = opts.target === 'all' ? ['.qoder', '.trae'] : [`.${opts.target}`];
869
+
870
+ const cursorDir = join(projectRoot, '.cursor');
871
+ if (!existsSync(cursorDir)) {
872
+ console.error('❌ 未找到 .cursor/ 目录,请先运行 asd setup 或 asd cursor-rules');
873
+ process.exit(1);
874
+ }
875
+
876
+ for (const target of targets) {
877
+ const cursorRulesDir = join(cursorDir, 'rules');
878
+ if (existsSync(cursorRulesDir)) {
879
+ const targetRulesDir = join(projectRoot, target, 'rules');
880
+ mkdirSync(targetRulesDir, { recursive: true });
881
+ const files = readdirSync(cursorRulesDir).filter(
882
+ (f) => f.startsWith('autosnippet-') && (f.endsWith('.mdc') || f.endsWith('.md'))
883
+ );
884
+ for (const file of files) {
885
+ const destName = file.endsWith('.mdc') ? file.replace(/\.mdc$/, '.md') : file;
886
+ copyFileSync(join(cursorRulesDir, file), join(targetRulesDir, destName));
887
+ }
888
+ console.log(` ✅ ${target}/rules/ — ${files.length} rules mirrored`);
889
+ }
890
+
891
+ const cursorSkillsDir = join(cursorDir, 'skills');
892
+ if (existsSync(cursorSkillsDir)) {
893
+ const targetSkillsDir = join(projectRoot, target, 'skills');
894
+ const skillDirs = readdirSync(cursorSkillsDir, { withFileTypes: true }).filter(
895
+ (d) => d.isDirectory() && d.name.startsWith('autosnippet-')
896
+ );
897
+ for (const dir of skillDirs) {
898
+ _copyDirRecursive(join(cursorSkillsDir, dir.name), join(targetSkillsDir, dir.name));
899
+ }
900
+ console.log(` ✅ ${target}/skills/ — ${skillDirs.length} skills mirrored`);
901
+ }
902
+ }
903
+ console.log('\n 💡 完成!如有新增交付物料,可随时重新运行 asd mirror');
904
+ });
905
+
906
+ /** @private 递归复制目录(mirror 命令用) */
907
+ function _copyDirRecursive(src, dest) {
908
+ mkdirSync(dest, { recursive: true });
909
+ for (const entry of readdirSync(src, { withFileTypes: true })) {
910
+ const srcPath = join(src, entry.name);
911
+ const destPath = join(dest, entry.name);
912
+ if (entry.isDirectory()) {
913
+ _copyDirRecursive(srcPath, destPath);
914
+ } else {
915
+ copyFileSync(srcPath, destPath);
916
+ }
917
+ }
918
+ }
919
+
857
920
  // ─────────────────────────────────────────────────────
858
921
  // sync 命令
859
922
  // ─────────────────────────────────────────────────────
@@ -52,5 +52,14 @@
52
52
  "maxErrors": 0,
53
53
  "maxWarnings": 20,
54
54
  "minScore": 70
55
+ },
56
+ "guard": {
57
+ "disabledRules": [],
58
+ "codeLevelThresholds": {
59
+ "swift-excessive-force-unwrap": 5,
60
+ "rust-excessive-unwrap": 3,
61
+ "rust-excessive-unsafe": 3,
62
+ "dart-excessive-late": 3
63
+ }
55
64
  }
56
65
  }