deepmodebot 0.9.1 → 0.10.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/plugins/marketplace.json +20 -0
- package/.claude-plugin/marketplace.json +2 -2
- package/.omp-plugin/marketplace.json +2 -2
- package/README.md +29 -5
- package/bin/deepmodebot.mjs +163 -4
- package/lib/clients.mjs +50 -3
- package/lib/tree.mjs +64 -10
- package/native/dmb-gate/Cargo.toml +13 -0
- package/native/dmb-gate/src/agents.rs +77 -0
- package/native/dmb-gate/src/ci.rs +516 -0
- package/native/dmb-gate/src/cleanup.rs +198 -0
- package/native/dmb-gate/src/gap.rs +1376 -0
- package/native/dmb-gate/src/guard.rs +135 -0
- package/native/dmb-gate/src/main.rs +327 -0
- package/native/dmb-gate/src/map.rs +173 -0
- package/native/dmb-gate/src/perf.rs +347 -0
- package/native/dmb-gate/src/reward.rs +1214 -0
- package/native/dmb-gate/src/skill_check.rs +171 -0
- package/native/dmb-gate/src/slop.rs +1238 -0
- package/native/dmb-gate/src/ui.rs +842 -0
- package/native/dmb-gate/src/util.rs +260 -0
- package/native/dmb-net/go.mod +3 -0
- package/native/dmb-net/main.go +624 -0
- package/native/dmb-net/main_test.go +122 -0
- package/package.json +12 -2
- package/plugins/deepmodebot/.antigravity-plugin/plugin.json +1 -1
- package/plugins/deepmodebot/.antigravity-plugin/skills/deep/SKILL.md +5 -5
- package/plugins/deepmodebot/.antigravity-plugin/skills/pr-thread/SKILL.md +1 -1
- package/plugins/deepmodebot/.antigravity-plugin/skills/review-pr/SKILL.md +2 -2
- package/plugins/deepmodebot/.antigravity-plugin/skills/suggest/SKILL.md +13 -0
- package/plugins/deepmodebot/.antigravity-plugin/skills/tournament/SKILL.md +2 -2
- package/plugins/deepmodebot/.claude-plugin/plugin.json +1 -1
- package/plugins/deepmodebot/.codex-plugin/plugin.json +46 -0
- package/plugins/deepmodebot/agents/comment-sicko/agent.md +35 -0
- package/plugins/deepmodebot/agents/researcher/agent.md +33 -0
- package/plugins/deepmodebot/agents/reviewer/agent.md +4 -2
- package/plugins/deepmodebot/agents/scout/agent.md +11 -12
- package/plugins/deepmodebot/agents/security-reviewer/agent.md +2 -1
- package/plugins/deepmodebot/commands/deep.md +6 -6
- package/plugins/deepmodebot/commands/research.md +8 -0
- package/plugins/deepmodebot/commands/suggest.md +10 -0
- package/plugins/deepmodebot/commands/tournament.md +2 -2
- package/plugins/deepmodebot/hooks/hooks.json +2 -2
- package/plugins/deepmodebot/hooks.json +1 -1
- package/plugins/deepmodebot/scripts/antigravity-guard.mjs +140 -7
- package/plugins/deepmodebot/scripts/omp-mcp-server.mjs +179 -47
- package/plugins/deepmodebot/skills/agent-harnesses/SKILL.md +4 -6
- package/plugins/deepmodebot/skills/agent-harnesses/assets/sdks/check_antigravity.py +3 -0
- package/plugins/deepmodebot/skills/agent-harnesses/references/ai-native-tooling.md +4 -0
- package/plugins/deepmodebot/skills/agent-harnesses/references/ai-sdk-selection.md +3 -1
- package/plugins/deepmodebot/skills/agent-harnesses/references/antigravity.md +2 -2
- package/plugins/deepmodebot/skills/agent-harnesses/references/delegation-efficiency.md +12 -2
- package/plugins/deepmodebot/skills/agent-harnesses/references/protocols.md +11 -3
- package/plugins/deepmodebot/skills/app-automation-relay/SKILL.md +17 -0
- package/plugins/deepmodebot/skills/app-automation-relay/assets/relay_server.ts +364 -0
- package/plugins/deepmodebot/skills/app-automation-relay/references/adapter-cookbook.md +15 -0
- package/plugins/deepmodebot/skills/app-automation-relay/references/wire-protocol.md +23 -0
- package/plugins/deepmodebot/skills/cloud-devsecops/SKILL.md +4 -3
- package/plugins/deepmodebot/skills/cloud-devsecops/references/cloudflare-edge.md +43 -0
- package/plugins/deepmodebot/skills/cloud-devsecops/references/local-emulators.md +15 -2
- package/plugins/deepmodebot/skills/contribute/SKILL.md +3 -35
- package/plugins/deepmodebot/skills/create-formal-verification-skill/LICENSE +21 -0
- package/plugins/deepmodebot/skills/create-formal-verification-skill/NOTICE.md +16 -0
- package/plugins/deepmodebot/skills/create-formal-verification-skill/SKILL.md +71 -0
- package/plugins/deepmodebot/skills/create-verification-skill/SKILL.md +2 -2
- package/plugins/deepmodebot/skills/deep-learning/LICENSE +21 -0
- package/plugins/deepmodebot/skills/deep-learning/SKILL.md +33 -0
- package/plugins/deepmodebot/skills/deep-learning/references/neural-architectures.md +43 -0
- package/plugins/deepmodebot/skills/deep-learning/references/papers-and-repos.md +128 -0
- package/plugins/deepmodebot/skills/deep-learning/references/reinforcement-learning.md +57 -0
- package/plugins/deepmodebot/skills/deep-learning/references/training-optimization.md +40 -0
- package/plugins/deepmodebot/skills/deep-learning/references/weight-space-programming.md +76 -0
- package/plugins/deepmodebot/skills/deep-learning/scripts/hf_passes.py +166 -0
- package/plugins/deepmodebot/skills/deep-learning/scripts/wsp.py +493 -0
- package/plugins/deepmodebot/skills/deep-stack/SKILL.md +1 -1
- package/plugins/deepmodebot/skills/deep-stack/references/design-workflow.md +46 -92
- package/plugins/deepmodebot/skills/deep-stack/references/isolate.md +1 -0
- package/plugins/deepmodebot/skills/deep-stack/references/prove.md +6 -0
- package/plugins/deepmodebot/skills/deep-stack/references/stack.md +11 -1
- package/plugins/deepmodebot/skills/deepmodebot/SKILL.md +74 -145
- package/plugins/deepmodebot/skills/deepmodebot/assets/agents-md/agents_md.py +18 -6
- package/plugins/deepmodebot/skills/deepmodebot/assets/autoroute/autoroute.py +1021 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/cleanup/self_cleanup.py +305 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/contain/claude_guard.py +98 -5
- package/plugins/deepmodebot/skills/deepmodebot/assets/contain/omp-contain.ts +106 -5
- package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/design.py +3 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/record.py +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/rehearsal_gate.py +536 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/review.py +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/formal-verification/verify_proof.py +638 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/gap-audit/gap_audit.py +1053 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/gen-ui/gen_ui.py +1782 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/git-guardrails/git-guard-patterns.txt +7 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/git-guardrails/git-guard.sh +3 -2
- package/plugins/deepmodebot/skills/deepmodebot/assets/git-guardrails/git-guard.ts +9 -5
- package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/ghapp.py +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/install.py +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/local-ci/local_ci.py +540 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/local-ci/slop_gate.py +642 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/loop/loop.py +2 -1
- package/plugins/deepmodebot/skills/deepmodebot/assets/loop/plan.py +2 -1
- package/plugins/deepmodebot/skills/deepmodebot/assets/loop/windows_job.py +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/memory/project_memory.py +529 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/perf-audit/bench_harness.py +48 -21
- package/plugins/deepmodebot/skills/deepmodebot/assets/perf-audit/perf_audit.py +339 -5
- package/plugins/deepmodebot/skills/deepmodebot/assets/pr-agent/diff_coverage.py +96 -6
- package/plugins/deepmodebot/skills/deepmodebot/assets/pr-agent/pr_agent_local.py +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/pr-conversation/arena.py +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/pr-conversation/show_thread.py +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/prompt-tools/prompt_tools.py +1239 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/quota-guard/quota_guard.py +424 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/repo-references.json +477 -1
- package/plugins/deepmodebot/skills/deepmodebot/assets/reward-guard/reward_guard.py +1597 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/rules/rule-paths.json +57 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/rules/rule_ledger.py +1645 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/scrape/yt_enrich.py +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/scrape/yt_meta.py +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/scrape/yt_transcript_relay.js +13 -10
- package/plugins/deepmodebot/skills/deepmodebot/assets/security-audit/static_sec_audit.py +275 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/self-grill/self_grill.py +1473 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/setup/model_setup.py +329 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/setup/project_setup.py +312 -0
- package/plugins/deepmodebot/skills/deepmodebot/assets/tournament/tournament.py +304 -18
- package/plugins/deepmodebot/skills/deepmodebot/assets/workspace-map/workspace_map.py +121 -78
- package/plugins/deepmodebot/skills/deepmodebot/references/README.md +14 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/catalog.md +16 -11
- package/plugins/deepmodebot/skills/deepmodebot/references/contain.md +2 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/delegation.md +14 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/flows.md +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/full-scope.md +9 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/babysit.md +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/end-to-end.md +12 -9
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/feature.md +7 -3
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/hillclimb.md +2 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/investigation.md +4 -4
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/opening-a-pr.md +1 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/perf-issue.md +13 -10
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/refactoring.md +6 -6
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/reference-rebuild.md +1 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/run-a-goal.md +3 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/setup.md +1 -2
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/visual-parity.md +1 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/playbooks/work-a-queue.md +4 -2
- package/plugins/deepmodebot/skills/deepmodebot/references/principles/hardcore-mode.md +7 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/principles/no-reward-hacking.md +8 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/principles/test-behavior-not-implementation.md +2 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/principles/type-system-discipline.md +2 -2
- package/plugins/deepmodebot/skills/deepmodebot/references/rule-approval.md +51 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/architect.md +10 -24
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/architecture-review.md +5 -4
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/arena.md +3 -3
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/autoroute.md +49 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/blast-radius.md +1 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/catchup-video.md +13 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/correct.md +8 -7
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/course.md +2 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/devex-review.md +13 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/expand-contract.md +13 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/formal-verification.md +33 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/gen-ui.md +60 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/grill.md +2 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/how.md +7 -18
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/inner-loop.md +7 -7
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/model-setup.md +14 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/modernize-pr.md +15 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/mutation-testing.md +13 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/no-comments.md +5 -5
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/panel.md +7 -3
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/pr-conversation.md +1 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/pr-review.md +8 -5
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/pre-commit.md +1 -2
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/prior-art.md +33 -38
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/product-lens.md +12 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/prompt-upgrade.md +30 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/recall.md +1 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/reframe.md +18 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/release-and-canary.md +10 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/research.md +62 -89
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/security-audit.md +5 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/self-grill.md +54 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/sharpen.md +3 -3
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/show-me-your-work.md +7 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/sme-review.md +3 -2
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/suggest.md +24 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/swarm.md +7 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/teach.md +2 -2
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/tournament.md +12 -11
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/variant-analysis.md +11 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/video-forensics.md +46 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/visual-e2e.md +10 -1
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/webhook-ui.md +11 -0
- package/plugins/deepmodebot/skills/deepmodebot/references/techniques/writing-for-agents.md +6 -0
- package/plugins/deepmodebot/skills/deepmodebot/scripts/check_skill.py +7 -0
- package/plugins/deepmodebot/skills/deepmodebot/scripts/trending.py +141 -18
- package/plugins/deepmodebot/skills/deepmodebot/worker.md +16 -0
- package/plugins/deepmodebot/skills/domain-rules/SKILL.md +13 -119
- package/plugins/deepmodebot/skills/domain-rules/references/backend-system-design.md +19 -1
- package/plugins/deepmodebot/skills/domain-rules/references/engineering-practice.md +7 -0
- package/plugins/deepmodebot/skills/domain-rules/references/language-ecosystems.md +11 -0
- package/plugins/deepmodebot/skills/domain-rules/references/sources.md +108 -0
- package/plugins/deepmodebot/skills/frontend-ui/SKILL.md +30 -131
- package/plugins/deepmodebot/skills/frontend-ui/assets/themes/canvas.css +42 -0
- package/plugins/deepmodebot/skills/frontend-ui/assets/themes/editorial.css +39 -0
- package/plugins/deepmodebot/skills/frontend-ui/assets/themes/layouts.css +95 -0
- package/plugins/deepmodebot/skills/frontend-ui/assets/themes/swiss.css +40 -0
- package/plugins/deepmodebot/skills/frontend-ui/assets/themes/tactile.css +41 -0
- package/plugins/deepmodebot/skills/frontend-ui/assets/themes/workbench.css +50 -0
- package/plugins/deepmodebot/skills/frontend-ui/references/patterns/mobbin-animations.md +49 -0
- package/plugins/deepmodebot/skills/frontend-ui/references/patterns/mobbin-shipped-apps.md +46 -24
- package/plugins/deepmodebot/skills/frontend-ui/references/patterns/motion-clips.md +27 -258
- package/plugins/deepmodebot/skills/frontend-ui/references/patterns/motion-graphics.md +26 -51
- package/plugins/deepmodebot/skills/frontend-ui/references/patterns/pinterest-animations.md +22 -195
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/00-art-direction.md +39 -0
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/01-workflow.md +27 -24
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/02-review-rubric.md +23 -17
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/03-ai-tells.md +22 -45
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/04-components.md +11 -0
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/04a-agent-ui.md +32 -152
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/05-motion.md +36 -91
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/05a-motion-graphics.md +14 -120
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/06-typography-layout.md +11 -10
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/06a-color.md +9 -9
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/06b-media-icons-charts.md +19 -0
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/06c-product-shots-craft.md +42 -0
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/07-copy.md +5 -6
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/08-quality-floor.md +28 -56
- package/plugins/deepmodebot/skills/frontend-ui/references/playbook/09-steering-agents.md +9 -7
- package/plugins/deepmodebot/skills/frontend-ui/scripts/motion_diff.py +259 -0
- package/plugins/deepmodebot/skills/frontend-ui/scripts/ui_audit.py +496 -0
- package/plugins/deepmodebot/skills/maintain-formal-verification-skill/LICENSE +21 -0
- package/plugins/deepmodebot/skills/maintain-formal-verification-skill/NOTICE.md +16 -0
- package/plugins/deepmodebot/skills/maintain-formal-verification-skill/SKILL.md +68 -0
- package/plugins/deepmodebot/skills/maintain-verification-skill/SKILL.md +1 -1
- package/plugins/deepmodebot/skills/office-documents/SKILL.md +24 -0
- package/plugins/deepmodebot/skills/office-documents/references/documents-docx-pdf.md +15 -0
- package/plugins/deepmodebot/skills/office-documents/references/presentations-pptx.md +15 -0
- package/plugins/deepmodebot/skills/office-documents/references/spreadsheets-xlsx.md +15 -0
- package/plugins/deepmodebot/skills/office-documents/scripts/doc_audit.py +230 -0
- package/plugins/deepmodebot/skills/project-brief/SKILL.md +2 -19
- package/plugins/deepmodebot/skills/project-brief/assets/pr-overlap.py +4 -0
- package/plugins/deepmodebot/skills/project-brief/assets/sync-roadmap.py +4 -0
- package/plugins/deepmodebot/skills/project-brief/references/claim-contract.md +55 -0
- package/plugins/deepmodebot/skills/research/SKILL.md +18 -0
- package/plugins/deepmodebot/skills/secrets-and-auth/SKILL.md +1 -1
- package/plugins/deepmodebot/skills/seo-and-geo/SKILL.md +29 -0
- package/plugins/deepmodebot/skills/seo-and-geo/references/geo-and-agentic-web.md +30 -0
- package/plugins/deepmodebot/skills/seo-and-geo/references/technical-and-schema.md +25 -0
- package/plugins/deepmodebot/skills/seo-and-geo/scripts/seo_audit.py +282 -0
- package/plugins/deepmodebot/skills/software-architecture/SKILL.md +2 -2
- package/plugins/deepmodebot/skills/software-architecture/references/backend-infrastructure.md +5 -0
- package/plugins/deepmodebot/skills/software-architecture/references/monorepos.md +1 -0
- package/plugins/deepmodebot/skills/statechart/LICENSE +21 -0
- package/plugins/deepmodebot/skills/statechart/NOTICE.md +21 -0
- package/plugins/deepmodebot/skills/statechart/SKILL.md +106 -0
- package/plugins/deepmodebot/skills/statechart/references/render.md +93 -0
- package/plugins/deepmodebot/skills/statechart/references/tooling.md +78 -0
- package/plugins/deepmodebot/skills/statechart/scripts/backends/cfg.ts +33 -0
- package/plugins/deepmodebot/skills/statechart/scripts/backends/mermaid.ts +249 -0
- package/plugins/deepmodebot/skills/statechart/scripts/backends/plain-text.ts +72 -0
- package/plugins/deepmodebot/skills/statechart/scripts/backends/report.ts +177 -0
- package/plugins/deepmodebot/skills/statechart/scripts/frontends/config.ts +276 -0
- package/plugins/deepmodebot/skills/statechart/scripts/frontends/dot.ts +77 -0
- package/plugins/deepmodebot/skills/statechart/scripts/frontends/marks.ts +93 -0
- package/plugins/deepmodebot/skills/statechart/scripts/frontends/messages.ts +52 -0
- package/plugins/deepmodebot/skills/statechart/scripts/frontends/spec.ts +114 -0
- package/plugins/deepmodebot/skills/statechart/scripts/frontends/trace.ts +24 -0
- package/plugins/deepmodebot/skills/statechart/scripts/frontends/value.ts +166 -0
- package/plugins/deepmodebot/skills/statechart/scripts/frontends/verdict.ts +40 -0
- package/plugins/deepmodebot/skills/statechart/scripts/frontends/view.ts +119 -0
- package/plugins/deepmodebot/skills/statechart/scripts/ir.ts +547 -0
- package/plugins/deepmodebot/skills/statechart/scripts/janitor.ts +13 -0
- package/plugins/deepmodebot/skills/statechart/scripts/kill.ts +15 -0
- package/plugins/deepmodebot/skills/statechart/scripts/package.json +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/passes/annotate.ts +128 -0
- package/plugins/deepmodebot/skills/statechart/scripts/passes/label.ts +269 -0
- package/plugins/deepmodebot/skills/statechart/scripts/passes/lift.ts +85 -0
- package/plugins/deepmodebot/skills/statechart/scripts/passes/loop-check.ts +68 -0
- package/plugins/deepmodebot/skills/statechart/scripts/passes/paths.ts +60 -0
- package/plugins/deepmodebot/skills/statechart/scripts/passes/reach.ts +135 -0
- package/plugins/deepmodebot/skills/statechart/scripts/passes/region-check.ts +97 -0
- package/plugins/deepmodebot/skills/statechart/scripts/passes/regions.ts +295 -0
- package/plugins/deepmodebot/skills/statechart/scripts/pipeline.ts +76 -0
- package/plugins/deepmodebot/skills/statechart/scripts/run.ts +500 -0
- package/plugins/deepmodebot/skills/statechart/scripts/statechart +29 -0
- package/plugins/deepmodebot/skills/statechart/scripts/statechart.ts +165 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/ConfigOracle.java +63 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/chart.test.ts +1253 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/charts/Braces.mmd +7 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/charts/Escapes.mmd +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/charts/Phases.mmd +29 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/cli.test.ts +1344 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/config-fuzz.test.ts +263 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/ChartRun.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/Counter.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/Counter.tla +10 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/chart.mmd +9 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/graph.dot +16 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/report.md +7 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Counter/verdict-1.out +49 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/ChartRun.out +60 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/CounterAction.cfg +4 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/CounterAction.tla +22 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/chart.mmd +26 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/graph.dot +19 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/report.md +20 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/verdict-1.out +56 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/verdict-2.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/verdict-2.out +82 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterAction/verdict-3.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/ChartRun.out +59 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/CounterDeadlock.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/CounterDeadlock.tla +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/chart.mmd +22 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/graph.dot +16 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/report.md +17 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-1.out +56 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-2.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-2.out +77 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/ChartRun.out +69 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/CounterFan.cfg +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/CounterFan.tla +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/chart.mmd +85 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/graph.dot +70 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/report.md +12 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/verdict-1.out +67 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterFan/verdict-2.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/ChartRun.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/ChartRun.out +85 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/CounterGuard.cfg +6 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/CounterGuard.tla +13 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/chart.mmd +5 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/graph.dot +10 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/report.md +31 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/verdict-1.out +64 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/verdict-2.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterGuard/verdict-2.out +77 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/ChartRun.out +55 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/CounterInitPast.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/CounterInitPast.tla +10 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/chart.mmd +12 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/graph.dot +6 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/report.md +12 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/verdict-1.out +33 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPast/verdict-2.out +54 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/ChartRun.out +54 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/CounterInitPastHolds.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/CounterInitPastHolds.tla +10 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/chart.mmd +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/graph.dot +6 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/report.md +7 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInitPastHolds/verdict-1.out +46 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/ChartRun.out +59 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/CounterInstance.cfg +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/CounterInstance.tla +10 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/CounterSteps.tla +6 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/chart.mmd +17 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/graph.dot +15 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/report.md +14 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/sany.out +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterInstance/verdict-1.out +78 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/ChartRun.out +59 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/CounterJump.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/CounterJump.tla +19 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/chart.mmd +26 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/graph.dot +22 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/report.md +12 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/verdict-1.out +58 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterJump/verdict-2.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/ChartRun.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/CounterLoop.cfg +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/CounterLoop.tla +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/chart.mmd +17 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/graph.dot +15 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/report.md +14 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterLoop/verdict-1.out +76 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/ChartRun.out +59 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/CounterOrder.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/CounterOrder.tla +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/chart.mmd +19 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/graph.dot +10 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/report.md +15 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/verdict-1.out +56 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/verdict-2.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterOrder/verdict-2.out +67 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/ChartRun.out +62 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/CounterRules.cfg +6 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/CounterRules.tla +24 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/Moves.tla +5 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/chart.mmd +22 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/graph.dot +10 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/report.md +23 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/sany.out +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-1.out +58 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-2.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-2.out +66 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-3.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-3.out +74 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterRules/verdict-4.out +59 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/ChartRun.out +58 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/CounterStart.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/CounterStart.tla +15 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/chart.mmd +18 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/graph.dot +13 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/report.md +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/verdict-1.out +33 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStart/verdict-2.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/ChartRun.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/CounterStop.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/CounterStop.tla +15 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/chart.mmd +7 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/graph.dot +13 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/report.md +6 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterStop/verdict-1.out +49 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/ChartRun.out +61 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/CounterTie.cfg +4 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/CounterTie.tla +14 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/chart.mmd +30 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/graph.dot +19 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/report.md +27 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-1.out +56 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-2.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-2.out +64 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-3.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-3.out +87 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTie/verdict-4.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/ChartRun.out +60 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/CounterTieInGraph.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/CounterTieInGraph.tla +12 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/chart.mmd +23 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/graph.dot +19 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/report.md +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/verdict-1.out +56 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterTieInGraph/verdict-2.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/ChartRun.out +61 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/CounterView.cfg +4 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/CounterView.tla +14 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/chart.mmd +23 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/graph.dot +19 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/report.md +27 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-1.out +56 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-2.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-2.out +64 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-3.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-3.out +87 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/verdict-4.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/CounterView/view.mjs +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/ChartRun.out +59 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/DieHard.cfg +4 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/DieHard.tla +38 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/chart.mmd +92 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/graph.dot +126 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/report.md +17 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/verdict-1.out +91 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/DieHard/verdict-2.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/ChartRun.out +61 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/FirstRule.cfg +6 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/FirstRule.tla +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/chart.mmd +22 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/graph.dot +16 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/report.md +25 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-1.out +56 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-2.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-2.out +64 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-3.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-3.out +64 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-4.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/FirstRule/verdict-4.out +77 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/ChartRun.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/HiddenClock.cfg +4 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/HiddenClock.tla +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/chart.mmd +13 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/graph.dot +12 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/report.md +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/HiddenClock/verdict-1.out +72 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/ChartRun.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/Login.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/Login.tla +62 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/chart.mmd +28 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/graph.dot +40 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/report.md +7 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/sany.out +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/verdict-1.out +47 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Login/view.mjs +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/ChartRun.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/LoginGuarded.cfg +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/LoginGuarded.tla +64 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/chart.mmd +28 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/graph.dot +37 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/report.md +8 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/sany.out +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/verdict-1.out +47 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginGuarded/view.mjs +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/ChartRun.out +60 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/LoginParallel.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/LoginParallel.tla +64 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/chart.mmd +44 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/graph.dot +58 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/report.md +17 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/sany.out +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/verdict-1.out +83 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/verdict-2.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/LoginParallel/view.mjs +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/ChartRun.out +60 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/MediaPlayer.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/MediaPlayer.tla +103 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/chart.mmd +43 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/graph.dot +93 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/report.md +14 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/sany.out +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/verdict-1.out +59 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/verdict-2.out +72 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayer/view.mjs +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/ChartRun.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/MediaPlayerFixed.cfg +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/MediaPlayerFixed.tla +100 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/chart.mmd +31 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/graph.dot +85 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/report.md +9 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/sany.out +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/verdict-1.out +47 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerFixed/view.mjs +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/ChartRun.out +59 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/MediaPlayer.tla +103 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/MediaPlayerProps.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/MediaPlayerProps.tla +6 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/chart.mmd +42 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/graph.dot +93 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/report.md +19 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-1.out +61 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-2.out +59 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-3.out +61 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-4.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-4.out +66 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-5.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-5.out +58 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-6.out +49 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/MediaPlayerProps/view.mjs +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/ChartRun.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/PickWorker.cfg +6 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/PickWorker.tla +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/chart.mmd +5 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/graph.dot +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/report.md +7 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/sany.out +5 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/PickWorker/verdict-1.out +70 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/ChartRun.out +61 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/Shadow.cfg +4 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/Shadow.tla +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/ShadowLib.tla +6 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/ShadowSub.tla +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/chart.mmd +9 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/graph.dot +16 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/report.md +8 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/sany.out +4 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/Shadow/verdict-1.out +65 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/ChartRun.out +59 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/SpacedNames.cfg +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/SpacedNames.tla +9 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/chart.mmd +23 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/graph.dot +17 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/report.md +15 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/sany.out +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/verdict-1.out +65 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/verdict-2.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/SpacedNames/verdict-2.out +75 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/ChartRun.out +69 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/TwoPhase.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/TwoPhase.tla +75 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/chart.mmd +60 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/graph.dot +297 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/report.md +20 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/sany.out +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/verdict-1.out +95 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/verdict-2.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhase/view.mjs +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/ChartRun.out +57 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/TwoPhaseFixed.cfg +3 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/TwoPhaseFixed.tla +75 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/chart.mmd +37 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/graph.dot +223 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/report.md +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/sany.out +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/verdict-1.out +47 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TwoPhaseFixed/view.mjs +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/ChartRun.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/ChartRun.out +75 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/TypeGuard.cfg +5 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/TypeGuard.tla +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/chart.mmd +18 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/graph.dot +14 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/report.md +29 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/verdict-1.out +64 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/verdict-2.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/TypeGuard/verdict-2.out +75 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/ChartRun.out +58 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/UserNoDeadlock.cfg +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/UserNoDeadlock.tla +8 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/chart.mmd +22 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/graph.dot +16 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/report.md +15 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-1.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-1.out +56 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-2.exit +1 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-2.out +77 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/corpus.test.ts +441 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/differential.test.ts +565 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/drawn.ts +20 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/grid/Grid.cfg +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/grid/Grid.tla +9 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/grid/sany.out +2 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/java.ts +63 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/labels.ts +648 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/messages.test.ts +226 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/pipeline.test.ts +270 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/plain-tlc.test.ts +255 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/render.test.ts +145 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/tlc-out.test.ts +90 -0
- package/plugins/deepmodebot/skills/statechart/scripts/test/tlc.ts +158 -0
- package/plugins/deepmodebot/skills/statechart/scripts/tsconfig.json +11 -0
- package/plugins/deepmodebot/skills/statechart/scripts/worker.ts +35 -0
- package/plugins/deepmodebot/skills/agent-harnesses/assets/sdks/bun.lock +0 -391
- package/plugins/deepmodebot/skills/deepmodebot/assets/agents-md/test_agents_md.py +0 -146
- package/plugins/deepmodebot/skills/deepmodebot/assets/contain/test_antigravity_guard.py +0 -483
- package/plugins/deepmodebot/skills/deepmodebot/assets/contain/test_audit_regressions.py +0 -139
- package/plugins/deepmodebot/skills/deepmodebot/assets/contain/test_contain.py +0 -301
- package/plugins/deepmodebot/skills/deepmodebot/assets/contain/test_omp_mcp.py +0 -602
- package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/test_design.py +0 -69
- package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/test_evidence.py +0 -160
- package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/test_record.py +0 -180
- package/plugins/deepmodebot/skills/deepmodebot/assets/e2e/test_review.py +0 -265
- package/plugins/deepmodebot/skills/deepmodebot/assets/git-guardrails/test_git_guard.py +0 -192
- package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/test_bot.py +0 -2182
- package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/test_brand.py +0 -19
- package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/test_local_updates.py +0 -691
- package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/test_review_context.py +0 -127
- package/plugins/deepmodebot/skills/deepmodebot/assets/github-app/test_workspace_cleanup.py +0 -496
- package/plugins/deepmodebot/skills/deepmodebot/assets/loop/test_loop.py +0 -1426
- package/plugins/deepmodebot/skills/deepmodebot/assets/loop/test_plan.py +0 -320
- package/plugins/deepmodebot/skills/deepmodebot/assets/loop/test_windows_job.py +0 -326
- package/plugins/deepmodebot/skills/deepmodebot/assets/perf-audit/test_bench_harness.py +0 -55
- package/plugins/deepmodebot/skills/deepmodebot/assets/perf-audit/test_perf_audit.py +0 -53
- package/plugins/deepmodebot/skills/deepmodebot/assets/pr-agent/test_diff_coverage.py +0 -94
- package/plugins/deepmodebot/skills/deepmodebot/assets/pr-conversation/test_arena.py +0 -610
- package/plugins/deepmodebot/skills/deepmodebot/assets/scrape/test_yt_enrich.py +0 -250
- package/plugins/deepmodebot/skills/deepmodebot/assets/tournament/test_tournament.py +0 -654
- package/plugins/deepmodebot/skills/deepmodebot/assets/workspace-map/test_workspace_map.py +0 -879
|
@@ -0,0 +1,1782 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Contained A2UI v1.0 surface compiler, validator, and interactive HTML human cockpit generator.
|
|
3
|
+
|
|
4
|
+
python gen_ui.py from-suggest --root <repo> [--slug suggest] [--limit 8] [--open] [--json]
|
|
5
|
+
python gen_ui.py from-grill --root <repo> [--slug grill] [--base <ref>] [--spec-stdin] [--open] [--json]
|
|
6
|
+
python gen_ui.py render --root <repo> --slug <slug> --stdin [--open] [--json]
|
|
7
|
+
python gen_ui.py validate-a2ui --file <surface.a2ui.json> [--json]
|
|
8
|
+
"""
|
|
9
|
+
import argparse
|
|
10
|
+
import datetime as dt
|
|
11
|
+
import importlib.util
|
|
12
|
+
import json
|
|
13
|
+
import re
|
|
14
|
+
import sys
|
|
15
|
+
import webbrowser
|
|
16
|
+
from pathlib import Path
|
|
17
|
+
from typing import Any
|
|
18
|
+
|
|
19
|
+
sys.dont_write_bytecode = True
|
|
20
|
+
|
|
21
|
+
SKILL_DIR = Path(__file__).resolve().parents[2]
|
|
22
|
+
ASSETS_DIR = SKILL_DIR / "assets"
|
|
23
|
+
CATALOG_ID = "https://a2ui.org/catalogs/deepmodebot-cockpit/v1/catalog.json"
|
|
24
|
+
|
|
25
|
+
SCRIPT_INJECTION_RE = re.compile(
|
|
26
|
+
r"(?:<\s*/?\s*(?:script|iframe|object|embed)\b|javascript\s*:|vbscript\s*:|data\s*:\s*text/html|\bon[a-z]{2,20}\s*=)",
|
|
27
|
+
re.I,
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
DEFAULT_CATALOG = {
|
|
31
|
+
"protocolVersion": "1.0",
|
|
32
|
+
"catalogId": CATALOG_ID,
|
|
33
|
+
"components": {
|
|
34
|
+
"SurfaceShell": {
|
|
35
|
+
"type": "object",
|
|
36
|
+
"description": "Top-level Operate-mode cockpit container with header telemetry and body sections.",
|
|
37
|
+
"properties": {
|
|
38
|
+
"title": {"type": ["string", "object"]},
|
|
39
|
+
"subtitle": {"type": ["string", "object"]},
|
|
40
|
+
"modeBadge": {"type": ["string", "object"]},
|
|
41
|
+
"children": {"type": "array", "items": {"type": "string"}},
|
|
42
|
+
},
|
|
43
|
+
"required": ["title", "children"],
|
|
44
|
+
},
|
|
45
|
+
"MetricStrip": {
|
|
46
|
+
"type": "object",
|
|
47
|
+
"description": "Horizontal strip of key numeric or categorical repo/audit metrics.",
|
|
48
|
+
"properties": {"children": {"type": "array", "items": {"type": "string"}}},
|
|
49
|
+
"required": ["children"],
|
|
50
|
+
},
|
|
51
|
+
"MetricTile": {
|
|
52
|
+
"type": "object",
|
|
53
|
+
"description": "Single metric card bound to a label, value, and tone.",
|
|
54
|
+
"properties": {
|
|
55
|
+
"label": {"type": ["string", "object"]},
|
|
56
|
+
"value": {"type": ["string", "number", "object"]},
|
|
57
|
+
"tone": {"type": ["string", "object"]},
|
|
58
|
+
},
|
|
59
|
+
"required": ["label", "value"],
|
|
60
|
+
},
|
|
61
|
+
"Section": {
|
|
62
|
+
"type": "object",
|
|
63
|
+
"description": "Titled content group holding cards or rows.",
|
|
64
|
+
"properties": {
|
|
65
|
+
"heading": {"type": ["string", "object"]},
|
|
66
|
+
"summary": {"type": ["string", "object"]},
|
|
67
|
+
"children": {"type": "array", "items": {"type": "string"}},
|
|
68
|
+
},
|
|
69
|
+
"required": ["heading", "children"],
|
|
70
|
+
},
|
|
71
|
+
"SuggestionCard": {
|
|
72
|
+
"type": "object",
|
|
73
|
+
"description": "Ranked /deep prompt card with priority, category, evidence list, and action trigger.",
|
|
74
|
+
"properties": {
|
|
75
|
+
"itemIndex": {"type": "integer"},
|
|
76
|
+
"priority": {"type": ["string", "object"]},
|
|
77
|
+
"kind": {"type": ["string", "object"]},
|
|
78
|
+
"title": {"type": ["string", "object"]},
|
|
79
|
+
"evidence": {"type": ["array", "object"]},
|
|
80
|
+
"prompt": {"type": ["string", "object"]},
|
|
81
|
+
"selected": {"type": ["boolean", "object"]},
|
|
82
|
+
"action": {"type": "object"},
|
|
83
|
+
},
|
|
84
|
+
"required": ["priority", "kind", "title", "prompt"],
|
|
85
|
+
},
|
|
86
|
+
"DecisionCard": {
|
|
87
|
+
"type": "object",
|
|
88
|
+
"description": "Interactive decision-frontier node with options, recommended pick, rationale, and reversal path.",
|
|
89
|
+
"properties": {
|
|
90
|
+
"itemIndex": {"type": "integer"},
|
|
91
|
+
"decisionId": {"type": "string"},
|
|
92
|
+
"question": {"type": ["string", "object"]},
|
|
93
|
+
"choice": {"type": ["string", "object"]},
|
|
94
|
+
"options": {"type": ["array", "object"]},
|
|
95
|
+
"why": {"type": ["string", "object"]},
|
|
96
|
+
"reverse": {"type": ["string", "object"]},
|
|
97
|
+
"action": {"type": "object"},
|
|
98
|
+
},
|
|
99
|
+
"required": ["decisionId", "question", "choice", "options"],
|
|
100
|
+
},
|
|
101
|
+
"FindingRow": {
|
|
102
|
+
"type": "object",
|
|
103
|
+
"description": "Audit or Prosecutor finding row with severity, kind, file location, and detail.",
|
|
104
|
+
"properties": {
|
|
105
|
+
"severity": {"type": ["string", "object"]},
|
|
106
|
+
"category": {"type": ["string", "object"]},
|
|
107
|
+
"location": {"type": ["string", "object"]},
|
|
108
|
+
"detail": {"type": ["string", "object"]},
|
|
109
|
+
},
|
|
110
|
+
"required": ["severity", "location", "detail"],
|
|
111
|
+
},
|
|
112
|
+
"ActionButton": {
|
|
113
|
+
"type": "object",
|
|
114
|
+
"description": "Explicit user action trigger emitting a v1.0 renderer_to_agent action message.",
|
|
115
|
+
"properties": {
|
|
116
|
+
"child": {"type": "string"},
|
|
117
|
+
"variant": {"type": "string"},
|
|
118
|
+
"action": {"type": "object"},
|
|
119
|
+
},
|
|
120
|
+
"required": ["child", "action"],
|
|
121
|
+
},
|
|
122
|
+
"Text": {
|
|
123
|
+
"type": "object",
|
|
124
|
+
"description": "Plain text leaf component.",
|
|
125
|
+
"properties": {"text": {"type": ["string", "object"]}},
|
|
126
|
+
"required": ["text"],
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
def _load_sibling(name: str, rel_path: str):
|
|
133
|
+
path = ASSETS_DIR / rel_path
|
|
134
|
+
spec = importlib.util.spec_from_file_location(name, path)
|
|
135
|
+
mod = importlib.util.module_from_spec(spec)
|
|
136
|
+
sys.modules[spec.name] = mod
|
|
137
|
+
spec.loader.exec_module(mod)
|
|
138
|
+
return mod
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
def sanitize_slug(slug: str) -> str:
|
|
142
|
+
cleaned = re.sub(r"[^A-Za-z0-9._-]+", "-", (slug or "").strip()).strip(".-")
|
|
143
|
+
if not cleaned:
|
|
144
|
+
return "surface"
|
|
145
|
+
return cleaned[:64]
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
def resolve_json_pointer(data: Any, pointer: str) -> tuple[bool, Any]:
|
|
149
|
+
if pointer == "/":
|
|
150
|
+
return True, data
|
|
151
|
+
if not isinstance(pointer, str) or not pointer.startswith("/"):
|
|
152
|
+
return False, None
|
|
153
|
+
cur = data
|
|
154
|
+
for raw_part in pointer.lstrip("/").split("/"):
|
|
155
|
+
part = raw_part.replace("~1", "/").replace("~0", "~")
|
|
156
|
+
if isinstance(cur, dict):
|
|
157
|
+
if part not in cur:
|
|
158
|
+
return False, None
|
|
159
|
+
cur = cur[part]
|
|
160
|
+
elif isinstance(cur, list):
|
|
161
|
+
if not part.isdigit():
|
|
162
|
+
return False, None
|
|
163
|
+
idx = int(part)
|
|
164
|
+
if idx < 0 or idx >= len(cur):
|
|
165
|
+
return False, None
|
|
166
|
+
cur = cur[idx]
|
|
167
|
+
else:
|
|
168
|
+
return False, None
|
|
169
|
+
return True, cur
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
def _matches_schema_type(val: Any, expected: str | list[str]) -> bool:
|
|
173
|
+
allowed = [expected] if isinstance(expected, str) else list(expected)
|
|
174
|
+
for t in allowed:
|
|
175
|
+
if t == "string" and isinstance(val, str):
|
|
176
|
+
return True
|
|
177
|
+
if t == "boolean" and isinstance(val, bool):
|
|
178
|
+
return True
|
|
179
|
+
if t == "integer" and isinstance(val, int) and not isinstance(val, bool):
|
|
180
|
+
return True
|
|
181
|
+
if t == "number" and isinstance(val, (int, float)) and not isinstance(val, bool):
|
|
182
|
+
return True
|
|
183
|
+
if t == "array" and isinstance(val, list):
|
|
184
|
+
return True
|
|
185
|
+
if t == "object" and isinstance(val, dict):
|
|
186
|
+
return True
|
|
187
|
+
return False
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
def _scan_component_value_for_pointers_and_scripts(
|
|
191
|
+
val: Any,
|
|
192
|
+
comp_id: str,
|
|
193
|
+
data_model: Any,
|
|
194
|
+
errors: list[str],
|
|
195
|
+
) -> None:
|
|
196
|
+
if isinstance(val, str):
|
|
197
|
+
if SCRIPT_INJECTION_RE.search(val):
|
|
198
|
+
errors.append(f"component '{comp_id}' contains forbidden executable/script pattern in string value")
|
|
199
|
+
return
|
|
200
|
+
if isinstance(val, dict):
|
|
201
|
+
if set(val.keys()) == {"@path"}:
|
|
202
|
+
ptr = val.get("@path")
|
|
203
|
+
if not isinstance(ptr, str) or not ptr.startswith("/"):
|
|
204
|
+
errors.append(f"component '{comp_id}' has invalid @path pointer {ptr!r} (must start with '/')")
|
|
205
|
+
else:
|
|
206
|
+
ok, _ = resolve_json_pointer(data_model, ptr)
|
|
207
|
+
if not ok:
|
|
208
|
+
errors.append(f"component '{comp_id}' @path {ptr!r} does not resolve in updateDataModel")
|
|
209
|
+
return
|
|
210
|
+
for k, sub in val.items():
|
|
211
|
+
if SCRIPT_INJECTION_RE.search(str(k)):
|
|
212
|
+
errors.append(f"component '{comp_id}' has forbidden pattern in property key {k!r}")
|
|
213
|
+
_scan_component_value_for_pointers_and_scripts(sub, comp_id, data_model, errors)
|
|
214
|
+
elif isinstance(val, list):
|
|
215
|
+
for item in val:
|
|
216
|
+
_scan_component_value_for_pointers_and_scripts(item, comp_id, data_model, errors)
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
def validate_a2ui_bundle(bundle: dict) -> dict:
|
|
220
|
+
errors: list[str] = []
|
|
221
|
+
if not isinstance(bundle, dict):
|
|
222
|
+
return {"valid": False, "errors": ["bundle root must be a JSON object"], "component_count": 0}
|
|
223
|
+
if bundle.get("version") != "1.0":
|
|
224
|
+
errors.append(f"bundle version must be '1.0', got {bundle.get('version')!r}")
|
|
225
|
+
|
|
226
|
+
catalog = bundle.get("catalog")
|
|
227
|
+
allowed_components: dict[str, Any] = {}
|
|
228
|
+
catalog_id = ""
|
|
229
|
+
if not isinstance(catalog, dict):
|
|
230
|
+
errors.append("missing or invalid 'catalog' object")
|
|
231
|
+
else:
|
|
232
|
+
if catalog.get("protocolVersion") != "1.0":
|
|
233
|
+
errors.append(f"catalog.protocolVersion must be '1.0', got {catalog.get('protocolVersion')!r}")
|
|
234
|
+
catalog_id = str(catalog.get("catalogId") or "")
|
|
235
|
+
if not catalog_id:
|
|
236
|
+
errors.append("catalog.catalogId must be non-empty")
|
|
237
|
+
comps = catalog.get("components")
|
|
238
|
+
if not isinstance(comps, dict) or not comps:
|
|
239
|
+
errors.append("catalog.components must be a non-empty object")
|
|
240
|
+
else:
|
|
241
|
+
allowed_components = comps
|
|
242
|
+
|
|
243
|
+
messages = bundle.get("messages")
|
|
244
|
+
if not isinstance(messages, list) or len(messages) < 3:
|
|
245
|
+
errors.append("messages must be a list containing createSurface, updateComponents, and updateDataModel")
|
|
246
|
+
return {"valid": False, "errors": errors, "component_count": 0}
|
|
247
|
+
|
|
248
|
+
known_ops = {"createSurface", "updateComponents", "updateDataModel", "deleteSurface"}
|
|
249
|
+
create_msg = None
|
|
250
|
+
update_comp_msg = None
|
|
251
|
+
update_data_msg = None
|
|
252
|
+
for idx, msg in enumerate(messages):
|
|
253
|
+
if not isinstance(msg, dict):
|
|
254
|
+
errors.append(f"messages[{idx}] must be an object")
|
|
255
|
+
continue
|
|
256
|
+
if msg.get("version") != "1.0":
|
|
257
|
+
errors.append(f"messages[{idx}].version must be '1.0', got {msg.get('version')!r}")
|
|
258
|
+
msg_ops = [k for k in msg.keys() if k != "version"]
|
|
259
|
+
unknown_ops = [k for k in msg_ops if k not in known_ops]
|
|
260
|
+
if unknown_ops:
|
|
261
|
+
errors.append(f"messages[{idx}] has unknown operation key(s): {unknown_ops}")
|
|
262
|
+
if len(msg_ops) != 1:
|
|
263
|
+
errors.append(f"messages[{idx}] must contain exactly one A2UI operation key, got {msg_ops}")
|
|
264
|
+
continue
|
|
265
|
+
op = msg_ops[0]
|
|
266
|
+
if op == "createSurface":
|
|
267
|
+
if create_msg is not None:
|
|
268
|
+
errors.append("duplicate createSurface message in initial bundle")
|
|
269
|
+
else:
|
|
270
|
+
create_msg = msg["createSurface"]
|
|
271
|
+
elif op == "updateComponents":
|
|
272
|
+
if update_comp_msg is not None:
|
|
273
|
+
errors.append("duplicate updateComponents message in initial bundle")
|
|
274
|
+
else:
|
|
275
|
+
update_comp_msg = msg["updateComponents"]
|
|
276
|
+
elif op == "updateDataModel":
|
|
277
|
+
if update_data_msg is not None:
|
|
278
|
+
errors.append("duplicate updateDataModel message in initial bundle")
|
|
279
|
+
else:
|
|
280
|
+
update_data_msg = msg["updateDataModel"]
|
|
281
|
+
|
|
282
|
+
if not isinstance(create_msg, dict):
|
|
283
|
+
errors.append("missing createSurface message")
|
|
284
|
+
if not isinstance(update_comp_msg, dict):
|
|
285
|
+
errors.append("missing updateComponents message")
|
|
286
|
+
if not isinstance(update_data_msg, dict):
|
|
287
|
+
errors.append("missing updateDataModel message")
|
|
288
|
+
if errors:
|
|
289
|
+
return {"valid": False, "errors": errors, "component_count": 0}
|
|
290
|
+
surface_id = create_msg.get("surfaceId")
|
|
291
|
+
if not isinstance(surface_id, str) or not surface_id.strip():
|
|
292
|
+
errors.append("createSurface.surfaceId must be a non-empty string")
|
|
293
|
+
if create_msg.get("catalogId") != catalog_id:
|
|
294
|
+
errors.append(f"createSurface.catalogId {create_msg.get('catalogId')!r} does not match catalog {catalog_id!r}")
|
|
295
|
+
if update_comp_msg.get("surfaceId") != surface_id:
|
|
296
|
+
errors.append("updateComponents.surfaceId does not match createSurface.surfaceId")
|
|
297
|
+
if update_data_msg.get("surfaceId") != surface_id:
|
|
298
|
+
errors.append("updateDataModel.surfaceId does not match createSurface.surfaceId")
|
|
299
|
+
if update_data_msg.get("path") != "/":
|
|
300
|
+
errors.append(f"initial updateDataModel.path must be '/', got {update_data_msg.get('path')!r}")
|
|
301
|
+
|
|
302
|
+
data_model = update_data_msg.get("value")
|
|
303
|
+
if not isinstance(data_model, dict):
|
|
304
|
+
errors.append("updateDataModel.value must be a JSON object")
|
|
305
|
+
data_model = {}
|
|
306
|
+
|
|
307
|
+
raw_components = update_comp_msg.get("components")
|
|
308
|
+
if not isinstance(raw_components, list) or not raw_components:
|
|
309
|
+
errors.append("updateComponents.components must be a non-empty flat list")
|
|
310
|
+
return {"valid": False, "errors": errors, "component_count": 0}
|
|
311
|
+
|
|
312
|
+
by_id: dict[str, dict] = {}
|
|
313
|
+
edges: dict[str, list[str]] = {}
|
|
314
|
+
for idx, comp in enumerate(raw_components):
|
|
315
|
+
if not isinstance(comp, dict):
|
|
316
|
+
errors.append(f"components[{idx}] must be an object")
|
|
317
|
+
continue
|
|
318
|
+
cid = comp.get("id")
|
|
319
|
+
ctype = comp.get("component")
|
|
320
|
+
if not isinstance(cid, str) or not cid.strip():
|
|
321
|
+
errors.append(f"components[{idx}] missing valid string 'id'")
|
|
322
|
+
continue
|
|
323
|
+
if cid in by_id:
|
|
324
|
+
errors.append(f"duplicate component id {cid!r}")
|
|
325
|
+
continue
|
|
326
|
+
if not isinstance(ctype, str) or ctype not in allowed_components:
|
|
327
|
+
errors.append(f"component '{cid}' uses uncataloged component type {ctype!r}")
|
|
328
|
+
else:
|
|
329
|
+
req_fields = allowed_components[ctype].get("required") or []
|
|
330
|
+
for req in req_fields:
|
|
331
|
+
if req not in comp:
|
|
332
|
+
errors.append(f"component '{cid}' ({ctype}) missing required property {req!r}")
|
|
333
|
+
by_id[cid] = comp
|
|
334
|
+
child_refs: list[str] = []
|
|
335
|
+
if "child" in comp:
|
|
336
|
+
if not isinstance(comp["child"], str) or not comp["child"]:
|
|
337
|
+
errors.append(f"component '{cid}'.child must be a non-empty component id string")
|
|
338
|
+
else:
|
|
339
|
+
child_refs.append(comp["child"])
|
|
340
|
+
if "children" in comp:
|
|
341
|
+
if not isinstance(comp["children"], list) or not all(isinstance(x, str) and x for x in comp["children"]):
|
|
342
|
+
errors.append(f"component '{cid}'.children must be a list of component id strings")
|
|
343
|
+
else:
|
|
344
|
+
child_refs.extend(comp["children"])
|
|
345
|
+
edges[cid] = child_refs
|
|
346
|
+
prop_defs = (allowed_components.get(comp.get("component"), {}) or {}).get("properties") or {}
|
|
347
|
+
for prop_k, prop_v in comp.items():
|
|
348
|
+
if prop_k in ("id", "component", "child", "children"):
|
|
349
|
+
continue
|
|
350
|
+
_scan_component_value_for_pointers_and_scripts(prop_v, cid, data_model, errors)
|
|
351
|
+
if prop_k in prop_defs and "type" in prop_defs[prop_k]:
|
|
352
|
+
expected_t = prop_defs[prop_k]["type"]
|
|
353
|
+
if isinstance(prop_v, dict) and set(prop_v.keys()) == {"@path"} and isinstance(prop_v.get("@path"), str):
|
|
354
|
+
ok, resolved_v = resolve_json_pointer(data_model, prop_v["@path"])
|
|
355
|
+
if ok:
|
|
356
|
+
non_obj_types = [t for t in ([expected_t] if isinstance(expected_t, str) else expected_t) if t != "object"] or expected_t
|
|
357
|
+
if not _matches_schema_type(resolved_v, non_obj_types):
|
|
358
|
+
errors.append(f"component '{cid}'.{prop_k} @path target has invalid type {type(resolved_v).__name__} (expected { non_obj_types })")
|
|
359
|
+
elif not _matches_schema_type(prop_v, expected_t):
|
|
360
|
+
errors.append(f"component '{cid}'.{prop_k} has invalid type {type(prop_v).__name__} (expected {expected_t})")
|
|
361
|
+
if "root" not in by_id:
|
|
362
|
+
errors.append("updateComponents.components must include an entry with id='root'")
|
|
363
|
+
else:
|
|
364
|
+
for cid, refs in edges.items():
|
|
365
|
+
for ref in refs:
|
|
366
|
+
if ref not in by_id:
|
|
367
|
+
errors.append(f"component '{cid}' references non-existent child id {ref!r}")
|
|
368
|
+
|
|
369
|
+
state: dict[str, int] = {}
|
|
370
|
+
reachable: set[str] = set()
|
|
371
|
+
|
|
372
|
+
def dfs(node: str) -> None:
|
|
373
|
+
state[node] = 1
|
|
374
|
+
reachable.add(node)
|
|
375
|
+
for nxt in edges.get(node, []):
|
|
376
|
+
if nxt not in by_id:
|
|
377
|
+
continue
|
|
378
|
+
st = state.get(nxt, 0)
|
|
379
|
+
if st == 1:
|
|
380
|
+
errors.append(f"cycle detected in component graph involving '{node}' -> '{nxt}'")
|
|
381
|
+
elif st == 0:
|
|
382
|
+
dfs(nxt)
|
|
383
|
+
state[node] = 2
|
|
384
|
+
|
|
385
|
+
dfs("root")
|
|
386
|
+
orphans = sorted(set(by_id.keys()) - reachable)
|
|
387
|
+
if orphans:
|
|
388
|
+
errors.append(f"unreachable orphan component(s) not connected from 'root': {orphans}")
|
|
389
|
+
|
|
390
|
+
return {
|
|
391
|
+
"valid": len(errors) == 0,
|
|
392
|
+
"surface_id": surface_id,
|
|
393
|
+
"catalog_id": catalog_id,
|
|
394
|
+
"component_count": len(by_id),
|
|
395
|
+
"errors": errors,
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
def compile_spec_to_a2ui(spec: dict, surface_id: str) -> dict:
|
|
400
|
+
title = str(spec.get("title") or "Deepmodebot Visual Cockpit")
|
|
401
|
+
subtitle = str(spec.get("subtitle") or "")
|
|
402
|
+
mode_badge = str(spec.get("mode_badge") or "A2UI 1.0 · Operate")
|
|
403
|
+
metrics = list(spec.get("metrics") or [])
|
|
404
|
+
suggestions = list(spec.get("suggestions") or [])
|
|
405
|
+
decisions = list(spec.get("decisions") or [])
|
|
406
|
+
findings = list(spec.get("findings") or [])
|
|
407
|
+
|
|
408
|
+
data_model: dict[str, Any] = {
|
|
409
|
+
"meta": {
|
|
410
|
+
"title": title,
|
|
411
|
+
"subtitle": subtitle,
|
|
412
|
+
"modeBadge": mode_badge,
|
|
413
|
+
"generatedAt": dt.datetime.now(dt.timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ"),
|
|
414
|
+
},
|
|
415
|
+
"metrics": [
|
|
416
|
+
{
|
|
417
|
+
"label": str(m.get("label") or ""),
|
|
418
|
+
"value": m.get("value", 0),
|
|
419
|
+
"tone": str(m.get("tone") or "neutral"),
|
|
420
|
+
}
|
|
421
|
+
for m in metrics
|
|
422
|
+
],
|
|
423
|
+
"suggestions": [
|
|
424
|
+
{
|
|
425
|
+
"priority": str(s.get("priority") or "P1"),
|
|
426
|
+
"kind": str(s.get("kind") or "gap"),
|
|
427
|
+
"title": str(s.get("title") or ""),
|
|
428
|
+
"evidence": [str(e) for e in (s.get("evidence") or [])],
|
|
429
|
+
"prompt": str(s.get("prompt") or ""),
|
|
430
|
+
"selected": bool(s.get("selected", idx == 0)),
|
|
431
|
+
}
|
|
432
|
+
for idx, s in enumerate(suggestions)
|
|
433
|
+
],
|
|
434
|
+
"decisions": [
|
|
435
|
+
{
|
|
436
|
+
"id": str(d.get("id") or f"d{idx + 1}"),
|
|
437
|
+
"question": str(d.get("question") or ""),
|
|
438
|
+
"choice": str(d.get("choice") or (d.get("options") or [""])[0]),
|
|
439
|
+
"options": [str(o) for o in (d.get("options") or [])] or [str(d.get("choice") or "Proceed")],
|
|
440
|
+
"why": str(d.get("why") or ""),
|
|
441
|
+
"reverse": str(d.get("reverse") or ""),
|
|
442
|
+
}
|
|
443
|
+
for idx, d in enumerate(decisions)
|
|
444
|
+
],
|
|
445
|
+
"findings": [
|
|
446
|
+
{
|
|
447
|
+
"severity": str(f.get("severity") or "P1"),
|
|
448
|
+
"category": str(f.get("category") or "audit"),
|
|
449
|
+
"location": str(f.get("location") or ""),
|
|
450
|
+
"detail": str(f.get("detail") or ""),
|
|
451
|
+
}
|
|
452
|
+
for f in findings
|
|
453
|
+
],
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
components: list[dict[str, Any]] = []
|
|
457
|
+
root_children: list[str] = []
|
|
458
|
+
|
|
459
|
+
if data_model["metrics"]:
|
|
460
|
+
metric_ids: list[str] = []
|
|
461
|
+
for idx in range(len(data_model["metrics"])):
|
|
462
|
+
mid = f"metric_{idx}"
|
|
463
|
+
metric_ids.append(mid)
|
|
464
|
+
components.append(
|
|
465
|
+
{
|
|
466
|
+
"id": mid,
|
|
467
|
+
"component": "MetricTile",
|
|
468
|
+
"label": {"@path": f"/metrics/{idx}/label"},
|
|
469
|
+
"value": {"@path": f"/metrics/{idx}/value"},
|
|
470
|
+
"tone": {"@path": f"/metrics/{idx}/tone"},
|
|
471
|
+
}
|
|
472
|
+
)
|
|
473
|
+
components.append({"id": "metrics_strip", "component": "MetricStrip", "children": metric_ids})
|
|
474
|
+
root_children.append("metrics_strip")
|
|
475
|
+
|
|
476
|
+
if data_model["decisions"]:
|
|
477
|
+
dec_ids: list[str] = []
|
|
478
|
+
for idx, dec in enumerate(data_model["decisions"]):
|
|
479
|
+
did = f"decision_{idx}"
|
|
480
|
+
dec_ids.append(did)
|
|
481
|
+
components.append(
|
|
482
|
+
{
|
|
483
|
+
"id": did,
|
|
484
|
+
"component": "DecisionCard",
|
|
485
|
+
"decisionId": dec["id"],
|
|
486
|
+
"question": {"@path": f"/decisions/{idx}/question"},
|
|
487
|
+
"choice": {"@path": f"/decisions/{idx}/choice"},
|
|
488
|
+
"options": {"@path": f"/decisions/{idx}/options"},
|
|
489
|
+
"why": {"@path": f"/decisions/{idx}/why"},
|
|
490
|
+
"reverse": {"@path": f"/decisions/{idx}/reverse"},
|
|
491
|
+
"action": {
|
|
492
|
+
"event": {
|
|
493
|
+
"name": "override_decision",
|
|
494
|
+
"context": {
|
|
495
|
+
"decisionId": dec["id"],
|
|
496
|
+
"choice": {"@path": f"/decisions/{idx}/choice"},
|
|
497
|
+
},
|
|
498
|
+
}
|
|
499
|
+
},
|
|
500
|
+
}
|
|
501
|
+
)
|
|
502
|
+
components.append(
|
|
503
|
+
{
|
|
504
|
+
"id": "decisions_section",
|
|
505
|
+
"component": "Section",
|
|
506
|
+
"heading": "Converged Decisions & Trade-offs",
|
|
507
|
+
"summary": "Agent-recommended choices pre-selected; click any option to override and export back.",
|
|
508
|
+
"children": dec_ids,
|
|
509
|
+
}
|
|
510
|
+
)
|
|
511
|
+
root_children.append("decisions_section")
|
|
512
|
+
|
|
513
|
+
if data_model["suggestions"]:
|
|
514
|
+
sug_ids: list[str] = []
|
|
515
|
+
for idx in range(len(data_model["suggestions"])):
|
|
516
|
+
sid = f"suggestion_{idx}"
|
|
517
|
+
sug_ids.append(sid)
|
|
518
|
+
components.append(
|
|
519
|
+
{
|
|
520
|
+
"id": sid,
|
|
521
|
+
"component": "SuggestionCard",
|
|
522
|
+
"itemIndex": idx,
|
|
523
|
+
"priority": {"@path": f"/suggestions/{idx}/priority"},
|
|
524
|
+
"kind": {"@path": f"/suggestions/{idx}/kind"},
|
|
525
|
+
"title": {"@path": f"/suggestions/{idx}/title"},
|
|
526
|
+
"evidence": {"@path": f"/suggestions/{idx}/evidence"},
|
|
527
|
+
"prompt": {"@path": f"/suggestions/{idx}/prompt"},
|
|
528
|
+
"selected": {"@path": f"/suggestions/{idx}/selected"},
|
|
529
|
+
"action": {
|
|
530
|
+
"event": {
|
|
531
|
+
"name": "run_suggested_prompt",
|
|
532
|
+
"context": {
|
|
533
|
+
"priority": {"@path": f"/suggestions/{idx}/priority"},
|
|
534
|
+
"prompt": {"@path": f"/suggestions/{idx}/prompt"},
|
|
535
|
+
},
|
|
536
|
+
}
|
|
537
|
+
},
|
|
538
|
+
}
|
|
539
|
+
)
|
|
540
|
+
components.append(
|
|
541
|
+
{
|
|
542
|
+
"id": "suggestions_section",
|
|
543
|
+
"component": "Section",
|
|
544
|
+
"heading": "Ranked Hardcore /deep Prompts",
|
|
545
|
+
"summary": "Filter by priority or category, inspect file:line receipts, or combine multiple prompts.",
|
|
546
|
+
"children": sug_ids,
|
|
547
|
+
}
|
|
548
|
+
)
|
|
549
|
+
root_children.append("suggestions_section")
|
|
550
|
+
|
|
551
|
+
if data_model["findings"]:
|
|
552
|
+
find_ids: list[str] = []
|
|
553
|
+
for idx in range(len(data_model["findings"])):
|
|
554
|
+
fid = f"finding_{idx}"
|
|
555
|
+
find_ids.append(fid)
|
|
556
|
+
components.append(
|
|
557
|
+
{
|
|
558
|
+
"id": fid,
|
|
559
|
+
"component": "FindingRow",
|
|
560
|
+
"severity": {"@path": f"/findings/{idx}/severity"},
|
|
561
|
+
"category": {"@path": f"/findings/{idx}/category"},
|
|
562
|
+
"location": {"@path": f"/findings/{idx}/location"},
|
|
563
|
+
"detail": {"@path": f"/findings/{idx}/detail"},
|
|
564
|
+
}
|
|
565
|
+
)
|
|
566
|
+
components.append(
|
|
567
|
+
{
|
|
568
|
+
"id": "findings_section",
|
|
569
|
+
"component": "Section",
|
|
570
|
+
"heading": "Prosecutor & Diff Audit Evidence",
|
|
571
|
+
"summary": "Verified file:line observations, risk signals, and deterministic gate checks.",
|
|
572
|
+
"children": find_ids,
|
|
573
|
+
}
|
|
574
|
+
)
|
|
575
|
+
root_children.append("findings_section")
|
|
576
|
+
|
|
577
|
+
if not root_children:
|
|
578
|
+
components.append({"id": "empty_note", "component": "Text", "text": "No findings, suggestions, or decisions in payload."})
|
|
579
|
+
root_children.append("empty_note")
|
|
580
|
+
|
|
581
|
+
components.append({"id": "export_btn_label", "component": "Text", "text": "Dispatch selection to agent"})
|
|
582
|
+
components.append(
|
|
583
|
+
{
|
|
584
|
+
"id": "export_btn",
|
|
585
|
+
"component": "ActionButton",
|
|
586
|
+
"child": "export_btn_label",
|
|
587
|
+
"variant": "primary",
|
|
588
|
+
"action": {
|
|
589
|
+
"event": {
|
|
590
|
+
"name": "submit_cockpit_selection",
|
|
591
|
+
"context": {
|
|
592
|
+
"suggestions": {"@path": "/suggestions"},
|
|
593
|
+
"decisions": {"@path": "/decisions"},
|
|
594
|
+
},
|
|
595
|
+
}
|
|
596
|
+
},
|
|
597
|
+
}
|
|
598
|
+
)
|
|
599
|
+
root_children.append("export_btn")
|
|
600
|
+
|
|
601
|
+
components.insert(
|
|
602
|
+
0,
|
|
603
|
+
{
|
|
604
|
+
"id": "root",
|
|
605
|
+
"component": "SurfaceShell",
|
|
606
|
+
"title": {"@path": "/meta/title"},
|
|
607
|
+
"subtitle": {"@path": "/meta/subtitle"},
|
|
608
|
+
"modeBadge": {"@path": "/meta/modeBadge"},
|
|
609
|
+
"children": root_children,
|
|
610
|
+
},
|
|
611
|
+
)
|
|
612
|
+
|
|
613
|
+
return {
|
|
614
|
+
"protocol": "A2UI",
|
|
615
|
+
"version": "1.0",
|
|
616
|
+
"catalog": DEFAULT_CATALOG,
|
|
617
|
+
"messages": [
|
|
618
|
+
{
|
|
619
|
+
"version": "1.0",
|
|
620
|
+
"createSurface": {
|
|
621
|
+
"surfaceId": surface_id,
|
|
622
|
+
"catalogId": CATALOG_ID,
|
|
623
|
+
},
|
|
624
|
+
},
|
|
625
|
+
{
|
|
626
|
+
"version": "1.0",
|
|
627
|
+
"updateComponents": {
|
|
628
|
+
"surfaceId": surface_id,
|
|
629
|
+
"components": components,
|
|
630
|
+
},
|
|
631
|
+
},
|
|
632
|
+
{
|
|
633
|
+
"version": "1.0",
|
|
634
|
+
"updateDataModel": {
|
|
635
|
+
"surfaceId": surface_id,
|
|
636
|
+
"path": "/",
|
|
637
|
+
"value": data_model,
|
|
638
|
+
},
|
|
639
|
+
},
|
|
640
|
+
],
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
|
|
644
|
+
def safe_json_for_html_script(payload: dict) -> str:
|
|
645
|
+
raw = json.dumps(payload, ensure_ascii=False, indent=2)
|
|
646
|
+
return raw.replace("<", "\\u003c").replace("\u2028", "\\u2028").replace("\u2029", "\\u2029")
|
|
647
|
+
|
|
648
|
+
HTML_TEMPLATE = r"""<!doctype html>
|
|
649
|
+
<html lang="en" data-theme="dark">
|
|
650
|
+
<head>
|
|
651
|
+
<meta charset="utf-8">
|
|
652
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
|
653
|
+
<meta name="color-scheme" content="dark light">
|
|
654
|
+
<title>__PAGE_TITLE__</title>
|
|
655
|
+
<style>
|
|
656
|
+
:root, [data-theme="dark"] {
|
|
657
|
+
color-scheme: dark;
|
|
658
|
+
--bg-canvas: oklch(0.145 0.011 168);
|
|
659
|
+
--bg-surface: oklch(0.185 0.012 168);
|
|
660
|
+
--bg-elevated: oklch(0.225 0.013 168);
|
|
661
|
+
--bg-subtle: oklch(0.125 0.010 168);
|
|
662
|
+
--bg-dock: oklch(0.175 0.012 168 / 0.84);
|
|
663
|
+
--fg-primary: oklch(0.935 0.009 92);
|
|
664
|
+
--fg-secondary: oklch(0.75 0.010 140);
|
|
665
|
+
--fg-muted: oklch(0.63 0.010 155);
|
|
666
|
+
--border-subtle: oklch(0.95 0.008 168 / 0.09);
|
|
667
|
+
--border-strong: oklch(0.95 0.008 168 / 0.18);
|
|
668
|
+
--rim-light: inset 0 1px 0 oklch(1 0 0 / 0.065);
|
|
669
|
+
--shadow-surface: 0 1px 2px oklch(0 0 0 / 0.28), 0 8px 24px oklch(0 0 0 / 0.18);
|
|
670
|
+
--accent: oklch(0.79 0.068 164);
|
|
671
|
+
--accent-hover: oklch(0.84 0.072 164);
|
|
672
|
+
--accent-fg: oklch(0.15 0.015 168);
|
|
673
|
+
--accent-soft: oklch(0.79 0.068 164 / 0.13);
|
|
674
|
+
--status-p0-bg: oklch(0.32 0.085 24 / 0.55);
|
|
675
|
+
--status-p0-fg: oklch(0.84 0.12 24);
|
|
676
|
+
--status-p1-bg: oklch(0.33 0.075 76 / 0.55);
|
|
677
|
+
--status-p1-fg: oklch(0.86 0.11 76);
|
|
678
|
+
--status-p2-bg: oklch(0.31 0.055 215 / 0.55);
|
|
679
|
+
--status-p2-fg: oklch(0.84 0.08 215);
|
|
680
|
+
--status-ok-bg: oklch(0.31 0.065 156 / 0.55);
|
|
681
|
+
--status-ok-fg: oklch(0.84 0.10 156);
|
|
682
|
+
--radius-sm: 6px;
|
|
683
|
+
--radius-md: 10px;
|
|
684
|
+
--font-display: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
685
|
+
--font-sans: "Inter", "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
686
|
+
--font-mono: "JetBrains Mono", "Cascadia Code", "DM Mono", ui-monospace, Menlo, Consolas, monospace;
|
|
687
|
+
}
|
|
688
|
+
[data-theme="light"] {
|
|
689
|
+
color-scheme: light;
|
|
690
|
+
--bg-canvas: oklch(0.965 0.007 92);
|
|
691
|
+
--bg-surface: oklch(0.992 0.004 92);
|
|
692
|
+
--bg-elevated: oklch(0.948 0.008 92);
|
|
693
|
+
--bg-subtle: oklch(0.935 0.009 92);
|
|
694
|
+
--bg-dock: oklch(0.985 0.005 92 / 0.86);
|
|
695
|
+
--fg-primary: oklch(0.19 0.014 168);
|
|
696
|
+
--fg-secondary: oklch(0.39 0.014 165);
|
|
697
|
+
--fg-muted: oklch(0.52 0.012 162);
|
|
698
|
+
--border-subtle: oklch(0.19 0.014 168 / 0.09);
|
|
699
|
+
--border-strong: oklch(0.19 0.014 168 / 0.18);
|
|
700
|
+
--rim-light: inset 0 1px 0 oklch(1 0 0 / 0.85);
|
|
701
|
+
--shadow-surface: 0 1px 2px oklch(0 0 0 / 0.03), 0 4px 14px oklch(0 0 0 / 0.04);
|
|
702
|
+
--accent: oklch(0.41 0.088 166);
|
|
703
|
+
--accent-hover: oklch(0.36 0.092 166);
|
|
704
|
+
--accent-fg: oklch(0.985 0.004 92);
|
|
705
|
+
--accent-soft: oklch(0.41 0.088 166 / 0.10);
|
|
706
|
+
--status-p0-bg: oklch(0.93 0.045 24);
|
|
707
|
+
--status-p0-fg: oklch(0.42 0.14 24);
|
|
708
|
+
--status-p1-bg: oklch(0.94 0.05 76);
|
|
709
|
+
--status-p1-fg: oklch(0.43 0.12 76);
|
|
710
|
+
--status-p2-bg: oklch(0.93 0.035 215);
|
|
711
|
+
--status-p2-fg: oklch(0.40 0.10 215);
|
|
712
|
+
--status-ok-bg: oklch(0.93 0.045 156);
|
|
713
|
+
--status-ok-fg: oklch(0.38 0.11 156);
|
|
714
|
+
}
|
|
715
|
+
* { box-sizing: border-box; }
|
|
716
|
+
::selection { background: var(--accent-soft); color: var(--fg-primary); }
|
|
717
|
+
body {
|
|
718
|
+
margin: 0;
|
|
719
|
+
background: var(--bg-canvas);
|
|
720
|
+
color: var(--fg-primary);
|
|
721
|
+
font-family: var(--font-sans);
|
|
722
|
+
font-size: 15px;
|
|
723
|
+
line-height: 1.55;
|
|
724
|
+
-webkit-font-smoothing: antialiased;
|
|
725
|
+
padding-bottom: 104px;
|
|
726
|
+
}
|
|
727
|
+
:focus-visible {
|
|
728
|
+
outline: 2px solid var(--accent);
|
|
729
|
+
outline-offset: 2px;
|
|
730
|
+
}
|
|
731
|
+
.shell {
|
|
732
|
+
max-width: 1140px;
|
|
733
|
+
margin: 0 auto;
|
|
734
|
+
padding: 36px 24px 48px;
|
|
735
|
+
}
|
|
736
|
+
.topbar {
|
|
737
|
+
display: flex;
|
|
738
|
+
flex-wrap: wrap;
|
|
739
|
+
justify-content: space-between;
|
|
740
|
+
align-items: flex-end;
|
|
741
|
+
gap: 16px;
|
|
742
|
+
padding-bottom: 24px;
|
|
743
|
+
margin-bottom: 24px;
|
|
744
|
+
border-bottom: 1px solid var(--border-subtle);
|
|
745
|
+
}
|
|
746
|
+
.title-group { min-width: 0; flex: 1 1 320px; }
|
|
747
|
+
.title-group h1 {
|
|
748
|
+
font-family: var(--font-display);
|
|
749
|
+
font-size: clamp(1.5rem, 2.2vw, 1.9rem);
|
|
750
|
+
font-weight: 650;
|
|
751
|
+
letter-spacing: -0.03em;
|
|
752
|
+
line-height: 1.15;
|
|
753
|
+
text-wrap: balance;
|
|
754
|
+
margin: 0 0 6px;
|
|
755
|
+
}
|
|
756
|
+
.title-group p {
|
|
757
|
+
margin: 0;
|
|
758
|
+
color: var(--fg-muted);
|
|
759
|
+
font-size: 0.82rem;
|
|
760
|
+
font-family: var(--font-mono);
|
|
761
|
+
overflow-wrap: anywhere;
|
|
762
|
+
}
|
|
763
|
+
.toolbar {
|
|
764
|
+
display: flex;
|
|
765
|
+
align-items: center;
|
|
766
|
+
gap: 8px;
|
|
767
|
+
flex-wrap: wrap;
|
|
768
|
+
}
|
|
769
|
+
.badge {
|
|
770
|
+
display: inline-flex;
|
|
771
|
+
align-items: center;
|
|
772
|
+
padding: 4px 9px;
|
|
773
|
+
border-radius: 999px;
|
|
774
|
+
font-size: 0.72rem;
|
|
775
|
+
font-weight: 600;
|
|
776
|
+
font-family: var(--font-mono);
|
|
777
|
+
background: var(--accent-soft);
|
|
778
|
+
color: var(--accent);
|
|
779
|
+
letter-spacing: 0.01em;
|
|
780
|
+
}
|
|
781
|
+
.btn {
|
|
782
|
+
min-height: 36px;
|
|
783
|
+
padding: 7px 14px;
|
|
784
|
+
border-radius: var(--radius-sm);
|
|
785
|
+
border: 1px solid var(--border-subtle);
|
|
786
|
+
background: var(--bg-surface);
|
|
787
|
+
color: var(--fg-primary);
|
|
788
|
+
font-size: 0.83rem;
|
|
789
|
+
font-weight: 550;
|
|
790
|
+
cursor: pointer;
|
|
791
|
+
box-shadow: var(--rim-light);
|
|
792
|
+
transition: transform 110ms ease-out, background-color 140ms ease-out, border-color 140ms ease-out;
|
|
793
|
+
}
|
|
794
|
+
.btn:hover { background: var(--bg-elevated); border-color: var(--border-strong); }
|
|
795
|
+
.btn:active { transform: scale(0.97); }
|
|
796
|
+
.btn-primary {
|
|
797
|
+
background: var(--accent);
|
|
798
|
+
color: var(--accent-fg);
|
|
799
|
+
border-color: transparent;
|
|
800
|
+
font-weight: 650;
|
|
801
|
+
}
|
|
802
|
+
.btn-primary:hover { background: var(--accent-hover); border-color: transparent; }
|
|
803
|
+
.metrics {
|
|
804
|
+
display: grid;
|
|
805
|
+
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
|
|
806
|
+
gap: 1px;
|
|
807
|
+
margin-bottom: 28px;
|
|
808
|
+
background: var(--border-subtle);
|
|
809
|
+
border: 1px solid var(--border-subtle);
|
|
810
|
+
border-radius: var(--radius-md);
|
|
811
|
+
box-shadow: var(--rim-light), var(--shadow-surface);
|
|
812
|
+
overflow: hidden;
|
|
813
|
+
}
|
|
814
|
+
.metric-tile {
|
|
815
|
+
background: var(--bg-surface);
|
|
816
|
+
padding: 16px 20px;
|
|
817
|
+
position: relative;
|
|
818
|
+
}
|
|
819
|
+
.metric-tile .m-label {
|
|
820
|
+
color: var(--fg-muted);
|
|
821
|
+
font-size: 0.75rem;
|
|
822
|
+
font-weight: 500;
|
|
823
|
+
margin-bottom: 6px;
|
|
824
|
+
}
|
|
825
|
+
.metric-tile .m-val {
|
|
826
|
+
font-size: 1.6rem;
|
|
827
|
+
font-weight: 650;
|
|
828
|
+
letter-spacing: -0.02em;
|
|
829
|
+
line-height: 1.1;
|
|
830
|
+
font-family: var(--font-mono);
|
|
831
|
+
font-variant-numeric: tabular-nums;
|
|
832
|
+
}
|
|
833
|
+
.metric-tile[data-tone="warn"] .m-val { color: var(--status-p0-fg); }
|
|
834
|
+
.metric-tile[data-tone="ok"] .m-val { color: var(--status-ok-fg); }
|
|
835
|
+
.controls-bar {
|
|
836
|
+
display: flex;
|
|
837
|
+
flex-wrap: wrap;
|
|
838
|
+
gap: 12px;
|
|
839
|
+
align-items: center;
|
|
840
|
+
justify-content: space-between;
|
|
841
|
+
margin-bottom: 28px;
|
|
842
|
+
padding-bottom: 16px;
|
|
843
|
+
border-bottom: 1px solid var(--border-subtle);
|
|
844
|
+
}
|
|
845
|
+
.pill-row { display: flex; flex-wrap: wrap; gap: 6px; }
|
|
846
|
+
.pill {
|
|
847
|
+
min-height: 34px;
|
|
848
|
+
padding: 6px 13px;
|
|
849
|
+
border-radius: 999px;
|
|
850
|
+
border: 1px solid transparent;
|
|
851
|
+
background: transparent;
|
|
852
|
+
color: var(--fg-secondary);
|
|
853
|
+
font-size: 0.8rem;
|
|
854
|
+
font-weight: 550;
|
|
855
|
+
cursor: pointer;
|
|
856
|
+
transition: background-color 140ms ease-out, color 140ms ease-out, border-color 140ms ease-out;
|
|
857
|
+
}
|
|
858
|
+
.pill:hover { background: var(--bg-surface); color: var(--fg-primary); }
|
|
859
|
+
.pill[aria-pressed="true"] {
|
|
860
|
+
background: var(--accent-soft);
|
|
861
|
+
color: var(--accent);
|
|
862
|
+
border-color: oklch(from var(--accent) l c h / 0.35);
|
|
863
|
+
font-weight: 650;
|
|
864
|
+
}
|
|
865
|
+
.search-input {
|
|
866
|
+
min-height: 36px;
|
|
867
|
+
min-width: 290px;
|
|
868
|
+
padding: 7px 12px;
|
|
869
|
+
border-radius: var(--radius-sm);
|
|
870
|
+
border: 1px solid var(--border-subtle);
|
|
871
|
+
background: var(--bg-subtle);
|
|
872
|
+
color: var(--fg-primary);
|
|
873
|
+
font-size: 0.84rem;
|
|
874
|
+
transition: border-color 140ms ease-out, background-color 140ms ease-out;
|
|
875
|
+
}
|
|
876
|
+
.search-input::placeholder { color: var(--fg-muted); }
|
|
877
|
+
.search-input:focus { background: var(--bg-surface); border-color: var(--accent); }
|
|
878
|
+
.card-check {
|
|
879
|
+
width: 18px;
|
|
880
|
+
height: 18px;
|
|
881
|
+
margin: 2px 2px 2px 0;
|
|
882
|
+
cursor: pointer;
|
|
883
|
+
accent-color: var(--accent);
|
|
884
|
+
flex-shrink: 0;
|
|
885
|
+
}
|
|
886
|
+
.section { margin-bottom: 36px; }
|
|
887
|
+
.section-head { margin-bottom: 16px; }
|
|
888
|
+
.section-head h2 {
|
|
889
|
+
font-family: var(--font-display);
|
|
890
|
+
font-size: 1.12rem;
|
|
891
|
+
font-weight: 650;
|
|
892
|
+
letter-spacing: -0.02em;
|
|
893
|
+
margin: 0 0 3px;
|
|
894
|
+
}
|
|
895
|
+
.section-head p {
|
|
896
|
+
margin: 0;
|
|
897
|
+
font-size: 0.84rem;
|
|
898
|
+
color: var(--fg-muted);
|
|
899
|
+
}
|
|
900
|
+
.stack { display: flex; flex-direction: column; gap: 14px; }
|
|
901
|
+
.card {
|
|
902
|
+
background: var(--bg-surface);
|
|
903
|
+
border: 1px solid var(--border-subtle);
|
|
904
|
+
border-radius: var(--radius-md);
|
|
905
|
+
padding: 18px 20px;
|
|
906
|
+
box-shadow: var(--rim-light), var(--shadow-surface);
|
|
907
|
+
transition: border-color 150ms ease-out, background-color 150ms ease-out;
|
|
908
|
+
}
|
|
909
|
+
.card:hover { border-color: var(--border-strong); }
|
|
910
|
+
.card[data-selected="true"] {
|
|
911
|
+
border-color: oklch(from var(--accent) l c h / 0.55);
|
|
912
|
+
box-shadow: inset 3px 0 0 var(--accent), var(--rim-light), var(--shadow-surface);
|
|
913
|
+
}
|
|
914
|
+
.card-top {
|
|
915
|
+
display: flex;
|
|
916
|
+
justify-content: space-between;
|
|
917
|
+
align-items: flex-start;
|
|
918
|
+
gap: 14px;
|
|
919
|
+
margin-bottom: 12px;
|
|
920
|
+
}
|
|
921
|
+
.card-title-row {
|
|
922
|
+
display: flex;
|
|
923
|
+
align-items: center;
|
|
924
|
+
gap: 10px;
|
|
925
|
+
flex-wrap: wrap;
|
|
926
|
+
min-width: 0;
|
|
927
|
+
}
|
|
928
|
+
.prio {
|
|
929
|
+
font-family: var(--font-mono);
|
|
930
|
+
font-size: 0.72rem;
|
|
931
|
+
font-weight: 700;
|
|
932
|
+
padding: 2px 7px;
|
|
933
|
+
border-radius: 4px;
|
|
934
|
+
letter-spacing: 0.02em;
|
|
935
|
+
}
|
|
936
|
+
.prio-P0 { background: var(--status-p0-bg); color: var(--status-p0-fg); }
|
|
937
|
+
.prio-P1 { background: var(--status-p1-bg); color: var(--status-p1-fg); }
|
|
938
|
+
.prio-P2 { background: var(--status-p2-bg); color: var(--status-p2-fg); }
|
|
939
|
+
.kind-tag {
|
|
940
|
+
font-family: var(--font-mono);
|
|
941
|
+
font-size: 0.72rem;
|
|
942
|
+
color: var(--fg-muted);
|
|
943
|
+
padding: 2px 6px;
|
|
944
|
+
background: var(--bg-subtle);
|
|
945
|
+
border-radius: 4px;
|
|
946
|
+
}
|
|
947
|
+
.card h3 {
|
|
948
|
+
margin: 0;
|
|
949
|
+
font-size: 0.98rem;
|
|
950
|
+
font-weight: 600;
|
|
951
|
+
letter-spacing: -0.01em;
|
|
952
|
+
}
|
|
953
|
+
.evidence-list {
|
|
954
|
+
display: flex;
|
|
955
|
+
flex-wrap: wrap;
|
|
956
|
+
gap: 6px;
|
|
957
|
+
margin: 0 0 12px;
|
|
958
|
+
padding: 0;
|
|
959
|
+
list-style: none;
|
|
960
|
+
}
|
|
961
|
+
.evidence-list li {
|
|
962
|
+
font-family: var(--font-mono);
|
|
963
|
+
font-size: 0.74rem;
|
|
964
|
+
background: var(--bg-subtle);
|
|
965
|
+
color: var(--fg-secondary);
|
|
966
|
+
padding: 3px 8px;
|
|
967
|
+
border-radius: 4px;
|
|
968
|
+
max-width: 100%;
|
|
969
|
+
overflow-wrap: anywhere;
|
|
970
|
+
}
|
|
971
|
+
.prompt-box {
|
|
972
|
+
margin: 0;
|
|
973
|
+
padding: 13px 15px;
|
|
974
|
+
background: var(--bg-subtle);
|
|
975
|
+
border-radius: var(--radius-sm);
|
|
976
|
+
font-family: var(--font-mono);
|
|
977
|
+
font-size: 0.8rem;
|
|
978
|
+
line-height: 1.55;
|
|
979
|
+
color: var(--fg-primary);
|
|
980
|
+
white-space: pre-wrap;
|
|
981
|
+
word-break: break-word;
|
|
982
|
+
}
|
|
983
|
+
.options-grid {
|
|
984
|
+
display: flex;
|
|
985
|
+
flex-wrap: wrap;
|
|
986
|
+
gap: 8px;
|
|
987
|
+
margin: 12px 0;
|
|
988
|
+
}
|
|
989
|
+
.opt-btn {
|
|
990
|
+
min-height: 36px;
|
|
991
|
+
padding: 7px 14px;
|
|
992
|
+
border-radius: var(--radius-sm);
|
|
993
|
+
border: 1px solid var(--border-subtle);
|
|
994
|
+
background: var(--bg-subtle);
|
|
995
|
+
color: var(--fg-secondary);
|
|
996
|
+
font-size: 0.83rem;
|
|
997
|
+
font-weight: 500;
|
|
998
|
+
cursor: pointer;
|
|
999
|
+
transition: background-color 130ms ease-out, border-color 130ms ease-out, color 130ms ease-out;
|
|
1000
|
+
}
|
|
1001
|
+
.opt-btn:hover { background: var(--bg-elevated); color: var(--fg-primary); }
|
|
1002
|
+
.opt-btn[aria-checked="true"] {
|
|
1003
|
+
background: var(--accent-soft);
|
|
1004
|
+
border-color: var(--accent);
|
|
1005
|
+
color: var(--accent);
|
|
1006
|
+
font-weight: 650;
|
|
1007
|
+
}
|
|
1008
|
+
.meta-note {
|
|
1009
|
+
font-size: 0.82rem;
|
|
1010
|
+
color: var(--fg-secondary);
|
|
1011
|
+
margin: 6px 0 0;
|
|
1012
|
+
}
|
|
1013
|
+
.finding-row {
|
|
1014
|
+
display: grid;
|
|
1015
|
+
grid-template-columns: auto auto minmax(0, 1fr) minmax(0, 2fr);
|
|
1016
|
+
gap: 12px;
|
|
1017
|
+
align-items: center;
|
|
1018
|
+
padding: 12px 16px;
|
|
1019
|
+
background: var(--bg-surface);
|
|
1020
|
+
border-bottom: 1px solid var(--border-subtle);
|
|
1021
|
+
font-size: 0.84rem;
|
|
1022
|
+
}
|
|
1023
|
+
.finding-row > * { min-width: 0; overflow-wrap: anywhere; }
|
|
1024
|
+
.finding-row .prio, .finding-row .kind-tag { justify-self: start; }
|
|
1025
|
+
.finding-row:first-child { border-radius: var(--radius-md) var(--radius-md) 0 0; }
|
|
1026
|
+
.finding-row:last-child { border-bottom: 0; border-radius: 0 0 var(--radius-md) var(--radius-md); }
|
|
1027
|
+
.finding-row:only-child { border-radius: var(--radius-md); }
|
|
1028
|
+
.dock {
|
|
1029
|
+
position: fixed;
|
|
1030
|
+
bottom: 0;
|
|
1031
|
+
left: 0;
|
|
1032
|
+
right: 0;
|
|
1033
|
+
background: var(--bg-dock);
|
|
1034
|
+
backdrop-filter: blur(16px) saturate(1.5);
|
|
1035
|
+
-webkit-backdrop-filter: blur(16px) saturate(1.5);
|
|
1036
|
+
border-top: 1px solid var(--border-strong);
|
|
1037
|
+
box-shadow: var(--rim-light);
|
|
1038
|
+
padding: 12px 24px calc(12px + env(safe-area-inset-bottom, 0px));
|
|
1039
|
+
z-index: 20;
|
|
1040
|
+
}
|
|
1041
|
+
.dock-inner {
|
|
1042
|
+
max-width: 1140px;
|
|
1043
|
+
margin: 0 auto;
|
|
1044
|
+
display: flex;
|
|
1045
|
+
flex-wrap: wrap;
|
|
1046
|
+
justify-content: space-between;
|
|
1047
|
+
align-items: center;
|
|
1048
|
+
gap: 12px;
|
|
1049
|
+
}
|
|
1050
|
+
.status-toast {
|
|
1051
|
+
font-size: 0.82rem;
|
|
1052
|
+
color: var(--fg-secondary);
|
|
1053
|
+
font-family: var(--font-mono);
|
|
1054
|
+
}
|
|
1055
|
+
@media (pointer: coarse), (max-width: 720px) {
|
|
1056
|
+
.btn, .pill, .opt-btn, .search-input { min-height: 44px; min-width: 44px; }
|
|
1057
|
+
.shell { padding: 20px 16px 40px; }
|
|
1058
|
+
.search-input { min-width: 0; width: 100%; }
|
|
1059
|
+
.card-top { flex-direction: column; align-items: stretch; }
|
|
1060
|
+
.finding-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
|
|
1061
|
+
.dock { padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); }
|
|
1062
|
+
}
|
|
1063
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1064
|
+
.btn, .pill, .opt-btn, .card, .search-input { transition: none; }
|
|
1065
|
+
}
|
|
1066
|
+
</style>
|
|
1067
|
+
</head>
|
|
1068
|
+
<body>
|
|
1069
|
+
<script id="a2ui-payload" type="application/a2ui+json">
|
|
1070
|
+
__A2UI_JSON__
|
|
1071
|
+
</script>
|
|
1072
|
+
<main id="a2ui-root" class="shell" aria-live="polite"></main>
|
|
1073
|
+
<footer class="dock" role="region" aria-label="Agent dispatch bar">
|
|
1074
|
+
<div class="dock-inner">
|
|
1075
|
+
<div id="dock-summary" class="status-toast">Ready</div>
|
|
1076
|
+
<div class="toolbar">
|
|
1077
|
+
<button id="copy-combined-btn" type="button" class="btn btn-primary">Copy selected /deep prompt</button>
|
|
1078
|
+
<button id="copy-action-btn" type="button" class="btn">Copy A2UI 1.0 action JSON</button>
|
|
1079
|
+
</div>
|
|
1080
|
+
</div>
|
|
1081
|
+
</footer>
|
|
1082
|
+
<script>
|
|
1083
|
+
(() => {
|
|
1084
|
+
const raw = document.getElementById("a2ui-payload").textContent;
|
|
1085
|
+
const bundle = JSON.parse(raw);
|
|
1086
|
+
const createMsg = bundle.messages.find(m => m.createSurface).createSurface;
|
|
1087
|
+
const compList = bundle.messages.find(m => m.updateComponents).updateComponents.components;
|
|
1088
|
+
const dataModel = JSON.parse(JSON.stringify(bundle.messages.find(m => m.updateDataModel).updateDataModel.value));
|
|
1089
|
+
const compMap = new Map(compList.map(c => [c.id, c]));
|
|
1090
|
+
let activePrio = "ALL";
|
|
1091
|
+
let searchQuery = "";
|
|
1092
|
+
let lastActionMessage = null;
|
|
1093
|
+
|
|
1094
|
+
function getPointer(obj, ptr) {
|
|
1095
|
+
if (ptr === "/") return obj;
|
|
1096
|
+
if (typeof ptr !== "string" || !ptr.startsWith("/")) return undefined;
|
|
1097
|
+
let cur = obj;
|
|
1098
|
+
for (const seg of ptr.slice(1).split("/")) {
|
|
1099
|
+
const key = seg.replace(/~1/g, "/").replace(/~0/g, "~");
|
|
1100
|
+
if (cur == null) return undefined;
|
|
1101
|
+
cur = Array.isArray(cur) ? cur[Number(key)] : cur[key];
|
|
1102
|
+
}
|
|
1103
|
+
return cur;
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
const FORBIDDEN_KEYS = new Set(["__proto__", "constructor", "prototype"]);
|
|
1107
|
+
function setPointer(obj, ptr, val) {
|
|
1108
|
+
if (typeof ptr !== "string" || !ptr.startsWith("/") || ptr === "/") return false;
|
|
1109
|
+
const parts = ptr.slice(1).split("/").map(s => s.replace(/~1/g, "/").replace(/~0/g, "~"));
|
|
1110
|
+
let cur = obj;
|
|
1111
|
+
for (let i = 0; i < parts.length - 1; i++) {
|
|
1112
|
+
if (cur == null || typeof cur !== "object" || FORBIDDEN_KEYS.has(parts[i])) return false;
|
|
1113
|
+
const k = Array.isArray(cur) ? Number(parts[i]) : parts[i];
|
|
1114
|
+
cur = cur[k];
|
|
1115
|
+
}
|
|
1116
|
+
const rawLeaf = parts[parts.length - 1];
|
|
1117
|
+
if (cur == null || typeof cur !== "object" || FORBIDDEN_KEYS.has(rawLeaf)) return false;
|
|
1118
|
+
const leaf = Array.isArray(cur) ? Number(rawLeaf) : rawLeaf;
|
|
1119
|
+
if (Array.isArray(cur) && (!Number.isInteger(leaf) || leaf < 0 || leaf >= cur.length)) return false;
|
|
1120
|
+
cur[leaf] = val;
|
|
1121
|
+
return true;
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1124
|
+
function resolveProp(prop) {
|
|
1125
|
+
if (prop && typeof prop === "object" && !Array.isArray(prop) && Object.keys(prop).length === 1 && "@path" in prop) {
|
|
1126
|
+
return getPointer(dataModel, prop["@path"]);
|
|
1127
|
+
}
|
|
1128
|
+
if (Array.isArray(prop)) return prop.map(resolveProp);
|
|
1129
|
+
if (prop && typeof prop === "object") {
|
|
1130
|
+
const out = {};
|
|
1131
|
+
for (const [k, v] of Object.entries(prop)) out[k] = resolveProp(v);
|
|
1132
|
+
return out;
|
|
1133
|
+
}
|
|
1134
|
+
return prop;
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
function emitAction(sourceId, actionSpec) {
|
|
1138
|
+
if (!actionSpec || !actionSpec.event) return null;
|
|
1139
|
+
const msg = {
|
|
1140
|
+
version: "1.0",
|
|
1141
|
+
action: {
|
|
1142
|
+
name: actionSpec.event.name,
|
|
1143
|
+
surfaceId: createMsg.surfaceId,
|
|
1144
|
+
sourceComponentId: sourceId,
|
|
1145
|
+
timestamp: new Date().toISOString(),
|
|
1146
|
+
context: resolveProp(actionSpec.event.context || {})
|
|
1147
|
+
}
|
|
1148
|
+
};
|
|
1149
|
+
lastActionMessage = msg;
|
|
1150
|
+
return msg;
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
function el(tag, attrs = {}, children = []) {
|
|
1154
|
+
const node = document.createElement(tag);
|
|
1155
|
+
for (const [k, v] of Object.entries(attrs)) {
|
|
1156
|
+
if (v === undefined || v === null) continue;
|
|
1157
|
+
if (k === "className") node.className = v;
|
|
1158
|
+
else if (k === "textContent") node.textContent = String(v);
|
|
1159
|
+
else if (k.startsWith("on") && typeof v === "function") node.addEventListener(k.slice(2).toLowerCase(), v);
|
|
1160
|
+
else node.setAttribute(k, String(v));
|
|
1161
|
+
}
|
|
1162
|
+
for (const ch of children) {
|
|
1163
|
+
if (ch == null) continue;
|
|
1164
|
+
node.appendChild(typeof ch === "string" ? document.createTextNode(ch) : ch);
|
|
1165
|
+
}
|
|
1166
|
+
return node;
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
async function copyText(text, label) {
|
|
1170
|
+
try {
|
|
1171
|
+
await navigator.clipboard.writeText(text);
|
|
1172
|
+
setToast(label);
|
|
1173
|
+
} catch (_err) {
|
|
1174
|
+
const ta = el("textarea", { style: "position:fixed;opacity:0" });
|
|
1175
|
+
ta.value = text;
|
|
1176
|
+
document.body.appendChild(ta);
|
|
1177
|
+
ta.select();
|
|
1178
|
+
document.execCommand("copy");
|
|
1179
|
+
ta.remove();
|
|
1180
|
+
setToast(label);
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
function setToast(msg) {
|
|
1185
|
+
const dock = document.getElementById("dock-summary");
|
|
1186
|
+
if (dock) dock.textContent = msg;
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
function matchesFilter(textBlob, prio) {
|
|
1190
|
+
if (activePrio !== "ALL" && prio !== activePrio) return false;
|
|
1191
|
+
if (!searchQuery) return true;
|
|
1192
|
+
return textBlob.toLowerCase().includes(searchQuery.toLowerCase());
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1195
|
+
function renderNode(id) {
|
|
1196
|
+
const comp = compMap.get(id);
|
|
1197
|
+
if (!comp) return null;
|
|
1198
|
+
const type = comp.component;
|
|
1199
|
+
|
|
1200
|
+
if (type === "Text") {
|
|
1201
|
+
return el("span", { textContent: resolveProp(comp.text) });
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
if (type === "MetricStrip") {
|
|
1205
|
+
return el("section", { className: "metrics", "aria-label": "Repository and audit metrics" }, (comp.children || []).map(renderNode));
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
if (type === "MetricTile") {
|
|
1209
|
+
const tone = resolveProp(comp.tone) || "neutral";
|
|
1210
|
+
return el("div", { className: "metric-tile", "data-tone": tone }, [
|
|
1211
|
+
el("div", { className: "m-label", textContent: resolveProp(comp.label) }),
|
|
1212
|
+
el("div", { className: "m-val", textContent: resolveProp(comp.value) })
|
|
1213
|
+
]);
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
if (type === "Section") {
|
|
1217
|
+
const renderedChildren = (comp.children || []).map(renderNode).filter(Boolean);
|
|
1218
|
+
if (renderedChildren.length === 0) return null;
|
|
1219
|
+
return el("section", { className: "section" }, [
|
|
1220
|
+
el("div", { className: "section-head" }, [
|
|
1221
|
+
el("h2", { textContent: resolveProp(comp.heading) }),
|
|
1222
|
+
comp.summary ? el("p", { textContent: resolveProp(comp.summary) }) : null
|
|
1223
|
+
]),
|
|
1224
|
+
el("div", { className: "stack" }, renderedChildren)
|
|
1225
|
+
]);
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
if (type === "SuggestionCard") {
|
|
1229
|
+
const idx = comp.itemIndex;
|
|
1230
|
+
const prio = resolveProp(comp.priority);
|
|
1231
|
+
const kind = resolveProp(comp.kind);
|
|
1232
|
+
const title = resolveProp(comp.title);
|
|
1233
|
+
const evidence = resolveProp(comp.evidence) || [];
|
|
1234
|
+
const prompt = resolveProp(comp.prompt);
|
|
1235
|
+
const selected = Boolean(resolveProp(comp.selected));
|
|
1236
|
+
const blob = [prio, kind, title, prompt, ...evidence].join(" ");
|
|
1237
|
+
if (!matchesFilter(blob, prio)) return null;
|
|
1238
|
+
|
|
1239
|
+
const selPtr = (comp.selected && typeof comp.selected === "object" && comp.selected["@path"])
|
|
1240
|
+
? comp.selected["@path"]
|
|
1241
|
+
: ("/suggestions/" + idx + "/selected");
|
|
1242
|
+
const checkbox = el("input", {
|
|
1243
|
+
type: "checkbox",
|
|
1244
|
+
className: "card-check",
|
|
1245
|
+
"data-focus-key": "chk:" + id,
|
|
1246
|
+
"aria-label": "Select " + title,
|
|
1247
|
+
onChange: (e) => {
|
|
1248
|
+
setPointer(dataModel, selPtr, e.target.checked);
|
|
1249
|
+
renderSurface("chk:" + id);
|
|
1250
|
+
}
|
|
1251
|
+
});
|
|
1252
|
+
checkbox.checked = selected;
|
|
1253
|
+
|
|
1254
|
+
return el("article", { className: "card", "data-selected": String(selected) }, [
|
|
1255
|
+
el("div", { className: "card-top" }, [
|
|
1256
|
+
el("div", { className: "card-title-row" }, [
|
|
1257
|
+
checkbox,
|
|
1258
|
+
el("span", { className: "prio prio-" + prio, textContent: prio }),
|
|
1259
|
+
el("span", { className: "kind-tag", textContent: kind }),
|
|
1260
|
+
el("h3", { textContent: title })
|
|
1261
|
+
]),
|
|
1262
|
+
el("button", {
|
|
1263
|
+
type: "button",
|
|
1264
|
+
className: "btn",
|
|
1265
|
+
"data-focus-key": "btn:" + id,
|
|
1266
|
+
textContent: "Copy /deep prompt",
|
|
1267
|
+
onClick: () => {
|
|
1268
|
+
emitAction(id, comp.action);
|
|
1269
|
+
copyText(prompt, "Copied [" + prio + "] /deep prompt to clipboard");
|
|
1270
|
+
}
|
|
1271
|
+
})
|
|
1272
|
+
]),
|
|
1273
|
+
evidence.length ? el("ul", { className: "evidence-list", "aria-label": "Evidence anchors" }, evidence.map(ev => el("li", { textContent: ev }))) : null,
|
|
1274
|
+
el("pre", { className: "prompt-box", textContent: prompt })
|
|
1275
|
+
]);
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
if (type === "DecisionCard") {
|
|
1279
|
+
const choicePtr = (comp.choice && typeof comp.choice === "object" && comp.choice["@path"])
|
|
1280
|
+
? comp.choice["@path"]
|
|
1281
|
+
: ("/decisions/" + (Number.isInteger(comp.itemIndex) ? comp.itemIndex : 0) + "/choice");
|
|
1282
|
+
const question = resolveProp(comp.question);
|
|
1283
|
+
const choice = resolveProp(comp.choice);
|
|
1284
|
+
const options = resolveProp(comp.options) || [];
|
|
1285
|
+
const why = resolveProp(comp.why);
|
|
1286
|
+
const reverse = resolveProp(comp.reverse);
|
|
1287
|
+
const searchBlob = [comp.decisionId || "", question, choice, why || "", reverse || "", ...options].join(" ").toLowerCase();
|
|
1288
|
+
if (searchQuery && !searchBlob.includes(searchQuery.toLowerCase())) return null;
|
|
1289
|
+
|
|
1290
|
+
const selectOption = (opt, optIdx) => {
|
|
1291
|
+
setPointer(dataModel, choicePtr, opt);
|
|
1292
|
+
emitAction(id, comp.action);
|
|
1293
|
+
renderSurface("opt:" + id + ":" + optIdx);
|
|
1294
|
+
};
|
|
1295
|
+
|
|
1296
|
+
return el("article", { className: "card", "data-selected": "true" }, [
|
|
1297
|
+
el("div", { className: "card-title-row" }, [
|
|
1298
|
+
el("span", { className: "kind-tag", textContent: comp.decisionId }),
|
|
1299
|
+
el("h3", { textContent: question })
|
|
1300
|
+
]),
|
|
1301
|
+
el("div", {
|
|
1302
|
+
className: "options-grid",
|
|
1303
|
+
role: "radiogroup",
|
|
1304
|
+
"aria-label": question,
|
|
1305
|
+
onKeydown: (e) => {
|
|
1306
|
+
if (!["ArrowRight", "ArrowDown", "ArrowLeft", "ArrowUp"].includes(e.key) || !options.length) return;
|
|
1307
|
+
e.preventDefault();
|
|
1308
|
+
const curIdx = Math.max(0, options.indexOf(choice));
|
|
1309
|
+
const delta = (e.key === "ArrowRight" || e.key === "ArrowDown") ? 1 : -1;
|
|
1310
|
+
const nextIdx = (curIdx + delta + options.length) % options.length;
|
|
1311
|
+
selectOption(options[nextIdx], nextIdx);
|
|
1312
|
+
}
|
|
1313
|
+
}, options.map((opt, optIdx) => el("button", {
|
|
1314
|
+
type: "button",
|
|
1315
|
+
role: "radio",
|
|
1316
|
+
className: "opt-btn",
|
|
1317
|
+
"data-focus-key": "opt:" + id + ":" + optIdx,
|
|
1318
|
+
tabIndex: (opt === choice || (options.indexOf(choice) < 0 && optIdx === 0)) ? 0 : -1,
|
|
1319
|
+
"aria-checked": String(opt === choice),
|
|
1320
|
+
textContent: opt,
|
|
1321
|
+
onClick: () => selectOption(opt, optIdx)
|
|
1322
|
+
}))),
|
|
1323
|
+
why ? el("p", { className: "meta-note", textContent: "Why: " + why }) : null,
|
|
1324
|
+
reverse ? el("p", { className: "meta-note", textContent: "Reversal path: " + reverse }) : null
|
|
1325
|
+
]);
|
|
1326
|
+
}
|
|
1327
|
+
|
|
1328
|
+
if (type === "FindingRow") {
|
|
1329
|
+
const sev = resolveProp(comp.severity);
|
|
1330
|
+
const cat = resolveProp(comp.category);
|
|
1331
|
+
const loc = resolveProp(comp.location);
|
|
1332
|
+
const detail = resolveProp(comp.detail);
|
|
1333
|
+
if (!matchesFilter([sev, cat, loc, detail].join(" "), sev)) return null;
|
|
1334
|
+
return el("div", { className: "finding-row" }, [
|
|
1335
|
+
el("span", { className: "prio prio-" + (sev === "P0" || sev === "P1" || sev === "P2" ? sev : "P1"), textContent: sev }),
|
|
1336
|
+
el("span", { className: "kind-tag", textContent: cat }),
|
|
1337
|
+
el("code", { textContent: loc }),
|
|
1338
|
+
el("span", { textContent: detail })
|
|
1339
|
+
]);
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
if (type === "ActionButton") {
|
|
1343
|
+
if (id === "export_btn") return null;
|
|
1344
|
+
const labelNode = comp.child ? renderNode(comp.child) : "Run action";
|
|
1345
|
+
const cls = comp.variant === "primary" ? "btn btn-primary" : "btn";
|
|
1346
|
+
return el("button", {
|
|
1347
|
+
type: "button",
|
|
1348
|
+
className: cls,
|
|
1349
|
+
"data-focus-key": "act:" + id,
|
|
1350
|
+
onClick: () => {
|
|
1351
|
+
const msg = emitAction(id, comp.action);
|
|
1352
|
+
if (msg) setToast("Dispatched A2UI action: " + msg.action.name);
|
|
1353
|
+
}
|
|
1354
|
+
}, [labelNode]);
|
|
1355
|
+
}
|
|
1356
|
+
|
|
1357
|
+
if (type === "SurfaceShell") {
|
|
1358
|
+
const hasFilterable = Boolean(
|
|
1359
|
+
(dataModel.suggestions && dataModel.suggestions.length > 0) ||
|
|
1360
|
+
(dataModel.findings && dataModel.findings.length > 0) ||
|
|
1361
|
+
(dataModel.decisions && dataModel.decisions.length > 0)
|
|
1362
|
+
);
|
|
1363
|
+
const searchInput = el("input", {
|
|
1364
|
+
type: "search",
|
|
1365
|
+
id: "cockpit-search",
|
|
1366
|
+
"data-focus-key": "search",
|
|
1367
|
+
className: "search-input",
|
|
1368
|
+
placeholder: "Filter by file, rule, or keyword (/ to focus)",
|
|
1369
|
+
"aria-label": "Filter items",
|
|
1370
|
+
value: searchQuery,
|
|
1371
|
+
onInput: (e) => {
|
|
1372
|
+
searchQuery = e.target.value;
|
|
1373
|
+
renderBodyOnly();
|
|
1374
|
+
}
|
|
1375
|
+
});
|
|
1376
|
+
|
|
1377
|
+
const header = el("header", { className: "topbar" }, [
|
|
1378
|
+
el("div", { className: "title-group" }, [
|
|
1379
|
+
el("h1", { textContent: resolveProp(comp.title) }),
|
|
1380
|
+
el("p", { textContent: resolveProp(comp.subtitle) })
|
|
1381
|
+
]),
|
|
1382
|
+
el("div", { className: "toolbar" }, [
|
|
1383
|
+
el("span", { className: "badge", textContent: resolveProp(comp.modeBadge) }),
|
|
1384
|
+
el("button", {
|
|
1385
|
+
type: "button",
|
|
1386
|
+
className: "btn",
|
|
1387
|
+
"data-focus-key": "theme-toggle",
|
|
1388
|
+
textContent: "Toggle theme",
|
|
1389
|
+
onClick: () => {
|
|
1390
|
+
const cur = document.documentElement.getAttribute("data-theme") || "dark";
|
|
1391
|
+
document.documentElement.setAttribute("data-theme", cur === "dark" ? "light" : "dark");
|
|
1392
|
+
}
|
|
1393
|
+
})
|
|
1394
|
+
])
|
|
1395
|
+
]);
|
|
1396
|
+
|
|
1397
|
+
const controls = hasFilterable ? el("div", { className: "controls-bar" }, [
|
|
1398
|
+
el("div", { className: "pill-row", role: "group", "aria-label": "Filter by priority" }, ["ALL", "P0", "P1", "P2"].map(p => el("button", {
|
|
1399
|
+
type: "button",
|
|
1400
|
+
className: "pill",
|
|
1401
|
+
"data-focus-key": "pill:" + p,
|
|
1402
|
+
"aria-pressed": String(activePrio === p),
|
|
1403
|
+
textContent: p === "ALL" ? "All priorities" : p,
|
|
1404
|
+
onClick: () => {
|
|
1405
|
+
activePrio = p;
|
|
1406
|
+
renderSurface("pill:" + p);
|
|
1407
|
+
}
|
|
1408
|
+
}))),
|
|
1409
|
+
searchInput
|
|
1410
|
+
]) : null;
|
|
1411
|
+
|
|
1412
|
+
const bodyContainer = el("div", { id: "cockpit-body" }, (comp.children || []).map(renderNode));
|
|
1413
|
+
return el("div", {}, [header, controls, bodyContainer]);
|
|
1414
|
+
}
|
|
1415
|
+
return null;
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
function renderBodyOnly() {
|
|
1419
|
+
const body = document.getElementById("cockpit-body");
|
|
1420
|
+
const rootComp = compMap.get("root");
|
|
1421
|
+
if (!body || !rootComp) return;
|
|
1422
|
+
body.replaceChildren(...(rootComp.children || []).map(renderNode).filter(Boolean));
|
|
1423
|
+
updateDockSummary();
|
|
1424
|
+
}
|
|
1425
|
+
|
|
1426
|
+
function updateDockSummary() {
|
|
1427
|
+
const selectedSug = (dataModel.suggestions || []).filter(s => s.selected).length;
|
|
1428
|
+
const decCount = (dataModel.decisions || []).length;
|
|
1429
|
+
const parts = [];
|
|
1430
|
+
if (dataModel.suggestions && dataModel.suggestions.length) parts.push(selectedSug + " of " + dataModel.suggestions.length + " prompt(s) selected");
|
|
1431
|
+
if (decCount) parts.push(decCount + " decision(s) active");
|
|
1432
|
+
setToast(parts.join(" · ") || "A2UI 1.0 surface ready");
|
|
1433
|
+
}
|
|
1434
|
+
|
|
1435
|
+
function buildCombinedPrompt() {
|
|
1436
|
+
const chosen = (dataModel.suggestions || []).filter(s => s.selected);
|
|
1437
|
+
const decs = dataModel.decisions || [];
|
|
1438
|
+
const lines = [];
|
|
1439
|
+
if (chosen.length === 1 && decs.length === 0) return chosen[0].prompt;
|
|
1440
|
+
if (chosen.length > 0) {
|
|
1441
|
+
lines.push("/deep [HARDCORE MODE] Execute the following selected full-scope deliverables end-to-end:");
|
|
1442
|
+
chosen.forEach((s, idx) => {
|
|
1443
|
+
lines.push((idx + 1) + ". [" + s.priority + "/" + s.kind + "] " + s.title + ": " + s.prompt.replace(/^\/deep\s+/i, ""));
|
|
1444
|
+
});
|
|
1445
|
+
}
|
|
1446
|
+
if (decs.length > 0) {
|
|
1447
|
+
lines.push("Locked decisions from cockpit:");
|
|
1448
|
+
decs.forEach(d => lines.push("- " + d.id + " (" + d.question + "): " + d.choice));
|
|
1449
|
+
}
|
|
1450
|
+
return lines.join("\n") || "/deep Inspect repository and propose next steps.";
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
function renderSurface(focusKey) {
|
|
1454
|
+
const prevKey = focusKey || (document.activeElement && document.activeElement.getAttribute && document.activeElement.getAttribute("data-focus-key"));
|
|
1455
|
+
const mount = document.getElementById("a2ui-root");
|
|
1456
|
+
mount.replaceChildren(renderNode("root"));
|
|
1457
|
+
updateDockSummary();
|
|
1458
|
+
if (prevKey) {
|
|
1459
|
+
const nextEl = mount.querySelector('[data-focus-key="' + CSS.escape(prevKey) + '"]');
|
|
1460
|
+
if (nextEl && typeof nextEl.focus === "function") nextEl.focus();
|
|
1461
|
+
}
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
document.getElementById("copy-combined-btn").addEventListener("click", () => {
|
|
1465
|
+
const exportComp = compMap.get("export_btn");
|
|
1466
|
+
if (exportComp) emitAction("export_btn", exportComp.action);
|
|
1467
|
+
copyText(buildCombinedPrompt(), "Copied combined /deep prompt to clipboard");
|
|
1468
|
+
});
|
|
1469
|
+
|
|
1470
|
+
document.getElementById("copy-action-btn").addEventListener("click", () => {
|
|
1471
|
+
let msg = lastActionMessage;
|
|
1472
|
+
if (!msg) {
|
|
1473
|
+
const exportComp = compMap.get("export_btn");
|
|
1474
|
+
msg = exportComp ? emitAction("export_btn", exportComp.action) : {
|
|
1475
|
+
version: "1.0",
|
|
1476
|
+
action: {
|
|
1477
|
+
name: "submit_cockpit_selection",
|
|
1478
|
+
surfaceId: createMsg.surfaceId,
|
|
1479
|
+
sourceComponentId: "root",
|
|
1480
|
+
timestamp: new Date().toISOString(),
|
|
1481
|
+
context: dataModel
|
|
1482
|
+
}
|
|
1483
|
+
};
|
|
1484
|
+
}
|
|
1485
|
+
copyText(JSON.stringify(msg, null, 2), "Copied A2UI 1.0 renderer_to_agent action JSON");
|
|
1486
|
+
});
|
|
1487
|
+
|
|
1488
|
+
window.addEventListener("keydown", (e) => {
|
|
1489
|
+
if (e.key === "/" && document.activeElement && document.activeElement.tagName !== "INPUT") {
|
|
1490
|
+
const inp = document.getElementById("cockpit-search");
|
|
1491
|
+
if (inp) {
|
|
1492
|
+
e.preventDefault();
|
|
1493
|
+
inp.focus();
|
|
1494
|
+
}
|
|
1495
|
+
}
|
|
1496
|
+
});
|
|
1497
|
+
|
|
1498
|
+
renderSurface();
|
|
1499
|
+
})();
|
|
1500
|
+
</script>
|
|
1501
|
+
</body>
|
|
1502
|
+
</html>
|
|
1503
|
+
"""
|
|
1504
|
+
|
|
1505
|
+
|
|
1506
|
+
def render_html_cockpit(bundle: dict, page_title: str) -> str:
|
|
1507
|
+
safe_title = (
|
|
1508
|
+
page_title.replace("&", "&")
|
|
1509
|
+
.replace("<", "<")
|
|
1510
|
+
.replace(">", ">")
|
|
1511
|
+
.replace('"', """)
|
|
1512
|
+
)
|
|
1513
|
+
embedded = safe_json_for_html_script(bundle)
|
|
1514
|
+
replacements = {
|
|
1515
|
+
"__PAGE_TITLE__": safe_title,
|
|
1516
|
+
"__A2UI_JSON__": embedded,
|
|
1517
|
+
}
|
|
1518
|
+
return re.sub(r"__PAGE_TITLE__|__A2UI_JSON__", lambda m: replacements[m.group(0)], HTML_TEMPLATE)
|
|
1519
|
+
|
|
1520
|
+
|
|
1521
|
+
def _prune_old_gen_ui_surfaces(gen_base: Path, safe_root: Path, ensure_contained, keep: int = 8) -> None:
|
|
1522
|
+
if not gen_base.is_dir() or gen_base.is_symlink():
|
|
1523
|
+
return
|
|
1524
|
+
dirs = [d for d in gen_base.iterdir() if d.is_dir() and not d.is_symlink()]
|
|
1525
|
+
if len(dirs) <= keep:
|
|
1526
|
+
return
|
|
1527
|
+
dirs.sort(key=lambda p: p.stat().st_mtime, reverse=True)
|
|
1528
|
+
import shutil as _shutil
|
|
1529
|
+
for old_d in dirs[keep:]:
|
|
1530
|
+
ensure_contained(old_d, safe_root)
|
|
1531
|
+
_shutil.rmtree(old_d, ignore_errors=True)
|
|
1532
|
+
|
|
1533
|
+
|
|
1534
|
+
def write_surface_artifacts(
|
|
1535
|
+
root: Path,
|
|
1536
|
+
slug: str,
|
|
1537
|
+
spec: dict,
|
|
1538
|
+
open_browser: bool = False,
|
|
1539
|
+
) -> dict:
|
|
1540
|
+
self_grill = _load_sibling("genui_self_grill", "self-grill/self_grill.py")
|
|
1541
|
+
safe_root = self_grill.reject_unsafe_root(root)
|
|
1542
|
+
clean_slug = sanitize_slug(slug)
|
|
1543
|
+
gen_base = safe_root / ".scratch" / "gen-ui"
|
|
1544
|
+
out_dir = gen_base / clean_slug
|
|
1545
|
+
self_grill.ensure_contained(out_dir, safe_root)
|
|
1546
|
+
out_dir.mkdir(parents=True, exist_ok=True)
|
|
1547
|
+
self_grill.ensure_contained(out_dir, gen_base)
|
|
1548
|
+
|
|
1549
|
+
surface_id = f"deepmodebot-{clean_slug}-surface"
|
|
1550
|
+
bundle = compile_spec_to_a2ui(spec, surface_id=surface_id)
|
|
1551
|
+
validation = validate_a2ui_bundle(bundle)
|
|
1552
|
+
if not validation["valid"]:
|
|
1553
|
+
raise ValueError(f"generated A2UI bundle failed validation: {validation['errors']}")
|
|
1554
|
+
|
|
1555
|
+
a2ui_path = out_dir / "surface.a2ui.json"
|
|
1556
|
+
html_path = out_dir / "index.html"
|
|
1557
|
+
self_grill.ensure_contained(a2ui_path, out_dir)
|
|
1558
|
+
self_grill.ensure_contained(html_path, out_dir)
|
|
1559
|
+
a2ui_path.write_text(json.dumps(bundle, indent=2, ensure_ascii=False) + "\n", encoding="utf-8")
|
|
1560
|
+
html_text = render_html_cockpit(bundle, str(spec.get("title") or "Deepmodebot Visual Cockpit"))
|
|
1561
|
+
html_path.write_text(html_text, encoding="utf-8")
|
|
1562
|
+
_prune_old_gen_ui_surfaces(gen_base, safe_root, self_grill.ensure_contained, keep=8)
|
|
1563
|
+
opened = False
|
|
1564
|
+
if open_browser:
|
|
1565
|
+
try:
|
|
1566
|
+
opened = bool(webbrowser.open(html_path.resolve().as_uri()))
|
|
1567
|
+
except Exception:
|
|
1568
|
+
opened = False
|
|
1569
|
+
|
|
1570
|
+
return {
|
|
1571
|
+
"valid": True,
|
|
1572
|
+
"protocol": "A2UI",
|
|
1573
|
+
"version": "1.0",
|
|
1574
|
+
"surface_id": surface_id,
|
|
1575
|
+
"slug": clean_slug,
|
|
1576
|
+
"component_count": validation["component_count"],
|
|
1577
|
+
"a2ui_path": str(a2ui_path),
|
|
1578
|
+
"html_path": str(html_path),
|
|
1579
|
+
"html_uri": html_path.resolve().as_uri(),
|
|
1580
|
+
"opened_browser": opened,
|
|
1581
|
+
}
|
|
1582
|
+
|
|
1583
|
+
|
|
1584
|
+
def generate_from_suggest(
|
|
1585
|
+
root: Path,
|
|
1586
|
+
slug: str = "suggest",
|
|
1587
|
+
limit: int = 0,
|
|
1588
|
+
open_browser: bool = False,
|
|
1589
|
+
precomputed: dict | None = None,
|
|
1590
|
+
) -> dict:
|
|
1591
|
+
prompt_tools = _load_sibling("genui_prompt_tools", "prompt-tools/prompt_tools.py")
|
|
1592
|
+
report = precomputed if precomputed is not None else prompt_tools.suggest_prompts(root, limit=limit)
|
|
1593
|
+
spec = {
|
|
1594
|
+
"title": f"Full-Scope High-Leverage Task & Gap Cockpit ({Path(report['root']).name})",
|
|
1595
|
+
"subtitle": report["root"],
|
|
1596
|
+
"mode_badge": "A2UI 1.0 · /suggest · full-scope",
|
|
1597
|
+
"metrics": [
|
|
1598
|
+
{"label": "Code files", "value": report["code_file_count"], "tone": "neutral"},
|
|
1599
|
+
{"label": "Active diff", "value": report["diff_size"], "tone": "neutral"},
|
|
1600
|
+
{
|
|
1601
|
+
"label": "Overclaim hits",
|
|
1602
|
+
"value": report["overclaim_hits"],
|
|
1603
|
+
"tone": "warn" if report["overclaim_hits"] > 0 else "ok",
|
|
1604
|
+
},
|
|
1605
|
+
{
|
|
1606
|
+
"label": "Broken doc links",
|
|
1607
|
+
"value": report["broken_link_hits"],
|
|
1608
|
+
"tone": "warn" if report["broken_link_hits"] > 0 else "ok",
|
|
1609
|
+
},
|
|
1610
|
+
{"label": "Verify skills", "value": len(report["verify_skills"]), "tone": "ok" if report["verify_skills"] else "warn"},
|
|
1611
|
+
{"label": "High-leverage tasks", "value": f"{len(report['suggestions'])}/{report.get('total_leverage_tasks', len(report['suggestions']))}", "tone": "neutral"},
|
|
1612
|
+
],
|
|
1613
|
+
"suggestions": report["suggestions"],
|
|
1614
|
+
"findings": [
|
|
1615
|
+
{
|
|
1616
|
+
"severity": "P1",
|
|
1617
|
+
"category": "core-module",
|
|
1618
|
+
"location": m["path"],
|
|
1619
|
+
"detail": f"{m['lines']} lines — top Hardcore Mode architectural ceiling candidate",
|
|
1620
|
+
}
|
|
1621
|
+
for m in report.get("core_modules", [])
|
|
1622
|
+
],
|
|
1623
|
+
}
|
|
1624
|
+
ui_meta = write_surface_artifacts(Path(report["root"]), slug=slug, spec=spec, open_browser=open_browser)
|
|
1625
|
+
return {"suggest_report": report, "ui_surface": ui_meta}
|
|
1626
|
+
|
|
1627
|
+
|
|
1628
|
+
def generate_from_grill(
|
|
1629
|
+
root: Path,
|
|
1630
|
+
slug: str = "grill",
|
|
1631
|
+
base: str | None = None,
|
|
1632
|
+
custom_spec: dict | None = None,
|
|
1633
|
+
open_browser: bool = False,
|
|
1634
|
+
) -> dict:
|
|
1635
|
+
self_grill = _load_sibling("genui_self_grill_diff", "self-grill/self_grill.py")
|
|
1636
|
+
safe_root = self_grill.reject_unsafe_root(root)
|
|
1637
|
+
if custom_spec is not None:
|
|
1638
|
+
merged = dict(custom_spec)
|
|
1639
|
+
merged.setdefault("title", f"Decision & Plan Grill Cockpit ({safe_root.name})")
|
|
1640
|
+
merged.setdefault("subtitle", str(safe_root))
|
|
1641
|
+
merged.setdefault("mode_badge", "A2UI 1.0 · grill")
|
|
1642
|
+
return write_surface_artifacts(safe_root, slug=slug, spec=merged, open_browser=open_browser)
|
|
1643
|
+
|
|
1644
|
+
diff = self_grill.inspect_diff(safe_root, base=base)
|
|
1645
|
+
findings: list[dict] = []
|
|
1646
|
+
for p in diff.get("sensitive_paths", []):
|
|
1647
|
+
findings.append({"severity": "P0", "category": "sensitive-path", "location": p, "detail": "Touches trust, auth, secret, or harness boundary"})
|
|
1648
|
+
for s in diff.get("toy_shortcuts", []):
|
|
1649
|
+
findings.append(
|
|
1650
|
+
{
|
|
1651
|
+
"severity": "P0" if s.get("critical") else "P1",
|
|
1652
|
+
"category": s["kind"],
|
|
1653
|
+
"location": f"{s['path']}:{s['line']}",
|
|
1654
|
+
"detail": s["text"],
|
|
1655
|
+
}
|
|
1656
|
+
)
|
|
1657
|
+
for w in diff.get("workaround_smells", []):
|
|
1658
|
+
findings.append(
|
|
1659
|
+
{
|
|
1660
|
+
"severity": "P1",
|
|
1661
|
+
"category": w["kind"],
|
|
1662
|
+
"location": f"{w['path']}:{w['line']}",
|
|
1663
|
+
"detail": w["text"],
|
|
1664
|
+
}
|
|
1665
|
+
)
|
|
1666
|
+
for c in diff.get("added_comments", [])[:15]:
|
|
1667
|
+
findings.append(
|
|
1668
|
+
{
|
|
1669
|
+
"severity": "P2",
|
|
1670
|
+
"category": "added-comment",
|
|
1671
|
+
"location": f"{c['path']}:{c['line']}",
|
|
1672
|
+
"detail": c["text"],
|
|
1673
|
+
}
|
|
1674
|
+
)
|
|
1675
|
+
spec = {
|
|
1676
|
+
"title": f"Self-Grill & Prosecutor Diff Cockpit ({safe_root.name})",
|
|
1677
|
+
"subtitle": str(safe_root),
|
|
1678
|
+
"mode_badge": "A2UI 1.0 · self-grill",
|
|
1679
|
+
"metrics": [
|
|
1680
|
+
{"label": "Measured size", "value": diff["measured_size"], "tone": "neutral"},
|
|
1681
|
+
{"label": "Changed files", "value": diff["file_count"], "tone": "neutral"},
|
|
1682
|
+
{"label": "Lines +/-", "value": f"+{diff['lines_added']}/-{diff['lines_deleted']}", "tone": "neutral"},
|
|
1683
|
+
{"label": "Sensitive paths", "value": len(diff["sensitive_paths"]), "tone": "warn" if diff["sensitive_paths"] else "ok"},
|
|
1684
|
+
{"label": "Toy shortcuts", "value": diff["toy_shortcut_count"], "tone": "warn" if diff["toy_shortcut_count"] else "ok"},
|
|
1685
|
+
{"label": "Added comments", "value": diff["added_comment_count"], "tone": "warn" if diff["added_comment_count"] else "ok"},
|
|
1686
|
+
],
|
|
1687
|
+
"findings": findings,
|
|
1688
|
+
}
|
|
1689
|
+
return write_surface_artifacts(safe_root, slug=slug, spec=spec, open_browser=open_browser)
|
|
1690
|
+
|
|
1691
|
+
|
|
1692
|
+
def cmd_from_suggest(args: argparse.Namespace) -> int:
|
|
1693
|
+
res = generate_from_suggest(Path(args.root), slug=args.slug, limit=args.limit, open_browser=args.open)
|
|
1694
|
+
if args.json:
|
|
1695
|
+
print(json.dumps(res["ui_surface"], indent=2))
|
|
1696
|
+
else:
|
|
1697
|
+
print(f"A2UI 1.0 surface: {res['ui_surface']['a2ui_path']}")
|
|
1698
|
+
print(f"Interactive HTML: {res['ui_surface']['html_path']}")
|
|
1699
|
+
return 0
|
|
1700
|
+
|
|
1701
|
+
|
|
1702
|
+
def cmd_from_grill(args: argparse.Namespace) -> int:
|
|
1703
|
+
custom = json.loads(sys.stdin.read()) if args.spec_stdin else None
|
|
1704
|
+
res = generate_from_grill(Path(args.root), slug=args.slug, base=args.base, custom_spec=custom, open_browser=args.open)
|
|
1705
|
+
if args.json:
|
|
1706
|
+
print(json.dumps(res, indent=2))
|
|
1707
|
+
else:
|
|
1708
|
+
print(f"A2UI 1.0 surface: {res['a2ui_path']}")
|
|
1709
|
+
print(f"Interactive HTML: {res['html_path']}")
|
|
1710
|
+
return 0
|
|
1711
|
+
|
|
1712
|
+
|
|
1713
|
+
def cmd_render(args: argparse.Namespace) -> int:
|
|
1714
|
+
spec = json.loads(sys.stdin.read())
|
|
1715
|
+
res = write_surface_artifacts(Path(args.root), slug=args.slug, spec=spec, open_browser=args.open)
|
|
1716
|
+
if args.json:
|
|
1717
|
+
print(json.dumps(res, indent=2))
|
|
1718
|
+
else:
|
|
1719
|
+
print(f"A2UI 1.0 surface: {res['a2ui_path']}")
|
|
1720
|
+
print(f"Interactive HTML: {res['html_path']}")
|
|
1721
|
+
return 0
|
|
1722
|
+
|
|
1723
|
+
|
|
1724
|
+
def cmd_validate(args: argparse.Namespace) -> int:
|
|
1725
|
+
bundle = json.loads(Path(args.file).read_text(encoding="utf-8"))
|
|
1726
|
+
res = validate_a2ui_bundle(bundle)
|
|
1727
|
+
if args.json:
|
|
1728
|
+
print(json.dumps(res, indent=2))
|
|
1729
|
+
else:
|
|
1730
|
+
if res["valid"]:
|
|
1731
|
+
print(f"OK ({res['component_count']} components on {res['surface_id']})")
|
|
1732
|
+
else:
|
|
1733
|
+
for err in res["errors"]:
|
|
1734
|
+
print(f"ERROR: {err}", file=sys.stderr)
|
|
1735
|
+
return 0 if res["valid"] else 2
|
|
1736
|
+
|
|
1737
|
+
|
|
1738
|
+
def build_parser() -> argparse.ArgumentParser:
|
|
1739
|
+
parser = argparse.ArgumentParser(description="Compile and validate A2UI v1.0 surfaces and interactive human cockpits.")
|
|
1740
|
+
sub = parser.add_subparsers(dest="cmd", required=True)
|
|
1741
|
+
|
|
1742
|
+
p_sug = sub.add_parser("from-suggest", help="Compile /suggest repo scan into A2UI v1.0 + interactive HTML cockpit.")
|
|
1743
|
+
p_sug.add_argument("--root", required=True)
|
|
1744
|
+
p_sug.add_argument("--slug", default="suggest")
|
|
1745
|
+
p_sug.add_argument("--limit", type=int, default=0, help="Max tasks to include (0 = full un-truncated scope, default).")
|
|
1746
|
+
p_sug.add_argument("--open", action="store_true")
|
|
1747
|
+
p_sug.add_argument("--json", action="store_true")
|
|
1748
|
+
p_sug.set_defaults(func=cmd_from_suggest)
|
|
1749
|
+
|
|
1750
|
+
p_gr = sub.add_parser("from-grill", help="Compile self-grill diff or custom decision spec into A2UI v1.0 + HTML cockpit.")
|
|
1751
|
+
p_gr.add_argument("--root", required=True)
|
|
1752
|
+
p_gr.add_argument("--slug", default="grill")
|
|
1753
|
+
p_gr.add_argument("--base", default=None)
|
|
1754
|
+
p_gr.add_argument("--spec-stdin", action="store_true")
|
|
1755
|
+
p_gr.add_argument("--open", action="store_true")
|
|
1756
|
+
p_gr.add_argument("--json", action="store_true")
|
|
1757
|
+
p_gr.set_defaults(func=cmd_from_grill)
|
|
1758
|
+
|
|
1759
|
+
p_ren = sub.add_parser("render", help="Render an arbitrary cockpit JSON spec from stdin into A2UI v1.0 + HTML.")
|
|
1760
|
+
p_ren.add_argument("--root", required=True)
|
|
1761
|
+
p_ren.add_argument("--slug", required=True)
|
|
1762
|
+
p_ren.add_argument("--stdin", action="store_true")
|
|
1763
|
+
p_ren.add_argument("--open", action="store_true")
|
|
1764
|
+
p_ren.add_argument("--json", action="store_true")
|
|
1765
|
+
p_ren.set_defaults(func=cmd_render)
|
|
1766
|
+
|
|
1767
|
+
p_val = sub.add_parser("validate-a2ui", help="Validate an A2UI v1.0 surface bundle for schema, DAG, pointers, and safety.")
|
|
1768
|
+
p_val.add_argument("--file", required=True)
|
|
1769
|
+
p_val.add_argument("--json", action="store_true")
|
|
1770
|
+
p_val.set_defaults(func=cmd_validate)
|
|
1771
|
+
|
|
1772
|
+
return parser
|
|
1773
|
+
|
|
1774
|
+
|
|
1775
|
+
def main(argv: list[str] | None = None) -> int:
|
|
1776
|
+
parser = build_parser()
|
|
1777
|
+
args = parser.parse_args(argv)
|
|
1778
|
+
return args.func(args)
|
|
1779
|
+
|
|
1780
|
+
|
|
1781
|
+
if __name__ == "__main__":
|
|
1782
|
+
raise SystemExit(main())
|