@proflandrigan/shards 1.1.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/README.md +475 -0
- package/package.json +37 -0
- package/src/agents/academic.md +276 -0
- package/src/agents/ai-engineer.md +377 -0
- package/src/agents/analytics-engineer.md +364 -0
- package/src/agents/applied-ml-scientist.md +410 -0
- package/src/agents/backend-engineer.md +255 -0
- package/src/agents/bi-engineer.md +333 -0
- package/src/agents/data-analyst.md +343 -0
- package/src/agents/data-engineer.md +260 -0
- package/src/agents/data-modeller.md +386 -0
- package/src/agents/data-scientist.md +366 -0
- package/src/agents/deep-learning-engineer.md +389 -0
- package/src/agents/ml-engineer.md +424 -0
- package/src/agents/mlops-engineer.md +339 -0
- package/src/agents/researcher.md +187 -0
- package/src/agents/specific_instructions/academic/critical_review.md +263 -0
- package/src/agents/specific_instructions/academic/report.md +113 -0
- package/src/agents/specific_instructions/ai_engineer/advise.md +162 -0
- package/src/agents/specific_instructions/ai_engineer/bi_engineer_handoff.md +86 -0
- package/src/agents/specific_instructions/ai_engineer/experiment.md +471 -0
- package/src/agents/specific_instructions/ai_engineer/experiment_ui_mode.md +44 -0
- package/src/agents/specific_instructions/ai_engineer/phases/index.md +45 -0
- package/src/agents/specific_instructions/ai_engineer/phases/phase-1.md +55 -0
- package/src/agents/specific_instructions/ai_engineer/phases/phase-2.md +86 -0
- package/src/agents/specific_instructions/ai_engineer/phases/phase-3.md +96 -0
- package/src/agents/specific_instructions/ai_engineer/phases/phase-4.md +138 -0
- package/src/agents/specific_instructions/ai_engineer/phases/phase-5.md +157 -0
- package/src/agents/specific_instructions/ai_engineer/phases/phase-6.md +196 -0
- package/src/agents/specific_instructions/ai_engineer/phases/phase-7.md +313 -0
- package/src/agents/specific_instructions/ai_engineer/phases.md +1011 -0
- package/src/agents/specific_instructions/ai_engineer/prompt_lab.md +161 -0
- package/src/agents/specific_instructions/ai_engineer/prompt_lab_ui_mode.md +28 -0
- package/src/agents/specific_instructions/ai_engineer/research.md +393 -0
- package/src/agents/specific_instructions/ai_engineer/research_ui_mode.md +66 -0
- package/src/agents/specific_instructions/ai_engineer/review.md +159 -0
- package/src/agents/specific_instructions/ai_engineer/validation_checklist.md +182 -0
- package/src/agents/specific_instructions/analytics_engineer/advise.md +155 -0
- package/src/agents/specific_instructions/analytics_engineer/bi_engineer_handoff.md +91 -0
- package/src/agents/specific_instructions/analytics_engineer/data_analyst_handoff.md +84 -0
- package/src/agents/specific_instructions/analytics_engineer/deep_phases.md +818 -0
- package/src/agents/specific_instructions/analytics_engineer/phases_deep/index.md +24 -0
- package/src/agents/specific_instructions/analytics_engineer/phases_deep/phase-1.md +77 -0
- package/src/agents/specific_instructions/analytics_engineer/phases_deep/phase-2.md +106 -0
- package/src/agents/specific_instructions/analytics_engineer/phases_deep/phase-3.md +93 -0
- package/src/agents/specific_instructions/analytics_engineer/phases_deep/phase-4.md +79 -0
- package/src/agents/specific_instructions/analytics_engineer/phases_deep/phase-5.md +61 -0
- package/src/agents/specific_instructions/analytics_engineer/phases_deep/phase-6.md +45 -0
- package/src/agents/specific_instructions/analytics_engineer/phases_deep/phase-7.md +235 -0
- package/src/agents/specific_instructions/analytics_engineer/phases_deep/phase-8.md +221 -0
- package/src/agents/specific_instructions/analytics_engineer/phases_quick/index.md +19 -0
- package/src/agents/specific_instructions/analytics_engineer/phases_quick/phase-1.md +47 -0
- package/src/agents/specific_instructions/analytics_engineer/phases_quick/phase-2.md +78 -0
- package/src/agents/specific_instructions/analytics_engineer/quick_phases.md +112 -0
- package/src/agents/specific_instructions/analytics_engineer/review.md +167 -0
- package/src/agents/specific_instructions/analytics_engineer/service_mode.md +369 -0
- package/src/agents/specific_instructions/analytics_engineer/ui_mode.md +45 -0
- package/src/agents/specific_instructions/analytics_engineer/update.md +162 -0
- package/src/agents/specific_instructions/analytics_engineer/validation_checklist.md +121 -0
- package/src/agents/specific_instructions/applied_ml_scientist/advise.md +143 -0
- package/src/agents/specific_instructions/applied_ml_scientist/phases/index.md +21 -0
- package/src/agents/specific_instructions/applied_ml_scientist/phases/phase-1.md +51 -0
- package/src/agents/specific_instructions/applied_ml_scientist/phases/phase-2.md +66 -0
- package/src/agents/specific_instructions/applied_ml_scientist/phases/phase-3.md +113 -0
- package/src/agents/specific_instructions/applied_ml_scientist/phases/phase-4.md +104 -0
- package/src/agents/specific_instructions/applied_ml_scientist/phases/phase-5.md +156 -0
- package/src/agents/specific_instructions/applied_ml_scientist/phases.md +428 -0
- package/src/agents/specific_instructions/applied_ml_scientist/research.md +379 -0
- package/src/agents/specific_instructions/applied_ml_scientist/review.md +142 -0
- package/src/agents/specific_instructions/applied_ml_scientist/validation_checklist.md +136 -0
- package/src/agents/specific_instructions/backend_engineer/clean.md +149 -0
- package/src/agents/specific_instructions/backend_engineer/review.md +91 -0
- package/src/agents/specific_instructions/backend_engineer/review_checklist.md +54 -0
- package/src/agents/specific_instructions/backend_engineer/service_mode.md +67 -0
- package/src/agents/specific_instructions/bi_engineer/advise.md +137 -0
- package/src/agents/specific_instructions/bi_engineer/data_analyst_handoff.md +77 -0
- package/src/agents/specific_instructions/bi_engineer/incoming_handoff.md +45 -0
- package/src/agents/specific_instructions/bi_engineer/phases/index.md +20 -0
- package/src/agents/specific_instructions/bi_engineer/phases/phase-1.md +164 -0
- package/src/agents/specific_instructions/bi_engineer/phases/phase-2.md +92 -0
- package/src/agents/specific_instructions/bi_engineer/phases/phase-3.md +121 -0
- package/src/agents/specific_instructions/bi_engineer/phases/phase-4.md +106 -0
- package/src/agents/specific_instructions/bi_engineer/phases.md +451 -0
- package/src/agents/specific_instructions/bi_engineer/review.md +166 -0
- package/src/agents/specific_instructions/bi_engineer/update.md +147 -0
- package/src/agents/specific_instructions/bi_engineer/validation_checklist.md +124 -0
- package/src/agents/specific_instructions/data_analyst/advise.md +138 -0
- package/src/agents/specific_instructions/data_analyst/explain.md +221 -0
- package/src/agents/specific_instructions/data_analyst/incoming_handoff.md +40 -0
- package/src/agents/specific_instructions/data_analyst/phases/index.md +20 -0
- package/src/agents/specific_instructions/data_analyst/phases/phase-1.md +159 -0
- package/src/agents/specific_instructions/data_analyst/phases/phase-2.md +112 -0
- package/src/agents/specific_instructions/data_analyst/phases/phase-3.md +265 -0
- package/src/agents/specific_instructions/data_analyst/phases/phase-4.md +100 -0
- package/src/agents/specific_instructions/data_analyst/phases.md +501 -0
- package/src/agents/specific_instructions/data_analyst/review.md +138 -0
- package/src/agents/specific_instructions/data_analyst/ui_mode.md +26 -0
- package/src/agents/specific_instructions/data_analyst/update.md +144 -0
- package/src/agents/specific_instructions/data_analyst/validation_checklist.md +95 -0
- package/src/agents/specific_instructions/data_engineer/advise.md +137 -0
- package/src/agents/specific_instructions/data_engineer/phases.md +466 -0
- package/src/agents/specific_instructions/data_engineer/phases_deep/index.md +23 -0
- package/src/agents/specific_instructions/data_engineer/phases_deep/phase-1.md +49 -0
- package/src/agents/specific_instructions/data_engineer/phases_deep/phase-2.md +93 -0
- package/src/agents/specific_instructions/data_engineer/phases_deep/phase-3.md +55 -0
- package/src/agents/specific_instructions/data_engineer/phases_deep/phase-4.md +48 -0
- package/src/agents/specific_instructions/data_engineer/phases_deep/phase-5.md +40 -0
- package/src/agents/specific_instructions/data_engineer/phases_deep/phase-6.md +102 -0
- package/src/agents/specific_instructions/data_engineer/phases_deep/phase-7.md +87 -0
- package/src/agents/specific_instructions/data_engineer/phases_quick/index.md +19 -0
- package/src/agents/specific_instructions/data_engineer/phases_quick/phase-1.md +45 -0
- package/src/agents/specific_instructions/data_engineer/phases_quick/phase-2.md +54 -0
- package/src/agents/specific_instructions/data_engineer/review.md +135 -0
- package/src/agents/specific_instructions/data_engineer/validation_checklist.md +136 -0
- package/src/agents/specific_instructions/data_modeller/advise.md +137 -0
- package/src/agents/specific_instructions/data_modeller/phases.md +581 -0
- package/src/agents/specific_instructions/data_modeller/phases_deep/index.md +23 -0
- package/src/agents/specific_instructions/data_modeller/phases_deep/phase-1.md +52 -0
- package/src/agents/specific_instructions/data_modeller/phases_deep/phase-2.md +113 -0
- package/src/agents/specific_instructions/data_modeller/phases_deep/phase-3.md +47 -0
- package/src/agents/specific_instructions/data_modeller/phases_deep/phase-4.md +51 -0
- package/src/agents/specific_instructions/data_modeller/phases_deep/phase-5.md +45 -0
- package/src/agents/specific_instructions/data_modeller/phases_deep/phase-6.md +105 -0
- package/src/agents/specific_instructions/data_modeller/phases_deep/phase-7.md +136 -0
- package/src/agents/specific_instructions/data_modeller/phases_quick/index.md +19 -0
- package/src/agents/specific_instructions/data_modeller/phases_quick/phase-1.md +47 -0
- package/src/agents/specific_instructions/data_modeller/phases_quick/phase-2.md +65 -0
- package/src/agents/specific_instructions/data_modeller/review.md +141 -0
- package/src/agents/specific_instructions/data_modeller/service_mode.md +218 -0
- package/src/agents/specific_instructions/data_modeller/validation_checklist.md +125 -0
- package/src/agents/specific_instructions/data_scientist/advise.md +158 -0
- package/src/agents/specific_instructions/data_scientist/bi_engineer_handoff.md +63 -0
- package/src/agents/specific_instructions/data_scientist/experiment.md +482 -0
- package/src/agents/specific_instructions/data_scientist/experiment_ui_mode.md +44 -0
- package/src/agents/specific_instructions/data_scientist/explain.md +247 -0
- package/src/agents/specific_instructions/data_scientist/greenfield_data.md +35 -0
- package/src/agents/specific_instructions/data_scientist/ml_engineer_handoff.md +52 -0
- package/src/agents/specific_instructions/data_scientist/notebook_walkthrough.md +76 -0
- package/src/agents/specific_instructions/data_scientist/phases/index.md +24 -0
- package/src/agents/specific_instructions/data_scientist/phases/phase-1.md +45 -0
- package/src/agents/specific_instructions/data_scientist/phases/phase-2.md +67 -0
- package/src/agents/specific_instructions/data_scientist/phases/phase-3.md +89 -0
- package/src/agents/specific_instructions/data_scientist/phases/phase-4.md +143 -0
- package/src/agents/specific_instructions/data_scientist/phases/phase-5.md +71 -0
- package/src/agents/specific_instructions/data_scientist/phases/phase-6.md +239 -0
- package/src/agents/specific_instructions/data_scientist/phases/phase-7.md +207 -0
- package/src/agents/specific_instructions/data_scientist/phases.md +651 -0
- package/src/agents/specific_instructions/data_scientist/research.md +345 -0
- package/src/agents/specific_instructions/data_scientist/research_ui_mode.md +52 -0
- package/src/agents/specific_instructions/data_scientist/review.md +136 -0
- package/src/agents/specific_instructions/data_scientist/service_mode.md +247 -0
- package/src/agents/specific_instructions/data_scientist/validation_checklist.md +183 -0
- package/src/agents/specific_instructions/deep_learning_engineer/advise.md +145 -0
- package/src/agents/specific_instructions/deep_learning_engineer/phases/index.md +21 -0
- package/src/agents/specific_instructions/deep_learning_engineer/phases/phase-1.md +74 -0
- package/src/agents/specific_instructions/deep_learning_engineer/phases/phase-2.md +98 -0
- package/src/agents/specific_instructions/deep_learning_engineer/phases/phase-3.md +76 -0
- package/src/agents/specific_instructions/deep_learning_engineer/phases/phase-4.md +128 -0
- package/src/agents/specific_instructions/deep_learning_engineer/phases/phase-5.md +292 -0
- package/src/agents/specific_instructions/deep_learning_engineer/phases.md +567 -0
- package/src/agents/specific_instructions/deep_learning_engineer/research.md +389 -0
- package/src/agents/specific_instructions/deep_learning_engineer/review.md +155 -0
- package/src/agents/specific_instructions/deep_learning_engineer/validation_checklist.md +147 -0
- package/src/agents/specific_instructions/ml_engineer/advise.md +174 -0
- package/src/agents/specific_instructions/ml_engineer/bi_engineer_handoff.md +71 -0
- package/src/agents/specific_instructions/ml_engineer/experiment.md +474 -0
- package/src/agents/specific_instructions/ml_engineer/experiment_ui_mode.md +44 -0
- package/src/agents/specific_instructions/ml_engineer/notebook_walkthrough.md +75 -0
- package/src/agents/specific_instructions/ml_engineer/phases/index.md +25 -0
- package/src/agents/specific_instructions/ml_engineer/phases/phase-1.md +49 -0
- package/src/agents/specific_instructions/ml_engineer/phases/phase-2.md +75 -0
- package/src/agents/specific_instructions/ml_engineer/phases/phase-3.md +124 -0
- package/src/agents/specific_instructions/ml_engineer/phases/phase-4.md +279 -0
- package/src/agents/specific_instructions/ml_engineer/phases/phase-5.md +160 -0
- package/src/agents/specific_instructions/ml_engineer/phases/phase-6-5.md +170 -0
- package/src/agents/specific_instructions/ml_engineer/phases/phase-6.md +295 -0
- package/src/agents/specific_instructions/ml_engineer/phases/phase-7.md +337 -0
- package/src/agents/specific_instructions/ml_engineer/phases.md +1068 -0
- package/src/agents/specific_instructions/ml_engineer/research.md +437 -0
- package/src/agents/specific_instructions/ml_engineer/research_ui_mode.md +71 -0
- package/src/agents/specific_instructions/ml_engineer/review.md +187 -0
- package/src/agents/specific_instructions/ml_engineer/service_mode.md +273 -0
- package/src/agents/specific_instructions/ml_engineer/validation_checklist.md +185 -0
- package/src/agents/specific_instructions/mlops_engineer/advise.md +139 -0
- package/src/agents/specific_instructions/mlops_engineer/phases/index.md +23 -0
- package/src/agents/specific_instructions/mlops_engineer/phases/phase-1.md +52 -0
- package/src/agents/specific_instructions/mlops_engineer/phases/phase-2.md +86 -0
- package/src/agents/specific_instructions/mlops_engineer/phases/phase-3.md +105 -0
- package/src/agents/specific_instructions/mlops_engineer/phases/phase-4.md +128 -0
- package/src/agents/specific_instructions/mlops_engineer/phases/phase-5.md +106 -0
- package/src/agents/specific_instructions/mlops_engineer/phases/phase-6.md +128 -0
- package/src/agents/specific_instructions/mlops_engineer/phases/phase-7.md +144 -0
- package/src/agents/specific_instructions/mlops_engineer/phases.md +671 -0
- package/src/agents/specific_instructions/mlops_engineer/review.md +164 -0
- package/src/agents/specific_instructions/mlops_engineer/service_mode.md +81 -0
- package/src/agents/specific_instructions/mlops_engineer/validation_checklist.md +151 -0
- package/src/agents/specific_instructions/researcher/critical_review.md +292 -0
- package/src/agents/specific_instructions/researcher/review_checklist.md +67 -0
- package/src/agents/specific_instructions/researcher/service_mode.md +224 -0
- package/src/agents/specific_instructions/shared/auto_verify_mode.md +141 -0
- package/src/agents/specific_instructions/shared/autonomous_research.md +1289 -0
- package/src/agents/specific_instructions/shared/behavioral_rules.md +36 -0
- package/src/agents/specific_instructions/shared/diverge_protocol.md +387 -0
- package/src/agents/specific_instructions/shared/engineering_guidelines.md +136 -0
- package/src/agents/specific_instructions/shared/experiment_versioning.md +184 -0
- package/src/agents/specific_instructions/shared/goal_mode.md +187 -0
- package/src/agents/specific_instructions/shared/incremental_testing.md +139 -0
- package/src/agents/specific_instructions/shared/intent_discovery.md +223 -0
- package/src/agents/specific_instructions/shared/join_path_protocol.md +168 -0
- package/src/agents/specific_instructions/shared/knowledge_checkpoint.md +83 -0
- package/src/agents/specific_instructions/shared/knowledge_harvest.md +220 -0
- package/src/agents/specific_instructions/shared/knowledge_retrieval.md +100 -0
- package/src/agents/specific_instructions/shared/notebook_walkthrough_protocol.md +367 -0
- package/src/agents/specific_instructions/shared/reviewer_verdict_protocol.md +74 -0
- package/src/agents/specific_instructions/shared/swarm_protocol.md +97 -0
- package/src/agents/specific_instructions/shared/validation_protocol.md +139 -0
- package/src/agents/specific_instructions/syn/arbiter.md +140 -0
- package/src/agents/specific_instructions/syn/brainstorm.md +550 -0
- package/src/agents/specific_instructions/syn/code_review.md +232 -0
- package/src/agents/specific_instructions/syn/diff.md +239 -0
- package/src/agents/specific_instructions/syn/final_review.md +65 -0
- package/src/agents/specific_instructions/syn/fixer.md +240 -0
- package/src/agents/specific_instructions/syn/free_form.md +130 -0
- package/src/agents/specific_instructions/syn/knowledge.md +468 -0
- package/src/agents/specific_instructions/syn/notebook_walkthrough.md +78 -0
- package/src/agents/specific_instructions/syn/panel_review.md +634 -0
- package/src/agents/specific_instructions/syn/pm.md +453 -0
- package/src/agents/specific_instructions/syn/pr_review.md +255 -0
- package/src/agents/specific_instructions/syn/slides.md +417 -0
- package/src/agents/syn.md +729 -0
- package/src/commands/academic.md +41 -0
- package/src/commands/ai-engineer.md +45 -0
- package/src/commands/analytics-engineer.md +48 -0
- package/src/commands/applied-ml-scientist.md +45 -0
- package/src/commands/backend-engineer.md +35 -0
- package/src/commands/bi-engineer.md +40 -0
- package/src/commands/brainstorm.md +24 -0
- package/src/commands/data-analyst.md +38 -0
- package/src/commands/data-engineer.md +37 -0
- package/src/commands/data-modeller.md +38 -0
- package/src/commands/data-scientist.md +38 -0
- package/src/commands/deep-learning-engineer.md +47 -0
- package/src/commands/end.md +49 -0
- package/src/commands/knowledge.md +24 -0
- package/src/commands/ml-engineer.md +42 -0
- package/src/commands/mlops-engineer.md +47 -0
- package/src/commands/notebook-walkthrough.md +58 -0
- package/src/commands/researcher.md +40 -0
- package/src/commands/resume.md +57 -0
- package/src/commands/review-pr.md +26 -0
- package/src/commands/shards-guide.md +41 -0
- package/src/commands/shards-ui.md +32 -0
- package/src/commands/shards.md +41 -0
- package/src/docs/01-getting-started/concepts.md +109 -0
- package/src/docs/01-getting-started/first-session.md +79 -0
- package/src/docs/01-getting-started/install.md +61 -0
- package/src/docs/02-agents/academic.md +71 -0
- package/src/docs/02-agents/ai-engineer.md +78 -0
- package/src/docs/02-agents/analytics-engineer.md +58 -0
- package/src/docs/02-agents/applied-ml-scientist.md +59 -0
- package/src/docs/02-agents/backend-engineer.md +58 -0
- package/src/docs/02-agents/bi-engineer.md +65 -0
- package/src/docs/02-agents/data-analyst.md +67 -0
- package/src/docs/02-agents/data-engineer.md +57 -0
- package/src/docs/02-agents/data-modeller.md +51 -0
- package/src/docs/02-agents/data-scientist.md +78 -0
- package/src/docs/02-agents/deep-learning-engineer.md +64 -0
- package/src/docs/02-agents/ml-engineer.md +80 -0
- package/src/docs/02-agents/mlops-engineer.md +59 -0
- package/src/docs/02-agents/overview.md +62 -0
- package/src/docs/02-agents/researcher.md +73 -0
- package/src/docs/02-agents/syn.md +88 -0
- package/src/docs/03-protocols/auto-verify.md +82 -0
- package/src/docs/03-protocols/autonomous-research.md +59 -0
- package/src/docs/03-protocols/behavioral-rules.md +35 -0
- package/src/docs/03-protocols/diverge.md +50 -0
- package/src/docs/03-protocols/engineering-guidelines.md +56 -0
- package/src/docs/03-protocols/experiment-versioning.md +38 -0
- package/src/docs/03-protocols/gate-pattern.md +65 -0
- package/src/docs/03-protocols/incremental-testing.md +68 -0
- package/src/docs/03-protocols/join-path.md +46 -0
- package/src/docs/03-protocols/knowledge-ledger.md +70 -0
- package/src/docs/03-protocols/reviewer-verdicts.md +39 -0
- package/src/docs/03-protocols/swarm.md +40 -0
- package/src/docs/03-protocols/validation.md +174 -0
- package/src/docs/04-ui/activity-bar.md +70 -0
- package/src/docs/04-ui/chat-pane.md +80 -0
- package/src/docs/04-ui/code-intel.md +62 -0
- package/src/docs/04-ui/file-editing.md +61 -0
- package/src/docs/04-ui/git.md +54 -0
- package/src/docs/04-ui/keybindings.md +79 -0
- package/src/docs/04-ui/knowledge-map.md +76 -0
- package/src/docs/04-ui/overview.md +93 -0
- package/src/docs/04-ui/panels.md +49 -0
- package/src/docs/04-ui/pinboard-selection.md +66 -0
- package/src/docs/04-ui/quick-open-palette.md +56 -0
- package/src/docs/04-ui/sessions.md +81 -0
- package/src/docs/04-ui/settings-permissions.md +56 -0
- package/src/docs/05-commands/reference.md +59 -0
- package/src/docs/06-outputs/directory-map.md +116 -0
- package/src/docs/07-workflows/ai-eval-first.md +57 -0
- package/src/docs/07-workflows/deep-study-to-production.md +76 -0
- package/src/docs/07-workflows/diverge-exploration.md +77 -0
- package/src/docs/07-workflows/quick-analysis.md +45 -0
- package/src/docs/08-integrations/claude-code-auto-mode.md +191 -0
- package/src/docs/08-integrations/google-slides.md +175 -0
- package/src/docs/README.md +30 -0
- package/src/docs/manifest.json +108 -0
- package/src/templates/analysis-template.md +20 -0
- package/src/templates/branch-report.md +46 -0
- package/src/templates/diff-report.md +88 -0
- package/src/templates/knowledge-index.md +7 -0
- package/src/templates/model-card-schema.json +186 -0
- package/src/templates/model-card-schema.md +88 -0
- package/src/templates/model-card.md +124 -0
- package/src/templates/project-plan.md +47 -0
- package/src/templates/project-specs.md +81 -0
- package/src/templates/report-template.md +43 -0
- package/src/templates/study-template.md +25 -0
- package/src/ui/cc-readonly.js +181 -0
- package/src/ui/chat-session.js +466 -0
- package/src/ui/css/base.css +136 -0
- package/src/ui/css/brainstorm.css +525 -0
- package/src/ui/css/chat.css +1405 -0
- package/src/ui/css/editor.css +546 -0
- package/src/ui/css/eval-dashboard.css +157 -0
- package/src/ui/css/experiment.css +237 -0
- package/src/ui/css/guide.css +186 -0
- package/src/ui/css/knowledge-map.css +383 -0
- package/src/ui/css/layout.css +431 -0
- package/src/ui/css/model-card.css +161 -0
- package/src/ui/css/notebook-walkthrough.css +271 -0
- package/src/ui/css/pr-review.css +403 -0
- package/src/ui/css/prompt-lab.css +325 -0
- package/src/ui/css/sessions.css +258 -0
- package/src/ui/css/sidebar.css +661 -0
- package/src/ui/css/terminal.css +113 -0
- package/src/ui/css/theme-light.css +542 -0
- package/src/ui/index.html +389 -0
- package/src/ui/js/agents.js +32 -0
- package/src/ui/js/bookmarks.js +230 -0
- package/src/ui/js/chat.js +1776 -0
- package/src/ui/js/code-intel.js +328 -0
- package/src/ui/js/command-palette.js +142 -0
- package/src/ui/js/events.js +591 -0
- package/src/ui/js/explorer.js +317 -0
- package/src/ui/js/file-view.js +477 -0
- package/src/ui/js/git.js +536 -0
- package/src/ui/js/guide.js +198 -0
- package/src/ui/js/hud.js +75 -0
- package/src/ui/js/init.js +351 -0
- package/src/ui/js/knowledge-map.js +906 -0
- package/src/ui/js/markdown.js +114 -0
- package/src/ui/js/monaco.js +164 -0
- package/src/ui/js/notebook-walkthrough.js +272 -0
- package/src/ui/js/notebook.js +448 -0
- package/src/ui/js/panels.js +2681 -0
- package/src/ui/js/pinboard.js +186 -0
- package/src/ui/js/quick-open.js +164 -0
- package/src/ui/js/selection-context.js +131 -0
- package/src/ui/js/sessions.js +256 -0
- package/src/ui/js/settings.js +476 -0
- package/src/ui/js/split-view.js +82 -0
- package/src/ui/js/state.js +343 -0
- package/src/ui/js/table.js +161 -0
- package/src/ui/js/tabs.js +284 -0
- package/src/ui/js/tabular.js +125 -0
- package/src/ui/js/terminal.js +354 -0
- package/src/ui/js/timeline.js +137 -0
- package/src/ui/js/utils.js +293 -0
- package/src/ui/notebook-kernel.py +790 -0
- package/src/ui/open-browser.js +55 -0
- package/src/ui/permission-pattern.js +42 -0
- package/src/ui/relay.js +513 -0
- package/src/ui/server.js +3072 -0
- package/src/ui/session-index.js +225 -0
- package/src/ui/shards_icon.png +0 -0
- package/src/ui/spawn-server.js +41 -0
- package/src/ui/symbol-index.js +813 -0
- package/src/ui/ui-push.js +177 -0
- package/tools/gate-hook/VALIDATION_SPEC.md +273 -0
- package/tools/gate-hook/__tests__/auto-verify.test.js +343 -0
- package/tools/gate-hook/auto-allowlist.js +179 -0
- package/tools/gate-hook/auto-state.js +68 -0
- package/tools/gate-hook/classify.js +21 -0
- package/tools/gate-hook/log.js +57 -0
- package/tools/gate-hook/parser.js +205 -0
- package/tools/gate-hook/sql-guard.js +230 -0
- package/tools/gate-hook/state.js +170 -0
- package/tools/gate-hook/sweep.js +139 -0
- package/tools/gate-hook/transcript.js +45 -0
- package/tools/gate-hook/validation.js +321 -0
- package/tools/gate-hook.js +475 -0
- package/tools/install.js +914 -0
- package/tools/shards-gates.js +311 -0
- package/tools/shards-sessions.js +261 -0
- package/tools/shards-ui.js +377 -0
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
// ═══════════════════════════════════════════════════════════════
|
|
2
|
+
// Code Intelligence — Monaco language providers
|
|
3
|
+
// ═══════════════════════════════════════════════════════════════
|
|
4
|
+
|
|
5
|
+
var codeIntelReady = false;
|
|
6
|
+
|
|
7
|
+
var CODE_INTEL_LANGS = ['python', 'javascript', 'typescript', 'go', 'rust', 'java', 'ruby', 'php', 'c', 'cpp'];
|
|
8
|
+
|
|
9
|
+
// ─── Kind → Monaco CompletionItemKind mapping ────────────────────────────────
|
|
10
|
+
|
|
11
|
+
function kindToMonacoKind(kind) {
|
|
12
|
+
if (!window.monaco) return 0;
|
|
13
|
+
var map = {
|
|
14
|
+
'function': monaco.languages.CompletionItemKind.Function,
|
|
15
|
+
'method': monaco.languages.CompletionItemKind.Method,
|
|
16
|
+
'class': monaco.languages.CompletionItemKind.Class,
|
|
17
|
+
'variable': monaco.languages.CompletionItemKind.Variable,
|
|
18
|
+
'property': monaco.languages.CompletionItemKind.Property,
|
|
19
|
+
'interface': monaco.languages.CompletionItemKind.Interface,
|
|
20
|
+
'enum': monaco.languages.CompletionItemKind.Enum,
|
|
21
|
+
'struct': monaco.languages.CompletionItemKind.Struct,
|
|
22
|
+
'type': monaco.languages.CompletionItemKind.TypeParameter,
|
|
23
|
+
'module': monaco.languages.CompletionItemKind.Module,
|
|
24
|
+
'namespace': monaco.languages.CompletionItemKind.Module,
|
|
25
|
+
'constant': monaco.languages.CompletionItemKind.Constant,
|
|
26
|
+
'macro': monaco.languages.CompletionItemKind.Keyword,
|
|
27
|
+
};
|
|
28
|
+
return map[kind] || monaco.languages.CompletionItemKind.Text;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// ─── Kind → Monaco SymbolKind mapping ────────────────────────────────────────
|
|
32
|
+
|
|
33
|
+
function kindToMonacoSymbolKind(kind) {
|
|
34
|
+
if (!window.monaco) return 0;
|
|
35
|
+
var map = {
|
|
36
|
+
'function': monaco.languages.SymbolKind.Function,
|
|
37
|
+
'method': monaco.languages.SymbolKind.Method,
|
|
38
|
+
'class': monaco.languages.SymbolKind.Class,
|
|
39
|
+
'variable': monaco.languages.SymbolKind.Variable,
|
|
40
|
+
'property': monaco.languages.SymbolKind.Property,
|
|
41
|
+
'interface': monaco.languages.SymbolKind.Interface,
|
|
42
|
+
'enum': monaco.languages.SymbolKind.Enum,
|
|
43
|
+
'struct': monaco.languages.SymbolKind.Struct,
|
|
44
|
+
'type': monaco.languages.SymbolKind.TypeParameter,
|
|
45
|
+
'module': monaco.languages.SymbolKind.Module,
|
|
46
|
+
'namespace': monaco.languages.SymbolKind.Namespace,
|
|
47
|
+
'constant': monaco.languages.SymbolKind.Constant,
|
|
48
|
+
};
|
|
49
|
+
return map[kind] || monaco.languages.SymbolKind.Variable;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// ─── Kind badge for UI ───────────────────────────────────────────────────────
|
|
53
|
+
|
|
54
|
+
function kindBadge(kind) {
|
|
55
|
+
var map = {
|
|
56
|
+
'function': 'fn', 'method': 'fn', 'class': 'cls', 'struct': 'str',
|
|
57
|
+
'interface': 'ifc', 'variable': 'var', 'property': 'prop', 'enum': 'enum',
|
|
58
|
+
'type': 'type', 'module': 'mod', 'namespace': 'ns', 'constant': 'const', 'macro': 'mac',
|
|
59
|
+
};
|
|
60
|
+
return map[kind] || kind;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function kindBadgeClass(kind) {
|
|
64
|
+
if (kind === 'function' || kind === 'method') return 'ci-badge-fn';
|
|
65
|
+
if (kind === 'class' || kind === 'struct' || kind === 'interface') return 'ci-badge-cls';
|
|
66
|
+
if (kind === 'variable' || kind === 'property' || kind === 'constant') return 'ci-badge-var';
|
|
67
|
+
return 'ci-badge-other';
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// ─── Navigate to definition ──────────────────────────────────────────────────
|
|
71
|
+
|
|
72
|
+
function navigateToDefinition(file, line) {
|
|
73
|
+
openFileFromExplorer(file).then(function() {
|
|
74
|
+
// Wait for Monaco to mount
|
|
75
|
+
setTimeout(function() {
|
|
76
|
+
if (activeMonacoInstance) {
|
|
77
|
+
activeMonacoInstance.revealLineInCenter(line);
|
|
78
|
+
activeMonacoInstance.setPosition({ lineNumber: line, column: 1 });
|
|
79
|
+
activeMonacoInstance.focus();
|
|
80
|
+
}
|
|
81
|
+
}, 150);
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// ─── Register all providers ──────────────────────────────────────────────────
|
|
86
|
+
|
|
87
|
+
function registerCodeIntelProviders() {
|
|
88
|
+
if (codeIntelReady) return;
|
|
89
|
+
if (!window.monaco) return;
|
|
90
|
+
codeIntelReady = true;
|
|
91
|
+
|
|
92
|
+
// ─── Definition Provider ─────────────────────────────────────────
|
|
93
|
+
|
|
94
|
+
for (var i = 0; i < CODE_INTEL_LANGS.length; i++) {
|
|
95
|
+
(function(lang) {
|
|
96
|
+
monaco.languages.registerDefinitionProvider(lang, {
|
|
97
|
+
provideDefinition: function(model, position, token) {
|
|
98
|
+
var word = model.getWordAtPosition(position);
|
|
99
|
+
if (!word) return null;
|
|
100
|
+
|
|
101
|
+
var currentFile = getCurrentFileKey() || '';
|
|
102
|
+
|
|
103
|
+
return authFetch('/symbols/definition?name=' + encodeURIComponent(word.word) + '&file=' + encodeURIComponent(currentFile) + '&line=' + position.lineNumber)
|
|
104
|
+
.then(function(r) { return r.json(); })
|
|
105
|
+
.then(function(data) {
|
|
106
|
+
if (!data.definitions || data.definitions.length === 0) return null;
|
|
107
|
+
|
|
108
|
+
return data.definitions.map(function(def) {
|
|
109
|
+
return {
|
|
110
|
+
uri: monaco.Uri.parse('file:///' + def.file),
|
|
111
|
+
range: new monaco.Range(def.line, 1, def.line, 1),
|
|
112
|
+
};
|
|
113
|
+
});
|
|
114
|
+
})
|
|
115
|
+
.catch(function() { return null; });
|
|
116
|
+
},
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
// ─── Reference Provider ────────────────────────────────────────
|
|
120
|
+
|
|
121
|
+
monaco.languages.registerReferenceProvider(lang, {
|
|
122
|
+
provideReferences: function(model, position, context, token) {
|
|
123
|
+
var word = model.getWordAtPosition(position);
|
|
124
|
+
if (!word) return null;
|
|
125
|
+
|
|
126
|
+
var currentFile = getCurrentFileKey() || '';
|
|
127
|
+
|
|
128
|
+
return authFetch('/symbols/references?name=' + encodeURIComponent(word.word) + '&file=' + encodeURIComponent(currentFile))
|
|
129
|
+
.then(function(r) { return r.json(); })
|
|
130
|
+
.then(function(data) {
|
|
131
|
+
if (!data.references || data.references.length === 0) return null;
|
|
132
|
+
|
|
133
|
+
return data.references.map(function(ref) {
|
|
134
|
+
return {
|
|
135
|
+
uri: monaco.Uri.parse('file:///' + ref.file),
|
|
136
|
+
range: new monaco.Range(ref.line, 1, ref.line, 1),
|
|
137
|
+
};
|
|
138
|
+
});
|
|
139
|
+
})
|
|
140
|
+
.catch(function() { return null; });
|
|
141
|
+
},
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
// ─── Hover Provider ────────────────────────────────────────────
|
|
145
|
+
|
|
146
|
+
monaco.languages.registerHoverProvider(lang, {
|
|
147
|
+
provideHover: function(model, position, token) {
|
|
148
|
+
var word = model.getWordAtPosition(position);
|
|
149
|
+
if (!word) return null;
|
|
150
|
+
|
|
151
|
+
var currentFile = getCurrentFileKey() || '';
|
|
152
|
+
|
|
153
|
+
return authFetch('/symbols/hover?name=' + encodeURIComponent(word.word) + '&file=' + encodeURIComponent(currentFile) + '&line=' + position.lineNumber)
|
|
154
|
+
.then(function(r) { return r.json(); })
|
|
155
|
+
.then(function(data) {
|
|
156
|
+
if (!data || data.found === false || !data.name) return null;
|
|
157
|
+
|
|
158
|
+
var sig = data.signature ? data.name + data.signature : data.name;
|
|
159
|
+
var contents = [];
|
|
160
|
+
|
|
161
|
+
// Show kind + signature in a code block
|
|
162
|
+
contents.push({
|
|
163
|
+
value: '```\n(' + data.kind + ') ' + sig + '\n```',
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
// Show source location
|
|
167
|
+
if (data.file) {
|
|
168
|
+
contents.push({
|
|
169
|
+
value: '*' + data.file + ':' + data.line + '*',
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// Show scope if available
|
|
174
|
+
if (data.scope) {
|
|
175
|
+
contents.push({
|
|
176
|
+
value: 'Scope: `' + data.scope + '`',
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// References summary
|
|
181
|
+
if (data.references && data.references.count > 0) {
|
|
182
|
+
var refLines = ['---', '**References** (' + data.references.count + ')'];
|
|
183
|
+
for (var ri = 0; ri < data.references.byFile.length; ri++) {
|
|
184
|
+
var rf = data.references.byFile[ri];
|
|
185
|
+
var lineStr = rf.lines.slice(0, 3).join(', ');
|
|
186
|
+
if (rf.lines.length > 3) lineStr += ' +' + (rf.lines.length - 3) + ' more';
|
|
187
|
+
refLines.push('- `' + rf.file + '` : L' + lineStr);
|
|
188
|
+
}
|
|
189
|
+
if (data.references.truncated) {
|
|
190
|
+
refLines.push('- *... and more (Shift+F12)*');
|
|
191
|
+
}
|
|
192
|
+
contents.push({ value: refLines.join('\n') });
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// Callers (called by)
|
|
196
|
+
if (data.callers && data.callers.length > 0) {
|
|
197
|
+
var callerLines = ['---', '**Called by**'];
|
|
198
|
+
for (var ci = 0; ci < data.callers.length; ci++) {
|
|
199
|
+
var c = data.callers[ci];
|
|
200
|
+
callerLines.push('- `' + c.name + '` *' + c.file + ':' + c.line + '*');
|
|
201
|
+
}
|
|
202
|
+
contents.push({ value: callerLines.join('\n') });
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// Callees (calls)
|
|
206
|
+
if (data.callees && data.callees.length > 0) {
|
|
207
|
+
var calleeLines = ['---', '**Calls**'];
|
|
208
|
+
for (var ei = 0; ei < data.callees.length; ei++) {
|
|
209
|
+
var ce = data.callees[ei];
|
|
210
|
+
calleeLines.push('- `' + ce.name + '` *' + ce.file + ':' + ce.line + '*');
|
|
211
|
+
}
|
|
212
|
+
contents.push({ value: calleeLines.join('\n') });
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
return {
|
|
216
|
+
range: new monaco.Range(
|
|
217
|
+
position.lineNumber, word.startColumn,
|
|
218
|
+
position.lineNumber, word.endColumn
|
|
219
|
+
),
|
|
220
|
+
contents: contents,
|
|
221
|
+
};
|
|
222
|
+
})
|
|
223
|
+
.catch(function() { return null; });
|
|
224
|
+
},
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
// ─── Completion Provider ───────────────────────────────────────
|
|
228
|
+
|
|
229
|
+
monaco.languages.registerCompletionItemProvider(lang, {
|
|
230
|
+
triggerCharacters: ['.', '_'],
|
|
231
|
+
provideCompletionItems: function(model, position, context, token) {
|
|
232
|
+
var word = model.getWordUntilPosition(position);
|
|
233
|
+
var prefix = word.word;
|
|
234
|
+
if (!prefix || prefix.length < 2) return { suggestions: [] };
|
|
235
|
+
|
|
236
|
+
var currentFile = getCurrentFileKey() || '';
|
|
237
|
+
|
|
238
|
+
return authFetch('/symbols/completions?prefix=' + encodeURIComponent(prefix) + '&file=' + encodeURIComponent(currentFile))
|
|
239
|
+
.then(function(r) { return r.json(); })
|
|
240
|
+
.then(function(data) {
|
|
241
|
+
if (!data.completions) return { suggestions: [] };
|
|
242
|
+
|
|
243
|
+
var range = new monaco.Range(
|
|
244
|
+
position.lineNumber, word.startColumn,
|
|
245
|
+
position.lineNumber, word.endColumn
|
|
246
|
+
);
|
|
247
|
+
|
|
248
|
+
return {
|
|
249
|
+
suggestions: data.completions.map(function(comp, idx) {
|
|
250
|
+
return {
|
|
251
|
+
label: comp.name,
|
|
252
|
+
kind: kindToMonacoKind(comp.kind),
|
|
253
|
+
detail: (comp.kind || '') + (comp.detail ? ' ' + comp.detail : ''),
|
|
254
|
+
documentation: comp.file ? 'Defined in ' + comp.file + ':' + comp.line : '',
|
|
255
|
+
insertText: comp.name,
|
|
256
|
+
range: range,
|
|
257
|
+
sortText: String(idx).padStart(4, '0'),
|
|
258
|
+
};
|
|
259
|
+
}),
|
|
260
|
+
};
|
|
261
|
+
})
|
|
262
|
+
.catch(function() { return { suggestions: [] }; });
|
|
263
|
+
},
|
|
264
|
+
});
|
|
265
|
+
})(CODE_INTEL_LANGS[i]);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
// ─── Editor opener for go-to-definition navigation ─────────────
|
|
269
|
+
|
|
270
|
+
try {
|
|
271
|
+
monaco.editor.registerEditorOpener({
|
|
272
|
+
openCodeEditor: function(source, resource, selectionOrPosition) {
|
|
273
|
+
// resource.path is like /path/to/file — extract relative path
|
|
274
|
+
var filePath = resource.path;
|
|
275
|
+
if (filePath.startsWith('/')) filePath = filePath.substring(1);
|
|
276
|
+
|
|
277
|
+
var line = 1;
|
|
278
|
+
if (selectionOrPosition) {
|
|
279
|
+
line = selectionOrPosition.startLineNumber || selectionOrPosition.lineNumber || 1;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
navigateToDefinition(filePath, line);
|
|
283
|
+
return true; // we handled it
|
|
284
|
+
},
|
|
285
|
+
});
|
|
286
|
+
} catch (e) {
|
|
287
|
+
// registerEditorOpener may not be available in all Monaco builds
|
|
288
|
+
// Fallback: override the go-to-definition action
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
// ─── Standalone actions (for command palette) ────────────────────────────────
|
|
293
|
+
|
|
294
|
+
function triggerGoToDefinition() {
|
|
295
|
+
if (activeMonacoInstance) {
|
|
296
|
+
try {
|
|
297
|
+
activeMonacoInstance.getAction('editor.action.revealDefinition').run();
|
|
298
|
+
} catch {}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
function triggerFindReferences() {
|
|
303
|
+
if (activeMonacoInstance) {
|
|
304
|
+
try {
|
|
305
|
+
activeMonacoInstance.getAction('editor.action.referenceSearch.trigger').run();
|
|
306
|
+
} catch {}
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
function triggerPeekDefinition() {
|
|
311
|
+
if (activeMonacoInstance) {
|
|
312
|
+
try {
|
|
313
|
+
activeMonacoInstance.getAction('editor.action.peekDefinition').run();
|
|
314
|
+
} catch {}
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
function openSymbolSearch() {
|
|
319
|
+
var overlay = document.getElementById('quick-open-overlay');
|
|
320
|
+
overlay.classList.add('visible');
|
|
321
|
+
var input = document.getElementById('quick-open-input');
|
|
322
|
+
input.value = '@';
|
|
323
|
+
input.focus();
|
|
324
|
+
// Move cursor to end
|
|
325
|
+
input.setSelectionRange(1, 1);
|
|
326
|
+
quickOpenIdx = -1;
|
|
327
|
+
renderQuickOpenResults('@');
|
|
328
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
// ═══════════════════════════════════════════════════════════════
|
|
2
|
+
// Command palette (Cmd+K)
|
|
3
|
+
// ═══════════════════════════════════════════════════════════════
|
|
4
|
+
|
|
5
|
+
var commandRegistry = [
|
|
6
|
+
{ label: 'Open Knowledge Map', shortcut: '', action: function() { openKnowledgeMapPanel(); }, category: 'View' },
|
|
7
|
+
{ label: 'Open Developer Guide', shortcut: '', action: function() { openGuidePanel(); }, category: 'View' },
|
|
8
|
+
{ label: 'Toggle Explorer', shortcut: 'Cmd+B', action: function() { toggleExplorer(); }, category: 'View' },
|
|
9
|
+
{ label: 'Toggle Split View', shortcut: 'Cmd+\\', action: function() { toggleSplit(); }, category: 'View' },
|
|
10
|
+
{ label: 'Toggle Theme', shortcut: '', action: function() { toggleTheme(); }, category: 'View' },
|
|
11
|
+
{ label: 'Switch to Chat', shortcut: 'Cmd+1', action: function() { switchTab('chat'); }, category: 'Navigation' },
|
|
12
|
+
{ label: 'Close Current Tab', shortcut: 'Cmd+W', action: function() { var k = getCurrentFileKey(); if (k && k !== 'chat') closeFileTab(k); }, category: 'Tabs' },
|
|
13
|
+
{ label: 'Close All Tabs', shortcut: '', action: function() { closeAllTabs(); }, category: 'Tabs' },
|
|
14
|
+
{ label: 'Quick Open File', shortcut: 'Cmd+P', action: function() { toggleQuickOpen(); }, category: 'Navigation' },
|
|
15
|
+
{ label: 'Go to Line', shortcut: 'Cmd+G', action: function() { if (activeMonacoInstance) activeMonacoInstance.getAction('editor.action.gotoLine').run(); }, category: 'Editor' },
|
|
16
|
+
{ label: 'Go to Definition', shortcut: 'F12', action: function() { triggerGoToDefinition(); }, category: 'Editor' },
|
|
17
|
+
{ label: 'Peek Definition', shortcut: 'Cmd+Shift+F12', action: function() { triggerPeekDefinition(); }, category: 'Editor' },
|
|
18
|
+
{ label: 'Find All References', shortcut: 'Shift+F12', action: function() { triggerFindReferences(); }, category: 'Editor' },
|
|
19
|
+
{ label: 'Go to Symbol', shortcut: 'Cmd+Shift+O', action: function() { openSymbolSearch(); }, category: 'Navigation' },
|
|
20
|
+
{ label: 'Search Chat', shortcut: 'Cmd+F', action: function() { toggleChatSearch(); }, category: 'Chat' },
|
|
21
|
+
{ label: 'Settings', shortcut: 'Cmd+,', action: function() { toggleSettings(); }, category: 'View' },
|
|
22
|
+
{ label: 'Save Current File', shortcut: 'Cmd+S', action: function() { saveCurrentFile(); }, category: 'Editor' },
|
|
23
|
+
{ label: 'Copy File Path', shortcut: '', action: function() { copyCurrentFilePath(); }, category: 'Editor' },
|
|
24
|
+
{ label: 'Pin Selection to Context', shortcut: '', action: function() { if (typeof pinCurrentSelection === 'function') pinCurrentSelection(); }, category: 'Chat' },
|
|
25
|
+
{ label: 'Pin Current File to Context', shortcut: '', action: function() { var k = getCurrentFileKey(); if (k && k !== 'chat' && typeof pinFileByPath === 'function') pinFileByPath(k); }, category: 'Chat' },
|
|
26
|
+
{ label: 'Clear All Pins', shortcut: '', action: function() { if (typeof clearAllPins === 'function') clearAllPins(); }, category: 'Chat' },
|
|
27
|
+
];
|
|
28
|
+
|
|
29
|
+
var skillsFetched = false;
|
|
30
|
+
|
|
31
|
+
function fetchAndAddSkillsToPalette() {
|
|
32
|
+
if (skillsFetched) return;
|
|
33
|
+
authFetch('/api/skills').then(function(res) {
|
|
34
|
+
if (!res.ok) return;
|
|
35
|
+
return res.json();
|
|
36
|
+
}).then(function(skills) {
|
|
37
|
+
if (!skills || !skills.length) return;
|
|
38
|
+
skillsFetched = true;
|
|
39
|
+
skills.forEach(function(skill) {
|
|
40
|
+
commandRegistry.push({
|
|
41
|
+
label: skill.name,
|
|
42
|
+
shortcut: '',
|
|
43
|
+
action: function() { sendSlashToActiveSession('/' + skill.name); },
|
|
44
|
+
category: 'Skills',
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
}).catch(function() {});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function sendSlashToActiveSession(text) {
|
|
51
|
+
var session = getActiveSession();
|
|
52
|
+
if (!session) return;
|
|
53
|
+
var input = document.getElementById('chat-input');
|
|
54
|
+
input.value = text;
|
|
55
|
+
sendChatMessage();
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
var cmdPaletteIdx = -1;
|
|
59
|
+
|
|
60
|
+
function toggleCommandPalette() {
|
|
61
|
+
var overlay = document.getElementById('command-palette-overlay');
|
|
62
|
+
var isVisible = overlay.classList.contains('visible');
|
|
63
|
+
if (isVisible) {
|
|
64
|
+
overlay.classList.remove('visible');
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
overlay.classList.add('visible');
|
|
68
|
+
var input = document.getElementById('command-palette-input');
|
|
69
|
+
input.value = '';
|
|
70
|
+
input.focus();
|
|
71
|
+
cmdPaletteIdx = -1;
|
|
72
|
+
fetchAndAddSkillsToPalette();
|
|
73
|
+
renderCommandPaletteResults('');
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function renderCommandPaletteResults(query) {
|
|
77
|
+
var container = document.getElementById('command-palette-results');
|
|
78
|
+
var q = query.toLowerCase();
|
|
79
|
+
var filtered = commandRegistry.filter(function(cmd) {
|
|
80
|
+
return !q || cmd.label.toLowerCase().indexOf(q) !== -1 || cmd.category.toLowerCase().indexOf(q) !== -1;
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
if (filtered.length === 0) {
|
|
84
|
+
container.innerHTML = '<div class="overlay-empty">No matching commands</div>';
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
container.innerHTML = '';
|
|
89
|
+
for (var i = 0; i < filtered.length; i++) {
|
|
90
|
+
var cmd = filtered[i];
|
|
91
|
+
var item = document.createElement('div');
|
|
92
|
+
item.className = 'overlay-item' + (i === cmdPaletteIdx ? ' active' : '');
|
|
93
|
+
item.innerHTML =
|
|
94
|
+
'<span>' + esc(cmd.label) + '<span class="overlay-item-category">' + esc(cmd.category) + '</span></span>' +
|
|
95
|
+
(cmd.shortcut ? '<span class="overlay-item-shortcut">' + esc(cmd.shortcut) + '</span>' : '');
|
|
96
|
+
item.addEventListener('click', (function(action) {
|
|
97
|
+
return function() {
|
|
98
|
+
document.getElementById('command-palette-overlay').classList.remove('visible');
|
|
99
|
+
action();
|
|
100
|
+
};
|
|
101
|
+
})(cmd.action));
|
|
102
|
+
container.appendChild(item);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
document.getElementById('command-palette-input').addEventListener('input', function() {
|
|
107
|
+
cmdPaletteIdx = -1;
|
|
108
|
+
renderCommandPaletteResults(this.value);
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
document.getElementById('command-palette-input').addEventListener('keydown', function(e) {
|
|
112
|
+
var container = document.getElementById('command-palette-results');
|
|
113
|
+
var items = container.querySelectorAll('.overlay-item');
|
|
114
|
+
|
|
115
|
+
if (e.key === 'ArrowDown') {
|
|
116
|
+
e.preventDefault();
|
|
117
|
+
cmdPaletteIdx = Math.min(cmdPaletteIdx + 1, items.length - 1);
|
|
118
|
+
updateCmdPaletteActive(items);
|
|
119
|
+
} else if (e.key === 'ArrowUp') {
|
|
120
|
+
e.preventDefault();
|
|
121
|
+
cmdPaletteIdx = Math.max(cmdPaletteIdx - 1, 0);
|
|
122
|
+
updateCmdPaletteActive(items);
|
|
123
|
+
} else if (e.key === 'Enter') {
|
|
124
|
+
e.preventDefault();
|
|
125
|
+
if (cmdPaletteIdx >= 0 && items[cmdPaletteIdx]) {
|
|
126
|
+
items[cmdPaletteIdx].click();
|
|
127
|
+
} else if (items.length > 0) {
|
|
128
|
+
items[0].click();
|
|
129
|
+
}
|
|
130
|
+
} else if (e.key === 'Escape') {
|
|
131
|
+
document.getElementById('command-palette-overlay').classList.remove('visible');
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
function updateCmdPaletteActive(items) {
|
|
136
|
+
for (var i = 0; i < items.length; i++) {
|
|
137
|
+
items[i].classList.toggle('active', i === cmdPaletteIdx);
|
|
138
|
+
}
|
|
139
|
+
if (items[cmdPaletteIdx]) {
|
|
140
|
+
items[cmdPaletteIdx].scrollIntoView({ block: 'nearest' });
|
|
141
|
+
}
|
|
142
|
+
}
|