@bluefly/openstandardagents 0.1.9
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/.buildkit/agent-first-policy.sh +65 -0
- package/.buildkit/branching-workflow.json +41 -0
- package/.buildkit/hooks.yaml +23 -0
- package/.buildkit/install-buildkit-setup.cjs +483 -0
- package/.cursor/plans/ossa-comprehensive-enhancement-issue-audit-plan.plan.md +735 -0
- package/.cursor/plans/ossa-enterprise-transformation-plan-0ccaf09b.plan.md +373 -0
- package/.cursor/plans/ossa-milestone-organization-and-v0-2-4-release-6dafa4ec.plan.md +214 -0
- package/.cursor/rules/problems.json +483 -0
- package/.cursor/settings.json +29 -0
- package/.cursor/worktrees.json +95 -0
- package/.env.example +41 -0
- package/.env.local +31 -0
- package/.github/ISSUE_TEMPLATE/README.md +33 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +61 -0
- package/.github/ISSUE_TEMPLATE/config.yml +12 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +75 -0
- package/.github/wiki_templates/home.md +39 -0
- package/.gitignore.bak +489 -0
- package/.gitlab-ci-trigger +1 -0
- package/.husky/pre-commit +31 -0
- package/.lintstagedrc.json +16 -0
- package/.redocly.yaml +63 -0
- package/.vscode/extensions.json +6 -0
- package/.vscode/settings.json +3 -0
- package/AUDIT_FIXES.md +139 -0
- package/AUDIT_REPORT.md +308 -0
- package/BUILDKIT_INTEGRATION.md +146 -0
- package/Dockerfile +35 -0
- package/README.md +559 -0
- package/dist/adk/adapters/index.d.ts +64 -0
- package/dist/adk/adapters/index.d.ts.map +1 -0
- package/dist/adk/adapters/index.js +257 -0
- package/dist/adk/adapters/index.js.map +1 -0
- package/dist/adk/agents/custom-agent.d.ts +55 -0
- package/dist/adk/agents/custom-agent.d.ts.map +1 -0
- package/dist/adk/agents/custom-agent.js +167 -0
- package/dist/adk/agents/custom-agent.js.map +1 -0
- package/dist/adk/agents/index.d.ts +64 -0
- package/dist/adk/agents/index.d.ts.map +1 -0
- package/dist/adk/agents/index.js +125 -0
- package/dist/adk/agents/index.js.map +1 -0
- package/dist/adk/agents/llm-agent.d.ts +27 -0
- package/dist/adk/agents/llm-agent.d.ts.map +1 -0
- package/dist/adk/agents/llm-agent.js +63 -0
- package/dist/adk/agents/llm-agent.js.map +1 -0
- package/dist/adk/agents/workflow-agent.d.ts +42 -0
- package/dist/adk/agents/workflow-agent.d.ts.map +1 -0
- package/dist/adk/agents/workflow-agent.js +144 -0
- package/dist/adk/agents/workflow-agent.js.map +1 -0
- package/dist/adk/index.d.ts +10 -0
- package/dist/adk/index.d.ts.map +1 -0
- package/dist/adk/index.js +10 -0
- package/dist/adk/index.js.map +1 -0
- package/dist/adk/orchestration/index.d.ts +63 -0
- package/dist/adk/orchestration/index.d.ts.map +1 -0
- package/dist/adk/orchestration/index.js +264 -0
- package/dist/adk/orchestration/index.js.map +1 -0
- package/dist/adk/state/index.d.ts +73 -0
- package/dist/adk/state/index.d.ts.map +1 -0
- package/dist/adk/state/index.js +177 -0
- package/dist/adk/state/index.js.map +1 -0
- package/dist/adk/tools/index.d.ts +65 -0
- package/dist/adk/tools/index.d.ts.map +1 -0
- package/dist/adk/tools/index.js +252 -0
- package/dist/adk/tools/index.js.map +1 -0
- package/dist/cli/agent-deployment.d.ts +34 -0
- package/dist/cli/agent-deployment.d.ts.map +1 -0
- package/dist/cli/agent-deployment.js +396 -0
- package/dist/cli/agent-deployment.js.map +1 -0
- package/dist/cli/commands/discover.command.d.ts +7 -0
- package/dist/cli/commands/discover.command.d.ts.map +1 -0
- package/dist/cli/commands/discover.command.js +80 -0
- package/dist/cli/commands/discover.command.js.map +1 -0
- package/dist/cli/commands/export.command.d.ts +7 -0
- package/dist/cli/commands/export.command.d.ts.map +1 -0
- package/dist/cli/commands/export.command.js +56 -0
- package/dist/cli/commands/export.command.js.map +1 -0
- package/dist/cli/commands/generate.command.d.ts +7 -0
- package/dist/cli/commands/generate.command.d.ts.map +1 -0
- package/dist/cli/commands/generate.command.js +66 -0
- package/dist/cli/commands/generate.command.js.map +1 -0
- package/dist/cli/commands/gitlab-agent.command.d.ts +8 -0
- package/dist/cli/commands/gitlab-agent.command.d.ts.map +1 -0
- package/dist/cli/commands/gitlab-agent.command.js +201 -0
- package/dist/cli/commands/gitlab-agent.command.js.map +1 -0
- package/dist/cli/commands/import.command.d.ts +7 -0
- package/dist/cli/commands/import.command.d.ts.map +1 -0
- package/dist/cli/commands/import.command.js +36 -0
- package/dist/cli/commands/import.command.js.map +1 -0
- package/dist/cli/commands/init.command.d.ts +7 -0
- package/dist/cli/commands/init.command.d.ts.map +1 -0
- package/dist/cli/commands/init.command.js +146 -0
- package/dist/cli/commands/init.command.js.map +1 -0
- package/dist/cli/commands/migrate.command.d.ts +7 -0
- package/dist/cli/commands/migrate.command.d.ts.map +1 -0
- package/dist/cli/commands/migrate.command.js +110 -0
- package/dist/cli/commands/migrate.command.js.map +1 -0
- package/dist/cli/commands/ossa.d.ts +9 -0
- package/dist/cli/commands/ossa.d.ts.map +1 -0
- package/dist/cli/commands/ossa.js +234 -0
- package/dist/cli/commands/ossa.js.map +1 -0
- package/dist/cli/commands/run.command.d.ts +7 -0
- package/dist/cli/commands/run.command.d.ts.map +1 -0
- package/dist/cli/commands/run.command.js +114 -0
- package/dist/cli/commands/run.command.js.map +1 -0
- package/dist/cli/commands/schema.command.d.ts +7 -0
- package/dist/cli/commands/schema.command.d.ts.map +1 -0
- package/dist/cli/commands/schema.command.js +72 -0
- package/dist/cli/commands/schema.command.js.map +1 -0
- package/dist/cli/commands/validate.command.d.ts +7 -0
- package/dist/cli/commands/validate.command.d.ts.map +1 -0
- package/dist/cli/commands/validate.command.js +125 -0
- package/dist/cli/commands/validate.command.js.map +1 -0
- package/dist/cli/commands/worktree.d.ts +7 -0
- package/dist/cli/commands/worktree.d.ts.map +1 -0
- package/dist/cli/commands/worktree.js +509 -0
- package/dist/cli/commands/worktree.js.map +1 -0
- package/dist/cli/index.d.ts +7 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +50 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/ossa-cli.d.ts +52 -0
- package/dist/cli/ossa-cli.d.ts.map +1 -0
- package/dist/cli/ossa-cli.js +1061 -0
- package/dist/cli/ossa-cli.js.map +1 -0
- package/dist/core/index.d.ts +31 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +37 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/mcp-server-implementation.d.ts +39 -0
- package/dist/core/mcp-server-implementation.d.ts.map +1 -0
- package/dist/core/mcp-server-implementation.js +1262 -0
- package/dist/core/mcp-server-implementation.js.map +1 -0
- package/dist/core/orchestrator/index.d.ts +156 -0
- package/dist/core/orchestrator/index.d.ts.map +1 -0
- package/dist/core/orchestrator/index.js +446 -0
- package/dist/core/orchestrator/index.js.map +1 -0
- package/dist/core/orchestrator/ossa-orchestrator.d.ts +106 -0
- package/dist/core/orchestrator/ossa-orchestrator.d.ts.map +1 -0
- package/dist/core/orchestrator/ossa-orchestrator.js +396 -0
- package/dist/core/orchestrator/ossa-orchestrator.js.map +1 -0
- package/dist/di-container.d.ts +18 -0
- package/dist/di-container.d.ts.map +1 -0
- package/dist/di-container.js +46 -0
- package/dist/di-container.js.map +1 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +37 -0
- package/dist/index.js.map +1 -0
- package/dist/protocols/acap.d.ts +61 -0
- package/dist/protocols/acap.d.ts.map +1 -0
- package/dist/protocols/acap.js +92 -0
- package/dist/protocols/acap.js.map +1 -0
- package/dist/protocols/index.d.ts +8 -0
- package/dist/protocols/index.d.ts.map +1 -0
- package/dist/protocols/index.js +8 -0
- package/dist/protocols/index.js.map +1 -0
- package/dist/protocols/rasp.d.ts +58 -0
- package/dist/protocols/rasp.d.ts.map +1 -0
- package/dist/protocols/rasp.js +212 -0
- package/dist/protocols/rasp.js.map +1 -0
- package/dist/repositories/manifest.repository.d.ts +26 -0
- package/dist/repositories/manifest.repository.d.ts.map +1 -0
- package/dist/repositories/manifest.repository.js +90 -0
- package/dist/repositories/manifest.repository.js.map +1 -0
- package/dist/repositories/schema.repository.d.ts +30 -0
- package/dist/repositories/schema.repository.d.ts.map +1 -0
- package/dist/repositories/schema.repository.js +144 -0
- package/dist/repositories/schema.repository.js.map +1 -0
- package/dist/server/simple-app.d.ts +18 -0
- package/dist/server/simple-app.d.ts.map +1 -0
- package/dist/server/simple-app.js +155 -0
- package/dist/server/simple-app.js.map +1 -0
- package/dist/server/types/agent.d.ts +498 -0
- package/dist/server/types/agent.d.ts.map +1 -0
- package/dist/server/types/agent.js +37 -0
- package/dist/server/types/agent.js.map +1 -0
- package/dist/server/types/server.d.ts +370 -0
- package/dist/server/types/server.d.ts.map +1 -0
- package/dist/server/types/server.js +68 -0
- package/dist/server/types/server.js.map +1 -0
- package/dist/services/discovery.service.d.ts +78 -0
- package/dist/services/discovery.service.d.ts.map +1 -0
- package/dist/services/discovery.service.js +212 -0
- package/dist/services/discovery.service.js.map +1 -0
- package/dist/services/generation.service.d.ts +54 -0
- package/dist/services/generation.service.d.ts.map +1 -0
- package/dist/services/generation.service.js +298 -0
- package/dist/services/generation.service.js.map +1 -0
- package/dist/services/gitlab-agent.service.d.ts +94 -0
- package/dist/services/gitlab-agent.service.d.ts.map +1 -0
- package/dist/services/gitlab-agent.service.js +158 -0
- package/dist/services/gitlab-agent.service.js.map +1 -0
- package/dist/services/migration.service.d.ts +30 -0
- package/dist/services/migration.service.d.ts.map +1 -0
- package/dist/services/migration.service.js +231 -0
- package/dist/services/migration.service.js.map +1 -0
- package/dist/services/orchestration/worktree-orchestrator.d.ts +146 -0
- package/dist/services/orchestration/worktree-orchestrator.d.ts.map +1 -0
- package/dist/services/orchestration/worktree-orchestrator.js +591 -0
- package/dist/services/orchestration/worktree-orchestrator.js.map +1 -0
- package/dist/services/runtime/openai.adapter.d.ts +94 -0
- package/dist/services/runtime/openai.adapter.d.ts.map +1 -0
- package/dist/services/runtime/openai.adapter.js +209 -0
- package/dist/services/runtime/openai.adapter.js.map +1 -0
- package/dist/services/validation.service.d.ts +45 -0
- package/dist/services/validation.service.d.ts.map +1 -0
- package/dist/services/validation.service.js +362 -0
- package/dist/services/validation.service.js.map +1 -0
- package/dist/services/validators/anthropic.validator.d.ts +9 -0
- package/dist/services/validators/anthropic.validator.d.ts.map +1 -0
- package/dist/services/validators/anthropic.validator.js +105 -0
- package/dist/services/validators/anthropic.validator.js.map +1 -0
- package/dist/services/validators/autogen.validator.d.ts +9 -0
- package/dist/services/validators/autogen.validator.d.ts.map +1 -0
- package/dist/services/validators/autogen.validator.js +111 -0
- package/dist/services/validators/autogen.validator.js.map +1 -0
- package/dist/services/validators/crewai.validator.d.ts +9 -0
- package/dist/services/validators/crewai.validator.d.ts.map +1 -0
- package/dist/services/validators/crewai.validator.js +117 -0
- package/dist/services/validators/crewai.validator.js.map +1 -0
- package/dist/services/validators/cursor.validator.d.ts +9 -0
- package/dist/services/validators/cursor.validator.d.ts.map +1 -0
- package/dist/services/validators/cursor.validator.js +88 -0
- package/dist/services/validators/cursor.validator.js.map +1 -0
- package/dist/services/validators/index.d.ts +15 -0
- package/dist/services/validators/index.d.ts.map +1 -0
- package/dist/services/validators/index.js +15 -0
- package/dist/services/validators/index.js.map +1 -0
- package/dist/services/validators/langchain.validator.d.ts +9 -0
- package/dist/services/validators/langchain.validator.d.ts.map +1 -0
- package/dist/services/validators/langchain.validator.js +103 -0
- package/dist/services/validators/langchain.validator.js.map +1 -0
- package/dist/services/validators/langflow.validator.d.ts +9 -0
- package/dist/services/validators/langflow.validator.d.ts.map +1 -0
- package/dist/services/validators/langflow.validator.js +92 -0
- package/dist/services/validators/langflow.validator.js.map +1 -0
- package/dist/services/validators/langgraph.validator.d.ts +9 -0
- package/dist/services/validators/langgraph.validator.d.ts.map +1 -0
- package/dist/services/validators/langgraph.validator.js +123 -0
- package/dist/services/validators/langgraph.validator.js.map +1 -0
- package/dist/services/validators/llamaindex.validator.d.ts +9 -0
- package/dist/services/validators/llamaindex.validator.d.ts.map +1 -0
- package/dist/services/validators/llamaindex.validator.js +121 -0
- package/dist/services/validators/llamaindex.validator.js.map +1 -0
- package/dist/services/validators/openai.validator.d.ts +9 -0
- package/dist/services/validators/openai.validator.d.ts.map +1 -0
- package/dist/services/validators/openai.validator.js +126 -0
- package/dist/services/validators/openai.validator.js.map +1 -0
- package/dist/services/validators/vercel-ai.validator.d.ts +9 -0
- package/dist/services/validators/vercel-ai.validator.d.ts.map +1 -0
- package/dist/services/validators/vercel-ai.validator.js +99 -0
- package/dist/services/validators/vercel-ai.validator.js.map +1 -0
- package/dist/services/worktree/branching-strategy.d.ts +17 -0
- package/dist/services/worktree/branching-strategy.d.ts.map +1 -0
- package/dist/services/worktree/branching-strategy.js +66 -0
- package/dist/services/worktree/branching-strategy.js.map +1 -0
- package/dist/services/worktree/git-worktree-manager.d.ts +32 -0
- package/dist/services/worktree/git-worktree-manager.d.ts.map +1 -0
- package/dist/services/worktree/git-worktree-manager.js +61 -0
- package/dist/services/worktree/git-worktree-manager.js.map +1 -0
- package/dist/spec/v0.1.9/agent-autonomous-extensions.json +234 -0
- package/dist/spec/v0.1.9/ecosystem-compliance.json +235 -0
- package/dist/spec/v0.1.9/ossa-v0.1.9.schema.json +695 -0
- package/dist/spec/v0.1.9/ossa-v0.1.9.schema.json.backup +695 -0
- package/dist/spec/v0.1.9/reasoning-compliance.json +654 -0
- package/dist/spec/v0.2.0/ossa-0.2.0.schema.json +0 -0
- package/dist/spec/v0.2.1/ossa-0.2.1.schema.json +555 -0
- package/dist/spec/v0.2.2/kagent-enhancements.json +395 -0
- package/dist/spec/v0.2.2/ossa-0.2.2.schema.json +906 -0
- package/dist/spec/v0.2.2/ossa-0.2.2.yaml +448 -0
- package/dist/spec/v0.2.2/ossa-reasoning-compliance-1.0.schema.json +424 -0
- package/dist/spec/v0.2.3/README.md +154 -0
- package/dist/spec/v0.2.3/migrations/v0.2.2-to-v0.2.3.md +343 -0
- package/dist/spec/v0.2.3/ossa-0.2.3.schema.json +1397 -0
- package/dist/spec/v0.2.3/ossa-0.2.3.yaml +448 -0
- package/dist/spec/v0.2.4-dev/README.md +61 -0
- package/dist/spec/v0.2.4-dev/RELEASE-PROCESS.md +130 -0
- package/dist/spec/v0.2.4-dev/migrations/v0.2.3-to-v0.2.4.md +599 -0
- package/dist/spec/v0.2.4-dev/openapi/CHANGELOG-0.2.4.md +177 -0
- package/dist/spec/v0.2.4-dev/openapi/README-0.2.4.md +51 -0
- package/dist/spec/v0.2.4-dev/openapi/VERIFICATION-0.2.4.md +147 -0
- package/dist/spec/v0.2.4-dev/ossa-0.2.4-dev.schema.json +1717 -0
- package/dist/spec/v0.2.4-dev/ossa-0.2.4-dev.yaml +581 -0
- package/dist/spec/v0.2.5-dev/migrations/v0.2.4-to-v0.2.5.md +317 -0
- package/dist/spec/v0.2.5-dev/ossa-0.2.5-dev.schema.json +1732 -0
- package/dist/spec/v0.2.5-dev/ossa-0.2.5-dev.yaml +409 -0
- package/dist/specification/validator.d.ts +82 -0
- package/dist/specification/validator.d.ts.map +1 -0
- package/dist/specification/validator.js +562 -0
- package/dist/specification/validator.js.map +1 -0
- package/dist/types/acdl-api.d.ts +335 -0
- package/dist/types/acdl-api.d.ts.map +1 -0
- package/dist/types/acdl-api.js +6 -0
- package/dist/types/acdl-api.js.map +1 -0
- package/dist/types/agents/index.d.ts +53 -0
- package/dist/types/agents/index.d.ts.map +1 -0
- package/dist/types/agents/index.js +5 -0
- package/dist/types/agents/index.js.map +1 -0
- package/dist/types/api.d.ts +225 -0
- package/dist/types/api.d.ts.map +1 -0
- package/dist/types/api.js +6 -0
- package/dist/types/api.js.map +1 -0
- package/dist/types/architecture/index.d.ts +530 -0
- package/dist/types/architecture/index.d.ts.map +1 -0
- package/dist/types/architecture/index.js +258 -0
- package/dist/types/architecture/index.js.map +1 -0
- package/dist/types/index.d.ts +279 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +68 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/openapi-extensions.d.ts +164 -0
- package/dist/types/openapi-extensions.d.ts.map +1 -0
- package/dist/types/openapi-extensions.js +6 -0
- package/dist/types/openapi-extensions.js.map +1 -0
- package/dist/types/policies/index.d.ts +35 -0
- package/dist/types/policies/index.d.ts.map +1 -0
- package/dist/types/policies/index.js +5 -0
- package/dist/types/policies/index.js.map +1 -0
- package/dist/types/workflows/index.d.ts +40 -0
- package/dist/types/workflows/index.d.ts.map +1 -0
- package/dist/types/workflows/index.js +5 -0
- package/dist/types/workflows/index.js.map +1 -0
- package/dist/utils/version-resolver.d.ts +28 -0
- package/dist/utils/version-resolver.d.ts.map +1 -0
- package/dist/utils/version-resolver.js +110 -0
- package/dist/utils/version-resolver.js.map +1 -0
- package/docker-compose.yml +160 -0
- package/junit.xml +1 -0
- package/package.json +105 -0
- package/public/api-docs.html +206 -0
- package/public/assets/favicon.svg +8 -0
- package/public/assets/script.js +279 -0
- package/public/assets/style.css +632 -0
- package/public/index.html +307 -0
- package/public/redocly-config.yaml +80 -0
- package/public/src/api/acdl-specification.yml +531 -0
- package/public/src/api/clean-architecture.openapi.yml +1435 -0
- package/public/src/api/context7-mcp.openapi.yml +313 -0
- package/public/src/api/magic-mcp.openapi.yml +647 -0
- package/public/src/api/mcp-infrastructure.openapi.yml +904 -0
- package/public/src/api/orchestration.openapi.yml +444 -0
- package/public/src/api/ossa-complete.openapi.yml +2250 -0
- package/public/src/api/project-discovery.openapi.yml +1293 -0
- package/public/src/api/rebuild-audit.openapi.yml +800 -0
- package/public/src/api/specification.openapi.yml +498 -0
- package/public/src/api/voice-agent-specification.yml +640 -0
- package/public/src/api/web-eval-mcp.openapi.yml +426 -0
- package/pyrightconfig.json +13 -0
- package/redocly.yaml +56 -0
- package/spec/v0.1.9/ossa-v0.1.9.schema.json.backup +695 -0
- package/spec/v0.2.0/ossa-0.2.0.schema.json +0 -0
- package/spec/v0.2.1/ossa-0.2.1.schema.json +555 -0
- package/spec/v0.2.4/ossa-0.2.4.schema.json +1717 -0
- package/spec/v0.2.4/ossa-0.2.4.yaml +581 -0
- package/specs/README.md +31 -0
- package/specs/acdl-specification.yml +531 -0
- package/specs/clean-architecture.openapi.yml +1435 -0
- package/specs/context7-mcp.openapi.yml +313 -0
- package/specs/magic-mcp.openapi.yml +647 -0
- package/specs/mcp-infrastructure.openapi.yml +904 -0
- package/specs/orchestration.openapi.yml +444 -0
- package/specs/ossa-complete.openapi.yml +2250 -0
- package/specs/project-discovery.openapi.yml +1293 -0
- package/specs/rebuild-audit.openapi.yml +800 -0
- package/specs/specification.openapi.yml +498 -0
- package/specs/test-api.openapi.yml +20 -0
- package/specs/voice-agent-specification.yml +640 -0
- package/specs/web-eval-mcp.openapi.yml +426 -0
- package/src/adk/adapters/index.ts +310 -0
- package/src/adk/agents/custom-agent.ts +206 -0
- package/src/adk/agents/index.ts +158 -0
- package/src/adk/agents/llm-agent.ts +76 -0
- package/src/adk/agents/workflow-agent.ts +191 -0
- package/src/adk/index.ts +10 -0
- package/src/adk/orchestration/index.ts +352 -0
- package/src/adk/state/index.ts +217 -0
- package/src/adk/tools/index.ts +291 -0
- package/src/api/acdl-specification.yml +531 -0
- package/src/api/agent-manifest.schema.json +859 -0
- package/src/api/agent-worktree-schema.json +320 -0
- package/src/api/clean-architecture.openapi.yml +1435 -0
- package/src/api/context7-mcp.openapi.yml +313 -0
- package/src/api/magic-mcp.openapi.yml +647 -0
- package/src/api/mcp-infrastructure.openapi.yml +904 -0
- package/src/api/openapi.redoc.config.json +6 -0
- package/src/api/orchestration.openapi.yml +444 -0
- package/src/api/ossa-complete.openapi.yml +2250 -0
- package/src/api/project-discovery.openapi.yml +1293 -0
- package/src/api/rebuild-audit.openapi.yml +800 -0
- package/src/api/specification.openapi.yml +498 -0
- package/src/api/test-api.openapi.yml +20 -0
- package/src/api/voice-agent-specification.yml +640 -0
- package/src/api/web-eval-mcp.openapi.yml +426 -0
- package/src/api/workflow.schema.json +524 -0
- package/src/cli/agent-deployment.ts +452 -0
- package/src/cli/commands/ossa.ts +272 -0
- package/src/cli/commands/worktree.ts +603 -0
- package/src/cli/ossa-cli.ts +1176 -0
- package/src/core/index.ts +42 -0
- package/src/core/mcp-server-implementation.ts +1409 -0
- package/src/core/orchestrator/index.ts +611 -0
- package/src/core/orchestrator/ossa-orchestrator.ts +504 -0
- package/src/mcp/simple-server.ts +322 -0
- package/src/protocols/acap.ts +146 -0
- package/src/protocols/index.ts +8 -0
- package/src/protocols/rasp.ts +263 -0
- package/src/server/app.ts +472 -0
- package/src/server/middleware/agentAccess.ts +10 -0
- package/src/server/middleware/asyncHandler.ts +10 -0
- package/src/server/middleware/auth.ts +10 -0
- package/src/server/middleware/errorHandler.ts +9 -0
- package/src/server/middleware/logging.ts +10 -0
- package/src/server/middleware/metrics.ts +10 -0
- package/src/server/middleware/validation.ts +10 -0
- package/src/server/routes/agents.ts +632 -0
- package/src/server/routes/monitoring.ts +13 -0
- package/src/server/routes/orchestration.ts +13 -0
- package/src/server/routes/specifications.ts +13 -0
- package/src/server/services/AgentService.ts +46 -0
- package/src/server/services/ExecutionService.ts +51 -0
- package/src/server/services/SpecificationService.ts +22 -0
- package/src/server/services/WebhookService.ts +24 -0
- package/src/server/simple-app.ts +174 -0
- package/src/server/types/agent.ts +612 -0
- package/src/server/types/server.ts +465 -0
- package/src/services/orchestration/worktree-orchestrator.ts +779 -0
- package/src/services/worktree/branching-strategy.ts +76 -0
- package/src/services/worktree/git-worktree-manager.ts +86 -0
- package/website/.next/BUILD_ID +1 -0
- package/website/.next/app-build-manifest.json +151 -0
- package/website/.next/app-path-routes-manifest.json +19 -0
- package/website/.next/build-manifest.json +33 -0
- package/website/.next/cache/.previewinfo +1 -0
- package/website/.next/cache/.rscinfo +1 -0
- package/website/.next/cache/.tsbuildinfo +1 -0
- package/website/.next/cache/fetch-cache/920aec34c288eefa97c5efba3baf95a846a0beb0c48a5064980a2c24b83e941c +1 -0
- package/website/.next/cache/fetch-cache/c2ad7a72b43463a0daaa85ca926a8af38defd17ecb64f1fdd2dd4fe2293e8b26 +1 -0
- package/website/.next/cache/fetch-cache/d10eb963d5980c8a50ee9ed24472339ee6da054ead33e00676e61e8b8e62cc83 +1 -0
- package/website/.next/cache/fetch-cache/f243d84640477f3205b74a85013018acd63b692144675630a74d1af8a3e9eab5 +1 -0
- package/website/.next/cache/webpack/client-production/0.pack +0 -0
- package/website/.next/cache/webpack/client-production/1.pack +0 -0
- package/website/.next/cache/webpack/client-production/10.pack +0 -0
- package/website/.next/cache/webpack/client-production/11.pack +0 -0
- package/website/.next/cache/webpack/client-production/12.pack +0 -0
- package/website/.next/cache/webpack/client-production/13.pack +0 -0
- package/website/.next/cache/webpack/client-production/14.pack +0 -0
- package/website/.next/cache/webpack/client-production/15.pack +0 -0
- package/website/.next/cache/webpack/client-production/16.pack +0 -0
- package/website/.next/cache/webpack/client-production/17.pack +0 -0
- package/website/.next/cache/webpack/client-production/18.pack +0 -0
- package/website/.next/cache/webpack/client-production/2.pack +0 -0
- package/website/.next/cache/webpack/client-production/3.pack +0 -0
- package/website/.next/cache/webpack/client-production/4.pack +0 -0
- package/website/.next/cache/webpack/client-production/5.pack +0 -0
- package/website/.next/cache/webpack/client-production/6.pack +0 -0
- package/website/.next/cache/webpack/client-production/7.pack +0 -0
- package/website/.next/cache/webpack/client-production/8.pack +0 -0
- package/website/.next/cache/webpack/client-production/9.pack +0 -0
- package/website/.next/cache/webpack/client-production/index.pack +0 -0
- package/website/.next/cache/webpack/client-production/index.pack.old +0 -0
- package/website/.next/cache/webpack/edge-server-production/0.pack +0 -0
- package/website/.next/cache/webpack/edge-server-production/index.pack +0 -0
- package/website/.next/cache/webpack/server-production/0.pack +0 -0
- package/website/.next/cache/webpack/server-production/1.pack +0 -0
- package/website/.next/cache/webpack/server-production/10.pack +0 -0
- package/website/.next/cache/webpack/server-production/11.pack +0 -0
- package/website/.next/cache/webpack/server-production/12.pack +0 -0
- package/website/.next/cache/webpack/server-production/2.pack +0 -0
- package/website/.next/cache/webpack/server-production/3.pack +0 -0
- package/website/.next/cache/webpack/server-production/4.pack +0 -0
- package/website/.next/cache/webpack/server-production/5.pack +0 -0
- package/website/.next/cache/webpack/server-production/6.pack +0 -0
- package/website/.next/cache/webpack/server-production/7.pack +0 -0
- package/website/.next/cache/webpack/server-production/8.pack +0 -0
- package/website/.next/cache/webpack/server-production/9.pack +0 -0
- package/website/.next/cache/webpack/server-production/index.pack +0 -0
- package/website/.next/cache/webpack/server-production/index.pack.old +0 -0
- package/website/.next/diagnostics/build-diagnostics.json +6 -0
- package/website/.next/diagnostics/framework.json +1 -0
- package/website/.next/export-detail.json +5 -0
- package/website/.next/export-marker.json +6 -0
- package/website/.next/images-manifest.json +57 -0
- package/website/.next/next-minimal-server.js.nft.json +1 -0
- package/website/.next/next-server.js.nft.json +1 -0
- package/website/.next/package.json +1 -0
- package/website/.next/prerender-manifest.json +2143 -0
- package/website/.next/react-loadable-manifest.json +1898 -0
- package/website/.next/required-server-files.json +320 -0
- package/website/.next/routes-manifest.json +161 -0
- package/website/.next/server/app/_not-found/page.js +2 -0
- package/website/.next/server/app/_not-found/page.js.nft.json +1 -0
- package/website/.next/server/app/_not-found/page_client-reference-manifest.js +1 -0
- package/website/.next/server/app/_not-found.html +1 -0
- package/website/.next/server/app/_not-found.meta +8 -0
- package/website/.next/server/app/_not-found.rsc +23 -0
- package/website/.next/server/app/about/page.js +2 -0
- package/website/.next/server/app/about/page.js.nft.json +1 -0
- package/website/.next/server/app/about/page_client-reference-manifest.js +1 -0
- package/website/.next/server/app/about.html +1 -0
- package/website/.next/server/app/about.meta +7 -0
- package/website/.next/server/app/about.rsc +40 -0
- package/website/.next/server/app/blog/OpenAPI-AI-Agents-Standard.html +217 -0
- package/website/.next/server/app/blog/OpenAPI-AI-Agents-Standard.meta +7 -0
- package/website/.next/server/app/blog/OpenAPI-AI-Agents-Standard.rsc +308 -0
- package/website/.next/server/app/blog/Why-Formal-Standards-Matter-Now.html +180 -0
- package/website/.next/server/app/blog/Why-Formal-Standards-Matter-Now.meta +7 -0
- package/website/.next/server/app/blog/Why-Formal-Standards-Matter-Now.rsc +232 -0
- package/website/.next/server/app/blog/[slug]/page.js +2 -0
- package/website/.next/server/app/blog/[slug]/page.js.nft.json +1 -0
- package/website/.next/server/app/blog/[slug]/page_client-reference-manifest.js +1 -0
- package/website/.next/server/app/blog/introducing-ossa-framework.html +263 -0
- package/website/.next/server/app/blog/introducing-ossa-framework.meta +7 -0
- package/website/.next/server/app/blog/introducing-ossa-framework.rsc +351 -0
- package/website/.next/server/app/blog/ossa-production-results.html +198 -0
- package/website/.next/server/app/blog/ossa-production-results.meta +7 -0
- package/website/.next/server/app/blog/ossa-production-results.rsc +302 -0
- package/website/.next/server/app/blog/page.js +2 -0
- package/website/.next/server/app/blog/page.js.nft.json +1 -0
- package/website/.next/server/app/blog/page_client-reference-manifest.js +1 -0
- package/website/.next/server/app/blog/welcome-to-ossa.html +22 -0
- package/website/.next/server/app/blog/welcome-to-ossa.meta +7 -0
- package/website/.next/server/app/blog/welcome-to-ossa.rsc +31 -0
- package/website/.next/server/app/blog/why-ai-agents-need-open-standard.html +63 -0
- package/website/.next/server/app/blog/why-ai-agents-need-open-standard.meta +7 -0
- package/website/.next/server/app/blog/why-ai-agents-need-open-standard.rsc +121 -0
- package/website/.next/server/app/blog.html +1 -0
- package/website/.next/server/app/blog.meta +7 -0
- package/website/.next/server/app/blog.rsc +35 -0
- package/website/.next/server/app/design-guide/page.js +12 -0
- package/website/.next/server/app/design-guide/page.js.nft.json +1 -0
- package/website/.next/server/app/design-guide/page_client-reference-manifest.js +1 -0
- package/website/.next/server/app/design-guide.html +11 -0
- package/website/.next/server/app/design-guide.meta +7 -0
- package/website/.next/server/app/design-guide.rsc +41 -0
- package/website/.next/server/app/docs.html +1 -0
- package/website/.next/server/app/docs.meta +7 -0
- package/website/.next/server/app/docs.rsc +42 -0
- package/website/.next/server/app/ecosystem/page.js +2 -0
- package/website/.next/server/app/ecosystem/page.js.nft.json +1 -0
- package/website/.next/server/app/ecosystem/page_client-reference-manifest.js +1 -0
- package/website/.next/server/app/ecosystem.html +1 -0
- package/website/.next/server/app/ecosystem.meta +7 -0
- package/website/.next/server/app/ecosystem.rsc +40 -0
- package/website/.next/server/app/examples.html +1 -0
- package/website/.next/server/app/examples.meta +7 -0
- package/website/.next/server/app/examples.rsc +14559 -0
- package/website/.next/server/app/index.html +3 -0
- package/website/.next/server/app/index.meta +7 -0
- package/website/.next/server/app/index.rsc +40 -0
- package/website/.next/server/app/license/page.js +2 -0
- package/website/.next/server/app/license/page.js.nft.json +1 -0
- package/website/.next/server/app/license/page_client-reference-manifest.js +1 -0
- package/website/.next/server/app/license.html +191 -0
- package/website/.next/server/app/license.meta +7 -0
- package/website/.next/server/app/license.rsc +222 -0
- package/website/.next/server/app/page.js +4 -0
- package/website/.next/server/app/page.js.nft.json +1 -0
- package/website/.next/server/app/page_client-reference-manifest.js +1 -0
- package/website/.next/server/app/playground/page.js +111 -0
- package/website/.next/server/app/playground/page.js.nft.json +1 -0
- package/website/.next/server/app/playground/page_client-reference-manifest.js +1 -0
- package/website/.next/server/app/playground.html +1 -0
- package/website/.next/server/app/playground.meta +7 -0
- package/website/.next/server/app/playground.rsc +30 -0
- package/website/.next/server/app/robots.txt/route.js +1 -0
- package/website/.next/server/app/robots.txt/route.js.nft.json +1 -0
- package/website/.next/server/app/robots.txt/route_client-reference-manifest.js +1 -0
- package/website/.next/server/app/robots.txt.body +6 -0
- package/website/.next/server/app/robots.txt.meta +1 -0
- package/website/.next/server/app/rss.xml/route.js +18 -0
- package/website/.next/server/app/rss.xml/route.js.nft.json +1 -0
- package/website/.next/server/app/rss.xml/route_client-reference-manifest.js +1 -0
- package/website/.next/server/app/rss.xml.body +11 -0
- package/website/.next/server/app/rss.xml.meta +1 -0
- package/website/.next/server/app/schema/page.js +76 -0
- package/website/.next/server/app/schema/page.js.nft.json +1 -0
- package/website/.next/server/app/schema/page_client-reference-manifest.js +1 -0
- package/website/.next/server/app/schema.html +1 -0
- package/website/.next/server/app/schema.meta +7 -0
- package/website/.next/server/app/schema.rsc +26 -0
- package/website/.next/server/app/sitemap.xml/route.js +1 -0
- package/website/.next/server/app/sitemap.xml/route.js.nft.json +1 -0
- package/website/.next/server/app/sitemap.xml/route_client-reference-manifest.js +1 -0
- package/website/.next/server/app/sitemap.xml.body +39 -0
- package/website/.next/server/app/sitemap.xml.meta +1 -0
- package/website/.next/server/app/specification/page.js +10 -0
- package/website/.next/server/app/specification/page.js.nft.json +1 -0
- package/website/.next/server/app/specification/page_client-reference-manifest.js +1 -0
- package/website/.next/server/app/specification.html +9 -0
- package/website/.next/server/app/specification.meta +7 -0
- package/website/.next/server/app/specification.rsc +32 -0
- package/website/.next/server/app-paths-manifest.json +19 -0
- package/website/.next/server/chunks/18.js +1 -0
- package/website/.next/server/chunks/227.js +9 -0
- package/website/.next/server/chunks/339.js +25 -0
- package/website/.next/server/chunks/49.js +1 -0
- package/website/.next/server/chunks/51.js +1 -0
- package/website/.next/server/chunks/57.js +1 -0
- package/website/.next/server/chunks/579.js +16 -0
- package/website/.next/server/chunks/611.js +6 -0
- package/website/.next/server/chunks/873.js +22 -0
- package/website/.next/server/chunks/900.js +1 -0
- package/website/.next/server/chunks/97.js +1 -0
- package/website/.next/server/functions-config-manifest.json +4 -0
- package/website/.next/server/interception-route-rewrite-manifest.js +1 -0
- package/website/.next/server/middleware-build-manifest.js +1 -0
- package/website/.next/server/middleware-manifest.json +6 -0
- package/website/.next/server/middleware-react-loadable-manifest.js +1 -0
- package/website/.next/server/next-font-manifest.js +1 -0
- package/website/.next/server/next-font-manifest.json +1 -0
- package/website/.next/server/pages/404.html +1 -0
- package/website/.next/server/pages/500.html +1 -0
- package/website/.next/server/pages/_app.js +1 -0
- package/website/.next/server/pages/_app.js.nft.json +1 -0
- package/website/.next/server/pages/_document.js +1 -0
- package/website/.next/server/pages/_document.js.nft.json +1 -0
- package/website/.next/server/pages/_error.js +19 -0
- package/website/.next/server/pages/_error.js.nft.json +1 -0
- package/website/.next/server/pages-manifest.json +6 -0
- package/website/.next/server/server-reference-manifest.js +1 -0
- package/website/.next/server/server-reference-manifest.json +1 -0
- package/website/.next/server/webpack-runtime.js +1 -0
- package/website/.next/static/IDhDQiozPwOaA3PpMqvTE/_buildManifest.js +1 -0
- package/website/.next/static/IDhDQiozPwOaA3PpMqvTE/_ssgManifest.js +1 -0
- package/website/.next/static/chunks/119.05f66060d7798fc9.js +25 -0
- package/website/.next/static/chunks/255-bf407b21685f2318.js +1 -0
- package/website/.next/static/chunks/451-235273497e501ae9.js +1 -0
- package/website/.next/static/chunks/4bd1b696-409494caf8c83275.js +1 -0
- package/website/.next/static/chunks/619-f072ac750404f9da.js +1 -0
- package/website/.next/static/chunks/651-5cd3c87d43b7eb46.js +1 -0
- package/website/.next/static/chunks/778.278ac2aadb2a1105.js +1 -0
- package/website/.next/static/chunks/890-ab915e0570e1961b.js +1 -0
- package/website/.next/static/chunks/app/_not-found/page-ccdaf9d90b537c5d.js +1 -0
- package/website/.next/static/chunks/app/about/page-bd4cb2219b41f933.js +1 -0
- package/website/.next/static/chunks/app/blog/[slug]/page-8fd43000c4969233.js +1 -0
- package/website/.next/static/chunks/app/blog/page-bd4cb2219b41f933.js +1 -0
- package/website/.next/static/chunks/app/design-guide/page-bd4cb2219b41f933.js +1 -0
- package/website/.next/static/chunks/app/ecosystem/page-bd4cb2219b41f933.js +1 -0
- package/website/.next/static/chunks/app/layout-ccacbd90656baa78.js +1 -0
- package/website/.next/static/chunks/app/license/page-bd4cb2219b41f933.js +1 -0
- package/website/.next/static/chunks/app/page-31241dc7465f9590.js +1 -0
- package/website/.next/static/chunks/app/playground/page-c2af00885374900f.js +1 -0
- package/website/.next/static/chunks/app/robots.txt/route-032c05054032342f.js +1 -0
- package/website/.next/static/chunks/app/rss.xml/route-032c05054032342f.js +1 -0
- package/website/.next/static/chunks/app/schema/page-f7c224b281771083.js +1 -0
- package/website/.next/static/chunks/app/sitemap.xml/route-032c05054032342f.js +1 -0
- package/website/.next/static/chunks/app/specification/page-bd4cb2219b41f933.js +1 -0
- package/website/.next/static/chunks/framework-1ce91eb6f9ecda85.js +1 -0
- package/website/.next/static/chunks/main-3099e141650ec47a.js +1 -0
- package/website/.next/static/chunks/main-app-a2fc6ac9305e3090.js +1 -0
- package/website/.next/static/chunks/pages/_app-5addca2b3b969fde.js +1 -0
- package/website/.next/static/chunks/pages/_error-022e4ac7bbb9914f.js +1 -0
- package/website/.next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
- package/website/.next/static/chunks/webpack-6ecb09e5c6e34cb4.js +1 -0
- package/website/.next/static/css/23135390005d4468.css +3 -0
- package/website/.next/static/media/19cfc7226ec3afaa-s.woff2 +0 -0
- package/website/.next/static/media/21350d82a1f187e9-s.woff2 +0 -0
- package/website/.next/static/media/8e9860b6e62d6359-s.woff2 +0 -0
- package/website/.next/static/media/ba9851c3c22cd980-s.woff2 +0 -0
- package/website/.next/static/media/c5fe6dc8356a8c31-s.woff2 +0 -0
- package/website/.next/static/media/df0a9ae256c0569c-s.woff2 +0 -0
- package/website/.next/static/media/e4af272ccee01ff0-s.p.woff2 +0 -0
- package/website/.next/trace +3 -0
- package/website/.next/types/app/about/page.ts +84 -0
- package/website/.next/types/app/blog/[slug]/page.ts +84 -0
- package/website/.next/types/app/blog/page.ts +84 -0
- package/website/.next/types/app/design-guide/page.ts +84 -0
- package/website/.next/types/app/ecosystem/page.ts +84 -0
- package/website/.next/types/app/license/page.ts +84 -0
- package/website/.next/types/app/page.ts +84 -0
- package/website/.next/types/app/playground/page.ts +84 -0
- package/website/.next/types/app/rss.xml/route.ts +347 -0
- package/website/.next/types/app/schema/page.ts +84 -0
- package/website/.next/types/app/specification/page.ts +84 -0
- package/website/.next/types/cache-life.d.ts +141 -0
- package/website/.next/types/package.json +1 -0
- package/website/.next/types/routes.d.ts +85 -0
- package/website/.next/types/validator.ts +187 -0
- package/website/.wiki-export/Agent-Folder-Structure.md +215 -0
- package/website/.wiki-export/CI-STATUS.md +66 -0
- package/website/.wiki-export/COMPLETE-IMPLEMENTATION-CHECKLIST.md +74 -0
- package/website/.wiki-export/DRUPAL-MODULE-INTEGRATION.md +103 -0
- package/website/.wiki-export/FINAL-STATUS.md +63 -0
- package/website/.wiki-export/Getting-Started.md +87 -0
- package/website/.wiki-export/INSTRUCTIONS.md +46 -0
- package/website/.wiki-export/INTEGRATION-ANALYSIS.md +216 -0
- package/website/.wiki-export/MANIFEST.json +62 -0
- package/website/.wiki-export/OSSA-COMPLIANT-BADGE.md +247 -0
- package/website/.wiki-export/Openapi-Extensions.md +930 -0
- package/website/.wiki-export/README.md +31 -0
- package/website/.wiki-export/RELEASE-READINESS.md +95 -0
- package/website/.wiki-export/VERSIONING.md +284 -0
- package/website/lib/versions.json +77 -0
- package/website/next-env.d.ts +6 -0
- package/website/out/app-build-manifest.json +3 -0
- package/website/out/build-manifest.json +17 -0
- package/website/out/cache/.rscinfo +1 -0
- package/website/out/cache/next-devtools-config.json +1 -0
- package/website/out/cache/webpack/client-development/0.pack.gz +0 -0
- package/website/out/cache/webpack/client-development/1.pack.gz +0 -0
- package/website/out/cache/webpack/client-development/2.pack.gz +0 -0
- package/website/out/cache/webpack/client-development/3.pack.gz +0 -0
- package/website/out/cache/webpack/client-development/index.pack.gz +0 -0
- package/website/out/cache/webpack/client-development/index.pack.gz.old +0 -0
- package/website/out/cache/webpack/client-development-fallback/0.pack.gz +0 -0
- package/website/out/cache/webpack/client-development-fallback/index.pack.gz +0 -0
- package/website/out/cache/webpack/server-development/0.pack.gz +0 -0
- package/website/out/cache/webpack/server-development/1.pack.gz +0 -0
- package/website/out/cache/webpack/server-development/2.pack.gz +0 -0
- package/website/out/cache/webpack/server-development/3.pack.gz +0 -0
- package/website/out/cache/webpack/server-development/index.pack.gz +0 -0
- package/website/out/cache/webpack/server-development/index.pack.gz.old +0 -0
- package/website/out/package.json +1 -0
- package/website/out/prerender-manifest.json +11 -0
- package/website/out/react-loadable-manifest.json +1 -0
- package/website/out/routes-manifest.json +1 -0
- package/website/out/server/app-paths-manifest.json +1 -0
- package/website/out/server/interception-route-rewrite-manifest.js +1 -0
- package/website/out/server/middleware-build-manifest.js +19 -0
- package/website/out/server/middleware-manifest.json +6 -0
- package/website/out/server/middleware-react-loadable-manifest.js +1 -0
- package/website/out/server/next-font-manifest.js +1 -0
- package/website/out/server/next-font-manifest.json +1 -0
- package/website/out/server/pages-manifest.json +1 -0
- package/website/out/server/server-reference-manifest.js +1 -0
- package/website/out/server/server-reference-manifest.json +5 -0
- package/website/out/static/chunks/polyfills.js +1 -0
- package/website/out/static/development/_buildManifest.js +1 -0
- package/website/out/static/development/_ssgManifest.js +1 -0
- package/website/out/trace +2 -0
- package/website/out/types/cache-life.d.ts +141 -0
- package/website/out/types/package.json +1 -0
- package/website/out/types/routes.d.ts +85 -0
- package/website/out/types/validator.ts +187 -0
- package/website/public/examples.json +476 -0
- package/website/public/schemas/openapi-extensions.schema.json +486 -0
- package/website/tsconfig.tsbuildinfo +1 -0
|
@@ -0,0 +1,1176 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* OSSA CLI - Main Command Line Interface
|
|
5
|
+
* OpenAPI 3.1 compliant CRUD operations for the OSSA specification
|
|
6
|
+
* Replaces all shell scripts with TypeScript-based operations
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { Command } from 'commander';
|
|
10
|
+
import { readFileSync, writeFileSync, existsSync, mkdirSync, readdirSync, statSync } from 'fs';
|
|
11
|
+
import { join, resolve, extname } from 'path';
|
|
12
|
+
import { execSync } from 'child_process';
|
|
13
|
+
import chalk from 'chalk';
|
|
14
|
+
import { z } from 'zod';
|
|
15
|
+
import * as yaml from 'js-yaml';
|
|
16
|
+
|
|
17
|
+
// OpenAPI 3.1 Schema Definitions
|
|
18
|
+
const OpenAPISchema = z.object({
|
|
19
|
+
openapi: z.literal('3.1.0'),
|
|
20
|
+
info: z.object({
|
|
21
|
+
title: z.string(),
|
|
22
|
+
version: z.string(),
|
|
23
|
+
description: z.string().optional()
|
|
24
|
+
}),
|
|
25
|
+
servers: z.array(z.object({
|
|
26
|
+
url: z.string(),
|
|
27
|
+
description: z.string().optional()
|
|
28
|
+
})).optional(),
|
|
29
|
+
paths: z.record(z.string(), z.any()),
|
|
30
|
+
components: z.object({
|
|
31
|
+
schemas: z.record(z.string(), z.any()).optional()
|
|
32
|
+
}).optional()
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const SpecificationSchema = z.object({
|
|
36
|
+
agentId: z.string().regex(/^[a-z0-9-]+$/),
|
|
37
|
+
agentType: z.enum(['orchestrator', 'worker', 'critic', 'judge', 'trainer', 'governor', 'monitor', 'integrator']),
|
|
38
|
+
version: z.string().regex(/^\d+\.\d+\.\d+$/),
|
|
39
|
+
capabilities: z.object({
|
|
40
|
+
supportedDomains: z.array(z.string()),
|
|
41
|
+
inputFormats: z.array(z.string()),
|
|
42
|
+
outputFormats: z.array(z.string())
|
|
43
|
+
})
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
interface CLIConfig {
|
|
47
|
+
baseDir: string;
|
|
48
|
+
specsDir: string;
|
|
49
|
+
agentsDir: string;
|
|
50
|
+
outputDir: string;
|
|
51
|
+
logLevel: 'debug' | 'info' | 'warn' | 'error';
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
interface OperationResult {
|
|
55
|
+
success: boolean;
|
|
56
|
+
message: string;
|
|
57
|
+
data?: any;
|
|
58
|
+
errors?: string[];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
class OSSACli {
|
|
62
|
+
private config: CLIConfig;
|
|
63
|
+
private program: Command;
|
|
64
|
+
|
|
65
|
+
constructor() {
|
|
66
|
+
this.config = {
|
|
67
|
+
baseDir: process.cwd(),
|
|
68
|
+
specsDir: join(process.cwd(), 'src', 'api'),
|
|
69
|
+
agentsDir: join(process.cwd(), '.agents'),
|
|
70
|
+
outputDir: join(process.cwd(), 'dist'),
|
|
71
|
+
logLevel: 'info'
|
|
72
|
+
};
|
|
73
|
+
this.program = new Command();
|
|
74
|
+
this.setupCommands();
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
private log(level: 'debug' | 'info' | 'warn' | 'error', message: string, data?: any): void {
|
|
78
|
+
const levels = { debug: 0, info: 1, warn: 2, error: 3 };
|
|
79
|
+
const configLevel = levels[this.config.logLevel];
|
|
80
|
+
const messageLevel = levels[level];
|
|
81
|
+
|
|
82
|
+
if (messageLevel < configLevel) return;
|
|
83
|
+
|
|
84
|
+
const colors = {
|
|
85
|
+
debug: chalk.gray,
|
|
86
|
+
info: chalk.blue,
|
|
87
|
+
warn: chalk.yellow,
|
|
88
|
+
error: chalk.red
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const timestamp = new Date().toISOString();
|
|
92
|
+
console.log(colors[level](`[${timestamp}] [${level.toUpperCase()}] ${message}`));
|
|
93
|
+
|
|
94
|
+
if (data) {
|
|
95
|
+
console.log(chalk.gray(JSON.stringify(data, null, 2)));
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
private setupCommands(): void {
|
|
100
|
+
this.program
|
|
101
|
+
.name('ossa')
|
|
102
|
+
.description('OSSA CLI - OpenAPI 3.1 Specification Management')
|
|
103
|
+
.version('0.1.9')
|
|
104
|
+
.option('-v, --verbose', 'Enable verbose logging')
|
|
105
|
+
.option('-d, --debug', 'Enable debug logging')
|
|
106
|
+
.hook('preAction', (thisCommand) => {
|
|
107
|
+
if (thisCommand.opts().verbose) this.config.logLevel = 'info';
|
|
108
|
+
if (thisCommand.opts().debug) this.config.logLevel = 'debug';
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
// SPECIFICATION CRUD Operations
|
|
112
|
+
const specCommand = this.program
|
|
113
|
+
.command('spec')
|
|
114
|
+
.description('Specification management (CRUD operations)');
|
|
115
|
+
|
|
116
|
+
// CREATE specification
|
|
117
|
+
specCommand
|
|
118
|
+
.command('create')
|
|
119
|
+
.description('Create new OpenAPI 3.1 specification')
|
|
120
|
+
.argument('<name>', 'Specification name')
|
|
121
|
+
.option('-t, --type <type>', 'Agent type', 'worker')
|
|
122
|
+
.option('-d, --description <desc>', 'Specification description')
|
|
123
|
+
.option('-v, --version <version>', 'API version', '1.0.0')
|
|
124
|
+
.option('--template <template>', 'Use template (basic, advanced, industrial)')
|
|
125
|
+
.option('--rasp-enabled', 'Enable RASP (Runtime Application Self-Protection) protocol support')
|
|
126
|
+
.action(this.createSpecification.bind(this));
|
|
127
|
+
|
|
128
|
+
// READ specifications
|
|
129
|
+
specCommand
|
|
130
|
+
.command('list')
|
|
131
|
+
.description('List all specifications')
|
|
132
|
+
.option('-f, --format <format>', 'Output format (table, json, yaml)', 'table')
|
|
133
|
+
.option('--filter <filter>', 'Filter by type or version')
|
|
134
|
+
.action(this.listSpecifications.bind(this));
|
|
135
|
+
|
|
136
|
+
specCommand
|
|
137
|
+
.command('get')
|
|
138
|
+
.description('Get specification details')
|
|
139
|
+
.argument('<name>', 'Specification name')
|
|
140
|
+
.option('-f, --format <format>', 'Output format (json, yaml)', 'yaml')
|
|
141
|
+
.action(this.getSpecification.bind(this));
|
|
142
|
+
|
|
143
|
+
// UPDATE specification
|
|
144
|
+
specCommand
|
|
145
|
+
.command('update')
|
|
146
|
+
.description('Update existing specification')
|
|
147
|
+
.argument('<name>', 'Specification name')
|
|
148
|
+
.option('-d, --description <desc>', 'Update description')
|
|
149
|
+
.option('-v, --version <version>', 'Update version')
|
|
150
|
+
.option('--add-path <path>', 'Add new API path')
|
|
151
|
+
.option('--remove-path <path>', 'Remove API path')
|
|
152
|
+
.action(this.updateSpecification.bind(this));
|
|
153
|
+
|
|
154
|
+
// DELETE specification
|
|
155
|
+
specCommand
|
|
156
|
+
.command('delete')
|
|
157
|
+
.description('Delete specification')
|
|
158
|
+
.argument('<name>', 'Specification name')
|
|
159
|
+
.option('-f, --force', 'Force deletion without confirmation')
|
|
160
|
+
.action(this.deleteSpecification.bind(this));
|
|
161
|
+
|
|
162
|
+
// AGENT CRUD Operations
|
|
163
|
+
const agentCommand = this.program
|
|
164
|
+
.command('agent')
|
|
165
|
+
.description('Agent management (CRUD operations)');
|
|
166
|
+
|
|
167
|
+
// CREATE agent
|
|
168
|
+
agentCommand
|
|
169
|
+
.command('create')
|
|
170
|
+
.description('Create new agent')
|
|
171
|
+
.argument('<agent-id>', 'Agent identifier')
|
|
172
|
+
.option('-t, --type <type>', 'Agent type')
|
|
173
|
+
.option('-s, --spec <spec>', 'OpenAPI specification file')
|
|
174
|
+
.option('-c, --capabilities <caps>', 'Comma-separated capabilities')
|
|
175
|
+
.action(this.createAgent.bind(this));
|
|
176
|
+
|
|
177
|
+
// READ agents
|
|
178
|
+
agentCommand
|
|
179
|
+
.command('list')
|
|
180
|
+
.description('List all agents')
|
|
181
|
+
.option('-t, --type <type>', 'Filter by agent type')
|
|
182
|
+
.option('-s, --status <status>', 'Filter by status')
|
|
183
|
+
.action(this.listAgents.bind(this));
|
|
184
|
+
|
|
185
|
+
agentCommand
|
|
186
|
+
.command('get')
|
|
187
|
+
.description('Get agent details')
|
|
188
|
+
.argument('<agent-id>', 'Agent identifier')
|
|
189
|
+
.option('-f, --format <format>', 'Output format (json, yaml, table)', 'table')
|
|
190
|
+
.action(this.getAgent.bind(this));
|
|
191
|
+
|
|
192
|
+
// UPDATE agent
|
|
193
|
+
agentCommand
|
|
194
|
+
.command('update')
|
|
195
|
+
.description('Update agent configuration')
|
|
196
|
+
.argument('<agent-id>', 'Agent identifier')
|
|
197
|
+
.option('-c, --capabilities <caps>', 'Update capabilities')
|
|
198
|
+
.option('-s, --spec <spec>', 'Update OpenAPI specification')
|
|
199
|
+
.action(this.updateAgent.bind(this));
|
|
200
|
+
|
|
201
|
+
// DELETE agent
|
|
202
|
+
agentCommand
|
|
203
|
+
.command('delete')
|
|
204
|
+
.description('Delete agent')
|
|
205
|
+
.argument('<agent-id>', 'Agent identifier')
|
|
206
|
+
.option('-f, --force', 'Force deletion')
|
|
207
|
+
.action(this.deleteAgent.bind(this));
|
|
208
|
+
|
|
209
|
+
// VALIDATION Operations
|
|
210
|
+
this.program
|
|
211
|
+
.command('validate')
|
|
212
|
+
.description('Validate OpenAPI 3.1 specifications and agents')
|
|
213
|
+
.option('-s, --spec <spec>', 'Validate specific specification')
|
|
214
|
+
.option('-a, --agent <agent>', 'Validate specific agent')
|
|
215
|
+
.option('--all', 'Validate all specifications and agents')
|
|
216
|
+
.option('--fix', 'Auto-fix validation errors where possible')
|
|
217
|
+
.action(this.validate.bind(this));
|
|
218
|
+
|
|
219
|
+
// BUILD Operations
|
|
220
|
+
this.program
|
|
221
|
+
.command('build')
|
|
222
|
+
.description('Build and compile specifications')
|
|
223
|
+
.option('-s, --spec <spec>', 'Build specific specification')
|
|
224
|
+
.option('--all', 'Build all specifications')
|
|
225
|
+
.option('-w, --watch', 'Watch for changes and rebuild')
|
|
226
|
+
.option('--output <dir>', 'Output directory')
|
|
227
|
+
.action(this.build.bind(this));
|
|
228
|
+
|
|
229
|
+
// DEPLOYMENT Operations
|
|
230
|
+
this.program
|
|
231
|
+
.command('deploy')
|
|
232
|
+
.description('Deploy agents and specifications')
|
|
233
|
+
.option('-e, --environment <env>', 'Target environment (dev, staging, prod)', 'dev')
|
|
234
|
+
.option('-a, --agent <agent>', 'Deploy specific agent')
|
|
235
|
+
.option('--all', 'Deploy all agents')
|
|
236
|
+
.option('--dry-run', 'Show what would be deployed without deploying')
|
|
237
|
+
.action(this.deploy.bind(this));
|
|
238
|
+
|
|
239
|
+
// TESTING Operations
|
|
240
|
+
this.program
|
|
241
|
+
.command('test')
|
|
242
|
+
.description('Test OpenAPI specifications and agents')
|
|
243
|
+
.option('-s, --spec <spec>', 'Test specific specification')
|
|
244
|
+
.option('-a, --agent <agent>', 'Test specific agent')
|
|
245
|
+
.option('--all', 'Test all specifications and agents')
|
|
246
|
+
.option('--coverage', 'Generate test coverage report')
|
|
247
|
+
.action(this.test.bind(this));
|
|
248
|
+
|
|
249
|
+
// STATUS Operations
|
|
250
|
+
this.program
|
|
251
|
+
.command('status')
|
|
252
|
+
.description('Show system status')
|
|
253
|
+
.option('--detailed', 'Show detailed status information')
|
|
254
|
+
.option('--health', 'Show health check results')
|
|
255
|
+
.action(this.status.bind(this));
|
|
256
|
+
|
|
257
|
+
// MIGRATION Operations
|
|
258
|
+
this.program
|
|
259
|
+
.command('migrate')
|
|
260
|
+
.description('Migrate specifications to OpenAPI 3.1')
|
|
261
|
+
.option('--from <version>', 'Source OpenAPI version')
|
|
262
|
+
.option('--backup', 'Create backup before migration')
|
|
263
|
+
.option('--dry-run', 'Show migration plan without executing')
|
|
264
|
+
.action(this.migrate.bind(this));
|
|
265
|
+
|
|
266
|
+
// UAP (Universal Agent Protocol) Operations
|
|
267
|
+
this.program
|
|
268
|
+
.command('certify')
|
|
269
|
+
.description('Certify agents and specifications for UAP compliance')
|
|
270
|
+
.option('--acap', 'Enable ACAP (Agent Capability Assurance Protocol) certification')
|
|
271
|
+
.option('-a, --agent <agent>', 'Certify specific agent')
|
|
272
|
+
.option('-s, --spec <spec>', 'Certify specific specification')
|
|
273
|
+
.option('--all', 'Certify all agents and specifications')
|
|
274
|
+
.option('--output <format>', 'Output format (json, yaml, table)', 'table')
|
|
275
|
+
.action(this.certify.bind(this));
|
|
276
|
+
|
|
277
|
+
this.program
|
|
278
|
+
.command('discover')
|
|
279
|
+
.description('Discover UAP-compliant agents and services')
|
|
280
|
+
.option('--uadp', 'Enable UADP (Universal Agent Discovery Protocol) for network discovery')
|
|
281
|
+
.option('--network <network>', 'Target network for discovery')
|
|
282
|
+
.option('--timeout <ms>', 'Discovery timeout in milliseconds', '5000')
|
|
283
|
+
.option('--filter <filter>', 'Filter by agent type, capability, or version')
|
|
284
|
+
.option('--output <format>', 'Output format (json, yaml, table)', 'table')
|
|
285
|
+
.action(this.discover.bind(this));
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
// SPECIFICATION CRUD Operations
|
|
289
|
+
private async createSpecification(name: string, options: any): Promise<void> {
|
|
290
|
+
try {
|
|
291
|
+
this.log('info', `Creating specification: ${name}`);
|
|
292
|
+
|
|
293
|
+
const specTemplate = this.getSpecTemplate(options.template || 'basic');
|
|
294
|
+
const spec = {
|
|
295
|
+
...specTemplate,
|
|
296
|
+
info: {
|
|
297
|
+
...specTemplate.info,
|
|
298
|
+
title: `${name} API`,
|
|
299
|
+
version: options.version || '1.0.0',
|
|
300
|
+
description: options.description || `OpenAPI 3.1 specification for ${name}`,
|
|
301
|
+
...(options.raspEnabled && {
|
|
302
|
+
'x-rasp-enabled': true,
|
|
303
|
+
'x-rasp-config': {
|
|
304
|
+
monitoring: true,
|
|
305
|
+
protection: true,
|
|
306
|
+
alerting: true
|
|
307
|
+
}
|
|
308
|
+
})
|
|
309
|
+
}
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
// Add RASP security schemes if enabled
|
|
313
|
+
if (options.raspEnabled) {
|
|
314
|
+
spec.components = spec.components || {};
|
|
315
|
+
spec.components.securitySchemes = {
|
|
316
|
+
...spec.components.securitySchemes,
|
|
317
|
+
RASPToken: {
|
|
318
|
+
type: 'http',
|
|
319
|
+
scheme: 'bearer',
|
|
320
|
+
bearerFormat: 'JWT',
|
|
321
|
+
description: 'RASP (Runtime Application Self-Protection) authentication token'
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
spec.security = [{ RASPToken: [] }];
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
// Validate against OpenAPI 3.1 schema
|
|
328
|
+
const validation = OpenAPISchema.safeParse(spec);
|
|
329
|
+
if (!validation.success) {
|
|
330
|
+
this.log('error', 'Specification validation failed', validation.error.issues);
|
|
331
|
+
return;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
const specPath = join(this.config.specsDir, `${name}.openapi.yml`);
|
|
335
|
+
writeFileSync(specPath, yaml.dump(spec));
|
|
336
|
+
|
|
337
|
+
this.log('info', `Specification created: ${specPath}`);
|
|
338
|
+
|
|
339
|
+
// Auto-generate TypeScript types if requested
|
|
340
|
+
if (options.generateTypes) {
|
|
341
|
+
await this.generateTypes(name);
|
|
342
|
+
}
|
|
343
|
+
} catch (error) {
|
|
344
|
+
this.log('error', `Failed to create specification: ${error instanceof Error ? error.message : String(error)}`);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
private async listSpecifications(options: any): Promise<void> {
|
|
349
|
+
try {
|
|
350
|
+
this.log('info', 'Listing specifications...');
|
|
351
|
+
|
|
352
|
+
const specs = this.getAllSpecifications();
|
|
353
|
+
|
|
354
|
+
if (options.format === 'json') {
|
|
355
|
+
console.log(JSON.stringify(specs, null, 2));
|
|
356
|
+
} else if (options.format === 'yaml') {
|
|
357
|
+
console.log(yaml.dump(specs));
|
|
358
|
+
} else {
|
|
359
|
+
// Table format
|
|
360
|
+
console.table(specs.map(spec => ({
|
|
361
|
+
Name: spec.name,
|
|
362
|
+
Version: spec.version,
|
|
363
|
+
Type: spec.type || 'Unknown',
|
|
364
|
+
'Last Modified': spec.lastModified
|
|
365
|
+
})));
|
|
366
|
+
}
|
|
367
|
+
} catch (error) {
|
|
368
|
+
this.log('error', `Failed to list specifications: ${error instanceof Error ? error.message : String(error)}`);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
private async getSpecification(name: string, options: any): Promise<void> {
|
|
373
|
+
try {
|
|
374
|
+
this.log('info', `Getting specification: ${name}`);
|
|
375
|
+
|
|
376
|
+
const specPath = join(this.config.specsDir, `${name}.openapi.yml`);
|
|
377
|
+
if (!existsSync(specPath)) {
|
|
378
|
+
this.log('error', `Specification not found: ${name}`);
|
|
379
|
+
return;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
const content = readFileSync(specPath, 'utf8');
|
|
383
|
+
|
|
384
|
+
if (options.format === 'json') {
|
|
385
|
+
const spec = yaml.load(content);
|
|
386
|
+
console.log(JSON.stringify(spec, null, 2));
|
|
387
|
+
} else {
|
|
388
|
+
console.log(content);
|
|
389
|
+
}
|
|
390
|
+
} catch (error) {
|
|
391
|
+
this.log('error', `Failed to get specification: ${error instanceof Error ? error.message : String(error)}`);
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
private async updateSpecification(name: string, options: any): Promise<void> {
|
|
396
|
+
try {
|
|
397
|
+
this.log('info', `Updating specification: ${name}`);
|
|
398
|
+
// TODO: Implement specification update logic
|
|
399
|
+
} catch (error) {
|
|
400
|
+
this.log('error', `Failed to update specification: ${error instanceof Error ? error.message : String(error)}`);
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
private async deleteSpecification(name: string, options: any): Promise<void> {
|
|
405
|
+
try {
|
|
406
|
+
this.log('info', `Deleting specification: ${name}`);
|
|
407
|
+
// TODO: Implement specification deletion logic
|
|
408
|
+
} catch (error) {
|
|
409
|
+
this.log('error', `Failed to delete specification: ${error instanceof Error ? error.message : String(error)}`);
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
// AGENT CRUD Operations
|
|
414
|
+
private async createAgent(agentId: string, options: any): Promise<void> {
|
|
415
|
+
try {
|
|
416
|
+
this.log('info', `Creating agent: ${agentId}`);
|
|
417
|
+
// TODO: Implement agent creation logic
|
|
418
|
+
} catch (error) {
|
|
419
|
+
this.log('error', `Failed to create agent: ${error instanceof Error ? error.message : String(error)}`);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
private async listAgents(options: any): Promise<void> {
|
|
424
|
+
try {
|
|
425
|
+
this.log('info', 'Listing agents...');
|
|
426
|
+
// TODO: Implement agent listing logic
|
|
427
|
+
} catch (error) {
|
|
428
|
+
this.log('error', `Failed to list agents: ${error instanceof Error ? error.message : String(error)}`);
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
private async getAgent(agentId: string, options: any): Promise<void> {
|
|
433
|
+
try {
|
|
434
|
+
this.log('info', `Getting agent: ${agentId}`);
|
|
435
|
+
// TODO: Implement get agent logic
|
|
436
|
+
} catch (error) {
|
|
437
|
+
this.log('error', `Failed to get agent: ${error instanceof Error ? error.message : String(error)}`);
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
private async updateAgent(agentId: string, options: any): Promise<void> {
|
|
442
|
+
try {
|
|
443
|
+
this.log('info', `Updating agent: ${agentId}`);
|
|
444
|
+
// TODO: Implement agent update logic
|
|
445
|
+
} catch (error) {
|
|
446
|
+
this.log('error', `Failed to update agent: ${error instanceof Error ? error.message : String(error)}`);
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
private async deleteAgent(agentId: string, options: any): Promise<void> {
|
|
451
|
+
try {
|
|
452
|
+
this.log('info', `Deleting agent: ${agentId}`);
|
|
453
|
+
// TODO: Implement agent deletion logic
|
|
454
|
+
} catch (error) {
|
|
455
|
+
this.log('error', `Failed to delete agent: ${error instanceof Error ? error.message : String(error)}`);
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
// Utility Operations
|
|
460
|
+
private async validate(options: any): Promise<void> {
|
|
461
|
+
try {
|
|
462
|
+
this.log('info', 'Starting validation...');
|
|
463
|
+
|
|
464
|
+
if (options.all) {
|
|
465
|
+
await this.validateAllSpecifications();
|
|
466
|
+
await this.validateAllAgents();
|
|
467
|
+
} else if (options.spec) {
|
|
468
|
+
await this.validateSpecification(options.spec);
|
|
469
|
+
} else if (options.agent) {
|
|
470
|
+
await this.validateAgent(options.agent);
|
|
471
|
+
}
|
|
472
|
+
} catch (error) {
|
|
473
|
+
this.log('error', `Validation failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
private async build(options: any): Promise<void> {
|
|
478
|
+
try {
|
|
479
|
+
this.log('info', 'Building specifications...');
|
|
480
|
+
// TODO: Implement build logic
|
|
481
|
+
} catch (error) {
|
|
482
|
+
this.log('error', `Build failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
private async deploy(options: any): Promise<void> {
|
|
487
|
+
try {
|
|
488
|
+
this.log('info', `Deploying to ${options.environment}...`);
|
|
489
|
+
// TODO: Implement deployment logic
|
|
490
|
+
} catch (error) {
|
|
491
|
+
this.log('error', `Deployment failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
private async test(options: any): Promise<void> {
|
|
496
|
+
try {
|
|
497
|
+
this.log('info', 'Running tests...');
|
|
498
|
+
// TODO: Implement testing logic
|
|
499
|
+
} catch (error) {
|
|
500
|
+
this.log('error', `Tests failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
private async status(options: any): Promise<void> {
|
|
505
|
+
try {
|
|
506
|
+
this.log('info', 'Checking system status...');
|
|
507
|
+
|
|
508
|
+
const status = {
|
|
509
|
+
specifications: this.getAllSpecifications().length,
|
|
510
|
+
agents: this.getAllAgents().length,
|
|
511
|
+
environment: process.env.NODE_ENV || 'development',
|
|
512
|
+
version: '0.1.9',
|
|
513
|
+
health: 'healthy'
|
|
514
|
+
};
|
|
515
|
+
|
|
516
|
+
console.log(chalk.green('OSSA System Status:'));
|
|
517
|
+
console.table(status);
|
|
518
|
+
} catch (error) {
|
|
519
|
+
this.log('error', `Failed to get status: ${error instanceof Error ? error.message : String(error)}`);
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
private async migrate(options: any): Promise<void> {
|
|
524
|
+
try {
|
|
525
|
+
this.log('info', 'Starting migration...');
|
|
526
|
+
// TODO: Implement migration logic
|
|
527
|
+
} catch (error) {
|
|
528
|
+
this.log('error', `Migration failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
// UAP Protocol Operations
|
|
533
|
+
private async certify(options: any): Promise<void> {
|
|
534
|
+
try {
|
|
535
|
+
this.log('info', 'Starting UAP certification process...');
|
|
536
|
+
|
|
537
|
+
const certificationResults: any[] = [];
|
|
538
|
+
|
|
539
|
+
if (options.acap) {
|
|
540
|
+
this.log('info', 'ACAP (Agent Capability Assurance Protocol) certification enabled');
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
if (options.all) {
|
|
544
|
+
// Certify all agents and specifications
|
|
545
|
+
this.log('info', 'Certifying all agents and specifications...');
|
|
546
|
+
|
|
547
|
+
const agents = this.getAllAgents();
|
|
548
|
+
const specs = this.getAllSpecifications();
|
|
549
|
+
|
|
550
|
+
for (const agent of agents) {
|
|
551
|
+
const result = await this.certifyAgent(agent.name, options);
|
|
552
|
+
certificationResults.push(result);
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
for (const spec of specs) {
|
|
556
|
+
const result = await this.certifySpecification(spec.name, options);
|
|
557
|
+
certificationResults.push(result);
|
|
558
|
+
}
|
|
559
|
+
} else if (options.agent) {
|
|
560
|
+
// Certify specific agent
|
|
561
|
+
const result = await this.certifyAgent(options.agent, options);
|
|
562
|
+
certificationResults.push(result);
|
|
563
|
+
} else if (options.spec) {
|
|
564
|
+
// Certify specific specification
|
|
565
|
+
const result = await this.certifySpecification(options.spec, options);
|
|
566
|
+
certificationResults.push(result);
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
// Output results
|
|
570
|
+
this.outputCertificationResults(certificationResults, options.output || 'table');
|
|
571
|
+
|
|
572
|
+
} catch (error) {
|
|
573
|
+
this.log('error', `Certification failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
private async discover(options: any): Promise<void> {
|
|
578
|
+
try {
|
|
579
|
+
this.log('info', 'Starting UAP discovery process...');
|
|
580
|
+
|
|
581
|
+
if (options.uadp) {
|
|
582
|
+
this.log('info', 'UADP (Universal Agent Discovery Protocol) enabled');
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
const discoveryResults = await this.performUAPDiscovery(options);
|
|
586
|
+
|
|
587
|
+
// Output results
|
|
588
|
+
this.outputDiscoveryResults(discoveryResults, options.output || 'table');
|
|
589
|
+
|
|
590
|
+
} catch (error) {
|
|
591
|
+
this.log('error', `Discovery failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
// UAP Protocol Helper Methods
|
|
596
|
+
private async certifyAgent(agentId: string, options: any): Promise<any> {
|
|
597
|
+
try {
|
|
598
|
+
this.log('info', `Certifying agent: ${agentId}`);
|
|
599
|
+
|
|
600
|
+
const certification = {
|
|
601
|
+
id: agentId,
|
|
602
|
+
type: 'agent',
|
|
603
|
+
certified: false,
|
|
604
|
+
certificationLevel: 'none',
|
|
605
|
+
compliance: {
|
|
606
|
+
uapCompliant: false,
|
|
607
|
+
acapCompliant: false,
|
|
608
|
+
errors: [] as string[],
|
|
609
|
+
warnings: [] as string[]
|
|
610
|
+
},
|
|
611
|
+
timestamp: new Date().toISOString()
|
|
612
|
+
};
|
|
613
|
+
|
|
614
|
+
// Check if agent exists
|
|
615
|
+
const agentPath = join(this.config.agentsDir, agentId);
|
|
616
|
+
if (!existsSync(agentPath)) {
|
|
617
|
+
certification.compliance.errors.push(`Agent directory not found: ${agentPath}`);
|
|
618
|
+
return certification;
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
// ACAP certification checks
|
|
622
|
+
if (options.acap) {
|
|
623
|
+
const acapResult = await this.performACAPCertification(agentId);
|
|
624
|
+
certification.compliance.acapCompliant = acapResult.compliant;
|
|
625
|
+
certification.compliance.errors.push(...acapResult.errors);
|
|
626
|
+
certification.compliance.warnings.push(...acapResult.warnings);
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
// Basic UAP compliance checks
|
|
630
|
+
const uapResult = await this.performUAPCertification(agentId);
|
|
631
|
+
certification.compliance.uapCompliant = uapResult.compliant;
|
|
632
|
+
certification.compliance.errors.push(...uapResult.errors);
|
|
633
|
+
certification.compliance.warnings.push(...uapResult.warnings);
|
|
634
|
+
|
|
635
|
+
// Determine overall certification
|
|
636
|
+
certification.certified = certification.compliance.errors.length === 0;
|
|
637
|
+
certification.certificationLevel = certification.certified ?
|
|
638
|
+
(certification.compliance.warnings.length === 0 ? 'full' : 'conditional') : 'failed';
|
|
639
|
+
|
|
640
|
+
return certification;
|
|
641
|
+
} catch (error) {
|
|
642
|
+
return {
|
|
643
|
+
id: agentId,
|
|
644
|
+
type: 'agent',
|
|
645
|
+
certified: false,
|
|
646
|
+
certificationLevel: 'error',
|
|
647
|
+
error: error instanceof Error ? error.message : String(error),
|
|
648
|
+
timestamp: new Date().toISOString()
|
|
649
|
+
};
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
private async certifySpecification(specName: string, options: any): Promise<any> {
|
|
654
|
+
try {
|
|
655
|
+
this.log('info', `Certifying specification: ${specName}`);
|
|
656
|
+
|
|
657
|
+
const certification = {
|
|
658
|
+
id: specName,
|
|
659
|
+
type: 'specification',
|
|
660
|
+
certified: false,
|
|
661
|
+
certificationLevel: 'none',
|
|
662
|
+
compliance: {
|
|
663
|
+
openapi31Compliant: false,
|
|
664
|
+
uapCompliant: false,
|
|
665
|
+
raspEnabled: false,
|
|
666
|
+
errors: [] as string[],
|
|
667
|
+
warnings: [] as string[]
|
|
668
|
+
},
|
|
669
|
+
timestamp: new Date().toISOString()
|
|
670
|
+
};
|
|
671
|
+
|
|
672
|
+
// Check if specification exists
|
|
673
|
+
const specPath = join(this.config.specsDir, `${specName}.openapi.yml`);
|
|
674
|
+
if (!existsSync(specPath)) {
|
|
675
|
+
certification.compliance.errors.push(`Specification file not found: ${specPath}`);
|
|
676
|
+
return certification;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
// Load and validate specification
|
|
680
|
+
const content = readFileSync(specPath, 'utf8');
|
|
681
|
+
const spec = yaml.load(content) as any;
|
|
682
|
+
|
|
683
|
+
// OpenAPI 3.1 compliance check
|
|
684
|
+
const validation = OpenAPISchema.safeParse(spec);
|
|
685
|
+
if (validation.success) {
|
|
686
|
+
certification.compliance.openapi31Compliant = true;
|
|
687
|
+
} else {
|
|
688
|
+
certification.compliance.errors.push(...validation.error.issues.map(issue =>
|
|
689
|
+
`OpenAPI validation: ${issue.path.join('.')}: ${issue.message}`
|
|
690
|
+
));
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
// Check for RASP enablement
|
|
694
|
+
if (spec.info && spec.info['x-rasp-enabled']) {
|
|
695
|
+
certification.compliance.raspEnabled = true;
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
// UAP compliance checks for specifications
|
|
699
|
+
const uapResult = await this.performSpecificationUAPCertification(spec);
|
|
700
|
+
certification.compliance.uapCompliant = uapResult.compliant;
|
|
701
|
+
certification.compliance.errors.push(...uapResult.errors);
|
|
702
|
+
certification.compliance.warnings.push(...uapResult.warnings);
|
|
703
|
+
|
|
704
|
+
// Determine overall certification
|
|
705
|
+
certification.certified = certification.compliance.errors.length === 0;
|
|
706
|
+
certification.certificationLevel = certification.certified ?
|
|
707
|
+
(certification.compliance.warnings.length === 0 ? 'full' : 'conditional') : 'failed';
|
|
708
|
+
|
|
709
|
+
return certification;
|
|
710
|
+
} catch (error) {
|
|
711
|
+
return {
|
|
712
|
+
id: specName,
|
|
713
|
+
type: 'specification',
|
|
714
|
+
certified: false,
|
|
715
|
+
certificationLevel: 'error',
|
|
716
|
+
error: error instanceof Error ? error.message : String(error),
|
|
717
|
+
timestamp: new Date().toISOString()
|
|
718
|
+
};
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
private async performACAPCertification(agentId: string): Promise<{compliant: boolean, errors: string[], warnings: string[]}> {
|
|
723
|
+
// ACAP (Agent Capability Assurance Protocol) certification
|
|
724
|
+
const result = { compliant: true, errors: [] as string[], warnings: [] as string[] };
|
|
725
|
+
|
|
726
|
+
try {
|
|
727
|
+
// Check for agent capability manifest
|
|
728
|
+
const capabilityManifestPath = join(this.config.agentsDir, agentId, 'capabilities.json');
|
|
729
|
+
if (!existsSync(capabilityManifestPath)) {
|
|
730
|
+
result.errors.push('ACAP: Missing capabilities.json manifest file');
|
|
731
|
+
result.compliant = false;
|
|
732
|
+
} else {
|
|
733
|
+
// Validate capability manifest structure
|
|
734
|
+
const capabilitiesContent = readFileSync(capabilityManifestPath, 'utf8');
|
|
735
|
+
try {
|
|
736
|
+
const capabilities = JSON.parse(capabilitiesContent);
|
|
737
|
+
if (!capabilities.version || !capabilities.capabilities || !Array.isArray(capabilities.capabilities)) {
|
|
738
|
+
result.errors.push('ACAP: Invalid capabilities.json structure');
|
|
739
|
+
result.compliant = false;
|
|
740
|
+
}
|
|
741
|
+
} catch (parseError) {
|
|
742
|
+
result.errors.push('ACAP: Invalid JSON in capabilities.json');
|
|
743
|
+
result.compliant = false;
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
// Check for performance benchmarks
|
|
748
|
+
const benchmarkPath = join(this.config.agentsDir, agentId, 'benchmarks.json');
|
|
749
|
+
if (!existsSync(benchmarkPath)) {
|
|
750
|
+
result.warnings.push('ACAP: Missing performance benchmarks file');
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
} catch (error) {
|
|
754
|
+
result.errors.push(`ACAP certification error: ${error instanceof Error ? error.message : String(error)}`);
|
|
755
|
+
result.compliant = false;
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
return result;
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
private async performUAPCertification(agentId: string): Promise<{compliant: boolean, errors: string[], warnings: string[]}> {
|
|
762
|
+
// UAP (Universal Agent Protocol) certification
|
|
763
|
+
const result = { compliant: true, errors: [] as string[], warnings: [] as string[] };
|
|
764
|
+
|
|
765
|
+
try {
|
|
766
|
+
// Check for agent configuration
|
|
767
|
+
const configPath = join(this.config.agentsDir, agentId, 'agent.json');
|
|
768
|
+
if (!existsSync(configPath)) {
|
|
769
|
+
result.errors.push('UAP: Missing agent.json configuration file');
|
|
770
|
+
result.compliant = false;
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
// Check for API specification
|
|
774
|
+
const apiSpecPath = join(this.config.agentsDir, agentId, 'api.openapi.yml');
|
|
775
|
+
if (!existsSync(apiSpecPath)) {
|
|
776
|
+
result.warnings.push('UAP: Missing OpenAPI specification');
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
} catch (error) {
|
|
780
|
+
result.errors.push(`UAP certification error: ${error instanceof Error ? error.message : String(error)}`);
|
|
781
|
+
result.compliant = false;
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
return result;
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
private async performSpecificationUAPCertification(spec: any): Promise<{compliant: boolean, errors: string[], warnings: string[]}> {
|
|
788
|
+
// UAP certification for specifications
|
|
789
|
+
const result = { compliant: true, errors: [] as string[], warnings: [] as string[] };
|
|
790
|
+
|
|
791
|
+
try {
|
|
792
|
+
// Check for required UAP extensions
|
|
793
|
+
if (!spec.info || !spec.info['x-uap-version']) {
|
|
794
|
+
result.warnings.push('UAP: Missing x-uap-version extension');
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
// Check for security schemes
|
|
798
|
+
if (!spec.components || !spec.components.securitySchemes) {
|
|
799
|
+
result.warnings.push('UAP: No security schemes defined');
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
// Check for agent metadata
|
|
803
|
+
if (!spec.info || !spec.info['x-agent-type']) {
|
|
804
|
+
result.warnings.push('UAP: Missing x-agent-type metadata');
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
} catch (error) {
|
|
808
|
+
result.errors.push(`UAP specification certification error: ${error instanceof Error ? error.message : String(error)}`);
|
|
809
|
+
result.compliant = false;
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
return result;
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
private async performUAPDiscovery(options: any): Promise<any[]> {
|
|
816
|
+
try {
|
|
817
|
+
const discoveryResults = [];
|
|
818
|
+
|
|
819
|
+
if (options.uadp) {
|
|
820
|
+
// UADP (Universal Agent Discovery Protocol) discovery
|
|
821
|
+
this.log('info', 'Performing UADP network discovery...');
|
|
822
|
+
|
|
823
|
+
const networkResults = await this.performUADPDiscovery(options);
|
|
824
|
+
discoveryResults.push(...networkResults);
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
// Local agent discovery
|
|
828
|
+
this.log('info', 'Discovering local UAP-compliant agents...');
|
|
829
|
+
const localResults = await this.performLocalAgentDiscovery(options);
|
|
830
|
+
discoveryResults.push(...localResults);
|
|
831
|
+
|
|
832
|
+
return discoveryResults;
|
|
833
|
+
} catch (error) {
|
|
834
|
+
this.log('error', `Discovery error: ${error instanceof Error ? error.message : String(error)}`);
|
|
835
|
+
return [];
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
private async performUADPDiscovery(options: any): Promise<any[]> {
|
|
840
|
+
// UADP network discovery implementation
|
|
841
|
+
const results = [];
|
|
842
|
+
const timeout = parseInt(options.timeout) || 5000;
|
|
843
|
+
const network = options.network || 'local';
|
|
844
|
+
|
|
845
|
+
try {
|
|
846
|
+
this.log('info', `UADP: Scanning network '${network}' (timeout: ${timeout}ms)`);
|
|
847
|
+
|
|
848
|
+
// Simulate network discovery (in real implementation, this would use UDP multicast or similar)
|
|
849
|
+
const mockNetworkAgents = [
|
|
850
|
+
{
|
|
851
|
+
id: 'network-agent-001',
|
|
852
|
+
type: 'worker',
|
|
853
|
+
location: 'network',
|
|
854
|
+
endpoint: 'http://192.168.1.100:3000',
|
|
855
|
+
capabilities: ['data-processing', 'analysis'],
|
|
856
|
+
version: '1.0.0',
|
|
857
|
+
uapCompliant: true,
|
|
858
|
+
discovered: new Date().toISOString(),
|
|
859
|
+
discoveryMethod: 'UADP'
|
|
860
|
+
},
|
|
861
|
+
{
|
|
862
|
+
id: 'network-agent-002',
|
|
863
|
+
type: 'orchestrator',
|
|
864
|
+
location: 'network',
|
|
865
|
+
endpoint: 'http://192.168.1.101:3000',
|
|
866
|
+
capabilities: ['coordination', 'workflow-management'],
|
|
867
|
+
version: '1.1.0',
|
|
868
|
+
uapCompliant: true,
|
|
869
|
+
discovered: new Date().toISOString(),
|
|
870
|
+
discoveryMethod: 'UADP'
|
|
871
|
+
}
|
|
872
|
+
];
|
|
873
|
+
|
|
874
|
+
// Apply filters if specified
|
|
875
|
+
let filteredResults = mockNetworkAgents;
|
|
876
|
+
if (options.filter) {
|
|
877
|
+
const filterLower = options.filter.toLowerCase();
|
|
878
|
+
filteredResults = mockNetworkAgents.filter(agent =>
|
|
879
|
+
agent.type.toLowerCase().includes(filterLower) ||
|
|
880
|
+
agent.capabilities.some(cap => cap.toLowerCase().includes(filterLower)) ||
|
|
881
|
+
agent.version.includes(options.filter)
|
|
882
|
+
);
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
results.push(...filteredResults);
|
|
886
|
+
|
|
887
|
+
} catch (error) {
|
|
888
|
+
this.log('error', `UADP discovery error: ${error instanceof Error ? error.message : String(error)}`);
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
return results;
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
private async performLocalAgentDiscovery(options: any): Promise<any[]> {
|
|
895
|
+
try {
|
|
896
|
+
const agents = this.getAllAgents();
|
|
897
|
+
const results = [];
|
|
898
|
+
|
|
899
|
+
for (const agent of agents) {
|
|
900
|
+
try {
|
|
901
|
+
const agentInfo = {
|
|
902
|
+
id: agent.name,
|
|
903
|
+
type: 'unknown',
|
|
904
|
+
location: 'local',
|
|
905
|
+
path: agent.path,
|
|
906
|
+
capabilities: [] as string[],
|
|
907
|
+
version: 'unknown',
|
|
908
|
+
uapCompliant: false,
|
|
909
|
+
discovered: new Date().toISOString(),
|
|
910
|
+
discoveryMethod: 'local'
|
|
911
|
+
};
|
|
912
|
+
|
|
913
|
+
// Try to load agent configuration
|
|
914
|
+
const configPath = join(agent.path, 'agent.json');
|
|
915
|
+
if (existsSync(configPath)) {
|
|
916
|
+
const configContent = readFileSync(configPath, 'utf8');
|
|
917
|
+
const config = JSON.parse(configContent);
|
|
918
|
+
|
|
919
|
+
agentInfo.type = config.type || 'unknown';
|
|
920
|
+
agentInfo.version = config.version || 'unknown';
|
|
921
|
+
agentInfo.capabilities = config.capabilities || [];
|
|
922
|
+
agentInfo.uapCompliant = config.uapCompliant || false;
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
// Apply filters if specified
|
|
926
|
+
if (options.filter) {
|
|
927
|
+
const filterLower = options.filter.toLowerCase();
|
|
928
|
+
const matchesFilter =
|
|
929
|
+
agentInfo.type.toLowerCase().includes(filterLower) ||
|
|
930
|
+
agentInfo.capabilities.some(cap => cap.toLowerCase().includes(filterLower)) ||
|
|
931
|
+
agentInfo.version.includes(options.filter);
|
|
932
|
+
|
|
933
|
+
if (matchesFilter) {
|
|
934
|
+
results.push(agentInfo);
|
|
935
|
+
}
|
|
936
|
+
} else {
|
|
937
|
+
results.push(agentInfo);
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
} catch (error) {
|
|
941
|
+
this.log('warn', `Failed to discover agent ${agent.name}: ${error instanceof Error ? error.message : String(error)}`);
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
return results;
|
|
946
|
+
} catch (error) {
|
|
947
|
+
this.log('error', `Local discovery error: ${error instanceof Error ? error.message : String(error)}`);
|
|
948
|
+
return [];
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
private outputCertificationResults(results: any[], format: string): void {
|
|
953
|
+
if (format === 'json') {
|
|
954
|
+
console.log(JSON.stringify(results, null, 2));
|
|
955
|
+
} else if (format === 'yaml') {
|
|
956
|
+
console.log(yaml.dump(results));
|
|
957
|
+
} else {
|
|
958
|
+
// Table format
|
|
959
|
+
const tableData = results.map(result => ({
|
|
960
|
+
ID: result.id,
|
|
961
|
+
Type: result.type,
|
|
962
|
+
Certified: result.certified ? '✅' : '❌',
|
|
963
|
+
Level: result.certificationLevel,
|
|
964
|
+
'UAP Compliant': result.compliance?.uapCompliant ? '✅' : '❌',
|
|
965
|
+
'ACAP Compliant': result.compliance?.acapCompliant ? '✅' : '❌',
|
|
966
|
+
Errors: result.compliance?.errors?.length || 0,
|
|
967
|
+
Warnings: result.compliance?.warnings?.length || 0
|
|
968
|
+
}));
|
|
969
|
+
|
|
970
|
+
console.log(chalk.cyan('\n📋 UAP Certification Results:\n'));
|
|
971
|
+
console.table(tableData);
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
private outputDiscoveryResults(results: any[], format: string): void {
|
|
976
|
+
if (format === 'json') {
|
|
977
|
+
console.log(JSON.stringify(results, null, 2));
|
|
978
|
+
} else if (format === 'yaml') {
|
|
979
|
+
console.log(yaml.dump(results));
|
|
980
|
+
} else {
|
|
981
|
+
// Table format
|
|
982
|
+
const tableData = results.map(result => ({
|
|
983
|
+
ID: result.id,
|
|
984
|
+
Type: result.type,
|
|
985
|
+
Location: result.location,
|
|
986
|
+
Method: result.discoveryMethod,
|
|
987
|
+
'UAP Compliant': result.uapCompliant ? '✅' : '❌',
|
|
988
|
+
Capabilities: result.capabilities.slice(0, 3).join(', ') + (result.capabilities.length > 3 ? '...' : ''),
|
|
989
|
+
Version: result.version,
|
|
990
|
+
Endpoint: result.endpoint || result.path || 'N/A'
|
|
991
|
+
}));
|
|
992
|
+
|
|
993
|
+
console.log(chalk.cyan('\n🔍 UAP Discovery Results:\n'));
|
|
994
|
+
console.table(tableData);
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
// Helper methods
|
|
999
|
+
private getSpecTemplate(template: string): any {
|
|
1000
|
+
const templates = {
|
|
1001
|
+
basic: {
|
|
1002
|
+
openapi: '3.1.0',
|
|
1003
|
+
info: {
|
|
1004
|
+
title: 'API',
|
|
1005
|
+
version: '1.0.0'
|
|
1006
|
+
},
|
|
1007
|
+
paths: {}
|
|
1008
|
+
},
|
|
1009
|
+
advanced: {
|
|
1010
|
+
openapi: '3.1.0',
|
|
1011
|
+
info: {
|
|
1012
|
+
title: 'API',
|
|
1013
|
+
version: '1.0.0'
|
|
1014
|
+
},
|
|
1015
|
+
servers: [
|
|
1016
|
+
{ url: 'http://localhost:3000/api/v1', description: 'Development server' }
|
|
1017
|
+
],
|
|
1018
|
+
paths: {},
|
|
1019
|
+
components: {
|
|
1020
|
+
schemas: {}
|
|
1021
|
+
}
|
|
1022
|
+
},
|
|
1023
|
+
industrial: {
|
|
1024
|
+
openapi: '3.1.0',
|
|
1025
|
+
info: {
|
|
1026
|
+
title: 'Industrial API',
|
|
1027
|
+
version: '1.0.0'
|
|
1028
|
+
},
|
|
1029
|
+
servers: [
|
|
1030
|
+
{ url: 'http://localhost:3000/api/v1', description: 'Development server' }
|
|
1031
|
+
],
|
|
1032
|
+
paths: {
|
|
1033
|
+
'/opcua/connect': {
|
|
1034
|
+
post: {
|
|
1035
|
+
summary: 'Connect to OPC UA server',
|
|
1036
|
+
operationId: 'connectOpcUa',
|
|
1037
|
+
requestBody: {
|
|
1038
|
+
required: true,
|
|
1039
|
+
content: {
|
|
1040
|
+
'application/json': {
|
|
1041
|
+
schema: {
|
|
1042
|
+
type: 'object',
|
|
1043
|
+
properties: {
|
|
1044
|
+
endpoint: { type: 'string' },
|
|
1045
|
+
securityMode: { type: 'string' }
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
},
|
|
1051
|
+
responses: {
|
|
1052
|
+
'200': {
|
|
1053
|
+
description: 'Connection successful'
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
},
|
|
1059
|
+
components: {
|
|
1060
|
+
schemas: {}
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
};
|
|
1064
|
+
|
|
1065
|
+
return templates[template as keyof typeof templates] || templates.basic;
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
private getAllSpecifications(): any[] {
|
|
1069
|
+
try {
|
|
1070
|
+
if (!existsSync(this.config.specsDir)) return [];
|
|
1071
|
+
|
|
1072
|
+
return readdirSync(this.config.specsDir)
|
|
1073
|
+
.filter(file => file.endsWith('.openapi.yml') || file.endsWith('.openapi.yaml'))
|
|
1074
|
+
.map(file => {
|
|
1075
|
+
const filePath = join(this.config.specsDir, file);
|
|
1076
|
+
const stats = statSync(filePath);
|
|
1077
|
+
return {
|
|
1078
|
+
name: file.replace(/\.openapi\.ya?ml$/, ''),
|
|
1079
|
+
path: filePath,
|
|
1080
|
+
lastModified: stats.mtime.toISOString(),
|
|
1081
|
+
size: stats.size
|
|
1082
|
+
};
|
|
1083
|
+
});
|
|
1084
|
+
} catch (error) {
|
|
1085
|
+
this.log('error', `Failed to get specifications: ${error instanceof Error ? error.message : String(error)}`);
|
|
1086
|
+
return [];
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
private getAllAgents(): any[] {
|
|
1091
|
+
try {
|
|
1092
|
+
if (!existsSync(this.config.agentsDir)) return [];
|
|
1093
|
+
|
|
1094
|
+
return readdirSync(this.config.agentsDir, { withFileTypes: true })
|
|
1095
|
+
.filter(dirent => dirent.isDirectory())
|
|
1096
|
+
.map(dirent => ({
|
|
1097
|
+
name: dirent.name,
|
|
1098
|
+
path: join(this.config.agentsDir, dirent.name)
|
|
1099
|
+
}));
|
|
1100
|
+
} catch (error) {
|
|
1101
|
+
this.log('error', `Failed to get agents: ${error instanceof Error ? error.message : String(error)}`);
|
|
1102
|
+
return [];
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
private async validateAllSpecifications(): Promise<void> {
|
|
1107
|
+
const specs = this.getAllSpecifications();
|
|
1108
|
+
for (const spec of specs) {
|
|
1109
|
+
await this.validateSpecification(spec.name);
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
private async validateAllAgents(): Promise<void> {
|
|
1114
|
+
const agents = this.getAllAgents();
|
|
1115
|
+
for (const agent of agents) {
|
|
1116
|
+
await this.validateAgent(agent.name);
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
private async validateSpecification(name: string): Promise<boolean> {
|
|
1121
|
+
try {
|
|
1122
|
+
const specPath = join(this.config.specsDir, `${name}.openapi.yml`);
|
|
1123
|
+
if (!existsSync(specPath)) {
|
|
1124
|
+
this.log('error', `Specification not found: ${name}`);
|
|
1125
|
+
return false;
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
const content = readFileSync(specPath, 'utf8');
|
|
1129
|
+
const spec = yaml.load(content);
|
|
1130
|
+
|
|
1131
|
+
const validation = OpenAPISchema.safeParse(spec);
|
|
1132
|
+
if (validation.success) {
|
|
1133
|
+
this.log('info', `✅ Specification ${name} is valid`);
|
|
1134
|
+
return true;
|
|
1135
|
+
} else {
|
|
1136
|
+
this.log('error', `❌ Specification ${name} is invalid`, validation.error.issues);
|
|
1137
|
+
return false;
|
|
1138
|
+
}
|
|
1139
|
+
} catch (error) {
|
|
1140
|
+
this.log('error', `Failed to validate specification ${name}: ${error instanceof Error ? error.message : String(error)}`);
|
|
1141
|
+
return false;
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
private async validateAgent(agentId: string): Promise<boolean> {
|
|
1146
|
+
try {
|
|
1147
|
+
// TODO: Implement agent validation logic
|
|
1148
|
+
this.log('info', `Validating agent: ${agentId}`);
|
|
1149
|
+
return true;
|
|
1150
|
+
} catch (error) {
|
|
1151
|
+
this.log('error', `Failed to validate agent ${agentId}: ${error instanceof Error ? error.message : String(error)}`);
|
|
1152
|
+
return false;
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
private async generateTypes(specName: string): Promise<void> {
|
|
1157
|
+
try {
|
|
1158
|
+
this.log('info', `Generating TypeScript types for ${specName}...`);
|
|
1159
|
+
// TODO: Implement TypeScript type generation
|
|
1160
|
+
} catch (error) {
|
|
1161
|
+
this.log('error', `Failed to generate types: ${error instanceof Error ? error.message : String(error)}`);
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
public run(): void {
|
|
1166
|
+
this.program.parse();
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1170
|
+
// CLI entry point for ES modules
|
|
1171
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
1172
|
+
const cli = new OSSACli();
|
|
1173
|
+
cli.run();
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
export default OSSACli;
|