@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,477 @@
|
|
|
1
|
+
// ═══════════════════════════════════════════════════════════════
|
|
2
|
+
// File pane rendering
|
|
3
|
+
// ═══════════════════════════════════════════════════════════════
|
|
4
|
+
|
|
5
|
+
function renderFilePane(relPath) {
|
|
6
|
+
var f = openFiles[relPath];
|
|
7
|
+
if (!f) { renderEmptyFilePane(); return; }
|
|
8
|
+
var thisGen = ++fileRenderGen;
|
|
9
|
+
|
|
10
|
+
// Git diff tabs get special rendering
|
|
11
|
+
if (f.gitDiff && typeof renderGitDiffPane === 'function') {
|
|
12
|
+
hideGitDiffContainer(); // clean up first
|
|
13
|
+
renderGitDiffPane(relPath);
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
// If file is in inline diff mode, render diff and return
|
|
17
|
+
if (f.diffMode && typeof renderInlineDiff === 'function') {
|
|
18
|
+
renderInlineDiff(relPath);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
// Hide diff container when showing a normal file
|
|
22
|
+
if (typeof hideGitDiffContainer === 'function') hideGitDiffContainer();
|
|
23
|
+
|
|
24
|
+
document.getElementById('file-path-display').textContent = relPath;
|
|
25
|
+
document.getElementById('copy-path-btn').style.display = '';
|
|
26
|
+
|
|
27
|
+
var ext = relPath.split('.').pop().toLowerCase();
|
|
28
|
+
var isImage = isImageFile(relPath);
|
|
29
|
+
var isPdf = isPdfFile(relPath);
|
|
30
|
+
var isMarkdown = ext === 'md';
|
|
31
|
+
var isNotebook = ext === 'ipynb';
|
|
32
|
+
var isTabular = isTabularFile(relPath) && typeof Tabulator !== 'undefined';
|
|
33
|
+
|
|
34
|
+
// Media files — no edit/save/diff
|
|
35
|
+
if (isImage || isPdf) {
|
|
36
|
+
document.getElementById('edit-btn').style.display = 'none';
|
|
37
|
+
document.getElementById('save-btn').style.display = 'none';
|
|
38
|
+
document.getElementById('diff-btn').style.display = 'none';
|
|
39
|
+
var renderedView = document.getElementById('file-rendered-view');
|
|
40
|
+
var editorEl = document.getElementById('file-editor');
|
|
41
|
+
var tableView = document.getElementById('table-view');
|
|
42
|
+
var monacoFileContainer = document.getElementById('monaco-file-container');
|
|
43
|
+
renderedView.classList.remove('visible');
|
|
44
|
+
renderedView.innerHTML = '';
|
|
45
|
+
editorEl.style.display = 'none';
|
|
46
|
+
tableView.classList.remove('visible');
|
|
47
|
+
destroyTabulator();
|
|
48
|
+
disposeMonacoInstance();
|
|
49
|
+
monacoFileContainer.style.display = 'none';
|
|
50
|
+
monacoFileContainer.innerHTML = '';
|
|
51
|
+
|
|
52
|
+
renderedView.classList.add('visible');
|
|
53
|
+
var rawUrl = getRawFileUrl(f.absPath);
|
|
54
|
+
|
|
55
|
+
if (isImage) {
|
|
56
|
+
renderedView.innerHTML =
|
|
57
|
+
'<div class="media-preview image-preview">' +
|
|
58
|
+
'<img src="' + esc(rawUrl) + '" alt="' + esc(relPath.split('/').pop()) + '" />' +
|
|
59
|
+
'</div>';
|
|
60
|
+
} else {
|
|
61
|
+
renderedView.innerHTML =
|
|
62
|
+
'<div class="media-preview pdf-preview">' +
|
|
63
|
+
'<iframe src="' + esc(rawUrl) + '" title="' + esc(relPath.split('/').pop()) + '"></iframe>' +
|
|
64
|
+
'</div>';
|
|
65
|
+
}
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Hide edit/save buttons for notebooks (per-cell editing)
|
|
70
|
+
if (isNotebook) {
|
|
71
|
+
document.getElementById('edit-btn').style.display = 'none';
|
|
72
|
+
document.getElementById('save-btn').style.display = f.modified ? '' : 'none';
|
|
73
|
+
} else {
|
|
74
|
+
if (isTabular) {
|
|
75
|
+
document.getElementById('edit-btn').style.display = '';
|
|
76
|
+
document.getElementById('edit-btn').textContent = f.editMode ? 'Table' : 'Raw';
|
|
77
|
+
document.getElementById('save-btn').style.display = '';
|
|
78
|
+
} else if (isMarkdown) {
|
|
79
|
+
// Markdown keeps toggle — View renders markdown, Edit shows raw
|
|
80
|
+
document.getElementById('edit-btn').style.display = '';
|
|
81
|
+
document.getElementById('edit-btn').textContent = f.editMode ? 'View' : 'Edit';
|
|
82
|
+
document.getElementById('save-btn').style.display = '';
|
|
83
|
+
} else {
|
|
84
|
+
// Code files — always editable, no toggle needed
|
|
85
|
+
document.getElementById('edit-btn').style.display = 'none';
|
|
86
|
+
document.getElementById('save-btn').style.display = '';
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Update diff toggle button visibility
|
|
91
|
+
if (typeof updateDiffButtonState === 'function') updateDiffButtonState(relPath);
|
|
92
|
+
|
|
93
|
+
var renderedView = document.getElementById('file-rendered-view');
|
|
94
|
+
var editorEl = document.getElementById('file-editor');
|
|
95
|
+
var codeView = document.getElementById('code-view');
|
|
96
|
+
var codeEdit = document.getElementById('code-edit');
|
|
97
|
+
var gutter = document.getElementById('line-gutter');
|
|
98
|
+
var tableView = document.getElementById('table-view');
|
|
99
|
+
|
|
100
|
+
var monacoFileContainer = document.getElementById('monaco-file-container');
|
|
101
|
+
|
|
102
|
+
// Helper to hide all views and dispose Monaco
|
|
103
|
+
function hideAll() {
|
|
104
|
+
renderedView.classList.remove('visible');
|
|
105
|
+
renderedView.innerHTML = '';
|
|
106
|
+
editorEl.style.display = 'none';
|
|
107
|
+
tableView.classList.remove('visible');
|
|
108
|
+
destroyTabulator();
|
|
109
|
+
disposeMonacoInstance();
|
|
110
|
+
monacoFileContainer.style.display = 'none';
|
|
111
|
+
monacoFileContainer.innerHTML = '';
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if (isNotebook) {
|
|
115
|
+
// Notebook view with per-cell editing
|
|
116
|
+
hideAll();
|
|
117
|
+
renderedView.classList.add('visible');
|
|
118
|
+
if (!f.notebookData) {
|
|
119
|
+
try {
|
|
120
|
+
f.notebookData = parseNotebookData(f.content);
|
|
121
|
+
} catch(e) {
|
|
122
|
+
renderedView.innerHTML = '<div class="file-rendered"><pre>' + esc(f.content) + '</pre></div>';
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
renderNotebookView(relPath);
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (f.editMode) {
|
|
131
|
+
// Edit mode
|
|
132
|
+
hideAll();
|
|
133
|
+
if (!monacoFailed) {
|
|
134
|
+
editorEl.style.display = 'flex';
|
|
135
|
+
gutter.style.display = 'none';
|
|
136
|
+
codeView.style.display = 'none';
|
|
137
|
+
codeEdit.classList.remove('visible');
|
|
138
|
+
monacoFileContainer.style.display = 'block';
|
|
139
|
+
monacoFileContainer.innerHTML = '';
|
|
140
|
+
loadMonaco().then(function() {
|
|
141
|
+
if (thisGen !== fileRenderGen) return;
|
|
142
|
+
var lang = getMonacoLang(relPath);
|
|
143
|
+
activeMonacoInstance = createMonacoEditor(monacoFileContainer, {
|
|
144
|
+
value: f.content,
|
|
145
|
+
language: lang,
|
|
146
|
+
readOnly: false,
|
|
147
|
+
});
|
|
148
|
+
activeMonacoInstance.onDidChangeModelContent(function() {
|
|
149
|
+
f.content = activeMonacoInstance.getValue();
|
|
150
|
+
f.modified = f.content !== f.originalContent;
|
|
151
|
+
renderWsTabs();
|
|
152
|
+
});
|
|
153
|
+
activeMonacoInstance.focus();
|
|
154
|
+
}).catch(function() {
|
|
155
|
+
// Fallback to textarea
|
|
156
|
+
monacoFileContainer.style.display = 'none';
|
|
157
|
+
gutter.style.display = '';
|
|
158
|
+
codeView.style.display = 'none';
|
|
159
|
+
codeEdit.classList.add('visible');
|
|
160
|
+
codeEdit.value = f.content;
|
|
161
|
+
updateLineGutter(f.content);
|
|
162
|
+
codeEdit.focus();
|
|
163
|
+
});
|
|
164
|
+
} else {
|
|
165
|
+
// Monaco failed — textarea fallback
|
|
166
|
+
editorEl.style.display = 'flex';
|
|
167
|
+
gutter.style.display = '';
|
|
168
|
+
codeView.style.display = 'none';
|
|
169
|
+
codeEdit.classList.add('visible');
|
|
170
|
+
codeEdit.value = f.content;
|
|
171
|
+
updateLineGutter(f.content);
|
|
172
|
+
codeEdit.focus();
|
|
173
|
+
}
|
|
174
|
+
} else if (isTabular) {
|
|
175
|
+
// Table view
|
|
176
|
+
hideAll();
|
|
177
|
+
tableView.classList.add('visible');
|
|
178
|
+
if (!f.tabularData) {
|
|
179
|
+
loadTabularData(relPath, f).then(function(data) {
|
|
180
|
+
f.tabularData = data;
|
|
181
|
+
initTabulator(relPath, data);
|
|
182
|
+
}).catch(function(err) {
|
|
183
|
+
if (thisGen !== fileRenderGen) return;
|
|
184
|
+
console.warn('Tabular parse failed, falling back to code view:', err);
|
|
185
|
+
tableView.classList.remove('visible');
|
|
186
|
+
renderCodeView(relPath, f);
|
|
187
|
+
});
|
|
188
|
+
} else {
|
|
189
|
+
initTabulator(relPath, f.tabularData);
|
|
190
|
+
}
|
|
191
|
+
} else if (isMarkdown) {
|
|
192
|
+
// Markdown rendered view
|
|
193
|
+
hideAll();
|
|
194
|
+
renderedView.classList.add('visible');
|
|
195
|
+
renderedView.innerHTML = '<div class="file-rendered">' + renderMarkdown(f.content) + '</div>';
|
|
196
|
+
// Highlight latest section in project-specs.md
|
|
197
|
+
if (relPath.endsWith('project-specs.md')) {
|
|
198
|
+
highlightLatestSpecsSection(renderedView);
|
|
199
|
+
}
|
|
200
|
+
} else {
|
|
201
|
+
// Code view — use Monaco read-only
|
|
202
|
+
hideAll();
|
|
203
|
+
if (!monacoFailed) {
|
|
204
|
+
editorEl.style.display = 'flex';
|
|
205
|
+
gutter.style.display = 'none';
|
|
206
|
+
codeView.style.display = 'none';
|
|
207
|
+
codeEdit.classList.remove('visible');
|
|
208
|
+
monacoFileContainer.style.display = 'block';
|
|
209
|
+
monacoFileContainer.innerHTML = '';
|
|
210
|
+
loadMonaco().then(function() {
|
|
211
|
+
if (thisGen !== fileRenderGen) return;
|
|
212
|
+
var lang = getMonacoLang(relPath);
|
|
213
|
+
activeMonacoInstance = createMonacoEditor(monacoFileContainer, {
|
|
214
|
+
value: f.content,
|
|
215
|
+
language: lang,
|
|
216
|
+
readOnly: true,
|
|
217
|
+
});
|
|
218
|
+
}).catch(function() {
|
|
219
|
+
monacoFileContainer.style.display = 'none';
|
|
220
|
+
renderCodeViewFallback(relPath, f);
|
|
221
|
+
});
|
|
222
|
+
} else {
|
|
223
|
+
renderCodeViewFallback(relPath, f);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
function renderCodeViewFallback(relPath, f) {
|
|
229
|
+
var editorEl = document.getElementById('file-editor');
|
|
230
|
+
var codeView = document.getElementById('code-view');
|
|
231
|
+
var codeEdit = document.getElementById('code-edit');
|
|
232
|
+
var gutter = document.getElementById('line-gutter');
|
|
233
|
+
editorEl.style.display = 'flex';
|
|
234
|
+
gutter.style.display = '';
|
|
235
|
+
codeView.style.display = 'block';
|
|
236
|
+
codeEdit.classList.remove('visible');
|
|
237
|
+
var lang = getLang(relPath);
|
|
238
|
+
document.getElementById('code-view-code').innerHTML = highlightCode(esc(f.content), lang);
|
|
239
|
+
updateLineGutter(f.content);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
function renderCodeView(relPath, f) {
|
|
243
|
+
var thisGen = fileRenderGen;
|
|
244
|
+
var editorEl = document.getElementById('file-editor');
|
|
245
|
+
var monacoFileContainer = document.getElementById('monaco-file-container');
|
|
246
|
+
editorEl.style.display = 'flex';
|
|
247
|
+
if (!monacoFailed) {
|
|
248
|
+
var gutter = document.getElementById('line-gutter');
|
|
249
|
+
var codeView = document.getElementById('code-view');
|
|
250
|
+
var codeEdit = document.getElementById('code-edit');
|
|
251
|
+
gutter.style.display = 'none';
|
|
252
|
+
codeView.style.display = 'none';
|
|
253
|
+
codeEdit.classList.remove('visible');
|
|
254
|
+
monacoFileContainer.style.display = 'block';
|
|
255
|
+
monacoFileContainer.innerHTML = '';
|
|
256
|
+
loadMonaco().then(function() {
|
|
257
|
+
if (thisGen !== fileRenderGen) return;
|
|
258
|
+
var lang = getMonacoLang(relPath);
|
|
259
|
+
activeMonacoInstance = createMonacoEditor(monacoFileContainer, {
|
|
260
|
+
value: f.content,
|
|
261
|
+
language: lang,
|
|
262
|
+
readOnly: false,
|
|
263
|
+
});
|
|
264
|
+
activeMonacoInstance.onDidChangeModelContent(function() {
|
|
265
|
+
f.content = activeMonacoInstance.getValue();
|
|
266
|
+
f.modified = f.content !== f.originalContent;
|
|
267
|
+
renderWsTabs();
|
|
268
|
+
});
|
|
269
|
+
}).catch(function() {
|
|
270
|
+
monacoFileContainer.style.display = 'none';
|
|
271
|
+
renderCodeViewFallback(relPath, f);
|
|
272
|
+
});
|
|
273
|
+
} else {
|
|
274
|
+
renderCodeViewFallback(relPath, f);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
// ═══════════════════════════════════════════════════════════════
|
|
279
|
+
// Edit mode toggle & save
|
|
280
|
+
// ═══════════════════════════════════════════════════════════════
|
|
281
|
+
|
|
282
|
+
function toggleEditMode() {
|
|
283
|
+
var key = getCurrentFileKey();
|
|
284
|
+
if (!key || key === 'chat' || !openFiles[key]) return;
|
|
285
|
+
var f = openFiles[key];
|
|
286
|
+
|
|
287
|
+
// Exit diff mode first if active
|
|
288
|
+
if (f.diffMode) {
|
|
289
|
+
f.diffMode = false;
|
|
290
|
+
if (typeof hideGitDiffContainer === 'function') hideGitDiffContainer();
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
// Notebooks use per-cell editing, no file-level toggle
|
|
294
|
+
var ext = key.split('.').pop().toLowerCase();
|
|
295
|
+
if (ext === 'ipynb') return;
|
|
296
|
+
|
|
297
|
+
if (isTabularFile(key) && isEditableTabular(key)) {
|
|
298
|
+
if (!f.editMode) {
|
|
299
|
+
// Table → Raw: serialize current Tabulator data to text
|
|
300
|
+
var serialized = getTabulatorSerializedContent(key);
|
|
301
|
+
if (serialized !== null) {
|
|
302
|
+
f.content = serialized;
|
|
303
|
+
}
|
|
304
|
+
f.tabularData = null;
|
|
305
|
+
destroyTabulator();
|
|
306
|
+
} else {
|
|
307
|
+
// Raw → Table: clear tabular data so it re-parses
|
|
308
|
+
f.tabularData = null;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
// Dispose Monaco when toggling
|
|
313
|
+
disposeMonacoInstance();
|
|
314
|
+
|
|
315
|
+
f.editMode = !f.editMode;
|
|
316
|
+
renderFilePane(key);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
function getCurrentFileKey() {
|
|
320
|
+
return splitMode ? currentFileInPane : activeTabId;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
async function saveCurrentFile() {
|
|
324
|
+
var key = getCurrentFileKey();
|
|
325
|
+
if (!key || key === 'chat' || !openFiles[key]) return;
|
|
326
|
+
var f = openFiles[key];
|
|
327
|
+
|
|
328
|
+
var contentToSave = f.content;
|
|
329
|
+
|
|
330
|
+
// Notebook: flush active Monaco editor, serialize
|
|
331
|
+
if (f.notebookData) {
|
|
332
|
+
if (activeNotebookCellMonaco && activeNotebookCellIdx !== null) {
|
|
333
|
+
var cell = f.notebookData.cells[activeNotebookCellIdx];
|
|
334
|
+
if (cell) cell.source = activeNotebookCellMonaco.getValue();
|
|
335
|
+
}
|
|
336
|
+
contentToSave = serializeNotebook(f.notebookData);
|
|
337
|
+
f.content = contentToSave;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
// If Tabulator is active (not in raw edit mode), serialize table data first
|
|
341
|
+
if (isTabularFile(key) && isEditableTabular(key) && !f.editMode && activeTabulatorInstance) {
|
|
342
|
+
var serializedTab = getTabulatorSerializedContent(key);
|
|
343
|
+
if (serializedTab !== null) {
|
|
344
|
+
contentToSave = serializedTab;
|
|
345
|
+
f.content = serializedTab;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
// If Monaco is active for a code file, sync content
|
|
350
|
+
if (activeMonacoInstance && !f.notebookData) {
|
|
351
|
+
contentToSave = activeMonacoInstance.getValue();
|
|
352
|
+
f.content = contentToSave;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
try {
|
|
356
|
+
var res = await authFetch('/browse/file/save', {
|
|
357
|
+
method: 'POST',
|
|
358
|
+
headers: { 'Content-Type': 'application/json' },
|
|
359
|
+
body: JSON.stringify({ path: f.absPath, content: contentToSave }),
|
|
360
|
+
});
|
|
361
|
+
var data = await res.json();
|
|
362
|
+
if (data.error) { alert('Save failed: ' + data.error); return; }
|
|
363
|
+
f.originalContent = contentToSave;
|
|
364
|
+
f.modified = false;
|
|
365
|
+
// Invalidate diff cache after save
|
|
366
|
+
f.cachedDiffData = false;
|
|
367
|
+
f.gitOriginal = null;
|
|
368
|
+
f.gitModified = null;
|
|
369
|
+
if (f.diffMode) {
|
|
370
|
+
f.diffMode = false;
|
|
371
|
+
if (typeof hideGitDiffContainer === 'function') hideGitDiffContainer();
|
|
372
|
+
}
|
|
373
|
+
renderWsTabs();
|
|
374
|
+
} catch (err) {
|
|
375
|
+
alert('Save failed: ' + err.message);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
function updateLineGutter(content) {
|
|
380
|
+
var gutter = document.getElementById('line-gutter');
|
|
381
|
+
var lineCount = (content.match(/\n/g) || []).length + 1;
|
|
382
|
+
var lines = [];
|
|
383
|
+
for (var i = 1; i <= lineCount; i++) lines.push(i);
|
|
384
|
+
gutter.textContent = lines.join('\n');
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
function highlightLatestSpecsSection(container) {
|
|
388
|
+
// Find all h2 headings in the rendered markdown
|
|
389
|
+
var headings = container.querySelectorAll('.file-rendered h2, .file-rendered h3');
|
|
390
|
+
if (headings.length === 0) return;
|
|
391
|
+
|
|
392
|
+
// Remove any previous highlights
|
|
393
|
+
var prev = container.querySelectorAll('.specs-latest-section');
|
|
394
|
+
for (var i = 0; i < prev.length; i++) {
|
|
395
|
+
prev[i].classList.remove('specs-latest-section');
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
// Highlight the last heading
|
|
399
|
+
var lastHeading = headings[headings.length - 1];
|
|
400
|
+
lastHeading.classList.add('specs-latest-section');
|
|
401
|
+
|
|
402
|
+
// Scroll the heading into view within the rendered view container
|
|
403
|
+
setTimeout(function() {
|
|
404
|
+
lastHeading.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
|
405
|
+
}, 100);
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
function handleArtifactUpdate(relPath, content, isSessionFile) {
|
|
409
|
+
if (relPath in openFiles) {
|
|
410
|
+
var f = openFiles[relPath];
|
|
411
|
+
if (!f.modified) {
|
|
412
|
+
f.content = content;
|
|
413
|
+
f.originalContent = content;
|
|
414
|
+
f.tabularData = null; // Force re-parse for tabular files
|
|
415
|
+
f.notebookData = null; // Force re-parse for notebooks
|
|
416
|
+
f.cachedDiffData = false; // Invalidate diff cache
|
|
417
|
+
var currentKey = getCurrentFileKey();
|
|
418
|
+
if (relPath === currentKey) {
|
|
419
|
+
// Update Monaco in-place if possible to avoid cursor jump
|
|
420
|
+
if (activeMonacoInstance && f.editMode) {
|
|
421
|
+
var cursorPos = activeMonacoInstance.getPosition();
|
|
422
|
+
activeMonacoInstance.setValue(content);
|
|
423
|
+
if (cursorPos) activeMonacoInstance.setPosition(cursorPos);
|
|
424
|
+
} else {
|
|
425
|
+
disposeNotebookCellMonaco();
|
|
426
|
+
renderFilePane(relPath);
|
|
427
|
+
}
|
|
428
|
+
} else {
|
|
429
|
+
var tabEl = document.querySelector('[data-path="' + CSS.escape(relPath) + '"]');
|
|
430
|
+
if (tabEl) tabEl.classList.add('unread');
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
} else if (sessionTouchedFiles.has(relPath) && relPath.endsWith('project-specs.md')) {
|
|
434
|
+
// Auto-open project-specs.md as a tab
|
|
435
|
+
openFileTab(relPath, content, relPath);
|
|
436
|
+
}
|
|
437
|
+
// else: don't auto-open
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
function initFileAutoRefresh() {
|
|
441
|
+
setInterval(async function() {
|
|
442
|
+
for (var i = 0; i < fileTabOrder.length; i++) {
|
|
443
|
+
var relPath = fileTabOrder[i];
|
|
444
|
+
var f = openFiles[relPath];
|
|
445
|
+
if (!f || f.modified) continue;
|
|
446
|
+
|
|
447
|
+
try {
|
|
448
|
+
var res = await authFetch('/browse/file?path=' + encodeURIComponent(f.absPath));
|
|
449
|
+
var data = await res.json();
|
|
450
|
+
if (data.error) continue;
|
|
451
|
+
if (data.content !== f.content) {
|
|
452
|
+
f.content = data.content;
|
|
453
|
+
f.originalContent = data.content;
|
|
454
|
+
f.tabularData = null; // Force re-parse for tabular files
|
|
455
|
+
f.notebookData = null; // Force re-parse for notebooks
|
|
456
|
+
f.cachedDiffData = false; // Invalidate diff cache
|
|
457
|
+
var currentKey = getCurrentFileKey();
|
|
458
|
+
if (relPath === currentKey) {
|
|
459
|
+
// Update Monaco in-place if possible to avoid cursor jump
|
|
460
|
+
if (activeMonacoInstance && f.editMode) {
|
|
461
|
+
var cursorPos = activeMonacoInstance.getPosition();
|
|
462
|
+
activeMonacoInstance.setValue(data.content);
|
|
463
|
+
if (cursorPos) activeMonacoInstance.setPosition(cursorPos);
|
|
464
|
+
} else {
|
|
465
|
+
disposeNotebookCellMonaco();
|
|
466
|
+
renderFilePane(relPath);
|
|
467
|
+
}
|
|
468
|
+
} else {
|
|
469
|
+
// Mark unread
|
|
470
|
+
var tabEl = document.querySelector('[data-path="' + CSS.escape(relPath) + '"]');
|
|
471
|
+
if (tabEl) tabEl.classList.add('unread');
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
} catch(e) {}
|
|
475
|
+
}
|
|
476
|
+
}, 3000);
|
|
477
|
+
}
|