@vyuhlabs/dxkit 1.6.1 → 2.0.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 (210) hide show
  1. package/CHANGELOG.md +93 -0
  2. package/README.md +3 -3
  3. package/dist/agents/extract.d.ts +25 -0
  4. package/dist/agents/extract.d.ts.map +1 -0
  5. package/dist/agents/extract.js +186 -0
  6. package/dist/agents/extract.js.map +1 -0
  7. package/dist/agents/schemas.d.ts +106 -0
  8. package/dist/agents/schemas.d.ts.map +1 -0
  9. package/dist/agents/schemas.js +86 -0
  10. package/dist/agents/schemas.js.map +1 -0
  11. package/dist/agents/session.d.ts +28 -0
  12. package/dist/agents/session.d.ts.map +1 -0
  13. package/dist/agents/session.js +223 -0
  14. package/dist/agents/session.js.map +1 -0
  15. package/dist/analyzers/developer/detailed.js +1 -1
  16. package/dist/analyzers/developer/detailed.js.map +1 -1
  17. package/dist/analyzers/dispatcher.d.ts +36 -0
  18. package/dist/analyzers/dispatcher.d.ts.map +1 -0
  19. package/dist/analyzers/dispatcher.js +62 -0
  20. package/dist/analyzers/dispatcher.js.map +1 -0
  21. package/dist/analyzers/docs/shallow.d.ts +3 -2
  22. package/dist/analyzers/docs/shallow.d.ts.map +1 -1
  23. package/dist/analyzers/docs/shallow.js +2 -2
  24. package/dist/analyzers/docs/shallow.js.map +1 -1
  25. package/dist/analyzers/dx/shallow.d.ts +3 -2
  26. package/dist/analyzers/dx/shallow.d.ts.map +1 -1
  27. package/dist/analyzers/dx/shallow.js +2 -2
  28. package/dist/analyzers/dx/shallow.js.map +1 -1
  29. package/dist/analyzers/health/actions.d.ts +3 -3
  30. package/dist/analyzers/health/actions.d.ts.map +1 -1
  31. package/dist/analyzers/health/actions.js +99 -52
  32. package/dist/analyzers/health/actions.js.map +1 -1
  33. package/dist/analyzers/health/detailed.d.ts.map +1 -1
  34. package/dist/analyzers/health/detailed.js +6 -2
  35. package/dist/analyzers/health/detailed.js.map +1 -1
  36. package/dist/analyzers/health.d.ts +0 -2
  37. package/dist/analyzers/health.d.ts.map +1 -1
  38. package/dist/analyzers/health.js +123 -72
  39. package/dist/analyzers/health.js.map +1 -1
  40. package/dist/analyzers/maintainability/shallow.d.ts +3 -2
  41. package/dist/analyzers/maintainability/shallow.d.ts.map +1 -1
  42. package/dist/analyzers/maintainability/shallow.js +2 -2
  43. package/dist/analyzers/maintainability/shallow.js.map +1 -1
  44. package/dist/analyzers/quality/detailed.js +1 -1
  45. package/dist/analyzers/quality/detailed.js.map +1 -1
  46. package/dist/analyzers/quality/gather.d.ts +33 -4
  47. package/dist/analyzers/quality/gather.d.ts.map +1 -1
  48. package/dist/analyzers/quality/gather.js +81 -93
  49. package/dist/analyzers/quality/gather.js.map +1 -1
  50. package/dist/analyzers/quality/index.js +4 -4
  51. package/dist/analyzers/quality/index.js.map +1 -1
  52. package/dist/analyzers/quality/shallow.d.ts +3 -2
  53. package/dist/analyzers/quality/shallow.d.ts.map +1 -1
  54. package/dist/analyzers/quality/shallow.js +2 -2
  55. package/dist/analyzers/quality/shallow.js.map +1 -1
  56. package/dist/analyzers/scoring.d.ts +26 -9
  57. package/dist/analyzers/scoring.d.ts.map +1 -1
  58. package/dist/analyzers/scoring.js +83 -71
  59. package/dist/analyzers/scoring.js.map +1 -1
  60. package/dist/analyzers/security/detailed.js +1 -1
  61. package/dist/analyzers/security/detailed.js.map +1 -1
  62. package/dist/analyzers/security/gather.d.ts +28 -5
  63. package/dist/analyzers/security/gather.d.ts.map +1 -1
  64. package/dist/analyzers/security/gather.js +87 -135
  65. package/dist/analyzers/security/gather.js.map +1 -1
  66. package/dist/analyzers/security/index.d.ts +1 -1
  67. package/dist/analyzers/security/index.d.ts.map +1 -1
  68. package/dist/analyzers/security/index.js +16 -11
  69. package/dist/analyzers/security/index.js.map +1 -1
  70. package/dist/analyzers/security/report.d.ts +6 -0
  71. package/dist/analyzers/security/report.d.ts.map +1 -0
  72. package/dist/analyzers/security/report.js +118 -0
  73. package/dist/analyzers/security/report.js.map +1 -0
  74. package/dist/analyzers/security/shallow.d.ts +3 -2
  75. package/dist/analyzers/security/shallow.d.ts.map +1 -1
  76. package/dist/analyzers/security/shallow.js +2 -2
  77. package/dist/analyzers/security/shallow.js.map +1 -1
  78. package/dist/analyzers/tests/detailed.js +1 -1
  79. package/dist/analyzers/tests/detailed.js.map +1 -1
  80. package/dist/analyzers/tests/import-graph.d.ts +8 -22
  81. package/dist/analyzers/tests/import-graph.d.ts.map +1 -1
  82. package/dist/analyzers/tests/import-graph.js +22 -189
  83. package/dist/analyzers/tests/import-graph.js.map +1 -1
  84. package/dist/analyzers/tests/index.d.ts +1 -1
  85. package/dist/analyzers/tests/index.d.ts.map +1 -1
  86. package/dist/analyzers/tests/index.js +3 -3
  87. package/dist/analyzers/tests/index.js.map +1 -1
  88. package/dist/analyzers/tests/shallow.d.ts +3 -2
  89. package/dist/analyzers/tests/shallow.d.ts.map +1 -1
  90. package/dist/analyzers/tests/shallow.js +2 -2
  91. package/dist/analyzers/tests/shallow.js.map +1 -1
  92. package/dist/analyzers/tools/coverage.d.ts +21 -11
  93. package/dist/analyzers/tools/coverage.d.ts.map +1 -1
  94. package/dist/analyzers/tools/coverage.js +32 -44
  95. package/dist/analyzers/tools/coverage.js.map +1 -1
  96. package/dist/analyzers/tools/dotnet.d.ts +8 -0
  97. package/dist/analyzers/tools/dotnet.d.ts.map +1 -0
  98. package/dist/analyzers/tools/dotnet.js +81 -0
  99. package/dist/analyzers/tools/dotnet.js.map +1 -0
  100. package/dist/analyzers/tools/gather-cache.d.ts +16 -0
  101. package/dist/analyzers/tools/gather-cache.d.ts.map +1 -0
  102. package/dist/analyzers/tools/gather-cache.js +126 -0
  103. package/dist/analyzers/tools/gather-cache.js.map +1 -0
  104. package/dist/analyzers/tools/generic.d.ts.map +1 -1
  105. package/dist/analyzers/tools/generic.js +6 -28
  106. package/dist/analyzers/tools/generic.js.map +1 -1
  107. package/dist/analyzers/tools/gitleaks.d.ts +28 -5
  108. package/dist/analyzers/tools/gitleaks.d.ts.map +1 -1
  109. package/dist/analyzers/tools/gitleaks.js +91 -37
  110. package/dist/analyzers/tools/gitleaks.js.map +1 -1
  111. package/dist/analyzers/tools/go.d.ts +8 -0
  112. package/dist/analyzers/tools/go.d.ts.map +1 -0
  113. package/dist/analyzers/tools/go.js +84 -0
  114. package/dist/analyzers/tools/go.js.map +1 -0
  115. package/dist/analyzers/tools/graphify.d.ts +31 -3
  116. package/dist/analyzers/tools/graphify.d.ts.map +1 -1
  117. package/dist/analyzers/tools/graphify.js +78 -36
  118. package/dist/analyzers/tools/graphify.js.map +1 -1
  119. package/dist/analyzers/tools/grep-secrets.d.ts +6 -0
  120. package/dist/analyzers/tools/grep-secrets.d.ts.map +1 -0
  121. package/dist/analyzers/tools/grep-secrets.js +124 -0
  122. package/dist/analyzers/tools/grep-secrets.js.map +1 -0
  123. package/dist/analyzers/tools/jscpd.d.ts +40 -0
  124. package/dist/analyzers/tools/jscpd.d.ts.map +1 -0
  125. package/dist/analyzers/tools/jscpd.js +96 -0
  126. package/dist/analyzers/tools/jscpd.js.map +1 -0
  127. package/dist/analyzers/tools/node.d.ts +8 -0
  128. package/dist/analyzers/tools/node.d.ts.map +1 -0
  129. package/dist/analyzers/tools/node.js +160 -0
  130. package/dist/analyzers/tools/node.js.map +1 -0
  131. package/dist/analyzers/tools/package-json.d.ts +6 -0
  132. package/dist/analyzers/tools/package-json.d.ts.map +1 -0
  133. package/dist/analyzers/tools/package-json.js +67 -0
  134. package/dist/analyzers/tools/package-json.js.map +1 -0
  135. package/dist/analyzers/tools/parallel.d.ts +22 -5
  136. package/dist/analyzers/tools/parallel.d.ts.map +1 -1
  137. package/dist/analyzers/tools/parallel.js +26 -185
  138. package/dist/analyzers/tools/parallel.js.map +1 -1
  139. package/dist/analyzers/tools/paths.d.ts +21 -0
  140. package/dist/analyzers/tools/paths.d.ts.map +1 -0
  141. package/dist/analyzers/tools/paths.js +62 -0
  142. package/dist/analyzers/tools/paths.js.map +1 -0
  143. package/dist/analyzers/tools/python.d.ts +8 -0
  144. package/dist/analyzers/tools/python.d.ts.map +1 -0
  145. package/dist/analyzers/tools/python.js +81 -0
  146. package/dist/analyzers/tools/python.js.map +1 -0
  147. package/dist/analyzers/tools/rust.d.ts +8 -0
  148. package/dist/analyzers/tools/rust.d.ts.map +1 -0
  149. package/dist/analyzers/tools/rust.js +86 -0
  150. package/dist/analyzers/tools/rust.js.map +1 -0
  151. package/dist/analyzers/tools/semgrep.d.ts +39 -0
  152. package/dist/analyzers/tools/semgrep.d.ts.map +1 -0
  153. package/dist/analyzers/tools/semgrep.js +129 -0
  154. package/dist/analyzers/tools/semgrep.js.map +1 -0
  155. package/dist/analyzers/tools/tool-registry.d.ts +0 -41
  156. package/dist/analyzers/tools/tool-registry.d.ts.map +1 -1
  157. package/dist/analyzers/tools/tool-registry.js +0 -87
  158. package/dist/analyzers/tools/tool-registry.js.map +1 -1
  159. package/dist/analyzers/types.d.ts +42 -30
  160. package/dist/analyzers/types.d.ts.map +1 -1
  161. package/dist/cli.js +2 -2
  162. package/dist/cli.js.map +1 -1
  163. package/dist/constants.d.ts +1 -3
  164. package/dist/constants.d.ts.map +1 -1
  165. package/dist/constants.js +55 -14
  166. package/dist/constants.js.map +1 -1
  167. package/dist/languages/capabilities/descriptors.d.ts +74 -0
  168. package/dist/languages/capabilities/descriptors.d.ts.map +1 -0
  169. package/dist/languages/capabilities/descriptors.js +250 -0
  170. package/dist/languages/capabilities/descriptors.js.map +1 -0
  171. package/dist/languages/capabilities/global.d.ts +43 -0
  172. package/dist/languages/capabilities/global.d.ts.map +1 -0
  173. package/dist/languages/capabilities/global.js +48 -0
  174. package/dist/languages/capabilities/global.js.map +1 -0
  175. package/dist/languages/capabilities/index.d.ts +31 -0
  176. package/dist/languages/capabilities/index.d.ts.map +1 -0
  177. package/dist/languages/capabilities/index.js +56 -0
  178. package/dist/languages/capabilities/index.js.map +1 -0
  179. package/dist/languages/capabilities/provider.d.ts +16 -0
  180. package/dist/languages/capabilities/provider.d.ts.map +1 -0
  181. package/dist/languages/capabilities/provider.js +12 -0
  182. package/dist/languages/capabilities/provider.js.map +1 -0
  183. package/dist/languages/capabilities/types.d.ts +226 -0
  184. package/dist/languages/capabilities/types.d.ts.map +1 -0
  185. package/dist/languages/capabilities/types.js +23 -0
  186. package/dist/languages/capabilities/types.js.map +1 -0
  187. package/dist/languages/csharp.d.ts +8 -0
  188. package/dist/languages/csharp.d.ts.map +1 -1
  189. package/dist/languages/csharp.js +203 -103
  190. package/dist/languages/csharp.js.map +1 -1
  191. package/dist/languages/go.d.ts +13 -7
  192. package/dist/languages/go.d.ts.map +1 -1
  193. package/dist/languages/go.js +277 -183
  194. package/dist/languages/go.js.map +1 -1
  195. package/dist/languages/python.d.ts +14 -0
  196. package/dist/languages/python.d.ts.map +1 -1
  197. package/dist/languages/python.js +276 -169
  198. package/dist/languages/python.js.map +1 -1
  199. package/dist/languages/rust.d.ts +8 -0
  200. package/dist/languages/rust.d.ts.map +1 -1
  201. package/dist/languages/rust.js +218 -131
  202. package/dist/languages/rust.js.map +1 -1
  203. package/dist/languages/types.d.ts +16 -15
  204. package/dist/languages/types.d.ts.map +1 -1
  205. package/dist/languages/typescript.d.ts +12 -11
  206. package/dist/languages/typescript.d.ts.map +1 -1
  207. package/dist/languages/typescript.js +256 -161
  208. package/dist/languages/typescript.js.map +1 -1
  209. package/package.json +1 -1
  210. package/templates/.ai/templates/session-checkpoint-template.md +97 -0
