@claudiolabs/claudin 0.5.7
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/LICENSE +207 -0
- package/README.md +91 -0
- package/bin/claudin +152 -0
- package/dist/chunks/AgentTool-0.5.7-0krqsszm.mjs +1 -0
- package/dist/chunks/App-0.5.7-k8c6xsbz.mjs +1 -0
- package/dist/chunks/ApproveApiKey-0.5.7-djmd358f.mjs +1 -0
- package/dist/chunks/AssistantSessionChooser-0.5.7-40f5p134.mjs +1 -0
- package/dist/chunks/AutoModeOptInDialog-0.5.7-dgpfkf7n.mjs +1 -0
- package/dist/chunks/BypassPermissionsModeDialog-0.5.7-m2n3zekg.mjs +1 -0
- package/dist/chunks/ClaudeMdExternalIncludesDialog-0.5.7-8p2b9258.mjs +1 -0
- package/dist/chunks/ConsoleOAuthFlow-0.5.7-e11rkgsy.mjs +1 -0
- package/dist/chunks/DiffDialog-0.5.7-df3q0dyx.mjs +3 -0
- package/dist/chunks/Doctor-0.5.7-996gqph8.mjs +1 -0
- package/dist/chunks/Grove-0.5.7-7xphv8qp.mjs +1 -0
- package/dist/chunks/ITermBackend-0.5.7-rv5t26my.mjs +1 -0
- package/dist/chunks/InvalidConfigDialog-0.5.7-76awdeqe.mjs +1 -0
- package/dist/chunks/InvalidSettingsDialog-0.5.7-d59ky2sv.mjs +1 -0
- package/dist/chunks/MigrationDialog-0.5.7-nkkcryn5.mjs +1 -0
- package/dist/chunks/Onboarding-0.5.7-v3jtvbkn.mjs +1 -0
- package/dist/chunks/ProviderManager-0.5.7-92navbez.mjs +1 -0
- package/dist/chunks/REPL-0.5.7-6zag11mg.mjs +1 -0
- package/dist/chunks/ResumeConversation-0.5.7-hpgm4f1s.mjs +1 -0
- package/dist/chunks/SnapshotUpdateDialog-0.5.7-xrverbhp.mjs +1 -0
- package/dist/chunks/TeleportProgress-0.5.7-xn5z7dt4.mjs +1 -0
- package/dist/chunks/TeleportRepoMismatchDialog-0.5.7-s29rrsak.mjs +1 -0
- package/dist/chunks/TeleportResumeWrapper-0.5.7-3r5mn1za.mjs +1 -0
- package/dist/chunks/TmuxBackend-0.5.7-k3c0537z.mjs +9 -0
- package/dist/chunks/ToolSearchTool-0.5.7-mybq3qz5.mjs +1 -0
- package/dist/chunks/TrustDialog-0.5.7-r4dhznyf.mjs +1 -0
- package/dist/chunks/activeProvider-0.5.7-8emdm8j8.mjs +1 -0
- package/dist/chunks/add-dir-0.5.7-jwaavdc7.mjs +1 -0
- package/dist/chunks/agents-0.5.7-e7dajmrs.mjs +110 -0
- package/dist/chunks/agents-0.5.7-q2vtj7pt.mjs +3 -0
- package/dist/chunks/api-0.5.7-j8bn129y.mjs +1 -0
- package/dist/chunks/asciicast-0.5.7-rp1h8swq.mjs +1 -0
- package/dist/chunks/assistant-0.5.7-sfk22b3z.mjs +1 -0
- package/dist/chunks/auth-0.5.7-ez3n1qpx.mjs +1 -0
- package/dist/chunks/auth-0.5.7-khssh83t.mjs +1 -0
- package/dist/chunks/autoMode-0.5.7-ezn856pd.mjs +48 -0
- package/dist/chunks/autoUpdater-0.5.7-dkw2aw1e.mjs +1 -0
- package/dist/chunks/backgroundHousekeeping-0.5.7-9ejvx75r.mjs +1 -0
- package/dist/chunks/branch-0.5.7-cjbtbwg1.mjs +4 -0
- package/dist/chunks/bridgePointer-0.5.7-5z0vqchx.mjs +1 -0
- package/dist/chunks/btw-0.5.7-p3kbd1wf.mjs +1 -0
- package/dist/chunks/buddy-0.5.7-pa55rfb4.mjs +3 -0
- package/dist/chunks/cacache-0.5.7-anq54jwq.mjs +1 -0
- package/dist/chunks/cache-probe-0.5.7-6j5hzxc4.mjs +21 -0
- package/dist/chunks/cacheStats-0.5.7-e1byp2n2.mjs +4 -0
- package/dist/chunks/caches-0.5.7-w8n6wxaj.mjs +1 -0
- package/dist/chunks/claudeDesktop-0.5.7-5kkyx4pz.mjs +1 -0
- package/dist/chunks/claudemd-0.5.7-jb7byep9.mjs +1 -0
- package/dist/chunks/clear-0.5.7-tkh04z2c.mjs +1 -0
- package/dist/chunks/clearTerminal-0.5.7-mbqev32s.mjs +1 -0
- package/dist/chunks/cli-0.5.7-023jpnwm.mjs +2 -0
- package/dist/chunks/cli-0.5.7-08mn1pmc.mjs +5 -0
- package/dist/chunks/cli-0.5.7-0bv1xcbe.mjs +21 -0
- package/dist/chunks/cli-0.5.7-0df5m6td.mjs +2 -0
- package/dist/chunks/cli-0.5.7-0rvzfmhb.mjs +2 -0
- package/dist/chunks/cli-0.5.7-0s7wtvbz.mjs +2 -0
- package/dist/chunks/cli-0.5.7-1fmgwk5c.mjs +2 -0
- package/dist/chunks/cli-0.5.7-1kmeaqmc.mjs +2 -0
- package/dist/chunks/cli-0.5.7-20cz322w.mjs +2 -0
- package/dist/chunks/cli-0.5.7-23hg3t0h.mjs +2 -0
- package/dist/chunks/cli-0.5.7-258ytmbr.mjs +2 -0
- package/dist/chunks/cli-0.5.7-26pwg6gg.mjs +2 -0
- package/dist/chunks/cli-0.5.7-2h4rgwc9.mjs +2 -0
- package/dist/chunks/cli-0.5.7-2qxsy7jq.mjs +12 -0
- package/dist/chunks/cli-0.5.7-2tnvc3ka.mjs +2 -0
- package/dist/chunks/cli-0.5.7-2xm61gkr.mjs +5 -0
- package/dist/chunks/cli-0.5.7-2ytftsg5.mjs +2 -0
- package/dist/chunks/cli-0.5.7-31969syr.mjs +2 -0
- package/dist/chunks/cli-0.5.7-31hdc2nc.mjs +2 -0
- package/dist/chunks/cli-0.5.7-35yf0b84.mjs +2 -0
- package/dist/chunks/cli-0.5.7-3jrq7w6x.mjs +2 -0
- package/dist/chunks/cli-0.5.7-3xssm25z.mjs +2 -0
- package/dist/chunks/cli-0.5.7-469r2a5r.mjs +193 -0
- package/dist/chunks/cli-0.5.7-4eg4pktt.mjs +2 -0
- package/dist/chunks/cli-0.5.7-4gmpny6k.mjs +133 -0
- package/dist/chunks/cli-0.5.7-4zv4np07.mjs +2 -0
- package/dist/chunks/cli-0.5.7-500c5b8m.mjs +4 -0
- package/dist/chunks/cli-0.5.7-52mwnwy6.mjs +58 -0
- package/dist/chunks/cli-0.5.7-55zn2cct.mjs +4 -0
- package/dist/chunks/cli-0.5.7-5736yt36.mjs +2 -0
- package/dist/chunks/cli-0.5.7-5aghfr8k.mjs +3 -0
- package/dist/chunks/cli-0.5.7-5by4fby4.mjs +2 -0
- package/dist/chunks/cli-0.5.7-5e5xfeq6.mjs +2 -0
- package/dist/chunks/cli-0.5.7-5jaayymr.mjs +17 -0
- package/dist/chunks/cli-0.5.7-5jms2g5g.mjs +2 -0
- package/dist/chunks/cli-0.5.7-5kv9dgvn.mjs +2 -0
- package/dist/chunks/cli-0.5.7-5mrw857q.mjs +4 -0
- package/dist/chunks/cli-0.5.7-5q6tfz39.mjs +2 -0
- package/dist/chunks/cli-0.5.7-650e2qk4.mjs +18 -0
- package/dist/chunks/cli-0.5.7-67xxeffj.mjs +2 -0
- package/dist/chunks/cli-0.5.7-6d26vvaa.mjs +2 -0
- package/dist/chunks/cli-0.5.7-6g3w68ks.mjs +2 -0
- package/dist/chunks/cli-0.5.7-6gfay8ap.mjs +2 -0
- package/dist/chunks/cli-0.5.7-6gkpb0vw.mjs +2 -0
- package/dist/chunks/cli-0.5.7-6pssgqdn.mjs +2 -0
- package/dist/chunks/cli-0.5.7-6thqe6p4.mjs +3 -0
- package/dist/chunks/cli-0.5.7-73er78b7.mjs +15 -0
- package/dist/chunks/cli-0.5.7-7a9gq9ff.mjs +2 -0
- package/dist/chunks/cli-0.5.7-7hm7dxyp.mjs +2 -0
- package/dist/chunks/cli-0.5.7-7k456xwn.mjs +3 -0
- package/dist/chunks/cli-0.5.7-7mmyazqh.mjs +34 -0
- package/dist/chunks/cli-0.5.7-7rgsmfw7.mjs +3 -0
- package/dist/chunks/cli-0.5.7-7wyhqw17.mjs +2 -0
- package/dist/chunks/cli-0.5.7-82x8qaxx.mjs +2 -0
- package/dist/chunks/cli-0.5.7-89fcvfy0.mjs +2 -0
- package/dist/chunks/cli-0.5.7-8ac9d7r6.mjs +2 -0
- package/dist/chunks/cli-0.5.7-8ap24w7a.mjs +2 -0
- package/dist/chunks/cli-0.5.7-8e61g5bq.mjs +10 -0
- package/dist/chunks/cli-0.5.7-8sbq2qed.mjs +2 -0
- package/dist/chunks/cli-0.5.7-8sqyymdb.mjs +2 -0
- package/dist/chunks/cli-0.5.7-8ychjqct.mjs +16 -0
- package/dist/chunks/cli-0.5.7-93eaxn9a.mjs +2 -0
- package/dist/chunks/cli-0.5.7-93k1z52y.mjs +2 -0
- package/dist/chunks/cli-0.5.7-9acdh8nc.mjs +2 -0
- package/dist/chunks/cli-0.5.7-9jck3vts.mjs +15 -0
- package/dist/chunks/cli-0.5.7-9rbmn26q.mjs +24 -0
- package/dist/chunks/cli-0.5.7-9sysdak3.mjs +2 -0
- package/dist/chunks/cli-0.5.7-9ysat94v.mjs +2 -0
- package/dist/chunks/cli-0.5.7-9z55nm22.mjs +3 -0
- package/dist/chunks/cli-0.5.7-9zwbnq8g.mjs +2 -0
- package/dist/chunks/cli-0.5.7-a47hzz3r.mjs +2 -0
- package/dist/chunks/cli-0.5.7-aq7a3646.mjs +2 -0
- package/dist/chunks/cli-0.5.7-ayjrdmrk.mjs +2 -0
- package/dist/chunks/cli-0.5.7-b51h487f.mjs +2 -0
- package/dist/chunks/cli-0.5.7-bkptgahs.mjs +4 -0
- package/dist/chunks/cli-0.5.7-bnapjxz4.mjs +2 -0
- package/dist/chunks/cli-0.5.7-bzrvdrq4.mjs +2 -0
- package/dist/chunks/cli-0.5.7-c1mv1399.mjs +2 -0
- package/dist/chunks/cli-0.5.7-c9dtw94k.mjs +2 -0
- package/dist/chunks/cli-0.5.7-cakvh73p.mjs +2 -0
- package/dist/chunks/cli-0.5.7-d19d4v07.mjs +2 -0
- package/dist/chunks/cli-0.5.7-d4gtv7f7.mjs +2 -0
- package/dist/chunks/cli-0.5.7-de90yre1.mjs +2 -0
- package/dist/chunks/cli-0.5.7-dntg9qbj.mjs +133 -0
- package/dist/chunks/cli-0.5.7-dp3z7wkh.mjs +2 -0
- package/dist/chunks/cli-0.5.7-dr7n1fyv.mjs +20 -0
- package/dist/chunks/cli-0.5.7-e8eqdfnf.mjs +2 -0
- package/dist/chunks/cli-0.5.7-eer6xagb.mjs +2 -0
- package/dist/chunks/cli-0.5.7-esx85d2g.mjs +2 -0
- package/dist/chunks/cli-0.5.7-eyemfxtz.mjs +2 -0
- package/dist/chunks/cli-0.5.7-fx3gesdm.mjs +2 -0
- package/dist/chunks/cli-0.5.7-g2dd5t6j.mjs +2 -0
- package/dist/chunks/cli-0.5.7-g4n7dg2d.mjs +9 -0
- package/dist/chunks/cli-0.5.7-g7k0r0ea.mjs +5 -0
- package/dist/chunks/cli-0.5.7-g8dqk0se.mjs +2 -0
- package/dist/chunks/cli-0.5.7-gcnk0vke.mjs +6 -0
- package/dist/chunks/cli-0.5.7-gnq8vh0c.mjs +2 -0
- package/dist/chunks/cli-0.5.7-gy4csxb5.mjs +2 -0
- package/dist/chunks/cli-0.5.7-h9v4tqbs.mjs +24 -0
- package/dist/chunks/cli-0.5.7-hdcnw5y4.mjs +2 -0
- package/dist/chunks/cli-0.5.7-hhre0h51.mjs +2 -0
- package/dist/chunks/cli-0.5.7-hp25yk8y.mjs +2 -0
- package/dist/chunks/cli-0.5.7-hq4wbper.mjs +11 -0
- package/dist/chunks/cli-0.5.7-hw11qa05.mjs +3 -0
- package/dist/chunks/cli-0.5.7-hw3pyj8g.mjs +2 -0
- package/dist/chunks/cli-0.5.7-j7h72bgz.mjs +2 -0
- package/dist/chunks/cli-0.5.7-j8q5bja8.mjs +2 -0
- package/dist/chunks/cli-0.5.7-jf3f8gen.mjs +2 -0
- package/dist/chunks/cli-0.5.7-jga8kgpr.mjs +2 -0
- package/dist/chunks/cli-0.5.7-jptzskw1.mjs +2 -0
- package/dist/chunks/cli-0.5.7-jw2te6th.mjs +2 -0
- package/dist/chunks/cli-0.5.7-k11mzgcb.mjs +2 -0
- package/dist/chunks/cli-0.5.7-kctf48t4.mjs +7 -0
- package/dist/chunks/cli-0.5.7-knkzkqbw.mjs +2 -0
- package/dist/chunks/cli-0.5.7-kp9pg4sr.mjs +2 -0
- package/dist/chunks/cli-0.5.7-kvazvrra.mjs +2 -0
- package/dist/chunks/cli-0.5.7-ky5khwx2.mjs +2 -0
- package/dist/chunks/cli-0.5.7-m0841vt9.mjs +2 -0
- package/dist/chunks/cli-0.5.7-m4ekdyhj.mjs +2 -0
- package/dist/chunks/cli-0.5.7-m4wwfa6q.mjs +2 -0
- package/dist/chunks/cli-0.5.7-m5q27x96.mjs +2 -0
- package/dist/chunks/cli-0.5.7-m82d23hf.mjs +2 -0
- package/dist/chunks/cli-0.5.7-mdcw5fyw.mjs +4 -0
- package/dist/chunks/cli-0.5.7-mz4njeb9.mjs +39 -0
- package/dist/chunks/cli-0.5.7-mzfr99sc.mjs +67 -0
- package/dist/chunks/cli-0.5.7-p381d4sx.mjs +3 -0
- package/dist/chunks/cli-0.5.7-p4mv49ab.mjs +25 -0
- package/dist/chunks/cli-0.5.7-pse9qff7.mjs +2 -0
- package/dist/chunks/cli-0.5.7-pzjz115k.mjs +2 -0
- package/dist/chunks/cli-0.5.7-q0pq4367.mjs +9 -0
- package/dist/chunks/cli-0.5.7-q2e6xpch.mjs +5281 -0
- package/dist/chunks/cli-0.5.7-q6sgd9ng.mjs +12 -0
- package/dist/chunks/cli-0.5.7-q8v8naf8.mjs +2 -0
- package/dist/chunks/cli-0.5.7-qdcp748z.mjs +2 -0
- package/dist/chunks/cli-0.5.7-qdqrgv1q.mjs +2 -0
- package/dist/chunks/cli-0.5.7-qk0n5hqa.mjs +9 -0
- package/dist/chunks/cli-0.5.7-r4cdt1b9.mjs +50 -0
- package/dist/chunks/cli-0.5.7-ra5kv4tw.mjs +2 -0
- package/dist/chunks/cli-0.5.7-rb75eq83.mjs +2 -0
- package/dist/chunks/cli-0.5.7-rggstqv6.mjs +2 -0
- package/dist/chunks/cli-0.5.7-rr1yd8f3.mjs +4 -0
- package/dist/chunks/cli-0.5.7-rzts2ke3.mjs +2 -0
- package/dist/chunks/cli-0.5.7-s09knvta.mjs +3 -0
- package/dist/chunks/cli-0.5.7-s5nd54ga.mjs +3 -0
- package/dist/chunks/cli-0.5.7-sb3fjts4.mjs +2 -0
- package/dist/chunks/cli-0.5.7-sjd6g3n6.mjs +15 -0
- package/dist/chunks/cli-0.5.7-sjx0wm99.mjs +2 -0
- package/dist/chunks/cli-0.5.7-skfm51ta.mjs +44 -0
- package/dist/chunks/cli-0.5.7-sx7pr75m.mjs +2 -0
- package/dist/chunks/cli-0.5.7-t6mtpr04.mjs +2 -0
- package/dist/chunks/cli-0.5.7-t8z48kc2.mjs +4 -0
- package/dist/chunks/cli-0.5.7-tbga87q3.mjs +2 -0
- package/dist/chunks/cli-0.5.7-tc3vm4ra.mjs +2 -0
- package/dist/chunks/cli-0.5.7-tgq7dtyz.mjs +2 -0
- package/dist/chunks/cli-0.5.7-tpjjm1z2.mjs +45 -0
- package/dist/chunks/cli-0.5.7-tqn2ged5.mjs +2 -0
- package/dist/chunks/cli-0.5.7-twqt7rxq.mjs +6 -0
- package/dist/chunks/cli-0.5.7-vgc7nzef.mjs +2 -0
- package/dist/chunks/cli-0.5.7-vk8p3n59.mjs +2 -0
- package/dist/chunks/cli-0.5.7-vn5aht50.mjs +2 -0
- package/dist/chunks/cli-0.5.7-vvrg78m6.mjs +2 -0
- package/dist/chunks/cli-0.5.7-vy4r02pg.mjs +4 -0
- package/dist/chunks/cli-0.5.7-vyxaeh82.mjs +2 -0
- package/dist/chunks/cli-0.5.7-w024nwsf.mjs +2 -0
- package/dist/chunks/cli-0.5.7-w16wj21h.mjs +2 -0
- package/dist/chunks/cli-0.5.7-w1bf9y93.mjs +3 -0
- package/dist/chunks/cli-0.5.7-w2fb8g6y.mjs +2 -0
- package/dist/chunks/cli-0.5.7-w50j12vv.mjs +2 -0
- package/dist/chunks/cli-0.5.7-w6nex68w.mjs +2 -0
- package/dist/chunks/cli-0.5.7-wz2cbwxt.mjs +4 -0
- package/dist/chunks/cli-0.5.7-x0n9mq65.mjs +2 -0
- package/dist/chunks/cli-0.5.7-x1azmh1g.mjs +2 -0
- package/dist/chunks/cli-0.5.7-x1w96j6d.mjs +59 -0
- package/dist/chunks/cli-0.5.7-x7dabprd.mjs +2 -0
- package/dist/chunks/cli-0.5.7-x8t1aeey.mjs +2 -0
- package/dist/chunks/cli-0.5.7-xepvraxn.mjs +2 -0
- package/dist/chunks/cli-0.5.7-xn6deh04.mjs +6 -0
- package/dist/chunks/cli-0.5.7-y2vc4xb6.mjs +12 -0
- package/dist/chunks/cli-0.5.7-y3pa8ttm.mjs +2 -0
- package/dist/chunks/cli-0.5.7-yaywev87.mjs +2 -0
- package/dist/chunks/cli-0.5.7-ycj2xr53.mjs +3 -0
- package/dist/chunks/cli-0.5.7-yzncgfs4.mjs +18 -0
- package/dist/chunks/cli-0.5.7-z1n09m4p.mjs +2 -0
- package/dist/chunks/cli-0.5.7-z97pranc.mjs +2 -0
- package/dist/chunks/cli-0.5.7-za19q18c.mjs +2 -0
- package/dist/chunks/cli-0.5.7-zb8ztx8p.mjs +2 -0
- package/dist/chunks/cli-0.5.7-zkw2fx86.mjs +2 -0
- package/dist/chunks/client-0.5.7-bqw74z29.mjs +1 -0
- package/dist/chunks/color-0.5.7-v1s3bvcj.mjs +1 -0
- package/dist/chunks/compact-0.5.7-7kxsprp5.mjs +3 -0
- package/dist/chunks/config-0.5.7-e41nnxnm.mjs +1 -0
- package/dist/chunks/config-0.5.7-q40ykcbb.mjs +1 -0
- package/dist/chunks/context-0.5.7-qvcehmj5.mjs +1 -0
- package/dist/chunks/context-noninteractive-0.5.7-02tkje0w.mjs +1 -0
- package/dist/chunks/conversation-0.5.7-h7r20gzw.mjs +1 -0
- package/dist/chunks/copy-0.5.7-p3xxq9b3.mjs +9 -0
- package/dist/chunks/cost-0.5.7-s3rzm0vd.mjs +1 -0
- package/dist/chunks/createSSHSession-0.5.7-s9fc5f1h.mjs +1 -0
- package/dist/chunks/createSession-0.5.7-4e64teqm.mjs +1 -0
- package/dist/chunks/debug-0.5.7-v8bqkmzm.mjs +1 -0
- package/dist/chunks/desktop-0.5.7-tna0yskx.mjs +1 -0
- package/dist/chunks/detectRepository-0.5.7-3dy7yz89.mjs +1 -0
- package/dist/chunks/detection-0.5.7-39zsjy8t.mjs +1 -0
- package/dist/chunks/diff-0.5.7-9ywmnxmx.mjs +1 -0
- package/dist/chunks/doctor-0.5.7-ty5zxpem.mjs +1 -0
- package/dist/chunks/doctorDiagnostic-0.5.7-g458bh9g.mjs +1 -0
- package/dist/chunks/earlyInput-0.5.7-x73yj3dn.mjs +1 -0
- package/dist/chunks/effort-0.5.7-h76k43fj.mjs +10 -0
- package/dist/chunks/envUtils-0.5.7-w1t7akfc.mjs +1 -0
- package/dist/chunks/environmentSelection-0.5.7-5dsnr0sv.mjs +1 -0
- package/dist/chunks/environments-0.5.7-pqh2gnjb.mjs +1 -0
- package/dist/chunks/errors-0.5.7-pa0hz043.mjs +1 -0
- package/dist/chunks/exampleCommands-0.5.7-3dtjxdad.mjs +1 -0
- package/dist/chunks/exit-0.5.7-0wrw77gk.mjs +1 -0
- package/dist/chunks/export-0.5.7-zw9rbf4j.mjs +2 -0
- package/dist/chunks/extra-usage-0.5.7-rfya84j0.mjs +1 -0
- package/dist/chunks/extra-usage-noninteractive-0.5.7-a1b9ndnm.mjs +1 -0
- package/dist/chunks/fast-0.5.7-2p6srbep.mjs +1 -0
- package/dist/chunks/feedback-0.5.7-181z18rn.mjs +14 -0
- package/dist/chunks/firstPartyEventLogger-0.5.7-xndd9dd0.mjs +1 -0
- package/dist/chunks/git-0.5.7-7gyptyxn.mjs +1 -0
- package/dist/chunks/githubModelsCredentials-0.5.7-9zhn44n6.mjs +1 -0
- package/dist/chunks/growthbook-0.5.7-1mynkk8j.mjs +1 -0
- package/dist/chunks/headless-0.5.7-9f87m6f5.mjs +2 -0
- package/dist/chunks/heapdump-0.5.7-ns6mqawv.mjs +6 -0
- package/dist/chunks/help-0.5.7-px56h6fs.mjs +1 -0
- package/dist/chunks/hookChains-0.5.7-1a6qvexe.mjs +3 -0
- package/dist/chunks/hooks-0.5.7-azm2m6rs.mjs +79 -0
- package/dist/chunks/hooks-0.5.7-fyp8e3f5.mjs +1 -0
- package/dist/chunks/ide-0.5.7-v9hbn8cp.mjs +3 -0
- package/dist/chunks/image-processor-napi-0.5.7-e41p58ef.mjs +1 -0
- package/dist/chunks/index-0.5.7-0tncgnn3.mjs +1 -0
- package/dist/chunks/index-0.5.7-30mrmtkn.mjs +1 -0
- package/dist/chunks/index-0.5.7-62s7cp1b.mjs +1 -0
- package/dist/chunks/index-0.5.7-69akvbm4.mjs +1 -0
- package/dist/chunks/index-0.5.7-6y6f5cws.mjs +1 -0
- package/dist/chunks/index-0.5.7-7w3agvzm.mjs +10 -0
- package/dist/chunks/index-0.5.7-8jwymzr6.mjs +1 -0
- package/dist/chunks/index-0.5.7-8m53gyr6.mjs +9 -0
- package/dist/chunks/index-0.5.7-ct6jw15p.mjs +2 -0
- package/dist/chunks/index-0.5.7-dr470b86.mjs +1 -0
- package/dist/chunks/index-0.5.7-e4rvp0fn.mjs +1 -0
- package/dist/chunks/index-0.5.7-fkw6rn8z.mjs +1 -0
- package/dist/chunks/index-0.5.7-h1xjcbtb.mjs +1 -0
- package/dist/chunks/index-0.5.7-ma3xmxv3.mjs +2 -0
- package/dist/chunks/index-0.5.7-qn7zmh31.mjs +9 -0
- package/dist/chunks/index-0.5.7-rd44m0e6.mjs +30 -0
- package/dist/chunks/index-0.5.7-te1s21zz.mjs +5 -0
- package/dist/chunks/index-0.5.7-vm9zmzmr.mjs +1 -0
- package/dist/chunks/index-0.5.7-wpffxvtn.mjs +1 -0
- package/dist/chunks/index-0.5.7-wwfn7x53.mjs +1 -0
- package/dist/chunks/index-0.5.7-ybcvbcjt.mjs +1 -0
- package/dist/chunks/index-0.5.7-yw3tp60c.mjs +1 -0
- package/dist/chunks/initReplBridge-0.5.7-xpy8ap8n.mjs +1 -0
- package/dist/chunks/ink-0.5.7-dwmx157s.mjs +1 -0
- package/dist/chunks/insights-0.5.7-5fpd27dr.mjs +870 -0
- package/dist/chunks/install-0.5.7-6sc73ew8.mjs +1 -0
- package/dist/chunks/install-github-app-0.5.7-jcyktynf.mjs +149 -0
- package/dist/chunks/install-slack-app-0.5.7-mk4a14ww.mjs +1 -0
- package/dist/chunks/instrumentation-0.5.7-116w6tf4.mjs +1 -0
- package/dist/chunks/interactiveHelpers-0.5.7-zbfkwcsb.mjs +1 -0
- package/dist/chunks/keybindings-0.5.7-k2s0bryc.mjs +2 -0
- package/dist/chunks/knowledge-0.5.7-55b2ckth.mjs +2 -0
- package/dist/chunks/latestVersionCache-0.5.7-k9pyxzrk.mjs +1 -0
- package/dist/chunks/loadAgentsDir-0.5.7-9bmbg04z.mjs +1 -0
- package/dist/chunks/loadPluginHooks-0.5.7-bcdwwerp.mjs +1 -0
- package/dist/chunks/loadPluginHooks-0.5.7-mdt3yvfc.mjs +1 -0
- package/dist/chunks/log-0.5.7-wcft0eyv.mjs +1 -0
- package/dist/chunks/main-0.5.7-9sxhszx9.mjs +1236 -0
- package/dist/chunks/managedEnv-0.5.7-k4gyyt60.mjs +1 -0
- package/dist/chunks/mcp-0.5.7-9z74evcf.mjs +1 -0
- package/dist/chunks/mcp-0.5.7-djz3mjw4.mjs +4 -0
- package/dist/chunks/mcp-0.5.7-n62qd49c.mjs +17 -0
- package/dist/chunks/mcpb-0.5.7-bqt73vjr.mjs +1 -0
- package/dist/chunks/memory-0.5.7-chxjrvf2.mjs +3 -0
- package/dist/chunks/mobile-0.5.7-y0cn32br.mjs +2 -0
- package/dist/chunks/model-0.5.7-7mt2xn7w.mjs +1 -0
- package/dist/chunks/model-0.5.7-fdhr0cwa.mjs +2 -0
- package/dist/chunks/oauth-0.5.7-xf0qbv6v.mjs +1 -0
- package/dist/chunks/openaiShim-0.5.7-0cejk3sb.mjs +14 -0
- package/dist/chunks/output-style-0.5.7-t5qc5jxe.mjs +1 -0
- package/dist/chunks/package-APBHZ5F3-0.5.7-7bp8s9sg.mjs +1 -0
- package/dist/chunks/parseConnectUrl-0.5.7-903apk0t.mjs +1 -0
- package/dist/chunks/parser-0.5.7-jnq01hth.mjs +1 -0
- package/dist/chunks/passes-0.5.7-nk3fgxyh.mjs +1 -0
- package/dist/chunks/permissions-0.5.7-q7whkp76.mjs +3 -0
- package/dist/chunks/plan-0.5.7-w5hgy3s7.mjs +1 -0
- package/dist/chunks/plist-0.5.7-jwz5qjtz.mjs +1 -0
- package/dist/chunks/plugin-0.5.7-x7xcey6d.mjs +29 -0
- package/dist/chunks/pluginStartupCheck-0.5.7-gy2e0dge.mjs +1 -0
- package/dist/chunks/plugins-0.5.7-2ehzph1a.mjs +9 -0
- package/dist/chunks/print-0.5.7-mjx6j0dk.mjs +57 -0
- package/dist/chunks/privacy-settings-0.5.7-rkmc34t8.mjs +1 -0
- package/dist/chunks/process-0.5.7-8c0qwpv6.mjs +1 -0
- package/dist/chunks/processBashCommand-0.5.7-czwzjsj9.mjs +1 -0
- package/dist/chunks/processSlashCommand-0.5.7-512rz16m.mjs +9 -0
- package/dist/chunks/prompt-0.5.7-r8ewyzer.mjs +1 -0
- package/dist/chunks/prompt-0.5.7-z98k679g.mjs +1 -0
- package/dist/chunks/prompts-0.5.7-g8mh8as5.mjs +1 -0
- package/dist/chunks/protocolHandler-0.5.7-p86as7s6.mjs +13 -0
- package/dist/chunks/provider-0.5.7-x4t1g0nh.mjs +2 -0
- package/dist/chunks/providerProfiles-0.5.7-dz70g8ys.mjs +1 -0
- package/dist/chunks/rate-limit-options-0.5.7-n282sweb.mjs +1 -0
- package/dist/chunks/registry-0.5.7-h8q8eay6.mjs +1 -0
- package/dist/chunks/release-notes-0.5.7-2h20frk0.mjs +5 -0
- package/dist/chunks/reload-plugins-0.5.7-z50apk74.mjs +2 -0
- package/dist/chunks/remote-env-0.5.7-08abe77m.mjs +1 -0
- package/dist/chunks/remoteBridgeCore-0.5.7-jdasqn18.mjs +1 -0
- package/dist/chunks/remoteSession-0.5.7-nq05jhdv.mjs +1 -0
- package/dist/chunks/rename-0.5.7-812j1w4d.mjs +1 -0
- package/dist/chunks/replBridgeHandle-0.5.7-aa3cp3ea.mjs +1 -0
- package/dist/chunks/resume-0.5.7-weq0rn3m.mjs +2 -0
- package/dist/chunks/rewind-0.5.7-y54y78kx.mjs +1 -0
- package/dist/chunks/sandbox-adapter-0.5.7-tb5qenm4.mjs +1 -0
- package/dist/chunks/sandbox-toggle-0.5.7-nxcpekeq.mjs +1 -0
- package/dist/chunks/session-0.5.7-ky2s0856.mjs +2 -0
- package/dist/chunks/sessionDiscovery-0.5.7-wr82xcxs.mjs +1 -0
- package/dist/chunks/sessionFileAccessHooks-0.5.7-0j8f4we0.mjs +1 -0
- package/dist/chunks/sessionStorage-0.5.7-qghsxmr2.mjs +1 -0
- package/dist/chunks/settings-0.5.7-xa4hccmb.mjs +1 -0
- package/dist/chunks/setup-0.5.7-s4yfpbyd.mjs +5 -0
- package/dist/chunks/sinks-0.5.7-feq030bq.mjs +1 -0
- package/dist/chunks/skills-0.5.7-h2r9d209.mjs +1 -0
- package/dist/chunks/startupProfiler-0.5.7-f44bsnqn.mjs +1 -0
- package/dist/chunks/startupUpdateCheck-0.5.7-7ff14fag.mjs +1 -0
- package/dist/chunks/state-0.5.7-cwk8b4cx.mjs +1 -0
- package/dist/chunks/stats-0.5.7-wd077xj7.mjs +6 -0
- package/dist/chunks/status-0.5.7-5qy7pnk9.mjs +1 -0
- package/dist/chunks/stickers-0.5.7-7s145w6d.mjs +1 -0
- package/dist/chunks/subprocessEnv-0.5.7-5dv3w3xn.mjs +1 -0
- package/dist/chunks/tasks-0.5.7-q79z0h3e.mjs +1 -0
- package/dist/chunks/teamHelpers-0.5.7-b8qf5f0d.mjs +1 -0
- package/dist/chunks/teammateModeSnapshot-0.5.7-kvmjwag8.mjs +1 -0
- package/dist/chunks/teleport-0.5.7-x740q45r.mjs +1 -0
- package/dist/chunks/terminalSetup-0.5.7-z8ytqt6q.mjs +1 -0
- package/dist/chunks/theme-0.5.7-9asaqpc9.mjs +1 -0
- package/dist/chunks/thinkback-0.5.7-6bzqdm8h.mjs +1 -0
- package/dist/chunks/thinkback-play-0.5.7-5m54zaez.mjs +1 -0
- package/dist/chunks/toolPool-0.5.7-5rd6jp71.mjs +1 -0
- package/dist/chunks/toolSearch-0.5.7-wgqasfmq.mjs +1 -0
- package/dist/chunks/trustedDevice-0.5.7-5qbzragc.mjs +1 -0
- package/dist/chunks/turndown.cjs-0.5.7-3fjybn8j.mjs +69 -0
- package/dist/chunks/ultrareviewCommand-0.5.7-98p7mn4r.mjs +4 -0
- package/dist/chunks/update-0.5.7-2jgnt5gj.mjs +86 -0
- package/dist/chunks/upgrade-0.5.7-1fa84f4g.mjs +1 -0
- package/dist/chunks/upstreamproxy-0.5.7-1p7vn612.mjs +14 -0
- package/dist/chunks/url-handler-napi-0.5.7-312p1719.mjs +1 -0
- package/dist/chunks/usage-0.5.7-qrsabcka.mjs +1 -0
- package/dist/chunks/util-0.5.7-tpzcah5j.mjs +1 -0
- package/dist/chunks/utils-0.5.7-8a2ekyr5.mjs +1 -0
- package/dist/chunks/vim-0.5.7-w4e8vpjf.mjs +1 -0
- package/dist/chunks/watcher-0.5.7-cj50b60x.mjs +1 -0
- package/dist/chunks/wiki-0.5.7-ccjdtg8v.mjs +132 -0
- package/dist/chunks/worktree-0.5.7-g8wrf9zf.mjs +1 -0
- package/dist/chunks/worktreeModeEnabled-0.5.7-w4jdaq8p.mjs +1 -0
- package/dist/chunks/wrapper-0.5.7-8k82xd0n.mjs +7 -0
- package/dist/claudin-vscode.vsix +0 -0
- package/dist/cli.mjs +7 -0
- package/package.json +141 -0
- package/scripts/v8cache-gc.mjs +84 -0
|
@@ -0,0 +1,1236 @@
|
|
|
1
|
+
import{u as o,w as SB,x as WG,y as uW,z as dW}from"./cli-0.5.7-7k456xwn.mjs";import{A as yX,B as PZ,C as IY,D as JX,E as XB,G as j2,H as U2,I as L2,J as Wb,K as RX,L as gX,M as w2,N as vG,O as AG,P as NH}from"./cli-0.5.7-q0pq4367.mjs";import"./cli-0.5.7-vy4r02pg.mjs";import{W as n,X as RG}from"./cli-0.5.7-p381d4sx.mjs";import"./cli-0.5.7-jptzskw1.mjs";import{$ as s2,aa as n2}from"./cli-0.5.7-bnapjxz4.mjs";import"./cli-0.5.7-2tnvc3ka.mjs";import{Ga as aI,Ha as F2,Ja as N2}from"./cli-0.5.7-67xxeffj.mjs";import{Pa as kB}from"./cli-0.5.7-j7h72bgz.mjs";import"./cli-0.5.7-bkptgahs.mjs";import"./cli-0.5.7-vn5aht50.mjs";import"./cli-0.5.7-de90yre1.mjs";import"./cli-0.5.7-3jrq7w6x.mjs";import{Eb as Q2,Fb as fC}from"./cli-0.5.7-5by4fby4.mjs";import"./cli-0.5.7-6gkpb0vw.mjs";import{Ac as KI,Bc as Db}from"./cli-0.5.7-rr1yd8f3.mjs";import"./cli-0.5.7-m82d23hf.mjs";import"./cli-0.5.7-w024nwsf.mjs";import"./cli-0.5.7-qdcp748z.mjs";import"./cli-0.5.7-2ytftsg5.mjs";import"./cli-0.5.7-5aghfr8k.mjs";import"./cli-0.5.7-6thqe6p4.mjs";import"./cli-0.5.7-jf3f8gen.mjs";import"./cli-0.5.7-6gfay8ap.mjs";import"./cli-0.5.7-d19d4v07.mjs";import{qh as wB,rh as zW}from"./cli-0.5.7-hhre0h51.mjs";import{$G as Rb,$L as DI,$h as WB,AF as l2,AN as sG,AO as SW,Am as CY,An as K0,As as hC,BO as MW,Bi as SY,Bm as y0,CF as m2,CH as gH,DH as KH,DJ as lG,Di as g0,Dn as kY,Dp as B2,EJ as qG,En as z0,Ep as qC,FJ as yI,Fh as _Y,Fw as X2,GJ as JI,GL as i,Gw as vC,HF as aC,HJ as Mb,HL as gG,Hl as iI,Hn as XX,Ho as GI,Hs as Y2,II as Yb,IJ as pG,Il as mC,In as VX,Io as BI,Is as $C,JI as eV,JJ as qb,Jo as II,KI as gY,KJ as RI,Ko as ZI,LA as V2,LJ as HB,Lo as iZ,Ls as W2,MG as HX,MJ as kb,Mo as sZ,NA as CX,NI as J0,NJ as CI,Nh as x0,No as cV,Np as I2,OA as uI,OD as $W,OG as RH,OO as a2,Os as xC,PD as QC,PG as HY,PL as vI,Pp as Z2,QB as C2,QD as VB,QI as UI,Qs as AB,Qw as PG,RD as zb,RI as CB,Rs as dG,SG as yY,Ss as LW,Sw as NI,TJ as XI,Tk as QW,Ts as wW,UG as JY,UJ as VI,UM as MB,Uh as ab,Ui as TY,Uk as FW,Us as AW,VB as DC,VD as Zb,VI as KY,Vi as q0,Vk as zC,Vn as aY,Vs as YI,WB as H2,WD as cW,WJ as B0,WL as pI,Wi as QB,Wn as iY,XD as bb,XI as zY,Xh as E2,Xi as MY,Xn as kI,Xr as YH,YB as PC,YI as QY,Yn as sY,Yp as kC,Yr as WH,ZI as LI,Zh as lC,Zz as _2,_I as FY,_M as nG,_n as e0,_z as pC,bD as y2,bJ as jb,bi as ZG,cP as i2,ci as GH,dD as TC,dH as RY,dP as FH,di as UG,dz as CH,eP as KB,ez as HH,gH as gb,go as ZH,ho as bH,jK as cI,kJ as Ub,kp as G2,lj as sb,lp as MC,mJ as Lb,mj as nb,ms as hI,nJ as wb,nj as rb,nt as fY,nv as eb,oJ as WI,ot as P0,ov as X0,pI as zH,pK as _C,ps as NW,pt as uY,qI as QH,qt as dY,rJ as G0,rt as lY,sC as O2,sF as qB,sn as OI,ss as xI,tC as c2,tF as q2,tK as K2,tn as SC,tt as T0,uC as Ib,uF as GY,uK as OC,ut as mY,vC as OW,vF as BY,vs as jW,vu as XH,wC as bI,wF as V0,wu as VH,xF as f2,xn as LG,yF as u2,yL as p2,yn as FI,ys as UW,yt as E0,zF as d2,zL as iC,zj as Y0,zn as qY,zs as b2}from"./cli-0.5.7-q2e6xpch.mjs";import{VP as ib,YP as b0}from"./cli-0.5.7-w16wj21h.mjs";import"./cli-0.5.7-tc3vm4ra.mjs";import{oQ as fW,qQ as NC}from"./cli-0.5.7-7hm7dxyp.mjs";import{wQ as yH,xQ as JH}from"./cli-0.5.7-gy4csxb5.mjs";import"./cli-0.5.7-bzrvdrq4.mjs";import"./cli-0.5.7-gnq8vh0c.mjs";import"./cli-0.5.7-93k1z52y.mjs";import"./cli-0.5.7-zb8ztx8p.mjs";import"./cli-0.5.7-w50j12vv.mjs";import{MR as QI,NR as W0}from"./cli-0.5.7-93eaxn9a.mjs";import{TR as J2,UR as R2,WR as g2,XR as EC}from"./cli-0.5.7-h9v4tqbs.mjs";import{rS as BH,sS as IH}from"./cli-0.5.7-vyxaeh82.mjs";import"./cli-0.5.7-31969syr.mjs";import{JS as VY,VS as H0}from"./cli-0.5.7-73er78b7.mjs";import"./cli-0.5.7-sb3fjts4.mjs";import"./cli-0.5.7-hq4wbper.mjs";import{HT as z2,IT as cC}from"./cli-0.5.7-yaywev87.mjs";import"./cli-0.5.7-7mmyazqh.mjs";import"./cli-0.5.7-aq7a3646.mjs";import"./cli-0.5.7-pzjz115k.mjs";import"./cli-0.5.7-tbga87q3.mjs";import"./cli-0.5.7-7a9gq9ff.mjs";import"./cli-0.5.7-x1w96j6d.mjs";import{rX as WX,uX as tb,wX as ob}from"./cli-0.5.7-9z55nm22.mjs";import"./cli-0.5.7-0rvzfmhb.mjs";import"./cli-0.5.7-kp9pg4sr.mjs";import"./cli-0.5.7-gcnk0vke.mjs";import"./cli-0.5.7-6d26vvaa.mjs";import"./cli-0.5.7-e8eqdfnf.mjs";import"./cli-0.5.7-9acdh8nc.mjs";import"./cli-0.5.7-g7k0r0ea.mjs";import{PY as HG,RY as BB}from"./cli-0.5.7-vgc7nzef.mjs";import{SY as FC}from"./cli-0.5.7-8sbq2qed.mjs";import"./cli-0.5.7-jw2te6th.mjs";import"./cli-0.5.7-20cz322w.mjs";import{eZ as mI,hZ as T2,lZ as h2}from"./cli-0.5.7-m5q27x96.mjs";import"./cli-0.5.7-6pssgqdn.mjs";import"./cli-0.5.7-5e5xfeq6.mjs";import{$0 as tW,B3 as _W,K1 as jB,N0 as rW,P1 as KW,PZ as RW,QZ as gC,R1 as KC,V1 as oW,W1 as AC,_0 as _I,a1 as wC,m3 as eW,r1 as gW,s2 as YX,t2 as Gb,u2 as Bb,z1 as UB,z3 as EW}from"./cli-0.5.7-8ychjqct.mjs";import"./cli-0.5.7-g4n7dg2d.mjs";import{X3 as x,Y3 as gB}from"./cli-0.5.7-xn6deh04.mjs";import"./cli-0.5.7-dntg9qbj.mjs";import"./cli-0.5.7-rggstqv6.mjs";import"./cli-0.5.7-0df5m6td.mjs";import"./cli-0.5.7-yzncgfs4.mjs";import"./cli-0.5.7-2qxsy7jq.mjs";import"./cli-0.5.7-89fcvfy0.mjs";import{B6 as KG,C$ as NB,Eaa as fI,G$ as HI,Haa as hG,Iaa as nW,J$ as EG,J6 as LB,M$ as sW,M7 as AY,O7 as bB,P7 as sB,T$ as yB,V8 as zB,Z_ as TG,_8 as WY,_aa as mb,b_ as tC,c_ as oC,f$ as XY,fba as oB,j$ as IW,k6 as TI,kba as eB,kca as DG,m6 as UC,n$ as CC,nca as pb,p7 as wY,q$ as bX,q9 as iW,r$ as eC,r8 as P2,r9 as LC,s$ as eZ,s8 as EI,t8 as aW,u7 as D2,vba as OV,x$ as oV}from"./cli-0.5.7-469r2a5r.mjs";import{Eca as BW,Gca as r,Ica as gI,Jca as aG,Kca as xb}from"./cli-0.5.7-mzfr99sc.mjs";import{Xca as PY,fda as M0,kda as M,lda as ZX,pda as oZ}from"./cli-0.5.7-5mrw857q.mjs";import"./cli-0.5.7-c9dtw94k.mjs";import{Ada as wI,xda as xG}from"./cli-0.5.7-0s7wtvbz.mjs";import{Kda as iG,Pda as TW,Wda as PI}from"./cli-0.5.7-35yf0b84.mjs";import{Zda as $I,_da as JW}from"./cli-0.5.7-sjx0wm99.mjs";import{Lea as lb,Mea as Z0}from"./cli-0.5.7-xepvraxn.mjs";import{Nea as v,Oea as rC,Pea as JG}from"./cli-0.5.7-26pwg6gg.mjs";import{Ifa as vY,Pfa as T,Qfa as DY,Sfa as jG,cfa as pW,efa as jC,sfa as CG,wfa as nC,xfa as mG}from"./cli-0.5.7-twqt7rxq.mjs";import{Vfa as jI,Yfa as C0}from"./cli-0.5.7-pse9qff7.mjs";import{cga as VG,ega as $G,fga as Nb,mga as FG}from"./cli-0.5.7-tqn2ged5.mjs";import{Cga as $B,Fga as v2,Gga as GG,Hga as zI,Iga as xY,Nga as kG}from"./cli-0.5.7-skfm51ta.mjs";import{Dja as VW,Eja as CW,Fja as HW,Jla as yW,Lla as lI,Ska as tZ,Sla as YY,Wka as bY,eka as RB,gka as uZ,ika as dZ,ima as IG,ria as db,ska as lZ,uia as $2,uka as mZ,xia as dI,yla as x2,zia as hB}from"./cli-0.5.7-hp25yk8y.mjs";import"./cli-0.5.7-m4wwfa6q.mjs";import{Vma as MZ,Wma as s,Xma as NG,Yma as EV,Zma as _V,_ma as J}from"./cli-0.5.7-258ytmbr.mjs";var uG=NG((cX)=>{class OB extends Error{constructor(G,B,I){super(I);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=B,this.exitCode=G,this.nestedError=void 0}}class VZ extends OB{constructor(G){super(1,"commander.invalidArgument",G);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}cX.CommanderError=OB;cX.InvalidArgumentError=VZ});var eG=NG((mX)=>{var{InvalidArgumentError:dX}=uG();class CZ{constructor(G,B){switch(this.description=B||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,G[0]){case"<":this.required=!0,this._name=G.slice(1,-1);break;case"[":this.required=!1,this._name=G.slice(1,-1);break;default:this.required=!0,this._name=G;break}if(this._name.endsWith("..."))this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_collectValue(G,B){if(B===this.defaultValue||!Array.isArray(B))return[G];return B.push(G),B}default(G,B){return this.defaultValue=G,this.defaultValueDescription=B,this}argParser(G){return this.parseArg=G,this}choices(G){return this.argChoices=G.slice(),this.parseArg=(B,I)=>{if(!this.argChoices.includes(B))throw new dX(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(B,I);return B},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function lX(G){let B=G.name()+(G.variadic===!0?"...":"");return G.required?"<"+B+">":"["+B+"]"}mX.Argument=CZ;mX.humanReadableArgName=lX});var cB=NG((sX)=>{var{humanReadableArgName:iX}=eG();class HZ{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(G){this.helpWidth=this.helpWidth??G.helpWidth??80}visibleCommands(G){let B=G.commands.filter((Z)=>!Z._hidden),I=G._getHelpCommand();if(I&&!I._hidden)B.push(I);if(this.sortSubcommands)B.sort((Z,b)=>{return Z.name().localeCompare(b.name())});return B}compareOptions(G,B){let I=(Z)=>{return Z.short?Z.short.replace(/^-/,""):Z.long.replace(/^--/,"")};return I(G).localeCompare(I(B))}visibleOptions(G){let B=G.options.filter((Z)=>!Z.hidden),I=G._getHelpOption();if(I&&!I.hidden){let Z=I.short&&G._findOption(I.short),b=I.long&&G._findOption(I.long);if(!Z&&!b)B.push(I);else if(I.long&&!b)B.push(G.createOption(I.long,I.description));else if(I.short&&!Z)B.push(G.createOption(I.short,I.description))}if(this.sortOptions)B.sort(this.compareOptions);return B}visibleGlobalOptions(G){if(!this.showGlobalOptions)return[];let B=[];for(let I=G.parent;I;I=I.parent){let Z=I.options.filter((b)=>!b.hidden);B.push(...Z)}if(this.sortOptions)B.sort(this.compareOptions);return B}visibleArguments(G){if(G._argsDescription)G.registeredArguments.forEach((B)=>{B.description=B.description||G._argsDescription[B.name()]||""});if(G.registeredArguments.find((B)=>B.description))return G.registeredArguments;return[]}subcommandTerm(G){let B=G.registeredArguments.map((I)=>iX(I)).join(" ");return G._name+(G._aliases[0]?"|"+G._aliases[0]:"")+(G.options.length?" [options]":"")+(B?" "+B:"")}optionTerm(G){return G.flags}argumentTerm(G){return G.name()}longestSubcommandTermLength(G,B){return B.visibleCommands(G).reduce((I,Z)=>{return Math.max(I,this.displayWidth(B.styleSubcommandTerm(B.subcommandTerm(Z))))},0)}longestOptionTermLength(G,B){return B.visibleOptions(G).reduce((I,Z)=>{return Math.max(I,this.displayWidth(B.styleOptionTerm(B.optionTerm(Z))))},0)}longestGlobalOptionTermLength(G,B){return B.visibleGlobalOptions(G).reduce((I,Z)=>{return Math.max(I,this.displayWidth(B.styleOptionTerm(B.optionTerm(Z))))},0)}longestArgumentTermLength(G,B){return B.visibleArguments(G).reduce((I,Z)=>{return Math.max(I,this.displayWidth(B.styleArgumentTerm(B.argumentTerm(Z))))},0)}commandUsage(G){let B=G._name;if(G._aliases[0])B=B+"|"+G._aliases[0];let I="";for(let Z=G.parent;Z;Z=Z.parent)I=Z.name()+" "+I;return I+B+" "+G.usage()}commandDescription(G){return G.description()}subcommandDescription(G){return G.summary()||G.description()}optionDescription(G){let B=[];if(G.argChoices)B.push(`choices: ${G.argChoices.map((I)=>JSON.stringify(I)).join(", ")}`);if(G.defaultValue!==void 0){if(G.required||G.optional||G.isBoolean()&&typeof G.defaultValue==="boolean")B.push(`default: ${G.defaultValueDescription||JSON.stringify(G.defaultValue)}`)}if(G.presetArg!==void 0&&G.optional)B.push(`preset: ${JSON.stringify(G.presetArg)}`);if(G.envVar!==void 0)B.push(`env: ${G.envVar}`);if(B.length>0){let I=`(${B.join(", ")})`;if(G.description)return`${G.description} ${I}`;return I}return G.description}argumentDescription(G){let B=[];if(G.argChoices)B.push(`choices: ${G.argChoices.map((I)=>JSON.stringify(I)).join(", ")}`);if(G.defaultValue!==void 0)B.push(`default: ${G.defaultValueDescription||JSON.stringify(G.defaultValue)}`);if(B.length>0){let I=`(${B.join(", ")})`;if(G.description)return`${G.description} ${I}`;return I}return G.description}formatItemList(G,B,I){if(B.length===0)return[];return[I.styleTitle(G),...B,""]}groupItems(G,B,I){let Z=new Map;return G.forEach((b)=>{let Y=I(b);if(!Z.has(Y))Z.set(Y,[])}),B.forEach((b)=>{let Y=I(b);if(!Z.has(Y))Z.set(Y,[]);Z.get(Y).push(b)}),Z}formatHelp(G,B){let I=B.padWidth(G,B),Z=B.helpWidth??80;function b(C,y){return B.formatItem(C,I,y,B)}let Y=[`${B.styleTitle("Usage:")} ${B.styleUsage(B.commandUsage(G))}`,""],W=B.commandDescription(G);if(W.length>0)Y=Y.concat([B.boxWrap(B.styleCommandDescription(W),Z),""]);let X=B.visibleArguments(G).map((C)=>{return b(B.styleArgumentTerm(B.argumentTerm(C)),B.styleArgumentDescription(B.argumentDescription(C)))});if(Y=Y.concat(this.formatItemList("Arguments:",X,B)),this.groupItems(G.options,B.visibleOptions(G),(C)=>C.helpGroupHeading??"Options:").forEach((C,y)=>{let R=C.map((g)=>{return b(B.styleOptionTerm(B.optionTerm(g)),B.styleOptionDescription(B.optionDescription(g)))});Y=Y.concat(this.formatItemList(y,R,B))}),B.showGlobalOptions){let C=B.visibleGlobalOptions(G).map((y)=>{return b(B.styleOptionTerm(B.optionTerm(y)),B.styleOptionDescription(B.optionDescription(y)))});Y=Y.concat(this.formatItemList("Global Options:",C,B))}return this.groupItems(G.commands,B.visibleCommands(G),(C)=>C.helpGroup()||"Commands:").forEach((C,y)=>{let R=C.map((g)=>{return b(B.styleSubcommandTerm(B.subcommandTerm(g)),B.styleSubcommandDescription(B.subcommandDescription(g)))});Y=Y.concat(this.formatItemList(y,R,B))}),Y.join(`
|
|
2
|
+
`)}displayWidth(G){return yZ(G).length}styleTitle(G){return G}styleUsage(G){return G.split(" ").map((B)=>{if(B==="[options]")return this.styleOptionText(B);if(B==="[command]")return this.styleSubcommandText(B);if(B[0]==="["||B[0]==="<")return this.styleArgumentText(B);return this.styleCommandText(B)}).join(" ")}styleCommandDescription(G){return this.styleDescriptionText(G)}styleOptionDescription(G){return this.styleDescriptionText(G)}styleSubcommandDescription(G){return this.styleDescriptionText(G)}styleArgumentDescription(G){return this.styleDescriptionText(G)}styleDescriptionText(G){return G}styleOptionTerm(G){return this.styleOptionText(G)}styleSubcommandTerm(G){return G.split(" ").map((B)=>{if(B==="[options]")return this.styleOptionText(B);if(B[0]==="["||B[0]==="<")return this.styleArgumentText(B);return this.styleSubcommandText(B)}).join(" ")}styleArgumentTerm(G){return this.styleArgumentText(G)}styleOptionText(G){return G}styleArgumentText(G){return G}styleSubcommandText(G){return G}styleCommandText(G){return G}padWidth(G,B){return Math.max(B.longestOptionTermLength(G,B),B.longestGlobalOptionTermLength(G,B),B.longestSubcommandTermLength(G,B),B.longestArgumentTermLength(G,B))}preformatted(G){return/\n[^\S\r\n]/.test(G)}formatItem(G,B,I,Z){let Y=" ".repeat(2);if(!I)return Y+G;let W=G.padEnd(B+G.length-Z.displayWidth(G)),X=2,V=(this.helpWidth??80)-B-X-2,C;if(V<this.minWidthToWrap||Z.preformatted(I))C=I;else C=Z.boxWrap(I,V).replace(/\n/g,`
|
|
3
|
+
`+" ".repeat(B+X));return Y+W+" ".repeat(X)+C.replace(/\n/g,`
|
|
4
|
+
${Y}`)}boxWrap(G,B){if(B<this.minWidthToWrap)return G;let I=G.split(/\r\n|\n/),Z=/[\s]*[^\s]+/g,b=[];return I.forEach((Y)=>{let W=Y.match(Z);if(W===null){b.push("");return}let X=[W.shift()],H=this.displayWidth(X[0]);W.forEach((V)=>{let C=this.displayWidth(V);if(H+C<=B){X.push(V),H+=C;return}b.push(X.join(""));let y=V.trimStart();X=[y],H=this.displayWidth(y)}),b.push(X.join(""))}),b.join(`
|
|
5
|
+
`)}}function yZ(G){let B=/\x1b\[\d*(;\d*)*m/g;return G.replace(B,"")}sX.Help=HZ;sX.stripColor=yZ});var fB=NG((eX)=>{var{InvalidArgumentError:tX}=uG();class RZ{constructor(G,B){this.flags=G,this.description=B||"",this.required=G.includes("<"),this.optional=G.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(G),this.mandatory=!1;let I=oX(G);if(this.short=I.shortFlag,this.long=I.longFlag,this.negate=!1,this.long)this.negate=this.long.startsWith("--no-");this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(G,B){return this.defaultValue=G,this.defaultValueDescription=B,this}preset(G){return this.presetArg=G,this}conflicts(G){return this.conflictsWith=this.conflictsWith.concat(G),this}implies(G){let B=G;if(typeof G==="string")B={[G]:!0};return this.implied=Object.assign(this.implied||{},B),this}env(G){return this.envVar=G,this}argParser(G){return this.parseArg=G,this}makeOptionMandatory(G=!0){return this.mandatory=!!G,this}hideHelp(G=!0){return this.hidden=!!G,this}_collectValue(G,B){if(B===this.defaultValue||!Array.isArray(B))return[G];return B.push(G),B}choices(G){return this.argChoices=G.slice(),this.parseArg=(B,I)=>{if(!this.argChoices.includes(B))throw new tX(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(B,I);return B},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return JZ(this.name().replace(/^no-/,""));return JZ(this.name())}helpGroup(G){return this.helpGroupHeading=G,this}is(G){return this.short===G||this.long===G}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class gZ{constructor(G){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,G.forEach((B)=>{if(B.negate)this.negativeOptions.set(B.attributeName(),B);else this.positiveOptions.set(B.attributeName(),B)}),this.negativeOptions.forEach((B,I)=>{if(this.positiveOptions.has(I))this.dualOptions.add(I)})}valueFromOption(G,B){let I=B.attributeName();if(!this.dualOptions.has(I))return!0;let Z=this.negativeOptions.get(I).presetArg,b=Z!==void 0?Z:!1;return B.negate===(b===G)}}function JZ(G){return G.split("-").reduce((B,I)=>{return B+I[0].toUpperCase()+I.slice(1)})}function oX(G){let B,I,Z=/^-[^-]$/,b=/^--[^-]/,Y=G.split(/[ |,]+/).concat("guard");if(Z.test(Y[0]))B=Y.shift();if(b.test(Y[0]))I=Y.shift();if(!B&&Z.test(Y[0]))B=Y.shift();if(!B&&b.test(Y[0]))B=I,I=Y.shift();if(Y[0].startsWith("-")){let W=Y[0],X=`option creation failed due to '${W}' in option flags '${G}'`;if(/^-[^-][^-]/.test(W))throw Error(`${X}
|
|
6
|
+
- a short flag is a single dash and a single character
|
|
7
|
+
- either use a single dash and a single character (for a short flag)
|
|
8
|
+
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(Z.test(W))throw Error(`${X}
|
|
9
|
+
- too many short flags`);if(b.test(W))throw Error(`${X}
|
|
10
|
+
- too many long flags`);throw Error(`${X}
|
|
11
|
+
- unrecognised flag format`)}if(B===void 0&&I===void 0)throw Error(`option creation failed due to no flags found in '${G}'.`);return{shortFlag:B,longFlag:I}}eX.Option=RZ;eX.DualOptions=gZ});var KZ=NG((bV)=>{function IV(G,B){if(Math.abs(G.length-B.length)>3)return Math.max(G.length,B.length);let I=[];for(let Z=0;Z<=G.length;Z++)I[Z]=[Z];for(let Z=0;Z<=B.length;Z++)I[0][Z]=Z;for(let Z=1;Z<=B.length;Z++)for(let b=1;b<=G.length;b++){let Y=1;if(G[b-1]===B[Z-1])Y=0;else Y=1;if(I[b][Z]=Math.min(I[b-1][Z]+1,I[b][Z-1]+1,I[b-1][Z-1]+Y),b>1&&Z>1&&G[b-1]===B[Z-2]&&G[b-2]===B[Z-1])I[b][Z]=Math.min(I[b][Z],I[b-2][Z-2]+1)}return I[G.length][B.length]}function ZV(G,B){if(!B||B.length===0)return"";B=Array.from(new Set(B));let I=G.startsWith("--");if(I)G=G.slice(2),B=B.map((W)=>W.slice(2));let Z=[],b=3,Y=0.4;if(B.forEach((W)=>{if(W.length<=1)return;let X=IV(G,W),H=Math.max(G.length,W.length);if((H-X)/H>Y){if(X<b)b=X,Z=[W];else if(X===b)Z.push(W)}}),Z.sort((W,X)=>W.localeCompare(X)),I)Z=Z.map((W)=>`--${W}`);if(Z.length>1)return`
|
|
12
|
+
(Did you mean one of ${Z.join(", ")}?)`;if(Z.length===1)return`
|
|
13
|
+
(Did you mean ${Z[0]}?)`;return""}bV.suggestSimilar=ZV});var NZ=NG((JV)=>{var WV=J("node:events").EventEmitter,uB=J("node:child_process"),QG=J("node:path"),GB=J("node:fs"),k=J("node:process"),{Argument:XV,humanReadableArgName:VV}=eG(),{CommanderError:dB}=uG(),{Help:CV,stripColor:HV}=cB(),{Option:zZ,DualOptions:yV}=fB(),{suggestSimilar:QZ}=KZ();class mB extends WV{constructor(G){super();this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=G||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:(B)=>k.stdout.write(B),writeErr:(B)=>k.stderr.write(B),outputError:(B,I)=>I(B),getOutHelpWidth:()=>k.stdout.isTTY?k.stdout.columns:void 0,getErrHelpWidth:()=>k.stderr.isTTY?k.stderr.columns:void 0,getOutHasColors:()=>lB()??(k.stdout.isTTY&&k.stdout.hasColors?.()),getErrHasColors:()=>lB()??(k.stderr.isTTY&&k.stderr.hasColors?.()),stripColor:(B)=>HV(B)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(G){return this._outputConfiguration=G._outputConfiguration,this._helpOption=G._helpOption,this._helpCommand=G._helpCommand,this._helpConfiguration=G._helpConfiguration,this._exitCallback=G._exitCallback,this._storeOptionsAsProperties=G._storeOptionsAsProperties,this._combineFlagAndOptionalValue=G._combineFlagAndOptionalValue,this._allowExcessArguments=G._allowExcessArguments,this._enablePositionalOptions=G._enablePositionalOptions,this._showHelpAfterError=G._showHelpAfterError,this._showSuggestionAfterError=G._showSuggestionAfterError,this}_getCommandAndAncestors(){let G=[];for(let B=this;B;B=B.parent)G.push(B);return G}command(G,B,I){let Z=B,b=I;if(typeof Z==="object"&&Z!==null)b=Z,Z=null;b=b||{};let[,Y,W]=G.match(/([^ ]+) *(.*)/),X=this.createCommand(Y);if(Z)X.description(Z),X._executableHandler=!0;if(b.isDefault)this._defaultCommandName=X._name;if(X._hidden=!!(b.noHelp||b.hidden),X._executableFile=b.executableFile||null,W)X.arguments(W);if(this._registerCommand(X),X.parent=this,X.copyInheritedSettings(this),Z)return this;return X}createCommand(G){return new mB(G)}createHelp(){return Object.assign(new CV,this.configureHelp())}configureHelp(G){if(G===void 0)return this._helpConfiguration;return this._helpConfiguration=G,this}configureOutput(G){if(G===void 0)return this._outputConfiguration;return this._outputConfiguration={...this._outputConfiguration,...G},this}showHelpAfterError(G=!0){if(typeof G!=="string")G=!!G;return this._showHelpAfterError=G,this}showSuggestionAfterError(G=!0){return this._showSuggestionAfterError=!!G,this}addCommand(G,B){if(!G._name)throw Error(`Command passed to .addCommand() must have a name
|
|
14
|
+
- specify the name in Command constructor or using .name()`);if(B=B||{},B.isDefault)this._defaultCommandName=G._name;if(B.noHelp||B.hidden)G._hidden=!0;return this._registerCommand(G),G.parent=this,G._checkForBrokenPassThrough(),this}createArgument(G,B){return new XV(G,B)}argument(G,B,I,Z){let b=this.createArgument(G,B);if(typeof I==="function")b.default(Z).argParser(I);else b.default(I);return this.addArgument(b),this}arguments(G){return G.trim().split(/ +/).forEach((B)=>{this.argument(B)}),this}addArgument(G){let B=this.registeredArguments.slice(-1)[0];if(B?.variadic)throw Error(`only the last argument can be variadic '${B.name()}'`);if(G.required&&G.defaultValue!==void 0&&G.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${G.name()}'`);return this.registeredArguments.push(G),this}helpCommand(G,B){if(typeof G==="boolean"){if(this._addImplicitHelpCommand=G,G&&this._defaultCommandGroup)this._initCommandGroup(this._getHelpCommand());return this}let I=G??"help [command]",[,Z,b]=I.match(/([^ ]+) *(.*)/),Y=B??"display help for command",W=this.createCommand(Z);if(W.helpOption(!1),b)W.arguments(b);if(Y)W.description(Y);if(this._addImplicitHelpCommand=!0,this._helpCommand=W,G||B)this._initCommandGroup(W);return this}addHelpCommand(G,B){if(typeof G!=="object")return this.helpCommand(G,B),this;return this._addImplicitHelpCommand=!0,this._helpCommand=G,this._initCommandGroup(G),this}_getHelpCommand(){if(this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))){if(this._helpCommand===void 0)this.helpCommand(void 0,void 0);return this._helpCommand}return null}hook(G,B){let I=["preSubcommand","preAction","postAction"];if(!I.includes(G))throw Error(`Unexpected value for event passed to hook : '${G}'.
|
|
15
|
+
Expecting one of '${I.join("', '")}'`);if(this._lifeCycleHooks[G])this._lifeCycleHooks[G].push(B);else this._lifeCycleHooks[G]=[B];return this}exitOverride(G){if(G)this._exitCallback=G;else this._exitCallback=(B)=>{if(B.code!=="commander.executeSubCommandAsync")throw B};return this}_exit(G,B,I){if(this._exitCallback)this._exitCallback(new dB(G,B,I));k.exit(G)}action(G){let B=(I)=>{let Z=this.registeredArguments.length,b=I.slice(0,Z);if(this._storeOptionsAsProperties)b[Z]=this;else b[Z]=this.opts();return b.push(this),G.apply(this,b)};return this._actionHandler=B,this}createOption(G,B){return new zZ(G,B)}_callParseArg(G,B,I,Z){try{return G.parseArg(B,I)}catch(b){if(b.code==="commander.invalidArgument"){let Y=`${Z} ${b.message}`;this.error(Y,{exitCode:b.exitCode,code:b.code})}throw b}}_registerOption(G){let B=G.short&&this._findOption(G.short)||G.long&&this._findOption(G.long);if(B){let I=G.long&&this._findOption(G.long)?G.long:G.short;throw Error(`Cannot add option '${G.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${I}'
|
|
16
|
+
- already used by option '${B.flags}'`)}this._initOptionGroup(G),this.options.push(G)}_registerCommand(G){let B=(Z)=>{return[Z.name()].concat(Z.aliases())},I=B(G).find((Z)=>this._findCommand(Z));if(I){let Z=B(this._findCommand(I)).join("|"),b=B(G).join("|");throw Error(`cannot add command '${b}' as already have command '${Z}'`)}this._initCommandGroup(G),this.commands.push(G)}addOption(G){this._registerOption(G);let B=G.name(),I=G.attributeName();if(G.negate){let b=G.long.replace(/^--no-/,"--");if(!this._findOption(b))this.setOptionValueWithSource(I,G.defaultValue===void 0?!0:G.defaultValue,"default")}else if(G.defaultValue!==void 0)this.setOptionValueWithSource(I,G.defaultValue,"default");let Z=(b,Y,W)=>{if(b==null&&G.presetArg!==void 0)b=G.presetArg;let X=this.getOptionValue(I);if(b!==null&&G.parseArg)b=this._callParseArg(G,b,X,Y);else if(b!==null&&G.variadic)b=G._collectValue(b,X);if(b==null)if(G.negate)b=!1;else if(G.isBoolean()||G.optional)b=!0;else b="";this.setOptionValueWithSource(I,b,W)};if(this.on("option:"+B,(b)=>{let Y=`error: option '${G.flags}' argument '${b}' is invalid.`;Z(b,Y,"cli")}),G.envVar)this.on("optionEnv:"+B,(b)=>{let Y=`error: option '${G.flags}' value '${b}' from env '${G.envVar}' is invalid.`;Z(b,Y,"env")});return this}_optionEx(G,B,I,Z,b){if(typeof B==="object"&&B instanceof zZ)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let Y=this.createOption(B,I);if(Y.makeOptionMandatory(!!G.mandatory),typeof Z==="function")Y.default(b).argParser(Z);else if(Z instanceof RegExp){let W=Z;Z=(X,H)=>{let V=W.exec(X);return V?V[0]:H},Y.default(b).argParser(Z)}else Y.default(Z);return this.addOption(Y)}option(G,B,I,Z){return this._optionEx({},G,B,I,Z)}requiredOption(G,B,I,Z){return this._optionEx({mandatory:!0},G,B,I,Z)}combineFlagAndOptionalValue(G=!0){return this._combineFlagAndOptionalValue=!!G,this}allowUnknownOption(G=!0){return this._allowUnknownOption=!!G,this}allowExcessArguments(G=!0){return this._allowExcessArguments=!!G,this}enablePositionalOptions(G=!0){return this._enablePositionalOptions=!!G,this}passThroughOptions(G=!0){return this._passThroughOptions=!!G,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(G=!0){if(this.options.length)throw Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!G,this}getOptionValue(G){if(this._storeOptionsAsProperties)return this[G];return this._optionValues[G]}setOptionValue(G,B){return this.setOptionValueWithSource(G,B,void 0)}setOptionValueWithSource(G,B,I){if(this._storeOptionsAsProperties)this[G]=B;else this._optionValues[G]=B;return this._optionValueSources[G]=I,this}getOptionValueSource(G){return this._optionValueSources[G]}getOptionValueSourceWithGlobals(G){let B;return this._getCommandAndAncestors().forEach((I)=>{if(I.getOptionValueSource(G)!==void 0)B=I.getOptionValueSource(G)}),B}_prepareUserArgs(G,B){if(G!==void 0&&!Array.isArray(G))throw Error("first parameter to parse must be array or undefined");if(B=B||{},G===void 0&&B.from===void 0){if(k.versions?.electron)B.from="electron";let Z=k.execArgv??[];if(Z.includes("-e")||Z.includes("--eval")||Z.includes("-p")||Z.includes("--print"))B.from="eval"}if(G===void 0)G=k.argv;this.rawArgs=G.slice();let I;switch(B.from){case void 0:case"node":this._scriptPath=G[1],I=G.slice(2);break;case"electron":if(k.defaultApp)this._scriptPath=G[1],I=G.slice(2);else I=G.slice(1);break;case"user":I=G.slice(0);break;case"eval":I=G.slice(1);break;default:throw Error(`unexpected parse option { from: '${B.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",I}parse(G,B){this._prepareForParse();let I=this._prepareUserArgs(G,B);return this._parseCommand([],I),this}async parseAsync(G,B){this._prepareForParse();let I=this._prepareUserArgs(G,B);return await this._parseCommand([],I),this}_prepareForParse(){if(this._savedState===null)this.saveStateBeforeParse();else this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw Error(`Can not call parse again when storeOptionsAsProperties is true.
|
|
17
|
+
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(G,B,I){if(GB.existsSync(G))return;let Z=B?`searched for local subcommand relative to directory '${B}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",b=`'${G}' does not exist
|
|
18
|
+
- if '${I}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
19
|
+
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
20
|
+
- ${Z}`;throw Error(b)}_executeSubCommand(G,B){B=B.slice();let I=!1,Z=[".js",".ts",".tsx",".mjs",".cjs"];function b(V,C){let y=QG.resolve(V,C);if(GB.existsSync(y))return y;if(Z.includes(QG.extname(C)))return;let R=Z.find((g)=>GB.existsSync(`${y}${g}`));if(R)return`${y}${R}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let Y=G._executableFile||`${this._name}-${G._name}`,W=this._executableDir||"";if(this._scriptPath){let V;try{V=GB.realpathSync(this._scriptPath)}catch{V=this._scriptPath}W=QG.resolve(QG.dirname(V),W)}if(W){let V=b(W,Y);if(!V&&!G._executableFile&&this._scriptPath){let C=QG.basename(this._scriptPath,QG.extname(this._scriptPath));if(C!==this._name)V=b(W,`${C}-${G._name}`)}Y=V||Y}I=Z.includes(QG.extname(Y));let X;if(k.platform!=="win32")if(I)B.unshift(Y),B=FZ(k.execArgv).concat(B),X=uB.spawn(k.argv[0],B,{stdio:"inherit"});else X=uB.spawn(Y,B,{stdio:"inherit"});else this._checkForMissingExecutable(Y,W,G._name),B.unshift(Y),B=FZ(k.execArgv).concat(B),X=uB.spawn(k.execPath,B,{stdio:"inherit"});if(!X.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((C)=>{k.on(C,()=>{if(X.killed===!1&&X.exitCode===null)X.kill(C)})});let H=this._exitCallback;X.on("close",(V)=>{if(V=V??1,!H)k.exit(V);else H(new dB(V,"commander.executeSubCommandAsync","(close)"))}),X.on("error",(V)=>{if(V.code==="ENOENT")this._checkForMissingExecutable(Y,W,G._name);else if(V.code==="EACCES")throw Error(`'${Y}' not executable`);if(!H)k.exit(1);else{let C=new dB(1,"commander.executeSubCommandAsync","(error)");C.nestedError=V,H(C)}}),this.runningCommand=X}_dispatchSubcommand(G,B,I){let Z=this._findCommand(G);if(!Z)this.help({error:!0});Z._prepareForParse();let b;return b=this._chainOrCallSubCommandHook(b,Z,"preSubcommand"),b=this._chainOrCall(b,()=>{if(Z._executableHandler)this._executeSubCommand(Z,B.concat(I));else return Z._parseCommand(B,I)}),b}_dispatchHelpCommand(G){if(!G)this.help();let B=this._findCommand(G);if(B&&!B._executableHandler)B.help();return this._dispatchSubcommand(G,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach((G,B)=>{if(G.required&&this.args[B]==null)this.missingArgument(G.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)return;if(this.args.length>this.registeredArguments.length)this._excessArguments(this.args)}_processArguments(){let G=(I,Z,b)=>{let Y=Z;if(Z!==null&&I.parseArg){let W=`error: command-argument value '${Z}' is invalid for argument '${I.name()}'.`;Y=this._callParseArg(I,Z,b,W)}return Y};this._checkNumberOfArguments();let B=[];this.registeredArguments.forEach((I,Z)=>{let b=I.defaultValue;if(I.variadic){if(Z<this.args.length){if(b=this.args.slice(Z),I.parseArg)b=b.reduce((Y,W)=>{return G(I,W,Y)},I.defaultValue)}else if(b===void 0)b=[]}else if(Z<this.args.length){if(b=this.args[Z],I.parseArg)b=G(I,b,I.defaultValue)}B[Z]=b}),this.processedArgs=B}_chainOrCall(G,B){if(G?.then&&typeof G.then==="function")return G.then(()=>B());return B()}_chainOrCallHooks(G,B){let I=G,Z=[];if(this._getCommandAndAncestors().reverse().filter((b)=>b._lifeCycleHooks[B]!==void 0).forEach((b)=>{b._lifeCycleHooks[B].forEach((Y)=>{Z.push({hookedCommand:b,callback:Y})})}),B==="postAction")Z.reverse();return Z.forEach((b)=>{I=this._chainOrCall(I,()=>{return b.callback(b.hookedCommand,this)})}),I}_chainOrCallSubCommandHook(G,B,I){let Z=G;if(this._lifeCycleHooks[I]!==void 0)this._lifeCycleHooks[I].forEach((b)=>{Z=this._chainOrCall(Z,()=>{return b(this,B)})});return Z}_parseCommand(G,B){let I=this.parseOptions(B);if(this._parseOptionsEnv(),this._parseOptionsImplied(),G=G.concat(I.operands),B=I.unknown,this.args=G.concat(B),G&&this._findCommand(G[0]))return this._dispatchSubcommand(G[0],G.slice(1),B);if(this._getHelpCommand()&&G[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(G[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(B),this._dispatchSubcommand(this._defaultCommandName,G,B);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(I.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let Z=()=>{if(I.unknown.length>0)this.unknownOption(I.unknown[0])},b=`command:${this.name()}`;if(this._actionHandler){Z(),this._processArguments();let Y;if(Y=this._chainOrCallHooks(Y,"preAction"),Y=this._chainOrCall(Y,()=>this._actionHandler(this.processedArgs)),this.parent)Y=this._chainOrCall(Y,()=>{this.parent.emit(b,G,B)});return Y=this._chainOrCallHooks(Y,"postAction"),Y}if(this.parent?.listenerCount(b))Z(),this._processArguments(),this.parent.emit(b,G,B);else if(G.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",G,B);if(this.listenerCount("command:*"))this.emit("command:*",G,B);else if(this.commands.length)this.unknownCommand();else Z(),this._processArguments()}else if(this.commands.length)Z(),this.help({error:!0});else Z(),this._processArguments()}_findCommand(G){if(!G)return;return this.commands.find((B)=>B._name===G||B._aliases.includes(G))}_findOption(G){return this.options.find((B)=>B.is(G))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((G)=>{G.options.forEach((B)=>{if(B.mandatory&&G.getOptionValue(B.attributeName())===void 0)G.missingMandatoryOptionValue(B)})})}_checkForConflictingLocalOptions(){let G=this.options.filter((I)=>{let Z=I.attributeName();if(this.getOptionValue(Z)===void 0)return!1;return this.getOptionValueSource(Z)!=="default"});G.filter((I)=>I.conflictsWith.length>0).forEach((I)=>{let Z=G.find((b)=>I.conflictsWith.includes(b.attributeName()));if(Z)this._conflictingOption(I,Z)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((G)=>{G._checkForConflictingLocalOptions()})}parseOptions(G){let B=[],I=[],Z=B;function b(V){return V.length>1&&V[0]==="-"}let Y=(V)=>{if(!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(V))return!1;return!this._getCommandAndAncestors().some((C)=>C.options.map((y)=>y.short).some((y)=>/^-\d$/.test(y)))},W=null,X=null,H=0;while(H<G.length||X){let V=X??G[H++];if(X=null,V==="--"){if(Z===I)Z.push(V);Z.push(...G.slice(H));break}if(W&&(!b(V)||Y(V))){this.emit(`option:${W.name()}`,V);continue}if(W=null,b(V)){let C=this._findOption(V);if(C){if(C.required){let y=G[H++];if(y===void 0)this.optionMissingArgument(C);this.emit(`option:${C.name()}`,y)}else if(C.optional){let y=null;if(H<G.length&&(!b(G[H])||Y(G[H])))y=G[H++];this.emit(`option:${C.name()}`,y)}else this.emit(`option:${C.name()}`);W=C.variadic?C:null;continue}}if(V.length>2&&V[0]==="-"&&V[1]!=="-"){let C=this._findOption(`-${V[1]}`);if(C){if(C.required||C.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${C.name()}`,V.slice(2));else this.emit(`option:${C.name()}`),X=`-${V.slice(2)}`;continue}}if(/^--[^=]+=/.test(V)){let C=V.indexOf("="),y=this._findOption(V.slice(0,C));if(y&&(y.required||y.optional)){this.emit(`option:${y.name()}`,V.slice(C+1));continue}}if(Z===B&&b(V)&&!(this.commands.length===0&&Y(V)))Z=I;if((this._enablePositionalOptions||this._passThroughOptions)&&B.length===0&&I.length===0){if(this._findCommand(V)){B.push(V),I.push(...G.slice(H));break}else if(this._getHelpCommand()&&V===this._getHelpCommand().name()){B.push(V,...G.slice(H));break}else if(this._defaultCommandName){I.push(V,...G.slice(H));break}}if(this._passThroughOptions){Z.push(V,...G.slice(H));break}Z.push(V)}return{operands:B,unknown:I}}opts(){if(this._storeOptionsAsProperties){let G={},B=this.options.length;for(let I=0;I<B;I++){let Z=this.options[I].attributeName();G[Z]=Z===this._versionOptionName?this._version:this[Z]}return G}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((G,B)=>Object.assign(G,B.opts()),{})}error(G,B){if(this._outputConfiguration.outputError(`${G}
|
|
21
|
+
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==="string")this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
22
|
+
`);else if(this._showHelpAfterError)this._outputConfiguration.writeErr(`
|
|
23
|
+
`),this.outputHelp({error:!0});let I=B||{},Z=I.exitCode||1,b=I.code||"commander.error";this._exit(Z,b,G)}_parseOptionsEnv(){this.options.forEach((G)=>{if(G.envVar&&G.envVar in k.env){let B=G.attributeName();if(this.getOptionValue(B)===void 0||["default","config","env"].includes(this.getOptionValueSource(B)))if(G.required||G.optional)this.emit(`optionEnv:${G.name()}`,k.env[G.envVar]);else this.emit(`optionEnv:${G.name()}`)}})}_parseOptionsImplied(){let G=new yV(this.options),B=(I)=>{return this.getOptionValue(I)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(I))};this.options.filter((I)=>I.implied!==void 0&&B(I.attributeName())&&G.valueFromOption(this.getOptionValue(I.attributeName()),I)).forEach((I)=>{Object.keys(I.implied).filter((Z)=>!B(Z)).forEach((Z)=>{this.setOptionValueWithSource(Z,I.implied[Z],"implied")})})}missingArgument(G){let B=`error: missing required argument '${G}'`;this.error(B,{code:"commander.missingArgument"})}optionMissingArgument(G){let B=`error: option '${G.flags}' argument missing`;this.error(B,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(G){let B=`error: required option '${G.flags}' not specified`;this.error(B,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(G,B){let I=(Y)=>{let W=Y.attributeName(),X=this.getOptionValue(W),H=this.options.find((C)=>C.negate&&W===C.attributeName()),V=this.options.find((C)=>!C.negate&&W===C.attributeName());if(H&&(H.presetArg===void 0&&X===!1||H.presetArg!==void 0&&X===H.presetArg))return H;return V||Y},Z=(Y)=>{let W=I(Y),X=W.attributeName();if(this.getOptionValueSource(X)==="env")return`environment variable '${W.envVar}'`;return`option '${W.flags}'`},b=`error: ${Z(G)} cannot be used with ${Z(B)}`;this.error(b,{code:"commander.conflictingOption"})}unknownOption(G){if(this._allowUnknownOption)return;let B="";if(G.startsWith("--")&&this._showSuggestionAfterError){let Z=[],b=this;do{let Y=b.createHelp().visibleOptions(b).filter((W)=>W.long).map((W)=>W.long);Z=Z.concat(Y),b=b.parent}while(b&&!b._enablePositionalOptions);B=QZ(G,Z)}let I=`error: unknown option '${G}'${B}`;this.error(I,{code:"commander.unknownOption"})}_excessArguments(G){if(this._allowExcessArguments)return;let B=this.registeredArguments.length,I=B===1?"":"s",b=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${B} argument${I} but got ${G.length}.`;this.error(b,{code:"commander.excessArguments"})}unknownCommand(){let G=this.args[0],B="";if(this._showSuggestionAfterError){let Z=[];this.createHelp().visibleCommands(this).forEach((b)=>{if(Z.push(b.name()),b.alias())Z.push(b.alias())}),B=QZ(G,Z)}let I=`error: unknown command '${G}'${B}`;this.error(I,{code:"commander.unknownCommand"})}version(G,B,I){if(G===void 0)return this._version;this._version=G,B=B||"-V, --version",I=I||"output the version number";let Z=this.createOption(B,I);return this._versionOptionName=Z.attributeName(),this._registerOption(Z),this.on("option:"+Z.name(),()=>{this._outputConfiguration.writeOut(`${G}
|
|
24
|
+
`),this._exit(0,"commander.version",G)}),this}description(G,B){if(G===void 0&&B===void 0)return this._description;if(this._description=G,B)this._argsDescription=B;return this}summary(G){if(G===void 0)return this._summary;return this._summary=G,this}alias(G){if(G===void 0)return this._aliases[0];let B=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)B=this.commands[this.commands.length-1];if(G===B._name)throw Error("Command alias can't be the same as its name");let I=this.parent?._findCommand(G);if(I){let Z=[I.name()].concat(I.aliases()).join("|");throw Error(`cannot add alias '${G}' to command '${this.name()}' as already have command '${Z}'`)}return B._aliases.push(G),this}aliases(G){if(G===void 0)return this._aliases;return G.forEach((B)=>this.alias(B)),this}usage(G){if(G===void 0){if(this._usage)return this._usage;let B=this.registeredArguments.map((I)=>{return VV(I)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?B:[]).join(" ")}return this._usage=G,this}name(G){if(G===void 0)return this._name;return this._name=G,this}helpGroup(G){if(G===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=G,this}commandsGroup(G){if(G===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=G,this}optionsGroup(G){if(G===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=G,this}_initOptionGroup(G){if(this._defaultOptionGroup&&!G.helpGroupHeading)G.helpGroup(this._defaultOptionGroup)}_initCommandGroup(G){if(this._defaultCommandGroup&&!G.helpGroup())G.helpGroup(this._defaultCommandGroup)}nameFromFilename(G){return this._name=QG.basename(G,QG.extname(G)),this}executableDir(G){if(G===void 0)return this._executableDir;return this._executableDir=G,this}helpInformation(G){let B=this.createHelp(),I=this._getOutputContext(G);B.prepareContext({error:I.error,helpWidth:I.helpWidth,outputHasColors:I.hasColors});let Z=B.formatHelp(this,B);if(I.hasColors)return Z;return this._outputConfiguration.stripColor(Z)}_getOutputContext(G){G=G||{};let B=!!G.error,I,Z,b;if(B)I=(W)=>this._outputConfiguration.writeErr(W),Z=this._outputConfiguration.getErrHasColors(),b=this._outputConfiguration.getErrHelpWidth();else I=(W)=>this._outputConfiguration.writeOut(W),Z=this._outputConfiguration.getOutHasColors(),b=this._outputConfiguration.getOutHelpWidth();return{error:B,write:(W)=>{if(!Z)W=this._outputConfiguration.stripColor(W);return I(W)},hasColors:Z,helpWidth:b}}outputHelp(G){let B;if(typeof G==="function")B=G,G=void 0;let I=this._getOutputContext(G),Z={error:I.error,write:I.write,command:this};this._getCommandAndAncestors().reverse().forEach((Y)=>Y.emit("beforeAllHelp",Z)),this.emit("beforeHelp",Z);let b=this.helpInformation({error:I.error});if(B){if(b=B(b),typeof b!=="string"&&!Buffer.isBuffer(b))throw Error("outputHelp callback must return a string or a Buffer")}if(I.write(b),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",Z),this._getCommandAndAncestors().forEach((Y)=>Y.emit("afterAllHelp",Z))}helpOption(G,B){if(typeof G==="boolean"){if(G){if(this._helpOption===null)this._helpOption=void 0;if(this._defaultOptionGroup)this._initOptionGroup(this._getHelpOption())}else this._helpOption=null;return this}if(this._helpOption=this.createOption(G??"-h, --help",B??"display help for command"),G||B)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption(G){return this._helpOption=G,this._initOptionGroup(G),this}help(G){this.outputHelp(G);let B=Number(k.exitCode??0);if(B===0&&G&&typeof G!=="function"&&G.error)B=1;this._exit(B,"commander.help","(outputHelp)")}addHelpText(G,B){let I=["beforeAll","before","after","afterAll"];if(!I.includes(G))throw Error(`Unexpected value for position to addHelpText.
|
|
25
|
+
Expecting one of '${I.join("', '")}'`);let Z=`${G}Help`;return this.on(Z,(b)=>{let Y;if(typeof B==="function")Y=B({error:b.error,command:b.command});else Y=B;if(Y)b.write(`${Y}
|
|
26
|
+
`)}),this}_outputHelpIfRequested(G){let B=this._getHelpOption();if(B&&G.find((Z)=>B.is(Z)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function FZ(G){return G.map((B)=>{if(!B.startsWith("--inspect"))return B;let I,Z="127.0.0.1",b="9229",Y;if((Y=B.match(/^(--inspect(-brk)?)$/))!==null)I=Y[1];else if((Y=B.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(I=Y[1],/^\d+$/.test(Y[3]))b=Y[3];else Z=Y[3];else if((Y=B.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)I=Y[1],Z=Y[3],b=Y[4];if(I&&b!=="0")return`${I}=${Z}:${parseInt(b)+1}`;return B})}function lB(){if(k.env.NO_COLOR||k.env.FORCE_COLOR==="0"||k.env.FORCE_COLOR==="false")return!1;if(k.env.FORCE_COLOR||k.env.CLICOLOR_FORCE!==void 0)return!0;return}JV.Command=mB;JV.useColor=lB});var wZ=NG((QV)=>{var{Argument:jZ}=eG(),{Command:pB}=NZ(),{CommanderError:KV,InvalidArgumentError:UZ}=uG(),{Help:zV}=cB(),{Option:LZ}=fB();QV.program=new pB;QV.createCommand=(G)=>new pB(G);QV.createOption=(G,B)=>new LZ(G,B);QV.createArgument=(G,B)=>new jZ(G,B);QV.Command=pB;QV.Option=LZ;QV.Argument=jZ;QV.Help=zV;QV.CommanderError=KV;QV.InvalidArgumentError=UZ;QV.InvalidOptionArgumentError=UZ});var SZ=NG((bG,AZ)=>{var XG=wZ();bG=AZ.exports={};bG.program=new XG.Command;bG.Argument=XG.Argument;bG.Command=XG.Command;bG.CommanderError=XG.CommanderError;bG.Help=XG.Help;bG.InvalidArgumentError=XG.InvalidArgumentError;bG.InvalidOptionArgumentError=XG.InvalidArgumentError;bG.Option=XG.Option;bG.createCommand=(G)=>new XG.Command(G);bG.createOption=(G,B)=>new XG.Option(G,B);bG.createArgument=(G,B)=>new XG.Argument(G,B)});var nZ={};EV(nZ,{runClaudinStartupMigrations:()=>rV});function aV(G){return pV.filter((B)=>G[B])}function iV(G){let B=G.profile;switch(B){case"gemini":{let I=G.env.GEMINI_BASE_URL??GI,Z=G.env.GEMINI_MODEL??BI;return{provider:"gemini",name:"Google Gemini (legacy)",baseUrl:I,model:Z,apiKey:G.env.GEMINI_API_KEY??G.env.GOOGLE_API_KEY??""}}case"mistral":return{provider:"mistral",name:"Mistral (legacy)",baseUrl:G.env.MISTRAL_BASE_URL??II,model:G.env.MISTRAL_MODEL??ZI,apiKey:G.env.MISTRAL_API_KEY??""};case"codex":case"openai":case"ollama":case"atomic-chat":case"nvidia-nim":case"minimax":{let I=G.env.OPENAI_BASE_URL?.trim(),Z=G.env.OPENAI_MODEL?.trim();if(!I||!Z)return null;return{provider:"openai",name:sV(B),baseUrl:I,model:Z,apiKey:G.env.OPENAI_API_KEY??""}}default:return null}}function sV(G){switch(G){case"codex":return"Codex (legacy)";case"openai":return"OpenAI (legacy)";case"ollama":return"Ollama (legacy)";case"atomic-chat":return"Atomic Chat (legacy)";case"nvidia-nim":return"NVIDIA NIM (legacy)";case"minimax":return"MiniMax (legacy)";case"gemini":return"Google Gemini (legacy)";case"mistral":return"Mistral (legacy)"}}function nV(G){if(G.CLAUDE_CODE_USE_OPENAI){let B=G.OPENAI_BASE_URL?.trim()??G.OPENAI_API_BASE?.trim(),I=G.OPENAI_MODEL?.trim();if(!B||!I)return null;return{input:{provider:"openai",name:"OpenAI (env)",baseUrl:B,model:I,apiKey:G.OPENAI_API_KEY??""}}}if(G.CLAUDE_CODE_USE_GEMINI)return{input:{provider:"gemini",name:"Google Gemini (env)",baseUrl:G.GEMINI_BASE_URL?.trim()??GI,model:G.GEMINI_MODEL?.trim()??BI,apiKey:G.GEMINI_API_KEY??G.GOOGLE_API_KEY??""}};if(G.CLAUDE_CODE_USE_MISTRAL)return{input:{provider:"mistral",name:"Mistral (env)",baseUrl:G.MISTRAL_BASE_URL?.trim()??II,model:G.MISTRAL_MODEL?.trim()??ZI,apiKey:G.MISTRAL_API_KEY??""}};if(G.CLAUDE_CODE_USE_GITHUB){let B=G.GITHUB_TOKEN?.trim()??G.GH_TOKEN?.trim()??"";return{input:{provider:"openai",name:"GitHub Copilot (legacy env)",baseUrl:fV,model:uV,apiKey:"",extras:B?{githubToken:B}:void 0}}}if(G.CLAUDE_CODE_USE_BEDROCK){let B=G.AWS_REGION?.trim()??G.AWS_DEFAULT_REGION?.trim()??dV;return{input:{provider:"bedrock",name:"AWS Bedrock (legacy env)",baseUrl:`https://bedrock-runtime.${B}.amazonaws.com`,model:tB,extras:{awsRegion:B}}}}if(G.CLAUDE_CODE_USE_VERTEX){let B=G.GCLOUD_PROJECT?.trim()??G.GOOGLE_CLOUD_PROJECT?.trim()??G.ANTHROPIC_VERTEX_PROJECT_ID?.trim(),I=G.CLOUD_ML_REGION?.trim()??lV,Z={gcpRegion:I};if(B)Z.gcpProject=B;return{input:{provider:"vertex",name:"Google Vertex AI (legacy env)",baseUrl:`https://${I}-aiplatform.googleapis.com`,model:tB,extras:Z}}}if(G.CLAUDE_CODE_USE_FOUNDRY)return{input:{provider:"foundry",name:"Azure AI Foundry (legacy env)",baseUrl:mV,model:tB},warning:"Profile created from CLAUDE_CODE_USE_FOUNDRY but azureResource missing — open /provider to complete"};return null}function rV(G){let B=G?.processEnv??process.env,I=G?.log??tV,Z={legacyProfileMigrated:!1,envsIgnored:[],notices:[]},b=iZ();if(b){let W=iV(b);if(W&&!oB()){if(eB(W,{makeActive:!0})){Z.legacyProfileMigrated=!0;let H="migrated legacy .claudin-profile.json to providerProfiles[]";Z.notices.push(H),I(H)}}sZ()}let Y=aV(B);if(Y.length>0)if(!oB()){let X=nV(B);if(X){let H=eB(X.input,{makeActive:!0});if(H){Z.rescueEnvAdoptedAs=H.name;let V=`migrated env-based config to /provider as "${H.name}"`;if(Z.notices.push(V),I(V),X.warning)Z.notices.push(X.warning),I(X.warning)}}}else{Z.envsIgnored=Y;let X=`ignoring ${Y.join(", ")} — managed by /provider`;Z.notices.push(X),I(X)}return Z}function tV(G){process.stderr.write(`\x1B[33m${G}\x1B[0m
|
|
27
|
+
`)}var fV="https://models.github.ai/inference",uV="github:copilot",dV="us-east-1",lV="us-east5",tB="claude-sonnet-4-6",mV="https://YOUR-RESOURCE-NAME.services.ai.azure.com",pV;var rZ=_V(()=>{cV();OV();pV=["CLAUDE_CODE_USE_OPENAI","CLAUDE_CODE_USE_GEMINI","CLAUDE_CODE_USE_MISTRAL","CLAUDE_CODE_USE_GITHUB","CLAUDE_CODE_USE_BEDROCK","CLAUDE_CODE_USE_VERTEX","CLAUDE_CODE_USE_FOUNDRY"]});oZ();eC();Bb();var qZ=MZ(SZ(),1),{program:dH,createCommand:lH,createArgument:mH,createOption:pH,CommanderError:aH,InvalidArgumentError:kZ,InvalidOptionArgumentError:iH,Command:hZ,Argument:sH,Option:N,Help:nH}=qZ.default;BB();var aB,iB;function $Z(G,B){aB=G,iB=B}async function yG(G,B,I,Z){let b=aB??import("./App-0.5.7-k8c6xsbz.mjs"),Y=iB??import("./REPL-0.5.7-6zag11mg.mjs");aB=void 0,iB=void 0;let[{App:W},{REPL:X}]=await Promise.all([b,Y]);await Z(G,HG(W,{...B,children:HG(X,{...I})}))}RH();ob();zW();JG();jG();FG();sB();import{posix as xZ,win32 as vZ}from"path";var hV=1000,IB=new Map;function $V(){let G=process.argv[1]||"",B=process.execPath||process.argv[0]||"";if(bB()==="windows")G=G.split(vZ.sep).join(xZ.sep),B=B.split(vZ.sep).join(xZ.sep);let I=[G,B],Z=["/build-ant/","/build-external/","/build-external-native/","/build-ant-native/"];return I.some((b)=>Z.some((Y)=>b.includes(Y)))}var xV=[/MaxListenersExceededWarning.*AbortSignal/,/MaxListenersExceededWarning.*EventTarget/];function vV(G){let B=`${G.name}: ${G.message}`;return xV.some((I)=>I.test(B))}var ZB=null;function DZ(){let G=process.listeners("warning");if(ZB&&G.includes(ZB))return;if(!$V())process.removeAllListeners("warning");ZB=(I)=>{try{let Z=`${I.name}: ${I.message.slice(0,50)}`,b=IB.get(Z)||0;if(IB.has(Z)||IB.size<hV)IB.set(Z,b+1);let Y=vV(I);if(v("tengu_node_warning",{is_internal:Y?1:0,occurrence_count:b+1,classname:I.name}),VG(process.env.CLAUDE_DEBUG))T(`${Y?"[Internal Warning]":"[Warning]"} ${I.toString()}`,{level:"warn"})}catch{}},process.on("warning",ZB)}function TZ(){DZ(),process.on("exit",()=>{PZ()}),process.on("SIGINT",()=>{if(process.argv.includes("-p")||process.argv.includes("--print"))return;process.exit(0)})}FG();JW();function EZ(G){return{prompt:G.prompt,pending:{connect:G.pendingConnect,assistantChat:G.pendingAssistantChat,ssh:G.pendingSSH},disableSlashCommands:!1,taskListId:void 0,worktreeOption:void 0,worktreeName:void 0,worktreeEnabled:!1,worktreePRNumber:void 0,tmuxEnabled:!1,kairosEnabled:!1,assistantTeamContext:void 0,storedTeammateOpts:void 0,sdkUrl:void 0,effectiveIncludePartialMessages:!1,fileSpecs:void 0,fileDownloadPromise:void 0}}var YB=void 0,nB=void 0,rB=void 0;UG();async function _Z(G){return}async function OZ(){return}function cZ(G){return}function fZ(G){return}FG();IG();function DV(){if(VG(process.env.GITHUB_ACTIONS))return"github-action";if(process.env.CLAUDE_CODE_ENTRYPOINT==="sdk-ts")return"sdk-typescript";if(process.env.CLAUDE_CODE_ENTRYPOINT==="sdk-py")return"sdk-python";if(process.env.CLAUDE_CODE_ENTRYPOINT==="sdk-cli")return"sdk-cli";if(process.env.CLAUDE_CODE_ENTRYPOINT==="claude-vscode")return"claude-vscode";if(process.env.CLAUDE_CODE_ENTRYPOINT==="local-agent")return"local-agent";if(process.env.CLAUDE_CODE_ENTRYPOINT==="claude-desktop")return"claude-desktop";let G=process.env.CLAUDE_CODE_SESSION_ACCESS_TOKEN||process.env.CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTOR;if(process.env.CLAUDE_CODE_ENTRYPOINT==="remote"||G)return"remote";return"cli"}function PV(G){let B=process.env.CLAUDE_CODE_QUESTION_PREVIEW_FORMAT;if(B==="markdown"||B==="html")return B;if(!G.startsWith("sdk-")&&G!=="claude-desktop"&&G!=="local-agent"&&G!=="remote")return"markdown";return}function TV(){let G=process.argv.slice(2),B=G.includes("-p")||G.includes("--print"),I=G.includes("--init-only"),Z=G.some((Y)=>Y.startsWith("--sdk-url"));return!(B||I||Z||!process.stdout.isTTY)}function pZ(){let G=DV(),B=PV(G),I=process.env.CLAUDE_CODE_ENVIRONMENT_KIND==="bridge"?"remote-control":void 0,Z=TV();return{clientType:G,previewFormat:B,sessionSource:I,isInteractive:Z}}function aZ(G){if(dZ(G.clientType),G.previewFormat!==void 0)mZ(G.previewFormat);if(G.sessionSource!==void 0)lZ(G.sessionSource);uZ(G.isInteractive)}IG();bI();bb();jG();FG();eV();Bb();oV();oZ();function Xb(G){return G.hook("preAction",async(B)=>{if(await Promise.all([eZ(),Gb()]),await XB(),M("preAction_after_init"),!VG(process.env.CLAUDE_CODE_DISABLE_TERMINAL_TITLE))process.title="claudin";let{initSinks:I}=await import("./sinks-0.5.7-feq030bq.mjs");I(),M("preAction_after_sinks");let Z=B.getOptionValue("pluginDir");if(Array.isArray(Z)&&Z.length>0&&Z.every((b)=>typeof b==="string"))tZ(Z),Yb("preAction: --plugin-dir inline plugins");Wb(),M("preAction_after_migrations");try{let{runClaudinStartupMigrations:b}=(rZ(),s(nZ));b()}catch(b){T(`[startup-migrations] failed: ${b instanceof Error?b.message:String(b)}`)}M("preAction_after_claudin_migrations"),Zb(),Ib(),M("preAction_after_remote_settings"),M("preAction_after_settings_sync")}),G}YI();function Vb(G){if(G.option("-w, --worktree [name]","Create a new git worktree for this session (optionally specify a name)"),G.option("--tmux","Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux."),dG())G.addOption(new N("--advisor <model>","Enable the server-side advisor tool with the specified model (alias or full ID).").hideHelp());return G.addOption(new N("--enable-auto-mode","Opt in to auto mode").hideHelp()),G.addOption(new N("--agent-id <id>","Teammate agent ID").hideHelp()),G.addOption(new N("--agent-name <name>","Teammate display name").hideHelp()),G.addOption(new N("--team-name <name>","Team name for swarm coordination").hideHelp()),G.addOption(new N("--agent-color <color>","Teammate UI color").hideHelp()),G.addOption(new N("--plan-mode-required","Require plan mode before implementation").hideHelp()),G.addOption(new N("--parent-session-id <id>","Parent session ID for analytics correlation").hideHelp()),G.addOption(new N("--teammate-mode <mode>",'How to spawn teammates: "tmux", "in-process", or "auto"').choices(["auto","tmux","in-process"]).hideHelp()),G.addOption(new N("--agent-type <type>","Custom agent type for this teammate").hideHelp()),G.addOption(new N("--sdk-url <url>","Use remote WebSocket endpoint for SDK I/O streaming (only with -p and stream-json format)").hideHelp()),G.addOption(new N("--teleport [session]","Resume a teleport session, optionally specify session ID").hideHelp()),G.addOption(new N("--remote [description]","Create a remote session with the given description").hideHelp()),G}function Cb(G){G.command("agents").description("List configured agents").option("--setting-sources <sources>","Comma-separated list of setting sources to load (user, project, local).").action(async()=>{let{agentsHandler:B}=await import("./agents-0.5.7-q2vtj7pt.mjs");await B(),process.exit(0)})}function Hb(G){}var yb=(G)=>G.long?.replace(/^--/,"")??G.short?.replace(/^-/,"")??"";function MG(){return Object.assign({sortSubcommands:!0,sortOptions:!0},{compareOptions:(G,B)=>yb(G).localeCompare(yb(B))})}function Jb(G){let B=G.command("auth").description("Manage authentication").configureHelp(MG());B.command("login").description("Sign in to your Anthropic account").option("--email <email>","Pre-populate email address on the login page").option("--sso","Force SSO login flow").option("--console","Use Anthropic Console (API usage billing) instead of Claude subscription").option("--claudeai","Use Claude subscription (default)").action(async({email:I,sso:Z,console:b,claudeai:Y})=>{let{authLogin:W}=await import("./auth-0.5.7-khssh83t.mjs");await W({email:I,sso:Z,console:b,claudeai:Y})}),B.command("status").description("Show authentication status").option("--json","Output as JSON (default)").option("--text","Output as human-readable text").action(async(I)=>{let{authStatus:Z}=await import("./auth-0.5.7-khssh83t.mjs");await Z(I)}),B.command("logout").description("Log out from your Anthropic account").action(async()=>{let{authLogout:I}=await import("./auth-0.5.7-khssh83t.mjs");await I()})}gb();function Kb(G){if(Rb()!=="disabled"){let B=G.command("auto-mode").description("Inspect auto mode classifier configuration");B.command("defaults").description("Print the default auto mode environment, allow, and deny rules as JSON").action(async()=>{let{autoModeDefaultsHandler:I}=await import("./autoMode-0.5.7-ezn856pd.mjs");I(),process.exit(0)}),B.command("config").description("Print the effective auto mode config as JSON: your settings where set, defaults otherwise").action(async()=>{let{autoModeConfigHandler:I}=await import("./autoMode-0.5.7-ezn856pd.mjs");I(),process.exit(0)}),B.command("critique").description("Get AI feedback on your custom auto mode rules").option("--model <model>","Override which model is used").action(async(I)=>{let{autoModeCritiqueHandler:Z}=await import("./autoMode-0.5.7-ezn856pd.mjs");await Z(I),process.exit()})}}zb();function Qb(G){G.command("doctor").description("Check the health of your Claude Code auto-updater. Note: The workspace trust dialog is skipped and stdio servers from .mcp.json are spawned for health checks. Only use this command in directories you trust.").action(async()=>{let[{doctorHandler:B},{createRoot:I}]=await Promise.all([import("./util-0.5.7-tpzcah5j.mjs"),import("./ink-0.5.7-dwmx157s.mjs")]),Z=await I(VB(!1));await B(Z)})}function Fb(G){G.command("install [target]").description("Install Claude Code native build. Use [target] to specify version (stable, latest, or specific version)").option("--force","Force installation even if already installed").action(async(B,I)=>{let{installHandler:Z}=await import("./util-0.5.7-tpzcah5j.mjs");await Z(B,I)})}JG();B0();jb();G0();CI();FG();mG();function Ab(G){G.command("add <name> <commandOrUrl> [args...]").description(`Add an MCP server to Claude Code.
|
|
28
|
+
|
|
29
|
+
Examples:
|
|
30
|
+
# Add HTTP server:
|
|
31
|
+
claude mcp add --transport http sentry https://mcp.sentry.dev/mcp
|
|
32
|
+
|
|
33
|
+
# Add HTTP server with headers:
|
|
34
|
+
claude mcp add --transport http corridor https://app.corridor.dev/api/mcp --header "Authorization: Bearer ..."
|
|
35
|
+
|
|
36
|
+
# Add stdio server with environment variables:
|
|
37
|
+
claude mcp add -e API_KEY=xxx my-server -- npx my-mcp-server
|
|
38
|
+
|
|
39
|
+
# Add stdio server with subprocess flags:
|
|
40
|
+
claude mcp add my-server -- my-command --some-flag arg1`).option("-s, --scope <scope>","Configuration scope (local, user, or project)","local").option("-t, --transport <transport>","Transport type (stdio, sse, http). Defaults to stdio if not specified.").option("-e, --env <env...>","Set environment variables (e.g. -e KEY=value)").option("-H, --header <header...>",'Set WebSocket headers (e.g. -H "X-Api-Key: abc123" -H "X-Custom: value")').option("--client-id <clientId>","OAuth client ID for HTTP/SSE servers").option("--client-secret","Prompt for OAuth client secret (or set MCP_CLIENT_SECRET env var)").option("--callback-port <port>","Fixed port for OAuth callback (for servers requiring pre-registered redirect URIs)").helpOption("-h, --help","Display help for command").addOption(new N("--xaa","Enable XAA (SEP-990) for this server. Requires 'claude mcp xaa setup' first. Also requires --client-id and --client-secret (for the MCP server's AS).").hideHelp(!lG())).action(async(B,I,Z,b)=>{let Y=I,W=Z;if(!B)n(`Error: Server name is required.
|
|
41
|
+
Usage: claude mcp add <name> <command> [args...]`);else if(!Y)n(`Error: Command is required when server name is provided.
|
|
42
|
+
Usage: claude mcp add <name> <command> [args...]`);try{let X=Lb(b.scope),H=wb(b.transport);if(b.xaa&&!lG())n("Error: --xaa requires CLAUDE_CODE_ENABLE_XAA=1 in your environment");let V=Boolean(b.xaa);if(V){let R=[];if(!b.clientId)R.push("--client-id");if(!b.clientSecret)R.push("--client-secret");if(!qG())R.push("'claude mcp xaa setup' (settings.xaaIdp not configured)");if(R.length)n(`Error: --xaa requires: ${R.join(", ")}`)}let C=b.transport!==void 0,y=Y.startsWith("http://")||Y.startsWith("https://")||Y.startsWith("localhost")||Y.endsWith("/sse")||Y.endsWith("/mcp");if(v("tengu_mcp_add",{type:H,scope:X,source:"command",transport:H,transportExplicit:C,looksLikeUrl:y}),H==="sse"){if(!Y)n("Error: URL is required for SSE transport.");let R=b.header?WI(b.header):void 0,g=b.callbackPort?parseInt(b.callbackPort,10):void 0,z=b.clientId||g||V?{...b.clientId?{clientId:b.clientId}:{},...g?{callbackPort:g}:{},...V?{xaa:!0}:{}}:void 0,j=b.clientSecret&&b.clientId?await XI():void 0,L={type:"sse",url:Y,headers:R,oauth:z};if(await CB(B,L,X),j)VI(B,L,j);if(process.stdout.write(`Added SSE MCP server ${B} with URL: ${Y} to ${X} config
|
|
43
|
+
`),R)process.stdout.write(`Headers: ${CG(R,null,2)}
|
|
44
|
+
`)}else if(H==="http"){if(!Y)n("Error: URL is required for HTTP transport.");let R=b.header?WI(b.header):void 0,g=b.callbackPort?parseInt(b.callbackPort,10):void 0,z=b.clientId||g||V?{...b.clientId?{clientId:b.clientId}:{},...g?{callbackPort:g}:{},...V?{xaa:!0}:{}}:void 0,j=b.clientSecret&&b.clientId?await XI():void 0,L={type:"http",url:Y,headers:R,oauth:z};if(await CB(B,L,X),j)VI(B,L,j);if(process.stdout.write(`Added HTTP MCP server ${B} with URL: ${Y} to ${X} config
|
|
45
|
+
`),R)process.stdout.write(`Headers: ${CG(R,null,2)}
|
|
46
|
+
`)}else{if(b.clientId||b.clientSecret||b.callbackPort||b.xaa)process.stderr.write(`Warning: --client-id, --client-secret, --callback-port, and --xaa are only supported for HTTP/SSE transports and will be ignored for stdio.
|
|
47
|
+
`);if(!C&&y)process.stderr.write(`
|
|
48
|
+
Warning: The command "${Y}" looks like a URL, but is being interpreted as a stdio server as --transport was not specified.
|
|
49
|
+
`),process.stderr.write(`If this is an HTTP server, use: claude mcp add --transport http ${B} ${Y}
|
|
50
|
+
`),process.stderr.write(`If this is an SSE server, use: claude mcp add --transport sse ${B} ${Y}
|
|
51
|
+
`);let R=Nb(b.env);await CB(B,{type:"stdio",command:Y,args:W,env:R},X),process.stdout.write(`Added stdio MCP server ${B} with command: ${Y} ${W.join(" ")} to ${X} config
|
|
52
|
+
`)}RG(`File modified: ${Ub(X)}`)}catch(X){n(X.message)}})}function Sb(G){G.command("doctor [name]").description("Diagnose MCP configuration, precedence, disabled/pending state, and connection health. Note: unless --config-only is used, stdio servers may be spawned and remote servers may be contacted. Only use this command in directories you trust.").option("-s, --scope <scope>","Restrict config analysis to a specific scope (local, project, user, or enterprise)").option("--config-only","Skip live connection checks and only analyze configuration state").option("--json","Output the diagnostics report as JSON").action(async(B,I)=>{let{mcpDoctorHandler:Z}=await import("./mcp-0.5.7-n62qd49c.mjs");await Z(B,I)})}CI();kG();yB();function hb(G){let B=G.command("xaa").description("Manage the XAA (SEP-990) IdP connection");B.command("setup").description("Configure the IdP connection (one-time setup for all XAA-enabled servers)").requiredOption("--issuer <url>","IdP issuer URL (OIDC discovery)").requiredOption("--client-id <id>","Claude Code's client_id at the IdP").option("--client-secret","Read IdP client secret from MCP_XAA_IDP_CLIENT_SECRET env var").option("--callback-port <port>","Fixed loopback callback port (only if IdP does not honor RFC 8252 port-any matching)").action((I)=>{let Z;try{Z=new URL(I.issuer)}catch{return n(`Error: --issuer must be a valid URL (got "${I.issuer}")`)}if(Z.protocol!=="https:"&&!(Z.protocol==="http:"&&(Z.hostname==="localhost"||Z.hostname==="127.0.0.1"||Z.hostname==="[::1]")))return n(`Error: --issuer must use https:// (got "${Z.protocol}//${Z.host}")`);let b=I.callbackPort?parseInt(I.callbackPort,10):void 0;if(b!==void 0&&(!Number.isInteger(b)||b<=0))return n("Error: --callback-port must be a positive integer");let Y=I.clientSecret?process.env.MCP_XAA_IDP_CLIENT_SECRET:void 0;if(I.clientSecret&&!Y)return n("Error: --client-secret requires MCP_XAA_IDP_CLIENT_SECRET env var");let W=qG(),X=W?.issuer,H=W?.clientId,{error:V}=HI("userSettings",{xaaIdp:{issuer:I.issuer,clientId:I.clientId,callbackPort:b}});if(V)return n(`Error writing settings: ${V.message}`);if(X){if(yI(X)!==yI(I.issuer))pG(X),HB(X);else if(H!==I.clientId)pG(X),HB(X)}if(Y){let{success:C,warning:y}=qb(I.issuer,Y);if(!C)return n(`Error: settings written but keychain save failed${y?` — ${y}`:""}. Re-run with --client-secret once keychain is available.`)}RG(`XAA IdP connection configured for ${I.issuer}`)}),B.command("login").description("Cache an IdP id_token so XAA-enabled MCP servers authenticate silently. Default: run the OIDC browser login. With --id-token: write a pre-obtained JWT directly (used by conformance/e2e tests where the mock IdP does not serve /authorize).").option("--force","Ignore any cached id_token and re-login (useful after IdP-side revocation)").option("--id-token <jwt>","Write this pre-obtained id_token directly to cache, skipping the OIDC browser login").action(async(I)=>{let Z=qG();if(!Z)return n("Error: no XAA IdP connection. Run 'claude mcp xaa setup' first.");if(I.idToken){let Y=Mb(Z.issuer,I.idToken);return RG(`id_token cached for ${Z.issuer} (expires ${new Date(Y).toISOString()})`)}if(I.force)pG(Z.issuer);if(JI(Z.issuer)!==void 0)return RG(`Already logged in to ${Z.issuer} (cached id_token still valid). Use --force to re-login.`);process.stdout.write(`Opening browser for IdP login at ${Z.issuer}…
|
|
53
|
+
`);try{await kb({idpIssuer:Z.issuer,idpClientId:Z.clientId,idpClientSecret:RI(Z.issuer),callbackPort:Z.callbackPort,onAuthorizationUrl:(Y)=>{process.stdout.write(`If the browser did not open, visit:
|
|
54
|
+
${Y}
|
|
55
|
+
`)}}),RG("Logged in. MCP servers with --xaa will now authenticate silently.")}catch(Y){n(`IdP login failed: ${GG(Y)}`)}}),B.command("show").description("Show the current IdP connection config").action(()=>{let I=qG();if(!I)return RG("No XAA IdP connection configured.");let Z=RI(I.issuer)!==void 0,b=JI(I.issuer)!==void 0;if(process.stdout.write(`Issuer: ${I.issuer}
|
|
56
|
+
`),process.stdout.write(`Client ID: ${I.clientId}
|
|
57
|
+
`),I.callbackPort!==void 0)process.stdout.write(`Callback port: ${I.callbackPort}
|
|
58
|
+
`);process.stdout.write(`Client secret: ${Z?"(stored in keychain)":"(not set — PKCE-only)"}
|
|
59
|
+
`),process.stdout.write(`Logged in: ${b?"yes (id_token cached)":"no — run 'claude mcp xaa login'"}
|
|
60
|
+
`),RG()}),B.command("clear").description("Clear the IdP connection config and cached id_token").action(()=>{let I=qG(),{error:Z}=HI("userSettings",{xaaIdp:void 0});if(Z)return n(`Error writing settings: ${Z.message}`);if(I)pG(I.issuer),HB(I.issuer);RG("XAA IdP connection cleared")})}CI();function $b(G){let B=G.command("mcp").description("Configure and manage MCP servers").configureHelp(MG()).enablePositionalOptions();if(B.command("serve").description("Start the Claude Code MCP server").option("-d, --debug","Enable debug mode",()=>!0).option("--verbose","Override verbose mode setting from config",()=>!0).action(async({debug:I,verbose:Z})=>{let{mcpServeHandler:b}=await import("./mcp-0.5.7-n62qd49c.mjs");await b({debug:I,verbose:Z})}),Ab(B),Sb(B),lG())hb(B);B.command("remove <name>").description("Remove an MCP server").option("-s, --scope <scope>","Configuration scope (local, user, or project) - if not specified, removes from whichever scope it exists in").action(async(I,Z)=>{let{mcpRemoveHandler:b}=await import("./mcp-0.5.7-n62qd49c.mjs");await b(I,Z)}),B.command("list").description("List configured MCP servers. Note: The workspace trust dialog is skipped and stdio servers from .mcp.json are spawned for health checks. Only use this command in directories you trust.").action(async()=>{let{mcpListHandler:I}=await import("./mcp-0.5.7-n62qd49c.mjs");await I()}),B.command("get <name>").description("Get details about an MCP server. Note: The workspace trust dialog is skipped and stdio servers from .mcp.json are spawned for health checks. Only use this command in directories you trust.").action(async(I)=>{let{mcpGetHandler:Z}=await import("./mcp-0.5.7-n62qd49c.mjs");await Z(I)}),B.command("add-json <name> <json>").description("Add an MCP server (stdio or SSE) with a JSON string").option("-s, --scope <scope>","Configuration scope (local, user, or project)","local").option("--client-secret","Prompt for OAuth client secret (or set MCP_CLIENT_SECRET env var)").action(async(I,Z,b)=>{let{mcpAddJsonHandler:Y}=await import("./mcp-0.5.7-n62qd49c.mjs");await Y(I,Z,b)}),B.command("add-from-claude-desktop").description("Import MCP servers from Claude Desktop (Mac and WSL only)").option("-s, --scope <scope>","Configuration scope (local, user, or project)","local").action(async(I)=>{let{mcpAddFromDesktopHandler:Z}=await import("./mcp-0.5.7-n62qd49c.mjs");await Z(I)}),B.command("reset-project-choices").description("Reset all approved and rejected project-scoped (.mcp.json) servers within this project").action(async()=>{let{mcpResetChoicesHandler:I}=await import("./mcp-0.5.7-n62qd49c.mjs");await I()})}IG();kG();mG();gI();xb();var I0=aG(()=>r.object({session_id:r.string(),ws_url:r.string(),work_dir:r.string().optional()}));function vb(G,B){}function Pb(G){let B=()=>new N("--cowork","Use cowork_plugins directory").hideHelp(),I=G.command("plugin").alias("plugins").description("Manage Claude Code plugins").configureHelp(MG());I.command("validate <path>").description("Validate a plugin or marketplace manifest").addOption(B()).action(async(b,Y)=>{let{pluginValidateHandler:W}=await import("./plugins-0.5.7-2ehzph1a.mjs");await W(b,Y)}),I.command("list").description("List installed plugins").option("--json","Output as JSON").option("--available","Include available plugins from marketplaces (requires --json)").addOption(B()).action(async(b)=>{let{pluginListHandler:Y}=await import("./plugins-0.5.7-2ehzph1a.mjs");await Y(b)});let Z=I.command("marketplace").description("Manage Claude Code marketplaces").configureHelp(MG());Z.command("add <source>").description("Add a marketplace from a URL, path, or GitHub repo").addOption(B()).option("--sparse <paths...>","Limit checkout to specific directories via git sparse-checkout (for monorepos). Example: --sparse .claude-plugin plugins").option("--scope <scope>","Where to declare the marketplace: user (default), project, or local").action(async(b,Y)=>{let{marketplaceAddHandler:W}=await import("./plugins-0.5.7-2ehzph1a.mjs");await W(b,Y)}),Z.command("list").description("List all configured marketplaces").option("--json","Output as JSON").addOption(B()).action(async(b)=>{let{marketplaceListHandler:Y}=await import("./plugins-0.5.7-2ehzph1a.mjs");await Y(b)}),Z.command("remove <name>").alias("rm").description("Remove a configured marketplace").addOption(B()).action(async(b,Y)=>{let{marketplaceRemoveHandler:W}=await import("./plugins-0.5.7-2ehzph1a.mjs");await W(b,Y)}),Z.command("update [name]").description("Update marketplace(s) from their source - updates all if no name specified").addOption(B()).action(async(b,Y)=>{let{marketplaceUpdateHandler:W}=await import("./plugins-0.5.7-2ehzph1a.mjs");await W(b,Y)}),I.command("install <plugin>").alias("i").description("Install a plugin from available marketplaces (use plugin@marketplace for specific marketplace)").option("-s, --scope <scope>","Installation scope: user, project, or local","user").addOption(B()).action(async(b,Y)=>{let{pluginInstallHandler:W}=await import("./plugins-0.5.7-2ehzph1a.mjs");await W(b,Y)}),I.command("uninstall <plugin>").alias("remove").alias("rm").description("Uninstall an installed plugin").option("-s, --scope <scope>","Uninstall from scope: user, project, or local","user").option("--keep-data","Preserve the plugin's persistent data directory (~/.claudin/plugins/data/{id}/)").addOption(B()).action(async(b,Y)=>{let{pluginUninstallHandler:W}=await import("./plugins-0.5.7-2ehzph1a.mjs");await W(b,Y)}),I.command("enable <plugin>").description("Enable a disabled plugin").option("-s, --scope <scope>",`Installation scope: ${KI.join(", ")} (default: auto-detect)`).addOption(B()).action(async(b,Y)=>{let{pluginEnableHandler:W}=await import("./plugins-0.5.7-2ehzph1a.mjs");await W(b,Y)}),I.command("disable [plugin]").description("Disable an enabled plugin").option("-a, --all","Disable all enabled plugins").option("-s, --scope <scope>",`Installation scope: ${KI.join(", ")} (default: auto-detect)`).addOption(B()).action(async(b,Y)=>{let{pluginDisableHandler:W}=await import("./plugins-0.5.7-2ehzph1a.mjs");await W(b,Y)}),I.command("update <plugin>").description("Update a plugin to the latest version (restart required to apply)").option("-s, --scope <scope>",`Installation scope: ${Db.join(", ")} (default: user)`).addOption(B()).action(async(b,Y)=>{let{pluginUpdateHandler:W}=await import("./plugins-0.5.7-2ehzph1a.mjs");await W(b,Y)})}function Tb(G){}function Eb(G){}zb();function _b(G){G.command("setup-token").description("Set up a long-lived authentication token (requires Claude subscription)").action(async()=>{let[{setupTokenHandler:B},{createRoot:I}]=await Promise.all([import("./util-0.5.7-tpzcah5j.mjs"),import("./ink-0.5.7-dwmx157s.mjs")]),Z=await I(VB(!1));await B(Z)})}function Ob(G){}function cb(G){G.command("update").alias("upgrade").description("Check for updates and install if available").action(async()=>{let{update:B}=await import("./update-0.5.7-2jgnt5gj.mjs");await B()})}function fb(G,B){return $b(G),Eb(G),Ob(G),vb(G,B.pendingConnect),Jb(G),Pb(G),_b(G),Cb(G),Kb(G),Tb(G),Hb(G),Qb(G),cb(G),Fb(G),G}gB();Z0();IG();V0();pb();JG();FI();mb();ob();FG();kG();X0();sB();b0();KB();NI();Y0();W0();import{readFileSync as ub}from"fs";import{resolve as JB}from"path";async function ZY(G,B,I,Z){let{teammate:b,assistant:Y}=Z,W=G;if(B.bare)process.env.CLAUDE_CODE_SIMPLE="1";if(W==="code")v("tengu_code_prompt_ignored",{}),console.warn(x.yellow("Tip: You can launch Claude Code with just `claude`")),W=void 0;if(W&&typeof W==="string"&&!/\s/.test(W)&&W.length>0)v("tengu_single_word_prompt",{length:W.length});let{debug:X=!1,debugToStderr:H=!1,dangerouslySkipPermissions:V,allowDangerouslySkipPermissions:C=!1,tools:y=[],allowedTools:R=[],disallowedTools:g=[],mcpConfig:z=[],permissionMode:j,addDir:L=[],fallbackModel:w,betas:Q=[],ide:q=!1,sessionId:E,includeHookEvents:c,includePartialMessages:f}=B;if(B.prefill)tb(B.prefill);let{agents:U,agent:h,outputFormat:F,inputFormat:S}=B,m=B.verbose??hG().verbose,$=B.print,p=B.init??!1,d=B.initOnly??!1,_=B.maintenance??!1;if(I.disableSlashCommands=B.disableSlashCommands||!1,I.taskListId=void 0,I.worktreeOption=QI()?B.worktree:void 0,I.worktreeName=typeof I.worktreeOption==="string"?I.worktreeOption:void 0,I.worktreeEnabled=I.worktreeOption!==void 0,I.worktreeName){let K=sb(I.worktreeName);if(K!==null)I.worktreePRNumber=K,I.worktreeName=void 0}if(I.tmuxEnabled=QI()&&B.tmux===!0,I.tmuxEnabled){if(!I.worktreeEnabled)process.stderr.write(x.red(`Error: --tmux requires --worktree
|
|
61
|
+
`)),process.exit(1);if(bB()==="windows")process.stderr.write(x.red(`Error: --tmux is not supported on Windows
|
|
62
|
+
`)),process.exit(1);if(!await nb())process.stderr.write(x.red(`Error: tmux is not installed.
|
|
63
|
+
${rb()}
|
|
64
|
+
`)),process.exit(1)}if(LG()){let K=IY(B);I.storedTeammateOpts=K;let t=K.agentId||K.agentName||K.teamName,a=K.agentId&&K.agentName&&K.teamName;if(t&&!a)process.stderr.write(x.red(`Error: --agent-id, --agent-name, and --team-name must all be provided together
|
|
65
|
+
`)),process.exit(1);if(K.agentId&&K.agentName&&K.teamName)b.getTeammateUtils().setDynamicTeamContext?.({agentId:K.agentId,agentName:K.agentName,teamName:K.teamName,color:K.agentColor,planModeRequired:K.planModeRequired??!1,parentSessionId:K.parentSessionId});if(K.teammateMode)b.getTeammateModeSnapshot().setCliTeammateModeOverride?.(K.teammateMode)}if(I.sdkUrl=B.sdkUrl??void 0,I.effectiveIncludePartialMessages=!!f||VG(process.env.CLAUDE_CODE_INCLUDE_PARTIAL_MESSAGES),c||VG(process.env.CLAUDE_CODE_REMOTE))eb(!0);if(I.sdkUrl){if(!S)S="stream-json";if(!F)F="stream-json";if(B.verbose===void 0)m=!0;if(!B.print)$=!0}let A=B.teleport??null,D=B.remote,O=D===!0?"":D??null,l=B.remoteControl??B.rc,BG=typeof l==="string"&&l.length>0?l:void 0;if(E){if((B.continue||B.resume)&&!B.forkSession)process.stderr.write(x.red(`Error: --session-id can only be used with --continue or --resume if --fork-session is also specified.
|
|
66
|
+
`)),process.exit(1);if(!I.sdkUrl){let K=PG(E);if(!K)process.stderr.write(x.red(`Error: Invalid session ID. Must be a valid UUID.
|
|
67
|
+
`)),process.exit(1);if(ab(K))process.stderr.write(x.red(`Error: Session ID ${K} is already in use.
|
|
68
|
+
`)),process.exit(1)}}if(I.fileSpecs=B.file,I.fileSpecs&&I.fileSpecs.length>0){let K=ib();if(!K)process.stderr.write(x.red(`Error: Session token required for file downloads. CLAUDE_CODE_SESSION_ACCESS_TOKEN must be set.
|
|
69
|
+
`)),process.exit(1);let t=process.env.CLAUDE_CODE_REMOTE_SESSION_ID||db(),a=BY(I.fileSpecs);if(a.length>0){let vB={baseUrl:(DG()?.transport==="anthropic"?DG()?.baseUrl:void 0)||lb().BASE_API_URL,oauthToken:K,sessionId:t};I.fileDownloadPromise=GY(a,vB)}}let u=RB();if(w&&B.model&&w===B.model)process.stderr.write(x.red(`Error: Fallback model cannot be the same as the main model. Please specify a different model for --fallback-model.
|
|
70
|
+
`)),process.exit(1);let P=B.systemPrompt;if(B.systemPromptFile){if(B.systemPrompt)process.stderr.write(x.red(`Error: Cannot use both --system-prompt and --system-prompt-file. Please use only one.
|
|
71
|
+
`)),process.exit(1);try{let K=JB(B.systemPromptFile);P=ub(K,"utf8")}catch(K){if(zI(K)==="ENOENT")process.stderr.write(x.red(`Error: System prompt file not found: ${JB(B.systemPromptFile)}
|
|
72
|
+
`)),process.exit(1);process.stderr.write(x.red(`Error reading system prompt file: ${GG(K)}
|
|
73
|
+
`)),process.exit(1)}}let YG=B.appendSystemPrompt;if(B.appendSystemPromptFile){if(B.appendSystemPrompt)process.stderr.write(x.red(`Error: Cannot use both --append-system-prompt and --append-system-prompt-file. Please use only one.
|
|
74
|
+
`)),process.exit(1);try{let K=JB(B.appendSystemPromptFile);YG=ub(K,"utf8")}catch(K){if(zI(K)==="ENOENT")process.stderr.write(x.red(`Error: Append system prompt file not found: ${JB(B.appendSystemPromptFile)}
|
|
75
|
+
`)),process.exit(1);process.stderr.write(x.red(`Error reading append system prompt file: ${GG(K)}
|
|
76
|
+
`)),process.exit(1)}}if(LG()&&I.storedTeammateOpts?.agentId&&I.storedTeammateOpts?.agentName&&I.storedTeammateOpts?.teamName){let K=b.getTeammatePromptAddendum().TEAMMATE_SYSTEM_PROMPT_ADDENDUM;YG=YG?`${YG}
|
|
77
|
+
|
|
78
|
+
${K}`:K}return{prompt:W,debug:X,debugToStderr:H,dangerouslySkipPermissions:V,allowDangerouslySkipPermissions:C,baseTools:y,allowedTools:R,disallowedTools:g,mcpConfig:z,permissionModeCli:j,addDir:L,fallbackModel:w,betas:Q,ide:q,sessionId:E,includeHookEvents:c,includePartialMessages:f,outputFormat:F,inputFormat:S,verbose:m,print:$,init:p,initOnly:d,maintenance:_,agentsJson:U,agentCli:h,systemPrompt:P,appendSystemPrompt:YG,teleport:A,remote:O,remoteControlOption:l,remoteControlName:BG,isNonInteractiveSession:u}}gB();y0();IG();JG();J0();jb();IG();H0();jG();FG();kG();WY();gb();sB();C0();IG();XY();import{resolve as R0}from"path";async function NY(G,B){let{options:I,ctx:Z,permissionModeCli:b,dangerouslySkipPermissions:Y,allowDangerouslySkipPermissions:W,baseTools:X,allowedTools:H,disallowedTools:V,mcpConfig:C,addDir:y,isNonInteractiveSession:R,inputFormat:g,outputFormat:z}=G,{autoModeStateModule:j}=B,{mode:L,notification:w}=yY({permissionModeCli:b,dangerouslySkipPermissions:Y});if(bY(L==="bypassPermissions"),I.enableAutoMode||b==="auto"||L==="auto"||!b&&RY())j?.setAutoModeFlagCli(!0);let Q={};if(C&&C.length>0){let d=C.map((D)=>D.trim()).filter((D)=>D.length>0),_={},A=[];for(let D of d){let O=null,l=[],BG=zB(D);if(BG){let u=zY({configObject:BG,filePath:"command line",expandVars:!0,scope:"dynamic"});if(u.config)O=u.config.mcpServers;else l=u.errors}else{let u=R0(D),P=QY({filePath:u,expandVars:!0,scope:"dynamic"});if(P.config)O=P.config.mcpServers;else l=P.errors}if(l.length>0)A.push(...l);else if(O)_={..._,...O}}if(A.length>0){let D=A.map((O)=>`${O.path?O.path+": ":""}${O.message}`).join(`
|
|
79
|
+
`);T(`--mcp-config validation failed (${A.length} errors): ${D}`,{level:"error"}),process.stderr.write(`Error: Invalid MCP configuration:
|
|
80
|
+
${D}
|
|
81
|
+
`),process.exit(1)}if(Object.keys(_).length>0){let D=Object.entries(_).filter(([,P])=>P.type!=="sdk").map(([P])=>P),O=null;if(O)process.stderr.write(`Error: ${O}
|
|
82
|
+
`),process.exit(1);let l=CY(_,(P)=>({...P,scope:"dynamic"})),{allowed:BG,blocked:u}=UI(l);if(u.length>0)process.stderr.write(`Warning: MCP ${TG(u.length,"server")} blocked by enterprise policy: ${u.join(", ")}
|
|
83
|
+
`);Q={...Q,...BG}}}let q=I.strictMcpConfig||!1;if(LI()){if(q)process.stderr.write(x.red("You cannot use --strict-mcp-config when an enterprise MCP config is present")),process.exit(1);if(Q&&!FY(Q))process.stderr.write(x.red("You cannot dynamically configure MCP servers when an enterprise MCP config is present")),process.exit(1)}YY(y);let E,c=await JY({allowedToolsCli:H,disallowedToolsCli:V,baseToolsCli:X,permissionMode:L,allowDangerouslySkipPermissions:W,addDirs:y}),f=c.toolPermissionContext,{warnings:U,dangerousPermissions:h,overlyBroadBashPermissions:F}=c;if(h.length>0)f=HY(f);U.forEach((d)=>{console.error(d)}),VY();let S=R&&!q&&!LI()&&!$G()?gY().then((d)=>{let{allowed:_,blocked:A}=UI(d);if(A.length>0)process.stderr.write(`Warning: claude.ai MCP ${TG(A.length,"server")} blocked by enterprise policy: ${A.join(", ")}
|
|
84
|
+
`);return _}):Promise.resolve({});T("[STARTUP] Loading MCP configs...");let m=Date.now(),$={current:void 0},p=(q||$G()?Promise.resolve({servers:{},errors:[]}):KY(Q)).then((d)=>{return $.current=Date.now()-m,d});if(g&&g!=="text"&&g!=="stream-json")console.error(`Error: Invalid input format "${g}".`),process.exit(1);if(g==="stream-json"&&z!=="stream-json")console.error("Error: --input-format=stream-json requires output-format=stream-json."),process.exit(1);if(Z.sdkUrl){if(g!=="stream-json"||z!=="stream-json")console.error("Error: --sdk-url requires both --input-format=stream-json and --output-format=stream-json."),process.exit(1)}if(I.replayUserMessages){if(g!=="stream-json"||z!=="stream-json")console.error("Error: --replay-user-messages requires both --input-format=stream-json and --output-format=stream-json."),process.exit(1)}if(Z.effectiveIncludePartialMessages){if(!R||z!=="stream-json")jI("Error: --include-partial-messages requires --print and --output-format=stream-json."),process.exit(1)}if(I.sessionPersistence===!1&&!R)jI("Error: --no-session-persistence can only be used with --print mode."),process.exit(1);return{permissionMode:L,permissionModeNotification:w,dynamicMcpConfig:Q,strictMcpConfig:q,devChannels:E,toolPermissionContext:f,overlyBroadBashPermissions:F,claudeaiConfigPromise:S,mcpConfigPromise:p,mcpConfigResolvedRef:$}}gB();IG();DI();zC();UW();YI();FI();JG();JW();jG();FG();WY();LB();zW();KC();gC();IG();KB();yB();NI();function jY(){}wI();MY();K0();g0();z0();AY();gG();var UY=5,LY=30,Q0=`After you finish implementing the change:
|
|
85
|
+
1. **Code review** — Invoke the \`${kY}\` tool with \`skill: "code-review"\` and \`args: "medium"\` to get a correctness-bug report on your changes, then fix every reported bug before moving on.
|
|
86
|
+
2. **Run unit tests** — Run the project's test suite (check for package.json scripts, Makefile targets, or common commands like \`npm test\`, \`bun test\`, \`pytest\`, \`go test\`). If tests fail, fix them.
|
|
87
|
+
3. **Test end-to-end** — Follow the e2e test recipe from the coordinator's prompt (below). If the recipe says to skip e2e for this unit, skip it.
|
|
88
|
+
4. **Commit and push** — Commit all changes with a clear message, push the branch, and create a PR with \`gh pr create\`. Use a descriptive title. If \`gh\` is not available or the push fails, note it in your final message.
|
|
89
|
+
5. **Report** — End with a single line: \`PR: <url>\` so the coordinator can track it. If no PR was created, end with \`PR: none — <reason>\`.`;function F0(G){return`# Batch: Parallel Work Orchestration
|
|
90
|
+
|
|
91
|
+
You are orchestrating a large, parallelizable change across this codebase.
|
|
92
|
+
|
|
93
|
+
## User Instruction
|
|
94
|
+
|
|
95
|
+
${G}
|
|
96
|
+
|
|
97
|
+
## Phase 1: Research and Plan (Plan Mode)
|
|
98
|
+
|
|
99
|
+
Call the \`${qY}\` tool now to enter plan mode, then:
|
|
100
|
+
|
|
101
|
+
1. **Understand the scope.** Launch one or more subagents (in the foreground — you need their results) to deeply research what this instruction touches. Find all the files, patterns, and call sites that need to change. Understand the existing conventions so the migration is consistent.
|
|
102
|
+
|
|
103
|
+
2. **Decompose into independent units.** Break the work into ${UY}–${LY} self-contained units. Each unit must:
|
|
104
|
+
- Be independently implementable in an isolated git worktree (no shared state with sibling units)
|
|
105
|
+
- Be mergeable on its own without depending on another unit's PR landing first
|
|
106
|
+
- Be roughly uniform in size (split large units, merge trivial ones)
|
|
107
|
+
|
|
108
|
+
Scale the count to the actual work: few files → closer to ${UY}; hundreds of files → closer to ${LY}. Prefer per-directory or per-module slicing over arbitrary file lists.
|
|
109
|
+
|
|
110
|
+
3. **Determine the e2e test recipe.** Figure out how a worker can verify its change actually works end-to-end — not just that unit tests pass. Look for:
|
|
111
|
+
- A \`claude-in-chrome\` skill or browser-automation tool (for UI changes: click through the affected flow, screenshot the result)
|
|
112
|
+
- A \`tmux\` or CLI-verifier skill (for CLI changes: launch the app interactively, exercise the changed behavior)
|
|
113
|
+
- A dev-server + curl pattern (for API changes: start the server, hit the affected endpoints)
|
|
114
|
+
- An existing e2e/integration test suite the worker can run
|
|
115
|
+
|
|
116
|
+
If you cannot find a concrete e2e path, use the \`${QB}\` tool to ask the user how to verify this change end-to-end. Offer 2–3 specific options based on what you found (e.g., "Screenshot via chrome extension", "Run \`bun run dev\` and curl the endpoint", "No e2e — unit tests are sufficient"). Do not skip this — the workers cannot ask the user themselves.
|
|
117
|
+
|
|
118
|
+
Write the recipe as a short, concrete set of steps that a worker can execute autonomously. Include any setup (start a dev server, build first) and the exact command/interaction to verify.
|
|
119
|
+
|
|
120
|
+
4. **Write the plan.** In your plan file, include:
|
|
121
|
+
- A summary of what you found during research
|
|
122
|
+
- A numbered list of work units — for each: a short title, the list of files/directories it covers, and a one-line description of the change
|
|
123
|
+
- The e2e test recipe (or "skip e2e because …" if the user chose that)
|
|
124
|
+
- The exact worker instructions you will give each agent (the shared template)
|
|
125
|
+
|
|
126
|
+
5. Call \`${SY}\` to present the plan for approval.
|
|
127
|
+
|
|
128
|
+
## Phase 2: Spawn Workers (After Plan Approval)
|
|
129
|
+
|
|
130
|
+
Once the plan is approved, spawn one background agent per work unit using the \`${xG}\` tool. **All agents must use \`isolation: "worktree"\` and \`run_in_background: true\`.** Launch them all in a single message block so they run in parallel.
|
|
131
|
+
|
|
132
|
+
For each agent, the prompt must be fully self-contained. Include:
|
|
133
|
+
- The overall goal (the user's instruction)
|
|
134
|
+
- This unit's specific task (title, file list, change description — copied verbatim from your plan)
|
|
135
|
+
- Any codebase conventions you discovered that the worker needs to follow
|
|
136
|
+
- The e2e test recipe from your plan (or "skip e2e because …")
|
|
137
|
+
- The worker instructions below, copied verbatim:
|
|
138
|
+
|
|
139
|
+
\`\`\`
|
|
140
|
+
${Q0}
|
|
141
|
+
\`\`\`
|
|
142
|
+
|
|
143
|
+
Use \`subagent_type: "Code"\` unless a more specific agent type fits.
|
|
144
|
+
|
|
145
|
+
## Phase 3: Track Progress
|
|
146
|
+
|
|
147
|
+
After launching all workers, render an initial status table:
|
|
148
|
+
|
|
149
|
+
| # | Unit | Status | PR |
|
|
150
|
+
|---|------|--------|----|
|
|
151
|
+
| 1 | <title> | running | — |
|
|
152
|
+
| 2 | <title> | running | — |
|
|
153
|
+
|
|
154
|
+
As background-agent completion notifications arrive, parse the \`PR: <url>\` line from each agent's result and re-render the table with updated status (\`done\` / \`failed\`) and PR links. Keep a brief failure note for any agent that did not produce a PR.
|
|
155
|
+
|
|
156
|
+
When all agents have reported, render the final table and a one-line summary (e.g., "22/24 units landed as PRs").
|
|
157
|
+
`}var N0="This is not a git repository. The `/batch` command requires a git repo because it spawns agents in isolated git worktrees and creates PRs from each. Initialize a repo first, or run this from inside an existing one.",j0=`Provide an instruction describing the batch change you want to make.
|
|
158
|
+
|
|
159
|
+
Examples:
|
|
160
|
+
/batch migrate from react to vue
|
|
161
|
+
/batch replace all uses of lodash with native equivalents
|
|
162
|
+
/batch add type annotations to all untyped function parameters`;function hY(){i({name:"batch",description:"Research and plan a large-scale change, then execute it in parallel across 5–30 isolated worktree agents that each open a PR.",whenToUse:"Use when the user wants to make a sweeping, mechanical change across many files (migrations, refactors, bulk renames) that can be decomposed into independent parallel units.",argumentHint:"<instruction>",userInvocable:!0,disableModelInvocation:!0,async getPromptForCommand(G){let B=G.trim();if(!B)return[{type:"text",text:j0}];if(!await wY())return[{type:"text",text:N0}];return[{type:"text",text:F0(B)}]}})}wI();MY();gG();var U0=/^(low|medium|high)$/i,L0=/^--comment$/i,w0={low:1,medium:2,high:3};function A0(G){let B=G.trim().split(/\s+/).filter(Boolean),I=!1,Z=[];for(let H of B)if(L0.test(H))I=!0;else Z.push(H);let b="high",Y,W=Z,X=Z[0];if(X!==void 0&&U0.test(X))b=X.toLowerCase(),W=Z.slice(1);else if(X!==void 0&&Z.length===1)Y=X,W=[];return{effort:b,comment:I,invalidEffort:Y,focus:W.join(" ")}}function S0(G){let{effort:B,comment:I,invalidEffort:Z,focus:b}=G,Y=w0[B],W=B==="high",X=Z?`
|
|
163
|
+
> Note: \`${Z}\` is not a valid effort level — defaulting to \`high\`. Valid levels are \`low\`, \`medium\`, \`high\`. Tell the user this once.
|
|
164
|
+
`:"",H=Y===1?`Use the ${xG} tool to launch **one** review agent. Pass it the full diff.`:`Use the ${xG} tool to launch **${Y}** review agents concurrently in a single message. Pass each agent the full diff. Split the changed files roughly evenly between agents so each owns a distinct slice, but every agent sees the whole diff for context.`,V=W?`
|
|
165
|
+
This is a **high-effort** review. ultrathink — reason deeply about each change before reporting. Trace control flow and data flow by hand, consider adversarial and boundary inputs, and verify your suspicion is a real bug (not a false positive) before including it.
|
|
166
|
+
`:"",C=I?`## Phase 3: Report and Post to the PR
|
|
167
|
+
|
|
168
|
+
The user passed \`--comment\`, so findings should be posted as inline comments on the branch's open GitHub pull request. **Never post without explicit user confirmation** — follow these steps in order:
|
|
169
|
+
|
|
170
|
+
1. Run \`gh pr view --json number,headRefName,url\` to find the open PR for the current branch.
|
|
171
|
+
2. If there is **no open PR** (or \`gh\` is unavailable), fall back: print the full markdown report in the chat and tell the user that \`--comment\` needs an open PR to post inline comments. Stop here.
|
|
172
|
+
3. Review **the PR's own diff** via \`gh pr diff\` (not a local \`git diff\` — this avoids mismatches if the local branch has diverged from the remote).
|
|
173
|
+
4. Present the verdict and all findings in the chat first, as a markdown report.
|
|
174
|
+
5. Use the ${QB} tool to let the user decide what to do next: post the inline comments to the PR, dig deeper into a finding, or discard. Answer any follow-up questions the user has before they decide.
|
|
175
|
+
6. Only if the user confirms posting, submit **one** review with all inline comments in a single request:
|
|
176
|
+
\`gh api repos/{owner}/{repo}/pulls/{number}/reviews -f event=COMMENT -F 'comments[][path]=...' -F 'comments[][line]=...' -F 'comments[][body]=...'\`
|
|
177
|
+
Each finding becomes one inline comment anchored at its file path and line.
|
|
178
|
+
7. Confirm what was posted and link the PR.`:`## Phase 3: Report
|
|
179
|
+
|
|
180
|
+
Wait for all review agents to finish. Aggregate their findings into a single markdown report. For each finding include:
|
|
181
|
+
|
|
182
|
+
- File and line (\`path:line\`)
|
|
183
|
+
- Severity (high / medium / low)
|
|
184
|
+
- A short description of the bug
|
|
185
|
+
- Why it is a bug — the concrete failure case or input that triggers it
|
|
186
|
+
- A suggested fix
|
|
187
|
+
|
|
188
|
+
Do **not** modify the code — this skill only reports. If a finding is a false positive or too speculative, drop it rather than padding the report. If no real bugs were found, say so plainly.`,y=b?`
|
|
189
|
+
|
|
190
|
+
## Additional Focus
|
|
191
|
+
|
|
192
|
+
${b}
|
|
193
|
+
`:"";return`# Code Review: Report Correctness Bugs
|
|
194
|
+
|
|
195
|
+
Review the changed code for **correctness bugs** and report them. Effort level: **${B}**.
|
|
196
|
+
${X}${V}
|
|
197
|
+
Focus exclusively on bugs that make the code behave incorrectly:
|
|
198
|
+
|
|
199
|
+
- Incorrect logic, inverted conditions, off-by-one errors
|
|
200
|
+
- Unhandled edge cases — empty inputs, boundaries, null/undefined
|
|
201
|
+
- Missing \`await\` on promises, unhandled rejections
|
|
202
|
+
- Regressions in existing behavior the change touches
|
|
203
|
+
- Broken or swallowed error handling
|
|
204
|
+
- Concrete race conditions (not theoretical ones)
|
|
205
|
+
|
|
206
|
+
Do **not** report style, naming, formatting, refactor opportunities, or general cleanup — only correctness bugs.
|
|
207
|
+
|
|
208
|
+
## Phase 1: Identify Changes
|
|
209
|
+
|
|
210
|
+
Run \`git diff\` (or \`git diff HEAD\` if there are staged changes) to see what changed. If there are no git changes, review the most recently modified files that the user mentioned or that you edited earlier in this conversation.
|
|
211
|
+
|
|
212
|
+
## Phase 2: Launch Review Agent${Y===1?"":"s"}
|
|
213
|
+
|
|
214
|
+
${H} Instruct each agent to read the surrounding code as needed to confirm whether a suspected bug is real, and to report only correctness bugs with a concrete failure case.
|
|
215
|
+
|
|
216
|
+
${C}${y}`}function $Y(){i({name:"code-review",description:"Report correctness bugs in changed code at a chosen effort level. Pass --comment to post findings as inline GitHub PR comments.",whenToUse:"When the user wants changed/recent code reviewed for correctness bugs (logic errors, edge cases, regressions).",argumentHint:"[low|medium|high] [--comment]",userInvocable:!0,disableModelInvocation:!1,allowedTools:["Read","Grep","Glob","Bash(git diff:*)","Bash(git status:*)","Bash(git log:*)","Bash(gh pr view:*)","Bash(gh pr diff:*)","Bash(gh api:*)"],async getPromptForCommand(G){let B=A0(G);return[{type:"text",text:S0(B)}]}})}q0();yB();jG();kG();M0();gG();import{open as k0,stat as h0}from"fs/promises";var FB=20,$0=65536;function EY(){i({name:"debug",description:"Enable debug logging for this session and help diagnose issues",allowedTools:["Read","Grep","Glob"],argumentHint:"[issue description]",disableModelInvocation:!0,userInvocable:!0,async getPromptForCommand(G){let B=vY(),I=DY(),Z;try{let W=await h0(I),X=Math.min(W.size,$0),H=W.size-X,V=await k0(I,"r");try{let{buffer:C,bytesRead:y}=await V.read({buffer:Buffer.alloc(X),position:H}),R=C.toString("utf-8",0,y).split(`
|
|
217
|
+
`).slice(-FB).join(`
|
|
218
|
+
`);Z=`Log size: ${PY(W.size)}
|
|
219
|
+
|
|
220
|
+
### Last ${FB} lines
|
|
221
|
+
|
|
222
|
+
\`\`\`
|
|
223
|
+
${R}
|
|
224
|
+
\`\`\``}finally{await V.close()}}catch(W){Z=xY(W)?"No debug log exists yet — logging was just enabled.":`Failed to read last ${FB} lines of debug log: ${GG(W)}`}return[{type:"text",text:`# Debug Skill
|
|
225
|
+
|
|
226
|
+
Help the user debug an issue they're encountering in this current Claude Code session.
|
|
227
|
+
${B?"":`
|
|
228
|
+
## Debug Logging Just Enabled
|
|
229
|
+
|
|
230
|
+
Debug logging was OFF for this session until now. Nothing prior to this /debug invocation was captured.
|
|
231
|
+
|
|
232
|
+
Tell the user that debug logging is now active at \`${I}\`, ask them to reproduce the issue, then re-read the log. If they can't reproduce, they can also restart with \`claude --debug\` to capture logs from startup.
|
|
233
|
+
`}
|
|
234
|
+
## Session Debug Log
|
|
235
|
+
|
|
236
|
+
The debug log for the current session is at: \`${I}\`
|
|
237
|
+
|
|
238
|
+
${Z}
|
|
239
|
+
|
|
240
|
+
For additional context, grep for [ERROR] and [WARN] lines across the full file.
|
|
241
|
+
|
|
242
|
+
## Issue Description
|
|
243
|
+
|
|
244
|
+
${G||"The user did not describe a specific issue. Read the debug log and summarize any errors, warnings, or notable issues."}
|
|
245
|
+
|
|
246
|
+
## Settings
|
|
247
|
+
|
|
248
|
+
Remember that settings are in:
|
|
249
|
+
* user - ${NB("userSettings")}
|
|
250
|
+
* project - ${NB("projectSettings")}
|
|
251
|
+
* local - ${NB("localSettings")}
|
|
252
|
+
|
|
253
|
+
## Instructions
|
|
254
|
+
|
|
255
|
+
1. Review the user's issue description
|
|
256
|
+
2. The last ${FB} lines show the debug file format. Look for [ERROR] and [WARN] entries, stack traces, and failure patterns across the file
|
|
257
|
+
3. Consider launching the ${TY} subagent to understand the relevant Claude Code features
|
|
258
|
+
4. Explain what you found in plain language
|
|
259
|
+
5. Suggest concrete fixes or next steps
|
|
260
|
+
`}]}})}x0();gG();function v0(){return`# Fewer Permission Prompts
|
|
261
|
+
|
|
262
|
+
Look through my transcripts' MCP and bash tool calls, and based on those, make a prioritized list of patterns that I should add to my permission allowlist to reduce permission prompts. Focus on read-only commands.
|
|
263
|
+
|
|
264
|
+
The format for permissions is: \`Bash(foo*)\`, \`Bash(foo)\`, \`Bash(foo bar *)\`, \`mcp__slack__slack_read_thread\`, etc.
|
|
265
|
+
|
|
266
|
+
Then, add these to the project \`.claudin/settings.json\` under \`permissions.allow\`.
|
|
267
|
+
|
|
268
|
+
## Steps
|
|
269
|
+
|
|
270
|
+
1. **Locate transcripts.** Session transcripts live under \`${_Y()}/<sanitized-cwd>/*.jsonl\` (this is Claudin's projects dir, honoring \`CLAUDIN_CONFIG_DIR\`). Each line is a JSON object. Tool calls appear as \`assistant\` messages with \`message.content[]\` entries of \`type: "tool_use"\`. The \`name\` field identifies the tool (e.g. \`"Bash"\`, \`"mcp__slack__slack_read_thread"\`); for Bash, \`input.command\` is the shell string.
|
|
271
|
+
|
|
272
|
+
Scan the recent transcripts across the projects dir — not just the current project — so the allowlist reflects their actual usage. Cap the scan at a reasonable number of recent sessions (e.g. 50 most-recently-modified JSONL files) so this stays fast.
|
|
273
|
+
|
|
274
|
+
2. **Extract tool-call frequencies.**
|
|
275
|
+
- For \`Bash\` calls: parse \`input.command\`, take the leading command token (handling \`sudo\`, \`timeout\`, pipes, \`&&\`, env-var prefixes). Record the command + first subcommand pair (e.g. \`git status\`, \`gh pr view\`, \`ls\`, \`cat\`).
|
|
276
|
+
- For MCP calls: record the full tool name (e.g. \`mcp__slack__slack_read_thread\`).
|
|
277
|
+
- Count occurrences across the scanned transcripts.
|
|
278
|
+
|
|
279
|
+
3. **Filter to read-only.** Keep only commands that don't mutate state. Examples of read-only: \`ls\`, \`cat\`, \`pwd\`, \`git status\`, \`git log\`, \`git diff\`, \`git show\`, \`git branch\`, \`rg\`, \`grep\`, \`find\`, \`head\`, \`tail\`, \`wc\`, \`file\`, \`which\`, \`echo\`, \`date\`, \`gh pr view\`, \`gh pr list\`, \`gh pr diff\`, \`gh issue view\`, \`gh issue list\`, \`gh run list\`, \`gh run view\`, \`gh api\` (GET), \`bun run typecheck\`, \`bun run lint\`, \`bun run test\` (for tests that don't mutate), \`docker ps\`, \`docker logs\`, \`kubectl get\`, \`kubectl describe\`, \`ps\`, \`top\`, \`df\`, \`du\`, \`env\`, \`printenv\`, any MCP tool with \`read\`/\`get\`/\`list\`/\`search\`/\`view\` in its name.
|
|
280
|
+
|
|
281
|
+
Drop anything that writes, deletes, renames, pushes, merges, installs, or runs a build/test that has side effects. When in doubt, leave it out.
|
|
282
|
+
|
|
283
|
+
**Never allowlist a pattern that grants arbitrary code execution.** A wildcard rule for any of these (e.g. \`Bash(python3:*)\`) is equivalent to allowing arbitrary code execution. This list is not exhaustive — apply the same rule to anything in the same category:
|
|
284
|
+
- Interpreters: \`python\`/\`python3\`, \`node\`, \`bun\`, \`deno\`, \`ruby\`, \`perl\`, \`php\`, \`lua\`, etc.
|
|
285
|
+
- Shells: \`bash\`, \`sh\`, \`zsh\`, \`fish\`, \`eval\`, \`exec\`, \`ssh\`, etc.
|
|
286
|
+
- Package runners: \`npx\`, \`bunx\`, \`uvx\`, \`uv run\`, etc.
|
|
287
|
+
- Task-runner wildcards: \`npm run *\`, \`yarn run *\`, \`pnpm run *\`, \`bun run *\`, \`make *\`, \`just *\`, \`cargo run *\`, \`go run *\`, etc. — an exact \`Bash(bun run typecheck)\` is fine, \`Bash(bun run *)\` is not
|
|
288
|
+
- \`gh api *\`, \`docker run\`/\`exec\`, \`kubectl exec\`, \`sudo\`, and similar
|
|
289
|
+
|
|
290
|
+
4. **Drop commands Claudin already auto-allows.** These don't need an allowlist entry — they never prompt. If you see any of these in the transcripts, skip them; don't suggest them to the user.
|
|
291
|
+
|
|
292
|
+
- **Always auto-allowed (any args):** \`cal\`, \`uptime\`, \`cat\`, \`head\`, \`tail\`, \`wc\`, \`stat\`, \`strings\`, \`hexdump\`, \`od\`, \`nl\`, \`id\`, \`uname\`, \`free\`, \`df\`, \`du\`, \`locale\`, \`groups\`, \`nproc\`, \`basename\`, \`dirname\`, \`realpath\`, \`cut\`, \`paste\`, \`tr\`, \`column\`, \`tac\`, \`rev\`, \`fold\`, \`expand\`, \`unexpand\`, \`fmt\`, \`comm\`, \`cmp\`, \`numfmt\`, \`readlink\`, \`diff\`, \`true\`, \`false\`, \`sleep\`, \`which\`, \`type\`, \`expr\`, \`test\`, \`getconf\`, \`seq\`, \`tsort\`, \`pr\`, \`echo\`, \`printf\`, \`ls\`, \`cd\`, \`find\`.
|
|
293
|
+
- **Auto-allowed with zero args only:** \`pwd\`, \`whoami\`, \`alias\`.
|
|
294
|
+
- **Auto-allowed exact forms:** \`node -v\`, \`node --version\`, \`python --version\`, \`python3 --version\`, \`ip addr\`.
|
|
295
|
+
- **Auto-allowed with safe flags only (validated):** \`xargs\`, \`file\`, \`sed\` (read-only expressions), \`sort\`, \`man\`, \`help\`, \`netstat\`, \`ps\`, \`base64\`, \`grep\`, \`egrep\`, \`fgrep\`, \`sha256sum\`, \`sha1sum\`, \`md5sum\`, \`tree\`, \`date\`, \`hostname\`, \`info\`, \`lsof\`, \`pgrep\`, \`tput\`, \`ss\`, \`fd\`, \`fdfind\`, \`rg\`, \`jq\`, \`uniq\`, \`history\`, \`arch\`, \`ifconfig\`, \`pyright\`.
|
|
296
|
+
- **All git read-only subcommands:** \`git status\`, \`git log\`, \`git diff\`, \`git show\`, \`git blame\`, \`git branch\`, \`git tag\`, \`git remote\`, \`git ls-files\`, \`git ls-remote\`, \`git config --get\`, \`git rev-parse\`, \`git describe\`, \`git stash list\`, \`git reflog\`, \`git shortlog\`, \`git cat-file\`, \`git for-each-ref\`, \`git worktree list\`, etc.
|
|
297
|
+
- **All gh read-only subcommands:** \`gh pr view\`, \`gh pr list\`, \`gh pr diff\`, \`gh pr checks\`, \`gh pr status\`, \`gh issue view\`, \`gh issue list\`, \`gh issue status\`, \`gh run view\`, \`gh run list\`, \`gh workflow list\`, \`gh workflow view\`, \`gh repo view\`, \`gh release view\`, \`gh release list\`, \`gh api\` (GET), \`gh auth status\`, etc.
|
|
298
|
+
- **Docker read-only subcommands:** \`docker ps\`, \`docker images\`, \`docker logs\`, \`docker inspect\`.
|
|
299
|
+
|
|
300
|
+
Source of truth: \`src/tools/BashTool/readOnlyValidation.ts\` (\`COMMAND_ALLOWLIST\`, \`READONLY_COMMANDS\`, \`READONLY_COMMAND_REGEXES\`) and \`src/utils/shell/readOnlyCommandValidation.ts\` (\`GIT_READ_ONLY_COMMANDS\`, \`GH_READ_ONLY_COMMANDS\`, \`DOCKER_READ_ONLY_COMMANDS\`, \`RIPGREP_READ_ONLY_COMMANDS\`, \`PYRIGHT_READ_ONLY_COMMANDS\`). If you're in this repo and unsure whether a command is covered, grep these files rather than guessing.
|
|
301
|
+
|
|
302
|
+
5. **Pick the pattern form.** Use the narrowest pattern that still covers the observed usage:
|
|
303
|
+
- If the user runs many variants (\`git log\`, \`git log --oneline\`, \`git log main..HEAD\`): use \`Bash(git log *)\` — note the space before \`*\`, which is required for prefix matching to work correctly.
|
|
304
|
+
- If a single exact invocation is common: use \`Bash(foo)\` with no wildcard.
|
|
305
|
+
- For MCP: use the full tool name verbatim (no wildcard needed; they're already specific).
|
|
306
|
+
- Never widen a pattern to the point that it conflicts with the rules above (no arbitrary code execution, no mutation/side effects).
|
|
307
|
+
|
|
308
|
+
6. **Prioritize.** Rank by count descending. Drop anything that appeared fewer than ~3 times — not worth the allowlist entry. Cap the list at the top ~20 so the user can skim it.
|
|
309
|
+
|
|
310
|
+
7. **Present the prioritized list to the user** as a markdown table with columns: rank, pattern, count, one-line description. Example:
|
|
311
|
+
|
|
312
|
+
| # | Pattern | Count | Notes |
|
|
313
|
+
|---|---------|-------|-------|
|
|
314
|
+
| 1 | \`Bash(git status *)\` | 142 | repo status checks |
|
|
315
|
+
| 2 | \`Bash(gh pr view *)\` | 87 | PR inspection |
|
|
316
|
+
| 3 | \`mcp__slack__slack_read_thread\` | 54 | Slack thread reads |
|
|
317
|
+
|
|
318
|
+
8. **Merge into \`.claudin/settings.json\`** in the current project (not the user-level \`settings.json\`, not \`.claudin/settings.local.json\`). Create the file if it doesn't exist. Preserve existing keys and existing entries in \`permissions.allow\`; de-duplicate against what's already there; don't remove anything; don't reorder unrelated fields.
|
|
319
|
+
|
|
320
|
+
9. **Report back.** Tell the user what you added (count + a few examples), what was already in the allowlist, and what you skipped and why (e.g. "dropped \`rm\` and \`git push\` — not read-only; dropped \`cat\`/\`ls\`/\`git status\` — already auto-allowed, no rule needed").
|
|
321
|
+
|
|
322
|
+
Do not add anything to \`permissions.deny\` or \`permissions.ask\`. Do not touch any other settings field.`}function OY(){i({name:"fewer-permission-prompts",description:"Scan recent transcripts for common read-only Bash/MCP calls and add a prioritized allowlist to the project's .claudin/settings.json to reduce permission prompts.",whenToUse:"When the user wants to cut down on permission prompts by allowlisting their frequent read-only commands.",userInvocable:!0,disableModelInvocation:!1,allowedTools:["Read","Grep","Glob","Edit","Write","Bash(ls:*)"],async getPromptForCommand(){return[{type:"text",text:v0()}]}})}P0();E0();T0();gI();xb();var AI=["Global","Chat","Autocomplete","Confirmation","Help","Transcript","HistorySearch","Task","ThemePicker","Settings","Tabs","Attachments","Footer","MessageSelector","DiffDialog","ModelPicker","Select","Plugin"],cY={Global:"Active everywhere, regardless of focus",Chat:"When the chat input is focused",Autocomplete:"When autocomplete menu is visible",Confirmation:"When a confirmation/permission dialog is shown",Help:"When the help overlay is open",Transcript:"When viewing the transcript",HistorySearch:"When searching command history (ctrl+r)",Task:"When a task/agent is running in the foreground",ThemePicker:"When the theme picker is open",Settings:"When the settings menu is open",Tabs:"When tab navigation is active",Attachments:"When navigating image attachments in a select dialog",Footer:"When footer indicators are focused",MessageSelector:"When the message selector (rewind) is open",DiffDialog:"When the diff dialog is open",ModelPicker:"When the model picker is open",Select:"When a select/list component is focused",Plugin:"When the plugin dialog is open"},SI=["app:interrupt","app:exit","app:toggleTodos","app:toggleTranscript","app:toggleBrief","app:toggleTeammatePreview","app:toggleTerminal","app:redraw","app:globalSearch","app:quickOpen","history:search","history:previous","history:next","chat:cancel","chat:killAgents","chat:cycleMode","chat:modelPicker","chat:fastMode","chat:thinkingToggle","chat:submit","chat:newline","chat:undo","chat:externalEditor","chat:stash","chat:imagePaste","chat:messageActions","autocomplete:accept","autocomplete:dismiss","autocomplete:previous","autocomplete:next","confirm:yes","confirm:no","confirm:previous","confirm:next","confirm:nextField","confirm:previousField","confirm:cycleMode","confirm:toggle","confirm:toggleExplanation","tabs:next","tabs:previous","transcript:toggleShowAll","transcript:exit","historySearch:next","historySearch:accept","historySearch:cancel","historySearch:execute","task:background","theme:toggleSyntaxHighlighting","help:dismiss","attachments:next","attachments:previous","attachments:remove","attachments:exit","footer:up","footer:down","footer:next","footer:previous","footer:openSelected","footer:clearSelection","footer:close","messageSelector:up","messageSelector:down","messageSelector:top","messageSelector:bottom","messageSelector:select","diff:dismiss","diff:previousSource","diff:nextSource","diff:back","diff:viewDetails","diff:previousFile","diff:nextFile","modelPicker:decreaseEffort","modelPicker:increaseEffort","select:next","select:previous","select:accept","select:cancel","plugin:toggle","plugin:install","permission:toggleDebug","settings:search","settings:retry","settings:close","voice:pushToTalk"],D0=aG(()=>r.object({context:r.enum(AI).describe("UI context where these bindings apply. Global bindings work everywhere."),bindings:r.record(r.string().describe('Keystroke pattern (e.g., "ctrl+k", "shift+tab")'),r.union([r.enum(SI),r.string().regex(/^command:[a-zA-Z0-9:\-_]+$/).describe('Command binding (e.g., "command:help", "command:compact"). Executes the slash command as if typed.'),r.null().describe("Set to null to unbind a default shortcut")]).describe("Action to trigger, command to invoke, or null to unbind")).describe("Map of keystroke patterns to actions")}).describe("A block of keybindings for a specific context")),FR=aG(()=>r.object({$schema:r.string().optional().describe("JSON Schema URL for editor validation"),$docs:r.string().optional().describe("Documentation URL"),bindings:r.array(D0()).describe("Array of keybinding blocks by context")}).describe("Claude Code keybindings configuration. Customize keyboard shortcuts by context."));mG();gG();function _0(){return MI(["Context","Description"],AI.map((G)=>[`\`${G}\``,cY[G]]))}function O0(){let G={};for(let B of fY)for(let[I,Z]of Object.entries(B.bindings))if(Z){if(!G[Z])G[Z]={keys:[],context:B.context};G[Z].keys.push(I)}return MI(["Action","Default Key(s)","Context"],SI.map((B)=>{let I=G[B],Z=I?I.keys.map((Y)=>`\`${Y}\``).join(", "):"(none)",b=I?I.context:c0(B);return[`\`${B}\``,Z,b]}))}function c0(G){let B=G.split(":")[0];return{app:"Global",history:"Global or Chat",chat:"Chat",autocomplete:"Autocomplete",confirm:"Confirmation",tabs:"Tabs",transcript:"Transcript",historySearch:"HistorySearch",task:"Task",theme:"ThemePicker",help:"Help",attachments:"Attachments",footer:"Footer",messageSelector:"MessageSelector",diff:"DiffDialog",modelPicker:"ModelPicker",select:"Select",permission:"Confirmation"}[B??""]??"Unknown"}function f0(){let G=[];G.push("### Non-rebindable (errors)");for(let B of uY)G.push(`- \`${B.key}\` — ${B.reason}`);G.push(""),G.push("### Terminal reserved (errors/warnings)");for(let B of dY)G.push(`- \`${B.key}\` — ${B.reason} (${B.severity==="error"?"will not work":"may conflict"})`);G.push(""),G.push("### macOS reserved (errors)");for(let B of lY)G.push(`- \`${B.key}\` — ${B.reason}`);return G.join(`
|
|
323
|
+
`)}var u0={$schema:"https://www.schemastore.org/claude-code-keybindings.json",$docs:"https://code.claude.com/docs/en/keybindings",bindings:[{context:"Chat",bindings:{"ctrl+e":"chat:externalEditor"}}]},d0={context:"Chat",bindings:{"ctrl+s":null}},l0={context:"Chat",bindings:{"ctrl+g":null,"ctrl+e":"chat:externalEditor"}},m0={context:"Global",bindings:{"ctrl+k ctrl+t":"app:toggleTodos"}},p0=["# Keybindings Skill","","Create or modify `~/.claudin/keybindings.json` to customize keyboard shortcuts.","","## CRITICAL: Read Before Write","","**Always read `~/.claudin/keybindings.json` first** (it may not exist yet). Merge changes with existing bindings — never replace the entire file.","","- Use **Edit** tool for modifications to existing files","- Use **Write** tool only if the file does not exist yet"].join(`
|
|
324
|
+
`),a0=["## File Format","","```json",CG(u0,null,2),"```","","Always include the `$schema` and `$docs` fields."].join(`
|
|
325
|
+
`),i0=["## Keystroke Syntax","","**Modifiers** (combine with `+`):","- `ctrl` (alias: `control`)","- `alt` (aliases: `opt`, `option`) — note: `alt` and `meta` are identical in terminals","- `shift`","- `meta` (aliases: `cmd`, `command`)","","**Special keys**: `escape`/`esc`, `enter`/`return`, `tab`, `space`, `backspace`, `delete`, `up`, `down`, `left`, `right`","","**Chords**: Space-separated keystrokes, e.g. `ctrl+k ctrl+s` (1-second timeout between keystrokes)","","**Examples**: `ctrl+shift+p`, `alt+enter`, `ctrl+k ctrl+n`"].join(`
|
|
326
|
+
`),s0=["## Unbinding Default Shortcuts","","Set a key to `null` to remove its default binding:","","```json",CG(d0,null,2),"```"].join(`
|
|
327
|
+
`),n0=["## How User Bindings Interact with Defaults","","- User bindings are **additive** — they are appended after the default bindings","- To **move** a binding to a different key: unbind the old key (`null`) AND add the new binding","- A context only needs to appear in the user's file if they want to change something in that context"].join(`
|
|
328
|
+
`),r0=["## Common Patterns","","### Rebind a key","To change the external editor shortcut from `ctrl+g` to `ctrl+e`:","```json",CG(l0,null,2),"```","","### Add a chord binding","```json",CG(m0,null,2),"```"].join(`
|
|
329
|
+
`),t0=["## Behavioral Rules","","1. Only include contexts the user wants to change (minimal overrides)","2. Validate that actions and contexts are from the known lists below","3. Warn the user proactively if they choose a key that conflicts with reserved shortcuts or common tools like tmux (`ctrl+b`) and screen (`ctrl+a`)","4. When adding a new binding for an existing action, the new binding is additive (existing default still works unless explicitly unbound)","5. To fully replace a default binding, unbind the old key AND add the new one"].join(`
|
|
330
|
+
`),o0=["## Validation with /doctor","",'The `/doctor` command includes a "Keybinding Configuration Issues" section that validates `~/.claudin/keybindings.json`.',"","### Common Issues and Fixes","",MI(["Issue","Cause","Fix"],[['`keybindings.json must have a "bindings" array`',"Missing wrapper object",'Wrap bindings in `{ "bindings": [...] }`'],['`"bindings" must be an array`',"`bindings` is not an array",'Set `"bindings"` to an array: `[{ context: ..., bindings: ... }]`'],['`Unknown context "X"`',"Typo or invalid context name","Use exact context names from the Available Contexts table"],['`Duplicate key "X" in Y bindings`',"Same key defined twice in one context","Remove the duplicate; JSON uses only the last value"],['`"X" may not work: ...`',"Key conflicts with terminal/OS reserved shortcut","Choose a different key (see Reserved Shortcuts section)"],['`Could not parse keystroke "X"`',"Invalid key syntax","Check syntax: use `+` between modifiers, valid key names"],['`Invalid action for "X"`',"Action value is not a string or null",'Actions must be strings like `"app:help"` or `null` to unbind']]),"","### Example /doctor Output","","```","Keybinding Configuration Issues","Location: ~/.claudin/keybindings.json",' └ [Error] Unknown context "chat"'," → Valid contexts: Global, Chat, Autocomplete, ...",' └ [Warning] "ctrl+c" may not work: Terminal interrupt (SIGINT)',"```","","**Errors** prevent bindings from working and must be fixed. **Warnings** indicate potential conflicts but the binding may still work."].join(`
|
|
331
|
+
`);function pY(){i({name:"keybindings-help",description:'Use when the user wants to customize keyboard shortcuts, rebind keys, add chord bindings, or modify ~/.claudin/keybindings.json. Examples: "rebind ctrl+s", "add a chord shortcut", "change the submit key", "customize keybindings".',allowedTools:["Read"],userInvocable:!1,isEnabled:mY,async getPromptForCommand(G){let B=_0(),I=O0(),Z=f0(),b=[p0,a0,i0,s0,n0,r0,t0,o0,`## Reserved Shortcuts
|
|
332
|
+
|
|
333
|
+
${Z}`,`## Available Contexts
|
|
334
|
+
|
|
335
|
+
${B}`,`## Available Actions
|
|
336
|
+
|
|
337
|
+
${I}`];if(G)b.push(`## User Request
|
|
338
|
+
|
|
339
|
+
${G}`);return[{type:"text",text:b.join(`
|
|
340
|
+
|
|
341
|
+
`)}]}})}function MI(G,B){let I=G.map(()=>"---");return[`| ${G.join(" | ")} |`,`| ${I.join(" | ")} |`,...B.map((Z)=>`| ${Z.join(" | ")} |`)].join(`
|
|
342
|
+
`)}e0();gG();var GC="1 minute",BC="1 hour",nY=`Scheduled maintenance loop iteration.
|
|
343
|
+
|
|
344
|
+
If .claudin/loop.md exists, read it and follow it.
|
|
345
|
+
Otherwise, if ~/.claudin/loop.md exists, read it and follow it.
|
|
346
|
+
Otherwise:
|
|
347
|
+
- continue any unfinished work from the conversation
|
|
348
|
+
- tend to the current branch's pull request: review comments, failed CI runs, merge conflicts
|
|
349
|
+
- run cleanup passes such as bug hunts or simplification when nothing else is pending
|
|
350
|
+
|
|
351
|
+
Do not start new initiatives outside that scope.
|
|
352
|
+
Irreversible actions such as pushing or deleting only proceed when they continue something the transcript already authorized.`;function IC(G){let B=G.toLowerCase();if(["s","sec","secs","second","seconds"].includes(B))return"s";if(["m","min","mins","minute","minutes"].includes(B))return"m";if(["h","hr","hrs","hour","hours"].includes(B))return"h";if(["d","day","days"].includes(B))return"d";return null}function qI(G){let B=G.trim().match(/^(\d+)\s*([a-zA-Z]+)$/);if(!B)return null;let I=Number.parseInt(B[1],10);if(!Number.isFinite(I)||I<1)return null;let Z=IC(B[2]);if(!Z)return null;return`${I}${Z}`}function ZC(G){let B=G.match(/^(.*?)(?:\s+every\s+)(\d+)\s*([a-zA-Z]+)\s*$/i);if(!B)return null;let I=qI(`${B[2]}${B[3]}`);if(!I)return null;return{prompt:B[1].trim(),interval:I}}function bC(G){let B=G.trim();if(!B)return{mode:"dynamic-maintenance"};let I=qI(B);if(I)return{mode:"fixed-maintenance",interval:I};let[Z,...b]=B.split(/\s+/),Y=qI(Z??"");if(Y){let X=b.join(" ").trim();if(!X)return{mode:"fixed-maintenance",interval:Y};return{mode:"fixed-prompt",interval:Y,prompt:X}}let W=ZC(B);if(W){if(!W.prompt)return{mode:"fixed-maintenance",interval:W.interval};return{mode:"fixed-prompt",interval:W.interval,prompt:W.prompt}}return{mode:"dynamic-prompt",prompt:B}}function YC(G){let B=G.prompt?`Use this prompt verbatim for both the immediate run and the recurring scheduled task:
|
|
353
|
+
|
|
354
|
+
--- BEGIN PROMPT ---
|
|
355
|
+
${G.prompt}
|
|
356
|
+
--- END PROMPT ---
|
|
357
|
+
`:`This is a maintenance loop with no explicit prompt.
|
|
358
|
+
|
|
359
|
+
For the recurring scheduled task, use this exact maintenance prompt body:
|
|
360
|
+
|
|
361
|
+
--- BEGIN MAINTENANCE PROMPT ---
|
|
362
|
+
${nY}
|
|
363
|
+
--- END MAINTENANCE PROMPT ---
|
|
364
|
+
`;return`# /loop — fixed recurring interval
|
|
365
|
+
|
|
366
|
+
The user invoked /loop with a fixed interval.
|
|
367
|
+
|
|
368
|
+
Requested interval: ${G.interval}
|
|
369
|
+
|
|
370
|
+
${B}
|
|
371
|
+
## Instructions
|
|
372
|
+
|
|
373
|
+
1. Convert the requested interval to a recurring cron expression.
|
|
374
|
+
- Supported suffixes: s, m, h, d.
|
|
375
|
+
- Seconds must be rounded up to the nearest minute because cron has minute granularity.
|
|
376
|
+
- If the requested interval does not map cleanly to cron cadence, choose the nearest clean recurring interval and tell the user what you picked.
|
|
377
|
+
2. Call ${kI} with:
|
|
378
|
+
- the recurring cron expression
|
|
379
|
+
- the effective prompt body above
|
|
380
|
+
- recurring: true
|
|
381
|
+
- durable: false
|
|
382
|
+
3. Briefly confirm what was scheduled, the cron expression, the human cadence, that recurring tasks auto-expire after ${aY} days, and that the user can cancel sooner with ${sY} using the returned job ID.
|
|
383
|
+
4. Immediately execute the effective prompt now — do not wait for the first cron fire.
|
|
384
|
+
- If the effective prompt starts with a slash command, invoke it via the Skill tool.
|
|
385
|
+
- Otherwise, act on it directly.
|
|
386
|
+
`}function WC(G){let B=G.prompt?`Use this prompt verbatim as the effective prompt for this iteration:
|
|
387
|
+
|
|
388
|
+
--- BEGIN PROMPT ---
|
|
389
|
+
${G.prompt}
|
|
390
|
+
--- END PROMPT ---
|
|
391
|
+
`:`This is a maintenance loop with no explicit prompt.
|
|
392
|
+
|
|
393
|
+
Determine the effective prompt in this order:
|
|
394
|
+
1. If .claudin/loop.md exists, read it and use it.
|
|
395
|
+
2. Otherwise, if ~/.claudin/loop.md exists, read it and use it.
|
|
396
|
+
3. Otherwise, use this built-in maintenance prompt:
|
|
397
|
+
|
|
398
|
+
--- BEGIN MAINTENANCE PROMPT ---
|
|
399
|
+
${nY}
|
|
400
|
+
--- END MAINTENANCE PROMPT ---
|
|
401
|
+
`,I=G.prompt?`/loop ${G.prompt}`:"/loop";return`# /loop — dynamic rescheduling
|
|
402
|
+
|
|
403
|
+
The user invoked /loop without a fixed interval.
|
|
404
|
+
|
|
405
|
+
${B}
|
|
406
|
+
## Instructions
|
|
407
|
+
|
|
408
|
+
1. Execute the effective prompt now.
|
|
409
|
+
- If it starts with a slash command, invoke it via the Skill tool.
|
|
410
|
+
- Otherwise, act on it directly.
|
|
411
|
+
2. After the work finishes, choose the next delay dynamically between ${GC} and ${BC}.
|
|
412
|
+
- Use shorter delays while active work is progressing or likely to change soon.
|
|
413
|
+
- Use longer delays when the situation is quiet or stable.
|
|
414
|
+
3. Briefly tell the user the chosen delay and the reason.
|
|
415
|
+
4. Schedule exactly one session-only follow-up run with ${kI}.
|
|
416
|
+
- Use recurring: false.
|
|
417
|
+
- Use durable: false.
|
|
418
|
+
- Pin the cron expression to a specific future local-time minute that matches the chosen delay.
|
|
419
|
+
- Set the scheduled prompt to this exact text so the next iteration stays in dynamic mode:
|
|
420
|
+
|
|
421
|
+
--- BEGIN SCHEDULED PROMPT ---
|
|
422
|
+
${I}
|
|
423
|
+
--- END SCHEDULED PROMPT ---
|
|
424
|
+
|
|
425
|
+
5. Confirm the next run time and the returned job ID.
|
|
426
|
+
6. Do not create a recurring cron for this mode.
|
|
427
|
+
`}function rY(){i({name:"loop",description:"Run a prompt on a fixed interval or dynamically reschedule it, including bare maintenance-mode loops.",whenToUse:"When the user wants to poll for status, babysit a workflow, run recurring maintenance, or keep re-running a prompt within the current session.",argumentHint:"[interval] [prompt]",userInvocable:!0,isEnabled:iY,async getPromptForCommand(G){let B=bC(G);return[{type:"text",text:B.mode==="fixed-prompt"||B.mode==="fixed-maintenance"?YC(B):WC(B)}]}})}gG();function wG(G){return Buffer.from(G,"base64").toString("utf8")}var tY={"examples/cli.md":wG("IyBWZXJpZnlpbmcgYSBDTEkgY2hhbmdlCgpUaGUgaGFuZGxlIGlzIGRpcmVjdCBpbnZvY2F0aW9uLiBUaGUgZXZpZGVuY2UgaXMgc3Rkb3V0L3N0ZGVyci9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C=`**Running means launching the actual app and interacting with it** —
|
|
428
|
+
not the test suite, not an \`import\` of an internal function and a
|
|
429
|
+
\`console.log\`. The app as a user (human or programmatic) would meet
|
|
430
|
+
it: the CLI at its command, the server at its socket, the GUI at its
|
|
431
|
+
window.
|
|
432
|
+
|
|
433
|
+
## First: does a project skill already cover this?
|
|
434
|
+
|
|
435
|
+
A project skill that launches this app is the repo's verified path —
|
|
436
|
+
its author already cold-started from a Linux container and committed
|
|
437
|
+
what worked: the exact \`apt-get\` line, the env vars, the patches, the
|
|
438
|
+
driver. Use it instead of rediscovering.
|
|
439
|
+
|
|
440
|
+
\`\`\`bash
|
|
441
|
+
d=$PWD; while :; do
|
|
442
|
+
grep -Hm1 '^description:' "$d"/.claudin/skills/*/SKILL.md 2>/dev/null
|
|
443
|
+
[ -e "$d/.git" ] || [ "$d" = / ] && break
|
|
444
|
+
d=$(dirname "$d")
|
|
445
|
+
done
|
|
446
|
+
\`\`\`
|
|
447
|
+
|
|
448
|
+
- **One describes launching/driving this app** → read that SKILL.md
|
|
449
|
+
and follow it verbatim. Don't paraphrase; don't skip the patches.
|
|
450
|
+
- **Mega-repo, several plausible, no clear match** → ask the user
|
|
451
|
+
which unit to run.
|
|
452
|
+
- **Stale** (fails on mechanics unrelated to your task) → tell the
|
|
453
|
+
user.
|
|
454
|
+
- **Nothing about running** → fall back to the patterns below.
|
|
455
|
+
|
|
456
|
+
## Otherwise: match the shape, use the pattern
|
|
457
|
+
|
|
458
|
+
Pick the row closest to your project. Each example walks through
|
|
459
|
+
launch + first interaction; ignore any trailing "write the skill"
|
|
460
|
+
section — you're using the recipe, not authoring one.
|
|
461
|
+
|
|
462
|
+
| Project type | Handle | Example |
|
|
463
|
+
|---|---|---|
|
|
464
|
+
| CLI tool | direct invocation, exit code, stdin/stdout | [examples/cli.md](examples/cli.md) |
|
|
465
|
+
| Web server / API | background launch + \`curl\` smoke | [examples/server.md](examples/server.md) |
|
|
466
|
+
| TUI / interactive terminal | tmux \`send-keys\` / \`capture-pane\` | [examples/tui.md](examples/tui.md) |
|
|
467
|
+
| Electron / desktop GUI | Playwright \`_electron\` REPL under xvfb | [examples/electron.md](examples/electron.md) |
|
|
468
|
+
| Browser-driven | dev server + \`chromium-cli\` script | [examples/playwright.md](examples/playwright.md) |
|
|
469
|
+
| Library / SDK | import-and-call smoke script at the package boundary | [examples/library.md](examples/library.md) |
|
|
470
|
+
|
|
471
|
+
If nothing fits, start from the closest match and adapt. For a web
|
|
472
|
+
app, [examples/playwright.md](examples/playwright.md) — drive it with
|
|
473
|
+
\`chromium-cli\`, no custom driver needed. For a desktop app,
|
|
474
|
+
[examples/electron.md](examples/electron.md) — it has the \`_electron\`
|
|
475
|
+
REPL driver skeleton and the tmux wrapping.
|
|
476
|
+
|
|
477
|
+
## Drive it, don't just launch it
|
|
478
|
+
|
|
479
|
+
Launching with no interaction proves the entrypoint resolves. That's
|
|
480
|
+
not running the app — it's typechecking with extra steps. Drive it to
|
|
481
|
+
a point where a user would see something:
|
|
482
|
+
|
|
483
|
+
- CLI → type a representative command, check the exit code and output.
|
|
484
|
+
- Server → hit the route the diff touches with \`curl\`, read the body.
|
|
485
|
+
- TUI → \`send-keys\` a navigation, \`capture-pane\` the result.
|
|
486
|
+
- GUI → click the button, screenshot the window. **Look at the
|
|
487
|
+
screenshot.** A blank frame is a failure to launch.
|
|
488
|
+
|
|
489
|
+
If the fallback pattern didn't work out of the box — you had to
|
|
490
|
+
install packages, set env vars, patch config, or write a driver —
|
|
491
|
+
note that in your report so the work can be captured as a project
|
|
492
|
+
skill for next time. If it just worked, don't.`;function eY(){i({name:"run",description:"Launch this project's app and drive it to confirm a change works in the real app (not just tests).",whenToUse:"When the user wants to run/start/screenshot the app, or confirm a change works end-to-end in the running app.",userInvocable:!0,disableModelInvocation:!1,files:oY,async getPromptForCommand(){return[{type:"text",text:XC}]}})}wI();gG();function VC(G){let B=G.trim(),I=B?`
|
|
493
|
+
|
|
494
|
+
## Additional Focus
|
|
495
|
+
|
|
496
|
+
${B}
|
|
497
|
+
`:"";return`# Simplify: Quality Cleanup of Changed Code
|
|
498
|
+
|
|
499
|
+
You are improving the quality of the changed code, not hunting for bugs. Review
|
|
500
|
+
it for reuse, simplification, efficiency, and altitude issues, then fix what you
|
|
501
|
+
find. Do not look for correctness bugs — that is what \`/code-review\` is for.
|
|
502
|
+
|
|
503
|
+
## Phase 0 — Gather the diff
|
|
504
|
+
|
|
505
|
+
Run \`git diff @{upstream}...HEAD\` (or \`git diff main...HEAD\` / \`git diff HEAD~1\`
|
|
506
|
+
if there's no upstream) to get the unified diff under review. If there are
|
|
507
|
+
uncommitted changes, or the range diff is empty, also run \`git diff HEAD\` and
|
|
508
|
+
include the working-tree changes in scope — the review often runs before the
|
|
509
|
+
commit. If a PR number, branch name, or file path was passed as an argument,
|
|
510
|
+
review that target instead. Treat this diff as the review scope.
|
|
511
|
+
|
|
512
|
+
## Phase 1 — Review (4 cleanup agents in parallel)
|
|
513
|
+
|
|
514
|
+
Use the ${xG} tool to launch **4 independent review agents**, all in
|
|
515
|
+
a single message so they run concurrently. Pass each agent the diff and one of
|
|
516
|
+
the four angles below. Each returns its findings with \`file\`, \`line\`, a
|
|
517
|
+
one-line \`summary\`, and the concrete cost (what is duplicated, wasted, or
|
|
518
|
+
harder to maintain).
|
|
519
|
+
|
|
520
|
+
### Reuse
|
|
521
|
+
|
|
522
|
+
Flag new code that re-implements something the codebase
|
|
523
|
+
already has — Grep shared/utility modules and files adjacent to the change,
|
|
524
|
+
and name the existing helper to call instead.
|
|
525
|
+
|
|
526
|
+
### Simplification
|
|
527
|
+
|
|
528
|
+
Flag unnecessary complexity the diff adds: redundant or derivable state,
|
|
529
|
+
copy-paste with slight variation, deep nesting, dead code left behind. Name
|
|
530
|
+
the simpler form that does the same job.
|
|
531
|
+
|
|
532
|
+
### Efficiency
|
|
533
|
+
|
|
534
|
+
Flag wasted work the diff introduces: redundant computation or repeated I/O,
|
|
535
|
+
independent operations run sequentially, blocking work added to startup or
|
|
536
|
+
hot paths. Name the cheaper alternative.
|
|
537
|
+
|
|
538
|
+
### Altitude
|
|
539
|
+
|
|
540
|
+
Check that each change is implemented at the right depth, not as a fragile
|
|
541
|
+
bandaid. Special cases layered on shared infrastructure are a sign the fix
|
|
542
|
+
isn't deep enough — prefer generalizing the underlying mechanism over adding
|
|
543
|
+
special cases.
|
|
544
|
+
|
|
545
|
+
## Phase 2 — Apply the fixes
|
|
546
|
+
|
|
547
|
+
Wait for all four agents to complete, dedup findings that point at the same
|
|
548
|
+
line or mechanism, and fix each remaining one directly. Skip any finding whose
|
|
549
|
+
fix would change intended behavior, require changes well outside the reviewed
|
|
550
|
+
diff, or that you judge to be a false positive — note the skip rather than
|
|
551
|
+
arguing with it. Finish with a brief summary of what was fixed and what was
|
|
552
|
+
skipped (or confirm the code was already clean).${I}`}function GW(){i({name:"simplify",description:"Clean up changed code for reuse, simplification, efficiency, and altitude, then apply the fixes. Quality only — use /code-review for correctness bugs.",whenToUse:"When the user wants the changed/recent code refactored for clarity and reuse (not bug-hunting).",argumentHint:"[focus]",userInvocable:!0,disableModelInvocation:!1,allowedTools:["Read","Grep","Glob","Edit","Bash(git diff:*)","Bash(git status:*)","Bash(git log:*)"],async getPromptForCommand(G){return[{type:"text",text:VC(G)}]}})}gI();CC();mG();gG();function HC(){let G=BW(IW(),{io:"input"});return CG(G,null,2)}var yC=`## Settings File Locations
|
|
553
|
+
|
|
554
|
+
Choose the appropriate file based on scope:
|
|
555
|
+
|
|
556
|
+
| File | Scope | Git | Use For |
|
|
557
|
+
|------|-------|-----|---------|
|
|
558
|
+
| \`~/.claudin/settings.json\` | Global | N/A | Personal preferences for all projects |
|
|
559
|
+
| \`.claudin/settings.json\` | Project | Commit | Team-wide hooks, permissions, plugins |
|
|
560
|
+
| \`.claudin/settings.local.json\` | Project | Gitignore | Personal overrides for this project |
|
|
561
|
+
|
|
562
|
+
Settings load in order: user → project → local (later overrides earlier).
|
|
563
|
+
|
|
564
|
+
## Settings Schema Reference
|
|
565
|
+
|
|
566
|
+
### Permissions
|
|
567
|
+
\`\`\`json
|
|
568
|
+
{
|
|
569
|
+
"permissions": {
|
|
570
|
+
"allow": ["Bash(npm:*)", "Edit(.claudin)", "Read"],
|
|
571
|
+
"deny": ["Bash(rm -rf:*)"],
|
|
572
|
+
"ask": ["Write(/etc/*)"],
|
|
573
|
+
"defaultMode": "default" | "plan" | "acceptEdits" | "dontAsk",
|
|
574
|
+
"additionalDirectories": ["/extra/dir"]
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
\`\`\`
|
|
578
|
+
|
|
579
|
+
**Permission Rule Syntax:**
|
|
580
|
+
- Exact match: \`"Bash(npm run test)"\`
|
|
581
|
+
- Prefix wildcard: \`"Bash(git:*)"\` - matches \`git status\`, \`git commit\`, etc.
|
|
582
|
+
- Tool only: \`"Read"\` - allows all Read operations
|
|
583
|
+
|
|
584
|
+
### Environment Variables
|
|
585
|
+
\`\`\`json
|
|
586
|
+
{
|
|
587
|
+
"env": {
|
|
588
|
+
"DEBUG": "true",
|
|
589
|
+
"MY_API_KEY": "value"
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
\`\`\`
|
|
593
|
+
|
|
594
|
+
### Model & Agent
|
|
595
|
+
\`\`\`json
|
|
596
|
+
{
|
|
597
|
+
"model": "sonnet", // or "opus", "haiku", full model ID
|
|
598
|
+
"agent": "agent-name",
|
|
599
|
+
"alwaysThinkingEnabled": true
|
|
600
|
+
}
|
|
601
|
+
\`\`\`
|
|
602
|
+
|
|
603
|
+
### Attribution (Commits & PRs)
|
|
604
|
+
\`\`\`json
|
|
605
|
+
{
|
|
606
|
+
"attribution": {
|
|
607
|
+
"commit": "Custom commit trailer text",
|
|
608
|
+
"pr": "Custom PR description text"
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
\`\`\`
|
|
612
|
+
Set \`commit\` or \`pr\` to empty string \`""\` to hide that attribution.
|
|
613
|
+
|
|
614
|
+
### MCP Server Management
|
|
615
|
+
\`\`\`json
|
|
616
|
+
{
|
|
617
|
+
"enableAllProjectMcpServers": true,
|
|
618
|
+
"enabledMcpjsonServers": ["server1", "server2"],
|
|
619
|
+
"disabledMcpjsonServers": ["blocked-server"]
|
|
620
|
+
}
|
|
621
|
+
\`\`\`
|
|
622
|
+
|
|
623
|
+
### Plugins
|
|
624
|
+
\`\`\`json
|
|
625
|
+
{
|
|
626
|
+
"enabledPlugins": {
|
|
627
|
+
"formatter@anthropic-tools": true
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
\`\`\`
|
|
631
|
+
Plugin syntax: \`plugin-name@source\` where source is \`claude-code-marketplace\`, \`claude-plugins-official\`, or \`builtin\`.
|
|
632
|
+
|
|
633
|
+
### Other Settings
|
|
634
|
+
- \`language\`: Preferred response language (e.g., "japanese")
|
|
635
|
+
- \`cleanupPeriodDays\`: Days to keep transcripts (default: 30; 0 disables persistence entirely)
|
|
636
|
+
- \`respectGitignore\`: Whether to respect .gitignore (default: true)
|
|
637
|
+
- \`spinnerTipsEnabled\`: Show tips in spinner
|
|
638
|
+
- \`spinnerVerbs\`: Customize spinner verbs (\`{ "mode": "append" | "replace", "verbs": [...] }\`)
|
|
639
|
+
- \`spinnerTipsOverride\`: Override spinner tips (\`{ "excludeDefault": true, "tips": ["Custom tip"] }\`)
|
|
640
|
+
- \`syntaxHighlightingDisabled\`: Disable diff highlighting
|
|
641
|
+
`,ZW=`## Hooks Configuration
|
|
642
|
+
|
|
643
|
+
Hooks run commands at specific points in Claude Code's lifecycle.
|
|
644
|
+
|
|
645
|
+
### Hook Structure
|
|
646
|
+
\`\`\`json
|
|
647
|
+
{
|
|
648
|
+
"hooks": {
|
|
649
|
+
"EVENT_NAME": [
|
|
650
|
+
{
|
|
651
|
+
"matcher": "ToolName|OtherTool",
|
|
652
|
+
"hooks": [
|
|
653
|
+
{
|
|
654
|
+
"type": "command",
|
|
655
|
+
"command": "your-command-here",
|
|
656
|
+
"timeout": 60,
|
|
657
|
+
"statusMessage": "Running..."
|
|
658
|
+
}
|
|
659
|
+
]
|
|
660
|
+
}
|
|
661
|
+
]
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
\`\`\`
|
|
665
|
+
|
|
666
|
+
### Hook Events
|
|
667
|
+
|
|
668
|
+
| Event | Matcher | Purpose |
|
|
669
|
+
|-------|---------|---------|
|
|
670
|
+
| PermissionRequest | Tool name | Run before permission prompt |
|
|
671
|
+
| PreToolUse | Tool name | Run before tool, can block |
|
|
672
|
+
| PostToolUse | Tool name | Run after successful tool |
|
|
673
|
+
| PostToolUseFailure | Tool name | Run after tool fails |
|
|
674
|
+
| Notification | Notification type | Run on notifications |
|
|
675
|
+
| Stop | - | Run when Claude stops (including clear, resume, compact) |
|
|
676
|
+
| PreCompact | "manual"/"auto" | Before compaction |
|
|
677
|
+
| PostCompact | "manual"/"auto" | After compaction (receives summary) |
|
|
678
|
+
| UserPromptSubmit | - | When user submits |
|
|
679
|
+
| SessionStart | - | When session starts |
|
|
680
|
+
|
|
681
|
+
**Common tool matchers:** \`Bash\`, \`Write\`, \`Edit\`, \`Read\`, \`Glob\`, \`Grep\`
|
|
682
|
+
|
|
683
|
+
### Hook Types
|
|
684
|
+
|
|
685
|
+
**1. Command Hook** - Runs a shell command:
|
|
686
|
+
\`\`\`json
|
|
687
|
+
{ "type": "command", "command": "prettier --write $FILE", "timeout": 30 }
|
|
688
|
+
\`\`\`
|
|
689
|
+
|
|
690
|
+
**2. Prompt Hook** - Evaluates a condition with LLM:
|
|
691
|
+
\`\`\`json
|
|
692
|
+
{ "type": "prompt", "prompt": "Is this safe? $ARGUMENTS" }
|
|
693
|
+
\`\`\`
|
|
694
|
+
Only available for tool events: PreToolUse, PostToolUse, PermissionRequest.
|
|
695
|
+
|
|
696
|
+
**3. Agent Hook** - Runs an agent with tools:
|
|
697
|
+
\`\`\`json
|
|
698
|
+
{ "type": "agent", "prompt": "Verify tests pass: $ARGUMENTS" }
|
|
699
|
+
\`\`\`
|
|
700
|
+
Only available for tool events: PreToolUse, PostToolUse, PermissionRequest.
|
|
701
|
+
|
|
702
|
+
### Hook Input (stdin JSON)
|
|
703
|
+
\`\`\`json
|
|
704
|
+
{
|
|
705
|
+
"session_id": "abc123",
|
|
706
|
+
"tool_name": "Write",
|
|
707
|
+
"tool_input": { "file_path": "/path/to/file.txt", "content": "..." },
|
|
708
|
+
"tool_response": { "success": true } // PostToolUse only
|
|
709
|
+
}
|
|
710
|
+
\`\`\`
|
|
711
|
+
|
|
712
|
+
### Hook JSON Output
|
|
713
|
+
|
|
714
|
+
Hooks can return JSON to control behavior:
|
|
715
|
+
|
|
716
|
+
\`\`\`json
|
|
717
|
+
{
|
|
718
|
+
"systemMessage": "Warning shown to user in UI",
|
|
719
|
+
"continue": false,
|
|
720
|
+
"stopReason": "Message shown when blocking",
|
|
721
|
+
"suppressOutput": false,
|
|
722
|
+
"decision": "block",
|
|
723
|
+
"reason": "Explanation for decision",
|
|
724
|
+
"hookSpecificOutput": {
|
|
725
|
+
"hookEventName": "PostToolUse",
|
|
726
|
+
"additionalContext": "Context injected back to model"
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
\`\`\`
|
|
730
|
+
|
|
731
|
+
**Fields:**
|
|
732
|
+
- \`systemMessage\` - Display a message to the user (all hooks)
|
|
733
|
+
- \`continue\` - Set to \`false\` to block/stop (default: true)
|
|
734
|
+
- \`stopReason\` - Message shown when \`continue\` is false
|
|
735
|
+
- \`suppressOutput\` - Hide stdout from transcript (default: false)
|
|
736
|
+
- \`decision\` - "block" for PostToolUse/Stop/UserPromptSubmit hooks (deprecated for PreToolUse, use hookSpecificOutput.permissionDecision instead)
|
|
737
|
+
- \`reason\` - Explanation for decision
|
|
738
|
+
- \`hookSpecificOutput\` - Event-specific output (must include \`hookEventName\`):
|
|
739
|
+
- \`additionalContext\` - Text injected into model context
|
|
740
|
+
- \`permissionDecision\` - "allow", "deny", or "ask" (PreToolUse only)
|
|
741
|
+
- \`permissionDecisionReason\` - Reason for the permission decision (PreToolUse only)
|
|
742
|
+
- \`updatedInput\` - Modified tool input (PreToolUse only)
|
|
743
|
+
|
|
744
|
+
### Common Patterns
|
|
745
|
+
|
|
746
|
+
**Auto-format after writes:**
|
|
747
|
+
\`\`\`json
|
|
748
|
+
{
|
|
749
|
+
"hooks": {
|
|
750
|
+
"PostToolUse": [{
|
|
751
|
+
"matcher": "Write|Edit",
|
|
752
|
+
"hooks": [{
|
|
753
|
+
"type": "command",
|
|
754
|
+
"command": "jq -r '.tool_response.filePath // .tool_input.file_path' | { read -r f; prettier --write \\"$f\\"; } 2>/dev/null || true"
|
|
755
|
+
}]
|
|
756
|
+
}]
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
\`\`\`
|
|
760
|
+
|
|
761
|
+
**Log all bash commands:**
|
|
762
|
+
\`\`\`json
|
|
763
|
+
{
|
|
764
|
+
"hooks": {
|
|
765
|
+
"PreToolUse": [{
|
|
766
|
+
"matcher": "Bash",
|
|
767
|
+
"hooks": [{
|
|
768
|
+
"type": "command",
|
|
769
|
+
"command": "jq -r '.tool_input.command' >> ~/.claudin/bash-log.txt"
|
|
770
|
+
}]
|
|
771
|
+
}]
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
\`\`\`
|
|
775
|
+
|
|
776
|
+
**Stop hook that displays message to user:**
|
|
777
|
+
|
|
778
|
+
Command must output JSON with \`systemMessage\` field:
|
|
779
|
+
\`\`\`bash
|
|
780
|
+
# Example command that outputs: {"systemMessage": "Session complete!"}
|
|
781
|
+
echo '{"systemMessage": "Session complete!"}'
|
|
782
|
+
\`\`\`
|
|
783
|
+
|
|
784
|
+
**Run tests after code changes:**
|
|
785
|
+
\`\`\`json
|
|
786
|
+
{
|
|
787
|
+
"hooks": {
|
|
788
|
+
"PostToolUse": [{
|
|
789
|
+
"matcher": "Write|Edit",
|
|
790
|
+
"hooks": [{
|
|
791
|
+
"type": "command",
|
|
792
|
+
"command": "jq -r '.tool_input.file_path // .tool_response.filePath' | grep -E '\\\\.(ts|js)$' && npm test || true"
|
|
793
|
+
}]
|
|
794
|
+
}]
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
\`\`\`
|
|
798
|
+
`,bW=`## Constructing a Hook (with verification)
|
|
799
|
+
|
|
800
|
+
Given an event, matcher, target file, and desired behavior, follow this flow. Each step catches a different failure class — a hook that silently does nothing is worse than no hook.
|
|
801
|
+
|
|
802
|
+
1. **Dedup check.** Read the target file. If a hook already exists on the same event+matcher, show the existing command and ask: keep it, replace it, or add alongside.
|
|
803
|
+
|
|
804
|
+
2. **Construct the command for THIS project — don't assume.** The hook receives JSON on stdin. Build a command that:
|
|
805
|
+
- Extracts any needed payload safely — use \`jq -r\` into a quoted variable or \`{ read -r f; ... "$f"; }\`, NOT unquoted \`| xargs\` (splits on spaces)
|
|
806
|
+
- Invokes the underlying tool the way this project runs it (npx/bunx/yarn/pnpm? Makefile target? globally-installed?)
|
|
807
|
+
- Skips inputs the tool doesn't handle (formatters often have \`--ignore-unknown\`; if not, guard by extension)
|
|
808
|
+
- Stays RAW for now — no \`|| true\`, no stderr suppression. You'll wrap it after the pipe-test passes.
|
|
809
|
+
|
|
810
|
+
3. **Pipe-test the raw command.** Synthesize the stdin payload the hook will receive and pipe it directly:
|
|
811
|
+
- \`Pre|PostToolUse\` on \`Write|Edit\`: \`echo '{"tool_name":"Edit","tool_input":{"file_path":"<a real file from this repo>"}}' | <cmd>\`
|
|
812
|
+
- \`Pre|PostToolUse\` on \`Bash\`: \`echo '{"tool_name":"Bash","tool_input":{"command":"ls"}}' | <cmd>\`
|
|
813
|
+
- \`Stop\`/\`UserPromptSubmit\`/\`SessionStart\`: most commands don't read stdin, so \`echo '{}' | <cmd>\` suffices
|
|
814
|
+
|
|
815
|
+
Check exit code AND side effect (file actually formatted, test actually ran). If it fails you get a real error — fix (wrong package manager? tool not installed? jq path wrong?) and retest. Once it works, wrap with \`2>/dev/null || true\` (unless the user wants a blocking check).
|
|
816
|
+
|
|
817
|
+
4. **Write the JSON.** Merge into the target file (schema shape in the "Hook Structure" section above). If this creates \`.claudin/settings.local.json\` for the first time, add it to .gitignore — the Write tool doesn't auto-gitignore it.
|
|
818
|
+
|
|
819
|
+
5. **Validate syntax + schema in one shot:**
|
|
820
|
+
|
|
821
|
+
\`jq -e '.hooks.<event>[] | select(.matcher == "<matcher>") | .hooks[] | select(.type == "command") | .command' <target-file>\`
|
|
822
|
+
|
|
823
|
+
Exit 0 + prints your command = correct. Exit 4 = matcher doesn't match. Exit 5 = malformed JSON or wrong nesting. A broken settings.json silently disables ALL settings from that file — fix any pre-existing malformation too.
|
|
824
|
+
|
|
825
|
+
6. **Prove the hook fires** — only for \`Pre|PostToolUse\` on a matcher you can trigger in-turn (\`Write|Edit\` via Edit, \`Bash\` via Bash). \`Stop\`/\`UserPromptSubmit\`/\`SessionStart\` fire outside this turn — skip to step 7.
|
|
826
|
+
|
|
827
|
+
For a **formatter** on \`PostToolUse\`/\`Write|Edit\`: introduce a detectable violation via Edit (two consecutive blank lines, bad indentation, missing semicolon — something this formatter corrects; NOT trailing whitespace, Edit strips that before writing), re-read, confirm the hook **fixed** it. For **anything else**: temporarily prefix the command in settings.json with \`echo "$(date) hook fired" >> /tmp/claude-hook-check.txt; \`, trigger the matching tool (Edit for \`Write|Edit\`, a harmless \`true\` for \`Bash\`), read the sentinel file.
|
|
828
|
+
|
|
829
|
+
**Always clean up** — revert the violation, strip the sentinel prefix — whether the proof passed or failed.
|
|
830
|
+
|
|
831
|
+
**If proof fails but pipe-test passed and \`jq -e\` passed**: the settings watcher isn't watching \`.claudin/\` — it only watches directories that had a settings file when this session started. The hook is written correctly. Tell the user to open \`/hooks\` once (reloads config) or restart — you can't do this yourself; \`/hooks\` is a user UI menu and opening it ends this turn.
|
|
832
|
+
|
|
833
|
+
7. **Handoff.** Tell the user the hook is live (or needs \`/hooks\`/restart per the watcher caveat). Point them at \`/hooks\` to review, edit, or disable it later. The UI only shows "Ran N hooks" if a hook errors or is slow — silent success is invisible by design.
|
|
834
|
+
`,JC=`# Update Config Skill
|
|
835
|
+
|
|
836
|
+
Modify Claude Code configuration by updating settings.json files.
|
|
837
|
+
|
|
838
|
+
## When Hooks Are Required (Not Memory)
|
|
839
|
+
|
|
840
|
+
If the user wants something to happen automatically in response to an EVENT, they need a **hook** configured in settings.json. Memory/preferences cannot trigger automated actions.
|
|
841
|
+
|
|
842
|
+
**These require hooks:**
|
|
843
|
+
- "Before compacting, ask me what to preserve" → PreCompact hook
|
|
844
|
+
- "After writing files, run prettier" → PostToolUse hook with Write|Edit matcher
|
|
845
|
+
- "When I run bash commands, log them" → PreToolUse hook with Bash matcher
|
|
846
|
+
- "Always run tests after code changes" → PostToolUse hook
|
|
847
|
+
|
|
848
|
+
**Hook events:** PreToolUse, PostToolUse, PreCompact, PostCompact, Stop, Notification, SessionStart
|
|
849
|
+
|
|
850
|
+
## CRITICAL: Read Before Write
|
|
851
|
+
|
|
852
|
+
**Always read the existing settings file before making changes.** Merge new settings with existing ones - never replace the entire file.
|
|
853
|
+
|
|
854
|
+
## CRITICAL: Use AskUserQuestion for Ambiguity
|
|
855
|
+
|
|
856
|
+
When the user's request is ambiguous, use AskUserQuestion to clarify:
|
|
857
|
+
- Which settings file to modify (user/project/local)
|
|
858
|
+
- Whether to add to existing arrays or replace them
|
|
859
|
+
- Specific values when multiple options exist
|
|
860
|
+
|
|
861
|
+
## Decision: Config Tool vs Direct Edit
|
|
862
|
+
|
|
863
|
+
**Use the Config tool** for these simple settings:
|
|
864
|
+
- \`theme\`, \`editorMode\`, \`verbose\`, \`model\`
|
|
865
|
+
- \`language\`, \`alwaysThinkingEnabled\`
|
|
866
|
+
- \`permissions.defaultMode\`
|
|
867
|
+
|
|
868
|
+
**Edit settings.json directly** for:
|
|
869
|
+
- Hooks (PreToolUse, PostToolUse, etc.)
|
|
870
|
+
- Complex permission rules (allow/deny arrays)
|
|
871
|
+
- Environment variables
|
|
872
|
+
- MCP server configuration
|
|
873
|
+
- Plugin configuration
|
|
874
|
+
|
|
875
|
+
## Workflow
|
|
876
|
+
|
|
877
|
+
1. **Clarify intent** - Ask if the request is ambiguous
|
|
878
|
+
2. **Read existing file** - Use Read tool on the target settings file
|
|
879
|
+
3. **Merge carefully** - Preserve existing settings, especially arrays
|
|
880
|
+
4. **Edit file** - Use Edit tool (if file doesn't exist, ask user to create it first)
|
|
881
|
+
5. **Confirm** - Tell user what was changed
|
|
882
|
+
|
|
883
|
+
## Merging Arrays (Important!)
|
|
884
|
+
|
|
885
|
+
When adding to permission arrays or hook arrays, **merge with existing**, don't replace:
|
|
886
|
+
|
|
887
|
+
**WRONG** (replaces existing permissions):
|
|
888
|
+
\`\`\`json
|
|
889
|
+
{ "permissions": { "allow": ["Bash(npm:*)"] } }
|
|
890
|
+
\`\`\`
|
|
891
|
+
|
|
892
|
+
**RIGHT** (preserves existing + adds new):
|
|
893
|
+
\`\`\`json
|
|
894
|
+
{
|
|
895
|
+
"permissions": {
|
|
896
|
+
"allow": [
|
|
897
|
+
"Bash(git:*)", // existing
|
|
898
|
+
"Edit(.claudin)", // existing
|
|
899
|
+
"Bash(npm:*)" // new
|
|
900
|
+
]
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
\`\`\`
|
|
904
|
+
|
|
905
|
+
${yC}
|
|
906
|
+
|
|
907
|
+
${ZW}
|
|
908
|
+
|
|
909
|
+
${bW}
|
|
910
|
+
|
|
911
|
+
## Example Workflows
|
|
912
|
+
|
|
913
|
+
### Adding a Hook
|
|
914
|
+
|
|
915
|
+
User: "Format my code after Claude writes it"
|
|
916
|
+
|
|
917
|
+
1. **Clarify**: Which formatter? (prettier, gofmt, etc.)
|
|
918
|
+
2. **Read**: \`.claudin/settings.json\` (or create if missing)
|
|
919
|
+
3. **Merge**: Add to existing hooks, don't replace
|
|
920
|
+
4. **Result**:
|
|
921
|
+
\`\`\`json
|
|
922
|
+
{
|
|
923
|
+
"hooks": {
|
|
924
|
+
"PostToolUse": [{
|
|
925
|
+
"matcher": "Write|Edit",
|
|
926
|
+
"hooks": [{
|
|
927
|
+
"type": "command",
|
|
928
|
+
"command": "jq -r '.tool_response.filePath // .tool_input.file_path' | { read -r f; prettier --write \\"$f\\"; } 2>/dev/null || true"
|
|
929
|
+
}]
|
|
930
|
+
}]
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
\`\`\`
|
|
934
|
+
|
|
935
|
+
### Adding Permissions
|
|
936
|
+
|
|
937
|
+
User: "Allow npm commands without prompting"
|
|
938
|
+
|
|
939
|
+
1. **Read**: Existing permissions
|
|
940
|
+
2. **Merge**: Add \`Bash(npm:*)\` to allow array
|
|
941
|
+
3. **Result**: Combined with existing allows
|
|
942
|
+
|
|
943
|
+
### Environment Variables
|
|
944
|
+
|
|
945
|
+
User: "Set DEBUG=true"
|
|
946
|
+
|
|
947
|
+
1. **Decide**: User settings (global) or project settings?
|
|
948
|
+
2. **Read**: Target file
|
|
949
|
+
3. **Merge**: Add to env object
|
|
950
|
+
\`\`\`json
|
|
951
|
+
{ "env": { "DEBUG": "true" } }
|
|
952
|
+
\`\`\`
|
|
953
|
+
|
|
954
|
+
## Common Mistakes to Avoid
|
|
955
|
+
|
|
956
|
+
1. **Replacing instead of merging** - Always preserve existing settings
|
|
957
|
+
2. **Wrong file** - Ask user if scope is unclear
|
|
958
|
+
3. **Invalid JSON** - Validate syntax after changes
|
|
959
|
+
4. **Forgetting to read first** - Always read before write
|
|
960
|
+
|
|
961
|
+
## Troubleshooting Hooks
|
|
962
|
+
|
|
963
|
+
If a hook isn't running:
|
|
964
|
+
1. **Check the settings file** - Read ~/.claudin/settings.json or .claudin/settings.json
|
|
965
|
+
2. **Verify JSON syntax** - Invalid JSON silently fails
|
|
966
|
+
3. **Check the matcher** - Does it match the tool name? (e.g., "Bash", "Write", "Edit")
|
|
967
|
+
4. **Check hook type** - Is it "command", "prompt", or "agent"?
|
|
968
|
+
5. **Test the command** - Run the hook command manually to see if it works
|
|
969
|
+
6. **Use --debug** - Run \`claude --debug\` to see hook execution logs
|
|
970
|
+
`;function YW(){i({name:"update-config",description:'Use this skill to configure the Claude Code harness via settings.json. Automated behaviors ("from now on when X", "each time X", "whenever X", "before/after X") require hooks configured in settings.json - the harness executes these, not Claude, so memory/preferences cannot fulfill them. Also use for: permissions ("allow X", "add permission", "move permission to"), env vars ("set X=Y"), hook troubleshooting, or any changes to settings.json/settings.local.json files. Examples: "allow npm commands", "add bq permission to global settings", "move permission to user settings", "set DEBUG=true", "when claude stops show X". For simple settings like theme/model, use Config tool.',allowedTools:["Read"],userInvocable:!0,async getPromptForCommand(G){if(G.startsWith("[hooks-only]")){let Z=G.slice(12).trim(),b=ZW+`
|
|
971
|
+
|
|
972
|
+
`+bW;if(Z)b+=`
|
|
973
|
+
|
|
974
|
+
## Task
|
|
975
|
+
|
|
976
|
+
${Z}`;return[{type:"text",text:b}]}let B=HC(),I=JC;if(I+=`
|
|
977
|
+
|
|
978
|
+
## Full Settings JSON Schema
|
|
979
|
+
|
|
980
|
+
\`\`\`json
|
|
981
|
+
${B}
|
|
982
|
+
\`\`\``,G)I+=`
|
|
983
|
+
|
|
984
|
+
## User Request
|
|
985
|
+
|
|
986
|
+
${G}`;return[{type:"text",text:I}]}})}gG();var RC=`**Verification is runtime observation.** You build the app, run it,
|
|
987
|
+
drive it to where the changed code executes, and capture what you
|
|
988
|
+
see. That capture is your evidence. Nothing else is.
|
|
989
|
+
|
|
990
|
+
**Don't run tests. Don't typecheck.** Running them here proves you
|
|
991
|
+
can run CI — not that the change works. Not as a warm-up,
|
|
992
|
+
not "just to be sure," not as a regression sweep after. The time
|
|
993
|
+
goes to running the app instead.
|
|
994
|
+
|
|
995
|
+
**Don't import-and-call.** \`import { foo } from './src/...'\` then
|
|
996
|
+
\`console.log(foo(x))\` is a unit test you wrote. The function did what
|
|
997
|
+
the function does — you knew that from reading it. The app never ran.
|
|
998
|
+
Whatever calls \`foo\` in the real codebase ends at a CLI, a socket, or
|
|
999
|
+
a window. Go there.
|
|
1000
|
+
|
|
1001
|
+
## Find the change
|
|
1002
|
+
|
|
1003
|
+
The scope is what you're verifying — usually a diff, sometimes just
|
|
1004
|
+
"does X work." In a git repo, establish the full range (a branch may
|
|
1005
|
+
be many commits, or the change may still be uncommitted):
|
|
1006
|
+
|
|
1007
|
+
\`\`\`bash
|
|
1008
|
+
git log --oneline @{u}.. # count commits (if upstream set)
|
|
1009
|
+
git diff @{u}.. --stat # full range, not HEAD~1
|
|
1010
|
+
git diff origin/HEAD... --stat # no upstream: committed vs base
|
|
1011
|
+
git diff HEAD --stat # uncommitted: working tree vs HEAD
|
|
1012
|
+
gh pr diff # if in a PR context
|
|
1013
|
+
\`\`\`
|
|
1014
|
+
|
|
1015
|
+
State the commit count. Large diff truncating? Redirect to a file
|
|
1016
|
+
then Read it. Repo but no diff from any of these → say so, stop.
|
|
1017
|
+
**No repo → the scope is whatever the user named; ask if they
|
|
1018
|
+
didn't.**
|
|
1019
|
+
|
|
1020
|
+
**The diff is ground truth. Any description is a claim about it.**
|
|
1021
|
+
Read both. If they disagree, that's a finding.
|
|
1022
|
+
|
|
1023
|
+
## Surface
|
|
1024
|
+
|
|
1025
|
+
The surface is where a user — human or programmatic — meets the
|
|
1026
|
+
change. That's where you observe.
|
|
1027
|
+
|
|
1028
|
+
| Change reaches | Surface | You |
|
|
1029
|
+
|---|---|---|
|
|
1030
|
+
| CLI / TUI | terminal | type the command, capture the pane — [example](examples/cli.md) |
|
|
1031
|
+
| Server / API | socket | send the request, capture the response — [example](examples/server.md) |
|
|
1032
|
+
| GUI | pixels | drive it under xvfb/Playwright, screenshot |
|
|
1033
|
+
| Library | package boundary | sample code through the public export — \`import pkg\`, not \`import ./src/...\` |
|
|
1034
|
+
| Prompt / agent config | the agent | run the agent, capture its behavior |
|
|
1035
|
+
| CI workflow | Actions | dispatch it, read the run |
|
|
1036
|
+
|
|
1037
|
+
**Internal function? Not a surface.** Something in the repo calls it
|
|
1038
|
+
and that caller ends at one of the rows above. Follow it there. A
|
|
1039
|
+
bash security gate's surface isn't the function's return value — it's
|
|
1040
|
+
the CLI prompting or auto-allowing when you type the command.
|
|
1041
|
+
|
|
1042
|
+
**No runtime surface at all** — docs-only, type declarations with no
|
|
1043
|
+
emit, build config that produces no behavioral diff — report
|
|
1044
|
+
**SKIP — no runtime surface: (reason).** Don't run tests to fill
|
|
1045
|
+
the space.
|
|
1046
|
+
|
|
1047
|
+
**Tests in the diff are the author's evidence, not a surface.** CI
|
|
1048
|
+
runs them. You'd be re-running CI. Tests-only PR → SKIP, one line.
|
|
1049
|
+
Mixed src+tests → verify the src, ignore the test files. Reading a
|
|
1050
|
+
test to learn what to check is fine — it's a spec. But then go run
|
|
1051
|
+
the app. Checking that assertions match source is code review.
|
|
1052
|
+
|
|
1053
|
+
## Get a handle
|
|
1054
|
+
|
|
1055
|
+
**Check \`.claudin/skills/\` first — even if you already know how to
|
|
1056
|
+
build and run.** A matching \`verifier-*\` skill is the repo's
|
|
1057
|
+
evidence-capture protocol: it wraps the session so a reviewer can
|
|
1058
|
+
replay what you saw (recording, screenshots). Drive the surface
|
|
1059
|
+
without it and you get a verdict with no replay.
|
|
1060
|
+
|
|
1061
|
+
\`\`\`bash
|
|
1062
|
+
ls .claudin/skills/
|
|
1063
|
+
\`\`\`
|
|
1064
|
+
|
|
1065
|
+
- **\`verifier-*\` matching your surface** (CLI verifier for a CLI
|
|
1066
|
+
change, etc.) → invoke it with the Skill tool and follow its
|
|
1067
|
+
setup. Mismatched surface → skip that one, try the next. Stale
|
|
1068
|
+
verifier (fails on mechanics unrelated to the change) → ask the
|
|
1069
|
+
user whether to patch it; don't FAIL the change for verifier rot.
|
|
1070
|
+
- **\`run-*\` but no matching verifier** → use its build/launch
|
|
1071
|
+
primitives as your handle.
|
|
1072
|
+
- **Neither** → cold start from README/package.json/Makefile. Timebox
|
|
1073
|
+
~15min. Stuck → BLOCKED with exactly where it stopped. Got through →
|
|
1074
|
+
note the working build/launch recipe so it can become a
|
|
1075
|
+
\`verifier-*\` skill.
|
|
1076
|
+
|
|
1077
|
+
## Drive it
|
|
1078
|
+
|
|
1079
|
+
Smallest path that makes the changed code execute:
|
|
1080
|
+
|
|
1081
|
+
- Changed a flag? Run with it.
|
|
1082
|
+
- Changed a handler? Hit that route.
|
|
1083
|
+
- Changed error handling? Trigger the error.
|
|
1084
|
+
- Changed an internal function? Find the CLI command / request / render
|
|
1085
|
+
that reaches it. Run that.
|
|
1086
|
+
|
|
1087
|
+
**Read your plan back before running.** If every step is build /
|
|
1088
|
+
typecheck / run test file — you've planned a CI rerun, not a
|
|
1089
|
+
verification. Find a step that reaches the surface or report BLOCKED.
|
|
1090
|
+
|
|
1091
|
+
**The verdict is table stakes. Your observations are the signal.**
|
|
1092
|
+
A PASS with three sharp "hey, I noticed…" lines is worth more than a
|
|
1093
|
+
bare PASS. You're the only reviewer who actually *ran* the thing —
|
|
1094
|
+
anything that made you pause, work around, or go "huh" is information
|
|
1095
|
+
the author doesn't have. Don't filter for "is this a bug." Filter for
|
|
1096
|
+
"would I mention this if they were sitting next to me."
|
|
1097
|
+
|
|
1098
|
+
**End-to-end, through the real interface.** Pieces passing in
|
|
1099
|
+
isolation doesn't mean the flow works — seams are where bugs hide.
|
|
1100
|
+
If users click buttons, test by clicking buttons, not by curling the
|
|
1101
|
+
API underneath.
|
|
1102
|
+
|
|
1103
|
+
**Destructive path?** If the change touches code that deletes,
|
|
1104
|
+
publishes, sends, or writes outside the workspace and there's no
|
|
1105
|
+
dry-run or safe target, don't drive it live. Verify what you can
|
|
1106
|
+
around it and say which path you didn't exercise and why.
|
|
1107
|
+
|
|
1108
|
+
## Push on it
|
|
1109
|
+
|
|
1110
|
+
The claim checked out — that's the first half. Confirming is step
|
|
1111
|
+
one, not the job. The description is what the author intended;
|
|
1112
|
+
your value is what they didn't.
|
|
1113
|
+
|
|
1114
|
+
You know exactly what changed. Probe *around* it, at the same
|
|
1115
|
+
surface you just drove:
|
|
1116
|
+
|
|
1117
|
+
- **New flag / option** → empty value, passed twice, combined with a
|
|
1118
|
+
conflicting flag, typo'd (does the error name it?)
|
|
1119
|
+
- **New handler / route** → wrong method, malformed body, missing
|
|
1120
|
+
required field, oversized payload
|
|
1121
|
+
- **Changed error path** → the adjacent errors it didn't touch —
|
|
1122
|
+
did the refactor catch them too, or only the one in the diff?
|
|
1123
|
+
- **Interactive / TUI** → Ctrl-C mid-op, resize the pane, paste
|
|
1124
|
+
garbage, rapid-fire the key, Esc at the wrong moment
|
|
1125
|
+
- **State / persistence** → do it twice, do it with stale state
|
|
1126
|
+
underneath, do it in two sessions at once
|
|
1127
|
+
- **Wander** → what's adjacent? What looked off while you were
|
|
1128
|
+
confirming? Go back to it.
|
|
1129
|
+
|
|
1130
|
+
These aren't a checklist — pick the ones the change points at. Stop
|
|
1131
|
+
when you've covered the obvious adjacents or hit something worth a
|
|
1132
|
+
⚠️. A probe that finds nothing is still a step: "\uD83D\uDD0D passed \`--from ''\`
|
|
1133
|
+
→ clean \`error: --from requires a value\`, exit 2." That the author
|
|
1134
|
+
didn't test it is exactly why it's worth knowing it holds.
|
|
1135
|
+
|
|
1136
|
+
Still not a test run. You're at the surface, typing what a user
|
|
1137
|
+
would type wrong.
|
|
1138
|
+
|
|
1139
|
+
## Capture
|
|
1140
|
+
|
|
1141
|
+
Stdout, response bodies, screenshots, pane dumps. Captured output is
|
|
1142
|
+
evidence; your memory isn't. Something unexpected? Don't route around
|
|
1143
|
+
it — capture, note, decide if it's the change or the environment.
|
|
1144
|
+
Unrelated breakage is a finding, not noise.
|
|
1145
|
+
|
|
1146
|
+
Shared process state (tmux, ports, lockfiles) — isolate. \`tmux -L
|
|
1147
|
+
name\`, bind \`:0\`, \`mktemp -d\`. You share a namespace with your host.
|
|
1148
|
+
|
|
1149
|
+
## Report
|
|
1150
|
+
|
|
1151
|
+
Inline, final message:
|
|
1152
|
+
|
|
1153
|
+
\`\`\`
|
|
1154
|
+
## Verification: <one-line what changed>
|
|
1155
|
+
|
|
1156
|
+
**Verdict:** PASS | FAIL | BLOCKED | SKIP
|
|
1157
|
+
|
|
1158
|
+
**Claim:** <what it's supposed to do — your read of the diff and/or
|
|
1159
|
+
the stated claim; note any mismatch>
|
|
1160
|
+
|
|
1161
|
+
**Method:** <how you got a handle — which verifier/run skill, or
|
|
1162
|
+
cold start; what you launched>
|
|
1163
|
+
|
|
1164
|
+
### Steps
|
|
1165
|
+
|
|
1166
|
+
Each step is one thing you did to the **running app** and what it
|
|
1167
|
+
showed. Build/install/checkout are setup, not steps. Test runs and
|
|
1168
|
+
typecheck don't belong here — they're CI's output.
|
|
1169
|
+
|
|
1170
|
+
1. ✅/❌/⚠️/\uD83D\uDD0D <what you did to the running app> → <what you observed>
|
|
1171
|
+
<evidence: the app's own output — pane capture, response body,
|
|
1172
|
+
screenshot path>
|
|
1173
|
+
|
|
1174
|
+
\uD83D\uDD0D marks a probe — a step off the claim's happy path, trying to
|
|
1175
|
+
break it. At least one. A Steps list that's all ✅ and no \uD83D\uDD0D is a
|
|
1176
|
+
happy-path replay: still PASS, but you stopped at the first half.
|
|
1177
|
+
|
|
1178
|
+
**Screenshot / sample:** <the one frame a reviewer looks at to see
|
|
1179
|
+
the feature — image path for GUI/TUI, code block for library/API;
|
|
1180
|
+
omit for build/types-only>
|
|
1181
|
+
|
|
1182
|
+
### Findings
|
|
1183
|
+
<Things you noticed. Not just bugs — friction, surprises, anything
|
|
1184
|
+
a first-time user would trip on. "Took three tries to find the right
|
|
1185
|
+
flag." "Error message on typo was unhelpful." "Default seems odd for
|
|
1186
|
+
the common case." "Works, but slower than I expected." Lower the bar:
|
|
1187
|
+
if it made you pause, it goes here. But the pause has to be yours,
|
|
1188
|
+
from running the app — not from reading the PR page. A red CI check,
|
|
1189
|
+
a review comment, someone else's bot: visible to anyone already, and
|
|
1190
|
+
you relaying it isn't an observation. Claim/diff mismatch, pre-existing
|
|
1191
|
+
breakage, and env notes also belong.
|
|
1192
|
+
|
|
1193
|
+
Each probe gets a line here even when it held — "\uD83D\uDD0D empty \`--from\`
|
|
1194
|
+
→ clean error" tells the author what *was* covered, which they
|
|
1195
|
+
can't see from a bare PASS.
|
|
1196
|
+
|
|
1197
|
+
Lead with ⚠️ for lines worth interrupting the reviewer for; plain
|
|
1198
|
+
bullets are context. Empty is fine if nothing stuck out — but nothing
|
|
1199
|
+
sticking out is itself rare.>
|
|
1200
|
+
\`\`\`
|
|
1201
|
+
|
|
1202
|
+
**Verdicts:**
|
|
1203
|
+
- **PASS** — you ran the app, the change did what it should at its
|
|
1204
|
+
surface. Not: tests pass, builds clean, code looks right.
|
|
1205
|
+
- **FAIL** — you ran it and it doesn't. Or it breaks something else.
|
|
1206
|
+
Or claim and diff disagree materially.
|
|
1207
|
+
- **BLOCKED** — couldn't reach a state where the change is observable.
|
|
1208
|
+
Build broke, env missing a dep, handle wouldn't come up. Not a
|
|
1209
|
+
verdict on the change. Say exactly where it stopped.
|
|
1210
|
+
- **SKIP** — no runtime surface exists. Docs-only, types-only,
|
|
1211
|
+
tests-only. Nothing went wrong; there's just nothing here to run.
|
|
1212
|
+
One line why.
|
|
1213
|
+
|
|
1214
|
+
No partial pass. "3 of 4 passed" is FAIL until 4 passes or is
|
|
1215
|
+
explained away.
|
|
1216
|
+
|
|
1217
|
+
**When in doubt, FAIL.** False PASS ships broken code; false FAIL
|
|
1218
|
+
costs one more human look. Ambiguous output is FAIL with the raw
|
|
1219
|
+
capture attached — don't interpret.`;function WW(){i({name:"verify",description:"Verify a change works by building the app, running it, driving it to the changed code, and capturing what you observe.",whenToUse:"When the user wants to confirm a fix/feature actually works at runtime (not just that tests pass).",userInvocable:!0,disableModelInvocation:!1,files:tY,async getPromptForCommand(){return[{type:"text",text:RC}]}})}function XW(){YW(),pY(),EY(),$Y(),hY(),GW(),WW(),eY(),OY(),rY()}async function qW(G){let{options:B,ctx:I,permissionMode:Z,allowDangerouslySkipPermissions:b,sessionId:Y}=G;T("[STARTUP] Running setup()...");let W=Date.now(),{setup:X}=await import("./setup-0.5.7-s4yfpbyd.mjs"),H=void 0,V=$I();if(process.env.CLAUDE_CODE_ENTRYPOINT!=="local-agent")jY(),XW();let C=X(V,Z,b,I.worktreeEnabled,I.worktreeName,I.tmuxEnabled,Y?PG(Y):void 0,I.worktreePRNumber,H),y=I.worktreeEnabled?null:vI(V),R=I.worktreeEnabled?null:xI(V);return y?.catch(()=>{}),R?.catch(()=>{}),await C,T(`[STARTUP] setup() completed in ${Date.now()-W}ms`),{preSetupCwd:V,commandsPromise:y,agentDefsPromise:R}}async function kW(G){let{options:B,ctx:I,outputFormat:Z,fallbackModel:b,preSetupCwd:Y,commandsPromise:W,agentDefsPromise:X}=G,H=!!B.replayUserMessages;if(RB())wB(),QW(),FW(),RW();let V=B.name?.trim();if(V)MW(V);let C=B.model==="default"?UB():B.model,y=b==="default"?UB():b,R=I.worktreeEnabled?$I():Y;T("[STARTUP] Loading commands and agents...");let g=Date.now(),[z,j]=await Promise.all([W??vI(R),X??xI(R)]);return T(`[STARTUP] Commands and agents loaded in ${Date.now()-g}ms`),{effectiveReplayUserMessages:H,sessionNameArg:V,userSpecifiedModel:C,userSpecifiedFallbackModel:y,currentCwd:R,commands:z,agentDefinitionsResult:j}}async function hW(G,B){let{options:I,ctx:Z,isNonInteractiveSession:b,agentCli:Y,agentsJson:W,userSpecifiedModel:X,agentDefinitionsResult:H}=G,{systemPrompt:V,appendSystemPrompt:C,inputPrompt:y}=G,{coordinatorModeModule:R,assistantModule:g}=B,z=[];if(W)try{let U=zB(W);if(U)z=jW(U,"flagSettings")}catch(U){KG(U)}let j=[...H.allAgents,...z],L={...H,allAgents:j,activeAgents:NW(j)},w=Y??EG().agent,Q;if(w){if(Q=L.activeAgents.find((U)=>U.agentType===w),!Q)T(`Warning: agent "${w}" not found. Available agents: ${L.activeAgents.map((U)=>U.agentType).join(", ")}. Using default behavior.`)}if(yW(Q?.agentType),Q)v("tengu_agent_flag",{agentType:hI(Q)?Q.agentType:"custom",...Y&&{source:"cli"}});if(Q?.agentType)SW(Q.agentType);if(b&&Q&&!V&&!hI(Q)){let U=Q.getSystemPrompt();if(U)V=U}if(Q?.initialPrompt){if(typeof y==="string")y=y?`${Q.initialPrompt}
|
|
1220
|
+
|
|
1221
|
+
${y}`:Q.initialPrompt;else if(!y)y=Q.initialPrompt}let q=X;if(!q&&Q?.model&&Q.model!=="inherit")q=jB(Q.model);CW(q),HW(gW()||null);let E=VW(),c=jB(E??UB()),f;if(AB()){let U=dG()?I.advisor:void 0;if(U){if(T(`[AdvisorTool] --advisor ${U}`),!LW(c))process.stderr.write(x.red(`Error: The model "${c}" does not support the advisor tool.
|
|
1222
|
+
`)),process.exit(1);let h=KW(jB(U));if(!wW(h))process.stderr.write(x.red(`Error: The model "${U}" cannot be used as an advisor.
|
|
1223
|
+
`)),process.exit(1)}if(f=dG()?U??AW():U,f)T(`[AdvisorTool] Advisor model: ${f}`)}if(LG()&&Z.storedTeammateOpts?.agentId&&Z.storedTeammateOpts?.agentName&&Z.storedTeammateOpts?.teamName&&Z.storedTeammateOpts?.agentType){let U=L.activeAgents.find((h)=>h.agentType===Z.storedTeammateOpts?.agentType);if(U){let h;if(U.source==="built-in")T(`[teammate] Built-in agent ${Z.storedTeammateOpts.agentType} - skipping custom prompt (not supported)`);else h=U.getSystemPrompt();if(U.memory)v("tengu_agent_memory_loaded",{scope:U.memory,source:"teammate"});if(h){let F=`
|
|
1224
|
+
# Custom Agent Instructions
|
|
1225
|
+
${h}`;C=C?`${C}
|
|
1226
|
+
|
|
1227
|
+
${F}`:F}}else T(`[teammate] Custom agent ${Z.storedTeammateOpts.agentType} not found in available agents`)}return AG(I),{agentDefinitions:L,mainThreadAgentDefinition:Q,cliAgents:z,agentSetting:w,effectiveModel:q,initialMainLoopModel:E,resolvedInitialModel:c,advisorModel:f,systemPrompt:V,appendSystemPrompt:C,inputPrompt:y}}JG();PI();bI();bb();UW();_W();jG();NC();var lW=MZ(FC(),1);QC();BB();async function xW(G,B){let{InvalidSettingsDialog:I}=await import("./InvalidSettingsDialog-0.5.7-d59ky2sv.mjs");return SB(G,(Z)=>HG(I,{settingsErrors:B.settingsErrors,onContinue:Z,onExit:B.onExit}))}async function vW(G){let{TeleportResumeWrapper:B}=await import("./TeleportResumeWrapper-0.5.7-3r5mn1za.mjs");return SB(G,(I)=>HG(B,{onComplete:I,onCancel:()=>I(null),source:"cliArg"}))}async function DW(G,B){let{TeleportRepoMismatchDialog:I}=await import("./TeleportRepoMismatchDialog-0.5.7-s29rrsak.mjs");return SB(G,(Z)=>HG(I,{targetRepo:B.targetRepo,initialPaths:B.initialPaths,onSelectPath:Z,onCancel:()=>Z(null)}))}async function PW(G,B,I,Z){let[b,{ResumeConversation:Y},{App:W}]=await Promise.all([I,import("./ResumeConversation-0.5.7-hpgm4f1s.mjs"),import("./App-0.5.7-k8c6xsbz.mjs")]);await WG(G,HG(W,{getFpsMetrics:B.getFpsMetrics,stats:B.stats,initialState:B.initialState,children:HG($W,{children:HG(Y,{...Z,worktreePaths:b})})}))}async function mW(G){let{permissionMode:B,allowDangerouslySkipPermissions:I,commands:Z,devChannels:b,remoteControlOption:Y,mainThreadAgentDefinition:W}=G,X=G.prompt,H=G.inputPrompt,V=dW(!1),C=V.getFpsMetrics,y=V.stats,{createRoot:R}=await import("./ink-0.5.7-dwmx157s.mjs"),g=await R(V.renderOptions);v("tengu_timer",{event:"startup",durationMs:Math.round(process.uptime()*1000)});let z=await uW(g,B,I,Z,b),j=!1;if(z&&typeof X==="string"&&X.trim().toLowerCase()==="/login")X="";if(z)cW(),OW(),fW(),TW(),import("./trustedDevice-0.5.7-5qbzragc.mjs").then((w)=>{return w.clearTrustedDeviceToken(),w.enrollTrustedDevice()});try{let{getActiveProviderProfile:w,getProviderProfiles:Q}=await import("./providerProfiles-0.5.7-dz70g8ys.mjs");if(!(Q().length>0||Boolean(w()))&&!z){let{showSetupDialog:E}=await import("./interactiveHelpers-0.5.7-zbfkwcsb.mjs"),{ProviderManager:c}=await import("./ProviderManager-0.5.7-92navbez.mjs");await E(g,(f)=>lW.default.createElement(c,{mode:"first-run",onDone:()=>f()}))}}catch(w){T(`[provider-wizard] auto-wizard failed: ${w instanceof Error?w.message:String(w)}`)}try{let{tryGetActiveProvider:w}=await import("./activeProvider-0.5.7-8emdm8j8.mjs");if(w()&&process.stdout.isTTY&&process.env.CLAUDIN_CLEAR_ON_START==="1"){let{clearTerminal:Q}=await import("./clearTerminal-0.5.7-mbqev32s.mjs");process.stdout.write(Q)}}catch(w){T(`[startup-clear] failed: ${w instanceof Error?w.message:String(w)}`)}let L=await EW();if(!L.valid)await o(g,L.message);return{root:g,getFpsMetrics:C,stats:y,remoteControl:j,prompt:X,inputPrompt:H}}TC();JG();_W();mb();jG();FG();PI();MC();fC();cC();$C();xC();_C();pb();YI();FI();LB();OC();aW();IG();EC();jC();hC();UC();kC();wC();UG();LC();sG();uI();vC();AC();yB();XY();DC();qC();PC();SC();async function A2(G){let{ctx:B,root:I,isNonInteractiveSession:Z,dynamicMcpConfig:b,mcpConfigPromise:Y}=G;if(process.exitCode!==void 0)return T("Graceful shutdown initiated, skipping further initialization"),{exited:!0};if(Y2())W2();if(!Z){let{errors:g}=sW(),z=g.filter((L)=>!L.mcpErrorMetadata),j=DG()?.transport;if(z.length>0&&j!=="openai_compat"&&j!=="codex_responses"&&j!=="github_copilot")await xW(I,{settingsErrors:z,onExit:()=>WB(1)})}let W=iG("tengu_cicada_nap_ms",0),X=hG().startupPrefetchedAt??0,H=$G()||W>0&&Date.now()-X<W;if(X2(),oW(),!H){let g=X>0?` last ran ${Math.round((Date.now()-X)/1000)}s ago`:"";if(T(`Starting background startup prefetches${g}`),G2().catch((z)=>KG(z)),Q2(),z2(),!iG("tengu_miraculo_the_bard",!1))tW();else _I();if(W>0)fI((z)=>({...z,startupPrefetchedAt:Date.now()}))}else T(`Skipping startup prefetches, last ran ${Math.round((Date.now()-X)/1000)}s ago`),_I();if(!Z){let{refreshExampleCommands:g}=await import("./exampleCommands-0.5.7-3dtjxdad.mjs");g()}let{servers:V}=await Y,C={...V,...b},y={},R={};for(let[g,z]of Object.entries(C)){let j=z;if(j.type==="sdk")y[g]=j;else R[g]=j}return{exited:!1,allMcpConfigs:C,sdkMcpConfigs:y,regularMcpConfigs:R}}function S2(G,B){let{options:I,ctx:Z,isNonInteractiveSession:b,regularMcpConfigs:Y,claudeaiConfigPromise:W,mainThreadAgentDefinition:X,resolvedInitialModel:H,initOnly:V,init:C,maintenance:y,prompt:R,inputPrompt:g,verbose:z,debug:j,debugToStderr:L,print:w,outputFormat:Q,inputFormat:q,allowedTools:E,disallowedTools:c,allMcpConfigs:f,dangerouslySkipPermissions:U,permissionMode:h,allowDangerouslySkipPermissions:F,systemPrompt:S,appendSystemPrompt:m,toolPermissionContext:$,sessionNameArg:p}=G,{assistantModule:d,coordinatorModeModule:_}=B,A=b?Promise.resolve({clients:[],tools:[],commands:[]}):cI(Y),D=b?Promise.resolve({clients:[],tools:[],commands:[]}):W.then((a)=>Object.keys(a).length>0?cI(a):{clients:[],tools:[],commands:[]}),O=Promise.all([A,D]).then(([a,zG])=>({clients:[...a.clients,...zG.clients],tools:OI([...a.tools,...zG.tools],"name"),commands:OI([...a.commands,...zG.commands],"name")})),l=V||C||y||b||I.continue||I.resume?null:V2("startup",{agentType:X?.agentType,model:H}),BG=[];O.catch(()=>{});let u=[],P=[],YG=[],K=B2(),t=K!==!1?{type:"adaptive"}:{type:"disabled"};if(I.thinking==="adaptive"||I.thinking==="enabled")K=!0,t={type:"adaptive"};else if(I.thinking==="disabled")K=!1,t={type:"disabled"};else{let a=process.env.MAX_THINKING_TOKENS?parseInt(process.env.MAX_THINKING_TOKENS,10):I.maxThinkingTokens;if(a!==void 0){if(a>0)K=!0,t={type:"enabled",budgetTokens:a};else if(a===0)K=!1,t={type:"disabled"}}}return TI("info","started",{version:"99.0.0",is_native_binary:iW()}),pW(async()=>{TI("info","exited")}),w2({hasInitialPrompt:Boolean(R),hasStdin:Boolean(g),verbose:z,debug:j,debugToStderr:L,print:w??!1,outputFormat:Q??"text",inputFormat:q??"text",numAllowedTools:E.length,numDisallowedTools:c.length,mcpClientCount:Object.keys(f).length,worktreeEnabled:Z.worktreeEnabled,skipWebFetchPreflight:EG().skipWebFetchPreflight,githubActionInputs:process.env.GITHUB_ACTION_INPUTS,dangerouslySkipPermissionsPassed:U??!1,permissionMode:h,modeIsBypass:h==="bypassPermissions",allowDangerouslySkipPermissionsPassed:F,systemPromptFlag:S?I.systemPromptFile?"file":"flag":void 0,appendSystemPromptFlag:m?I.appendSystemPromptFile?"file":"flag":void 0,thinkingConfig:t,assistantActivationPath:void 0,isCoordinator:_?.isCoordinatorMode()===!0}),K2(Y,$),j2(),J2().then((a)=>{if(!a)return;if(p)R2(p);g2().then((zG)=>{if(zG>=2)v("tengu_concurrent_sessions",{num_sessions:zG})})}),{mcpPromise:O,hooksPromise:l,hookMessages:BG,mcpClients:u,mcpTools:P,mcpCommands:YG,thinkingEnabled:K,thinkingConfig:t}}function M2(G,B){let{options:I,ctx:Z,agentSetting:b,resolvedInitialModel:Y,permissionModeNotification:W,overlyBroadBashPermissions:X,toolPermissionContext:H,initialMainLoopModel:V,agentDefinitions:C,mainThreadAgentDefinition:y,verbose:R,remoteControl:g,remoteControlName:z,advisorModel:j,inputPrompt:L,thinkingEnabled:w,mcpTools:Q}=G,{getTeammateUtils:q}=B;v("tengu_startup_manual_model_config",{cli_flag:I.model,env_var:DG()?.model,settings_file:(EG()||{}).model,subscriptionType:eW(),agent:b});let E=N2(Y),c=[];if(W)c.push({key:"permission-mode-notification",text:W,priority:"high"});if(E)c.push({key:"model-deprecation-warning",text:E,color:"warning",priority:"high"});if(X.length>0){let $=EI(X.map((A)=>A.ruleDisplay)),p=$.join(", "),d=EI(X.map((A)=>A.sourceDisplay)).join(", "),_=$.length;c.push({key:"overly-broad-bash-notification",text:`${p} allow ${TG(_,"rule")} from ${d} ${TG(_,"was","were")} ignored — not available for Ants, please use auto-mode instead`,color:"warning",priority:"high"})}let f={...H,mode:LG()&&q().isPlanModeRequired()?"plan":H.mode},U=!1,h=g||nW()||Z.kairosEnabled,F=!1,S={settings:EG(),tasks:{},agentNameRegistry:new Map,verbose:R??hG().verbose??!1,mainLoopModel:V,mainLoopModelForSession:null,isBriefOnly:U,expandedView:hG().showSpinnerTree?"teammates":hG().showExpandedTodos?"tasks":"none",showTeammateMessagePreview:LG()?!1:void 0,selectedIPAgentIndex:-1,coordinatorTaskIndex:-1,viewSelectionMode:"none",footerSelection:null,toolPermissionContext:f,agent:y?.agentType,agentDefinitions:C,mcp:{clients:[],tools:[],commands:[],resources:{},pluginReconnectKey:0},plugins:{enabled:[],disabled:[],commands:[],errors:[],installationStatus:{marketplaces:[],plugins:[]},needsRefresh:!1},statusLineText:void 0,kairosEnabled:Z.kairosEnabled,remoteSessionUrl:void 0,remoteConnectionStatus:"connecting",remoteBackgroundTaskCount:0,replBridgeEnabled:h||F,replBridgeExplicit:g,replBridgeOutboundOnly:F,replBridgeConnected:!1,replBridgeSessionActive:!1,replBridgeReconnecting:!1,replBridgeConnectUrl:void 0,replBridgeSessionUrl:void 0,replBridgeEnvironmentId:void 0,replBridgeSessionId:void 0,replBridgeError:void 0,replBridgeInitialName:z,showRemoteCallout:!1,notifications:{current:null,queue:c},elicitation:{queue:[]},todos:{},remoteAgentTaskSuggestions:[],fileHistory:{snapshots:[],trackedFiles:new Set,snapshotSequence:0},attribution:b2(),thinkingEnabled:w,promptSuggestionEnabled:C2(),sessionHooks:new Map,inbox:{messages:[]},promptSuggestion:{text:null,promptId:null,shownAt:0,acceptedAt:0,generationRequestId:null},speculation:H2,speculationSessionTimeSavedMs:0,skillImprovement:{suggestion:null},workerSandboxPermissions:{queue:[],selectedIndex:0},pendingWorkerRequest:null,pendingSandboxRequest:null,authVersion:0,initialMessage:L?{message:MB({content:String(L)})}:null,effortValue:I2(I.effort)??Z2(),activeOverlays:new Set,fastMode:rW(Y),...AB()&&j&&{advisorModel:j},teamContext:F2?.()};if(L)y2(String(L));let m=Q;return fI(($)=>({...$,numStartups:($.numStartups??0)+1})),setImmediate(()=>{L2(),U2()}),{initialState:S,initialTools:m}}LB();kG();JG();q2();UG();async function k2(G){let{root:B,options:I,sessionConfig:Z,resumeContext:b,mainThreadAgentDefinitionRef:Y,getFpsMetrics:W,stats:X}=G,H=!1;try{let V=performance.now(),{clearSessionCaches:C}=await import("./caches-0.5.7-w8n6wxaj.mjs");C();let y=await qB(void 0,void 0);if(!y)return v("tengu_continue",{success:!1}),await o(B,"No conversation found to continue");let R=await kB(y,{forkSession:!!I.forkSession,includeAttribution:!0,transcriptPath:y.fullPath},b);if(R.restoredAgentDef)Y.current=R.restoredAgentDef;vG(I),AG(I),v("tengu_continue",{success:!0,resume_duration_ms:Math.round(performance.now()-V)}),H=!0,await yG(B,{getFpsMetrics:W,stats:X,initialState:R.initialState},{...Z,mainThreadAgentDefinition:R.restoredAgentDef??Y.current,initialMessages:R.messages,initialFileHistorySnapshots:R.fileHistorySnapshots,initialContentReplacements:R.contentReplacements,initialAgentName:R.agentName,initialAgentColor:R.agentColor},WG)}catch(V){if(!H)v("tengu_continue",{success:!1});return KG(V),await o(B,GG(V),()=>ZG(1))}}IG();UG();sG();IG();UG();sG();IG();DI();UG();sG();h2();gB();mC();IG();DI();PI();JG();lC();aW();q2();kG();AY();iC();UG();jG();LB();sG();KB();pC();h2();aC();NI();bI();async function r2(G){let{root:B,ctx:I,options:Z,teleport:b,remote:Y,debug:W,debugToStderr:X,commands:H,ide:V,mainThreadAgentDefinitionRef:C,thinkingConfig:y,sessionConfig:R,resumeContext:g,getFpsMetrics:z,stats:j,initialState:L}=G,{clearSessionCaches:w}=await import("./caches-0.5.7-w8n6wxaj.mjs");w();let Q=null,q=void 0,E=PG(Z.resume),c=void 0,f=null,U=void 0;if(Z.fromPr){if(Z.fromPr===!0)U=!0;else if(typeof Z.fromPr==="string")U=Z.fromPr}if(Z.resume&&typeof Z.resume==="string"&&!E){let F=Z.resume.trim();if(F){let S=await i2(F,{exact:!0});if(S.length===1)f=S[0],E=a2(f)??null;else c=F}}if(Y!==null||b){if(await O2(),!c2("allow_remote_sessions"))return await o(B,"Error: Remote sessions are disabled by your organization's policy.",()=>ZG(1))}if(Y!==null){let F=Y.length>0,S=iG("tengu_remote_backend",!1);if(!S&&!F)return await o(B,`Error: --remote requires a description.
|
|
1228
|
+
Usage: claude --remote "your task description"`,()=>ZG(1));v("tengu_remote_create_session",{has_initial_prompt:String(F)});let m=await D2(),$=await m2(B,F?Y:null,new AbortController().signal,m||void 0);if(!$)return v("tengu_remote_create_session_error",{error:"unable_to_create_session"}),await o(B,"Error: Unable to create remote session",()=>ZG(1));if(v("tengu_remote_create_session_success",{session_id:$.id}),!S)process.stdout.write(`Created remote session: ${$.title}
|
|
1229
|
+
`),process.stdout.write(`View: ${iI($.id)}?m=0
|
|
1230
|
+
`),process.stdout.write(`Resume with: claude --teleport ${$.id}
|
|
1231
|
+
`),await ZG(0),process.exit(0);lI(!0),$2(E2($.id));let p;try{p=await mI()}catch(P){return KG(v2(P)),await o(B,`Error: ${GG(P)||"Failed to authenticate"}`,()=>ZG(1))}let{getClaudeAIOAuthTokens:d}=await import("./auth-0.5.7-ez3n1qpx.mjs"),_=()=>d()?.accessToken??p.accessToken,A=aI($.id,_,p.orgUUID,F),D=`${iI($.id)}?m=0`,O=nG(`/remote-control is active. Code in CLI or at ${D}`,"info"),l=F?MB({content:Y}):null,BG={...L,remoteSessionUrl:D},u=pI(H);await yG(B,{getFpsMetrics:z,stats:j,initialState:BG},{debug:W||X,commands:u,initialTools:[],initialMessages:l?[O,l]:[O],mcpClients:[],autoConnectIdeFlag:V,mainThreadAgentDefinition:C.current,disableSlashCommands:I.disableSlashCommands,remoteSessionConfig:A,thinkingConfig:y},WG);return}else if(b){if(b===!0||b===""){v("tengu_teleport_interactive_mode",{}),T("selectAndResumeTeleportTask: Starting teleport flow...");let F=await vW(B);if(!F)await ZG(0),process.exit(0);let{branchError:S}=await d2(F.branch);Q=u2(F.log,S)}else if(typeof b==="string"){v("tengu_teleport_resume_session",{mode:"direct"});try{let F=await T2(b),S=await l2(F);if(S.status==="mismatch"||S.status==="not_in_repo"){let p=S.sessionRepo;if(p){let d=s2(p),_=await n2(d);if(_.length>0){let A=await DW(B,{targetRepo:p,initialPaths:_});if(A)process.chdir(A),_2(A),hB(A);else await ZG(0)}else throw new $B(`You must run claude --teleport ${b} from a checkout of ${p}.`,x.red(`You must run claude --teleport ${b} from a checkout of ${x.bold(p)}.
|
|
1232
|
+
`))}}else if(S.status==="error")throw new $B(S.errorMessage||"Failed to validate session",x.red(`Error: ${S.errorMessage||"Failed to validate session"}
|
|
1233
|
+
`));await f2();let{teleportWithProgress:m}=await import("./TeleportProgress-0.5.7-xn5z7dt4.mjs"),$=await m(B,b);x2({sessionId:b}),Q=$.messages}catch(F){if(F instanceof $B)process.stderr.write(F.formattedMessage+`
|
|
1234
|
+
`);else KG(F),process.stderr.write(x.red(`Error: ${GG(F)}
|
|
1235
|
+
`));await ZG(1)}}}if(E){let F=E;try{let S=performance.now(),m=await qB(f??F,void 0);if(!m)return v("tengu_session_resumed",{entrypoint:"cli_flag",success:!1}),await o(B,`No conversation found with session ID: ${F}`);let $=f?.fullPath??m.fullPath;if(q=await kB(m,{forkSession:!!Z.forkSession,sessionIdOverride:F,transcriptPath:$},g),q.restoredAgentDef)C.current=q.restoredAgentDef;v("tengu_session_resumed",{entrypoint:"cli_flag",success:!0,resume_duration_ms:Math.round(performance.now()-S)})}catch(S){v("tengu_session_resumed",{entrypoint:"cli_flag",success:!1}),KG(S),await o(B,GG(S))}}if(I.fileDownloadPromise)try{let F=await I.fileDownloadPromise,S=P2(F,(m)=>!m.success);if(S>0)process.stderr.write(x.yellow(`Warning: ${S}/${F.length} file(s) failed to download.
|
|
1236
|
+
`))}catch(F){return await o(B,`Error downloading files: ${GG(F)}`)}let h=q??(Array.isArray(Q)?{messages:Q,fileHistorySnapshots:void 0,agentName:void 0,agentColor:void 0,restoredAgentDef:C.current,initialState:L,contentReplacements:void 0}:void 0);if(h)vG(Z),AG(Z),await yG(B,{getFpsMetrics:z,stats:j,initialState:h.initialState},{...R,mainThreadAgentDefinition:h.restoredAgentDef??C.current,initialMessages:h.messages,initialFileHistorySnapshots:h.fileHistorySnapshots,initialContentReplacements:h.contentReplacements,initialAgentName:h.agentName,initialAgentColor:h.agentColor},WG);else await PW(B,{getFpsMetrics:z,stats:j,initialState:L},p2(dI()),{...R,initialSearchQuery:c,forkSession:Z.forkSession,filterByPr:U})}function sC(G){let B={debug:G.debug||G.debugToStderr,commands:[...G.commands,...G.mcpCommands],initialTools:G.initialTools,mcpClients:G.mcpClients,autoConnectIdeFlag:G.ide,mainThreadAgentDefinition:G.mainThreadAgentDefinition,disableSlashCommands:G.ctx.disableSlashCommands,dynamicMcpConfig:G.dynamicMcpConfig,strictMcpConfig:G.strictMcpConfig,systemPrompt:G.systemPrompt,appendSystemPrompt:G.appendSystemPrompt,taskListId:G.ctx.taskListId,thinkingConfig:G.thinkingConfig},I={modeApi:G.coordinatorModeModule,mainThreadAgentDefinition:G.mainThreadAgentDefinition,agentDefinitions:G.agentDefinitions,currentCwd:G.currentCwd,cliAgents:G.cliAgents,initialState:G.initialState};return{sessionConfig:B,resumeContext:I}}async function t2(G){let{root:B,ctx:I,options:Z,debug:b,debugToStderr:Y,commands:W,ide:X,teleport:H,remote:V,thinkingConfig:C,initialState:y,getFpsMetrics:R,stats:g}=G,z=G.mainThreadAgentDefinition,{sessionConfig:j,resumeContext:L}=sC({ctx:I,debug:b,debugToStderr:Y,commands:W,initialTools:G.initialTools,mcpClients:G.mcpClients,mcpCommands:G.mcpCommands,ide:X,mainThreadAgentDefinition:z,dynamicMcpConfig:G.dynamicMcpConfig,strictMcpConfig:G.strictMcpConfig,systemPrompt:G.systemPrompt,appendSystemPrompt:G.appendSystemPrompt,thinkingConfig:C,coordinatorModeModule:G.coordinatorModeModule,agentDefinitions:G.agentDefinitions,currentCwd:G.currentCwd,cliAgents:G.cliAgents,initialState:y});if(Z.continue){let q={current:z};return await k2({root:B,options:Z,sessionConfig:j,resumeContext:L,mainThreadAgentDefinitionRef:q,getFpsMetrics:R,stats:g}),z=q.current,{handled:!0,mainThreadAgentDefinition:z,sessionConfig:j}}let w=b,Q=Y;if(Z.resume||Z.fromPr||H||V!==null){let q={current:z};return await r2({root:B,ctx:I,options:Z,teleport:H,remote:V,debug:w,debugToStderr:Q,commands:W,ide:X,mainThreadAgentDefinitionRef:q,thinkingConfig:C,sessionConfig:j,resumeContext:L,getFpsMetrics:R,stats:g,initialState:y}),z=q.current,{handled:!0,mainThreadAgentDefinition:z,sessionConfig:j}}return{handled:!1,mainThreadAgentDefinition:z,sessionConfig:j}}M("main_tsx_entry");bX();YX();var o2=()=>(IH(),s(BH)),jH=()=>(HH(),s(CH)),UH=()=>(JH(),s(yH)),xB=(bH(),s(ZH)),sI=null,LH=null,wH=()=>(VX(),s(XX)).createSyntheticOutputTool,AH=()=>(VX(),s(XX)).isSyntheticOutputToolEnabled,SH=()=>(mG(),s(nC)).jsonParse;var MH=()=>(oC(),s(tC)).PERMISSION_MODES,e2=()=>(JG(),s(rC)).logEvent,GX=()=>(QH(),s(zH)).initializeVersionedPlugins,BX=()=>(KH(),s(gH)).cleanupOrphanedPluginVersionsInBackground,IX=()=>(VH(),s(XH)).getGlobExclusionsForPluginCache,qH=()=>(uI(),s(CX)).processSessionStartHooks,kH=()=>(uI(),s(CX)).processSetupHooks,hH=()=>(KB(),s(FH)).saveMode,$H=()=>(UG(),s(GH)).gracefulShutdownSync,xH=(WH(),s(YH));M("main_tsx_imports_loaded");if(yX())process.exit(1);async function _9(){M("main_function_start"),process.env.NoDefaultCurrentDirectoryInExePath="1",TZ(),M("main_warning_handler_initialized"),await _Z(YB),await OZ(),cZ(nB),fZ(rB);let G=pZ();if(!G.isInteractive)WX();aZ(G),gX(!G.isInteractive),M("main_client_type_determined"),RX();let B=XB(),I=import("./REPL-0.5.7-6zag11mg.mjs"),Z=import("./App-0.5.7-k8c6xsbz.mjs");$Z(Z,I),M("main_before_run"),await vH(),await B,M("main_after_run")}async function vH(){M("run_function_start");function G(){let b=(Y)=>Y.long?.replace(/^--/,"")??Y.short?.replace(/^-/,"")??"";return Object.assign({sortSubcommands:!0,sortOptions:!0},{compareOptions:(Y,W)=>b(Y).localeCompare(b(W))})}let B=new hZ().configureHelp(G()).enablePositionalOptions();M("run_commander_initialized"),Xb(B),B.name("claude").description("Claude Code - starts an interactive session by default, use -p/--print for non-interactive output").allowExcessArguments().argument("[prompt]","Your prompt",String).helpOption("-h, --help","Display help for command").option("-d, --debug [filter]",'Enable debug mode with optional category filtering (e.g., "api,hooks" or "!1p,!file")',(b)=>{return!0}).addOption(new N("-D, --debug-to-stderr","Enable debug mode (to stderr)").argParser(Boolean).hideHelp()).option("--debug-file <path>","Write debug logs to a specific file path (implicitly enables debug mode)",()=>!0).option("--verbose","Override verbose mode setting from config",()=>!0).option("-p, --print","Print response and exit (useful for pipes). Note: The workspace trust dialog is skipped when Claude is run with the -p mode. Only use this flag in directories you trust.",()=>!0).option("--bare","Minimal mode: skip hooks, LSP, plugin sync, attribution, auto-memory, background prefetches, keychain reads, and CLAUDE.md auto-discovery. Sets CLAUDE_CODE_SIMPLE=1. Anthropic auth is strictly ANTHROPIC_API_KEY or apiKeyHelper via --settings (OAuth and keychain are never read). 3P providers (Bedrock/Vertex/Foundry) use their own credentials. Skills still resolve via /skill-name. Explicitly provide context via: --system-prompt[-file], --append-system-prompt[-file], --add-dir (CLAUDE.md dirs), --mcp-config, --settings, --agents, --plugin-dir.",()=>!0).addOption(new N("--init","Run Setup hooks with init trigger, then continue").hideHelp()).addOption(new N("--init-only","Run Setup and SessionStart:startup hooks, then exit").hideHelp()).addOption(new N("--maintenance","Run Setup hooks with maintenance trigger, then continue").hideHelp()).addOption(new N("--output-format <format>",'Output format (only works with --print): "text" (default), "json" (single result), or "stream-json" (realtime streaming)').choices(["text","json","stream-json"])).addOption(new N("--json-schema <schema>",'JSON Schema for structured output validation. Example: {"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}').argParser(String)).option("--include-hook-events","Include all hook lifecycle events in the output stream (only works with --output-format=stream-json)",()=>!0).option("--include-partial-messages","Include partial message chunks as they arrive (only works with --print and --output-format=stream-json)",()=>!0).addOption(new N("--input-format <format>",'Input format (only works with --print): "text" (default), or "stream-json" (realtime streaming input)').choices(["text","stream-json"])).option("--mcp-debug","[DEPRECATED. Use --debug instead] Enable MCP debug mode (shows MCP server errors)",()=>!0).option("--dangerously-skip-permissions","Bypass all permission checks. Recommended only for sandboxes with no internet access.",()=>!0).option("--allow-dangerously-skip-permissions","Enable bypassing all permission checks as an option, without it being enabled by default. Recommended only for sandboxes with no internet access.",()=>!0).addOption(new N("--thinking <mode>","Thinking mode: enabled, disabled").choices(["enabled","disabled"]).hideHelp()).addOption(new N("--max-thinking-tokens <tokens>","[DEPRECATED. Use --thinking instead for newer models] Maximum number of thinking tokens (only works with --print)").argParser(Number).hideHelp()).addOption(new N("--max-turns <turns>","Maximum number of agentic turns in non-interactive mode. This will early exit the conversation after the specified number of turns. (only works with --print)").argParser(Number).hideHelp()).addOption(new N("--max-budget-usd <amount>","Maximum dollar amount to spend on API calls (only works with --print)").argParser((b)=>{let Y=Number(b);if(isNaN(Y)||Y<=0)throw Error("--max-budget-usd must be a positive number greater than 0");return Y})).addOption(new N("--task-budget <tokens>","API-side task budget in tokens (output_config.task_budget)").argParser((b)=>{let Y=Number(b);if(isNaN(Y)||Y<=0||!Number.isInteger(Y))throw Error("--task-budget must be a positive integer");return Y}).hideHelp()).option("--replay-user-messages","Re-emit user messages from stdin back on stdout for acknowledgment (only works with --input-format=stream-json and --output-format=stream-json)",()=>!0).addOption(new N("--enable-auth-status","Enable auth status messages in SDK mode").default(!1).hideHelp()).option("--allowedTools, --allowed-tools <tools...>",'Comma or space-separated list of tool names to allow (e.g. "Bash(git:*) Edit")').option("--tools <tools...>",'Specify the list of available tools from the built-in set. Use "" to disable all tools, "default" to use all tools, or specify tool names (e.g. "Bash,Edit,Read").').option("--disallowedTools, --disallowed-tools <tools...>",'Comma or space-separated list of tool names to deny (e.g. "Bash(git:*) Edit")').option("--mcp-config <configs...>","Load MCP servers from JSON files or strings (space-separated)").addOption(new N("--permission-prompt-tool <tool>","MCP tool to use for permission prompts (only works with --print)").argParser(String).hideHelp()).addOption(new N("--system-prompt <prompt>","System prompt to use for the session").argParser(String)).addOption(new N("--system-prompt-file <file>","Read system prompt from a file").argParser(String).hideHelp()).addOption(new N("--append-system-prompt <prompt>","Append a system prompt to the default system prompt").argParser(String)).addOption(new N("--append-system-prompt-file <file>","Read system prompt from a file and append to the default system prompt").argParser(String).hideHelp()).addOption(new N("--permission-mode <mode>","Permission mode to use for the session").argParser(String).choices(MH())).option("-c, --continue","Continue the most recent conversation in the current directory",()=>!0).option("-r, --resume [value]","Resume a conversation by session ID, or open interactive picker with optional search term",(b)=>b||!0).option("--fork-session","When resuming, create a new session ID instead of reusing the original (use with --resume or --continue)",()=>!0).addOption(new N("--prefill <text>","Pre-fill the prompt input with text without submitting it").hideHelp()).addOption(new N("--deep-link-origin","Signal that this session was launched from a deep link").hideHelp()).addOption(new N("--deep-link-repo <slug>","Repo slug the deep link ?repo= parameter resolved to the current cwd").hideHelp()).addOption(new N("--deep-link-last-fetch <ms>","FETCH_HEAD mtime in epoch ms, precomputed by the deep link trampoline").argParser((b)=>{let Y=Number(b);return Number.isFinite(Y)?Y:void 0}).hideHelp()).option("--from-pr [value]","Resume a session linked to a PR by PR number/URL, or open interactive picker with optional search term",(b)=>b||!0).option("--no-session-persistence","Disable session persistence - sessions will not be saved to disk and cannot be resumed (only works with --print)").addOption(new N("--resume-session-at <message id>","When resuming, only messages up to and including the assistant message with <message.id> (use with --resume in print mode)").argParser(String).hideHelp()).addOption(new N("--rewind-files <user-message-id>","Restore files to state at the specified user message and exit (requires --resume)").hideHelp()).option("--model <model>","Model for the current session. Provide an alias for the latest model (e.g. 'sonnet' or 'opus') or a model's full name (e.g. 'claude-sonnet-4-6').").option("--provider <provider>","AI provider to use (anthropic, openai, gemini, github, bedrock, vertex, ollama). Reads API keys from environment variables.").addOption(new N("--effort <level>","Effort level for the current session (low, medium, high, max)").argParser((b)=>{let Y=b.toLowerCase(),W=["low","medium","high","max"];if(!W.includes(Y))throw new kZ(`It must be one of: ${W.join(", ")}`);return Y})).option("--agent <agent>","Agent for the current session. Overrides the 'agent' setting.").option("--betas <betas...>","Beta headers to include in API requests (API key users only)").option("--fallback-model <model>","Enable automatic fallback to specified model when default model is overloaded (only works with --print)").option("--settings <file-or-json>","Path to a settings JSON file or a JSON string to load additional settings from").option("--add-dir <directories...>","Additional directories to allow tool access to").option("--ide","Automatically connect to IDE on startup if exactly one valid IDE is available",()=>!0).option("--strict-mcp-config","Only use MCP servers from --mcp-config, ignoring all other MCP configurations",()=>!0).option("--session-id <uuid>","Use a specific session ID for the conversation (must be a valid UUID)").option("-n, --name <name>","Set a display name for this session (shown in /resume and terminal title)").option("--agents <json>",`JSON object defining custom agents (e.g. '{"reviewer": {"description": "Reviews code", "prompt": "You are a code reviewer"}}')`).option("--setting-sources <sources>","Comma-separated list of setting sources to load (user, project, local).").option("--plugin-dir <path>","Load plugins from a directory for this session only (repeatable: --plugin-dir A --plugin-dir B)",(b,Y)=>[...Y,b],[]).option("--disable-slash-commands","Disable all skills",()=>!0).option("--file <specs...>","File resources to download at startup. Format: file_id:relative_path (e.g., --file file_abc:doc.txt file_def:img.png)").action(async(b,Y)=>{M("action_handler_start");let W=EZ({prompt:b,pendingConnect:YB,pendingAssistantChat:nB,pendingSSH:rB}),X=await ZY(b,Y,W,{teammate:{getTeammateUtils:o2,getTeammatePromptAddendum:jH,getTeammateModeSnapshot:UH},assistant:{assistantModule:sI,kairosGate:LH}});b=X.prompt;let{debug:H,debugToStderr:V,dangerouslySkipPermissions:C,allowDangerouslySkipPermissions:y,baseTools:R,allowedTools:g,disallowedTools:z,mcpConfig:j,permissionModeCli:L,addDir:w,fallbackModel:Q,betas:q,ide:E,sessionId:c,includeHookEvents:f,init:U,initOnly:h,maintenance:F,agentsJson:S,agentCli:m,teleport:$,remote:p,remoteControlOption:d,remoteControlName:_,isNonInteractiveSession:A}=X,D=X.outputFormat,O=X.inputFormat,l=X.verbose,BG=X.print,u=X.systemPrompt,P=X.appendSystemPrompt,YG=!1,K=await NY({options:Y,ctx:W,permissionModeCli:L,dangerouslySkipPermissions:C,allowDangerouslySkipPermissions:y,baseTools:R,allowedTools:g,disallowedTools:z,mcpConfig:j,addDir:w,isNonInteractiveSession:A,inputFormat:O,outputFormat:D},{autoModeStateModule:xH}),{permissionMode:t,permissionModeNotification:a,strictMcpConfig:zG,devChannels:vB,claudeaiConfigPromise:nI,mcpConfigPromise:KX,mcpConfigResolvedRef:DH,overlyBroadBashPermissions:zX}=K,rI=K.dynamicMcpConfig,rG=K.toolPermissionContext,SG=await JX(b||"",O??"text");M("action_after_input_prompt"),vG(Y);let _G=HX(rG);if(VG(process.env.CLAUDE_CODE_COORDINATOR_MODE)){let{applyCoordinatorToolFilter:e}=await import("./toolPool-0.5.7-5rd6jp71.mjs");_G=e(_G)}M("action_tools_loaded");let OG;if(AH()({isNonInteractiveSession:A})&&Y.jsonSchema)OG=SH()(Y.jsonSchema);if(OG){let e=wH()(OG);if("tool"in e)_G=[..._G,e.tool],e2()("tengu_structured_output_enabled",{schema_property_count:Object.keys(OG.properties||{}).length});else e2()("tengu_structured_output_failure",{error:"Invalid JSON schema"})}M("action_before_setup");let{preSetupCwd:QX,commandsPromise:FX,agentDefsPromise:NX}=await qW({options:Y,ctx:W,permissionMode:t,allowDangerouslySkipPermissions:y,sessionId:c});M("action_after_setup");let{effectiveReplayUserMessages:jX,sessionNameArg:UX,userSpecifiedModel:LX,userSpecifiedFallbackModel:wX,currentCwd:AX,commands:DB,agentDefinitionsResult:SX}=await kW({options:Y,ctx:W,outputFormat:D,fallbackModel:Q,preSetupCwd:QX,commandsPromise:FX,agentDefsPromise:NX});M("action_commands_loaded");let cG=await hW({options:Y,ctx:W,isNonInteractiveSession:A,agentCli:m,agentsJson:S,userSpecifiedModel:LX,agentDefinitionsResult:SX,systemPrompt:u,appendSystemPrompt:P,inputPrompt:SG},{coordinatorModeModule:xB,assistantModule:sI}),{agentDefinitions:PB,cliAgents:MX,agentSetting:qX,effectiveModel:kX,initialMainLoopModel:hX,resolvedInitialModel:tI,advisorModel:oI}=cG,fG=cG.mainThreadAgentDefinition;u=cG.systemPrompt,P=cG.appendSystemPrompt,SG=cG.inputPrompt;let tG,TB,EB;if(!A){let e=await mW({permissionMode:t,allowDangerouslySkipPermissions:y,commands:DB,devChannels:vB,remoteControlOption:d,mainThreadAgentDefinition:fG,prompt:b,inputPrompt:SG});tG=e.root,TB=e.getFpsMetrics,EB=e.stats,YG=e.remoteControl,b=e.prompt,SG=e.inputPrompt}let eI=await A2({options:Y,ctx:W,root:tG,isNonInteractiveSession:A,dynamicMcpConfig:rI,mcpConfigPromise:KX});if(eI.exited)return;let{allMcpConfigs:$X,sdkMcpConfigs:xX,regularMcpConfigs:GZ}=eI;M("action_mcp_configs_loaded");let vX=S2({options:Y,ctx:W,isNonInteractiveSession:A,regularMcpConfigs:GZ,claudeaiConfigPromise:nI,mainThreadAgentDefinition:fG,resolvedInitialModel:tI,initOnly:h,init:U,maintenance:F,prompt:b,inputPrompt:SG,verbose:l,debug:H,debugToStderr:V,print:BG,outputFormat:D,inputFormat:O,allowedTools:g,disallowedTools:z,allMcpConfigs:$X,dangerouslySkipPermissions:C,permissionMode:t,allowDangerouslySkipPermissions:y,systemPrompt:u,appendSystemPrompt:P,toolPermissionContext:rG,sessionNameArg:UX},{assistantModule:sI,coordinatorModeModule:xB}),{hooksPromise:BZ,hookMessages:oG,mcpClients:IZ,mcpTools:ZZ,mcpCommands:bZ,thinkingConfig:YZ,thinkingEnabled:DX}=vX;if($G());else if(A)await GX()(),M("action_after_plugins_init"),BX()().then(()=>IX()());else GX()().then(async()=>{M("action_after_plugins_init"),await BX()(),IX()()});let PX=h||U?"init":F?"maintenance":null;if(h){wB(),await kH()("init",{forceSyncExecution:!0}),await qH()("startup",{forceSyncExecution:!0}),$H()(0);return}if(A){let{runHeadlessBranch:e}=await import("./headless-0.5.7-9f87m6f5.mjs");await e({ctx:W,options:{continue:Y.continue,resume:Y.resume,sessionPersistence:Y.sessionPersistence,permissionPromptTool:Y.permissionPromptTool,maxTurns:Y.maxTurns,maxBudgetUsd:Y.maxBudgetUsd,taskBudget:Y.taskBudget,forkSession:Y.forkSession,resumeSessionAt:Y.resumeSessionAt,rewindFiles:Y.rewindFiles,enableAuthStatus:Y.enableAuthStatus,effort:Y.effort},teleport:$,setupTrigger:PX,outputFormat:D,inputPrompt:SG,commands:DB,tools:_G,mcpClients:IZ,mcpCommands:bZ,mcpTools:ZZ,sdkMcpConfigs:xX,agentDefinitions:PB,regularMcpConfigs:GZ,claudeaiConfigPromise:nI,toolPermissionContext:rG,effectiveModel:kX,advisorModel:oI,allowDangerouslySkipPermissions:y,betas:q,jsonSchema:OG,allowedTools:g,thinkingConfig:YZ,systemPrompt:u,appendSystemPrompt:P,userSpecifiedFallbackModel:wX,effectiveReplayUserMessages:jX,agentCli:m,verbose:l});return}let TX=M2({options:Y,ctx:W,agentSetting:qX,resolvedInitialModel:tI,permissionModeNotification:a,overlyBroadBashPermissions:zX,toolPermissionContext:rG,initialMainLoopModel:hX,agentDefinitions:PB,mainThreadAgentDefinition:fG,verbose:l,remoteControl:YG,remoteControlName:_,advisorModel:oI,inputPrompt:SG,thinkingEnabled:DX,mcpTools:ZZ},{getTeammateUtils:o2}),{initialState:WZ,initialTools:EX}=TX,_B=await t2({root:tG,ctx:W,options:Y,debug:H,debugToStderr:V,commands:DB,initialTools:EX,mcpClients:IZ,mcpCommands:bZ,ide:E,teleport:$,remote:p,thinkingConfig:YZ,dynamicMcpConfig:rI,strictMcpConfig:zG,systemPrompt:u,appendSystemPrompt:P,coordinatorModeModule:xB,agentDefinitions:PB,currentCwd:AX,cliAgents:MX,initialState:WZ,getFpsMetrics:TB,stats:EB,mainThreadAgentDefinition:fG}),{sessionConfig:_X}=_B;if(_B.handled)return;fG=_B.mainThreadAgentDefinition;{let e=BZ&&oG.length===0?BZ:void 0;M("action_after_hooks"),vG(Y),AG(Y),hH()(xB?.isCoordinatorMode()?"coordinator":"normal");let XZ=null,OX=XZ?[XZ,...oG]:oG.length>0?oG:void 0;await yG(tG,{getFpsMetrics:TB,stats:EB,initialState:WZ},{..._X,initialMessages:OX,pendingHookMessages:e},WG)}}).version("0.5.7 (Claudin)","-v, --version","Output the version number"),Vb(B),M("run_main_options_built");let I=process.argv.includes("-p")||process.argv.includes("--print"),Z=process.argv.some((b)=>b.startsWith("cc://")||b.startsWith("cc+unix://"));if(I&&!Z)return M("run_before_parse"),await B.parseAsync(process.argv),M("run_after_parse"),B;return fb(B,{pendingConnect:YB}),M("run_before_parse"),await B.parseAsync(process.argv),M("run_after_parse"),M("main_after_run"),ZX(),B}export{NH as startDeferredPrefetches,_9 as main};
|