@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,476 @@
|
|
|
1
|
+
// ═══════════════════════════════════════════════════════════════
|
|
2
|
+
// Settings panel (Cmd+,)
|
|
3
|
+
// ═══════════════════════════════════════════════════════════════
|
|
4
|
+
|
|
5
|
+
var permissionsCache = { allow: [], presets: {} };
|
|
6
|
+
|
|
7
|
+
function toggleSettings() {
|
|
8
|
+
var overlay = document.getElementById('settings-overlay');
|
|
9
|
+
var isVisible = overlay.classList.contains('visible');
|
|
10
|
+
if (isVisible) {
|
|
11
|
+
overlay.classList.remove('visible');
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
// Sync current values
|
|
15
|
+
var prefs = loadPreferences();
|
|
16
|
+
document.getElementById('settings-theme').value = prefs.theme;
|
|
17
|
+
document.getElementById('settings-font-size').value = prefs.fontSize;
|
|
18
|
+
document.getElementById('settings-editor-font-size').value = prefs.editorFontSize;
|
|
19
|
+
overlay.classList.add('visible');
|
|
20
|
+
loadPermissions();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function loadPreferences() {
|
|
24
|
+
try {
|
|
25
|
+
var saved = JSON.parse(localStorage.getItem('shards-preferences') || '{}');
|
|
26
|
+
return {
|
|
27
|
+
theme: saved.theme || (document.documentElement.getAttribute('data-theme') === 'light' ? 'light' : 'dark'),
|
|
28
|
+
fontSize: saved.fontSize || 13,
|
|
29
|
+
editorFontSize: saved.editorFontSize || 13,
|
|
30
|
+
};
|
|
31
|
+
} catch(e) {
|
|
32
|
+
return { theme: 'dark', fontSize: 13, editorFontSize: 13 };
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function savePreferences(prefs) {
|
|
37
|
+
localStorage.setItem('shards-preferences', JSON.stringify(prefs));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function applySettingsTheme(value) {
|
|
41
|
+
if (value === 'light') {
|
|
42
|
+
document.documentElement.setAttribute('data-theme', 'light');
|
|
43
|
+
localStorage.setItem('shards-theme', 'light');
|
|
44
|
+
} else {
|
|
45
|
+
document.documentElement.removeAttribute('data-theme');
|
|
46
|
+
localStorage.setItem('shards-theme', 'dark');
|
|
47
|
+
}
|
|
48
|
+
updateThemeIcon();
|
|
49
|
+
if (typeof monaco !== 'undefined') {
|
|
50
|
+
monaco.editor.setTheme(currentMonacoTheme());
|
|
51
|
+
}
|
|
52
|
+
rerenderActiveDiagramPanel();
|
|
53
|
+
var prefs = loadPreferences();
|
|
54
|
+
prefs.theme = value;
|
|
55
|
+
savePreferences(prefs);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function applySettingsFontSize(value) {
|
|
59
|
+
var size = Math.max(10, Math.min(20, parseInt(value) || 13));
|
|
60
|
+
document.documentElement.style.setProperty('--ui-font-size', size + 'px');
|
|
61
|
+
document.body.style.fontSize = size + 'px';
|
|
62
|
+
var prefs = loadPreferences();
|
|
63
|
+
prefs.fontSize = size;
|
|
64
|
+
savePreferences(prefs);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function applySettingsEditorFontSize(value) {
|
|
68
|
+
var size = Math.max(10, Math.min(24, parseInt(value) || 13));
|
|
69
|
+
document.documentElement.style.setProperty('--editor-font-size', size + 'px');
|
|
70
|
+
var prefs = loadPreferences();
|
|
71
|
+
prefs.editorFontSize = size;
|
|
72
|
+
savePreferences(prefs);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function resetLayout() {
|
|
76
|
+
localStorage.removeItem('shards-layout');
|
|
77
|
+
localStorage.removeItem('shards-preferences');
|
|
78
|
+
document.documentElement.style.removeProperty('--ui-font-size');
|
|
79
|
+
document.documentElement.style.removeProperty('--editor-font-size');
|
|
80
|
+
document.body.style.fontSize = '';
|
|
81
|
+
document.getElementById('settings-overlay').classList.remove('visible');
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// ═══════════════════════════════════════════════════════════════
|
|
85
|
+
// Chat search (Cmd+F in chat)
|
|
86
|
+
// ═══════════════════════════════════════════════════════════════
|
|
87
|
+
|
|
88
|
+
var chatSearchMatches = [];
|
|
89
|
+
var chatSearchIdx = -1;
|
|
90
|
+
|
|
91
|
+
function toggleChatSearch() {
|
|
92
|
+
var bar = document.getElementById('chat-search-bar');
|
|
93
|
+
var isVisible = bar.classList.contains('visible');
|
|
94
|
+
if (isVisible) {
|
|
95
|
+
bar.classList.remove('visible');
|
|
96
|
+
clearChatSearchHighlights();
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
bar.classList.add('visible');
|
|
100
|
+
var input = document.getElementById('chat-search-input');
|
|
101
|
+
input.value = '';
|
|
102
|
+
input.focus();
|
|
103
|
+
chatSearchMatches = [];
|
|
104
|
+
chatSearchIdx = -1;
|
|
105
|
+
document.getElementById('chat-search-count').textContent = '';
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function clearChatSearchHighlights() {
|
|
109
|
+
var msgs = document.querySelectorAll('.message.search-highlight');
|
|
110
|
+
for (var i = 0; i < msgs.length; i++) {
|
|
111
|
+
msgs[i].classList.remove('search-highlight');
|
|
112
|
+
}
|
|
113
|
+
chatSearchMatches = [];
|
|
114
|
+
chatSearchIdx = -1;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function executeChatSearch(query) {
|
|
118
|
+
clearChatSearchHighlights();
|
|
119
|
+
if (!query) {
|
|
120
|
+
document.getElementById('chat-search-count').textContent = '';
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
var q = query.toLowerCase();
|
|
124
|
+
var messages = document.querySelectorAll('#messages .message');
|
|
125
|
+
chatSearchMatches = [];
|
|
126
|
+
for (var i = 0; i < messages.length; i++) {
|
|
127
|
+
var bubble = messages[i].querySelector('.message-bubble');
|
|
128
|
+
if (bubble && bubble.textContent.toLowerCase().indexOf(q) !== -1) {
|
|
129
|
+
chatSearchMatches.push(messages[i]);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
if (chatSearchMatches.length > 0) {
|
|
133
|
+
chatSearchIdx = 0;
|
|
134
|
+
chatSearchMatches[0].classList.add('search-highlight');
|
|
135
|
+
chatSearchMatches[0].scrollIntoView({ block: 'center' });
|
|
136
|
+
}
|
|
137
|
+
document.getElementById('chat-search-count').textContent =
|
|
138
|
+
chatSearchMatches.length > 0 ? (chatSearchIdx + 1) + ' of ' + chatSearchMatches.length : 'No results';
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function chatSearchNav(dir) {
|
|
142
|
+
if (chatSearchMatches.length === 0) return;
|
|
143
|
+
chatSearchMatches[chatSearchIdx].classList.remove('search-highlight');
|
|
144
|
+
chatSearchIdx = (chatSearchIdx + dir + chatSearchMatches.length) % chatSearchMatches.length;
|
|
145
|
+
chatSearchMatches[chatSearchIdx].classList.add('search-highlight');
|
|
146
|
+
chatSearchMatches[chatSearchIdx].scrollIntoView({ block: 'center' });
|
|
147
|
+
document.getElementById('chat-search-count').textContent = (chatSearchIdx + 1) + ' of ' + chatSearchMatches.length;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
document.getElementById('chat-search-input').addEventListener('input', function() {
|
|
151
|
+
executeChatSearch(this.value);
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
document.getElementById('chat-search-input').addEventListener('keydown', function(e) {
|
|
155
|
+
if (e.key === 'Enter') {
|
|
156
|
+
e.preventDefault();
|
|
157
|
+
chatSearchNav(e.shiftKey ? -1 : 1);
|
|
158
|
+
} else if (e.key === 'Escape') {
|
|
159
|
+
toggleChatSearch();
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
// ═══════════════════════════════════════════════════════════════
|
|
164
|
+
// Layout persistence
|
|
165
|
+
// ═══════════════════════════════════════════════════════════════
|
|
166
|
+
|
|
167
|
+
var layoutSaveTimeout = null;
|
|
168
|
+
|
|
169
|
+
function saveLayout() {
|
|
170
|
+
if (layoutSaveTimeout) clearTimeout(layoutSaveTimeout);
|
|
171
|
+
layoutSaveTimeout = setTimeout(function() {
|
|
172
|
+
var sidebar = document.getElementById('explorer-sidebar');
|
|
173
|
+
var layout = {
|
|
174
|
+
openTabs: fileTabOrder.slice(),
|
|
175
|
+
activeTab: activeTabId,
|
|
176
|
+
splitMode: splitMode,
|
|
177
|
+
currentFileInPane: currentFileInPane,
|
|
178
|
+
explorerCollapsed: sidebar.classList.contains('collapsed'),
|
|
179
|
+
explorerWidth: sidebar.style.width || null,
|
|
180
|
+
activeSidebarView: activeSidebarView,
|
|
181
|
+
};
|
|
182
|
+
localStorage.setItem('shards-layout', JSON.stringify(layout));
|
|
183
|
+
}, 100);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function restoreLayout() {
|
|
187
|
+
try {
|
|
188
|
+
var raw = localStorage.getItem('shards-layout');
|
|
189
|
+
if (!raw) return;
|
|
190
|
+
var layout = JSON.parse(raw);
|
|
191
|
+
|
|
192
|
+
// Restore explorer state
|
|
193
|
+
var sidebar = document.getElementById('explorer-sidebar');
|
|
194
|
+
if (layout.explorerCollapsed) sidebar.classList.add('collapsed');
|
|
195
|
+
if (layout.explorerWidth) sidebar.style.width = layout.explorerWidth;
|
|
196
|
+
|
|
197
|
+
// Restore active sidebar view
|
|
198
|
+
if (layout.activeSidebarView && typeof switchSidebarView === 'function') {
|
|
199
|
+
switchSidebarView(layout.activeSidebarView);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// Split mode is not restored — user toggles manually (Cmd+\)
|
|
203
|
+
|
|
204
|
+
// Re-open tabs (fetch content from server)
|
|
205
|
+
if (layout.openTabs && layout.openTabs.length > 0) {
|
|
206
|
+
for (var i = 0; i < layout.openTabs.length; i++) {
|
|
207
|
+
openFileFromExplorer(layout.openTabs[i]);
|
|
208
|
+
}
|
|
209
|
+
// After files load, restore active tab
|
|
210
|
+
setTimeout(function() {
|
|
211
|
+
if (layout.activeTab && layout.activeTab !== 'chat') {
|
|
212
|
+
if (openFiles[layout.activeTab]) switchTab(layout.activeTab);
|
|
213
|
+
}
|
|
214
|
+
if (layout.splitMode && layout.currentFileInPane && openFiles[layout.currentFileInPane]) {
|
|
215
|
+
currentFileInPane = layout.currentFileInPane;
|
|
216
|
+
renderWsTabs();
|
|
217
|
+
showActiveContent();
|
|
218
|
+
}
|
|
219
|
+
}, 300);
|
|
220
|
+
}
|
|
221
|
+
} catch(e) {
|
|
222
|
+
// Ignore errors restoring layout
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
// ═══════════════════════════════════════════════════════════════
|
|
227
|
+
// Session files view (activity bar panel)
|
|
228
|
+
// ═══════════════════════════════════════════════════════════════
|
|
229
|
+
|
|
230
|
+
function renderSessionFiles() {
|
|
231
|
+
var list = document.getElementById('session-files-list');
|
|
232
|
+
var countEl = document.getElementById('session-file-count');
|
|
233
|
+
if (!list) return;
|
|
234
|
+
|
|
235
|
+
list.innerHTML = '';
|
|
236
|
+
|
|
237
|
+
// Convert to array and show most recent first (reverse order of Set iteration)
|
|
238
|
+
var files = [];
|
|
239
|
+
sessionTouchedFiles.forEach(function(f) { files.push(f); });
|
|
240
|
+
files.reverse();
|
|
241
|
+
|
|
242
|
+
// Update count display
|
|
243
|
+
if (countEl) {
|
|
244
|
+
countEl.textContent = files.length > 0 ? files.length + ' file' + (files.length !== 1 ? 's' : '') : '';
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
// Update badge on activity bar button
|
|
248
|
+
updateSessionBadge(files.length);
|
|
249
|
+
|
|
250
|
+
for (var i = 0; i < files.length; i++) {
|
|
251
|
+
var entry = document.createElement('div');
|
|
252
|
+
entry.className = 'session-file-entry';
|
|
253
|
+
var name = files[i].split('/').pop();
|
|
254
|
+
entry.innerHTML = '<span class="dir-icon">📄</span><span>' + esc(name) + '</span>';
|
|
255
|
+
entry.title = files[i];
|
|
256
|
+
entry.addEventListener('click', (function(fp) {
|
|
257
|
+
return function() { openFileFromExplorer(fp); };
|
|
258
|
+
})(files[i]));
|
|
259
|
+
if (typeof makeExplorerEntryDraggable === 'function') makeExplorerEntryDraggable(entry, files[i]);
|
|
260
|
+
list.appendChild(entry);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
function updateSessionBadge(count) {
|
|
265
|
+
var btn = document.getElementById('activity-session');
|
|
266
|
+
if (!btn) return;
|
|
267
|
+
var existing = btn.querySelector('.badge');
|
|
268
|
+
if (count > 0) {
|
|
269
|
+
if (!existing) {
|
|
270
|
+
existing = document.createElement('span');
|
|
271
|
+
existing.className = 'badge';
|
|
272
|
+
btn.appendChild(existing);
|
|
273
|
+
}
|
|
274
|
+
existing.textContent = count;
|
|
275
|
+
} else if (existing) {
|
|
276
|
+
existing.remove();
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
// ═══════════════════════════════════════════════════════════════
|
|
281
|
+
// Explorer file search
|
|
282
|
+
// ═══════════════════════════════════════════════════════════════
|
|
283
|
+
|
|
284
|
+
var explorerSearchTimeout = null;
|
|
285
|
+
|
|
286
|
+
(function initExplorerSearch() {
|
|
287
|
+
var input = document.getElementById('explorer-search-input');
|
|
288
|
+
if (!input) return;
|
|
289
|
+
// Show search input when explorer is not collapsed
|
|
290
|
+
var wrap = document.getElementById('explorer-search-wrap');
|
|
291
|
+
if (wrap) wrap.classList.add('visible');
|
|
292
|
+
|
|
293
|
+
input.addEventListener('input', function() {
|
|
294
|
+
var q = this.value.trim();
|
|
295
|
+
if (explorerSearchTimeout) clearTimeout(explorerSearchTimeout);
|
|
296
|
+
if (!q) {
|
|
297
|
+
// Restore normal view
|
|
298
|
+
if (explorerViewMode === 'tree') renderTree();
|
|
299
|
+
else if (currentBrowseDir) browseDir(currentBrowseDir);
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
302
|
+
explorerSearchTimeout = setTimeout(function() {
|
|
303
|
+
searchExplorerFiles(q);
|
|
304
|
+
}, 300);
|
|
305
|
+
});
|
|
306
|
+
})();
|
|
307
|
+
|
|
308
|
+
async function searchExplorerFiles(query) {
|
|
309
|
+
try {
|
|
310
|
+
var res = await authFetch('/browse/search?q=' + encodeURIComponent(query));
|
|
311
|
+
var data = await res.json();
|
|
312
|
+
if (data.error) return;
|
|
313
|
+
renderExplorerSearchResults(data.results || []);
|
|
314
|
+
} catch(e) {
|
|
315
|
+
// Fallback: client-side filter of known files
|
|
316
|
+
var results = [];
|
|
317
|
+
var q = query.toLowerCase();
|
|
318
|
+
sessionTouchedFiles.forEach(function(f) {
|
|
319
|
+
if (f.toLowerCase().indexOf(q) !== -1) results.push(f);
|
|
320
|
+
});
|
|
321
|
+
fileTabOrder.forEach(function(f) {
|
|
322
|
+
if (f.toLowerCase().indexOf(q) !== -1 && results.indexOf(f) === -1) results.push(f);
|
|
323
|
+
});
|
|
324
|
+
renderExplorerSearchResults(results);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
function renderExplorerSearchResults(results) {
|
|
329
|
+
var el = document.getElementById('explorer-listing');
|
|
330
|
+
el.innerHTML = '';
|
|
331
|
+
if (results.length === 0) {
|
|
332
|
+
el.innerHTML = '<div style="padding:8px 12px;color:#3a3a54;font-size:10px">No files found</div>';
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
for (var i = 0; i < Math.min(results.length, 50); i++) {
|
|
336
|
+
var filePath = results[i];
|
|
337
|
+
var row = document.createElement('div');
|
|
338
|
+
row.className = 'tree-entry is-file';
|
|
339
|
+
row.style.paddingLeft = '10px';
|
|
340
|
+
var name = filePath.split('/').pop();
|
|
341
|
+
var dir = filePath.split('/').slice(0, -1).join('/');
|
|
342
|
+
row.innerHTML =
|
|
343
|
+
'<span class="dir-icon file-icon">📄</span>' +
|
|
344
|
+
'<span class="dir-name">' + esc(name) + '</span>' +
|
|
345
|
+
'<span class="dir-size" style="font-size:9px;opacity:0.6">' + esc(dir) + '</span>';
|
|
346
|
+
row.addEventListener('click', (function(fp) {
|
|
347
|
+
return function() { openFileFromExplorer(fp); };
|
|
348
|
+
})(filePath));
|
|
349
|
+
el.appendChild(row);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
// ═══════════════════════════════════════════════════════════════
|
|
354
|
+
// Permissions management
|
|
355
|
+
// ═══════════════════════════════════════════════════════════════
|
|
356
|
+
|
|
357
|
+
function loadPermissions() {
|
|
358
|
+
authFetch('/permissions')
|
|
359
|
+
.then(function(r) { return r.json(); })
|
|
360
|
+
.then(function(data) {
|
|
361
|
+
permissionsCache.allow = data.allow || [];
|
|
362
|
+
permissionsCache.presets = data.presets || {};
|
|
363
|
+
renderPermissionsList();
|
|
364
|
+
})
|
|
365
|
+
.catch(function() {
|
|
366
|
+
var list = document.getElementById('permissions-list');
|
|
367
|
+
if (list) list.innerHTML = '<span class="perm-empty">Could not load permissions</span>';
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
function renderPermissionsList() {
|
|
372
|
+
var list = document.getElementById('permissions-list');
|
|
373
|
+
if (!list) return;
|
|
374
|
+
list.innerHTML = '';
|
|
375
|
+
|
|
376
|
+
// Filter out internal shards permissions from display
|
|
377
|
+
var display = permissionsCache.allow.filter(function(p) {
|
|
378
|
+
return p.indexOf('ui-push.js') === -1 && p.indexOf('relay.js') === -1;
|
|
379
|
+
});
|
|
380
|
+
|
|
381
|
+
if (display.length === 0) {
|
|
382
|
+
list.innerHTML = '<span class="perm-empty">No permissions configured. Use a preset or add custom rules.</span>';
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
for (var i = 0; i < display.length; i++) {
|
|
387
|
+
var item = document.createElement('div');
|
|
388
|
+
item.className = 'perm-item';
|
|
389
|
+
item.innerHTML = '<code>' + esc(display[i]) + '</code><span class="perm-remove" title="Remove">×</span>';
|
|
390
|
+
item.querySelector('.perm-remove').addEventListener('click', (function(perm) {
|
|
391
|
+
return function() { removePermission(perm); };
|
|
392
|
+
})(display[i]));
|
|
393
|
+
list.appendChild(item);
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
function removePermission(pattern) {
|
|
398
|
+
authFetch('/permissions', {
|
|
399
|
+
method: 'POST',
|
|
400
|
+
headers: { 'Content-Type': 'application/json' },
|
|
401
|
+
body: JSON.stringify({ remove: [pattern] }),
|
|
402
|
+
})
|
|
403
|
+
.then(function(r) { return r.json(); })
|
|
404
|
+
.then(function(data) {
|
|
405
|
+
if (data.allow) permissionsCache.allow = data.allow;
|
|
406
|
+
renderPermissionsList();
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
function addCustomPermission() {
|
|
411
|
+
var input = document.getElementById('permissions-custom-input');
|
|
412
|
+
var raw = (input.value || '').trim();
|
|
413
|
+
if (!raw) return;
|
|
414
|
+
|
|
415
|
+
// Parse comma-separated patterns; wrap bare commands in Bash(cmd:*)
|
|
416
|
+
var patterns = raw.split(',').map(function(p) {
|
|
417
|
+
p = p.trim();
|
|
418
|
+
if (!p) return null;
|
|
419
|
+
return p.indexOf('(') !== -1 ? p : 'Bash(' + p + ':*)';
|
|
420
|
+
}).filter(Boolean);
|
|
421
|
+
|
|
422
|
+
if (patterns.length === 0) return;
|
|
423
|
+
|
|
424
|
+
authFetch('/permissions', {
|
|
425
|
+
method: 'POST',
|
|
426
|
+
headers: { 'Content-Type': 'application/json' },
|
|
427
|
+
body: JSON.stringify({ add: patterns }),
|
|
428
|
+
})
|
|
429
|
+
.then(function(r) { return r.json(); })
|
|
430
|
+
.then(function(data) {
|
|
431
|
+
if (data.allow) permissionsCache.allow = data.allow;
|
|
432
|
+
renderPermissionsList();
|
|
433
|
+
input.value = '';
|
|
434
|
+
});
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
function applyPermissionPreset(presetName) {
|
|
438
|
+
var preset = permissionsCache.presets[presetName];
|
|
439
|
+
if (!preset) return;
|
|
440
|
+
|
|
441
|
+
// Merge preset into existing — don't remove existing custom rules
|
|
442
|
+
authFetch('/permissions', {
|
|
443
|
+
method: 'POST',
|
|
444
|
+
headers: { 'Content-Type': 'application/json' },
|
|
445
|
+
body: JSON.stringify({ add: preset }),
|
|
446
|
+
})
|
|
447
|
+
.then(function(r) { return r.json(); })
|
|
448
|
+
.then(function(data) {
|
|
449
|
+
if (data.allow) permissionsCache.allow = data.allow;
|
|
450
|
+
renderPermissionsList();
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
// Allow Enter key in custom permission input
|
|
455
|
+
(function() {
|
|
456
|
+
var input = document.getElementById('permissions-custom-input');
|
|
457
|
+
if (input) {
|
|
458
|
+
input.addEventListener('keydown', function(e) {
|
|
459
|
+
if (e.key === 'Enter') {
|
|
460
|
+
e.preventDefault();
|
|
461
|
+
addCustomPermission();
|
|
462
|
+
}
|
|
463
|
+
});
|
|
464
|
+
}
|
|
465
|
+
})();
|
|
466
|
+
|
|
467
|
+
// Apply saved preferences on load
|
|
468
|
+
(function initPreferences() {
|
|
469
|
+
var prefs = loadPreferences();
|
|
470
|
+
if (prefs.fontSize && prefs.fontSize !== 13) {
|
|
471
|
+
applySettingsFontSize(prefs.fontSize);
|
|
472
|
+
}
|
|
473
|
+
if (prefs.editorFontSize && prefs.editorFontSize !== 13) {
|
|
474
|
+
applySettingsEditorFontSize(prefs.editorFontSize);
|
|
475
|
+
}
|
|
476
|
+
})();
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// ═══════════════════════════════════════════════════════════════
|
|
2
|
+
// Split view
|
|
3
|
+
// ═══════════════════════════════════════════════════════════════
|
|
4
|
+
|
|
5
|
+
function toggleSplit() {
|
|
6
|
+
splitMode = !splitMode;
|
|
7
|
+
var chatPane = document.getElementById('chat-pane');
|
|
8
|
+
|
|
9
|
+
if (splitMode) {
|
|
10
|
+
// Enter split mode
|
|
11
|
+
activeTabId = 'chat'; // chat always active in split
|
|
12
|
+
if (!currentFileInPane && fileTabOrder.length > 0) {
|
|
13
|
+
currentFileInPane = fileTabOrder[0];
|
|
14
|
+
}
|
|
15
|
+
chatPane.classList.add('split-visible');
|
|
16
|
+
chatPane.style.flex = '1';
|
|
17
|
+
document.getElementById('file-pane').style.flex = '1';
|
|
18
|
+
} else {
|
|
19
|
+
// Exit split mode — also uncollapse
|
|
20
|
+
chatPane.classList.remove('split-visible', 'collapsed');
|
|
21
|
+
chatPane.style.flex = '';
|
|
22
|
+
chatPane.style.width = '';
|
|
23
|
+
document.getElementById('file-pane').style.flex = '';
|
|
24
|
+
if (currentFileInPane && openFiles[currentFileInPane]) {
|
|
25
|
+
activeTabId = currentFileInPane;
|
|
26
|
+
} else {
|
|
27
|
+
activeTabId = 'chat';
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
renderWsTabs();
|
|
32
|
+
showActiveContent();
|
|
33
|
+
if (typeof saveLayout === 'function') saveLayout();
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function toggleChatCollapse() {
|
|
37
|
+
var chatPane = document.getElementById('chat-pane');
|
|
38
|
+
if (!splitMode) return; // only works in split mode
|
|
39
|
+
|
|
40
|
+
chatPane.classList.toggle('collapsed');
|
|
41
|
+
|
|
42
|
+
// When expanding, restore flex layout
|
|
43
|
+
if (!chatPane.classList.contains('collapsed')) {
|
|
44
|
+
chatPane.style.width = '';
|
|
45
|
+
chatPane.style.flex = '1';
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function initSplitResize() {
|
|
50
|
+
var handle = document.getElementById('split-resize');
|
|
51
|
+
var chatPane = document.getElementById('chat-pane');
|
|
52
|
+
var filePane = document.getElementById('file-pane');
|
|
53
|
+
var startX, chatStartW, fileStartW;
|
|
54
|
+
|
|
55
|
+
handle.addEventListener('mousedown', function(e) {
|
|
56
|
+
e.preventDefault();
|
|
57
|
+
startX = e.clientX;
|
|
58
|
+
chatStartW = chatPane.offsetWidth;
|
|
59
|
+
fileStartW = filePane.offsetWidth;
|
|
60
|
+
handle.classList.add('dragging');
|
|
61
|
+
document.addEventListener('mousemove', onMove);
|
|
62
|
+
document.addEventListener('mouseup', onUp);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
function onMove(e) {
|
|
66
|
+
var delta = e.clientX - startX;
|
|
67
|
+
var totalW = chatStartW + fileStartW;
|
|
68
|
+
var newChatW = Math.max(200, Math.min(totalW - 200, chatStartW + delta));
|
|
69
|
+
var newFileW = totalW - newChatW;
|
|
70
|
+
chatPane.style.flex = 'none';
|
|
71
|
+
filePane.style.flex = 'none';
|
|
72
|
+
chatPane.style.width = newChatW + 'px';
|
|
73
|
+
filePane.style.width = newFileW + 'px';
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function onUp() {
|
|
77
|
+
handle.classList.remove('dragging');
|
|
78
|
+
document.removeEventListener('mousemove', onMove);
|
|
79
|
+
document.removeEventListener('mouseup', onUp);
|
|
80
|
+
if (typeof saveLayout === 'function') saveLayout();
|
|
81
|
+
}
|
|
82
|
+
}
|