agentsys 5.6.4 → 5.7.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 (39) hide show
  1. package/.claude-plugin/marketplace.json +6 -17
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.kiro/agents/exploration-agent.json +1 -1
  4. package/.kiro/agents/implementation-agent.json +1 -1
  5. package/.kiro/agents/map-validator.json +2 -2
  6. package/.kiro/agents/perf-orchestrator.json +1 -1
  7. package/.kiro/agents/planning-agent.json +1 -1
  8. package/.kiro/skills/perf-code-paths/SKILL.md +1 -1
  9. package/.kiro/skills/perf-theory-gatherer/SKILL.md +1 -1
  10. package/.kiro/skills/repo-intel/SKILL.md +63 -0
  11. package/AGENTS.md +3 -3
  12. package/CHANGELOG.md +20 -0
  13. package/README.md +85 -87
  14. package/lib/binary/version.js +1 -1
  15. package/lib/repo-map/converter.js +130 -0
  16. package/lib/repo-map/index.js +117 -74
  17. package/lib/repo-map/installer.js +38 -172
  18. package/lib/repo-map/updater.js +16 -474
  19. package/meta/skills/maintain-cross-platform/SKILL.md +5 -5
  20. package/package.json +3 -3
  21. package/scripts/fix-graduated-repos.js +2 -2
  22. package/scripts/generate-docs.js +10 -13
  23. package/scripts/graduate-plugin.js +1 -1
  24. package/scripts/preflight.js +4 -4
  25. package/scripts/validate-cross-platform-docs.js +2 -2
  26. package/site/content.json +12 -19
  27. package/site/index.html +44 -12
  28. package/site/ux-spec.md +1 -1
  29. package/.kiro/skills/repo-mapping/SKILL.md +0 -83
  30. package/lib/repo-map/concurrency.js +0 -29
  31. package/lib/repo-map/queries/go.js +0 -27
  32. package/lib/repo-map/queries/index.js +0 -100
  33. package/lib/repo-map/queries/java.js +0 -38
  34. package/lib/repo-map/queries/javascript.js +0 -55
  35. package/lib/repo-map/queries/python.js +0 -24
  36. package/lib/repo-map/queries/rust.js +0 -73
  37. package/lib/repo-map/queries/typescript.js +0 -38
  38. package/lib/repo-map/runner.js +0 -1364
  39. package/lib/repo-map/usage-analyzer.js +0 -407
package/README.md CHANGED
@@ -19,7 +19,7 @@
19
19
  </p>
20
20
 
21
21
  <p align="center">
22
- <b>19 plugins · 38 agents · 39 skills (across all repos) · 30k lines of lib code · 3,575 tests · 5 platforms</b><br>
22
+ <b>19 plugins · 47 agents · 39 skills (across all repos) · 30k lines of lib code · 3,583 tests · 5 platforms</b><br>
23
23
  <em>Plugins distributed as standalone repos under <a href="https://github.com/agent-sh">agent-sh</a> org — agentsys is the marketplace &amp; installer</em>
24
24
  </p>
25
25
 
@@ -45,7 +45,7 @@ AI models can write code. That's not the hard part anymore. The hard part is eve
45
45
 
46
46
  ## What This Is
47
47
 
