@researai/deepscientist 1.5.17 → 1.6.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/AGENTS.md +309 -130
- package/AISB/catalog/aisb.b1.agentic_coding.yaml +244 -0
- package/AISB/catalog/aisb.b10.climate_earth.yaml +235 -0
- package/AISB/catalog/aisb.b11.model_efficiency.yaml +231 -0
- package/AISB/catalog/aisb.b12.embodied_ai.yaml +238 -0
- package/AISB/catalog/aisb.b2.agent_systems.yaml +229 -0
- package/AISB/catalog/aisb.b3.self_evolving_rl.yaml +237 -0
- package/AISB/catalog/aisb.b4.lm_reasoning.yaml +240 -0
- package/AISB/catalog/aisb.b5.math_proof.yaml +235 -0
- package/AISB/catalog/aisb.b6.research_process.yaml +243 -0
- package/AISB/catalog/aisb.b7.multimodal_fusion.yaml +232 -0
- package/AISB/catalog/aisb.b8.lifesci_drug.yaml +275 -0
- package/AISB/catalog/aisb.b9.material_science.yaml +237 -0
- package/AISB/catalog/aisb.t3.001_savvy.yaml +159 -0
- package/AISB/catalog/aisb.t3.001_savvy.zh.yaml +121 -0
- package/AISB/catalog/aisb.t3.002_pinet.yaml +189 -0
- package/AISB/catalog/aisb.t3.002_pinet.zh.yaml +130 -0
- package/AISB/catalog/aisb.t3.004_decentralattn.yaml +184 -0
- package/AISB/catalog/aisb.t3.004_decentralattn.zh.yaml +153 -0
- package/AISB/catalog/aisb.t3.005_tsae.yaml +193 -0
- package/AISB/catalog/aisb.t3.005_tsae.zh.yaml +139 -0
- package/AISB/catalog/aisb.t3.006_physense.yaml +194 -0
- package/AISB/catalog/aisb.t3.006_physense.zh.yaml +118 -0
- package/AISB/catalog/aisb.t3.007_reasoningiqa.yaml +169 -0
- package/AISB/catalog/aisb.t3.007_reasoningiqa.zh.yaml +133 -0
- package/AISB/catalog/aisb.t3.008_meanflows.yaml +188 -0
- package/AISB/catalog/aisb.t3.008_meanflows.zh.yaml +140 -0
- package/AISB/catalog/aisb.t3.009_scoremissing.yaml +179 -0
- package/AISB/catalog/aisb.t3.009_scoremissing.zh.yaml +119 -0
- package/AISB/catalog/aisb.t3.010_suitabilityfilter.yaml +221 -0
- package/AISB/catalog/aisb.t3.010_suitabilityfilter.zh.yaml +141 -0
- package/AISB/catalog/aisb.t3.011_osd.yaml +206 -0
- package/AISB/catalog/aisb.t3.011_osd.zh.yaml +163 -0
- package/AISB/catalog/aisb.t3.012_efficientqat.yaml +206 -0
- package/AISB/catalog/aisb.t3.012_efficientqat.zh.yaml +159 -0
- package/AISB/catalog/aisb.t3.013_appl.yaml +152 -0
- package/AISB/catalog/aisb.t3.013_appl.zh.yaml +126 -0
- package/AISB/catalog/aisb.t3.014_piguard.yaml +207 -0
- package/AISB/catalog/aisb.t3.014_piguard.zh.yaml +164 -0
- package/AISB/catalog/aisb.t3.015_frspec.yaml +209 -0
- package/AISB/catalog/aisb.t3.015_frspec.zh.yaml +163 -0
- package/AISB/catalog/aisb.t3.016_mathfusion.yaml +166 -0
- package/AISB/catalog/aisb.t3.016_mathfusion.zh.yaml +145 -0
- package/AISB/catalog/aisb.t3.017_multimodalglp.yaml +171 -0
- package/AISB/catalog/aisb.t3.017_multimodalglp.zh.yaml +122 -0
- package/AISB/catalog/aisb.t3.018_cotsynth.yaml +206 -0
- package/AISB/catalog/aisb.t3.018_cotsynth.zh.yaml +162 -0
- package/AISB/catalog/aisb.t3.019_dyscaleut.yaml +211 -0
- package/AISB/catalog/aisb.t3.019_dyscaleut.zh.yaml +148 -0
- package/AISB/catalog/aisb.t3.020_aristotle.yaml +173 -0
- package/AISB/catalog/aisb.t3.020_aristotle.zh.yaml +119 -0
- package/AISB/catalog/aisb.t3.021_tokenrecycling.yaml +160 -0
- package/AISB/catalog/aisb.t3.021_tokenrecycling.zh.yaml +129 -0
- package/AISB/catalog/aisb.t3.022_chainofreasoning.yaml +204 -0
- package/AISB/catalog/aisb.t3.022_chainofreasoning.zh.yaml +161 -0
- package/AISB/catalog/aisb.t3.023_guidedembed.yaml +211 -0
- package/AISB/catalog/aisb.t3.023_guidedembed.zh.yaml +189 -0
- package/AISB/catalog/aisb.t3.024_outputcentric.yaml +148 -0
- package/AISB/catalog/aisb.t3.024_outputcentric.zh.yaml +131 -0
- package/AISB/catalog/aisb.t3.025_deeper.yaml +143 -0
- package/AISB/catalog/aisb.t3.025_deeper.zh.yaml +116 -0
- package/AISB/catalog/aisb.t3.026_gartkg.yaml +195 -0
- package/AISB/catalog/aisb.t3.026_gartkg.zh.yaml +127 -0
- package/AISB/catalog/aisb.t3.027_citeeval.yaml +182 -0
- package/AISB/catalog/aisb.t3.027_citeeval.zh.yaml +135 -0
- package/AISB/catalog/aisb.t3.028_sbam.yaml +206 -0
- package/AISB/catalog/aisb.t3.028_sbam.zh.yaml +166 -0
- package/AISB/catalog/aisb.t3.029_cdqgeoembed.yaml +224 -0
- package/AISB/catalog/aisb.t3.029_cdqgeoembed.zh.yaml +142 -0
- package/AISB/catalog/aisb.t3.030_processrm.yaml +211 -0
- package/AISB/catalog/aisb.t3.030_processrm.zh.yaml +166 -0
- package/AISB/catalog/aisb.t3.031_circuitstability.yaml +172 -0
- package/AISB/catalog/aisb.t3.031_circuitstability.zh.yaml +134 -0
- package/AISB/catalog/aisb.t3.032_ptsolver.yaml +169 -0
- package/AISB/catalog/aisb.t3.032_ptsolver.zh.yaml +135 -0
- package/AISB/catalog/aisb.t3.033_gcse.yaml +144 -0
- package/AISB/catalog/aisb.t3.033_gcse.zh.yaml +126 -0
- package/AISB/catalog/aisb.t3.034_ensemblewm.yaml +183 -0
- package/AISB/catalog/aisb.t3.034_ensemblewm.zh.yaml +146 -0
- package/AISB/catalog/aisb.t3.035_moralvalueswa.yaml +207 -0
- package/AISB/catalog/aisb.t3.035_moralvalueswa.zh.yaml +165 -0
- package/AISB/catalog/aisb.t3.036_weakstrongpref.yaml +210 -0
- package/AISB/catalog/aisb.t3.036_weakstrongpref.zh.yaml +194 -0
- package/AISB/catalog/aisb.t3.037_dementiamask.yaml +172 -0
- package/AISB/catalog/aisb.t3.037_dementiamask.zh.yaml +132 -0
- package/AISB/catalog/aisb.t3.038_tinysam.yaml +284 -0
- package/AISB/catalog/aisb.t3.038_tinysam.zh.yaml +240 -0
- package/AISB/catalog/aisb.t3.039_calf.yaml +224 -0
- package/AISB/catalog/aisb.t3.039_calf.zh.yaml +194 -0
- package/AISB/catalog/aisb.t3.040_graniteguardian.yaml +199 -0
- package/AISB/catalog/aisb.t3.040_graniteguardian.zh.yaml +174 -0
- package/AISB/catalog/aisb.t3.041_amdm.yaml +149 -0
- package/AISB/catalog/aisb.t3.041_amdm.zh.yaml +137 -0
- package/AISB/catalog/aisb.t3.042_xpatch.yaml +216 -0
- package/AISB/catalog/aisb.t3.042_xpatch.zh.yaml +182 -0
- package/AISB/catalog/aisb.t3.043_vhm.yaml +268 -0
- package/AISB/catalog/aisb.t3.043_vhm.zh.yaml +193 -0
- package/AISB/catalog/aisb.t3.044_rgvi.yaml +224 -0
- package/AISB/catalog/aisb.t3.044_rgvi.zh.yaml +176 -0
- package/AISB/catalog/aisb.t3.045_pslstm.yaml +203 -0
- package/AISB/catalog/aisb.t3.045_pslstm.zh.yaml +179 -0
- package/AISB/catalog/aisb.t3.046_nonstatts.yaml +208 -0
- package/AISB/catalog/aisb.t3.046_nonstatts.zh.yaml +194 -0
- package/AISB/catalog/aisb.t3.047_timepfn.yaml +156 -0
- package/AISB/catalog/aisb.t3.047_timepfn.zh.yaml +124 -0
- package/AISB/catalog/aisb.t3.048_proxyspex.yaml +148 -0
- package/AISB/catalog/aisb.t3.048_proxyspex.zh.yaml +125 -0
- package/AISB/catalog/aisb.t3.049_hogwildinference.yaml +183 -0
- package/AISB/catalog/aisb.t3.049_hogwildinference.zh.yaml +138 -0
- package/AISB/catalog/aisb.t3.050_causalpfn.yaml +214 -0
- package/AISB/catalog/aisb.t3.050_causalpfn.zh.yaml +190 -0
- package/AISB/catalog/aisb.t3.051_flashtp.yaml +169 -0
- package/AISB/catalog/aisb.t3.051_flashtp.zh.yaml +124 -0
- package/AISB/catalog/aisb.t3.052_nsdiff.yaml +155 -0
- package/AISB/catalog/aisb.t3.052_nsdiff.zh.yaml +138 -0
- package/AISB/catalog/aisb.t3.053_k2vae.yaml +158 -0
- package/AISB/catalog/aisb.t3.053_k2vae.zh.yaml +132 -0
- package/AISB/catalog/aisb.t3.054_timebase.yaml +178 -0
- package/AISB/catalog/aisb.t3.054_timebase.zh.yaml +158 -0
- package/AISB/catalog/aisb.t3.055_csbrain.yaml +238 -0
- package/AISB/catalog/aisb.t3.055_csbrain.zh.yaml +184 -0
- package/AISB/catalog/aisb.t3.056_infosam.yaml +224 -0
- package/AISB/catalog/aisb.t3.056_infosam.zh.yaml +189 -0
- package/AISB/catalog/aisb.t3.057_mdreid.yaml +129 -0
- package/AISB/catalog/aisb.t3.057_mdreid.zh.yaml +117 -0
- package/AISB/catalog/aisb.t3.058_mindglitch.yaml +171 -0
- package/AISB/catalog/aisb.t3.058_mindglitch.zh.yaml +145 -0
- package/AISB/catalog/aisb.t3.059_selfsupervised.yaml +154 -0
- package/AISB/catalog/aisb.t3.059_selfsupervised.zh.yaml +125 -0
- package/AISB/catalog/aisb.t3.060_iaggad.yaml +121 -0
- package/AISB/catalog/aisb.t3.060_iaggad.zh.yaml +100 -0
- package/AISB/catalog/aisb.t3.061_hsgkn.yaml +136 -0
- package/AISB/catalog/aisb.t3.061_hsgkn.zh.yaml +113 -0
- package/AISB/catalog/aisb.t3.062_visionts.yaml +237 -0
- package/AISB/catalog/aisb.t3.062_visionts.zh.yaml +216 -0
- package/AISB/catalog/aisb.t3.063_tsrag.yaml +162 -0
- package/AISB/catalog/aisb.t3.063_tsrag.zh.yaml +138 -0
- package/AISB/catalog/aisb.t3.064_pir.yaml +221 -0
- package/AISB/catalog/aisb.t3.064_pir.zh.yaml +197 -0
- package/AISB/catalog/aisb.t3.065_proteinbinding.yaml +234 -0
- package/AISB/catalog/aisb.t3.065_proteinbinding.zh.yaml +167 -0
- package/AISB/catalog/aisb.t3.066_tropicalattention.yaml +267 -0
- package/AISB/catalog/aisb.t3.066_tropicalattention.zh.yaml +229 -0
- package/AISB/catalog/aisb.t3.067_kanad.yaml +193 -0
- package/AISB/catalog/aisb.t3.067_kanad.zh.yaml +167 -0
- package/AISB/catalog/aisb.t3.068_sempo.yaml +187 -0
- package/AISB/catalog/aisb.t3.068_sempo.zh.yaml +148 -0
- package/AISB/catalog/aisb.t3.069_treehfd.yaml +129 -0
- package/AISB/catalog/aisb.t3.069_treehfd.zh.yaml +111 -0
- package/AISB/catalog/aisb.t3.070_certifiedunlearning.yaml +224 -0
- package/AISB/catalog/aisb.t3.070_certifiedunlearning.zh.yaml +171 -0
- package/AISB/catalog/aisb.t3.071_neuralmjd.yaml +142 -0
- package/AISB/catalog/aisb.t3.071_neuralmjd.zh.yaml +120 -0
- package/AISB/catalog/aisb.t3.072_fedgmt.yaml +181 -0
- package/AISB/catalog/aisb.t3.072_fedgmt.zh.yaml +158 -0
- package/AISB/catalog/aisb.t3.073_rld.yaml +161 -0
- package/AISB/catalog/aisb.t3.073_rld.zh.yaml +129 -0
- package/AISB/catalog/aisb.t3.074_lsvi.yaml +163 -0
- package/AISB/catalog/aisb.t3.074_lsvi.zh.yaml +129 -0
- package/AISB/catalog/aisb.t3.075_treeslicedentropy.yaml +201 -0
- package/AISB/catalog/aisb.t3.075_treeslicedentropy.zh.yaml +148 -0
- package/AISB/catalog/aisb.t3.076_aanet.yaml +169 -0
- package/AISB/catalog/aisb.t3.076_aanet.zh.yaml +129 -0
- package/AISB/catalog/aisb.t3.077_cmnn.yaml +199 -0
- package/AISB/catalog/aisb.t3.077_cmnn.zh.yaml +165 -0
- package/AISB/catalog/aisb.t3.078_conformalanomaly.yaml +146 -0
- package/AISB/catalog/aisb.t3.078_conformalanomaly.zh.yaml +117 -0
- package/AISB/catalog/aisb.t3.079_dpfkmeans.yaml +131 -0
- package/AISB/catalog/aisb.t3.079_dpfkmeans.zh.yaml +104 -0
- package/AISB/catalog/aisb.t3.080_latentscorereweight.yaml +169 -0
- package/AISB/catalog/aisb.t3.080_latentscorereweight.zh.yaml +123 -0
- package/AISB/catalog/aisb.t3.081_qmamba.yaml +150 -0
- package/AISB/catalog/aisb.t3.081_qmamba.zh.yaml +117 -0
- package/AISB/catalog/aisb.t3.082_onlinellmrouting.yaml +160 -0
- package/AISB/catalog/aisb.t3.082_onlinellmrouting.zh.yaml +133 -0
- package/AISB/catalog/aisb.t3.083_starformer.yaml +178 -0
- package/AISB/catalog/aisb.t3.083_starformer.zh.yaml +140 -0
- package/AISB/catalog/aisb.t3.084_ift.yaml +139 -0
- package/AISB/catalog/aisb.t3.084_ift.zh.yaml +111 -0
- package/AISB/catalog/aisb.t3.085_neuralsurv.yaml +183 -0
- package/AISB/catalog/aisb.t3.085_neuralsurv.zh.yaml +143 -0
- package/AISB/catalog/aisb.t3.086_stella.yaml +197 -0
- package/AISB/catalog/aisb.t3.086_stella.zh.yaml +142 -0
- package/AISB/catalog/aisb.t3.087_moses.yaml +167 -0
- package/AISB/catalog/aisb.t3.087_moses.zh.yaml +132 -0
- package/AISB/catalog/aisb.t3.088_channelnorm.yaml +140 -0
- package/AISB/catalog/aisb.t3.088_channelnorm.zh.yaml +109 -0
- package/AISB/catalog/aisb.t3.089_causalvelocity.yaml +730 -0
- package/AISB/catalog/aisb.t3.089_causalvelocity.zh.yaml +668 -0
- package/AISB/catalog/aisb.t3.090_rstib.yaml +144 -0
- package/AISB/catalog/aisb.t3.090_rstib.zh.yaml +109 -0
- package/AISB/catalog/aisb.t3.091_timeawarecausal.yaml +132 -0
- package/AISB/catalog/aisb.t3.091_timeawarecausal.zh.yaml +107 -0
- package/AISB/catalog/aisb.t3.092_kmeanslocalopt.yaml +138 -0
- package/AISB/catalog/aisb.t3.092_kmeanslocalopt.zh.yaml +110 -0
- package/AISB/catalog/aisb.t3.093_fedwmsam.yaml +134 -0
- package/AISB/catalog/aisb.t3.093_fedwmsam.zh.yaml +106 -0
- package/AISB/catalog/aisb.t3.094_boundre.yaml +147 -0
- package/AISB/catalog/aisb.t3.094_boundre.zh.yaml +114 -0
- package/AISB/catalog/aisb.t3.095_fastfeaturecp.yaml +153 -0
- package/AISB/catalog/aisb.t3.095_fastfeaturecp.zh.yaml +118 -0
- package/AISB/catalog/aisb.t3.096_m3svm.yaml +189 -0
- package/AISB/catalog/aisb.t3.096_m3svm.zh.yaml +149 -0
- package/AISB/catalog/aisb.t3.097_wassersteintl.yaml +212 -0
- package/AISB/catalog/aisb.t3.097_wassersteintl.zh.yaml +169 -0
- package/AISB/catalog/aisb.t3.098_xmahalanobis.yaml +171 -0
- package/AISB/catalog/aisb.t3.098_xmahalanobis.zh.yaml +127 -0
- package/AISB/catalog/aisb.t3.099_ollalanding.yaml +248 -0
- package/AISB/catalog/aisb.t3.099_ollalanding.zh.yaml +182 -0
- package/AISB/catalog/aisb.t3.100_invmissingdata.yaml +179 -0
- package/AISB/catalog/aisb.t3.100_invmissingdata.zh.yaml +150 -0
- package/AISB/catalog/aisb.t3.101_acia.yaml +164 -0
- package/AISB/catalog/aisb.t3.101_acia.zh.yaml +109 -0
- package/AISB/catalog/aisb.t3.102_stochasticff.yaml +178 -0
- package/AISB/catalog/aisb.t3.102_stochasticff.zh.yaml +130 -0
- package/AISB/catalog/aisb.t3.103_qdcp.yaml +150 -0
- package/AISB/catalog/aisb.t3.103_qdcp.zh.yaml +116 -0
- package/AISB/catalog/aisb.t3.104_balancedactiveinf.yaml +137 -0
- package/AISB/catalog/aisb.t3.104_balancedactiveinf.zh.yaml +104 -0
- package/AISB/catalog/aisb.t3.105_binaryclasseval.yaml +161 -0
- package/AISB/catalog/aisb.t3.105_binaryclasseval.zh.yaml +130 -0
- package/AISB/image/001_aisb.t3.001_savvy.jpg +0 -0
- package/AISB/image/002_aisb.t3.002_pinet.jpg +0 -0
- package/AISB/image/003_aisb.t3.003_dmsqd.jpg +0 -0
- package/AISB/image/004_aisb.t3.004_decentralattn.jpg +0 -0
- package/AISB/image/005_aisb.t3.005_tsae.jpg +0 -0
- package/AISB/image/006_aisb.t3.006_physense.jpg +0 -0
- package/AISB/image/007_aisb.t3.007_reasoningiqa.jpg +0 -0
- package/AISB/image/008_aisb.t3.008_meanflows.jpg +0 -0
- package/AISB/image/009_aisb.t3.009_scoremissing.jpg +0 -0
- package/AISB/image/010_aisb.t3.010_suitabilityfilter.jpg +0 -0
- package/AISB/image/011_aisb.t3.011_osd.jpg +0 -0
- package/AISB/image/012_aisb.t3.012_efficientqat.jpg +0 -0
- package/AISB/image/013_aisb.t3.013_appl.jpg +0 -0
- package/AISB/image/014_aisb.t3.014_piguard.jpg +0 -0
- package/AISB/image/015_aisb.t3.015_frspec.jpg +0 -0
- package/AISB/image/016_aisb.t3.016_mathfusion.jpg +0 -0
- package/AISB/image/017_aisb.t3.017_multimodalglp.jpg +0 -0
- package/AISB/image/018_aisb.t3.018_cotsynth.jpg +0 -0
- package/AISB/image/019_aisb.t3.019_dyscaleut.jpg +0 -0
- package/AISB/image/020_aisb.t3.020_aristotle.jpg +0 -0
- package/AISB/image/021_aisb.t3.021_tokenrecycling.jpg +0 -0
- package/AISB/image/022_aisb.t3.022_chainofreasoning.jpg +0 -0
- package/AISB/image/023_aisb.t3.023_guidedembed.jpg +0 -0
- package/AISB/image/024_aisb.t3.024_outputcentric.jpg +0 -0
- package/AISB/image/025_aisb.t3.025_deeper.jpg +0 -0
- package/AISB/image/026_aisb.t3.026_gartkg.jpg +0 -0
- package/AISB/image/027_aisb.t3.027_citeeval.jpg +0 -0
- package/AISB/image/028_aisb.t3.028_sbam.jpg +0 -0
- package/AISB/image/029_aisb.t3.029_cdqgeoembed.jpg +0 -0
- package/AISB/image/030_aisb.t3.030_processrm.jpg +0 -0
- package/AISB/image/031_aisb.t3.031_circuitstability.jpg +0 -0
- package/AISB/image/032_aisb.t3.032_ptsolver.jpg +0 -0
- package/AISB/image/033_aisb.t3.033_gcse.jpg +0 -0
- package/AISB/image/034_aisb.t3.034_ensemblewm.jpg +0 -0
- package/AISB/image/035_aisb.t3.035_moralvalueswa.jpg +0 -0
- package/AISB/image/036_aisb.t3.036_weakstrongpref.jpg +0 -0
- package/AISB/image/037_aisb.t3.037_dementiamask.jpg +0 -0
- package/AISB/image/038_aisb.t3.038_tinysam.jpg +0 -0
- package/AISB/image/039_aisb.t3.039_calf.jpg +0 -0
- package/AISB/image/040_aisb.t3.040_graniteguardian.jpg +0 -0
- package/AISB/image/041_aisb.t3.041_amdm.jpg +0 -0
- package/AISB/image/042_aisb.t3.042_xpatch.jpg +0 -0
- package/AISB/image/043_aisb.t3.043_vhm.jpg +0 -0
- package/AISB/image/044_aisb.t3.044_rgvi.jpg +0 -0
- package/AISB/image/045_aisb.t3.045_pslstm.jpg +0 -0
- package/AISB/image/046_aisb.t3.046_nonstatts.jpg +0 -0
- package/AISB/image/047_aisb.t3.047_timepfn.jpg +0 -0
- package/AISB/image/048_aisb.t3.048_proxyspex.jpg +0 -0
- package/AISB/image/049_aisb.t3.049_hogwildinference.jpg +0 -0
- package/AISB/image/050_aisb.t3.050_causalpfn.jpg +0 -0
- package/AISB/image/051_aisb.t3.051_flashtp.jpg +0 -0
- package/AISB/image/052_aisb.t3.052_nsdiff.jpg +0 -0
- package/AISB/image/053_aisb.t3.053_k2vae.jpg +0 -0
- package/AISB/image/054_aisb.t3.054_timebase.jpg +0 -0
- package/AISB/image/055_aisb.t3.055_csbrain.jpg +0 -0
- package/AISB/image/056_aisb.t3.056_infosam.jpg +0 -0
- package/AISB/image/057_aisb.t3.057_mdreid.jpg +0 -0
- package/AISB/image/058_aisb.t3.058_mindglitch.jpg +0 -0
- package/AISB/image/059_aisb.t3.059_selfsupervised.jpg +0 -0
- package/AISB/image/060_aisb.t3.060_iaggad.jpg +0 -0
- package/AISB/image/061_aisb.t3.061_hsgkn.jpg +0 -0
- package/AISB/image/062_aisb.t3.062_visionts.jpg +0 -0
- package/AISB/image/063_aisb.t3.063_tsrag.jpg +0 -0
- package/AISB/image/064_aisb.t3.064_pir.jpg +0 -0
- package/AISB/image/065_aisb.t3.065_proteinbinding.jpg +0 -0
- package/AISB/image/066_aisb.t3.066_tropicalattention.jpg +0 -0
- package/AISB/image/067_aisb.t3.067_kanad.jpg +0 -0
- package/AISB/image/068_aisb.t3.068_sempo.jpg +0 -0
- package/AISB/image/069_aisb.t3.069_treehfd.jpg +0 -0
- package/AISB/image/070_aisb.t3.070_certifiedunlearning.jpg +0 -0
- package/AISB/image/071_aisb.t3.071_neuralmjd.jpg +0 -0
- package/AISB/image/072_aisb.t3.072_fedgmt.jpg +0 -0
- package/AISB/image/073_aisb.t3.073_rld.jpg +0 -0
- package/AISB/image/074_aisb.t3.074_lsvi.jpg +0 -0
- package/AISB/image/075_aisb.t3.075_treeslicedentropy.jpg +0 -0
- package/AISB/image/076_aisb.t3.076_aanet.jpg +0 -0
- package/AISB/image/077_aisb.t3.077_cmnn.jpg +0 -0
- package/AISB/image/078_aisb.t3.078_conformalanomaly.jpg +0 -0
- package/AISB/image/079_aisb.t3.079_dpfkmeans.jpg +0 -0
- package/AISB/image/080_aisb.t3.080_latentscorereweight.jpg +0 -0
- package/AISB/image/081_aisb.t3.081_qmamba.jpg +0 -0
- package/AISB/image/082_aisb.t3.082_onlinellmrouting.jpg +0 -0
- package/AISB/image/083_aisb.t3.083_starformer.jpg +0 -0
- package/AISB/image/084_aisb.t3.084_ift.jpg +0 -0
- package/AISB/image/085_aisb.t3.085_neuralsurv.jpg +0 -0
- package/AISB/image/086_aisb.t3.086_stella.jpg +0 -0
- package/AISB/image/087_aisb.t3.087_moses.jpg +0 -0
- package/AISB/image/088_aisb.t3.088_channelnorm.jpg +0 -0
- package/AISB/image/089_aisb.t3.089_causalvelocity.jpg +0 -0
- package/AISB/image/090_aisb.t3.090_rstib.jpg +0 -0
- package/AISB/image/091_aisb.t3.091_timeawarecausal.jpg +0 -0
- package/AISB/image/092_aisb.t3.092_kmeanslocalopt.jpg +0 -0
- package/AISB/image/093_aisb.t3.093_fedwmsam.jpg +0 -0
- package/AISB/image/094_aisb.t3.094_boundre.jpg +0 -0
- package/AISB/image/095_aisb.t3.095_fastfeaturecp.jpg +0 -0
- package/AISB/image/096_aisb.t3.096_m3svm.jpg +0 -0
- package/AISB/image/097_aisb.t3.097_wassersteintl.jpg +0 -0
- package/AISB/image/098_aisb.t3.098_xmahalanobis.jpg +0 -0
- package/AISB/image/099_aisb.t3.099_ollalanding.jpg +0 -0
- package/AISB/image/100_aisb.t3.100_invmissingdata.jpg +0 -0
- package/AISB/image/101_aisb.t3.101_acia.jpg +0 -0
- package/AISB/image/102_aisb.t3.102_stochasticff.jpg +0 -0
- package/AISB/image/103_aisb.t3.103_qdcp.jpg +0 -0
- package/AISB/image/104_aisb.t3.104_balancedactiveinf.jpg +0 -0
- package/AISB/image/105_aisb.t3.105_binaryclasseval.jpg +0 -0
- package/AISB/image/106_aisb.t1.reasoning_lite.jpg +0 -0
- package/AISB/image/107_aisb.t2.paper_audit.jpg +0 -0
- package/AISB/image/108_aisb.t3.multi_gpu_search.jpg +0 -0
- package/AISB/image/109_aisb.t3.tdc_admet.jpg +0 -0
- package/AISB/image/aisb.b1.agentic_coding.svg +16 -0
- package/AISB/image/aisb.b10.climate_earth.svg +16 -0
- package/AISB/image/aisb.b11.model_efficiency.svg +16 -0
- package/AISB/image/aisb.b12.embodied_ai.svg +16 -0
- package/AISB/image/aisb.b2.agent_systems.svg +16 -0
- package/AISB/image/aisb.b3.self_evolving_rl.svg +16 -0
- package/AISB/image/aisb.b4.lm_reasoning.svg +16 -0
- package/AISB/image/aisb.b5.math_proof.svg +16 -0
- package/AISB/image/aisb.b6.research_process.svg +16 -0
- package/AISB/image/aisb.b7.multimodal_fusion.svg +16 -0
- package/AISB/image/aisb.b8.lifesci_drug.svg +16 -0
- package/AISB/image/aisb.b9.material_science.svg +16 -0
- package/README.md +132 -11
- package/bin/ds.js +376 -49
- package/docs/en/00_QUICK_START.md +135 -18
- package/docs/en/01_SETTINGS_REFERENCE.md +468 -96
- package/docs/en/02_START_RESEARCH_GUIDE.md +26 -5
- package/docs/en/03_QQ_CONNECTOR_GUIDE.md +14 -3
- package/docs/en/04_LINGZHU_CONNECTOR_GUIDE.md +2 -0
- package/docs/en/05_TUI_GUIDE.md +171 -2
- package/docs/en/07_MEMORY_AND_MCP.md +38 -2
- package/docs/en/09_DOCTOR.md +64 -4
- package/docs/en/10_WEIXIN_CONNECTOR_GUIDE.md +38 -1
- package/docs/en/11_LICENSE_AND_RISK.md +4 -0
- package/docs/en/12_GUIDED_WORKFLOW_TOUR.md +15 -0
- package/docs/en/14_PROMPT_SKILLS_AND_MCP_GUIDE.md +9 -0
- package/docs/en/15_CODEX_PROVIDER_SETUP.md +622 -187
- package/docs/en/16_TELEGRAM_CONNECTOR_GUIDE.md +14 -0
- package/docs/en/17_WHATSAPP_CONNECTOR_GUIDE.md +14 -0
- package/docs/en/18_FEISHU_CONNECTOR_GUIDE.md +14 -0
- package/docs/en/21_LOCAL_MODEL_BACKENDS_GUIDE.md +105 -2
- package/docs/en/22_BENCHSTORE_YAML_REFERENCE.md +469 -0
- package/docs/en/23_BENCHSTORE_GITHUB_RELEASES_SPEC.md +316 -0
- package/docs/en/24_CLAUDE_CODE_PROVIDER_SETUP.md +469 -0
- package/docs/en/25_OPENCODE_PROVIDER_SETUP.md +653 -0
- package/docs/en/26_CITATION_AND_ATTRIBUTION.md +119 -0
- package/docs/en/27_KIMI_CODE_PROVIDER_SETUP.md +180 -0
- package/docs/en/28_DISCORD_CONNECTOR_GUIDE.md +61 -0
- package/docs/en/29_SLACK_CONNECTOR_GUIDE.md +60 -0
- package/docs/en/30_SETTINGS_CONTROL_CENTER_GUIDE.md +371 -0
- package/docs/en/{19_LOCAL_BROWSER_AUTH.md → 31_LOCAL_BROWSER_AUTH.md} +1 -1
- package/docs/en/32_WINDOWS_WSL2_DEPLOYMENT_GUIDE.md +273 -0
- package/docs/en/33_WORKSPACE_EXPLORER_QA.md +121 -0
- package/docs/en/91_DEVELOPMENT.md +29 -0
- package/docs/en/99_ACKNOWLEDGEMENTS.md +24 -19
- package/docs/en/README.md +44 -7
- package/docs/images/admin/admin-connectors-health-en.png +0 -0
- package/docs/images/admin/admin-controllers-en.png +0 -0
- package/docs/images/admin/admin-diagnostics-en.png +0 -0
- package/docs/images/admin/admin-errors-en.png +0 -0
- package/docs/images/admin/admin-issues-en.png +0 -0
- package/docs/images/admin/admin-logs-en.png +0 -0
- package/docs/images/admin/admin-quest-detail-en.png +0 -0
- package/docs/images/admin/admin-quests-en.png +0 -0
- package/docs/images/admin/admin-repairs-en.png +0 -0
- package/docs/images/admin/admin-runtime-en.png +0 -0
- package/docs/images/admin/admin-search-en.png +0 -0
- package/docs/images/admin/admin-stats-en.png +0 -0
- package/docs/images/admin/admin-summary-en.png +0 -0
- package/docs/images/connectors/connector-discord-en.png +0 -0
- package/docs/images/connectors/connector-feishu-en.png +0 -0
- package/docs/images/connectors/connector-lingzhu-en.png +0 -0
- package/docs/images/connectors/connector-qq-en.png +0 -0
- package/docs/images/connectors/connector-slack-en.png +0 -0
- package/docs/images/connectors/connector-telegram-en.png +0 -0
- package/docs/images/connectors/connector-weixin-en.png +0 -0
- package/docs/images/connectors/connector-whatsapp-en.png +0 -0
- package/docs/images/settings/settings-baselines-en.png +0 -0
- package/docs/images/settings/settings-config-en.png +0 -0
- package/docs/images/settings/settings-connectors-overview-en.png +0 -0
- package/docs/images/settings/settings-deepxiv-en.png +0 -0
- package/docs/images/settings/settings-mcp-servers-en.png +0 -0
- package/docs/images/settings/settings-plugins-en.png +0 -0
- package/docs/images/settings/settings-runners-en.png +0 -0
- package/docs/zh/00_QUICK_START.md +92 -17
- package/docs/zh/01_SETTINGS_REFERENCE.md +219 -98
- package/docs/zh/02_START_RESEARCH_GUIDE.md +26 -5
- package/docs/zh/05_TUI_GUIDE.md +171 -2
- package/docs/zh/07_MEMORY_AND_MCP.md +29 -2
- package/docs/zh/09_DOCTOR.md +39 -4
- package/docs/zh/10_WEIXIN_CONNECTOR_GUIDE.md +24 -1
- package/docs/zh/11_LICENSE_AND_RISK.md +4 -0
- package/docs/zh/12_GUIDED_WORKFLOW_TOUR.md +15 -0
- package/docs/zh/14_PROMPT_SKILLS_AND_MCP_GUIDE.md +9 -0
- package/docs/zh/15_CODEX_PROVIDER_SETUP.md +550 -188
- package/docs/zh/21_LOCAL_MODEL_BACKENDS_GUIDE.md +105 -2
- package/docs/zh/22_BENCHSTORE_YAML_REFERENCE.md +459 -0
- package/docs/zh/23_BENCHSTORE_GITHUB_RELEASES_SPEC.md +287 -0
- package/docs/zh/23_CLAUDE_RUNNER_GUIDE.md +103 -0
- package/docs/zh/24_CLAUDE_CODE_PROVIDER_SETUP.md +460 -0
- package/docs/zh/25_OPENCODE_PROVIDER_SETUP.md +660 -0
- package/docs/zh/26_CITATION_AND_ATTRIBUTION.md +102 -0
- package/docs/zh/27_KIMI_CODE_PROVIDER_SETUP.md +51 -0
- package/docs/zh/{19_LOCAL_BROWSER_AUTH.md → 31_LOCAL_BROWSER_AUTH.md} +1 -1
- package/docs/zh/32_WINDOWS_WSL2_DEPLOYMENT_GUIDE.md +264 -0
- package/docs/zh/33_WORKSPACE_EXPLORER_QA.md +127 -0
- package/docs/zh/99_ACKNOWLEDGEMENTS.md +23 -19
- package/docs/zh/README.md +29 -7
- package/install.sh +122 -16
- package/package.json +4 -1
- package/pyproject.toml +2 -1
- package/src/deepscientist/__init__.py +1 -1
- package/src/deepscientist/acp/envelope.py +13 -0
- package/src/deepscientist/admin/__init__.py +3 -0
- package/src/deepscientist/admin/charts.py +681 -0
- package/src/deepscientist/admin/logs.py +119 -0
- package/src/deepscientist/admin/repairs.py +217 -0
- package/src/deepscientist/admin/service.py +1310 -0
- package/src/deepscientist/admin/system_info.py +700 -0
- package/src/deepscientist/admin/tasks.py +465 -0
- package/src/deepscientist/admin/tool_metrics.py +600 -0
- package/src/deepscientist/artifact/guidance.py +8 -4
- package/src/deepscientist/artifact/schemas.py +115 -0
- package/src/deepscientist/artifact/service.py +4268 -260
- package/src/deepscientist/bash_exec/monitor.py +30 -3
- package/src/deepscientist/bash_exec/service.py +134 -1
- package/src/deepscientist/benchstore/__init__.py +4 -0
- package/src/deepscientist/benchstore/prompt_builder.py +224 -0
- package/src/deepscientist/benchstore/service.py +1716 -0
- package/src/deepscientist/channels/weixin_ilink.py +8 -1
- package/src/deepscientist/cli.py +92 -17
- package/src/deepscientist/codex_cli_compat.py +2 -2
- package/src/deepscientist/config/models.py +82 -11
- package/src/deepscientist/config/service.py +927 -91
- package/src/deepscientist/connector/weixin_support.py +48 -17
- package/src/deepscientist/daemon/api/handlers.py +697 -210
- package/src/deepscientist/daemon/api/router.py +76 -1
- package/src/deepscientist/daemon/app.py +1054 -51
- package/src/deepscientist/diagnostics/runner_failures.py +147 -0
- package/src/deepscientist/doctor.py +212 -65
- package/src/deepscientist/evidence_packets.py +590 -0
- package/src/deepscientist/home.py +52 -4
- package/src/deepscientist/kimi_cli_compat.py +50 -0
- package/src/deepscientist/latex_runtime.py +2 -2
- package/src/deepscientist/mcp/context.py +2 -0
- package/src/deepscientist/mcp/schemas.py +114 -0
- package/src/deepscientist/mcp/server.py +1566 -126
- package/src/deepscientist/memory/service.py +203 -16
- package/src/deepscientist/process_control.py +8 -1
- package/src/deepscientist/prompts/builder.py +836 -92
- package/src/deepscientist/quest/__init__.py +2 -2
- package/src/deepscientist/quest/layout.py +12 -1
- package/src/deepscientist/quest/node_traces.py +10 -0
- package/src/deepscientist/quest/service.py +1430 -139
- package/src/deepscientist/quest/stage_views.py +1 -1
- package/src/deepscientist/runners/__init__.py +18 -0
- package/src/deepscientist/runners/base.py +89 -1
- package/src/deepscientist/runners/builtins.py +13 -1
- package/src/deepscientist/runners/claude.py +391 -0
- package/src/deepscientist/runners/codex.py +421 -21
- package/src/deepscientist/runners/codex_telemetry.py +127 -0
- package/src/deepscientist/runners/kimi.py +334 -0
- package/src/deepscientist/runners/metadata.py +68 -0
- package/src/deepscientist/runners/opencode.py +414 -0
- package/src/deepscientist/runners/runtime_overrides.py +100 -0
- package/src/deepscientist/runners/simple_cli.py +538 -0
- package/src/deepscientist/runtime_storage.py +303 -0
- package/src/deepscientist/shared.py +61 -16
- package/src/deepscientist/skills/installer.py +37 -0
- package/src/deepscientist/skills/registry.py +2 -0
- package/src/deepscientist/tinytex.py +2 -2
- package/src/deepscientist/tui.py +10 -3
- package/src/prompts/benchstore/system.md +77 -0
- package/src/prompts/connectors/qq.md +33 -2
- package/src/prompts/connectors/weixin.md +208 -23
- package/src/prompts/contracts/admin_ops.md +74 -0
- package/src/prompts/contracts/admin_ops_knowledge.md +138 -0
- package/src/prompts/contracts/shared_interaction.md +5 -11
- package/src/prompts/start_setup/system.md +422 -0
- package/src/prompts/system.md +409 -315
- package/src/prompts/system_copilot.md +88 -12
- package/src/skills/analysis-campaign/SKILL.md +239 -578
- package/src/skills/analysis-campaign/references/artifact-flow-examples.md +102 -0
- package/src/skills/analysis-campaign/references/boundary-cases.md +98 -0
- package/src/skills/analysis-campaign/references/campaign-checklist-template.md +39 -24
- package/src/skills/analysis-campaign/references/campaign-design.md +26 -10
- package/src/skills/analysis-campaign/references/campaign-plan-template.md +53 -54
- package/src/skills/analysis-campaign/references/operational-guidance.md +97 -0
- package/src/skills/analysis-campaign/references/writing-facing-slice-examples.md +10 -20
- package/src/skills/baseline/SKILL.md +183 -461
- package/src/skills/baseline/references/artifact-flow-examples.md +106 -0
- package/src/skills/baseline/references/artifact-payload-examples.md +1 -1
- package/src/skills/baseline/references/baseline-checklist-template.md +27 -35
- package/src/skills/baseline/references/baseline-plan-template.md +37 -76
- package/src/skills/baseline/references/boundary-cases.md +86 -0
- package/src/skills/baseline/references/codebase-audit-checklist.md +2 -6
- package/src/skills/baseline/references/comparability-contract.md +7 -12
- package/src/skills/baseline/references/operational-guidance.md +56 -0
- package/src/skills/baseline/references/route-selection.md +5 -25
- package/src/skills/decision/SKILL.md +113 -306
- package/src/skills/decision/references/checkpoint-memory-template.md +47 -0
- package/src/skills/decision/references/operational-guidance.md +94 -0
- package/src/skills/decision/references/research-route-criteria.md +7 -8
- package/src/skills/decision/references/strategic-decision-template.md +13 -26
- package/src/skills/experiment/SKILL.md +132 -670
- package/src/skills/experiment/references/execution-playbook.md +374 -0
- package/src/skills/experiment/references/main-experiment-checklist-template.md +26 -2
- package/src/skills/experiment/references/main-experiment-plan-template.md +28 -17
- package/src/skills/experiment/references/operational-guidance.md +108 -0
- package/src/skills/finalize/SKILL.md +62 -0
- package/src/skills/finalize/references/checkpoint-memory-template.md +49 -0
- package/src/skills/finalize/references/resume-packet-template.md +7 -0
- package/src/skills/idea/SKILL.md +228 -15
- package/src/skills/idea/references/controlled-brainstorming-playbook.md +78 -0
- package/src/skills/idea/references/current-board-packet-template.md +61 -0
- package/src/skills/idea/references/high-value-idea-sourcing.md +119 -0
- package/src/skills/idea/references/idea-generation-playbook.md +21 -0
- package/src/skills/idea/references/idea-thinking-flow.md +6 -0
- package/src/skills/idea/references/literature-survey-template.md +3 -0
- package/src/skills/idea/references/objective-contract-template.md +54 -0
- package/src/skills/idea/references/outline-seeding-example.md +56 -0
- package/src/skills/idea/references/pre-idea-draft-template.md +105 -0
- package/src/skills/idea/references/related-work-playbook.md +75 -2
- package/src/skills/idea/references/research-history-playbook.md +114 -0
- package/src/skills/idea/references/selection-gate.md +58 -6
- package/src/skills/intake-audit/SKILL.md +43 -2
- package/src/skills/intake-audit/references/state-audit-template.md +10 -0
- package/src/skills/nature-data/SKILL.md +128 -0
- package/src/skills/nature-data/UPSTREAM_LICENSE.txt +21 -0
- package/src/skills/nature-data/agents/openai.yaml +4 -0
- package/src/skills/nature-data/references/chinese-author-alignment.md +84 -0
- package/src/skills/nature-data/references/fair-metadata-checklist.md +105 -0
- package/src/skills/nature-data/references/policy-principles.md +103 -0
- package/src/skills/nature-data/references/repository-and-identifiers.md +96 -0
- package/src/skills/nature-data/references/source-basis.md +54 -0
- package/src/skills/nature-data/references/statement-patterns.md +153 -0
- package/src/skills/nature-figure/SKILL.md +197 -0
- package/src/skills/nature-figure/UPSTREAM_LICENSE.txt +21 -0
- package/src/skills/nature-figure/agents/openai.yaml +4 -0
- package/src/skills/nature-figure/evals/evals.json +37 -0
- package/src/skills/nature-figure/references/api.md +428 -0
- package/src/skills/nature-figure/references/backend-selection.md +100 -0
- package/src/skills/nature-figure/references/chart-types.md +281 -0
- package/src/skills/nature-figure/references/common-patterns.md +349 -0
- package/src/skills/nature-figure/references/design-theory.md +436 -0
- package/src/skills/nature-figure/references/figure-contract.md +93 -0
- package/src/skills/nature-figure/references/nature-2026-observations.md +112 -0
- package/src/skills/nature-figure/references/qa-contract.md +119 -0
- package/src/skills/nature-figure/references/r-template-index.md +66 -0
- package/src/skills/nature-figure/references/r-workflow.md +161 -0
- package/src/skills/nature-figure/references/tutorials.md +250 -0
- package/src/skills/nature-paper2ppt/SKILL.md +507 -0
- package/src/skills/nature-paper2ppt/UPSTREAM_LICENSE.txt +21 -0
- package/src/skills/nature-paper2ppt/agents/openai.yaml +4 -0
- package/src/skills/nature-polishing/SKILL.md +385 -0
- package/src/skills/nature-polishing/UPSTREAM_LICENSE.txt +21 -0
- package/src/skills/nature-polishing/agents/openai.yaml +4 -0
- package/src/skills/nature-polishing/references/phrasebank-playbook.md +162 -0
- package/src/skills/nature-polishing/references/section-moves.md +240 -0
- package/src/skills/nature-polishing/references/style-guardrails.md +94 -0
- package/src/skills/nature-polishing/references/writing-strategy.md +148 -0
- package/src/skills/optimize/SKILL.md +177 -1568
- package/src/skills/optimize/references/brief-shaping-playbook.md +95 -0
- package/src/skills/optimize/references/candidate-board-template.md +13 -0
- package/src/skills/optimize/references/candidate-ranking-template.md +51 -0
- package/src/skills/optimize/references/codegen-route-playbook.md +50 -0
- package/src/skills/optimize/references/debug-response-template.md +29 -0
- package/src/skills/optimize/references/frontier-review-template.md +32 -0
- package/src/skills/optimize/references/fusion-playbook.md +36 -0
- package/src/skills/optimize/references/method-brief-template.md +73 -0
- package/src/skills/optimize/references/operational-guidance.md +621 -0
- package/src/skills/optimize/references/optimization-memory-template.md +30 -0
- package/src/skills/optimize/references/optimize-checklist-template.md +18 -0
- package/src/skills/optimize/references/plateau-response-playbook.md +28 -0
- package/src/skills/optimize/references/prompt-patterns.md +49 -0
- package/src/skills/paper-outline/SKILL.md +227 -0
- package/src/skills/paper-outline/references/outline-patterns.md +87 -0
- package/src/skills/paper-plot/SKILL.md +79 -0
- package/src/skills/paper-plot/agents/openai.yaml +4 -0
- package/src/skills/paper-plot/references/bar_grouped_hatch.md +96 -0
- package/src/skills/paper-plot/references/bar_paired_delta.md +72 -0
- package/src/skills/paper-plot/references/line_confidence_band.md +75 -0
- package/src/skills/paper-plot/references/line_loss_with_inset.md +65 -0
- package/src/skills/paper-plot/references/line_training_curve.md +44 -0
- package/src/skills/paper-plot/references/radar_dual_series.md +59 -0
- package/src/skills/paper-plot/references/scatter_broken_axis.md +59 -0
- package/src/skills/paper-plot/references/scatter_tsne_cluster.md +72 -0
- package/src/skills/paper-plot/scripts/bar_memevolve.py +109 -0
- package/src/skills/paper-plot/scripts/bar_spice.py +166 -0
- package/src/skills/paper-plot/scripts/line_aime.py +94 -0
- package/src/skills/paper-plot/scripts/line_loss_inset.py +157 -0
- package/src/skills/paper-plot/scripts/line_selfdistill.py +168 -0
- package/src/skills/paper-plot/scripts/radar_dora.py +151 -0
- package/src/skills/paper-plot/scripts/scatter_break.py +169 -0
- package/src/skills/paper-plot/scripts/scatter_tsne.py +133 -0
- package/src/skills/rebuttal/SKILL.md +9 -0
- package/src/skills/references/tool-usage-by-stage.md +438 -0
- package/src/skills/review/SKILL.md +105 -7
- package/src/skills/science/PROVENANCE.md +44 -0
- package/src/skills/science/SKILL.md +137 -0
- package/src/skills/science/references/artifact-science-tool.md +110 -0
- package/src/skills/science/references/claim-type-discipline.md +56 -0
- package/src/skills/science/references/domain-index.md +422 -0
- package/src/skills/science/references/hpc-via-bash-exec.md +42 -0
- package/src/skills/science/references/package-check-playbook.md +64 -0
- package/src/skills/science/references/package-index.min.json +3616 -0
- package/src/skills/science/references/packages/abinit.md +80 -0
- package/src/skills/science/references/packages/acts.md +73 -0
- package/src/skills/science/references/packages/aiida-core.md +80 -0
- package/src/skills/science/references/packages/alamode.md +80 -0
- package/src/skills/science/references/packages/amuse.md +88 -0
- package/src/skills/science/references/packages/anndata.md +88 -0
- package/src/skills/science/references/packages/arbor.md +80 -0
- package/src/skills/science/references/packages/arc.md +73 -0
- package/src/skills/science/references/packages/astropy.md +88 -0
- package/src/skills/science/references/packages/astroquery.md +88 -0
- package/src/skills/science/references/packages/atomate2.md +80 -0
- package/src/skills/science/references/packages/atomsmltr.md +73 -0
- package/src/skills/science/references/packages/awkward.md +73 -0
- package/src/skills/science/references/packages/batman.md +88 -0
- package/src/skills/science/references/packages/biopython.md +88 -0
- package/src/skills/science/references/packages/bloqade.md +73 -0
- package/src/skills/science/references/packages/brian2.md +73 -0
- package/src/skills/science/references/packages/bullet3.md +73 -0
- package/src/skills/science/references/packages/calculix.md +80 -0
- package/src/skills/science/references/packages/cantera.md +73 -0
- package/src/skills/science/references/packages/cavity-md-ipi.md +80 -0
- package/src/skills/science/references/packages/ccdproc.md +88 -0
- package/src/skills/science/references/packages/celerite2.md +88 -0
- package/src/skills/science/references/packages/cellrank.md +73 -0
- package/src/skills/science/references/packages/cesm.md +80 -0
- package/src/skills/science/references/packages/chemicals.md +73 -0
- package/src/skills/science/references/packages/chempy.md +73 -0
- package/src/skills/science/references/packages/cirq.md +73 -0
- package/src/skills/science/references/packages/coffea.md +73 -0
- package/src/skills/science/references/packages/cp2k.md +88 -0
- package/src/skills/science/references/packages/custodian.md +80 -0
- package/src/skills/science/references/packages/dart.md +73 -0
- package/src/skills/science/references/packages/datamol.md +88 -0
- package/src/skills/science/references/packages/dd4hep.md +73 -0
- package/src/skills/science/references/packages/dealii.md +80 -0
- package/src/skills/science/references/packages/deepchem.md +88 -0
- package/src/skills/science/references/packages/delphes.md +73 -0
- package/src/skills/science/references/packages/devito.md +80 -0
- package/src/skills/science/references/packages/dftb.md +88 -0
- package/src/skills/science/references/packages/dftd4.md +88 -0
- package/src/skills/science/references/packages/dftk-jl.md +80 -0
- package/src/skills/science/references/packages/dolfinx.md +80 -0
- package/src/skills/science/references/packages/drake.md +73 -0
- package/src/skills/science/references/packages/dumux.md +73 -0
- package/src/skills/science/references/packages/elk.md +80 -0
- package/src/skills/science/references/packages/elmerfem.md +80 -0
- package/src/skills/science/references/packages/enzo-e.md +88 -0
- package/src/skills/science/references/packages/espresso.md +80 -0
- package/src/skills/science/references/packages/exoplanet.md +88 -0
- package/src/skills/science/references/packages/fairroot.md +73 -0
- package/src/skills/science/references/packages/fbpic.md +80 -0
- package/src/skills/science/references/packages/fdtdbath-meep.md +80 -0
- package/src/skills/science/references/packages/geant4.md +73 -0
- package/src/skills/science/references/packages/geosx.md +80 -0
- package/src/skills/science/references/packages/gprmax.md +80 -0
- package/src/skills/science/references/packages/gromacs.md +80 -0
- package/src/skills/science/references/packages/gwaslab.md +73 -0
- package/src/skills/science/references/packages/gz-sim.md +73 -0
- package/src/skills/science/references/packages/hail.md +88 -0
- package/src/skills/science/references/packages/hiphive.md +80 -0
- package/src/skills/science/references/packages/hoomd-blue.md +80 -0
- package/src/skills/science/references/packages/itensor.md +73 -0
- package/src/skills/science/references/packages/itensors-jl.md +73 -0
- package/src/skills/science/references/packages/jdftx.md +73 -0
- package/src/skills/science/references/packages/jobflow.md +80 -0
- package/src/skills/science/references/packages/kadanoffbaym-jl.md +73 -0
- package/src/skills/science/references/packages/kite.md +80 -0
- package/src/skills/science/references/packages/kratos.md +80 -0
- package/src/skills/science/references/packages/kwant.md +73 -0
- package/src/skills/science/references/packages/lammps.md +80 -0
- package/src/skills/science/references/packages/lightkurve.md +88 -0
- package/src/skills/science/references/packages/limix.md +73 -0
- package/src/skills/science/references/packages/maxwelllink.md +80 -0
- package/src/skills/science/references/packages/mcdc.md +73 -0
- package/src/skills/science/references/packages/meep.md +80 -0
- package/src/skills/science/references/packages/mfem.md +80 -0
- package/src/skills/science/references/packages/mitgcm.md +73 -0
- package/src/skills/science/references/packages/modflow6.md +73 -0
- package/src/skills/science/references/packages/molecool.md +73 -0
- package/src/skills/science/references/packages/mom6.md +73 -0
- package/src/skills/science/references/packages/moose.md +80 -0
- package/src/skills/science/references/packages/mpas-model.md +73 -0
- package/src/skills/science/references/packages/mujoco.md +73 -0
- package/src/skills/science/references/packages/mumax3.md +73 -0
- package/src/skills/science/references/packages/nekrs.md +80 -0
- package/src/skills/science/references/packages/nessi.md +73 -0
- package/src/skills/science/references/packages/nest-simulator.md +73 -0
- package/src/skills/science/references/packages/netket.md +73 -0
- package/src/skills/science/references/packages/neuron.md +73 -0
- package/src/skills/science/references/packages/nextflow.md +88 -0
- package/src/skills/science/references/packages/nwchem.md +88 -0
- package/src/skills/science/references/packages/openbabel.md +88 -0
- package/src/skills/science/references/packages/openems.md +80 -0
- package/src/skills/science/references/packages/openff-toolkit.md +88 -0
- package/src/skills/science/references/packages/openfoam-dev.md +80 -0
- package/src/skills/science/references/packages/openmc.md +73 -0
- package/src/skills/science/references/packages/openmm.md +80 -0
- package/src/skills/science/references/packages/openmoc.md +73 -0
- package/src/skills/science/references/packages/openmx.md +80 -0
- package/src/skills/science/references/packages/opensees.md +80 -0
- package/src/skills/science/references/packages/opensn.md +80 -0
- package/src/skills/science/references/packages/opm-simulators.md +73 -0
- package/src/skills/science/references/packages/oqupy.md +73 -0
- package/src/skills/science/references/packages/packmol.md +80 -0
- package/src/skills/science/references/packages/palabos.md +80 -0
- package/src/skills/science/references/packages/parflow.md +80 -0
- package/src/skills/science/references/packages/pennylane.md +88 -0
- package/src/skills/science/references/packages/perceval.md +73 -0
- package/src/skills/science/references/packages/phono3py.md +73 -0
- package/src/skills/science/references/packages/phonopy.md +73 -0
- package/src/skills/science/references/packages/photutils.md +88 -0
- package/src/skills/science/references/packages/picongpu.md +80 -0
- package/src/skills/science/references/packages/plink-ng.md +88 -0
- package/src/skills/science/references/packages/precice.md +73 -0
- package/src/skills/science/references/packages/psc.md +80 -0
- package/src/skills/science/references/packages/psi4.md +88 -0
- package/src/skills/science/references/packages/pybinding.md +73 -0
- package/src/skills/science/references/packages/pyfr.md +80 -0
- package/src/skills/science/references/packages/pyhf.md +73 -0
- package/src/skills/science/references/packages/pyiron_base.md +80 -0
- package/src/skills/science/references/packages/pylcp.md +73 -0
- package/src/skills/science/references/packages/pylith.md +80 -0
- package/src/skills/science/references/packages/pynbody.md +88 -0
- package/src/skills/science/references/packages/pysam.md +88 -0
- package/src/skills/science/references/packages/pyscf.md +88 -0
- package/src/skills/science/references/packages/q-e.md +73 -0
- package/src/skills/science/references/packages/qibo.md +73 -0
- package/src/skills/science/references/packages/qiskit.md +73 -0
- package/src/skills/science/references/packages/quantica-jl.md +73 -0
- package/src/skills/science/references/packages/quantumoptics-jl.md +73 -0
- package/src/skills/science/references/packages/quimb.md +73 -0
- package/src/skills/science/references/packages/qulacs.md +73 -0
- package/src/skills/science/references/packages/qutip.md +73 -0
- package/src/skills/science/references/packages/rdkit.md +88 -0
- package/src/skills/science/references/packages/rmg-py.md +73 -0
- package/src/skills/science/references/packages/root.md +73 -0
- package/src/skills/science/references/packages/scanpy.md +88 -0
- package/src/skills/science/references/packages/scikit-allel.md +88 -0
- package/src/skills/science/references/packages/scikit-bio.md +88 -0
- package/src/skills/science/references/packages/scqubits.md +73 -0
- package/src/skills/science/references/packages/scuff-em.md +80 -0
- package/src/skills/science/references/packages/scvi-tools.md +73 -0
- package/src/skills/science/references/packages/seissol.md +73 -0
- package/src/skills/science/references/packages/sfepy.md +80 -0
- package/src/skills/science/references/packages/sisl.md +73 -0
- package/src/skills/science/references/packages/smilei.md +80 -0
- package/src/skills/science/references/packages/snakemake.md +88 -0
- package/src/skills/science/references/packages/specfem3d-globe.md +80 -0
- package/src/skills/science/references/packages/specutils.md +88 -0
- package/src/skills/science/references/packages/spglib.md +80 -0
- package/src/skills/science/references/packages/squidpy.md +88 -0
- package/src/skills/science/references/packages/starry.md +88 -0
- package/src/skills/science/references/packages/strawberryfields.md +73 -0
- package/src/skills/science/references/packages/su2.md +80 -0
- package/src/skills/science/references/packages/sunny-jl.md +73 -0
- package/src/skills/science/references/packages/sw4.md +73 -0
- package/src/skills/science/references/packages/swift.md +88 -0
- package/src/skills/science/references/packages/tdnegf.md +73 -0
- package/src/skills/science/references/packages/tenpy.md +73 -0
- package/src/skills/science/references/packages/thermo.md +73 -0
- package/src/skills/science/references/packages/tkwant.md +73 -0
- package/src/skills/science/references/packages/tvb-root.md +73 -0
- package/src/skills/science/references/packages/uproot5.md +73 -0
- package/src/skills/science/references/packages/vampire.md +80 -0
- package/src/skills/science/references/packages/wannier_tools.md +73 -0
- package/src/skills/science/references/packages/warpx.md +80 -0
- package/src/skills/science/references/packages/wrf.md +73 -0
- package/src/skills/science/references/packages/xtb.md +88 -0
- package/src/skills/science/references/packages/yt.md +73 -0
- package/src/skills/science/references/science-task-brief-template.md +71 -0
- package/src/skills/scout/SKILL.md +83 -425
- package/src/skills/scout/references/literature-scout-template.md +5 -24
- package/src/skills/scout/references/operational-guidance.md +191 -0
- package/src/skills/scout/references/paper-triage-playbook.md +11 -35
- package/src/skills/write/SKILL.md +744 -1246
- package/src/skills/write/references/experiments_analysis_patterns.md +129 -0
- package/src/skills/write/references/oral_package_patterns.md +252 -0
- package/src/skills/write/references/oral_writing_principles.md +291 -0
- package/src/skills/write/references/section_rewrite_checklist.md +234 -0
- package/src/tui/dist/app/AppContainer.js +1314 -27
- package/src/tui/dist/components/Composer.js +26 -1
- package/src/tui/dist/components/ConfigScreen.js +2 -1
- package/src/tui/dist/components/InputPrompt.js +25 -9
- package/src/tui/dist/components/MainContent.js +18 -3
- package/src/tui/dist/components/QuestScreen.js +3 -2
- package/src/tui/dist/components/UtilityScreen.js +37 -0
- package/src/tui/dist/hooks/useSafeInput.js +10 -0
- package/src/tui/dist/index.js +13 -1
- package/src/tui/dist/layouts/DefaultAppLayout.js +11 -8
- package/src/tui/dist/lib/api.js +89 -1
- package/src/tui/package.json +1 -1
- package/src/ui/dist/assets/{AnalysisPlugin-BCKAfjba.js → AnalysisPlugin-CA94NGmI.js} +1 -1
- package/src/ui/dist/assets/CliPlugin-DHBzphZU.js +79 -0
- package/src/ui/dist/assets/CodeEditorPlugin-BOFwD2rn.js +2 -0
- package/src/ui/dist/assets/{CodeViewerPlugin-CbaFRrUU.js → CodeViewerPlugin-CqDpgjik.js} +4 -4
- package/src/ui/dist/assets/{DocViewerPlugin-DAjLVeQD.js → DocViewerPlugin-UDBgt8-4.js} +3 -3
- package/src/ui/dist/assets/GitCommitViewerPlugin-BmHtZ0bZ.js +6 -0
- package/src/ui/dist/assets/{GitDiffViewerPlugin-CQACjoAA.js → GitDiffViewerPlugin-CAxjNorQ.js} +2 -2
- package/src/ui/dist/assets/{GitSnapshotViewer-0r4nLPke.js → GitSnapshotViewer-CweA6VON.js} +2 -2
- package/src/ui/dist/assets/{ImageViewerPlugin-nBOmI2v_.js → ImageViewerPlugin-C8wHGvGN.js} +5 -5
- package/src/ui/dist/assets/LabPlugin-COyyLUol.js +32 -0
- package/src/ui/dist/assets/{LatexPlugin-ZwtV8pIp.js → LatexPlugin-BQjAaA5J.js} +4 -4
- package/src/ui/dist/assets/{MarkdownViewerPlugin-DKqVfKyW.js → MarkdownViewerPlugin-Dy1NE2dI.js} +3 -3
- package/src/ui/dist/assets/{MarketplacePlugin-BwxStZ9D.js → MarketplacePlugin-DMIZtEJ2.js} +2 -2
- package/src/ui/dist/assets/NotebookEditor-CFHMq_Qt.js +91 -0
- package/src/ui/dist/assets/{NotebookEditor-DB9N_T9q.js → NotebookEditor-WFyd8Ybt.js} +3 -3
- package/src/ui/dist/assets/{PdfLoader-eWBONbQP.js → PdfLoader-CLE5u5TS.js} +3 -3
- package/src/ui/dist/assets/{PdfMarkdownPlugin-D22YOZL3.js → PdfMarkdownPlugin-_iNK_H83.js} +1 -1
- package/src/ui/dist/assets/PdfViewerPlugin-DgWsbInT.js +22 -0
- package/src/ui/dist/assets/SearchPlugin-DrZmn5iw.js +11 -0
- package/src/ui/dist/assets/{TextViewerPlugin-C5xqeeUH.js → TextViewerPlugin-D1-T3aC7.js} +4 -4
- package/src/ui/dist/assets/branding/runner-claude.svg +107 -0
- package/src/ui/dist/assets/branding/runner-codex.svg +10 -0
- package/src/ui/dist/assets/branding/runner-kimi.svg +14 -0
- package/src/ui/dist/assets/branding/runner-opencode.svg +7 -0
- package/src/ui/dist/assets/cli-store-CoZ-x5Ip.js +1 -0
- package/src/ui/dist/assets/{code-WlFHE7z_.js → code-DbsmSd3Y.js} +1 -1
- package/src/ui/dist/assets/file-diff-panel-DsvyRz47.js +1 -0
- package/src/ui/dist/assets/{wrap-text-BC-Hltpd.js → file-jump-queue-DeQBikaw.js} +3 -3
- package/src/ui/dist/assets/{file-socket-CfQPKQKj.js → file-socket-DA5XIx88.js} +1 -1
- package/src/ui/dist/assets/fonts/ds-fonts.css +50 -4
- package/src/ui/dist/assets/images/deepxiv/register-guide.png +0 -0
- package/src/ui/dist/assets/index-39vY9LmZ.js +1 -0
- package/src/ui/dist/assets/{index-CwNu1aH4.js → index-BsO46tJA.js} +1 -1
- package/src/ui/dist/assets/index-CHzJ2xtB.js +3530 -0
- package/src/ui/dist/assets/index-DH-zxoZ3.css +33 -0
- package/src/ui/dist/assets/{plugin-notebook-HbW2K-1c.js → plugin-notebook-JRhysCqj.js} +2 -2
- package/src/ui/dist/assets/{project-sync-C9IdzdZW.js → project-sync-DPmWKmKD.js} +1 -1
- package/src/ui/dist/assets/{zoom-out-E_gaeAxL.js → zoom-out-DAukFWen.js} +3 -3
- package/src/ui/dist/index.html +3 -3
- package/src/skills/analysis-campaign/references/artifact-orchestration.md +0 -58
- package/src/skills/baseline/references/memory-playbook.md +0 -40
- package/src/skills/baseline/references/publishable-baseline-package.md +0 -30
- package/src/skills/write/references/outline-evidence-contract-example.md +0 -107
- package/src/skills/write/references/paper-experiment-matrix-template.md +0 -131
- package/src/skills/write/references/paper-section-playbook.md +0 -64
- package/src/skills/write/references/reviewer-first-writing.md +0 -64
- package/src/skills/write/references/revision-checklist.md +0 -70
- package/src/skills/write/references/section-contracts.md +0 -82
- package/src/skills/write/references/sentence-level-proofing.md +0 -49
- package/src/ui/dist/assets/AiManusChatView-Bv-Z8YpU.js +0 -204
- package/src/ui/dist/assets/CliPlugin-BCKcpc35.js +0 -109
- package/src/ui/dist/assets/CodeEditorPlugin-DbOfSJ8K.js +0 -2
- package/src/ui/dist/assets/GitCommitViewerPlugin-CIUqbUDO.js +0 -1
- package/src/ui/dist/assets/LabCopilotPanel-BHxOxF4z.js +0 -14
- package/src/ui/dist/assets/LabPlugin-BKoZGs95.js +0 -22
- package/src/ui/dist/assets/NotebookEditor-BEQhaQbt.js +0 -81
- package/src/ui/dist/assets/PdfViewerPlugin-c-RK9DLM.js +0 -17
- package/src/ui/dist/assets/SearchPlugin-CxF9ytAx.js +0 -16
- package/src/ui/dist/assets/VNCViewer-BoLGLnHz.js +0 -11
- package/src/ui/dist/assets/bot-DREQOxzP.js +0 -6
- package/src/ui/dist/assets/chevron-up-C9Qpx4DE.js +0 -6
- package/src/ui/dist/assets/file-content-BZMz3RYp.js +0 -1
- package/src/ui/dist/assets/file-diff-panel-CQhw0jS2.js +0 -1
- package/src/ui/dist/assets/file-jump-queue-DA-SdG__.js +0 -1
- package/src/ui/dist/assets/git-commit-horizontal-DxZ8DCZh.js +0 -6
- package/src/ui/dist/assets/image-Bgl4VIyx.js +0 -6
- package/src/ui/dist/assets/index-BpV6lusQ.css +0 -33
- package/src/ui/dist/assets/index-CBNVuWcP.js +0 -2496
- package/src/ui/dist/assets/index-DrUnlf6K.js +0 -1
- package/src/ui/dist/assets/index-NW-h8VzN.js +0 -1
- package/src/ui/dist/assets/pdf-effect-queue-J8OnM0jE.js +0 -6
- package/src/ui/dist/assets/popover-CLc0pPP8.js +0 -1
- package/src/ui/dist/assets/select-Cs2PmzwL.js +0 -11
- package/src/ui/dist/assets/sigma-ClKcHAXm.js +0 -6
- package/src/ui/dist/assets/trash-DwpbFr3w.js +0 -11
- package/src/ui/dist/assets/useCliAccess-NQ8m0Let.js +0 -1
- package/src/ui/dist/assets/useFileDiffOverlay-FuhcnKiw.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
2
|
-
import{u as V,a as q,c as G,j as e,L as $,C as J,F as K,E as Q,b as S,d as Z,e as B,_ as X}from"./index-
|
|
3
|
-
`),E=U[w]||U.javascript||[],o=new Set(E);return z.map(C=>{const s=[];let t=C;for(;t.length>0;){const _=t.match(/^"(?:[^"\\]|\\.)*"/);if(_){s.push({type:"string",value:_[0]}),t=t.slice(_[0].length);continue}const f=t.match(/^'(?:[^'\\]|\\.)*'/);if(f){s.push({type:"string",value:f[0]}),t=t.slice(f[0].length);continue}const y=t.match(/^`(?:[^`\\]|\\.)*`/);if(y){s.push({type:"string",value:y[0]}),t=t.slice(y[0].length);continue}const D=t.match(/^(\/\/.*|#.*)$/);if(D){s.push({type:"comment",value:D[0]}),t="";continue}const N=t.match(/^\/\*.*?\*\//);if(N){s.push({type:"comment",value:N[0]}),t=t.slice(N[0].length);continue}const v=t.match(/^-?\d+\.?\d*([eE][+-]?\d+)?/);if(v){s.push({type:"number",value:v[0]}),t=t.slice(v[0].length);continue}const b=t.match(/^[a-zA-Z_$][a-zA-Z0-9_$]*/);if(b){const m=b[0],d=t[m.length];o.has(m)?s.push({type:"keyword",value:m}):d==="("?s.push({type:"function",value:m}):s.push({type:"default",value:m}),t=t.slice(m.length);continue}const k=t.match(/^[+\-*/%=<>!&|^~?:]+/);if(k){s.push({type:"operator",value:k[0]}),t=t.slice(k[0].length);continue}const g=t.match(/^[{}[\]();,.]/);if(g){s.push({type:"punctuation",value:g[0]}),t=t.slice(g[0].length);continue}s.push({type:"default",value:t[0]}),t=t.slice(1)}return s})}const oe={keyword:"text-purple-400",string:"text-green-400",comment:"text-gray-500 italic",number:"text-slate-200",function:"text-blue-400",operator:"text-pink-400",punctuation:"text-gray-400",default:"text-gray-100"};function
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CHzJ2xtB.js","assets/plugin-monaco-C8UgLomw.js","assets/plugin-terminal-MXFIPun8.js","assets/plugin-notebook-JRhysCqj.js","assets/index-DH-zxoZ3.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{u as V,a as q,c as G,j as e,L as $,C as J,F as K,E as Q,b as S,d as Z,e as B,_ as X}from"./index-CHzJ2xtB.js";import{r}from"./plugin-monaco-C8UgLomw.js";import{H as Y,W as ee,c as te}from"./file-jump-queue-DeQBikaw.js";import{C as se}from"./code-DbsmSd3Y.js";import"./plugin-notebook-JRhysCqj.js";import"./plugin-terminal-MXFIPun8.js";const ne={".js":"javascript",".jsx":"javascript",".mjs":"javascript",".ts":"typescript",".tsx":"typescript",".mts":"typescript",".py":"python",".pyw":"python",".pyi":"python",".json":"json",".jsonc":"json",".json5":"json",".html":"html",".htm":"html",".css":"css",".scss":"scss",".sass":"sass",".less":"less",".yaml":"yaml",".yml":"yaml",".toml":"toml",".ini":"ini",".cfg":"ini",".conf":"ini",".sh":"bash",".bash":"bash",".zsh":"zsh",".fish":"fish",".sql":"sql",".xml":"xml",".xsl":"xml",".xslt":"xml",".svg":"xml",".go":"go",".rs":"rust",".c":"c",".h":"c",".cpp":"cpp",".cc":"cpp",".cxx":"cpp",".hpp":"cpp",".hxx":"cpp",".java":"java",".cs":"csharp",".php":"php",".rb":"ruby",".swift":"swift",".kt":"kotlin",".kts":"kotlin",".md":"markdown",".markdown":"markdown"};function re(c){const w=c.substring(c.lastIndexOf(".")).toLowerCase();return ne[w]||"plaintext"}function ae(c){return c==="html"}const U={javascript:["const","let","var","function","return","if","else","for","while","do","switch","case","break","continue","default","class","extends","new","this","super","import","export","from","as","async","await","try","catch","finally","throw","typeof","instanceof","in","of","true","false","null","undefined","void"],typescript:["const","let","var","function","return","if","else","for","while","do","switch","case","break","continue","default","class","extends","new","this","super","import","export","from","as","async","await","try","catch","finally","throw","typeof","instanceof","in","of","true","false","null","undefined","void","type","interface","enum","namespace","module","declare","abstract","implements","private","protected","public","readonly","static"],python:["def","class","if","elif","else","for","while","try","except","finally","with","as","import","from","return","yield","raise","pass","break","continue","and","or","not","in","is","lambda","True","False","None","global","nonlocal","assert","del"],go:["package","import","func","return","var","const","type","struct","interface","map","chan","go","defer","if","else","for","range","switch","case","default","break","continue","fallthrough","select","true","false","nil"],rust:["fn","let","mut","const","static","if","else","match","for","while","loop","break","continue","return","struct","enum","impl","trait","pub","mod","use","as","self","super","crate","async","await","move","ref","true","false","where"]};function ce(c,w){const z=c.split(`
|
|
3
|
+
`),E=U[w]||U.javascript||[],o=new Set(E);return z.map(C=>{const s=[];let t=C;for(;t.length>0;){const _=t.match(/^"(?:[^"\\]|\\.)*"/);if(_){s.push({type:"string",value:_[0]}),t=t.slice(_[0].length);continue}const f=t.match(/^'(?:[^'\\]|\\.)*'/);if(f){s.push({type:"string",value:f[0]}),t=t.slice(f[0].length);continue}const y=t.match(/^`(?:[^`\\]|\\.)*`/);if(y){s.push({type:"string",value:y[0]}),t=t.slice(y[0].length);continue}const D=t.match(/^(\/\/.*|#.*)$/);if(D){s.push({type:"comment",value:D[0]}),t="";continue}const N=t.match(/^\/\*.*?\*\//);if(N){s.push({type:"comment",value:N[0]}),t=t.slice(N[0].length);continue}const v=t.match(/^-?\d+\.?\d*([eE][+-]?\d+)?/);if(v){s.push({type:"number",value:v[0]}),t=t.slice(v[0].length);continue}const b=t.match(/^[a-zA-Z_$][a-zA-Z0-9_$]*/);if(b){const m=b[0],d=t[m.length];o.has(m)?s.push({type:"keyword",value:m}):d==="("?s.push({type:"function",value:m}):s.push({type:"default",value:m}),t=t.slice(m.length);continue}const k=t.match(/^[+\-*/%=<>!&|^~?:]+/);if(k){s.push({type:"operator",value:k[0]}),t=t.slice(k[0].length);continue}const g=t.match(/^[{}[\]();,.]/);if(g){s.push({type:"punctuation",value:g[0]}),t=t.slice(g[0].length);continue}s.push({type:"default",value:t[0]}),t=t.slice(1)}return s})}const oe={keyword:"text-purple-400",string:"text-green-400",comment:"text-gray-500 italic",number:"text-slate-200",function:"text-blue-400",operator:"text-pink-400",punctuation:"text-gray-400",default:"text-gray-100"};function he({context:c,tabId:w,setDirty:z,setTitle:E}){const{t:o}=V("code_viewer"),C=q(a=>a.updateTabState),[s,t]=r.useState(""),[_,f]=r.useState(!0),[y,D]=r.useState(null),[N,v]=r.useState(!1),[b,k]=r.useState(!0),[g,m]=r.useState(!1),[d,L]=r.useState("source"),[T,A]=r.useState(null),j=r.useRef(null),p=c.resourceId,M=c.resourceName||c.resourcePath||"Untitled",x=r.useMemo(()=>re(c.resourcePath||""),[c.resourcePath]),u=r.useMemo(()=>ae(x)||String(c.mimeType||"").toLowerCase().includes("html"),[c.mimeType,x]);r.useEffect(()=>{L(u?"rendered":"source")},[p,u]),r.useEffect(()=>{E(M)},[M,E]),r.useEffect(()=>{C(w,{contentKind:u?"html":"code",documentMode:u?d:"source",isReadOnly:!0})},[u,w,C,d]),r.useEffect(()=>{(async()=>{f(!0),D(null);try{if(!c.resourceId){t(F[x]||F.javascript),f(!1);return}const{getFileContent:n}=await X(async()=>{const{getFileContent:l}=await import("./index-CHzJ2xtB.js").then(i=>i.d8);return{getFileContent:l}},__vite__mapDeps([0,1,2,3,4])),h=await n(c.resourceId);t(h)}catch(n){D(n instanceof Error?n.message:o("load_failed"))}finally{f(!1)}})()},[c.resourceId,x,o]);const P=r.useMemo(()=>ce(s,x),[s,x]),H=r.useCallback(async()=>{await G(s)&&(v(!0),setTimeout(()=>v(!1),2e3))},[s]),R=P.length,I=r.useCallback(a=>{if(!p||a.fileId!==p)return;const n=a.lineStart??a.line??a.lineEnd;if(!n)return;const h=a.lineEnd??a.line??a.lineStart??n,l=Math.max(1,R),i=Math.min(Math.max(n,1),l),W=Math.min(Math.max(h,i),l);A({start:i,end:W});const O=document.getElementById(`code-line-${i-1}`);O&&O.scrollIntoView({behavior:"smooth",block:"center"}),j.current&&window.clearTimeout(j.current),j.current=window.setTimeout(()=>{A(null)},2500)},[p,R]);return r.useEffect(()=>{if(!p)return;const a=()=>{te(p).forEach(i=>I(i.data))};a();const n=l=>{const i=l.detail;I(i)},h=l=>{const i=l.detail;!i||i.fileId!==p||a()};return window.addEventListener("ds:file:jump",n),window.addEventListener("ds:file:queue",h),()=>{window.removeEventListener("ds:file:jump",n),window.removeEventListener("ds:file:queue",h),j.current&&(window.clearTimeout(j.current),j.current=null)}},[I,p]),_?e.jsx("div",{className:"flex items-center justify-center h-full bg-background",children:e.jsxs("div",{className:"flex flex-col items-center gap-3 text-muted-foreground",children:[e.jsx($,{className:"w-8 h-8 animate-spin"}),e.jsx("span",{children:o("loading")})]})}):y?e.jsx("div",{className:"flex items-center justify-center h-full bg-background",children:e.jsxs("div",{className:"flex flex-col items-center gap-3 text-destructive",children:[e.jsx(J,{className:"w-8 h-8"}),e.jsx("span",{children:y}),e.jsx("button",{className:"px-4 py-2 text-sm bg-destructive/10 hover:bg-destructive/20 rounded-lg transition-colors",onClick:()=>window.location.reload(),children:o("retry")})]})}):e.jsxs("div",{className:"flex flex-col h-full bg-[#1e1e1e] text-gray-100",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-[#333] bg-[#252526]",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(K,{className:"w-4 h-4 text-gray-400"}),e.jsx("span",{className:"text-sm text-gray-300",children:M}),e.jsx("span",{className:"text-xs px-2 py-0.5 rounded bg-[#333] text-gray-400 uppercase",children:u?"HTML":x}),e.jsx("span",{className:"text-xs text-gray-500",children:o("line_count",{count:R})})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[u?e.jsxs("div",{className:"mr-2 flex items-center rounded-md border border-[#3a3a3a] bg-[#202021] p-0.5",children:[e.jsx("button",{onClick:()=>L("rendered"),className:S("rounded px-2 py-1 text-xs transition-colors",d==="rendered"?"bg-[#3A4653] text-white":"text-gray-400 hover:text-gray-200"),title:o("rendered_view"),children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Q,{className:"h-3.5 w-3.5"}),o("rendered_view_short")]})}),e.jsx("button",{onClick:()=>L("source"),className:S("rounded px-2 py-1 text-xs transition-colors",d==="source"?"bg-[#3A4653] text-white":"text-gray-400 hover:text-gray-200"),title:o("source_view"),children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(se,{className:"h-3.5 w-3.5"}),o("source_view_short")]})})]}):null,!u||d==="source"?e.jsx("button",{onClick:()=>k(!b),className:S("p-2 rounded hover:bg-[#333] transition-colors",b?"text-blue-400":"text-gray-500"),title:o("toggle_line_numbers"),children:e.jsx(Y,{className:"w-4 h-4"})}):null,!u||d==="source"?e.jsx("button",{onClick:()=>m(!g),className:S("p-2 rounded hover:bg-[#333] transition-colors",g?"text-blue-400":"text-gray-500"),title:o("toggle_word_wrap"),children:e.jsx(ee,{className:"w-4 h-4"})}):null,e.jsx("button",{onClick:H,className:"p-2 rounded hover:bg-[#333] transition-colors text-gray-400 hover:text-gray-200",title:o("copy_source"),children:N?e.jsx(Z,{className:"w-4 h-4 text-green-400"}):e.jsx(B,{className:"w-4 h-4"})})]})]}),e.jsx("div",{className:"flex-1 overflow-auto",children:u&&d==="rendered"?e.jsxs("div",{className:"flex h-full flex-col bg-[#1c1c1d]",children:[e.jsx("div",{className:"border-b border-[#2f2f30] px-4 py-2 text-xs text-gray-400",children:o("html_render_hint")}),e.jsx("div",{className:"flex-1 p-3",children:e.jsx("div",{className:"h-full overflow-hidden rounded-xl border border-white/10 bg-white shadow-[0_24px_60px_-36px_rgba(0,0,0,0.55)]",children:e.jsx("iframe",{title:o("html_render_frame_title",{name:M}),srcDoc:s,sandbox:"",className:"h-full w-full bg-white"})})})]}):e.jsxs("div",{className:"flex min-h-full",children:[b&&e.jsx("div",{className:"flex-shrink-0 py-4 pr-4 text-right bg-[#1e1e1e] border-r border-[#333] select-none sticky left-0",children:P.map((a,n)=>e.jsx("div",{className:"px-4 text-xs leading-6 text-gray-500 font-mono",children:n+1},n))}),e.jsx("pre",{className:S("flex-1 py-4 px-4 font-mono text-sm leading-6 overflow-x-auto",g&&"whitespace-pre-wrap break-all"),children:e.jsx("code",{children:P.map((a,n)=>{const h=T&&n+1>=T.start&&n+1<=T.end;return e.jsx("div",{id:`code-line-${n}`,className:S("min-h-[1.5rem]",h&&"ds-citation-line-highlight"),children:a.length===0?e.jsx("span",{children:" "}):a.map((l,i)=>e.jsx("span",{className:oe[l.type],children:l.value},i))},n)})})})]})})]})}const F={javascript:`// DeepScientist - Example JavaScript Code
|
|
4
4
|
import { useState, useEffect } from 'react';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -267,4 +267,4 @@ fn main() {
|
|
|
267
267
|
"react": ">=18.0.0"
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
|
-
`};export{
|
|
270
|
+
`};export{he as default};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
2
|
-
import{
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CHzJ2xtB.js","assets/plugin-monaco-C8UgLomw.js","assets/plugin-terminal-MXFIPun8.js","assets/plugin-notebook-JRhysCqj.js","assets/index-DH-zxoZ3.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as k,u as v,j as e,L as P,b as m,T as I,a0 as E,_ as C,ac as j,f as g}from"./index-CHzJ2xtB.js";import{r as n}from"./plugin-monaco-C8UgLomw.js";import"./plugin-notebook-JRhysCqj.js";import"./plugin-terminal-MXFIPun8.js";/**
|
|
3
3
|
* @license lucide-react v0.511.0 - ISC
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the ISC license.
|
|
6
6
|
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/const F=[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]],_=k("presentation",F),O={docx:{icon:"W",color:"bg-blue-600",labelKey:"word_document"},doc:{icon:"W",color:"bg-blue-600",labelKey:"word_document"},xlsx:{icon:"X",color:"bg-green-600",labelKey:"excel_spreadsheet"},xls:{icon:"X",color:"bg-green-600",labelKey:"excel_spreadsheet"},pptx:{icon:"P",color:"bg-primary",labelKey:"powerpoint_presentation"},ppt:{icon:"P",color:"bg-primary",labelKey:"powerpoint_presentation"},odt:{icon:"OD",color:"bg-blue-500",labelKey:"open_document_text"},ods:{icon:"OD",color:"bg-green-500",labelKey:"open_document_spreadsheet"},odp:{icon:"OD",color:"bg-primary",labelKey:"open_document_presentation"}};function T({src:o,fileName:l,fileType:N,onError:c,onDownload:a,className:w}){const{t}=v("doc_viewer"),[r,i]=n.useState(!0),[d,p]=n.useState(!1),u=O[N.toLowerCase()]||{icon:"?",color:"bg-gray-600",labelKey:"document"},f=n.useCallback(()=>{i(!1)},[]),b=n.useCallback(()=>{i(!1),p(!0),c?.(t("preview_load_failed"))},[c,t]),h=o?(x=>null)(o):null,y=n.useCallback(()=>{if(a){a();return}if(!o)return;const x=document.createElement("a");x.href=o,x.download=l,x.click()},[a,o,l]);return h&&!d?e.jsxs("div",{className:m("relative w-full h-full",w),children:[r&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background z-10",children:e.jsxs("div",{className:"flex flex-col items-center gap-3",children:[e.jsx(P,{className:"w-8 h-8 animate-spin text-muted-foreground"}),e.jsx("div",{className:"text-sm text-muted-foreground",children:t("preview_loading")})]})}),e.jsx("iframe",{src:h,className:"w-full h-full border-0",onLoad:f,onError:b,title:l,sandbox:"allow-scripts allow-same-origin allow-popups"})]}):e.jsxs("div",{className:m("flex flex-col items-center justify-center h-full text-center p-8",w),children:[e.jsx("div",{className:m("w-24 h-24 rounded-lg flex items-center justify-center text-4xl font-bold text-white mb-6",u.color),children:u.icon}),e.jsx("h2",{className:"text-xl font-semibold text-foreground mb-2",children:l}),e.jsx("p",{className:"text-muted-foreground mb-6",children:t(u.labelKey)}),e.jsxs("div",{className:"flex items-center gap-2 text-sm text-amber-600 dark:text-amber-400 mb-6",children:[e.jsx(I,{className:"w-4 h-4"}),e.jsx("span",{children:t("preview_unavailable")})]}),e.jsx("div",{className:"flex gap-3",children:e.jsxs("button",{onClick:y,className:"flex items-center gap-2 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:[e.jsx(E,{className:"w-4 h-4"}),t("download")]})}),e.jsx("p",{className:"text-xs text-muted-foreground mt-8 max-w-md",children:t("help_text")})]})}const K={docx:{type:"word",icon:g,label:"Word Document",color:"text-blue-500"},doc:{type:"word",icon:g,label:"Word Document",color:"text-blue-500"},xlsx:{type:"excel",icon:j,label:"Excel Spreadsheet",color:"text-green-500"},xls:{type:"excel",icon:j,label:"Excel Spreadsheet",color:"text-green-500"},pptx:{type:"powerpoint",icon:_,label:"PowerPoint",color:"text-primary"},ppt:{type:"powerpoint",icon:_,label:"PowerPoint",color:"text-primary"},odt:{type:"opendocument",icon:g,label:"OpenDocument Text",color:"text-blue-400"},ods:{type:"opendocument",icon:j,label:"OpenDocument Spreadsheet",color:"text-green-400"},odp:{type:"opendocument",icon:_,label:"OpenDocument Presentation",color:"text-primary"}},S={type:"unknown",icon:g,label:"Document",color:"text-muted-foreground"};function D(o){return o.split(".").pop()?.toLowerCase()||""}function L(o){const l=D(o);return K[l]||S}function B(o){return o?o<1024?`${o} B`:o<1024*1024?`${(o/1024).toFixed(1)} KB`:`${(o/(1024*1024)).toFixed(1)} MB`:""}function W({context:o,tabId:l,setDirty:N,setTitle:c}){const{t:a}=v("doc_viewer"),[w,t]=n.useState(null),r=o.resourceName||o.resourcePath||"Document",i=D(r),d=n.useMemo(()=>L(r),[r]),p=o.customData?.size;n.useEffect(()=>{c(r)},[r,c]),n.useEffect(()=>{t(null)},[o.resourceId]);const u=n.useCallback(s=>{t(s)},[]),f=n.useCallback(()=>{o.resourceId&&(async()=>{try{const{downloadFileById:s}=await C(async()=>{const{downloadFileById:h}=await import("./index-
|
|
7
|
+
*/const F=[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]],_=k("presentation",F),O={docx:{icon:"W",color:"bg-blue-600",labelKey:"word_document"},doc:{icon:"W",color:"bg-blue-600",labelKey:"word_document"},xlsx:{icon:"X",color:"bg-green-600",labelKey:"excel_spreadsheet"},xls:{icon:"X",color:"bg-green-600",labelKey:"excel_spreadsheet"},pptx:{icon:"P",color:"bg-primary",labelKey:"powerpoint_presentation"},ppt:{icon:"P",color:"bg-primary",labelKey:"powerpoint_presentation"},odt:{icon:"OD",color:"bg-blue-500",labelKey:"open_document_text"},ods:{icon:"OD",color:"bg-green-500",labelKey:"open_document_spreadsheet"},odp:{icon:"OD",color:"bg-primary",labelKey:"open_document_presentation"}};function T({src:o,fileName:l,fileType:N,onError:c,onDownload:a,className:w}){const{t}=v("doc_viewer"),[r,i]=n.useState(!0),[d,p]=n.useState(!1),u=O[N.toLowerCase()]||{icon:"?",color:"bg-gray-600",labelKey:"document"},f=n.useCallback(()=>{i(!1)},[]),b=n.useCallback(()=>{i(!1),p(!0),c?.(t("preview_load_failed"))},[c,t]),h=o?(x=>null)(o):null,y=n.useCallback(()=>{if(a){a();return}if(!o)return;const x=document.createElement("a");x.href=o,x.download=l,x.click()},[a,o,l]);return h&&!d?e.jsxs("div",{className:m("relative w-full h-full",w),children:[r&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background z-10",children:e.jsxs("div",{className:"flex flex-col items-center gap-3",children:[e.jsx(P,{className:"w-8 h-8 animate-spin text-muted-foreground"}),e.jsx("div",{className:"text-sm text-muted-foreground",children:t("preview_loading")})]})}),e.jsx("iframe",{src:h,className:"w-full h-full border-0",onLoad:f,onError:b,title:l,sandbox:"allow-scripts allow-same-origin allow-popups"})]}):e.jsxs("div",{className:m("flex flex-col items-center justify-center h-full text-center p-8",w),children:[e.jsx("div",{className:m("w-24 h-24 rounded-lg flex items-center justify-center text-4xl font-bold text-white mb-6",u.color),children:u.icon}),e.jsx("h2",{className:"text-xl font-semibold text-foreground mb-2",children:l}),e.jsx("p",{className:"text-muted-foreground mb-6",children:t(u.labelKey)}),e.jsxs("div",{className:"flex items-center gap-2 text-sm text-amber-600 dark:text-amber-400 mb-6",children:[e.jsx(I,{className:"w-4 h-4"}),e.jsx("span",{children:t("preview_unavailable")})]}),e.jsx("div",{className:"flex gap-3",children:e.jsxs("button",{onClick:y,className:"flex items-center gap-2 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:[e.jsx(E,{className:"w-4 h-4"}),t("download")]})}),e.jsx("p",{className:"text-xs text-muted-foreground mt-8 max-w-md",children:t("help_text")})]})}const K={docx:{type:"word",icon:g,label:"Word Document",color:"text-blue-500"},doc:{type:"word",icon:g,label:"Word Document",color:"text-blue-500"},xlsx:{type:"excel",icon:j,label:"Excel Spreadsheet",color:"text-green-500"},xls:{type:"excel",icon:j,label:"Excel Spreadsheet",color:"text-green-500"},pptx:{type:"powerpoint",icon:_,label:"PowerPoint",color:"text-primary"},ppt:{type:"powerpoint",icon:_,label:"PowerPoint",color:"text-primary"},odt:{type:"opendocument",icon:g,label:"OpenDocument Text",color:"text-blue-400"},ods:{type:"opendocument",icon:j,label:"OpenDocument Spreadsheet",color:"text-green-400"},odp:{type:"opendocument",icon:_,label:"OpenDocument Presentation",color:"text-primary"}},S={type:"unknown",icon:g,label:"Document",color:"text-muted-foreground"};function D(o){return o.split(".").pop()?.toLowerCase()||""}function L(o){const l=D(o);return K[l]||S}function B(o){return o?o<1024?`${o} B`:o<1024*1024?`${(o/1024).toFixed(1)} KB`:`${(o/(1024*1024)).toFixed(1)} MB`:""}function W({context:o,tabId:l,setDirty:N,setTitle:c}){const{t:a}=v("doc_viewer"),[w,t]=n.useState(null),r=o.resourceName||o.resourcePath||"Document",i=D(r),d=n.useMemo(()=>L(r),[r]),p=o.customData?.size;n.useEffect(()=>{c(r)},[r,c]),n.useEffect(()=>{t(null)},[o.resourceId]);const u=n.useCallback(s=>{t(s)},[]),f=n.useCallback(()=>{o.resourceId&&(async()=>{try{const{downloadFileById:s}=await C(async()=>{const{downloadFileById:h}=await import("./index-CHzJ2xtB.js").then(y=>y.d8);return{downloadFileById:h}},__vite__mapDeps([0,1,2,3,4]));await s(o.resourceId,r)}catch(s){console.error("Failed to download document:",s),t("Failed to download document")}})()},[o.resourceId,r]),b=d.icon;return e.jsxs("div",{className:"flex flex-col h-full bg-background",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-border bg-muted/30",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(b,{className:m("w-4 h-4",d.color)}),e.jsx("span",{className:"text-sm text-foreground",children:r}),e.jsx("span",{className:"text-xs px-2 py-0.5 rounded bg-muted text-muted-foreground uppercase",children:i}),p&&e.jsx("span",{className:"text-xs text-muted-foreground",children:B(p)})]}),e.jsx("div",{className:"flex items-center gap-1",children:e.jsx("button",{onClick:f,className:"p-2 rounded hover:bg-accent transition-colors text-muted-foreground hover:text-foreground",title:a("download_document"),children:e.jsx(E,{className:"w-4 h-4"})})})]}),e.jsx("div",{className:"flex-1 overflow-hidden",children:o.resourceId?e.jsx(T,{src:"",fileName:r,fileType:i,onError:u,onDownload:f}):e.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center p-8",children:[e.jsx(b,{className:m("w-16 h-16 mb-4",d.color)}),e.jsx("h2",{className:"text-lg font-medium text-foreground mb-2",children:"No document selected"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Select a document file to view it here"})]})})]})}export{W as default};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{t as _,u as F,a as C,a5 as b,j as e,b as h,a6 as S,R as E,f as L,O as g}from"./index-CHzJ2xtB.js";import{r as n}from"./plugin-monaco-C8UgLomw.js";import{f as M,b as q,G as D}from"./GitSnapshotViewer-CweA6VON.js";import"./plugin-notebook-JRhysCqj.js";import"./plugin-terminal-MXFIPun8.js";/**
|
|
2
|
+
* @license lucide-react v0.511.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const G=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],P=_("git-commit-horizontal",G),k=m=>typeof m!="string"?null:m.trim()||null;function R({context:m,tabId:u,setTitle:w}){const{t:l}=F("workspace"),x=m.customData??{},j=C(a=>a.updateTabState),d=k(x.projectId),s=k(x.sha),[r,p]=n.useState(k(x.initialPath)),[o,v]=n.useState(x.initialMode==="snapshot"?"snapshot":"diff"),t=b({queryKey:["git-commit-viewer","commit",d,s],queryFn:()=>g.gitCommit(d,s),enabled:!!(d&&s),staleTime:3e4});n.useEffect(()=>{const a=t.data?.files||[];if(!a.length){r&&p(null);return}r&&a.some(N=>N.path===r)||p(a[0].path)},[t.data?.files,r]);const c=b({queryKey:["git-commit-viewer","diff",d,s,r],queryFn:()=>g.gitCommitFile(d,s,r),enabled:!!(d&&s&&r&&o==="diff"),staleTime:3e4}),i=b({queryKey:["git-commit-viewer","snapshot",d,s,r],queryFn:()=>g.openDocument(d,`git::${s}::${r}`),enabled:!!(d&&s&&r&&o==="snapshot"),staleTime:3e4}),y=n.useMemo(()=>t.data?.files?.find(a=>a.path===r)||null,[t.data?.files,r]),f=n.useMemo(()=>M(r||i.data?.path||void 0,y?.old_path||null,l("git_viewer_diff",void 0,"Diff")),[y?.old_path,r,i.data?.path,l]);return n.useEffect(()=>{const a=t.data?.subject||t.data?.short_sha||s||l("git_viewer_diff",void 0,"Commit");w(a)},[t.data?.short_sha,t.data?.subject,w,s,l]),n.useEffect(()=>{j(u,{contentKind:o==="snapshot"?"text":"code",documentMode:o,isReadOnly:!0,resourceName:f,resourcePath:r||void 0})},[f,r,u,j,o]),!d||!s?e.jsx("div",{className:"flex h-full items-center justify-center px-6 text-sm text-muted-foreground",children:l("git_viewer_missing_context",void 0,"Missing diff context.")}):e.jsxs("div",{"data-testid":"git-commit-viewer-plugin",className:"flex h-full min-h-0 flex-col bg-[rgba(250,248,244,0.86)] dark:bg-[rgba(18,20,24,0.92)]",children:[e.jsx("div",{className:"border-b border-black/[0.06] px-6 py-5 dark:border-white/[0.08]",children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:[e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(P,{className:"h-3.5 w-3.5"}),"Commit"]}),t.data?.short_sha?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:t.data.short_sha})]}):null]}),e.jsx("div",{className:"mt-2 break-words text-[24px] font-semibold tracking-[-0.03em] text-foreground",children:t.data?.subject||s}),e.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-3 text-sm text-muted-foreground",children:[t.data?.author_name?e.jsx("span",{children:t.data.author_name}):null,t.data?.authored_at?e.jsx("span",{children:t.data.authored_at}):null,typeof t.data?.file_count=="number"?e.jsxs("span",{children:[t.data.file_count," files"]}):null,typeof t.data?.stats?.added=="number"?e.jsxs("span",{className:"text-emerald-700 dark:text-emerald-300",children:["+",t.data.stats.added]}):null,typeof t.data?.stats?.removed=="number"?e.jsxs("span",{className:"text-rose-700 dark:text-rose-300",children:["-",t.data.stats.removed]}):null]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("div",{className:"flex items-center rounded-full border border-black/[0.08] bg-white/[0.86] p-1 dark:border-white/[0.1] dark:bg-white/[0.03]",children:[e.jsx("button",{type:"button",onClick:()=>v("snapshot"),className:h("rounded-full px-3 py-1.5 text-[12px] font-medium transition-colors",o==="snapshot"?"bg-black/[0.06] text-foreground dark:bg-white/[0.12]":"text-muted-foreground hover:text-foreground"),children:"Snapshot"}),e.jsx("button",{type:"button",onClick:()=>v("diff"),className:h("rounded-full px-3 py-1.5 text-[12px] font-medium transition-colors",o==="diff"?"bg-black/[0.06] text-foreground dark:bg-white/[0.12]":"text-muted-foreground hover:text-foreground"),children:"Diff"})]}),e.jsxs(S,{type:"button",size:"sm",variant:"outline",onClick:()=>{t.refetch(),c.refetch(),i.refetch()},className:"h-9 rounded-full border-black/[0.08] bg-white/[0.86] px-3 text-[12px] shadow-none hover:bg-black/[0.03] dark:border-white/[0.1] dark:bg-white/[0.03] dark:hover:bg-white/[0.06]",children:[e.jsx(E,{className:h("mr-1.5 h-3.5 w-3.5",(t.isFetching||c.isFetching||i.isFetching)&&"animate-spin")}),l("explorer_refresh")]})]})]})}),e.jsxs("div",{className:"grid min-h-0 flex-1 grid-cols-[280px_minmax(0,1fr)]",children:[e.jsxs("div",{className:"border-r border-black/[0.06] bg-white/[0.46] p-4 dark:border-white/[0.08] dark:bg-white/[0.02]",children:[e.jsx("div",{className:"mb-3 text-[11px] font-semibold uppercase tracking-[0.14em] text-muted-foreground",children:"Changed Files"}),e.jsx("div",{className:"space-y-2",children:(t.data?.files||[]).map(a=>e.jsxs("button",{type:"button",onClick:()=>p(a.path),className:h("w-full rounded-[18px] border px-3 py-3 text-left transition",r===a.path?"border-black/[0.12] bg-white shadow-sm dark:border-white/[0.12] dark:bg-white/[0.04]":"border-black/[0.06] bg-white/[0.72] hover:border-black/[0.1] dark:border-white/[0.08] dark:bg-white/[0.02]"),children:[e.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:a.path}),e.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-[11px] text-muted-foreground",children:[e.jsx("span",{children:a.status||"modified"}),typeof a.added=="number"?e.jsxs("span",{className:"text-emerald-700 dark:text-emerald-300",children:["+",a.added]}):null,typeof a.removed=="number"?e.jsxs("span",{className:"text-rose-700 dark:text-rose-300",children:["-",a.removed]}):null]})]},a.path))})]}),e.jsxs("div",{className:"min-h-0 overflow-hidden px-6 py-6",children:[r?o==="snapshot"?i.isLoading?e.jsx("div",{className:"text-sm leading-7 text-muted-foreground",children:"Loading snapshot…"}):i.isError?e.jsx("div",{className:"rounded-[20px] border border-rose-200/80 bg-rose-50/70 px-4 py-4 text-sm text-rose-700 dark:border-rose-400/20 dark:bg-rose-500/10 dark:text-rose-200",children:"Failed to load snapshot."}):e.jsx(q,{document:i.data,className:"border border-black/[0.06] bg-white/[0.92] shadow-none dark:border-white/[0.08] dark:bg-[rgba(24,26,31,0.92)]"}):c.isLoading?e.jsx("div",{className:"text-sm leading-7 text-muted-foreground",children:"Loading patch…"}):c.isError?e.jsx("div",{className:"rounded-[20px] border border-rose-200/80 bg-rose-50/70 px-4 py-4 text-sm text-rose-700 dark:border-rose-400/20 dark:bg-rose-500/10 dark:text-rose-200",children:"Failed to load diff."}):e.jsx(D,{diff:c.data,pathLabel:f,className:"border border-black/[0.06] bg-white/[0.92] shadow-none dark:border-white/[0.08] dark:bg-[rgba(24,26,31,0.92)]"}):e.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"Select one changed file to inspect this commit."}),t.data?.body?e.jsxs("div",{className:"mt-5 rounded-[20px] border border-black/[0.06] bg-white/[0.68] px-4 py-4 text-sm leading-7 text-muted-foreground dark:border-white/[0.08] dark:bg-white/[0.03]",children:[e.jsxs("div",{className:"mb-2 flex items-center gap-2 text-[11px] font-semibold uppercase tracking-[0.14em] text-muted-foreground",children:[e.jsx(L,{className:"h-3.5 w-3.5"}),"Body"]}),e.jsx("div",{className:"whitespace-pre-wrap",children:t.data.body})]}):null]})]})]})}export{R as default};
|
package/src/ui/dist/assets/{GitDiffViewerPlugin-CQACjoAA.js → GitDiffViewerPlugin-CAxjNorQ.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{t as ne,u as de,a as A,a5 as J,j as e,f as le,b as L,a6 as ce,R as he,a7 as fe,K as pe,O as G}from"./index-CHzJ2xtB.js";import{r as p}from"./plugin-monaco-C8UgLomw.js";import me from"./ImageViewerPlugin-C8wHGvGN.js";import ue from"./MarkdownViewerPlugin-Dy1NE2dI.js";import{N as xe}from"./NotebookEditor-CFHMq_Qt.js";import ge from"./PdfViewerPlugin-DgWsbInT.js";import{i as ve,a as Z,f as be,G as we,b as U}from"./GitSnapshotViewer-CweA6VON.js";import"./plugin-notebook-JRhysCqj.js";import"./plugin-terminal-MXFIPun8.js";import"./zoom-out-DAukFWen.js";import"./code-DbsmSd3Y.js";import"./NotebookEditor-WFyd8Ybt.js";import"./project-sync-DPmWKmKD.js";import"./index-BsO46tJA.js";import"./file-diff-panel-DsvyRz47.js";import"./file-socket-DA5XIx88.js";import"./PdfLoader-CLE5u5TS.js";import"./plugin-pdf-CR8hgQBV.js";/**
|
|
2
2
|
* @license lucide-react v0.511.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const _e=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]],ke=ne("git-compare",_e),X=s=>typeof s=="boolean"?s:null,Y=s=>typeof s=="number"&&Number.isFinite(s)?s:null,c=s=>typeof s!="string"?null:s.trim()||null,M=s=>!!(s&&"available"in s);function je({document:s,projectId:x,parentTabId:D}){const
|
|
6
|
+
*/const _e=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]],ke=ne("git-compare",_e),X=s=>typeof s=="boolean"?s:null,Y=s=>typeof s=="number"&&Number.isFinite(s)?s:null,c=s=>typeof s!="string"?null:s.trim()||null,M=s=>!!(s&&"available"in s);function je({document:s,projectId:x,parentTabId:D}){const r=A(f=>f.clearTabState),a=A(f=>f.clearTabReferences),h=p.useMemo(()=>Z(s),[s]),t=p.useMemo(()=>s?fe(x,s):null,[s,x]),o=p.useMemo(()=>`${D}::snapshot-preview::${h}`,[D,h]),b=p.useMemo(()=>{if(!t)return null;const f=t.path?pe(t.path):void 0,g={updatedAt:t.updatedAt,sizeBytes:t.size,mimeType:t.mimeType};return{context:{type:h==="notebook"?"notebook":"file",resourceId:t.id,resourceName:t.name,resourcePath:f,mimeType:t.mimeType,customData:{projectId:x,readonly:!0,readOnlyMode:!0,size:t.size,fileMeta:g}},tabId:o,setDirty:()=>{},setTitle:()=>{}}},[h,o,x,t]);return p.useEffect(()=>()=>{a(o),r(o)},[a,r,o]),!s||h==="plain"||!b?e.jsx(U,{document:s,className:"border border-black/[0.06] bg-white/[0.92] shadow-none dark:border-white/[0.08] dark:bg-[rgba(24,26,31,0.92)]"}):h==="markdown"?e.jsx("div",{className:"h-full min-h-0 overflow-hidden",children:e.jsx(ue,{...b})}):h==="notebook"?e.jsx("div",{className:"h-full min-h-0 overflow-hidden",children:e.jsx(xe,{...b,className:"h-full"})}):h==="pdf"?e.jsx("div",{className:"h-full min-h-0 overflow-hidden",children:e.jsx(ge,{...b})}):h==="image"?e.jsx("div",{className:"h-full min-h-0 overflow-hidden",children:e.jsx(me,{...b})}):e.jsx(U,{document:s,className:"border border-black/[0.06] bg-white/[0.92] shadow-none dark:border-white/[0.08] dark:bg-[rgba(24,26,31,0.92)]"})}function qe({context:s,tabId:x,setTitle:D}){const{t:r}=de("workspace"),a=s.customData??{},h=A(i=>i.updateTabState),t=c(a.projectId),o=a.resolver==="file_change"?"file_change":a.resolver==="git_commit"?"git_commit":"git",b=a.initialMode==="snapshot"?"snapshot":"diff",f=c(a.sha),g=c(a.base),w=c(a.head),l=c(a.path),_=c(a.queryPath),F=c(a.displayPath),k=c(a.runId),S=c(a.eventId),T=c(a.status),C=c(a.oldPath),B=Y(a.added),E=Y(a.removed),I=c(a.snapshotRevision),ee=c(a.snapshotDocumentId),R=o==="file_change"?!!(t&&k&&_):o==="git_commit"?!!(t&&f&&l):!!(t&&g&&w&&l),V=ee||(I&&l?`git::${I}::${l}`:null),q=!!(t&&V),te=X(a.allowSnapshot),ie=X(a.allowDiff),v=te??q,m=ie??R,[n,z]=p.useState(()=>b==="snapshot"&&v?"snapshot":"diff");p.useEffect(()=>{if(n==="snapshot"&&!v&&m){z("diff");return}n==="diff"&&!m&&v&&z("snapshot")},[m,v,n]);const u=J({queryKey:["git-diff-viewer","snapshot",t,V],queryFn:()=>G.openDocument(t,V),enabled:!!(t&&V&&v&&n==="snapshot"),staleTime:3e4}),P=J({queryKey:["git-diff-viewer","diff",o,t,f,g,w,l,_,k,S],queryFn:()=>o==="file_change"?G.fileChangeDiff(t,k,_,S||void 0):o==="git_commit"?G.gitCommitFile(t,f,l):G.gitDiffFile(t,g,w,l),enabled:!!(R&&m&&n==="diff"),staleTime:3e4}),d=p.useMemo(()=>{const i=P.data??null;return i&&(o==="file_change"?{...i,display_path:(M(i)?i.display_path:null)||F||void 0,run_id:M(i)?i.run_id||k||void 0:k||void 0,event_id:M(i)?i.event_id||S||void 0:S||void 0}:o==="git_commit"?l?{...i,path:l,sha:i?.sha||f||void 0,old_path:i.old_path||C||void 0,status:i.status||T||void 0,added:i.added??B??void 0,removed:i.removed??E??void 0}:i:!l||!g||!w?i:{...i,path:l,base:g,head:w,old_path:i.old_path||C||void 0,status:i.status||T||void 0,added:i.added??B??void 0,removed:i.removed??E??void 0})},[B,g,P.data,F,S,w,C,l,E,o,k,f,T]),j=d?.base||g||"",y=d?.head||w||"",K=c(d?.sha)||f||"",se=d?.status||T||"modified",ae=d?.old_path||C||null,Q=d?.added??B,H=d?.removed??E,O=p.useMemo(()=>ve(u.data),[u.data]),oe=p.useMemo(()=>Z(u.data),[u.data]),N=o==="file_change"?(M(d)?d.display_path:null)||F||d?.path||_||r("git_viewer_diff",void 0,"Diff"):be(l||d?.path||F,ae,r("git_viewer_diff",void 0,"Diff"));p.useEffect(()=>{D(N)},[N,D]),p.useEffect(()=>{h(x,{contentKind:n==="snapshot"?O:"code",documentMode:n,isReadOnly:!0,resourceName:N,resourcePath:n==="snapshot"?u.data?.path||l||void 0:d?.path||l||_||void 0})},[d?.path,l,_,N,O,u.data?.path,x,h,n]);const W=o==="file_change"&&M(d)&&!d.available?d.message||r("git_viewer_historical_patch_unavailable",void 0,"Historical patch unavailable."):null,$=n==="snapshot"?u:P,re=n==="snapshot"&&!!u.data&&oe!=="plain";return!t||!q&&!R?e.jsx("div",{className:"flex h-full items-center justify-center px-6 text-sm text-muted-foreground",children:r("git_viewer_missing_context",void 0,"Missing diff context.")}):e.jsxs("div",{"data-testid":"git-diff-viewer-plugin",className:"flex h-full min-h-0 flex-col bg-[rgba(250,248,244,0.86)] dark:bg-[rgba(18,20,24,0.92)]",children:[e.jsx("div",{className:"border-b border-black/[0.06] px-6 py-5 dark:border-white/[0.08]",children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:[e.jsxs("span",{className:"inline-flex items-center gap-1",children:[n==="snapshot"?e.jsx(le,{className:"h-3.5 w-3.5"}):e.jsx(ke,{className:"h-3.5 w-3.5"}),n==="snapshot"?r("git_viewer_snapshot",void 0,"Snapshot"):o==="file_change"?r("git_viewer_historical_diff",void 0,"Historical Diff"):r("git_viewer_diff",void 0,"Diff")]}),n==="diff"?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:se})]}):null]}),e.jsx("div",{className:"mt-2 break-words text-[24px] font-semibold tracking-[-0.03em] text-foreground",children:N}),e.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-3 text-sm text-muted-foreground",children:[n==="snapshot"?e.jsxs(e.Fragment,{children:[I?e.jsx("span",{children:I}):null,m&&o==="git_commit"&&K?e.jsx("span",{children:K}):null,m&&o!=="git_commit"&&j?e.jsx("span",{children:j}):null,m&&o!=="git_commit"&&j&&y?e.jsx("span",{children:"→"}):null,m&&o!=="git_commit"&&y?e.jsx("span",{children:y}):null]}):e.jsx(e.Fragment,{children:o==="git_commit"?K?e.jsx("span",{children:K}):null:e.jsxs(e.Fragment,{children:[j?e.jsx("span",{children:j}):null,j&&y?e.jsx("span",{children:"→"}):null,y?e.jsx("span",{children:y}):null]})}),Q!=null?e.jsxs("span",{className:"text-emerald-700 dark:text-emerald-300",children:["+",Q]}):null,H!=null?e.jsxs("span",{className:"text-rose-700 dark:text-rose-300",children:["-",H]}):null]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[v||m?e.jsxs("div",{className:"flex items-center rounded-full border border-black/[0.08] bg-white/[0.86] p-1 dark:border-white/[0.1] dark:bg-white/[0.03]",children:[v?e.jsx("button",{type:"button",onClick:()=>z("snapshot"),"data-testid":"git-diff-viewer-snapshot-toggle",className:L("rounded-full px-3 py-1.5 text-[12px] font-medium transition-colors",n==="snapshot"?"bg-black/[0.06] text-foreground dark:bg-white/[0.12]":"text-muted-foreground hover:text-foreground"),children:r("git_viewer_snapshot",void 0,"Snapshot")}):null,m?e.jsx("button",{type:"button",onClick:()=>z("diff"),"data-testid":"git-diff-viewer-diff-toggle",className:L("rounded-full px-3 py-1.5 text-[12px] font-medium transition-colors",n==="diff"?"bg-black/[0.06] text-foreground dark:bg-white/[0.12]":"text-muted-foreground hover:text-foreground"),children:r("git_viewer_diff",void 0,"Diff")}):null]}):null,e.jsxs(ce,{type:"button",size:"sm",variant:"outline",onClick:()=>{$.refetch()},className:"h-9 rounded-full border-black/[0.08] bg-white/[0.86] px-3 text-[12px] shadow-none hover:bg-black/[0.03] dark:border-white/[0.1] dark:bg-white/[0.03] dark:hover:bg-white/[0.06]",children:[e.jsx(he,{className:L("mr-1.5 h-3.5 w-3.5",$.isFetching&&"animate-spin")}),r("explorer_refresh")]})]})]})}),e.jsx("div",{className:L("min-h-0 flex-1 px-6 py-6",re?"overflow-hidden":"overflow-y-auto"),children:n==="snapshot"?!v||!q?e.jsx("div",{className:"rounded-[20px] border border-black/[0.08] bg-white/[0.82] px-4 py-4 text-sm leading-7 text-muted-foreground dark:border-white/[0.08] dark:bg-white/[0.04]",children:r("git_viewer_snapshot_unavailable",void 0,"Snapshot preview is unavailable for this file.")}):u.isLoading?e.jsx("div",{className:"text-sm leading-7 text-muted-foreground",children:r("git_viewer_loading_snapshot",void 0,"Loading snapshot…")}):u.isError?e.jsx("div",{className:"rounded-[20px] border border-rose-200/80 bg-rose-50/70 px-4 py-4 text-sm text-rose-700 dark:border-rose-400/20 dark:bg-rose-500/10 dark:text-rose-200",children:r("git_viewer_failed_snapshot",void 0,"Failed to load snapshot.")}):e.jsx(je,{document:u.data,projectId:t,parentTabId:x}):!m||!R?e.jsx("div",{className:"rounded-[20px] border border-black/[0.08] bg-white/[0.82] px-4 py-4 text-sm leading-7 text-muted-foreground dark:border-white/[0.08] dark:bg-white/[0.04]",children:r("git_viewer_diff_unavailable",void 0,"Diff preview is unavailable for this file.")}):P.isLoading?e.jsx("div",{className:"text-sm leading-7 text-muted-foreground",children:r("git_viewer_loading_diff",void 0,"Loading patch…")}):P.isError?e.jsx("div",{className:"rounded-[20px] border border-rose-200/80 bg-rose-50/70 px-4 py-4 text-sm text-rose-700 dark:border-rose-400/20 dark:bg-rose-500/10 dark:text-rose-200",children:r("git_viewer_failed_diff",void 0,"Failed to load diff.")}):W?e.jsx("div",{className:"rounded-[20px] border border-black/[0.08] bg-white/[0.82] px-4 py-4 text-sm leading-7 text-muted-foreground dark:border-white/[0.08] dark:bg-white/[0.04]",children:W}):e.jsx(we,{diff:d,pathLabel:N,className:"border border-black/[0.06] bg-white/[0.92] shadow-none dark:border-white/[0.08] dark:bg-[rgba(24,26,31,0.92)]"})})]})}export{qe as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{am as Br,B as We,an as Fr,ao as Rr,j as g,u as Xn,b as Ce}from"./index-CHzJ2xtB.js";import{r as E}from"./plugin-monaco-C8UgLomw.js";function Jn(e){const r=String(e||"").trim();if(!r)return"";const n=r.split("/").filter(Boolean);return n[n.length-1]||r}function Lr(e){const r=Jn(e?.path),n=String(e?.mime_type||"").trim();return(n?Fr(n):void 0)||(r?Rr(r):void 0)||null}function is(e){const r=Lr(e),n=Jn(e?.path).toLowerCase();return n.endsWith(".md")||n.endsWith(".markdown")||n.endsWith(".mdx")?"markdown":r===We.PDF_VIEWER?"pdf":r===We.IMAGE_VIEWER?"image":r===We.NOTEBOOK?"notebook":"plain"}function ss(e){return Br({mimeType:e?.mime_type,resourceName:e?.path,resourcePath:e?.path})||"file"}function Ur(e,r,n="Diff"){return e&&r&&e!==r?`${r} → ${e}`:e||n}function _n(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,t)}return n}function D(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?_n(Object(n),!0).forEach(function(t){Ze(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_n(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ze(e,r,n){return(r=function(t){var a=function(i,s){if(typeof i!="object"||i===null)return i;var o=i[Symbol.toPrimitive];if(o!==void 0){var u=o.call(i,s);if(typeof u!="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(i)}(t,"string");return typeof a=="symbol"?a:String(a)}(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function X(e,r){if(e==null)return{};var n,t,a=function(s,o){if(s==null)return{};var u,l,c={},f=Object.keys(s);for(l=0;l<f.length;l++)u=f[l],o.indexOf(u)>=0||(c[u]=s[u]);return c}(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(t=0;t<i.length;t++)n=i[t],r.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function T(e,r){return Qn(e)||function(n,t){var a=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(a!=null){var i,s,o,u,l=[],c=!0,f=!1;try{if(o=(a=a.call(n)).next,t===0){if(Object(a)!==a)return;c=!1}else for(;!(c=(i=o.call(a)).done)&&(l.push(i.value),l.length!==t);c=!0);}catch(h){f=!0,s=h}finally{try{if(!c&&a.return!=null&&(u=a.return(),Object(u)!==u))return}finally{if(f)throw s}}return l}}(e,r)||De(e,r)||qn()}function Zn(e){return Qn(e)||Yn(e)||De(e)||qn()}function G(e){return function(r){if(Array.isArray(r))return Qe(r)}(e)||Yn(e)||De(e)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Qn(e){if(Array.isArray(e))return e}function Yn(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function De(e,r){if(e){if(typeof e=="string")return Qe(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Qe(e,r):void 0}}function Qe(e,r){(r==null||r>e.length)&&(r=e.length);for(var n=0,t=new Array(r);n<r;n++)t[n]=e[n];return t}function qn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
3
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function an(e,r){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=De(e))||r){n&&(e=n);var t=0,a=function(){};return{s:a,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(u){throw u},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
4
4
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,s=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var u=n.next();return s=u.done,u},e:function(u){o=!0,i=u},f:function(){try{s||n.return==null||n.return()}finally{if(o)throw i}}}}var _e=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ve(e,r){return e(r={exports:{}},r.exports),r.exports}var $=ve(function(e){/*!
|
|
@@ -27,4 +27,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
27
27
|
`):r.startsWith("--- ")||r.startsWith("Binary files ")?[`diff --git a/${n} b/${t}`,...e.lines].join(`
|
|
28
28
|
`):qi(e)}function es(e,r){const n="display_path"in e&&typeof e.display_path=="string"&&e.display_path.trim()?e.display_path.trim():e.path;return Ur(n,e.old_path,r)}function ns(e){if(!e.trim())return null;try{return Wr(e,{nearbySequences:"zip"})[0]??null}catch{return null}}function us({diff:e,className:r,pathLabel:n}){const{t}=Xn("workspace"),a=E.useMemo(()=>e?xi(e):"",[e]),i=E.useMemo(()=>ns(a),[a]),s=E.useMemo(()=>{if(!i?.hunks.length)return null;try{return Zi(i.hunks,{enhancers:[Xi(i.hunks,{type:"line"})]})}catch{return null}},[i]),o=e?n||es(e,t("git_viewer_diff",void 0,"Diff")):null;return e?e.binary?g.jsx("div",{"data-testid":"git-unified-diff-viewer",className:Ce("ds-stage-diff-shell",r),children:g.jsx("div",{className:"ds-stage-diff-filehead",children:g.jsxs("div",{className:"min-w-0",children:[g.jsx("div",{className:"truncate text-[13px] font-medium text-foreground",children:o}),g.jsx("div",{className:"mt-1 text-[11px] text-muted-foreground",children:t("git_diff_binary_changed",void 0,"Binary file changed.")})]})})}):!i||!i.hunks.length?g.jsxs("div",{"data-testid":"git-unified-diff-viewer",className:Ce("ds-stage-diff-shell",r),children:[g.jsxs("div",{className:"ds-stage-diff-filehead",children:[g.jsxs("div",{className:"min-w-0",children:[g.jsx("div",{className:"truncate text-[13px] font-medium text-foreground",children:o}),g.jsx("div",{className:"mt-1 text-[11px] text-muted-foreground",children:String(e.status||"modified")})]}),g.jsxs("div",{className:"flex items-center gap-3 text-[11px]",children:[g.jsxs("span",{className:"text-emerald-700 dark:text-emerald-300",children:["+",e.added||0]}),g.jsxs("span",{className:"text-rose-700 dark:text-rose-300",children:["-",e.removed||0]})]})]}),g.jsx("div",{className:"feed-scrollbar overflow-x-auto overflow-y-visible",children:g.jsx("pre",{className:"min-w-max px-4 py-3 font-mono text-[12px] leading-6 text-foreground",children:e.lines.join(`
|
|
29
29
|
`)||t("git_diff_no_patch_lines",void 0,"No patch lines available.")})})]}):g.jsxs("div",{"data-testid":"git-unified-diff-viewer",className:Ce("ds-stage-diff-shell",r),children:[g.jsxs("div",{className:"ds-stage-diff-filehead",children:[g.jsxs("div",{className:"min-w-0",children:[g.jsx("div",{className:"truncate text-[13px] font-medium text-foreground",children:o}),g.jsxs("div",{className:"mt-1 text-[11px] text-muted-foreground",children:[String(e.status||"modified")," · ",e.base," → ",e.head]})]}),g.jsxs("div",{className:"flex items-center gap-3 text-[11px]",children:[g.jsxs("span",{className:"text-emerald-700 dark:text-emerald-300",children:["+",e.added||0]}),g.jsxs("span",{className:"text-rose-700 dark:text-rose-300",children:["-",e.removed||0]})]})]}),g.jsx("div",{className:"feed-scrollbar overflow-x-auto overflow-y-visible",children:g.jsx("div",{className:"min-w-max",children:g.jsx(di,{viewType:"unified",diffType:i.type||Qi(e.status),hunks:i.hunks,gutterType:"default",tokens:s,className:"ds-github-diff-table",children:u=>u.flatMap(l=>[g.jsx(mi,{children:g.jsx("div",{className:"ds-github-diff-hunk",children:l.content})},`decoration-${l.content}`),g.jsx(Cr,{hunk:l},`hunk-${l.content}`)])})})}),e.truncated?g.jsx("div",{className:"border-t border-black/[0.06] px-4 py-2 text-[11px] text-muted-foreground dark:border-white/[0.08]",children:t("git_diff_patch_truncated",void 0,"Patch output is truncated.")}):null]}):g.jsx("div",{className:"text-sm leading-7 text-muted-foreground",children:t("git_diff_none_selected",void 0,"No patch selected.")})}function rs(e){const r=e?.meta?.git_revision;return typeof r=="string"&&r.trim()?r.trim():String(e?.revision||"").trim()||null}function os({document:e,className:r}){const{t:n}=Xn("workspace"),t=E.useMemo(()=>String(e?.content||"").split(`
|
|
30
|
-
`),[e?.content]),a=rs(e),i=!e?.content&&!e?.encoding&&Number(e?.size_bytes||0)>0;return e?g.jsxs("div",{"data-testid":"git-snapshot-viewer",className:Ce("ds-stage-diff-shell",r),children:[g.jsx("div",{className:"ds-stage-diff-filehead",children:g.jsxs("div",{className:"min-w-0",children:[g.jsx("div",{className:"truncate text-[13px] font-medium text-foreground",children:e.path||e.title||n("git_viewer_snapshot",void 0,"Snapshot")}),g.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-[11px] text-muted-foreground",children:[g.jsx("span",{children:n("git_snapshot_meta_label",void 0,"Snapshot")}),a?g.jsxs("span",{children:["· ",a]}):null,e.mime_type?g.jsxs("span",{children:["· ",e.mime_type]}):null,typeof e.size_bytes=="number"?g.jsxs("span",{children:["· ",e.size_bytes," bytes"]}):null]})]})}),i?g.jsx("div",{className:"px-4 py-8 text-sm text-muted-foreground",children:n("git_snapshot_binary_unavailable",void 0,"Snapshot preview is unavailable for binary files.")}):g.jsx("div",{className:"feed-scrollbar overflow-x-auto overflow-y-visible",children:g.jsx("div",{className:"min-w-max",children:t.length===1&&t[0]===""?g.jsx("div",{className:"px-4 py-6 font-mono text-[12px] leading-6 text-muted-foreground",children:n("git_snapshot_empty_file",void 0,"File is empty.")}):t.map((s,o)=>g.jsxs("div",{className:"grid grid-cols-[64px_minmax(0,1fr)] border-b border-black/[0.05] font-mono text-[12px] leading-6 text-foreground last:border-b-0 dark:border-white/[0.06]",children:[g.jsx("div",{className:"select-none border-r border-black/[0.06] bg-black/[0.02] px-3 py-0.5 text-right text-[11px] text-muted-foreground dark:border-white/[0.06] dark:bg-white/[0.03]",children:o+1}),g.jsx("div",{className:"whitespace-pre px-4 py-0.5",children:s||" "})]},`snapshot-line-${o+1}`))})})]}):g.jsx("div",{className:"text-sm leading-7 text-muted-foreground",children:n("git_snapshot_none_selected",void 0,"No snapshot selected.")})}export{
|
|
30
|
+
`),[e?.content]),a=rs(e),i=!e?.content&&!e?.encoding&&Number(e?.size_bytes||0)>0;return e?g.jsxs("div",{"data-testid":"git-snapshot-viewer",className:Ce("ds-stage-diff-shell",r),children:[g.jsx("div",{className:"ds-stage-diff-filehead",children:g.jsxs("div",{className:"min-w-0",children:[g.jsx("div",{className:"truncate text-[13px] font-medium text-foreground",children:e.path||e.title||n("git_viewer_snapshot",void 0,"Snapshot")}),g.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-[11px] text-muted-foreground",children:[g.jsx("span",{children:n("git_snapshot_meta_label",void 0,"Snapshot")}),a?g.jsxs("span",{children:["· ",a]}):null,e.mime_type?g.jsxs("span",{children:["· ",e.mime_type]}):null,typeof e.size_bytes=="number"?g.jsxs("span",{children:["· ",e.size_bytes," bytes"]}):null]})]})}),i?g.jsx("div",{className:"px-4 py-8 text-sm text-muted-foreground",children:n("git_snapshot_binary_unavailable",void 0,"Snapshot preview is unavailable for binary files.")}):g.jsx("div",{className:"feed-scrollbar overflow-x-auto overflow-y-visible",children:g.jsx("div",{className:"min-w-max",children:t.length===1&&t[0]===""?g.jsx("div",{className:"px-4 py-6 font-mono text-[12px] leading-6 text-muted-foreground",children:n("git_snapshot_empty_file",void 0,"File is empty.")}):t.map((s,o)=>g.jsxs("div",{className:"grid grid-cols-[64px_minmax(0,1fr)] border-b border-black/[0.05] font-mono text-[12px] leading-6 text-foreground last:border-b-0 dark:border-white/[0.06]",children:[g.jsx("div",{className:"select-none border-r border-black/[0.06] bg-black/[0.02] px-3 py-0.5 text-right text-[11px] text-muted-foreground dark:border-white/[0.06] dark:bg-white/[0.03]",children:o+1}),g.jsx("div",{className:"whitespace-pre px-4 py-0.5",children:s||" "})]},`snapshot-line-${o+1}`))})})]}):g.jsx("div",{className:"text-sm leading-7 text-muted-foreground",children:n("git_snapshot_none_selected",void 0,"No snapshot selected.")})}export{us as G,is as a,os as b,Ur as f,ss as i};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
2
|
-
import{
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CHzJ2xtB.js","assets/plugin-monaco-C8UgLomw.js","assets/plugin-terminal-MXFIPun8.js","assets/plugin-notebook-JRhysCqj.js","assets/index-DH-zxoZ3.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as O,j as e,b as z,al as F,aA as P,aB as Z,a0 as V,L as q,_ as G}from"./index-CHzJ2xtB.js";import{r as t}from"./plugin-monaco-C8UgLomw.js";import{Z as K,a as J}from"./zoom-out-DAukFWen.js";import"./plugin-notebook-JRhysCqj.js";import"./plugin-terminal-MXFIPun8.js";/**
|
|
3
3
|
* @license lucide-react v0.511.0 - ISC
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the ISC license.
|
|
@@ -14,13 +14,13 @@ import{y as O,j as e,b as z,am as Z,an as B,a3 as V,L as q,_ as G}from"./index-C
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the ISC license.
|
|
16
16
|
* See the LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/const se=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],re=O("rotate-cw",se),$=.1,H=10,Y=.1;function ne({src:r,alt:E,onLoad:
|
|
17
|
+
*/const se=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],re=O("rotate-cw",se),$=.1,H=10,Y=.1;function ne({src:r,alt:E,onLoad:y,onError:N,rotation:f,className:C}){const[v,x]=t.useState(!0),[s,l]=t.useState({scale:1,translateX:0,translateY:0}),[c,p]=t.useState(!1),[d,j]=t.useState({x:0,y:0}),m=t.useRef(null),u=t.useRef(null);t.useEffect(()=>{l({scale:1,translateX:0,translateY:0}),x(!0)},[r]);const k=t.useCallback(()=>{x(!1),u.current&&y&&y({width:u.current.width,height:u.current.height,naturalWidth:u.current.naturalWidth,naturalHeight:u.current.naturalHeight})},[y]),i=t.useCallback(()=>{x(!1),N?.()},[N]);t.useCallback(()=>{l(a=>({...a,scale:Math.min(a.scale+Y,H)}))},[]),t.useCallback(()=>{l(a=>({...a,scale:Math.max(a.scale-Y,$)}))},[]);const I=t.useCallback(()=>{l({scale:1,translateX:0,translateY:0})},[]);t.useCallback(()=>{if(!m.current||!u.current)return;const a=m.current.getBoundingClientRect(),o=u.current,b=o.naturalWidth,h=o.naturalHeight,R=(a.width-40)/b,D=(a.height-40)/h,X=Math.min(R,D,1);l({scale:X,translateX:0,translateY:0})},[]);const L=t.useCallback(a=>{a.preventDefault();const o=a.deltaY>0?-Y:Y,b=Math.max($,Math.min(H,s.scale+o));if(m.current){const h=m.current.getBoundingClientRect(),R=a.clientX-h.left-h.width/2,D=a.clientY-h.top-h.height/2,X=b/s.scale,A=R-X*(R-s.translateX),B=D-X*(D-s.translateY);l({scale:b,translateX:A,translateY:B})}else l(h=>({...h,scale:b}))},[s]),_=t.useCallback(a=>{a.button===0&&(a.preventDefault(),p(!0),j({x:a.clientX-s.translateX,y:a.clientY-s.translateY}))},[s.translateX,s.translateY]),U=t.useCallback(a=>{c&&(a.preventDefault(),l(o=>({...o,translateX:a.clientX-d.x,translateY:a.clientY-d.y})))},[c,d]),M=t.useCallback(()=>{p(!1)},[]),S=t.useCallback(a=>{if(a.touches.length===1){const o=a.touches[0];p(!0),j({x:o.clientX-s.translateX,y:o.clientY-s.translateY})}},[s.translateX,s.translateY]),n=t.useCallback(a=>{if(!c||a.touches.length!==1)return;const o=a.touches[0];l(b=>({...b,translateX:o.clientX-d.x,translateY:o.clientY-d.y}))},[c,d]),g=t.useCallback(()=>{p(!1)},[]),T=t.useCallback(()=>{I()},[I]),w=`
|
|
18
18
|
translate(${s.translateX}px, ${s.translateY}px)
|
|
19
19
|
scale(${s.scale})
|
|
20
20
|
rotate(${f}deg)
|
|
21
|
-
`;return e.jsxs("div",{ref:m,className:z("relative w-full h-full overflow-hidden select-none",c?"cursor-grabbing":"cursor-grab",C),onWheel:L,onMouseDown:_,onMouseMove:U,onMouseUp:M,onMouseLeave:M,onTouchStart:S,onTouchMove:n,onTouchEnd:g,onDoubleClick:T,children:[v&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsx("div",{className:"w-8 h-8 border-2 border-primary border-t-transparent rounded-full animate-spin"})}),e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsx("img",{ref:u,src:r,alt:E,className:z("max-w-none transition-transform duration-100",v&&"opacity-0"),style:{transform:
|
|
21
|
+
`;return e.jsxs("div",{ref:m,className:z("relative w-full h-full overflow-hidden select-none",c?"cursor-grabbing":"cursor-grab",C),onWheel:L,onMouseDown:_,onMouseMove:U,onMouseUp:M,onMouseLeave:M,onTouchStart:S,onTouchMove:n,onTouchEnd:g,onDoubleClick:T,children:[v&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsx("div",{className:"w-8 h-8 border-2 border-primary border-t-transparent rounded-full animate-spin"})}),e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsx("img",{ref:u,src:r,alt:E,className:z("max-w-none transition-transform duration-100",v&&"opacity-0"),style:{transform:w,transformOrigin:"center center"},onLoad:k,onError:i,draggable:!1})}),e.jsxs("div",{className:"absolute bottom-4 left-4 px-2 py-1 bg-background/80 backdrop-blur rounded text-xs text-muted-foreground",children:[Math.round(s.scale*100),"%"]})]})}const oe="https://via.placeholder.com/1920x1080?text=DeepScientist+Image+Viewer";function le(r){return r?r<1024?`${r} B`:r<1024*1024?`${(r/1024).toFixed(1)} KB`:`${(r/(1024*1024)).toFixed(1)} MB`:"Unknown"}function W(r){return(r.split(".").pop()?.toLowerCase()||"").toUpperCase()}function xe({context:r,tabId:E,setDirty:y,setTitle:N}){const[f,C]=t.useState(""),[v,x]=t.useState(!0),[s,l]=t.useState(null),[c,p]=t.useState(null),[d,j]=t.useState(0),[m,u]=t.useState(!1),k=t.useRef(null),i=r.resourceName||r.resourcePath||"Image";t.useEffect(()=>{N(i)},[i,N]),t.useEffect(()=>{let n=!1,g=null;return x(!0),l(null),r.resourceId?((async()=>{try{const{createFileObjectUrl:w}=await G(async()=>{const{createFileObjectUrl:a}=await import("./index-CHzJ2xtB.js").then(o=>o.d8);return{createFileObjectUrl:a}},__vite__mapDeps([0,1,2,3,4]));if(g=await w(r.resourceId),n){URL.revokeObjectURL(g);return}C(g)}catch(w){console.error("Failed to get image URL:",w),l("Failed to load image"),x(!1)}})(),()=>{n=!0,g&&URL.revokeObjectURL(g)}):(C(oe),()=>{n=!0})},[r.resourceId]);const I=t.useCallback(n=>{x(!1),p(n)},[]),L=t.useCallback(()=>{x(!1),l("Failed to load image")},[]),_=t.useCallback(()=>{j(n=>(n-90)%360)},[]),U=t.useCallback(()=>{j(n=>(n+90)%360)},[]);t.useCallback(()=>{j(0)},[]);const M=t.useCallback(()=>{if(!f)return;const n=document.createElement("a");n.href=f,n.download=i,n.click()},[f,i]),S=r.customData?.size;return s&&!v?e.jsxs("div",{className:"flex flex-col h-full bg-background",children:[e.jsx("div",{className:"flex items-center px-4 py-2 border-b border-border bg-muted/30",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(F,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm text-foreground",children:i})]})}),e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[e.jsx(ee,{className:"w-16 h-16 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-lg font-medium text-foreground",children:"Failed to load image"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:s})]}),e.jsx("button",{className:"px-4 py-2 text-sm bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",onClick:()=>window.location.reload(),children:"Retry"})]})})]}):e.jsxs("div",{className:"flex flex-col h-full bg-muted/30",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-border bg-background",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(F,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm text-foreground",children:i}),e.jsx("span",{className:"text-xs px-2 py-0.5 rounded bg-muted text-muted-foreground",children:W(i)}),c&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:[c.naturalWidth," x ",c.naturalHeight]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{onClick:()=>k.current?.zoomOut?.(),className:"p-2 rounded hover:bg-accent transition-colors text-muted-foreground hover:text-foreground",title:"Zoom out",children:e.jsx(K,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>k.current?.resetTransform?.(),className:"p-2 rounded hover:bg-accent transition-colors text-muted-foreground hover:text-foreground",title:"Reset zoom (double-click image)",children:e.jsx(ae,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>k.current?.zoomIn?.(),className:"p-2 rounded hover:bg-accent transition-colors text-muted-foreground hover:text-foreground",title:"Zoom in",children:e.jsx(J,{className:"w-4 h-4"})}),e.jsx("div",{className:"w-px h-6 bg-border mx-1"}),e.jsx("button",{onClick:_,className:"p-2 rounded hover:bg-accent transition-colors text-muted-foreground hover:text-foreground",title:"Rotate left",children:e.jsx(P,{className:"w-4 h-4"})}),e.jsx("button",{onClick:U,className:"p-2 rounded hover:bg-accent transition-colors text-muted-foreground hover:text-foreground",title:"Rotate right",children:e.jsx(re,{className:"w-4 h-4"})}),e.jsx("div",{className:"w-px h-6 bg-border mx-1"}),e.jsx("button",{onClick:()=>u(!m),className:z("p-2 rounded transition-colors",m?"bg-primary text-primary-foreground":"hover:bg-accent text-muted-foreground hover:text-foreground"),title:"Image info",children:e.jsx(Z,{className:"w-4 h-4"})}),e.jsx("button",{onClick:M,className:"p-2 rounded hover:bg-accent transition-colors text-muted-foreground hover:text-foreground",title:"Download image",children:e.jsx(V,{className:"w-4 h-4"})})]})]}),e.jsxs("div",{className:"flex-1 relative overflow-hidden bg-[#1a1a1a]",children:[e.jsx("div",{className:"absolute inset-0 opacity-20",style:{backgroundImage:`
|
|
22
22
|
linear-gradient(45deg, #808080 25%, transparent 25%),
|
|
23
23
|
linear-gradient(-45deg, #808080 25%, transparent 25%),
|
|
24
24
|
linear-gradient(45deg, transparent 75%, #808080 75%),
|
|
25
25
|
linear-gradient(-45deg, transparent 75%, #808080 75%)
|
|
26
|
-
`,backgroundSize:"20px 20px",backgroundPosition:"0 0, 0 10px, 10px -10px, -10px 0px"}}),v&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-10",children:e.jsx(q,{className:"w-8 h-8 animate-spin text-muted-foreground"})}),f&&e.jsx(ne,{src:f,alt:i,rotation:d,onLoad:I,onError:L}),m&&c&&e.jsxs("div",{className:"absolute top-4 right-4 p-4 bg-background/90 backdrop-blur rounded-lg shadow-lg border border-border",children:[e.jsx("h3",{className:"font-medium text-foreground mb-3",children:"Image Information"}),e.jsxs("dl",{className:"space-y-2 text-sm",children:[e.jsxs("div",{className:"flex justify-between gap-8",children:[e.jsx("dt",{className:"text-muted-foreground",children:"Filename"}),e.jsx("dd",{className:"text-foreground font-mono",children:i})]}),e.jsxs("div",{className:"flex justify-between gap-8",children:[e.jsx("dt",{className:"text-muted-foreground",children:"Dimensions"}),e.jsxs("dd",{className:"text-foreground font-mono",children:[c.naturalWidth," x ",c.naturalHeight]})]}),e.jsxs("div",{className:"flex justify-between gap-8",children:[e.jsx("dt",{className:"text-muted-foreground",children:"Format"}),e.jsx("dd",{className:"text-foreground font-mono",children:W(i)})]}),S&&e.jsxs("div",{className:"flex justify-between gap-8",children:[e.jsx("dt",{className:"text-muted-foreground",children:"Size"}),e.jsx("dd",{className:"text-foreground font-mono",children:le(S)})]}),d!==0&&e.jsxs("div",{className:"flex justify-between gap-8",children:[e.jsx("dt",{className:"text-muted-foreground",children:"Rotation"}),e.jsxs("dd",{className:"text-foreground font-mono",children:[d,"deg"]})]})]})]})]}),e.jsx("div",{className:"flex items-center justify-center gap-2 px-4 py-2 border-t border-border bg-background",children:e.jsx("span",{className:"text-xs text-muted-foreground",children:"Scroll to zoom | Drag to pan | Double-click to reset"})})]})}export{
|
|
26
|
+
`,backgroundSize:"20px 20px",backgroundPosition:"0 0, 0 10px, 10px -10px, -10px 0px"}}),v&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-10",children:e.jsx(q,{className:"w-8 h-8 animate-spin text-muted-foreground"})}),f&&e.jsx(ne,{src:f,alt:i,rotation:d,onLoad:I,onError:L}),m&&c&&e.jsxs("div",{className:"absolute top-4 right-4 p-4 bg-background/90 backdrop-blur rounded-lg shadow-lg border border-border",children:[e.jsx("h3",{className:"font-medium text-foreground mb-3",children:"Image Information"}),e.jsxs("dl",{className:"space-y-2 text-sm",children:[e.jsxs("div",{className:"flex justify-between gap-8",children:[e.jsx("dt",{className:"text-muted-foreground",children:"Filename"}),e.jsx("dd",{className:"text-foreground font-mono",children:i})]}),e.jsxs("div",{className:"flex justify-between gap-8",children:[e.jsx("dt",{className:"text-muted-foreground",children:"Dimensions"}),e.jsxs("dd",{className:"text-foreground font-mono",children:[c.naturalWidth," x ",c.naturalHeight]})]}),e.jsxs("div",{className:"flex justify-between gap-8",children:[e.jsx("dt",{className:"text-muted-foreground",children:"Format"}),e.jsx("dd",{className:"text-foreground font-mono",children:W(i)})]}),S&&e.jsxs("div",{className:"flex justify-between gap-8",children:[e.jsx("dt",{className:"text-muted-foreground",children:"Size"}),e.jsx("dd",{className:"text-foreground font-mono",children:le(S)})]}),d!==0&&e.jsxs("div",{className:"flex justify-between gap-8",children:[e.jsx("dt",{className:"text-muted-foreground",children:"Rotation"}),e.jsxs("dd",{className:"text-foreground font-mono",children:[d,"deg"]})]})]})]})]}),e.jsx("div",{className:"flex items-center justify-center gap-2 px-4 py-2 border-t border-border bg-background",children:e.jsx("span",{className:"text-xs text-muted-foreground",children:"Scroll to zoom | Drag to pan | Double-click to reset"})})]})}export{xe as default};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import{t as et,j as e,aC as se,aD as ta,aE as wt,a6 as Me,aF as aa,ae as sa,J as it,a5 as le,aG as na,aH as ue,O as _t,aI as ia,u as Re,au as He,aJ as ut,aK as Xe,aL as Nt,aM as jt,aN as ra,aO as la,aP as oa,aQ as ca,b as ie,aR as Je,aS as Ze,aT as Kt,aU as Ft,aV as Ot,ax as Ue,h as ua,aW as ht,ap as Ye,aX as St,aY as da,R as $e,aZ as qt,a_ as ma,a$ as va,z as rt,b0 as Et,b1 as Ct,b2 as ha,b3 as xa,b4 as ba,b5 as pa,b6 as fa,b7 as ga,b8 as ya,b9 as wa,B as _a,ba as Na,aq as ja,ar as Sa,bb as qa,bc as Ea,bd as Ca}from"./index-CHzJ2xtB.js";import{r as i}from"./plugin-monaco-C8UgLomw.js";import{u as lt}from"./cli-store-CoZ-x5Ip.js";import"./plugin-notebook-JRhysCqj.js";import"./plugin-terminal-MXFIPun8.js";/**
|
|
2
|
+
* @license lucide-react v0.511.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const Ta=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],ot=et("bot",Ta);/**
|
|
7
|
+
* @license lucide-react v0.511.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const La=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],Aa=et("inbox",La);/**
|
|
12
|
+
* @license lucide-react v0.511.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const Pa=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],ka=et("layout-dashboard",Pa);/**
|
|
17
|
+
* @license lucide-react v0.511.0 - ISC
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the ISC license.
|
|
20
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/const Ma=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],Qt=et("moon",Ma);function Se({title:t,children:a}){return e.jsxs("div",{className:"rounded-[8px] border border-[var(--lab-border)] bg-[var(--lab-surface)] px-4 py-3",children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-[0.12em] text-[var(--lab-text-secondary)]",children:t}),e.jsx("div",{className:"mt-2",children:a})]})}function ke({label:t,paths:a,onOpenPath:s}){return a.length?e.jsxs("div",{children:[e.jsx("div",{className:"text-[11px] font-semibold text-[var(--lab-text-secondary)]",children:t}),e.jsx("div",{className:"mt-1 space-y-1",children:a.map(l=>e.jsxs("div",{className:"flex items-center gap-2 rounded-[6px] bg-[var(--lab-background)] px-2 py-1.5",children:[e.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px] text-[var(--lab-text-primary)]",title:l,children:l}),s?e.jsx(Me,{type:"button",variant:"outline",size:"sm",className:"h-6 px-2 text-[10px]",onClick:()=>s(l),children:"Open"}):null]},`${t}:${l}`))})]}):null}function Ba({node:t,onOpenPath:a}){const s=[...t.parentNodeIds,...t.relatedNodeIds],l=t.inputPaths.length||t.logPaths.length||t.outputPaths.length||t.validationPaths.length||t.evidencePaths.length;return e.jsxs("div",{className:"space-y-3","data-testid":"science-node-detail",children:[e.jsxs(Se,{title:ta(t.nodeType),children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(se,{variant:"outline",children:t.status}),t.claimType?e.jsx(se,{variant:"outline",children:t.claimType}):null,t.trust?e.jsxs(se,{variant:"outline",children:["trust: ",t.trust]}):null]}),e.jsx("div",{className:"mt-3 text-sm font-semibold text-[var(--lab-text-primary)]",children:t.title}),t.summary?e.jsx("div",{className:"mt-1 text-xs leading-5 text-[var(--lab-text-secondary)]",children:t.summary}):null]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs(Se,{title:"Package",children:[e.jsx("div",{className:"text-sm text-[var(--lab-text-primary)]",children:t.packageId||"N/A"}),t.domain||t.taskType?e.jsx("div",{className:"mt-1 text-xs text-[var(--lab-text-secondary)]",children:[t.domain,t.taskType].filter(Boolean).join(" · ")}):null]}),e.jsx(Se,{title:"Node Id",children:e.jsx("div",{className:"break-all text-sm text-[var(--lab-text-primary)]",children:t.nodeId})})]}),t.keyResults.length?e.jsx(Se,{title:"Key Results",children:e.jsx("div",{className:"space-y-1.5",children:t.keyResults.map((n,r)=>e.jsxs("div",{className:"rounded-[6px] bg-[var(--lab-background)] px-2 py-1.5 text-xs",children:[e.jsx("span",{className:"font-medium text-[var(--lab-text-primary)]",children:n.label}),wt(n)?e.jsxs("span",{className:"text-[var(--lab-text-secondary)]",children:[" = ",wt(n)]}):null]},`${n.label}:${r}`))})}):null,l?e.jsx(Se,{title:"Evidence",children:e.jsxs("div",{className:"space-y-3",children:[e.jsx(ke,{label:"Input",paths:t.inputPaths,onOpenPath:a}),e.jsx(ke,{label:"Log",paths:t.logPaths,onOpenPath:a}),e.jsx(ke,{label:"Output",paths:t.outputPaths,onOpenPath:a}),e.jsx(ke,{label:"Validation",paths:t.validationPaths,onOpenPath:a}),e.jsx(ke,{label:"Evidence",paths:t.evidencePaths,onOpenPath:a})]})}):null,s.length?e.jsx(Se,{title:"Related Nodes",children:e.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.map(n=>e.jsx(se,{variant:"outline",className:"max-w-full truncate",children:n},n))})}):null,t.nodeType==="science.claim"&&t.claimType!=="computed"?e.jsx(Se,{title:"Warnings",children:e.jsxs("div",{className:"text-xs leading-5 text-[var(--lab-text-secondary)]",children:["This claim is classified as ",t.claimType||"unknown",", not computed evidence."]})}):null]})}const Ce=t=>{const a=String(t||"").trim().replace(/[_-]+/g," ");return a?a.replace(/\b\w/g,s=>s.toUpperCase()):"N/A"},Ra=t=>{try{return JSON.stringify(t,null,2)}catch{return String(t)}},Da=t=>!t||typeof t!="object"||Array.isArray(t)?null:t,Ka=t=>typeof t=="string"?t.trim()||null:typeof t=="number"||typeof t=="boolean"?String(t):null;function Te({label:t,value:a}){return e.jsxs("div",{className:"rounded-[14px] border border-[var(--lab-border)] bg-[var(--lab-background)] px-3 py-2.5",children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-[0.12em] text-[var(--lab-text-secondary)]",children:t}),e.jsx("div",{className:"mt-1 text-sm text-[var(--lab-text-primary)]",children:a})]})}function Fa({projectId:t,questId:a,trace:s,isLoading:l,payloadJson:n,payloadTruncated:r}){const p=s?.payload_json||Da(n)?.payload||n||null,_=[...s?.actions||[]].reverse().find(u=>u.artifact_id||u.head_commit)||null,f=s?.head_commit||_?.head_commit||null,y=s?.artifact_kind||_?.artifact_kind||null,q=s?.artifact_id||_?.artifact_id||null,P=s?aa(s):null,{openFileInTab:x}=sa(),W=it(u=>u.findNode),U=it(u=>u.findNodeByPath),N=it(u=>u.refresh),g=le({queryKey:["lab-trace-commit",a,f],queryFn:()=>_t.gitCommit(a,f),enabled:!!(a&&f),staleTime:15e3}),b=i.useMemo(()=>{const u=[...s?.changed_files||[]].filter(Boolean),j=g.data?.files?.map(w=>w.path).filter(Boolean)||[],h=Object.values(s?.paths_map||{}).map(w=>Ka(w)).filter(w=>!!(w&&!w.startsWith("/")));return[...new Set([...u,...j,...h])]},[g.data?.files,s?.changed_files,s?.paths_map]),[L,Y]=i.useState(null);i.useEffect(()=>{if(!b.length){Y(null);return}(!L||!b.includes(L))&&Y(b[0]||null)},[b,L]);const D=le({queryKey:["lab-trace-commit-file",a,f,L],queryFn:()=>_t.gitCommitFile(a,f,L),enabled:!!(a&&f&&L),staleTime:15e3}),Q=i.useCallback(async u=>{const j=t||a||null;j&&await na({href:u,projectId:j,currentOrigin:typeof window<"u"?window.location.origin:null,findNode:W,findNodeByPath:U,refreshTree:N,openFileInTab:x})},[W,U,x,t,a,N]);return l&&!s?e.jsxs("div",{className:"space-y-3",children:[e.jsx(ue,{className:"h-24 w-full rounded-[18px]"}),e.jsx(ue,{className:"h-20 w-full rounded-[18px]"}),e.jsx(ue,{className:"h-32 w-full rounded-[18px]"})]}):s?e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"rounded-[18px] border border-[var(--lab-border)] bg-[var(--lab-surface)] px-4 py-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(se,{variant:"outline",children:Ce(s.selection_type)}),s.stage_title?e.jsx(se,{variant:"outline",children:s.stage_title}):null,s.status?e.jsx(se,{variant:"outline",children:Ce(s.status)}):null,y?e.jsx(se,{variant:"outline",children:Ce(y)}):null]}),e.jsx("div",{className:"mt-3 text-sm font-semibold text-[var(--lab-text-primary)]",children:s.title}),e.jsx("div",{className:"mt-1 text-xs leading-5 text-[var(--lab-text-secondary)]",children:s.summary||"No normalized summary is available for this node."})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsx(Te,{label:"Branch",value:s.branch_name||"N/A"}),e.jsx(Te,{label:"Stage",value:s.stage_title||"N/A"}),e.jsx(Te,{label:"Artifact",value:q||"N/A"}),e.jsx(Te,{label:"Commit",value:f||"N/A"}),e.jsx(Te,{label:"Actions",value:s.counts?.actions??s.actions.length}),e.jsx(Te,{label:"Updated",value:s.updated_at||"N/A"})]}),P?e.jsx(Ba,{node:P,onOpenPath:u=>{Q(u)}}):null,p&&!P?e.jsxs("div",{className:"rounded-[18px] border border-[var(--lab-border)] bg-[var(--lab-surface)] px-4 py-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("div",{className:"text-xs font-semibold uppercase tracking-[0.12em] text-[var(--lab-text-secondary)]",children:"Artifact Payload"}),r?e.jsx(se,{variant:"outline",children:"Truncated"}):null]}),e.jsx("pre",{className:"mt-3 max-h-[280px] overflow-auto whitespace-pre-wrap rounded-[14px] bg-[var(--lab-background)] p-3 text-[11px] leading-5 text-[var(--lab-text-primary)]",children:Ra(p)})]}):null,f?e.jsxs("div",{className:"rounded-[18px] border border-[var(--lab-border)] bg-[var(--lab-surface)] px-4 py-4",children:[e.jsx("div",{className:"text-xs font-semibold uppercase tracking-[0.12em] text-[var(--lab-text-secondary)]",children:"Commit"}),g.isLoading?e.jsx(ue,{className:"mt-3 h-20 w-full rounded-[14px]"}):g.data?e.jsxs("div",{className:"mt-3 space-y-2 text-xs text-[var(--lab-text-secondary)]",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--lab-text-primary)]",children:g.data.subject}),e.jsxs("div",{children:[g.data.short_sha," · ",g.data.author_name||"Unknown author"]}),e.jsx("div",{children:g.data.authored_at||"Unknown time"}),e.jsxs("div",{children:[g.data.file_count||0," files · +",g.data.stats?.added||0," / -",g.data.stats?.removed||0]})]}):e.jsx("div",{className:"mt-3 text-sm text-[var(--lab-text-secondary)]",children:"Commit metadata is unavailable."})]}):null,b.length?e.jsxs("div",{className:"rounded-[18px] border border-[var(--lab-border)] bg-[var(--lab-surface)] px-4 py-4",children:[e.jsx("div",{className:"text-xs font-semibold uppercase tracking-[0.12em] text-[var(--lab-text-secondary)]",children:"Changed Files"}),e.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:b.slice(0,12).map(u=>e.jsx("button",{type:"button",className:`rounded-full border px-2.5 py-1 text-[11px] ${L===u?"border-[var(--lab-accent-strong)] bg-[rgba(64,113,175,0.1)] text-[var(--lab-text-primary)]":"border-[var(--lab-border)] bg-[var(--lab-background)] text-[var(--lab-text-secondary)]"}`,onClick:()=>Y(u),children:u},u))}),L?e.jsxs("div",{className:"mt-3",children:[e.jsx("div",{className:"text-xs font-semibold text-[var(--lab-text-primary)]",children:L}),D.isLoading?e.jsx(ue,{className:"mt-2 h-36 w-full rounded-[14px]"}):D.data?.lines?.length?e.jsx("pre",{className:"mt-2 max-h-[320px] overflow-auto whitespace-pre-wrap rounded-[14px] bg-[var(--lab-background)] p-3 text-[11px] leading-5 text-[var(--lab-text-primary)]",children:D.data.lines.join(`
|
|
22
|
+
`)}):e.jsx("div",{className:"mt-2 text-sm text-[var(--lab-text-secondary)]",children:t&&a?"Preview unavailable for this file.":"Preview unavailable."})]}):null]}):null,e.jsxs("div",{className:"rounded-[18px] border border-[var(--lab-border)] bg-[var(--lab-surface)] px-4 py-4",children:[e.jsx("div",{className:"text-xs font-semibold uppercase tracking-[0.12em] text-[var(--lab-text-secondary)]",children:"Trace Actions"}),e.jsx("div",{className:"mt-3 space-y-3",children:s.actions.length?s.actions.map(u=>e.jsxs("div",{className:"rounded-[14px] border border-[var(--lab-border)] bg-[var(--lab-background)] px-3 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--lab-text-primary)]",children:u.title||u.tool_name||u.raw_event_type||u.kind||u.action_id}),u.kind?e.jsx(se,{variant:"outline",children:Ce(u.kind)}):null,u.status?e.jsx(se,{variant:"outline",children:Ce(u.status)}):null,u.artifact_kind?e.jsx(se,{variant:"outline",children:Ce(u.artifact_kind)}):null]}),e.jsx("div",{className:"mt-1 text-[11px] text-[var(--lab-text-secondary)]",children:u.created_at||"N/A"}),u.summary?e.jsx("div",{className:"mt-2 text-xs leading-5 text-[var(--lab-text-secondary)]",children:u.summary}):null,u.head_commit?e.jsxs("div",{className:"mt-2 text-xs text-[var(--lab-text-secondary)]",children:["Commit: ",e.jsx("span",{className:"font-semibold text-[var(--lab-text-primary)]",children:u.head_commit})]}):null,u.tool_name?e.jsxs("div",{className:"mt-2 text-xs text-[var(--lab-text-secondary)]",children:["Tool: ",e.jsx("span",{className:"font-semibold text-[var(--lab-text-primary)]",children:u.tool_name})]}):null,u.mcp_server||u.mcp_tool?e.jsxs("div",{className:"mt-2 text-xs text-[var(--lab-text-secondary)]",children:["MCP:"," ",e.jsxs("span",{className:"font-semibold text-[var(--lab-text-primary)]",children:[u.mcp_server||"unknown",u.mcp_tool?`.${u.mcp_tool}`:""]})]}):null,u.args?e.jsx("pre",{className:"mt-2 max-h-36 overflow-auto whitespace-pre-wrap rounded-[12px] bg-[rgba(15,23,42,0.04)] p-2 text-[11px] leading-5 text-[var(--lab-text-primary)]",children:u.args}):null,u.output?e.jsx("pre",{className:"mt-2 max-h-40 overflow-auto whitespace-pre-wrap rounded-[12px] bg-[rgba(15,23,42,0.04)] p-2 text-[11px] leading-5 text-[var(--lab-text-primary)]",children:u.output}):null]},u.action_id)):e.jsx("div",{className:"text-sm text-[var(--lab-text-secondary)]",children:"No action records yet."})})]})]}):e.jsx("div",{className:"rounded-[18px] border border-[var(--lab-border)] bg-[var(--lab-surface)] px-4 py-4 text-sm text-[var(--lab-text-secondary)]",children:"No trace is attached to this node yet."})}const dt="ds:lab:focus",mt=t=>{typeof window>"u"||window.dispatchEvent(new CustomEvent(dt,{detail:t}))},Tt=t=>"kind"in t?t.kind:"quest",Oa=(t,a)=>{const s=Tt(t),l=Tt(a);if(s!==l)return!1;if(s==="quest"&&l==="quest"){const n=t,r=a;return n.questId===r.questId&&n.title===r.title&&n.status===r.status&&n.piState===r.piState&&n.baselineBound===r.baselineBound&&n.hasCliBinding===r.hasCliBinding&&n.headBranch===r.headBranch&&n.lastEventAt===r.lastEventAt&&n.pendingQuestionCount===r.pendingQuestionCount&&n.piAgentName===r.piAgentName&&n.piAgentLogo===r.piAgentLogo&&n.piAgentFrameColor===r.piAgentFrameColor&&n.createdAt===r.createdAt&&n.isActive===r.isActive}if(s==="agent"&&l==="agent"){const n=t,r=a;return n.questId===r.questId&&n.agentId===r.agentId&&n.name===r.name&&n.avatar===r.avatar&&n.avatarColor===r.avatarColor&&n.statusTone===r.statusTone&&n.statusState===r.statusState&&n.statusLabel===r.statusLabel}if(s==="pi"&&l==="pi"){const n=t,r=a;return n.agentId===r.agentId&&n.name===r.name&&n.avatar===r.avatar&&n.avatarColor===r.avatarColor&&n.statusTone===r.statusTone&&n.statusState===r.statusState&&n.statusLabel===r.statusLabel}if(s==="pending"&&l==="pending"){const n=t,r=a;return n.count===r.count}return!1},Ie=2,H=14,oe=44,ze=oe+12,Qa=420,$a=520,vt=420,$t=600,za=t=>{if(typeof window>"u")return null;try{const a=window.localStorage.getItem(`ds:lab:overview_layout:v${Ie}:${t}`);if(!a)return null;const s=JSON.parse(a);return s?.version!==Ie?null:s}catch{return null}},Va=(t,a)=>{if(!(typeof window>"u"))try{window.localStorage.setItem(`ds:lab:overview_layout:v${Ie}:${t}`,JSON.stringify(a))}catch{}},Ga=(t,a)=>{const r=t%3,p=Math.floor(t/3);return{x:a.x+r*260,y:a.y+p*170}},Lt=2,Wa=494,Ua=221,Ya=340,Ha=150,Ve=28,At=28,zt=0,Xa=40,Ja=220,Za=(t,a)=>{const s=Math.max(1,Math.ceil(t/Lt)),l=(Lt-1)*Wa+Ya,n=(s-1)*Ua+a,r=l+Ve*2,p=n+Ve*2+At,_=zt-l/2-Ve,f=Xa-Ve-At;return{x:_,y:f,width:r,height:p}},_e=(t,a,s)=>Math.min(s,Math.max(a,t)),Ia=(t,a)=>!(t.x+t.width<=a.x||a.x+a.width<=t.x||t.y+t.height<=a.y||a.y+a.height<=t.y),Pt=.5,kt=(t,a)=>{const s=Number.isFinite(t.x)?t.x:a.x,l=Number.isFinite(t.y)?t.y:a.y;return{x:s,y:l}},Ge=(t,a)=>Math.abs(t.x-a.x)>Pt||Math.abs(t.y-a.y)>Pt,Mt=(t,a,s)=>{const l=H,n=Math.max(H,a.width-oe-H),r=H,p=Math.max(H,a.height-oe-H),_=_e(t.x,l,n),f=_e(t.y,r,p),q=[{edge:"left",dist:Math.abs(_-l)},{edge:"right",dist:Math.abs(_-n)},{edge:"top",dist:Math.abs(f-r)},{edge:"bottom",dist:Math.abs(f-p)}].sort((N,g)=>N.dist-g.dist)[0]?.edge??"left",P=[],x=(N,g)=>{P.push({x:_e(N,l,n),y:_e(g,r,p)})};if(q==="left"||q==="right"){const N=q==="left"?l:n;x(N,f),x(N,f+ze),x(N,f-ze),x(q==="left"?n:l,f)}else{const N=q==="top"?r:p;x(_,N),x(_+ze,N),x(_-ze,N),x(_,q==="top"?p:r)}x(l,r),x(n,r),x(l,p),x(n,p);const W=new Set,U=P.filter(N=>{const g=`${N.x}:${N.y}`;return W.has(g)?!1:(W.add(g),!0)});for(const N of U){const g={x:N.x,y:N.y,width:oe,height:oe};if(!s.some(b=>Ia(g,b)))return N}return U[0]??{x:l,y:r}},Bt=(t,a,s)=>{if(a)return{width:oe,height:oe};const l=t==="action"?vt:Qa,n=t==="action"?$t:$a;return{width:Math.min(l,Math.max(oe,s.width-24)),height:Math.min(n,Math.max(oe,s.height-24))}},Rt=(t,a)=>({x:Number.isFinite(t?.x)?Number(t?.x):a.x,y:Number.isFinite(t?.y)?Number(t?.y):a.y,collapsed:typeof t?.collapsed=="boolean"?t.collapsed:a.collapsed}),Vt=i.createContext(null),es=({data:t})=>{const{t:a}=Re("lab"),s=t,l=s.status?String(s.status).toLowerCase():null,n=s.piState?String(s.piState).toLowerCase():null,r=!!s.baselineBound,p=s.headBranch?.trim()||"main",_=!!s.hasCliBinding,f=Math.max(0,Number(s.pendingQuestionCount??0)),y=f>0,q=s.lastEventAt?Ue(s.lastEventAt):a("overview_last_event_none",void 0,"No event yet");return e.jsxs("div",{className:ie("lab-overview-quest-node",s.isActive&&"is-active",l?`is-${l}`:null),children:[e.jsx(Je,{type:"target",position:Ze.Left,className:"lab-flow-handle"}),e.jsx(Je,{type:"source",position:Ze.Right,className:"lab-flow-handle"}),e.jsxs("div",{className:"lab-overview-quest-node__title-row",children:[e.jsx("div",{className:"lab-overview-quest-node__title",children:s.title||"Quest"}),s.piAgentName?e.jsxs("button",{type:"button",className:"lab-overview-pi-chip nodrag nopan nowheel",onClick:P=>{P.stopPropagation(),s.onPiClick?.()},"aria-label":a("overview_open_pi_chat",void 0,"Open PI chat"),title:a("overview_open_pi_chat",void 0,"Open PI chat"),children:[e.jsx("span",{className:"lab-overview-pi-avatar",style:s.piAgentFrameColor?{borderColor:s.piAgentFrameColor}:void 0,children:s.piAgentLogo?e.jsx("img",{src:s.piAgentLogo,alt:""}):e.jsx("span",{className:"lab-overview-pi-avatar__fallback",children:a("overview_pi_label")})}),e.jsx("span",{className:"lab-overview-pi-label",children:s.piAgentName})]}):null]}),e.jsxs("div",{className:"lab-overview-quest-node__meta",children:[e.jsx("span",{children:l||a("overview_unknown",void 0,"unknown")}),e.jsxs("span",{children:[a("overview_pi_label",void 0,"PI")," ",n||a("overview_unknown",void 0,"unknown")]})]}),e.jsxs("div",{className:"lab-overview-quest-node__chips",children:[e.jsx("span",{className:"lab-overview-quest-chip",children:r?a("overview_baseline_bound",void 0,"Baseline bound"):a("overview_baseline_pending",void 0,"Baseline pending")}),e.jsx("span",{className:"lab-overview-quest-chip",children:a("overview_head_branch",{branch:p},"Head {branch}")}),e.jsx("span",{className:"lab-overview-quest-chip",children:_?a("overview_cli_bound",void 0,"CLI bound"):a("overview_cli_pending",void 0,"CLI pending")}),y?e.jsx("span",{className:"lab-overview-quest-chip lab-overview-quest-chip--attention",children:a("overview_decision_count",{count:f},"{count} decisions")}):null,typeof s.progressingCount=="number"?e.jsx("span",{className:"lab-overview-quest-chip",children:a("overview_progressing_count",{count:s.progressingCount},"{count} progressing")}):null,typeof s.experimentCount=="number"?e.jsx("span",{className:"lab-overview-quest-chip",children:a("overview_experiment_count",{count:s.experimentCount},"{count} experiments")}):null,typeof s.pushFailedCount=="number"&&s.pushFailedCount>0?e.jsx("span",{className:"lab-overview-quest-chip lab-overview-quest-chip--attention",children:a("overview_push_failed_count",{count:s.pushFailedCount},"{count} push failed")}):null,typeof s.writerConflictCount=="number"&&s.writerConflictCount>0?e.jsx("span",{className:"lab-overview-quest-chip lab-overview-quest-chip--attention",children:a("overview_writer_conflict_count",{count:s.writerConflictCount},"{count} writer conflicts")}):null,s.runtimeLabel?e.jsx("span",{className:"lab-overview-quest-chip",children:s.runtimeLabel}):null,e.jsx("span",{className:"lab-overview-quest-chip",title:s.lastEventAt??void 0,children:a("overview_last_event",{value:q},"Last event {value}")})]})]})},ts=({data:t})=>{const a=t,s=`lab-status-${a.statusTone}`;return e.jsxs("div",{className:"lab-overview-agent-node",children:[e.jsx(Je,{type:"target",position:Ze.Left,className:"lab-flow-handle"}),e.jsxs("div",{className:ie("lab-avatar lab-avatar-sm",s),children:[e.jsx("span",{className:"lab-avatar-ring",style:{borderColor:a.avatarColor}}),e.jsx("img",{src:a.avatar,alt:a.name})]}),e.jsxs("div",{className:"lab-overview-agent-node__meta",children:[e.jsx("div",{className:"lab-overview-agent-node__name",children:a.name}),e.jsxs("div",{className:"lab-overview-agent-node__status",children:[e.jsx("span",{className:ie("lab-status-indicator",a.statusState==="working"&&"lab-status-indicator-working",a.statusState==="waiting"&&"lab-status-indicator-waiting"),"aria-label":a.statusLabel,title:a.statusLabel,children:a.statusState==="waiting"?e.jsx(Kt,{className:"h-3.5 w-3.5","aria-hidden":"true"}):a.statusState==="working"?e.jsx(Ft,{compact:!0,sizePx:16,className:"lab-status-orbit"}):a.statusState==="paused"?e.jsx(Ot,{className:"h-3.5 w-3.5","aria-hidden":"true"}):e.jsx(Qt,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),e.jsx("span",{className:"lab-overview-agent-node__status-label",children:a.statusLabel})]})]})]})},as=({data:t})=>{const a=t,s=`lab-status-${a.statusTone}`;return e.jsxs("div",{className:"lab-overview-agent-node",children:[e.jsx(Je,{type:"source",position:Ze.Right,className:"lab-flow-handle"}),e.jsxs("div",{className:ie("lab-avatar lab-avatar-sm",s),children:[e.jsx("span",{className:"lab-avatar-ring",style:{borderColor:a.avatarColor}}),e.jsx("img",{src:a.avatar,alt:a.name})]}),e.jsxs("div",{className:"lab-overview-agent-node__meta",children:[e.jsx("div",{className:"lab-overview-agent-node__name",children:a.name}),e.jsxs("div",{className:"lab-overview-agent-node__status",children:[e.jsx("span",{className:ie("lab-status-indicator",a.statusState==="working"&&"lab-status-indicator-working",a.statusState==="waiting"&&"lab-status-indicator-waiting"),"aria-label":a.statusLabel,title:a.statusLabel,children:a.statusState==="waiting"?e.jsx(Kt,{className:"h-3.5 w-3.5","aria-hidden":"true"}):a.statusState==="working"?e.jsx(Ft,{compact:!0,sizePx:16,className:"lab-status-orbit"}):a.statusState==="paused"?e.jsx(Ot,{className:"h-3.5 w-3.5","aria-hidden":"true"}):e.jsx(Qt,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),e.jsx("span",{className:"lab-overview-agent-node__status-label",children:a.statusLabel})]})]})]})},ss=({data:t})=>{const{t:a}=Re("lab"),s=t,l=i.useContext(Vt);return e.jsxs("div",{className:"lab-overview-pending-node","aria-label":a("overview_pending_decisions"),children:[e.jsxs("div",{className:"lab-overview-pending-node__header",children:[e.jsxs("div",{children:[e.jsx("div",{className:"lab-overview-pending-node__title",children:a("overview_pending_decisions")}),e.jsx("div",{className:"lab-overview-pending-node__subtitle",children:s.count===1?a("overview_pending_single"):a("overview_pending_plural",{count:s.count})})]}),e.jsx("span",{className:"lab-overview-pending-node__count","aria-hidden":"true",children:s.count})]}),e.jsx("div",{className:"lab-overview-pending-node__content nodrag nowheel",children:l})]})},ns={overviewQuest:es,overviewAgent:ts,overviewPi:as,overviewPending:ss};function Dt({boundsRef:t,title:a,icon:s,state:l,zIndex:n,onChange:r,onActivate:p,className:_,children:f}){const y=i.useRef(null),q=i.useRef(null),P=i.useRef(null),x=i.useRef(!1);i.useEffect(()=>()=>{P.current?.(),P.current=null},[]);const W=i.useCallback(g=>{if(g.stopPropagation(),typeof g.button=="number"&&g.button!==0||(p?.(),!q.current))return;const b=t.current;if(!b)return;P.current?.(),x.current=!1;const L=b.getBoundingClientRect(),Y=q.current.getBoundingClientRect(),D=Y.left-L.left,Q=Y.top-L.top;y.current={originX:D,originY:Q,pointerId:g.pointerId,startX:g.clientX,startY:g.clientY,moved:!1},q.current.setPointerCapture(g.pointerId);const u=h=>{if(!y.current||h.pointerId!==y.current.pointerId)return;const w=h.clientX-y.current.startX,T=h.clientY-y.current.startY;Math.abs(w)+Math.abs(T)>2&&(y.current.moved=!0);const d=Math.max(H,L.width-Y.width-H),V=Math.max(H,L.height-Y.height-H),K=_e(y.current.originX+w,H,d),$=_e(y.current.originY+T,H,V);r({...l,x:K,y:$})},j=h=>{y.current&&h.pointerId===y.current.pointerId&&(x.current=y.current.moved,y.current=null,P.current?.(),P.current=null)};window.addEventListener("pointermove",u),window.addEventListener("pointerup",j),window.addEventListener("pointercancel",j),P.current=()=>{window.removeEventListener("pointermove",u),window.removeEventListener("pointerup",j),window.removeEventListener("pointercancel",j)}},[t,p,r,l]),U=i.useCallback(g=>{g.stopPropagation(),r({...l,collapsed:!0})},[r,l]),N=i.useCallback(()=>{if(x.current){x.current=!1;return}p?.(),r({...l,collapsed:!1})},[p,r,l]);return l.collapsed?e.jsx("button",{ref:q,type:"button",className:ie("lab-floating-orb nowheel nopan",_),style:{transform:`translate3d(${l.x}px, ${l.y}px, 0)`,zIndex:n},onPointerDown:W,onClick:g=>{g.stopPropagation(),N()},"aria-label":`Show ${a}`,children:s}):e.jsxs("div",{ref:q,className:ie("lab-floating-panel nowheel nopan",_),style:{transform:`translate3d(${l.x}px, ${l.y}px, 0)`,zIndex:n},onPointerDown:g=>{g.stopPropagation(),p?.()},children:[e.jsxs("div",{className:"lab-floating-panel__header",onPointerDown:W,children:[e.jsxs("div",{className:"lab-floating-panel__title",children:[e.jsx("span",{className:"lab-floating-panel__icon",children:s}),e.jsx("span",{children:a})]}),e.jsx("button",{type:"button",className:"lab-floating-panel__collapse",onPointerDown:g=>g.stopPropagation(),onClick:U,"aria-label":`Collapse ${a}`,children:e.jsx(ua,{size:16})})]}),e.jsx("div",{className:"lab-floating-panel__content",children:f})]})}function is({projectId:t,quests:a,agents:s=[],templates:l=[],graphVm:n,waitingAnswerByAgentId:r=new Map,pendingDecisionCount:p,activeQuestId:_,hasPiAgent:f,piAgent:y,readOnly:q,canvasLevel:P="map",actionPanel:x,overviewPanel:W,showFloatingPanels:U=!0,onOpenCanvas:N,onOpenQuestPiChat:g,onOpenPiChat:b,onSelectAgent:L}){const{t:Y}=Re("lab"),D=i.useRef(null),[Q,u]=i.useState(!1),j=i.useMemo(()=>za(t),[t]),h=j?.viewport??null,w=h&&Number.isFinite(h.x)&&Number.isFinite(h.y)&&Number.isFinite(h.zoom)&&h.zoom>=.15&&h.zoom<=3?h:void 0,T=i.useRef(!1),d=i.useRef(!1),V=i.useRef([]),K=i.useRef(j?.viewport??null),$=i.useRef(null),X=i.useRef(2),[z,de]=i.useState({overview:1,action:2}),[F,ce]=i.useState(()=>Rt(j?.panels?.overview,{x:16,y:16,collapsed:!1})),[G,J]=i.useState(()=>Rt(j?.panels?.action,{x:16,y:88,collapsed:!1})),Ne=i.useMemo(()=>{const m=new Map;return n?.quests?.forEach(o=>{m.set(o.questId,o)}),m},[n]),ee=i.useCallback(m=>{X.current+=1;const o=X.current;de(S=>({...S,[m]:o}))},[]),me=i.useCallback(()=>{typeof window>"u"||($.current&&window.clearTimeout($.current),$.current=window.setTimeout(()=>{const m={};V.current.forEach(o=>{m[o.id]={x:o.position.x,y:o.position.y}}),Va(t,{version:Ie,viewport:K.current,nodes:m,panels:{overview:{x:F.x,y:F.y,collapsed:F.collapsed},action:{x:G.x,y:G.y,collapsed:G.collapsed}}})},450))},[G,F,t]),Z=i.useMemo(()=>Za(4,Ha),[]),qe=i.useMemo(()=>{const m=Math.round(Z.x+Z.width+140),o=Math.round(Z.y);return{x:m,y:o}},[Z]),R=i.useMemo(()=>{if(typeof p=="number")return Math.max(0,p);let m=0;for(const o of r.values())o&&(m+=1);return m},[p,r]),te=P==="ops",be=R>0&&!te,Ae=te||!be;i.useLayoutEffect(()=>{const m=D.current;if(!m)return;const o=m.getBoundingClientRect();J(S=>{const O=Number.isFinite(j?.panels?.action?.x),B=Number.isFinite(j?.panels?.action?.y);if(O||B||S.x!==16||S.y!==88)return S;const v=Math.max(H,o.width-vt-H);return{...S,x:v}})},[j?.panels?.action?.x,j?.panels?.action?.y]),i.useLayoutEffect(()=>{const m=D.current;if(!m)return;const o=m.getBoundingClientRect(),S=(C,ne)=>{const I=Math.max(H,o.width-ne.width-H),he=Math.max(H,o.height-ne.height-H);return{x:_e(C.x,H,I),y:_e(C.y,H,he)}},O=Bt("overview",F.collapsed,o),B=Bt("action",G.collapsed,o);let v=F;if(!F.collapsed){const C=S(F,O);(C.x!==F.x||C.y!==F.y)&&(v={...F,...C})}let A=G;if(!G.collapsed){const C=S(G,B);(C.x!==G.x||C.y!==G.y)&&(A={...G,...C})}const k=[];if(v.collapsed||k.push({x:v.x,y:v.y,...O}),A.collapsed||k.push({x:A.x,y:A.y,...B}),v.collapsed){const C=kt(Mt(v,o,k),v);Ge(C,v)&&(v={...v,...C}),k.push({x:v.x,y:v.y,width:oe,height:oe})}if(A.collapsed){const C=kt(Mt(A,o,k),A);Ge(C,A)&&(A={...A,...C})}(Ge(v,F)||v.collapsed!==F.collapsed)&&ce(v),(Ge(A,G)||A.collapsed!==G.collapsed)&&J(A)},[G,F,j?.panels?.action?.x,j?.panels?.action?.y]),i.useEffect(()=>{te&&(ee("action"),J(m=>m.collapsed?{...m,collapsed:!1}:m))},[ee,te]);const c=i.useMemo(()=>{if(!be)return null;const m=vt,o=$t,S=j?.nodes?.["overview:pending"]??null,O=Math.round(Z.x+Z.width/2-m/2),B=Math.round(Z.y+Z.height+96);return{id:"overview:pending",type:"overviewPending",position:S||{x:O,y:B},draggable:!q,selectable:!q,data:{kind:"pending",count:R},style:{width:m,height:o,zIndex:2}}},[Z,be,q,R,j?.nodes]),E=i.useMemo(()=>{const m=j?.nodes??{};return a.map((o,S)=>{const O=Ne.get(o.quest_id),B=`quest:${o.quest_id}`,v=m?.[B]??null,A=v||Ga(S,qe),k=O?.summary,C=O?.runtime,ne=C&&C.runningAgents>0?Y("overview_runtime_running",{count:C.runningAgents},"{count} running"):null;return{id:B,type:"overviewQuest",position:A,draggable:!q,data:{questId:o.quest_id,title:o.title||"Quest",status:o.status??null,piState:o.pi_state??C?.piState??null,baselineBound:O?.governance.formalBaselineState==="confirmed"||o.governance?.formalBaselineState==="confirmed",hasCliBinding:!!o.cli_server_id,headBranch:O?.topology.headBranch??o.git_head_branch??null,lastEventAt:o.last_event_at??null,pendingQuestionCount:Math.max(0,Number(o.pending_question_count??0)),piAgentName:y?.name??null,piAgentLogo:y?.logo??null,piAgentFrameColor:y?.frameColor??null,onPiClick:y?.name?()=>{if(g){g(o.quest_id);return}b?.()}:null,createdAt:o.created_at??null,isActive:o.quest_id===_,progressingCount:k?.progressingCount??void 0,experimentCount:k?.experimentCount??void 0,runtimeLabel:ne,pushFailedCount:k?.pushFailedCount??void 0,writerConflictCount:k?.writerConflictCount??void 0}}})},[_,Ne,b,g,y,Y,a,q,j?.nodes,qe]),M=i.useMemo(()=>new Map(l.map(m=>[m.template_id,m])),[l]),ae=i.useMemo(()=>{if(!f||!s.length)return null;const m=l.find(je=>je.template_key==="pi")??null,o=(m?s.find(je=>je.template_id===m.template_id):s.find(je=>je.agent_id==="pi"))??null;if(!o)return null;const S=j?.nodes??{},O={x:zt-Ja/2,y:Z.y+Z.height+48},B=`pi:${o.instance_id}`,v=S?.[B]??O,A=o.template_id?M.get(o.template_id)??null:null,k=He(o)||"PI",C=ut(o,A),ne=o.avatar_frame_color?.trim()||Xe(o.instance_id,0),I=typeof o.status=="string"?o.status.toLowerCase():"idle",he=r.get(o.instance_id)??!1,Ke=I==="waiting"&&!he,Fe=I==="waiting"&&!he?"idle":I,Ee=he,Pe=!Ee&&Nt(Fe),Oe=Ee?"waiting":Pe?"working":jt(Fe),ft=Ee?"waiting":Pe?"working":Ke?"paused":"resting",tt=Ee?"Waiting for answer":Pe?"Working":Ke?"Paused":"Resting";return{id:B,type:"overviewPi",position:v,draggable:!q,data:{kind:"pi",agentId:o.instance_id,name:k,avatar:C,avatarColor:ne,statusTone:Oe,statusState:ft,statusLabel:tt}}},[s,Z,f,q,j?.nodes,l,M,r]),ve=i.useMemo(()=>{if(!s.length||!E.length)return[];const m=j?.nodes??{},o=new Map(E.map(v=>[v.id,v])),S=new Set(a.map(v=>v.quest_id)),O=new Map;s.forEach(v=>{const A=v.active_quest_id;if(!A||!S.has(A))return;const k=O.get(A)??[];k.push(v),O.set(A,k)});const B=[];return O.forEach((v,A)=>{const k=o.get(`quest:${A}`);if(!k)return;const C=v.length>3?2:1,ne=Math.ceil(v.length/C);v.forEach((I,he)=>{const Ke=he%C,Fe=Math.floor(he/C),Ee=240+Ke*170,Pe=(Fe-(ne-1)/2)*90,Oe=`agent:${A}:${I.instance_id}`,tt=m?.[Oe]??null??{x:k.position.x+Ee,y:k.position.y+Pe},je=I.template_id?M.get(I.template_id)??null:null,Ht=He(I),Xt=ut(I,je),Jt=I.avatar_frame_color?.trim()||Xe(I.instance_id,he),at=typeof I.status=="string"?I.status.toLowerCase():"idle",st=r.get(I.instance_id)??!1,gt=at==="waiting"&&!st,yt=at==="waiting"&&!st?"idle":at,Qe=st,nt=!Qe&&Nt(yt),Zt=Qe?"waiting":nt?"working":jt(yt),It=Qe?"waiting":nt?"working":gt?"paused":"resting",ea=Qe?"Waiting for answer":nt?"Working":gt?"Paused":"Resting";B.push({id:Oe,type:"overviewAgent",position:tt,draggable:!q,data:{kind:"agent",questId:A,agentId:I.instance_id,name:Ht,avatar:Xt,avatarColor:Jt,statusTone:Zt,statusState:It,statusLabel:ea}})})}),B},[s,E,a,q,j?.nodes,M,r]),Wt=i.useMemo(()=>{const m=ae?[ae]:[];return[...c?[c]:[],...m,...E,...ve]},[ve,c,ae,E]),[pe,xt,Ut]=ra(Wt),bt=i.useMemo(()=>{const m={stroke:"var(--lab-border-strong)",strokeWidth:1.2,strokeDasharray:"4 6"};return ve.map(o=>({id:`agent-edge:${o.data.questId}:${o.data.agentId}`,source:`quest:${o.data.questId}`,target:o.id,type:"smoothstep",style:m,animated:!1}))},[ve]),pt=i.useMemo(()=>ae?E.map(m=>({id:`pi-edge:${ae.id}:${m.id}`,source:ae.id,target:m.id,type:"smoothstep",style:{stroke:"var(--lab-accent-strong)",strokeWidth:1.4,strokeDasharray:"2 6"},animated:!1})):[],[ae,E]),Yt=i.useMemo(()=>[...pt,...bt],[bt,pt]),De=la();return i.useEffect(()=>{V.current=pe},[pe]),i.useEffect(()=>{xt(m=>{const o=new Map(m.map(v=>[v.id,v])),S=ae?[ae]:[],B=[...c?[c]:[],...S,...E,...ve].map(v=>{const A=o.get(v.id);return A&&(v.type==="overviewQuest"||v.type==="overviewAgent"||v.type==="overviewPi"||v.type==="overviewPending")?{...v,position:A.position}:v});if(m.length===B.length){let v=!0;for(let A=0;A<B.length;A+=1){const k=m[A],C=B[A];if(!k||!C||k.id!==C.id){v=!1;break}if(k.position.x!==C.position.x||k.position.y!==C.position.y){v=!1;break}if(!Oa(k.data,C.data)){v=!1;break}}if(v)return m}return B})},[_,ve,c,ae,E,xt]),i.useEffect(()=>{me()},[G,F,me]),i.useEffect(()=>{if(!pe.length||w||T.current)return;let m=0,o=0;const S=()=>{o+=1;try{De.fitView({padding:.2,duration:450}),T.current=!0}catch{o<8&&typeof window<"u"&&(m=window.requestAnimationFrame(S))}};return S(),()=>{m&&typeof window<"u"&&window.cancelAnimationFrame(m)}},[De,w,pe.length]),i.useEffect(()=>{if(!pe.length||!w||T.current||d.current)return;const m=D.current;if(!m)return;const o=m.getBoundingClientRect();if(!o.width||!o.height)return;const S=w.x,O=w.y,B=w.zoom,v=160;if(!pe.some(k=>{const C=k.position.x*B+S,ne=k.position.y*B+O;return C>-v&&C<o.width+v&&ne>-v&&ne<o.height+v})){let k=0,C=0;const ne=()=>{C+=1;try{De.fitView({padding:.2,duration:450}),T.current=!0}catch{C<8&&typeof window<"u"&&(k=window.requestAnimationFrame(ne))}};return ne(),()=>{k&&typeof window<"u"&&window.cancelAnimationFrame(k)}}d.current=!0},[De,w,pe]),i.useEffect(()=>()=>{$.current&&window.clearTimeout($.current)},[]),i.useLayoutEffect(()=>{u(!1);const m=D.current;if(!m||typeof window>"u")return;let o=0,S=0;const O=()=>{S+=1;const B=m.getBoundingClientRect();if(B.width>0&&B.height>0){u(!0);return}S<6&&(o=window.requestAnimationFrame(O))};return O(),()=>{o&&window.cancelAnimationFrame(o)}},[t]),e.jsx(Vt.Provider,{value:be?x:null,children:e.jsxs("div",{ref:D,className:ie("lab-overview-canvas",te&&"lab-overview-canvas--ops"),children:[Q?null:e.jsx("div",{className:"space-y-3 p-4",children:U?e.jsxs(e.Fragment,{children:[te?null:W,x]}):null}),e.jsx("div",{className:"lab-quest-graph-shell lab-quest-graph-shell--full",children:e.jsx(oa,{nodes:pe,edges:Yt,nodeTypes:ns,onNodesChange:Ut,nodesDraggable:!q,panOnDrag:!0,zoomOnScroll:!0,zoomOnPinch:!0,minZoom:.15,maxZoom:3,defaultViewport:w,onNodeDragStop:()=>me(),onMoveEnd:(m,o)=>{K.current=o,me()},onNodeClick:(m,o)=>{const S=o.data;if(S&&typeof S=="object"&&S.kind==="pending"){mt({projectId:t,focusType:"overview",focusId:t}),U&&Ae&&(ee("action"),J(B=>({...B,collapsed:!1})));return}if(S&&typeof S=="object"&&S.kind==="agent"){const B=S;L?.(B.agentId,B.questId);return}if(S&&typeof S=="object"&&S.kind==="pi"){L?.(S.agentId,null),b?.();return}const O=o.data?.questId;O&&(mt({projectId:t,focusType:"quest",focusId:O}),N?.(O))},children:e.jsx(ca,{color:"var(--lab-border)",gap:28,size:1,variant:"dots"})})}),Q?e.jsxs(e.Fragment,{children:[U&&!te?e.jsx(Dt,{boundsRef:D,title:Y("overview_overall"),icon:e.jsx(ka,{size:16}),state:F,zIndex:z.overview,onChange:ce,onActivate:()=>ee("overview"),className:"lab-overview-panel--overview",children:W}):null,U&&Ae?e.jsx(Dt,{boundsRef:D,title:Y("overview_action_center"),icon:e.jsx(Aa,{size:16}),state:G,zIndex:z.action,onChange:J,onActivate:()=>ee("action"),className:"lab-overview-panel--action",children:x}):null]}):null]})})}function rs(t){return e.jsx(ia,{children:e.jsx(is,{...t})})}const Le=t=>{const a=String(t||"").trim().replace(/[_-]+/g," ");return a?a.replace(/\b\w/g,s=>s.toUpperCase()):"N/A"};function fe({children:t,mono:a=!1}){return e.jsx("span",{className:ie("inline-flex max-w-full items-center rounded-full border border-[var(--lab-border)] px-2.5 py-1 text-[10px] font-medium uppercase tracking-[0.14em] text-[var(--lab-text-secondary)]",a&&"font-mono normal-case tracking-[0.02em]"),children:e.jsx("span",{className:"truncate",children:t})})}function ge({title:t,hint:a,actions:s,children:l,first:n=!1}){return e.jsxs("section",{className:ie("py-5",n?"pt-0":"border-t border-dashed border-[var(--lab-border)]"),children:[e.jsxs("div",{className:"mb-5 flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-[var(--lab-text-secondary)]",children:t}),a?e.jsx("div",{className:"mt-2 text-sm leading-7 text-[var(--lab-text-secondary)]",children:a}):null]}),s?e.jsx("div",{className:"shrink-0",children:s}):null]}),l]})}function ye({icon:t,label:a,value:s,hint:l}){return e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 text-[11px] font-semibold uppercase tracking-[0.16em] text-[var(--lab-text-secondary)]",children:[e.jsx("span",{className:"shrink-0",children:t}),e.jsx("span",{children:a})]}),e.jsx("div",{className:"mt-2 break-words text-[15px] font-semibold leading-6 text-[var(--lab-text-primary)]",children:s}),l?e.jsx("div",{className:"mt-2 break-words text-sm leading-6 text-[var(--lab-text-secondary)]",children:l}):null]})}function We({items:t}){return e.jsx("div",{className:"divide-y divide-dashed divide-[var(--lab-border)]",children:t.map(a=>e.jsxs("div",{className:"grid gap-2 py-3 sm:grid-cols-[130px_minmax(0,1fr)]",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-[var(--lab-text-secondary)]",children:a.label}),e.jsx("div",{className:"break-words text-sm leading-7 text-[var(--lab-text-primary)]",children:a.value})]},a.label))})}function ls(t){return t==="truth"?"border-[rgba(64,113,175,0.24)] bg-[rgba(64,113,175,0.1)] text-[#315c97] dark:text-[#9ec5ff]":t==="runtime"?"border-[rgba(99,102,241,0.24)] bg-[rgba(99,102,241,0.1)] text-[#4f46e5] dark:text-[#c7d2fe]":t==="overlay"?"border-[rgba(83,176,174,0.26)] bg-[rgba(83,176,174,0.12)] text-[#0f766e] dark:text-[#8be4db]":"border-[rgba(148,163,184,0.26)] bg-[rgba(148,163,184,0.12)] text-[var(--lab-text-secondary)]"}function os({projectId:t,readOnly:a,onRefresh:s,onOpenStageSelection:l,cliStatus:n,labStream:r,projectName:p,templates:_,agents:f,quests:y,overview:q,isLoading:P,lockedQuestId:x=null,immersiveLockedQuest:W=!1}){const{t:U}=Re("lab"),N=ht(),g=Ye(c=>c.setActiveQuest),b=St(c=>c.selection),L=St(c=>c.clear),[Y,D]=i.useState(null),[Q,u]=i.useState(null),[j,h]=i.useState(null),[w,T]=i.useState(null),d=x??Y,V=i.useMemo(()=>new Map(_.map(c=>[c.template_id,c])),[_]),K=i.useMemo(()=>y.find(c=>c.quest_id===d)??null,[y,d]),$=i.useMemo(()=>f.find(c=>c.instance_id===w)??null,[f,w]),X=i.useMemo(()=>{const c=_.filter(E=>["pi","principal-investigator"].includes(String(E.template_key||"").trim().toLowerCase()));if(c.length){const E=f.find(M=>c.some(ae=>M.template_id===ae.template_id))??null;if(E)return E}return f.find(E=>{const M=String(E.agent_id||"").trim().toLowerCase(),ae=String(E.mention_label||"").trim().replace(/^@/,"").toLowerCase();return M==="pi"||ae==="pi"||M.endsWith(":pi")||String(E.template_id||"").trim().toLowerCase().includes("principal")})??null},[f,_]),z=X?.template_id?V.get(X.template_id)??null:null,de=X?{name:He(X),logo:ut(X,z),frameColor:X.avatar_frame_color||Xe(X.instance_id,0)}:null,F=i.useMemo(()=>{const c=q.graph_vm?.project?.pendingDecisionCount;return typeof c=="number"?Math.max(0,c):y.reduce((E,M)=>E+Math.max(0,Number(M.pending_question_count??0)),0)},[q.graph_vm?.project?.pendingDecisionCount,y]);i.useEffect(()=>{x||d&&!K&&!P.quests&&(D(null),u(null),h(null),L())},[L,P.quests,x,K,d]),i.useEffect(()=>{x&&(u(c=>c??null),h(c=>c??null),T(null))},[x]),i.useEffect(()=>{g(d)},[d,g]),i.useEffect(()=>{const c=E=>{const M=E.detail;if(M&&!(M.projectId&&M.projectId!==t)){if(M.focusType==="overview"||M.focusType==="canvas"){x||D(null),u(null),h(null),T(null),L();return}if(M.focusType==="agent"){T(M.focusId??null);return}if(M.focusType==="quest"||M.focusType==="quest-branch"||M.focusType==="quest-event"){if(x&&M.focusId&&M.focusId!==x)return;x||D(M.focusId??null),u(M.branch??null),h(M.eventId??null),T(null),L()}}};return window.addEventListener(dt,c),()=>window.removeEventListener(dt,c)},[L,x,t]);const ce=le({queryKey:["lab-quest-detail",t,d,"canvas-studio"],queryFn:()=>ha(t,d),enabled:!!(t&&d),staleTime:1e4}),G=le({queryKey:["lab-quest-summary",t,d,j??null,"canvas-studio"],queryFn:()=>xa(t,d,{atEventId:j}),enabled:!!(t&&d),staleTime:1e4}),J=le({queryKey:["lab-quest-event-payload",t,d,b?.selection_type??null,b?.selection_ref??null,"canvas-studio"],queryFn:()=>ba(t,d,b?.selection_ref,{maxBytes:1e5}),enabled:!!(t&&d&&b?.selection_type==="event_node"&&b?.selection_ref),staleTime:1e4}),Ne=le({queryKey:["lab-quest-node-trace",t,d,b?.selection_type??null,b?.selection_ref??null,"canvas-studio"],queryFn:()=>pa(t,d,b?.selection_ref,{selectionType:b?.selection_type??null}),enabled:!!(t&&d&&b?.selection_ref&&["branch_node","event_node","stage_node"].includes(String(b?.selection_type||""))),staleTime:1e4}),ee=i.useMemo(()=>da({selectionType:b?.selection_type,edgeType:b?.summary??b?.selection_ref??null,hasActiveProposal:!1}),[b?.selection_ref,b?.selection_type,b?.summary]),me=i.useCallback(()=>{Promise.resolve(s?.()),N.invalidateQueries({queryKey:["lab-agents",t]}),N.invalidateQueries({queryKey:["lab-quests",t]}),N.invalidateQueries({queryKey:["lab-overview",t]}),d&&(N.invalidateQueries({queryKey:["lab-quest-detail",t,d]}),N.invalidateQueries({queryKey:["lab-quest-summary",t,d]}),N.invalidateQueries({queryKey:["lab-quest-graph",t,d]}),N.invalidateQueries({queryKey:["lab-quest-node-trace",t,d]}))},[s,t,N,d]),Z=i.useCallback((c,E,M)=>{x&&c!==x||(x||D(c),u(E??null),h(M??null),T(null),L())},[L,x]),qe=i.useCallback(()=>{x||D(null),u(null),h(null),L()},[L,x]),R=()=>e.jsxs("div",{className:"space-y-0",children:[P.quests||P.agents||P.overview?e.jsxs("div",{className:"space-y-3",children:[e.jsx(ue,{className:"h-24 w-full rounded-[18px]"}),e.jsx(ue,{className:"h-20 w-full rounded-[18px]"})]}):null,e.jsxs(ge,{first:!0,title:"Overall",hint:"Select a quest node to enter its canvas. After that, click a branch, event, or stage node to inspect its durable detail state here.",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(fe,{children:"Home"}),e.jsx(fe,{children:Le(n)}),e.jsxs(fe,{children:[y.length," quests"]}),e.jsxs(fe,{children:[f.length," agents"]})]}),e.jsxs("div",{className:"mt-4 flex items-center gap-2",children:[e.jsx(rt,{className:"h-4 w-4 text-[#4071af]"}),e.jsx("div",{className:"text-[22px] font-semibold tracking-[-0.03em] text-[var(--lab-text-primary)]",children:p||U("plugin_home_title",void 0,"Home")})]})]}),e.jsx(ge,{title:"Operational Status",hint:"Keep this panel focused on high-signal canvas state rather than dashboard clutter.",children:e.jsxs("div",{className:"grid gap-x-8 gap-y-5 sm:grid-cols-2",children:[e.jsx(ye,{icon:e.jsx(Et,{className:"h-4 w-4"}),label:"Quests",value:y.length,hint:"Durable research repositories tracked in this project."}),e.jsx(ye,{icon:e.jsx(ot,{className:"h-4 w-4"}),label:"Agents",value:f.length,hint:"Live agent instances visible to the Lab surface."}),e.jsx(ye,{icon:e.jsx(rt,{className:"h-4 w-4"}),label:"Pending",value:F,hint:"User decisions or unresolved blocking items."}),e.jsx(ye,{icon:e.jsx($e,{className:"h-4 w-4"}),label:"CLI",value:Le(n),hint:"Shared runtime binding for this project workspace."})]})}),e.jsx(ge,{title:"Next Step",hint:"The Lab plugin is now canvas-first. Explorer handles navigation, center tabs handle content, and this rail only summarizes context.",children:e.jsx(We,{items:[{label:"Canvas",value:"Open a quest node to switch from map view into its research graph."},{label:"Selection",value:"Branch, event, and stage nodes expose stable detail summaries here."},{label:"Explorer",value:"Changed files now open in center tabs instead of rendering inline in the navigator."}]})}),$?te($):null]}),te=c=>{const E=c.template_id?V.get(c.template_id)??null:null;return e.jsxs(ge,{title:"Agent",hint:"Current agent focus selected from the overview canvas.",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full border border-[var(--lab-border)] bg-[var(--lab-background)]",style:{boxShadow:`0 0 0 2px ${c.avatar_frame_color||Xe(c.instance_id)}`},children:e.jsx(ot,{className:"h-4 w-4 text-[var(--lab-text-primary)]"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"truncate text-sm font-semibold text-[var(--lab-text-primary)]",children:He(c)}),e.jsx("div",{className:"truncate text-xs text-[var(--lab-text-secondary)]",children:E?.template_key||c.agent_id})]})]}),e.jsx("div",{className:"mt-5",children:e.jsx(We,{items:[{label:"Status",value:Le(c.status)},{label:"Quest",value:c.active_quest_id||"Unassigned"},{label:"Branch",value:c.active_quest_branch||"N/A"},{label:"Stage",value:c.active_quest_stage_key||"N/A"}]})})]})},xe=()=>{if(!d)return null;const c=ce.data?.quest??K,E=G.data?.quest??null,M=E?.runtime??null,ve=(E?.governance??null)?.lastPushStatus||(typeof c?.github_push?.status=="string"?c.github_push.status:null)||"N/A";return ce.isLoading&&!c?e.jsxs("div",{className:"space-y-3",children:[e.jsx(ue,{className:"h-28 w-full rounded-[18px]"}),e.jsx(ue,{className:"h-20 w-full rounded-[18px]"}),e.jsx(ue,{className:"h-20 w-full rounded-[18px]"})]}):e.jsxs("div",{className:"space-y-0",children:[e.jsxs(ge,{first:!0,title:"Overall",hint:c?.description?.trim()||c?.summary?.trim()||"No quest description yet.",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(fe,{children:Le(c?.status)}),e.jsx(fe,{children:E?.topology?.headBranch||c?.git_head_branch||"main"}),e.jsx(fe,{mono:!0,children:d}),Q?e.jsx(fe,{children:Q}):null]}),e.jsx("div",{className:"mt-4 text-[22px] font-semibold tracking-[-0.03em] text-[var(--lab-text-primary)]",children:c?.title||d}),e.jsxs("div",{className:"mt-5 grid gap-x-8 gap-y-5 sm:grid-cols-2",children:[e.jsx(ye,{icon:e.jsx(Et,{className:"h-4 w-4"}),label:"Branches",value:E?.topology?.branchCount??0,hint:`Head ${E?.topology?.headBranch||c?.git_head_branch||"main"}`}),e.jsx(ye,{icon:e.jsx(ot,{className:"h-4 w-4"}),label:"Running Agents",value:M?.runningAgents??0,hint:"Live agents attached to this quest."}),e.jsx(ye,{icon:e.jsx(rt,{className:"h-4 w-4"}),label:"Pending Questions",value:Math.max(0,Number(c?.pending_question_count??0)),hint:"Open decisions or direct user replies still waiting."}),e.jsx(ye,{icon:e.jsx($e,{className:"h-4 w-4"}),label:"Push Status",value:ve,hint:c?.last_event_at?`Last event ${Ue(c.last_event_at)}`:"No event timestamp yet."})]})]}),b?e.jsxs(e.Fragment,{children:[e.jsxs(ge,{title:"Selection",hint:b.summary||"No structured summary is attached to this node yet.",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[ee?e.jsx("span",{className:ie("inline-flex items-center rounded-full border px-2 py-0.5 text-[10px] font-semibold",ls(ee.tone)),children:U(Ct[ee.tone].labelKey,void 0,Ct[ee.tone].labelDefault)}):null,e.jsx(se,{variant:"outline",children:Le(b.selection_type)})]}),e.jsx("div",{className:"mt-4 text-base font-semibold text-[var(--lab-text-primary)]",children:b.label||b.selection_ref}),e.jsx("div",{className:"mt-5",children:e.jsx(We,{items:[{label:"Ref",value:b.selection_ref},{label:"Branch No",value:b.branch_no||"N/A"},{label:"Branch",value:b.branch_name||"N/A"},{label:"Parent",value:b.parent_branch||"N/A"},{label:"Foundation",value:b.foundation_label||"N/A"},{label:"Stage",value:b.stage_key||"N/A"},{label:"Worktree",value:b.worktree_rel_path||"N/A"},{label:"Agent",value:b.agent_instance_id||"N/A"}]})})]}),e.jsx(ge,{title:"Trace",hint:"Durable actions, artifact payloads, and commit evidence attached to the selected node.",children:e.jsx(Fa,{projectId:t,questId:d,trace:Ne.data?.trace??null,isLoading:Ne.isLoading,payloadJson:J.data?.payload_json??null,payloadTruncated:J.data?.truncated??null})})]}):e.jsx(ge,{title:"Operational Status",hint:"Quest-level runtime, topology, and governance signals.",children:e.jsx(We,{items:[{label:"Head Branch",value:E?.topology?.headBranch||c?.git_head_branch||"main"},{label:"Pending Questions",value:Math.max(0,Number(c?.pending_question_count??0))},{label:"Branch Count",value:E?.topology?.branchCount??0},{label:"Running Agents",value:M?.runningAgents??0},{label:"Push Status",value:ve},{label:"Last Event",value:c?.last_event_at?Ue(c.last_event_at):"N/A"},{label:"Created",value:c?.created_at?Ue(c.created_at):"N/A"}]})})]})},be=K?K.title||K.quest_id:p||U("plugin_home_title",void 0,"Home"),Ae=K?x?"Research canvas":"Quest canvas":"Quest map";return x&&W&&d?e.jsxs("div",{className:"relative flex h-full min-h-0 w-full flex-1 overflow-hidden",children:[e.jsx("div",{className:"absolute right-4 top-4 z-20",children:e.jsxs(Me,{type:"button",size:"sm",variant:"outline",className:"h-9 rounded-full border-[var(--lab-border)] bg-[rgba(255,255,255,0.94)] px-3 text-[11px] text-[var(--lab-text-primary)] shadow-[0_10px_28px_rgba(15,23,42,0.08)] backdrop-blur dark:bg-[rgba(28,29,34,0.94)]",onClick:me,children:[e.jsx($e,{className:"mr-1.5 h-3.5 w-3.5"}),"Refresh"]})}),e.jsx("div",{className:"h-full min-h-0 w-full overflow-hidden",children:e.jsx(qt,{projectId:t,questId:d,readOnly:a,highlightBranch:Q,atEventId:j,preferredViewMode:j?"event":"branch",activeBranch:Q,onBranchSelect:c=>{u(c),h(null)},onEventSelect:(c,E)=>{h(c),E&&u(E)},showFloatingPanels:!1,minimalChrome:!0,onStageOpen:l})})]}):e.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 rounded-[20px] border border-[var(--lab-border)] bg-[var(--lab-surface)] px-4 py-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[d&&!x?e.jsx(Me,{type:"button",size:"sm",variant:"ghost",className:"h-8 px-2",onClick:qe,children:e.jsx(ma,{className:"h-4 w-4"})}):null,e.jsx("div",{className:"truncate text-sm font-semibold text-[var(--lab-text-primary)]",children:be})]}),e.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-xs text-[var(--lab-text-secondary)]",children:[e.jsx("span",{children:Ae}),e.jsx("span",{children:"·"}),e.jsxs("span",{children:[y.length," quests"]}),e.jsx("span",{children:"·"}),e.jsxs("span",{children:[f.length," agents"]}),r?.status&&r.status!=="idle"?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:["stream ",r.status]})]}):null]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[Q?e.jsx(se,{variant:"outline",children:Q}):null,e.jsx(se,{variant:"outline",children:Le(n)}),e.jsxs(Me,{type:"button",size:"sm",variant:"outline",className:"h-8 px-3",onClick:me,children:[e.jsx($e,{className:"mr-1.5 h-3.5 w-3.5"}),"Refresh"]})]})]}),e.jsxs("div",{className:"grid min-h-0 flex-1 gap-4 xl:grid-cols-[minmax(0,1fr)_360px]",children:[e.jsx("div",{className:"min-h-0 overflow-hidden rounded-[24px] border border-[var(--lab-border)] bg-[var(--lab-surface)]",children:d?e.jsx(qt,{projectId:t,questId:d,readOnly:a,highlightBranch:Q,atEventId:j,preferredViewMode:j?"event":"branch",activeBranch:Q,onBranchSelect:c=>{u(c),h(null)},onEventSelect:(c,E)=>{h(c),E&&u(E)},showFloatingPanels:!1,onStageOpen:l}):e.jsx(rs,{projectId:t,quests:y,agents:f,templates:_,graphVm:q.graph_vm??null,pendingDecisionCount:F,activeQuestId:d,hasPiAgent:!!de,piAgent:de,readOnly:a,actionPanel:null,overviewPanel:null,showFloatingPanels:!1,onOpenCanvas:Z,onSelectAgent:c=>{T(c)}})}),e.jsx("aside",{className:"min-h-0 overflow-hidden rounded-[24px] border border-[var(--lab-border)] bg-[var(--lab-surface)]",children:e.jsx(va,{className:"h-full",children:e.jsxs("div",{className:"space-y-3 p-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--lab-text-primary)]",children:"Details"}),e.jsx("div",{className:"mt-1 text-xs text-[var(--lab-text-secondary)]",children:d?"Selected node and quest context.":"Overview context and node guidance."})]}),d?e.jsx(Me,{type:"button",size:"sm",variant:"ghost",className:"h-8 px-3",onClick:()=>{L(),h(null)},children:"Clear node"}):null]}),d?xe():R()]})})})]})]})}const cs=80,us=new Set(["lab.agent.changed","lab.agent.status"]),ds=new Set(["lab.assignment.changed"]),ms=new Set(["lab.quest.changed","lab.quest.event","lab.quest.sync"]),vs=new Set(["lab.quest.runtime"]),hs=new Set(["lab.memory.changed"]),xs=new Set(["lab.paper.changed"]),bs=new Set(["lab.baseline.archive","lab.baseline.restore"]),Be=t=>!t||typeof t!="object"?null:t,re=t=>{if(typeof t!="string")return null;const a=t.trim();return a||null},ps=t=>{if(typeof t=="boolean")return t;if(typeof t=="number")return t!==0;if(typeof t=="string"){const a=t.trim().toLowerCase();return a==="1"||a==="true"||a==="yes"}return!1},fs=t=>Array.isArray(t)?t.map(a=>re(a)).filter(a=>!!a):[],gs=t=>{if(!t)return null;const a=Be(t.data),s=re(a?.quest_id)??re(a?.questId)??re(a?.active_quest_id)??re(t.quest_id)??re(t.questId)??re(t.active_quest_id);if(s)return s;const l=Be(a?.quest);return re(l?.quest_id)??re(l?.id)},Gt=t=>[{queryKey:["lab-agents",t]},{queryKey:["lab-quests",t]},{queryKey:["lab-overview",t]}],we=(t,a)=>a?[{queryKey:["lab-quest-detail",t,a]},{queryKey:["lab-quest",t,a]},{queryKey:["lab-quest-summary",t,a]},{queryKey:["lab-quest-graph",t,a]},{queryKey:["lab-quest-events",t,a]},{queryKey:["lab-quest-event-payload",t,a]},{queryKey:["lab-quest-node-trace",t,a]},{queryKey:["lab-quest-decision-events",t,a]},{queryKey:["lab-quest-pi-qa-events",t,a]},{queryKey:["lab-quest-branch-insights",t,a]},{queryKey:["lab-quest-runtime",t,a]},{queryKey:["lab-papers",t,a]},{queryKey:["lab-memory",t,a]}]:[{queryKey:["lab-quest-detail",t]},{queryKey:["lab-quest",t]},{queryKey:["lab-quest-summary",t]},{queryKey:["lab-quest-graph",t]},{queryKey:["lab-quest-events",t]},{queryKey:["lab-quest-event-payload",t]},{queryKey:["lab-quest-node-trace",t]},{queryKey:["lab-quest-decision-events",t]},{queryKey:["lab-quest-pi-qa-events",t]},{queryKey:["lab-quest-branch-insights",t]},{queryKey:["lab-quest-runtime",t]},{queryKey:["lab-papers",t]},{queryKey:["lab-memory",t]}],ys=t=>[{queryKey:["lab-memory",t]}],ws=(t,a,s)=>us.has(t)?[{queryKey:["lab-agents",a]},{queryKey:["lab-overview",a]}]:ds.has(t)?[{queryKey:["lab-agents",a]},{queryKey:["lab-quests",a]},{queryKey:["lab-overview",a]},...we(a,s)]:ms.has(t)?[{queryKey:["lab-agents",a]},{queryKey:["lab-quests",a]},{queryKey:["lab-overview",a]},...we(a,s)]:vs.has(t)?[{queryKey:["lab-quests",a]},{queryKey:["lab-overview",a]},...we(a,s)]:hs.has(t)?[...ys(a),...we(a,s)]:xs.has(t)?[{queryKey:["lab-papers",a]},{queryKey:["lab-overview",a]},...we(a,s)]:bs.has(t)?[{queryKey:["lab-baselines",a]},{queryKey:["lab-quests",a]},{queryKey:["lab-overview",a]},...we(a,s)]:t.startsWith("lab.")?[{queryKey:["lab-quests",a]},{queryKey:["lab-overview",a]},...s?we(a,s):[]]:Gt(a),_s=(t,a,s)=>{if(t!=="lab.agent.changed")return null;const l=Be(s?.data);if(!l)return null;const n=re(l.action)?.toLowerCase();if(n!=="created"&&n!=="promoted"||!ps(l.auto_focus))return null;const r=re(l.agent_instance_id);return r?{projectId:a,focusType:"agent",focusId:r}:null};function Ns({projectId:t,enabled:a}){const s=ht(),[l,n]=i.useState({status:"idle",lastEventAt:null}),r=fa();return i.useEffect(()=>{if(!a||!t||r){n(h=>h.status==="idle"?h:{...h,status:"idle"});return}let p=!1,_=null,f=null,y=0,q=null,P=null;const x=new Set,W=[],U=512,N=new Map,g=`${ga()}/api/v1/projects/${t}/lab/stream`,b=h=>{const w=h.split(/\n/);let T="",d="";const V=[];for(const K of w)if(K){if(K.startsWith("event:")){T=K.slice(6).trim();continue}if(K.startsWith("data:")){V.push(K.slice(5).trimStart());continue}K.startsWith("id:")&&(d=K.slice(3).trim())}return V.length===0?null:{event:T||"message",data:V.join(`
|
|
23
|
+
`),id:d||void 0}},L=(h,w)=>{const T=(w||"").trim();if(!T)return!1;const d=(h||"").trim().toLowerCase(),V=d?`${d}|${T}`:T;if(x.has(V))return!0;if(x.add(V),W.push(V),W.length>U){const K=W.shift();K&&x.delete(K)}return!1},Y=()=>{if(N.size===0)return;const h=Array.from(N.values());N.clear(),h.forEach(w=>{s.invalidateQueries({queryKey:w.queryKey,exact:w.exact})})},D=h=>{h.forEach(w=>{const T=`${w.exact?1:0}:${JSON.stringify(w.queryKey)}`;N.set(T,w)}),!f&&(f=window.setTimeout(()=>{f=null,Y()},cs))},Q=(h,w)=>{if(h==="lab.ping")return;n(z=>({...z,lastEventAt:Date.now()}));let T=null;try{const z=JSON.parse(w||"{}");T=Be(z)}catch{T=null}const d=gs(T),V=Be(T?.data),K=fs(V?.quest_ids),$=ws(h,t,d);D($),K.forEach(z=>{D(we(t,z))});const X=_s(h,t,T);X&&mt(X)},u=()=>{if(p)return;_&&window.clearTimeout(_);const h=Math.min(y,4),w=Math.min(1e4,1e3*2**h),T=Math.min(250,y*50);n(d=>d.status==="connecting"||d.status==="open"?{...d,status:"reconnecting"}:d),_=window.setTimeout(j,w+T)},j=()=>{if(p)return;P&&P.abort(),P=new AbortController;const h=P;n(w=>({...w,status:y>0?"reconnecting":"connecting"})),(async()=>{try{const w=typeof window<"u"?window.localStorage.getItem("ds_access_token"):null;if(!w)return;const T={Accept:"text/event-stream",Authorization:`Bearer ${w}`};q&&(T["Last-Event-ID"]=q);const d=await fetch(g,{method:"GET",headers:T,signal:h.signal});if(p||h.signal.aborted)return;if(d.status===401){typeof window<"u"&&(window.localStorage.removeItem("ds_access_token"),ya("session_expired"));return}if(!d.ok)throw new Error(`HTTP ${d.status}: ${d.statusText}`);y=0,n(z=>({...z,status:"open"})),D(Gt(t));const V=d.body?.getReader();if(!V)throw new Error("No response body");const K=new TextDecoder;let $="";for(;!(p||h.signal.aborted);){const{done:z,value:de}=await V.read();if(z||p||h.signal.aborted)break;$+=K.decode(de,{stream:!0}),$.includes("\r")&&($=$.replace(/\r\n/g,`
|
|
24
|
+
`));let F=$.indexOf(`
|
|
25
|
+
|
|
26
|
+
`);for(;F!==-1;){const ce=$.slice(0,F);$=$.slice(F+2);const G=ce.replace(/\r\n/g,`
|
|
27
|
+
`).trim(),J=b(G);if(J?.id&&(q=J.id,L(J.event,J.id))){F=$.indexOf(`
|
|
28
|
+
|
|
29
|
+
`);continue}J&&!p&&!h.signal.aborted&&Q(J.event,J.data),F=$.indexOf(`
|
|
30
|
+
|
|
31
|
+
`)}}const X=$.replace(/\r\n/g,`
|
|
32
|
+
`).trim();if(X&&!p&&!h.signal.aborted){const z=b(X);if(z?.id&&(q=z.id,L(z.event,z.id)))return;z&&Q(z.event,z.data)}!p&&!h.signal.aborted&&(y+=1,u())}catch{if(p||h.signal.aborted)return;n(w=>({...w,status:"error"})),y+=1,u()}})()};return j(),()=>{p=!0,Y(),_&&window.clearTimeout(_),f&&window.clearTimeout(f),P&&P.abort()}},[a,r,t,s]),l}function ct({liveEnabled:t,streamStatus:a,fastMs:s,slowMs:l}){return t?a==="open"?l:s:!1}function js({projectId:t,readOnly:a,lockedQuestId:s=null,immersiveLockedQuest:l=!1,onRefresh:n,onOpenStageSelection:r}){const p=ht(),_=Ye(R=>R.setActiveQuest),f=Ye(R=>R.activeQuestId),y=Ye(R=>R.clearSelections),q=lt(R=>R.servers),P=lt(R=>R.loadServers),x=lt(R=>R.projectId),W=wa(),U=i.useMemo(()=>{const R=W?.context?.customData,te=typeof R?.projectId=="string"?R.projectId:null,xe=!te||te===t;return W?.pluginId===_a.LAB&&xe},[W,t]);i.useEffect(()=>{t&&x!==t&&P(t)},[x,P,t]);const N=i.useMemo(()=>q.filter(R=>R.status!=="offline"&&R.status!=="error"),[q]),g=q.length===0?"unbound":N.length>0?"online":"offline",b=!0,[L,Y]=i.useState(!0);i.useEffect(()=>{const R=()=>{Y(typeof document<"u"&&document.visibilityState==="visible")};return R(),document.addEventListener("visibilitychange",R),()=>document.removeEventListener("visibilitychange",R)},[]);const D=3e4,Q=!!(t&&U&&L),u=!!(t&&L),j=5e3,h=1e4,w=1e4,T=Ns({projectId:t,enabled:u}),d=T?.status??"idle",V=ct({liveEnabled:Q,streamStatus:d,fastMs:j,slowMs:j}),K=ct({liveEnabled:Q,streamStatus:d,fastMs:h,slowMs:3e4}),$=ct({liveEnabled:Q,streamStatus:d,fastMs:w,slowMs:3e4}),X=i.useRef(Q);i.useEffect(()=>{const R=X.current;X.current=Q,!(!t||!Q||R)&&(p.invalidateQueries({queryKey:["lab-agents",t]}),p.invalidateQueries({queryKey:["lab-quests",t]}),p.invalidateQueries({queryKey:["lab-overview",t]}))},[Q,t,p]);const z=le({queryKey:["lab-templates",t],queryFn:()=>Na(t),enabled:!!t,staleTime:D}),de=le({queryKey:["lab-agents",t],queryFn:()=>ja(t,{silent:!0}),enabled:!!t,staleTime:D,refetchInterval:V}),F=le({queryKey:["lab-quests",t],queryFn:()=>Sa(t,{silent:!0}),enabled:!!t,staleTime:D,refetchInterval:K}),ce=le({queryKey:["lab-overview",t],queryFn:()=>qa(t,{silent:!0}),staleTime:D,refetchInterval:$}),G=le({queryKey:["project",t],queryFn:()=>Ea(t),enabled:!!t,staleTime:D}),J=z.data?.items??[],Ne=de.data?.items??[],ee=F.data?.items??[],me=ce.data??{},Z=i.useMemo(()=>ee.length===0?null:ee.reduce((te,xe)=>{const be=te?.created_at?new Date(te.created_at).getTime():0;return(xe?.created_at?new Date(xe.created_at).getTime():0)>be?xe:te},ee[0])?.quest_id??null,[ee]),qe=G.data?.name??null;return i.useEffect(()=>{if(s){_(s);return}f||!Z||_(Z)},[f,Z,s,_]),i.useEffect(()=>{y()},[y,t]),e.jsx("div",{className:"lab-root flex h-full min-h-0 flex-col","data-activity":L?"active":"inactive",children:e.jsx("div",{className:ie("lab-panel h-full min-h-0 flex-1 overflow-hidden"),children:e.jsx(os,{projectId:t,readOnly:b,onRefresh:n,onOpenStageSelection:r,cliStatus:g,labStream:T,projectName:qe,templates:J,agents:Ne,quests:ee,overview:me,isLoading:{agents:de.isLoading,quests:F.isLoading,overview:ce.isLoading},lockedQuestId:s,immersiveLockedQuest:l})})})}const Ss="ds:lab:focus";function As({context:t,setTitle:a}){const{t:s}=Re("lab"),l=Ca("lab.use"),n=typeof t.customData?.projectId=="string"?t.customData.projectId:null,r=!!t.customData?.readOnly,p=t.customData?.focusType==="agent"||t.customData?.focusType==="quest"||t.customData?.focusType==="quest-branch"||t.customData?.focusType==="quest-event"||t.customData?.focusType==="overview"?t.customData.focusType:null,_=typeof t.customData?.focusId=="string"?t.customData.focusId:null,f=typeof t.customData?.branch=="string"?t.customData.branch:null,y=typeof t.customData?.eventId=="string"?t.customData.eventId:null;return i.useEffect(()=>{a(s("plugin_home_title",void 0,"Home"))},[a,s]),i.useEffect(()=>{!n||!p||!_&&p!=="overview"||window.dispatchEvent(new CustomEvent(Ss,{detail:{projectId:n,focusType:p,focusId:_,branch:f,eventId:y}}))},[f,y,_,p,n]),n?!l.isEntitlementLoading&&!l.isMaxEntitled?e.jsx("div",{className:"flex h-full items-center justify-center rounded-2xl border border-[var(--soft-border)] bg-[var(--soft-bg-surface)]",children:e.jsxs("div",{className:"px-6 text-center",children:[e.jsx("div",{className:"text-sm font-medium text-[var(--soft-text-primary)]",children:s("plugin_plan_access_required",void 0,"Plan access required")}),e.jsx("div",{className:"mt-1 text-xs text-[var(--soft-text-secondary)]",children:s("plugin_max_only_desc",void 0,"Lab is currently available for Max users only.")})]})}):e.jsx(js,{projectId:n,readOnly:r}):e.jsx("div",{className:"flex h-full items-center justify-center rounded-2xl border border-[var(--soft-border)] bg-[var(--soft-bg-surface)]",children:e.jsx("div",{className:"text-sm text-[var(--soft-text-secondary)]",children:s("plugin_project_not_found",void 0,"Project not found.")})})}export{As as default};
|