archbyte 0.1.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 (142) hide show
  1. package/README.md +282 -0
  2. package/bin/archbyte.js +213 -0
  3. package/dist/agents/core/component-detector.d.ts +2 -0
  4. package/dist/agents/core/component-detector.js +57 -0
  5. package/dist/agents/core/connection-mapper.d.ts +2 -0
  6. package/dist/agents/core/connection-mapper.js +77 -0
  7. package/dist/agents/core/doc-parser.d.ts +2 -0
  8. package/dist/agents/core/doc-parser.js +64 -0
  9. package/dist/agents/core/env-detector.d.ts +2 -0
  10. package/dist/agents/core/env-detector.js +51 -0
  11. package/dist/agents/core/event-detector.d.ts +2 -0
  12. package/dist/agents/core/event-detector.js +59 -0
  13. package/dist/agents/core/infra-analyzer.d.ts +2 -0
  14. package/dist/agents/core/infra-analyzer.js +72 -0
  15. package/dist/agents/core/structure-scanner.d.ts +2 -0
  16. package/dist/agents/core/structure-scanner.js +55 -0
  17. package/dist/agents/core/validator.d.ts +2 -0
  18. package/dist/agents/core/validator.js +74 -0
  19. package/dist/agents/index.d.ts +24 -0
  20. package/dist/agents/index.js +73 -0
  21. package/dist/agents/llm/index.d.ts +8 -0
  22. package/dist/agents/llm/index.js +185 -0
  23. package/dist/agents/llm/prompt-builder.d.ts +3 -0
  24. package/dist/agents/llm/prompt-builder.js +251 -0
  25. package/dist/agents/llm/response-parser.d.ts +6 -0
  26. package/dist/agents/llm/response-parser.js +174 -0
  27. package/dist/agents/llm/types.d.ts +31 -0
  28. package/dist/agents/llm/types.js +2 -0
  29. package/dist/agents/pipeline/agents/component-identifier.d.ts +3 -0
  30. package/dist/agents/pipeline/agents/component-identifier.js +102 -0
  31. package/dist/agents/pipeline/agents/connection-mapper.d.ts +3 -0
  32. package/dist/agents/pipeline/agents/connection-mapper.js +126 -0
  33. package/dist/agents/pipeline/agents/flow-detector.d.ts +3 -0
  34. package/dist/agents/pipeline/agents/flow-detector.js +101 -0
  35. package/dist/agents/pipeline/agents/service-describer.d.ts +3 -0
  36. package/dist/agents/pipeline/agents/service-describer.js +100 -0
  37. package/dist/agents/pipeline/agents/validator.d.ts +3 -0
  38. package/dist/agents/pipeline/agents/validator.js +102 -0
  39. package/dist/agents/pipeline/index.d.ts +13 -0
  40. package/dist/agents/pipeline/index.js +128 -0
  41. package/dist/agents/pipeline/merger.d.ts +7 -0
  42. package/dist/agents/pipeline/merger.js +212 -0
  43. package/dist/agents/pipeline/response-parser.d.ts +5 -0
  44. package/dist/agents/pipeline/response-parser.js +43 -0
  45. package/dist/agents/pipeline/types.d.ts +92 -0
  46. package/dist/agents/pipeline/types.js +3 -0
  47. package/dist/agents/prompt-data.d.ts +1 -0
  48. package/dist/agents/prompt-data.js +15 -0
  49. package/dist/agents/prompts-encode.d.ts +9 -0
  50. package/dist/agents/prompts-encode.js +26 -0
  51. package/dist/agents/prompts.d.ts +12 -0
  52. package/dist/agents/prompts.js +30 -0
  53. package/dist/agents/providers/anthropic.d.ts +10 -0
  54. package/dist/agents/providers/anthropic.js +117 -0
  55. package/dist/agents/providers/google.d.ts +10 -0
  56. package/dist/agents/providers/google.js +136 -0
  57. package/dist/agents/providers/ollama.d.ts +9 -0
  58. package/dist/agents/providers/ollama.js +162 -0
  59. package/dist/agents/providers/openai.d.ts +9 -0
  60. package/dist/agents/providers/openai.js +142 -0
  61. package/dist/agents/providers/router.d.ts +7 -0
  62. package/dist/agents/providers/router.js +55 -0
  63. package/dist/agents/runtime/orchestrator.d.ts +34 -0
  64. package/dist/agents/runtime/orchestrator.js +193 -0
  65. package/dist/agents/runtime/registry.d.ts +23 -0
  66. package/dist/agents/runtime/registry.js +56 -0
  67. package/dist/agents/runtime/types.d.ts +117 -0
  68. package/dist/agents/runtime/types.js +29 -0
  69. package/dist/agents/static/code-sampler.d.ts +3 -0
  70. package/dist/agents/static/code-sampler.js +153 -0
  71. package/dist/agents/static/component-detector.d.ts +3 -0
  72. package/dist/agents/static/component-detector.js +404 -0
  73. package/dist/agents/static/connection-mapper.d.ts +3 -0
  74. package/dist/agents/static/connection-mapper.js +280 -0
  75. package/dist/agents/static/doc-parser.d.ts +3 -0
  76. package/dist/agents/static/doc-parser.js +358 -0
  77. package/dist/agents/static/env-detector.d.ts +3 -0
  78. package/dist/agents/static/env-detector.js +73 -0
  79. package/dist/agents/static/event-detector.d.ts +3 -0
  80. package/dist/agents/static/event-detector.js +70 -0
  81. package/dist/agents/static/file-tree-collector.d.ts +3 -0
  82. package/dist/agents/static/file-tree-collector.js +51 -0
  83. package/dist/agents/static/index.d.ts +19 -0
  84. package/dist/agents/static/index.js +307 -0
  85. package/dist/agents/static/infra-analyzer.d.ts +3 -0
  86. package/dist/agents/static/infra-analyzer.js +208 -0
  87. package/dist/agents/static/structure-scanner.d.ts +3 -0
  88. package/dist/agents/static/structure-scanner.js +195 -0
  89. package/dist/agents/static/types.d.ts +165 -0
  90. package/dist/agents/static/types.js +2 -0
  91. package/dist/agents/static/utils.d.ts +21 -0
  92. package/dist/agents/static/utils.js +146 -0
  93. package/dist/agents/static/validator.d.ts +2 -0
  94. package/dist/agents/static/validator.js +75 -0
  95. package/dist/agents/tools/claude-code.d.ts +38 -0
  96. package/dist/agents/tools/claude-code.js +129 -0
  97. package/dist/agents/tools/local-fs.d.ts +12 -0
  98. package/dist/agents/tools/local-fs.js +112 -0
  99. package/dist/agents/tools/tool-definitions.d.ts +6 -0
  100. package/dist/agents/tools/tool-definitions.js +66 -0
  101. package/dist/cli/analyze.d.ts +27 -0
  102. package/dist/cli/analyze.js +586 -0
  103. package/dist/cli/auth.d.ts +46 -0
  104. package/dist/cli/auth.js +397 -0
  105. package/dist/cli/config.d.ts +11 -0
  106. package/dist/cli/config.js +177 -0
  107. package/dist/cli/diff.d.ts +10 -0
  108. package/dist/cli/diff.js +144 -0
  109. package/dist/cli/export.d.ts +10 -0
  110. package/dist/cli/export.js +321 -0
  111. package/dist/cli/gate.d.ts +13 -0
  112. package/dist/cli/gate.js +131 -0
  113. package/dist/cli/generate.d.ts +10 -0
  114. package/dist/cli/generate.js +213 -0
  115. package/dist/cli/license-gate.d.ts +27 -0
  116. package/dist/cli/license-gate.js +121 -0
  117. package/dist/cli/patrol.d.ts +15 -0
  118. package/dist/cli/patrol.js +212 -0
  119. package/dist/cli/run.d.ts +11 -0
  120. package/dist/cli/run.js +24 -0
  121. package/dist/cli/serve.d.ts +9 -0
  122. package/dist/cli/serve.js +65 -0
  123. package/dist/cli/setup.d.ts +1 -0
  124. package/dist/cli/setup.js +233 -0
  125. package/dist/cli/shared.d.ts +68 -0
  126. package/dist/cli/shared.js +275 -0
  127. package/dist/cli/stats.d.ts +9 -0
  128. package/dist/cli/stats.js +158 -0
  129. package/dist/cli/ui.d.ts +18 -0
  130. package/dist/cli/ui.js +144 -0
  131. package/dist/cli/validate.d.ts +54 -0
  132. package/dist/cli/validate.js +315 -0
  133. package/dist/cli/workflow.d.ts +10 -0
  134. package/dist/cli/workflow.js +594 -0
  135. package/dist/server/src/generator/index.d.ts +123 -0
  136. package/dist/server/src/generator/index.js +254 -0
  137. package/dist/server/src/index.d.ts +8 -0
  138. package/dist/server/src/index.js +1311 -0
  139. package/package.json +62 -0
  140. package/ui/dist/assets/index-B66Til39.js +70 -0
  141. package/ui/dist/assets/index-BE2OWbzu.css +1 -0
  142. package/ui/dist/index.html +14 -0
