@tea-agent/loop-agent 0.1.0-fe-test.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/AGENTS.md +114 -0
- package/CHANGELOG.md +2283 -0
- package/README.md +177 -0
- package/bin/agent-worker.js +22 -0
- package/bin/loop-agent.js +57 -0
- package/dist/adapters/aimax.js +91 -0
- package/dist/adapters/context.js +32 -0
- package/dist/adapters/index.js +29 -0
- package/dist/adapters/loop-agent.js +192 -0
- package/dist/adapters/types.js +1 -0
- package/dist/application/context-usage/skill-resolution-stats.js +263 -0
- package/dist/application/dag/args.js +486 -0
- package/dist/application/dag/generate-task-dag.js +408 -0
- package/dist/application/dag/report-dag.js +14 -0
- package/dist/application/dag/run-dag.js +109 -0
- package/dist/application/dag/validate-dag.js +166 -0
- package/dist/application/evaluation/alias.js +184 -0
- package/dist/application/evaluation/budget.js +192 -0
- package/dist/application/evaluation/campaign-hash.js +47 -0
- package/dist/application/evaluation/campaign-matrix.js +372 -0
- package/dist/application/evaluation/campaign-scorecard.js +135 -0
- package/dist/application/evaluation/campaign.js +370 -0
- package/dist/application/evaluation/candidate-hash.js +75 -0
- package/dist/application/evaluation/candidate.js +69 -0
- package/dist/application/evaluation/corpus-hash.js +38 -0
- package/dist/application/evaluation/corpus.js +56 -0
- package/dist/application/evaluation/experiment.js +294 -0
- package/dist/application/evaluation/ignition.js +198 -0
- package/dist/application/evaluation/integrity-audit.js +162 -0
- package/dist/application/evaluation/outer-loop.js +132 -0
- package/dist/application/evaluation/pi-cell-executor.js +39 -0
- package/dist/application/evaluation/private-verifier.js +46 -0
- package/dist/application/evaluation/promotion-policy.js +151 -0
- package/dist/application/evaluation/proposer.js +98 -0
- package/dist/application/evaluation/replay.js +289 -0
- package/dist/application/evaluation/types.js +652 -0
- package/dist/application/loop/run-action.js +19 -0
- package/dist/application/task-lifecycle/advance.js +1204 -0
- package/dist/application/task-lifecycle/gates.js +130 -0
- package/dist/application/task-lifecycle/index.js +7 -0
- package/dist/application/task-lifecycle/observe.js +424 -0
- package/dist/application/task-lifecycle/plan-transitions.js +251 -0
- package/dist/application/task-lifecycle/recommendations.js +180 -0
- package/dist/application/task-lifecycle/record.js +73 -0
- package/dist/application/task-lifecycle/types.js +1 -0
- package/dist/build-stamp.json +6 -0
- package/dist/cli/catalog.js +24 -0
- package/dist/cli/command-definitions.js +659 -0
- package/dist/cli/help.js +56 -0
- package/dist/cli/index.js +5 -0
- package/dist/cli/program.js +647 -0
- package/dist/cli/router.js +13 -0
- package/dist/cli/update/init-surface-notifier.js +167 -0
- package/dist/cli/update/notifier.js +117 -0
- package/dist/cli/update/npm-client.js +151 -0
- package/dist/cli/update/policy.js +92 -0
- package/dist/cli/update/runtime-activity.js +29 -0
- package/dist/cli/update/state.js +68 -0
- package/dist/cli-governance/active-residue-check.js +38 -0
- package/dist/cli.js +57 -0
- package/dist/commands/client-recovery.js +1373 -0
- package/dist/commands/closeout.js +13 -0
- package/dist/commands/coverage-audit.js +14 -0
- package/dist/commands/coverage-report.js +50 -0
- package/dist/commands/cursor-prompt.js +182 -0
- package/dist/commands/dag-approve.js +142 -0
- package/dist/commands/dag-final-verification.js +76 -0
- package/dist/commands/dag-init-hybrid.js +57 -0
- package/dist/commands/dag-reconcile-run.js +5 -0
- package/dist/commands/dag-reconcile-tasks.js +51 -0
- package/dist/commands/dag-reject.js +91 -0
- package/dist/commands/dag-report.js +76 -0
- package/dist/commands/dag-request-interrupt.js +20 -0
- package/dist/commands/dag-rerun-task.js +19 -0
- package/dist/commands/dag-rerun.js +111 -0
- package/dist/commands/dag-resume.js +35 -0
- package/dist/commands/dag-run-task.js +12 -0
- package/dist/commands/dag-validate.js +20 -0
- package/dist/commands/dag-workflow-compile.js +91 -0
- package/dist/commands/dag-workflow-plan.js +130 -0
- package/dist/commands/dag-workflow-validate.js +66 -0
- package/dist/commands/delegate.js +130 -0
- package/dist/commands/docs-archive.js +5 -0
- package/dist/commands/docs-audit.js +6 -0
- package/dist/commands/doctor.js +283 -0
- package/dist/commands/eval.js +1398 -0
- package/dist/commands/examples.js +90 -0
- package/dist/commands/goal.js +92 -0
- package/dist/commands/handoff-check.js +5 -0
- package/dist/commands/harvest.js +44 -0
- package/dist/commands/import-prd.js +81 -0
- package/dist/commands/init-upgrade.js +3085 -0
- package/dist/commands/init.js +3630 -0
- package/dist/commands/inspect.js +11 -0
- package/dist/commands/instructions.js +223 -0
- package/dist/commands/knowledge.js +162 -0
- package/dist/commands/loop-benchmark.js +72 -0
- package/dist/commands/loop.js +251 -0
- package/dist/commands/new-task.js +5 -0
- package/dist/commands/operator.js +44 -0
- package/dist/commands/pi-prompt.js +174 -0
- package/dist/commands/pi-reuse-benchmark.js +153 -0
- package/dist/commands/plan-list.js +5 -0
- package/dist/commands/plan.js +50 -0
- package/dist/commands/promote-run.js +29 -0
- package/dist/commands/reference-index.js +16 -0
- package/dist/commands/run-dag-progress.js +123 -0
- package/dist/commands/run-dag.js +22 -0
- package/dist/commands/spine.js +38 -0
- package/dist/commands/stats.js +113 -0
- package/dist/commands/status.js +57 -0
- package/dist/commands/study-init.js +192 -0
- package/dist/commands/task-advance.js +366 -0
- package/dist/commands/task-contract.js +269 -0
- package/dist/commands/task-source-prepare.js +479 -0
- package/dist/commands/task-status.js +133 -0
- package/dist/commands/workflow.js +259 -0
- package/dist/commands/worktree-create.js +31 -0
- package/dist/commands/worktree-list.js +5 -0
- package/dist/commands/worktree-remove.js +26 -0
- package/dist/executors/config-core.js +5 -0
- package/dist/executors/config.js +2 -0
- package/dist/executors/dag-pi-executor.js +1277 -0
- package/dist/executors/dag-static-executor.js +42 -0
- package/dist/executors/dag.js +3 -0
- package/dist/executors/index.js +6 -0
- package/dist/executors/model-routing.js +71 -0
- package/dist/executors/pi-defaults.js +9 -0
- package/dist/executors/pi-event-serializer.js +65 -0
- package/dist/executors/pi-executor.js +981 -0
- package/dist/executors/pi-playwright-cli-tool.js +1006 -0
- package/dist/executors/pi-prompt-transport.js +198 -0
- package/dist/executors/pi-reuse-benchmark.js +316 -0
- package/dist/executors/pi-runtime-reuse.js +29 -0
- package/dist/executors/pi-sdk-executor.js +722 -0
- package/dist/executors/pi-sdk.js +1 -0
- package/dist/executors/pi-writer-tool-policy.js +266 -0
- package/dist/executors/pi.js +3 -0
- package/dist/executors/playwright-cli-launcher.js +63 -0
- package/dist/executors/process-tree.js +33 -0
- package/dist/executors/shell-executor.js +3055 -0
- package/dist/executors/shell-presets.js +99 -0
- package/dist/executors/shell-verification.js +262 -0
- package/dist/executors/shell-write-guard.js +543 -0
- package/dist/executors/shell.js +3 -0
- package/dist/executors/static.js +1 -0
- package/dist/governance/checks.js +437 -0
- package/dist/governance/document-index-closure.js +164 -0
- package/dist/governance/exec-plans.js +549 -0
- package/dist/governance/harness.js +9 -0
- package/dist/governance/index.js +3 -0
- package/dist/governance/manifest-types.js +254 -0
- package/dist/governance/manifest.js +2 -0
- package/dist/governance/path-guard.js +69 -0
- package/dist/governance/path-guards.js +2 -0
- package/dist/governance/profiles.js +3 -0
- package/dist/governance/requirement-coverage.js +425 -0
- package/dist/governance/skill-safety.js +135 -0
- package/dist/governance/spine-audit.js +155 -0
- package/dist/infrastructure/evaluation/alias-store.js +199 -0
- package/dist/infrastructure/evaluation/campaign-store.js +154 -0
- package/dist/infrastructure/evaluation/candidate-store.js +439 -0
- package/dist/infrastructure/evaluation/corpus-store.js +181 -0
- package/dist/infrastructure/evaluation/experiment-store.js +124 -0
- package/dist/infrastructure/evaluation/ignition-store.js +82 -0
- package/dist/infrastructure/evaluation/private-verifier-store.js +145 -0
- package/dist/infrastructure/evaluation/proposer-store.js +78 -0
- package/dist/infrastructure/evaluation/store.js +40 -0
- package/dist/infrastructure/harness/active-residue-policy.js +73 -0
- package/dist/infrastructure/harness/artifact-store.js +72 -0
- package/dist/infrastructure/harness/atomic-write.js +50 -0
- package/dist/infrastructure/harness/completed-facts-guard.js +40 -0
- package/dist/infrastructure/harness/loop-action-store.js +20 -0
- package/dist/infrastructure/harness/loop-store.js +41 -0
- package/dist/infrastructure/harness/one-shot-run-store.js +94 -0
- package/dist/infrastructure/harness/task-store.js +108 -0
- package/dist/records/closeout.js +2 -0
- package/dist/records/harvest.js +215 -0
- package/dist/records/index.js +3 -0
- package/dist/records/one-shot-runs.js +386 -0
- package/dist/records/promotion.js +200 -0
- package/dist/shared/artifacts-core.js +107 -0
- package/dist/shared/artifacts.js +2 -0
- package/dist/shared/context-files.js +32 -0
- package/dist/shared/context.js +2 -0
- package/dist/shared/copy-dir.js +17 -0
- package/dist/shared/git-progress.js +172 -0
- package/dist/shared/index.js +5 -0
- package/dist/shared/logger.js +17 -0
- package/dist/shared/one-shot-prompt-args.js +98 -0
- package/dist/shared/openspec-spec.js +125 -0
- package/dist/shared/operator/capabilities.js +2659 -0
- package/dist/shared/operator/command-lifecycle.js +94 -0
- package/dist/shared/operator/envelope.js +59 -0
- package/dist/shared/operator/index.js +5 -0
- package/dist/shared/operator/registry.js +38 -0
- package/dist/shared/operator/types.js +5 -0
- package/dist/shared/output-truncation.js +37 -0
- package/dist/shared/package-metadata.js +530 -0
- package/dist/shared/path-refs.js +31 -0
- package/dist/shared/pi-retry-settings.js +23 -0
- package/dist/shared/playwright-cli-command-policy.js +41 -0
- package/dist/shared/preview.js +39 -0
- package/dist/shared/prompts.js +26 -0
- package/dist/shared/reference-context.js +264 -0
- package/dist/shared/resilient-git.js +133 -0
- package/dist/shared/runtime-activity.js +6 -0
- package/dist/shared/timeout-policy.js +24 -0
- package/dist/shared/timeout.js +1 -0
- package/dist/shared/types.js +5 -0
- package/dist/sidecars/cursor-prompt/executor.js +428 -0
- package/dist/sidecars/cursor-prompt/index.js +3 -0
- package/dist/sidecars/cursor-prompt/stream.js +121 -0
- package/dist/task/config-types.js +235 -0
- package/dist/task/config.js +2 -0
- package/dist/task/contract/adopt.js +166 -0
- package/dist/task/contract/apply.js +326 -0
- package/dist/task/contract/canonicalize.js +60 -0
- package/dist/task/contract/constants.js +30 -0
- package/dist/task/contract/diff.js +177 -0
- package/dist/task/contract/hash.js +42 -0
- package/dist/task/contract/import-revision.js +96 -0
- package/dist/task/contract/index.js +17 -0
- package/dist/task/contract/journal.js +155 -0
- package/dist/task/contract/lock.js +153 -0
- package/dist/task/contract/observe.js +296 -0
- package/dist/task/contract/paths.js +19 -0
- package/dist/task/contract/project.js +185 -0
- package/dist/task/contract/recover.js +312 -0
- package/dist/task/contract/request-ledger.js +37 -0
- package/dist/task/contract/schema.js +153 -0
- package/dist/task/contract/transaction.js +160 -0
- package/dist/task/contract/types.js +1 -0
- package/dist/task/contract/validate-draft.js +106 -0
- package/dist/task/dag-source-paths.js +50 -0
- package/dist/task/delegate.js +208 -0
- package/dist/task/frontend-preflight.js +131 -0
- package/dist/task/frontend-project-capability.js +570 -0
- package/dist/task/goal-audit.js +51 -0
- package/dist/task/goal-policy.js +8 -0
- package/dist/task/goal.js +3 -0
- package/dist/task/ids.js +1 -0
- package/dist/task/index.js +12 -0
- package/dist/task/lifecycle.js +1 -0
- package/dist/task/operator/capabilities.js +6 -0
- package/dist/task/operator/envelope.js +2 -0
- package/dist/task/operator/index.js +5 -0
- package/dist/task/operator/registry.js +2 -0
- package/dist/task/operator/types.js +1 -0
- package/dist/task/paths.js +1 -0
- package/dist/task/read-model.js +140 -0
- package/dist/task/runtime.js +708 -0
- package/dist/task/source-prepare/artifact-meta.js +137 -0
- package/dist/task/source-prepare/build-draft.js +232 -0
- package/dist/task/source-prepare/completeness.js +248 -0
- package/dist/task/source-prepare/index.js +10 -0
- package/dist/task/source-prepare/parse-intent.js +496 -0
- package/dist/task/source-prepare/path-policy.js +197 -0
- package/dist/task/source-prepare/placeholder-paths.js +77 -0
- package/dist/task/source-prepare/prepare.js +920 -0
- package/dist/task/source-prepare/reference-integrity.js +290 -0
- package/dist/task/source-prepare/semantic-intake.js +717 -0
- package/dist/task/source-prepare/types.js +7 -0
- package/dist/task/source-references.js +228 -0
- package/dist/task/source-state.js +1 -0
- package/dist/task/state.js +41 -0
- package/dist/task/subagent-guidance.js +1 -0
- package/dist/task/task-demand-routing.js +443 -0
- package/dist/task/workflow-state-types.js +92 -0
- package/dist/task/worktree-cleanup.js +140 -0
- package/dist/task/worktree.js +388 -0
- package/dist/verification/maven/cache.js +142 -0
- package/dist/verification/maven/index.js +120 -0
- package/dist/verification/maven/plan-commands.js +421 -0
- package/dist/verification/maven/pom-static.js +136 -0
- package/dist/verification/maven/scope-resolve.js +153 -0
- package/dist/verification/maven/stale.js +130 -0
- package/dist/verification/maven/types.js +23 -0
- package/dist/verification/maven/workspace-graph.js +322 -0
- package/dist/worker/cli.js +957 -0
- package/dist/worker/closeout/apply.js +73 -0
- package/dist/worker/closeout/preview.js +30 -0
- package/dist/worker/console/app-data.js +316 -0
- package/dist/worker/console/chat/artifact-card.js +30 -0
- package/dist/worker/console/chat/assistant-content.js +121 -0
- package/dist/worker/console/chat/chat-event-store.js +981 -0
- package/dist/worker/console/chat/chat-ui-policy.js +25 -0
- package/dist/worker/console/chat/compaction-errors.js +64 -0
- package/dist/worker/console/chat/composer-draft-store.js +45 -0
- package/dist/worker/console/chat/context-panel.js +54 -0
- package/dist/worker/console/chat/contract-apply-receipt-store.js +174 -0
- package/dist/worker/console/chat/explore-tools.js +299 -0
- package/dist/worker/console/chat/human-gate-card.js +45 -0
- package/dist/worker/console/chat/interview-adapter.js +149 -0
- package/dist/worker/console/chat/mcp-inventory.js +221 -0
- package/dist/worker/console/chat/model-resolver.js +215 -0
- package/dist/worker/console/chat/operation-card.js +92 -0
- package/dist/worker/console/chat/pi-console-config.js +376 -0
- package/dist/worker/console/chat/pi-runtime.js +2446 -0
- package/dist/worker/console/chat/repo-browser.js +140 -0
- package/dist/worker/console/chat/repo-walk.js +125 -0
- package/dist/worker/console/chat/resource-loader.js +59 -0
- package/dist/worker/console/chat/resource-preferences-store.js +152 -0
- package/dist/worker/console/chat/routes.js +3137 -0
- package/dist/worker/console/chat/runtime-context.js +102 -0
- package/dist/worker/console/chat/runtime-selection.js +96 -0
- package/dist/worker/console/chat/semantic-activity.js +489 -0
- package/dist/worker/console/chat/session-store.js +484 -0
- package/dist/worker/console/chat/shortcuts.js +217 -0
- package/dist/worker/console/chat/tool-adapter.js +131 -0
- package/dist/worker/console/chat/tool-preview.js +247 -0
- package/dist/worker/console/chat/tools.js +212 -0
- package/dist/worker/console/chat/turn-execution-registry.js +82 -0
- package/dist/worker/console/chat/turn-process.js +346 -0
- package/dist/worker/console/chat/usage.js +165 -0
- package/dist/worker/console/chat/workspace-landing.js +103 -0
- package/dist/worker/console/dag-confirmation.js +347 -0
- package/dist/worker/console/dag-execution-receipt.js +393 -0
- package/dist/worker/console/doctor.js +230 -0
- package/dist/worker/console/draft-store.js +158 -0
- package/dist/worker/console/harness-pi-model-matrix.js +137 -0
- package/dist/worker/console/human-gate-token.js +130 -0
- package/dist/worker/console/index.js +17 -0
- package/dist/worker/console/inspect-split.js +82 -0
- package/dist/worker/console/interview/assessment.js +67 -0
- package/dist/worker/console/interview/grill-me.js +277 -0
- package/dist/worker/console/interview/session.js +100 -0
- package/dist/worker/console/interview/tools.js +109 -0
- package/dist/worker/console/loopback.js +16 -0
- package/dist/worker/console/mutation-gate-receipt-store.js +184 -0
- package/dist/worker/console/night-aux-ticker.js +146 -0
- package/dist/worker/console/observe-health-match.js +179 -0
- package/dist/worker/console/observe-link.js +42 -0
- package/dist/worker/console/open-browser.js +134 -0
- package/dist/worker/console/operation-run-facts.js +190 -0
- package/dist/worker/console/operation-runner.js +353 -0
- package/dist/worker/console/operation-sse.js +184 -0
- package/dist/worker/console/operation-store.js +169 -0
- package/dist/worker/console/operation-wait.js +355 -0
- package/dist/worker/console/operator-actions.js +3768 -0
- package/dist/worker/console/operator-selection.js +105 -0
- package/dist/worker/console/operator-surface-health.js +24 -0
- package/dist/worker/console/operator-user-error.js +45 -0
- package/dist/worker/console/pi-readiness.js +288 -0
- package/dist/worker/console/prd-identity.js +102 -0
- package/dist/worker/console/prd-intake-bridge.js +441 -0
- package/dist/worker/console/prd-reference-discovery.js +124 -0
- package/dist/worker/console/recovery-cta.js +320 -0
- package/dist/worker/console/recovery-error-copy.js +198 -0
- package/dist/worker/console/recovery-selection.js +107 -0
- package/dist/worker/console/repo-fingerprint.js +35 -0
- package/dist/worker/console/resolve-dag-run-for-task.js +115 -0
- package/dist/worker/console/resource-loader.js +95 -0
- package/dist/worker/console/routes.js +475 -0
- package/dist/worker/console/security.js +170 -0
- package/dist/worker/console/server.js +357 -0
- package/dist/worker/console/sibling-controller.js +33 -0
- package/dist/worker/console/static/assets/abnfDiagram-N423BO3Z-BmOEx0gA.js +1 -0
- package/dist/worker/console/static/assets/arc-BGiVVe8b.js +1 -0
- package/dist/worker/console/static/assets/architectureDiagram-T3A2C74G-nDdu4rgJ.js +36 -0
- package/dist/worker/console/static/assets/blockDiagram-VBNYF7ZC-Bb5u0BWf.js +132 -0
- package/dist/worker/console/static/assets/c4Diagram-5PPSVZJV-BlhC0j94.js +10 -0
- package/dist/worker/console/static/assets/channel-Tl-FkUqr.js +1 -0
- package/dist/worker/console/static/assets/chunk-2GRJ4B5K-Ai8_qQXI.js +1 -0
- package/dist/worker/console/static/assets/chunk-2Q5K7J3B-B9gyCjqX.js +1 -0
- package/dist/worker/console/static/assets/chunk-5RXB4S5H-Bzbj3zGH.js +231 -0
- package/dist/worker/console/static/assets/chunk-5VM5RSS4-BT415PvT.js +15 -0
- package/dist/worker/console/static/assets/chunk-6Q2QTUOP-D_A5_5QL.js +88 -0
- package/dist/worker/console/static/assets/chunk-GF5L2VYU-srJkaP3f.js +206 -0
- package/dist/worker/console/static/assets/chunk-JWPE2WC7-UYGvEP4l.js +1 -0
- package/dist/worker/console/static/assets/chunk-KBJHAD2P-B8luBrrz.js +1 -0
- package/dist/worker/console/static/assets/chunk-RYQCIY6F-DN7wXZSq.js +1 -0
- package/dist/worker/console/static/assets/chunk-XXDRQBXY-DXKyMuKS.js +1 -0
- package/dist/worker/console/static/assets/classDiagram-JCYQIIEL-BaehtRk4.js +1 -0
- package/dist/worker/console/static/assets/classDiagram-v2-OCEON4UE-BaehtRk4.js +1 -0
- package/dist/worker/console/static/assets/cose-bilkent-JH36ORCC-dqvoynXj.js +1 -0
- package/dist/worker/console/static/assets/cynefin-VYW2F7L2--PcyL34A.js +166 -0
- package/dist/worker/console/static/assets/cynefinDiagram-MW4NZA55-DvWs_hTY.js +62 -0
- package/dist/worker/console/static/assets/cytoscape.esm-yzknjiTM.js +321 -0
- package/dist/worker/console/static/assets/dagre-VZM6K2ZE-DxeIxbyO.js +4 -0
- package/dist/worker/console/static/assets/defaultLocale-DX6XiGOO.js +1 -0
- package/dist/worker/console/static/assets/diagram-7IWD3JNH-DPCG61Of.js +30 -0
- package/dist/worker/console/static/assets/diagram-B4RE2ZJO-CmuU50-U.js +3 -0
- package/dist/worker/console/static/assets/diagram-LBJQPF4R-B61XLD_v.js +24 -0
- package/dist/worker/console/static/assets/diagram-Q27KOJAE-BB7HTRRY.js +24 -0
- package/dist/worker/console/static/assets/diagram-UB23O5K3-DvkboAIp.js +41 -0
- package/dist/worker/console/static/assets/ebnfDiagram-BXEA7PRR-BdJ_y1fL.js +1 -0
- package/dist/worker/console/static/assets/erDiagram-JOGREHBK-9bUBZTRi.js +85 -0
- package/dist/worker/console/static/assets/flowDiagram-UKHOOZJN-Dw4L4RBa.js +156 -0
- package/dist/worker/console/static/assets/ganttDiagram-PKOTCBZU-Jr82N_QP.js +292 -0
- package/dist/worker/console/static/assets/gitGraphDiagram-DS77QQ5N-DAz9wFLr.js +106 -0
- package/dist/worker/console/static/assets/graph-DOmOIIwC.js +1 -0
- package/dist/worker/console/static/assets/index-B7Y-0g3J.css +1 -0
- package/dist/worker/console/static/assets/index-DkCrqaYg.js +325 -0
- package/dist/worker/console/static/assets/infoDiagram-6WML65LV-CBB5Np7y.js +2 -0
- package/dist/worker/console/static/assets/init-Gi6I4Gst.js +1 -0
- package/dist/worker/console/static/assets/ishikawaDiagram-WSZJBQD7-D8IOp94y.js +70 -0
- package/dist/worker/console/static/assets/journeyDiagram-NVQOT4AX-Dgd3AHGG.js +139 -0
- package/dist/worker/console/static/assets/kanban-definition-27J2QSJJ-BmYOxLE9.js +89 -0
- package/dist/worker/console/static/assets/layout-D-LzfAck.js +1 -0
- package/dist/worker/console/static/assets/linear-DfYTEF6J.js +1 -0
- package/dist/worker/console/static/assets/map-DxJ2ADlA.js +1 -0
- package/dist/worker/console/static/assets/mermaid.core-BjuFPRqa.js +308 -0
- package/dist/worker/console/static/assets/mindmap-definition-FAOFIHXS-CLyUViGd.js +96 -0
- package/dist/worker/console/static/assets/ordinal-Cboi1Yqb.js +1 -0
- package/dist/worker/console/static/assets/pegDiagram-VL7TDLO6-BvX2Di4-.js +1 -0
- package/dist/worker/console/static/assets/pieDiagram-7S7Q4E2Y-BFj0_OLv.js +39 -0
- package/dist/worker/console/static/assets/quadrantDiagram-CIZ2JOQS-BIUrD_hx.js +7 -0
- package/dist/worker/console/static/assets/railroadDiagram-AXF67PYL-CHBB48fj.js +1 -0
- package/dist/worker/console/static/assets/requirementDiagram-LRYGKXZP-sJrYw2Sf.js +84 -0
- package/dist/worker/console/static/assets/sankeyDiagram-W5VNT64P-BzHH6fPR.js +40 -0
- package/dist/worker/console/static/assets/sequenceDiagram-SI44F4Z6-7QCnelCt.js +162 -0
- package/dist/worker/console/static/assets/sizeCapture-X5ZJPWSS-sDYSxn72.js +1 -0
- package/dist/worker/console/static/assets/stateDiagram-OKZ733FA-XpiUdwzm.js +1 -0
- package/dist/worker/console/static/assets/stateDiagram-v2-UEYNNEHI-eEhq2A8Y.js +1 -0
- package/dist/worker/console/static/assets/swimlanes-SLNWSIFB-DvqgNPzD.js +2 -0
- package/dist/worker/console/static/assets/swimlanesDiagram-ULZ7WXOC-la8AC7fo.js +8 -0
- package/dist/worker/console/static/assets/timeline-definition-Z64GVDOM-2TyOYNx0.js +120 -0
- package/dist/worker/console/static/assets/vennDiagram-T6HMQDX7-B-nM6wM2.js +34 -0
- package/dist/worker/console/static/assets/wardleyDiagram-T6FBY63Y-B86wPdbr.js +78 -0
- package/dist/worker/console/static/assets/xychartDiagram-ELKLHX3M-Dr1C4AQz.js +7 -0
- package/dist/worker/console/static/favicon.svg +37 -0
- package/dist/worker/console/static/fonts/katex/KaTeX_AMS-Regular.woff2 +0 -0
- package/dist/worker/console/static/fonts/katex/KaTeX_Caligraphic-Bold.woff2 +0 -0
- package/dist/worker/console/static/fonts/katex/KaTeX_Caligraphic-Regular.woff2 +0 -0
- package/dist/worker/console/static/fonts/katex/KaTeX_Fraktur-Bold.woff2 +0 -0
- package/dist/worker/console/static/fonts/katex/KaTeX_Fraktur-Regular.woff2 +0 -0
- package/dist/worker/console/static/fonts/katex/KaTeX_Main-Bold.woff2 +0 -0
- package/dist/worker/console/static/fonts/katex/KaTeX_Main-BoldItalic.woff2 +0 -0
- package/dist/worker/console/static/fonts/katex/KaTeX_Main-Italic.woff2 +0 -0
- package/dist/worker/console/static/fonts/katex/KaTeX_Main-Regular.woff2 +0 -0
- package/dist/worker/console/static/fonts/katex/KaTeX_Math-BoldItalic.woff2 +0 -0
- package/dist/worker/console/static/fonts/katex/KaTeX_Math-Italic.woff2 +0 -0
- package/dist/worker/console/static/fonts/katex/KaTeX_SansSerif-Bold.woff2 +0 -0
- package/dist/worker/console/static/fonts/katex/KaTeX_SansSerif-Italic.woff2 +0 -0
- package/dist/worker/console/static/fonts/katex/KaTeX_SansSerif-Regular.woff2 +0 -0
- package/dist/worker/console/static/fonts/katex/KaTeX_Script-Regular.woff2 +0 -0
- package/dist/worker/console/static/fonts/katex/KaTeX_Size1-Regular.woff2 +0 -0
- package/dist/worker/console/static/fonts/katex/KaTeX_Size2-Regular.woff2 +0 -0
- package/dist/worker/console/static/fonts/katex/KaTeX_Size3-Regular.woff2 +0 -0
- package/dist/worker/console/static/fonts/katex/KaTeX_Size4-Regular.woff2 +0 -0
- package/dist/worker/console/static/fonts/katex/KaTeX_Typewriter-Regular.woff2 +0 -0
- package/dist/worker/console/static/index.html +15 -0
- package/dist/worker/console/static-src/app/console-types.js +184 -0
- package/dist/worker/console/static-src/app/useConsoleShell.js +101 -0
- package/dist/worker/console/static-src/app/useOperatorActions.js +324 -0
- package/dist/worker/console/static-src/app/usePrdImport.js +172 -0
- package/dist/worker/console/static-src/app/useRecoveryActions.js +289 -0
- package/dist/worker/console/static-src/app/useRecoveryConsole.js +425 -0
- package/dist/worker/console/static-src/app/useTaskWizard.js +296 -0
- package/dist/worker/console/static-src/chat-markdown-security.js +38 -0
- package/dist/worker/console/static-src/chat-view-types.js +2 -0
- package/dist/worker/console/static-src/night/night-types.js +24 -0
- package/dist/worker/console/static-src/night/useNightBoard.js +94 -0
- package/dist/worker/console/static-src/night/useNightWizard.js +171 -0
- package/dist/worker/console/static-src/night-prepare-result.js +118 -0
- package/dist/worker/console/static-src/operator-chat/activity-journey.js +125 -0
- package/dist/worker/console/static-src/operator-chat/activity-rail-presentation.js +73 -0
- package/dist/worker/console/static-src/operator-chat/activity-references.js +20 -0
- package/dist/worker/console/static-src/operator-chat/chat-sse-events.js +420 -0
- package/dist/worker/console/static-src/operator-chat/format.js +71 -0
- package/dist/worker/console/static-src/operator-chat/landing-density.js +23 -0
- package/dist/worker/console/static-src/operator-chat/mutation-gate.js +45 -0
- package/dist/worker/console/static-src/operator-chat/refs.js +86 -0
- package/dist/worker/console/static-src/operator-chat/resource-auto-invocation.js +91 -0
- package/dist/worker/console/static-src/operator-chat/resource-diagnostics.js +204 -0
- package/dist/worker/console/static-src/operator-chat/runtime-snapshot-store.js +257 -0
- package/dist/worker/console/static-src/operator-chat/session-title-watcher.js +128 -0
- package/dist/worker/console/static-src/operator-chat/sidebar-split.js +90 -0
- package/dist/worker/console/static-src/operator-chat/slash-palette-layout.js +24 -0
- package/dist/worker/console/static-src/operator-chat/slash-palette-nav.js +141 -0
- package/dist/worker/console/static-src/operator-chat/spatial-overlay.js +38 -0
- package/dist/worker/console/static-src/operator-chat/tools-catalog.js +77 -0
- package/dist/worker/console/static-src/operator-chat/turn-stream-controller.js +690 -0
- package/dist/worker/console/static-src/operator-chat/turn-submission.js +158 -0
- package/dist/worker/console/static-src/operator-chat/types.js +1 -0
- package/dist/worker/console/static-src/operator-chat/useActivityRailTransition.js +59 -0
- package/dist/worker/console/static-src/operator-chat/useChatSessions.js +495 -0
- package/dist/worker/console/static-src/operator-chat/useChatStream.js +780 -0
- package/dist/worker/console/static-src/operator-chat/useChatThread.js +280 -0
- package/dist/worker/console/static-src/operator-chat/useComposer.js +257 -0
- package/dist/worker/console/static-src/operator-chat/useInterview.js +108 -0
- package/dist/worker/console/static-src/operator-chat/useOverlayFocus.js +84 -0
- package/dist/worker/console/static-src/operator-chat/useRepoBrowser.js +148 -0
- package/dist/worker/console/static-src/operator-chat/useRuntimeControls.js +358 -0
- package/dist/worker/console/static-src/operator-chat/useRuntimeSnapshot.js +196 -0
- package/dist/worker/console/static-src/operator-chat/useWorkspaceLayout.js +58 -0
- package/dist/worker/console/static-src/operator-chat/workspace-layout-mode.js +35 -0
- package/dist/worker/console/static-src/prd-file-import.js +218 -0
- package/dist/worker/console/vite.config.js +27 -0
- package/dist/worker/console/workflow-kinds.js +46 -0
- package/dist/worker/delivery/final-verification.js +302 -0
- package/dist/worker/delivery/git-transaction.js +497 -0
- package/dist/worker/delivery/package.js +537 -0
- package/dist/worker/delivery/verification-bundle.js +544 -0
- package/dist/worker/feature/acceptance-policy.js +227 -0
- package/dist/worker/feature/advance.js +301 -0
- package/dist/worker/feature/decision-loader.js +99 -0
- package/dist/worker/feature/discover.js +14 -0
- package/dist/worker/feature/doctor.js +223 -0
- package/dist/worker/feature/fullstack-validate.js +337 -0
- package/dist/worker/feature/next-action.js +140 -0
- package/dist/worker/feature/profile-schema.js +47 -0
- package/dist/worker/feature/ready-plan-projection.js +82 -0
- package/dist/worker/feature/reducer.js +137 -0
- package/dist/worker/feature/review.js +678 -0
- package/dist/worker/feature/run.js +390 -0
- package/dist/worker/feature/scaffold.js +812 -0
- package/dist/worker/feature/types.js +1 -0
- package/dist/worker/follow-up/approve.js +273 -0
- package/dist/worker/follow-up/factory.js +234 -0
- package/dist/worker/follow-up/paths.js +25 -0
- package/dist/worker/follow-up/policy.js +26 -0
- package/dist/worker/follow-up/schema.js +93 -0
- package/dist/worker/follow-up/store.js +96 -0
- package/dist/worker/loop-agent/command-result.js +1 -0
- package/dist/worker/loop-agent/controller-protocol.js +143 -0
- package/dist/worker/loop-agent/loop-agent-client.js +489 -0
- package/dist/worker/loop-agent/parse-json.js +14 -0
- package/dist/worker/materialize/harness-task-lifecycle-probe.js +126 -0
- package/dist/worker/materialize/harness-task-lineage.js +220 -0
- package/dist/worker/materialize/harness-task-materializer.js +648 -0
- package/dist/worker/metrics/projector.js +139 -0
- package/dist/worker/observability/dag-execution-trajectory.js +591 -0
- package/dist/worker/observability/event-history.js +216 -0
- package/dist/worker/observability/event-store.js +83 -0
- package/dist/worker/observability/events.js +79 -0
- package/dist/worker/observability/interrupt-eligibility.js +264 -0
- package/dist/worker/observability/progress-composite.js +34 -0
- package/dist/worker/observability/read-model.js +2499 -0
- package/dist/worker/observability/snapshot-store.js +43 -0
- package/dist/worker/observability/types.js +1 -0
- package/dist/worker/observe/dag-node-execution-output.js +180 -0
- package/dist/worker/observe/dag-run-artifacts.js +90 -0
- package/dist/worker/observe/health.js +58 -0
- package/dist/worker/observe/night-jobs.js +104 -0
- package/dist/worker/observe/node-input.js +441 -0
- package/dist/worker/observe/paths.js +174 -0
- package/dist/worker/observe/routes.js +1077 -0
- package/dist/worker/observe/server.js +117 -0
- package/dist/worker/observe/spec-evidence.js +398 -0
- package/dist/worker/observe/static/api.js +117 -0
- package/dist/worker/observe/static/app.js +169 -0
- package/dist/worker/observe/static/constants.js +182 -0
- package/dist/worker/observe/static/copy.js +67 -0
- package/dist/worker/observe/static/custom-select.js +567 -0
- package/dist/worker/observe/static/dag-edge-routing.js +368 -0
- package/dist/worker/observe/static/dag-helpers.js +161 -0
- package/dist/worker/observe/static/dag-history-labels.js +95 -0
- package/dist/worker/observe/static/dag-layout.d.ts +36 -0
- package/dist/worker/observe/static/dag-layout.js +163 -0
- package/dist/worker/observe/static/dag-model.js +145 -0
- package/dist/worker/observe/static/dom.js +220 -0
- package/dist/worker/observe/static/favicon.svg +37 -0
- package/dist/worker/observe/static/format-pool.d.ts +71 -0
- package/dist/worker/observe/static/format-pool.js +153 -0
- package/dist/worker/observe/static/format.js +347 -0
- package/dist/worker/observe/static/index.html +409 -0
- package/dist/worker/observe/static/kpi.js +78 -0
- package/dist/worker/observe/static/markdown-render.js +124 -0
- package/dist/worker/observe/static/operator-chrome.css +517 -0
- package/dist/worker/observe/static/operator-chrome.d.ts +83 -0
- package/dist/worker/observe/static/operator-chrome.js +623 -0
- package/dist/worker/observe/static/relations.js +133 -0
- package/dist/worker/observe/static/router.js +156 -0
- package/dist/worker/observe/static/run-processing.js +148 -0
- package/dist/worker/observe/static/shell-chrome.js +65 -0
- package/dist/worker/observe/static/state.js +496 -0
- package/dist/worker/observe/static/styles.css +3567 -0
- package/dist/worker/observe/static/views/batch.js +227 -0
- package/dist/worker/observe/static/views/dag-graph.js +508 -0
- package/dist/worker/observe/static/views/dag-inspector.js +1722 -0
- package/dist/worker/observe/static/views/dag-trajectory.js +313 -0
- package/dist/worker/observe/static/views/dag.js +483 -0
- package/dist/worker/observe/static/views/dags.js +877 -0
- package/dist/worker/observe/static/views/dashboard.js +747 -0
- package/dist/worker/observe/static/views/failures.js +143 -0
- package/dist/worker/observe/static/views/feature.js +492 -0
- package/dist/worker/observe/static/views/night.js +201 -0
- package/dist/worker/observe/static/views/pool.js +708 -0
- package/dist/worker/observe/static/views/run.js +453 -0
- package/dist/worker/observe/static/views/session-timeline.js +771 -0
- package/dist/worker/observe/static/views/shell.js +7 -0
- package/dist/worker/observe/static/views/task.js +315 -0
- package/dist/worker/observe/static/views/timeline.js +163 -0
- package/dist/worker/outcomes/adapters.js +153 -0
- package/dist/worker/outcomes/declared-artifacts.js +103 -0
- package/dist/worker/outcomes/evidence-tokens.js +29 -0
- package/dist/worker/outcomes/gate.js +40 -0
- package/dist/worker/outcomes/projector.js +227 -0
- package/dist/worker/outcomes/registry.js +1 -0
- package/dist/worker/outcomes/store.js +131 -0
- package/dist/worker/outcomes/types.js +79 -0
- package/dist/worker/pool/attempt-identity.js +41 -0
- package/dist/worker/pool/attempt-lease.js +184 -0
- package/dist/worker/pool/attempt-transition.js +210 -0
- package/dist/worker/pool/begin-attempt-with-lease.js +26 -0
- package/dist/worker/pool/begin-attempt.js +35 -0
- package/dist/worker/pool/doctor.js +165 -0
- package/dist/worker/pool/failure-routing.js +182 -0
- package/dist/worker/pool/migrate-state.js +303 -0
- package/dist/worker/pool/reconcile.js +285 -0
- package/dist/worker/pool/recovery-decision.js +163 -0
- package/dist/worker/pool/run-owner-store.js +126 -0
- package/dist/worker/pool/run-store.js +360 -0
- package/dist/worker/pool/runtime-reconcile-inventory.js +127 -0
- package/dist/worker/pool/state-projection.js +57 -0
- package/dist/worker/pool/types.js +17 -0
- package/dist/worker/pool/validation.js +144 -0
- package/dist/worker/preflight.js +157 -0
- package/dist/worker/profile-mapping.js +76 -0
- package/dist/worker/progress-reporter.js +63 -0
- package/dist/worker/report/morning-report.js +155 -0
- package/dist/worker/repos/repo-resolver.js +23 -0
- package/dist/worker/run-task/execute-prepared-task.js +178 -0
- package/dist/worker/run-task/run-task.js +912 -0
- package/dist/worker/runner/run-ready.js +561 -0
- package/dist/worker/runner/single-task-attempt.js +176 -0
- package/dist/worker/scheduler/admission.js +547 -0
- package/dist/worker/scheduler/auto-followup.js +99 -0
- package/dist/worker/scheduler/cli.js +644 -0
- package/dist/worker/scheduler/clock-install/darwin-launchd.js +238 -0
- package/dist/worker/scheduler/clock-install/linux-systemd-user.js +224 -0
- package/dist/worker/scheduler/clock-install/types.js +1 -0
- package/dist/worker/scheduler/clock-install/win32-schtasks.js +227 -0
- package/dist/worker/scheduler/clock-install.js +284 -0
- package/dist/worker/scheduler/clock.js +420 -0
- package/dist/worker/scheduler/dispatcher.js +503 -0
- package/dist/worker/scheduler/doctor.js +431 -0
- package/dist/worker/scheduler/evidence.js +170 -0
- package/dist/worker/scheduler/git-base.js +90 -0
- package/dist/worker/scheduler/index.js +25 -0
- package/dist/worker/scheduler/lease.js +114 -0
- package/dist/worker/scheduler/lifecycle.js +348 -0
- package/dist/worker/scheduler/lock.js +80 -0
- package/dist/worker/scheduler/morning-window.js +191 -0
- package/dist/worker/scheduler/night-git-finalizer.js +114 -0
- package/dist/worker/scheduler/night-harvest.js +412 -0
- package/dist/worker/scheduler/paths.js +92 -0
- package/dist/worker/scheduler/prepared-attempt-recovery.js +471 -0
- package/dist/worker/scheduler/recovery.js +277 -0
- package/dist/worker/scheduler/reservation.js +146 -0
- package/dist/worker/scheduler/retry.js +199 -0
- package/dist/worker/scheduler/scheduler-loop.js +272 -0
- package/dist/worker/scheduler/store.js +275 -0
- package/dist/worker/scheduler/traceability.js +54 -0
- package/dist/worker/scheduler/trigger.js +258 -0
- package/dist/worker/scheduler/types.js +369 -0
- package/dist/worker/scheduler/workspace-adapter.js +128 -0
- package/dist/worker/task-graph/acceptance-schema.js +40 -0
- package/dist/worker/task-graph/ready-planner.js +267 -0
- package/dist/worker/task-graph/ready-queue.js +23 -0
- package/dist/worker/task-graph/task-graph-schema.js +59 -0
- package/dist/worker/task-graph/types.js +1 -0
- package/dist/worker/task-graph/validate.js +293 -0
- package/dist/worker/task-spec/complexity-mapping.js +8 -0
- package/dist/worker/task-spec/schema.js +125 -0
- package/dist/worker/task-spec/types.js +1 -0
- package/dist/worker/task-spec/validate.js +391 -0
- package/dist/worker/task-spec/workflow-routing.js +149 -0
- package/dist/workflows/dag/authoring.js +8 -0
- package/dist/workflows/dag/authority-surface.js +138 -0
- package/dist/workflows/dag/backend-test-analysis-contract.js +507 -0
- package/dist/workflows/dag/backend-test-case-coverage-analysis.js +1985 -0
- package/dist/workflows/dag/backend-test-case-manifest.js +638 -0
- package/dist/workflows/dag/backend-test-classification-contract.js +38 -0
- package/dist/workflows/dag/backend-test-contract-envelope.js +205 -0
- package/dist/workflows/dag/backend-test-coverage-contract.js +202 -0
- package/dist/workflows/dag/backend-test-execution-contract.js +715 -0
- package/dist/workflows/dag/backend-test-gap-fill.js +205 -0
- package/dist/workflows/dag/backend-test-intake-context.js +178 -0
- package/dist/workflows/dag/backend-test-layout.js +133 -0
- package/dist/workflows/dag/backend-test-markdown-workflow.js +1984 -0
- package/dist/workflows/dag/backend-test-module-stem.js +26 -0
- package/dist/workflows/dag/backend-test-pytest-collection.js +859 -0
- package/dist/workflows/dag/backend-test-result-contract.js +1030 -0
- package/dist/workflows/dag/backend-test-scenario-param.js +1670 -0
- package/dist/workflows/dag/backend-test-scenario-partitions.js +249 -0
- package/dist/workflows/dag/backend-test-semantic-review-contract.js +36 -0
- package/dist/workflows/dag/backend-test-stability-contract.js +57 -0
- package/dist/workflows/dag/backend-test-writer-completeness.js +1058 -0
- package/dist/workflows/dag/budget-enforcement.js +67 -0
- package/dist/workflows/dag/canvas-observer.js +474 -0
- package/dist/workflows/dag/context-policy.js +137 -0
- package/dist/workflows/dag/contract-output-registry.js +14 -0
- package/dist/workflows/dag/contract-validator-registrations.js +10 -0
- package/dist/workflows/dag/controller-identity.js +104 -0
- package/dist/workflows/dag/convergence/controller.js +596 -0
- package/dist/workflows/dag/decision-envelope.js +557 -0
- package/dist/workflows/dag/decision-evidence.js +153 -0
- package/dist/workflows/dag/decision-gates.js +1 -0
- package/dist/workflows/dag/dynamic-runtime/condition.js +48 -0
- package/dist/workflows/dag/dynamic-runtime/loop-until.js +161 -0
- package/dist/workflows/dag/dynamic-runtime/map.js +435 -0
- package/dist/workflows/dag/dynamic-runtime/reduction.js +72 -0
- package/dist/workflows/dag/dynamic-runtime/shared.js +203 -0
- package/dist/workflows/dag/event-observer.js +132 -0
- package/dist/workflows/dag/executor-registry.js +23 -0
- package/dist/workflows/dag/facts.js +4 -0
- package/dist/workflows/dag/failure-category.js +118 -0
- package/dist/workflows/dag/failure-routing.js +105 -0
- package/dist/workflows/dag/final-verification.js +180 -0
- package/dist/workflows/dag/frontend-implementation-contract.js +1911 -0
- package/dist/workflows/dag/frontend-lint-baseline.js +474 -0
- package/dist/workflows/dag/frontend-plan-render.js +90 -0
- package/dist/workflows/dag/frontend-prewrite-gate.js +1011 -0
- package/dist/workflows/dag/frontend-project-capability.js +1 -0
- package/dist/workflows/dag/frontend-recovery-plan.js +73 -0
- package/dist/workflows/dag/frontend-recovery-root-manifest.js +123 -0
- package/dist/workflows/dag/frontend-recovery-run.js +539 -0
- package/dist/workflows/dag/frontend-repair.js +541 -0
- package/dist/workflows/dag/frontend-review-context.js +116 -0
- package/dist/workflows/dag/frontend-risk.js +161 -0
- package/dist/workflows/dag/frontend-test-case-checklist.js +343 -0
- package/dist/workflows/dag/frontend-test-case-manifest.js +104 -0
- package/dist/workflows/dag/frontend-test-case-quality.js +105 -0
- package/dist/workflows/dag/frontend-test-html-report.js +174 -0
- package/dist/workflows/dag/frontend-test-l5-report.js +177 -0
- package/dist/workflows/dag/frontend-test-result-contract.js +487 -0
- package/dist/workflows/dag/frontend-verification-trace.js +275 -0
- package/dist/workflows/dag/frontend-worktree-diff.js +201 -0
- package/dist/workflows/dag/frontend-writer-recovery.js +106 -0
- package/dist/workflows/dag/frontend-writer-rollback.js +821 -0
- package/dist/workflows/dag/governance-constants.js +5 -0
- package/dist/workflows/dag/governance-profile.js +413 -0
- package/dist/workflows/dag/index.js +6 -0
- package/dist/workflows/dag/init-hybrid.js +7345 -0
- package/dist/workflows/dag/interrupt-request.js +559 -0
- package/dist/workflows/dag/knowledge-curator.js +165 -0
- package/dist/workflows/dag/l5-report-metrics.js +33 -0
- package/dist/workflows/dag/lifecycle.js +855 -0
- package/dist/workflows/dag/liveness-policy.js +251 -0
- package/dist/workflows/dag/node-execution.js +1081 -0
- package/dist/workflows/dag/observer-compose.js +52 -0
- package/dist/workflows/dag/output-protocol.js +356 -0
- package/dist/workflows/dag/project-governance-context.js +514 -0
- package/dist/workflows/dag/prompt-source.js +88 -0
- package/dist/workflows/dag/prompt.js +348 -0
- package/dist/workflows/dag/reconcile-run.js +145 -0
- package/dist/workflows/dag/reconcile-tasks.js +404 -0
- package/dist/workflows/dag/recovery-recommendation.js +329 -0
- package/dist/workflows/dag/repair-artifact.js +363 -0
- package/dist/workflows/dag/report.js +1229 -0
- package/dist/workflows/dag/rerun-plan.js +614 -0
- package/dist/workflows/dag/rerun-run.js +556 -0
- package/dist/workflows/dag/rerun-task.js +370 -0
- package/dist/workflows/dag/retry-policy.js +263 -0
- package/dist/workflows/dag/run-store.js +41 -0
- package/dist/workflows/dag/runner.js +1069 -0
- package/dist/workflows/dag/runtime-contract.js +87 -0
- package/dist/workflows/dag/runtime.js +5 -0
- package/dist/workflows/dag/scheduler.js +497 -0
- package/dist/workflows/dag/sdd-embedded.js +128 -0
- package/dist/workflows/dag/skill-instructions.js +478 -0
- package/dist/workflows/dag/skill-snapshot.js +553 -0
- package/dist/workflows/dag/skills.js +41 -0
- package/dist/workflows/dag/spec.js +3 -0
- package/dist/workflows/dag/task-contract-binding.js +138 -0
- package/dist/workflows/dag/task-demand-routing.js +1 -0
- package/dist/workflows/dag/topo.js +30 -0
- package/dist/workflows/dag/types.js +1145 -0
- package/dist/workflows/dag/upstream-artifacts.js +98 -0
- package/dist/workflows/dag/validate.js +998 -0
- package/dist/workflows/dag/workspace-checkpoint.js +186 -0
- package/dist/workflows/dynamic/artifacts.js +65 -0
- package/dist/workflows/dynamic/compile.js +371 -0
- package/dist/workflows/dynamic/compileTypes.js +1 -0
- package/dist/workflows/dynamic/errors.js +5 -0
- package/dist/workflows/dynamic/index.js +7 -0
- package/dist/workflows/dynamic/profiles.js +156 -0
- package/dist/workflows/dynamic/spec.js +115 -0
- package/dist/workflows/dynamic/validate.js +275 -0
- package/dist/workflows/loop/actions/dag-action.js +129 -0
- package/dist/workflows/loop/actions/pi-review.js +267 -0
- package/dist/workflows/loop/actions/shared.js +157 -0
- package/dist/workflows/loop/actions/shell-verify.js +82 -0
- package/dist/workflows/loop/actions/types.js +1 -0
- package/dist/workflows/loop/actions/workflow-action.js +255 -0
- package/dist/workflows/loop/actions.js +160 -0
- package/dist/workflows/loop/benchmark.js +510 -0
- package/dist/workflows/loop/closeout.js +135 -0
- package/dist/workflows/loop/context.js +47 -0
- package/dist/workflows/loop/events.js +26 -0
- package/dist/workflows/loop/hash.js +32 -0
- package/dist/workflows/loop/index.js +8 -0
- package/dist/workflows/loop/paths.js +17 -0
- package/dist/workflows/loop/policy/auto-policy.js +112 -0
- package/dist/workflows/loop/policy/path-patterns.js +13 -0
- package/dist/workflows/loop/rounds.js +81 -0
- package/dist/workflows/loop/signals.js +52 -0
- package/dist/workflows/loop/state.js +116 -0
- package/dist/workflows/loop/templates.js +54 -0
- package/dist/workflows/loop/types.js +28 -0
- package/docs/README.md +82 -0
- package/docs/architecture/README.md +35 -0
- package/docs/architecture/dag-execution.md +165 -0
- package/docs/architecture/evolution.md +108 -0
- package/docs/architecture/facts-and-state.md +74 -0
- package/docs/architecture/runtime-boundaries.md +226 -0
- package/docs/architecture/system-overview.md +100 -0
- package/docs/architecture/worker-and-feature.md +122 -0
- package/docs/governance/README.md +18 -0
- package/docs/governance/harness-methodology-debugging.md +177 -0
- package/docs/governance/harness-methodology-tdd.md +130 -0
- package/docs/governance/harness-methodology-verification.md +27 -0
- package/docs/init-surface.manifest.json +358 -0
- package/docs/operations/README.md +15 -0
- package/docs/operations/local-development-environment.md +77 -0
- package/docs/skills/README.md +7 -0
- package/docs/skills/vetted-skill-registry.md +49 -0
- package/docs/templates/README.md +67 -0
- package/docs/templates/adr.md +60 -0
- package/docs/templates/agent-dag-authority-surface-audit.prompt.md +94 -0
- package/docs/templates/agent-dag-decision-envelope.schema.json +213 -0
- package/docs/templates/agent-dag-decision-gate-dogfood-report.md +117 -0
- package/docs/templates/agent-dag-decision-gate.prompt.md +246 -0
- package/docs/templates/agent-dag-process-supervisor.prompt.md +98 -0
- package/docs/templates/agent-dag-report.schema.json +473 -0
- package/docs/templates/agent-dag-review-verdict.prompt.md +68 -0
- package/docs/templates/agent-dag.base.json +190 -0
- package/docs/templates/agent-dag.final-verification.json +185 -0
- package/docs/templates/agent-dag.schema.json +590 -0
- package/docs/templates/agent-dag.supervised-implementation.json +640 -0
- package/docs/templates/agent-worker-production-readiness-checklist.md +47 -0
- package/docs/templates/backend-test-analysis.schema.json +37 -0
- package/docs/templates/backend-test-case-manifest.schema.json +223 -0
- package/docs/templates/backend-test-dag.classify.prompt.md +75 -0
- package/docs/templates/backend-test-dag.generate-pytest.prompt.md +41 -0
- package/docs/templates/backend-test-dag.json +671 -0
- package/docs/templates/backend-test-dag.retrospect.prompt.md +165 -0
- package/docs/templates/backend-test-dag.review-cases.prompt.md +36 -0
- package/docs/templates/backend-test-execution.schema.json +138 -0
- package/docs/templates/backend-test-result.schema.json +99 -0
- package/docs/templates/branch-merge-report.md +115 -0
- package/docs/templates/evaluation/agents-map-slim-v1.candidate.json +9 -0
- package/docs/templates/evaluation/agents-map-slim-v1.md +87 -0
- package/docs/templates/evaluation/agents-map-verbose-v0.candidate.json +9 -0
- package/docs/templates/evaluation/agents-map-verbose-v0.md +153 -0
- package/docs/templates/evaluation/campaign-budget-v1.json +12 -0
- package/docs/templates/evaluation/campaign-dogfood-v0.json +24 -0
- package/docs/templates/evaluation/campaign-evidence-v1.json +44 -0
- package/docs/templates/evaluation/context-policy-baseline-v1.json +17 -0
- package/docs/templates/evaluation/context-policy-role-specialized-v1.json +28 -0
- package/docs/templates/evaluation/corpus-dogfood-v0.manifest.json +118 -0
- package/docs/templates/evaluation/matrix-dag-dry-run-v1.json +21 -0
- package/docs/templates/evaluation/matrix-fixture-v1.json +10 -0
- package/docs/templates/evaluation/private-verifier-dogfood-v0.json +16 -0
- package/docs/templates/exec-plan.md +66 -0
- package/docs/templates/feature-spec.md +53 -0
- package/docs/templates/frontend-design-contract.md +68 -0
- package/docs/templates/frontend-eval/fixtures/failures/01-type-build-error.md +17 -0
- package/docs/templates/frontend-eval/fixtures/failures/02-unit-component-test-fail.md +16 -0
- package/docs/templates/frontend-eval/fixtures/failures/03-fixture-schema-drift.md +16 -0
- package/docs/templates/frontend-eval/fixtures/failures/04-missing-loading-empty-error-state.md +16 -0
- package/docs/templates/frontend-eval/fixtures/failures/05-forbidden-write-writeset-expansion.md +16 -0
- package/docs/templates/frontend-eval/fixtures/failures/06-unapproved-dependency-add.md +16 -0
- package/docs/templates/frontend-eval/fixtures/failures/07-mock-production-on.md +21 -0
- package/docs/templates/frontend-eval/fixtures/functional/01-simple-component-style.md +29 -0
- package/docs/templates/frontend-eval/fixtures/functional/02-form-validation.md +28 -0
- package/docs/templates/frontend-eval/fixtures/functional/03-list-detail-page.md +28 -0
- package/docs/templates/frontend-eval/fixtures/functional/04-api-mock.md +29 -0
- package/docs/templates/frontend-eval/fixtures/functional/05-permission-auth-gated-ui.md +27 -0
- package/docs/templates/frontend-eval/fixtures/functional/06-ssr-server-client-boundary.md +28 -0
- package/docs/templates/frontend-eval/fixtures/functional/07-shared-public-component-api.md +28 -0
- package/docs/templates/frontend-eval/fixtures/functional/08-pure-local-no-remote.md +27 -0
- package/docs/templates/frontend-eval/metrics.md +138 -0
- package/docs/templates/frontend-eval/smoke-targets.md +53 -0
- package/docs/templates/frontend-implementation-contract.schema.json +35 -0
- package/docs/templates/frontend-task-constraints.md +62 -0
- package/docs/templates/frontend-task-requirement.md +104 -0
- package/docs/templates/frontend-test-case-checklist.md +44 -0
- package/docs/templates/frontend-test-case.example.md +143 -0
- package/docs/templates/frontend-test-dag.generate-cases.prompt.md +63 -0
- package/docs/templates/frontend-test-dag.json +409 -0
- package/docs/templates/frontend-test-dag.retrieve-context.prompt.md +21 -0
- package/docs/templates/frontend-test-dag.retrospect.prompt.md +5 -0
- package/docs/templates/frontend-test-dag.review-cases.prompt.md +5 -0
- package/docs/templates/frontend-test-dag.review-execution.prompt.md +3 -0
- package/docs/templates/frontend-test-standard-scenarios.v1.json +159 -0
- package/docs/templates/harness.schema.json +351 -0
- package/docs/templates/hybrid-dag.json +188 -0
- package/docs/templates/init-evolution-review.md +35 -0
- package/docs/templates/init-managed-agents.md +157 -0
- package/docs/templates/interactive-ui-round2-experiment.md +66 -0
- package/docs/templates/knowledge-graph-bootstrap-dag.json +118 -0
- package/docs/templates/knowledge-sync-dag.json +178 -0
- package/docs/templates/knowledge-sync-draft.schema.json +71 -0
- package/docs/templates/product-line/AGENTS.md +9 -0
- package/docs/templates/product-line/README.md +42 -0
- package/docs/templates/product-line/acceptance.yaml +23 -0
- package/docs/templates/product-line/closeout.yaml +9 -0
- package/docs/templates/product-line/design.md +13 -0
- package/docs/templates/product-line/feature-scaffold-batch.example.yaml +31 -0
- package/docs/templates/product-line/feature.yaml +11 -0
- package/docs/templates/product-line/links.md +10 -0
- package/docs/templates/product-line/requirement.md +17 -0
- package/docs/templates/product-line/scaffold-samples/README.md +36 -0
- package/docs/templates/product-line/scaffold-samples/backend-only/acceptance.yaml +16 -0
- package/docs/templates/product-line/scaffold-samples/backend-only/design.md +14 -0
- package/docs/templates/product-line/scaffold-samples/backend-only/feature.yaml +14 -0
- package/docs/templates/product-line/scaffold-samples/backend-only/requirement.md +6 -0
- package/docs/templates/product-line/scaffold-samples/backend-only/tasks/BE-IMPL-001.yaml +83 -0
- package/docs/templates/product-line/scaffold-samples/backend-only/tasks/task-graph.yaml +14 -0
- package/docs/templates/product-line/scaffold-samples/fe-with-api/acceptance.yaml +18 -0
- package/docs/templates/product-line/scaffold-samples/fe-with-api/design.md +18 -0
- package/docs/templates/product-line/scaffold-samples/fe-with-api/feature.yaml +14 -0
- package/docs/templates/product-line/scaffold-samples/fe-with-api/requirement.md +6 -0
- package/docs/templates/product-line/scaffold-samples/fe-with-api/tasks/BE-IMPL-001.yaml +84 -0
- package/docs/templates/product-line/scaffold-samples/fe-with-api/tasks/CONTRACT-001.yaml +84 -0
- package/docs/templates/product-line/scaffold-samples/fe-with-api/tasks/FE-IMPL-001.yaml +86 -0
- package/docs/templates/product-line/scaffold-samples/fe-with-api/tasks/task-graph.yaml +40 -0
- package/docs/templates/product-line/scaffold-samples/frontend-only/acceptance.yaml +16 -0
- package/docs/templates/product-line/scaffold-samples/frontend-only/design.md +14 -0
- package/docs/templates/product-line/scaffold-samples/frontend-only/feature.yaml +14 -0
- package/docs/templates/product-line/scaffold-samples/frontend-only/requirement.md +6 -0
- package/docs/templates/product-line/scaffold-samples/frontend-only/tasks/FE-IMPL-001.yaml +85 -0
- package/docs/templates/product-line/scaffold-samples/frontend-only/tasks/task-graph.yaml +14 -0
- package/docs/templates/product-line/task-graph.yaml +23 -0
- package/docs/templates/product-line/task.yaml +68 -0
- package/docs/templates/product-line/test-plan.md +7 -0
- package/docs/templates/production-readiness-checklist.md +57 -0
- package/docs/templates/progress-log.md +27 -0
- package/docs/templates/project-start-checklist.md +9 -0
- package/docs/templates/qa-report.md +48 -0
- package/docs/templates/sprint-contract.md +29 -0
- package/docs/templates/worker-dogfood-evidence.md +80 -0
- package/docs/templates/worker-dogfood-setup.md +68 -0
- package/examples/decision-gate-agent-dag.json +177 -0
- package/examples/example-dag.json +46 -0
- package/examples/hybrid-loop-agent-dag.json +189 -0
- package/examples/l5-report-coms-process-definition.html +322 -0
- package/examples/l5-report-demo.html +79 -0
- package/harness.json +90 -0
- package/package.json +98 -0
- package/scripts/kb-bootstrap-init-skeleton.sh +241 -0
- package/scripts/kb-graph-incremental-prepare.mjs +386 -0
- package/scripts/kb-graph-materialize.mjs +105 -0
- package/scripts/kb-graph-promote.mjs +164 -0
- package/scripts/kb-query.mjs +554 -0
- package/skills/agent-worker/SKILL.md +48 -0
- package/skills/agent-worker/references/agent-worker-operator.md +159 -0
- package/skills/ai-engineering-context/SKILL.md +48 -0
- package/skills/analyze-product-dependencies/SKILL.md +108 -0
- package/skills/analyze-product-dependencies/references/api-documentation-schema.md +35 -0
- package/skills/analyze-product-dependencies/references/dependency-analysis-schema.md +38 -0
- package/skills/analyze-product-dependencies/references/example.md +76 -0
- package/skills/analyze-product-dependencies/references/forward-test-cases.md +110 -0
- package/skills/analyze-product-dependencies/references/input-contract.md +34 -0
- package/skills/analyze-product-dependencies/references/kb-integration.md +64 -0
- package/skills/analyze-product-dependencies/references/scouting-rules.md +76 -0
- package/skills/analyze-product-dependencies/scripts/test-validators.mjs +460 -0
- package/skills/analyze-product-dependencies/scripts/validate-api-documentation.mjs +194 -0
- package/skills/analyze-product-dependencies/scripts/validate-dependency-analysis.mjs +200 -0
- package/skills/analyze-product-dependencies/scripts/validate-product-requirement-input.mjs +90 -0
- package/skills/analyze-product-dependencies/scripts/validation-helpers.mjs +138 -0
- package/skills/analyze-product-requirements/SKILL.md +145 -0
- package/skills/analyze-product-requirements/references/acceptance-criteria.md +87 -0
- package/skills/analyze-product-requirements/references/clarification-and-knowledge.md +70 -0
- package/skills/analyze-product-requirements/references/example.md +104 -0
- package/skills/analyze-product-requirements/references/forward-test-cases.md +144 -0
- package/skills/analyze-product-requirements/references/kb-integration.md +56 -0
- package/skills/analyze-product-requirements/references/product-analysis-schema.md +41 -0
- package/skills/analyze-product-requirements/references/product-requirement-schema.md +42 -0
- package/skills/analyze-product-requirements/references/requirement-clarification-schema.md +66 -0
- package/skills/analyze-product-requirements/scripts/compute-source-identity.mjs +35 -0
- package/skills/analyze-product-requirements/scripts/test-validators.mjs +501 -0
- package/skills/analyze-product-requirements/scripts/validate-product-analysis.mjs +100 -0
- package/skills/analyze-product-requirements/scripts/validate-product-requirement.mjs +109 -0
- package/skills/analyze-product-requirements/scripts/validate-requirement-clarification.mjs +109 -0
- package/skills/analyze-product-requirements/scripts/validation-helpers.mjs +175 -0
- package/skills/browser-tools/SKILL.md +196 -0
- package/skills/browser-tools/browser-content.js +103 -0
- package/skills/browser-tools/browser-cookies.js +35 -0
- package/skills/browser-tools/browser-eval.js +53 -0
- package/skills/browser-tools/browser-hn-scraper.js +108 -0
- package/skills/browser-tools/browser-nav.js +44 -0
- package/skills/browser-tools/browser-pick.js +162 -0
- package/skills/browser-tools/browser-screenshot.js +34 -0
- package/skills/browser-tools/browser-start.js +86 -0
- package/skills/browser-tools/package-lock.json +2556 -0
- package/skills/browser-tools/package.json +19 -0
- package/skills/code-review-core/SKILL.md +20 -0
- package/skills/codebase-scout/SKILL.md +19 -0
- package/skills/frontend-bounded-implement/SKILL.md +53 -0
- package/skills/frontend-design-review/SKILL.md +79 -0
- package/skills/frontend-design-review/references/review-checklist.md +43 -0
- package/skills/frontend-implementation/SKILL.md +52 -0
- package/skills/frontend-implementation/references/code-standards.md +33 -0
- package/skills/frontend-implementation/references/design-spec.md +56 -0
- package/skills/frontend-implementation/references/node-contracts.md +31 -0
- package/skills/frontend-review/SKILL.md +55 -0
- package/skills/frontend-review/references/review-findings.md +50 -0
- package/skills/frontend-verification/SKILL.md +61 -0
- package/skills/frontend-verification/references/verification-checklist.md +48 -0
- package/skills/grill-me/SKILL.md +10 -0
- package/skills/grill-with-docs/SKILL.md +80 -0
- package/skills/grill-with-docs/adr-format.md +58 -0
- package/skills/grill-with-docs/context-format.md +52 -0
- package/skills/init-capability-evolution/SKILL.md +70 -0
- package/skills/local-jacoco-coverage/SKILL.md +281 -0
- package/skills/local-jacoco-coverage/references/requirement-to-source-mapping.md +85 -0
- package/skills/local-jacoco-coverage/references/runtime-alignment.md +106 -0
- package/skills/local-jacoco-coverage/scripts/run-coverage-analysis.sh +148 -0
- package/skills/local-jacoco-coverage/scripts/start-jacoco-agent.sh +110 -0
- package/skills/loop-agent/SKILL.md +68 -0
- package/skills/loop-agent/references/README.md +67 -0
- package/skills/loop-agent/references/command-reference.md +645 -0
- package/skills/loop-agent/references/docs-converge.md +126 -0
- package/skills/loop-agent/references/harness-policy.md +289 -0
- package/skills/loop-agent/references/hybrid-dag.md +245 -0
- package/skills/loop-agent/references/learned/README.md +21 -0
- package/skills/loop-agent/references/long-running-loop.md +57 -0
- package/skills/loop-agent/references/model-routing.md +45 -0
- package/skills/loop-agent/references/multi-worktree.md +54 -0
- package/skills/loop-agent/references/one-shot-runs.md +84 -0
- package/skills/loop-agent/references/orchestrator-and-interventions.md +175 -0
- package/skills/loop-agent/references/pi-prompt.md +23 -0
- package/skills/loop-agent/references/pi-subagent-assisted-mode.md +84 -0
- package/skills/loop-agent/references/post-implementation-and-patterns.md +54 -0
- package/skills/loop-agent/references/source-and-plan-practice.md +169 -0
- package/skills/loop-agent/references/task-workflow.md +104 -0
- package/skills/loop-agent/references/verification-and-failure-handling.md +148 -0
- package/skills/playwright-cli/SKILL.md +93 -0
- package/skills/playwright-cli/references/element-attributes.md +23 -0
- package/skills/playwright-cli/references/playwright-tests.md +39 -0
- package/skills/playwright-cli/references/request-mocking.md +87 -0
- package/skills/playwright-cli/references/running-code.md +241 -0
- package/skills/playwright-cli/references/session-management.md +225 -0
- package/skills/playwright-cli/references/storage-state.md +275 -0
- package/skills/playwright-cli/references/test-generation.md +433 -0
- package/skills/playwright-cli/references/tracing.md +5 -0
- package/skills/playwright-cli/references/video-recording.md +5 -0
- package/skills/playwright-cli-case-generator/SKILL.md +108 -0
- package/skills/requesting-code-review/SKILL.md +101 -0
- package/skills/requesting-code-review/code-reviewer.md +168 -0
- package/skills/systematic-debugging/CREATION-LOG.md +119 -0
- package/skills/systematic-debugging/SKILL.md +312 -0
- package/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
- package/skills/systematic-debugging/condition-based-waiting.md +115 -0
- package/skills/systematic-debugging/defense-in-depth.md +122 -0
- package/skills/systematic-debugging/find-polluter.sh +63 -0
- package/skills/systematic-debugging/root-cause-tracing.md +169 -0
- package/skills/systematic-debugging/test-academic.md +14 -0
- package/skills/systematic-debugging/test-pressure-1.md +58 -0
- package/skills/systematic-debugging/test-pressure-2.md +68 -0
- package/skills/systematic-debugging/test-pressure-3.md +69 -0
- package/skills/test-driven-development/SKILL.md +27 -0
- package/skills/using-git-worktrees/SKILL.md +215 -0
- package/skills/verification-before-completion/SKILL.md +154 -0
- package/skills/webapp-testing/SKILL.md +19 -0
|
@@ -0,0 +1,1722 @@
|
|
|
1
|
+
/** DAG node inspector panel (Observe UI R5). */
|
|
2
|
+
import {
|
|
3
|
+
DAG_INSPECTOR_DEFAULT_WIDTH,
|
|
4
|
+
DAG_INSPECTOR_DEFAULT_WIDTH_RATIO,
|
|
5
|
+
DAG_INSPECTOR_MIN_WIDTH,
|
|
6
|
+
DAG_INSPECTOR_MAX_WIDTH,
|
|
7
|
+
DAG_INSPECTOR_RIGHT_OFFSET,
|
|
8
|
+
DAG_INSPECTOR_VIEWPORT_MARGIN,
|
|
9
|
+
DAG_INSPECTOR_KEYBOARD_STEP,
|
|
10
|
+
UI_TEXT,
|
|
11
|
+
} from "../constants.js";
|
|
12
|
+
import { clearNode, el } from "../dom.js";
|
|
13
|
+
import { attemptFailureLabel } from "../dag-history-labels.js";
|
|
14
|
+
import { fetchJson, fetchSpecEvidenceFile, fetchDagNodeInput } from "../api.js";
|
|
15
|
+
import { badge, formatMs } from "../format.js";
|
|
16
|
+
import { renderMarkdown } from "../markdown-render.js";
|
|
17
|
+
import {
|
|
18
|
+
uiState,
|
|
19
|
+
makeSessionEventIdentity,
|
|
20
|
+
makeDagNodeInputIdentity,
|
|
21
|
+
makeDagNodeExecutionOutputIdentity,
|
|
22
|
+
getDagNodeExecutionOutputCache,
|
|
23
|
+
setDagNodeExecutionOutputCache,
|
|
24
|
+
clearDagNodeExecutionOutputCache,
|
|
25
|
+
openSpecEvidenceDetail,
|
|
26
|
+
closeSpecEvidenceDetail,
|
|
27
|
+
updateDagTimelineViewportState,
|
|
28
|
+
updateDagOutputViewportState,
|
|
29
|
+
computeFollowLatest,
|
|
30
|
+
isInteractiveGestureActive,
|
|
31
|
+
inspectorViewportRegionKey,
|
|
32
|
+
saveDagInspectorViewportState,
|
|
33
|
+
getDagInspectorViewportState,
|
|
34
|
+
} from "../state.js";
|
|
35
|
+
import {
|
|
36
|
+
formatSessionEventTime,
|
|
37
|
+
renderSessionTimeline,
|
|
38
|
+
} from "./session-timeline.js";
|
|
39
|
+
import { createCustomSelect } from "../custom-select.js";
|
|
40
|
+
|
|
41
|
+
// Current inspector selection. Tab handlers reference this mutable slot so a
|
|
42
|
+
// reused inspector shell never keeps stale node closures: every render writes
|
|
43
|
+
// the latest {dagRunId, node} here and tab clicks re-render from the same
|
|
44
|
+
// reference, always resolving the currently selected node identity.
|
|
45
|
+
const inspectorSelection = { dagRunId: null, node: null };
|
|
46
|
+
|
|
47
|
+
function renderDagInspectorForCurrent() {
|
|
48
|
+
if (!inspectorSelection.dagRunId || !inspectorSelection.node) return;
|
|
49
|
+
renderDagInspector(
|
|
50
|
+
inspectorSelection.dagRunId,
|
|
51
|
+
inspectorSelection.node,
|
|
52
|
+
false,
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function resetInspectorNodeSelection(dagRunId, nodeId) {
|
|
57
|
+
uiState.selectedDagNodeId = nodeId;
|
|
58
|
+
uiState.dagInspectorOpen = true;
|
|
59
|
+
// Reset the per-attempt selection so an old node's attempt cannot leak
|
|
60
|
+
// into the newly selected node (always defaults back to the latest).
|
|
61
|
+
uiState.dagInspectorAttempt = null;
|
|
62
|
+
uiState.sessionEventOffset = 0;
|
|
63
|
+
uiState.sessionEvents = [];
|
|
64
|
+
// Drop any open spec-evidence preview so a stale A detail cannot survive
|
|
65
|
+
// into node B's spec-evidence panel (AC-007 regression guard).
|
|
66
|
+
uiState.specEvidenceDetail = null;
|
|
67
|
+
uiState.specEvidenceListEvidence = null;
|
|
68
|
+
uiState.dagNodeInputData = null;
|
|
69
|
+
uiState.dagNodeInputError = null;
|
|
70
|
+
uiState.dagNodeInputLoading = false;
|
|
71
|
+
// Drop execution-output cache/identity so node A's bodies never leak into B.
|
|
72
|
+
clearDagNodeExecutionOutputCache();
|
|
73
|
+
// Bump the session-event identity token so any in-flight response for the
|
|
74
|
+
// previous node is rejected before it can mutate the current node cache.
|
|
75
|
+
uiState.sessionEventIdentity = makeSessionEventIdentity(dagRunId, nodeId);
|
|
76
|
+
uiState.dagNodeInputIdentity = makeDagNodeInputIdentity(dagRunId, nodeId);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function selectDagNode(dagRunId, nodeId) {
|
|
80
|
+
const nodeChanged = uiState.selectedDagNodeId !== nodeId;
|
|
81
|
+
if (nodeChanged) {
|
|
82
|
+
resetInspectorNodeSelection(dagRunId, nodeId);
|
|
83
|
+
} else {
|
|
84
|
+
uiState.dagInspectorOpen = true;
|
|
85
|
+
}
|
|
86
|
+
void import("./dag.js").then((m) => m.renderDagDetail(dagRunId, false));
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* 从执行轨迹 occurrence 打开同一 Inspector 并选中对应 execution(AC-005)。
|
|
91
|
+
* `executionKey` 为既有 pass-<n> key(@pass-<n> 映射)或 null(@base/@final
|
|
92
|
+
* 默认最新)。uiState.dagInspectorAttempt 跨 poll 保持。
|
|
93
|
+
*/
|
|
94
|
+
export function selectDagExecution(dagRunId, nodeId, executionKey) {
|
|
95
|
+
const nodeChanged = uiState.selectedDagNodeId !== nodeId;
|
|
96
|
+
if (nodeChanged) {
|
|
97
|
+
resetInspectorNodeSelection(dagRunId, nodeId);
|
|
98
|
+
} else {
|
|
99
|
+
uiState.dagInspectorOpen = true;
|
|
100
|
+
}
|
|
101
|
+
uiState.dagInspectorAttempt = {
|
|
102
|
+
dagRunId,
|
|
103
|
+
nodeId,
|
|
104
|
+
key: executionKey ? String(executionKey) : null,
|
|
105
|
+
};
|
|
106
|
+
void import("./dag.js").then((m) => m.renderDagDetail(dagRunId, false));
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export function closeDagInspector() {
|
|
110
|
+
uiState.dagInspectorOpen = false;
|
|
111
|
+
const panel = document.getElementById("dag-inspector");
|
|
112
|
+
if (panel) {
|
|
113
|
+
panel.classList.remove("is-open");
|
|
114
|
+
panel.setAttribute("aria-hidden", "true");
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export function closeDagInspectorOnOutsideClick(event) {
|
|
119
|
+
if (!uiState.dagInspectorOpen || !(event.target instanceof Element)) return;
|
|
120
|
+
if (
|
|
121
|
+
event.target.closest(
|
|
122
|
+
"#dag-inspector, .dag-node-table tbody tr, button, a, input, select, textarea, [role='button'], [role='tab']",
|
|
123
|
+
)
|
|
124
|
+
) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
closeDagInspector();
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export function dagInspectorMaximumWidth() {
|
|
131
|
+
return Math.max(
|
|
132
|
+
DAG_INSPECTOR_MIN_WIDTH,
|
|
133
|
+
Math.min(
|
|
134
|
+
DAG_INSPECTOR_MAX_WIDTH,
|
|
135
|
+
window.innerWidth - DAG_INSPECTOR_VIEWPORT_MARGIN,
|
|
136
|
+
),
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/** Default open width: half the viewport, clamped to min/max. */
|
|
141
|
+
export function dagInspectorDefaultWidth() {
|
|
142
|
+
const half = Math.round(
|
|
143
|
+
window.innerWidth * DAG_INSPECTOR_DEFAULT_WIDTH_RATIO,
|
|
144
|
+
);
|
|
145
|
+
return Math.min(
|
|
146
|
+
dagInspectorMaximumWidth(),
|
|
147
|
+
Math.max(DAG_INSPECTOR_MIN_WIDTH, half || DAG_INSPECTOR_DEFAULT_WIDTH),
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export function setDagInspectorWidth(panel, requestedWidth) {
|
|
152
|
+
const maximum = dagInspectorMaximumWidth();
|
|
153
|
+
uiState.dagInspectorWidth = Math.min(
|
|
154
|
+
maximum,
|
|
155
|
+
Math.max(DAG_INSPECTOR_MIN_WIDTH, Math.round(requestedWidth)),
|
|
156
|
+
);
|
|
157
|
+
panel.style.setProperty(
|
|
158
|
+
"--dag-inspector-width",
|
|
159
|
+
`${uiState.dagInspectorWidth}px`,
|
|
160
|
+
);
|
|
161
|
+
return {
|
|
162
|
+
minimum: DAG_INSPECTOR_MIN_WIDTH,
|
|
163
|
+
maximum,
|
|
164
|
+
value: uiState.dagInspectorWidth,
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export function createDagInspectorResizeHandle(panel) {
|
|
169
|
+
const handle = el("div", "dag-inspector-resize-handle");
|
|
170
|
+
handle.tabIndex = 0;
|
|
171
|
+
handle.setAttribute("role", "separator");
|
|
172
|
+
handle.setAttribute("aria-orientation", "vertical");
|
|
173
|
+
handle.setAttribute("aria-label", "调整节点检查器宽度");
|
|
174
|
+
handle.title = "拖动调整节点检查器宽度";
|
|
175
|
+
|
|
176
|
+
const updateRange = (requestedWidth) => {
|
|
177
|
+
const range = setDagInspectorWidth(
|
|
178
|
+
panel,
|
|
179
|
+
requestedWidth ?? uiState.dagInspectorWidth ?? dagInspectorDefaultWidth(),
|
|
180
|
+
);
|
|
181
|
+
handle.setAttribute("aria-valuemin", String(range.minimum));
|
|
182
|
+
handle.setAttribute("aria-valuemax", String(range.maximum));
|
|
183
|
+
handle.setAttribute("aria-valuenow", String(range.value));
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
updateRange();
|
|
187
|
+
handle.addEventListener("pointerdown", (event) => {
|
|
188
|
+
if (event.button !== 0) return;
|
|
189
|
+
event.preventDefault();
|
|
190
|
+
handle.setPointerCapture(event.pointerId);
|
|
191
|
+
document.body.classList.add("is-resizing-dag-inspector");
|
|
192
|
+
});
|
|
193
|
+
handle.addEventListener("pointermove", (event) => {
|
|
194
|
+
if (!handle.hasPointerCapture(event.pointerId)) return;
|
|
195
|
+
updateRange(window.innerWidth - event.clientX - DAG_INSPECTOR_RIGHT_OFFSET);
|
|
196
|
+
});
|
|
197
|
+
const stopResizing = (event) => {
|
|
198
|
+
if (handle.hasPointerCapture(event.pointerId)) {
|
|
199
|
+
handle.releasePointerCapture(event.pointerId);
|
|
200
|
+
}
|
|
201
|
+
document.body.classList.remove("is-resizing-dag-inspector");
|
|
202
|
+
};
|
|
203
|
+
handle.addEventListener("pointerup", stopResizing);
|
|
204
|
+
handle.addEventListener("pointercancel", stopResizing);
|
|
205
|
+
handle.addEventListener("keydown", (event) => {
|
|
206
|
+
const currentWidth =
|
|
207
|
+
uiState.dagInspectorWidth ?? dagInspectorDefaultWidth();
|
|
208
|
+
if (event.key === "ArrowLeft") {
|
|
209
|
+
event.preventDefault();
|
|
210
|
+
updateRange(currentWidth + DAG_INSPECTOR_KEYBOARD_STEP);
|
|
211
|
+
} else if (event.key === "ArrowRight") {
|
|
212
|
+
event.preventDefault();
|
|
213
|
+
updateRange(currentWidth - DAG_INSPECTOR_KEYBOARD_STEP);
|
|
214
|
+
} else if (event.key === "Home") {
|
|
215
|
+
event.preventDefault();
|
|
216
|
+
updateRange(DAG_INSPECTOR_MIN_WIDTH);
|
|
217
|
+
} else if (event.key === "End") {
|
|
218
|
+
event.preventDefault();
|
|
219
|
+
updateRange(dagInspectorMaximumWidth());
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
return handle;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export function captureDagTimelineViewportState(panel) {
|
|
226
|
+
const scrollEl = panel.querySelector(".process-timeline-scroll");
|
|
227
|
+
if (scrollEl?.dataset.dagRunId && scrollEl.dataset.nodeId) {
|
|
228
|
+
const followLatest = computeFollowLatest(
|
|
229
|
+
scrollEl.scrollTop,
|
|
230
|
+
scrollEl.scrollHeight,
|
|
231
|
+
scrollEl.clientHeight,
|
|
232
|
+
);
|
|
233
|
+
uiState.dagTimelineViewportState = updateDagTimelineViewportState(
|
|
234
|
+
uiState.dagTimelineViewportState,
|
|
235
|
+
scrollEl.dataset.dagRunId,
|
|
236
|
+
scrollEl.dataset.nodeId,
|
|
237
|
+
scrollEl.scrollLeft,
|
|
238
|
+
scrollEl.scrollTop,
|
|
239
|
+
followLatest,
|
|
240
|
+
);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
async function renderSpecEvidence(content, dagRunId, nodeId, cachedEvidence) {
|
|
245
|
+
const evidence =
|
|
246
|
+
cachedEvidence ??
|
|
247
|
+
(await fetchJson(
|
|
248
|
+
`/api/dag-runs/${encodeURIComponent(dagRunId)}/nodes/${encodeURIComponent(nodeId)}/spec-evidence`,
|
|
249
|
+
));
|
|
250
|
+
if (
|
|
251
|
+
!content.isConnected ||
|
|
252
|
+
content.dataset.dagNodeId !== String(nodeId) ||
|
|
253
|
+
content.dataset.dagRunId !== String(dagRunId) ||
|
|
254
|
+
uiState.dagInspectorTab !== "spec-evidence"
|
|
255
|
+
) {
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
if (uiState.specEvidenceDetail) {
|
|
259
|
+
renderSpecEvidenceDetail(content, dagRunId, nodeId);
|
|
260
|
+
restoreInspectorContentScroll(content, dagRunId, nodeId, "spec-evidence");
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
if (!evidence) {
|
|
264
|
+
content.appendChild(el("p", "empty", "无法加载规范证据。"));
|
|
265
|
+
restoreInspectorContentScroll(content, dagRunId, nodeId, "spec-evidence");
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
uiState.specEvidenceListEvidence = evidence;
|
|
269
|
+
|
|
270
|
+
const statusLabels = {
|
|
271
|
+
"spec-read": "已读取规范",
|
|
272
|
+
"source-bound": "已绑定任务源",
|
|
273
|
+
"spec-injected": "仅注入 skill",
|
|
274
|
+
"search-only": "仅执行检索",
|
|
275
|
+
"kb-queried": "已观察知识库查询",
|
|
276
|
+
"no-evidence": "未观察到读取",
|
|
277
|
+
};
|
|
278
|
+
const statusSection = el("div", "spec-evidence-section");
|
|
279
|
+
statusSection.appendChild(el("h4", null, "证据状态"));
|
|
280
|
+
statusSection.appendChild(
|
|
281
|
+
el(
|
|
282
|
+
"span",
|
|
283
|
+
`badge badge-${evidence.status === "spec-read" ? "succeeded" : evidence.status === "no-evidence" ? "failed" : "pending"}`,
|
|
284
|
+
statusLabels[evidence.status] ?? evidence.status,
|
|
285
|
+
),
|
|
286
|
+
);
|
|
287
|
+
if (evidence.summary) {
|
|
288
|
+
statusSection.appendChild(
|
|
289
|
+
el("p", "spec-evidence-summary", evidence.summary),
|
|
290
|
+
);
|
|
291
|
+
}
|
|
292
|
+
content.appendChild(statusSection);
|
|
293
|
+
|
|
294
|
+
const appendListSection = (
|
|
295
|
+
title,
|
|
296
|
+
entries,
|
|
297
|
+
renderEntry,
|
|
298
|
+
emptyMessage = "",
|
|
299
|
+
) => {
|
|
300
|
+
if (!entries?.length && !emptyMessage) return;
|
|
301
|
+
const section = el("div", "spec-evidence-section");
|
|
302
|
+
section.appendChild(el("h4", null, title));
|
|
303
|
+
if (!entries?.length) {
|
|
304
|
+
section.appendChild(el("p", "spec-evidence-summary", emptyMessage));
|
|
305
|
+
content.appendChild(section);
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
const list = el("ul", "spec-evidence-list");
|
|
309
|
+
for (const entry of entries) list.appendChild(renderEntry(entry));
|
|
310
|
+
section.appendChild(list);
|
|
311
|
+
content.appendChild(section);
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
appendListSection(
|
|
315
|
+
"注入的 Skill",
|
|
316
|
+
evidence.skillInjection?.skills,
|
|
317
|
+
(skill) => {
|
|
318
|
+
const item = el("li", null);
|
|
319
|
+
const icon = el("i", "ri-bookmark-line");
|
|
320
|
+
icon.setAttribute("aria-hidden", "true");
|
|
321
|
+
item.append(icon, document.createTextNode(` ${skill}`));
|
|
322
|
+
return item;
|
|
323
|
+
},
|
|
324
|
+
);
|
|
325
|
+
appendListSection(
|
|
326
|
+
"已绑定任务源",
|
|
327
|
+
evidence.sourceBinding?.sources,
|
|
328
|
+
(source) => {
|
|
329
|
+
const item = el("li", null);
|
|
330
|
+
const button = document.createElement("button");
|
|
331
|
+
button.type = "button";
|
|
332
|
+
button.className = "spec-evidence-file-btn";
|
|
333
|
+
button.setAttribute("data-source", "binding");
|
|
334
|
+
button.setAttribute("data-path", source.path);
|
|
335
|
+
button.id = `spec-evidence-btn-binding-${source.path}`;
|
|
336
|
+
const icon = el("i", "ri-links-line");
|
|
337
|
+
icon.setAttribute("aria-hidden", "true");
|
|
338
|
+
button.append(
|
|
339
|
+
icon,
|
|
340
|
+
document.createTextNode(` ${source.kind}: `),
|
|
341
|
+
el("code", null, source.path),
|
|
342
|
+
document.createTextNode(` · sha256 ${source.sha256.slice(0, 12)}…`),
|
|
343
|
+
);
|
|
344
|
+
button.addEventListener("click", () =>
|
|
345
|
+
onSpecEvidenceFileClick(
|
|
346
|
+
content,
|
|
347
|
+
dagRunId,
|
|
348
|
+
nodeId,
|
|
349
|
+
"binding",
|
|
350
|
+
source.path,
|
|
351
|
+
button,
|
|
352
|
+
),
|
|
353
|
+
);
|
|
354
|
+
item.appendChild(button);
|
|
355
|
+
return item;
|
|
356
|
+
},
|
|
357
|
+
);
|
|
358
|
+
appendListSection(
|
|
359
|
+
"显式需求编号",
|
|
360
|
+
evidence.sourceBinding?.requirementIds,
|
|
361
|
+
(id) => el("li", null, id),
|
|
362
|
+
);
|
|
363
|
+
appendListSection(
|
|
364
|
+
`规范已读取(${evidence.specReads?.length ?? 0})`,
|
|
365
|
+
evidence.specReads,
|
|
366
|
+
(read) => {
|
|
367
|
+
const item = el("li", null);
|
|
368
|
+
const button = document.createElement("button");
|
|
369
|
+
button.type = "button";
|
|
370
|
+
button.className = "spec-evidence-file-btn";
|
|
371
|
+
button.setAttribute("data-source", "read");
|
|
372
|
+
button.setAttribute("data-path", read.path);
|
|
373
|
+
if (read.timestamp) {
|
|
374
|
+
button.setAttribute("data-read-at", read.timestamp);
|
|
375
|
+
}
|
|
376
|
+
button.id = `spec-evidence-btn-read-${read.path}`;
|
|
377
|
+
const icon = el("i", "ri-book-open-line");
|
|
378
|
+
icon.setAttribute("aria-hidden", "true");
|
|
379
|
+
button.append(icon, el("code", null, read.path));
|
|
380
|
+
if (read.timestamp) {
|
|
381
|
+
button.appendChild(
|
|
382
|
+
el(
|
|
383
|
+
"span",
|
|
384
|
+
"spec-evidence-time",
|
|
385
|
+
formatSessionEventTime({ timestamp: read.timestamp }),
|
|
386
|
+
),
|
|
387
|
+
);
|
|
388
|
+
}
|
|
389
|
+
button.addEventListener("click", () =>
|
|
390
|
+
onSpecEvidenceFileClick(
|
|
391
|
+
content,
|
|
392
|
+
dagRunId,
|
|
393
|
+
nodeId,
|
|
394
|
+
"read",
|
|
395
|
+
read.path,
|
|
396
|
+
button,
|
|
397
|
+
),
|
|
398
|
+
);
|
|
399
|
+
item.appendChild(button);
|
|
400
|
+
return item;
|
|
401
|
+
},
|
|
402
|
+
"unavailable:未观察到规范读取。",
|
|
403
|
+
);
|
|
404
|
+
appendListSection(
|
|
405
|
+
`规范检索(${evidence.specSearches?.length ?? 0})`,
|
|
406
|
+
evidence.specSearches,
|
|
407
|
+
(search) => {
|
|
408
|
+
const item = el("li", null);
|
|
409
|
+
const icon = el("i", "ri-search-line");
|
|
410
|
+
icon.setAttribute("aria-hidden", "true");
|
|
411
|
+
item.append(
|
|
412
|
+
icon,
|
|
413
|
+
document.createTextNode(` ${search.tool}: ${search.query}`),
|
|
414
|
+
);
|
|
415
|
+
return item;
|
|
416
|
+
},
|
|
417
|
+
"unavailable:未观察到规范检索。",
|
|
418
|
+
);
|
|
419
|
+
appendListSection(
|
|
420
|
+
`知识库查询(${evidence.knowledgeBaseQueries?.length ?? 0})`,
|
|
421
|
+
evidence.knowledgeBaseQueries,
|
|
422
|
+
(query) => {
|
|
423
|
+
const item = el("li", null);
|
|
424
|
+
const icon = el("i", "ri-database-2-line");
|
|
425
|
+
icon.setAttribute("aria-hidden", "true");
|
|
426
|
+
item.append(icon, document.createTextNode(` ${query.connector}`));
|
|
427
|
+
return item;
|
|
428
|
+
},
|
|
429
|
+
"unavailable:未观察到知识库查询;connector 可能未配置或未调用。",
|
|
430
|
+
);
|
|
431
|
+
|
|
432
|
+
if (
|
|
433
|
+
evidence.status === "source-bound" ||
|
|
434
|
+
evidence.status === "spec-injected" ||
|
|
435
|
+
evidence.status === "no-evidence"
|
|
436
|
+
) {
|
|
437
|
+
const warning = el("div", "spec-evidence-warning");
|
|
438
|
+
const icon = el("i", "ri-alert-line");
|
|
439
|
+
icon.setAttribute("aria-hidden", "true");
|
|
440
|
+
warning.append(
|
|
441
|
+
icon,
|
|
442
|
+
document.createTextNode(
|
|
443
|
+
evidence.status === "source-bound"
|
|
444
|
+
? "DAG 已绑定权威任务源及内容哈希,但尚未观察到成功的 read 工具调用;绑定证明上下文来源,read 事件才证明节点读取了完整文件。"
|
|
445
|
+
: evidence.status === "no-evidence"
|
|
446
|
+
? "未观察到规范读取。只有 session event 中成功配对的 read 工具调用才算已读取,模型总结或文件名命中不能作为证明。"
|
|
447
|
+
: "规范 skill 已注入,但未观察到规范读取或知识库查询;grep/find/ls 只能证明检索,不能替代 read。",
|
|
448
|
+
),
|
|
449
|
+
);
|
|
450
|
+
content.appendChild(warning);
|
|
451
|
+
}
|
|
452
|
+
restoreInspectorContentScroll(content, dagRunId, nodeId, "spec-evidence");
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* Click handler for spec-evidence file buttons (AC-001/002). Opens the detail
|
|
457
|
+
* view in the same spec-evidence panel (no modal), records the trigger button
|
|
458
|
+
* so the back action can restore keyboard focus (AC-005).
|
|
459
|
+
*/
|
|
460
|
+
function onSpecEvidenceFileClick(
|
|
461
|
+
content,
|
|
462
|
+
dagRunId,
|
|
463
|
+
nodeId,
|
|
464
|
+
source,
|
|
465
|
+
relPath,
|
|
466
|
+
button,
|
|
467
|
+
) {
|
|
468
|
+
openSpecEvidenceDetail(source, relPath, button);
|
|
469
|
+
clearNode(content);
|
|
470
|
+
const detail = uiState.specEvidenceDetail;
|
|
471
|
+
renderSpecEvidenceDetail(content, dagRunId, nodeId);
|
|
472
|
+
void (async () => {
|
|
473
|
+
try {
|
|
474
|
+
const data = await fetchSpecEvidenceFile(
|
|
475
|
+
dagRunId,
|
|
476
|
+
nodeId,
|
|
477
|
+
source,
|
|
478
|
+
relPath,
|
|
479
|
+
);
|
|
480
|
+
if (
|
|
481
|
+
!content.isConnected ||
|
|
482
|
+
content.dataset.dagNodeId !== String(nodeId) ||
|
|
483
|
+
!uiState.specEvidenceDetail ||
|
|
484
|
+
uiState.specEvidenceDetail.source !== source ||
|
|
485
|
+
uiState.specEvidenceDetail.path !== relPath
|
|
486
|
+
) {
|
|
487
|
+
return;
|
|
488
|
+
}
|
|
489
|
+
detail.loading = false;
|
|
490
|
+
detail.data = data;
|
|
491
|
+
} catch (error) {
|
|
492
|
+
if (
|
|
493
|
+
!content.isConnected ||
|
|
494
|
+
content.dataset.dagNodeId !== String(nodeId) ||
|
|
495
|
+
!uiState.specEvidenceDetail ||
|
|
496
|
+
uiState.specEvidenceDetail.source !== source ||
|
|
497
|
+
uiState.specEvidenceDetail.path !== relPath
|
|
498
|
+
) {
|
|
499
|
+
return;
|
|
500
|
+
}
|
|
501
|
+
detail.loading = false;
|
|
502
|
+
detail.error = error instanceof Error ? error.message : String(error);
|
|
503
|
+
}
|
|
504
|
+
renderSpecEvidenceDetail(content, dagRunId, nodeId);
|
|
505
|
+
})();
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
/**
|
|
509
|
+
* Render the in-inspector file preview (AC-005). Single scroll container for
|
|
510
|
+
* the body, always-visible back button, and accessible loading/error states.
|
|
511
|
+
*/
|
|
512
|
+
function renderSpecEvidenceDetail(content, dagRunId, nodeId) {
|
|
513
|
+
const detail = uiState.specEvidenceDetail;
|
|
514
|
+
clearNode(content);
|
|
515
|
+
if (!detail) {
|
|
516
|
+
renderSpecEvidence(
|
|
517
|
+
content,
|
|
518
|
+
dagRunId,
|
|
519
|
+
nodeId,
|
|
520
|
+
uiState.specEvidenceListEvidence,
|
|
521
|
+
);
|
|
522
|
+
return;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
const wrapper = el("div", "spec-evidence-detail");
|
|
526
|
+
const back = document.createElement("button");
|
|
527
|
+
back.type = "button";
|
|
528
|
+
back.className = "spec-evidence-back";
|
|
529
|
+
back.setAttribute("aria-label", "返回规范证据");
|
|
530
|
+
const backIcon = el("i", "ri-arrow-left-line");
|
|
531
|
+
backIcon.setAttribute("aria-hidden", "true");
|
|
532
|
+
back.append(backIcon, document.createTextNode(" 返回规范证据"));
|
|
533
|
+
back.addEventListener("click", () => {
|
|
534
|
+
const closed = closeSpecEvidenceDetail();
|
|
535
|
+
clearNode(content);
|
|
536
|
+
// Restore the list synchronously from the cached evidence so the user
|
|
537
|
+
// sees no flicker and the trigger button is immediately focusable.
|
|
538
|
+
renderSpecEvidence(
|
|
539
|
+
content,
|
|
540
|
+
dagRunId,
|
|
541
|
+
nodeId,
|
|
542
|
+
uiState.specEvidenceListEvidence,
|
|
543
|
+
);
|
|
544
|
+
if (closed?.triggerId) {
|
|
545
|
+
const trigger = document.getElementById(closed.triggerId);
|
|
546
|
+
trigger?.focus();
|
|
547
|
+
}
|
|
548
|
+
});
|
|
549
|
+
wrapper.appendChild(back);
|
|
550
|
+
|
|
551
|
+
const meta = el("div", "spec-evidence-detail-meta");
|
|
552
|
+
meta.appendChild(el("code", null, detail.path));
|
|
553
|
+
if (detail.source === "binding" && detail.data) {
|
|
554
|
+
meta.appendChild(
|
|
555
|
+
el(
|
|
556
|
+
"span",
|
|
557
|
+
"spec-evidence-detail-hash",
|
|
558
|
+
`绑定 sha256 ${String(detail.data.sha256 ?? "").slice(0, 12)}… · 当前 ${detail.data.hashMatch ? "一致" : "不一致"}`,
|
|
559
|
+
),
|
|
560
|
+
);
|
|
561
|
+
} else if (detail.source === "read" && detail.data?.readAt) {
|
|
562
|
+
meta.appendChild(
|
|
563
|
+
el(
|
|
564
|
+
"span",
|
|
565
|
+
"spec-evidence-detail-time",
|
|
566
|
+
`读取于 ${formatSessionEventTime({ timestamp: detail.data.readAt })}`,
|
|
567
|
+
),
|
|
568
|
+
);
|
|
569
|
+
}
|
|
570
|
+
wrapper.appendChild(meta);
|
|
571
|
+
|
|
572
|
+
if (detail.loading) {
|
|
573
|
+
const loading = el("p", "muted", "正在加载文件内容…");
|
|
574
|
+
loading.setAttribute("role", "status");
|
|
575
|
+
loading.setAttribute("aria-live", "polite");
|
|
576
|
+
wrapper.appendChild(loading);
|
|
577
|
+
} else if (detail.error) {
|
|
578
|
+
const error = el(
|
|
579
|
+
"p",
|
|
580
|
+
"spec-evidence-detail-error",
|
|
581
|
+
`加载失败:${detail.error}`,
|
|
582
|
+
);
|
|
583
|
+
error.setAttribute("role", "alert");
|
|
584
|
+
wrapper.appendChild(error);
|
|
585
|
+
} else if (detail.data) {
|
|
586
|
+
const body = el("div", "spec-evidence-detail-content");
|
|
587
|
+
body.appendChild(renderMarkdown(detail.data.content ?? ""));
|
|
588
|
+
wrapper.appendChild(body);
|
|
589
|
+
if (detail.data.truncated) {
|
|
590
|
+
const note = el(
|
|
591
|
+
"p",
|
|
592
|
+
"spec-evidence-detail-truncated",
|
|
593
|
+
`已截断,仅显示前 ${detail.data.maxBytes ?? 0} 字节。`,
|
|
594
|
+
);
|
|
595
|
+
wrapper.appendChild(note);
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
content.appendChild(wrapper);
|
|
599
|
+
restoreInspectorContentScroll(content, dagRunId, nodeId, "spec-evidence");
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
function sourceLabel(source) {
|
|
603
|
+
if (source === "defaults") return "继承默认值";
|
|
604
|
+
if (source === "schema-default") return "schema 默认";
|
|
605
|
+
if (source === "merged") return "合并";
|
|
606
|
+
return null;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
function appendMetaRow(dl, label, value, source) {
|
|
610
|
+
if (value == null || value === "") return;
|
|
611
|
+
const dt = el("dt", null, label);
|
|
612
|
+
const dd = el("dd", null, String(value));
|
|
613
|
+
const inherited = sourceLabel(source);
|
|
614
|
+
if (inherited) {
|
|
615
|
+
dd.appendChild(document.createTextNode(" "));
|
|
616
|
+
dd.appendChild(el("span", "node-input-inherited", inherited));
|
|
617
|
+
}
|
|
618
|
+
dl.appendChild(dt);
|
|
619
|
+
dl.appendChild(dd);
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
function appendCodeList(parent, title, values) {
|
|
623
|
+
if (!values || values.length === 0) return;
|
|
624
|
+
const section = el("section", "node-input-section");
|
|
625
|
+
section.appendChild(el("h4", null, title));
|
|
626
|
+
const list = el("ul", "node-input-code-list");
|
|
627
|
+
for (const value of values) {
|
|
628
|
+
const item = document.createElement("li");
|
|
629
|
+
const code = document.createElement("code");
|
|
630
|
+
code.textContent = String(value);
|
|
631
|
+
item.appendChild(code);
|
|
632
|
+
list.appendChild(item);
|
|
633
|
+
}
|
|
634
|
+
section.appendChild(list);
|
|
635
|
+
parent.appendChild(section);
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
function renderDagNodeInputDetail(content, data) {
|
|
639
|
+
const wrap = el("div", "node-input-root");
|
|
640
|
+
wrap.appendChild(el("p", "node-input-semantics", UI_TEXT.inputFrozenLabel));
|
|
641
|
+
|
|
642
|
+
if (data.summary) {
|
|
643
|
+
const section = el("section", "node-input-section");
|
|
644
|
+
section.appendChild(el("h4", null, "摘要"));
|
|
645
|
+
const dl = el("dl", "node-input-summary");
|
|
646
|
+
appendMetaRow(
|
|
647
|
+
dl,
|
|
648
|
+
"executor",
|
|
649
|
+
data.summary.executor,
|
|
650
|
+
data.summary.executorSource,
|
|
651
|
+
);
|
|
652
|
+
appendMetaRow(dl, "role", data.summary.role, null);
|
|
653
|
+
appendMetaRow(dl, "complexity", data.summary.complexity, null);
|
|
654
|
+
appendMetaRow(
|
|
655
|
+
dl,
|
|
656
|
+
"writePolicy",
|
|
657
|
+
data.summary.writePolicy,
|
|
658
|
+
data.summary.writePolicySource,
|
|
659
|
+
);
|
|
660
|
+
appendMetaRow(dl, "toolProfile", data.summary.toolProfile, null);
|
|
661
|
+
section.appendChild(dl);
|
|
662
|
+
wrap.appendChild(section);
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
if (data.dependency) {
|
|
666
|
+
const section = el("section", "node-input-section");
|
|
667
|
+
section.appendChild(el("h4", null, "依赖"));
|
|
668
|
+
const dl = el("dl", "node-input-summary");
|
|
669
|
+
appendMetaRow(
|
|
670
|
+
dl,
|
|
671
|
+
"depends_on",
|
|
672
|
+
(data.dependency.dependsOn ?? []).join(", ") || "(none)",
|
|
673
|
+
null,
|
|
674
|
+
);
|
|
675
|
+
if (data.dependency.dependsPolicy) {
|
|
676
|
+
appendMetaRow(dl, "dependsPolicy", data.dependency.dependsPolicy, null);
|
|
677
|
+
}
|
|
678
|
+
if ((data.dependency.failureAwareDependsOn ?? []).length > 0) {
|
|
679
|
+
appendMetaRow(
|
|
680
|
+
dl,
|
|
681
|
+
"failureAwareDependsOn",
|
|
682
|
+
data.dependency.failureAwareDependsOn.join(", "),
|
|
683
|
+
null,
|
|
684
|
+
);
|
|
685
|
+
}
|
|
686
|
+
if (data.dependency.runIf) {
|
|
687
|
+
appendMetaRow(dl, "runIf", data.dependency.runIf, null);
|
|
688
|
+
}
|
|
689
|
+
section.appendChild(dl);
|
|
690
|
+
wrap.appendChild(section);
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
if (data.prompt) {
|
|
694
|
+
const section = el("section", "node-input-section");
|
|
695
|
+
section.appendChild(el("h4", null, "任务正文"));
|
|
696
|
+
if (data.prompt.source?.path) {
|
|
697
|
+
const meta = el("p", "muted");
|
|
698
|
+
meta.textContent = `source: ${data.prompt.source.path}${
|
|
699
|
+
data.prompt.source.sha256Prefix
|
|
700
|
+
? ` (sha256 ${data.prompt.source.sha256Prefix}…)`
|
|
701
|
+
: ""
|
|
702
|
+
}`;
|
|
703
|
+
section.appendChild(meta);
|
|
704
|
+
}
|
|
705
|
+
section.appendChild(renderMarkdown(data.prompt.text ?? ""));
|
|
706
|
+
if (data.prompt.truncated) {
|
|
707
|
+
section.appendChild(
|
|
708
|
+
el(
|
|
709
|
+
"p",
|
|
710
|
+
"node-input-truncated",
|
|
711
|
+
`已截断,仅显示前 ${data.prompt.maxBytes ?? 0} 字节(UTF-8)。`,
|
|
712
|
+
),
|
|
713
|
+
);
|
|
714
|
+
}
|
|
715
|
+
wrap.appendChild(section);
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
if (data.executorInput) {
|
|
719
|
+
const section = el("section", "node-input-section");
|
|
720
|
+
section.appendChild(el("h4", null, "执行器输入摘要"));
|
|
721
|
+
const dl = el("dl", "node-input-summary");
|
|
722
|
+
appendMetaRow(dl, "kind", data.executorInput.kind, null);
|
|
723
|
+
if (data.executorInput.modelHint) {
|
|
724
|
+
appendMetaRow(dl, "modelHint", data.executorInput.modelHint, null);
|
|
725
|
+
}
|
|
726
|
+
section.appendChild(dl);
|
|
727
|
+
appendCodeList(section, "skills", data.executorInput.skills);
|
|
728
|
+
if (data.executorInput.shell) {
|
|
729
|
+
const shell = data.executorInput.shell;
|
|
730
|
+
const shellDl = el("dl", "node-input-summary");
|
|
731
|
+
appendMetaRow(shellDl, "preset", shell.preset, null);
|
|
732
|
+
appendMetaRow(shellDl, "cwd", shell.cwd, null);
|
|
733
|
+
appendMetaRow(shellDl, "timeoutMs", shell.timeoutMs, null);
|
|
734
|
+
appendMetaRow(
|
|
735
|
+
shellDl,
|
|
736
|
+
"nonZeroExitPolicy",
|
|
737
|
+
shell.nonZeroExitPolicy,
|
|
738
|
+
null,
|
|
739
|
+
);
|
|
740
|
+
appendMetaRow(
|
|
741
|
+
shellDl,
|
|
742
|
+
"gates",
|
|
743
|
+
(shell.gates ?? []).join(", ") || "(none)",
|
|
744
|
+
null,
|
|
745
|
+
);
|
|
746
|
+
section.appendChild(shellDl);
|
|
747
|
+
if ((shell.commands ?? []).length > 0) {
|
|
748
|
+
const list = el("ol", "node-input-command-list");
|
|
749
|
+
for (const command of shell.commands) {
|
|
750
|
+
const item = document.createElement("li");
|
|
751
|
+
const pre = document.createElement("pre");
|
|
752
|
+
const code = document.createElement("code");
|
|
753
|
+
code.textContent = String(command);
|
|
754
|
+
pre.appendChild(code);
|
|
755
|
+
item.appendChild(pre);
|
|
756
|
+
list.appendChild(item);
|
|
757
|
+
}
|
|
758
|
+
section.appendChild(list);
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
if (data.executorInput.static) {
|
|
762
|
+
const staticBlock = data.executorInput.static;
|
|
763
|
+
const staticDl = el("dl", "node-input-summary");
|
|
764
|
+
appendMetaRow(staticDl, "status", staticBlock.status, null);
|
|
765
|
+
section.appendChild(staticDl);
|
|
766
|
+
section.appendChild(renderMarkdown(staticBlock.resultPreview ?? ""));
|
|
767
|
+
if (staticBlock.truncated) {
|
|
768
|
+
section.appendChild(
|
|
769
|
+
el(
|
|
770
|
+
"p",
|
|
771
|
+
"node-input-truncated",
|
|
772
|
+
`已截断,仅显示前 ${staticBlock.maxBytes ?? 0} 字节(UTF-8)。`,
|
|
773
|
+
),
|
|
774
|
+
);
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
wrap.appendChild(section);
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
if (data.boundaries) {
|
|
781
|
+
const section = el("section", "node-input-section");
|
|
782
|
+
section.appendChild(el("h4", null, "边界与输出契约"));
|
|
783
|
+
const dl = el("dl", "node-input-summary");
|
|
784
|
+
appendMetaRow(dl, "outputMode", data.boundaries.outputMode, null);
|
|
785
|
+
appendMetaRow(
|
|
786
|
+
dl,
|
|
787
|
+
"firstProtocolLine",
|
|
788
|
+
data.boundaries.firstProtocolLine,
|
|
789
|
+
null,
|
|
790
|
+
);
|
|
791
|
+
section.appendChild(dl);
|
|
792
|
+
if (data.boundaries.outputContract) {
|
|
793
|
+
section.appendChild(el("h5", null, "outputContract"));
|
|
794
|
+
section.appendChild(renderMarkdown(data.boundaries.outputContract));
|
|
795
|
+
}
|
|
796
|
+
appendCodeList(section, "allowedPaths", data.boundaries.allowedPaths);
|
|
797
|
+
appendCodeList(section, "forbiddenPaths", data.boundaries.forbiddenPaths);
|
|
798
|
+
appendCodeList(section, "writeSet", data.boundaries.writeSet);
|
|
799
|
+
wrap.appendChild(section);
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
if (data.promptFingerprint?.exists) {
|
|
803
|
+
const section = el("section", "node-input-section");
|
|
804
|
+
section.appendChild(el("h4", null, "Assembled prompt 指纹"));
|
|
805
|
+
const dl = el("dl", "node-input-summary");
|
|
806
|
+
appendMetaRow(
|
|
807
|
+
dl,
|
|
808
|
+
"sha256",
|
|
809
|
+
data.promptFingerprint.sha256Prefix ?? "(parse failed)",
|
|
810
|
+
null,
|
|
811
|
+
);
|
|
812
|
+
appendMetaRow(dl, "lengthChars", data.promptFingerprint.lengthChars, null);
|
|
813
|
+
appendMetaRow(dl, "artifact", data.promptFingerprint.artifact, null);
|
|
814
|
+
section.appendChild(dl);
|
|
815
|
+
section.appendChild(el("p", "muted", UI_TEXT.inputFingerprintNote));
|
|
816
|
+
wrap.appendChild(section);
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
if ((data.warnings ?? []).length > 0) {
|
|
820
|
+
const section = el("section", "node-input-section");
|
|
821
|
+
section.appendChild(el("h4", null, "警告"));
|
|
822
|
+
for (const warning of data.warnings) {
|
|
823
|
+
section.appendChild(el("p", "node-input-warning", String(warning)));
|
|
824
|
+
}
|
|
825
|
+
wrap.appendChild(section);
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
content.appendChild(wrap);
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
function unavailableMessage(reason) {
|
|
832
|
+
if (reason === "unsupported-dynamic-node") {
|
|
833
|
+
return UI_TEXT.inputDynamicUnsupported;
|
|
834
|
+
}
|
|
835
|
+
if (reason === "run-spec-unavailable") {
|
|
836
|
+
return UI_TEXT.inputRunSpecUnavailable;
|
|
837
|
+
}
|
|
838
|
+
if (reason === "task-not-found") {
|
|
839
|
+
return UI_TEXT.inputUnavailable;
|
|
840
|
+
}
|
|
841
|
+
return UI_TEXT.noInput;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
async function renderDagNodeInput(content, dagRunId, node) {
|
|
845
|
+
const nodeId = node.nodeId;
|
|
846
|
+
const identity = makeDagNodeInputIdentity(dagRunId, nodeId);
|
|
847
|
+
uiState.dagNodeInputIdentity = identity;
|
|
848
|
+
uiState.dagNodeInputLoading = true;
|
|
849
|
+
uiState.dagNodeInputError = null;
|
|
850
|
+
|
|
851
|
+
// Preserve prior intent scroll across the short loading shell (AC-004).
|
|
852
|
+
saveInspectorContentScroll(content, dagRunId, nodeId, "input", {
|
|
853
|
+
preserveIntent: true,
|
|
854
|
+
});
|
|
855
|
+
clearNode(content);
|
|
856
|
+
const loading = el("p", "muted", UI_TEXT.inputLoading);
|
|
857
|
+
loading.setAttribute("role", "status");
|
|
858
|
+
loading.setAttribute("aria-live", "polite");
|
|
859
|
+
content.appendChild(loading);
|
|
860
|
+
|
|
861
|
+
const result = await fetchDagNodeInput(dagRunId, nodeId);
|
|
862
|
+
if (
|
|
863
|
+
uiState.dagNodeInputIdentity !== identity ||
|
|
864
|
+
uiState.selectedDagNodeId !== nodeId ||
|
|
865
|
+
uiState.currentDagRunId !== dagRunId ||
|
|
866
|
+
uiState.dagInspectorTab !== "input" ||
|
|
867
|
+
!content.isConnected ||
|
|
868
|
+
content.dataset.dagNodeId !== String(nodeId) ||
|
|
869
|
+
content.dataset.dagRunId !== String(dagRunId)
|
|
870
|
+
) {
|
|
871
|
+
return;
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
clearNode(content);
|
|
875
|
+
const finishInputRender = () => {
|
|
876
|
+
restoreInspectorContentScroll(content, dagRunId, nodeId, "input");
|
|
877
|
+
uiState.dagNodeInputLoading = false;
|
|
878
|
+
};
|
|
879
|
+
|
|
880
|
+
if (!result.ok) {
|
|
881
|
+
const message =
|
|
882
|
+
result.body?.error ||
|
|
883
|
+
(result.status === 0
|
|
884
|
+
? UI_TEXT.inputError
|
|
885
|
+
: `${UI_TEXT.inputError}(HTTP ${result.status})`);
|
|
886
|
+
uiState.dagNodeInputError = message;
|
|
887
|
+
uiState.dagNodeInputData = null;
|
|
888
|
+
const error = el("p", "node-input-error", message);
|
|
889
|
+
error.setAttribute("role", "alert");
|
|
890
|
+
content.appendChild(error);
|
|
891
|
+
finishInputRender();
|
|
892
|
+
return;
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
const data = result.body;
|
|
896
|
+
uiState.dagNodeInputData = data;
|
|
897
|
+
uiState.dagNodeInputError = null;
|
|
898
|
+
if (!data?.available) {
|
|
899
|
+
const empty = el(
|
|
900
|
+
"p",
|
|
901
|
+
"empty",
|
|
902
|
+
unavailableMessage(data?.availabilityReason),
|
|
903
|
+
);
|
|
904
|
+
empty.setAttribute("role", "status");
|
|
905
|
+
content.appendChild(empty);
|
|
906
|
+
if ((data?.warnings ?? []).length > 0) {
|
|
907
|
+
for (const warning of data.warnings) {
|
|
908
|
+
content.appendChild(el("p", "node-input-warning", String(warning)));
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
finishInputRender();
|
|
912
|
+
return;
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
renderDagNodeInputDetail(content, data);
|
|
916
|
+
finishInputRender();
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
function activeInspectorTab() {
|
|
920
|
+
return ["input", "timeline", "spec-evidence"].includes(
|
|
921
|
+
uiState.dagInspectorTab,
|
|
922
|
+
)
|
|
923
|
+
? uiState.dagInspectorTab
|
|
924
|
+
: "output";
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
function saveInspectorContentScroll(
|
|
928
|
+
content,
|
|
929
|
+
dagRunId,
|
|
930
|
+
nodeId,
|
|
931
|
+
tab,
|
|
932
|
+
options = {},
|
|
933
|
+
) {
|
|
934
|
+
if (!content) return null;
|
|
935
|
+
const regionKey = inspectorViewportRegionKey(dagRunId, nodeId, tab);
|
|
936
|
+
const saved = saveDagInspectorViewportState(
|
|
937
|
+
regionKey,
|
|
938
|
+
content.scrollLeft,
|
|
939
|
+
content.scrollTop,
|
|
940
|
+
options,
|
|
941
|
+
);
|
|
942
|
+
if (tab === "input") {
|
|
943
|
+
uiState.dagNodeInputViewportState = updateDagOutputViewportState(
|
|
944
|
+
uiState.dagNodeInputViewportState,
|
|
945
|
+
regionKey,
|
|
946
|
+
saved?.scrollLeft ?? 0,
|
|
947
|
+
saved?.scrollTop ?? 0,
|
|
948
|
+
false,
|
|
949
|
+
);
|
|
950
|
+
} else if (tab === "output") {
|
|
951
|
+
const followLatest = computeFollowLatest(
|
|
952
|
+
content.scrollTop,
|
|
953
|
+
content.scrollHeight,
|
|
954
|
+
content.clientHeight,
|
|
955
|
+
);
|
|
956
|
+
uiState.dagNodeOutputViewportState = updateDagOutputViewportState(
|
|
957
|
+
uiState.dagNodeOutputViewportState,
|
|
958
|
+
regionKey,
|
|
959
|
+
content.scrollLeft,
|
|
960
|
+
content.scrollTop,
|
|
961
|
+
followLatest,
|
|
962
|
+
);
|
|
963
|
+
} else if (tab === "spec-evidence") {
|
|
964
|
+
uiState.dagNodeSpecEvidenceViewportState = saved;
|
|
965
|
+
}
|
|
966
|
+
return saved;
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
function restoreInspectorContentScroll(content, dagRunId, nodeId, tab) {
|
|
970
|
+
if (!content) return;
|
|
971
|
+
const regionKey = inspectorViewportRegionKey(dagRunId, nodeId, tab);
|
|
972
|
+
const apply = () => {
|
|
973
|
+
if (
|
|
974
|
+
!content.isConnected ||
|
|
975
|
+
content.dataset.dagNodeId !== String(nodeId ?? "") ||
|
|
976
|
+
content.dataset.dagRunId !== String(dagRunId ?? "") ||
|
|
977
|
+
activeInspectorTab() !== tab
|
|
978
|
+
) {
|
|
979
|
+
return;
|
|
980
|
+
}
|
|
981
|
+
if (tab === "output") {
|
|
982
|
+
const saved = uiState.dagNodeOutputViewportState;
|
|
983
|
+
if (saved?.regionKey === regionKey && saved.followLatest) {
|
|
984
|
+
content.scrollTop = content.scrollHeight;
|
|
985
|
+
content.scrollLeft = saved.scrollLeft ?? 0;
|
|
986
|
+
return;
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
const saved =
|
|
990
|
+
getDagInspectorViewportState(regionKey) ??
|
|
991
|
+
(tab === "input" &&
|
|
992
|
+
uiState.dagNodeInputViewportState?.regionKey === regionKey
|
|
993
|
+
? uiState.dagNodeInputViewportState
|
|
994
|
+
: null) ??
|
|
995
|
+
(tab === "output" &&
|
|
996
|
+
uiState.dagNodeOutputViewportState?.regionKey === regionKey
|
|
997
|
+
? uiState.dagNodeOutputViewportState
|
|
998
|
+
: null) ??
|
|
999
|
+
(tab === "spec-evidence" &&
|
|
1000
|
+
uiState.dagNodeSpecEvidenceViewportState?.regionKey === regionKey
|
|
1001
|
+
? uiState.dagNodeSpecEvidenceViewportState
|
|
1002
|
+
: null);
|
|
1003
|
+
content.scrollLeft = saved?.scrollLeft ?? 0;
|
|
1004
|
+
content.scrollTop = saved?.scrollTop ?? 0;
|
|
1005
|
+
};
|
|
1006
|
+
apply();
|
|
1007
|
+
if (typeof requestAnimationFrame === "function") {
|
|
1008
|
+
requestAnimationFrame(apply);
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
function ensureInspectorContentScrollCapture(content, dagRunId, nodeId, tab) {
|
|
1013
|
+
if (!content || content.dataset.scrollCaptureBound === "1") return;
|
|
1014
|
+
content.dataset.scrollCaptureBound = "1";
|
|
1015
|
+
content.addEventListener(
|
|
1016
|
+
"scroll",
|
|
1017
|
+
() => {
|
|
1018
|
+
const runId = content.dataset.dagRunId;
|
|
1019
|
+
const nId = content.dataset.dagNodeId;
|
|
1020
|
+
const active = activeInspectorTab();
|
|
1021
|
+
if (!runId || !nId || !active) return;
|
|
1022
|
+
saveInspectorContentScroll(content, runId, nId, active, {
|
|
1023
|
+
// Clearing a tall input pane for its loading shell can emit a native
|
|
1024
|
+
// scroll-to-zero event. Preserve the user's prior intent until the
|
|
1025
|
+
// asynchronous content has been restored.
|
|
1026
|
+
preserveIntent:
|
|
1027
|
+
active === "input" && Boolean(uiState.dagNodeInputLoading),
|
|
1028
|
+
});
|
|
1029
|
+
},
|
|
1030
|
+
{ passive: true },
|
|
1031
|
+
);
|
|
1032
|
+
// Touch current context so callers always have a key even before first scroll.
|
|
1033
|
+
saveInspectorContentScroll(content, dagRunId, nodeId, tab, {
|
|
1034
|
+
preserveIntent: true,
|
|
1035
|
+
});
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
function attemptPreviewStatus(status) {
|
|
1039
|
+
if (!status) return null;
|
|
1040
|
+
const normalized = String(status).toLowerCase();
|
|
1041
|
+
if (
|
|
1042
|
+
["success", "finished", "completed", "succeeded", "done"].includes(
|
|
1043
|
+
normalized,
|
|
1044
|
+
)
|
|
1045
|
+
) {
|
|
1046
|
+
return { cls: "succeeded", label: "成功" };
|
|
1047
|
+
}
|
|
1048
|
+
if (
|
|
1049
|
+
[
|
|
1050
|
+
"failure",
|
|
1051
|
+
"failed",
|
|
1052
|
+
"error",
|
|
1053
|
+
"partial_failed",
|
|
1054
|
+
"partial-failed",
|
|
1055
|
+
"interrupted",
|
|
1056
|
+
].includes(normalized)
|
|
1057
|
+
) {
|
|
1058
|
+
return { cls: "failed", label: "失败" };
|
|
1059
|
+
}
|
|
1060
|
+
return null;
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
/**
|
|
1064
|
+
* Attempt selector options for a node: per-attempt when attempts>1,
|
|
1065
|
+
* per-pass when convergence passes>1, none otherwise (legacy/single).
|
|
1066
|
+
* 主文案为中文:首次尝试 / 第 N 次尝试 / 初始执行 / 修复轮次 N-1
|
|
1067
|
+
* (AC-001/AC-002);option value 保持 raw attempt-<n>/pass-<n>(AC-003)。
|
|
1068
|
+
*/
|
|
1069
|
+
function attemptSelectorOptions(node) {
|
|
1070
|
+
const summary = node.executionSummary;
|
|
1071
|
+
if (summary?.attempts && summary.attempts.length > 1) {
|
|
1072
|
+
return summary.attempts.map((attempt) => ({
|
|
1073
|
+
key: `attempt-${attempt.attempt}`,
|
|
1074
|
+
label:
|
|
1075
|
+
attempt.attempt === 1 ? "首次尝试" : `第 ${attempt.attempt} 次尝试`,
|
|
1076
|
+
preview: attempt,
|
|
1077
|
+
}));
|
|
1078
|
+
}
|
|
1079
|
+
const passes = node.passes ?? [];
|
|
1080
|
+
if (passes.length > 1) {
|
|
1081
|
+
const passPreviews = summary?.passes ?? [];
|
|
1082
|
+
return passes.map((pass) => {
|
|
1083
|
+
const preview = passPreviews.find((entry) => entry.pass === pass) ?? {
|
|
1084
|
+
pass,
|
|
1085
|
+
};
|
|
1086
|
+
// 仅显示文案做人类轮次映射:raw pass=1 → 初始执行,raw pass>=2 →
|
|
1087
|
+
// 修复轮次 N-1(AC-001/AC-002);option value 保持 raw pass-<n>(AC-003)。
|
|
1088
|
+
return {
|
|
1089
|
+
key: `pass-${pass}`,
|
|
1090
|
+
label: pass <= 1 ? "初始执行" : `修复轮次 ${pass - 1}`,
|
|
1091
|
+
preview,
|
|
1092
|
+
};
|
|
1093
|
+
});
|
|
1094
|
+
}
|
|
1095
|
+
return [];
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
/** Selected attempt key for the current node; null = latest. */
|
|
1099
|
+
function resolveSelectedAttemptKey(dagRunId, node) {
|
|
1100
|
+
const selection = uiState.dagInspectorAttempt;
|
|
1101
|
+
if (
|
|
1102
|
+
selection &&
|
|
1103
|
+
selection.dagRunId === dagRunId &&
|
|
1104
|
+
selection.nodeId === node.nodeId
|
|
1105
|
+
) {
|
|
1106
|
+
return selection.key;
|
|
1107
|
+
}
|
|
1108
|
+
return null;
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1111
|
+
/**
|
|
1112
|
+
* Sticky selector + preview strip shown at the top of output/timeline tabs
|
|
1113
|
+
* when the node carries multi-attempt (or multi-pass) history. Preview shows
|
|
1114
|
+
* status badge / failureCategory / durationMs for the selected attempt; for a
|
|
1115
|
+
* non-latest attempt the full body stays in the immutable attempt artifact.
|
|
1116
|
+
*/
|
|
1117
|
+
function buildAttemptBar(dagRunId, node) {
|
|
1118
|
+
const options = attemptSelectorOptions(node);
|
|
1119
|
+
if (options.length === 0) return null;
|
|
1120
|
+
const latestKey = options[options.length - 1].key;
|
|
1121
|
+
const requestedKey = resolveSelectedAttemptKey(dagRunId, node);
|
|
1122
|
+
const selectedKey = options.some((option) => option.key === requestedKey)
|
|
1123
|
+
? requestedKey
|
|
1124
|
+
: latestKey;
|
|
1125
|
+
|
|
1126
|
+
const bar = el("div", "dag-inspector-attempt-bar");
|
|
1127
|
+
bar.appendChild(el("label", "dag-inspector-attempt-label", "执行分次"));
|
|
1128
|
+
const select = createCustomSelect({
|
|
1129
|
+
ariaLabel: "选择执行分次",
|
|
1130
|
+
className: "dag-inspector-attempt-select",
|
|
1131
|
+
value: selectedKey,
|
|
1132
|
+
options: options.map((option) => ({
|
|
1133
|
+
value: option.key,
|
|
1134
|
+
label: option.label,
|
|
1135
|
+
})),
|
|
1136
|
+
onChange: (nextKey) => {
|
|
1137
|
+
uiState.dagInspectorAttempt = {
|
|
1138
|
+
dagRunId,
|
|
1139
|
+
nodeId: node.nodeId,
|
|
1140
|
+
key: String(nextKey),
|
|
1141
|
+
};
|
|
1142
|
+
renderDagInspectorForCurrent();
|
|
1143
|
+
},
|
|
1144
|
+
});
|
|
1145
|
+
// Keep raw key on the root for existing integration assertions that read
|
|
1146
|
+
// `.value` after assign + change (StubNode handler contract).
|
|
1147
|
+
select.value = selectedKey;
|
|
1148
|
+
bar.appendChild(select);
|
|
1149
|
+
|
|
1150
|
+
const selected =
|
|
1151
|
+
options.find((option) => option.key === selectedKey) ??
|
|
1152
|
+
options[options.length - 1];
|
|
1153
|
+
const data = selected.preview ?? {};
|
|
1154
|
+
const preview = el("div", "dag-inspector-attempt-preview");
|
|
1155
|
+
const status = attemptPreviewStatus(data.status);
|
|
1156
|
+
if (status) {
|
|
1157
|
+
preview.appendChild(el("span", `badge badge-${status.cls}`, status.label));
|
|
1158
|
+
}
|
|
1159
|
+
if (status?.cls === "failed" && data.failureCategory) {
|
|
1160
|
+
// 仅失败尝试显示原因;部分 runtime 会在成功尝试保留
|
|
1161
|
+
// failureCategory="success",不能将其误映射为「其他失败原因」。
|
|
1162
|
+
// 未知失败分类仍 fail-closed,raw token 仅保留在 title 诊断中。
|
|
1163
|
+
const reason = el(
|
|
1164
|
+
"span",
|
|
1165
|
+
"dag-inspector-attempt-category",
|
|
1166
|
+
`原因 ${attemptFailureLabel(data.failureCategory)}`,
|
|
1167
|
+
);
|
|
1168
|
+
reason.setAttribute("title", `failureCategory ${data.failureCategory}`);
|
|
1169
|
+
preview.appendChild(reason);
|
|
1170
|
+
}
|
|
1171
|
+
if (data.durationMs !== undefined) {
|
|
1172
|
+
preview.appendChild(
|
|
1173
|
+
el(
|
|
1174
|
+
"span",
|
|
1175
|
+
"dag-inspector-attempt-duration",
|
|
1176
|
+
`耗时 ${formatMs(data.durationMs)}`,
|
|
1177
|
+
),
|
|
1178
|
+
);
|
|
1179
|
+
}
|
|
1180
|
+
// Historical bodies load via execution-output endpoint; do not surface
|
|
1181
|
+
// raw artifact paths as the primary path for full text (AC-003/004).
|
|
1182
|
+
bar.appendChild(preview);
|
|
1183
|
+
return { bar, selectedKey, latestKey, options };
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1186
|
+
/**
|
|
1187
|
+
* Resolve whether the current selection is the semantic latest execution.
|
|
1188
|
+
* Users selecting the last option still write a concrete attempt-N/pass-N key;
|
|
1189
|
+
* treat that as latest so preview/body is never blank on "切回最新".
|
|
1190
|
+
*/
|
|
1191
|
+
function isLatestExecutionSelection(dagRunId, node) {
|
|
1192
|
+
const options = attemptSelectorOptions(node);
|
|
1193
|
+
if (options.length === 0) return true;
|
|
1194
|
+
const latestKey = options[options.length - 1].key;
|
|
1195
|
+
const requested = resolveSelectedAttemptKey(dagRunId, node);
|
|
1196
|
+
return requested === null || requested === latestKey;
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
function effectiveExecutionKey(dagRunId, node) {
|
|
1200
|
+
const options = attemptSelectorOptions(node);
|
|
1201
|
+
if (options.length === 0) return null;
|
|
1202
|
+
const latestKey = options[options.length - 1].key;
|
|
1203
|
+
const requested = resolveSelectedAttemptKey(dagRunId, node);
|
|
1204
|
+
if (requested === null) return latestKey;
|
|
1205
|
+
return options.some((option) => option.key === requested)
|
|
1206
|
+
? requested
|
|
1207
|
+
: latestKey;
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
/**
|
|
1211
|
+
* Inline read-only fetch for execution-output (api.js is outside writeSet).
|
|
1212
|
+
* Mirrors fetchJsonResult: preserves status, never throws on transport errors.
|
|
1213
|
+
*/
|
|
1214
|
+
async function fetchExecutionOutput(dagRunId, nodeId, key) {
|
|
1215
|
+
const url = `/api/dag-runs/${encodeURIComponent(dagRunId)}/nodes/${encodeURIComponent(nodeId)}/execution-output?key=${encodeURIComponent(key)}`;
|
|
1216
|
+
try {
|
|
1217
|
+
const res = await fetch(url);
|
|
1218
|
+
let body = null;
|
|
1219
|
+
try {
|
|
1220
|
+
body = await res.json();
|
|
1221
|
+
} catch {
|
|
1222
|
+
body = null;
|
|
1223
|
+
}
|
|
1224
|
+
return { ok: res.ok, status: res.status, body };
|
|
1225
|
+
} catch {
|
|
1226
|
+
return { ok: false, status: 0, body: null };
|
|
1227
|
+
}
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
function composeExecutionBodyText(payload) {
|
|
1231
|
+
if (!payload || typeof payload !== "object") return "";
|
|
1232
|
+
const assistant =
|
|
1233
|
+
typeof payload.assistantText === "string" && payload.assistantText
|
|
1234
|
+
? payload.assistantText
|
|
1235
|
+
: "";
|
|
1236
|
+
const stdout =
|
|
1237
|
+
typeof payload.stdout === "string" && payload.stdout ? payload.stdout : "";
|
|
1238
|
+
// Dedupe when both streams are non-empty and equal after trim (AC-001);
|
|
1239
|
+
// keep order assistantText → stdout when they differ (AC-002).
|
|
1240
|
+
if (assistant && stdout) {
|
|
1241
|
+
if (assistant.trim() === stdout.trim()) return assistant;
|
|
1242
|
+
return `${assistant}\n\n${stdout}`;
|
|
1243
|
+
}
|
|
1244
|
+
return assistant || stdout;
|
|
1245
|
+
}
|
|
1246
|
+
|
|
1247
|
+
function composeExecutionErrorText(payload) {
|
|
1248
|
+
if (!payload || typeof payload !== "object") return "";
|
|
1249
|
+
return typeof payload.stderr === "string" ? payload.stderr : "";
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
function appendOutputBody(content, outputText, errorText, options = null) {
|
|
1253
|
+
if (!outputText && !errorText) {
|
|
1254
|
+
content.appendChild(el("p", "empty", UI_TEXT.noOutput));
|
|
1255
|
+
return;
|
|
1256
|
+
}
|
|
1257
|
+
if (outputText) content.appendChild(renderMarkdown(outputText));
|
|
1258
|
+
// Truncation note only for full/cached execution-output bodies (AC-003);
|
|
1259
|
+
// preview path never invents truncated/maxBytes.
|
|
1260
|
+
if (options?.truncated === true) {
|
|
1261
|
+
const maxBytes = options.maxBytes ?? 0;
|
|
1262
|
+
content.appendChild(
|
|
1263
|
+
el(
|
|
1264
|
+
"p",
|
|
1265
|
+
"muted execution-output-truncated",
|
|
1266
|
+
`内容过长,已截断(maxBytes=${maxBytes})`,
|
|
1267
|
+
),
|
|
1268
|
+
);
|
|
1269
|
+
}
|
|
1270
|
+
if (errorText) {
|
|
1271
|
+
const error = el("section", "markdown-error");
|
|
1272
|
+
error.appendChild(el("p", "markdown-error-title", "错误输出"));
|
|
1273
|
+
error.appendChild(renderMarkdown(errorText));
|
|
1274
|
+
content.appendChild(error);
|
|
1275
|
+
}
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
function renderCachedOrPreviewBody(content, dagRunId, node, key, isLatest) {
|
|
1279
|
+
const cached = key
|
|
1280
|
+
? getDagNodeExecutionOutputCache(dagRunId, node.nodeId, key)
|
|
1281
|
+
: null;
|
|
1282
|
+
if (cached?.ok && cached.body) {
|
|
1283
|
+
appendOutputBody(
|
|
1284
|
+
content,
|
|
1285
|
+
composeExecutionBodyText(cached.body),
|
|
1286
|
+
composeExecutionErrorText(cached.body),
|
|
1287
|
+
{
|
|
1288
|
+
truncated: cached.body.truncated === true,
|
|
1289
|
+
maxBytes: cached.body.maxBytes,
|
|
1290
|
+
},
|
|
1291
|
+
);
|
|
1292
|
+
return "cached";
|
|
1293
|
+
}
|
|
1294
|
+
if (isLatest) {
|
|
1295
|
+
appendOutputBody(
|
|
1296
|
+
content,
|
|
1297
|
+
node.outputPreview ?? "",
|
|
1298
|
+
node.errorPreview ?? "",
|
|
1299
|
+
);
|
|
1300
|
+
return "preview";
|
|
1301
|
+
}
|
|
1302
|
+
if (cached && cached.ok === false) {
|
|
1303
|
+
const message =
|
|
1304
|
+
cached.error || "该次执行输出暂不可用(artifact 缺失或无法读取)。";
|
|
1305
|
+
const error = el("p", "empty", message);
|
|
1306
|
+
error.setAttribute("role", "status");
|
|
1307
|
+
content.appendChild(error);
|
|
1308
|
+
return "missing";
|
|
1309
|
+
}
|
|
1310
|
+
return null;
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1313
|
+
async function loadAndRenderExecutionOutput(
|
|
1314
|
+
content,
|
|
1315
|
+
dagRunId,
|
|
1316
|
+
node,
|
|
1317
|
+
key,
|
|
1318
|
+
isLatest,
|
|
1319
|
+
) {
|
|
1320
|
+
const nodeId = node.nodeId;
|
|
1321
|
+
const identity = makeDagNodeExecutionOutputIdentity(dagRunId, nodeId, key);
|
|
1322
|
+
uiState.dagNodeExecutionOutputIdentity = identity;
|
|
1323
|
+
uiState.dagNodeExecutionOutputKey = key;
|
|
1324
|
+
uiState.dagNodeExecutionOutputLoading = true;
|
|
1325
|
+
uiState.dagNodeExecutionOutputError = null;
|
|
1326
|
+
|
|
1327
|
+
const stillCurrent = () =>
|
|
1328
|
+
uiState.dagNodeExecutionOutputIdentity === identity &&
|
|
1329
|
+
uiState.selectedDagNodeId === nodeId &&
|
|
1330
|
+
// currentDagRunId may be unset in isolated unit stubs; prefer dataset match.
|
|
1331
|
+
(uiState.currentDagRunId == null || uiState.currentDagRunId === dagRunId) &&
|
|
1332
|
+
uiState.dagInspectorTab === "output" &&
|
|
1333
|
+
content.isConnected &&
|
|
1334
|
+
content.dataset.dagNodeId === String(nodeId) &&
|
|
1335
|
+
content.dataset.dagRunId === String(dagRunId) &&
|
|
1336
|
+
effectiveExecutionKey(dagRunId, inspectorSelection.node ?? node) === key;
|
|
1337
|
+
|
|
1338
|
+
const result = await fetchExecutionOutput(dagRunId, nodeId, key);
|
|
1339
|
+
if (!stillCurrent()) return;
|
|
1340
|
+
|
|
1341
|
+
uiState.dagNodeExecutionOutputLoading = false;
|
|
1342
|
+
if (!result.ok || !result.body) {
|
|
1343
|
+
const message =
|
|
1344
|
+
result.body?.error ||
|
|
1345
|
+
(result.status === 0
|
|
1346
|
+
? "加载执行输出失败(网络错误)。"
|
|
1347
|
+
: result.status === 404
|
|
1348
|
+
? "该次执行输出暂不可用(artifact 缺失或无法读取)。"
|
|
1349
|
+
: `加载执行输出失败(HTTP ${result.status})。`);
|
|
1350
|
+
// Cache the miss for this key only — never wipe other valid bodies.
|
|
1351
|
+
setDagNodeExecutionOutputCache(dagRunId, nodeId, key, {
|
|
1352
|
+
ok: false,
|
|
1353
|
+
error: message,
|
|
1354
|
+
status: result.status,
|
|
1355
|
+
});
|
|
1356
|
+
uiState.dagNodeExecutionOutputError = message;
|
|
1357
|
+
// Rebuild body area: keep attempt bar, replace status/body.
|
|
1358
|
+
repaintOutputTabBody(content, dagRunId, node);
|
|
1359
|
+
return;
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
setDagNodeExecutionOutputCache(dagRunId, nodeId, key, {
|
|
1363
|
+
ok: true,
|
|
1364
|
+
body: result.body,
|
|
1365
|
+
});
|
|
1366
|
+
uiState.dagNodeExecutionOutputError = null;
|
|
1367
|
+
repaintOutputTabBody(content, dagRunId, node);
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
/**
|
|
1371
|
+
* Rebuild the output tab body under the attempt bar using cache + preview
|
|
1372
|
+
* without losing selection identity (poll / async completion).
|
|
1373
|
+
*/
|
|
1374
|
+
function repaintOutputTabBody(content, dagRunId, node) {
|
|
1375
|
+
if (
|
|
1376
|
+
!content?.isConnected ||
|
|
1377
|
+
content.dataset.dagNodeId !== String(node.nodeId ?? "") ||
|
|
1378
|
+
content.dataset.dagRunId !== String(dagRunId ?? "") ||
|
|
1379
|
+
activeInspectorTab() !== "output"
|
|
1380
|
+
) {
|
|
1381
|
+
return;
|
|
1382
|
+
}
|
|
1383
|
+
// Remove everything after the attempt bar (or all if no bar).
|
|
1384
|
+
const bar = content.querySelector(".dag-inspector-attempt-bar");
|
|
1385
|
+
const keep = bar ? [bar] : [];
|
|
1386
|
+
while (content.firstChild) content.removeChild(content.firstChild);
|
|
1387
|
+
for (const nodeEl of keep) content.appendChild(nodeEl);
|
|
1388
|
+
|
|
1389
|
+
const key = effectiveExecutionKey(dagRunId, node);
|
|
1390
|
+
const latest = isLatestExecutionSelection(dagRunId, node);
|
|
1391
|
+
const rendered = renderCachedOrPreviewBody(
|
|
1392
|
+
content,
|
|
1393
|
+
dagRunId,
|
|
1394
|
+
node,
|
|
1395
|
+
key,
|
|
1396
|
+
latest,
|
|
1397
|
+
);
|
|
1398
|
+
if (rendered === null) {
|
|
1399
|
+
const loading = el("p", "muted", "正在加载执行输出…");
|
|
1400
|
+
loading.setAttribute("role", "status");
|
|
1401
|
+
loading.setAttribute("aria-live", "polite");
|
|
1402
|
+
content.appendChild(loading);
|
|
1403
|
+
}
|
|
1404
|
+
restoreInspectorContentScroll(content, dagRunId, node.nodeId, "output");
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1407
|
+
function fillDagInspectorContent(content, dagRunId, node) {
|
|
1408
|
+
const previousRenderedNode = content.dataset.dagNodeId ?? "";
|
|
1409
|
+
const previousRenderedRun = content.dataset.dagRunId ?? "";
|
|
1410
|
+
const previousTab = content.dataset.inspectorTab ?? "";
|
|
1411
|
+
const nodeChanged =
|
|
1412
|
+
previousRenderedNode !== String(node.nodeId ?? "") ||
|
|
1413
|
+
previousRenderedRun !== String(dagRunId ?? "");
|
|
1414
|
+
if (nodeChanged) {
|
|
1415
|
+
// Drop any open spec-evidence preview + cached list so a stale A detail
|
|
1416
|
+
// cannot survive into node B (AC-007 regression guard).
|
|
1417
|
+
uiState.specEvidenceDetail = null;
|
|
1418
|
+
uiState.specEvidenceListEvidence = null;
|
|
1419
|
+
uiState.dagNodeInputData = null;
|
|
1420
|
+
uiState.dagNodeInputError = null;
|
|
1421
|
+
}
|
|
1422
|
+
const activeTab = activeInspectorTab();
|
|
1423
|
+
// Capture outgoing context scroll before datasets flip (AC-005 isolation).
|
|
1424
|
+
if (
|
|
1425
|
+
previousRenderedNode &&
|
|
1426
|
+
previousRenderedRun &&
|
|
1427
|
+
(previousTab || activeTab)
|
|
1428
|
+
) {
|
|
1429
|
+
saveInspectorContentScroll(
|
|
1430
|
+
content,
|
|
1431
|
+
previousRenderedRun,
|
|
1432
|
+
previousRenderedNode,
|
|
1433
|
+
previousTab || activeTab,
|
|
1434
|
+
{ preserveIntent: true },
|
|
1435
|
+
);
|
|
1436
|
+
}
|
|
1437
|
+
content.id = `dag-inspector-panel-${activeTab}`;
|
|
1438
|
+
content.setAttribute("role", "tabpanel");
|
|
1439
|
+
content.setAttribute("aria-labelledby", `dag-inspector-tab-${activeTab}`);
|
|
1440
|
+
content.dataset.dagNodeId = String(node.nodeId ?? "");
|
|
1441
|
+
content.dataset.dagRunId = String(dagRunId ?? "");
|
|
1442
|
+
content.dataset.inspectorTab = activeTab;
|
|
1443
|
+
// Drop timeline-only classes when switching tabs so output layout stays clean.
|
|
1444
|
+
content.className = "dag-inspector-content";
|
|
1445
|
+
ensureInspectorContentScrollCapture(
|
|
1446
|
+
content,
|
|
1447
|
+
dagRunId,
|
|
1448
|
+
node.nodeId,
|
|
1449
|
+
activeTab,
|
|
1450
|
+
);
|
|
1451
|
+
if (activeTab === "spec-evidence") {
|
|
1452
|
+
void renderSpecEvidence(content, dagRunId, node.nodeId);
|
|
1453
|
+
} else if (activeTab === "timeline") {
|
|
1454
|
+
const attemptBuilt = buildAttemptBar(dagRunId, node);
|
|
1455
|
+
if (attemptBuilt?.bar) content.appendChild(attemptBuilt.bar);
|
|
1456
|
+
renderSessionTimeline(content, node.nodeId);
|
|
1457
|
+
} else if (activeTab === "input") {
|
|
1458
|
+
void renderDagNodeInput(content, dagRunId, node);
|
|
1459
|
+
} else {
|
|
1460
|
+
// output tab: attempt bar + latest preview immediate / historical async body.
|
|
1461
|
+
const attemptBuilt = buildAttemptBar(dagRunId, node);
|
|
1462
|
+
if (attemptBuilt?.bar) content.appendChild(attemptBuilt.bar);
|
|
1463
|
+
const key = effectiveExecutionKey(dagRunId, node);
|
|
1464
|
+
const latest = isLatestExecutionSelection(dagRunId, node);
|
|
1465
|
+
const rendered = renderCachedOrPreviewBody(
|
|
1466
|
+
content,
|
|
1467
|
+
dagRunId,
|
|
1468
|
+
node,
|
|
1469
|
+
key,
|
|
1470
|
+
latest,
|
|
1471
|
+
);
|
|
1472
|
+
// Historical (or multi-exec) selection without cache → loading then fetch.
|
|
1473
|
+
if (key && rendered === null) {
|
|
1474
|
+
const loading = el("p", "muted", "正在加载执行输出…");
|
|
1475
|
+
loading.setAttribute("role", "status");
|
|
1476
|
+
loading.setAttribute("aria-live", "polite");
|
|
1477
|
+
content.appendChild(loading);
|
|
1478
|
+
void loadAndRenderExecutionOutput(content, dagRunId, node, key, latest);
|
|
1479
|
+
} else if (key && rendered === "preview" && latest) {
|
|
1480
|
+
// Optional parallel enhance: load full artifact body for latest.
|
|
1481
|
+
const cached = getDagNodeExecutionOutputCache(dagRunId, node.nodeId, key);
|
|
1482
|
+
if (!cached) {
|
|
1483
|
+
void loadAndRenderExecutionOutput(content, dagRunId, node, key, latest);
|
|
1484
|
+
}
|
|
1485
|
+
}
|
|
1486
|
+
// Single-execution nodes (!key) already painted preview via renderCachedOrPreviewBody.
|
|
1487
|
+
restoreInspectorContentScroll(content, dagRunId, node.nodeId, "output");
|
|
1488
|
+
}
|
|
1489
|
+
}
|
|
1490
|
+
|
|
1491
|
+
function buildDagInspectorHeader(dagRunId, node) {
|
|
1492
|
+
const header = el("div", "dag-inspector-header");
|
|
1493
|
+
header.dataset.dagRunId = String(dagRunId ?? "");
|
|
1494
|
+
header.dataset.dagNodeId = String(node.nodeId ?? "");
|
|
1495
|
+
const title = el("div", "dag-inspector-title");
|
|
1496
|
+
title.appendChild(el("h3", null, "节点检查器"));
|
|
1497
|
+
title.appendChild(el("div", "dag-inspector-node", node.nodeId));
|
|
1498
|
+
header.appendChild(title);
|
|
1499
|
+
const controls = el("div", "dag-inspector-controls");
|
|
1500
|
+
const status = badge(node.status ?? "unknown");
|
|
1501
|
+
status.classList.add("dag-inspector-status");
|
|
1502
|
+
controls.appendChild(status);
|
|
1503
|
+
const close = document.createElement("button");
|
|
1504
|
+
close.type = "button";
|
|
1505
|
+
close.className = "dag-inspector-close";
|
|
1506
|
+
close.setAttribute("aria-label", "关闭节点检查器");
|
|
1507
|
+
const closeIcon = el("i", "ri-close-line");
|
|
1508
|
+
closeIcon.setAttribute("aria-hidden", "true");
|
|
1509
|
+
close.appendChild(closeIcon);
|
|
1510
|
+
close.addEventListener("click", closeDagInspector);
|
|
1511
|
+
controls.appendChild(close);
|
|
1512
|
+
header.appendChild(controls);
|
|
1513
|
+
|
|
1514
|
+
const tabDefs = [
|
|
1515
|
+
["input", "节点输入", "ri-login-box-line"],
|
|
1516
|
+
["output", "节点输出", "ri-file-text-line"],
|
|
1517
|
+
["timeline", "执行过程", "ri-route-line"],
|
|
1518
|
+
["spec-evidence", "规范证据", "ri-book-open-line"],
|
|
1519
|
+
];
|
|
1520
|
+
const tabs = el("div", "dag-inspector-tabs");
|
|
1521
|
+
tabs.setAttribute("role", "tablist");
|
|
1522
|
+
tabs.setAttribute("aria-label", "节点检查器面板");
|
|
1523
|
+
for (const [tab, label, icon] of tabDefs) {
|
|
1524
|
+
const selected = uiState.dagInspectorTab === tab;
|
|
1525
|
+
const button = document.createElement("button");
|
|
1526
|
+
button.type = "button";
|
|
1527
|
+
button.id = `dag-inspector-tab-${tab}`;
|
|
1528
|
+
button.className = "dag-inspector-tab";
|
|
1529
|
+
button.setAttribute("role", "tab");
|
|
1530
|
+
button.setAttribute("aria-controls", `dag-inspector-panel-${tab}`);
|
|
1531
|
+
button.setAttribute("aria-selected", String(selected));
|
|
1532
|
+
button.tabIndex = selected ? 0 : -1;
|
|
1533
|
+
button.dataset.tab = tab;
|
|
1534
|
+
const tabIcon = el("i", icon);
|
|
1535
|
+
tabIcon.setAttribute("aria-hidden", "true");
|
|
1536
|
+
button.appendChild(tabIcon);
|
|
1537
|
+
button.appendChild(document.createTextNode(` ${label}`));
|
|
1538
|
+
button.addEventListener("click", () => {
|
|
1539
|
+
uiState.dagInspectorTab = tab;
|
|
1540
|
+
renderDagInspectorForCurrent();
|
|
1541
|
+
const next = document.getElementById(`dag-inspector-tab-${tab}`);
|
|
1542
|
+
next?.focus();
|
|
1543
|
+
});
|
|
1544
|
+
button.addEventListener("keydown", (event) => {
|
|
1545
|
+
if (event.key !== "ArrowLeft" && event.key !== "ArrowRight") return;
|
|
1546
|
+
event.preventDefault();
|
|
1547
|
+
event.stopPropagation();
|
|
1548
|
+
const order = tabDefs.map(([id]) => id);
|
|
1549
|
+
const idx = order.indexOf(tab);
|
|
1550
|
+
if (idx < 0) return;
|
|
1551
|
+
const delta = event.key === "ArrowRight" ? 1 : -1;
|
|
1552
|
+
const nextTab = order[(idx + delta + order.length) % order.length];
|
|
1553
|
+
uiState.dagInspectorTab = nextTab;
|
|
1554
|
+
renderDagInspectorForCurrent();
|
|
1555
|
+
document.getElementById(`dag-inspector-tab-${nextTab}`)?.focus();
|
|
1556
|
+
});
|
|
1557
|
+
tabs.appendChild(button);
|
|
1558
|
+
}
|
|
1559
|
+
header.appendChild(tabs);
|
|
1560
|
+
return header;
|
|
1561
|
+
}
|
|
1562
|
+
|
|
1563
|
+
function syncDagInspectorHeader(panel, dagRunId, node) {
|
|
1564
|
+
const header = panel.querySelector(".dag-inspector-header");
|
|
1565
|
+
if (!header) return;
|
|
1566
|
+
header.dataset.dagRunId = String(dagRunId ?? "");
|
|
1567
|
+
header.dataset.dagNodeId = String(node.nodeId ?? "");
|
|
1568
|
+
const nodeLabel = header.querySelector(".dag-inspector-node");
|
|
1569
|
+
if (nodeLabel) nodeLabel.textContent = node.nodeId;
|
|
1570
|
+
const status = header.querySelector(".dag-inspector-status");
|
|
1571
|
+
if (status) {
|
|
1572
|
+
const next = badge(node.status ?? "unknown");
|
|
1573
|
+
next.classList.add("dag-inspector-status");
|
|
1574
|
+
status.replaceWith(next);
|
|
1575
|
+
}
|
|
1576
|
+
for (const button of header.querySelectorAll(".dag-inspector-tab")) {
|
|
1577
|
+
const selected = button.dataset.tab === uiState.dagInspectorTab;
|
|
1578
|
+
button.setAttribute("aria-selected", String(selected));
|
|
1579
|
+
button.tabIndex = selected ? 0 : -1;
|
|
1580
|
+
}
|
|
1581
|
+
}
|
|
1582
|
+
|
|
1583
|
+
function dagInspectorSignature(dagRunId, node) {
|
|
1584
|
+
const tab = activeInspectorTab();
|
|
1585
|
+
const execKey = effectiveExecutionKey(dagRunId, node);
|
|
1586
|
+
const cachedBody = execKey
|
|
1587
|
+
? getDagNodeExecutionOutputCache(dagRunId, node.nodeId, execKey)
|
|
1588
|
+
: null;
|
|
1589
|
+
const cachedRevision = cachedBody?.ok
|
|
1590
|
+
? [
|
|
1591
|
+
cachedBody.body?.assistantText ?? "",
|
|
1592
|
+
cachedBody.body?.stdout ?? "",
|
|
1593
|
+
cachedBody.body?.stderr ?? "",
|
|
1594
|
+
cachedBody.body?.truncated === true ? "trunc" : "full",
|
|
1595
|
+
cachedBody.body?.maxBytes ?? "",
|
|
1596
|
+
]
|
|
1597
|
+
: cachedBody
|
|
1598
|
+
? ["err", cachedBody.error ?? ""]
|
|
1599
|
+
: ["none"];
|
|
1600
|
+
const contentRevision =
|
|
1601
|
+
tab === "output"
|
|
1602
|
+
? [
|
|
1603
|
+
node.outputPreview ?? "",
|
|
1604
|
+
node.errorPreview ?? "",
|
|
1605
|
+
...cachedRevision,
|
|
1606
|
+
uiState.dagNodeExecutionOutputLoading ? "loading" : "idle",
|
|
1607
|
+
]
|
|
1608
|
+
: tab === "timeline"
|
|
1609
|
+
? [uiState.sessionEventOffset]
|
|
1610
|
+
: [node.status ?? ""];
|
|
1611
|
+
// Attempt dimension: selection identity + history shape. Poll refreshes keep
|
|
1612
|
+
// the DOM while selection/history are unchanged; switching attempt or a
|
|
1613
|
+
// changed attempt count rebuilds the selector.
|
|
1614
|
+
const summary = node.executionSummary;
|
|
1615
|
+
const attemptRevision = [
|
|
1616
|
+
summary?.totalAttemptCount ?? 0,
|
|
1617
|
+
(node.passes ?? []).join(","),
|
|
1618
|
+
execKey ?? "latest",
|
|
1619
|
+
];
|
|
1620
|
+
return JSON.stringify([
|
|
1621
|
+
dagRunId,
|
|
1622
|
+
node.nodeId,
|
|
1623
|
+
tab,
|
|
1624
|
+
attemptRevision,
|
|
1625
|
+
contentRevision,
|
|
1626
|
+
]);
|
|
1627
|
+
}
|
|
1628
|
+
|
|
1629
|
+
export function renderDagInspector(dagRunId, node, initial = true) {
|
|
1630
|
+
// Record the current selection before any early-return so tab handlers
|
|
1631
|
+
// (which reference the mutable inspectorSelection slot) always re-render
|
|
1632
|
+
// the currently selected node, never a stale build-time closure.
|
|
1633
|
+
inspectorSelection.dagRunId = dagRunId;
|
|
1634
|
+
inspectorSelection.node = node;
|
|
1635
|
+
const panel = document.getElementById("dag-inspector");
|
|
1636
|
+
if (!panel) return;
|
|
1637
|
+
captureDagTimelineViewportState(panel);
|
|
1638
|
+
if (!uiState.dagInspectorOpen || !node) {
|
|
1639
|
+
panel.classList.remove("is-open");
|
|
1640
|
+
panel.setAttribute("aria-hidden", "true");
|
|
1641
|
+
return;
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1644
|
+
// Defer tearing down the inspector shell while the user is actively
|
|
1645
|
+
// dragging the resize handle (or the graph) so the pointer-capture target
|
|
1646
|
+
// is not destroyed mid-gesture; the next poll refreshes the content.
|
|
1647
|
+
if (isInteractiveGestureActive(document.body.classList)) {
|
|
1648
|
+
return;
|
|
1649
|
+
}
|
|
1650
|
+
|
|
1651
|
+
const existingContent = panel.querySelector(".dag-inspector-content") ?? null;
|
|
1652
|
+
const reuseShell = !initial && Boolean(existingContent);
|
|
1653
|
+
const nextContentSignature = dagInspectorSignature(dagRunId, node);
|
|
1654
|
+
|
|
1655
|
+
if (reuseShell && existingContent) {
|
|
1656
|
+
panel.classList.add("is-open");
|
|
1657
|
+
panel.setAttribute("aria-hidden", "false");
|
|
1658
|
+
syncDagInspectorHeader(panel, dagRunId, node);
|
|
1659
|
+
// AC-003: signature unchanged → keep content DOM; header already synced.
|
|
1660
|
+
if (panel.dataset.contentSignature === nextContentSignature) return;
|
|
1661
|
+
const previousNode = existingContent.dataset.dagNodeId ?? "";
|
|
1662
|
+
const previousRun = existingContent.dataset.dagRunId ?? "";
|
|
1663
|
+
const previousTab =
|
|
1664
|
+
existingContent.dataset.inspectorTab ?? activeInspectorTab();
|
|
1665
|
+
const nodeChanged =
|
|
1666
|
+
previousNode !== String(node.nodeId ?? "") ||
|
|
1667
|
+
previousRun !== String(dagRunId ?? "");
|
|
1668
|
+
const activeTab = activeInspectorTab();
|
|
1669
|
+
// Capture scroll for the outgoing context before rebuild.
|
|
1670
|
+
saveInspectorContentScroll(
|
|
1671
|
+
existingContent,
|
|
1672
|
+
previousRun || dagRunId,
|
|
1673
|
+
previousNode || node.nodeId,
|
|
1674
|
+
previousTab,
|
|
1675
|
+
{ preserveIntent: true },
|
|
1676
|
+
);
|
|
1677
|
+
const nestedViewportState = [
|
|
1678
|
+
...existingContent.querySelectorAll("pre"),
|
|
1679
|
+
].map((pre) => ({
|
|
1680
|
+
scrollLeft: pre.scrollLeft,
|
|
1681
|
+
scrollTop: pre.scrollTop,
|
|
1682
|
+
}));
|
|
1683
|
+
clearNode(existingContent);
|
|
1684
|
+
fillDagInspectorContent(existingContent, dagRunId, node);
|
|
1685
|
+
// Async tabs restore themselves after fetch; sync tabs restore here.
|
|
1686
|
+
if (activeTab === "output" || activeTab === "timeline") {
|
|
1687
|
+
restoreInspectorContentScroll(
|
|
1688
|
+
existingContent,
|
|
1689
|
+
dagRunId,
|
|
1690
|
+
node.nodeId,
|
|
1691
|
+
activeTab,
|
|
1692
|
+
);
|
|
1693
|
+
}
|
|
1694
|
+
if (!nodeChanged && previousTab === activeTab) {
|
|
1695
|
+
for (const [index, pre] of [
|
|
1696
|
+
...existingContent.querySelectorAll("pre"),
|
|
1697
|
+
].entries()) {
|
|
1698
|
+
const previous = nestedViewportState[index];
|
|
1699
|
+
if (!previous) continue;
|
|
1700
|
+
pre.scrollLeft = previous.scrollLeft;
|
|
1701
|
+
pre.scrollTop = previous.scrollTop;
|
|
1702
|
+
}
|
|
1703
|
+
}
|
|
1704
|
+
panel.dataset.contentSignature = nextContentSignature;
|
|
1705
|
+
return;
|
|
1706
|
+
}
|
|
1707
|
+
|
|
1708
|
+
clearNode(panel);
|
|
1709
|
+
panel.classList.add("is-open");
|
|
1710
|
+
panel.setAttribute("aria-hidden", "false");
|
|
1711
|
+
panel.appendChild(createDagInspectorResizeHandle(panel));
|
|
1712
|
+
panel.appendChild(buildDagInspectorHeader(dagRunId, node));
|
|
1713
|
+
|
|
1714
|
+
const content = el("div", "dag-inspector-content");
|
|
1715
|
+
fillDagInspectorContent(content, dagRunId, node);
|
|
1716
|
+
panel.appendChild(content);
|
|
1717
|
+
panel.dataset.contentSignature = nextContentSignature;
|
|
1718
|
+
}
|
|
1719
|
+
|
|
1720
|
+
/**
|
|
1721
|
+
* Bounded event history UI. Uses opaque `cursor`/`nextCursor` (not SSE/run `after` offsets).
|
|
1722
|
+
*/
|