@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,354 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* terminal.js — Integrated terminal panel for Shards IDE (Electron only).
|
|
3
|
+
*
|
|
4
|
+
* Uses xterm.js in the renderer and node-pty in the main process,
|
|
5
|
+
* connected via the shardsElectron IPC bridge from preload.js.
|
|
6
|
+
*
|
|
7
|
+
* Gracefully degrades: if window.shardsElectron is not available
|
|
8
|
+
* (web UI mode), the terminal panel is hidden and no code runs.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const terminalState = {
|
|
12
|
+
tabs: [], // [{ id, label, termId }]
|
|
13
|
+
activeTab: null, // index into tabs
|
|
14
|
+
visible: false,
|
|
15
|
+
panelHeight: 250,
|
|
16
|
+
instances: {} // termId -> Terminal (xterm) instance
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
let xtermLoaded = false;
|
|
20
|
+
let fitAddonModule = null;
|
|
21
|
+
|
|
22
|
+
function isElectron() {
|
|
23
|
+
return !!(window.shardsElectron && window.shardsElectron.terminal);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// ─── xterm.js loading ────────────────────────────────────────────────────────
|
|
27
|
+
// In Electron, xterm is bundled in vendor/. In dev, loaded from node_modules.
|
|
28
|
+
|
|
29
|
+
async function ensureXterm() {
|
|
30
|
+
if (xtermLoaded) return;
|
|
31
|
+
|
|
32
|
+
// xterm.js and fit addon should be available globally or via import
|
|
33
|
+
// In Electron packaged mode, they're loaded via script tags in index.html
|
|
34
|
+
if (typeof Terminal === 'undefined') {
|
|
35
|
+
console.warn('xterm.js not loaded — terminal unavailable');
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (typeof FitAddon !== 'undefined') {
|
|
40
|
+
fitAddonModule = FitAddon;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
xtermLoaded = true;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// ─── Panel visibility ───────────────────────────────────────────────────────
|
|
47
|
+
|
|
48
|
+
function toggleTerminalPanel() {
|
|
49
|
+
if (!isElectron()) return;
|
|
50
|
+
|
|
51
|
+
terminalState.visible = !terminalState.visible;
|
|
52
|
+
const panel = document.getElementById('terminal-panel');
|
|
53
|
+
if (!panel) return;
|
|
54
|
+
|
|
55
|
+
if (terminalState.visible) {
|
|
56
|
+
panel.style.display = 'flex';
|
|
57
|
+
panel.style.height = terminalState.panelHeight + 'px';
|
|
58
|
+
// Create first terminal if none exist
|
|
59
|
+
if (terminalState.tabs.length === 0) {
|
|
60
|
+
createTerminalTab();
|
|
61
|
+
} else {
|
|
62
|
+
// Re-fit the active terminal
|
|
63
|
+
const active = terminalState.tabs[terminalState.activeTab];
|
|
64
|
+
if (active && terminalState.instances[active.termId]) {
|
|
65
|
+
const inst = terminalState.instances[active.termId];
|
|
66
|
+
if (inst.fitAddon) {
|
|
67
|
+
setTimeout(() => inst.fitAddon.fit(), 50);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
} else {
|
|
72
|
+
panel.style.display = 'none';
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// ─── Terminal tabs ──────────────────────────────────────────────────────────
|
|
77
|
+
|
|
78
|
+
async function createTerminalTab() {
|
|
79
|
+
if (!isElectron()) return;
|
|
80
|
+
await ensureXterm();
|
|
81
|
+
if (!xtermLoaded) return;
|
|
82
|
+
|
|
83
|
+
const termId = await window.shardsElectron.terminal.create({
|
|
84
|
+
cols: 80,
|
|
85
|
+
rows: 24
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
const index = terminalState.tabs.length;
|
|
89
|
+
const tab = { id: index, label: `Terminal ${index + 1}`, termId };
|
|
90
|
+
terminalState.tabs.push(tab);
|
|
91
|
+
terminalState.activeTab = index;
|
|
92
|
+
|
|
93
|
+
// Create xterm instance
|
|
94
|
+
const term = new Terminal({
|
|
95
|
+
cursorBlink: true,
|
|
96
|
+
fontSize: 13,
|
|
97
|
+
fontFamily: "'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace",
|
|
98
|
+
theme: {
|
|
99
|
+
background: '#0d1117',
|
|
100
|
+
foreground: '#e6edf3',
|
|
101
|
+
cursor: '#58a6ff',
|
|
102
|
+
selectionBackground: 'rgba(56, 139, 253, 0.3)',
|
|
103
|
+
black: '#484f58',
|
|
104
|
+
red: '#ff7b72',
|
|
105
|
+
green: '#3fb950',
|
|
106
|
+
yellow: '#d29922',
|
|
107
|
+
blue: '#58a6ff',
|
|
108
|
+
magenta: '#bc8cff',
|
|
109
|
+
cyan: '#39d353',
|
|
110
|
+
white: '#b1bac4'
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
const inst = { terminal: term, fitAddon: null };
|
|
115
|
+
|
|
116
|
+
if (fitAddonModule) {
|
|
117
|
+
const fit = new fitAddonModule.FitAddon();
|
|
118
|
+
term.loadAddon(fit);
|
|
119
|
+
inst.fitAddon = fit;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
terminalState.instances[termId] = inst;
|
|
123
|
+
|
|
124
|
+
// Render
|
|
125
|
+
renderTerminalTabs();
|
|
126
|
+
activateTerminalTab(index);
|
|
127
|
+
|
|
128
|
+
// Connect input: renderer -> main process
|
|
129
|
+
term.onData((data) => {
|
|
130
|
+
window.shardsElectron.terminal.write(termId, data);
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function activateTerminalTab(index) {
|
|
135
|
+
if (index < 0 || index >= terminalState.tabs.length) return;
|
|
136
|
+
terminalState.activeTab = index;
|
|
137
|
+
const tab = terminalState.tabs[index];
|
|
138
|
+
const container = document.getElementById('terminal-container');
|
|
139
|
+
if (!container) return;
|
|
140
|
+
|
|
141
|
+
// Hide all, show active
|
|
142
|
+
container.querySelectorAll('.terminal-instance').forEach(el => {
|
|
143
|
+
el.style.display = 'none';
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
let el = document.getElementById(`term-${tab.termId}`);
|
|
147
|
+
if (!el) {
|
|
148
|
+
el = document.createElement('div');
|
|
149
|
+
el.id = `term-${tab.termId}`;
|
|
150
|
+
el.className = 'terminal-instance';
|
|
151
|
+
container.appendChild(el);
|
|
152
|
+
|
|
153
|
+
const inst = terminalState.instances[tab.termId];
|
|
154
|
+
if (inst) {
|
|
155
|
+
inst.terminal.open(el);
|
|
156
|
+
if (inst.fitAddon) {
|
|
157
|
+
setTimeout(() => inst.fitAddon.fit(), 50);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
el.style.display = 'block';
|
|
163
|
+
|
|
164
|
+
// Fit on activation
|
|
165
|
+
const inst = terminalState.instances[tab.termId];
|
|
166
|
+
if (inst && inst.fitAddon) {
|
|
167
|
+
setTimeout(() => {
|
|
168
|
+
inst.fitAddon.fit();
|
|
169
|
+
// Notify main process of new dimensions
|
|
170
|
+
const dims = inst.fitAddon.proposeDimensions();
|
|
171
|
+
if (dims) {
|
|
172
|
+
window.shardsElectron.terminal.resize(tab.termId, dims.cols, dims.rows);
|
|
173
|
+
}
|
|
174
|
+
}, 50);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
renderTerminalTabs();
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
function closeTerminalTab(index) {
|
|
181
|
+
const tab = terminalState.tabs[index];
|
|
182
|
+
if (!tab) return;
|
|
183
|
+
|
|
184
|
+
// Destroy pty in main process
|
|
185
|
+
window.shardsElectron.terminal.destroy(tab.termId);
|
|
186
|
+
|
|
187
|
+
// Clean up xterm instance
|
|
188
|
+
const inst = terminalState.instances[tab.termId];
|
|
189
|
+
if (inst) {
|
|
190
|
+
inst.terminal.dispose();
|
|
191
|
+
delete terminalState.instances[tab.termId];
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// Remove DOM
|
|
195
|
+
const el = document.getElementById(`term-${tab.termId}`);
|
|
196
|
+
if (el) el.remove();
|
|
197
|
+
|
|
198
|
+
terminalState.tabs.splice(index, 1);
|
|
199
|
+
|
|
200
|
+
if (terminalState.tabs.length === 0) {
|
|
201
|
+
terminalState.activeTab = null;
|
|
202
|
+
toggleTerminalPanel(); // hide
|
|
203
|
+
} else {
|
|
204
|
+
terminalState.activeTab = Math.min(index, terminalState.tabs.length - 1);
|
|
205
|
+
activateTerminalTab(terminalState.activeTab);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
function renderTerminalTabs() {
|
|
210
|
+
const bar = document.getElementById('terminal-tab-bar');
|
|
211
|
+
if (!bar) return;
|
|
212
|
+
|
|
213
|
+
bar.innerHTML = '';
|
|
214
|
+
|
|
215
|
+
terminalState.tabs.forEach((tab, i) => {
|
|
216
|
+
const btn = document.createElement('button');
|
|
217
|
+
btn.className = 'terminal-tab' + (i === terminalState.activeTab ? ' active' : '');
|
|
218
|
+
btn.textContent = tab.label;
|
|
219
|
+
btn.onclick = () => activateTerminalTab(i);
|
|
220
|
+
|
|
221
|
+
const close = document.createElement('span');
|
|
222
|
+
close.className = 'terminal-tab-close';
|
|
223
|
+
close.textContent = '\u00d7';
|
|
224
|
+
close.onclick = (e) => { e.stopPropagation(); closeTerminalTab(i); };
|
|
225
|
+
btn.appendChild(close);
|
|
226
|
+
|
|
227
|
+
bar.appendChild(btn);
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
// "+" button
|
|
231
|
+
const addBtn = document.createElement('button');
|
|
232
|
+
addBtn.className = 'terminal-tab terminal-tab-add';
|
|
233
|
+
addBtn.textContent = '+';
|
|
234
|
+
addBtn.title = 'New terminal';
|
|
235
|
+
addBtn.onclick = () => createTerminalTab();
|
|
236
|
+
bar.appendChild(addBtn);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
// ─── Resize handle ──────────────────────────────────────────────────────────
|
|
240
|
+
|
|
241
|
+
function initTerminalResize() {
|
|
242
|
+
const handle = document.getElementById('terminal-resize-handle');
|
|
243
|
+
const panel = document.getElementById('terminal-panel');
|
|
244
|
+
if (!handle || !panel) return;
|
|
245
|
+
|
|
246
|
+
let startY = 0;
|
|
247
|
+
let startHeight = 0;
|
|
248
|
+
|
|
249
|
+
handle.addEventListener('mousedown', (e) => {
|
|
250
|
+
e.preventDefault();
|
|
251
|
+
startY = e.clientY;
|
|
252
|
+
startHeight = panel.offsetHeight;
|
|
253
|
+
|
|
254
|
+
const onMove = (e2) => {
|
|
255
|
+
const delta = startY - e2.clientY;
|
|
256
|
+
const newHeight = Math.max(100, Math.min(600, startHeight + delta));
|
|
257
|
+
panel.style.height = newHeight + 'px';
|
|
258
|
+
terminalState.panelHeight = newHeight;
|
|
259
|
+
|
|
260
|
+
// Re-fit active terminal
|
|
261
|
+
if (terminalState.activeTab !== null) {
|
|
262
|
+
const tab = terminalState.tabs[terminalState.activeTab];
|
|
263
|
+
const inst = tab && terminalState.instances[tab.termId];
|
|
264
|
+
if (inst && inst.fitAddon) inst.fitAddon.fit();
|
|
265
|
+
}
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
const onUp = () => {
|
|
269
|
+
document.removeEventListener('mousemove', onMove);
|
|
270
|
+
document.removeEventListener('mouseup', onUp);
|
|
271
|
+
|
|
272
|
+
// Send final dimensions to pty
|
|
273
|
+
if (terminalState.activeTab !== null) {
|
|
274
|
+
const tab = terminalState.tabs[terminalState.activeTab];
|
|
275
|
+
const inst = tab && terminalState.instances[tab.termId];
|
|
276
|
+
if (inst && inst.fitAddon) {
|
|
277
|
+
const dims = inst.fitAddon.proposeDimensions();
|
|
278
|
+
if (dims) {
|
|
279
|
+
window.shardsElectron.terminal.resize(tab.termId, dims.cols, dims.rows);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
document.addEventListener('mousemove', onMove);
|
|
286
|
+
document.addEventListener('mouseup', onUp);
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
// ─── IPC data routing ───────────────────────────────────────────────────────
|
|
291
|
+
|
|
292
|
+
function initTerminalIPC() {
|
|
293
|
+
if (!isElectron()) return;
|
|
294
|
+
|
|
295
|
+
window.shardsElectron.terminal.onData((termId, data) => {
|
|
296
|
+
const inst = terminalState.instances[termId];
|
|
297
|
+
if (inst) inst.terminal.write(data);
|
|
298
|
+
});
|
|
299
|
+
|
|
300
|
+
window.shardsElectron.terminal.onExit((termId, _code) => {
|
|
301
|
+
// Find and close the tab
|
|
302
|
+
const index = terminalState.tabs.findIndex(t => t.termId === termId);
|
|
303
|
+
if (index >= 0) {
|
|
304
|
+
const inst = terminalState.instances[termId];
|
|
305
|
+
if (inst) {
|
|
306
|
+
inst.terminal.dispose();
|
|
307
|
+
delete terminalState.instances[termId];
|
|
308
|
+
}
|
|
309
|
+
const el = document.getElementById(`term-${termId}`);
|
|
310
|
+
if (el) el.remove();
|
|
311
|
+
|
|
312
|
+
terminalState.tabs.splice(index, 1);
|
|
313
|
+
if (terminalState.tabs.length === 0) {
|
|
314
|
+
terminalState.activeTab = null;
|
|
315
|
+
toggleTerminalPanel();
|
|
316
|
+
} else {
|
|
317
|
+
terminalState.activeTab = Math.min(index, terminalState.tabs.length - 1);
|
|
318
|
+
activateTerminalTab(terminalState.activeTab);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
});
|
|
322
|
+
|
|
323
|
+
// Keyboard shortcut: Ctrl+` to toggle
|
|
324
|
+
document.addEventListener('keydown', (e) => {
|
|
325
|
+
if (e.ctrlKey && e.key === '`') {
|
|
326
|
+
e.preventDefault();
|
|
327
|
+
toggleTerminalPanel();
|
|
328
|
+
}
|
|
329
|
+
});
|
|
330
|
+
|
|
331
|
+
// Menu action
|
|
332
|
+
window.shardsElectron.onMenuAction('toggle-terminal', toggleTerminalPanel);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
// ─── Init ───────────────────────────────────────────────────────────────────
|
|
336
|
+
|
|
337
|
+
function initTerminal() {
|
|
338
|
+
if (!isElectron()) {
|
|
339
|
+
// Hide terminal panel in web UI mode
|
|
340
|
+
const panel = document.getElementById('terminal-panel');
|
|
341
|
+
if (panel) panel.style.display = 'none';
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
initTerminalIPC();
|
|
346
|
+
initTerminalResize();
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
// Auto-init when DOM is ready
|
|
350
|
+
if (document.readyState === 'loading') {
|
|
351
|
+
document.addEventListener('DOMContentLoaded', initTerminal);
|
|
352
|
+
} else {
|
|
353
|
+
initTerminal();
|
|
354
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
// ═══════════════════════════════════════════════════════════════
|
|
2
|
+
// Session Activity timeline (R3)
|
|
3
|
+
//
|
|
4
|
+
// Sidebar panel that lists every running session with a vertical event
|
|
5
|
+
// timeline. Helps disambiguate concurrent sessions of the same agent type
|
|
6
|
+
// (e.g., two data-analyst sessions on different projects).
|
|
7
|
+
//
|
|
8
|
+
// All data is in-memory on the ChatSessionState — appended by events.js as
|
|
9
|
+
// hook events arrive. This module only renders.
|
|
10
|
+
// ═══════════════════════════════════════════════════════════════
|
|
11
|
+
|
|
12
|
+
var TIMELINE_KIND_GLYPH = {
|
|
13
|
+
start: '▶',
|
|
14
|
+
tool: '⚙',
|
|
15
|
+
file: '✎',
|
|
16
|
+
consult: '↘',
|
|
17
|
+
gate: '⏸',
|
|
18
|
+
error: '⚠',
|
|
19
|
+
log: '·',
|
|
20
|
+
agent: '⤵',
|
|
21
|
+
end: '■',
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
function formatTimelineTs(ts) {
|
|
25
|
+
if (!ts) return '';
|
|
26
|
+
try {
|
|
27
|
+
var d = new Date(ts);
|
|
28
|
+
var hh = String(d.getHours()).padStart(2, '0');
|
|
29
|
+
var mm = String(d.getMinutes()).padStart(2, '0');
|
|
30
|
+
return hh + ':' + mm;
|
|
31
|
+
} catch (e) {
|
|
32
|
+
return '';
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function timelineSessionHeader(session) {
|
|
37
|
+
var info = (typeof AGENTS !== 'undefined' && AGENTS[session.agent])
|
|
38
|
+
? AGENTS[session.agent]
|
|
39
|
+
: { color: '#666', label: session.agent };
|
|
40
|
+
var label = session.title || info.label;
|
|
41
|
+
if (session.projectName) label += ' · ' + session.projectName;
|
|
42
|
+
|
|
43
|
+
var statusText = '';
|
|
44
|
+
var statusClass = '';
|
|
45
|
+
if (session.needsAttention) {
|
|
46
|
+
statusText = 'attention';
|
|
47
|
+
statusClass = 'attention';
|
|
48
|
+
} else if (session.chatResponding) {
|
|
49
|
+
statusText = 'live';
|
|
50
|
+
statusClass = 'live';
|
|
51
|
+
} else if (session.lastActivityAt) {
|
|
52
|
+
statusText = (typeof formatRelativeTime === 'function')
|
|
53
|
+
? (formatRelativeTime(session.lastActivityAt) + ' idle')
|
|
54
|
+
: '';
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
'<div class="timeline-session-header" data-sid="' + esc(session.sessionId) + '">' +
|
|
59
|
+
'<span class="timeline-session-dot" style="background:' + info.color + '"></span>' +
|
|
60
|
+
'<span class="timeline-session-label">' + esc(label) + '</span>' +
|
|
61
|
+
(statusText
|
|
62
|
+
? '<span class="timeline-session-status ' + statusClass + '">' + esc(statusText) + '</span>'
|
|
63
|
+
: '') +
|
|
64
|
+
'</div>'
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function timelineEntryRow(entry) {
|
|
69
|
+
var glyph = TIMELINE_KIND_GLYPH[entry.kind] || '·';
|
|
70
|
+
var ts = formatTimelineTs(entry.ts);
|
|
71
|
+
return (
|
|
72
|
+
'<div class="timeline-entry kind-' + esc(entry.kind) + '">' +
|
|
73
|
+
'<span class="timeline-entry-time">' + esc(ts) + '</span>' +
|
|
74
|
+
'<span class="timeline-entry-glyph">' + glyph + '</span>' +
|
|
75
|
+
'<span class="timeline-entry-label">' + esc(entry.label || '') + '</span>' +
|
|
76
|
+
'</div>'
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function renderTimeline() {
|
|
81
|
+
var listEl = document.getElementById('timeline-list');
|
|
82
|
+
var emptyEl = document.getElementById('timeline-empty');
|
|
83
|
+
var countEl = document.getElementById('timeline-session-count');
|
|
84
|
+
if (!listEl) return;
|
|
85
|
+
|
|
86
|
+
// Only render when this view is the active sidebar — saves a lot of work
|
|
87
|
+
// since events.js calls renderTimeline on every signal-bearing event.
|
|
88
|
+
if (activeSidebarView !== 'timeline') return;
|
|
89
|
+
|
|
90
|
+
var sids = (typeof sessionOrder !== 'undefined') ? sessionOrder : [];
|
|
91
|
+
if (!sids.length) {
|
|
92
|
+
listEl.innerHTML = '';
|
|
93
|
+
if (emptyEl) emptyEl.classList.add('visible');
|
|
94
|
+
if (countEl) countEl.textContent = '';
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
if (emptyEl) emptyEl.classList.remove('visible');
|
|
98
|
+
if (countEl) countEl.textContent = sids.length + ' session' + (sids.length === 1 ? '' : 's');
|
|
99
|
+
|
|
100
|
+
var html = '';
|
|
101
|
+
for (var i = 0; i < sids.length; i++) {
|
|
102
|
+
var sid = sids[i];
|
|
103
|
+
var session = chatSessions[sid];
|
|
104
|
+
if (!session) continue;
|
|
105
|
+
|
|
106
|
+
var isActive = (sid === activeSessionId);
|
|
107
|
+
html += '<div class="timeline-session' + (isActive ? ' active' : '') + '">';
|
|
108
|
+
html += timelineSessionHeader(session);
|
|
109
|
+
|
|
110
|
+
var timeline = session.timeline || [];
|
|
111
|
+
if (timeline.length === 0) {
|
|
112
|
+
html += '<div class="timeline-empty-row">no activity yet</div>';
|
|
113
|
+
} else {
|
|
114
|
+
// Newest first — easier to scan when watching parallel sessions
|
|
115
|
+
var entries = timeline.slice().reverse();
|
|
116
|
+
html += '<div class="timeline-entries">';
|
|
117
|
+
for (var j = 0; j < entries.length; j++) {
|
|
118
|
+
html += timelineEntryRow(entries[j]);
|
|
119
|
+
}
|
|
120
|
+
html += '</div>';
|
|
121
|
+
}
|
|
122
|
+
html += '</div>';
|
|
123
|
+
}
|
|
124
|
+
listEl.innerHTML = html;
|
|
125
|
+
|
|
126
|
+
// Click a session header to switch active session
|
|
127
|
+
var headers = listEl.querySelectorAll('.timeline-session-header');
|
|
128
|
+
for (var h = 0; h < headers.length; h++) {
|
|
129
|
+
headers[h].addEventListener('click', (function(sidVal) {
|
|
130
|
+
return function() {
|
|
131
|
+
if (typeof switchSession === 'function' && sidVal !== activeSessionId) {
|
|
132
|
+
switchSession(sidVal);
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
})(headers[h].getAttribute('data-sid')));
|
|
136
|
+
}
|
|
137
|
+
}
|