package/CHANGELOG.md CHANGED
@@ -7,6 +7,99 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [2.0.0] - 2026-04-22
11
+
12
+ **BREAKING RELEASE.** The deterministic analyzer architecture introduced in
13
+ 1.6.0 matured through an explicit capability model during Phase 10e. Language
14
+ packs now expose data exclusively through typed capability providers
15
+ (depVulns, lint, coverage, testFramework, imports) routed through a
16
+ `CapabilityDispatcher`; global scanners (gitleaks + grep-secrets fallback,
17
+ semgrep, jscpd, graphify) register under the same model. The legacy
18
+ `gatherMetrics` channel and its aggregation helpers are removed.
19
+
20
+ ### Breaking changes — JSON schema v10 → v11
21
+
22
+ - Detailed reports now emit `"schemaVersion": "11"` (was `"10c.1"`).
23
+ - `HealthReport.dimensions.*.metrics` shed all capability-data echoes
24
+ (`lintErrors`, `lintWarnings`, `lintTool`, `secretFindings`,
25
+ `depVulnCritical`/`High`/`Medium`/`Low`, `depAuditTool`,
26
+ `testFramework`, `coveragePercent`, `commentedCodeRatio`,
27
+ `maxFunctionsInFile`, `deadImportCount`, `godNodeCount`,
28
+ `communityCount`, `avgCohesion`, `orphanModuleCount`). Consumers read
29
+ these from `report.capabilities.*` now.
30
+ - `HealthReport.capabilities` is the new canonical sub-object carrying
31
+ typed envelopes (`depVulns`, `lint`, `coverage`, `imports`,
32
+ `testFramework`, `secrets`, `codePatterns`, `duplication`,
33
+ `structural`).
34
+ - `HealthMetrics` narrowed to ~30 non-capability fields (filesystem
35
+ counts, grep markers, doc / config flags, language breakdown).
36
+ - `QualityReport`, `SecurityReport`, `TestGapsReport`, `DevReport` shapes
37
+ unchanged — their detailed variants still bump to v11 for release
38
+ consistency.
39
+
40
+ ### Added
41
+
42
+ - Capability dispatcher (`src/analyzers/dispatcher.ts`) with per-`(cwd,
43
+ capId)` in-memory caching and provider-failure isolation.
44
+ - Nine capability descriptors with bespoke aggregate functions
45
+ (depVulns/lint sum counts, coverage/testFramework last-wins,
46
+ secrets/codePatterns union findings, duplication sums + re-weights,
47
+ structural last-wins, imports unions per-pack graphs).
48
+ - Multi-provider support per capability: `GlobalCapabilities` slots take
49
+ provider arrays, so fallbacks and opt-in scanners compose cleanly.
50
+ - `grep-secrets` fallback provider: 7 regex patterns (hardcoded-password,
51
+ api-key, secret, private-key, AWS access key, GitHub token, Anthropic
52
+ key) that activate when `gitleaks` is absent. Preserves degraded-
53
+ environment secret coverage.
54
+ - `src/analyzers/tools/package-json.ts`: direct `fs.readFileSync` +
55
+ `JSON.parse` helper for `npmScriptsCount` and `nodeEngineVersion`,
56
+ replacing the prior `node -e` subprocess pair.
57
+
58
+ ### Removed
59
+
60
+ - `LanguageSupport.gatherMetrics` optional method — every pack now
61
+ exposes data through `capabilities`.
62
+ - `LangMetrics` type and `mergeMetrics` / `AGGREGATED_VULN_FIELDS`
63
+ helpers.
64
+ - `gatherGitleaksMetrics`, `gatherGraphifyMetrics` legacy bridge
65
+ functions (capability providers + memoized outcome helpers replace
66
+ them).
67
+ - `getSemgrepRulesets`, `getToolDef`, `runRegisteredTool`,
68
+ `EVOLVING_FILES`, `src/analyzers/index.ts` barrel file — all
69
+ unreferenced after the refactor.
70
+ - Pre-2.0 child-process + bash orchestration in `tools/parallel.ts`;
71
+ gitleaks and graphify now run in-process with per-cwd memoization.
72
+
73
+ ### Changed
74
+
75
+ - Scorers consume a `ScoreInput = { metrics, capabilities }` bundle
76
+ (was: flat `HealthMetrics`). Same byte-identical scoring formulas.
77
+ - `HealthReport.toolsUsed` synthesizes per-pack tool names
78
+ (`eslint`, `npm-audit`, `ruff`, `pip-audit`, `golangci-lint`,
79
+ `govulncheck`, …) directly from `capabilities.lint.tool` and
80
+ `capabilities.depVulns.tool` rather than from the deleted per-pack
81
+ gatherMetrics emissions.
82
+
83
+ ### Migration
84
+
85
+ - Replace `report.dimensions.quality.metrics.lintErrors` →
86
+ `(report.capabilities.lint?.counts.critical ?? 0) +
87
+ (report.capabilities.lint?.counts.high ?? 0)`.
88
+ - Replace `report.dimensions.security.metrics.secretFindings` →
89
+ `report.capabilities.secrets?.findings.length ?? 0`.
90
+ - Replace `report.dimensions.security.metrics.depVulnCritical` →
91
+ `report.capabilities.depVulns?.counts.critical ?? 0` (and similarly
92
+ for high/medium/low).
93
+ - Replace `report.dimensions.testing.metrics.coveragePercent` →
94
+ `Math.round(report.capabilities.coverage?.coverage.linePercent ?? 0)`.
95
+ - Replace `report.dimensions.testing.metrics.testFramework` →
96
+ `report.capabilities.testFramework?.name`.
97
+ - Replace `report.dimensions.quality.metrics.maxFunctionsInFile` →
98
+ `report.capabilities.structural?.maxFunctionsInFile`.
99
+ - No changes required for non-`health` commands — `vyuh-dxkit
100
+ vulnerabilities`, `test-gaps`, `quality`, `dev-report` keep their
101
+ report shapes unchanged.
102
+
10
103
  ## [1.6.1] - 2026-04-21