48
- An agent orchestration system — 19 plugins, 38 agents, and 39 skills that compose into structured pipelines for software development. Each plugin lives in its own standalone repo under the [agent-sh](https://github.com/agent-sh) org. agentsys is the marketplace and installer that ties them together.
48
+ An agent orchestration system — 19 plugins, 47 agents, and 39 skills that compose into structured pipelines for software development. Each plugin lives in its own standalone repo under the [agent-sh](https://github.com/agent-sh) org. agentsys is the marketplace and installer that ties them together.
49
49
 
50
50
  Each agent has a single responsibility, a specific model assignment, and defined inputs/outputs. Pipelines enforce phase gates so agents can't skip steps. State persists across sessions so work survives interruptions.
51
51
 
@@ -73,9 +73,46 @@ This came from testing on 1,000+ repositories.
73
73
 
74
74
  ---
75
75
 
76
+ ## Benchmarks
77
+
78
+ Structured prompts and enriched context do more for output quality than model tier. Benchmarked March 2026 on real tasks (`/can-i-help` and `/onboard` against [glide-mq](https://github.com/avifenesh/glide-mq)), measured with `claude -p --output-format json`. Models: Claude Opus 4 and Claude Sonnet 4.
79
+
80
+ ### Sonnet + AgentSys vs raw Opus
81
+
82
+ Same task, same repo, same prompt ("I want to improve docs"):
83
+
84
+ | Configuration | Cost | Output tokens | Result quality |
85
+ |---------------|------|---------------|----------------|
86
+ | Opus, no agentsys | $1.10 | 2,841 | Generic recommendations, no project-specific context |
87
+ | Opus + agentsys | $1.95 | 5,879 | Specific recommendations with effort estimates, convention awareness, breaking change detection |
88
+ | **Sonnet + agentsys** | **$0.66** | **6,084** | **Comparable to Opus + agentsys: specific, actionable, project-aware** |
89
+
90
+ Sonnet + agentsys produced more output with higher specificity than raw Opus - at 40% lower cost.
91
+
92
+ ### With agentsys, model tier matters less
93
+
94
+ Once the pipeline provides structured prompts, enriched repo-intel data, and phase-gated workflows, the model does less heavy lifting. The gap between Sonnet and Opus narrows:
95
+
96
+ | Plugin | Opus | Sonnet | Savings |
97
+ |--------|------|--------|---------|
98
+ | /onboard | $1.10 | $0.30 | 73% |
99
+ | /can-i-help | $1.34 | $0.23 | 83% |
100
+
101
+ Both models reached the same outcome quality - Sonnet just costs less to get there. The structured pipeline captures most of the gains that would otherwise require a more expensive model.
102
+
103
+ ### What this means
104
+
105
+ | Scenario | Model cost | Quality |
106
+ |----------|-----------|---------|
107
+ | Without agentsys | Need Opus for good results | Depends on model capability |
108
+ | **With agentsys** | **Sonnet is sufficient** | **Pipeline handles the structure, model handles judgment** |
109
+
110
+ The investment shifts from model spend to pipeline design. Better prompts, richer context, enforced phases - these compound in ways that model upgrades alone don't.
111
+
112
+ ---
113
+
76
114
  ## Commands
77
115
 
78
- <!-- GEN:START:readme-commands -->
79
116
  | Command | What it does |
80
117
  |---------|--------------|
81
118
  | [`/next-task`](#next-task) | Task workflow: discovery, implementation, PR, merge |
@@ -86,7 +123,7 @@ This came from testing on 1,000+ repositories.
86
123
  | [`/drift-detect`](#drift-detect) | Compare plan vs implementation |
87
124
  | [`/audit-project`](#audit-project) | Multi-agent iterative code review |
88
125
  | [`/enhance`](#enhance) | Plugin, agent, and prompt analyzers |
89
- | [`/repo-map`](#repo-map) | AST-based repository map |
126
+ | [`/repo-intel`](#repo-intel) | Unified static analysis - git history, AST symbols, project metadata |
90
127
  | [`/sync-docs`](#sync-docs) | Sync documentation with code changes |
91
128
  | [`/learn`](#learn) | Research topics, create learning guides |
92
129
  | [`/consult`](#consult) | Cross-tool AI consultation |
@@ -94,10 +131,8 @@ This came from testing on 1,000+ repositories.
94
131
  | [`/web-ctl`](#web-ctl) | Browser automation for AI agents |
95
132
  | [`/release`](#release) | Versioned release with ecosystem detection |
96
133
  | [`/skillers`](#skillers) | Workflow pattern learning and automation |
97
- | [`/git-map`](#git-map) | Git history analysis: hotspots, coupling, ownership, bus factor |
98
134
  | [`/onboard`](#onboard) | Codebase orientation for newcomers |
99
135
  | [`/can-i-help`](#can-i-help) | Match contributor skills to project needs |
100
- <!-- GEN:END:readme-commands -->
101
136
 
102
137
  Each command works standalone. Together, they compose into end-to-end pipelines.
103
138
 
@@ -105,12 +140,12 @@ Each command works standalone. Together, they compose into end-to-end pipelines.
105
140
 
106
141
  ## Skills
107
142
 
108
- <!-- GEN:START:readme-skills -->
109
- 39 skills included across the plugins:
143
+ 38 skills included across the plugins:
110
144
 
111
145
  | Category | Skills |
112
146
  |----------|--------|
113
147
  | **Workflow** | `discover-tasks`, `orchestrate-review`, `validate-delivery` |
148
+ | **Message Queues** | `glide-mq-migrate-bee`, `glide-mq-migrate-bullmq`, `glide-mq` |
114
149
  | **Enhancement** | `enhance-agent-prompts`, `enhance-claude-memory`, `enhance-cross-file`, `enhance-docs`, `enhance-hooks`, `enhance-orchestrator`, `enhance-plugins`, `enhance-prompts`, `enhance-skills` |
115
150
  | **Performance** | `baseline`, `benchmark`, `code-paths`, `investigation-logger`, `perf-analyzer`, `profile`, `theory-gatherer`, `theory-tester` |
116
151
  | **Cleanup** | `deslop`, `sync-docs` |
@@ -119,9 +154,7 @@ Each command works standalone. Together, they compose into end-to-end pipelines.
119
154
  | **Onboarding** | `can-i-help`, `onboard` |
120
155
  | **Web** | `web-auth`, `web-browse` |
121
156
  | **Release** | `release` |
122
- | **Analysis** | `drift-analysis`, `git-mapping`, `repo-mapping` |
123
- | **Other** | `glide-mq-migrate-bee`, `glide-mq-migrate-bullmq`, `glide-mq` |
124
- <!-- GEN:END:readme-skills -->
157
+ | **Analysis** | `drift-analysis`, `repo-intel` |
125
158
 
126
159
  **External skill plugins** (standalone repos, installed separately):
127
160
 
@@ -138,8 +171,10 @@ Skills are the reusable implementation units. Agents invoke skills; commands orc
138
171
  | Section | What's there |
139
172
  |---------|--------------|
140
173
  | [The Approach](#the-approach) | Why it's built this way |
174
+ | [Benchmarks](#benchmarks) | Sonnet + agentsys vs raw Opus |
141
175
  | [Commands](#commands) | All 19 commands overview |
142
176
  | [Skills](#skills) | 39 skills across plugins |
177
+ | [Skill-Only Plugins](#skill-only-plugins) | glide-mq and other non-command plugins |
143
178
  | [Command Details](#command-details) | Deep dive into each command |
144
179
  | [How Commands Work Together](#how-commands-work-together) | Standalone vs integrated |
145
180
  | [Design Philosophy](#design-philosophy) | The thinking behind the architecture |
@@ -149,6 +184,26 @@ Skills are the reusable implementation units. Agents invoke skills; commands orc
149
184
 
150
185
  ---
151
186
 
187
+ ## Skill-Only Plugins
188
+
189
+ Plugins that provide skills without a `/` command. Installed alongside agentsys; skills become available to all agents.
190
+
191
+ ### glide-mq
192
+
193
+ Build message queues, background jobs, and workflow orchestration with [glide-mq](https://github.com/avifenesh/glide-mq) - high-performance Node.js queue on Valkey/Redis.
194
+
195
+ | Skill | What it does |
196
+ |-------|--------------|
197
+ | `glide-mq` | Greenfield queue development - queues, workers, ordering, rate limiting, flows, broadcast, step jobs |
198
+ | `glide-mq-migrate-bullmq` | Migrate from BullMQ to glide-mq - API mapping, breaking changes, feature comparison |
199
+ | `glide-mq-migrate-bee` | Migrate from Bee-Queue to glide-mq - API mapping, pattern conversion |
200
+
201
+ Key features: per-key ordering, group concurrency, runtime group rate limiting (`job.rateLimitGroup()`), token bucket, DAG workflows, broadcast pub/sub, step jobs, deduplication, serverless producers.
202
+
203
+ [Skill plugin →](https://github.com/agent-sh/glidemq) | [glide-mq docs →](https://avifenesh.github.io/glide-mq.dev/) | [npm →](https://www.npmjs.com/package/glide-mq)
204
+
205
+ ---
206
+
152
207
  ## Command Details
153
208
 
154
209
  ### /next-task
@@ -399,7 +454,7 @@ Three phases run in sequence:
399
454
  3. **Breaking Point** - Binary search to find failure threshold
400
455
  4. **Constraints** - CPU/memory limits, measure delta vs baseline
401
456
  5. **Hypotheses** - Generate up to 5 hypotheses with evidence and confidence
402
- 6. **Code Paths** - Use repo-map to identify entrypoints and hot files
457
+ 6. **Code Paths** - Use repo-intel to identify entrypoints and hot files
403
458
  7. **Profiling** - Language-specific tools (--cpu-prof, JFR, cProfile, pprof)
404
459
  8. **Optimization** - One change per experiment, 2+ validation passes
405
460
  9. **Decision** - Continue or stop based on measurable improvement
@@ -546,30 +601,33 @@ Findings are collected and categorized by severity (critical/high/medium/low). A
546
601
 
547
602
  ---
548
603
 
549
- ### /repo-map
604
+ ### /repo-intel
550
605
 
551
- **Purpose:** Builds an AST-based map of symbols and imports for fast repo analysis.
606
+ **Purpose:** Unified static analysis - git history, AST symbols, and project metadata in one plugin.
552
607
 
553
- **What it generates:**
608
+ **What it provides:**
554
609
 
555
- - Cached file→symbols map (exports, functions, classes)
556
- - Import graph for dependency hints
610
+ - Git history intelligence: hotspots, coupling, ownership, bus factor, bugspots, AI detection
611
+ - AST symbol mapping: exports, functions, classes, imports
612
+ - Project metadata and health metrics
557
613
 
558
- Output is cached at `{state-dir}/repo-map.json` and exposed via the MCP `repo_map` tool.
614
+ Output is cached at `{state-dir}/repo-intel.json` and `{state-dir}/repo-map.json`.
559
615
 
560
616
  **Why it matters:**
561
617
 
562
- Tools like `/drift-detect` and planners can use the map instead of re-scanning the repo every time.
618
+ Tools like `/drift-detect`, `/onboard`, `/can-i-help`, and planners consume this data instead of re-scanning the repo every time. 9 plugins use repo-intel data automatically.
563
619
 
564
620
  **Usage:**
565
621
 
566
622
  ```bash
567
- /repo-map init # First-time map generation
568
- /repo-map update # Incremental update
569
- /repo-map status # Check freshness
623
+ /repo-intel init # First-time scan
624
+ /repo-intel update # Incremental update
625
+ /repo-intel query hotspots # Most active files
626
+ /repo-intel query ownership src/ # Who owns a path
627
+ /repo-intel query bus-factor # Knowledge risk
570
628
  ```
571
629
 
572
- **Required:** ast-grep (`sg`) must be installed.
630
+ Backed by [agent-analyzer](https://github.com/agent-sh/agent-analyzer) Rust binary.
573
631
 
574
632
  ---
575
633
 
@@ -848,44 +906,6 @@ No per-turn overhead - it reads transcripts that Claude Code already saves.
848
906
 
849
907
  ---
850
908
 
851
- ### /git-map
852
-
853
- **Purpose:** Analyze git history to surface hotspots, coupling, ownership, bus factor, bugspots, area health, and AI attribution.
854
-
855
- **How it works:**
856
-
857
- The plugin wraps the [agent-analyzer](https://github.com/agent-sh/agent-analyzer) Rust binary. Run `init` once to scan git history and cache the result as `repo-intel.json`. Then run queries instantly.
858
-
859
- **20 query types:**
860
-
861
- | Category | Queries |
862
- |----------|---------|
863
- | Activity | `hotspots`, `coldspots`, `file-history` |
864
- | Quality | `bugspots`, `test-gaps`, `diff-risk` |
865
- | People | `ownership`, `contributors`, `bus-factor` |
866
- | Coupling | `coupling` |
867
- | Standards | `norms`, `conventions` |
868
- | Health | `areas`, `health`, `release-info` |
869
- | AI | `ai-ratio`, `recent-ai` |
870
- | Guidance | `onboard`, `can-i-help` |
871
- | Docs | `doc-drift` |
872
-
873
- **9 plugins consume git-map data automatically** - deslop, sync-docs, drift-detect, audit-project, next-task, enhance, ship, onboard, can-i-help.
874
-
875
- **Usage:**
876
-
877
- ```bash
878
- /git-map init # First-time scan
879
- /git-map update # Add new commits
880
- /git-map query hotspots # Most active files
881
- /git-map query ownership src/ # Who owns a path
882
- /git-map query bus-factor # Knowledge risk
883
- ```
884
-
885
- [Full query reference →](https://github.com/agent-sh/git-map)
886
-
887
- ---
888
-
889
909
  ### /onboard
890
910
 
891
911
  **Purpose:** Get oriented in any codebase in under 3 minutes.
@@ -904,7 +924,7 @@ The plugin wraps the [agent-analyzer](https://github.com/agent-sh/agent-analyzer
904
924
  |-------|------|------|
905
925
  | quick | ~2s | Manifest + README + structure |
906
926
  | normal | ~5s | + CLAUDE.md/AGENTS.md + CI + repo-intel |
907
- | deep | ~15s | + repo-map AST symbols |
927
+ | deep | ~15s | + repo-intel AST symbols |
908
928
 
909
929
  **Supported manifests:** package.json, Cargo.toml, go.mod, pyproject.toml, deno.json, CMakeLists.txt, meson.build, setup.py, pom.xml, build.gradle. Detects monorepos (npm/pnpm/lerna/Cargo workspaces, Python libs/, Deno workspaces).
910
930
 
@@ -956,28 +976,6 @@ The plugin wraps the [agent-analyzer](https://github.com/agent-sh/agent-analyzer
956
976
 
957
977
  ---
958
978
 
959
- ## Skill-Only Plugins
960
-
961
- Plugins that provide skills without a `/` command. Installed alongside agentsys; skills become available to all agents.
962
-
963
- ### glide-mq
964
-
965
- **Purpose:** Build message queues, background jobs, and workflow orchestration with [glide-mq](https://github.com/avifenesh/glide-mq) - high-performance Node.js queue on Valkey/Redis.
966
-
967
- **Skills:**
968
-
969
- | Skill | What it does |
970
- |-------|--------------|
971
- | `glide-mq` | Greenfield queue development - queues, workers, ordering, rate limiting, flows, broadcast, step jobs |
972
- | `glide-mq-migrate-bullmq` | Migrate from BullMQ to glide-mq - API mapping, breaking changes, feature comparison |
973
- | `glide-mq-migrate-bee` | Migrate from Bee-Queue to glide-mq - API mapping, pattern conversion |
974
-
975
- **Key features covered:** per-key ordering, group concurrency, runtime group rate limiting (`job.rateLimitGroup()`), token bucket, DAG workflows, broadcast pub/sub, step jobs, deduplication, serverless producers.
976
-
977
- [Full documentation →](https://github.com/agent-sh/glidemq) | [glide-mq docs →](https://avifenesh.github.io/glide-mq.dev/)
978
-
979
- ---
980
-
981
979
  ## How Commands Work Together
982
980
 
983
981
  **Standalone use:**
@@ -1154,8 +1152,8 @@ agentsys --development # Dev mode (bypasses marketplace)
1154
1152
  **For GitLab workflows:**
1155
1153
  - GitLab CLI (`glab`) authenticated
1156
1154
 
1157
- **For /repo-map:**
1158
- - ast-grep (`sg`) installed
1155
+ **For /repo-intel:**
1156
+ - agent-analyzer (installed automatically via npm)
1159
1157
 
1160
1158
  **For /agnix:**
1161
1159
  - [agnix CLI](https://github.com/agent-sh/agnix) installed (`npm install -g agnix`, `cargo install agnix-cli`, or `brew install agnix`)
@@ -1181,7 +1179,7 @@ The system is built on research, not guesswork.
1181
1179
  - Instruction following reliability
1182
1180
 
1183
1181
  **Testing:**
1184
- - 3,575 tests passing
1182
+ - 3,583 tests passing
1185
1183
  - Drift-detect validated on 1,000+ repositories
1186
1184
  - E2E workflow testing across all commands
1187
1185
  - Cross-platform validation (Claude Code, OpenCode, Codex CLI, Cursor, Kiro)
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  // Minimum binary version required by this version of agent-core
4
- const ANALYZER_MIN_VERSION = '0.1.0';
4
+ const ANALYZER_MIN_VERSION = '0.3.0';
5
5
 
6
6
  // Binary name
7
7
  const BINARY_NAME = 'agent-analyzer';
@@ -0,0 +1,130 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * Convert agent-analyzer repo-intel.json format to repo-map.json format.
5
+ *
6
+ * agent-analyzer outputs: { symbols: { [filePath]: { exports, imports, definitions } } }
7
+ * repo-map expects: { files: { [filePath]: { language, symbols, imports } } }
8
+ *
9
+ * @module lib/repo-map/converter
10
+ */
11
+
12
+ const path = require('path');
13
+
14
+ const LANGUAGE_BY_EXTENSION = {
15
+ '.js': 'javascript', '.jsx': 'javascript', '.mjs': 'javascript', '.cjs': 'javascript',
16
+ '.ts': 'typescript', '.tsx': 'typescript', '.mts': 'typescript', '.cts': 'typescript',
17
+ '.py': 'python', '.pyw': 'python',
18
+ '.rs': 'rust',
19
+ '.go': 'go',
20
+ '.java': 'java'
21
+ };
22
+
23
+ // SymbolKind values from agent-analyzer (kebab-case serialized)
24
+ const CLASS_KINDS = new Set(['class', 'struct', 'interface', 'enum', 'impl']);
25
+ const TYPE_KINDS = new Set(['trait', 'type-alias']);
26
+ const FUNCTION_LIKE_KINDS = new Set(['method', 'arrow', 'closure']);
27
+ const CONSTANT_KINDS = new Set(['constant', 'variable', 'const', 'field', 'property']);
28
+
29
+ function detectLanguage(filePath) {
30
+ return LANGUAGE_BY_EXTENSION[path.extname(filePath).toLowerCase()] || 'unknown';
31
+ }
32
+
33
+ function detectLanguagesFromFiles(filePaths) {
34
+ const langs = new Set();
35
+ for (const fp of filePaths) {
36
+ const lang = detectLanguage(fp);
37
+ if (lang !== 'unknown') langs.add(lang);
38
+ }
39
+ return Array.from(langs);
40
+ }
41
+
42
+ /**
43
+ * Convert a single file's symbols from repo-intel format to repo-map format.
44
+ * @param {string} filePath
45
+ * @param {Object} fileSym - { exports, imports, definitions }
46
+ * @returns {Object} repo-map file entry
47
+ */
48
+ function convertFile(filePath, fileSym) {
49
+ const exportNames = new Set((fileSym.exports || []).map(e => e.name));
50
+
51
+ const exports = (fileSym.exports || []).map(e => ({
52
+ name: e.name,
53
+ kind: e.kind,
54
+ line: e.line
55
+ }));
56
+
57
+ const functions = [];
58
+ const classes = [];
59
+ const types = [];
60
+ const constants = [];
61
+
62
+ for (const def of fileSym.definitions || []) {
63
+ const entry = {
64
+ name: def.name,
65
+ kind: def.kind,
66
+ line: def.line,
67
+ exported: exportNames.has(def.name)
68
+ };
69
+ if (def.kind === 'function' || FUNCTION_LIKE_KINDS.has(def.kind)) {
70
+ functions.push(entry);
71
+ } else if (CLASS_KINDS.has(def.kind)) {
72
+ classes.push(entry);
73
+ } else if (TYPE_KINDS.has(def.kind)) {
74
+ types.push(entry);
75
+ } else if (CONSTANT_KINDS.has(def.kind)) {
76
+ constants.push(entry);
77
+ } else {
78
+ // Unknown kind - default to constants for backward compat
79
+ constants.push(entry);
80
+ }
81
+ }
82
+
83
+ // agent-analyzer imports: [{ from, names }] → repo-map imports: [{ source, kind, names }]
84
+ const imports = (fileSym.imports || []).map(imp => ({
85
+ source: imp.from,
86
+ kind: 'import',
87
+ names: imp.names || []
88
+ }));
89
+
90
+ return {
91
+ language: detectLanguage(filePath),
92
+ symbols: { exports, functions, classes, types, constants },
93
+ imports
94
+ };
95
+ }
96
+
97
+ /**
98
+ * Convert a full repo-intel data object to repo-map format.
99
+ * @param {Object} intel - RepoIntelData from agent-analyzer
100
+ * @returns {Object} repo-map.json compatible object
101
+ */
102
+ function convertIntelToRepoMap(intel) {
103
+ const files = {};
104
+ let totalSymbols = 0;
105
+ let totalImports = 0;
106
+
107
+ for (const [filePath, fileSym] of Object.entries(intel.symbols || {})) {
108
+ files[filePath] = convertFile(filePath, fileSym);
109
+ const s = files[filePath].symbols;
110
+ totalSymbols += s.functions.length + s.classes.length +
111
+ s.types.length + s.constants.length;
112
+ totalImports += files[filePath].imports.length;
113
+ }
114
+
115
+ return {
116
+ version: '2.0',
117
+ generated: intel.generated || new Date().toISOString(),
118
+ git: intel.git ? { commit: intel.git.analyzedUpTo } : undefined,
119
+ project: { languages: detectLanguagesFromFiles(Object.keys(files)) },
120
+ stats: {
121
+ totalFiles: Object.keys(files).length,
122
+ totalSymbols,
123
+ totalImports,
124
+ errors: []
125
+ },
126
+ files
127
+ };
128
+ }
129
+
130
+ module.exports = { convertIntelToRepoMap, convertFile, detectLanguage };