xcoder-dna 0.0.0-stage → 1.3.1
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 +87 -2
- 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/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/loadConfig.d.ts +82 -0
- package/dist/config/loadConfig.js +240 -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 +79 -0
- package/dist/index.js +77 -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/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 +163 -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 +190 -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/scheduleTool.d.ts +19 -0
- package/dist/tools/scheduleTool.js +181 -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 +596 -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 +26 -0
- package/dist/util/logs.js +88 -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 +103 -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 +4 -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 +38 -3
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { FooterRenderer } from "./footer-renderer.js";
|
|
2
|
+
import { type ScrollRegionGuard } from "./scroll-region-guard.js";
|
|
3
|
+
import type { SdlcStage } from "../types.js";
|
|
4
|
+
/**
|
|
5
|
+
* Specification passed to FooterManager.init() from the orchestrator.
|
|
6
|
+
*/
|
|
7
|
+
export interface FooterSpec {
|
|
8
|
+
/** Effective ANSI gate: TTY attached and NO_COLOR unset (see isInteractiveStdout). */
|
|
9
|
+
tty: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* RAW task title (the goal) shown in the footer. NOT pre-truncated — the
|
|
12
|
+
* renderer owns the 50-character field.
|
|
13
|
+
*/
|
|
14
|
+
taskTitle?: string;
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated Use `taskTitle`. Retained for compatibility: when `taskTitle`
|
|
17
|
+
* is absent this value is treated as the raw title.
|
|
18
|
+
*/
|
|
19
|
+
taskDesc?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Optional opt-out for orchestrator-adjacent runners. When true the
|
|
22
|
+
* singleton still exists (consumers may optional-chain safely) but no
|
|
23
|
+
* footer output, scroll region, spinner, or ANSI escapes are ever
|
|
24
|
+
* emitted. Defaults to false.
|
|
25
|
+
*/
|
|
26
|
+
quiet?: boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Public API facade for the terminal status footer.
|
|
30
|
+
*
|
|
31
|
+
* Manages FooterState + FooterRenderer lifecycle.
|
|
32
|
+
* Serializes concurrent updates via a microtask queue (the JS event loop
|
|
33
|
+
* naturally batches all synchronous calls into one render).
|
|
34
|
+
*
|
|
35
|
+
* Design reference: `src/util/footer-state.ts`, `src/util/footer-renderer.ts`
|
|
36
|
+
*/
|
|
37
|
+
export declare class FooterManager {
|
|
38
|
+
private static _instance;
|
|
39
|
+
private _state;
|
|
40
|
+
private _renderer;
|
|
41
|
+
private _scrollRegionGuard;
|
|
42
|
+
private _muted;
|
|
43
|
+
private _pending;
|
|
44
|
+
private _flushScheduled;
|
|
45
|
+
private constructor();
|
|
46
|
+
/**
|
|
47
|
+
* Initialize the singleton footer. Sole caller: SdlcOrchestrator._runLoop.
|
|
48
|
+
* Consumers are restricted to `FooterManager.instance()?.` optional-chained
|
|
49
|
+
* update/hide/show/shutdown/writeSafe and must never call init.
|
|
50
|
+
*
|
|
51
|
+
* Availability matrix — the footer is visible iff ALL of these hold:
|
|
52
|
+
*
|
|
53
|
+
* 1) Path gate: the task runs through SdlcOrchestrator.run()/resume() into
|
|
54
|
+
* _runLoop. Status/bench/backlog list|status|pick|done/sprint/observe/
|
|
55
|
+
* release/index/test/swarm never construct the orchestrator and never
|
|
56
|
+
* show a footer. Backlog start/continue DO route through the
|
|
57
|
+
* orchestrator and DO show one.
|
|
58
|
+
* 2) TTY gate: process.stdout.isTTY === true at init time (ANSI/cursor/
|
|
59
|
+
* scroll-region output is only safe on a real terminal; piped output
|
|
60
|
+
* stays raw).
|
|
61
|
+
* 3) NO_COLOR gate: process.env.NO_COLOR is unset. Setting NO_COLOR makes
|
|
62
|
+
* spec.tty false, so zero escape sequences are emitted and redirected
|
|
63
|
+
* output stays clean.
|
|
64
|
+
* 4) Lifecycle gate: the footer is outside the interrupt-hide window and
|
|
65
|
+
* has not yet been shut down by the execution loop.
|
|
66
|
+
*
|
|
67
|
+
* The quiet flag is a deliberate opt-out for orchestrator-adjacent runners:
|
|
68
|
+
* the singleton exists (so optional-chained consumers are safe) but no
|
|
69
|
+
* footer is ever painted and no timer is started.
|
|
70
|
+
*/
|
|
71
|
+
static init(spec: FooterSpec): FooterManager;
|
|
72
|
+
/** Get the current singleton instance (may be null if not initialized). */
|
|
73
|
+
static instance(): FooterManager | null;
|
|
74
|
+
/** Whether the footer is active (TTY attached). */
|
|
75
|
+
static isActive(): boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Write text safely above the footer. If the footer is active (TTY),
|
|
78
|
+
* routes through the ScrollRegionGuard to preserve the reserved bottom row.
|
|
79
|
+
* If inactive, writes directly to process.stdout.
|
|
80
|
+
*/
|
|
81
|
+
static writeSafe(text: string): void;
|
|
82
|
+
/** Get the ScrollRegionGuard instance (for OutputInterceptor). */
|
|
83
|
+
getScrollRegionGuard(): ScrollRegionGuard | null;
|
|
84
|
+
/** Get the FooterRenderer instance (for direct access to writeAbove / forceRender). */
|
|
85
|
+
getFooterRenderer(): FooterRenderer;
|
|
86
|
+
/** Agent started thinking — show spinner and agent ID. */
|
|
87
|
+
updateThinkingStart(agentId: string): void;
|
|
88
|
+
/** Agent stopped thinking. */
|
|
89
|
+
updateThinkingStop(): void;
|
|
90
|
+
/** Agent performed an action. */
|
|
91
|
+
updateAction(tool: string): void;
|
|
92
|
+
/** Agent received an observation. */
|
|
93
|
+
updateObservation(ok: boolean, text: string): void;
|
|
94
|
+
/** Update token count display. */
|
|
95
|
+
updateTokens(inputTokens: number, outputTokens: number): void;
|
|
96
|
+
/** Update current SDLC stage. */
|
|
97
|
+
updateStage(stage: SdlcStage): void;
|
|
98
|
+
/** Update document info. */
|
|
99
|
+
updateDocument(docs: string): void;
|
|
100
|
+
/**
|
|
101
|
+
* Temporarily hide the footer (e.g. for interrupt prompts).
|
|
102
|
+
* Call show() to restore.
|
|
103
|
+
*/
|
|
104
|
+
hide(): void;
|
|
105
|
+
/**
|
|
106
|
+
* Restore the footer after being hidden.
|
|
107
|
+
*/
|
|
108
|
+
show(): void;
|
|
109
|
+
/**
|
|
110
|
+
* Shutdown the footer — teardown scroll region, clear line, null singleton.
|
|
111
|
+
* Called when the task run finishes or is interrupted.
|
|
112
|
+
*/
|
|
113
|
+
shutdown(): void;
|
|
114
|
+
/**
|
|
115
|
+
* Handle terminal resize by reconfiguring the renderer.
|
|
116
|
+
*/
|
|
117
|
+
onResize(): void;
|
|
118
|
+
/**
|
|
119
|
+
* Accumulate partial state changes and flush on the next microtask.
|
|
120
|
+
* This coalesces multiple synchronous calls into a single render.
|
|
121
|
+
*/
|
|
122
|
+
private _apply;
|
|
123
|
+
private _flush;
|
|
124
|
+
}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
// xcoder:version 4 | xcoder:task task-3e056b | xcoder:updated 2026-11-03T17:57:40.885Z | xcoder:subtask code-st-f19254
|
|
2
|
+
import { FooterRenderer } from "./footer-renderer.js";
|
|
3
|
+
import { createFooterState } from "./footer-state.js";
|
|
4
|
+
import { createScrollRegionGuard } from "./scroll-region-guard.js";
|
|
5
|
+
import { XCODER_VERSION } from "../version.js";
|
|
6
|
+
/**
|
|
7
|
+
* Public API facade for the terminal status footer.
|
|
8
|
+
*
|
|
9
|
+
* Manages FooterState + FooterRenderer lifecycle.
|
|
10
|
+
* Serializes concurrent updates via a microtask queue (the JS event loop
|
|
11
|
+
* naturally batches all synchronous calls into one render).
|
|
12
|
+
*
|
|
13
|
+
* Design reference: `src/util/footer-state.ts`, `src/util/footer-renderer.ts`
|
|
14
|
+
*/
|
|
15
|
+
export class FooterManager {
|
|
16
|
+
static _instance = null;
|
|
17
|
+
_state;
|
|
18
|
+
_renderer;
|
|
19
|
+
_scrollRegionGuard = null;
|
|
20
|
+
_muted = false;
|
|
21
|
+
_pending = {};
|
|
22
|
+
_flushScheduled = false;
|
|
23
|
+
constructor(state) {
|
|
24
|
+
this._state = state;
|
|
25
|
+
this._renderer = new FooterRenderer();
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Initialize the singleton footer. Sole caller: SdlcOrchestrator._runLoop.
|
|
29
|
+
* Consumers are restricted to `FooterManager.instance()?.` optional-chained
|
|
30
|
+
* update/hide/show/shutdown/writeSafe and must never call init.
|
|
31
|
+
*
|
|
32
|
+
* Availability matrix — the footer is visible iff ALL of these hold:
|
|
33
|
+
*
|
|
34
|
+
* 1) Path gate: the task runs through SdlcOrchestrator.run()/resume() into
|
|
35
|
+
* _runLoop. Status/bench/backlog list|status|pick|done/sprint/observe/
|
|
36
|
+
* release/index/test/swarm never construct the orchestrator and never
|
|
37
|
+
* show a footer. Backlog start/continue DO route through the
|
|
38
|
+
* orchestrator and DO show one.
|
|
39
|
+
* 2) TTY gate: process.stdout.isTTY === true at init time (ANSI/cursor/
|
|
40
|
+
* scroll-region output is only safe on a real terminal; piped output
|
|
41
|
+
* stays raw).
|
|
42
|
+
* 3) NO_COLOR gate: process.env.NO_COLOR is unset. Setting NO_COLOR makes
|
|
43
|
+
* spec.tty false, so zero escape sequences are emitted and redirected
|
|
44
|
+
* output stays clean.
|
|
45
|
+
* 4) Lifecycle gate: the footer is outside the interrupt-hide window and
|
|
46
|
+
* has not yet been shut down by the execution loop.
|
|
47
|
+
*
|
|
48
|
+
* The quiet flag is a deliberate opt-out for orchestrator-adjacent runners:
|
|
49
|
+
* the singleton exists (so optional-chained consumers are safe) but no
|
|
50
|
+
* footer is ever painted and no timer is started.
|
|
51
|
+
*/
|
|
52
|
+
static init(spec) {
|
|
53
|
+
if (FooterManager._instance) {
|
|
54
|
+
FooterManager._instance.shutdown();
|
|
55
|
+
}
|
|
56
|
+
const state = createFooterState({
|
|
57
|
+
tty: spec.tty,
|
|
58
|
+
// Raw title — the renderer applies the 50-char field. `taskDesc` is the
|
|
59
|
+
// deprecated alias, accepted so older callers keep working.
|
|
60
|
+
taskDesc: spec.taskTitle ?? spec.taskDesc ?? null,
|
|
61
|
+
version: XCODER_VERSION,
|
|
62
|
+
});
|
|
63
|
+
const mgr = new FooterManager(state);
|
|
64
|
+
mgr._muted = spec.quiet === true;
|
|
65
|
+
FooterManager._instance = mgr;
|
|
66
|
+
if (state.tty && !mgr._muted) {
|
|
67
|
+
mgr._renderer.setup(state);
|
|
68
|
+
// Create the ScrollRegionGuard after setup so it knows the active state.
|
|
69
|
+
mgr._scrollRegionGuard = createScrollRegionGuard(mgr._renderer, () => mgr._state);
|
|
70
|
+
}
|
|
71
|
+
return mgr;
|
|
72
|
+
}
|
|
73
|
+
/** Get the current singleton instance (may be null if not initialized). */
|
|
74
|
+
static instance() {
|
|
75
|
+
return FooterManager._instance;
|
|
76
|
+
}
|
|
77
|
+
/** Whether the footer is active (TTY attached). */
|
|
78
|
+
static isActive() {
|
|
79
|
+
return FooterManager._instance != null && FooterManager._instance._state.tty;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Write text safely above the footer. If the footer is active (TTY),
|
|
83
|
+
* routes through the ScrollRegionGuard to preserve the reserved bottom row.
|
|
84
|
+
* If inactive, writes directly to process.stdout.
|
|
85
|
+
*/
|
|
86
|
+
static writeSafe(text) {
|
|
87
|
+
const mgr = FooterManager._instance;
|
|
88
|
+
if (mgr && mgr._scrollRegionGuard && mgr._state.tty) {
|
|
89
|
+
mgr._scrollRegionGuard.write(text);
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
process.stdout.write(text);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
/** Get the ScrollRegionGuard instance (for OutputInterceptor). */
|
|
96
|
+
getScrollRegionGuard() {
|
|
97
|
+
return this._scrollRegionGuard;
|
|
98
|
+
}
|
|
99
|
+
/** Get the FooterRenderer instance (for direct access to writeAbove / forceRender). */
|
|
100
|
+
getFooterRenderer() {
|
|
101
|
+
return this._renderer;
|
|
102
|
+
}
|
|
103
|
+
// ── update helpers ──
|
|
104
|
+
/** Agent started thinking — show spinner and agent ID. */
|
|
105
|
+
updateThinkingStart(agentId) {
|
|
106
|
+
this._apply({ agentId, spinner: true });
|
|
107
|
+
if (!this._muted) {
|
|
108
|
+
this._renderer.startSpinner();
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
/** Agent stopped thinking. */
|
|
112
|
+
updateThinkingStop() {
|
|
113
|
+
this._renderer.stopSpinner();
|
|
114
|
+
this._apply({ spinner: false });
|
|
115
|
+
}
|
|
116
|
+
/** Agent performed an action. */
|
|
117
|
+
updateAction(tool) {
|
|
118
|
+
this._apply({ action: tool });
|
|
119
|
+
}
|
|
120
|
+
/** Agent received an observation. */
|
|
121
|
+
updateObservation(ok, text) {
|
|
122
|
+
// Show observing state briefly.
|
|
123
|
+
const preview = text.length > 40 ? text.slice(0, 37) + "..." : text;
|
|
124
|
+
this._apply({ observing: true, action: ok ? preview : `✗ ${preview}` });
|
|
125
|
+
// Clear observing after a tick.
|
|
126
|
+
setTimeout(() => {
|
|
127
|
+
if (this._state.observing) {
|
|
128
|
+
this._apply({ observing: false });
|
|
129
|
+
}
|
|
130
|
+
}, 0);
|
|
131
|
+
}
|
|
132
|
+
/** Update token count display. */
|
|
133
|
+
updateTokens(inputTokens, outputTokens) {
|
|
134
|
+
this._apply({ tokens: `${inputTokens} in / ${outputTokens} out` });
|
|
135
|
+
}
|
|
136
|
+
/** Update current SDLC stage. */
|
|
137
|
+
updateStage(stage) {
|
|
138
|
+
this._apply({ stage });
|
|
139
|
+
}
|
|
140
|
+
/** Update document info. */
|
|
141
|
+
updateDocument(docs) {
|
|
142
|
+
this._apply({ docs });
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Temporarily hide the footer (e.g. for interrupt prompts).
|
|
146
|
+
* Call show() to restore.
|
|
147
|
+
*/
|
|
148
|
+
hide() {
|
|
149
|
+
this._renderer.hide();
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Restore the footer after being hidden.
|
|
153
|
+
*/
|
|
154
|
+
show() {
|
|
155
|
+
this._renderer.show(this._state);
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Shutdown the footer — teardown scroll region, clear line, null singleton.
|
|
159
|
+
* Called when the task run finishes or is interrupted.
|
|
160
|
+
*/
|
|
161
|
+
shutdown() {
|
|
162
|
+
this._renderer.teardown();
|
|
163
|
+
if (FooterManager._instance === this) {
|
|
164
|
+
FooterManager._instance = null;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Handle terminal resize by reconfiguring the renderer.
|
|
169
|
+
*/
|
|
170
|
+
onResize() {
|
|
171
|
+
this._renderer.reconfigure(this._state);
|
|
172
|
+
}
|
|
173
|
+
// ── private ──
|
|
174
|
+
/**
|
|
175
|
+
* Accumulate partial state changes and flush on the next microtask.
|
|
176
|
+
* This coalesces multiple synchronous calls into a single render.
|
|
177
|
+
*/
|
|
178
|
+
_apply(patch) {
|
|
179
|
+
Object.assign(this._pending, patch);
|
|
180
|
+
if (!this._flushScheduled) {
|
|
181
|
+
this._flushScheduled = true;
|
|
182
|
+
Promise.resolve().then(() => {
|
|
183
|
+
this._flush();
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
_flush() {
|
|
188
|
+
this._flushScheduled = false;
|
|
189
|
+
Object.assign(this._state, this._pending);
|
|
190
|
+
this._pending = {};
|
|
191
|
+
if (this._state.tty) {
|
|
192
|
+
this._renderer.render(this._state);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { FooterState } from "./footer-state.js";
|
|
2
|
+
/**
|
|
3
|
+
* Converts a FooterState into a single ANSI escape sequence string
|
|
4
|
+
* that paints a 1-row footer at the bottom of the terminal.
|
|
5
|
+
*
|
|
6
|
+
* Design:
|
|
7
|
+
* - 1-row footer using scroll region to reserve the bottom line.
|
|
8
|
+
* - Truncation priority: stage+spinner > action > tokens > agentId > taskDesc > docs.
|
|
9
|
+
* - Respects NO_COLOR and TTY detection.
|
|
10
|
+
* - Handles window resize by re-reading process.stdout.columns.
|
|
11
|
+
*/
|
|
12
|
+
export declare class FooterRenderer {
|
|
13
|
+
private _active;
|
|
14
|
+
private _hidden;
|
|
15
|
+
private _spinnerIdx;
|
|
16
|
+
private _spinnerInterval;
|
|
17
|
+
private _currentState;
|
|
18
|
+
private _noColor;
|
|
19
|
+
/**
|
|
20
|
+
* Perform one-time setup: enable scroll region, hide cursor.
|
|
21
|
+
* Must be called before render(). Safe to call when already active (no-op).
|
|
22
|
+
*/
|
|
23
|
+
setup(state: FooterState): void;
|
|
24
|
+
/**
|
|
25
|
+
* Render the current state to the reserved bottom row.
|
|
26
|
+
* Handles layout, truncation, and spinner animation.
|
|
27
|
+
*/
|
|
28
|
+
render(state: FooterState): void;
|
|
29
|
+
/** Re-read terminal size and re-apply scroll region after a resize. */
|
|
30
|
+
reconfigure(state: FooterState, partial?: Partial<FooterState>): void;
|
|
31
|
+
/** Temporarily hide the footer (e.g. during interrupt prompts). */
|
|
32
|
+
hide(): void;
|
|
33
|
+
/** Restore the footer after being hidden. */
|
|
34
|
+
show(state: FooterState): void;
|
|
35
|
+
/**
|
|
36
|
+
* Return the current reserved scroll-region bottom row index (height - 1).
|
|
37
|
+
* Used by ScrollRegionGuard to know which row to keep free.
|
|
38
|
+
*/
|
|
39
|
+
getScrollBottom(): number;
|
|
40
|
+
/**
|
|
41
|
+
* Force-render the footer without checking _hidden/_active guards.
|
|
42
|
+
* Used by ScrollRegionGuard during re-establish after a guarded write.
|
|
43
|
+
*/
|
|
44
|
+
forceRender(state: FooterState): void;
|
|
45
|
+
/**
|
|
46
|
+
* Write text above the footer safely. Saves cursor, resets scroll region,
|
|
47
|
+
* writes the text, re-establishes scroll region, re-renders footer,
|
|
48
|
+
* and restores cursor. This is the core defensive write — it ensures
|
|
49
|
+
* no output can break the scroll region.
|
|
50
|
+
*/
|
|
51
|
+
writeAbove(text: string, state: FooterState): void;
|
|
52
|
+
/**
|
|
53
|
+
* Tear down: reset scroll region, show cursor, clear footer.
|
|
54
|
+
*/
|
|
55
|
+
teardown(): void;
|
|
56
|
+
private _render;
|
|
57
|
+
private _clearFooterRow;
|
|
58
|
+
/**
|
|
59
|
+
* Start spinner tick — called by FooterManager when initiating thinking.
|
|
60
|
+
* Managed here so the renderer owns the interval lifecycle.
|
|
61
|
+
*/
|
|
62
|
+
startSpinner(): void;
|
|
63
|
+
/**
|
|
64
|
+
* Stop spinner tick — called by FooterManager when thinking stops.
|
|
65
|
+
*/
|
|
66
|
+
stopSpinner(): void;
|
|
67
|
+
}
|