11
104
 
12
105
  Patch release with two CLI bug fixes found while regenerating dxkit's own
package/README.md CHANGED
@@ -14,7 +14,7 @@ Built so agent-written code has deterministic guardrails before it ships. Scores
14
14
  ```bash
15
15
  cd your-repo
16
16
  npx @vyuhlabs/dxkit tools install --yes # one-time: install cloc, gitleaks, etc.
17
- npx @vyuhlabs/dxkit health --detailed # 5-dimension score + remediation plan
17
+ npx @vyuhlabs/dxkit health --detailed # 6-dimension score + remediation plan
18
18
  npx @vyuhlabs/dxkit vulnerabilities # secret + SAST + dep-audit scan
19
19
  npx @vyuhlabs/dxkit test-gaps # import-graph + coverage-aware
20
20
  ```
@@ -148,11 +148,11 @@ Each language is a single `LanguageSupport` implementation in `src/languages/`.
148
148
  | Rust | `Cargo.toml` | ✅ lcov + cobertura | ✅ use statements | clippy, cargo-audit, cargo-llvm-cov | ✅ clippy group | ✅ cargo-audit native |
149
149
  | C# | `*.csproj`, `*.sln` | ✅ cobertura XML | ✅ using declarations | dotnet-format | — (formatter) | ✅ dotnet list --vulnerable |
