atabey 0.0.12 → 0.0.14
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/ATABEY.md +45 -499
- package/PRIVACY.md +161 -0
- package/README.md +553 -88
- package/bin/validate-al-registry.js +4 -4
- package/dist/framework-mcp/src/index.js +914 -62
- package/dist/framework-mcp/src/index.js.map +1 -1
- package/dist/framework-mcp/src/tools/compliance/mask_pii.d.ts +17 -0
- package/dist/framework-mcp/src/tools/compliance/mask_pii.js +56 -0
- package/dist/framework-mcp/src/tools/compliance/mask_pii.js.map +1 -0
- package/dist/framework-mcp/src/tools/definitions.js +24 -1
- package/dist/framework-mcp/src/tools/definitions.js.map +1 -1
- package/dist/framework-mcp/src/tools/framework/run_tests.js +25 -0
- package/dist/framework-mcp/src/tools/framework/run_tests.js.map +1 -1
- package/dist/framework-mcp/src/tools/gateway/llm_gateway_query.d.ts +19 -0
- package/dist/framework-mcp/src/tools/gateway/llm_gateway_query.js +138 -0
- package/dist/framework-mcp/src/tools/gateway/llm_gateway_query.js.map +1 -0
- package/dist/framework-mcp/src/tools/gateway/llm_gateway_status.d.ts +8 -0
- package/dist/framework-mcp/src/tools/gateway/llm_gateway_status.js +91 -0
- package/dist/framework-mcp/src/tools/gateway/llm_gateway_status.js.map +1 -0
- package/dist/framework-mcp/src/tools/index.d.ts +1 -1
- package/dist/framework-mcp/src/tools/index.js +34 -20
- package/dist/framework-mcp/src/tools/index.js.map +1 -1
- package/dist/framework-mcp/src/tools/messaging/approve_operation.d.ts +22 -0
- package/dist/framework-mcp/src/tools/messaging/approve_operation.js +81 -0
- package/dist/framework-mcp/src/tools/messaging/approve_operation.js.map +1 -0
- package/dist/framework-mcp/src/tools/messaging/ask_human.d.ts +15 -0
- package/dist/framework-mcp/src/tools/messaging/ask_human.js +89 -20
- package/dist/framework-mcp/src/tools/messaging/ask_human.js.map +1 -1
- package/dist/framework-mcp/src/tools/observability/check_ports.js +3 -1
- package/dist/framework-mcp/src/tools/observability/check_ports.js.map +1 -1
- package/dist/framework-mcp/src/tools/quality/analyze_code_quality.d.ts +11 -0
- package/dist/framework-mcp/src/tools/quality/analyze_code_quality.js +115 -0
- package/dist/framework-mcp/src/tools/quality/analyze_code_quality.js.map +1 -0
- package/dist/framework-mcp/src/tools/quality/check_architecture_compliance.d.ts +11 -0
- package/dist/framework-mcp/src/tools/quality/check_architecture_compliance.js +135 -0
- package/dist/framework-mcp/src/tools/quality/check_architecture_compliance.js.map +1 -0
- package/dist/framework-mcp/src/tools/schemas.d.ts +90 -15
- package/dist/framework-mcp/src/tools/schemas.js +32 -7
- package/dist/framework-mcp/src/tools/schemas.js.map +1 -1
- package/dist/framework-mcp/src/tools/shell/run_command.js +12 -2
- package/dist/framework-mcp/src/tools/shell/run_command.js.map +1 -1
- package/dist/framework-mcp/src/tools/types.d.ts +11 -105
- package/dist/framework-mcp/src/tools/types.js +1 -0
- package/dist/framework-mcp/src/tools/types.js.map +1 -1
- package/dist/framework-mcp/src/utils/auth.d.ts +36 -0
- package/dist/framework-mcp/src/utils/auth.js +79 -0
- package/dist/framework-mcp/src/utils/auth.js.map +1 -0
- package/dist/framework-mcp/src/utils/auto-rollback.d.ts +71 -0
- package/dist/framework-mcp/src/utils/auto-rollback.js +266 -0
- package/dist/framework-mcp/src/utils/auto-rollback.js.map +1 -0
- package/dist/framework-mcp/src/utils/compliance.js +12 -4
- package/dist/framework-mcp/src/utils/compliance.js.map +1 -1
- package/dist/framework-mcp/src/utils/context-optimizer.d.ts +69 -0
- package/dist/framework-mcp/src/utils/context-optimizer.js +157 -0
- package/dist/framework-mcp/src/utils/context-optimizer.js.map +1 -0
- package/dist/framework-mcp/src/utils/discipline.d.ts +68 -0
- package/dist/framework-mcp/src/utils/discipline.js +218 -0
- package/dist/framework-mcp/src/utils/discipline.js.map +1 -0
- package/dist/framework-mcp/src/utils/finops.d.ts +143 -0
- package/dist/framework-mcp/src/utils/finops.js +326 -0
- package/dist/framework-mcp/src/utils/finops.js.map +1 -0
- package/dist/framework-mcp/src/utils/human-in-loop.d.ts +95 -0
- package/dist/framework-mcp/src/utils/human-in-loop.js +216 -0
- package/dist/framework-mcp/src/utils/human-in-loop.js.map +1 -0
- package/dist/framework-mcp/src/utils/license-scanner.d.ts +71 -0
- package/dist/framework-mcp/src/utils/license-scanner.js +284 -0
- package/dist/framework-mcp/src/utils/license-scanner.js.map +1 -0
- package/dist/framework-mcp/src/utils/loop-detector.d.ts +105 -0
- package/dist/framework-mcp/src/utils/loop-detector.js +362 -0
- package/dist/framework-mcp/src/utils/loop-detector.js.map +1 -0
- package/dist/framework-mcp/src/utils/quality.d.ts +19 -0
- package/dist/framework-mcp/src/utils/quality.js +124 -0
- package/dist/framework-mcp/src/utils/quality.js.map +1 -0
- package/dist/framework-mcp/src/utils/rules-engine.d.ts +78 -0
- package/dist/framework-mcp/src/utils/rules-engine.js +232 -0
- package/dist/framework-mcp/src/utils/rules-engine.js.map +1 -0
- package/dist/framework-mcp/src/utils/silent-router.d.ts +47 -0
- package/dist/framework-mcp/src/utils/silent-router.js +129 -0
- package/dist/framework-mcp/src/utils/silent-router.js.map +1 -0
- package/dist/framework-mcp/src/utils/storage.d.ts +1 -0
- package/dist/framework-mcp/src/utils/storage.js +2 -2
- package/dist/framework-mcp/src/utils/storage.js.map +1 -1
- package/dist/framework-mcp/src/utils/telemetry-streamer.d.ts +133 -0
- package/dist/framework-mcp/src/utils/telemetry-streamer.js +397 -0
- package/dist/framework-mcp/src/utils/telemetry-streamer.js.map +1 -0
- package/dist/framework-mcp/tests/tools/file_system/file_system_tools.test.js +2 -2
- package/dist/framework-mcp/tests/tools/file_system/file_system_tools.test.js.map +1 -1
- package/dist/framework-mcp/tests/tools/framework/run_tests.test.d.ts +1 -0
- package/dist/framework-mcp/tests/tools/framework/run_tests.test.js +49 -0
- package/dist/framework-mcp/tests/tools/framework/run_tests.test.js.map +1 -0
- package/dist/framework-mcp/tests/tools/messaging/send_message.test.js +14 -5
- package/dist/framework-mcp/tests/tools/messaging/send_message.test.js.map +1 -1
- package/dist/framework-mcp/tests/tools/observability/check_ports.test.d.ts +1 -0
- package/dist/framework-mcp/tests/tools/observability/check_ports.test.js +30 -0
- package/dist/framework-mcp/tests/tools/observability/check_ports.test.js.map +1 -0
- package/dist/framework-mcp/tests/tools/shell/run_command.test.js +7 -0
- package/dist/framework-mcp/tests/tools/shell/run_command.test.js.map +1 -1
- package/dist/framework-mcp/tests/utils/auto-rollback.test.d.ts +7 -0
- package/dist/framework-mcp/tests/utils/auto-rollback.test.js +178 -0
- package/dist/framework-mcp/tests/utils/auto-rollback.test.js.map +1 -0
- package/dist/framework-mcp/tests/utils/context-optimizer.test.d.ts +1 -0
- package/dist/framework-mcp/tests/utils/context-optimizer.test.js +62 -0
- package/dist/framework-mcp/tests/utils/context-optimizer.test.js.map +1 -0
- package/dist/framework-mcp/tests/utils/finops.test.d.ts +7 -0
- package/dist/framework-mcp/tests/utils/finops.test.js +157 -0
- package/dist/framework-mcp/tests/utils/finops.test.js.map +1 -0
- package/dist/framework-mcp/tests/utils/human-in-loop.test.d.ts +1 -0
- package/dist/framework-mcp/tests/utils/human-in-loop.test.js +59 -0
- package/dist/framework-mcp/tests/utils/human-in-loop.test.js.map +1 -0
- package/dist/framework-mcp/tests/utils/license-scanner.test.d.ts +7 -0
- package/dist/framework-mcp/tests/utils/license-scanner.test.js +131 -0
- package/dist/framework-mcp/tests/utils/license-scanner.test.js.map +1 -0
- package/dist/framework-mcp/tests/utils/loop-detector.test.d.ts +7 -0
- package/dist/framework-mcp/tests/utils/loop-detector.test.js +204 -0
- package/dist/framework-mcp/tests/utils/loop-detector.test.js.map +1 -0
- package/dist/framework-mcp/tests/utils/rules-engine.test.d.ts +1 -0
- package/dist/framework-mcp/tests/utils/rules-engine.test.js +106 -0
- package/dist/framework-mcp/tests/utils/rules-engine.test.js.map +1 -0
- package/dist/framework-mcp/tests/utils/telemetry-streamer.test.d.ts +7 -0
- package/dist/framework-mcp/tests/utils/telemetry-streamer.test.js +201 -0
- package/dist/framework-mcp/tests/utils/telemetry-streamer.test.js.map +1 -0
- package/dist/src/cli/commands/check.js +18 -3
- package/dist/src/cli/commands/check.js.map +1 -1
- package/dist/src/cli/commands/dashboard.d.ts +1 -1
- package/dist/src/cli/commands/dashboard.js +343 -96
- package/dist/src/cli/commands/dashboard.js.map +1 -1
- package/dist/src/cli/commands/gateway.d.ts +1 -0
- package/dist/src/cli/commands/gateway.js +172 -0
- package/dist/src/cli/commands/gateway.js.map +1 -0
- package/dist/src/cli/commands/init/create-agent.js +3 -3
- package/dist/src/cli/commands/init/create-agent.js.map +1 -1
- package/dist/src/cli/commands/init/scaffold-core.d.ts +3 -1
- package/dist/src/cli/commands/init/scaffold-core.js +17 -2
- package/dist/src/cli/commands/init/scaffold-core.js.map +1 -1
- package/dist/src/cli/commands/init/scaffold-ops.js +2 -2
- package/dist/src/cli/commands/init/scaffold-ops.js.map +1 -1
- package/dist/src/cli/commands/init/scaffold-standards.js +13 -1
- package/dist/src/cli/commands/init/scaffold-standards.js.map +1 -1
- package/dist/src/cli/commands/init.d.ts +6 -0
- package/dist/src/cli/commands/init.js +163 -25
- package/dist/src/cli/commands/init.js.map +1 -1
- package/dist/src/cli/commands/mcp.d.ts +7 -0
- package/dist/src/cli/commands/mcp.js +45 -22
- package/dist/src/cli/commands/mcp.js.map +1 -1
- package/dist/src/cli/commands/orchestrate.d.ts +8 -7
- package/dist/src/cli/commands/orchestrate.js +2 -1
- package/dist/src/cli/commands/orchestrate.js.map +1 -1
- package/dist/src/cli/commands/quickstart.d.ts +5 -5
- package/dist/src/cli/commands/quickstart.js +30 -42
- package/dist/src/cli/commands/quickstart.js.map +1 -1
- package/dist/src/cli/index.js +228 -317
- package/dist/src/cli/index.js.map +1 -1
- package/dist/src/cli/platforms/core.d.ts +12 -0
- package/dist/src/cli/platforms/core.js +73 -0
- package/dist/src/cli/platforms/core.js.map +1 -0
- package/dist/src/cli/platforms/index.d.ts +5 -0
- package/dist/src/cli/platforms/index.js +6 -0
- package/dist/src/cli/platforms/index.js.map +1 -0
- package/dist/src/cli/platforms/paths.d.ts +15 -0
- package/dist/src/cli/platforms/paths.js +102 -0
- package/dist/src/cli/platforms/paths.js.map +1 -0
- package/dist/src/cli/platforms/scaffold.d.ts +2 -0
- package/dist/src/cli/platforms/scaffold.js +73 -0
- package/dist/src/cli/platforms/scaffold.js.map +1 -0
- package/dist/src/cli/platforms/utils.d.ts +4 -0
- package/dist/src/cli/platforms/utils.js +76 -0
- package/dist/src/cli/platforms/utils.js.map +1 -0
- package/dist/src/cli/shims.js +11 -11
- package/dist/src/cli/utils/fs.d.ts +1 -1
- package/dist/src/cli/utils/fs.js +1 -1
- package/dist/src/cli/utils/fs.js.map +1 -1
- package/dist/src/cli/utils/pkg.js +2 -3
- package/dist/src/cli/utils/pkg.js.map +1 -1
- package/dist/src/cli/utils/quality.d.ts +10 -0
- package/dist/src/cli/utils/quality.js +10 -0
- package/dist/src/cli/utils/quality.js.map +1 -0
- package/dist/src/modules/agents/definitions.d.ts +2 -2
- package/dist/src/modules/agents/definitions.js +104 -63
- package/dist/src/modules/agents/definitions.js.map +1 -1
- package/dist/src/modules/agents/registry/manager.js +6 -1
- package/dist/src/modules/agents/registry/manager.js.map +1 -1
- package/dist/src/modules/contracts/api.d.ts +178 -0
- package/dist/src/modules/contracts/api.js +56 -0
- package/dist/src/modules/contracts/api.js.map +1 -0
- package/dist/src/modules/contracts/index.d.ts +5 -0
- package/dist/src/modules/contracts/index.js +6 -0
- package/dist/src/modules/contracts/index.js.map +1 -0
- package/dist/src/modules/engines/agent-executor.d.ts +25 -30
- package/dist/src/modules/engines/agent-executor.js +133 -73
- package/dist/src/modules/engines/agent-executor.js.map +1 -1
- package/dist/src/modules/engines/agent-loop.d.ts +34 -0
- package/dist/src/modules/engines/agent-loop.js +102 -0
- package/dist/src/modules/engines/agent-loop.js.map +1 -0
- package/dist/src/modules/engines/evaluation-engine.js +2 -2
- package/dist/src/modules/engines/evaluation-engine.js.map +1 -1
- package/dist/src/modules/engines/quality-gate.d.ts +16 -8
- package/dist/src/modules/engines/quality-gate.js +42 -34
- package/dist/src/modules/engines/quality-gate.js.map +1 -1
- package/dist/src/modules/engines/routing-engine.d.ts +21 -28
- package/dist/src/modules/engines/routing-engine.js +83 -50
- package/dist/src/modules/engines/routing-engine.js.map +1 -1
- package/dist/src/modules/gateway/circuit-breaker.d.ts +40 -0
- package/dist/src/modules/gateway/circuit-breaker.js +163 -0
- package/dist/src/modules/gateway/circuit-breaker.js.map +1 -0
- package/dist/src/modules/gateway/cost-tracker.d.ts +60 -0
- package/dist/src/modules/gateway/cost-tracker.js +198 -0
- package/dist/src/modules/gateway/cost-tracker.js.map +1 -0
- package/dist/src/modules/gateway/gateway.d.ts +72 -0
- package/dist/src/modules/gateway/gateway.js +243 -0
- package/dist/src/modules/gateway/gateway.js.map +1 -0
- package/dist/src/modules/gateway/index.d.ts +19 -0
- package/dist/src/modules/gateway/index.js +19 -0
- package/dist/src/modules/gateway/index.js.map +1 -0
- package/dist/src/modules/gateway/load-balancer.d.ts +86 -0
- package/dist/src/modules/gateway/load-balancer.js +230 -0
- package/dist/src/modules/gateway/load-balancer.js.map +1 -0
- package/dist/src/modules/gateway/providers/anthropic.d.ts +14 -0
- package/dist/src/modules/gateway/providers/anthropic.js +169 -0
- package/dist/src/modules/gateway/providers/anthropic.js.map +1 -0
- package/dist/src/modules/gateway/providers/base.d.ts +38 -0
- package/dist/src/modules/gateway/providers/base.js +42 -0
- package/dist/src/modules/gateway/providers/base.js.map +1 -0
- package/dist/src/modules/gateway/providers/google.d.ts +18 -0
- package/dist/src/modules/gateway/providers/google.js +176 -0
- package/dist/src/modules/gateway/providers/google.js.map +1 -0
- package/dist/src/modules/gateway/providers/grok.d.ts +14 -0
- package/dist/src/modules/gateway/providers/grok.js +166 -0
- package/dist/src/modules/gateway/providers/grok.js.map +1 -0
- package/dist/src/modules/gateway/providers/index.d.ts +21 -0
- package/dist/src/modules/gateway/providers/index.js +38 -0
- package/dist/src/modules/gateway/providers/index.js.map +1 -0
- package/dist/src/modules/gateway/providers/ollama.d.ts +23 -0
- package/dist/src/modules/gateway/providers/ollama.js +187 -0
- package/dist/src/modules/gateway/providers/ollama.js.map +1 -0
- package/dist/src/modules/gateway/providers/openai.d.ts +14 -0
- package/dist/src/modules/gateway/providers/openai.js +170 -0
- package/dist/src/modules/gateway/providers/openai.js.map +1 -0
- package/dist/src/modules/gateway/rate-limiter.d.ts +41 -0
- package/dist/src/modules/gateway/rate-limiter.js +119 -0
- package/dist/src/modules/gateway/rate-limiter.js.map +1 -0
- package/dist/src/modules/gateway/types.d.ts +114 -0
- package/dist/src/modules/gateway/types.js +8 -0
- package/dist/src/modules/gateway/types.js.map +1 -0
- package/dist/src/modules/memory/core.d.ts +4 -12
- package/dist/src/modules/memory/core.js +10 -17
- package/dist/src/modules/memory/core.js.map +1 -1
- package/dist/src/modules/memory/embedding.d.ts +28 -0
- package/dist/src/modules/memory/embedding.js +131 -0
- package/dist/src/modules/memory/embedding.js.map +1 -0
- package/dist/src/modules/providers/definitions.d.ts +9 -0
- package/dist/src/modules/providers/definitions.js +141 -0
- package/dist/src/modules/providers/definitions.js.map +1 -0
- package/dist/src/modules/providers/registry.d.ts +12 -0
- package/dist/src/modules/providers/registry.js +19 -0
- package/dist/src/modules/providers/registry.js.map +1 -0
- package/dist/src/modules/providers/shared.d.ts +1 -0
- package/dist/src/modules/providers/shared.js +105 -0
- package/dist/src/modules/providers/shared.js.map +1 -0
- package/dist/src/modules/providers/types.d.ts +14 -0
- package/dist/src/modules/providers/types.js +2 -0
- package/dist/src/modules/providers/types.js.map +1 -0
- package/dist/src/modules/skills/adapter-skills.d.ts +68 -0
- package/dist/src/modules/skills/adapter-skills.js +450 -0
- package/dist/src/modules/skills/adapter-skills.js.map +1 -0
- package/dist/src/shared/audit.d.ts +105 -0
- package/dist/src/shared/audit.js +221 -0
- package/dist/src/shared/audit.js.map +1 -0
- package/dist/src/shared/fs.js +4 -2
- package/dist/src/shared/fs.js.map +1 -1
- package/dist/src/shared/lock.d.ts +82 -0
- package/dist/src/shared/lock.js +160 -0
- package/dist/src/shared/lock.js.map +1 -0
- package/dist/src/shared/logger.d.ts +2 -0
- package/dist/src/shared/logger.js +15 -5
- package/dist/src/shared/logger.js.map +1 -1
- package/dist/src/shared/pii.d.ts +69 -0
- package/dist/src/shared/pii.js +213 -0
- package/dist/src/shared/pii.js.map +1 -0
- package/dist/src/shared/retention.d.ts +63 -0
- package/dist/src/shared/retention.js +171 -0
- package/dist/src/shared/retention.js.map +1 -0
- package/dist/src/shared/storage.d.ts +22 -1
- package/dist/src/shared/storage.js +49 -7
- package/dist/src/shared/storage.js.map +1 -1
- package/dist/tests/adapter.test.js +1 -1
- package/dist/tests/adapter.test.js.map +1 -1
- package/dist/tests/adapters/paths.test.js +4 -4
- package/dist/tests/adapters/paths.test.js.map +1 -1
- package/dist/tests/cli/commands/dashboard-coverage.test.d.ts +1 -0
- package/dist/tests/cli/commands/dashboard-coverage.test.js +88 -0
- package/dist/tests/cli/commands/dashboard-coverage.test.js.map +1 -0
- package/dist/tests/cli/init/adapter_init.test.js +4 -5
- package/dist/tests/cli/init/adapter_init.test.js.map +1 -1
- package/dist/tests/cli/init/unified_init.test.js +5 -7
- package/dist/tests/cli/init/unified_init.test.js.map +1 -1
- package/dist/tests/embedding.test.d.ts +1 -0
- package/dist/tests/embedding.test.js +82 -0
- package/dist/tests/embedding.test.js.map +1 -0
- package/dist/tests/engines/evaluation-engine.test.d.ts +1 -0
- package/dist/tests/engines/evaluation-engine.test.js +71 -0
- package/dist/tests/engines/evaluation-engine.test.js.map +1 -0
- package/dist/tests/engines/planning-engine.test.d.ts +1 -0
- package/dist/tests/engines/planning-engine.test.js +100 -0
- package/dist/tests/engines/planning-engine.test.js.map +1 -0
- package/dist/tests/engines/quality-gate.test.d.ts +1 -0
- package/dist/tests/engines/quality-gate.test.js +59 -0
- package/dist/tests/engines/quality-gate.test.js.map +1 -0
- package/dist/tests/engines/risk-engine.test.d.ts +1 -0
- package/dist/tests/engines/risk-engine.test.js +80 -0
- package/dist/tests/engines/risk-engine.test.js.map +1 -0
- package/dist/tests/engines/routing-engine.test.d.ts +1 -0
- package/dist/tests/engines/routing-engine.test.js +78 -0
- package/dist/tests/engines/routing-engine.test.js.map +1 -0
- package/dist/tests/integration/agent_flow.test.js +14 -8
- package/dist/tests/integration/agent_flow.test.js.map +1 -1
- package/dist/tests/integration/hermes_locking.test.js +1 -0
- package/dist/tests/integration/hermes_locking.test.js.map +1 -1
- package/dist/tests/modules/adapters/adapters.test.js +2 -2
- package/dist/tests/modules/adapters/adapters.test.js.map +1 -1
- package/dist/tests/modules/contracts/contracts.test.d.ts +1 -0
- package/dist/tests/modules/contracts/contracts.test.js +73 -0
- package/dist/tests/modules/contracts/contracts.test.js.map +1 -0
- package/dist/tests/modules/engines/agent-executor.test.js +30 -23
- package/dist/tests/modules/engines/agent-executor.test.js.map +1 -1
- package/dist/tests/modules/gateway/circuit-breaker.test.d.ts +1 -0
- package/dist/tests/modules/gateway/circuit-breaker.test.js +124 -0
- package/dist/tests/modules/gateway/circuit-breaker.test.js.map +1 -0
- package/dist/tests/modules/gateway/cost-tracker.test.d.ts +1 -0
- package/dist/tests/modules/gateway/cost-tracker.test.js +93 -0
- package/dist/tests/modules/gateway/cost-tracker.test.js.map +1 -0
- package/dist/tests/modules/gateway/load-balancer.test.d.ts +1 -0
- package/dist/tests/modules/gateway/load-balancer.test.js +70 -0
- package/dist/tests/modules/gateway/load-balancer.test.js.map +1 -0
- package/dist/tests/modules/gateway/rate-limiter.test.d.ts +1 -0
- package/dist/tests/modules/gateway/rate-limiter.test.js +62 -0
- package/dist/tests/modules/gateway/rate-limiter.test.js.map +1 -0
- package/dist/tests/orchestrator-dependencies.test.js +23 -6
- package/dist/tests/orchestrator-dependencies.test.js.map +1 -1
- package/dist/tests/shared/audit.test.d.ts +1 -0
- package/dist/tests/shared/audit.test.js +53 -0
- package/dist/tests/shared/audit.test.js.map +1 -0
- package/dist/tests/shared/lock.test.d.ts +1 -0
- package/dist/tests/shared/lock.test.js +95 -0
- package/dist/tests/shared/lock.test.js.map +1 -0
- package/dist/tests/shared/pii.test.d.ts +1 -0
- package/dist/tests/shared/pii.test.js +183 -0
- package/dist/tests/shared/pii.test.js.map +1 -0
- package/dist/tests/storage-operations.test.d.ts +1 -0
- package/dist/tests/storage-operations.test.js +116 -0
- package/dist/tests/storage-operations.test.js.map +1 -0
- package/framework-mcp/README.md +596 -77
- package/framework-mcp/dist/dashboard/assets/index-B2mYld0c.js +1221 -0
- package/framework-mcp/dist/dashboard/index.html +15 -0
- package/framework-mcp/dist/framework-mcp/src/index.js +914 -62
- package/framework-mcp/dist/framework-mcp/src/tools/compliance/mask_pii.js +55 -0
- package/framework-mcp/dist/framework-mcp/src/tools/definitions.js +24 -1
- package/framework-mcp/dist/framework-mcp/src/tools/framework/run_tests.js +25 -0
- package/framework-mcp/dist/framework-mcp/src/tools/gateway/llm_gateway_query.js +137 -0
- package/framework-mcp/dist/framework-mcp/src/tools/gateway/llm_gateway_status.js +90 -0
- package/framework-mcp/dist/framework-mcp/src/tools/index.js +34 -20
- package/framework-mcp/dist/framework-mcp/src/tools/messaging/approve_operation.js +80 -0
- package/framework-mcp/dist/framework-mcp/src/tools/messaging/ask_human.js +89 -20
- package/framework-mcp/dist/framework-mcp/src/tools/observability/check_ports.js +3 -1
- package/framework-mcp/dist/framework-mcp/src/tools/quality/analyze_code_quality.js +114 -0
- package/framework-mcp/dist/framework-mcp/src/tools/quality/check_architecture_compliance.js +134 -0
- package/framework-mcp/dist/framework-mcp/src/tools/schemas.js +32 -7
- package/framework-mcp/dist/framework-mcp/src/tools/shell/run_command.js +12 -2
- package/framework-mcp/dist/framework-mcp/src/tools/types.js +1 -0
- package/framework-mcp/dist/framework-mcp/src/utils/auth.js +78 -0
- package/framework-mcp/dist/framework-mcp/src/utils/auto-rollback.js +265 -0
- package/framework-mcp/dist/framework-mcp/src/utils/compliance.js +12 -4
- package/framework-mcp/dist/framework-mcp/src/utils/context-optimizer.js +156 -0
- package/framework-mcp/dist/framework-mcp/src/utils/discipline.js +217 -0
- package/framework-mcp/dist/framework-mcp/src/utils/finops.js +325 -0
- package/framework-mcp/dist/framework-mcp/src/utils/human-in-loop.js +215 -0
- package/framework-mcp/dist/framework-mcp/src/utils/license-scanner.js +283 -0
- package/framework-mcp/dist/framework-mcp/src/utils/loop-detector.js +361 -0
- package/framework-mcp/dist/framework-mcp/src/utils/quality.js +123 -0
- package/framework-mcp/dist/framework-mcp/src/utils/rules-engine.js +231 -0
- package/framework-mcp/dist/framework-mcp/src/utils/silent-router.js +128 -0
- package/framework-mcp/dist/framework-mcp/src/utils/storage.js +2 -2
- package/framework-mcp/dist/framework-mcp/src/utils/telemetry-streamer.js +396 -0
- package/framework-mcp/dist/src/cli/platforms/core.js +72 -0
- package/framework-mcp/dist/src/cli/platforms/index.js +5 -0
- package/framework-mcp/dist/src/cli/platforms/paths.js +101 -0
- package/framework-mcp/dist/src/cli/platforms/scaffold.js +72 -0
- package/framework-mcp/dist/src/cli/platforms/utils.js +75 -0
- package/framework-mcp/dist/src/cli/utils/claude.js +57 -0
- package/framework-mcp/dist/src/cli/utils/compliance.js +12 -0
- package/framework-mcp/dist/src/cli/utils/fs.js +138 -0
- package/framework-mcp/dist/src/cli/utils/pkg.js +282 -0
- package/framework-mcp/dist/src/cli/utils/quality.js +9 -0
- package/framework-mcp/dist/src/modules/agents/definitions.js +563 -0
- package/framework-mcp/dist/src/modules/agents/registry/analyst.js +39 -0
- package/framework-mcp/dist/src/modules/agents/registry/architect.js +42 -0
- package/framework-mcp/dist/src/modules/agents/registry/backend.js +50 -0
- package/framework-mcp/dist/src/modules/agents/registry/database.js +45 -0
- package/framework-mcp/dist/src/modules/agents/registry/devops.js +45 -0
- package/framework-mcp/dist/src/modules/agents/registry/explorer.js +37 -0
- package/framework-mcp/dist/src/modules/agents/registry/frontend.js +52 -0
- package/framework-mcp/dist/src/modules/agents/registry/git.js +36 -0
- package/framework-mcp/dist/src/modules/agents/registry/manager.js +64 -0
- package/framework-mcp/dist/src/modules/agents/registry/mobile.js +41 -0
- package/framework-mcp/dist/src/modules/agents/registry/native.js +41 -0
- package/framework-mcp/dist/src/modules/agents/registry/quality.js +43 -0
- package/framework-mcp/dist/src/modules/agents/registry/security.js +42 -0
- package/framework-mcp/dist/src/modules/agents/types.js +1 -0
- package/framework-mcp/dist/src/modules/engines/quality-gate.js +92 -0
- package/framework-mcp/dist/src/modules/engines/risk-engine.js +105 -0
- package/framework-mcp/dist/src/modules/engines/routing-engine.js +408 -0
- package/framework-mcp/dist/src/modules/engines/types.js +1 -0
- package/framework-mcp/dist/src/modules/memory/core.js +10 -17
- package/framework-mcp/dist/src/modules/memory/embedding.js +130 -0
- package/framework-mcp/dist/src/modules/providers/definitions.js +140 -0
- package/framework-mcp/dist/src/modules/providers/registry.js +18 -0
- package/framework-mcp/dist/src/modules/providers/shared.js +104 -0
- package/framework-mcp/dist/src/modules/providers/types.js +1 -0
- package/framework-mcp/dist/src/modules/skills/adapter-skills.js +449 -0
- package/framework-mcp/dist/src/modules/skills/definitions.js +70 -0
- package/framework-mcp/dist/src/shared/audit.js +220 -0
- package/framework-mcp/dist/src/shared/errors.js +68 -0
- package/framework-mcp/dist/src/shared/fs.js +4 -2
- package/framework-mcp/dist/src/shared/lock.js +159 -0
- package/framework-mcp/dist/src/shared/logger.js +15 -5
- package/framework-mcp/dist/src/shared/pii.js +212 -0
- package/framework-mcp/dist/src/shared/retention.js +170 -0
- package/framework-mcp/dist/src/shared/storage.js +49 -7
- package/framework-mcp/dist/src/shared/string.js +29 -0
- package/framework-mcp/package.json +8 -2
- package/mcp.json +11 -6
- package/package.json +22 -9
- package/templates/full/ATABEY_FULL.md +515 -0
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [MEMORY] Embedding Service
|
|
3
|
+
*
|
|
4
|
+
* Real embedding generation with OpenAI API integration.
|
|
5
|
+
* Falls back to TF-IDF if no API key is available.
|
|
6
|
+
*
|
|
7
|
+
* Supported methods:
|
|
8
|
+
* 1. OpenAI Embedding API (text-embedding-3-small) — 1536 dimensions
|
|
9
|
+
* 2. TF-IDF fallback (local method) — 384 dimensions
|
|
10
|
+
*/
|
|
11
|
+
import fs from "fs";
|
|
12
|
+
import path from "path";
|
|
13
|
+
import { logger } from "../../shared/logger.js";
|
|
14
|
+
import { CoreMemory } from "./core.js";
|
|
15
|
+
const EMBEDDING_API = "https://api.openai.com/v1/embeddings";
|
|
16
|
+
const EMBEDDING_MODEL = "text-embedding-3-small";
|
|
17
|
+
const EMBEDDING_DIM = 1536;
|
|
18
|
+
/**
|
|
19
|
+
* Reads the API key from environment variable or .env file.
|
|
20
|
+
*/
|
|
21
|
+
function getApiKey() {
|
|
22
|
+
if (process.env.OPENAI_API_KEY)
|
|
23
|
+
return process.env.OPENAI_API_KEY;
|
|
24
|
+
try {
|
|
25
|
+
const envPath = path.join(process.cwd(), ".env");
|
|
26
|
+
if (fs.existsSync(envPath)) {
|
|
27
|
+
const content = fs.readFileSync(envPath, "utf8");
|
|
28
|
+
const match = content.match(/^OPENAI_API_KEY=(.+)$/m);
|
|
29
|
+
if (match)
|
|
30
|
+
return match[1].trim();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
// Silently ignore .env read errors
|
|
35
|
+
}
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Generates an embedding vector for the given text.
|
|
40
|
+
*
|
|
41
|
+
* Priority:
|
|
42
|
+
* 1. OpenAI API (if API key is available)
|
|
43
|
+
* 2. TF-IDF fallback (local)
|
|
44
|
+
*/
|
|
45
|
+
export async function generateEmbedding(text) {
|
|
46
|
+
const apiKey = getApiKey();
|
|
47
|
+
// Use OpenAI API if available
|
|
48
|
+
if (apiKey) {
|
|
49
|
+
try {
|
|
50
|
+
const response = await fetch(EMBEDDING_API, {
|
|
51
|
+
method: "POST",
|
|
52
|
+
headers: {
|
|
53
|
+
"Content-Type": "application/json",
|
|
54
|
+
"Authorization": `Bearer ${apiKey}`,
|
|
55
|
+
},
|
|
56
|
+
body: JSON.stringify({
|
|
57
|
+
input: text,
|
|
58
|
+
model: EMBEDDING_MODEL,
|
|
59
|
+
}),
|
|
60
|
+
});
|
|
61
|
+
if (!response.ok) {
|
|
62
|
+
logger.warn(`OpenAI API error: ${response.status}. Falling back to TF-IDF.`);
|
|
63
|
+
return fallbackEmbedding(text);
|
|
64
|
+
}
|
|
65
|
+
const data = await response.json();
|
|
66
|
+
if (data?.data?.[0]?.embedding) {
|
|
67
|
+
return data.data[0].embedding;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
catch (err) {
|
|
71
|
+
logger.warn(`OpenAI API call failed: ${err.message}. Falling back to TF-IDF.`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
// Fallback: TF-IDF
|
|
75
|
+
return fallbackEmbedding(text);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* TF-IDF fallback embedding using CoreMemory.generateEmbedding.
|
|
79
|
+
* OpenAI embedding is 1536 dimensions, TF-IDF is 384 dimensions.
|
|
80
|
+
* Pads TF-IDF output to 1536 for compatibility.
|
|
81
|
+
*/
|
|
82
|
+
function fallbackEmbedding(text) {
|
|
83
|
+
const tfidfVector = CoreMemory.generateEmbedding(text); // 384 dimensions
|
|
84
|
+
// Pad 384 → 1536
|
|
85
|
+
const padded = new Array(EMBEDDING_DIM).fill(0);
|
|
86
|
+
for (let i = 0; i < tfidfVector.length; i++) {
|
|
87
|
+
padded[i] = tfidfVector[i];
|
|
88
|
+
}
|
|
89
|
+
return padded;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Batch embedding generation. Single API call for multiple texts.
|
|
93
|
+
* OpenAI supports batch requests natively.
|
|
94
|
+
*/
|
|
95
|
+
export async function generateEmbeddings(texts) {
|
|
96
|
+
const apiKey = getApiKey();
|
|
97
|
+
if (apiKey) {
|
|
98
|
+
try {
|
|
99
|
+
const response = await fetch(EMBEDDING_API, {
|
|
100
|
+
method: "POST",
|
|
101
|
+
headers: {
|
|
102
|
+
"Content-Type": "application/json",
|
|
103
|
+
"Authorization": `Bearer ${apiKey}`,
|
|
104
|
+
},
|
|
105
|
+
body: JSON.stringify({
|
|
106
|
+
input: texts,
|
|
107
|
+
model: EMBEDDING_MODEL,
|
|
108
|
+
}),
|
|
109
|
+
});
|
|
110
|
+
if (response.ok) {
|
|
111
|
+
const data = await response.json();
|
|
112
|
+
if (data?.data) {
|
|
113
|
+
return data.data.map(d => d.embedding);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
catch {
|
|
118
|
+
// fallback
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
// Fallback for each text
|
|
122
|
+
return Promise.all(texts.map(t => fallbackEmbedding(t)));
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Checks if a vector is an OpenAI embedding (1536 dimensions)
|
|
126
|
+
* as opposed to TF-IDF (384 dimensions).
|
|
127
|
+
*/
|
|
128
|
+
export function isOpenAIEmbedding(vector) {
|
|
129
|
+
return vector.length === EMBEDDING_DIM;
|
|
130
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
import { addMcpServerToClaude, findClaudeConfigPath } from "../../cli/utils/claude.js";
|
|
3
|
+
import { writeJsonFile } from "../../shared/fs.js";
|
|
4
|
+
import { registerGlobalAntigravityPlugins } from "./shared.js";
|
|
5
|
+
import { registry } from "./registry.js";
|
|
6
|
+
import { UI } from "../../cli/utils/ui.js";
|
|
7
|
+
// ─── Register Core Adapters ──────────────────────────────────────────────────
|
|
8
|
+
// [GEMINI] Gemini
|
|
9
|
+
registry.register({
|
|
10
|
+
id: "gemini",
|
|
11
|
+
frameworkDir: ".gemini",
|
|
12
|
+
shimFile: "GEMINI.md",
|
|
13
|
+
shimTemplate: "src/cli/shims/gemini.md",
|
|
14
|
+
role: "commander",
|
|
15
|
+
templateDir: ".atabey",
|
|
16
|
+
nestedDirs: ["agents", "rules"],
|
|
17
|
+
agentsDir: ".gemini/agents",
|
|
18
|
+
agentsExt: ".md"
|
|
19
|
+
}, (projectRoot, mcpBlock) => {
|
|
20
|
+
const frameworkDir = ".gemini";
|
|
21
|
+
writeJsonFile(path.join(projectRoot, frameworkDir, "mcp.json"), mcpBlock);
|
|
22
|
+
UI.success(`Gemini MCP registered → ${frameworkDir}/mcp.json`);
|
|
23
|
+
registerGlobalAntigravityPlugins(mcpBlock);
|
|
24
|
+
});
|
|
25
|
+
// [START] Claude
|
|
26
|
+
registry.register({
|
|
27
|
+
id: "claude",
|
|
28
|
+
frameworkDir: ".claude",
|
|
29
|
+
shimFile: "CLAUDE.md",
|
|
30
|
+
shimTemplate: "src/cli/shims/claude.md",
|
|
31
|
+
role: "architect",
|
|
32
|
+
templateDir: ".atabey",
|
|
33
|
+
nestedDirs: ["agents", "rules"],
|
|
34
|
+
agentsDir: ".claude/agents",
|
|
35
|
+
agentsExt: ".md"
|
|
36
|
+
}, (projectRoot, mcpBlock) => {
|
|
37
|
+
const configPath = findClaudeConfigPath();
|
|
38
|
+
if (configPath) {
|
|
39
|
+
const block = mcpBlock;
|
|
40
|
+
const mcpEntry = block.mcpServers["atabey"];
|
|
41
|
+
const ok = addMcpServerToClaude(configPath, "atabey", mcpEntry);
|
|
42
|
+
if (ok)
|
|
43
|
+
UI.success(`Claude MCP registered → ${configPath}`);
|
|
44
|
+
}
|
|
45
|
+
const frameworkDir = ".claude";
|
|
46
|
+
writeJsonFile(path.join(projectRoot, frameworkDir, "mcp_config.json"), mcpBlock);
|
|
47
|
+
writeJsonFile(path.join(projectRoot, ".mcp.json"), mcpBlock);
|
|
48
|
+
UI.success("Claude Code Project MCP → .mcp.json");
|
|
49
|
+
});
|
|
50
|
+
// [AI] Grok
|
|
51
|
+
registry.register({
|
|
52
|
+
id: "grok",
|
|
53
|
+
frameworkDir: ".grok",
|
|
54
|
+
shimFile: "GROK.md",
|
|
55
|
+
shimTemplate: "src/cli/shims/grok.md",
|
|
56
|
+
role: "researcher",
|
|
57
|
+
templateDir: ".atabey",
|
|
58
|
+
nestedDirs: ["agents", "rules"],
|
|
59
|
+
agentsDir: ".grok/agents",
|
|
60
|
+
agentsExt: ".md"
|
|
61
|
+
}, (projectRoot, mcpBlock) => {
|
|
62
|
+
const frameworkDir = ".grok";
|
|
63
|
+
writeJsonFile(path.join(projectRoot, frameworkDir, "mcp_config.json"), mcpBlock);
|
|
64
|
+
UI.success(`Grok MCP → ${frameworkDir}/mcp_config.json`);
|
|
65
|
+
});
|
|
66
|
+
// [CURSOR] Cursor
|
|
67
|
+
registry.register({
|
|
68
|
+
id: "cursor",
|
|
69
|
+
frameworkDir: ".cursor",
|
|
70
|
+
shimFile: "CURSOR.md",
|
|
71
|
+
shimTemplate: "src/cli/shims/cursor.mdc",
|
|
72
|
+
role: "implementer",
|
|
73
|
+
templateDir: ".atabey",
|
|
74
|
+
nestedDirs: ["rules"],
|
|
75
|
+
agentsDir: ".cursor/rules",
|
|
76
|
+
agentsExt: ".mdc"
|
|
77
|
+
}, (projectRoot, mcpBlock) => {
|
|
78
|
+
const frameworkDir = ".cursor";
|
|
79
|
+
writeJsonFile(path.join(projectRoot, frameworkDir, "mcp.json"), mcpBlock);
|
|
80
|
+
UI.success(`Cursor IDE Project MCP → ${frameworkDir}/mcp.json`);
|
|
81
|
+
});
|
|
82
|
+
// [TIP] Codex (Copilot)
|
|
83
|
+
registry.register({
|
|
84
|
+
id: "codex",
|
|
85
|
+
frameworkDir: ".agents",
|
|
86
|
+
shimFile: "copilot-instructions.md",
|
|
87
|
+
shimTemplate: "src/cli/shims/codex.md",
|
|
88
|
+
role: "implementer",
|
|
89
|
+
templateDir: ".atabey",
|
|
90
|
+
nestedDirs: ["skills", "rules", "instructions"],
|
|
91
|
+
agentsDir: ".agents/instructions",
|
|
92
|
+
agentsExt: ".md"
|
|
93
|
+
}, (projectRoot, mcpBlock) => {
|
|
94
|
+
const frameworkDir = ".agents";
|
|
95
|
+
writeJsonFile(path.join(projectRoot, frameworkDir, "mcp_config.json"), mcpBlock);
|
|
96
|
+
writeJsonFile(path.join(projectRoot, ".vscode/mcp.json"), mcpBlock);
|
|
97
|
+
writeJsonFile(path.join(projectRoot, ".mcp.json"), mcpBlock);
|
|
98
|
+
UI.success("GitHub Copilot Project MCP → .vscode/mcp.json & .mcp.json");
|
|
99
|
+
});
|
|
100
|
+
// [LOCAL] Local LLM (Ollama / Private AI)
|
|
101
|
+
registry.register({
|
|
102
|
+
id: "local",
|
|
103
|
+
frameworkDir: ".atabey",
|
|
104
|
+
shimFile: "LOCAL_AI.md",
|
|
105
|
+
shimTemplate: "src/cli/shims/local.md",
|
|
106
|
+
role: "commander",
|
|
107
|
+
templateDir: ".atabey",
|
|
108
|
+
nestedDirs: ["agents", "rules"],
|
|
109
|
+
agentsDir: ".atabey/agents",
|
|
110
|
+
agentsExt: ".md"
|
|
111
|
+
}, (projectRoot, mcpBlock) => {
|
|
112
|
+
const frameworkDir = ".atabey";
|
|
113
|
+
writeJsonFile(path.join(projectRoot, frameworkDir, "mcp_config.json"), mcpBlock);
|
|
114
|
+
UI.success(`Local LLM MCP (Ollama/Private AI) registered → ${frameworkDir}/mcp_config.json`);
|
|
115
|
+
});
|
|
116
|
+
// [ANTIGRAVITY] Antigravity
|
|
117
|
+
registry.register({
|
|
118
|
+
id: "antigravity-cli",
|
|
119
|
+
frameworkDir: ".agents",
|
|
120
|
+
shimFile: "AGENTS.md",
|
|
121
|
+
shimTemplate: "src/cli/shims/antigravity-cli.md",
|
|
122
|
+
role: "general",
|
|
123
|
+
templateDir: ".atabey",
|
|
124
|
+
nestedDirs: ["agents", "plugins", "rules"],
|
|
125
|
+
agentsDir: ".agents/agents",
|
|
126
|
+
agentsExt: ".md"
|
|
127
|
+
}, (projectRoot, mcpBlock) => {
|
|
128
|
+
const frameworkDir = ".agents";
|
|
129
|
+
writeJsonFile(path.join(projectRoot, frameworkDir, "mcp_config.json"), mcpBlock);
|
|
130
|
+
UI.success(`Antigravity CLI MCP → ${frameworkDir}/mcp_config.json`);
|
|
131
|
+
registerGlobalAntigravityPlugins(mcpBlock);
|
|
132
|
+
});
|
|
133
|
+
/**
|
|
134
|
+
* Mapped Adapter Configurations
|
|
135
|
+
*/
|
|
136
|
+
export const ADAPTER_CONFIGS = registry.getConfigs();
|
|
137
|
+
/**
|
|
138
|
+
* Post-Initialization Handlers for specific adapters
|
|
139
|
+
*/
|
|
140
|
+
export const POST_INIT_HANDLERS = registry.getHandlers();
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
class AdapterRegistry {
|
|
2
|
+
configs = new Map();
|
|
3
|
+
handlers = new Map();
|
|
4
|
+
register(config, handler) {
|
|
5
|
+
this.configs.set(config.id, config);
|
|
6
|
+
this.handlers.set(config.id, handler);
|
|
7
|
+
}
|
|
8
|
+
getConfigs() {
|
|
9
|
+
return Object.fromEntries(this.configs);
|
|
10
|
+
}
|
|
11
|
+
getHandlers() {
|
|
12
|
+
return Object.fromEntries(this.handlers);
|
|
13
|
+
}
|
|
14
|
+
getIds() {
|
|
15
|
+
return Array.from(this.configs.keys());
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export const registry = new AdapterRegistry();
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
import os from "os";
|
|
4
|
+
import { execSync } from "child_process";
|
|
5
|
+
import { writeJsonFile, writeTextFile } from "../../shared/fs.js";
|
|
6
|
+
import { ALL_AGENTS, toAntigravityJson } from "../agents/definitions.js";
|
|
7
|
+
import { CORE_SKILLS } from "../skills/definitions.js";
|
|
8
|
+
import { getPackageRoot } from "../../cli/utils/pkg.js";
|
|
9
|
+
import { logger } from "../../shared/logger.js";
|
|
10
|
+
export function registerGlobalAntigravityPlugins(mcpBlock) {
|
|
11
|
+
// Allow overriding via env var for different OS/Gemini CLI versions
|
|
12
|
+
const defaultGlobalDir = path.join(os.homedir(), ".gemini/antigravity-cli");
|
|
13
|
+
const customDir = process.env["ANTIGRAVITY_GLOBAL_DIR"];
|
|
14
|
+
const targets = [customDir ?? defaultGlobalDir];
|
|
15
|
+
const baseKnowledgeDir = path.join(getPackageRoot(), "templates/standards");
|
|
16
|
+
for (const globalDir of targets) {
|
|
17
|
+
try {
|
|
18
|
+
// Write directly under directory
|
|
19
|
+
fs.mkdirSync(globalDir, { recursive: true });
|
|
20
|
+
writeJsonFile(path.join(globalDir, "mcp.json"), mcpBlock);
|
|
21
|
+
writeJsonFile(path.join(globalDir, "mcp_config.json"), mcpBlock);
|
|
22
|
+
logger.info(`Antigravity MCP registered → ${globalDir}/`);
|
|
23
|
+
// Global Plugin configuration under plugins/atabey/
|
|
24
|
+
const globalPluginDir = path.join(globalDir, "plugins/atabey");
|
|
25
|
+
fs.mkdirSync(globalPluginDir, { recursive: true });
|
|
26
|
+
// plugin.json marker
|
|
27
|
+
writeJsonFile(path.join(globalPluginDir, "plugin.json"), {
|
|
28
|
+
name: "atabey",
|
|
29
|
+
version: "1.0.0",
|
|
30
|
+
description: "Agent Atabey AI Orchestration framework"
|
|
31
|
+
});
|
|
32
|
+
// MCP Server configs inside the plugin
|
|
33
|
+
writeJsonFile(path.join(globalPluginDir, "mcp.json"), mcpBlock);
|
|
34
|
+
writeJsonFile(path.join(globalPluginDir, "mcp_config.json"), mcpBlock);
|
|
35
|
+
// Scaffold 13 agents
|
|
36
|
+
const agentsBaseDir = path.join(globalPluginDir, "agents");
|
|
37
|
+
fs.mkdirSync(agentsBaseDir, { recursive: true });
|
|
38
|
+
// Also write directly to ~/.gemini/antigravity-cli/agents/ so the CLI's
|
|
39
|
+
// workspace/global agent discovery finds them without the plugins/ prefix.
|
|
40
|
+
const globalAgentsDir = path.join(globalDir, "agents");
|
|
41
|
+
fs.mkdirSync(globalAgentsDir, { recursive: true });
|
|
42
|
+
for (const ag of ALL_AGENTS) {
|
|
43
|
+
const agentJson = toAntigravityJson(ag, baseKnowledgeDir);
|
|
44
|
+
// 1. Nested format inside plugin: plugins/atabey/agents/{name}/agent.json
|
|
45
|
+
const nestedAgentDir = path.join(agentsBaseDir, ag.name);
|
|
46
|
+
fs.mkdirSync(nestedAgentDir, { recursive: true });
|
|
47
|
+
writeTextFile(path.join(nestedAgentDir, "agent.json"), agentJson);
|
|
48
|
+
// 2. Flat format inside plugin: plugins/atabey/agents/{name}.json
|
|
49
|
+
writeTextFile(path.join(agentsBaseDir, `${ag.name}.json`), agentJson);
|
|
50
|
+
// 3. Direct global agents root — THIS is what Antigravity CLI reads:
|
|
51
|
+
// ~/.gemini/antigravity-cli/agents/{name}/agent.json
|
|
52
|
+
const globalNestedDir = path.join(globalAgentsDir, ag.name);
|
|
53
|
+
fs.mkdirSync(globalNestedDir, { recursive: true });
|
|
54
|
+
writeTextFile(path.join(globalNestedDir, "agent.json"), agentJson);
|
|
55
|
+
// 4. Flat global format as fallback
|
|
56
|
+
writeTextFile(path.join(globalAgentsDir, `${ag.name}.json`), agentJson);
|
|
57
|
+
}
|
|
58
|
+
// Scaffold skills
|
|
59
|
+
const skillsDir = path.join(globalPluginDir, "skills");
|
|
60
|
+
fs.mkdirSync(skillsDir, { recursive: true });
|
|
61
|
+
for (const [key, skill] of Object.entries(CORE_SKILLS)) {
|
|
62
|
+
const skillContent = `# [TOOL] Skill — ${skill.name}\n\n${skill.mandates.join("\n")}\n`;
|
|
63
|
+
writeTextFile(path.join(skillsDir, `${key.toLowerCase()}.md`), skillContent);
|
|
64
|
+
}
|
|
65
|
+
// Scaffold rules
|
|
66
|
+
const rulesDir = path.join(globalPluginDir, "rules");
|
|
67
|
+
fs.mkdirSync(rulesDir, { recursive: true });
|
|
68
|
+
for (const ag of ALL_AGENTS) {
|
|
69
|
+
const ruleContent = `# [ATABEY] Agent Atabey — @${ag.name} (${ag.displayName})
|
|
70
|
+
|
|
71
|
+
You are the **${ag.displayName}** of the Agent Atabey AL.
|
|
72
|
+
|
|
73
|
+
## [AI] Specialist Directive (Role: @${ag.name})
|
|
74
|
+
${ag.instructions.identity}
|
|
75
|
+
|
|
76
|
+
### [GOAL] Mission
|
|
77
|
+
${ag.instructions.mission}
|
|
78
|
+
|
|
79
|
+
### [DOCS] Discipline Rules
|
|
80
|
+
${ag.instructions.rules.map(r => `- ${r}`).join("\n")}
|
|
81
|
+
|
|
82
|
+
## [SECURITY] Core Mandates
|
|
83
|
+
- **Surgical Precision:** Enforce replace_text / replace_file_content for all code modifications.
|
|
84
|
+
- **Traceability:** Inherit and pass the active Trace ID across all delegations.
|
|
85
|
+
- **Approval Signature:** High-risk actions require manager approval signature.
|
|
86
|
+
`;
|
|
87
|
+
writeTextFile(path.join(rulesDir, `${ag.name}.md`), ruleContent);
|
|
88
|
+
}
|
|
89
|
+
// Scaffold optional empty hooks.json
|
|
90
|
+
writeJsonFile(path.join(globalPluginDir, "hooks.json"), {});
|
|
91
|
+
logger.info(`Antigravity Plugin registered → ${globalPluginDir}/`);
|
|
92
|
+
try {
|
|
93
|
+
execSync(`agy plugin install "${globalPluginDir}"`, { stdio: "ignore" });
|
|
94
|
+
logger.info("Antigravity Plugin installed in CLI.");
|
|
95
|
+
}
|
|
96
|
+
catch {
|
|
97
|
+
// Ignore if agy is not in PATH or fails
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
catch (e) {
|
|
101
|
+
logger.warn(`Failed to register plugin/MCP in ${globalDir}`, e);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const ADAPTER_IDS = ["gemini", "claude", "grok", "cursor", "codex", "local", "antigravity-cli"];
|