@@ -0,0 +1,64 @@
1
+ import { executeToolLoop } from "../runtime/orchestrator.js";
2
+ export const docParser = {
3
+ id: "doc-parser",
4
+ name: "Documentation Parser",
5
+ description: "Parses README, OpenAPI specs, and Mermaid diagrams for architectural insights.",
6
+ tier: "free",
7
+ phase: "parallel",
8
+ modelTier: "standard",
9
+ requiredTools: ["glob", "read_file"],
10
+ systemPrompt: `You are a documentation analysis agent. Your job is to extract architectural information from project documentation.
11
+
12
+ Analyze documentation files and return a JSON object with this structure:
13
+ {
14
+ "projectDescription": "string",
15
+ "architectureNotes": ["key architectural decisions or patterns mentioned in docs"],
16
+ "apiEndpoints": [
17
+ {
18
+ "method": "GET | POST | PUT | DELETE",
19
+ "path": "/api/...",
20
+ "description": "what it does"
21
+ }
22
+ ],
23
+ "diagrams": [
24
+ {
25
+ "type": "mermaid | plantuml | ascii",
26
+ "description": "what the diagram shows",
27
+ "components": ["components referenced in diagram"]
28
+ }
29
+ ],
30
+ "externalDependencies": [
31
+ {
32
+ "name": "service or API name",
33
+ "type": "api | database | queue | storage | auth",
34
+ "description": "what it's used for"
35
+ }
36
+ ]
37
+ }
38
+
39
+ Instructions:
40
+ 1. Search for documentation files: README*, ARCHITECTURE*, DESIGN*, docs/**, *.md
41
+ 2. Look for OpenAPI/Swagger specs: openapi.*, swagger.*, **/api-spec.*
42
+ 3. Extract Mermaid or PlantUML diagrams from markdown files
43
+ 4. Identify external service dependencies mentioned in docs
44
+ 5. Extract API endpoint documentation
45
+ 6. Return ONLY the JSON object, no other text`,
46
+ async run(context) {
47
+ const start = Date.now();
48
+ const output = await executeToolLoop(context, this.systemPrompt, "Parse project documentation for architectural insights. Search for README, docs, API specs, and architecture diagrams.");
49
+ let data;
50
+ try {
51
+ const jsonMatch = output.match(/\{[\s\S]*\}/);
52
+ data = jsonMatch ? JSON.parse(jsonMatch[0]) : { raw: output };
53
+ }
54
+ catch {
55
+ data = { raw: output };
56
+ }
57
+ return {
58
+ agentId: this.id,
59
+ data,
60
+ confidence: data && typeof data === "object" && "projectDescription" in data ? 0.8 : 0.5,
61
+ duration: Date.now() - start,
62
+ };
63
+ },
64
+ };
@@ -0,0 +1,2 @@
1
+ import type { ArchByteAgent } from "../runtime/types.js";
2
+ export declare const envDetector: ArchByteAgent;
@@ -0,0 +1,51 @@
1
+ import { executeToolLoop } from "../runtime/orchestrator.js";
2
+ export const envDetector = {
3
+ id: "env-detector",
4
+ name: "Environment Detector",
5
+ description: "Detects environments, configuration, and deployment stages.",
6
+ tier: "free",
7
+ phase: "parallel",
8
+ modelTier: "fast",
9
+ requiredTools: ["glob", "read_file"],
10
+ systemPrompt: `You are an environment detection agent. Your job is to identify the deployment environments and configuration patterns in a project.
11
+
12
+ Analyze the project and return a JSON object with this structure:
13
+ {
14
+ "environments": [
15
+ {
16
+ "name": "development | staging | production | test",
17
+ "configFiles": ["list of config files for this env"],
18
+ "variables": ["key env variable names (NOT values)"]
19
+ }
20
+ ],
21
+ "configPattern": "env-files | yaml | json | toml | vault | aws-ssm | none",
22
+ "hasSecrets": boolean,
23
+ "secretsManagement": "vault | aws-secrets | gcp-secrets | env-files | none"
24
+ }
25
+
26
+ Instructions:
27
+ 1. Search for .env files (.env, .env.*, .env.example)
28
+ 2. Look for config directories (config/, environments/)
29
+ 3. Check for environment-specific configs (config.production.ts, settings.staging.yaml)
30
+ 4. Identify secret management patterns (vault, AWS SSM, sealed-secrets)
31
+ 5. List environment variable NAMES only, never values
32
+ 6. Return ONLY the JSON object, no other text`,
33
+ async run(context) {
34
+ const start = Date.now();
35
+ const output = await executeToolLoop(context, this.systemPrompt, "Detect environments and configuration patterns. Search for .env files, config directories, and environment-specific settings.");
36
+ let data;
37
+ try {
38
+ const jsonMatch = output.match(/\{[\s\S]*\}/);
39
+ data = jsonMatch ? JSON.parse(jsonMatch[0]) : { raw: output };
40
+ }
41
+ catch {
42
+ data = { raw: output };
43
+ }
44
+ return {
45
+ agentId: this.id,
46
+ data,
47
+ confidence: data && typeof data === "object" && "environments" in data ? 0.85 : 0.5,
48
+ duration: Date.now() - start,
49
+ };
50
+ },
51
+ };
@@ -0,0 +1,2 @@
1
+ import type { ArchByteAgent } from "../runtime/types.js";
2
+ export declare const eventDetector: ArchByteAgent;
@@ -0,0 +1,59 @@
1
+ import { executeToolLoop } from "../runtime/orchestrator.js";
2
+ export const eventDetector = {
3
+ id: "event-detector",
4
+ name: "Event Detector",
5
+ description: "Detects event-driven architecture patterns: Kafka, queues, pub/sub, webhooks.",
6
+ tier: "free",
7
+ phase: "parallel",
8
+ modelTier: "standard",
9
+ requiredTools: ["glob", "read_file", "grep"],
10
+ systemPrompt: `You are an event-driven architecture detection agent. Your job is to identify async messaging patterns, event buses, and pub/sub systems.
11
+
12
+ Analyze the project and return a JSON object with this structure:
13
+ {
14
+ "hasEDA": boolean,
15
+ "patterns": [
16
+ {
17
+ "type": "kafka | rabbitmq | sqs | sns | pubsub | redis-streams | nats | eventbridge | webhooks | websocket | sse | custom-events",
18
+ "producers": ["component or file that publishes"],
19
+ "consumers": ["component or file that subscribes"],
20
+ "topics": ["topic/queue/channel names"],
21
+ "evidence": "file:line where this was found"
22
+ }
23
+ ],
24
+ "events": [
25
+ {
26
+ "name": "event name or type",
27
+ "producer": "who emits it",
28
+ "consumers": ["who handles it"],
29
+ "schema": "brief description of event payload"
30
+ }
31
+ ]
32
+ }
33
+
34
+ Instructions:
35
+ 1. Search for message broker clients: kafkajs, amqplib, @aws-sdk/client-sqs, bull, ioredis
36
+ 2. Grep for patterns: .publish, .subscribe, .emit, .on(', EventEmitter, @EventHandler
37
+ 3. Look for webhook endpoints (POST routes that receive external events)
38
+ 4. Check for WebSocket or SSE server implementations
39
+ 5. Read relevant files to understand the event flow
40
+ 6. Return ONLY the JSON object, no other text`,
41
+ async run(context) {
42
+ const start = Date.now();
43
+ const output = await executeToolLoop(context, this.systemPrompt, "Detect event-driven architecture patterns. Search for message brokers, pub/sub, webhooks, and async communication.");
44
+ let data;
45
+ try {
46
+ const jsonMatch = output.match(/\{[\s\S]*\}/);
47
+ data = jsonMatch ? JSON.parse(jsonMatch[0]) : { raw: output };
48
+ }
49
+ catch {
50
+ data = { raw: output };
51
+ }
52
+ return {
53
+ agentId: this.id,
54
+ data,
55
+ confidence: data && typeof data === "object" && "hasEDA" in data ? 0.8 : 0.5,
56
+ duration: Date.now() - start,
57
+ };
58
+ },
59
+ };
@@ -0,0 +1,2 @@
1
+ import type { ArchByteAgent } from "../runtime/types.js";
2
+ export declare const infraAnalyzer: ArchByteAgent;
@@ -0,0 +1,72 @@
1
+ import { executeToolLoop } from "../runtime/orchestrator.js";
2
+ export const infraAnalyzer = {
3
+ id: "infra-analyzer",
4
+ name: "Infrastructure Analyzer",
5
+ description: "Analyzes Docker, Kubernetes, cloud infrastructure, and deployment configuration.",
6
+ tier: "free",
7
+ phase: "parallel",
8
+ modelTier: "standard",
9
+ requiredTools: ["glob", "read_file", "grep"],
10
+ systemPrompt: `You are an infrastructure analysis agent. Your job is to understand the deployment and infrastructure setup of a software project.
11
+
12
+ Analyze the project and return a JSON object with this structure:
13
+ {
14
+ "docker": {
15
+ "hasDocker": boolean,
16
+ "services": [
17
+ {
18
+ "name": "string",
19
+ "image": "string",
20
+ "ports": ["string"],
21
+ "dependsOn": ["string"]
22
+ }
23
+ ],
24
+ "composeFile": "path or null"
25
+ },
26
+ "kubernetes": {
27
+ "hasK8s": boolean,
28
+ "resources": [
29
+ {
30
+ "kind": "Deployment | Service | Ingress | ConfigMap | etc.",
31
+ "name": "string",
32
+ "namespace": "string"
33
+ }
34
+ ]
35
+ },
36
+ "cloud": {
37
+ "provider": "aws | gcp | azure | none",
38
+ "services": ["list of cloud services used (S3, RDS, CloudRun, etc.)"],
39
+ "iac": "terraform | pulumi | cdk | cloudformation | none"
40
+ },
41
+ "ci": {
42
+ "platform": "github-actions | gitlab-ci | jenkins | circleci | none",
43
+ "pipelines": ["list of pipeline/workflow names"]
44
+ }
45
+ }
46
+
47
+ Instructions:
48
+ 1. Search for Dockerfiles, docker-compose files
49
+ 2. Search for Kubernetes manifests (*.yaml in k8s/, deploy/, manifests/)
50
+ 3. Look for cloud configuration (terraform/, .aws/, gcp/, azure/)
51
+ 4. Check CI/CD configs (.github/workflows/, .gitlab-ci.yml, Jenkinsfile)
52
+ 5. Read and parse each config file found
53
+ 6. Return ONLY the JSON object, no other text`,
54
+ async run(context) {
55
+ const start = Date.now();
56
+ const output = await executeToolLoop(context, this.systemPrompt, "Analyze the infrastructure and deployment configuration. Search for Docker, Kubernetes, cloud config, and CI/CD pipelines.");
57
+ let data;
58
+ try {
59
+ const jsonMatch = output.match(/\{[\s\S]*\}/);
60
+ data = jsonMatch ? JSON.parse(jsonMatch[0]) : { raw: output };
61
+ }
62
+ catch {
63
+ data = { raw: output };
64
+ }
65
+ return {
66
+ agentId: this.id,
67
+ data,
68
+ confidence: data && typeof data === "object" && "docker" in data ? 0.85 : 0.5,
69
+ duration: Date.now() - start,
70
+ };
71
+ },
72
+ };
@@ -0,0 +1,2 @@
1
+ import type { ArchByteAgent } from "../runtime/types.js";
2
+ export declare const structureScanner: ArchByteAgent;
@@ -0,0 +1,55 @@
1
+ import { executeToolLoop } from "../runtime/orchestrator.js";
2
+ export const structureScanner = {
3
+ id: "structure-scanner",
4
+ name: "Structure Scanner",
5
+ description: "Scans project structure, package managers, monorepo detection, and build systems.",
6
+ tier: "free",
7
+ phase: "parallel",
8
+ modelTier: "fast",
9
+ requiredTools: ["glob", "read_file", "list_dir"],
10
+ systemPrompt: `You are a project structure analysis agent. Your job is to understand the layout and build system of a software project.
11
+
12
+ Analyze the project and return a JSON object with this structure:
13
+ {
14
+ "projectName": "string",
15
+ "language": "string (primary language)",
16
+ "languages": ["list of all languages found"],
17
+ "framework": "string or null",
18
+ "packageManager": "npm | yarn | pnpm | pip | poetry | cargo | go | maven | gradle | other",
19
+ "isMonorepo": boolean,
20
+ "monorepoTool": "string or null (nx, turborepo, lerna, workspaces, etc.)",
21
+ "entryPoints": ["list of main entry files"],
22
+ "buildSystem": "string (tsc, vite, webpack, esbuild, etc.)",
23
+ "testFramework": "string or null",
24
+ "directories": {
25
+ "src": "description of what's in src/",
26
+ "...": "other significant directories"
27
+ }
28
+ }
29
+
30
+ Instructions:
31
+ 1. Start by listing the root directory to understand the project layout
32
+ 2. Read package.json, Cargo.toml, go.mod, pyproject.toml, or equivalent
33
+ 3. Look for monorepo indicators (workspaces, nx.json, turbo.json, lerna.json)
34
+ 4. Identify the primary language and framework
35
+ 5. Return ONLY the JSON object, no other text`,
36
+ async run(context) {
37
+ const start = Date.now();
38
+ const output = await executeToolLoop(context, this.systemPrompt, "Analyze the project structure. Start by listing the root directory, then read the relevant config files.");
39
+ let data;
40
+ try {
41
+ // Extract JSON from the response
42
+ const jsonMatch = output.match(/\{[\s\S]*\}/);
43
+ data = jsonMatch ? JSON.parse(jsonMatch[0]) : { raw: output };
44
+ }
45
+ catch {
46
+ data = { raw: output };
47
+ }
48
+ return {
49
+ agentId: this.id,
50
+ data,
51
+ confidence: data && typeof data === "object" && "projectName" in data ? 0.9 : 0.5,
52
+ duration: Date.now() - start,
53
+ };
54
+ },
55
+ };
@@ -0,0 +1,2 @@
1
+ import type { ArchByteAgent } from "../runtime/types.js";
2
+ export declare const validator: ArchByteAgent;
@@ -0,0 +1,74 @@
1
+ import { executeToolLoop } from "../runtime/orchestrator.js";
2
+ export const validator = {
3
+ id: "validator",
4
+ name: "Architecture Validator",
5
+ description: "Validates analysis results: checks for orphans, broken references, and confidence scoring.",
6
+ tier: "free",
7
+ phase: "sequential",
8
+ modelTier: "standard",
9
+ requiredTools: ["read_file", "glob", "grep"],
10
+ systemPrompt: `You are an architecture validation agent. Your job is to review the results from all prior analysis agents and validate the findings.
11
+
12
+ You will receive prior results from: structure-scanner, doc-parser, infra-analyzer, component-detector, event-detector, env-detector, and connection-mapper.
13
+
14
+ Review all findings and return a JSON object with this structure:
15
+ {
16
+ "valid": boolean,
17
+ "overallConfidence": 0.0-1.0,
18
+ "issues": [
19
+ {
20
+ "type": "orphan-component | missing-connection | broken-reference | inconsistency | incomplete-analysis",
21
+ "severity": "error | warning | info",
22
+ "message": "description of the issue",
23
+ "component": "affected component name or null"
24
+ }
25
+ ],
26
+ "suggestions": [
27
+ "list of improvement suggestions for the architecture"
28
+ ],
29
+ "componentCount": number,
30
+ "connectionCount": number,
31
+ "layerDistribution": {
32
+ "presentation": number,
33
+ "application": number,
34
+ "data": number,
35
+ "external": number,
36
+ "deployment": number
37
+ }
38
+ }
39
+
40
+ Instructions:
41
+ 1. Review all prior agent results for consistency
42
+ 2. Check for orphan components (no connections)
43
+ 3. Check for broken references (connections to non-existent components)
44
+ 4. Verify layer assignments make sense
45
+ 5. Score overall confidence based on agent results
46
+ 6. Spot-check 2-3 findings by reading actual source files
47
+ 7. Return ONLY the JSON object, no other text`,
48
+ async run(context) {
49
+ const start = Date.now();
50
+ let priorContext = "Prior analysis results:\n\n";
51
+ if (context.priorResults) {
52
+ for (const [agentId, result] of Object.entries(context.priorResults)) {
53
+ priorContext += `--- ${agentId} (confidence: ${result.confidence}) ---\n`;
54
+ priorContext += JSON.stringify(result.data, null, 2);
55
+ priorContext += "\n\n";
56
+ }
57
+ }
58
+ const output = await executeToolLoop(context, this.systemPrompt, `Validate the architecture analysis results. Check for orphans, broken references, and inconsistencies. Spot-check a few findings against actual source code.\n\n${priorContext}`);
59
+ let data;
60
+ try {
61
+ const jsonMatch = output.match(/\{[\s\S]*\}/);
62
+ data = jsonMatch ? JSON.parse(jsonMatch[0]) : { raw: output };
63
+ }
64
+ catch {
65
+ data = { raw: output };
66
+ }
67
+ return {
68
+ agentId: this.id,
69
+ data,
70
+ confidence: data && typeof data === "object" && "valid" in data ? 0.9 : 0.5,
71
+ duration: Date.now() - start,
72
+ };
73
+ },
74
+ };
@@ -0,0 +1,24 @@
1
+ export { Orchestrator, executeToolLoop } from "./runtime/orchestrator.js";
2
+ export { AgentRegistry, getRegistry } from "./runtime/registry.js";
3
+ export type { ArchByteAgent, AgentContext, AgentResult, LLMProvider, ToolBackend, License, ArchByteConfig, ProviderName, ModelTier, AgentTier, PipelineResult, } from "./runtime/types.js";
4
+ export { MODEL_MAP, resolveModel } from "./runtime/types.js";
5
+ export { createProvider, detectConfig } from "./providers/router.js";
6
+ export { AnthropicProvider } from "./providers/anthropic.js";
7
+ export { OpenAIProvider } from "./providers/openai.js";
8
+ export { GoogleProvider } from "./providers/google.js";
9
+ export { OllamaProvider } from "./providers/ollama.js";
10
+ export { LocalFSBackend } from "./tools/local-fs.js";
11
+ export { ClaudeCodeBackend } from "./tools/claude-code.js";
12
+ export { AGENT_TOOLS } from "./tools/tool-definitions.js";
13
+ export { structureScanner } from "./core/structure-scanner.js";
14
+ export { componentDetector } from "./core/component-detector.js";
15
+ export { connectionMapper } from "./core/connection-mapper.js";
16
+ export { docParser } from "./core/doc-parser.js";
17
+ export { infraAnalyzer } from "./core/infra-analyzer.js";
18
+ export { eventDetector } from "./core/event-detector.js";
19
+ export { envDetector } from "./core/env-detector.js";
20
+ export { validator } from "./core/validator.js";
21
+ export declare const CORE_AGENTS: import("./runtime/types.js").ArchByteAgent[];
22
+ export declare function loadPremiumAgents(): Promise<typeof CORE_AGENTS>;
23
+ export declare const PREMIUM_AGENTS: typeof CORE_AGENTS;
24
+ export declare const ALL_AGENTS: import("./runtime/types.js").ArchByteAgent[];
@@ -0,0 +1,73 @@
1
+ // ArchByte Agent Framework — Main Entry Point
2
+ // Runtime
3
+ export { Orchestrator, executeToolLoop } from "./runtime/orchestrator.js";
4
+ export { AgentRegistry, getRegistry } from "./runtime/registry.js";
5
+ export { MODEL_MAP, resolveModel } from "./runtime/types.js";
6
+ // Providers
7
+ export { createProvider, detectConfig } from "./providers/router.js";
8
+ export { AnthropicProvider } from "./providers/anthropic.js";
9
+ export { OpenAIProvider } from "./providers/openai.js";
10
+ export { GoogleProvider } from "./providers/google.js";
11
+ export { OllamaProvider } from "./providers/ollama.js";
12
+ // Tools
13
+ export { LocalFSBackend } from "./tools/local-fs.js";
14
+ export { ClaudeCodeBackend } from "./tools/claude-code.js";
15
+ export { AGENT_TOOLS } from "./tools/tool-definitions.js";
16
+ // Core Agents
17
+ export { structureScanner } from "./core/structure-scanner.js";
18
+ export { componentDetector } from "./core/component-detector.js";
19
+ export { connectionMapper } from "./core/connection-mapper.js";
20
+ export { docParser } from "./core/doc-parser.js";
21
+ export { infraAnalyzer } from "./core/infra-analyzer.js";
22
+ export { eventDetector } from "./core/event-detector.js";
23
+ export { envDetector } from "./core/env-detector.js";
24
+ export { validator } from "./core/validator.js";
25
+ // Premium agents are not shipped in the npm package.
26
+ // They are loaded dynamically at runtime for licensed users.
27
+ // All core agents as a list for easy registration
28
+ import { structureScanner } from "./core/structure-scanner.js";
29
+ import { componentDetector } from "./core/component-detector.js";
30
+ import { connectionMapper } from "./core/connection-mapper.js";
31
+ import { docParser } from "./core/doc-parser.js";
32
+ import { infraAnalyzer } from "./core/infra-analyzer.js";
33
+ import { eventDetector } from "./core/event-detector.js";
34
+ import { envDetector } from "./core/env-detector.js";
35
+ import { validator } from "./core/validator.js";
36
+ export const CORE_AGENTS = [
37
+ structureScanner,
38
+ docParser,
39
+ infraAnalyzer,
40
+ componentDetector,
41
+ eventDetector,
42
+ envDetector,
43
+ connectionMapper,
44
+ validator,
45
+ ];
46
+ // Dynamic loader for premium agents (not bundled in npm package)
47
+ export async function loadPremiumAgents() {
48
+ try {
49
+ const mods = await Promise.all([
50
+ import("./premium/security-auditor.js"),
51
+ import("./premium/compliance-checker.js"),
52
+ import("./premium/performance-analyzer.js"),
53
+ import("./premium/dependency-risk-scorer.js"),
54
+ import("./premium/migration-planner.js"),
55
+ import("./premium/api-contract-verifier.js"),
56
+ import("./premium/drift-detector.js"),
57
+ ]);
58
+ return [
59
+ mods[0].securityAuditor,
60
+ mods[1].complianceChecker,
61
+ mods[2].performanceAnalyzer,
62
+ mods[3].dependencyRiskScorer,
63
+ mods[4].migrationPlanner,
64
+ mods[5].apiContractVerifier,
65
+ mods[6].driftDetector,
66
+ ];
67
+ }
68
+ catch {
69
+ return [];
70
+ }
71
+ }
72
+ export const PREMIUM_AGENTS = [];
73
+ export const ALL_AGENTS = [...CORE_AGENTS];
@@ -0,0 +1,8 @@
1
+ import type { StaticAnalysisResult } from "../static/types.js";
2
+ import type { LLMProvider, ArchByteConfig } from "../runtime/types.js";
3
+ export type { LLMEnhancement } from "./types.js";
4
+ /**
5
+ * Enhance static analysis with a single LLM call.
6
+ * Returns the merged analysis. On any failure, returns the original unchanged.
7
+ */
8
+ export declare function enhanceWithLLM(analysis: StaticAnalysisResult, provider: LLMProvider, config: ArchByteConfig, projectRoot: string, onProgress?: (msg: string) => void): Promise<StaticAnalysisResult>;