150
150
 
151
- ✅ full support. Multi-language repos fully supported — every detected language's tools run, and `depVuln*` counts aggregate across all language packs (pip-audit findings don't silently replace npm-audit ones).
151
+ ✅ full support. Multi-language repos fully supported — every detected language's tools run, and dep-vuln counts aggregate across all language packs via the `depVulns` capability (pip-audit findings don't silently replace npm-audit ones).
152
152
 
153
153
  **Severity enrichment.** Scanners that don't publish per-finding severity (pip-audit, govulncheck) are enriched via the OSV.dev API. DXKit ships a complete CVSS v4.0 base-score calculator (macrovector lookup + severity-distance refinement, ported from [FIRST's reference implementation](https://github.com/FIRSTdotorg/cvss-v4-calculator)) since modern CVEs (2025+) increasingly publish v4 vectors exclusively. Unreachable IDs keep the scanner's legacy default bucket — the analyzer never fails because OSV was slow.
154
154
 
155
- **Lint severity tiering.** Every lint finding is categorized into critical/high/medium/low by rule ID, linter name, or lint group. For backward compatibility, `gatherMetrics` collapses tiers to the existing `lintErrors` (critical + high) / `lintWarnings` (medium + low) fields, so scoring behavior is preserved. The tiered data is available for future analyzers that want finer granularity.
155
+ **Lint severity tiering.** Every lint finding is categorized into critical/high/medium/low by rule ID, linter name, or lint group. The `lint` capability envelope carries the tiered counts; `HealthReport.dimensions.quality.details` collapses them into an `"N errors, M warnings"` rendering (critical + high errors, medium + low warnings) for human readability. Consumers that want finer granularity read `report.capabilities.lint.counts` directly.
156
156
 
157
157
  ---
158
158
 
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Prompt extraction — reads agent templates from src-templates/
3
+ * and transforms them for use with Managed Agents.
4
+ *
5
+ * Source of truth: src-templates/.claude/agents-available/*.md
6
+ * This module READS those files at runtime — never copies or duplicates them.
7
+ */
8
+ export interface ExtractedAgent {
9
+ name: string;
10
+ description: string;
11
+ systemPrompt: string;
12
+ model: string;
13
+ tools: Array<{
14
+ type: string;
15
+ [key: string]: unknown;
16
+ }>;
17
+ outputSchema: object | undefined;
18
+ }
19
+ /** List all available agent template names. */
20
+ export declare function listAgentTemplates(): string[];
21
+ /** Extract a single agent's prompt from its template file. */
22
+ export declare function extractAgent(name: string, modelOverride?: string): ExtractedAgent;
23
+ /** Extract all available agent prompts. */
24
+ export declare function extractAllAgents(modelOverride?: string): ExtractedAgent[];
25
+ //# sourceMappingURL=extract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../../src/agents/extract.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC,CAAC;IACvD,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC;AA4DD,+CAA+C;AAC/C,wBAAgB,kBAAkB,IAAI,MAAM,EAAE,CAO7C;AAED,8DAA8D;AAC9D,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,cAAc,CA0CjF;AAED,2CAA2C;AAC3C,wBAAgB,gBAAgB,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,cAAc,EAAE,CAEzE"}
@@ -0,0 +1,186 @@
1
+ "use strict";
2
+ /**
3
+ * Prompt extraction — reads agent templates from src-templates/
4
+ * and transforms them for use with Managed Agents.
5
+ *
6
+ * Source of truth: src-templates/.claude/agents-available/*.md
7
+ * This module READS those files at runtime — never copies or duplicates them.
8
+ */
9
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ var desc = Object.getOwnPropertyDescriptor(m, k);
12
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
+ desc = { enumerable: true, get: function() { return m[k]; } };
14
+ }
15
+ Object.defineProperty(o, k2, desc);
16
+ }) : (function(o, m, k, k2) {
17
+ if (k2 === undefined) k2 = k;
18
+ o[k2] = m[k];
19
+ }));
20
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
21
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
22
+ }) : function(o, v) {
23
+ o["default"] = v;
24
+ });
25
+ var __importStar = (this && this.__importStar) || (function () {
26
+ var ownKeys = function(o) {
27
+ ownKeys = Object.getOwnPropertyNames || function (o) {
28
+ var ar = [];
29
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
30
+ return ar;
31
+ };
32
+ return ownKeys(o);
33
+ };
34
+ return function (mod) {
35
+ if (mod && mod.__esModule) return mod;
36
+ var result = {};
37
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
38
+ __setModuleDefault(result, mod);
39
+ return result;
40
+ };
41
+ })();
42
+ Object.defineProperty(exports, "__esModule", { value: true });
43
+ exports.listAgentTemplates = listAgentTemplates;
44
+ exports.extractAgent = extractAgent;
45
+ exports.extractAllAgents = extractAllAgents;
46
+ const fs = __importStar(require("fs"));
47
+ const path = __importStar(require("path"));
48
+ const schemas_1 = require("./schemas");
49
+ /**
50
+ * Default model per agent category.
51
+ * Analysis agents use Sonnet (cheaper, good enough).
52
+ * Execution agents use Opus (accuracy matters for code changes).
53
+ */
54
+ const AGENT_MODELS = {
55
+ // Analysis — Sonnet is cost-effective
56
+ 'health-auditor': 'claude-sonnet-4-6',
57
+ 'vulnerability-scanner': 'claude-sonnet-4-6',
58
+ 'test-gap-finder': 'claude-sonnet-4-6',
59
+ 'dev-report': 'claude-sonnet-4-6',
60
+ 'dependency-mapper': 'claude-sonnet-4-6',
61
+ 'codebase-explorer': 'claude-sonnet-4-6',
62
+ 'code-reviewer': 'claude-sonnet-4-6',
63
+ 'doc-writer': 'claude-sonnet-4-6',
64
+ 'dashboard-builder': 'claude-sonnet-4-6',
65
+ 'knowledge-bot': 'claude-sonnet-4-6',
66
+ // Execution — Opus for accuracy
67
+ 'feature-planner': 'claude-opus-4-6',
68
+ 'feature-builder': 'claude-opus-4-6',
69
+ 'plan-executor': 'claude-opus-4-6',
70
+ 'strategic-planner': 'claude-opus-4-6',
71
+ 'test-writer': 'claude-opus-4-6',
72
+ 'debugger': 'claude-opus-4-6',
73
+ 'hooks-configurator': 'claude-sonnet-4-6',
74
+ };
75
+ /** Map of Claude Code slash command references to plain-language equivalents. */
76
+ const COMMAND_REPLACEMENTS = {
77
+ 'Run /health': 'Analyze the codebase for health metrics',
78
+ 'Run /quality': 'Run available linting tools via bash',
79
+ 'Run /test': 'Run the test suite via bash',
80
+ 'Run /vulnerabilities': 'Scan for security vulnerabilities',
81
+ '/health': 'health analysis',
82
+ '/quality': 'quality check',
83
+ '/test': 'test suite',
84
+ };
85
+ /** Lines to strip from prompts (Claude Code-specific). */
86
+ const STRIP_PATTERNS = [
87
+ /Save .*to \.ai\/reports\/.*/g,
88
+ /Saves? reports? to \.ai\/reports\/.*/g,
89
+ /\.ai\/reports\//g,
90
+ /\.ai\/sessions\//g,
91
+ ];
92
+ /**
93
+ * Resolve the templates directory.
94
+ * In development: src-templates/
95
+ * When published: templates/ (copied by build script)
96
+ */
97
+ function templatesDir() {
98
+ const srcTemplates = path.resolve(__dirname, '..', '..', 'src-templates');
99
+ if (fs.existsSync(srcTemplates))
100
+ return srcTemplates;
101
+ return path.resolve(__dirname, '..', '..', 'templates');
102
+ }
103
+ /** List all available agent template names. */
104
+ function listAgentTemplates() {
105
+ const dir = path.join(templatesDir(), '.claude', 'agents-available');
106
+ if (!fs.existsSync(dir))
107
+ return [];
108
+ return fs
109
+ .readdirSync(dir)
110
+ .filter((f) => f.endsWith('.md'))
111
+ .map((f) => f.replace('.md', ''));
112
+ }
113
+ /** Extract a single agent's prompt from its template file. */
114
+ function extractAgent(name, modelOverride) {
115
+ const filePath = path.join(templatesDir(), '.claude', 'agents-available', `${name}.md`);
116
+ if (!fs.existsSync(filePath)) {
117
+ throw new Error(`Agent template not found: ${name}`);
118
+ }
119
+ const raw = fs.readFileSync(filePath, 'utf-8');
120
+ const { frontmatter, body } = parseFrontmatter(raw);
121
+ // Clean the prompt for Managed Agent use
122
+ let systemPrompt = body;
123
+ // Replace Claude Code command references
124
+ for (const [pattern, replacement] of Object.entries(COMMAND_REPLACEMENTS)) {
125
+ systemPrompt = systemPrompt.replaceAll(pattern, replacement);
126
+ }
127
+ // Strip Claude Code-specific lines
128
+ for (const pattern of STRIP_PATTERNS) {
129
+ systemPrompt = systemPrompt.replace(pattern, '');
130
+ }
131
+ // Determine the agent type for schema lookup
132
+ const agentType = mapNameToSchemaType(name);
133
+ const outputSchema = agentType ? (0, schemas_1.getSchema)(agentType) : undefined;
134
+ // Append JSON output instructions if we have a schema
135
+ if (outputSchema) {
136
+ systemPrompt += `\n\n## Output Format\n\nReturn your analysis as valid JSON. Wrap the JSON in a \`\`\`json code block. The JSON must match this schema:\n\n\`\`\`json\n${JSON.stringify(outputSchema, null, 2)}\n\`\`\`\n`;
137
+ }
138
+ // Clean up excessive blank lines
139
+ systemPrompt = systemPrompt.replace(/\n{3,}/g, '\n\n').trim();
140
+ return {
141
+ name: `dxkit-${name}`,
142
+ description: frontmatter.description || `DXKit ${name} agent`,
143
+ systemPrompt,
144
+ model: modelOverride || AGENT_MODELS[name] || 'claude-sonnet-4-6',
145
+ tools: [{ type: 'agent_toolset_20260401' }],
146
+ outputSchema,
147
+ };
148
+ }
149
+ /** Extract all available agent prompts. */
150
+ function extractAllAgents(modelOverride) {
151
+ return listAgentTemplates().map((name) => extractAgent(name, modelOverride));
152
+ }
153
+ /** Map agent names to schema type keys. */
154
+ function mapNameToSchemaType(name) {
155
+ const map = {
156
+ 'health-auditor': 'health',
157
+ 'vulnerability-scanner': 'vulnerabilities',
158
+ 'feature-planner': 'feature',
159
+ 'feature-builder': 'execution',
160
+ 'plan-executor': 'execution',
161
+ };
162
+ return map[name];
163
+ }
164
+ /** Parse YAML-ish frontmatter from agent markdown files. */
165
+ function parseFrontmatter(raw) {
166
+ const frontmatter = {};
167
+ if (!raw.startsWith('---')) {
168
+ return { frontmatter, body: raw };
169
+ }
170
+ const endIdx = raw.indexOf('---', 3);
171
+ if (endIdx === -1) {
172
+ return { frontmatter, body: raw };
173
+ }
174
+ const fmBlock = raw.slice(3, endIdx).trim();
175
+ for (const line of fmBlock.split('\n')) {
176
+ const colonIdx = line.indexOf(':');
177
+ if (colonIdx === -1)
178
+ continue;
179
+ const key = line.slice(0, colonIdx).trim();
180
+ const value = line.slice(colonIdx + 1).trim();
181
+ frontmatter[key] = value;
182
+ }
183
+ const body = raw.slice(endIdx + 3).trim();
184
+ return { frontmatter, body };
185
+ }
186
+ //# sourceMappingURL=extract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extract.js","sourceRoot":"","sources":["../../src/agents/extract.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0EH,gDAOC;AAGD,oCA0CC;AAGD,4CAEC;AAjID,uCAAyB;AACzB,2CAA6B;AAC7B,uCAAsC;AAWtC;;;;GAIG;AACH,MAAM,YAAY,GAA2B;IAC3C,sCAAsC;IACtC,gBAAgB,EAAE,mBAAmB;IACrC,uBAAuB,EAAE,mBAAmB;IAC5C,iBAAiB,EAAE,mBAAmB;IACtC,YAAY,EAAE,mBAAmB;IACjC,mBAAmB,EAAE,mBAAmB;IACxC,mBAAmB,EAAE,mBAAmB;IACxC,eAAe,EAAE,mBAAmB;IACpC,YAAY,EAAE,mBAAmB;IACjC,mBAAmB,EAAE,mBAAmB;IACxC,eAAe,EAAE,mBAAmB;IAEpC,gCAAgC;IAChC,iBAAiB,EAAE,iBAAiB;IACpC,iBAAiB,EAAE,iBAAiB;IACpC,eAAe,EAAE,iBAAiB;IAClC,mBAAmB,EAAE,iBAAiB;IACtC,aAAa,EAAE,iBAAiB;IAChC,UAAU,EAAE,iBAAiB;IAC7B,oBAAoB,EAAE,mBAAmB;CAC1C,CAAC;AAEF,iFAAiF;AACjF,MAAM,oBAAoB,GAA2B;IACnD,aAAa,EAAE,yCAAyC;IACxD,cAAc,EAAE,sCAAsC;IACtD,WAAW,EAAE,6BAA6B;IAC1C,sBAAsB,EAAE,mCAAmC;IAC3D,SAAS,EAAE,iBAAiB;IAC5B,UAAU,EAAE,eAAe;IAC3B,OAAO,EAAE,YAAY;CACtB,CAAC;AAEF,0DAA0D;AAC1D,MAAM,cAAc,GAAG;IACrB,8BAA8B;IAC9B,uCAA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AAC,CAAC,IAAI,EAAE,CAAC;QAC3C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAC9C,WAAW,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IAC3B,CAAC;IAED,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAC1C,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;AAC/B,CAAC"}
@@ -0,0 +1,106 @@
1
+ /**
2
+ * JSON output schemas for Managed Agent responses.
3
+ * Each agent type returns structured JSON matching these schemas.
4
+ */
5
+ export interface HealthReport {
6
+ repo: string;
7
+ analyzedAt: string;
8
+ summary: {
9
+ overallScore: number;
10
+ maxScore: number;
11
+ grade: 'A' | 'B' | 'C' | 'D' | 'F';
12
+ };
13
+ dimensions: {
14
+ testing: {
15
+ score: number;
16
+ details: string;
17
+ };
18
+ quality: {
19
+ score: number;
20
+ details: string;
21
+ };
22
+ documentation: {
23
+ score: number;
24
+ details: string;
25
+ };
26
+ security: {
27
+ score: number;
28
+ details: string;
29
+ };
30
+ maintainability: {
31
+ score: number;
32
+ details: string;
33
+ };
34
+ developerExperience: {
35
+ score: number;
36
+ details: string;
37
+ };
38
+ };
39
+ recommendations: Array<{
40
+ priority: number;
41
+ title: string;
42
+ description: string;
43
+ affectedFiles: string[];
44
+ }>;
45
+ }
46
+ export interface VulnerabilityReport {
47
+ repo: string;
48
+ analyzedAt: string;
49
+ summary: {
50
+ total: number;
51
+ critical: number;
52
+ high: number;
53
+ medium: number;
54
+ low: number;
55
+ };
56
+ findings: Array<{
57
+ cwe: string;
58
+ severity: 'critical' | 'high' | 'medium' | 'low';
59
+ title: string;
60
+ file: string;
61
+ line: number | null;
62
+ description: string;
63
+ recommendation: string;
64
+ }>;
65
+ }
66
+ export interface FeaturePlan {
67
+ slug: string;
68
+ title: string;
69
+ description: string;
70
+ tasks: Array<{
71
+ sequence: number;
72
+ title: string;
73
+ description: string;
74
+ type: string;
75
+ affectedFiles: string[];
76
+ acceptanceCriteria: string[];
77
+ dependsOn: number[];
78
+ }>;
79
+ risks: Array<{
80
+ description: string;
81
+ severity: string;
82
+ mitigation: string;
83
+ }>;
84
+ }
85
+ export interface ExecutionReport {
86
+ taskKey: string;
87
+ status: 'success' | 'failed' | 'timeout';
88
+ filesChanged: Array<{
89
+ path: string;
90
+ additions: number;
91
+ deletions: number;
92
+ }>;
93
+ changeSummary: string;
94
+ testResults: {
95
+ passed: boolean;
96
+ total: number;
97
+ failed: number;
98
+ output: string;
99
+ };
100
+ retries: number;
101
+ }
102
+ /** JSON schema objects for injection into system prompts. */
103
+ export declare const SCHEMA_JSON: Record<string, object>;
104
+ /** Map agent type names to their JSON schemas. */
105
+ export declare function getSchema(agentType: string): object | undefined;
106
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/agents/schemas.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE;QACP,YAAY,EAAE,MAAM,CAAC;QACrB,QAAQ,EAAE,MAAM,CAAC;QACjB,KAAK,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;KACpC,CAAC;IACF,UAAU,EAAE;QACV,OAAO,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE,CAAC;QAC5C,OAAO,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE,CAAC;QAC5C,aAAa,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE,CAA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EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;QACpB,IAAI,EAAE,MAAM,CAAC;QACb,aAAa,EAAE,MAAM,EAAE,CAAC;QACxB,kBAAkB,EAAE,MAAM,EAAE,CAAC;QAC7B,SAAS,EAAE,MAAM,EAAE,CAAC;KACrB,CAAC,CAAC;IACH,KAAK,EAAE,KAAK,CAAC;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC7E;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;IACzC,YAAY,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC5E,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE;QAAE,MAAM,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAChF,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,6DAA6D;AAC7D,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAuE9C,CAAC;AAEF,kDAAkD;AAClD,wBAAgB,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE/D"}
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ /**
3
+ * JSON output schemas for Managed Agent responses.
4
+ * Each agent type returns structured JSON matching these schemas.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.SCHEMA_JSON = void 0;
8
+ exports.getSchema = getSchema;
9
+ /** JSON schema objects for injection into system prompts. */
10
+ exports.SCHEMA_JSON = {
11
+ health: {
12
+ type: 'object',
13
+ properties: {
14
+ repo: { type: 'string' },
15
+ analyzedAt: { type: 'string' },
16
+ summary: {
17
+ type: 'object',
18
+ properties: {
19
+ overallScore: { type: 'number' },
20
+ maxScore: { type: 'number', const: 60 },
21
+ grade: { type: 'string', enum: ['A', 'B', 'C', 'D', 'F'] },
22
+ },
23
+ },
24
+ dimensions: {
25
+ type: 'object',
26
+ properties: {
27
+ testing: { type: 'object', properties: { score: { type: 'number' }, details: { type: 'string' } } },
28
+ quality: { type: 'object', properties: { score: { type: 'number' }, details: { type: 'string' } } },
29
+ documentation: { type: 'object', properties: { score: { type: 'number' }, details: { type: 'string' } } },
30
+ security: { type: 'object', properties: { score: { type: 'number' }, details: { type: 'string' } } },
31
+ maintainability: { type: 'object', properties: { score: { type: 'number' }, details: { type: 'string' } } },
32
+ developerExperience: { type: 'object', properties: { score: { type: 'number' }, details: { type: 'string' } } },
33
+ },
34
+ },
35
+ recommendations: {
36
+ type: 'array',
37
+ items: {
38
+ type: 'object',
39
+ properties: {
40
+ priority: { type: 'number' },
41
+ title: { type: 'string' },
42
+ description: { type: 'string' },
43
+ affectedFiles: { type: 'array', items: { type: 'string' } },
44
+ },
45
+ },
46
+ },
47
+ },
48
+ },
49
+ vulnerabilities: {
50
+ type: 'object',
51
+ properties: {
52
+ repo: { type: 'string' },
53
+ analyzedAt: { type: 'string' },
54
+ summary: {
55
+ type: 'object',
56
+ properties: {
57
+ total: { type: 'number' },
58
+ critical: { type: 'number' },
59
+ high: { type: 'number' },
60
+ medium: { type: 'number' },
61
+ low: { type: 'number' },
62
+ },
63
+ },
64
+ findings: {
65
+ type: 'array',
66
+ items: {
67
+ type: 'object',
68
+ properties: {
69
+ cwe: { type: 'string' },
70
+ severity: { type: 'string' },
71
+ title: { type: 'string' },
72
+ file: { type: 'string' },
73
+ line: { type: ['number', 'null'] },
74
+ description: { type: 'string' },
75
+ recommendation: { type: 'string' },
76
+ },
77
+ },
78
+ },
79
+ },
80
+ },
81
+ };
82
+ /** Map agent type names to their JSON schemas. */
83
+ function getSchema(agentType) {
84
+ return exports.SCHEMA_JSON[agentType];
85
+ }
86
+ //# sourceMappingURL=schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../src/agents/schemas.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA6IH,8BAEC;AA7ED,6DAA6D;AAChD,QAAA,WAAW,GAA2B;IACjD,MAAM,EAAE;QACN,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACxB,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC9B,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBAChC,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE;oBACvC,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE;iBAC3D;aACF;YACD,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE;oBACnG,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE;oBACnG,aAAa,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE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AAE,QAAQ;gBACd,UAAU,EAAE;oBACV,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBACzB,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBAC5B,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBACxB,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBAC1B,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;iBACxB;aACF;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;wBACvB,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;wBAC5B,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;wBACzB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;wBACxB,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE;wBAClC,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;wBAC/B,cAAc,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;qBACnC;iBACF;aACF;SACF;KACF;CACF,CAAC;AAEF,kDAAkD;AAClD,SAAgB,SAAS,CAAC,SAAiB;IACzC,OAAO,mBAAW,CAAC,SAAS,CAAC,CAAC;AAChC,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Managed Agent session orchestration.
3
+ *
4
+ * Creates sessions, mounts repos, sends tasks, streams results.
5
+ * Requires @anthropic-ai/sdk and ANTHROPIC_API_KEY.
6
+ */
7
+ /** Stored agent config — persisted to .dxkit-agents.json */
8
+ export interface AgentConfig {
9
+ version: string;
10
+ environment_id: string;
11
+ agents: Record<string, {
12
+ agent_id: string;
13
+ agent_version: string;
14
+ prompt_hash: string;
15
+ }>;
16
+ }
17
+ /** Load agent config from disk. */
18
+ export declare function loadConfig(cwd: string): AgentConfig | null;
19
+ /**
20
+ * Set up all agents on Anthropic's infrastructure.
21
+ * Creates an environment and one agent per template.
22
+ */
23
+ export declare function setupAgents(cwd: string, modelOverride?: string): Promise<AgentConfig>;
24
+ /** List registered agents. */
25
+ export declare function listAgents(cwd: string): void;
26
+ /** Run an agent session on a GitHub repo. */
27
+ export declare function runAgent(cwd: string, agentType: string, repoUrl: string, githubToken: string, branch?: string, task?: string): Promise<string>;
28
+ //# sourceMappingURL=session.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/agents/session.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,4DAA4D;AAC5D,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CACZ,MAAM,EACN;QACE,QAAQ,EAAE,MAAM,CAAC;QACjB,aAAa,EAAE,MAAM,CAAC;QACtB,WAAW,EAAE,MAAM,CAAC;KACrB,CACF,CAAC;CACH;AAID,mCAAmC;AACnC,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAQ1D;AAkBD;;;GAGG;AACH,wBAAsB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAsD3F;AAED,8BAA8B;AAC9B,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAe5C;AAED,6CAA6C;AAC7C,wBAAsB,QAAQ,CAC5B,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,MAAM,CAAC,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,MAAM,GACZ,OAAO,CAAC,MAAM,CAAC,CAuFjB"}