@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,284 @@
|
|
|
1
|
+
// ═══════════════════════════════════════════════════════════════
|
|
2
|
+
// Workspace tabs & file state
|
|
3
|
+
// ═══════════════════════════════════════════════════════════════
|
|
4
|
+
|
|
5
|
+
function openFileTab(relPath, content, absPath, opts) {
|
|
6
|
+
opts = opts || {};
|
|
7
|
+
if (relPath in openFiles) {
|
|
8
|
+
// Update content if not modified by user
|
|
9
|
+
var f = openFiles[relPath];
|
|
10
|
+
if (!f.modified) {
|
|
11
|
+
f.content = content;
|
|
12
|
+
f.originalContent = content;
|
|
13
|
+
}
|
|
14
|
+
if (opts.media) f.media = true;
|
|
15
|
+
} else {
|
|
16
|
+
var ext = relPath.split('.').pop().toLowerCase();
|
|
17
|
+
var isMarkdown = ext === 'md';
|
|
18
|
+
openFiles[relPath] = {
|
|
19
|
+
content: content,
|
|
20
|
+
absPath: absPath || relPath,
|
|
21
|
+
originalContent: content,
|
|
22
|
+
modified: false,
|
|
23
|
+
editMode: !isMarkdown,
|
|
24
|
+
tabularData: null,
|
|
25
|
+
tabulatorInstance: null,
|
|
26
|
+
media: opts.media || false,
|
|
27
|
+
};
|
|
28
|
+
fileTabOrder.push(relPath);
|
|
29
|
+
sortFileTabs();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (splitMode) {
|
|
33
|
+
// In split mode, file tabs show in file pane — switch to this file
|
|
34
|
+
renderWsTabs();
|
|
35
|
+
showFileInPane(relPath);
|
|
36
|
+
} else {
|
|
37
|
+
// In single mode, switch to this tab
|
|
38
|
+
activeTabId = relPath;
|
|
39
|
+
renderWsTabs();
|
|
40
|
+
showActiveContent();
|
|
41
|
+
}
|
|
42
|
+
if (typeof saveLayout === 'function') saveLayout();
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function closeFileTab(relPath) {
|
|
46
|
+
// Save check
|
|
47
|
+
var f = openFiles[relPath];
|
|
48
|
+
if (f && f.modified) {
|
|
49
|
+
if (!confirm('"' + relPath.split('/').pop() + '" has unsaved changes. Close anyway?')) return;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Destroy Tabulator if this file had one
|
|
53
|
+
if (f && f.tabulatorInstance) {
|
|
54
|
+
var currentKey = getCurrentFileKey();
|
|
55
|
+
if (relPath === currentKey) destroyTabulator();
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Dispose git diff editor if this is a diff tab
|
|
59
|
+
if (f && f.gitDiff && typeof disposeGitDiffEditor === 'function') {
|
|
60
|
+
var currentKey0 = getCurrentFileKey();
|
|
61
|
+
if (relPath === currentKey0) hideGitDiffContainer();
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Dispose Monaco instances
|
|
65
|
+
var currentKey2 = getCurrentFileKey();
|
|
66
|
+
if (relPath === currentKey2) {
|
|
67
|
+
disposeMonacoInstance();
|
|
68
|
+
disposeNotebookCellMonaco();
|
|
69
|
+
}
|
|
70
|
+
if (f && f.notebookData) {
|
|
71
|
+
f.notebookData.cells.forEach(function(cell) {
|
|
72
|
+
if (cell.monacoInstance) {
|
|
73
|
+
cell.monacoInstance.dispose();
|
|
74
|
+
cell.monacoInstance = null;
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
delete openFiles[relPath];
|
|
80
|
+
var ftIdx = fileTabOrder.indexOf(relPath);
|
|
81
|
+
if (ftIdx !== -1) fileTabOrder.splice(ftIdx, 1);
|
|
82
|
+
|
|
83
|
+
if (activeTabId === relPath) {
|
|
84
|
+
activeTabId = fileTabOrder.length > 0 ? fileTabOrder[0] : 'chat';
|
|
85
|
+
}
|
|
86
|
+
renderWsTabs();
|
|
87
|
+
showActiveContent();
|
|
88
|
+
if (typeof saveLayout === 'function') saveLayout();
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function closeAllTabs() {
|
|
92
|
+
// Close all file tabs
|
|
93
|
+
var filesToClose = fileTabOrder.slice();
|
|
94
|
+
for (var i = 0; i < filesToClose.length; i++) {
|
|
95
|
+
closeFileTab(filesToClose[i]);
|
|
96
|
+
}
|
|
97
|
+
// Close all panel tabs
|
|
98
|
+
var panelsToClose = panelTabOrder.slice();
|
|
99
|
+
for (var j = 0; j < panelsToClose.length; j++) {
|
|
100
|
+
closePanelTab(panelsToClose[j]);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function sortFileTabs() {
|
|
105
|
+
fileTabOrder.sort(function(a, b) {
|
|
106
|
+
var aS = a.endsWith('project-specs.md') ? 0 : 1;
|
|
107
|
+
var bS = b.endsWith('project-specs.md') ? 0 : 1;
|
|
108
|
+
if (aS !== bS) return aS - bS;
|
|
109
|
+
return a.localeCompare(b);
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function switchTab(id) {
|
|
114
|
+
if (splitMode && id !== 'chat') {
|
|
115
|
+
// Both file tabs and panel tabs show in the file pane in split mode
|
|
116
|
+
if (openPanels[id]) {
|
|
117
|
+
currentFileInPane = id;
|
|
118
|
+
renderWsTabs();
|
|
119
|
+
renderPanelPane(id);
|
|
120
|
+
} else {
|
|
121
|
+
showFileInPane(id);
|
|
122
|
+
renderWsTabs();
|
|
123
|
+
}
|
|
124
|
+
if (typeof saveLayout === 'function') saveLayout();
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
activeTabId = id;
|
|
128
|
+
renderWsTabs();
|
|
129
|
+
showActiveContent();
|
|
130
|
+
if (typeof saveLayout === 'function') saveLayout();
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function renderWsTabs() {
|
|
134
|
+
var bar = document.getElementById('ws-tab-bar');
|
|
135
|
+
// Remove existing tabs (keep actions)
|
|
136
|
+
var actions = document.getElementById('ws-tab-actions');
|
|
137
|
+
bar.innerHTML = '';
|
|
138
|
+
|
|
139
|
+
// Chat tab (pinned)
|
|
140
|
+
var chatTab = document.createElement('div');
|
|
141
|
+
chatTab.className = 'ws-tab pinned' + (activeTabId === 'chat' && !splitMode ? ' active' : '') + (splitMode ? ' in-split' : '');
|
|
142
|
+
chatTab.textContent = 'Chat';
|
|
143
|
+
chatTab.addEventListener('click', function() { switchTab('chat'); });
|
|
144
|
+
bar.appendChild(chatTab);
|
|
145
|
+
|
|
146
|
+
// File tabs
|
|
147
|
+
for (var i = 0; i < fileTabOrder.length; i++) {
|
|
148
|
+
var p = fileTabOrder[i];
|
|
149
|
+
var f = openFiles[p];
|
|
150
|
+
if (!f) continue;
|
|
151
|
+
var tab = document.createElement('div');
|
|
152
|
+
var isActive = splitMode ? (p === currentFileInPane) : (p === activeTabId);
|
|
153
|
+
tab.className = 'ws-tab' + (isActive ? ' active' : '') + (f.modified ? ' modified' : '');
|
|
154
|
+
tab.dataset.path = p;
|
|
155
|
+
|
|
156
|
+
var name = p.split('/').pop();
|
|
157
|
+
// Check if this is a git diff tab
|
|
158
|
+
var isDiffTab = p.indexOf('diff:') === 0;
|
|
159
|
+
var displayName = isDiffTab ? p.substring(5).split('/').pop() : name;
|
|
160
|
+
// Git diff badge
|
|
161
|
+
var gitBadge = '';
|
|
162
|
+
if (typeof getGitStatusForFile === 'function') {
|
|
163
|
+
var gitPath = isDiffTab ? p.substring(5) : p;
|
|
164
|
+
var gs = getGitStatusForFile(gitPath);
|
|
165
|
+
if (gs) {
|
|
166
|
+
var gl = gs.status === 'modified' ? 'M' : gs.status === 'added' ? 'A' : gs.status === 'deleted' ? 'D' : gs.status === 'untracked' ? 'U' : gs.status === 'renamed' ? 'R' : '';
|
|
167
|
+
if (gl) gitBadge = '<span class="git-diff-badge ' + gs.status + '">' + gl + '</span>';
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
tab.innerHTML =
|
|
171
|
+
'<span class="tab-dot"></span>' +
|
|
172
|
+
'<span class="modified-dot"></span>' +
|
|
173
|
+
esc(displayName) + gitBadge +
|
|
174
|
+
' <span class="close-btn" title="Close">x</span>';
|
|
175
|
+
|
|
176
|
+
tab.addEventListener('click', (function(path) {
|
|
177
|
+
return function(e) {
|
|
178
|
+
if (e.target.classList.contains('close-btn')) { closeFileTab(path); return; }
|
|
179
|
+
switchTab(path);
|
|
180
|
+
};
|
|
181
|
+
})(p));
|
|
182
|
+
tab.addEventListener('contextmenu', (function(path) {
|
|
183
|
+
return function(e) { showCtxMenu(e, path); };
|
|
184
|
+
})(p));
|
|
185
|
+
bar.appendChild(tab);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// Panel tabs
|
|
189
|
+
var PANEL_ICONS = { 'data-viewer': '⊞', 'dag': '⬡', 'diagram': '◈', 'chart': '▦', 'diff': '⊟', 'model-card': '▣', 'eval-dashboard': '◉', 'knowledge-map': '◇', 'pr-review': '⊙' };
|
|
190
|
+
for (var pi = 0; pi < panelTabOrder.length; pi++) {
|
|
191
|
+
var pid = panelTabOrder[pi];
|
|
192
|
+
var panel = openPanels[pid];
|
|
193
|
+
if (!panel) continue;
|
|
194
|
+
var ptab = document.createElement('div');
|
|
195
|
+
var isPanelActive = splitMode ? (pid === currentFileInPane) : (pid === activeTabId);
|
|
196
|
+
ptab.className = 'ws-tab panel-tab' + (isPanelActive ? ' active' : '');
|
|
197
|
+
ptab.dataset.panelId = pid;
|
|
198
|
+
|
|
199
|
+
var icon = PANEL_ICONS[panel.panel] || '▪';
|
|
200
|
+
ptab.innerHTML =
|
|
201
|
+
'<span class="panel-tab-icon">' + icon + '</span>' +
|
|
202
|
+
esc(panel.title) +
|
|
203
|
+
' <span class="close-btn" title="Close panel">x</span>';
|
|
204
|
+
|
|
205
|
+
ptab.addEventListener('click', (function(panelId) {
|
|
206
|
+
return function(e) {
|
|
207
|
+
if (e.target.classList.contains('close-btn')) { closePanelTab(panelId); return; }
|
|
208
|
+
switchTab(panelId);
|
|
209
|
+
};
|
|
210
|
+
})(pid));
|
|
211
|
+
bar.appendChild(ptab);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
bar.appendChild(actions);
|
|
215
|
+
|
|
216
|
+
// Split button state
|
|
217
|
+
document.getElementById('split-btn').className = splitMode ? 'active' : '';
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
function showActiveContent() {
|
|
221
|
+
var chatPane = document.getElementById('chat-pane');
|
|
222
|
+
var filePane = document.getElementById('file-pane');
|
|
223
|
+
var splitResize = document.getElementById('split-resize');
|
|
224
|
+
|
|
225
|
+
if (splitMode) {
|
|
226
|
+
chatPane.style.display = 'flex';
|
|
227
|
+
splitResize.style.display = 'block';
|
|
228
|
+
filePane.classList.add('visible');
|
|
229
|
+
if (currentFileInPane && openPanels[currentFileInPane]) {
|
|
230
|
+
renderPanelPane(currentFileInPane);
|
|
231
|
+
} else if (currentFileInPane && openFiles[currentFileInPane]) {
|
|
232
|
+
renderFilePane(currentFileInPane);
|
|
233
|
+
} else if (fileTabOrder.length > 0) {
|
|
234
|
+
showFileInPane(fileTabOrder[0]);
|
|
235
|
+
} else if (panelTabOrder.length > 0) {
|
|
236
|
+
currentFileInPane = panelTabOrder[0];
|
|
237
|
+
renderPanelPane(panelTabOrder[0]);
|
|
238
|
+
} else {
|
|
239
|
+
renderEmptyFilePane();
|
|
240
|
+
}
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
// Single mode
|
|
245
|
+
splitResize.style.display = 'none';
|
|
246
|
+
|
|
247
|
+
if (activeTabId === 'chat') {
|
|
248
|
+
chatPane.style.display = 'flex';
|
|
249
|
+
filePane.classList.remove('visible');
|
|
250
|
+
} else if (openPanels[activeTabId]) {
|
|
251
|
+
chatPane.style.display = 'none';
|
|
252
|
+
filePane.classList.add('visible');
|
|
253
|
+
renderPanelPane(activeTabId);
|
|
254
|
+
} else {
|
|
255
|
+
chatPane.style.display = 'none';
|
|
256
|
+
filePane.classList.add('visible');
|
|
257
|
+
renderFilePane(activeTabId);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
function showFileInPane(relPath) {
|
|
262
|
+
currentFileInPane = relPath;
|
|
263
|
+
renderFilePane(relPath);
|
|
264
|
+
renderWsTabs();
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
function renderEmptyFilePane() {
|
|
268
|
+
document.getElementById('file-path-display').textContent = '';
|
|
269
|
+
document.getElementById('copy-path-btn').style.display = 'none';
|
|
270
|
+
document.getElementById('edit-btn').style.display = 'none';
|
|
271
|
+
document.getElementById('save-btn').style.display = 'none';
|
|
272
|
+
document.getElementById('file-rendered-view').classList.remove('visible');
|
|
273
|
+
document.getElementById('file-rendered-view').innerHTML = '';
|
|
274
|
+
document.getElementById('file-editor').style.display = 'none';
|
|
275
|
+
document.getElementById('table-view').classList.remove('visible');
|
|
276
|
+
if (typeof hideGitDiffContainer === 'function') hideGitDiffContainer();
|
|
277
|
+
destroyTabulator();
|
|
278
|
+
disposeMonacoInstance();
|
|
279
|
+
disposeNotebookCellMonaco();
|
|
280
|
+
|
|
281
|
+
var rendered = document.getElementById('file-rendered-view');
|
|
282
|
+
rendered.classList.add('visible');
|
|
283
|
+
rendered.innerHTML = '<div class="no-file-msg">Open a file from the explorer</div>';
|
|
284
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
// ═══════════════════════════════════════════════════════════════
|
|
2
|
+
// Tabular data viewer (CSV/TSV/JSON/JSONL)
|
|
3
|
+
// ═══════════════════════════════════════════════════════════════
|
|
4
|
+
|
|
5
|
+
var TABULAR_EXTS = ['csv', 'tsv', 'json', 'jsonl'];
|
|
6
|
+
var EDITABLE_TABULAR_EXTS = ['csv', 'tsv'];
|
|
7
|
+
|
|
8
|
+
function isTabularFile(relPath) {
|
|
9
|
+
var ext = relPath.split('.').pop().toLowerCase();
|
|
10
|
+
return TABULAR_EXTS.includes(ext);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function isEditableTabular(relPath) {
|
|
14
|
+
var ext = relPath.split('.').pop().toLowerCase();
|
|
15
|
+
return EDITABLE_TABULAR_EXTS.includes(ext);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function getTabularDelimiter(relPath) {
|
|
19
|
+
return relPath.split('.').pop().toLowerCase() === 'tsv' ? '\t' : ',';
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function flattenObject(obj, prefix) {
|
|
23
|
+
var result = {};
|
|
24
|
+
for (var _i = 0, _a = Object.entries(obj); _i < _a.length; _i++) {
|
|
25
|
+
var key = _a[_i][0], val = _a[_i][1];
|
|
26
|
+
var newKey = prefix ? prefix + '.' + key : key;
|
|
27
|
+
if (val && typeof val === 'object' && !Array.isArray(val)) {
|
|
28
|
+
Object.assign(result, flattenObject(val, newKey));
|
|
29
|
+
} else if (Array.isArray(val)) {
|
|
30
|
+
result[newKey] = JSON.stringify(val);
|
|
31
|
+
} else {
|
|
32
|
+
result[newKey] = val;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return result;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function flattenToTable(arr) {
|
|
39
|
+
var flat = arr.map(function(item) { return flattenObject(item, ''); });
|
|
40
|
+
var colSet = new Set();
|
|
41
|
+
for (var i = 0; i < flat.length; i++) {
|
|
42
|
+
for (var k of Object.keys(flat[i])) colSet.add(k);
|
|
43
|
+
}
|
|
44
|
+
var columns = Array.from(colSet);
|
|
45
|
+
var data = flat.map(function(row) {
|
|
46
|
+
var out = {};
|
|
47
|
+
for (var j = 0; j < columns.length; j++) {
|
|
48
|
+
out[columns[j]] = row[columns[j]] !== undefined ? row[columns[j]] : '';
|
|
49
|
+
}
|
|
50
|
+
return out;
|
|
51
|
+
});
|
|
52
|
+
return { columns: columns, data: data };
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function serializeToDelimited(columns, data, delimiter) {
|
|
56
|
+
var escape = function(val) {
|
|
57
|
+
var s = val == null ? '' : String(val);
|
|
58
|
+
if (s.includes(delimiter) || s.includes('"') || s.includes('\n') || s.includes('\r')) {
|
|
59
|
+
return '"' + s.replace(/"/g, '""') + '"';
|
|
60
|
+
}
|
|
61
|
+
return s;
|
|
62
|
+
};
|
|
63
|
+
var lines = [columns.map(escape).join(delimiter)];
|
|
64
|
+
for (var i = 0; i < data.length; i++) {
|
|
65
|
+
var row = data[i];
|
|
66
|
+
lines.push(columns.map(function(col) { return escape(row[col]); }).join(delimiter));
|
|
67
|
+
}
|
|
68
|
+
return lines.join('\n') + '\n';
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function downloadTableCSV() {
|
|
72
|
+
if (!activeTabulatorInstance) return;
|
|
73
|
+
var data = activeTabulatorInstance.getData();
|
|
74
|
+
if (!data || data.length === 0) return;
|
|
75
|
+
var columns = activeTabulatorInstance.getColumns().map(function(col) { return col.getField(); });
|
|
76
|
+
var csv = serializeToDelimited(columns, data, ',');
|
|
77
|
+
var blob = new Blob([csv], { type: 'text/csv;charset=utf-8;' });
|
|
78
|
+
var link = document.createElement('a');
|
|
79
|
+
var url = URL.createObjectURL(blob);
|
|
80
|
+
link.setAttribute('href', url);
|
|
81
|
+
var activeTab = openPanels[activeTabId] || { title: activeTabId };
|
|
82
|
+
var fileName = (activeTab.title || 'export').replace(/[^a-z0-9_-]/gi, '_').toLowerCase() + '.csv';
|
|
83
|
+
link.setAttribute('download', fileName);
|
|
84
|
+
link.style.visibility = 'hidden';
|
|
85
|
+
document.body.appendChild(link);
|
|
86
|
+
link.click();
|
|
87
|
+
document.body.removeChild(link);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
async function loadTabularData(relPath, f) {
|
|
91
|
+
var ext = relPath.split('.').pop().toLowerCase();
|
|
92
|
+
|
|
93
|
+
if (ext === 'csv' || ext === 'tsv') {
|
|
94
|
+
var delimiter = ext === 'tsv' ? '\t' : ',';
|
|
95
|
+
var res = await authFetch('/browse/file/parse-csv', {
|
|
96
|
+
method: 'POST',
|
|
97
|
+
headers: { 'Content-Type': 'application/json' },
|
|
98
|
+
body: JSON.stringify({ path: f.absPath, delimiter: delimiter }),
|
|
99
|
+
});
|
|
100
|
+
var result = await res.json();
|
|
101
|
+
if (result.error) throw new Error(result.error);
|
|
102
|
+
return result;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// JSON / JSONL — client-side parse + flatten
|
|
106
|
+
if (ext === 'jsonl') {
|
|
107
|
+
var lines = f.content.split('\n').filter(function(l) { return l.trim(); });
|
|
108
|
+
var arr = lines.map(function(l) { return JSON.parse(l); });
|
|
109
|
+
return flattenToTable(arr);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// JSON
|
|
113
|
+
var parsed = JSON.parse(f.content);
|
|
114
|
+
if (!Array.isArray(parsed)) {
|
|
115
|
+
if (parsed && typeof parsed === 'object') {
|
|
116
|
+
parsed = [parsed];
|
|
117
|
+
} else {
|
|
118
|
+
throw new Error('JSON is not an object or array');
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
if (parsed.length > 0 && typeof parsed[0] !== 'object') {
|
|
122
|
+
throw new Error('JSON array does not contain objects');
|
|
123
|
+
}
|
|
124
|
+
return flattenToTable(parsed);
|
|
125
|
+
}
|