@neural-node-labs/xcoder-dna 0.0.0-stage → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +132 -2
- package/dist/agents/agent-catalog.d.ts +87 -0
- package/dist/agents/agent-catalog.js +159 -0
- package/dist/agents/agent-registry.d.ts +76 -0
- package/dist/agents/agent-registry.js +189 -0
- package/dist/agents/ai-chat-debate.d.ts +36 -0
- package/dist/agents/ai-chat-debate.js +300 -0
- package/dist/agents/ai-chat-report-writer.d.ts +7 -0
- package/dist/agents/ai-chat-report-writer.js +100 -0
- package/dist/agents/duplicate-detector.d.ts +41 -0
- package/dist/agents/duplicate-detector.js +65 -0
- package/dist/agents/genesis-agent.d.ts +61 -0
- package/dist/agents/genesis-agent.js +340 -0
- package/dist/agents/samurai-agent.d.ts +53 -0
- package/dist/agents/samurai-agent.js +279 -0
- package/dist/agents/sub-agent.d.ts +56 -0
- package/dist/agents/sub-agent.js +353 -0
- package/dist/backlog/backlog-requirement-validator.d.ts +10 -0
- package/dist/backlog/backlog-requirement-validator.js +60 -0
- package/dist/backlog/backlog-store.d.ts +29 -0
- package/dist/backlog/backlog-store.js +148 -0
- package/dist/backlog/po-agent.d.ts +16 -0
- package/dist/backlog/po-agent.js +121 -0
- package/dist/backlog/types.d.ts +25 -0
- package/dist/backlog/types.js +4 -0
- package/dist/bench/run.d.ts +11 -0
- package/dist/bench/run.js +185 -0
- package/dist/bench/types.d.ts +50 -0
- package/dist/bench/types.js +1 -0
- package/dist/cli/delegate.d.ts +90 -0
- package/dist/cli/delegate.js +220 -0
- package/dist/cli/swarm.d.ts +10 -0
- package/dist/cli/swarm.js +100 -0
- package/dist/cli/task.d.ts +14 -0
- package/dist/cli/task.js +121 -0
- package/dist/cli/wbc-arg.d.ts +6 -0
- package/dist/cli/wbc-arg.js +40 -0
- package/dist/cli/wbc.d.ts +45 -0
- package/dist/cli/wbc.js +98 -0
- package/dist/commands/license.d.ts +9 -0
- package/dist/commands/license.js +140 -0
- package/dist/commands/release.d.ts +44 -0
- package/dist/commands/release.js +180 -0
- package/dist/commands/test.d.ts +50 -0
- package/dist/commands/test.js +385 -0
- package/dist/config/env-guard.d.ts +35 -0
- package/dist/config/env-guard.js +100 -0
- package/dist/config/env-snapshot.d.ts +18 -0
- package/dist/config/env-snapshot.js +30 -0
- package/dist/config/loadConfig.d.ts +82 -0
- package/dist/config/loadConfig.js +249 -0
- package/dist/config/secure-mode.d.ts +29 -0
- package/dist/config/secure-mode.js +63 -0
- package/dist/config/user-config.d.ts +39 -0
- package/dist/config/user-config.js +202 -0
- package/dist/engine/reasoning-engine.d.ts +21 -0
- package/dist/engine/reasoning-engine.js +59 -0
- package/dist/events/bus.d.ts +22 -0
- package/dist/events/bus.js +18 -0
- package/dist/index.d.ts +87 -0
- package/dist/index.js +88 -0
- package/dist/indexing/ignoreRules.d.ts +1 -0
- package/dist/indexing/ignoreRules.js +53 -0
- package/dist/instance-swarm/instance-swarm-orchestrator.d.ts +57 -0
- package/dist/instance-swarm/instance-swarm-orchestrator.js +204 -0
- package/dist/instance-swarm/protocol-name-resolver.d.ts +23 -0
- package/dist/instance-swarm/protocol-name-resolver.js +64 -0
- package/dist/license/gate.d.ts +31 -0
- package/dist/license/gate.js +188 -0
- package/dist/license/http-client.d.ts +43 -0
- package/dist/license/http-client.js +195 -0
- package/dist/license/manager.d.ts +39 -0
- package/dist/license/manager.js +175 -0
- package/dist/license/receipt.d.ts +27 -0
- package/dist/license/receipt.js +108 -0
- package/dist/license/state-codec.d.ts +72 -0
- package/dist/license/state-codec.js +218 -0
- package/dist/license/state-paths.d.ts +17 -0
- package/dist/license/state-paths.js +64 -0
- package/dist/license/store.d.ts +44 -0
- package/dist/license/store.js +223 -0
- package/dist/license/trust-anchor.d.ts +24 -0
- package/dist/license/trust-anchor.js +74 -0
- package/dist/license/types.d.ts +34 -0
- package/dist/license/types.js +19 -0
- package/dist/llm/budget.d.ts +23 -0
- package/dist/llm/budget.js +58 -0
- package/dist/llm/client.d.ts +53 -0
- package/dist/llm/client.js +122 -0
- package/dist/llm/factory.d.ts +14 -0
- package/dist/llm/factory.js +32 -0
- package/dist/orchestrator/defect-logger.d.ts +31 -0
- package/dist/orchestrator/defect-logger.js +101 -0
- package/dist/orchestrator/defect-manager.d.ts +118 -0
- package/dist/orchestrator/defect-manager.js +338 -0
- package/dist/orchestrator/defect-migration.d.ts +14 -0
- package/dist/orchestrator/defect-migration.js +174 -0
- package/dist/orchestrator/defect-store.d.ts +48 -0
- package/dist/orchestrator/defect-store.js +76 -0
- package/dist/orchestrator/healing.d.ts +14 -0
- package/dist/orchestrator/healing.js +11 -0
- package/dist/orchestrator/interactive-steering.d.ts +64 -0
- package/dist/orchestrator/interactive-steering.js +107 -0
- package/dist/orchestrator/interrupt-handler.d.ts +30 -0
- package/dist/orchestrator/interrupt-handler.js +70 -0
- package/dist/orchestrator/lesson-manager.d.ts +25 -0
- package/dist/orchestrator/lesson-manager.js +122 -0
- package/dist/orchestrator/progress-summary.d.ts +15 -0
- package/dist/orchestrator/progress-summary.js +106 -0
- package/dist/orchestrator/reasoning-score.d.ts +49 -0
- package/dist/orchestrator/reasoning-score.js +117 -0
- package/dist/orchestrator/swarm.d.ts +36 -0
- package/dist/orchestrator/swarm.js +77 -0
- package/dist/orchestrator/task-factory.d.ts +15 -0
- package/dist/orchestrator/task-factory.js +176 -0
- package/dist/orchestrator/validation-gate.d.ts +23 -0
- package/dist/orchestrator/validation-gate.js +155 -0
- package/dist/protocol/react-contract.d.ts +136 -0
- package/dist/protocol/react-contract.js +698 -0
- package/dist/protocol/wks-protocol-manager.d.ts +22 -0
- package/dist/protocol/wks-protocol-manager.js +72 -0
- package/dist/sdlc-runtime/conversation-runner.d.ts +8 -0
- package/dist/sdlc-runtime/conversation-runner.js +64 -0
- package/dist/sdlc-runtime/dag-utils.d.ts +15 -0
- package/dist/sdlc-runtime/dag-utils.js +67 -0
- package/dist/sdlc-runtime/defect-integration.d.ts +7 -0
- package/dist/sdlc-runtime/defect-integration.js +99 -0
- package/dist/sdlc-runtime/execution-loop.d.ts +38 -0
- package/dist/sdlc-runtime/execution-loop.js +274 -0
- package/dist/sdlc-runtime/lesson-recorder.d.ts +9 -0
- package/dist/sdlc-runtime/lesson-recorder.js +27 -0
- package/dist/sdlc-runtime/plan-initializer.d.ts +47 -0
- package/dist/sdlc-runtime/plan-initializer.js +135 -0
- package/dist/sdlc-runtime/progress-persister.d.ts +10 -0
- package/dist/sdlc-runtime/progress-persister.js +34 -0
- package/dist/sdlc-runtime/protocol-loader.d.ts +10 -0
- package/dist/sdlc-runtime/protocol-loader.js +21 -0
- package/dist/sdlc-runtime/reporting.d.ts +24 -0
- package/dist/sdlc-runtime/reporting.js +68 -0
- package/dist/sdlc-runtime/run-task.d.ts +81 -0
- package/dist/sdlc-runtime/run-task.js +210 -0
- package/dist/sdlc-runtime/sdlc-orchestrator.d.ts +59 -0
- package/dist/sdlc-runtime/sdlc-orchestrator.js +170 -0
- package/dist/sdlc-runtime/sdlc-skill.d.ts +44 -0
- package/dist/sdlc-runtime/sdlc-skill.js +148 -0
- package/dist/sdlc-runtime/steering-handler.d.ts +14 -0
- package/dist/sdlc-runtime/steering-handler.js +51 -0
- package/dist/sdlc-runtime/trace-recorder.d.ts +10 -0
- package/dist/sdlc-runtime/trace-recorder.js +7 -0
- package/dist/security/index.d.ts +16 -0
- package/dist/security/index.js +12 -0
- package/dist/security/input-screen.d.ts +30 -0
- package/dist/security/input-screen.js +75 -0
- package/dist/security/tool-call-guard.d.ts +16 -0
- package/dist/security/tool-call-guard.js +174 -0
- package/dist/security/untrusted-content.d.ts +34 -0
- package/dist/security/untrusted-content.js +63 -0
- package/dist/skills/advanced-dfir/SKILL.md +85 -0
- package/dist/skills/advanced-pentest-lab/SKILL.md +88 -0
- package/dist/skills/analyst/SKILL.md +55 -0
- package/dist/skills/architect/SKILL.md +54 -0
- package/dist/skills/aws/SKILL.md +92 -0
- package/dist/skills/azure/SKILL.md +90 -0
- package/dist/skills/bylaw-context.d.ts +45 -0
- package/dist/skills/bylaw-context.js +61 -0
- package/dist/skills/bylaw-review.d.ts +20 -0
- package/dist/skills/bylaw-review.js +101 -0
- package/dist/skills/conversation/SKILL.md +29 -0
- package/dist/skills/design-patterns/SKILL.md +190 -0
- package/dist/skills/devops/SKILL.md +55 -0
- package/dist/skills/directives.d.ts +20 -0
- package/dist/skills/directives.js +313 -0
- package/dist/skills/docker/SKILL.md +76 -0
- package/dist/skills/docker-expert/SKILL.md +56 -0
- package/dist/skills/enterprise-systems-analyst/SKILL.md +83 -0
- package/dist/skills/enterprise-systems-analyst/references/crm.md +41 -0
- package/dist/skills/enterprise-systems-analyst/references/erp.md +40 -0
- package/dist/skills/enterprise-systems-analyst/references/financial-systems.md +35 -0
- package/dist/skills/enterprise-systems-analyst/references/hcm.md +38 -0
- package/dist/skills/enterprise-systems-analyst/references/mrp.md +37 -0
- package/dist/skills/enterprise-systems-analyst/references/scm.md +32 -0
- package/dist/skills/ethical-hacking-methodology/SKILL.md +119 -0
- package/dist/skills/externalSkillLoader.d.ts +25 -0
- package/dist/skills/externalSkillLoader.js +65 -0
- package/dist/skills/externalSkillRegistry.d.ts +33 -0
- package/dist/skills/externalSkillRegistry.js +94 -0
- package/dist/skills/filesystem-management/SKILL.md +61 -0
- package/dist/skills/first-run-seed.d.ts +26 -0
- package/dist/skills/first-run-seed.js +75 -0
- package/dist/skills/git-vcs/SKILL.md +84 -0
- package/dist/skills/kafka/SKILL.md +89 -0
- package/dist/skills/kubernetes/SKILL.md +93 -0
- package/dist/skills/kubernetes-expert/SKILL.md +54 -0
- package/dist/skills/openshift/SKILL.md +93 -0
- package/dist/skills/pentester/SKILL.md +59 -0
- package/dist/skills/performance-tester/SKILL.md +57 -0
- package/dist/skills/playwright-ui-tester/SKILL.md +67 -0
- package/dist/skills/programmer/SKILL.md +58 -0
- package/dist/skills/project-scaffolding/SKILL.md +133 -0
- package/dist/skills/qa-engineer/SKILL.md +91 -0
- package/dist/skills/rca/SKILL.md +58 -0
- package/dist/skills/redhat/SKILL.md +92 -0
- package/dist/skills/rosa/SKILL.md +80 -0
- package/dist/skills/scrum-framework/SKILL.md +74 -0
- package/dist/skills/scrum-framework/references/artifacts_and_quality.md +79 -0
- package/dist/skills/scrum-framework/references/roles_and_events.md +105 -0
- package/dist/skills/scrum-master-agent/SKILL.md +74 -0
- package/dist/skills/scrum-master-agent/references/behaviors.md +56 -0
- package/dist/skills/sdlc-skill.d.ts +1 -0
- package/dist/skills/sdlc-skill.js +4 -0
- package/dist/skills/secops/SKILL.md +52 -0
- package/dist/skills/secure-architect.bylaws.d.ts +68 -0
- package/dist/skills/secure-architect.bylaws.js +525 -0
- package/dist/skills/seed-skills.d.ts +48 -0
- package/dist/skills/seed-skills.js +213 -0
- package/dist/skills/skill-authoring/SKILL.md +123 -0
- package/dist/skills/skill-header.d.ts +51 -0
- package/dist/skills/skill-header.js +163 -0
- package/dist/skills/skill-path-guard.d.ts +41 -0
- package/dist/skills/skill-path-guard.js +95 -0
- package/dist/skills/skillRouter.d.ts +51 -0
- package/dist/skills/skillRouter.js +90 -0
- package/dist/skills/skills-root.d.ts +64 -0
- package/dist/skills/skills-root.js +168 -0
- package/dist/skills/software-architect/SKILL.md +77 -0
- package/dist/skills/software-engineer/SKILL.md +74 -0
- package/dist/skills/solid-principles/SKILL.md +94 -0
- package/dist/skills/task-planning/SKILL.md +115 -0
- package/dist/skills/tester/SKILL.md +54 -0
- package/dist/skills/ubuntu/SKILL.md +87 -0
- package/dist/skills/ui-ux-design/SKILL.md +114 -0
- package/dist/skills/workspace-context/SKILL.md +103 -0
- package/dist/sprint/controller.d.ts +37 -0
- package/dist/sprint/controller.js +220 -0
- package/dist/sprint/dag-builder.d.ts +14 -0
- package/dist/sprint/dag-builder.js +105 -0
- package/dist/sprint/reporter.d.ts +11 -0
- package/dist/sprint/reporter.js +97 -0
- package/dist/sprint/state-store.d.ts +10 -0
- package/dist/sprint/state-store.js +71 -0
- package/dist/sprint/types.d.ts +24 -0
- package/dist/sprint/types.js +4 -0
- package/dist/store/file-version-store.d.ts +24 -0
- package/dist/store/file-version-store.js +73 -0
- package/dist/store/task-store.d.ts +90 -0
- package/dist/store/task-store.js +166 -0
- package/dist/task-ingest/architect-detailer.d.ts +43 -0
- package/dist/task-ingest/architect-detailer.js +141 -0
- package/dist/task-ingest/detail-schema.d.ts +9 -0
- package/dist/task-ingest/detail-schema.js +195 -0
- package/dist/task-ingest/detailed-run.d.ts +36 -0
- package/dist/task-ingest/detailed-run.js +108 -0
- package/dist/task-ingest/extract-id.d.ts +9 -0
- package/dist/task-ingest/extract-id.js +24 -0
- package/dist/task-ingest/index.d.ts +23 -0
- package/dist/task-ingest/index.js +14 -0
- package/dist/task-ingest/ingest.d.ts +45 -0
- package/dist/task-ingest/ingest.js +163 -0
- package/dist/task-ingest/list-ingested.d.ts +13 -0
- package/dist/task-ingest/list-ingested.js +30 -0
- package/dist/task-ingest/pending-filter.d.ts +30 -0
- package/dist/task-ingest/pending-filter.js +59 -0
- package/dist/task-ingest/scanner.d.ts +56 -0
- package/dist/task-ingest/scanner.js +216 -0
- package/dist/task-ingest/source-reader.d.ts +25 -0
- package/dist/task-ingest/source-reader.js +93 -0
- package/dist/task-ingest/spec-builder.d.ts +34 -0
- package/dist/task-ingest/spec-builder.js +89 -0
- package/dist/task-ingest/wbs-extract.d.ts +50 -0
- package/dist/task-ingest/wbs-extract.js +226 -0
- package/dist/task-ingest/wbs-parser.d.ts +36 -0
- package/dist/task-ingest/wbs-parser.js +170 -0
- package/dist/tools/apiTestTool.d.ts +37 -0
- package/dist/tools/apiTestTool.js +128 -0
- package/dist/tools/ast-tools.d.ts +183 -0
- package/dist/tools/ast-tools.js +853 -0
- package/dist/tools/browse-tool.d.ts +105 -0
- package/dist/tools/browse-tool.js +394 -0
- package/dist/tools/credential.d.ts +17 -0
- package/dist/tools/credential.js +32 -0
- package/dist/tools/dependency-graph.d.ts +23 -0
- package/dist/tools/dependency-graph.js +164 -0
- package/dist/tools/edit-tool.d.ts +34 -0
- package/dist/tools/edit-tool.js +95 -0
- package/dist/tools/file-header-manager.d.ts +27 -0
- package/dist/tools/file-header-manager.js +153 -0
- package/dist/tools/fs-tools.d.ts +154 -0
- package/dist/tools/fs-tools.js +337 -0
- package/dist/tools/git-tools.d.ts +79 -0
- package/dist/tools/git-tools.js +348 -0
- package/dist/tools/github-tool.d.ts +48 -0
- package/dist/tools/github-tool.js +147 -0
- package/dist/tools/globTool.d.ts +20 -0
- package/dist/tools/globTool.js +34 -0
- package/dist/tools/grepTool.d.ts +19 -0
- package/dist/tools/grepTool.js +44 -0
- package/dist/tools/index-freshness.d.ts +58 -0
- package/dist/tools/index-freshness.js +196 -0
- package/dist/tools/index-glob.d.ts +48 -0
- package/dist/tools/index-glob.js +175 -0
- package/dist/tools/load-skill-tool.d.ts +15 -0
- package/dist/tools/load-skill-tool.js +114 -0
- package/dist/tools/patch-tools.d.ts +58 -0
- package/dist/tools/patch-tools.js +153 -0
- package/dist/tools/playwright-tool.d.ts +66 -0
- package/dist/tools/playwright-tool.js +121 -0
- package/dist/tools/project-detect.d.ts +20 -0
- package/dist/tools/project-detect.js +87 -0
- package/dist/tools/prompt-guidance.d.ts +22 -0
- package/dist/tools/prompt-guidance.js +23 -0
- package/dist/tools/schedule-audit.d.ts +50 -0
- package/dist/tools/schedule-audit.js +124 -0
- package/dist/tools/schedule-validation.d.ts +67 -0
- package/dist/tools/schedule-validation.js +210 -0
- package/dist/tools/scheduleTool.d.ts +62 -0
- package/dist/tools/scheduleTool.js +313 -0
- package/dist/tools/search-tools.d.ts +27 -0
- package/dist/tools/search-tools.js +78 -0
- package/dist/tools/sed-tool.d.ts +66 -0
- package/dist/tools/sed-tool.js +402 -0
- package/dist/tools/shell-result.d.ts +11 -0
- package/dist/tools/shell-result.js +1 -0
- package/dist/tools/shell-tool.d.ts +45 -0
- package/dist/tools/shell-tool.js +141 -0
- package/dist/tools/siteCrawlerTool.d.ts +32 -0
- package/dist/tools/siteCrawlerTool.js +205 -0
- package/dist/tools/tool-registry.d.ts +67 -0
- package/dist/tools/tool-registry.js +606 -0
- package/dist/tools/validate-tool.d.ts +23 -0
- package/dist/tools/validate-tool.js +201 -0
- package/dist/tools/workspace-index.d.ts +46 -0
- package/dist/tools/workspace-index.js +173 -0
- package/dist/types.d.ts +222 -0
- package/dist/types.js +7 -0
- package/dist/updater/index.d.ts +14 -0
- package/dist/updater/index.js +120 -0
- package/dist/util/banner.d.ts +25 -0
- package/dist/util/banner.js +140 -0
- package/dist/util/command-suggester.d.ts +6 -0
- package/dist/util/command-suggester.js +25 -0
- package/dist/util/confirm-interrupt.d.ts +10 -0
- package/dist/util/confirm-interrupt.js +31 -0
- package/dist/util/continue-trigger.d.ts +11 -0
- package/dist/util/continue-trigger.js +20 -0
- package/dist/util/env-info.d.ts +18 -0
- package/dist/util/env-info.js +37 -0
- package/dist/util/file-access-log.d.ts +35 -0
- package/dist/util/file-access-log.js +140 -0
- package/dist/util/footer-manager.d.ts +124 -0
- package/dist/util/footer-manager.js +195 -0
- package/dist/util/footer-renderer.d.ts +67 -0
- package/dist/util/footer-renderer.js +319 -0
- package/dist/util/footer-state.d.ts +34 -0
- package/dist/util/footer-state.js +18 -0
- package/dist/util/footer-text.d.ts +51 -0
- package/dist/util/footer-text.js +74 -0
- package/dist/util/ids.d.ts +1 -0
- package/dist/util/ids.js +4 -0
- package/dist/util/levenshtein.d.ts +6 -0
- package/dist/util/levenshtein.js +34 -0
- package/dist/util/logger.d.ts +10 -0
- package/dist/util/logger.js +41 -0
- package/dist/util/logs.d.ts +80 -0
- package/dist/util/logs.js +135 -0
- package/dist/util/output-handler.d.ts +89 -0
- package/dist/util/output-handler.js +193 -0
- package/dist/util/output-interceptor.d.ts +18 -0
- package/dist/util/output-interceptor.js +49 -0
- package/dist/util/output-paths.d.ts +43 -0
- package/dist/util/output-paths.js +121 -0
- package/dist/util/package-json.d.ts +6 -0
- package/dist/util/package-json.js +36 -0
- package/dist/util/process-kill.d.ts +27 -0
- package/dist/util/process-kill.js +148 -0
- package/dist/util/protocol-error-logger.d.ts +33 -0
- package/dist/util/protocol-error-logger.js +73 -0
- package/dist/util/redact.d.ts +25 -0
- package/dist/util/redact.js +119 -0
- package/dist/util/scroll-region-guard.d.ts +33 -0
- package/dist/util/scroll-region-guard.js +63 -0
- package/dist/util/spinner.d.ts +15 -0
- package/dist/util/spinner.js +49 -0
- package/dist/util/terminal-output.d.ts +34 -0
- package/dist/util/terminal-output.js +1 -0
- package/dist/util/terminal-silent.d.ts +6 -0
- package/dist/util/terminal-silent.js +20 -0
- package/dist/util/terminal.d.ts +56 -0
- package/dist/util/terminal.js +124 -0
- package/dist/util/text-sanitize.d.ts +8 -0
- package/dist/util/text-sanitize.js +45 -0
- package/dist/util/thinking-spinner.d.ts +27 -0
- package/dist/util/thinking-spinner.js +189 -0
- package/dist/util/tool-error-logger.d.ts +33 -0
- package/dist/util/tool-error-logger.js +77 -0
- package/dist/util/tty.d.ts +13 -0
- package/dist/util/tty.js +16 -0
- package/dist/util/xcoder-paths.d.ts +56 -0
- package/dist/util/xcoder-paths.js +63 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.js +5 -0
- package/dist/worker-agent/to-subtask-node.d.ts +35 -0
- package/dist/worker-agent/to-subtask-node.js +41 -0
- package/dist/worker-agent/worker-orchestrator.d.ts +104 -0
- package/dist/worker-agent/worker-orchestrator.js +201 -0
- package/package.json +43 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Neural Node Labs
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,133 @@
|
|
|
1
|
-
|
|
1
|
+
<!-- xcoder:version 6 | xcoder:task task-0d242c | xcoder:updated 2026-11-19T14:15:57.197Z | xcoder:subtask code-st-8d2337 -->
|
|
2
|
+
# @neural-node-labs/xcoder-dna — shared runtime for the Xcoder agents
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
`@neural-node-labs/xcoder-dna` is a **library**, not a CLI. It has no binary and nothing to run directly: it holds the reusable tools, skills, swarm, sub-agent runtime and orchestration primitives that the Xcoder agents are built from. Its public barrel, `src/index.ts`, is the only import path other packages may use.
|
|
5
|
+
|
|
6
|
+
## Install
|
|
7
|
+
|
|
8
|
+
```
|
|
9
|
+
npm install @neural-node-labs/xcoder-dna
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Node >= 20 is required. Do not install this package globally — there is no executable to put on your PATH.
|
|
13
|
+
|
|
14
|
+
## Quick start
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import { createLlmClient, log, buildIndex, ensureFreshIndex } from "@neural-node-labs/xcoder-dna";
|
|
18
|
+
|
|
19
|
+
const index = buildIndex(process.cwd());
|
|
20
|
+
await ensureFreshIndex(process.cwd());
|
|
21
|
+
log.orchestrator(`indexed ${index.files.length} files`);
|
|
22
|
+
|
|
23
|
+
const llm = createLlmClient("orchestrator", { workspaceRoot: process.cwd() });
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Embedding the SDLC orchestrator: `runSdlcTask`
|
|
27
|
+
|
|
28
|
+
`runSdlcTask` is the supported in-process entry point for hosts that want the full SDLC pipeline without shelling out
|
|
29
|
+
to a CLI. It builds the same `TaskSpec` the CLI builds and returns a small, projected result.
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
import { runSdlcTask } from "@neural-node-labs/xcoder-dna";
|
|
33
|
+
|
|
34
|
+
const r = await runSdlcTask({
|
|
35
|
+
workspaceRoot: process.cwd(),
|
|
36
|
+
task: "add a slug field to the Article model",
|
|
37
|
+
quiet: true, // default true when embedded
|
|
38
|
+
concurrency: 3,
|
|
39
|
+
deadlineMs: 1_800_000,
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
if (r.status === "completed") console.log(r.taskId, r.doneCount, "/", r.totalCount);
|
|
43
|
+
else console.error(r.status, r.error?.code, r.error?.message);
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Contract, deliberately narrow and total:
|
|
47
|
+
|
|
48
|
+
- **Never throws.** Every failure comes back as `status: "error"` with `error.code` — a failed run is data, not an
|
|
49
|
+
exception, at this boundary.
|
|
50
|
+
- **Total status union.** `completed` · `escalated` · `halted` · `aborted` · `license_warning` · `error`. Every legacy
|
|
51
|
+
CLI exit code has exactly one home: `0 → completed`, `1 → error`, `2 → escalated`, `3 → halted`, `4 → license_warning`
|
|
52
|
+
(which is never a success — the run may still have changed files).
|
|
53
|
+
- **Honest abort reporting.** `abortObservedAt` says where an abort actually landed: `before-run`, `round-boundary`,
|
|
54
|
+
`deadline` or `not-observed`. The engine checks its signal *between rounds*, so a long LLM call or `run_command` can
|
|
55
|
+
overrun a deadline; `not-observed` means the run finished anyway and may still be doing work.
|
|
56
|
+
- **Self-reported DAG.** `dag` is the orchestrator's own account of what happened. Side-effect truth stays with the
|
|
57
|
+
caller's own before/after diff.
|
|
58
|
+
- **Redacted.** `error.message` and `finalDeliverable` pass through `redact()` before they are returned.
|
|
59
|
+
|
|
60
|
+
Options: `workspaceRoot`, `task`, `inputs`, `concurrency`, `model`, `maxRounds`, `lessonLearned`, `quiet`, `signal`,
|
|
61
|
+
`deadlineMs`, `reindex`. `signal` is the caller's `AbortSignal`; `deadlineMs` adds an internal timer. `SdlcOrchestrator`
|
|
62
|
+
and `OrchestratorOptions` remain exported if you need the lower-level object.
|
|
63
|
+
|
|
64
|
+
## Public API
|
|
65
|
+
|
|
66
|
+
The barrel is grouped by concern. Each identifier below is a real export; import it from the package root, never from a deep path.
|
|
67
|
+
|
|
68
|
+
| Area | Exports |
|
|
69
|
+
|---|---|
|
|
70
|
+
| LLM access | `createLlmClient`, `LlmClient`, `requestScope` |
|
|
71
|
+
| Logging and output | `log`, `getOutputHandler`, `getOutputPaths`, `redactSecrets`, `sanitizeForTerminal` |
|
|
72
|
+
| Workspace index | `buildIndex`, `ensureFreshIndex`, `createXcoderPaths` |
|
|
73
|
+
| Agents and runtime | `SubAgent`, `GenesisReActOrchestrator`, `SamuraiAgent`, `WorkerOrchestrator`, `InstanceSwarmOrchestrator`, `DuplicateActionDetector`, `runDebate`, `writeReport` |
|
|
74
|
+
| Orchestration | `decideHealing`, `getOrchestratorEngine`, `buildProgressSummaryMarkdown`, `resolveLessonFlag`, `loadLessons`, `recordLesson` |
|
|
75
|
+
| In-process SDLC run | `runSdlcTask`, `scrub`, `DEFAULT_CONCURRENCY`, `DEFAULT_MAX_HEALING`, `SdlcOrchestrator` |
|
|
76
|
+
| Environment guard | `installCwdEnvKillSwitch`, `assertXcoderEnvIntact`, `captureEnvBaseline`, `diffXcoderEnv` |
|
|
77
|
+
| Defects | `scanForDefects`, `classifyDefectRouting`, `resolveDefect`, `loadDefectsIndex`, `upsertDefect` |
|
|
78
|
+
| Planning and DAG | `inlineIntoDependents`, `dagSnapshot`, `recomputeReady` |
|
|
79
|
+
| Backlog and sprints | `addBacklogItem`, `listBacklogItems`, `getBacklogItem`, `updateBacklogItem`, `runPoPick` |
|
|
80
|
+
| Benchmarking | `runBenchmark`, `compareReports` |
|
|
81
|
+
| Terminal and spinner | `setSpinnerStyle`, `getSpinnerStyle`, `createSpinner`, `AVAILABLE_SPINNER_STYLES`, `taskIntro`, `taskOutro`, `orchestratorNote`, `printCrash`, `printInterruptSummary` |
|
|
82
|
+
| Events and diagnostics | `xcoderEvents`, `emitXcoderEvent`, `enableProtocolErrorLogging`, `enableToolErrorLogging`, `maybePrintBanner` |
|
|
83
|
+
| Licensing | `requireLicense`, `isLicensedFeature`, `maybeRefreshLicense`, `createDefaultLicenseManager`, `LICENSE_REQUIRED_EXIT_CODE` |
|
|
84
|
+
| Command registrars | `registerTestCommand`, `registerSwarmCommand`, `registerTaskCommand`, `registerLicenseCommand` |
|
|
85
|
+
| Version | `XCODER_VERSION` |
|
|
86
|
+
|
|
87
|
+
Types such as `TaskRun`, `TaskSpec`, `SubtaskNode`, `SubtaskResult`, `LessonEntry`, `AgentRole`, `SdlcStage` and `SpinnerHandle` are exported alongside their values.
|
|
88
|
+
|
|
89
|
+
## Process exit
|
|
90
|
+
|
|
91
|
+
This is a library; it never calls `process.exit` and sets no exit code itself. It does export `LICENSE_REQUIRED_EXIT_CODE` (`4`), which the CLIs relay when a licensed command runs without an active license.
|
|
92
|
+
|
|
93
|
+
## Environment variables
|
|
94
|
+
|
|
95
|
+
`@neural-node-labs/xcoder-dna` reads credentials and provider settings through the host agent's config (`~/.xcoder/config.json` or environment variables such as `XCODER_MODEL`); it never prompts for a key itself. Secrets are redacted by `redactSecrets` before they reach logs.
|
|
96
|
+
|
|
97
|
+
`XCODER_IGNORE_CWD_ENV=1` stops the config loader from reading `process.cwd()/.env`. Embedded hosts should set it
|
|
98
|
+
(`runSdlcTask` sets it for you): otherwise an `.env` in the host's working directory can redirect `XCODER_BASE_URL`,
|
|
99
|
+
the provider and the key of every LLM call. `runSdlcTask` also snapshots the `XCODER_*` environment and fails closed
|
|
100
|
+
with `env_tampered` if anything rewrites it after startup.
|
|
101
|
+
|
|
102
|
+
## Dependency direction
|
|
103
|
+
|
|
104
|
+
`@neural-node-labs/xcoder-dna` has **no internal dependencies** — it is the base of the workspace graph and imports no other workspace package. Everyone else depends on it:
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
@neural-node-labs/xcoder-dna <- xcoder-litebro
|
|
108
|
+
<- xcoder-qa-agent
|
|
109
|
+
<- xcoder-sdlc-agent
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Build output
|
|
113
|
+
|
|
114
|
+
`npm run build` compiles TypeScript to `dist/` and then copies `skills/` to `dist/skills/`, so the skills catalogue ships inside the package. Only `dist/`, `README.md` and `LICENSE` are published.
|
|
115
|
+
|
|
116
|
+
## Documentation contract
|
|
117
|
+
|
|
118
|
+
This README ships to npm, so it is gated like code by `packages/xcoder-dna/src/doc-readme.test.ts`. It asserts differently from the agent packages because this is a library: there is no bin, so no CLI section and no exit-code table are allowed. Instead every identifier named in the Public API table is checked against the barrel at `src/index.ts` — the single legal import path — so the README cannot claim an export the library does not have. Run it in isolation with:
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
npx vitest run packages/xcoder-dna/src/doc-readme.test.ts
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Related packages
|
|
125
|
+
|
|
126
|
+
- [xcoder-sdlc-agent](https://github.com/Neural-Node-Labs/xcoder-origin/tree/main/packages/sdlc-agent) — the `xcoder` SDLC agent and `ba-v1`.
|
|
127
|
+
- [xcoder-qa-agent](https://github.com/Neural-Node-Labs/xcoder-origin/tree/main/packages/qa-agent) — the `bugfinder` QA agent.
|
|
128
|
+
- [xcoder-litebro](https://github.com/Neural-Node-Labs/xcoder-origin/tree/main/packages/litebro) — the tool-less planner/broker.
|
|
129
|
+
- [blueprint.md](https://github.com/Neural-Node-Labs/xcoder-origin/blob/main/docs/blueprint.md) — architecture and component decomposition.
|
|
130
|
+
|
|
131
|
+
## License
|
|
132
|
+
|
|
133
|
+
see [LICENSE](./LICENSE) for details.
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { AcceptanceCriterion, Role, SdlcStage } from "../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* The agent catalog (design K1): every Xcoder agent that can be RUN, declared
|
|
4
|
+
* with the usage metadata a supervisor needs to CHOOSE it.
|
|
5
|
+
*
|
|
6
|
+
* Before this file a caller that wanted to delegate had a hardcoded `as const`
|
|
7
|
+
* list of 14 role strings and nothing else -- no statement of when to pick one
|
|
8
|
+
* role over another and no per-role deliverable, so the supervisor either
|
|
9
|
+
* guessed or always took the default. A list of names is not a catalog; a
|
|
10
|
+
* catalog says what each agent is FOR.
|
|
11
|
+
*
|
|
12
|
+
* Home: `xcoder-dna`, because the roles are dna's (`ROLE_DIRECTIVES` is the
|
|
13
|
+
* authoritative 14-role union) and because the catalog must not become a second
|
|
14
|
+
* copy of a role list that already lives here. Policy -- confirmation, caps,
|
|
15
|
+
* kill switch -- deliberately stays in `jarvis-agent` (design T2).
|
|
16
|
+
*
|
|
17
|
+
* This module only DESCRIBES. It does not execute, does not know what tools
|
|
18
|
+
* exist, and never prompts a human.
|
|
19
|
+
*/
|
|
20
|
+
/** An agent is addressed by a stable string id. Today every id IS a Role. */
|
|
21
|
+
export type AgentId = Role;
|
|
22
|
+
/** Only role-backed agents exist today; swarm protocols are a later `kind`. */
|
|
23
|
+
export type AgentKind = "role";
|
|
24
|
+
/** Length caps. They bound the prompt fragment the catalog renders (AI-09). */
|
|
25
|
+
export declare const AGENT_USAGE_SUMMARY_MAX = 120;
|
|
26
|
+
export declare const AGENT_USAGE_DETAIL_MAX = 200;
|
|
27
|
+
/** Caps bounds. The executor re-clamps to these; nothing may widen them. */
|
|
28
|
+
export declare const AGENT_CAPS_MIN_ITERATIONS = 1;
|
|
29
|
+
export declare const AGENT_CAPS_MAX_ITERATIONS = 25;
|
|
30
|
+
export declare const AGENT_CAPS_MIN_PER_TURN = 1;
|
|
31
|
+
export declare const AGENT_CAPS_MAX_PER_TURN = 5;
|
|
32
|
+
export interface AgentUsage {
|
|
33
|
+
/** One line: what this agent is for. Rendered as the catalog line's lead. */
|
|
34
|
+
summary: string;
|
|
35
|
+
/** When to pick it. Short and concrete -- this is the text the model reads. */
|
|
36
|
+
useWhen: string;
|
|
37
|
+
/** When NOT to pick it, so the supervisor stops conflating near neighbours. */
|
|
38
|
+
whenNotToUse: string;
|
|
39
|
+
}
|
|
40
|
+
export interface AgentCaps {
|
|
41
|
+
/** Per-run ReAct iteration ceiling for this agent. */
|
|
42
|
+
maxIterations: number;
|
|
43
|
+
/** Per-turn spawn ceiling for this agent; the executor takes the minimum. */
|
|
44
|
+
maxPerTurn: number;
|
|
45
|
+
}
|
|
46
|
+
export interface AgentDeliverable {
|
|
47
|
+
/** What the agent must hand back -- passed to the Sub Agent verbatim (T7). */
|
|
48
|
+
spec: string;
|
|
49
|
+
/** How the hand-back is checked. Derived from the role's SDLC stage. */
|
|
50
|
+
acceptanceCriteria: AcceptanceCriterion[];
|
|
51
|
+
}
|
|
52
|
+
export interface AgentDescriptor {
|
|
53
|
+
id: AgentId;
|
|
54
|
+
kind: AgentKind;
|
|
55
|
+
role: Role;
|
|
56
|
+
usage: AgentUsage;
|
|
57
|
+
caps: AgentCaps;
|
|
58
|
+
deliverable: AgentDeliverable;
|
|
59
|
+
/**
|
|
60
|
+
* Fail-closed availability. An unavailable agent stays in the catalog (so its
|
|
61
|
+
* id stays documented) but is never offered to the model and is refused at
|
|
62
|
+
* call time. The field exists so a broken agent can be withdrawn by a
|
|
63
|
+
* one-line edit instead of a deletion.
|
|
64
|
+
*/
|
|
65
|
+
available: boolean;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Every role the union defines, read from the authoritative directives record
|
|
69
|
+
* rather than re-typed. `buildAgentRegistry` validates against this, so a Role
|
|
70
|
+
* added to `types.ts` fails the coverage assertion until it is given an entry
|
|
71
|
+
* instead of quietly becoming un-runnable.
|
|
72
|
+
*/
|
|
73
|
+
export declare const AGENT_ROLES: readonly Role[];
|
|
74
|
+
/** The stage an agent's deliverable contract is derived from. */
|
|
75
|
+
export declare function stageForRole(role: Role): SdlcStage;
|
|
76
|
+
/** Bounded default caps: an agent the executor can run without unbounded spend. */
|
|
77
|
+
export declare const AGENT_DEFAULT_CAPS: AgentCaps;
|
|
78
|
+
/**
|
|
79
|
+
* THE CATALOG. One entry per runnable agent, in the order a task normally
|
|
80
|
+
* walks them.
|
|
81
|
+
*
|
|
82
|
+
* Every `usage` field is mandatory on purpose: `buildAgentRegistry` rejects an
|
|
83
|
+
* empty or over-long value, because "which agent do I call" is a decision the
|
|
84
|
+
* supervisor makes from THIS text and nothing else (design T4). A vague entry is
|
|
85
|
+
* a defect, not a style choice.
|
|
86
|
+
*/
|
|
87
|
+
export declare const AGENT_CATALOG_ENTRIES: readonly AgentDescriptor[];
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
// xcoder:version 2 | xcoder:task task-8b3261 | xcoder:updated 2026-11-05T14:28:25.512Z | xcoder:subtask code-st-14bc0c
|
|
2
|
+
import { acceptanceCriteriaFor, deliverableFor } from "../orchestrator/task-factory.js";
|
|
3
|
+
import { STAGE_ROLE } from "../sdlc-runtime/sdlc-skill.js";
|
|
4
|
+
import { ROLE_DIRECTIVES } from "../skills/directives.js";
|
|
5
|
+
/** Length caps. They bound the prompt fragment the catalog renders (AI-09). */
|
|
6
|
+
export const AGENT_USAGE_SUMMARY_MAX = 120;
|
|
7
|
+
export const AGENT_USAGE_DETAIL_MAX = 200;
|
|
8
|
+
/** Caps bounds. The executor re-clamps to these; nothing may widen them. */
|
|
9
|
+
export const AGENT_CAPS_MIN_ITERATIONS = 1;
|
|
10
|
+
export const AGENT_CAPS_MAX_ITERATIONS = 25;
|
|
11
|
+
export const AGENT_CAPS_MIN_PER_TURN = 1;
|
|
12
|
+
export const AGENT_CAPS_MAX_PER_TURN = 5;
|
|
13
|
+
/**
|
|
14
|
+
* Every role the union defines, read from the authoritative directives record
|
|
15
|
+
* rather than re-typed. `buildAgentRegistry` validates against this, so a Role
|
|
16
|
+
* added to `types.ts` fails the coverage assertion until it is given an entry
|
|
17
|
+
* instead of quietly becoming un-runnable.
|
|
18
|
+
*/
|
|
19
|
+
export const AGENT_ROLES = Object.freeze(Object.keys(ROLE_DIRECTIVES));
|
|
20
|
+
/**
|
|
21
|
+
* Role -> SDLC stage, derived by inverting `STAGE_ROLE` (the orchestrator's own
|
|
22
|
+
* mapping) and overriding only the roles `STAGE_ROLE` leaves out, because those
|
|
23
|
+
* are dispatched inline rather than through a DAG node.
|
|
24
|
+
*/
|
|
25
|
+
const ROLE_STAGE_OVERRIDES = Object.freeze({
|
|
26
|
+
"business-analyst": "requirements",
|
|
27
|
+
"defect-manager": "fix_defect",
|
|
28
|
+
"scrum-master": "quality_gate",
|
|
29
|
+
"system-architect": "quality_gate",
|
|
30
|
+
"security-lead": "quality_gate",
|
|
31
|
+
});
|
|
32
|
+
function buildStageForRole() {
|
|
33
|
+
const inverted = {};
|
|
34
|
+
for (const [stage, role] of Object.entries(STAGE_ROLE)) {
|
|
35
|
+
// First writer wins: `tester` also owns fix_defect, and `requirements-analyst`
|
|
36
|
+
// is the quality_gate default the DAG builder overrides per node.
|
|
37
|
+
if (inverted[role] === undefined)
|
|
38
|
+
inverted[role] = stage;
|
|
39
|
+
}
|
|
40
|
+
const merged = { ...inverted, ...ROLE_STAGE_OVERRIDES };
|
|
41
|
+
const missing = AGENT_ROLES.filter((role) => merged[role] === undefined);
|
|
42
|
+
if (missing.length > 0) {
|
|
43
|
+
// Fail closed at import: an unmapped role would get an undefined
|
|
44
|
+
// deliverable, which is a lie in a prompt rather than an error.
|
|
45
|
+
throw new Error(`agent catalog: no SDLC stage for role(s) ${missing.join(", ")}`);
|
|
46
|
+
}
|
|
47
|
+
return merged;
|
|
48
|
+
}
|
|
49
|
+
const STAGE_FOR_ROLE = Object.freeze(buildStageForRole());
|
|
50
|
+
/** The stage an agent's deliverable contract is derived from. */
|
|
51
|
+
export function stageForRole(role) {
|
|
52
|
+
return STAGE_FOR_ROLE[role];
|
|
53
|
+
}
|
|
54
|
+
/** Bounded default caps: an agent the executor can run without unbounded spend. */
|
|
55
|
+
export const AGENT_DEFAULT_CAPS = Object.freeze({
|
|
56
|
+
maxIterations: 25,
|
|
57
|
+
maxPerTurn: 3,
|
|
58
|
+
});
|
|
59
|
+
function clampCaps(caps) {
|
|
60
|
+
const maxIterations = Math.min(AGENT_CAPS_MAX_ITERATIONS, Math.max(AGENT_CAPS_MIN_ITERATIONS, Math.trunc(caps?.maxIterations ?? AGENT_DEFAULT_CAPS.maxIterations)));
|
|
61
|
+
const maxPerTurn = Math.min(AGENT_CAPS_MAX_PER_TURN, Math.max(AGENT_CAPS_MIN_PER_TURN, Math.trunc(caps?.maxPerTurn ?? AGENT_DEFAULT_CAPS.maxPerTurn)));
|
|
62
|
+
return Object.freeze({ maxIterations, maxPerTurn });
|
|
63
|
+
}
|
|
64
|
+
function descriptor(role, usage, caps) {
|
|
65
|
+
const stage = STAGE_FOR_ROLE[role];
|
|
66
|
+
return Object.freeze({
|
|
67
|
+
id: role,
|
|
68
|
+
kind: "role",
|
|
69
|
+
role,
|
|
70
|
+
usage: Object.freeze({ ...usage }),
|
|
71
|
+
caps: clampCaps(caps),
|
|
72
|
+
deliverable: Object.freeze({
|
|
73
|
+
spec: deliverableFor(stage),
|
|
74
|
+
acceptanceCriteria: Object.freeze(acceptanceCriteriaFor(stage)),
|
|
75
|
+
}),
|
|
76
|
+
available: true,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* THE CATALOG. One entry per runnable agent, in the order a task normally
|
|
81
|
+
* walks them.
|
|
82
|
+
*
|
|
83
|
+
* Every `usage` field is mandatory on purpose: `buildAgentRegistry` rejects an
|
|
84
|
+
* empty or over-long value, because "which agent do I call" is a decision the
|
|
85
|
+
* supervisor makes from THIS text and nothing else (design T4). A vague entry is
|
|
86
|
+
* a defect, not a style choice.
|
|
87
|
+
*/
|
|
88
|
+
export const AGENT_CATALOG_ENTRIES = Object.freeze([
|
|
89
|
+
descriptor("requirements-analyst", {
|
|
90
|
+
summary: "Turns a vague ask into a concrete, testable requirements document.",
|
|
91
|
+
useWhen: "The goal is still ambiguous, or you need explicit non-goals and checkable acceptance criteria before designing.",
|
|
92
|
+
whenNotToUse: "The requirements already exist upstream — go straight to architect or programmer.",
|
|
93
|
+
}),
|
|
94
|
+
descriptor("business-analyst", {
|
|
95
|
+
summary: "Frames the business problem, stakeholders and success measures behind a goal.",
|
|
96
|
+
useWhen: "You need the why and for-whom, or the goal must be justified in business terms.",
|
|
97
|
+
whenNotToUse: "You need machine-checkable acceptance criteria — that is requirements-analyst.",
|
|
98
|
+
}),
|
|
99
|
+
descriptor("architect", {
|
|
100
|
+
summary: "Turns requirements into components, interfaces and stated tradeoffs.",
|
|
101
|
+
useWhen: "A design and data/API contract must exist before any code is written.",
|
|
102
|
+
whenNotToUse: "The design is already handed down; use programmer.",
|
|
103
|
+
}),
|
|
104
|
+
descriptor("system-architect", {
|
|
105
|
+
summary: "Reviews a design for system-level risk: boundaries, scaling, failure modes.",
|
|
106
|
+
useWhen: "A design crosses services or has non-obvious operational consequences.",
|
|
107
|
+
whenNotToUse: "The change is local to one module — use security-lead or scrum-master instead.",
|
|
108
|
+
}),
|
|
109
|
+
descriptor("security-lead", {
|
|
110
|
+
summary: "Reviews a deliverable against the security bylaws and reports violations.",
|
|
111
|
+
useWhen: "The change touches auth, secrets, untrusted input, tool execution or data egress.",
|
|
112
|
+
whenNotToUse: "The change is a pure refactor with no data or boundary implications.",
|
|
113
|
+
}),
|
|
114
|
+
descriptor("programmer", {
|
|
115
|
+
summary: "Implements a handed-down design and reports every file it wrote.",
|
|
116
|
+
useWhen: "You have a design or a precise work order and need working code that builds.",
|
|
117
|
+
whenNotToUse: "There is existing broken code to correct — use refactorer instead.",
|
|
118
|
+
}),
|
|
119
|
+
descriptor("refactorer", {
|
|
120
|
+
summary: "Corrects a specific defect in existing code with the smallest change.",
|
|
121
|
+
useWhen: "You have a reproducible defect and the affected files, and the fix is local.",
|
|
122
|
+
whenNotToUse: "The defect needs a design change, or no defect has been reproduced yet.",
|
|
123
|
+
}),
|
|
124
|
+
descriptor("defect-manager", {
|
|
125
|
+
summary: "Tracks a defect lifecycle: reproduce, assign, verify, close.",
|
|
126
|
+
useWhen: "You need the defect recorded and its fix→retest loop driven to closure.",
|
|
127
|
+
whenNotToUse: "You only need the fix applied — use refactorer, then tester.",
|
|
128
|
+
}),
|
|
129
|
+
descriptor("tester", {
|
|
130
|
+
summary: "Writes and runs unit tests, then reports pass/fail counts.",
|
|
131
|
+
useWhen: "Implementation exists and needs independent evidence that it behaves as intended.",
|
|
132
|
+
whenNotToUse: "The question is about a running URL or UI — use ui-api-tester.",
|
|
133
|
+
}),
|
|
134
|
+
descriptor("ui-api-tester", {
|
|
135
|
+
summary: "Drives a live URL or API end-to-end and reports which steps passed.",
|
|
136
|
+
useWhen: "You must validate deployed or running behaviour rather than unit-level logic.",
|
|
137
|
+
whenNotToUse: "Nothing is deployed yet; unit-level evidence is what you need.",
|
|
138
|
+
}),
|
|
139
|
+
descriptor("technical-writer", {
|
|
140
|
+
summary: "Documents what was built and why for humans who were not in the loop.",
|
|
141
|
+
useWhen: "The work is done and needs README/docs that reference concrete specifics.",
|
|
142
|
+
whenNotToUse: "You need a design or a requirements doc — those are architect/requirements-analyst.",
|
|
143
|
+
}),
|
|
144
|
+
descriptor("devops", {
|
|
145
|
+
summary: "Ships a change: build, deploy and verify with a health check.",
|
|
146
|
+
useWhen: "The deliverable is ready and the goal is to put it somewhere runnable.",
|
|
147
|
+
whenNotToUse: "Nothing is built yet, or the environment is out of scope for this task.",
|
|
148
|
+
}),
|
|
149
|
+
descriptor("scrum-master", {
|
|
150
|
+
summary: "Runs a quality gate over the work: pass/fail with a stated reason.",
|
|
151
|
+
useWhen: "You need an independent verdict on whether the increments meet their criteria.",
|
|
152
|
+
whenNotToUse: "You need a technical design review — use system-architect or security-lead.",
|
|
153
|
+
}),
|
|
154
|
+
descriptor("conversation", {
|
|
155
|
+
summary: "Answers a question directly, with no plan and no deliverable contract.",
|
|
156
|
+
useWhen: "The user asks something, or the correct response is an explanation rather than work.",
|
|
157
|
+
whenNotToUse: "Real SDLC work is being requested — pick the role that does that work.",
|
|
158
|
+
}),
|
|
159
|
+
]);
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { AGENT_CATALOG_ENTRIES, type AgentDescriptor, type AgentId, type AgentUsage } from "./agent-catalog.js";
|
|
2
|
+
import type { Role } from "../types.js";
|
|
3
|
+
/**
|
|
4
|
+
* The agent registry (design K2): a validated, frozen id lookup over the
|
|
5
|
+
* catalog, plus the renderer that turns it into a prompt fragment (K3).
|
|
6
|
+
*
|
|
7
|
+
* Construction FAILS CLOSED. A duplicate id, an id that is not a Role, a role
|
|
8
|
+
* outside the union, an empty or over-long usage string, out-of-bounds caps, an
|
|
9
|
+
* empty deliverable or a duplicate role throws `AgentCatalogError` at import
|
|
10
|
+
* time -- before any model turn can be offered a broken catalog (design T5).
|
|
11
|
+
*
|
|
12
|
+
* The alternative -- filter bad entries out and carry on -- was rejected: a
|
|
13
|
+
* silently missing agent is indistinguishable from "that agent does not exist",
|
|
14
|
+
* so a supervisor would route around a typo forever. One loud failure in CI is
|
|
15
|
+
* cheaper than a permanently degraded catalogue.
|
|
16
|
+
*/
|
|
17
|
+
export type AgentCatalogErrorCode = "empty-catalog" | "duplicate-id" | "invalid-id" | "role-not-in-union" | "duplicate-role" | "kind-mismatch" | "empty-usage" | "usage-too-long" | "bad-caps" | "empty-deliverable";
|
|
18
|
+
export declare class AgentCatalogError extends Error {
|
|
19
|
+
readonly code: AgentCatalogErrorCode;
|
|
20
|
+
readonly agentId: string;
|
|
21
|
+
constructor(code: AgentCatalogErrorCode, agentId: string, message: string);
|
|
22
|
+
}
|
|
23
|
+
export interface AgentRegistry {
|
|
24
|
+
/** The descriptor for an id, or undefined when the id is not registered. */
|
|
25
|
+
get(id: string): AgentDescriptor | undefined;
|
|
26
|
+
has(id: string): boolean;
|
|
27
|
+
/** Ids that are registered AND available -- the only ones a caller may run. */
|
|
28
|
+
availableIds(): readonly AgentId[];
|
|
29
|
+
/** Ids that are registered but withdrawn, for diagnostics and docs. */
|
|
30
|
+
unavailableIds(): readonly AgentId[];
|
|
31
|
+
all(): readonly AgentDescriptor[];
|
|
32
|
+
size: number;
|
|
33
|
+
}
|
|
34
|
+
/** Build a registry from explicit entries. Throws on any validation failure. */
|
|
35
|
+
export declare function buildAgentRegistry(entries?: readonly AgentDescriptor[], roles?: readonly Role[]): AgentRegistry;
|
|
36
|
+
/**
|
|
37
|
+
* Coverage assertion: every role in the union has exactly one agent, and every
|
|
38
|
+
* agent is for a role in the union. Called from CI so adding a Role without a
|
|
39
|
+
* catalog entry fails the build rather than becoming quietly un-runnable.
|
|
40
|
+
*/
|
|
41
|
+
export declare function assertCatalogCoverage(registry: AgentRegistry, roles?: readonly Role[]): void;
|
|
42
|
+
/** The production registry: the catalog, validated once at import. */
|
|
43
|
+
export declare const AGENT_REGISTRY: AgentRegistry;
|
|
44
|
+
/** Untrusted-data delimiter for the rendered catalog (PRM-02). */
|
|
45
|
+
export declare const UNTRUSTED_AGENT_CATALOG_TAG = "untrusted-agent-catalog";
|
|
46
|
+
export interface RenderAgentCatalogOptions {
|
|
47
|
+
/** Maximum entries to render. Truncation is announced, never silent. */
|
|
48
|
+
maxEntries?: number;
|
|
49
|
+
/**
|
|
50
|
+
* Hard byte ceiling for the whole rendered fragment, delimiters included
|
|
51
|
+
* (AI-09). Values below `AGENT_CATALOG_MIN_BYTES` -- the size of the
|
|
52
|
+
* unavoidable preamble plus open/close tags -- cannot hold a well-formed
|
|
53
|
+
* block, so the renderer returns "" (no catalog section) instead of an
|
|
54
|
+
* over-budget or unterminated fragment.
|
|
55
|
+
*/
|
|
56
|
+
maxBytes?: number;
|
|
57
|
+
}
|
|
58
|
+
export declare const AGENT_CATALOG_DEFAULT_MAX_ENTRIES = 20;
|
|
59
|
+
export declare const AGENT_CATALOG_DEFAULT_MAX_BYTES = 4000;
|
|
60
|
+
/**
|
|
61
|
+
* Smallest `maxBytes` that can hold a well-formed, delimited block at all: the
|
|
62
|
+
* preamble plus both tags. A ceiling below this yields NO catalog section
|
|
63
|
+
* rather than an over-budget or unterminated one (AI-09, PRM-02).
|
|
64
|
+
*/
|
|
65
|
+
export declare const AGENT_CATALOG_MIN_BYTES: number;
|
|
66
|
+
/**
|
|
67
|
+
* K3: render the catalog as reference DATA inside an explicit untrusted block.
|
|
68
|
+
*
|
|
69
|
+
* Only AVAILABLE agents appear -- offering an id the executor will refuse is a
|
|
70
|
+
* trap. The text is data, not instruction, so it is wrapped in the project's
|
|
71
|
+
* established `<untrusted-...>` convention (PRM-02) and bounded by BOTH an
|
|
72
|
+
* entry count and a byte ceiling (AI-09). It never chooses an agent.
|
|
73
|
+
*/
|
|
74
|
+
export declare function renderAgentCatalog(registry?: AgentRegistry, opts?: RenderAgentCatalogOptions): string;
|
|
75
|
+
export type { AgentDescriptor, AgentId, AgentUsage };
|
|
76
|
+
export { AGENT_CATALOG_ENTRIES };
|