@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{getInstallationInfo,getNpmCliPath,getNpmNodePath}from"./chunk-STPD3MIX.js";import{t}from"./chunk-4NQCOITC.js";import{getPackageJson}from"./chunk-6KMPLONS.js";import{isBunRuntime}from"./chunk-WGNF7FPC.js";import{require_semver}from"./chunk-73G3MZQR.js";import{createDebugLogger}from"./chunk-46KPDLFH.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name,__toESM}from"./chunk-KBWJGX7I.js";init_esbuild_shims();var import_semver=__toESM(require_semver(),1);import{execFile}from"node:child_process";import{promisify}from"node:util";init_esbuild_shims();import*as fs from"node:fs";import*as os from"node:os";import*as path from"node:path";function npmrcValue(raw){const value=raw.trim();if(value.startsWith('"')&&value.endsWith('"')){try{const parsed=JSON.parse(value);if(typeof parsed==="string")return parsed}catch{return value}}if(value.startsWith("'")&&value.endsWith("'"))return value.slice(1,-1);return value.replace(/\\([\\;#])|[;#].*$/g,(_match,escaped)=>escaped??"").trim()}__name(npmrcValue,"npmrcValue");function expandEnv(value){return value.replace(/(\\*)\$\{([^}]+)\}/g,(match,escapes,name)=>{if(escapes.length%2)return match.slice(1);return escapes+(process.env[name]??`\${${name}}`)})}__name(expandEnv,"expandEnv");function readNpmrc(filename){let content;try{content=fs.readFileSync(filename,"utf8")}catch(error){if(error.code==="ENOENT")return new Map;throw new Error("Unable to read npm registry configuration")}const config=new Map;let inSection=false;for(const line of content.split(/\r?\n/)){if(/^\s*\[/.test(line))inSection=true;if(inSection||/^\s*[;#]/.test(line))continue;const match=line.match(/^\s*([^=]+?)\s*=(.*)$/);if(!match)continue;config.set(expandEnv(npmrcValue(match[1])),expandEnv(npmrcValue(match[2])))}return config}__name(readNpmrc,"readNpmrc");function getGlobalNpmRegistryConfig(packageName){const env=new Map;for(const[key,value]of Object.entries(process.env)){if(!/^npm_config_/i.test(key)||!value)continue;const suffix=key.slice("npm_config_".length);const name=suffix.startsWith("//")?suffix:suffix.toLowerCase().replace(/(?!^)_/g,"-");env.set(expandEnv(name),expandEnv(value.trim()))}const home=os.homedir();const configPath=__name(value=>{if(/^~(?=\/|$)/.test(value)){if(!path.isAbsolute(home)){throw new Error("Cannot resolve npm configuration without an absolute home directory")}value=value.replace(/^~/,home)}return path.resolve(value)},"configPath");const builtin=readNpmrc(path.join(path.dirname(process.execPath),...process.platform==="win32"?["node_modules","npm","npmrc"]:["..","lib","node_modules","npm","npmrc"]));const userConfig=env.get("userconfig")??builtin.get("userconfig")??(path.isAbsolute(home)?path.join(home,".npmrc"):void 0);const user=userConfig?readNpmrc(configPath(userConfig)):new Map;let defaultPrefix=path.dirname(process.execPath);if(process.platform!=="win32"){defaultPrefix=path.dirname(defaultPrefix);if(process.env["DESTDIR"]){defaultPrefix=path.join(process.env["DESTDIR"],defaultPrefix)}}if(process.env["PREFIX"])defaultPrefix=process.env["PREFIX"];const prefix=env.get("prefix")??user.get("prefix")??builtin.get("prefix")??defaultPrefix;const global=readNpmrc(configPath(env.get("globalconfig")??user.get("globalconfig")??builtin.get("globalconfig")??path.join(prefix,"etc","npmrc")));const config=new Map([...builtin,...global,...user,...env]);const scope=packageName.startsWith("@")?packageName.split("/")[0]:void 0;let registry;try{registry=new URL(scope&&config.get(`${scope}:registry`)||config.get("registry")||"https://registry.npmjs.org/")}catch{throw new Error("Invalid npm registry configuration")}if(!["https:","http:"].includes(registry.protocol)||registry.username||registry.password){throw new Error("Invalid npm registry configuration")}if(!registry.pathname.endsWith("/"))registry.pathname+="/";registry.search="";registry.hash="";let authPath=registry.pathname;for(;;){const key=`//${registry.host}${authPath}:`;const token=config.get(`${key}_authToken`);const auth=config.get(`${key}_auth`);const username=config.get(`${key}username`);const password=config.get(`${key}_password`);let authorization;if(token)authorization=`Bearer ${token}`;else if(auth)authorization=`Basic ${auth}`;else if(username&&password){const decodedPassword=Buffer.from(password,"base64").toString("utf8");authorization=`Basic ${Buffer.from(`${username}:${decodedPassword}`).toString("base64")}`}if(authorization){try{new Headers({Authorization:authorization})}catch{throw new Error("Invalid npm registry authentication configuration")}return{registry,authorization}}if(authPath==="")break;authPath=authPath.replace(/([^/]+|\/)$/,"")}return{registry}}__name(getGlobalNpmRegistryConfig,"getGlobalNpmRegistryConfig");var debugLogger=createDebugLogger("UPDATE_CHECK");var FETCH_TIMEOUT_MS=5e3;var UpdateCheckTimeoutError=class extends Error{static{__name(this,"UpdateCheckTimeoutError")}distTag;constructor(timeoutMs,distTag){const suffix=distTag?` for ${distTag}`:"";super(`update check timed out after ${timeoutMs}ms${suffix}`);this.name="UpdateCheckTimeoutError";this.distTag=distTag}};var NETWORK_ERROR_CODES=["ENOTFOUND","ECONNREFUSED","EAI_AGAIN","ETIMEDOUT","ENETUNREACH"];function classifyUpdateCheckError(error){if(error instanceof UpdateCheckTimeoutError)return"timeout";if(error instanceof Error){if(error.name==="TimeoutError")return"timeout";if("killed"in error&&error.killed===true&&"signal"in error&&error.signal==="SIGTERM"){return"timeout"}const errors=[error];if(error.cause instanceof Error)errors.push(error.cause);const matchesCode=__name(code=>errors.some(error2=>error2.code===code||error2.message.includes(code)),"matchesCode");if(NETWORK_ERROR_CODES.some(matchesCode))return"offline"}return"registry"}__name(classifyUpdateCheckError,"classifyUpdateCheckError");function describeUpdateCheckFailure(error,timeoutMs=FETCH_TIMEOUT_MS){switch(classifyUpdateCheckError(error)){case"timeout":return t("registry did not respond within {{seconds}}s",{seconds:String(Math.round(timeoutMs/1e3))});case"offline":return t("registry unreachable");default:return t("registry error")}}__name(describeUpdateCheckFailure,"describeUpdateCheckFailure");async function fetchInfoWithTimeout(notifier,timeoutMs,distTag){let timer;try{return await Promise.race([Promise.resolve(notifier.fetchInfo()),new Promise((_,reject)=>{timer=setTimeout(()=>reject(new UpdateCheckTimeoutError(timeoutMs,distTag)),timeoutMs)})])}finally{if(timer!==void 0)clearTimeout(timer)}}__name(fetchInfoWithTimeout,"fetchInfoWithTimeout");var execFileAsync=promisify(execFile);async function runGlobalNpm(args,run=execFileAsync,platform=process.platform,nodePath=getNpmNodePath(),resolveNpmCliPath=getNpmCliPath){const{stdout}=await run(nodePath,[resolveNpmCliPath(nodePath,platform),...args],{encoding:"utf8",timeout:FETCH_TIMEOUT_MS});return String(stdout).trim()}__name(runGlobalNpm,"runGlobalNpm");async function fetchGlobalNpmUpdateInfo(packageName,currentVersion,distTag,run=execFileAsync){if(isBunRuntime()&&getInstallationInfo("",false).isStandalone){const{registry,authorization}=getGlobalNpmRegistryConfig(packageName);let url=new URL(`-/package/${encodeURIComponent(packageName)}/dist-tags`,registry);const signal=AbortSignal.timeout(FETCH_TIMEOUT_MS);let auth=authorization;let response;for(let redirects=0;;redirects++){response=await fetch(url,{signal,headers:auth?{Authorization:auth}:void 0,redirect:"manual"});if(![301,302,303,307,308].includes(response.status))break;const location=response.headers.get("location");await response.body?.cancel();if(!location||redirects===5){throw new Error("Invalid npm registry redirect")}let next;try{next=new URL(location,url)}catch{throw new Error("Invalid npm registry redirect")}if(!["https:","http:"].includes(next.protocol)||next.username||next.password){throw new Error("Invalid npm registry redirect")}if(next.origin!==url.origin)auth=void 0;url=next}if(!response.ok)throw new Error(`Registry returned HTTP ${response.status}`);const tags=await response.json();if(typeof tags!=="object"||tags===null||Array.isArray(tags)){throw new Error("Invalid registry dist-tags response")}const latest2=Reflect.get(tags,distTag);if(latest2!==void 0&&typeof latest2!=="string"){throw new Error(`Invalid registry ${distTag} version response`)}return{latest:latest2??currentVersion,current:currentVersion,type:"latest",name:packageName}}const output=await runGlobalNpm(["view",packageName,`dist-tags.${distTag}`,"--json","--global"],run);if(output===""){return{latest:currentVersion,current:currentVersion,type:"latest",name:packageName}}const parsed=JSON.parse(output);const latest=typeof parsed==="string"?parsed:Array.isArray(parsed)&&parsed.length===1&&typeof parsed[0]==="string"?parsed[0]:void 0;if(latest===void 0){throw new Error(`Invalid npm ${distTag} version response`)}return{latest,current:currentVersion,type:"latest",name:packageName}}__name(fetchGlobalNpmUpdateInfo,"fetchGlobalNpmUpdateInfo");function getBestAvailableUpdate(nightly,stable){if(!nightly)return stable||null;if(!stable)return nightly||null;const nightlyVer=nightly.latest;const stableVer=stable.latest;if(import_semver.default.coerce(stableVer)?.version===import_semver.default.coerce(nightlyVer)?.version){return nightly}return import_semver.default.gt(stableVer,nightlyVer)?stable:nightly}__name(getBestAvailableUpdate,"getBestAvailableUpdate");async function checkForUpdatesDetailed(fetchGlobalNpm=fetchGlobalNpmUpdateInfo){let currentVersion;try{if(process.env["DEV"]==="true"){return{status:"skipped",reason:"development mode"}}const packageJson=await getPackageJson();if(!packageJson||!packageJson.name||!packageJson.version){return{status:"skipped",reason:"package metadata unavailable"}}const{name,version}=packageJson;currentVersion=version;const isNightly=version.includes("nightly");const createNotifier=__name(distTag=>({fetchInfo:__name(()=>fetchGlobalNpm(name,version,distTag),"fetchInfo")}),"createNotifier");if(isNightly){const[nightlyUpdateInfo,latestUpdateInfo]=await Promise.all([fetchInfoWithTimeout(createNotifier("nightly"),FETCH_TIMEOUT_MS,"nightly"),fetchInfoWithTimeout(createNotifier("latest"),FETCH_TIMEOUT_MS,"latest")]);debugLogger.debug(`fetchInfo returned nightly=${JSON.stringify(nightlyUpdateInfo)} latest=${JSON.stringify(latestUpdateInfo)} for current=${version}`);const bestUpdate=getBestAvailableUpdate(nightlyUpdateInfo,latestUpdateInfo);if(bestUpdate&&import_semver.default.gt(bestUpdate.latest,version)){return{status:"update",info:{message:t("A new version of MiraOS is available! {{current}} \u2192 {{latest}}",{current:version,latest:bestUpdate.latest}),update:{...bestUpdate,current:version}}}}}else{const updateInfo=await fetchInfoWithTimeout(createNotifier("latest"),FETCH_TIMEOUT_MS,"latest");debugLogger.debug(`fetchInfo returned ${JSON.stringify(updateInfo)} for current=${version}`);if(updateInfo&&import_semver.default.gt(updateInfo.latest,version)){return{status:"update",info:{message:t("Qwen Code update available! {{current}} \u2192 {{latest}}",{current:version,latest:updateInfo.latest}),update:{...updateInfo,current:version}}}}}return{status:"up-to-date",currentVersion:version}}catch(e){const error=e instanceof Error?e:new Error(String(e));debugLogger.warn("Failed to check for updates: "+error);return{status:"error",error,currentVersion}}}__name(checkForUpdatesDetailed,"checkForUpdatesDetailed");async function checkForUpdates(fetchGlobalNpm=fetchGlobalNpmUpdateInfo){const result=await checkForUpdatesDetailed(fetchGlobalNpm);return result.status==="update"?result.info:null}__name(checkForUpdates,"checkForUpdates");export{FETCH_TIMEOUT_MS,UpdateCheckTimeoutError,classifyUpdateCheckError,describeUpdateCheckFailure,runGlobalNpm,fetchGlobalNpmUpdateInfo,checkForUpdatesDetailed,checkForUpdates};
|
|
3
|
+
import{getInstallationInfo,getNpmCliPath,getNpmNodePath}from"./chunk-GOZ5FAUV.js";import{t}from"./chunk-FK5L2WVV.js";import{getPackageJson}from"./chunk-6KMPLONS.js";import{isBunRuntime}from"./chunk-WGNF7FPC.js";import{require_semver}from"./chunk-73G3MZQR.js";import{createDebugLogger}from"./chunk-46KPDLFH.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name,__toESM}from"./chunk-KBWJGX7I.js";init_esbuild_shims();var import_semver=__toESM(require_semver(),1);import{execFile}from"node:child_process";import{promisify}from"node:util";init_esbuild_shims();import*as fs from"node:fs";import*as os from"node:os";import*as path from"node:path";function npmrcValue(raw){const value=raw.trim();if(value.startsWith('"')&&value.endsWith('"')){try{const parsed=JSON.parse(value);if(typeof parsed==="string")return parsed}catch{return value}}if(value.startsWith("'")&&value.endsWith("'"))return value.slice(1,-1);return value.replace(/\\([\\;#])|[;#].*$/g,(_match,escaped)=>escaped??"").trim()}__name(npmrcValue,"npmrcValue");function expandEnv(value){return value.replace(/(\\*)\$\{([^}]+)\}/g,(match,escapes,name)=>{if(escapes.length%2)return match.slice(1);return escapes+(process.env[name]??`\${${name}}`)})}__name(expandEnv,"expandEnv");function readNpmrc(filename){let content;try{content=fs.readFileSync(filename,"utf8")}catch(error){if(error.code==="ENOENT")return new Map;throw new Error("Unable to read npm registry configuration")}const config=new Map;let inSection=false;for(const line of content.split(/\r?\n/)){if(/^\s*\[/.test(line))inSection=true;if(inSection||/^\s*[;#]/.test(line))continue;const match=line.match(/^\s*([^=]+?)\s*=(.*)$/);if(!match)continue;config.set(expandEnv(npmrcValue(match[1])),expandEnv(npmrcValue(match[2])))}return config}__name(readNpmrc,"readNpmrc");function getGlobalNpmRegistryConfig(packageName){const env=new Map;for(const[key,value]of Object.entries(process.env)){if(!/^npm_config_/i.test(key)||!value)continue;const suffix=key.slice("npm_config_".length);const name=suffix.startsWith("//")?suffix:suffix.toLowerCase().replace(/(?!^)_/g,"-");env.set(expandEnv(name),expandEnv(value.trim()))}const home=os.homedir();const configPath=__name(value=>{if(/^~(?=\/|$)/.test(value)){if(!path.isAbsolute(home)){throw new Error("Cannot resolve npm configuration without an absolute home directory")}value=value.replace(/^~/,home)}return path.resolve(value)},"configPath");const builtin=readNpmrc(path.join(path.dirname(process.execPath),...process.platform==="win32"?["node_modules","npm","npmrc"]:["..","lib","node_modules","npm","npmrc"]));const userConfig=env.get("userconfig")??builtin.get("userconfig")??(path.isAbsolute(home)?path.join(home,".npmrc"):void 0);const user=userConfig?readNpmrc(configPath(userConfig)):new Map;let defaultPrefix=path.dirname(process.execPath);if(process.platform!=="win32"){defaultPrefix=path.dirname(defaultPrefix);if(process.env["DESTDIR"]){defaultPrefix=path.join(process.env["DESTDIR"],defaultPrefix)}}if(process.env["PREFIX"])defaultPrefix=process.env["PREFIX"];const prefix=env.get("prefix")??user.get("prefix")??builtin.get("prefix")??defaultPrefix;const global=readNpmrc(configPath(env.get("globalconfig")??user.get("globalconfig")??builtin.get("globalconfig")??path.join(prefix,"etc","npmrc")));const config=new Map([...builtin,...global,...user,...env]);const scope=packageName.startsWith("@")?packageName.split("/")[0]:void 0;let registry;try{registry=new URL(scope&&config.get(`${scope}:registry`)||config.get("registry")||"https://registry.npmjs.org/")}catch{throw new Error("Invalid npm registry configuration")}if(!["https:","http:"].includes(registry.protocol)||registry.username||registry.password){throw new Error("Invalid npm registry configuration")}if(!registry.pathname.endsWith("/"))registry.pathname+="/";registry.search="";registry.hash="";let authPath=registry.pathname;for(;;){const key=`//${registry.host}${authPath}:`;const token=config.get(`${key}_authToken`);const auth=config.get(`${key}_auth`);const username=config.get(`${key}username`);const password=config.get(`${key}_password`);let authorization;if(token)authorization=`Bearer ${token}`;else if(auth)authorization=`Basic ${auth}`;else if(username&&password){const decodedPassword=Buffer.from(password,"base64").toString("utf8");authorization=`Basic ${Buffer.from(`${username}:${decodedPassword}`).toString("base64")}`}if(authorization){try{new Headers({Authorization:authorization})}catch{throw new Error("Invalid npm registry authentication configuration")}return{registry,authorization}}if(authPath==="")break;authPath=authPath.replace(/([^/]+|\/)$/,"")}return{registry}}__name(getGlobalNpmRegistryConfig,"getGlobalNpmRegistryConfig");var debugLogger=createDebugLogger("UPDATE_CHECK");var FETCH_TIMEOUT_MS=5e3;var UpdateCheckTimeoutError=class extends Error{static{__name(this,"UpdateCheckTimeoutError")}distTag;constructor(timeoutMs,distTag){const suffix=distTag?` for ${distTag}`:"";super(`update check timed out after ${timeoutMs}ms${suffix}`);this.name="UpdateCheckTimeoutError";this.distTag=distTag}};var NETWORK_ERROR_CODES=["ENOTFOUND","ECONNREFUSED","EAI_AGAIN","ETIMEDOUT","ENETUNREACH"];function classifyUpdateCheckError(error){if(error instanceof UpdateCheckTimeoutError)return"timeout";if(error instanceof Error){if(error.name==="TimeoutError")return"timeout";if("killed"in error&&error.killed===true&&"signal"in error&&error.signal==="SIGTERM"){return"timeout"}const errors=[error];if(error.cause instanceof Error)errors.push(error.cause);const matchesCode=__name(code=>errors.some(error2=>error2.code===code||error2.message.includes(code)),"matchesCode");if(NETWORK_ERROR_CODES.some(matchesCode))return"offline"}return"registry"}__name(classifyUpdateCheckError,"classifyUpdateCheckError");function describeUpdateCheckFailure(error,timeoutMs=FETCH_TIMEOUT_MS){switch(classifyUpdateCheckError(error)){case"timeout":return t("registry did not respond within {{seconds}}s",{seconds:String(Math.round(timeoutMs/1e3))});case"offline":return t("registry unreachable");default:return t("registry error")}}__name(describeUpdateCheckFailure,"describeUpdateCheckFailure");async function fetchInfoWithTimeout(notifier,timeoutMs,distTag){let timer;try{return await Promise.race([Promise.resolve(notifier.fetchInfo()),new Promise((_,reject)=>{timer=setTimeout(()=>reject(new UpdateCheckTimeoutError(timeoutMs,distTag)),timeoutMs)})])}finally{if(timer!==void 0)clearTimeout(timer)}}__name(fetchInfoWithTimeout,"fetchInfoWithTimeout");var execFileAsync=promisify(execFile);async function runGlobalNpm(args,run=execFileAsync,platform=process.platform,nodePath=getNpmNodePath(),resolveNpmCliPath=getNpmCliPath){const{stdout}=await run(nodePath,[resolveNpmCliPath(nodePath,platform),...args],{encoding:"utf8",timeout:FETCH_TIMEOUT_MS});return String(stdout).trim()}__name(runGlobalNpm,"runGlobalNpm");async function fetchGlobalNpmUpdateInfo(packageName,currentVersion,distTag,run=execFileAsync){if(isBunRuntime()&&getInstallationInfo("",false).isStandalone){const{registry,authorization}=getGlobalNpmRegistryConfig(packageName);let url=new URL(`-/package/${encodeURIComponent(packageName)}/dist-tags`,registry);const signal=AbortSignal.timeout(FETCH_TIMEOUT_MS);let auth=authorization;let response;for(let redirects=0;;redirects++){response=await fetch(url,{signal,headers:auth?{Authorization:auth}:void 0,redirect:"manual"});if(![301,302,303,307,308].includes(response.status))break;const location=response.headers.get("location");await response.body?.cancel();if(!location||redirects===5){throw new Error("Invalid npm registry redirect")}let next;try{next=new URL(location,url)}catch{throw new Error("Invalid npm registry redirect")}if(!["https:","http:"].includes(next.protocol)||next.username||next.password){throw new Error("Invalid npm registry redirect")}if(next.origin!==url.origin)auth=void 0;url=next}if(!response.ok)throw new Error(`Registry returned HTTP ${response.status}`);const tags=await response.json();if(typeof tags!=="object"||tags===null||Array.isArray(tags)){throw new Error("Invalid registry dist-tags response")}const latest2=Reflect.get(tags,distTag);if(latest2!==void 0&&typeof latest2!=="string"){throw new Error(`Invalid registry ${distTag} version response`)}return{latest:latest2??currentVersion,current:currentVersion,type:"latest",name:packageName}}const output=await runGlobalNpm(["view",packageName,`dist-tags.${distTag}`,"--json","--global"],run);if(output===""){return{latest:currentVersion,current:currentVersion,type:"latest",name:packageName}}const parsed=JSON.parse(output);const latest=typeof parsed==="string"?parsed:Array.isArray(parsed)&&parsed.length===1&&typeof parsed[0]==="string"?parsed[0]:void 0;if(latest===void 0){throw new Error(`Invalid npm ${distTag} version response`)}return{latest,current:currentVersion,type:"latest",name:packageName}}__name(fetchGlobalNpmUpdateInfo,"fetchGlobalNpmUpdateInfo");function getBestAvailableUpdate(nightly,stable){if(!nightly)return stable||null;if(!stable)return nightly||null;const nightlyVer=nightly.latest;const stableVer=stable.latest;if(import_semver.default.coerce(stableVer)?.version===import_semver.default.coerce(nightlyVer)?.version){return nightly}return import_semver.default.gt(stableVer,nightlyVer)?stable:nightly}__name(getBestAvailableUpdate,"getBestAvailableUpdate");async function checkForUpdatesDetailed(fetchGlobalNpm=fetchGlobalNpmUpdateInfo){let currentVersion;try{if(process.env["DEV"]==="true"){return{status:"skipped",reason:"development mode"}}const packageJson=await getPackageJson();if(!packageJson||!packageJson.name||!packageJson.version){return{status:"skipped",reason:"package metadata unavailable"}}const{name,version}=packageJson;currentVersion=version;const isNightly=version.includes("nightly");const createNotifier=__name(distTag=>({fetchInfo:__name(()=>fetchGlobalNpm(name,version,distTag),"fetchInfo")}),"createNotifier");if(isNightly){const[nightlyUpdateInfo,latestUpdateInfo]=await Promise.all([fetchInfoWithTimeout(createNotifier("nightly"),FETCH_TIMEOUT_MS,"nightly"),fetchInfoWithTimeout(createNotifier("latest"),FETCH_TIMEOUT_MS,"latest")]);debugLogger.debug(`fetchInfo returned nightly=${JSON.stringify(nightlyUpdateInfo)} latest=${JSON.stringify(latestUpdateInfo)} for current=${version}`);const bestUpdate=getBestAvailableUpdate(nightlyUpdateInfo,latestUpdateInfo);if(bestUpdate&&import_semver.default.gt(bestUpdate.latest,version)){return{status:"update",info:{message:t("A new version of MiraOS is available! {{current}} \u2192 {{latest}}",{current:version,latest:bestUpdate.latest}),update:{...bestUpdate,current:version}}}}}else{const updateInfo=await fetchInfoWithTimeout(createNotifier("latest"),FETCH_TIMEOUT_MS,"latest");debugLogger.debug(`fetchInfo returned ${JSON.stringify(updateInfo)} for current=${version}`);if(updateInfo&&import_semver.default.gt(updateInfo.latest,version)){return{status:"update",info:{message:t("Qwen Code update available! {{current}} \u2192 {{latest}}",{current:version,latest:updateInfo.latest}),update:{...updateInfo,current:version}}}}}return{status:"up-to-date",currentVersion:version}}catch(e){const error=e instanceof Error?e:new Error(String(e));debugLogger.warn("Failed to check for updates: "+error);return{status:"error",error,currentVersion}}}__name(checkForUpdatesDetailed,"checkForUpdatesDetailed");async function checkForUpdates(fetchGlobalNpm=fetchGlobalNpmUpdateInfo){const result=await checkForUpdatesDetailed(fetchGlobalNpm);return result.status==="update"?result.info:null}__name(checkForUpdates,"checkForUpdates");export{FETCH_TIMEOUT_MS,UpdateCheckTimeoutError,classifyUpdateCheckError,describeUpdateCheckFailure,runGlobalNpm,fetchGlobalNpmUpdateInfo,checkForUpdatesDetailed,checkForUpdates};
|
|
4
4
|
/**
|
|
5
5
|
* @license
|
|
6
6
|
* Copyright 2026 Alibaba Inc.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import{executeBwrap}from"./chunk-
|
|
3
|
+
import{executeBwrap}from"./chunk-AIGBQN6R.js";import{executeLandlock}from"./chunk-4GNHXVJZ.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name}from"./chunk-KBWJGX7I.js";init_esbuild_shims();function executeSandbox(policy,payload,onOutput,signal,usePty=false,config={},options={}){if(policy.effectiveBackend==="bwrap"){return executeBwrap(policy,payload,onOutput,signal,usePty,config,options)}if(policy.effectiveBackend==="landlock"){return executeLandlock(policy,payload,onOutput,signal,usePty,config,options)}return Promise.reject(new Error("Sandbox backend was not resolved."))}__name(executeSandbox,"executeSandbox");export{executeSandbox};
|
|
4
4
|
/**
|
|
5
5
|
* @license
|
|
6
6
|
* Copyright 2026 Qwen Team
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import{GlobTool}from"./chunk-I2VRXV5B.js";import{GrepTool}from"./chunk-GDBMOSHC.js";import{LSTool}from"./chunk-ZWU3AE2V.js";import{NotebookEditTool}from"./chunk-
|
|
3
|
+
import{GlobTool}from"./chunk-I2VRXV5B.js";import{GrepTool}from"./chunk-GDBMOSHC.js";import{LSTool}from"./chunk-ZWU3AE2V.js";import{NotebookEditTool}from"./chunk-2VW4HXVF.js";import{TaskStopTool}from"./chunk-NU5JNC5E.js";import{WriteFileTool}from"./chunk-724YPZRX.js";import{EditTool}from"./chunk-V5Z6OEKJ.js";import{ShellTool,isModifiableDeclarativeTool}from"./chunk-PFKTTUGS.js";import{stableJson}from"./chunk-FIXDX63I.js";import{ReadFileTool}from"./chunk-MJEL7DIE.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name}from"./chunk-KBWJGX7I.js";init_esbuild_shims();import{stat}from"node:fs/promises";function createExecutionTools(config){const tools=[new ReadFileTool(config),new WriteFileTool(config),new EditTool(config),new NotebookEditTool(config),new GlobTool(config),new GrepTool(config),new LSTool(config),new ShellTool(config),new TaskStopTool(config)];return new Map(tools.map(tool=>[tool.name,tool]))}__name(createExecutionTools,"createExecutionTools");var LocalExecutionEnvironment=class{constructor(config,options={}){this.config=config;this.toolNames=options.toolNames;this.run=options.run;this.tools=createExecutionTools(config);if(options.toolNames){for(const name of this.tools.keys()){if(!options.toolNames.has(name))this.tools.delete(name)}}}static{__name(this,"LocalExecutionEnvironment")}toolNames;tools;invocations=new Map;controllers=new Set;run;disposed=false;tool(name){if(this.disposed)throw new Error("Execution environment is disposed.");const tool=this.tools.get(name);if(!tool)throw new Error(`Unsupported execution tool: ${name}`);return tool}pending(id){if(this.disposed)throw new Error("Execution environment is disposed.");const pending=this.invocations.get(id);if(!pending)throw new Error(`Unknown execution invocation: ${id}`);if(pending.executing)throw new Error(`Invocation is executing: ${id}`);return pending}toolDefinition(name){const{name:toolName,description,parametersJsonSchema}=this.tool(name).schema;return{name:toolName,description,parametersJsonSchema}}async prepare(request,signal){signal.throwIfAborted();const tool=this.tool(request.toolName);if(this.invocations.has(request.id))throw new Error(`Duplicate invocation: ${request.id}`);if(this.invocations.size>=256)throw new Error("Too many pending execution invocations.");let params=structuredClone(request.params);if(request.modification){if(!isModifiableDeclarativeTool(tool))throw new Error("Tool does not support modification.");params=tool.getModifyContext(signal).createUpdatedParams(request.modification.oldContent,request.modification.newContent,params)}const invocation=tool.build(params);this.invocations.set(request.id,{toolName:request.toolName,invocation,executing:false,...request.callId===void 0?{}:{callId:request.callId}});return{params:invocation.params,description:invocation.getDescription(),locations:invocation.toolLocations()}}async permission(id,signal){signal.throwIfAborted();return this.pending(id).invocation.getDefaultPermission(signal)}async confirmation(id,signal){signal.throwIfAborted();const pending=this.pending(id);const details=await pending.invocation.getConfirmationDetails(signal);pending.confirmation=details;const{onConfirm:_onConfirm,...serializable}=details;return serializable}async confirm(id,outcome,payload,signal){signal.throwIfAborted();const pending=this.pending(id);await pending.confirmation?.onConfirm(outcome,payload);if(outcome==="cancel")this.invocations.delete(id)}async execute(id,signal,updateOutput){signal.throwIfAborted();const pending=this.pending(id);pending.executing=true;const controller=new AbortController;const abort=__name(()=>controller.abort(signal.reason),"abort");signal.addEventListener("abort",abort,{once:true});this.controllers.add(controller);try{if(this.run){const params=structuredClone(pending.invocation.params);const rebuilt=this.tool(pending.toolName).build(structuredClone(params)).params;if(stableJson(rebuilt)!==stableJson(params)){throw new Error("The approved parameters change when the tool builds them again; the call did not run.")}return await this.run({id,toolName:pending.toolName,params,...pending.callId===void 0?{}:{callId:pending.callId}},controller.signal,updateOutput)}return await pending.invocation.execute(controller.signal,updateOutput,{...this.config.getShellExecutionConfig(),streamBufferedOutput:true})}finally{signal.removeEventListener("abort",abort);this.controllers.delete(controller);this.invocations.delete(id)}}async modificationContent(toolName,params,signal){signal.throwIfAborted();const tool=this.tool(toolName);if(!isModifiableDeclarativeTool(tool))throw new Error("Tool does not support modification.");const context=tool.getModifyContext(signal);const current=await context.getCurrentContent(params);const proposed=await context.getProposedContent(params);return{current,proposed}}async release(id,signal){signal.throwIfAborted();if(!this.invocations.get(id)?.executing)this.invocations.delete(id)}async invalidateReadCache(paths){const cache=this.config.getFileReadCache();if(!paths){cache.clear();return}await Promise.all(paths.map(async filePath=>{const stats=await stat(filePath).catch(()=>void 0);if(!stats||!cache.markReadEvictedFromHistory(stats))cache.invalidateByPath(filePath)}))}async dispose(){this.disposed=true;for(const controller of this.controllers)controller.abort();this.config.getBackgroundShellRegistry().abortAll();this.invocations.clear();this.tools.clear()}};export{createExecutionTools,LocalExecutionEnvironment};
|
|
4
4
|
/**
|
|
5
5
|
* @license
|
|
6
6
|
* Copyright 2026 Qwen Team
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import{t}from"./chunk-
|
|
3
|
+
import{t}from"./chunk-FK5L2WVV.js";import{computeThresholds,estimateContextTextTokens,formatContextFileDisplayPath,getAutoMemorySnapshot,getMainSessionBaseSystemPrompt,withoutAutoMemorySnapshots}from"./chunk-PFKTTUGS.js";import{stripTerminalControlSequences}from"./chunk-R2EHHA2C.js";import{qualifySkillName}from"./chunk-CV2UAEZA.js";import{DiscoveredMCPTool,uiTelemetryService}from"./chunk-MJEL7DIE.js";import{getAllMemoryFilenames}from"./chunk-6JHMYZNS.js";import{DEFAULT_TOKEN_LIMIT}from"./chunk-EV2CXPMN.js";import{resolveSlimmingConfig}from"./chunk-Q6UAOTP3.js";import{AUTO_MEMORY_SNAPSHOT_METADATA,buildAvailableSkillsReminder,getStartupContextLength,isSkillListingReminder}from"./chunk-DMM5LJWL.js";import{ToolNames}from"./chunk-SBZFGYYS.js";import{Storage}from"./chunk-5VB4YX3Z.js";import{isSubpath}from"./chunk-2ZK2FGZQ.js";import{getErrorMessage}from"./chunk-E7MYPQGV.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name}from"./chunk-KBWJGX7I.js";init_esbuild_shims();import*as path from"node:path";init_esbuild_shims();import*as fs from"node:fs/promises";var EXTENSION_REF_PREFIX="ext:";var EXTENSION_CONTEXT_BUDGET=2e5;var EXTENSION_CONTEXT_FILE_CAP=5e4;function parseExtensionRef(pathName){if(!pathName.startsWith(EXTENSION_REF_PREFIX))return null;const name=pathName.slice(EXTENSION_REF_PREFIX.length);if(!name)return null;return{name}}__name(parseExtensionRef,"parseExtensionRef");function buildExtensionRef(extensionName){return`${EXTENSION_REF_PREFIX}${extensionName}`}__name(buildExtensionRef,"buildExtensionRef");function matchExtensionByRef(name,extensions){const lower=name.toLowerCase();return extensions.find(ext=>ext.name.toLowerCase()===lower||ext.config.name.toLowerCase()===lower)}__name(matchExtensionByRef,"matchExtensionByRef");var BIDI_CONTROL_RE=/[]/g;function sanitizeDisplayText(raw){const stripped=stripTerminalControlSequences(raw).replace(BIDI_CONTROL_RE,"").replace(/\s+/g," ").trim();return stripped.length>0?stripped:null}__name(sanitizeDisplayText,"sanitizeDisplayText");function getSanitizedExtensionDisplayName(extension){return sanitizeDisplayText(extension.displayName||extension.name)||extension.name}__name(getSanitizedExtensionDisplayName,"getSanitizedExtensionDisplayName");function buildExtensionContextText(extension){const displayName=getSanitizedExtensionDisplayName(extension);const lines=[];lines.push(`--- Extension: ${displayName} (untrusted third-party content) ---`);if(extension.config.description){const desc=sanitizeDisplayText(extension.config.description);if(desc){lines.push(desc);lines.push("")}}const capabilities=[];if(extension.skills&&extension.skills.length>0){const skillNames=extension.skills.map(s=>sanitizeDisplayText(qualifySkillName(extension.name,s.name))||s.name).join(", ");capabilities.push(`- Skills: ${skillNames} (invoke via /<skill-name>)`)}if(extension.mcpServers&&Object.keys(extension.mcpServers).length>0){const serverNames=Object.keys(extension.mcpServers).map(n=>sanitizeDisplayText(n)||n).join(", ");capabilities.push(`- MCP Servers: ${serverNames}`)}if(extension.agents&&extension.agents.length>0){const agentNames=extension.agents.map(a=>sanitizeDisplayText(a.name)||a.name).join(", ");capabilities.push(`- Agents: ${agentNames}`)}if(capabilities.length>0){lines.push("Available capabilities from this extension:");lines.push(...capabilities);lines.push("")}lines.push(`--- End Extension: ${displayName} ---`);return lines.join("\n")}__name(buildExtensionContextText,"buildExtensionContextText");async function buildExtensionMentionContext(extension,options){let contextText=buildExtensionContextText(extension);let remainingBudget=options.remainingBudget;if(extension.contextFiles.length===0){return{text:contextText,remainingBudget}}const fileReads=await Promise.allSettled(extension.contextFiles.map(async contextFilePath=>{let realPath;let realExtPath;try{realPath=await fs.realpath(contextFilePath);realExtPath=await fs.realpath(extension.path)}catch{options.onDebugMessage?.(`Skipping unreadable context file: ${contextFilePath}`);return null}if(!isSubpath(realExtPath,realPath)){options.onDebugMessage?.(`Skipping context file outside extension directory: ${contextFilePath}`);return null}return fs.readFile(realPath,{encoding:"utf-8",signal:options.signal})}));for(let i=0;i<fileReads.length;i++){const outcome=fileReads[i];if(outcome.status==="rejected"){options.onDebugMessage?.(`Failed to read extension context file ${extension.contextFiles[i]}: ${getErrorMessage(outcome.reason)}`);continue}const content=outcome.value;if(!content||!content.trim())continue;if(remainingBudget<=0){options.onDebugMessage?.("Extension context budget exhausted, skipping remaining files.");break}const cap=Math.min(EXTENSION_CONTEXT_FILE_CAP,remainingBudget);const cappedContent=content.length>cap?content.slice(0,cap)+"\n... (truncated)":content;contextText+=`
|
|
4
4
|
|
|
5
5
|
${cappedContent}`;remainingBudget-=cappedContent.length}return{text:contextText,remainingBudget}}__name(buildExtensionMentionContext,"buildExtensionMentionContext");function currentTier(tokens,thresholds){if(tokens>=thresholds.hard)return"hard";if(tokens>=thresholds.auto)return"auto";if(tokens>=thresholds.warn)return"warn";return"safe"}__name(currentTier,"currentTier");function extensionContextFileOwners(config,workingDir){const owners=new Map;for(const extension of config.getActiveExtensions?.()??[]){const displayName=getSanitizedExtensionDisplayName(extension);for(const contextFile of extension.contextFiles??[]){const absolutePath=path.resolve(workingDir,contextFile);const fileLabel=formatContextFileDisplayPath(absolutePath,extension.path);owners.set(absolutePath,`${t("Extension")}: ${displayName} \xB7 ${fileLabel}`)}}return owners}__name(extensionContextFileOwners,"extensionContextFileOwners");function parseMemoryFiles(memoryContent,workingDir,extensionOwners=new Map,admissionRoot=workingDir){if(!memoryContent||memoryContent.trim().length===0)return[];const results=[];const root=path.resolve(admissionRoot);const globalDir=path.resolve(Storage.getGlobalQwenDir());const memoryFilenames=new Set(getAllMemoryFilenames());const openablePath=__name(absolutePath=>isSubpath(root,absolutePath)||path.resolve(path.dirname(absolutePath))===globalDir&&memoryFilenames.has(path.basename(absolutePath))?absolutePath:void 0,"openablePath");const regex=/--- Context from: (.+?) ---\n([\s\S]*?)--- End of Context from: \1 ---/g;let match;while((match=regex.exec(memoryContent))!==null){const filePath=match[1];const content=match[2];const absolutePath=path.resolve(workingDir,filePath);const owner=extensionOwners.get(absolutePath);const openPath=openablePath(absolutePath);results.push({path:owner??formatContextFileDisplayPath(absolutePath,workingDir),tokens:estimateContextTextTokens(content),...openPath!==void 0?{absolutePath:openPath}:{}})}if(results.length===0&&memoryContent.trim().length>0){results.push({path:t("memory"),tokens:estimateContextTextTokens(memoryContent)})}return results}__name(parseMemoryFiles,"parseMemoryFiles");function unescapeXml(text){return text.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/&/g,"&")}__name(unescapeXml,"unescapeXml");var SKILL_LISTING_ENTRY=/<skill>\n<name>\n([\s\S]*?)\n<\/name>[\s\S]*?<\/skill>/g;function measureSkillListing(text){const byName=new Map;for(const match of text.matchAll(SKILL_LISTING_ENTRY)){const name=unescapeXml(match[1]);byName.set(name.toLowerCase(),{name,tokens:estimateContextTextTokens(match[0])})}return{tokens:estimateContextTextTokens(text),byName}}__name(measureSkillListing,"measureSkillListing");function mergeSkillListing(into,from){into.tokens+=from.tokens;for(const[name,entry]of from.byName){into.byName.set(name,entry)}}__name(mergeSkillListing,"mergeSkillListing");function measureTailSkillListings(conversation){const listing={tokens:0,byName:new Map};const billedTexts=new Set;for(const content of conversation){for(const part of content.parts??[]){const text=part.text;if(typeof text!=="string"||!isSkillListingReminder(text))continue;const measured=measureSkillListing(text);if(measured.byName.size===0)continue;mergeSkillListing(listing,measured);billedTexts.add(text)}}return{listing,billedTexts}}__name(measureTailSkillListings,"measureTailSkillListings");function measureStartupPrelude(prelude){const skillListing={tokens:0,byName:new Map};let startupContextTokens=0;for(const content of prelude){for(const part of content.parts??[]){if(typeof part.text!=="string")continue;if(isSkillListingReminder(part.text)){mergeSkillListing(skillListing,measureSkillListing(part.text))}else{startupContextTokens+=estimateContextTextTokens(part.text)}}}return{skillListing,startupContextTokens}}__name(measureStartupPrelude,"measureStartupPrelude");function estimateFunctionResponseTokens(part,imageTokenEstimate){const response=part.functionResponse;let tokens=estimateContextTextTokens(JSON.stringify({id:response.id,name:response.name,response:response.response}));const nested=response.parts;if(Array.isArray(nested)){for(const inner of nested){if(inner.inlineData||inner.fileData){tokens+=imageTokenEstimate}else if(typeof inner.text==="string"){tokens+=estimateContextTextTokens(inner.text)}}}return tokens}__name(estimateFunctionResponseTokens,"estimateFunctionResponseTokens");function consumeBilledSkillBody(part,billedSkillBodies){if(billedSkillBodies.size===0)return false;const output=part.functionResponse?.response?.output;if(typeof output!=="string")return false;if(billedSkillBodies.delete(output))return true;for(const body of billedSkillBodies){if(output.startsWith(`${body}
|
|
6
6
|
`)){billedSkillBodies.delete(body);return true}}return false}__name(consumeBilledSkillBody,"consumeBilledSkillBody");function estimateConversationTokens(conversation,billing){let tokens=0;const remainingSkillBodies=new Set(billing.billedSkillBodies);for(const content of conversation){for(const part of content.parts??[]){if(typeof part.text==="string"){if(billing.billedListingTexts.has(part.text))continue;tokens+=estimateContextTextTokens(part.text)}else if(part.inlineData||part.fileData){tokens+=billing.imageTokenEstimate}else if(part.functionCall){tokens+=estimateContextTextTokens(JSON.stringify(part.functionCall))}else if(part.functionResponse){if(part.functionResponse.name===ToolNames.SKILL&&consumeBilledSkillBody(part,remainingSkillBodies)){continue}tokens+=estimateFunctionResponseTokens(part,billing.imageTokenEstimate)}}}return tokens}__name(estimateConversationTokens,"estimateConversationTokens");async function collectContextData(config,showDetails){const modelName=config.getModel()||"unknown";const contentGeneratorConfig=config.getContentGeneratorConfig();const contextWindowSize=contentGeneratorConfig.contextWindowSize??DEFAULT_TOKEN_LIMIT;const llmClient=config.getLlmClient?.();const activeChat=llmClient?.isInitialized?.()?llmClient.getChat():void 0;const apiTotalTokens=activeChat?activeChat.getLastPromptTokenCount():uiTelemetryService.getLastPromptTokenCount();const apiCachedTokens=activeChat?.getLastCachedContentTokenCount?.()??uiTelemetryService.getLastCachedContentTokenCount();const history=activeChat?.getHistoryShallow?.()??activeChat?.getHistory?.()??[];const preludeLength=getStartupContextLength(history);const prelude=measureStartupPrelude(withoutAutoMemorySnapshots(history.slice(0,preludeLength)));const conversationHistory=withoutAutoMemorySnapshots(history.slice(preludeLength));const tailSkillListings=measureTailSkillListings(conversationHistory);let conversationTokens=0;const systemPromptText=getMainSessionBaseSystemPrompt(config);const systemPromptTokens=estimateContextTextTokens(systemPromptText);const toolRegistry=config.getToolRegistry();const allTools=toolRegistry?toolRegistry.getAllTools():[];const toolDeclarations=toolRegistry?toolRegistry.getFunctionDeclarations():[];const toolsJsonStr=JSON.stringify(toolDeclarations);const allToolsTokens=estimateContextTextTokens(toolsJsonStr);const builtinTools=[];const mcpTools=[];for(const declaration of toolDeclarations){const tool=allTools.find(tool2=>tool2.name===declaration.name);const toolJsonStr=JSON.stringify(declaration);const tokens=estimateContextTextTokens(toolJsonStr);if(tool instanceof DiscoveredMCPTool){mcpTools.push({name:`${tool.serverName}__${tool.serverToolName||tool.name}`,tokens})}else if(declaration.name!==ToolNames.SKILL){builtinTools.push({name:declaration.name,tokens})}}const memoryContent=config.getUserMemory();const instructionFiles=parseMemoryFiles(memoryContent,config.getWorkingDir(),extensionContextFileOwners(config,config.getWorkingDir()),config.storage.getProjectRoot());const memoryFiles=[];const instructionFilesTokens=instructionFiles.reduce((sum,f)=>sum+f.tokens,0);const catalog=config.getAutoMemoryContext?.()??"";const snapshots=catalog?history.flatMap(content=>(content.parts??[]).filter(part=>part.partMetadata?.[AUTO_MEMORY_SNAPSHOT_METADATA]===true)):[];const pendingSnapshot=getAutoMemorySnapshot(history,catalog);if(pendingSnapshot)snapshots.push(pendingSnapshot);const autoMemoryTokens=estimateContextTextTokens(config.getAutoMemoryPrompt())+snapshots.reduce((sum,part)=>sum+estimateContextTextTokens(part.text??""),0);if(autoMemoryTokens>0){memoryFiles.push({path:t("auto memory"),tokens:autoMemoryTokens})}const memoryFilesTokens=memoryFiles.reduce((sum,f)=>sum+f.tokens,0);const skillTool=allTools.find(tool=>tool.name===ToolNames.SKILL);const skillDeclaration=toolDeclarations.find(declaration=>declaration.name===ToolNames.SKILL);const skillToolDefinitionTokens=skillDeclaration?estimateContextTextTokens(JSON.stringify(skillDeclaration)):0;const loadedContentNames=skillTool&&"getLoadedSkillContentNames"in skillTool?skillTool.getLoadedSkillContentNames():new Map;const bodyTokensByName=new Map;for(const[content,name]of loadedContentNames){bodyTokensByName.set(name,(bodyTokensByName.get(name)??0)+estimateContextTextTokens(content))}const loadedBodiesTokens=[...bodyTokensByName.values()].reduce((sum,tokens)=>sum+tokens,0);const skillManager=config.getSkillManager();const skillConfigs=skillManager?await skillManager.listSkills():[];const enabledSkillNames=new Set(skillConfigs.filter(skill=>config.isSkillEnabled(skill)).map(skill=>skill.name.toLowerCase()));let skillListing=prelude.skillListing;if(!activeChat){const reminder=await buildAvailableSkillsReminder(config);if(reminder){skillListing=measureSkillListing(reminder.reminder)}}mergeSkillListing(skillListing,tailSkillListings.listing);const billedSkillBodies=new Set(loadedContentNames.keys());const skills=skillConfigs.map(skill=>{const listingTokens=skillListing.byName.get(skill.name.toLowerCase())?.tokens??0;const bodyTokens=bodyTokensByName.get(skill.name);const isLoaded=bodyTokens!==void 0;return{name:skill.name,tokens:listingTokens,loaded:isLoaded,bodyTokens}});const discoveredNames=new Set(skillConfigs.map(skill=>skill.name));for(const[name,bodyTokens]of bodyTokensByName){if(!discoveredNames.has(name)){skills.push({name,tokens:skillListing.byName.get(name.toLowerCase())?.tokens??0,loaded:true,bodyTokens})}}const rowedNames=new Set(skills.map(s=>s.name.toLowerCase()));for(const[key,entry]of skillListing.byName){enabledSkillNames.add(key);if(rowedNames.has(key))continue;rowedNames.add(key);skills.push({name:entry.name,tokens:entry.tokens,loaded:false})}conversationTokens=estimateConversationTokens(conversationHistory,{imageTokenEstimate:resolveSlimmingConfig(config.getChatCompression?.()).imageTokenEstimate,billedSkillBodies,billedListingTexts:tailSkillListings.billedTexts});const skillsTokens=skillToolDefinitionTokens+skillListing.tokens+loadedBodiesTokens;const startupContextTokens=prelude.startupContextTokens;const thresholds=computeThresholds(contextWindowSize,config.getAutoCompactThreshold());const autocompactBuffer=Math.max(0,Math.round(contextWindowSize-thresholds.auto));const rawOverhead=systemPromptTokens+allToolsTokens+instructionFilesTokens+memoryFilesTokens+skillListing.tokens+loadedBodiesTokens+startupContextTokens;const rawContent=rawOverhead+conversationTokens;const hasTokenCount=apiTotalTokens>0;const isEstimated=!hasTokenCount||activeChat?.isLastPromptTokenCountEstimated()===true;const mcpToolsTotalTokens=mcpTools.reduce((sum,tool)=>sum+tool.tokens,0);const totalTokens=hasTokenCount?apiTotalTokens:0;const clampDeficit=Math.max(0,skillToolDefinitionTokens+mcpToolsTotalTokens-allToolsTokens);const clampedMcpTools=Math.max(0,mcpToolsTotalTokens-clampDeficit);const clampedSkills=skillsTokens-Math.max(0,clampDeficit-mcpToolsTotalTokens);const clampedBuiltinTools=Math.max(0,allToolsTokens-skillToolDefinitionTokens-clampedMcpTools);const mcpDetailShare=mcpToolsTotalTokens>0?clampedMcpTools/mcpToolsTotalTokens:1;const detailMcpTools=mcpDetailShare<1?mcpTools.map(item=>({...item,tokens:Math.round(item.tokens*mcpDetailShare)})):mcpTools;const tierTokens=hasTokenCount?apiTotalTokens:rawContent;const freeSpace=Math.max(0,contextWindowSize-tierTokens-autocompactBuffer);const breakdown={systemPrompt:systemPromptTokens,builtinTools:clampedBuiltinTools,mcpTools:clampedMcpTools,instructionFiles:instructionFilesTokens,memoryFiles:memoryFilesTokens,skills:clampedSkills,startupContext:startupContextTokens,messages:conversationTokens,cachedTokens:hasTokenCount?apiCachedTokens:0,freeSpace,autocompactBuffer,thresholds,currentTier:currentTier(tierTokens,thresholds)};return{type:"context_usage",modelName,totalTokens,contextWindowSize,breakdown,builtinTools:showDetails?builtinTools:[],mcpTools:showDetails?detailMcpTools:[],instructionFiles:showDetails?instructionFiles:[],memoryFiles:showDetails?memoryFiles:[],skills:showDetails?skills.filter(skill=>skill.loaded||enabledSkillNames.has(skill.name.toLowerCase())):[],isEstimated,showDetails}}__name(collectContextData,"collectContextData");function fmtTokens(tokens){if(tokens>=999950){return`${(tokens/1e6).toFixed(1)}m`}if(tokens>=1e3){return`${(tokens/1e3).toFixed(1)}k`}return`${tokens}`}__name(fmtTokens,"fmtTokens");function fmtCategoryRow(label,tokens,contextWindowSize,indent=" "){const percentage=contextWindowSize>0?(tokens/contextWindowSize*100).toFixed(1):"0.0";const right=`${fmtTokens(tokens)} tokens (${percentage}%)`;const leftPart=`${indent}${label}`;const totalWidth=56;const dots=Math.max(1,totalWidth-leftPart.length-right.length);return`${leftPart}${" ".repeat(dots)}${right}`}__name(fmtCategoryRow,"fmtCategoryRow");function formatNum(n){return Math.round(n).toLocaleString("en-US")}__name(formatNum,"formatNum");function formatContextUsageText(data){const{modelName,totalTokens,contextWindowSize,breakdown,builtinTools,mcpTools,instructionFiles=[],memoryFiles,skills,isEstimated,showDetails}=data;const hasTokenCount=totalTokens>0;const memoryLabel=breakdown.instructionFiles===void 0?"Memory files":"Auto memory";const lines=[];lines.push("## Context Usage");lines.push("");if(!hasTokenCount){const includesConversation=breakdown.messages>0;lines.push(includesConversation?"*No provider usage yet. These are local estimates, including the conversation.*":"*No API response yet. Send a message to see actual usage.*");lines.push("");lines.push(includesConversation?"**Estimated usage, including the conversation**":"**Estimated pre-conversation overhead**");lines.push(`Model: ${modelName} Context window: ${fmtTokens(contextWindowSize)} tokens`);lines.push("")}else{lines.push(`Model: ${modelName} Context window: ${fmtTokens(contextWindowSize)} tokens`);lines.push("");if(isEstimated){lines.push("*Token usage is estimated until provider usage is received.*");lines.push("")}lines.push(fmtCategoryRow("Used",totalTokens,contextWindowSize));if((breakdown.cachedTokens??0)>0){lines.push(fmtCategoryRow("Cached prefix",breakdown.cachedTokens,contextWindowSize," \u2514 "))}lines.push(fmtCategoryRow("Free",breakdown.freeSpace,contextWindowSize));lines.push("");lines.push("**Compaction thresholds**");lines.push(` Effective window: ${formatNum(breakdown.thresholds.effectiveWindow)} (window \u2212 ${formatNum(contextWindowSize-breakdown.thresholds.effectiveWindow)} reserve)`);lines.push(` Warn threshold: ${formatNum(breakdown.thresholds.warn)}`);lines.push(` Auto threshold: ${formatNum(breakdown.thresholds.auto)}`);lines.push(` Hard threshold: ${formatNum(breakdown.thresholds.hard)}`);lines.push(` Current tier: ${breakdown.currentTier}`);lines.push("");lines.push("**Usage by category**")}lines.push(fmtCategoryRow("System prompt",breakdown.systemPrompt,contextWindowSize));lines.push(fmtCategoryRow("Built-in tools",breakdown.builtinTools,contextWindowSize));if(breakdown.mcpTools>0){lines.push(fmtCategoryRow("MCP tools",breakdown.mcpTools,contextWindowSize))}if(breakdown.instructionFiles!==void 0){lines.push(fmtCategoryRow("Instruction files",breakdown.instructionFiles,contextWindowSize))}lines.push(fmtCategoryRow(memoryLabel,breakdown.memoryFiles,contextWindowSize));lines.push(fmtCategoryRow("Skills",breakdown.skills,contextWindowSize));if((breakdown.startupContext??0)>0){lines.push(fmtCategoryRow("Startup context",breakdown.startupContext,contextWindowSize))}if(hasTokenCount||breakdown.messages>0){lines.push(fmtCategoryRow("Messages",breakdown.messages,contextWindowSize))}if(showDetails){const sortedBuiltin=[...builtinTools].sort((a,b)=>b.tokens-a.tokens);const sortedMcp=[...mcpTools].sort((a,b)=>b.tokens-a.tokens);const sortedMemory=[...memoryFiles].sort((a,b)=>b.tokens-a.tokens);const sortedSkills=[...skills].sort((a,b)=>{if(!a.loaded!==!b.loaded)return a.loaded?-1:1;return b.tokens+(b.bodyTokens??0)-(a.tokens+(a.bodyTokens??0))});if(sortedBuiltin.length>0){lines.push("");lines.push("**Built-in tools**");for(const tool of sortedBuiltin){lines.push(fmtCategoryRow(tool.name,tool.tokens,contextWindowSize," \u2514 "))}}if(sortedMcp.length>0){lines.push("");lines.push("**MCP tools**");for(const tool of sortedMcp){lines.push(fmtCategoryRow(tool.name,tool.tokens,contextWindowSize," \u2514 "))}}if(instructionFiles.length>0){lines.push("","**Instruction files**");for(const file of[...instructionFiles].sort((a,b)=>b.tokens-a.tokens)){lines.push(fmtCategoryRow(file.path,file.tokens,contextWindowSize," \u2514 "))}}if(sortedMemory.length>0){lines.push("");lines.push("**"+memoryLabel+"**");for(const file of sortedMemory){lines.push(fmtCategoryRow(file.path,file.tokens,contextWindowSize," \u2514 "))}}if(sortedSkills.length>0){lines.push("");lines.push("**Skills**");for(const skill of sortedSkills){lines.push(fmtCategoryRow(skill.name,skill.tokens,contextWindowSize," \u2514 "));if(skill.loaded&&skill.bodyTokens&&skill.bodyTokens>0){lines.push(fmtCategoryRow("body loaded",skill.bodyTokens,contextWindowSize," \u2514 "))}}}}else{lines.push("");lines.push("*Run /context detail for per-item breakdown.*")}return lines.join("\n")}__name(formatContextUsageText,"formatContextUsageText");var contextCommand={name:"context",get description(){return t('Show context window usage breakdown. Use "/context detail" for per-item breakdown.')},kind:"built-in",supportedModes:["interactive","non_interactive","acp"],action:__name(async(context,args)=>{const normalizedArgs=args?.trim().toLowerCase();const showDetails=normalizedArgs==="detail"||normalizedArgs==="-d";const executionMode=context.executionMode??"interactive";const{config}=context.services;if(!config){if(executionMode==="interactive"){context.ui.addItem({type:"error",text:t("Config not loaded.")},Date.now());return}return{type:"message",messageType:"error",content:t("Config not loaded.")}}const contextUsageItem=await collectContextData(config,showDetails);if(executionMode==="interactive"){context.ui.addItem(contextUsageItem,Date.now());return}return{type:"message",messageType:"info",content:formatContextUsageText(contextUsageItem)}},"action"),subCommands:[{name:"detail",get description(){return t("Show per-item context usage breakdown.")},kind:"built-in",supportedModes:["interactive","non_interactive","acp"],action:__name(async context=>{await contextCommand.action(context,"detail")},"action")}]};export{EXTENSION_CONTEXT_BUDGET,parseExtensionRef,buildExtensionRef,matchExtensionByRef,sanitizeDisplayText,getSanitizedExtensionDisplayName,buildExtensionMentionContext,collectContextData,formatContextUsageText,contextCommand};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name}from"./chunk-KBWJGX7I.js";init_esbuild_shims();import{promises as fs}from"node:fs";import{join}from"node:path";var cleanupFunctions=[];var exitCleanupPromise;function registerCleanup(fn,options={}){if(options.first)cleanupFunctions.unshift(fn);else cleanupFunctions.push(fn);return()=>{const index=cleanupFunctions.indexOf(fn);if(index!==-1)cleanupFunctions.splice(index,1)}}__name(registerCleanup,"registerCleanup");var PER_CLEANUP_TIMEOUT_MS=2e3;var OVERALL_CLEANUP_TIMEOUT_MS=5e3;function withTimeout(promise,ms){return new Promise(resolve=>{const timer=setTimeout(()=>resolve(void 0),ms);timer.unref?.();promise.then(value=>{clearTimeout(timer);resolve(value)},()=>{clearTimeout(timer);resolve(void 0)})})}__name(withTimeout,"withTimeout");function runExitCleanup(options={}){if(exitCleanupPromise)return exitCleanupPromise;const cleanup=runExitCleanupPass(options).finally(()=>{if(exitCleanupPromise===cleanup)exitCleanupPromise=void 0});exitCleanupPromise=cleanup;return cleanup}__name(runExitCleanup,"runExitCleanup");async function runExitCleanupPass(options){const perFn=options._testPerFnTimeoutMs??PER_CLEANUP_TIMEOUT_MS;const overall=options._testOverallTimeoutMs??OVERALL_CLEANUP_TIMEOUT_MS;const drain=(async()=>{for(const fn of cleanupFunctions){try{await withTimeout(Promise.resolve().then(fn),perFn)}catch(_){}}})();let wallClockTimer;const wallClock=new Promise(resolve=>{wallClockTimer=setTimeout(()=>resolve(),overall);wallClockTimer.unref?.()});try{await Promise.race([drain,wallClock])}finally{if(wallClockTimer)clearTimeout(wallClockTimer);cleanupFunctions.length=0}}__name(runExitCleanupPass,"runExitCleanupPass");async function cleanupCheckpoints(){const{Storage}=await import("./deferred-core-runtime-
|
|
3
|
+
import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name}from"./chunk-KBWJGX7I.js";init_esbuild_shims();import{promises as fs}from"node:fs";import{join}from"node:path";var cleanupFunctions=[];var exitCleanupPromise;function registerCleanup(fn,options={}){if(options.first)cleanupFunctions.unshift(fn);else cleanupFunctions.push(fn);return()=>{const index=cleanupFunctions.indexOf(fn);if(index!==-1)cleanupFunctions.splice(index,1)}}__name(registerCleanup,"registerCleanup");var PER_CLEANUP_TIMEOUT_MS=2e3;var OVERALL_CLEANUP_TIMEOUT_MS=5e3;function withTimeout(promise,ms){return new Promise(resolve=>{const timer=setTimeout(()=>resolve(void 0),ms);timer.unref?.();promise.then(value=>{clearTimeout(timer);resolve(value)},()=>{clearTimeout(timer);resolve(void 0)})})}__name(withTimeout,"withTimeout");function runExitCleanup(options={}){if(exitCleanupPromise)return exitCleanupPromise;const cleanup=runExitCleanupPass(options).finally(()=>{if(exitCleanupPromise===cleanup)exitCleanupPromise=void 0});exitCleanupPromise=cleanup;return cleanup}__name(runExitCleanup,"runExitCleanup");async function runExitCleanupPass(options){const perFn=options._testPerFnTimeoutMs??PER_CLEANUP_TIMEOUT_MS;const overall=options._testOverallTimeoutMs??OVERALL_CLEANUP_TIMEOUT_MS;const drain=(async()=>{for(const fn of cleanupFunctions){try{await withTimeout(Promise.resolve().then(fn),perFn)}catch(_){}}})();let wallClockTimer;const wallClock=new Promise(resolve=>{wallClockTimer=setTimeout(()=>resolve(),overall);wallClockTimer.unref?.()});try{await Promise.race([drain,wallClock])}finally{if(wallClockTimer)clearTimeout(wallClockTimer);cleanupFunctions.length=0}}__name(runExitCleanupPass,"runExitCleanupPass");async function cleanupCheckpoints(){const{Storage}=await import("./deferred-core-runtime-YC5XIWEI.js");const storage=new Storage(process.cwd());const tempDir=storage.getProjectTempDir();const checkpointsDir=join(tempDir,"checkpoints");try{await fs.rm(checkpointsDir,{recursive:true,force:true})}catch{}}__name(cleanupCheckpoints,"cleanupCheckpoints");export{registerCleanup,runExitCleanup,cleanupCheckpoints};
|
|
4
4
|
/**
|
|
5
5
|
* @license
|
|
6
6
|
* Copyright 2025 Google LLC
|