0xray 4.0.34 → 4.0.36
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.
- package/.grok-plugin/plugin.json +1 -1
- package/.xray/codex.json +12 -4
- package/.xray/features.json +1 -1
- package/AGENTS-consumer.md +6 -6
- package/AGENTS.md +5 -5
- package/README.md +2 -2
- package/dist/AGENTS.md +5 -5
- package/dist/CHANGELOG.md +26 -0
- package/dist/README.md +2 -2
- package/dist/cli/index.js +2 -5
- package/dist/governance/governance-service.js +1 -1
- package/dist/integrations/base/README.md +1 -9
- package/dist/integrations/base/index.d.ts +0 -1
- package/dist/integrations/base/index.js +0 -2
- package/dist/integrations/governance/index.js +31 -8
- package/dist/integrations/grok/hooks/grok-hook-utils.js +1 -1
- package/dist/integrations/grok/hooks/session-start.js +12 -0
- package/dist/integrations/grok/plugin/0xray/hooks/hooks.json +6 -6
- package/dist/integrations/hooks/goggles-mcp.mjs +10 -3
- package/dist/integrations/hooks/goggles-pipeline.mjs +110 -23
- package/dist/integrations/hooks/host-truth.mjs +74 -0
- package/dist/integrations/hooks/station-hook-runtime.cjs +3 -0
- package/dist/integrations/openclaw/plugin/xray-pre-tool/package.json +1 -1
- package/dist/mcps/knowledge-skills/storyteller.server.js +0 -1
- package/dist/nucleus/delegation-gate.d.ts +2 -2
- package/dist/nucleus/delegation-gate.js +13 -2
- package/dist/nucleus/work-freshness.mjs +189 -0
- package/dist/processors/implementations/agents-md-validation-processor.js +1 -1
- package/docs-site/docs/plates/boot.md +17 -2
- package/docs-site/docs/plates/governance.md +3 -2
- package/docs-site/docs/plates/index.md +3 -1
- package/docs-site/docs/plates/memory-recall.md +26 -35
- package/docs-site/docs/plates/orchestration.md +39 -35
- package/docs-site/docs/plates/processor.md +34 -36
- package/docs-site/docs/plates/reporting.md +3 -8
- package/docs-site/docs/plates/routing.md +22 -11
- package/package.json +3 -2
- package/scripts/foundry/release.mjs +48 -5
- package/scripts/mjs/run-grok-hook.mjs +50 -0
- package/scripts/mjs/test-consumer-readiness.mjs +1 -0
- package/scripts/mjs/test-mcp-functionality.mjs +14 -9
- package/scripts/node/basic-security-audit.cjs +0 -1
- package/scripts/node/bridge-mcp-wiring.cjs +66 -3
- package/scripts/node/install-bridges.cjs +3 -3
- package/scripts/node/postinstall.cjs +1 -1
- package/scripts/node/prepare-consumer.cjs +11 -7
- package/scripts/node/setup-dev.cjs +18 -26
- package/scripts/node/validate-mcp-connectivity.js +2 -1
- package/src/integrations/grok/plugin/0xray/hooks/hooks.json +6 -6
- package/src/integrations/openclaw/plugin/xray-pre-tool/package.json +1 -1
- package/src/mcps/knowledge-skills/storyteller.server.ts +0 -1
- package/xray/agents_template.md +5 -5
- package/xray/codex.json +12 -4
- package/xray/features.json +1 -1
- package/dist/agents/known-names.d.ts +0 -26
- package/dist/agents/known-names.js +0 -72
- package/dist/analytics/consent-manager.d.ts +0 -92
- package/dist/analytics/consent-manager.js +0 -257
- package/dist/benchmark/performance-benchmark.d.ts +0 -103
- package/dist/benchmark/performance-benchmark.js +0 -373
- package/dist/cli/commands/analytics-disable.d.ts +0 -9
- package/dist/cli/commands/analytics-disable.js +0 -72
- package/dist/cli/commands/analytics-enable-action.d.ts +0 -8
- package/dist/cli/commands/analytics-enable-action.js +0 -82
- package/dist/cli/commands/analytics-preview.d.ts +0 -9
- package/dist/cli/commands/analytics-preview.js +0 -106
- package/dist/cli/commands/analytics-status.d.ts +0 -9
- package/dist/cli/commands/analytics-status.js +0 -68
- package/dist/cli/commands/enforce.d.ts +0 -12
- package/dist/cli/commands/enforce.js +0 -78
- package/dist/cli/commands/govern.d.ts +0 -29
- package/dist/cli/commands/govern.js +0 -149
- package/dist/cli/commands/security-audit.d.ts +0 -23
- package/dist/cli/commands/security-audit.js +0 -219
- package/dist/cli/server.d.ts +0 -1
- package/dist/cli/server.js +0 -147
- package/dist/config/routing-mappings.d.ts +0 -26
- package/dist/config/routing-mappings.js +0 -151
- package/dist/core/bridge.mjs +0 -922
- package/dist/core/trace-context.d.ts +0 -12
- package/dist/core/trace-context.js +0 -33
- package/dist/enforcement/index.d.ts +0 -22
- package/dist/enforcement/index.js +0 -40
- package/dist/enforcement/loaders/index.d.ts +0 -36
- package/dist/enforcement/loaders/index.js +0 -39
- package/dist/enforcement/test-auto-healing.d.ts +0 -83
- package/dist/enforcement/test-auto-healing.js +0 -325
- package/dist/inference/index.d.ts +0 -10
- package/dist/inference/index.js +0 -5
- package/dist/infrastructure/iac-validator.d.ts +0 -150
- package/dist/infrastructure/iac-validator.js +0 -465
- package/dist/infrastructure/schemas/cloud-schemas.d.ts +0 -482
- package/dist/infrastructure/schemas/cloud-schemas.js +0 -488
- package/dist/integrations/base/ExampleIntegration.d.ts +0 -46
- package/dist/integrations/base/ExampleIntegration.js +0 -180
- package/dist/integrations/enforcement-gate.d.ts +0 -44
- package/dist/integrations/enforcement-gate.js +0 -348
- package/dist/mcps/connection/connection-manager.d.ts +0 -39
- package/dist/mcps/connection/connection-manager.js +0 -79
- package/dist/mcps/index.d.ts +0 -17
- package/dist/mcps/index.js +0 -65
- package/dist/mcps/orchestrator/index.d.ts +0 -6
- package/dist/mcps/orchestrator/index.js +0 -5
- package/dist/metrics/index.d.ts +0 -6
- package/dist/metrics/index.js +0 -6
- package/dist/orchestrator/self-direction-activation.d.ts +0 -108
- package/dist/orchestrator/self-direction-activation.js +0 -244
- package/dist/orchestrator/universal-registry-bridge.d.ts +0 -84
- package/dist/orchestrator/universal-registry-bridge.js +0 -246
- package/dist/performance/performance-budget-enforcer.d.ts +0 -157
- package/dist/performance/performance-budget-enforcer.js +0 -433
- package/dist/performance/performance-regression-tester.d.ts +0 -107
- package/dist/performance/performance-regression-tester.js +0 -341
- package/dist/postprocessor/analysis/CodeChangeAnalyzer.d.ts +0 -11
- package/dist/postprocessor/analysis/CodeChangeAnalyzer.js +0 -50
- package/dist/postprocessor/config/ProcessorConfigLoader.d.ts +0 -44
- package/dist/postprocessor/config/ProcessorConfigLoader.js +0 -16
- package/dist/postprocessor/integration.d.ts +0 -156
- package/dist/postprocessor/integration.js +0 -194
- package/dist/postprocessor/metamorphosis/index.d.ts +0 -2
- package/dist/postprocessor/metamorphosis/index.js +0 -1
- package/dist/postprocessor/redeploy/RetryHandler.d.ts +0 -49
- package/dist/postprocessor/redeploy/RetryHandler.js +0 -118
- package/dist/processors/implementations/session-capture-processor.d.ts +0 -14
- package/dist/processors/implementations/session-capture-processor.js +0 -37
- package/dist/public/XrayService.d.ts +0 -17
- package/dist/public/XrayService.js +0 -40
- package/dist/public/index.d.ts +0 -4
- package/dist/public/index.js +0 -2
- package/dist/security/comprehensive-security-audit.d.ts +0 -157
- package/dist/security/comprehensive-security-audit.js +0 -1004
- package/dist/security/index.d.ts +0 -13
- package/dist/security/index.js +0 -13
- package/dist/security/security-agent-coordinator.d.ts +0 -71
- package/dist/security/security-agent-coordinator.js +0 -203
- package/dist/security/security-hardening-system.d.ts +0 -238
- package/dist/security/security-hardening-system.js +0 -726
- package/dist/security/security-orchestration-layer.d.ts +0 -118
- package/dist/security/security-orchestration-layer.js +0 -495
- package/dist/testing/memory-regression-suite.d.ts +0 -105
- package/dist/testing/memory-regression-suite.js +0 -258
- package/dist/tools/assess-complexity-tool.d.ts +0 -28
- package/dist/tools/assess-complexity-tool.js +0 -44
- package/dist/tools/query-routing-tool.d.ts +0 -17
- package/dist/tools/query-routing-tool.js +0 -59
- package/dist/utils/batch-operations.d.ts +0 -25
- package/dist/utils/batch-operations.js +0 -292
- package/dist/utils/task-graph.d.ts +0 -29
- package/dist/utils/task-graph.js +0 -106
- package/dist/utils/test-template-generator.d.ts +0 -25
- package/dist/utils/test-template-generator.js +0 -178
- package/dist/utils/token-manager.d.ts +0 -48
- package/dist/utils/token-manager.js +0 -163
- package/dist/validation/agent-config-validator.d.ts +0 -110
- package/dist/validation/agent-config-validator.js +0 -280
- package/dist/validation/orchestration-flow-validator.d.ts +0 -87
- package/dist/validation/orchestration-flow-validator.js +0 -606
- package/src/mcps/connection/connection-manager.ts +0 -91
- package/src/mcps/index.ts +0 -80
- package/src/mcps/orchestrator/index.ts +0 -29
package/dist/cli/server.js
DELETED
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import express from "express";
|
|
2
|
-
import { exec } from "child_process";
|
|
3
|
-
import { join, dirname } from "path";
|
|
4
|
-
import { fileURLToPath } from "url";
|
|
5
|
-
import * as fs from "fs";
|
|
6
|
-
import * as crypto from "crypto";
|
|
7
|
-
import { frameworkLogger } from "../core/framework-logger.js";
|
|
8
|
-
import { resolveConfigPath } from "../core/config-paths.js";
|
|
9
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
10
|
-
const __dirname = dirname(__filename);
|
|
11
|
-
const ROOT_DIR = join(__dirname, "..", "..");
|
|
12
|
-
const PUBLIC_DIR = join(ROOT_DIR, "public");
|
|
13
|
-
// Read version dynamically from package.json
|
|
14
|
-
const packageJsonPath = join(ROOT_DIR, "package.json");
|
|
15
|
-
const { version } = JSON.parse(fs.readFileSync(packageJsonPath, "utf-8"));
|
|
16
|
-
const app = express();
|
|
17
|
-
const PORT = 3000;
|
|
18
|
-
const API_KEY = process.env.XRAY_API_KEY || undefined;
|
|
19
|
-
function timingSafeCompare(a, b) {
|
|
20
|
-
const aBuf = Buffer.from(a, "utf-8");
|
|
21
|
-
const bBuf = Buffer.from(b, "utf-8");
|
|
22
|
-
if (aBuf.length !== bBuf.length)
|
|
23
|
-
return false;
|
|
24
|
-
return crypto.timingSafeEqual(aBuf, bBuf);
|
|
25
|
-
}
|
|
26
|
-
function requireAuth(req, res, next) {
|
|
27
|
-
if (!API_KEY) {
|
|
28
|
-
frameworkLogger.log("cli-server", "auth-skipped", "warning", {
|
|
29
|
-
message: "No XRAY_API_KEY set — API is unauthenticated. Set XRAY_API_KEY in production.",
|
|
30
|
-
});
|
|
31
|
-
return next();
|
|
32
|
-
}
|
|
33
|
-
const providedKey = req.headers["x-api-key"];
|
|
34
|
-
if (typeof providedKey !== "string") {
|
|
35
|
-
return res.status(401).json({ error: "API key required. Set XRAY_API_KEY environment variable." });
|
|
36
|
-
}
|
|
37
|
-
if (!timingSafeCompare(providedKey, API_KEY)) {
|
|
38
|
-
return res.status(403).json({ error: "Invalid API key" });
|
|
39
|
-
}
|
|
40
|
-
next();
|
|
41
|
-
}
|
|
42
|
-
// Lazy load security headers middleware
|
|
43
|
-
let securityMiddleware = null;
|
|
44
|
-
const getSecurityMiddleware = async () => {
|
|
45
|
-
if (!securityMiddleware) {
|
|
46
|
-
try {
|
|
47
|
-
const { securityHeadersMiddleware } = await import("../security/security-headers");
|
|
48
|
-
securityMiddleware = securityHeadersMiddleware.getExpressMiddleware();
|
|
49
|
-
}
|
|
50
|
-
catch (error) {
|
|
51
|
-
frameworkLogger.log("cli-server", "security-middleware-unavailable", "warning", {
|
|
52
|
-
message: "Security middleware not available, continuing without security headers",
|
|
53
|
-
});
|
|
54
|
-
securityMiddleware = (req, res, next) => next(); // No-op middleware
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return securityMiddleware;
|
|
58
|
-
};
|
|
59
|
-
// Apply security headers middleware lazily
|
|
60
|
-
app.use(async (req, res, next) => {
|
|
61
|
-
try {
|
|
62
|
-
const middleware = await getSecurityMiddleware();
|
|
63
|
-
middleware(req, res, next);
|
|
64
|
-
}
|
|
65
|
-
catch (error) {
|
|
66
|
-
frameworkLogger.log("cli-server", "security-middleware-load-failed", "warning", {
|
|
67
|
-
error,
|
|
68
|
-
message: "Security middleware failed to load, continuing without it",
|
|
69
|
-
});
|
|
70
|
-
next();
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
// Serve static files
|
|
74
|
-
app.use(express.static(PUBLIC_DIR));
|
|
75
|
-
// API endpoints
|
|
76
|
-
app.get("/api/status", requireAuth, (req, res) => {
|
|
77
|
-
// Return framework status
|
|
78
|
-
res.json({
|
|
79
|
-
framework: "0xRay",
|
|
80
|
-
version,
|
|
81
|
-
status: "active",
|
|
82
|
-
agents: 8,
|
|
83
|
-
timestamp: new Date().toISOString(),
|
|
84
|
-
});
|
|
85
|
-
});
|
|
86
|
-
app.get("/api/agents", requireAuth, (req, res) => {
|
|
87
|
-
// Return agent configurations
|
|
88
|
-
res.json({
|
|
89
|
-
agents: [
|
|
90
|
-
"architect",
|
|
91
|
-
"bug-triage-specialist",
|
|
92
|
-
"code-reviewer",
|
|
93
|
-
"security-auditor",
|
|
94
|
-
"refactorer",
|
|
95
|
-
"testing-lead",
|
|
96
|
-
],
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
// Performance monitoring middleware
|
|
100
|
-
app.use((req, res, next) => {
|
|
101
|
-
const start = process.hrtime.bigint();
|
|
102
|
-
res.on("finish", () => {
|
|
103
|
-
const end = process.hrtime.bigint();
|
|
104
|
-
const duration = Number(end - start) / 1e6; // Convert to milliseconds
|
|
105
|
-
// HTTP request logging - operational, keep for monitoring
|
|
106
|
-
});
|
|
107
|
-
next();
|
|
108
|
-
});
|
|
109
|
-
// Add route for root path
|
|
110
|
-
app.get("/", (req, res) => {
|
|
111
|
-
res.sendFile(join(PUBLIC_DIR, "index.html"));
|
|
112
|
-
});
|
|
113
|
-
// Add route for refactoring logs
|
|
114
|
-
app.get("/logs", requireAuth, async (req, res) => {
|
|
115
|
-
const logPath = resolveConfigPath("REFACTORING_LOG.md") || join(__dirname, "..", ".xray", "REFACTORING_LOG.md");
|
|
116
|
-
// Server debug logging - remove for production
|
|
117
|
-
try {
|
|
118
|
-
if (fs.existsSync(logPath)) {
|
|
119
|
-
const content = fs.readFileSync(logPath, "utf-8");
|
|
120
|
-
res.setHeader("Content-Type", "text/markdown");
|
|
121
|
-
res.send(content);
|
|
122
|
-
}
|
|
123
|
-
else {
|
|
124
|
-
res
|
|
125
|
-
.status(404)
|
|
126
|
-
.send("Refactoring log not found. The framework may not have generated any logs yet.");
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
catch (error) {
|
|
130
|
-
// File read error - remove debug logging
|
|
131
|
-
res.status(500).send("Server error reading log file.");
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
// Global error handler (4-param middleware must be registered before listen)
|
|
135
|
-
app.use((err, req, res, _next) => {
|
|
136
|
-
frameworkLogger.log("cli-server", "unhandled-error", "error", { error: err, path: req.path });
|
|
137
|
-
res.status(500).send("Internal Server Error");
|
|
138
|
-
});
|
|
139
|
-
app.listen(PORT, () => {
|
|
140
|
-
// Auto-open browser
|
|
141
|
-
const start = process.platform === "darwin"
|
|
142
|
-
? "open"
|
|
143
|
-
: process.platform === "win32"
|
|
144
|
-
? "start"
|
|
145
|
-
: "xdg-open";
|
|
146
|
-
exec(`${start} http://localhost:${PORT}`);
|
|
147
|
-
});
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Routing Mappings — Shared keyword→agent+skill lookup table.
|
|
3
|
-
*
|
|
4
|
-
* Extracted from enforcer-tools.ts to be queryable at runtime
|
|
5
|
-
* by the main AI delegation decision tools.
|
|
6
|
-
*/
|
|
7
|
-
export interface RoutingMappingEntry {
|
|
8
|
-
keywords: string[];
|
|
9
|
-
skill: string;
|
|
10
|
-
agent: string;
|
|
11
|
-
confidence: number;
|
|
12
|
-
}
|
|
13
|
-
export declare const ROUTING_MAPPINGS: RoutingMappingEntry[];
|
|
14
|
-
export interface RoutingMatch {
|
|
15
|
-
agent: string;
|
|
16
|
-
skill: string;
|
|
17
|
-
confidence: number;
|
|
18
|
-
matchedKeywords: string[];
|
|
19
|
-
}
|
|
20
|
-
export declare function queryRoutingMappings(keywords: string[]): RoutingMatch[];
|
|
21
|
-
export declare function getAllRoutingMappings(): RoutingMappingEntry[];
|
|
22
|
-
/**
|
|
23
|
-
* Validate that all agent names in routing mappings exist in the SSOT.
|
|
24
|
-
* Call at boot to detect drift.
|
|
25
|
-
*/
|
|
26
|
-
export declare function validateRoutingMappings(validAgents: string[]): string[];
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Routing Mappings — Shared keyword→agent+skill lookup table.
|
|
3
|
-
*
|
|
4
|
-
* Extracted from enforcer-tools.ts to be queryable at runtime
|
|
5
|
-
* by the main AI delegation decision tools.
|
|
6
|
-
*/
|
|
7
|
-
export const ROUTING_MAPPINGS = [
|
|
8
|
-
// Core built-in skills (high confidence)
|
|
9
|
-
{ keywords: ["write", "file", "create"], skill: "code-review", agent: "code-reviewer", confidence: 0.9 },
|
|
10
|
-
{ keywords: ["review", "audit", "assess", "evaluate", "check", "inspect", "quality", "validate", "code-review"], skill: "code-review", agent: "code-reviewer", confidence: 0.9 },
|
|
11
|
-
{ keywords: ["test", "testing", "jest", "coverage", "unit", "e2e", "cypress", "spec", "verify"], skill: "testing-strategy", agent: "testing-lead", confidence: 0.95 },
|
|
12
|
-
{ keywords: ["fix", "debug", "triage", "broken", "error", "crash", "bug", "issue", "resolve"], skill: "bug-triage", agent: "bug-triage-specialist", confidence: 0.92 },
|
|
13
|
-
{ keywords: ["security", "vulnerability", "threat", "scan", "risk", "exploit", "secure", "pentest"], skill: "security-audit", agent: "security-auditor", confidence: 0.95 },
|
|
14
|
-
{ keywords: ["refactor", "cleanup", "improve", "restructure", "modernize", "debt"], skill: "refactoring-strategies", agent: "refactorer", confidence: 0.92 },
|
|
15
|
-
{ keywords: ["performance", "optimize", "bottleneck", "benchmark", "profile", "speed"], skill: "performance-optimization", agent: "performance-engineer", confidence: 0.93 },
|
|
16
|
-
{ keywords: ["frontend", "react", "vue", "angular", "ui", "ux", "interface", "component"], skill: "frontend-development", agent: "frontend-engineer", confidence: 0.95 },
|
|
17
|
-
{ keywords: ["backend", "api", "server", "microservice", "endpoint"], skill: "backend-development", agent: "backend-engineer", confidence: 0.95 },
|
|
18
|
-
{ keywords: ["docs", "documentation", "readme", "wiki", "guide", "manual"], skill: "documentation-generation", agent: "tech-writer", confidence: 0.9 },
|
|
19
|
-
{ keywords: ["database", "db", "sql", "schema", "migration", "query"], skill: "database-design", agent: "database-engineer", confidence: 0.95 },
|
|
20
|
-
{ keywords: ["deploy", "ci/cd", "pipeline", "docker", "kubernetes", "infrastructure"], skill: "devops-deployment", agent: "devops-engineer", confidence: 0.94 },
|
|
21
|
-
{ keywords: ["mobile", "ios", "android", "react-native", "flutter"], skill: "mobile-development", agent: "mobile-developer", confidence: 0.95 },
|
|
22
|
-
{ keywords: ["enforce", "compliance", "rule", "standard", "codex", "block", "prevent"], skill: "code-review", agent: "code-reviewer", confidence: 0.95 },
|
|
23
|
-
{ keywords: ["design", "architect", "plan", "system", "model", "pattern", "architecture"], skill: "architecture-patterns", agent: "architect", confidence: 0.95 },
|
|
24
|
-
{ keywords: ["codebase", "explore", "research", "discover", "implementation"], skill: "researcher", agent: "researcher", confidence: 0.92 },
|
|
25
|
-
// Additional built-in skill mappings
|
|
26
|
-
{ keywords: ["api", "rest", "graphql", "openapi", "endpoint", "swagger"], skill: "api-design", agent: "backend-engineer", confidence: 0.9 },
|
|
27
|
-
{ keywords: ["strategy", "roadmap", "planning", "technical", "decision", "architecture"], skill: "architecture-patterns", agent: "strategist", confidence: 0.88 },
|
|
28
|
-
{ keywords: ["reflection", "story", "narrative", "saga", "journey", "document"], skill: "storyteller", agent: "tech-writer", confidence: 0.85 },
|
|
29
|
-
{ keywords: ["analyze", "metrics", "complexity", "maintainability", "quality"], skill: "code-analyzer", agent: "code-analyzer", confidence: 0.9 },
|
|
30
|
-
{ keywords: ["growth", "marketing", "conversion", "acquisition", "user-acquisition"], skill: "growth-strategist", agent: "growth-strategist", confidence: 0.9 },
|
|
31
|
-
{ keywords: ["seo", "search", "organic", "traffic", "keywords", "ranking"], skill: "seo-consultant", agent: "seo-consultant", confidence: 0.92 },
|
|
32
|
-
{ keywords: ["content", "copy", "blog", "marketing", "social"], skill: "content-creator", agent: "content-creator", confidence: 0.88 },
|
|
33
|
-
{ keywords: ["format", "lint", "prettier", "eslint", "style", "formatting"], skill: "auto-format", agent: "code-reviewer", confidence: 0.85 },
|
|
34
|
-
{ keywords: ["project", "structure", "health", "dependencies", "architecture"], skill: "project-analysis", agent: "architect", confidence: 0.88 },
|
|
35
|
-
{ keywords: ["compliance", "audit", "standards", "framework", "validation"], skill: "framework-compliance-audit", agent: "code-reviewer", confidence: 0.9 },
|
|
36
|
-
{ keywords: ["session", "state", "persistence", "storage", "cache"], skill: "session-management", agent: "backend-engineer", confidence: 0.85 },
|
|
37
|
-
{ keywords: ["image", "visual", "pdf", "diagram", "multimedia", "media"], skill: "multimodal-looker", agent: "multimodal-looker", confidence: 0.92 },
|
|
38
|
-
{ keywords: ["testing", "strategy", "coverage", "test-plan"], skill: "testing-strategy", agent: "testing-lead", confidence: 0.92 },
|
|
39
|
-
{ keywords: ["inference", "model", "llm", "tuning", "optimization"], skill: "inference-improve", agent: "performance-engineer", confidence: 0.88 },
|
|
40
|
-
{ keywords: ["orchestrate", "boot", "initialize", "startup", "bootstrap"], skill: "boot-orchestrator", agent: "architect", confidence: 0.9 },
|
|
41
|
-
// Additional unmapped skills
|
|
42
|
-
{ keywords: ["tool", "utility", "helper", "instrument"], skill: "architect-tools", agent: "architect", confidence: 0.85 },
|
|
43
|
-
{ keywords: ["design", "visual", "style", "theme", "css", "accessibility"], skill: "ui-ux-design", agent: "frontend-ui-ux-engineer", confidence: 0.9 },
|
|
44
|
-
{ keywords: ["agent", "multi-agent", "coordination", "hermes", "communication"], skill: "hermes-agent", agent: "architect", confidence: 0.88 },
|
|
45
|
-
{ keywords: ["log", "diagnostic", "trace", "monitor", "watch"], skill: "log-monitor", agent: "log-monitor", confidence: 0.9 },
|
|
46
|
-
{ keywords: ["health", "diagnostic", "model-health", "validate-llm"], skill: "model-health-check", agent: "performance-engineer", confidence: 0.88 },
|
|
47
|
-
{ keywords: ["profiling", "memory", "cpu", "latency"], skill: "performance-analysis", agent: "performance-engineer", confidence: 0.9 },
|
|
48
|
-
{ keywords: ["pipeline", "stream", "etl", "batch", "process"], skill: "processor-pipeline", agent: "backend-engineer", confidence: 0.88 },
|
|
49
|
-
{ keywords: ["vulnerability", "cve", "sast", "dast", "dependency-check"], skill: "security-scan", agent: "security-auditor", confidence: 0.92 },
|
|
50
|
-
{ keywords: ["state", "store", "redux", "context", "persistence"], skill: "state-manager", agent: "backend-engineer", confidence: 0.88 },
|
|
51
|
-
// Community Skills (optional, lower confidence)
|
|
52
|
-
{ keywords: ["theme", "design-system", "color", "font", "typography", "palette"], skill: "antigravity--theme-factory", agent: "frontend-ui-ux-engineer", confidence: 0.6 },
|
|
53
|
-
{ keywords: ["hig", "salesforce design", "lightning design", "slds"], skill: "antigravity--hig-components-system", agent: "frontend-ui-ux-engineer", confidence: 0.65 },
|
|
54
|
-
{ keywords: ["slide", "deck", "presentation", "powerpoint"], skill: "antigravity--theme-factory", agent: "content-creator", confidence: 0.55 },
|
|
55
|
-
{ keywords: ["seo technical", "crawl", "indexability", "core web vitals", "sitemap"], skill: "antigravity--seo-technical", agent: "seo-consultant", confidence: 0.7 },
|
|
56
|
-
{ keywords: ["seo structure", "content hierarchy", "schema", "internal linking"], skill: "antigravity--seo-structure-architect", agent: "seo-consultant", confidence: 0.7 },
|
|
57
|
-
{ keywords: ["seo snippet", "meta description", "title tag"], skill: "antigravity--seo-snippet-hunter", agent: "seo-consultant", confidence: 0.7 },
|
|
58
|
-
{ keywords: ["seo hreflang", "international seo", "multilingual"], skill: "antigravity--seo-hreflang", agent: "seo-consultant", confidence: 0.65 },
|
|
59
|
-
{ keywords: ["backend security", "secure coding", "input validation", "authentication"], skill: "antigravity--backend-security-coder", agent: "security-auditor", confidence: 0.7 },
|
|
60
|
-
{ keywords: ["mobile security", "ios security", "android security"], skill: "antigravity--mobile-security-coder", agent: "security-auditor", confidence: 0.65 },
|
|
61
|
-
{ keywords: ["security audit", "vulnerability assessment", "penetration test"], skill: "security-audit", agent: "security-auditor", confidence: 0.75 },
|
|
62
|
-
{ keywords: ["vector", "embeddings", "similarity search", "pinecone", "qdrant", "chroma"], skill: "antigravity--vector-database-engineer", agent: "database-engineer", confidence: 0.65 },
|
|
63
|
-
{ keywords: ["similarity search", "approximate nearest neighbor"], skill: "antigravity--similarity-search-patterns", agent: "database-engineer", confidence: 0.65 },
|
|
64
|
-
{ keywords: ["svelte", "sveltekit", "svelte.js"], skill: "antigravity--sveltekit", agent: "frontend-engineer", confidence: 0.65 },
|
|
65
|
-
{ keywords: ["trpc", "typescript rpc", "tRPC"], skill: "antigravity--trpc-fullstack", agent: "backend-engineer", confidence: 0.65 },
|
|
66
|
-
{ keywords: ["vercel ai", "ai sdk", "vapi"], skill: "antigravity--vercel-ai-sdk-expert", agent: "backend-engineer", confidence: 0.65 },
|
|
67
|
-
{ keywords: ["threejs", "3d web", "webgl", "3d graphics"], skill: "antigravity--threejs-loaders", agent: "frontend-engineer", confidence: 0.6 },
|
|
68
|
-
{ keywords: ["comfyui", "ai image generation", "stable diffusion"], skill: "antigravity--comfyui-gateway", agent: "multimodal-looker", confidence: 0.6 },
|
|
69
|
-
{ keywords: ["swiftui", "ios development"], skill: "antigravity--swiftui-liquid-glass", agent: "mobile-developer", confidence: 0.7 },
|
|
70
|
-
{ keywords: ["ios performance", "swift optimization"], skill: "antigravity--swiftui-performance-audit", agent: "mobile-developer", confidence: 0.65 },
|
|
71
|
-
{ keywords: ["react native", "rn"], skill: "mobile-development", agent: "mobile-developer", confidence: 0.7 },
|
|
72
|
-
{ keywords: ["golang", "go", "gopher"], skill: "antigravity--golang-pro", agent: "backend-engineer", confidence: 0.65 },
|
|
73
|
-
{ keywords: ["temporal", "workflow", " durable execution"], skill: "antigravity--temporal-golang-pro", agent: "backend-engineer", confidence: 0.65 },
|
|
74
|
-
{ keywords: ["python async", "asyncio", "uvloop"], skill: "antigravity--async-python-patterns", agent: "backend-engineer", confidence: 0.65 },
|
|
75
|
-
{ keywords: ["pydantic", "data validation", "python models"], skill: "antigravity--pydantic-models-py", agent: "backend-engineer", confidence: 0.65 },
|
|
76
|
-
{ keywords: ["scala", "spark", "big data"], skill: "antigravity--scala-pro", agent: "backend-engineer", confidence: 0.6 },
|
|
77
|
-
{ keywords: ["dotnet", "c#", ".net"], skill: "antigravity--dotnet-backend-patterns", agent: "backend-engineer", confidence: 0.6 },
|
|
78
|
-
{ keywords: ["azure", "azd", "azure deploy"], skill: "antigravity--azd-deployment", agent: "devops-engineer", confidence: 0.65 },
|
|
79
|
-
{ keywords: ["azure storage", "file share"], skill: "antigravity--azure-storage-file-share-ts", agent: "devops-engineer", confidence: 0.6 },
|
|
80
|
-
{ keywords: ["azure service bus", "messaging"], skill: "antigravity--azure-servicebus-py", agent: "devops-engineer", confidence: 0.6 },
|
|
81
|
-
{ keywords: ["discord bot", "discord automation"], skill: "antigravity--discord-bot-architect", agent: "backend-engineer", confidence: 0.6 },
|
|
82
|
-
{ keywords: ["n8n", "workflow automation"], skill: "antigravity--n8n-expression-syntax", agent: "devops-engineer", confidence: 0.6 },
|
|
83
|
-
{ keywords: ["linkedin automation", "social posting"], skill: "antigravity--linkedin-automation", agent: "growth-strategist", confidence: 0.55 },
|
|
84
|
-
{ keywords: ["reddit automation"], skill: "antigravity--reddit-automation", agent: "growth-strategist", confidence: 0.55 },
|
|
85
|
-
{ keywords: ["freshdesk", "customer support automation"], skill: "antigravity--freshdesk-automation", agent: "devops-engineer", confidence: 0.55 },
|
|
86
|
-
{ keywords: ["pagerduty", "incident management"], skill: "antigravity--pagerduty-automation", agent: "devops-engineer", confidence: 0.55 },
|
|
87
|
-
{ keywords: ["local llm", "ollama", "llama", "local model"], skill: "antigravity--local-llm-expert", agent: "performance-engineer", confidence: 0.65 },
|
|
88
|
-
{ keywords: ["mcp", "model context protocol"], skill: "antigravity--agent-memory-mcp", agent: "architect", confidence: 0.65 },
|
|
89
|
-
{ keywords: ["agent evaluation", "agent testing"], skill: "antigravity--agent-evaluation", agent: "testing-lead", confidence: 0.65 },
|
|
90
|
-
{ keywords: ["ai agent", "autonomous agent"], skill: "antigravity--ai-agent-development", agent: "backend-engineer", confidence: 0.65 },
|
|
91
|
-
{ keywords: ["marketing content", "ad creative", "campaign"], skill: "antigravity--marketing-ideas", agent: "content-creator", confidence: 0.6 },
|
|
92
|
-
{ keywords: ["conversion", "cro", "optimization"], skill: "antigravity--onboarding-cro", agent: "growth-strategist", confidence: 0.6 },
|
|
93
|
-
{ keywords: ["code documentation", "code explain", "explain code"], skill: "antigravity--code-documentation-code-explain", agent: "tech-writer", confidence: 0.65 },
|
|
94
|
-
{ keywords: ["code refactoring", "clean code"], skill: "antigravity--code-refactoring-refactor-clean", agent: "refactorer", confidence: 0.65 },
|
|
95
|
-
{ keywords: ["code review checklist"], skill: "antigravity--code-review-checklist", agent: "code-reviewer", confidence: 0.7 },
|
|
96
|
-
{ keywords: ["microservices", "service mesh", "distributed systems"], skill: "antigravity--microservices-patterns", agent: "architect", confidence: 0.65 },
|
|
97
|
-
{ keywords: ["architecture decision", "adr", "decision records"], skill: "antigravity--architecture-decision-records", agent: "architect", confidence: 0.65 },
|
|
98
|
-
{ keywords: ["context management", "context compression", "token optimization"], skill: "antigravity--context-compression", agent: "performance-engineer", confidence: 0.65 },
|
|
99
|
-
{ keywords: ["context guardian", "memory safety"], skill: "antigravity--context-guardian", agent: "performance-engineer", confidence: 0.6 },
|
|
100
|
-
{ keywords: ["context fundamentals"], skill: "antigravity--context-fundamentals", agent: "performance-engineer", confidence: 0.6 },
|
|
101
|
-
{ keywords: ["interview", "technical interview", "coding interview"], skill: "antigravity--interview-coach", agent: "growth-strategist", confidence: 0.6 },
|
|
102
|
-
{ keywords: ["i18n", "localization", "translation"], skill: "antigravity--i18n-localization", agent: "frontend-engineer", confidence: 0.6 },
|
|
103
|
-
{ keywords: ["accessibility", "a11y", "wcag"], skill: "antigravity--accessibility-compliance-accessibility-audit", agent: "frontend-ui-ux-engineer", confidence: 0.7 },
|
|
104
|
-
{ keywords: ["pwa", "progressive web app"], skill: "antigravity--progressive-web-app", agent: "frontend-engineer", confidence: 0.6 },
|
|
105
|
-
{ keywords: ["data migration", "sql migration"], skill: "antigravity--database-migrations-sql-migrations", agent: "database-engineer", confidence: 0.65 },
|
|
106
|
-
{ keywords: ["request code review", "pr review", "pull request"], skill: "superpowers--requesting-code-review", agent: "code-reviewer", confidence: 0.7 },
|
|
107
|
-
];
|
|
108
|
-
export function queryRoutingMappings(keywords) {
|
|
109
|
-
const descLower = keywords.join(" ").toLowerCase();
|
|
110
|
-
const matches = [];
|
|
111
|
-
for (const mapping of ROUTING_MAPPINGS) {
|
|
112
|
-
const matched = [];
|
|
113
|
-
for (const kw of mapping.keywords) {
|
|
114
|
-
if (descLower.includes(kw.toLowerCase())) {
|
|
115
|
-
matched.push(kw);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
if (matched.length > 0) {
|
|
119
|
-
matches.push({
|
|
120
|
-
agent: mapping.agent,
|
|
121
|
-
skill: mapping.skill,
|
|
122
|
-
confidence: mapping.confidence,
|
|
123
|
-
matchedKeywords: matched,
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
matches.sort((a, b) => b.confidence - a.confidence);
|
|
128
|
-
return matches;
|
|
129
|
-
}
|
|
130
|
-
export function getAllRoutingMappings() {
|
|
131
|
-
return ROUTING_MAPPINGS;
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Validate that all agent names in routing mappings exist in the SSOT.
|
|
135
|
-
* Call at boot to detect drift.
|
|
136
|
-
*/
|
|
137
|
-
export function validateRoutingMappings(validAgents) {
|
|
138
|
-
const errors = [];
|
|
139
|
-
const seen = new Set();
|
|
140
|
-
for (const mapping of ROUTING_MAPPINGS) {
|
|
141
|
-
if (!validAgents.includes(mapping.agent)) {
|
|
142
|
-
errors.push(`Routing mapping references unknown agent "${mapping.agent}" (keywords: ${mapping.keywords.slice(0, 2).join(", ")})`);
|
|
143
|
-
}
|
|
144
|
-
const key = `${mapping.agent}:${mapping.skill}`;
|
|
145
|
-
if (seen.has(key)) {
|
|
146
|
-
errors.push(`Duplicate routing mapping: agent="${mapping.agent}" skill="${mapping.skill}"`);
|
|
147
|
-
}
|
|
148
|
-
seen.add(key);
|
|
149
|
-
}
|
|
150
|
-
return errors;
|
|
151
|
-
}
|