@hostclubeos/miraos 0.0.1-beta → 0.0.5-beta
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/bundled/app-store-compliance/SKILL.md +58 -0
- package/bundled/bug-hunter/NOTICE +17 -0
- package/bundled/bug-hunter/SKILL.md +65 -0
- package/bundled/superpowers/NOTICE +11 -0
- package/bundled/superpowers/SKILL.md +43 -0
- package/bundled/superpowers/references/brainstorming/SKILL.md +316 -0
- package/bundled/superpowers/references/brainstorming/builder-check-prompt.md +23 -0
- package/bundled/superpowers/references/brainstorming/scripts/frame-template.html +213 -0
- package/bundled/superpowers/references/brainstorming/scripts/helper.js +167 -0
- package/bundled/superpowers/references/brainstorming/scripts/server.cjs +723 -0
- package/bundled/superpowers/references/brainstorming/scripts/start-server.sh +216 -0
- package/bundled/superpowers/references/brainstorming/scripts/stop-server.sh +120 -0
- package/bundled/superpowers/references/brainstorming/visual-companion.md +299 -0
- package/bundled/superpowers/references/diagnosing-superpowers/SKILL.md +120 -0
- package/bundled/superpowers/references/diagnosing-superpowers/prompts/analyst-common.md +38 -0
- package/bundled/superpowers/references/diagnosing-superpowers/prompts/cost-and-time.md +28 -0
- package/bundled/superpowers/references/diagnosing-superpowers/prompts/plan-adherence.md +29 -0
- package/bundled/superpowers/references/diagnosing-superpowers/prompts/quality-evidence.md +26 -0
- package/bundled/superpowers/references/diagnosing-superpowers/prompts/repeated-work.md +30 -0
- package/bundled/superpowers/references/diagnosing-superpowers/prompts/request-conflicts.md +20 -0
- package/bundled/superpowers/references/diagnosing-superpowers/prompts/scrub-audit.md +33 -0
- package/bundled/superpowers/references/diagnosing-superpowers/prompts/scrub.md +29 -0
- package/bundled/superpowers/references/diagnosing-superpowers/prompts/similar-session.md +38 -0
- package/bundled/superpowers/references/diagnosing-superpowers/prompts/skill-timeline.md +30 -0
- package/bundled/superpowers/references/diagnosing-superpowers/prompts/stumbles.md +28 -0
- package/bundled/superpowers/references/diagnosing-superpowers/references/context-safety.md +22 -0
- package/bundled/superpowers/references/diagnosing-superpowers/references/github-issues.md +47 -0
- package/bundled/superpowers/references/diagnosing-superpowers/references/redaction-policy.md +34 -0
- package/bundled/superpowers/references/diagnosing-superpowers/references/session-discovery.md +31 -0
- package/bundled/superpowers/references/diagnosing-superpowers/templates/bundle-README.md +77 -0
- package/bundled/superpowers/references/diagnosing-superpowers/templates/case.md +64 -0
- package/bundled/superpowers/references/diagnosing-superpowers/templates/issue.md +70 -0
- package/bundled/superpowers/references/diagnosing-superpowers/templates/report.md +82 -0
- package/bundled/superpowers/references/dispatching-parallel-agents/SKILL.md +167 -0
- package/bundled/superpowers/references/executing-plans/SKILL.md +323 -0
- package/bundled/superpowers/references/executing-plans/scripts/task-done +55 -0
- package/bundled/superpowers/references/executing-plans/scripts/task-start +32 -0
- package/bundled/superpowers/references/finishing-a-development-branch/SKILL.md +225 -0
- package/bundled/superpowers/references/receiving-code-review/SKILL.md +205 -0
- package/bundled/superpowers/references/requesting-code-review/SKILL.md +95 -0
- package/bundled/superpowers/references/requesting-code-review/code-reviewer.md +198 -0
- package/bundled/superpowers/references/subagent-driven-development/SKILL.md +339 -0
- package/bundled/superpowers/references/subagent-driven-development/implementer-prompt.md +154 -0
- package/bundled/superpowers/references/subagent-driven-development/re-review-prompt.md +116 -0
- package/bundled/superpowers/references/subagent-driven-development/references/batching.md +11 -0
- package/bundled/superpowers/references/subagent-driven-development/references/cannot-verify.md +10 -0
- package/bundled/superpowers/references/subagent-driven-development/references/final-review.md +49 -0
- package/bundled/superpowers/references/subagent-driven-development/references/fix-loop.md +77 -0
- package/bundled/superpowers/references/subagent-driven-development/references/handling-reports.md +15 -0
- package/bundled/superpowers/references/subagent-driven-development/references/preflight.md +26 -0
- package/bundled/superpowers/references/subagent-driven-development/references/resuming.md +12 -0
- package/bundled/superpowers/references/subagent-driven-development/scripts/review-package +64 -0
- package/bundled/superpowers/references/subagent-driven-development/scripts/sdd-repo +54 -0
- package/bundled/superpowers/references/subagent-driven-development/scripts/sdd-workspace +110 -0
- package/bundled/superpowers/references/subagent-driven-development/scripts/task-brief +108 -0
- package/bundled/superpowers/references/subagent-driven-development/task-reviewer-prompt.md +209 -0
- package/bundled/superpowers/references/systematic-debugging/SKILL.md +283 -0
- package/bundled/superpowers/references/systematic-debugging/condition-based-waiting-example.ts +159 -0
- package/bundled/superpowers/references/systematic-debugging/condition-based-waiting.md +115 -0
- package/bundled/superpowers/references/systematic-debugging/defense-in-depth.md +122 -0
- package/bundled/superpowers/references/systematic-debugging/find-polluter.sh +72 -0
- package/bundled/superpowers/references/systematic-debugging/root-cause-tracing.md +169 -0
- package/bundled/superpowers/references/test-driven-development/SKILL.md +330 -0
- package/bundled/superpowers/references/test-driven-development/writing-good-tests.md +198 -0
- package/bundled/superpowers/references/using-git-worktrees/SKILL.md +167 -0
- package/bundled/superpowers/references/using-superpowers/SKILL.md +65 -0
- package/bundled/superpowers/references/using-superpowers/references/antigravity-tools.md +23 -0
- package/bundled/superpowers/references/using-superpowers/references/claude-code-tools.md +29 -0
- package/bundled/superpowers/references/using-superpowers/references/codex-tools.md +108 -0
- package/bundled/superpowers/references/using-superpowers/references/gemini-tools.md +63 -0
- package/bundled/superpowers/references/using-superpowers/references/hermes-tools.md +56 -0
- package/bundled/superpowers/references/using-superpowers/references/muse-tools.md +35 -0
- package/bundled/superpowers/references/using-superpowers/references/pi-tools.md +16 -0
- package/bundled/superpowers/references/verification-before-completion/SKILL.md +120 -0
- package/bundled/superpowers/references/writing-plans/SKILL.md +204 -0
- package/bundled/superpowers/references/writing-skills/SKILL.md +399 -0
- package/bundled/superpowers/references/writing-skills/references/CLAUDE_MD_TESTING.md +189 -0
- package/bundled/superpowers/references/writing-skills/references/anthropic-best-practices.md +1150 -0
- package/bundled/superpowers/references/writing-skills/references/bulletproofing.md +80 -0
- package/bundled/superpowers/references/writing-skills/references/discovery.md +201 -0
- package/bundled/superpowers/references/writing-skills/references/flowcharts.md +37 -0
- package/bundled/superpowers/references/writing-skills/references/graphviz-conventions.dot +172 -0
- package/bundled/superpowers/references/writing-skills/references/persuasion-principles.md +187 -0
- package/bundled/superpowers/references/writing-skills/references/testing-skills-with-subagents.md +384 -0
- package/bundled/superpowers/references/writing-skills/render-graphs.js +169 -0
- package/bundled/swarm/SKILL.md +47 -0
- package/chunks/{MaxSizedBox-4XZJGJCR.js → MaxSizedBox-CBUPHLMW.js} +1 -1
- package/chunks/{StandaloneSessionPicker-YUWFI6WT.js → StandaloneSessionPicker-EXZJQKTK.js} +1 -1
- package/chunks/{acp-subagent-executor-7BGJRBWA.js → acp-subagent-executor-BMIXP52W.js} +1 -1
- package/chunks/{acpAgent-DO3DYSKS.js → acpAgent-UHWDA3W7.js} +3 -3
- package/chunks/{advisor-ZMSGPCRF.js → advisor-5RUG3VFZ.js} +1 -1
- package/chunks/{agent-ZMZLTEBG.js → agent-SGQ7AEZI.js} +1 -1
- package/chunks/{agent-headless-5COOZKMA.js → agent-headless-ZGCZ2DA7.js} +1 -1
- package/chunks/{agent-host-client-L2ROWXVT.js → agent-host-client-HY5GPSHM.js} +1 -1
- package/chunks/{agent-host-connections-A4UGANXV.js → agent-host-connections-KGTBS37X.js} +1 -1
- package/chunks/{autofix-pr-N3M7IGHT.js → autofix-pr-E62FC67X.js} +1 -1
- package/chunks/{autofix-pr-VWZPABZQ.js → autofix-pr-TRI4NMYI.js} +1 -1
- package/chunks/{batch-RTO7FWGG.js → batch-OUC6FGCQ.js} +1 -1
- package/chunks/{bridge-ZZ2GF4DM.js → bridge-FLEIBB5V.js} +1 -1
- package/chunks/{bwrap-execution-6NIUP47A.js → bwrap-execution-VLHJWP4O.js} +1 -1
- package/chunks/{channel-settings-store-Y5HXLPQF.js → channel-settings-store-QG6HREVH.js} +1 -1
- package/chunks/{chunk-FXFSZ7QF.js → chunk-23543L6E.js} +1 -1
- package/chunks/{chunk-NM5TUAPJ.js → chunk-2GVKPBW5.js} +1 -1
- package/chunks/{chunk-DPKN7TSL.js → chunk-2QYFSBJY.js} +1 -1
- package/chunks/{chunk-NMB6IBA7.js → chunk-2TDRP3IX.js} +1 -1
- package/chunks/{chunk-ZE5YXIAJ.js → chunk-2VW4HXVF.js} +1 -1
- package/chunks/{chunk-FQXNP7EE.js → chunk-2ZWVSKPK.js} +1 -1
- package/chunks/{chunk-SBFKWNC3.js → chunk-3GJ56V2J.js} +1 -1
- package/chunks/{chunk-7JU5ZJJ7.js → chunk-3KFLO5W3.js} +1 -1
- package/chunks/{chunk-P4ZCOMZS.js → chunk-3MBYQYPC.js} +1 -1
- package/chunks/{chunk-FHGGT7VE.js → chunk-4346FNTB.js} +1 -1
- package/chunks/{chunk-IKQHFQ74.js → chunk-4GNHXVJZ.js} +1 -1
- package/chunks/{chunk-2FD2BYUZ.js → chunk-4IVYVCCU.js} +3 -3
- package/chunks/{chunk-ZEIWENJU.js → chunk-4KIFAVR2.js} +1 -1
- package/chunks/{chunk-YSWDQYJU.js → chunk-4MGTY3CJ.js} +1 -1
- package/chunks/{chunk-3LS3HVJA.js → chunk-4WYKHP7Q.js} +1 -1
- package/chunks/{chunk-MWGGXT4P.js → chunk-56PVVXUG.js} +1 -1
- package/chunks/{chunk-J4KLD52D.js → chunk-62DMHXLL.js} +1 -1
- package/chunks/{chunk-TALEJQWF.js → chunk-66DZADDA.js} +1 -1
- package/chunks/{chunk-GOEBFMO2.js → chunk-6RDYPRV6.js} +1 -1
- package/chunks/{chunk-5HNCGRMZ.js → chunk-724YPZRX.js} +1 -1
- package/chunks/{chunk-HA6K73R7.js → chunk-744QTJR2.js} +2 -2
- package/chunks/{chunk-SCQWVHLA.js → chunk-7F5IYTVE.js} +1 -1
- package/chunks/{chunk-TDM5PKRC.js → chunk-7VP4KALB.js} +1 -1
- package/chunks/{chunk-QWOBTVIO.js → chunk-7W5DOBKY.js} +1 -1
- package/chunks/{chunk-UL5A63VS.js → chunk-AE6E2YKY.js} +1 -1
- package/chunks/{chunk-J2DA7XAM.js → chunk-AIAYQAPA.js} +1 -1
- package/chunks/{chunk-3XFUS57Z.js → chunk-AIGBQN6R.js} +1 -1
- package/chunks/{chunk-BVYNPYGP.js → chunk-AJ75BPTA.js} +6 -1
- package/chunks/{chunk-LEZ3AZJI.js → chunk-ATVRF62A.js} +1 -1
- package/chunks/{chunk-DW4HTZVZ.js → chunk-BX3KM7OK.js} +1 -1
- package/chunks/{chunk-4UVQYN33.js → chunk-CUY6CVSL.js} +1 -1
- package/chunks/{chunk-RRXNG7AI.js → chunk-D3QZNIFB.js} +6 -6
- package/chunks/{chunk-5PZ4EFXH.js → chunk-D3YOXHQF.js} +1 -1
- package/chunks/{chunk-L66KXTVG.js → chunk-DABLVQXV.js} +1 -1
- package/chunks/{chunk-6AA5DYMC.js → chunk-DMM5LJWL.js} +2 -2
- package/chunks/{chunk-TWCQNRBQ.js → chunk-DNYXZVBT.js} +1 -1
- package/chunks/{chunk-HCIFQTQ4.js → chunk-E6LRCLLE.js} +2 -2
- package/chunks/{chunk-L44CUCID.js → chunk-EF3HUB7S.js} +1 -1
- package/chunks/{chunk-WQEJL3HN.js → chunk-EW3EVEYN.js} +1 -1
- package/chunks/{chunk-RMATGKAM.js → chunk-FC7SJIAS.js} +1 -1
- package/chunks/{chunk-4NQCOITC.js → chunk-FK5L2WVV.js} +1 -1
- package/chunks/{chunk-EMRZ722U.js → chunk-FRADUGRC.js} +1 -1
- package/chunks/{chunk-T2O3JMRH.js → chunk-FS67DOZQ.js} +1 -1
- package/chunks/{chunk-27MEJGPT.js → chunk-FXANOHXI.js} +5 -5
- package/chunks/{chunk-VCLKQDTV.js → chunk-GLQWA4W2.js} +1 -1
- package/chunks/{chunk-STPD3MIX.js → chunk-GOZ5FAUV.js} +1 -1
- package/chunks/{chunk-POX6TDCX.js → chunk-GTQULDIL.js} +1 -1
- package/chunks/{chunk-SR6MFJYO.js → chunk-GY4ID3EB.js} +1 -1
- package/chunks/{chunk-IJDGB3GP.js → chunk-H65ZVST6.js} +1 -1
- package/chunks/{chunk-6MWOHNU7.js → chunk-HASJX2YS.js} +1 -1
- package/chunks/{chunk-TJVI2L24.js → chunk-HSN5QUS7.js} +1 -1
- package/chunks/{chunk-7A42KF7G.js → chunk-HZ4L4MDM.js} +1 -1
- package/chunks/{chunk-WXVU3W2Q.js → chunk-IC42HQCH.js} +1 -1
- package/chunks/{chunk-NSA4ZO4V.js → chunk-IF3SWUYT.js} +1 -1
- package/chunks/{chunk-AGVUBA2V.js → chunk-J773THNP.js} +1 -1
- package/chunks/{chunk-ETYFIFMT.js → chunk-JDHMSERR.js} +1 -1
- package/chunks/{chunk-GNJTCOX3.js → chunk-JIQVUYBI.js} +1 -1
- package/chunks/{chunk-F5LMCQ2K.js → chunk-JJDF5FHA.js} +1 -1
- package/chunks/{chunk-TSI3G7JM.js → chunk-JQOLNQQN.js} +1 -1
- package/chunks/{chunk-ERUWCPGL.js → chunk-JQYPRANX.js} +1 -1
- package/chunks/{chunk-IW5GJAOR.js → chunk-K7KY7FIB.js} +1 -1
- package/chunks/{chunk-P2CUOX2Q.js → chunk-K7VOBDFT.js} +1 -1
- package/chunks/{chunk-SNGI5OD7.js → chunk-KK6SQPYG.js} +1 -1
- package/chunks/{chunk-HVAOQB42.js → chunk-KNW2OD46.js} +1 -1
- package/chunks/{chunk-GQSVGUOU.js → chunk-KP77CL5U.js} +1 -1
- package/chunks/{chunk-G6EIN5FW.js → chunk-KYK53GFP.js} +1 -1
- package/chunks/{chunk-432LPP2J.js → chunk-MQWKOOSR.js} +1 -1
- package/chunks/{chunk-XMIUDKGO.js → chunk-MUS4ADP7.js} +2 -2
- package/chunks/{chunk-IVHSWYWP.js → chunk-MYS5NQXO.js} +1 -1
- package/chunks/{chunk-FCOVJQX7.js → chunk-N4RIISOE.js} +1 -1
- package/chunks/{chunk-FCB7X7TI.js → chunk-NCBA52SB.js} +1 -1
- package/chunks/{chunk-GNV3UOVR.js → chunk-NGH27AWP.js} +1 -1
- package/chunks/{chunk-YM7CPT6W.js → chunk-NKWATWMD.js} +2 -2
- package/chunks/{chunk-R4HUU27E.js → chunk-NVD63O5H.js} +1 -1
- package/chunks/{chunk-WNT3ND65.js → chunk-NYM67KKZ.js} +2 -2
- package/chunks/{chunk-F6MHDBMX.js → chunk-O6Z3KO6R.js} +1 -1
- package/chunks/{chunk-RPMW55YH.js → chunk-OV2J3OED.js} +1 -1
- package/chunks/{chunk-RGOWOT3Z.js → chunk-P42MFWO2.js} +1 -1
- package/chunks/{chunk-XREDCQA5.js → chunk-P5543CFV.js} +1 -1
- package/chunks/{chunk-RHFRL6CB.js → chunk-PFECH6U6.js} +1 -1
- package/chunks/{chunk-3SQ76U4F.js → chunk-PFKTTUGS.js} +6 -6
- package/chunks/{chunk-XU5D2FKZ.js → chunk-PGKFDR73.js} +1 -1
- package/chunks/{chunk-LTUKVA3O.js → chunk-PQOQONLN.js} +1 -1
- package/chunks/{chunk-E7PL6EYK.js → chunk-PVHBBTAU.js} +1 -1
- package/chunks/{chunk-SKLO2WHR.js → chunk-PXBJPUGN.js} +1 -1
- package/chunks/{chunk-BCY6VYWQ.js → chunk-QEIX42MZ.js} +1 -1
- package/chunks/{chunk-MEUP65FI.js → chunk-QTCO5I4C.js} +1 -1
- package/chunks/{chunk-3KM4JL4Y.js → chunk-RBA3TP7L.js} +1 -1
- package/chunks/{chunk-R3H2AN4X.js → chunk-RKFNQQNA.js} +1 -1
- package/chunks/{chunk-RBYRJBQV.js → chunk-RNPVWQ3V.js} +1 -1
- package/chunks/{chunk-G7KBHT53.js → chunk-RRMTSVGU.js} +1 -1
- package/chunks/{chunk-W5YMSMZG.js → chunk-RWFOQXPU.js} +1 -1
- package/chunks/{chunk-R32F7IAM.js → chunk-SCHCTQCG.js} +1 -1
- package/chunks/{chunk-MC47YWMG.js → chunk-SHKSVOTG.js} +1 -1
- package/chunks/{chunk-YPG2SMZS.js → chunk-SK3QOQR4.js} +1 -1
- package/chunks/{chunk-5SFSOCHV.js → chunk-T3A53XMM.js} +1 -1
- package/chunks/{chunk-3SCCBDDE.js → chunk-T5PDEAU5.js} +1 -1
- package/chunks/{chunk-PIHZPQYO.js → chunk-T5XGTSQU.js} +1 -1
- package/chunks/{chunk-J4SZAKAX.js → chunk-TFITRCIC.js} +1 -1
- package/chunks/{chunk-THO23XWK.js → chunk-TLZM3DMY.js} +1 -1
- package/chunks/{chunk-Y6PDX4C4.js → chunk-TU5QHOJC.js} +1 -1
- package/chunks/{chunk-FFE5LIA6.js → chunk-TWJ4XBED.js} +1 -1
- package/chunks/{chunk-K6I2EP3G.js → chunk-UNJYVYTC.js} +1 -1
- package/chunks/{chunk-KSWZ6FTA.js → chunk-UOYXBAN7.js} +1 -1
- package/chunks/{chunk-GGXMABF2.js → chunk-USR2Y7B3.js} +1 -1
- package/chunks/{chunk-6O6IED5M.js → chunk-UWMLSAQY.js} +1 -1
- package/chunks/{chunk-OGPOUNG7.js → chunk-V5Z6OEKJ.js} +1 -1
- package/chunks/{chunk-MWMYT4PK.js → chunk-VBJV7T47.js} +1 -1
- package/chunks/{chunk-BAHNLZJQ.js → chunk-VF2UWWI2.js} +1 -1
- package/chunks/{chunk-MVF4MYTY.js → chunk-VJUTDS6C.js} +1 -1
- package/chunks/{chunk-A42T2FGM.js → chunk-W2ZVZ6LS.js} +1 -1
- package/chunks/{chunk-V6ZOOFZ3.js → chunk-W6IOHGWW.js} +1 -1
- package/chunks/{chunk-I5FHTXDB.js → chunk-WC72OWF2.js} +2 -2
- package/chunks/{chunk-XW5ZOTPK.js → chunk-WJLHLFIR.js} +1 -1
- package/chunks/{chunk-T4P4FF3I.js → chunk-WZTO3EYG.js} +1 -1
- package/chunks/{chunk-IUUWYEF5.js → chunk-XZNF4YNN.js} +1 -1
- package/chunks/{chunk-N7OJZ7AS.js → chunk-YN6WXB6B.js} +1 -1
- package/chunks/{chunk-PJUXHD2F.js → chunk-YVN32EUM.js} +1 -1
- package/chunks/{chunk-B7XMOQLO.js → chunk-Z4JY3HGO.js} +1 -1
- package/chunks/{chunk-AIIV662S.js → chunk-ZOWMHZWO.js} +1 -1
- package/chunks/{codex-subagent-executor-AR4Q5IHV.js → codex-subagent-executor-UCDGQFTR.js} +1 -1
- package/chunks/{config-utils-5S5PZQ5S.js → config-utils-Z6F4DVLG.js} +1 -1
- package/chunks/{contextCommand-YEZP3P4L.js → contextCommand-HMVZT56Y.js} +1 -1
- package/chunks/{core-runtime-LISS3YR4.js → core-runtime-AV7CJXOL.js} +1 -1
- package/chunks/{create-sub-session-FCB4YENT.js → create-sub-session-NNKVHZKT.js} +1 -1
- package/chunks/{cron-create-E2PZGYSL.js → cron-create-HWZDFVPA.js} +1 -1
- package/chunks/{daemon-git-worktree-guard-23KFZWC5.js → daemon-git-worktree-guard-Q3C45X7T.js} +1 -1
- package/chunks/{daemon-status-provider-KU7B5BBQ.js → daemon-status-provider-F6KB2LNG.js} +1 -1
- package/chunks/{daemon-trust-policy-FL3DDA6T.js → daemon-trust-policy-6D4KJANB.js} +1 -1
- package/chunks/{daemon-trust-policy-monitor-FCCK3YHW.js → daemon-trust-policy-monitor-BZ46W4IA.js} +1 -1
- package/chunks/{deferred-core-runtime-BCJU6YQI.js → deferred-core-runtime-YC5XIWEI.js} +1 -1
- package/chunks/{display-image-ZHNLZCK7.js → display-image-LAGHQ4RY.js} +1 -1
- package/chunks/{edit-SXQ5HK4W.js → edit-LOWDEKPX.js} +1 -1
- package/chunks/{enterPlanMode-NX6SOALP.js → enterPlanMode-NGSATDRH.js} +1 -1
- package/chunks/{environment-GFCR2C43.js → environment-CVIB5DW4.js} +1 -1
- package/chunks/{errors-WZJPHSEP.js → errors-USKSVZFO.js} +1 -1
- package/chunks/{execute-sandbox-VZ4OKFCC.js → execute-sandbox-KNRRYQ52.js} +1 -1
- package/chunks/{execution-sandbox-config-XQNSHI7G.js → execution-sandbox-config-XBW3PXDA.js} +1 -1
- package/chunks/{execution-tool-XPHUDQJ4.js → execution-tool-QSJLRU5N.js} +1 -1
- package/chunks/{execution-worker-6RXFIQH4.js → execution-worker-TQEIC4AJ.js} +1 -1
- package/chunks/{exitPlanMode-LP3D7M5M.js → exitPlanMode-AW2HOTIK.js} +1 -1
- package/chunks/{fast-path-2D5QZRQW.js → fast-path-DWPD5EGQ.js} +1 -1
- package/chunks/{glob-JFH2DTI7.js → glob-7U6FQSWZ.js} +1 -1
- package/chunks/{goal-tools-UL3O364Y.js → goal-tools-5ZB6GPCJ.js} +1 -1
- package/chunks/{handleAutoUpdate-MYD2LZXQ.js → handleAutoUpdate-MLUFTWFP.js} +1 -1
- package/chunks/{i18n-LDINZEX3.js → i18n-QAPQLOC3.js} +1 -1
- package/chunks/{initializer-LLXI4EVO.js → initializer-B27IZ7K4.js} +1 -1
- package/chunks/{installationInfo-4FS5ROEO.js → installationInfo-SAMHABWV.js} +1 -1
- package/chunks/{interactive-mod-session-UFB2CURW.js → interactive-mod-session-7LQ5CYUR.js} +1 -1
- package/chunks/{landlock-execution-3T5Y3SFY.js → landlock-execution-2BJ56FDV.js} +1 -1
- package/chunks/{list-45PFXWOV.js → list-TDMJQDQO.js} +1 -1
- package/chunks/{llm-VIFUT34L.js → llm-RBI7KXDE.js} +4 -4
- package/chunks/{loadedSettingsAdapter-3MNB7PHB.js → loadedSettingsAdapter-ZQK5KMEW.js} +1 -1
- package/chunks/{local-TBDN3BOU.js → local-HSG47CNJ.js} +1 -1
- package/chunks/{local-execution-environment-PNRU2WTJ.js → local-execution-environment-WJVCE26F.js} +1 -1
- package/chunks/{loggingContentGenerator-JA22TIC4.js → loggingContentGenerator-ALSG42YA.js} +1 -1
- package/chunks/{loop-wakeup-BXKFVB7H.js → loop-wakeup-LFU4LDJM.js} +1 -1
- package/chunks/{manage-memory-BMKA64KG.js → manage-memory-FBL6CHX2.js} +1 -1
- package/chunks/{managed-execution-engine-PVXRANOE.js → managed-execution-engine-FX7FDAWW.js} +1 -1
- package/chunks/{managed-local-serve-H5BEBXVR.js → managed-local-serve-YE4JDFNP.js} +1 -1
- package/chunks/{managed-npm-update-JGC5W6SL.js → managed-npm-update-2MKV7UOI.js} +1 -1
- package/chunks/{managed-runtime-attestation-worker-KCUQIRVR.js → managed-runtime-attestation-worker-DBAHM5MN.js} +1 -1
- package/chunks/{managed-runtime-bootstrap-HCN3NINM.js → managed-runtime-bootstrap-SHEXUEZN.js} +1 -1
- package/chunks/{managed-runtime-session-worker-G4TB3S5M.js → managed-runtime-session-worker-YN4KML7A.js} +1 -1
- package/chunks/{managed-runtime-ssh-worker-4WSWY2MH.js → managed-runtime-ssh-worker-BZNJV7IB.js} +1 -1
- package/chunks/{managed-session-authority-H5USCQ6W.js → managed-session-authority-MFEINLXC.js} +1 -1
- package/chunks/{mcp-WXNSQID6.js → mcp-TS5PX5FY.js} +1 -1
- package/chunks/{memory-E5SQH3NJ.js → memory-JTDN5AEA.js} +1 -1
- package/chunks/{model-call-collection-PULBNXXQ.js → model-call-collection-TNBMD3YL.js} +1 -1
- package/chunks/{model-configuration-SJEIOQGZ.js → model-configuration-6KTQQTMO.js} +1 -1
- package/chunks/{modelConfigUtils-WJ27GPGB.js → modelConfigUtils-LCZZ3EQU.js} +1 -1
- package/chunks/{monitor-N25QQU7J.js → monitor-KCCNIKLE.js} +1 -1
- package/chunks/{nonInteractiveCli-E6RLP7AG.js → nonInteractiveCli-BXHX6EIU.js} +1 -1
- package/chunks/{nonInteractiveToolExecutor-Z5JBEIAW.js → nonInteractiveToolExecutor-R5CTTWKD.js} +1 -1
- package/chunks/{notebook-edit-WVLO2EUN.js → notebook-edit-KIWE2XOA.js} +1 -1
- package/chunks/{omni-RKVYBBQI.js → omni-IFTMWBMU.js} +1 -1
- package/chunks/{openaiContentGenerator-2G2XB3DF.js → openaiContentGenerator-XP3VPU6C.js} +1 -1
- package/chunks/{openaiResponsesContentGenerator-344BTMHF.js → openaiResponsesContentGenerator-ZJ6C22EA.js} +1 -1
- package/chunks/{pidfile-KS6QFQIJ.js → pidfile-42P24JIA.js} +1 -1
- package/chunks/{processUtils-U45GFMXN.js → processUtils-I2XOO5U2.js} +1 -1
- package/chunks/{prompt-terminal-ledger-HAK6RGOC.js → prompt-terminal-ledger-7EW46VQ4.js} +1 -1
- package/chunks/{reactive-degrade-S7C6GXHH.js → reactive-degrade-O4JO7MOX.js} +1 -1
- package/chunks/{read-file-RG5ZNNCH.js → read-file-VGC4O7F2.js} +1 -1
- package/chunks/{record-source-6J47E2DW.js → record-source-VX26ZO6I.js} +1 -1
- package/chunks/{request-shutdown-SCU5TN5V.js → request-shutdown-P7227UEF.js} +1 -1
- package/chunks/{resumeHistoryUtils-CDDEU4RO.js → resumeHistoryUtils-QMVIHQRW.js} +1 -1
- package/chunks/{review-H6FLIVJV.js → review-PC4IDLCG.js} +1 -1
- package/chunks/{ripGrep-XEDOYGPA.js → ripGrep-JY4PZABK.js} +1 -1
- package/chunks/{run-qwen-serve-ODBFOM6H.js → run-qwen-serve-XRWVWOZK.js} +1 -1
- package/chunks/{runtime-SCINDTK2.js → runtime-OL7B72CH.js} +1 -1
- package/chunks/{runtime-shell-policy-77EFLSNG.js → runtime-shell-policy-TXAWAOBK.js} +1 -1
- package/chunks/{sandboxConfig-WE7GXTES.js → sandboxConfig-EJTMWZHD.js} +1 -1
- package/chunks/{scheduled-tasks-4HL6GKQ4.js → scheduled-tasks-XQSZWZXG.js} +1 -1
- package/chunks/{scheduler-ETHKOB4B.js → scheduler-3TIRZEVB.js} +1 -1
- package/chunks/{search-memory-R4O5AIEV.js → search-memory-P5KOTUVV.js} +1 -1
- package/chunks/{send-message-SBQSBXDW.js → send-message-KFSKFXLX.js} +1 -1
- package/chunks/{serve-TRAGNNK6.js → serve-JCUT4WK7.js} +1 -1
- package/chunks/{server-BXVHT3XW.js → server-HMTRZJF7.js} +3 -3
- package/chunks/{session-A6NV4RLU.js → session-RGLZU6KY.js} +1 -1
- package/chunks/{session-attachments-root-WU56VFQN.js → session-attachments-root-O3YQ7HWD.js} +1 -1
- package/chunks/{session-execution-engine-selector-MG2ZDK25.js → session-execution-engine-selector-LZBHS3UO.js} +1 -1
- package/chunks/{session-pr-refresh-HQOHASVU.js → session-pr-refresh-L5Z5WCXS.js} +1 -1
- package/chunks/{sessionService-XBFZRVW6.js → sessionService-MMPZUN5X.js} +1 -1
- package/chunks/{settings-HDG72SDU.js → settings-7PYHXPN4.js} +1 -1
- package/chunks/{shell-VNVPTXQO.js → shell-E6QLKRVU.js} +1 -1
- package/chunks/{skill-4VDNIMOV.js → skill-55IZUUM5.js} +1 -1
- package/chunks/{skill-settings-VKC2ATCK.js → skill-settings-A2M5BPH7.js} +1 -1
- package/chunks/{spawnChannel-RB5Q6Z4U.js → spawnChannel-KWU26CB7.js} +1 -1
- package/chunks/{standalone-update-QDH63IIS.js → standalone-update-32WYZ3BJ.js} +1 -1
- package/chunks/{start-opentui-ui-VULNQJ3L.js → start-opentui-ui-YNTPK7LX.js} +2 -2
- package/chunks/{startInteractiveUI-XZATGHLR.js → startInteractiveUI-MWA2VYTJ.js} +2 -2
- package/chunks/{task-create-ODLLJ5EF.js → task-create-67YBESBR.js} +1 -1
- package/chunks/{task-update-ZNWF5QPF.js → task-update-DLBXOE5R.js} +1 -1
- package/chunks/{team-create-CUJXJ2ZS.js → team-create-ARICYIQB.js} +1 -1
- package/chunks/{team-plan-approval-36LS5SZD.js → team-plan-approval-JPRE6Q3R.js} +1 -1
- package/chunks/{terminal-image-renderer-FYGH5GYJ.js → terminal-image-renderer-HVIZ2VNE.js} +1 -1
- package/chunks/{theme-manager-AMNU6BMN.js → theme-manager-UEPLIBUP.js} +1 -1
- package/chunks/{tool-call-E635LKSC.js → tool-call-EFJKXI3Z.js} +1 -1
- package/chunks/{tool-result-media-USCQTGHC.js → tool-result-media-LMIYNXSD.js} +1 -1
- package/chunks/{tool-search-FNTAT2ZW.js → tool-search-D7HQTRQG.js} +1 -1
- package/chunks/{total-session-admission-6P5YNVII.js → total-session-admission-67QMR44O.js} +1 -1
- package/chunks/{trustedFolders-7SPIYZSS.js → trustedFolders-HARYVS3F.js} +1 -1
- package/chunks/{update-relaunch-ZYID7ZKA.js → update-relaunch-NVNPOK5J.js} +1 -1
- package/chunks/{updateCheck-A3JUVWQV.js → updateCheck-7NMXUCTN.js} +1 -1
- package/chunks/{upload-config-DT3IQPC7.js → upload-config-W2SICJ32.js} +1 -1
- package/chunks/{useAutoAcceptIndicator-OS64SJOW.js → useAutoAcceptIndicator-ELMIP4TJ.js} +1 -1
- package/chunks/{validateNonInterActiveAuth-SJLXPGT4.js → validateNonInterActiveAuth-3433WFLE.js} +1 -1
- package/chunks/{version-CD2O2AJ7.js → version-XCFKTEY3.js} +1 -1
- package/chunks/{web-fetch-CQZMLBDV.js → web-fetch-537RS6IX.js} +1 -1
- package/chunks/{web-search-47YZU3PO.js → web-search-O27MYFSW.js} +1 -1
- package/chunks/{workflow-ROHRWGL5.js → workflow-6QF4RMYM.js} +1 -1
- package/chunks/{workflow-ancestor-trust-YSFNC6J5.js → workflow-ancestor-trust-CABLU3VV.js} +1 -1
- package/chunks/{workspace-agents-P4T5564B.js → workspace-agents-5WP3PY7W.js} +1 -1
- package/chunks/{workspace-providers-status-GZOJR5XX.js → workspace-providers-status-7G2EJJEO.js} +1 -1
- package/chunks/{workspace-recovery-worker-C4KTT7J5.js → workspace-recovery-worker-ICCIDEWU.js} +1 -1
- package/chunks/{workspace-registration-store-2WDVL42M.js → workspace-registration-store-WHXMNQQQ.js} +1 -1
- package/chunks/{workspace-registry-2V2LYFXO.js → workspace-registry-NXBODLYH.js} +1 -1
- package/chunks/{workspace-runtime-coordinator-7OH4M6FV.js → workspace-runtime-coordinator-CJXS273B.js} +1 -1
- package/chunks/{workspace-service-353F3S2A.js → workspace-service-HUDE2RXN.js} +1 -1
- package/chunks/{workspace-skills-status-A5FRCJJF.js → workspace-skills-status-FJC6U62F.js} +1 -1
- package/chunks/{workspace-trust-reconciler-N4AKVBD4.js → workspace-trust-reconciler-ZIQ3A5ZB.js} +1 -1
- package/chunks/{write-file-XOIVQYGC.js → write-file-652YGG7I.js} +1 -1
- package/chunks/{zoom-image-ACTDUJ4C.js → zoom-image-YEH4O74G.js} +1 -1
- package/cli.js +2 -2
- package/execution-worker.js +1 -1
- package/export-transcript-document.js +1 -1
- package/package.json +2 -2
- package/web-shell/assets/{PierreFilePreview-DR46bTX6.js → PierreFilePreview-DEhWK46v.js} +1 -1
- package/web-shell/assets/{SpreadsheetPreview-zgxr-aKy.js → SpreadsheetPreview-C-GgIuPX.js} +1 -1
- package/web-shell/assets/{WorkspaceFileBrowser-BEoibHvP.js → WorkspaceFileBrowser-64vDYikf.js} +1 -1
- package/web-shell/assets/{abnfDiagram-VCTEODGH-Cba-rfLM.js → abnfDiagram-VCTEODGH-C2WWURam.js} +1 -1
- package/web-shell/assets/{agents-route-DexLhLcH.js → agents-route-j5ba59xn.js} +1 -1
- package/web-shell/assets/{arc-BLxikpdy.js → arc-Bkr_-GVn.js} +1 -1
- package/web-shell/assets/{architectureDiagram-5GKGNRK7-BMaIAoGQ.js → architectureDiagram-5GKGNRK7-D_v_wDDW.js} +1 -1
- package/web-shell/assets/{blockDiagram-NRAW4CY4-CGSbuIDn.js → blockDiagram-NRAW4CY4-Csxc3YNo.js} +1 -1
- package/web-shell/assets/{c4Diagram-UCG6FXSJ-DVwZ8MO2.js → c4Diagram-UCG6FXSJ-PXryoJCB.js} +1 -1
- package/web-shell/assets/channel-6Pj4KPAs.js +1 -0
- package/web-shell/assets/{chunk-2Q5K7J3B-BzKDWtZ3.js → chunk-2Q5K7J3B-DwK5UBHI.js} +1 -1
- package/web-shell/assets/{chunk-5VM5RSS4-C8SFBHFV.js → chunk-5VM5RSS4-BC1hvD6_.js} +1 -1
- package/web-shell/assets/{chunk-F27PBJKO-D8brpDvU.js → chunk-F27PBJKO-iFe0IxfJ.js} +1 -1
- package/web-shell/assets/{chunk-G27WJ6UU-Cilx_eO_.js → chunk-G27WJ6UU-ROSuKRxI.js} +1 -1
- package/web-shell/assets/{chunk-JWPE2WC7-CeplW23S.js → chunk-JWPE2WC7-CYHS6PxA.js} +1 -1
- package/web-shell/assets/{chunk-LCL6LL3I-BUO5XSSe.js → chunk-LCL6LL3I-D5bFMqCy.js} +1 -1
- package/web-shell/assets/{chunk-POPQ4Y6H-DPo869nv.js → chunk-POPQ4Y6H-BJh77MGv.js} +1 -1
- package/web-shell/assets/{chunk-SVP7TREG-DhfIj0Jt.js → chunk-SVP7TREG-Cs81aYft.js} +1 -1
- package/web-shell/assets/{chunk-XXDRQBXY-B72Tsbdi.js → chunk-XXDRQBXY-DqDbN44E.js} +1 -1
- package/web-shell/assets/classDiagram-DTDB5LWJ-BaTUuuB8.js +1 -0
- package/web-shell/assets/classDiagram-v2-JRS7N3AN-BaTUuuB8.js +1 -0
- package/web-shell/assets/{cose-bilkent-JH36ORCC-8EANR5K4.js → cose-bilkent-JH36ORCC-DhjrwADJ.js} +1 -1
- package/web-shell/assets/{cynefin-OW5HDTMX-Cj3uoFr9.js → cynefin-OW5HDTMX-Dh7t-_3M.js} +1 -1
- package/web-shell/assets/{cynefinDiagram-5FMLGOSQ-CHwRYcv9.js → cynefinDiagram-5FMLGOSQ-5J4kto0C.js} +1 -1
- package/web-shell/assets/{dagre-3AP2YEHR-B50MDk4E.js → dagre-3AP2YEHR-28AdbIcl.js} +1 -1
- package/web-shell/assets/{diagram-S7CK7UJ4-Fbk8W4Ks.js → diagram-S7CK7UJ4-DmksuoIf.js} +1 -1
- package/web-shell/assets/{diagram-UQ7AKVKN-CNeEtpni.js → diagram-UQ7AKVKN-DUjgQ8Fg.js} +1 -1
- package/web-shell/assets/{diagram-VSXAHHWV-CYXiWI4p.js → diagram-VSXAHHWV-DUe_FpG-.js} +1 -1
- package/web-shell/assets/{diagram-VX7I27RA-CF7R7hGA.js → diagram-VX7I27RA-CJJ70teK.js} +1 -1
- package/web-shell/assets/{diagram-Z3DM3KII-DZzHpEub.js → diagram-Z3DM3KII-BgABlJO4.js} +1 -1
- package/web-shell/assets/{docx-preview-CjpeB47y.js → docx-preview-BMBWboRx.js} +1 -1
- package/web-shell/assets/{ebnfDiagram-PWID7BFC-CtH0z2j9.js → ebnfDiagram-PWID7BFC-B3nK_Lh7.js} +1 -1
- package/web-shell/assets/{erDiagram-SSCWMZ5O-D51BQ445.js → erDiagram-SSCWMZ5O-DCTdCWlu.js} +1 -1
- package/web-shell/assets/{flowDiagram-A5DVABFB-B1-3lJwP.js → flowDiagram-A5DVABFB-CPxk2UUl.js} +1 -1
- package/web-shell/assets/{ganttDiagram-EL5Y4UJY-iMw3jNW5.js → ganttDiagram-EL5Y4UJY-WZzMAKht.js} +1 -1
- package/web-shell/assets/{gitGraphDiagram-WWUBYQGX-D_KI4JVS.js → gitGraphDiagram-WWUBYQGX-DKcO5ugU.js} +1 -1
- package/web-shell/assets/{index-D1oIEFvH.js → index-CkRLMu1y.js} +6 -6
- package/web-shell/assets/{index-iouf3mnZ.js → index-Dbm3-Fps.js} +1 -1
- package/web-shell/assets/{infoDiagram-RXCK75RN-CwG9MQQq.js → infoDiagram-RXCK75RN-CJX5DzdL.js} +1 -1
- package/web-shell/assets/{ishikawaDiagram-5VMMS53U-C99w6R-O.js → ishikawaDiagram-5VMMS53U-fF0Id5B6.js} +1 -1
- package/web-shell/assets/{journeyDiagram-EYS64GPL--T5XVhJh.js → journeyDiagram-EYS64GPL-BOAezBVe.js} +1 -1
- package/web-shell/assets/{kanban-definition-3QL26DDD-Cs-rGYgZ.js → kanban-definition-3QL26DDD-DdNBof9J.js} +1 -1
- package/web-shell/assets/{layout-BHU2s0xS.js → layout-CXX3l5w0.js} +1 -1
- package/web-shell/assets/{linear-DbLtsa7_.js → linear-Dnaccp-S.js} +1 -1
- package/web-shell/assets/{mermaid.core-CTBkTEXb.js → mermaid.core-BzdC3B6T.js} +6 -6
- package/web-shell/assets/{mindmap-definition-FBJOCRG2-RWLGqkYd.js → mindmap-definition-FBJOCRG2-D-gMUzLw.js} +1 -1
- package/web-shell/assets/{pegDiagram-XKGWAZYB-DIQRWxNr.js → pegDiagram-XKGWAZYB-B9n1WVZq.js} +1 -1
- package/web-shell/assets/{pieDiagram-E7YTZNPT-Dg9VHqU0.js → pieDiagram-E7YTZNPT-ok49U0zT.js} +1 -1
- package/web-shell/assets/{quadrantDiagram-AXDQQJYC-BFeuB7Iq.js → quadrantDiagram-AXDQQJYC-DJKha-v3.js} +1 -1
- package/web-shell/assets/{railroadDiagram-O6MQD6OU-DbO9AYto.js → railroadDiagram-O6MQD6OU-DjL4pl7y.js} +1 -1
- package/web-shell/assets/{requirementDiagram-EFPCY7ZU-ClpOYbUE.js → requirementDiagram-EFPCY7ZU-BpmmRw3A.js} +1 -1
- package/web-shell/assets/{sankeyDiagram-P5KCCOFB-CaHmNc0O.js → sankeyDiagram-P5KCCOFB-KpteHB8X.js} +1 -1
- package/web-shell/assets/{sequenceDiagram-WJ2MYXX4-4r32bqWv.js → sequenceDiagram-WJ2MYXX4-COMghCpA.js} +1 -1
- package/web-shell/assets/{sizeCapture-X5ZJPWSS-CGXqc7rW.js → sizeCapture-X5ZJPWSS-5fEwJD-n.js} +1 -1
- package/web-shell/assets/{stateDiagram-HBIQ2CUA-DuAO60my.js → stateDiagram-HBIQ2CUA-CnC7oXvs.js} +1 -1
- package/web-shell/assets/stateDiagram-v2-4QOOHH4V-V_cfZFBL.js +1 -0
- package/web-shell/assets/{swimlanes-XN3QIQJK-DUQMHZRn.js → swimlanes-XN3QIQJK-bVlhZdve.js} +1 -1
- package/web-shell/assets/swimlanesDiagram-VK2B7HYN-25wVg0WL.js +8 -0
- package/web-shell/assets/{timeline-definition-24CTP7MA-DNCSPOxv.js → timeline-definition-24CTP7MA-CBvYgMu5.js} +1 -1
- package/web-shell/assets/{vennDiagram-4TSXK5OY-Bxh1Z0T6.js → vennDiagram-4TSXK5OY-CUTYvV1j.js} +1 -1
- package/web-shell/assets/{wardleyDiagram-VM6X3IG4-D6fuN1bA.js → wardleyDiagram-VM6X3IG4-Djl4gxCB.js} +1 -1
- package/web-shell/assets/{xychartDiagram-S5SC5T6Z-DkwTa8kZ.js → xychartDiagram-S5SC5T6Z-BcJZtI2X.js} +1 -1
- package/web-shell/index.html +1 -1
- package/web-shell/sw.js +1 -1
- package/web-shell/assets/channel-CvkbH6SO.js +0 -1
- package/web-shell/assets/classDiagram-DTDB5LWJ-DuyseBqE.js +0 -1
- package/web-shell/assets/classDiagram-v2-JRS7N3AN-DuyseBqE.js +0 -1
- package/web-shell/assets/stateDiagram-v2-4QOOHH4V-BjIYif-p.js +0 -1
- package/web-shell/assets/swimlanesDiagram-VK2B7HYN-DZB3DqrF.js +0 -8
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import{getWritableScopes}from"./chunk-
|
|
3
|
+
import{getWritableScopes}from"./chunk-23543L6E.js";import{publicProviderBaseUrl}from"./chunk-YQXX44YA.js";import{isImageGenerationCapable,tryResolveModelProtocol}from"./chunk-AJ75BPTA.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name}from"./chunk-KBWJGX7I.js";init_esbuild_shims();import{createHash}from"node:crypto";function modelKey(scope,provider,model,authType){return createHash("sha256").update(JSON.stringify([scope,provider,model.id,model.baseUrl??"",authType])).digest("hex")}__name(modelKey,"modelKey");function modelEntries(loaded){const seenProviders=new Set;return["System",...getWritableScopes(loaded),"SystemDefaults"].flatMap(scope=>{const providers=loaded.forScope(scope).settings.modelProviders??{};return Object.entries(providers).flatMap(([provider,models])=>{if(seenProviders.has(provider))return[];seenProviders.add(provider);if(!Array.isArray(models))return[];return models.flatMap((model,index)=>{if(!model||typeof model!=="object"||typeof model.id!=="string"||!model.id||model.baseUrl!==void 0&&typeof model.baseUrl!=="string")return[];const authType=tryResolveModelProtocol(provider,model,loaded.merged.providerProtocol);if(!authType||authType==="qwen-oauth")return[];return[{scope,provider,authType,model,index,key:modelKey(scope,provider,model,authType)}]})})})}__name(modelEntries,"modelEntries");function findModelConfiguration(loaded,key){const matches=modelEntries(loaded).filter(entry=>entry.key===key);return matches.length===1&&getWritableScopes(loaded).includes(matches[0].scope)?matches[0]:void 0}__name(findModelConfiguration,"findModelConfiguration");function findModelConfigurationForDeletion(loaded,target){const candidates=modelEntries(loaded).filter(entry=>entry.authType===target.authType&&entry.model.id===target.modelId);const exact=candidates.filter(entry=>(entry.model.baseUrl??void 0)===target.baseUrl);const matches=target.baseUrl!==void 0&&exact.length?exact:candidates;if(matches.length===0)return void 0;return matches.length===1&&getWritableScopes(loaded).includes(matches[0].scope)?matches[0]:"ambiguous"}__name(findModelConfigurationForDeletion,"findModelConfigurationForDeletion");function getModelConfigurationKey(loaded,authType,modelId,baseUrl){const matches=modelEntries(loaded).filter(entry=>entry.authType===authType&&entry.model.id===modelId&&(entry.model.baseUrl??"")===(baseUrl??""));return matches.length===1&&getWritableScopes(loaded).includes(matches[0].scope)?matches[0].key:void 0}__name(getModelConfigurationKey,"getModelConfigurationKey");function isConversationModelConfiguration(model){return!model.imageOnly&&!model.voiceOnly&&!model.fastOnly&&!model.visionOnly&&!model.realtimeOnly}__name(isConversationModelConfiguration,"isConversationModelConfiguration");function isImageModelConfiguration(model){if(!isImageGenerationCapable(model)||model.fastOnly||model.voiceOnly||model.realtimeOnly||!model.baseUrl||typeof model.envKey!=="string"||!model.envKey.trim())return false;try{const url=new URL(model.baseUrl);return url.protocol==="https:"&&!url.username&&!url.password&&!url.search&&!url.hash}catch{return false}}__name(isImageModelConfiguration,"isImageModelConfiguration");function listModelConfigurations(loaded){const entries=modelEntries(loaded);const routeKey=__name(entry=>JSON.stringify([entry.authType,entry.model.id,entry.model.baseUrl??""]),"routeKey");const counts=new Map;for(const entry of entries){const route=routeKey(entry);counts.set(route,(counts.get(route)??0)+1)}const writableScopes=getWritableScopes(loaded);return entries.filter(entry=>writableScopes.includes(entry.scope)).map(entry=>{const{model,authType,key}=entry;const uniqueRoute=counts.get(routeKey(entry))===1;let imageModel;let advisorModel;if(uniqueRoute&&isConversationModelConfiguration(model)){if(!model.baseUrl)advisorModel=`${authType}:${model.id}\0`;else{try{const url=new URL(model.baseUrl);if(["https:","http:"].includes(url.protocol)&&!url.username&&!url.password&&!url.search&&!url.hash)advisorModel=`${authType}:${model.id}\0${model.baseUrl}`}catch{}}}if(uniqueRoute&&isImageModelConfiguration(model)){imageModel=`${authType}:${model.id}\0${model.baseUrl}`}return{key,authType,modelId:model.id,name:model.name,baseUrl:model.baseUrl?publicProviderBaseUrl(model.baseUrl):void 0,envKey:typeof model.envKey==="string"?model.envKey:void 0,contextWindowSize:typeof model.generationConfig?.contextWindowSize==="number"&&Number.isInteger(model.generationConfig.contextWindowSize)&&model.generationConfig.contextWindowSize>0?model.generationConfig.contextWindowSize:void 0,canEditContextWindow:uniqueRoute,purpose:model.imageOnly===true?"image":model.voiceOnly===true?"voice":model.realtimeOnly===true?"realtime":"chat",...imageModel?{imageModel}:{},...advisorModel?{advisorModel}:{}}})}__name(listModelConfigurations,"listModelConfigurations");function updateModelContextWindow(loaded,key,contextWindowSize,assertGenerationOpen){const match=findModelConfiguration(loaded,key);if(!match)return void 0;if(getModelConfigurationKey(loaded,match.authType,match.model.id,match.model.baseUrl)!==key)return void 0;const{scope,provider,index}=match;const providers=loaded.forScope(scope).originalSettings.modelProviders??{};const model=providers[provider][index];const generationConfig={...model.generationConfig};if(contextWindowSize===null)delete generationConfig.contextWindowSize;else generationConfig.contextWindowSize=contextWindowSize;const updated={...model,generationConfig};if(Object.keys(generationConfig).length===0)delete updated.generationConfig;loaded.setValue(scope,"modelProviders",{...providers,[provider]:providers[provider].map((entry,i)=>i===index?updated:entry)},assertGenerationOpen,{throwOnWriteFailure:true});return scope==="Workspace"?"workspace":"user"}__name(updateModelContextWindow,"updateModelContextWindow");export{findModelConfiguration,findModelConfigurationForDeletion,getModelConfigurationKey,isConversationModelConfiguration,isImageModelConfiguration,listModelConfigurations,updateModelContextWindow};
|
|
4
4
|
/**
|
|
5
5
|
* @license
|
|
6
6
|
* Copyright 2025 Qwen Team
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import{sanitizeFilenameForDisplay,truncateToWidth}from"./chunk-64CA3W6G.js";import{t}from"./chunk-4NQCOITC.js";import{isCompressionFailureStatus}from"./chunk-3SQ76U4F.js";import{fetchGitDiff}from"./chunk-I44IFX3I.js";import{skillRestrictionNames}from"./chunk-CV2UAEZA.js";import{findProviderByCredentials,resolveMetadataKey}from"./chunk-BVYNPYGP.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name}from"./chunk-KBWJGX7I.js";init_esbuild_shims();var formatRelativeTime=__name(timestamp=>{const now=Date.now();const diffMs=now-timestamp;const seconds=Math.floor(diffMs/1e3);const minutes=Math.floor(seconds/60);const hours=Math.floor(minutes/60);const days=Math.floor(hours/24);const weeks=Math.floor(days/7);const months=Math.floor(days/30);if(months>0){return months===1?"1 month ago":`${months} months ago`}if(weeks>0){return weeks===1?"1 week ago":`${weeks} weeks ago`}if(days>0){return days===1?"1 day ago":`${days} days ago`}if(hours>0){return hours===1?"1 hour ago":`${hours} hours ago`}if(minutes>0){return minutes===1?"1 minute ago":`${minutes} minutes ago`}return"just now"},"formatRelativeTime");var formatClockTime=__name(timestamp=>`[${new Date(timestamp).toLocaleTimeString("en-US",{hour12:false,hour:"2-digit",minute:"2-digit",second:"2-digit"})}]`,"formatClockTime");var formatTokenCount=__name(count=>{if(count<1e3){return`${count}`}if(count<1e4){return`${(count/1e3).toFixed(1)}k`}return`${Math.floor(count/1e3)}k`},"formatTokenCount");var formatPercentageUsed=__name(percentage=>{if(percentage>1){return">100"}return(percentage*100).toFixed(1)},"formatPercentageUsed");var contextUsageLabel=__name(terminalWidth=>terminalWidth<100?t("% used"):t("% context used"),"contextUsageLabel");var formatDuration=__name((milliseconds,options)=>{if(milliseconds<=0){return"0s"}if(milliseconds<1e3){return`${Math.round(milliseconds)}ms`}const totalSeconds=milliseconds/1e3;if(totalSeconds<60){const formatted=totalSeconds.toFixed(1);if(parseFloat(formatted)>=60){return"1m"}if(options?.hideTrailingZeros&&formatted.endsWith(".0")){return`${formatted.slice(0,-2)}s`}return`${formatted}s`}const hours=Math.floor(totalSeconds/3600);const minutes=Math.floor(totalSeconds%3600/60);const seconds=Math.floor(totalSeconds%60);const parts=[];if(hours>0){parts.push(`${hours}h`)}if(minutes>0){parts.push(`${minutes}m`)}if(seconds>0){parts.push(`${seconds}s`)}if(parts.length===0){if(hours>0)return`${hours}h`;if(minutes>0)return`${minutes}m`;return`${seconds}s`}return parts.join(" ")},"formatDuration");init_esbuild_shims();var formatCompressionTokenCount=__name((count,isEstimated)=>isEstimated?`~${count}`:String(count),"formatCompressionTokenCount");function getCompressionStatusText({isPending,originalTokenCount,newTokenCount,compressionStatus,originalTokenCountIsEstimated,newTokenCountIsEstimated}){if(isPending){return t("Compressing chat history")}const originalTokens=originalTokenCount??0;const newTokens=newTokenCount??0;switch(compressionStatus){case 1:return t("Chat history compressed from {{originalTokens}} to {{newTokens}} tokens.",{originalTokens:formatCompressionTokenCount(originalTokens,originalTokenCountIsEstimated),newTokens:formatCompressionTokenCount(newTokens,newTokenCountIsEstimated)});case 2:if(originalTokens<5e4){return t("Compression was not beneficial for this history size.")}return t("Chat history compression did not reduce size. This may indicate issues with the compression prompt.");case 3:return t("Could not compress chat history due to a token counting error.");case 4:return t("Could not compress chat history because the compression summary was empty.");case 6:return t("Could not compress chat history because the compression summary was truncated.");case 7:return t("Could not compress chat history due to an API error.");case 5:return"Nothing to compress.";default:return""}}__name(getCompressionStatusText,"getCompressionStatusText");function getCompressionFailureStatusText(options){if(!isCompressionFailureStatus(options.compressionStatus)){return t("Failed to compress chat history.")}return getCompressionStatusText({...options,isPending:false})||t("Failed to compress chat history.")}__name(getCompressionFailureStatusText,"getCompressionFailureStatusText");init_esbuild_shims();function getSystemInfoFields(info){const fields=[];addField(fields,t("MiraOS"),formatCliVersion(info));addField(fields,t("Runtime"),formatRuntime(info));addField(fields,t("IDE Client"),info.ideClient);addField(fields,"LSP",info.lspStatus??"");addField(fields,t("OS"),formatOs(info));addField(fields,t("Auth"),formatAuth(info));addField(fields,t("Base URL"),formatBaseUrl(info));addField(fields,t("Model"),info.modelVersion);addField(fields,t("Fast Model"),info.fastModel||info.modelVersion);addField(fields,t("Session ID"),info.sessionId);addField(fields,t("Sandbox"),info.sandboxEnv);addField(fields,t("Proxy"),formatProxy(info.proxy));addField(fields,t("Memory Usage"),info.memoryUsage);return fields}__name(getSystemInfoFields,"getSystemInfoFields");function addField(fields,label,value){if(value){fields.push({label,value})}}__name(addField,"addField");function formatCliVersion(info){if(!info.cliVersion){return""}if(!info.gitCommit){return info.cliVersion}return`${info.cliVersion} (${info.gitCommit})`}__name(formatCliVersion,"formatCliVersion");function formatRuntime(info){if(!info.nodeVersion&&!info.npmVersion){return""}const node=info.nodeVersion?`Node.js ${info.nodeVersion}`:"";const npm=info.npmVersion?`npm ${info.npmVersion}`:"";return joinParts([node,npm]," / ")}__name(formatRuntime,"formatRuntime");function formatOs(info){return joinParts([info.osPlatform,info.osArch,formatOsRelease(info.osRelease)]," ").trim()}__name(formatOs,"formatOs");function formatOsRelease(release){if(!release){return""}return`(${release})`}__name(formatOsRelease,"formatOsRelease");function formatAuth(info){if(!info.selectedAuthType){return""}if(info.selectedAuthType==="qwen-subscription"){return"Qwen Subscription"}const managedProvider=findProviderByCredentials(info.baseUrl,info.apiKeyEnvKey);if(managedProvider&&resolveMetadataKey(managedProvider)){return t(managedProvider.label)}if(info.selectedAuthType.startsWith("oauth")||info.selectedAuthType==="qwen-oauth"){return"Qwen OAuth"}return`API Key - ${info.selectedAuthType}`}__name(formatAuth,"formatAuth");function formatBaseUrl(info){if(!info.selectedAuthType||!info.baseUrl){return""}if(info.selectedAuthType.startsWith("oauth")||info.selectedAuthType==="qwen-oauth"){return""}return info.baseUrl}__name(formatBaseUrl,"formatBaseUrl");function formatProxy(proxy){if(!proxy){return"no proxy"}return redactProxy(proxy)}__name(formatProxy,"formatProxy");function redactProxy(proxy){try{const url=new URL(proxy);if(url.username||url.password){url.username=url.username?"***":"";url.password=url.password?"***":""}return url.toString()}catch{return proxy.replace(/\/\/[^/]*@/,"//***@")}}__name(redactProxy,"redactProxy");function joinParts(parts,separator){return parts.filter(part=>part).join(separator)}__name(joinParts,"joinParts");init_esbuild_shims();function outputTokensPerSecond(outputTokens,durationMs){return outputTokens>0&&durationMs>0?outputTokens/(durationMs/1e3):void 0}__name(outputTokensPerSecond,"outputTokensPerSecond");function computeGenerationRates(generation){const last=generation?.last;return{lastTps:last?outputTokensPerSecond(last.outputTokens,last.ttftMs+last.generationDurationMs):void 0,averageTtft:generation&&generation.timedRequests>0?generation.totalTtftMs/generation.timedRequests:void 0,sessionTps:generation?outputTokensPerSecond(generation.totalOutputSpeedTokens,generation.totalOutputSpeedDurationMs):void 0}}__name(computeGenerationRates,"computeGenerationRates");function calculateErrorRate(metrics){if(metrics.api.totalRequests===0){return 0}return metrics.api.totalErrors/metrics.api.totalRequests*100}__name(calculateErrorRate,"calculateErrorRate");function calculateAverageLatency(metrics){if(metrics.api.totalRequests===0){return 0}return metrics.api.totalLatencyMs/metrics.api.totalRequests}__name(calculateAverageLatency,"calculateAverageLatency");function calculateCacheHitRate(metrics){if(metrics.tokens.prompt===0){return 0}return metrics.tokens.cached/metrics.tokens.prompt*100}__name(calculateCacheHitRate,"calculateCacheHitRate");var computeSessionStats=__name(metrics=>{const{models,tools,files}=metrics;const totalApiTime=Object.values(models).reduce((acc,model)=>acc+model.api.totalLatencyMs,0);const totalToolTime=tools.totalDurationMs;const agentActiveTime=totalApiTime+totalToolTime;const apiTimePercent=agentActiveTime>0?totalApiTime/agentActiveTime*100:0;const toolTimePercent=agentActiveTime>0?totalToolTime/agentActiveTime*100:0;const totalCachedTokens=Object.values(models).reduce((acc,model)=>acc+model.tokens.cached,0);const totalPromptTokens=Object.values(models).reduce((acc,model)=>acc+model.tokens.prompt,0);const cacheEfficiency=totalPromptTokens>0?totalCachedTokens/totalPromptTokens*100:0;const totalDecisions=tools.totalDecisions.accept+tools.totalDecisions.reject+tools.totalDecisions.modify;const successRate=tools.totalCalls>0?tools.totalSuccess/tools.totalCalls*100:0;const agreementRate=totalDecisions>0?tools.totalDecisions.accept/totalDecisions*100:0;return{totalApiTime,totalToolTime,agentActiveTime,apiTimePercent,toolTimePercent,cacheEfficiency,totalDecisions,successRate,agreementRate,totalCachedTokens,totalPromptTokens,totalLinesAdded:files.totalLinesAdded,totalLinesRemoved:files.totalLinesRemoved}},"computeSessionStats");init_esbuild_shims();function calculateCost(args){const{inputTokens,outputTokens,pricing}=args;if(!pricing)return null;if(pricing.inputPerMillionTokens==null&&pricing.outputPerMillionTokens==null){return null}if(inputTokens<=0&&outputTokens<=0){return null}const inputCost=pricing.inputPerMillionTokens!=null?inputTokens/1e6*pricing.inputPerMillionTokens:0;const outputCost=pricing.outputPerMillionTokens!=null?outputTokens/1e6*pricing.outputPerMillionTokens:0;return inputCost+outputCost}__name(calculateCost,"calculateCost");function billableOutputTokens(tokens){const{prompt,candidates,thoughts,total}=tokens;const derived=total-prompt;if(derived>=candidates&&derived<=candidates+thoughts){return derived}return candidates+thoughts}__name(billableOutputTokens,"billableOutputTokens");init_esbuild_shims();function commandRestrictionNames(cmd){const names=cmd.skillDetail?skillRestrictionNames(cmd.skillDetail):[cmd.name.trim().toLowerCase()];return[...names,...cmd.workflowName?[cmd.workflowName.trim().toLowerCase()]:[],...(cmd.altNames??[]).map(name=>name.trim().toLowerCase())]}__name(commandRestrictionNames,"commandRestrictionNames");function getEffectiveSupportedModes(cmd){if(cmd.supportedModes!==void 0){return cmd.supportedModes}switch(cmd.kind){case"built-in":return["interactive"];case"file":case"skill":case"mcp-prompt":return["interactive","non_interactive","acp"];default:return["interactive"]}}__name(getEffectiveSupportedModes,"getEffectiveSupportedModes");function filterCommandsForMode(commands,mode){return commands.filter(cmd=>getEffectiveSupportedModes(cmd).includes(mode))}__name(filterCommandsForMode,"filterCommandsForMode");init_esbuild_shims();function extensionOwnerLabel(owner){return`${t("Extension:")} ${owner.displayName||owner.name||"unknown"}`}__name(extensionOwnerLabel,"extensionOwnerLabel");var MAX_EXTENSION_OWNER_LABEL_WIDTH=35;function getCommandSourceBadge(command){switch(command.source){case"bundled-skill":return"[Skill]";case"skill-dir-command":if(command.sourceDetail==="user"){return"[User]"}if(command.sourceDetail==="project"){return"[Project]"}return"[Custom]";case"plugin-command":if(command.sourceDetail!=="extension"){return"[Plugin]"}return command.sourceLabel?`[${truncateToWidth(command.sourceLabel,MAX_EXTENSION_OWNER_LABEL_WIDTH)}]`:"[Extension]";case"mcp-prompt":return"[MCP]";case"workflow-command":return command.sourceDetail==="extension"&&command.sourceLabel?`[${truncateToWidth(command.sourceLabel,MAX_EXTENSION_OWNER_LABEL_WIDTH)}]`:null;case"builtin-command":default:return null}}__name(getCommandSourceBadge,"getCommandSourceBadge");function getCommandSourceGroup(command){switch(command.source){case"builtin-command":return{key:"built-in",title:"Built-in Commands",order:0};case"bundled-skill":return{key:"bundled-skill",title:"Bundled Skills",order:1};case"skill-dir-command":return{key:"custom",title:"Custom Commands",order:2};case"plugin-command":return{key:"plugin",title:"Plugin Commands",order:3};case"mcp-prompt":return{key:"mcp",title:"MCP Commands",order:4};default:return{key:"other",title:"Other Commands",order:5}}}__name(getCommandSourceGroup,"getCommandSourceGroup");function formatSupportedModes(command){const modes=getEffectiveSupportedModes(command);const hasInteractive=modes.includes("interactive");const hasNonInteractive=modes.includes("non_interactive");const hasAcp=modes.includes("acp");if(hasInteractive&&hasNonInteractive&&hasAcp){return"[all]"}if(!hasInteractive&&hasNonInteractive&&hasAcp){return"[headless]"}if(hasInteractive&&!hasNonInteractive&&!hasAcp){return"[interactive]"}return modes.map(mode=>{switch(mode){case"interactive":return"[i]";case"non_interactive":return"[ni]";case"acp":return"[acp]";default:return`[${mode}]`}}).join(" ")}__name(formatSupportedModes,"formatSupportedModes");function getCommandDisplayName(command,options={}){const prefix=options.prefix??"";const baseLabel=`${prefix}${command.name}`;if(options.matchedAlias){return`${baseLabel} (alias: ${options.matchedAlias})`}if(options.includeAliases===false){return baseLabel}const altNames=command.altNames?.filter(Boolean);if(!altNames||altNames.length===0){return baseLabel}return`${baseLabel} (${altNames.join(", ")})`}__name(getCommandDisplayName,"getCommandDisplayName");function getCommandSubcommandNames(command){return command.subCommands?.filter(subCommand=>!subCommand.hidden).map(subCommand=>subCommand.name)??[]}__name(getCommandSubcommandNames,"getCommandSubcommandNames");init_esbuild_shims();function levelLabel(level){switch(level){case"project":return t("Project");case"user":return t("User");case"extension":return t("Extension");case"bundled":return t("Bundled");default:{const _exhaustive=level;return _exhaustive}}}__name(levelLabel,"levelLabel");function skillOriginLabel(skill){if(skill.level==="extension"){return`(${extensionOwnerLabel({name:skill.extensionName,displayName:skill.extensionDisplayName})})`}return`(${levelLabel(skill.level)})`}__name(skillOriginLabel,"skillOriginLabel");init_esbuild_shims();async function diffAction(context){const{config}=context.services;if(!config){return{type:"message",messageType:"error",content:t("Configuration not available.")}}if(config.getShellExecutionSandbox?.()){return{type:"message",messageType:"error",content:"Diff preview unavailable in tool sandbox. Run git diff through the Shell tool."}}if(context.executionMode==="interactive"){return{type:"dialog",dialog:"diff"}}const cwd=config.getWorkingDir()||config.getProjectRoot();if(!cwd){return{type:"message",messageType:"error",content:t("Could not determine current working directory.")}}let result;try{result=await fetchGitDiff(cwd)}catch(error){return{type:"message",messageType:"error",content:`${t("Failed to compute git diff stats")}: ${error instanceof Error?error.message:String(error)}`}}if(!result){return{type:"message",messageType:"info",content:t("No diff available. Either this is not a git repository, HEAD is missing, or a merge/rebase/cherry-pick/revert is in progress.")}}if(result.stats.filesCount===0){return{type:"message",messageType:"info",content:t("Clean working tree \u2014 no changes against HEAD.")}}const model=buildDiffRenderModel(result);return{type:"message",messageType:"info",content:renderDiffModelText(model)}}__name(diffAction,"diffAction");function buildDiffRenderModel(result){const rows=[];for(const[filename,s]of result.perFileStats){rows.push(toRow(filename,s))}const hiddenCount=Math.max(0,result.stats.filesCount-rows.length);return{filesCount:result.stats.filesCount,linesAdded:result.stats.linesAdded,linesRemoved:result.stats.linesRemoved,rows,hiddenCount}}__name(buildDiffRenderModel,"buildDiffRenderModel");function toRow(filename,s){if(s.isBinary){return{filename,oldPath:s.oldPath,isBinary:true,isUntracked:Boolean(s.isUntracked),isDeleted:Boolean(s.isDeleted),truncated:false}}return{filename,oldPath:s.oldPath,added:s.added,removed:s.isUntracked?0:s.removed,isBinary:false,isUntracked:Boolean(s.isUntracked),isDeleted:Boolean(s.isDeleted),truncated:Boolean(s.truncated)}}__name(toRow,"toRow");function computeDiffColumnWidths(rows){let maxAdded=0;let maxRemoved=0;for(const r of rows){if(r.isBinary)continue;if((r.added??0)>maxAdded)maxAdded=r.added??0;if((r.removed??0)>maxRemoved)maxRemoved=r.removed??0}const addWidth=String(maxAdded).length;const remWidth=String(maxRemoved).length;const statColumnWidth=1+addWidth+1+1+remWidth;return{addWidth,remWidth,statColumnWidth}}__name(computeDiffColumnWidths,"computeDiffColumnWidths");function renderDiffModelText(model){const{filesCount,linesAdded,linesRemoved,rows,hiddenCount}=model;const header=filesCount===1?t("{{count}} file changed, +{{added}} / -{{removed}}",{count:String(filesCount),added:String(linesAdded),removed:String(linesRemoved)}):t("{{count}} files changed, +{{added}} / -{{removed}}",{count:String(filesCount),added:String(linesAdded),removed:String(linesRemoved)});const lines=formatRowsText(rows);const capNote=hiddenCount>0&&rows.length>0?`
|
|
3
|
+
import{sanitizeFilenameForDisplay,truncateToWidth}from"./chunk-64CA3W6G.js";import{t}from"./chunk-FK5L2WVV.js";import{isCompressionFailureStatus}from"./chunk-PFKTTUGS.js";import{fetchGitDiff}from"./chunk-I44IFX3I.js";import{skillRestrictionNames}from"./chunk-CV2UAEZA.js";import{findProviderByCredentials,resolveMetadataKey}from"./chunk-AJ75BPTA.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name}from"./chunk-KBWJGX7I.js";init_esbuild_shims();var formatRelativeTime=__name(timestamp=>{const now=Date.now();const diffMs=now-timestamp;const seconds=Math.floor(diffMs/1e3);const minutes=Math.floor(seconds/60);const hours=Math.floor(minutes/60);const days=Math.floor(hours/24);const weeks=Math.floor(days/7);const months=Math.floor(days/30);if(months>0){return months===1?"1 month ago":`${months} months ago`}if(weeks>0){return weeks===1?"1 week ago":`${weeks} weeks ago`}if(days>0){return days===1?"1 day ago":`${days} days ago`}if(hours>0){return hours===1?"1 hour ago":`${hours} hours ago`}if(minutes>0){return minutes===1?"1 minute ago":`${minutes} minutes ago`}return"just now"},"formatRelativeTime");var formatClockTime=__name(timestamp=>`[${new Date(timestamp).toLocaleTimeString("en-US",{hour12:false,hour:"2-digit",minute:"2-digit",second:"2-digit"})}]`,"formatClockTime");var formatTokenCount=__name(count=>{if(count<1e3){return`${count}`}if(count<1e4){return`${(count/1e3).toFixed(1)}k`}return`${Math.floor(count/1e3)}k`},"formatTokenCount");var formatPercentageUsed=__name(percentage=>{if(percentage>1){return">100"}return(percentage*100).toFixed(1)},"formatPercentageUsed");var contextUsageLabel=__name(terminalWidth=>terminalWidth<100?t("% used"):t("% context used"),"contextUsageLabel");var formatDuration=__name((milliseconds,options)=>{if(milliseconds<=0){return"0s"}if(milliseconds<1e3){return`${Math.round(milliseconds)}ms`}const totalSeconds=milliseconds/1e3;if(totalSeconds<60){const formatted=totalSeconds.toFixed(1);if(parseFloat(formatted)>=60){return"1m"}if(options?.hideTrailingZeros&&formatted.endsWith(".0")){return`${formatted.slice(0,-2)}s`}return`${formatted}s`}const hours=Math.floor(totalSeconds/3600);const minutes=Math.floor(totalSeconds%3600/60);const seconds=Math.floor(totalSeconds%60);const parts=[];if(hours>0){parts.push(`${hours}h`)}if(minutes>0){parts.push(`${minutes}m`)}if(seconds>0){parts.push(`${seconds}s`)}if(parts.length===0){if(hours>0)return`${hours}h`;if(minutes>0)return`${minutes}m`;return`${seconds}s`}return parts.join(" ")},"formatDuration");init_esbuild_shims();var formatCompressionTokenCount=__name((count,isEstimated)=>isEstimated?`~${count}`:String(count),"formatCompressionTokenCount");function getCompressionStatusText({isPending,originalTokenCount,newTokenCount,compressionStatus,originalTokenCountIsEstimated,newTokenCountIsEstimated}){if(isPending){return t("Compressing chat history")}const originalTokens=originalTokenCount??0;const newTokens=newTokenCount??0;switch(compressionStatus){case 1:return t("Chat history compressed from {{originalTokens}} to {{newTokens}} tokens.",{originalTokens:formatCompressionTokenCount(originalTokens,originalTokenCountIsEstimated),newTokens:formatCompressionTokenCount(newTokens,newTokenCountIsEstimated)});case 2:if(originalTokens<5e4){return t("Compression was not beneficial for this history size.")}return t("Chat history compression did not reduce size. This may indicate issues with the compression prompt.");case 3:return t("Could not compress chat history due to a token counting error.");case 4:return t("Could not compress chat history because the compression summary was empty.");case 6:return t("Could not compress chat history because the compression summary was truncated.");case 7:return t("Could not compress chat history due to an API error.");case 5:return"Nothing to compress.";default:return""}}__name(getCompressionStatusText,"getCompressionStatusText");function getCompressionFailureStatusText(options){if(!isCompressionFailureStatus(options.compressionStatus)){return t("Failed to compress chat history.")}return getCompressionStatusText({...options,isPending:false})||t("Failed to compress chat history.")}__name(getCompressionFailureStatusText,"getCompressionFailureStatusText");init_esbuild_shims();function getSystemInfoFields(info){const fields=[];addField(fields,t("MiraOS"),formatCliVersion(info));addField(fields,t("Runtime"),formatRuntime(info));addField(fields,t("IDE Client"),info.ideClient);addField(fields,"LSP",info.lspStatus??"");addField(fields,t("OS"),formatOs(info));addField(fields,t("Auth"),formatAuth(info));addField(fields,t("Base URL"),formatBaseUrl(info));addField(fields,t("Model"),info.modelVersion);addField(fields,t("Fast Model"),info.fastModel||info.modelVersion);addField(fields,t("Session ID"),info.sessionId);addField(fields,t("Sandbox"),info.sandboxEnv);addField(fields,t("Proxy"),formatProxy(info.proxy));addField(fields,t("Memory Usage"),info.memoryUsage);return fields}__name(getSystemInfoFields,"getSystemInfoFields");function addField(fields,label,value){if(value){fields.push({label,value})}}__name(addField,"addField");function formatCliVersion(info){if(!info.cliVersion){return""}if(!info.gitCommit){return info.cliVersion}return`${info.cliVersion} (${info.gitCommit})`}__name(formatCliVersion,"formatCliVersion");function formatRuntime(info){if(!info.nodeVersion&&!info.npmVersion){return""}const node=info.nodeVersion?`Node.js ${info.nodeVersion}`:"";const npm=info.npmVersion?`npm ${info.npmVersion}`:"";return joinParts([node,npm]," / ")}__name(formatRuntime,"formatRuntime");function formatOs(info){return joinParts([info.osPlatform,info.osArch,formatOsRelease(info.osRelease)]," ").trim()}__name(formatOs,"formatOs");function formatOsRelease(release){if(!release){return""}return`(${release})`}__name(formatOsRelease,"formatOsRelease");function formatAuth(info){if(!info.selectedAuthType){return""}if(info.selectedAuthType==="qwen-subscription"){return"Qwen Subscription"}const managedProvider=findProviderByCredentials(info.baseUrl,info.apiKeyEnvKey);if(managedProvider&&resolveMetadataKey(managedProvider)){return t(managedProvider.label)}if(info.selectedAuthType.startsWith("oauth")||info.selectedAuthType==="qwen-oauth"){return"Qwen OAuth"}return`API Key - ${info.selectedAuthType}`}__name(formatAuth,"formatAuth");function formatBaseUrl(info){if(!info.selectedAuthType||!info.baseUrl){return""}if(info.selectedAuthType.startsWith("oauth")||info.selectedAuthType==="qwen-oauth"){return""}return info.baseUrl}__name(formatBaseUrl,"formatBaseUrl");function formatProxy(proxy){if(!proxy){return"no proxy"}return redactProxy(proxy)}__name(formatProxy,"formatProxy");function redactProxy(proxy){try{const url=new URL(proxy);if(url.username||url.password){url.username=url.username?"***":"";url.password=url.password?"***":""}return url.toString()}catch{return proxy.replace(/\/\/[^/]*@/,"//***@")}}__name(redactProxy,"redactProxy");function joinParts(parts,separator){return parts.filter(part=>part).join(separator)}__name(joinParts,"joinParts");init_esbuild_shims();function outputTokensPerSecond(outputTokens,durationMs){return outputTokens>0&&durationMs>0?outputTokens/(durationMs/1e3):void 0}__name(outputTokensPerSecond,"outputTokensPerSecond");function computeGenerationRates(generation){const last=generation?.last;return{lastTps:last?outputTokensPerSecond(last.outputTokens,last.ttftMs+last.generationDurationMs):void 0,averageTtft:generation&&generation.timedRequests>0?generation.totalTtftMs/generation.timedRequests:void 0,sessionTps:generation?outputTokensPerSecond(generation.totalOutputSpeedTokens,generation.totalOutputSpeedDurationMs):void 0}}__name(computeGenerationRates,"computeGenerationRates");function calculateErrorRate(metrics){if(metrics.api.totalRequests===0){return 0}return metrics.api.totalErrors/metrics.api.totalRequests*100}__name(calculateErrorRate,"calculateErrorRate");function calculateAverageLatency(metrics){if(metrics.api.totalRequests===0){return 0}return metrics.api.totalLatencyMs/metrics.api.totalRequests}__name(calculateAverageLatency,"calculateAverageLatency");function calculateCacheHitRate(metrics){if(metrics.tokens.prompt===0){return 0}return metrics.tokens.cached/metrics.tokens.prompt*100}__name(calculateCacheHitRate,"calculateCacheHitRate");var computeSessionStats=__name(metrics=>{const{models,tools,files}=metrics;const totalApiTime=Object.values(models).reduce((acc,model)=>acc+model.api.totalLatencyMs,0);const totalToolTime=tools.totalDurationMs;const agentActiveTime=totalApiTime+totalToolTime;const apiTimePercent=agentActiveTime>0?totalApiTime/agentActiveTime*100:0;const toolTimePercent=agentActiveTime>0?totalToolTime/agentActiveTime*100:0;const totalCachedTokens=Object.values(models).reduce((acc,model)=>acc+model.tokens.cached,0);const totalPromptTokens=Object.values(models).reduce((acc,model)=>acc+model.tokens.prompt,0);const cacheEfficiency=totalPromptTokens>0?totalCachedTokens/totalPromptTokens*100:0;const totalDecisions=tools.totalDecisions.accept+tools.totalDecisions.reject+tools.totalDecisions.modify;const successRate=tools.totalCalls>0?tools.totalSuccess/tools.totalCalls*100:0;const agreementRate=totalDecisions>0?tools.totalDecisions.accept/totalDecisions*100:0;return{totalApiTime,totalToolTime,agentActiveTime,apiTimePercent,toolTimePercent,cacheEfficiency,totalDecisions,successRate,agreementRate,totalCachedTokens,totalPromptTokens,totalLinesAdded:files.totalLinesAdded,totalLinesRemoved:files.totalLinesRemoved}},"computeSessionStats");init_esbuild_shims();function calculateCost(args){const{inputTokens,outputTokens,pricing}=args;if(!pricing)return null;if(pricing.inputPerMillionTokens==null&&pricing.outputPerMillionTokens==null){return null}if(inputTokens<=0&&outputTokens<=0){return null}const inputCost=pricing.inputPerMillionTokens!=null?inputTokens/1e6*pricing.inputPerMillionTokens:0;const outputCost=pricing.outputPerMillionTokens!=null?outputTokens/1e6*pricing.outputPerMillionTokens:0;return inputCost+outputCost}__name(calculateCost,"calculateCost");function billableOutputTokens(tokens){const{prompt,candidates,thoughts,total}=tokens;const derived=total-prompt;if(derived>=candidates&&derived<=candidates+thoughts){return derived}return candidates+thoughts}__name(billableOutputTokens,"billableOutputTokens");init_esbuild_shims();function commandRestrictionNames(cmd){const names=cmd.skillDetail?skillRestrictionNames(cmd.skillDetail):[cmd.name.trim().toLowerCase()];return[...names,...cmd.workflowName?[cmd.workflowName.trim().toLowerCase()]:[],...(cmd.altNames??[]).map(name=>name.trim().toLowerCase())]}__name(commandRestrictionNames,"commandRestrictionNames");function getEffectiveSupportedModes(cmd){if(cmd.supportedModes!==void 0){return cmd.supportedModes}switch(cmd.kind){case"built-in":return["interactive"];case"file":case"skill":case"mcp-prompt":return["interactive","non_interactive","acp"];default:return["interactive"]}}__name(getEffectiveSupportedModes,"getEffectiveSupportedModes");function filterCommandsForMode(commands,mode){return commands.filter(cmd=>getEffectiveSupportedModes(cmd).includes(mode))}__name(filterCommandsForMode,"filterCommandsForMode");init_esbuild_shims();function extensionOwnerLabel(owner){return`${t("Extension:")} ${owner.displayName||owner.name||"unknown"}`}__name(extensionOwnerLabel,"extensionOwnerLabel");var MAX_EXTENSION_OWNER_LABEL_WIDTH=35;function getCommandSourceBadge(command){switch(command.source){case"bundled-skill":return"[Skill]";case"skill-dir-command":if(command.sourceDetail==="user"){return"[User]"}if(command.sourceDetail==="project"){return"[Project]"}return"[Custom]";case"plugin-command":if(command.sourceDetail!=="extension"){return"[Plugin]"}return command.sourceLabel?`[${truncateToWidth(command.sourceLabel,MAX_EXTENSION_OWNER_LABEL_WIDTH)}]`:"[Extension]";case"mcp-prompt":return"[MCP]";case"workflow-command":return command.sourceDetail==="extension"&&command.sourceLabel?`[${truncateToWidth(command.sourceLabel,MAX_EXTENSION_OWNER_LABEL_WIDTH)}]`:null;case"builtin-command":default:return null}}__name(getCommandSourceBadge,"getCommandSourceBadge");function getCommandSourceGroup(command){switch(command.source){case"builtin-command":return{key:"built-in",title:"Built-in Commands",order:0};case"bundled-skill":return{key:"bundled-skill",title:"Bundled Skills",order:1};case"skill-dir-command":return{key:"custom",title:"Custom Commands",order:2};case"plugin-command":return{key:"plugin",title:"Plugin Commands",order:3};case"mcp-prompt":return{key:"mcp",title:"MCP Commands",order:4};default:return{key:"other",title:"Other Commands",order:5}}}__name(getCommandSourceGroup,"getCommandSourceGroup");function formatSupportedModes(command){const modes=getEffectiveSupportedModes(command);const hasInteractive=modes.includes("interactive");const hasNonInteractive=modes.includes("non_interactive");const hasAcp=modes.includes("acp");if(hasInteractive&&hasNonInteractive&&hasAcp){return"[all]"}if(!hasInteractive&&hasNonInteractive&&hasAcp){return"[headless]"}if(hasInteractive&&!hasNonInteractive&&!hasAcp){return"[interactive]"}return modes.map(mode=>{switch(mode){case"interactive":return"[i]";case"non_interactive":return"[ni]";case"acp":return"[acp]";default:return`[${mode}]`}}).join(" ")}__name(formatSupportedModes,"formatSupportedModes");function getCommandDisplayName(command,options={}){const prefix=options.prefix??"";const baseLabel=`${prefix}${command.name}`;if(options.matchedAlias){return`${baseLabel} (alias: ${options.matchedAlias})`}if(options.includeAliases===false){return baseLabel}const altNames=command.altNames?.filter(Boolean);if(!altNames||altNames.length===0){return baseLabel}return`${baseLabel} (${altNames.join(", ")})`}__name(getCommandDisplayName,"getCommandDisplayName");function getCommandSubcommandNames(command){return command.subCommands?.filter(subCommand=>!subCommand.hidden).map(subCommand=>subCommand.name)??[]}__name(getCommandSubcommandNames,"getCommandSubcommandNames");init_esbuild_shims();function levelLabel(level){switch(level){case"project":return t("Project");case"user":return t("User");case"extension":return t("Extension");case"bundled":return t("Bundled");default:{const _exhaustive=level;return _exhaustive}}}__name(levelLabel,"levelLabel");function skillOriginLabel(skill){if(skill.level==="extension"){return`(${extensionOwnerLabel({name:skill.extensionName,displayName:skill.extensionDisplayName})})`}return`(${levelLabel(skill.level)})`}__name(skillOriginLabel,"skillOriginLabel");init_esbuild_shims();async function diffAction(context){const{config}=context.services;if(!config){return{type:"message",messageType:"error",content:t("Configuration not available.")}}if(config.getShellExecutionSandbox?.()){return{type:"message",messageType:"error",content:"Diff preview unavailable in tool sandbox. Run git diff through the Shell tool."}}if(context.executionMode==="interactive"){return{type:"dialog",dialog:"diff"}}const cwd=config.getWorkingDir()||config.getProjectRoot();if(!cwd){return{type:"message",messageType:"error",content:t("Could not determine current working directory.")}}let result;try{result=await fetchGitDiff(cwd)}catch(error){return{type:"message",messageType:"error",content:`${t("Failed to compute git diff stats")}: ${error instanceof Error?error.message:String(error)}`}}if(!result){return{type:"message",messageType:"info",content:t("No diff available. Either this is not a git repository, HEAD is missing, or a merge/rebase/cherry-pick/revert is in progress.")}}if(result.stats.filesCount===0){return{type:"message",messageType:"info",content:t("Clean working tree \u2014 no changes against HEAD.")}}const model=buildDiffRenderModel(result);return{type:"message",messageType:"info",content:renderDiffModelText(model)}}__name(diffAction,"diffAction");function buildDiffRenderModel(result){const rows=[];for(const[filename,s]of result.perFileStats){rows.push(toRow(filename,s))}const hiddenCount=Math.max(0,result.stats.filesCount-rows.length);return{filesCount:result.stats.filesCount,linesAdded:result.stats.linesAdded,linesRemoved:result.stats.linesRemoved,rows,hiddenCount}}__name(buildDiffRenderModel,"buildDiffRenderModel");function toRow(filename,s){if(s.isBinary){return{filename,oldPath:s.oldPath,isBinary:true,isUntracked:Boolean(s.isUntracked),isDeleted:Boolean(s.isDeleted),truncated:false}}return{filename,oldPath:s.oldPath,added:s.added,removed:s.isUntracked?0:s.removed,isBinary:false,isUntracked:Boolean(s.isUntracked),isDeleted:Boolean(s.isDeleted),truncated:Boolean(s.truncated)}}__name(toRow,"toRow");function computeDiffColumnWidths(rows){let maxAdded=0;let maxRemoved=0;for(const r of rows){if(r.isBinary)continue;if((r.added??0)>maxAdded)maxAdded=r.added??0;if((r.removed??0)>maxRemoved)maxRemoved=r.removed??0}const addWidth=String(maxAdded).length;const remWidth=String(maxRemoved).length;const statColumnWidth=1+addWidth+1+1+remWidth;return{addWidth,remWidth,statColumnWidth}}__name(computeDiffColumnWidths,"computeDiffColumnWidths");function renderDiffModelText(model){const{filesCount,linesAdded,linesRemoved,rows,hiddenCount}=model;const header=filesCount===1?t("{{count}} file changed, +{{added}} / -{{removed}}",{count:String(filesCount),added:String(linesAdded),removed:String(linesRemoved)}):t("{{count}} files changed, +{{added}} / -{{removed}}",{count:String(filesCount),added:String(linesAdded),removed:String(linesRemoved)});const lines=formatRowsText(rows);const capNote=hiddenCount>0&&rows.length>0?`
|
|
4
4
|
${t("\u2026and {{hidden}} more (showing first {{shown}})",{hidden:String(hiddenCount),shown:String(rows.length)})}`:"";return lines.length>0?`${header}
|
|
5
5
|
${lines.join("\n")}${capNote}`:header}__name(renderDiffModelText,"renderDiffModelText");function formatRowsText(rows){if(rows.length===0)return[];const{addWidth,remWidth,statColumnWidth}=computeDiffColumnWidths(rows);const out=[];for(const r of rows){const safeName=sanitizeFilenameForDisplay(r.filename);const displayName=r.oldPath?`${sanitizeFilenameForDisplay(r.oldPath)} \u2192 ${safeName}`:safeName;if(r.isBinary){const suffix2=r.isUntracked?` ${t("(binary, new)")}`:r.isDeleted?` ${t("(binary, deleted)")}`:` ${t("(binary)")}`;out.push(` ${padMarker("~",statColumnWidth)} ${displayName}${suffix2}`);continue}const added=`+${String(r.added??0).padStart(addWidth)}`;const removed=`-${String(r.removed??0).padStart(remWidth)}`;let suffix="";if(r.isUntracked){suffix=r.truncated?` ${t("(new, partial)")}`:` ${t("(new)")}`}else if(r.isDeleted){suffix=` ${t("(deleted)")}`}out.push(` ${added} ${removed} ${displayName}${suffix}`)}return out}__name(formatRowsText,"formatRowsText");function padMarker(marker,width){if(marker.length>=width)return marker;return`${marker}${" ".repeat(width-marker.length)}`}__name(padMarker,"padMarker");var diffCommand={name:"diff",get description(){return t("Show working-tree change stats versus HEAD")},kind:"built-in",supportedModes:["interactive","non_interactive","acp"],action:diffAction};init_esbuild_shims();var INLINE_MATH_MAX_CHARS=1024;var INLINE_CODE_SPAN_PATTERN_SOURCE=String.raw`(?<!\`)(?<inlineCodeFence>\`+)(?!\`).+?(?<!\`)\k<inlineCodeFence>(?!\`)`;var INLINE_CODE_SPAN_RE=new RegExp(INLINE_CODE_SPAN_PATTERN_SOURCE,"g");function isEscapedAt(text,index){let slashCount=0;for(let cursor=index-1;cursor>=0&&text[cursor]==="\\";cursor-=1){slashCount+=1}return slashCount%2===1}__name(isEscapedAt,"isEscapedAt");function isUnescapedDollarAt(text,index){return text[index]==="$"&&!isEscapedAt(text,index)}__name(isUnescapedDollarAt,"isUnescapedDollarAt");function unescapeMarkdownDollars(text){return text.replace(/(\\+)\$/g,(_match,slashes)=>`${"\\".repeat(Math.floor(slashes.length/2))}$`)}__name(unescapeMarkdownDollars,"unescapeMarkdownDollars");function unescapeMarkdownBeforeMath(text){return unescapeMarkdownDollars(`${text}$`).slice(0,-1)}__name(unescapeMarkdownBeforeMath,"unescapeMarkdownBeforeMath");function readInlineMathSpan(text,index){if(!isUnescapedDollarAt(text,index)){return null}const previous=text[index-1]??"";const next=text[index+1]??"";if(/\w/.test(previous)||isUnescapedDollarAt(text,index-1)||!next||/[\s\d$]/.test(next)){return null}let closingIndex=index+1;while(closingIndex<text.length&&text[closingIndex]!=="\n"&&closingIndex-index-1<=INLINE_MATH_MAX_CHARS&&!isUnescapedDollarAt(text,closingIndex)){closingIndex+=1}if(!isUnescapedDollarAt(text,closingIndex)){return null}const content=text.slice(index+1,closingIndex);const following=text[closingIndex+1]??"";if(content.length>INLINE_MATH_MAX_CHARS||/\s$/.test(content)||/[\w$]/.test(following)){return null}return{content,index,raw:text.slice(index,closingIndex+1)}}__name(readInlineMathSpan,"readInlineMathSpan");function findNextInlineMath(text,fromIndex=0){for(let index=fromIndex;index<text.length;index+=1){const span=readInlineMathSpan(text,index);if(span){return span}}return null}__name(findNextInlineMath,"findNextInlineMath");function*mergeInlineMathMatches(text,markupRegex,enableInlineMath=true){markupRegex.lastIndex=0;const markupMatches=text.matchAll(markupRegex);let nextMarkup=markupMatches.next();let nextMath=enableInlineMath?findNextInlineMath(text):null;let cursor=0;while(!nextMarkup.done||nextMath){while(!nextMarkup.done&&(nextMarkup.value.index??0)<cursor){nextMarkup=markupMatches.next()}if(nextMath&&nextMath.index<cursor){nextMath=findNextInlineMath(text,cursor)}const markupIndex=nextMarkup.done?Number.POSITIVE_INFINITY:nextMarkup.value.index??0;const mathIndex=nextMath?.index??Number.POSITIVE_INFINITY;if(!nextMarkup.done&&markupIndex<=mathIndex){const match=nextMarkup.value;yield{kind:"markup",match};cursor=markupIndex+match[0].length;nextMarkup=markupMatches.next()}else if(nextMath){yield{kind:"math",span:nextMath};cursor=mathIndex+nextMath.raw.length;nextMath=findNextInlineMath(text,cursor)}}}__name(mergeInlineMathMatches,"mergeInlineMathMatches");function findInlineMathExpressions(text){const expressions=[];for(const token of mergeInlineMathMatches(text,INLINE_CODE_SPAN_RE)){if(token.kind==="math"){expressions.push(token.span.content)}}return expressions}__name(findInlineMathExpressions,"findInlineMathExpressions");function readInlineMathSpanAt(text,index){return readInlineMathSpan(text,index)?.raw??null}__name(readInlineMathSpanAt,"readInlineMathSpanAt");export{formatRelativeTime,formatClockTime,formatTokenCount,formatPercentageUsed,contextUsageLabel,formatDuration,INLINE_CODE_SPAN_PATTERN_SOURCE,unescapeMarkdownDollars,unescapeMarkdownBeforeMath,mergeInlineMathMatches,findInlineMathExpressions,readInlineMathSpanAt,formatCompressionTokenCount,getCompressionStatusText,getCompressionFailureStatusText,getSystemInfoFields,redactProxy,computeGenerationRates,calculateErrorRate,calculateAverageLatency,calculateCacheHitRate,computeSessionStats,calculateCost,billableOutputTokens,commandRestrictionNames,getEffectiveSupportedModes,filterCommandsForMode,extensionOwnerLabel,MAX_EXTENSION_OWNER_LABEL_WIDTH,getCommandSourceBadge,getCommandSourceGroup,formatSupportedModes,getCommandDisplayName,getCommandSubcommandNames,levelLabel,skillOriginLabel,computeDiffColumnWidths,diffCommand};
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import{parseCallerSuppliedSessionId}from"./chunk-LGFF5PJA.js";import{isInternalWorkspaceRuntime}from"./chunk-M5KJJE2X.js";import{canonicalizeWorkspace}from"./chunk-L5UULTGF.js";import{isWithinRoot}from"./chunk-IDXJIDME.js";import{SessionService}from"./chunk-3SQ76U4F.js";import{WORKTREE_SESSION_FILE,gitEnv}from"./chunk-I44IFX3I.js";import{Storage}from"./chunk-5VB4YX3Z.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name}from"./chunk-KBWJGX7I.js";init_esbuild_shims();function runWithWorkspaceRuntimeStorage(runtime,fn){return Storage.runWithResolvedRuntimeBaseDir(runtime.sessionRuntimeBaseDir,fn)}__name(runWithWorkspaceRuntimeStorage,"runWithWorkspaceRuntimeStorage");function createWorkspaceRuntimeSessionService(runtime,options={}){return new SessionService(runtime.workspaceCwd,{...options,runtimeBaseDir:runtime.sessionRuntimeBaseDir})}__name(createWorkspaceRuntimeSessionService,"createWorkspaceRuntimeSessionService");init_esbuild_shims();import*as fs from"node:fs";import*as fsPromises from"node:fs/promises";import path from"node:path";import{execFile}from"node:child_process";import{promisify}from"node:util";var execFileAsync=promisify(execFile);function isGitProbeInfrastructureError(error){const failure=error;return failure.killed===true||typeof failure.code==="string"&&["ENOENT","EACCES","EAGAIN","ENOMEM","ETIMEDOUT"].includes(failure.code)}__name(isGitProbeInfrastructureError,"isGitProbeInfrastructureError");async function isGitInfrastructureFault(error,cwd){if(!isGitProbeInfrastructureError(error))return false;const code=error.code;if(code!=="ENOENT"&&code!=="EACCES")return true;try{await fsPromises.access(cwd,fs.constants.X_OK);return true}catch{return false}}__name(isGitInfrastructureFault,"isGitInfrastructureFault");function resolveWorkspaceEntryFromParam(registry,req,res,paramName="workspace"){const selector=req.params[paramName]??"";const entry=resolveWorkspaceEntryBySelector(registry,selector);if(entry)return entry;if(!isPortableAbsolutePath(selector)){res.status(400).json({error:`\`:${paramName}\` must decode to a workspace id or absolute path`,code:"workspace_mismatch"});return null}sendWorkspaceMismatch(res,registry);return null}__name(resolveWorkspaceEntryFromParam,"resolveWorkspaceEntryFromParam");function resolveWorkspaceEntryBySelector(registry,selector){const byId=registry.getEntryByWorkspaceId(selector);if(byId)return byId;if(!isPortableAbsolutePath(selector))return void 0;const exact=registry.getEntryByWorkspaceCwd(selector);if(exact)return exact;if(path.isAbsolute(selector)&&!isUncPath(selector)){try{const canonicalSelector=canonicalizeWorkspace(selector);const canonicalMatch=registry.getEntryByWorkspaceCwd(canonicalSelector);if(canonicalMatch)return canonicalMatch;for(const candidate of registry.listEntries()){if(canonicalizeWorkspace(candidate.workspaceCwd)===canonicalSelector){return candidate}}}catch{}}const normalizedSelector=normalizePortableAbsolutePath(selector);return registry.listEntries().find(candidate=>normalizePortableAbsolutePath(candidate.workspaceCwd)===normalizedSelector)}__name(resolveWorkspaceEntryBySelector,"resolveWorkspaceEntryBySelector");function isPortableAbsolutePath(value){return path.isAbsolute(value)||/^[A-Za-z]:[\\/]/.test(value)||/^\\\\[^\\]+\\[^\\]+/.test(value)}__name(isPortableAbsolutePath,"isPortableAbsolutePath");function isUncPath(value){return/^\\\\[^\\]+\\[^\\]+/.test(value)}__name(isUncPath,"isUncPath");function normalizePortableAbsolutePath(value){if(/^[A-Za-z]:[\\/]/.test(value)||/^\\\\[^\\]+\\[^\\]+/.test(value)){return path.win32.normalize(value).toLowerCase()}return path.resolve(value)}__name(normalizePortableAbsolutePath,"normalizePortableAbsolutePath");function resolveRegisteredWorkspaceRuntimeByPathSelector(registry,selector){const exact=registry.getByWorkspaceCwd(selector);if(exact)return exact;if(path.isAbsolute(selector)&&!isUncPath(selector)){try{const canonicalSelector=canonicalizeWorkspace(selector);const canonicalMatch=registry.getByWorkspaceCwd(canonicalSelector);if(canonicalMatch)return canonicalMatch;for(const runtime of registry.list()){if(canonicalizeWorkspace(runtime.workspaceCwd)===canonicalSelector){return runtime}}}catch{}}const normalizedSelector=normalizePortableAbsolutePath(selector);return registry.list().find(runtime=>normalizePortableAbsolutePath(runtime.workspaceCwd)===normalizedSelector)}__name(resolveRegisteredWorkspaceRuntimeByPathSelector,"resolveRegisteredWorkspaceRuntimeByPathSelector");function resolveManagedWorkspaceRuntimeByPathSelector(registry,selector){const exact=registry.getManagedByWorkspaceCwd(selector);if(exact&&!isInternalWorkspaceRuntime(exact))return exact;if(path.isAbsolute(selector)&&!isUncPath(selector)){try{const canonicalSelector=canonicalizeWorkspace(selector);const canonicalMatch=registry.getManagedByWorkspaceCwd(canonicalSelector);if(canonicalMatch&&!isInternalWorkspaceRuntime(canonicalMatch)){return canonicalMatch}for(const runtime of registry.listManaged()){if(isInternalWorkspaceRuntime(runtime))continue;if(canonicalizeWorkspace(runtime.workspaceCwd)===canonicalSelector){return runtime}}}catch{}}const normalizedSelector=normalizePortableAbsolutePath(selector);return registry.listManaged().find(runtime=>!isInternalWorkspaceRuntime(runtime)&&normalizePortableAbsolutePath(runtime.workspaceCwd)===normalizedSelector)}__name(resolveManagedWorkspaceRuntimeByPathSelector,"resolveManagedWorkspaceRuntimeByPathSelector");function resolveWorkspaceRuntimeFromParam(registry,req,res,paramName="workspace"){const entry=resolveWorkspaceEntryFromParam(registry,req,res,paramName);if(!entry)return null;const runtime=entry.state==="active"?entry.current?.runtime:void 0;if(!runtime){sendWorkspaceRuntimeUnavailable(res,entry);return null}return runtime}__name(resolveWorkspaceRuntimeFromParam,"resolveWorkspaceRuntimeFromParam");function resolveTrustedRuntime(registry,req,res,paramName="workspace"){const runtime=resolveWorkspaceRuntimeFromParam(registry,req,res,paramName);if(!runtime)return null;return requireTrustedWorkspaceRuntime(runtime,res)?runtime:null}__name(resolveTrustedRuntime,"resolveTrustedRuntime");function resolveWorkspaceRuntimeWithLiveCompatibilityFromParam(registry,req,res,paramName="workspace"){if(typeof registry.getManagedEntryByWorkspaceId!=="function"||typeof registry.getManagedEntryByWorkspaceCwd!=="function"){return resolveWorkspaceRuntimeFromParam(registry,req,res,paramName)}const selector=req.params[paramName]??"";let entry=registry.getManagedEntryByWorkspaceId(selector);if(!entry&&isPortableAbsolutePath(selector)){entry=registry.getManagedEntryByWorkspaceCwd(selector)}if(!entry?.internal){return resolveWorkspaceRuntimeFromParam(registry,req,res,paramName)}const runtime=entry.state==="active"?entry.current?.runtime:void 0;if(!runtime){sendConversationRuntimeUnavailable(res);return null}return runtime}__name(resolveWorkspaceRuntimeWithLiveCompatibilityFromParam,"resolveWorkspaceRuntimeWithLiveCompatibilityFromParam");function sendConversationRuntimeUnavailable(res){res.set("Retry-After","1");res.status(503).json({error:"The Conversations runtime is temporarily unavailable.",code:"conversation_runtime_unavailable",retryable:true})}__name(sendConversationRuntimeUnavailable,"sendConversationRuntimeUnavailable");function sendWorkspaceRuntimeUnavailable(res,entry){res.set("Retry-After","1");res.status(503).json({error:"Workspace runtime is not active.",code:"workspace_runtime_unavailable",...entry?{workspaceCwd:entry.workspaceCwd,workspaceId:entry.workspaceId}:{}})}__name(sendWorkspaceRuntimeUnavailable,"sendWorkspaceRuntimeUnavailable");var MAX_BATCH_WORKSPACES=20;var MAX_SELECTOR_CHARS=4096;var MAX_MEMBER_BYTES=512*1024;function failedBatchMember(workspace,entry,status,code,message){return{workspace,...entry?{workspaceId:entry.workspaceId,cwd:entry.workspaceCwd}:{},error:{code,message,status}}}__name(failedBatchMember,"failedBatchMember");function captureWorkspaceEntryCurrency(registry,entry){const generation=entry.current;return{generation,isCurrent:__name(()=>registry.getEntryByWorkspaceId(entry.workspaceId)===entry&&entry.state==="active"&&entry.current?.generationId===generation?.generationId&&generation!==void 0&&!generation.guard.closed,"isCurrent")}}__name(captureWorkspaceEntryCurrency,"captureWorkspaceEntryCurrency");function isGenerationClosedError(error){return Boolean(error&&typeof error==="object"&&"code"in error&&error.code==="workspace_generation_closed")}__name(isGenerationClosedError,"isGenerationClosedError");function sendGenerationClosedError(res,error){if(!isGenerationClosedError(error))return false;sendWorkspaceRuntimeUnavailable(res);return true}__name(sendGenerationClosedError,"sendGenerationClosedError");function resolveManagedWorkspaceRuntimeFromParam(registry,req,res,paramName="workspace"){const selector=req.params[paramName]??"";const byId=registry.getManagedByWorkspaceId(selector);if(byId&&!isInternalWorkspaceRuntime(byId))return byId;if(!isPortableAbsolutePath(selector)){res.status(400).json({error:`\`:${paramName}\` must decode to a workspace id or absolute path`,code:"workspace_mismatch"});return null}const runtime=resolveManagedWorkspaceRuntimeByPathSelector(registry,selector);if(!runtime){res.status(400).json({error:"Workspace mismatch: the requested workspace is not registered with this daemon.",code:"workspace_mismatch"});return null}return runtime}__name(resolveManagedWorkspaceRuntimeFromParam,"resolveManagedWorkspaceRuntimeFromParam");function requireTrustedWorkspaceRuntime(runtime,res){if(runtime.trusted)return true;sendUntrustedWorkspaceResponse(res);return false}__name(requireTrustedWorkspaceRuntime,"requireTrustedWorkspaceRuntime");function sendUntrustedWorkspaceResponse(res,extra){res.status(403).json({error:"Workspace is not trusted.",code:"untrusted_workspace",...extra})}__name(sendUntrustedWorkspaceResponse,"sendUntrustedWorkspaceResponse");function getWorkspaceRouteContext(req){return req.workspaceRouteContext}__name(getWorkspaceRouteContext,"getWorkspaceRouteContext");function setWorkspaceRouteContext(req,context){req.workspaceRouteContext=context}__name(setWorkspaceRouteContext,"setWorkspaceRouteContext");function sendWorkspaceMismatch(res,registry){res.status(400).json({error:"Workspace mismatch: the requested workspace is not registered with this daemon.",code:"workspace_mismatch",workspaceCount:registry.listEntries().length})}__name(sendWorkspaceMismatch,"sendWorkspaceMismatch");function resolveContainedCwd(req,workspaceCwd){const rawCwd=req.query["cwd"];if(typeof rawCwd!=="string"||rawCwd.length===0){return workspaceCwd}try{const resolved=fs.realpathSync(path.resolve(rawCwd));const root=fs.realpathSync(workspaceCwd);if(isWithinRoot(resolved,root)){return resolved}}catch{}return workspaceCwd}__name(resolveContainedCwd,"resolveContainedCwd");function resolveContainedCwdOrFail(req,workspaceCwd){const rawCwd=req.query["cwd"];if(rawCwd===void 0){return workspaceCwd}if(typeof rawCwd!=="string"||rawCwd.length===0){return null}try{const resolved=fs.realpathSync(path.resolve(rawCwd));const root=fs.realpathSync(workspaceCwd);if(isWithinRoot(resolved,root)){return resolved}}catch{}return null}__name(resolveContainedCwdOrFail,"resolveContainedCwdOrFail");async function resolveGitCommonDir(cwd){let stdout;try{({stdout}=await execFileAsync("git",["rev-parse","--git-common-dir"],{cwd,encoding:"utf8",timeout:3e4,env:gitEnv()}))}catch(error){if(await isGitInfrastructureFault(error,cwd))throw error;return null}return fsPromises.realpath(path.resolve(cwd,stdout.trim())).catch(()=>null)}__name(resolveGitCommonDir,"resolveGitCommonDir");async function resolveAbsoluteGitDir(cwd){let stdout;try{({stdout}=await execFileAsync("git",["rev-parse","--absolute-git-dir"],{cwd,encoding:"utf8",timeout:3e4,env:gitEnv()}))}catch(error){if(await isGitInfrastructureFault(error,cwd))throw error;return null}return fsPromises.realpath(stdout.trim()).catch(()=>null)}__name(resolveAbsoluteGitDir,"resolveAbsoluteGitDir");async function readBoundedRegularFile(filePath,maxBytes,options){const pathStat=await fsPromises.lstat(filePath);if(!pathStat.isFile()||!options?.allowHardLinks&&pathStat.nlink!==1||pathStat.size>maxBytes){return null}const handle=await fsPromises.open(filePath,fs.constants.O_RDONLY|(fs.constants.O_NOFOLLOW??0));try{const openedStat=await handle.stat();if(!openedStat.isFile()||!options?.allowHardLinks&&openedStat.nlink!==1||openedStat.dev!==pathStat.dev||openedStat.ino!==pathStat.ino||openedStat.size>maxBytes){return null}const buffer=Buffer.alloc(maxBytes+1);let bytesRead=0;while(bytesRead<buffer.length){const chunk=await handle.read(buffer,bytesRead,buffer.length-bytesRead,bytesRead);if(chunk.bytesRead===0)break;bytesRead+=chunk.bytesRead}if(bytesRead>maxBytes)return null;const finalStat=await fsPromises.lstat(filePath);if(!finalStat.isFile()||!options?.allowHardLinks&&finalStat.nlink!==1||finalStat.dev!==openedStat.dev||finalStat.ino!==openedStat.ino){return null}return buffer.subarray(0,bytesRead).toString("utf8")}finally{await handle.close()}}__name(readBoundedRegularFile,"readBoundedRegularFile");async function markerIsOwnedBy(markerPath,sessionId){try{return(await readBoundedRegularFile(markerPath,256))?.trim()===sessionId}catch{return false}}__name(markerIsOwnedBy,"markerIsOwnedBy");async function isLinkedWorktreeOrUnknown(cwd){let stdout;try{({stdout}=await execFileAsync("git",["rev-parse","--git-common-dir","--absolute-git-dir"],{cwd,encoding:"utf8",timeout:3e4,env:gitEnv()}))}catch(error){if(await isGitInfrastructureFault(error,cwd))throw error;const stderr=error.stderr;return!(typeof stderr==="string"&&/not a git repository/i.test(stderr))}const[common,absolute]=stdout.trim().split("\n");if(!common||!absolute)return true;try{const[commonDir,gitDir]=await Promise.all([fsPromises.realpath(path.resolve(cwd,common)),fsPromises.realpath(absolute)]);return commonDir!==gitDir}catch{return true}}__name(isLinkedWorktreeOrUnknown,"isLinkedWorktreeOrUnknown");async function resolveSessionManagedGitCwd(req,runtime){const rawCwd=req.query["cwd"];if(rawCwd===void 0)return runtime.workspaceCwd;if(typeof rawCwd!=="string"||rawCwd.length===0)return null;let requested;let workspace;try{requested=await fsPromises.realpath(path.resolve(rawCwd));workspace=await fsPromises.realpath(runtime.workspaceCwd)}catch{return null}let stdout;try{({stdout}=await execFileAsync("git",["rev-parse","--show-toplevel"],{cwd:workspace,encoding:"utf8",timeout:3e4,env:gitEnv()}))}catch(error){if(isGitProbeInfrastructureError(error))throw error;const stderr=error.stderr;if(typeof stderr==="string"&&/not a git repository/i.test(stderr)&&isWithinRoot(requested,workspace)&&!await isLinkedWorktreeOrUnknown(requested)){return requested}return null}const repoTop=await fsPromises.realpath(stdout.trim()).catch(()=>null);if(repoTop===null)return null;if(requested===workspace)return requested;const managedRoot=path.join(repoTop,".qwen","worktrees");if(isWithinRoot(requested,workspace)&&!isWithinRoot(requested,managedRoot)){if(!await isLinkedWorktreeOrUnknown(requested)){return requested}const[workspaceGitDir,requestedGitDir]=await Promise.all([resolveAbsoluteGitDir(workspace),resolveAbsoluteGitDir(requested)]);if(workspaceGitDir!==null&&requestedGitDir===workspaceGitDir){return requested}}if(!isWithinRoot(requested,managedRoot))return null;const[workspaceCommonDir,requestedCommonDir]=await Promise.all([resolveGitCommonDir(workspace),resolveGitCommonDir(requested)]);if(workspaceCommonDir===null||requestedCommonDir===null||requestedCommonDir!==workspaceCommonDir){return null}try{let rawSessionId=req.query["sessionId"];if(rawSessionId===void 0){const[slug]=path.relative(managedRoot,requested).split(path.sep);if(!slug)return null;rawSessionId=(await readBoundedRegularFile(path.join(managedRoot,slug,WORKTREE_SESSION_FILE),256))?.trim()}const parsedSessionId=parseCallerSuppliedSessionId(rawSessionId);if(parsedSessionId.kind!=="valid")return null;const sessionId=parsedSessionId.sessionId;let snapshot;try{snapshot=runtime.bridge.getSessionExecutionSnapshot(sessionId)}catch{return null}if(await fsPromises.realpath(snapshot.workspaceCwd)!==workspace||!snapshot.worktree){return null}const worktreeRoot=await fsPromises.realpath(snapshot.worktree.path);if(path.dirname(worktreeRoot)!==managedRoot||!isWithinRoot(requested,worktreeRoot)){return null}const sidecarPath=createWorkspaceRuntimeSessionService(runtime).getWorktreeSessionPath(sessionId);const sidecarRaw=await readBoundedRegularFile(sidecarPath,64*1024,{allowHardLinks:true});if(sidecarRaw===null)return null;let sidecar;try{sidecar=JSON.parse(sidecarRaw)}catch{return null}if(!sidecar||typeof sidecar!=="object"||Array.isArray(sidecar)||typeof sidecar["worktreePath"]!=="string"||await fsPromises.realpath(sidecar.worktreePath)!==worktreeRoot){return null}const markerPath=path.join(worktreeRoot,WORKTREE_SESSION_FILE);if(!await markerIsOwnedBy(markerPath,sessionId)){return null}const requestedGitDir=await resolveAbsoluteGitDir(requested);if(requestedGitDir===null)return null;const metadataRoot=await fsPromises.realpath(path.join(workspaceCommonDir,"worktrees"));if(path.dirname(requestedGitDir)!==metadataRoot)return null;const backpointer=await readBoundedRegularFile(path.join(requestedGitDir,"gitdir"),4096);if(backpointer===null)return null;const actualGitFile=await fsPromises.realpath(path.resolve(requestedGitDir,backpointer.trim()));const expectedGitFile=await fsPromises.realpath(path.join(worktreeRoot,".git"));if(actualGitFile!==expectedGitFile)return null;return requested}catch(error){const code=error.code;if(code==="ENOENT"||code==="EACCES"||code==="EPERM"||code==="ELOOP"||code==="ENOTDIR"){return null}throw error}}__name(resolveSessionManagedGitCwd,"resolveSessionManagedGitCwd");async function resolveSessionManagedGitCwdForRoute(req,res,runtime,route,sendBridgeError){let cwd;try{cwd=await resolveSessionManagedGitCwd(req,runtime);runtime.generationGuard?.assertOpen()}catch(error){sendBridgeError(res,error,{route});return void 0}if(cwd===null){res.status(400).json({error:"invalid_cwd",message:"The supplied cwd is invalid or outside the workspace"});return void 0}return cwd}__name(resolveSessionManagedGitCwdForRoute,"resolveSessionManagedGitCwdForRoute");export{runWithWorkspaceRuntimeStorage,createWorkspaceRuntimeSessionService,resolveWorkspaceEntryFromParam,resolveWorkspaceEntryBySelector,isPortableAbsolutePath,resolveRegisteredWorkspaceRuntimeByPathSelector,resolveManagedWorkspaceRuntimeByPathSelector,resolveWorkspaceRuntimeFromParam,resolveTrustedRuntime,resolveWorkspaceRuntimeWithLiveCompatibilityFromParam,sendConversationRuntimeUnavailable,sendWorkspaceRuntimeUnavailable,MAX_BATCH_WORKSPACES,MAX_SELECTOR_CHARS,MAX_MEMBER_BYTES,failedBatchMember,captureWorkspaceEntryCurrency,isGenerationClosedError,sendGenerationClosedError,resolveManagedWorkspaceRuntimeFromParam,requireTrustedWorkspaceRuntime,sendUntrustedWorkspaceResponse,getWorkspaceRouteContext,setWorkspaceRouteContext,resolveContainedCwd,resolveContainedCwdOrFail,resolveSessionManagedGitCwdForRoute};
|
|
3
|
+
import{parseCallerSuppliedSessionId}from"./chunk-LGFF5PJA.js";import{isInternalWorkspaceRuntime}from"./chunk-M5KJJE2X.js";import{canonicalizeWorkspace}from"./chunk-L5UULTGF.js";import{isWithinRoot}from"./chunk-IDXJIDME.js";import{SessionService}from"./chunk-PFKTTUGS.js";import{WORKTREE_SESSION_FILE,gitEnv}from"./chunk-I44IFX3I.js";import{Storage}from"./chunk-5VB4YX3Z.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name}from"./chunk-KBWJGX7I.js";init_esbuild_shims();function runWithWorkspaceRuntimeStorage(runtime,fn){return Storage.runWithResolvedRuntimeBaseDir(runtime.sessionRuntimeBaseDir,fn)}__name(runWithWorkspaceRuntimeStorage,"runWithWorkspaceRuntimeStorage");function createWorkspaceRuntimeSessionService(runtime,options={}){return new SessionService(runtime.workspaceCwd,{...options,runtimeBaseDir:runtime.sessionRuntimeBaseDir})}__name(createWorkspaceRuntimeSessionService,"createWorkspaceRuntimeSessionService");init_esbuild_shims();import*as fs from"node:fs";import*as fsPromises from"node:fs/promises";import path from"node:path";import{execFile}from"node:child_process";import{promisify}from"node:util";var execFileAsync=promisify(execFile);function isGitProbeInfrastructureError(error){const failure=error;return failure.killed===true||typeof failure.code==="string"&&["ENOENT","EACCES","EAGAIN","ENOMEM","ETIMEDOUT"].includes(failure.code)}__name(isGitProbeInfrastructureError,"isGitProbeInfrastructureError");async function isGitInfrastructureFault(error,cwd){if(!isGitProbeInfrastructureError(error))return false;const code=error.code;if(code!=="ENOENT"&&code!=="EACCES")return true;try{await fsPromises.access(cwd,fs.constants.X_OK);return true}catch{return false}}__name(isGitInfrastructureFault,"isGitInfrastructureFault");function resolveWorkspaceEntryFromParam(registry,req,res,paramName="workspace"){const selector=req.params[paramName]??"";const entry=resolveWorkspaceEntryBySelector(registry,selector);if(entry)return entry;if(!isPortableAbsolutePath(selector)){res.status(400).json({error:`\`:${paramName}\` must decode to a workspace id or absolute path`,code:"workspace_mismatch"});return null}sendWorkspaceMismatch(res,registry);return null}__name(resolveWorkspaceEntryFromParam,"resolveWorkspaceEntryFromParam");function resolveWorkspaceEntryBySelector(registry,selector){const byId=registry.getEntryByWorkspaceId(selector);if(byId)return byId;if(!isPortableAbsolutePath(selector))return void 0;const exact=registry.getEntryByWorkspaceCwd(selector);if(exact)return exact;if(path.isAbsolute(selector)&&!isUncPath(selector)){try{const canonicalSelector=canonicalizeWorkspace(selector);const canonicalMatch=registry.getEntryByWorkspaceCwd(canonicalSelector);if(canonicalMatch)return canonicalMatch;for(const candidate of registry.listEntries()){if(canonicalizeWorkspace(candidate.workspaceCwd)===canonicalSelector){return candidate}}}catch{}}const normalizedSelector=normalizePortableAbsolutePath(selector);return registry.listEntries().find(candidate=>normalizePortableAbsolutePath(candidate.workspaceCwd)===normalizedSelector)}__name(resolveWorkspaceEntryBySelector,"resolveWorkspaceEntryBySelector");function isPortableAbsolutePath(value){return path.isAbsolute(value)||/^[A-Za-z]:[\\/]/.test(value)||/^\\\\[^\\]+\\[^\\]+/.test(value)}__name(isPortableAbsolutePath,"isPortableAbsolutePath");function isUncPath(value){return/^\\\\[^\\]+\\[^\\]+/.test(value)}__name(isUncPath,"isUncPath");function normalizePortableAbsolutePath(value){if(/^[A-Za-z]:[\\/]/.test(value)||/^\\\\[^\\]+\\[^\\]+/.test(value)){return path.win32.normalize(value).toLowerCase()}return path.resolve(value)}__name(normalizePortableAbsolutePath,"normalizePortableAbsolutePath");function resolveRegisteredWorkspaceRuntimeByPathSelector(registry,selector){const exact=registry.getByWorkspaceCwd(selector);if(exact)return exact;if(path.isAbsolute(selector)&&!isUncPath(selector)){try{const canonicalSelector=canonicalizeWorkspace(selector);const canonicalMatch=registry.getByWorkspaceCwd(canonicalSelector);if(canonicalMatch)return canonicalMatch;for(const runtime of registry.list()){if(canonicalizeWorkspace(runtime.workspaceCwd)===canonicalSelector){return runtime}}}catch{}}const normalizedSelector=normalizePortableAbsolutePath(selector);return registry.list().find(runtime=>normalizePortableAbsolutePath(runtime.workspaceCwd)===normalizedSelector)}__name(resolveRegisteredWorkspaceRuntimeByPathSelector,"resolveRegisteredWorkspaceRuntimeByPathSelector");function resolveManagedWorkspaceRuntimeByPathSelector(registry,selector){const exact=registry.getManagedByWorkspaceCwd(selector);if(exact&&!isInternalWorkspaceRuntime(exact))return exact;if(path.isAbsolute(selector)&&!isUncPath(selector)){try{const canonicalSelector=canonicalizeWorkspace(selector);const canonicalMatch=registry.getManagedByWorkspaceCwd(canonicalSelector);if(canonicalMatch&&!isInternalWorkspaceRuntime(canonicalMatch)){return canonicalMatch}for(const runtime of registry.listManaged()){if(isInternalWorkspaceRuntime(runtime))continue;if(canonicalizeWorkspace(runtime.workspaceCwd)===canonicalSelector){return runtime}}}catch{}}const normalizedSelector=normalizePortableAbsolutePath(selector);return registry.listManaged().find(runtime=>!isInternalWorkspaceRuntime(runtime)&&normalizePortableAbsolutePath(runtime.workspaceCwd)===normalizedSelector)}__name(resolveManagedWorkspaceRuntimeByPathSelector,"resolveManagedWorkspaceRuntimeByPathSelector");function resolveWorkspaceRuntimeFromParam(registry,req,res,paramName="workspace"){const entry=resolveWorkspaceEntryFromParam(registry,req,res,paramName);if(!entry)return null;const runtime=entry.state==="active"?entry.current?.runtime:void 0;if(!runtime){sendWorkspaceRuntimeUnavailable(res,entry);return null}return runtime}__name(resolveWorkspaceRuntimeFromParam,"resolveWorkspaceRuntimeFromParam");function resolveTrustedRuntime(registry,req,res,paramName="workspace"){const runtime=resolveWorkspaceRuntimeFromParam(registry,req,res,paramName);if(!runtime)return null;return requireTrustedWorkspaceRuntime(runtime,res)?runtime:null}__name(resolveTrustedRuntime,"resolveTrustedRuntime");function resolveWorkspaceRuntimeWithLiveCompatibilityFromParam(registry,req,res,paramName="workspace"){if(typeof registry.getManagedEntryByWorkspaceId!=="function"||typeof registry.getManagedEntryByWorkspaceCwd!=="function"){return resolveWorkspaceRuntimeFromParam(registry,req,res,paramName)}const selector=req.params[paramName]??"";let entry=registry.getManagedEntryByWorkspaceId(selector);if(!entry&&isPortableAbsolutePath(selector)){entry=registry.getManagedEntryByWorkspaceCwd(selector)}if(!entry?.internal){return resolveWorkspaceRuntimeFromParam(registry,req,res,paramName)}const runtime=entry.state==="active"?entry.current?.runtime:void 0;if(!runtime){sendConversationRuntimeUnavailable(res);return null}return runtime}__name(resolveWorkspaceRuntimeWithLiveCompatibilityFromParam,"resolveWorkspaceRuntimeWithLiveCompatibilityFromParam");function sendConversationRuntimeUnavailable(res){res.set("Retry-After","1");res.status(503).json({error:"The Conversations runtime is temporarily unavailable.",code:"conversation_runtime_unavailable",retryable:true})}__name(sendConversationRuntimeUnavailable,"sendConversationRuntimeUnavailable");function sendWorkspaceRuntimeUnavailable(res,entry){res.set("Retry-After","1");res.status(503).json({error:"Workspace runtime is not active.",code:"workspace_runtime_unavailable",...entry?{workspaceCwd:entry.workspaceCwd,workspaceId:entry.workspaceId}:{}})}__name(sendWorkspaceRuntimeUnavailable,"sendWorkspaceRuntimeUnavailable");var MAX_BATCH_WORKSPACES=20;var MAX_SELECTOR_CHARS=4096;var MAX_MEMBER_BYTES=512*1024;function failedBatchMember(workspace,entry,status,code,message){return{workspace,...entry?{workspaceId:entry.workspaceId,cwd:entry.workspaceCwd}:{},error:{code,message,status}}}__name(failedBatchMember,"failedBatchMember");function captureWorkspaceEntryCurrency(registry,entry){const generation=entry.current;return{generation,isCurrent:__name(()=>registry.getEntryByWorkspaceId(entry.workspaceId)===entry&&entry.state==="active"&&entry.current?.generationId===generation?.generationId&&generation!==void 0&&!generation.guard.closed,"isCurrent")}}__name(captureWorkspaceEntryCurrency,"captureWorkspaceEntryCurrency");function isGenerationClosedError(error){return Boolean(error&&typeof error==="object"&&"code"in error&&error.code==="workspace_generation_closed")}__name(isGenerationClosedError,"isGenerationClosedError");function sendGenerationClosedError(res,error){if(!isGenerationClosedError(error))return false;sendWorkspaceRuntimeUnavailable(res);return true}__name(sendGenerationClosedError,"sendGenerationClosedError");function resolveManagedWorkspaceRuntimeFromParam(registry,req,res,paramName="workspace"){const selector=req.params[paramName]??"";const byId=registry.getManagedByWorkspaceId(selector);if(byId&&!isInternalWorkspaceRuntime(byId))return byId;if(!isPortableAbsolutePath(selector)){res.status(400).json({error:`\`:${paramName}\` must decode to a workspace id or absolute path`,code:"workspace_mismatch"});return null}const runtime=resolveManagedWorkspaceRuntimeByPathSelector(registry,selector);if(!runtime){res.status(400).json({error:"Workspace mismatch: the requested workspace is not registered with this daemon.",code:"workspace_mismatch"});return null}return runtime}__name(resolveManagedWorkspaceRuntimeFromParam,"resolveManagedWorkspaceRuntimeFromParam");function requireTrustedWorkspaceRuntime(runtime,res){if(runtime.trusted)return true;sendUntrustedWorkspaceResponse(res);return false}__name(requireTrustedWorkspaceRuntime,"requireTrustedWorkspaceRuntime");function sendUntrustedWorkspaceResponse(res,extra){res.status(403).json({error:"Workspace is not trusted.",code:"untrusted_workspace",...extra})}__name(sendUntrustedWorkspaceResponse,"sendUntrustedWorkspaceResponse");function getWorkspaceRouteContext(req){return req.workspaceRouteContext}__name(getWorkspaceRouteContext,"getWorkspaceRouteContext");function setWorkspaceRouteContext(req,context){req.workspaceRouteContext=context}__name(setWorkspaceRouteContext,"setWorkspaceRouteContext");function sendWorkspaceMismatch(res,registry){res.status(400).json({error:"Workspace mismatch: the requested workspace is not registered with this daemon.",code:"workspace_mismatch",workspaceCount:registry.listEntries().length})}__name(sendWorkspaceMismatch,"sendWorkspaceMismatch");function resolveContainedCwd(req,workspaceCwd){const rawCwd=req.query["cwd"];if(typeof rawCwd!=="string"||rawCwd.length===0){return workspaceCwd}try{const resolved=fs.realpathSync(path.resolve(rawCwd));const root=fs.realpathSync(workspaceCwd);if(isWithinRoot(resolved,root)){return resolved}}catch{}return workspaceCwd}__name(resolveContainedCwd,"resolveContainedCwd");function resolveContainedCwdOrFail(req,workspaceCwd){const rawCwd=req.query["cwd"];if(rawCwd===void 0){return workspaceCwd}if(typeof rawCwd!=="string"||rawCwd.length===0){return null}try{const resolved=fs.realpathSync(path.resolve(rawCwd));const root=fs.realpathSync(workspaceCwd);if(isWithinRoot(resolved,root)){return resolved}}catch{}return null}__name(resolveContainedCwdOrFail,"resolveContainedCwdOrFail");async function resolveGitCommonDir(cwd){let stdout;try{({stdout}=await execFileAsync("git",["rev-parse","--git-common-dir"],{cwd,encoding:"utf8",timeout:3e4,env:gitEnv()}))}catch(error){if(await isGitInfrastructureFault(error,cwd))throw error;return null}return fsPromises.realpath(path.resolve(cwd,stdout.trim())).catch(()=>null)}__name(resolveGitCommonDir,"resolveGitCommonDir");async function resolveAbsoluteGitDir(cwd){let stdout;try{({stdout}=await execFileAsync("git",["rev-parse","--absolute-git-dir"],{cwd,encoding:"utf8",timeout:3e4,env:gitEnv()}))}catch(error){if(await isGitInfrastructureFault(error,cwd))throw error;return null}return fsPromises.realpath(stdout.trim()).catch(()=>null)}__name(resolveAbsoluteGitDir,"resolveAbsoluteGitDir");async function readBoundedRegularFile(filePath,maxBytes,options){const pathStat=await fsPromises.lstat(filePath);if(!pathStat.isFile()||!options?.allowHardLinks&&pathStat.nlink!==1||pathStat.size>maxBytes){return null}const handle=await fsPromises.open(filePath,fs.constants.O_RDONLY|(fs.constants.O_NOFOLLOW??0));try{const openedStat=await handle.stat();if(!openedStat.isFile()||!options?.allowHardLinks&&openedStat.nlink!==1||openedStat.dev!==pathStat.dev||openedStat.ino!==pathStat.ino||openedStat.size>maxBytes){return null}const buffer=Buffer.alloc(maxBytes+1);let bytesRead=0;while(bytesRead<buffer.length){const chunk=await handle.read(buffer,bytesRead,buffer.length-bytesRead,bytesRead);if(chunk.bytesRead===0)break;bytesRead+=chunk.bytesRead}if(bytesRead>maxBytes)return null;const finalStat=await fsPromises.lstat(filePath);if(!finalStat.isFile()||!options?.allowHardLinks&&finalStat.nlink!==1||finalStat.dev!==openedStat.dev||finalStat.ino!==openedStat.ino){return null}return buffer.subarray(0,bytesRead).toString("utf8")}finally{await handle.close()}}__name(readBoundedRegularFile,"readBoundedRegularFile");async function markerIsOwnedBy(markerPath,sessionId){try{return(await readBoundedRegularFile(markerPath,256))?.trim()===sessionId}catch{return false}}__name(markerIsOwnedBy,"markerIsOwnedBy");async function isLinkedWorktreeOrUnknown(cwd){let stdout;try{({stdout}=await execFileAsync("git",["rev-parse","--git-common-dir","--absolute-git-dir"],{cwd,encoding:"utf8",timeout:3e4,env:gitEnv()}))}catch(error){if(await isGitInfrastructureFault(error,cwd))throw error;const stderr=error.stderr;return!(typeof stderr==="string"&&/not a git repository/i.test(stderr))}const[common,absolute]=stdout.trim().split("\n");if(!common||!absolute)return true;try{const[commonDir,gitDir]=await Promise.all([fsPromises.realpath(path.resolve(cwd,common)),fsPromises.realpath(absolute)]);return commonDir!==gitDir}catch{return true}}__name(isLinkedWorktreeOrUnknown,"isLinkedWorktreeOrUnknown");async function resolveSessionManagedGitCwd(req,runtime){const rawCwd=req.query["cwd"];if(rawCwd===void 0)return runtime.workspaceCwd;if(typeof rawCwd!=="string"||rawCwd.length===0)return null;let requested;let workspace;try{requested=await fsPromises.realpath(path.resolve(rawCwd));workspace=await fsPromises.realpath(runtime.workspaceCwd)}catch{return null}let stdout;try{({stdout}=await execFileAsync("git",["rev-parse","--show-toplevel"],{cwd:workspace,encoding:"utf8",timeout:3e4,env:gitEnv()}))}catch(error){if(isGitProbeInfrastructureError(error))throw error;const stderr=error.stderr;if(typeof stderr==="string"&&/not a git repository/i.test(stderr)&&isWithinRoot(requested,workspace)&&!await isLinkedWorktreeOrUnknown(requested)){return requested}return null}const repoTop=await fsPromises.realpath(stdout.trim()).catch(()=>null);if(repoTop===null)return null;if(requested===workspace)return requested;const managedRoot=path.join(repoTop,".qwen","worktrees");if(isWithinRoot(requested,workspace)&&!isWithinRoot(requested,managedRoot)){if(!await isLinkedWorktreeOrUnknown(requested)){return requested}const[workspaceGitDir,requestedGitDir]=await Promise.all([resolveAbsoluteGitDir(workspace),resolveAbsoluteGitDir(requested)]);if(workspaceGitDir!==null&&requestedGitDir===workspaceGitDir){return requested}}if(!isWithinRoot(requested,managedRoot))return null;const[workspaceCommonDir,requestedCommonDir]=await Promise.all([resolveGitCommonDir(workspace),resolveGitCommonDir(requested)]);if(workspaceCommonDir===null||requestedCommonDir===null||requestedCommonDir!==workspaceCommonDir){return null}try{let rawSessionId=req.query["sessionId"];if(rawSessionId===void 0){const[slug]=path.relative(managedRoot,requested).split(path.sep);if(!slug)return null;rawSessionId=(await readBoundedRegularFile(path.join(managedRoot,slug,WORKTREE_SESSION_FILE),256))?.trim()}const parsedSessionId=parseCallerSuppliedSessionId(rawSessionId);if(parsedSessionId.kind!=="valid")return null;const sessionId=parsedSessionId.sessionId;let snapshot;try{snapshot=runtime.bridge.getSessionExecutionSnapshot(sessionId)}catch{return null}if(await fsPromises.realpath(snapshot.workspaceCwd)!==workspace||!snapshot.worktree){return null}const worktreeRoot=await fsPromises.realpath(snapshot.worktree.path);if(path.dirname(worktreeRoot)!==managedRoot||!isWithinRoot(requested,worktreeRoot)){return null}const sidecarPath=createWorkspaceRuntimeSessionService(runtime).getWorktreeSessionPath(sessionId);const sidecarRaw=await readBoundedRegularFile(sidecarPath,64*1024,{allowHardLinks:true});if(sidecarRaw===null)return null;let sidecar;try{sidecar=JSON.parse(sidecarRaw)}catch{return null}if(!sidecar||typeof sidecar!=="object"||Array.isArray(sidecar)||typeof sidecar["worktreePath"]!=="string"||await fsPromises.realpath(sidecar.worktreePath)!==worktreeRoot){return null}const markerPath=path.join(worktreeRoot,WORKTREE_SESSION_FILE);if(!await markerIsOwnedBy(markerPath,sessionId)){return null}const requestedGitDir=await resolveAbsoluteGitDir(requested);if(requestedGitDir===null)return null;const metadataRoot=await fsPromises.realpath(path.join(workspaceCommonDir,"worktrees"));if(path.dirname(requestedGitDir)!==metadataRoot)return null;const backpointer=await readBoundedRegularFile(path.join(requestedGitDir,"gitdir"),4096);if(backpointer===null)return null;const actualGitFile=await fsPromises.realpath(path.resolve(requestedGitDir,backpointer.trim()));const expectedGitFile=await fsPromises.realpath(path.join(worktreeRoot,".git"));if(actualGitFile!==expectedGitFile)return null;return requested}catch(error){const code=error.code;if(code==="ENOENT"||code==="EACCES"||code==="EPERM"||code==="ELOOP"||code==="ENOTDIR"){return null}throw error}}__name(resolveSessionManagedGitCwd,"resolveSessionManagedGitCwd");async function resolveSessionManagedGitCwdForRoute(req,res,runtime,route,sendBridgeError){let cwd;try{cwd=await resolveSessionManagedGitCwd(req,runtime);runtime.generationGuard?.assertOpen()}catch(error){sendBridgeError(res,error,{route});return void 0}if(cwd===null){res.status(400).json({error:"invalid_cwd",message:"The supplied cwd is invalid or outside the workspace"});return void 0}return cwd}__name(resolveSessionManagedGitCwdForRoute,"resolveSessionManagedGitCwdForRoute");export{runWithWorkspaceRuntimeStorage,createWorkspaceRuntimeSessionService,resolveWorkspaceEntryFromParam,resolveWorkspaceEntryBySelector,isPortableAbsolutePath,resolveRegisteredWorkspaceRuntimeByPathSelector,resolveManagedWorkspaceRuntimeByPathSelector,resolveWorkspaceRuntimeFromParam,resolveTrustedRuntime,resolveWorkspaceRuntimeWithLiveCompatibilityFromParam,sendConversationRuntimeUnavailable,sendWorkspaceRuntimeUnavailable,MAX_BATCH_WORKSPACES,MAX_SELECTOR_CHARS,MAX_MEMBER_BYTES,failedBatchMember,captureWorkspaceEntryCurrency,isGenerationClosedError,sendGenerationClosedError,resolveManagedWorkspaceRuntimeFromParam,requireTrustedWorkspaceRuntime,sendUntrustedWorkspaceResponse,getWorkspaceRouteContext,setWorkspaceRouteContext,resolveContainedCwd,resolveContainedCwdOrFail,resolveSessionManagedGitCwdForRoute};
|
|
4
4
|
/**
|
|
5
5
|
* @license
|
|
6
6
|
* Copyright 2026 Qwen Team
|