@namzu/cli 42.0.0 → 44.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +132 -0
- package/dist/bin.js +1 -1
- package/dist/chunks/{acp-ADQ2PRAY.js → acp-3D2PPXYC.js} +39 -38
- package/dist/chunks/acp-3D2PPXYC.js.map +6 -0
- package/dist/chunks/{activity-command-JROQLBPA.js → activity-command-WE45L6EF.js} +12 -12
- package/dist/chunks/{add-ILLLF6YP.js → add-RLDOB23V.js} +14 -14
- package/dist/chunks/{agent-YQI5KOPV.js → agent-VXVUHPUF.js} +30 -29
- package/dist/chunks/agent-session-HLH4P7W4.js +59 -0
- package/dist/chunks/{archive-55KJKGJB.js → archive-M5SZWEBT.js} +10 -10
- package/dist/chunks/{bin-main-332F5KRZ.js → bin-main-HCAGOSEJ.js} +4 -4
- package/dist/chunks/{browser-C6AOJ3CH.js → browser-GO5REABI.js} +6 -6
- package/dist/chunks/{chat-45H5F3KI.js → chat-ZV3OQQRQ.js} +15 -15
- package/dist/chunks/{chunk-6GBZAUYW.js → chunk-2343E2J7.js} +2 -2
- package/dist/chunks/{chunk-4TS6ZPOZ.js → chunk-26VFNQCY.js} +3 -3
- package/dist/chunks/{chunk-GOGBOZKO.js → chunk-2AUFXSKS.js} +254 -21
- package/dist/chunks/chunk-2AUFXSKS.js.map +6 -0
- package/dist/chunks/{chunk-A4CKLHKM.js → chunk-2QWVT55W.js} +441 -88
- package/dist/chunks/chunk-2QWVT55W.js.map +6 -0
- package/dist/chunks/{chunk-XXUL6HHM.js → chunk-3IPE4LDE.js} +2 -2
- package/dist/chunks/{chunk-QRGO6R2O.js → chunk-3J4ALTG2.js} +6 -4
- package/dist/chunks/chunk-3J4ALTG2.js.map +6 -0
- package/dist/chunks/{chunk-L3QW53QL.js → chunk-3PSNEUBW.js} +7 -7
- package/dist/chunks/{chunk-YM4DUQ3P.js → chunk-44OG65HR.js} +3 -3
- package/dist/chunks/{chunk-AZPS37AQ.js → chunk-4C6462L3.js} +2 -2
- package/dist/chunks/{chunk-YPHXWFKQ.js → chunk-4NBV2LZS.js} +2 -2
- package/dist/chunks/{chunk-RVSVVL6O.js → chunk-4PSNBASI.js} +3 -3
- package/dist/chunks/{chunk-HO2ZUI5Y.js → chunk-4TBPO43I.js} +2 -2
- package/dist/chunks/{chunk-URJ7TITR.js → chunk-5OVJ2ZCX.js} +8 -8
- package/dist/chunks/{chunk-HXAWIWOZ.js → chunk-5WHSDJCC.js} +2 -2
- package/dist/chunks/{chunk-EWSIGY2A.js → chunk-5WJAAPVQ.js} +3 -3
- package/dist/chunks/{chunk-BDLDDNNO.js → chunk-5WJXI4JR.js} +2 -2
- package/dist/chunks/{chunk-Y3I7AAD6.js → chunk-6LLUYDBO.js} +4 -4
- package/dist/chunks/{chunk-FSKJ3EZC.js → chunk-7M6ZU2NT.js} +2 -2
- package/dist/chunks/{chunk-Y74CPWYC.js → chunk-7QFW6TV7.js} +49 -23
- package/dist/chunks/chunk-7QFW6TV7.js.map +6 -0
- package/dist/chunks/{chunk-W2PJ6ZHY.js → chunk-7S2H77Y7.js} +3 -3
- package/dist/chunks/{chunk-CW2N2QS2.js → chunk-AN3DBA6N.js} +4 -4
- package/dist/chunks/chunk-ARCMOPO3.js +157 -0
- package/dist/chunks/chunk-ARCMOPO3.js.map +6 -0
- package/dist/chunks/{chunk-FMEGRBJP.js → chunk-AX7KHJVF.js} +2 -2
- package/dist/chunks/{chunk-XMOKHCPV.js → chunk-B6QM5F2E.js} +87 -39
- package/dist/chunks/chunk-B6QM5F2E.js.map +6 -0
- package/dist/chunks/{chunk-XGVCAMNT.js → chunk-CC2HK5I5.js} +2 -2
- package/dist/chunks/{chunk-4IIEEOCA.js → chunk-CECVIOY5.js} +3 -3
- package/dist/chunks/{chunk-QWBR6FBY.js → chunk-CLXRRUDH.js} +149 -17
- package/dist/chunks/chunk-CLXRRUDH.js.map +6 -0
- package/dist/chunks/{chunk-N4OY22M2.js → chunk-CQC6GJQE.js} +2 -2
- package/dist/chunks/{chunk-DLL2FPUY.js → chunk-DU27LH3W.js} +2 -2
- package/dist/chunks/{chunk-Y2DZ27P6.js → chunk-DW3ML3PZ.js} +4 -4
- package/dist/chunks/{chunk-RGVJHSMU.js → chunk-E2F7P6GI.js} +2 -2
- package/dist/chunks/{chunk-23NRJ2RC.js → chunk-FVYKDRVT.js} +5 -5
- package/dist/chunks/{chunk-JD2HLKFO.js → chunk-G7D7FNRZ.js} +2 -2
- package/dist/chunks/{chunk-HOY7BUGW.js → chunk-GLCZ7227.js} +207 -8
- package/dist/chunks/chunk-GLCZ7227.js.map +6 -0
- package/dist/chunks/{chunk-N56FVHCU.js → chunk-GQ6ZQA7C.js} +2 -2
- package/dist/chunks/{chunk-7E3V7NNN.js → chunk-GYW5IJ5R.js} +75586 -73631
- package/dist/chunks/chunk-GYW5IJ5R.js.map +6 -0
- package/dist/chunks/{chunk-YP7AINGL.js → chunk-HOWIEIPK.js} +9 -9
- package/dist/chunks/{chunk-FTMTO72X.js → chunk-HSEIISLI.js} +2 -1
- package/dist/chunks/{chunk-WHOSI6UQ.js → chunk-I7HAYS6Z.js} +15 -3
- package/dist/chunks/chunk-I7HAYS6Z.js.map +6 -0
- package/dist/chunks/{chunk-F6WVRMVY.js → chunk-J6LQJ3H4.js} +1610 -488
- package/dist/chunks/chunk-J6LQJ3H4.js.map +6 -0
- package/dist/chunks/{chunk-ESZ7X37S.js → chunk-JLZP3PRV.js} +4 -4
- package/dist/chunks/{chunk-6S4R2USK.js → chunk-JWFCCQGM.js} +6 -5
- package/dist/chunks/chunk-JWFCCQGM.js.map +6 -0
- package/dist/chunks/{chunk-A3AF5WXZ.js → chunk-LAAQCLVV.js} +6 -6
- package/dist/chunks/{chunk-K6LLMOB2.js → chunk-LC4R7FEV.js} +2 -2
- package/dist/chunks/{chunk-SIWZZF4M.js → chunk-LEVQANRZ.js} +15 -15
- package/dist/chunks/chunk-LEVQANRZ.js.map +6 -0
- package/dist/chunks/{chunk-HQZ3GBQI.js → chunk-LYI2HXN4.js} +6 -6
- package/dist/chunks/{chunk-S4KDR6G5.js → chunk-ON4RSB2L.js} +4 -4
- package/dist/chunks/{chunk-IQQ6TY4W.js → chunk-OQMQL3WF.js} +3 -3
- package/dist/chunks/{chunk-YVIM3MXU.js → chunk-PAB3MJVU.js} +2 -2
- package/dist/chunks/{chunk-HOIDWHGC.js → chunk-PLYCCNXW.js} +6 -6
- package/dist/chunks/{chunk-6PNBIMWH.js → chunk-PYMCT4ZA.js} +3 -3
- package/dist/chunks/{chunk-R2LYGFCI.js → chunk-Q7NNEWMZ.js} +4 -4
- package/dist/chunks/{chunk-3LNTQLQ4.js → chunk-QRC4LSKT.js} +7 -7
- package/dist/chunks/{chunk-BRKD6FMO.js → chunk-QXRLKALD.js} +2 -2
- package/dist/chunks/{chunk-XCMCPWMB.js → chunk-R4MQECAY.js} +4 -4
- package/dist/chunks/{chunk-M46GKTOI.js → chunk-R7IUMUGJ.js} +2 -2
- package/dist/chunks/{chunk-N3C5X6BW.js → chunk-SLVAGDHU.js} +5 -5
- package/dist/chunks/{chunk-SRYIMLOK.js → chunk-UFSCA2XZ.js} +2 -2
- package/dist/chunks/{chunk-6LVWHXT6.js → chunk-UQKTVCUV.js} +8 -8
- package/dist/chunks/{chunk-QT6KYBCC.js → chunk-USAZW2SV.js} +3 -3
- package/dist/chunks/{chunk-TW5BCDA5.js → chunk-V3P5BZE4.js} +3 -3
- package/dist/chunks/{chunk-JXT47VT6.js → chunk-VESQFRF3.js} +821 -33
- package/dist/chunks/chunk-VESQFRF3.js.map +6 -0
- package/dist/chunks/{chunk-35VTE7V5.js → chunk-VHS5I4HA.js} +2 -2
- package/dist/chunks/{chunk-5XWMKWQQ.js → chunk-W4B3XGK5.js} +45 -3
- package/dist/chunks/chunk-W4B3XGK5.js.map +6 -0
- package/dist/chunks/{chunk-J4IES4SO.js → chunk-WALXUBIZ.js} +2 -2
- package/dist/chunks/{chunk-QUELENQP.js → chunk-WPECMU3F.js} +4 -4
- package/dist/chunks/{chunk-SNC5D5UG.js → chunk-XS2JWCGM.js} +13 -13
- package/dist/chunks/{chunk-4NO5XFK2.js → chunk-YV227DWZ.js} +2 -2
- package/dist/chunks/cli-runtime-35A3RAU6.js +337 -0
- package/dist/chunks/cli-runtime-35A3RAU6.js.map +6 -0
- package/dist/chunks/{commands-JZT6JJY5.js → commands-OWQUB7JT.js} +5 -5
- package/dist/chunks/{crash-report-TWMWHNKY.js → crash-report-KDMLQRS6.js} +6 -6
- package/dist/chunks/{dist-AZ5T257L.js → dist-4LKH4B3B.js} +4 -3
- package/dist/chunks/dist-4LKH4B3B.js.map +6 -0
- package/dist/chunks/{dist-POSMI3PI.js → dist-5A3XKURK.js} +2 -2
- package/dist/chunks/{dist-CLKFY67B.js → dist-FURVCE4N.js} +2 -2
- package/dist/chunks/{dist-4EGZFRWY.js → dist-RS5H5LHE.js} +2 -2
- package/dist/chunks/{dist-6ORFQIRV.js → dist-VKC2OF2P.js} +2 -2
- package/dist/chunks/{dist-K5JIOWIQ.js → dist-WPETBMRE.js} +2 -2
- package/dist/chunks/{dist-MVLQAON2.js → dist-XFPIH4KV.js} +2 -2
- package/dist/chunks/{doctor-UVZBNUNF.js → doctor-ZDM3LGPR.js} +13 -13
- package/dist/chunks/{drain-27E6XUNK.js → drain-BCDD6WT4.js} +10 -10
- package/dist/chunks/{eval-NRRIWDET.js → eval-CWHRB4CM.js} +2 -2
- package/dist/chunks/{exec-KX46LZ36.js → exec-ZL7XCVPV.js} +290 -88
- package/dist/chunks/exec-ZL7XCVPV.js.map +6 -0
- package/dist/chunks/github-FH7PPWVW.js +347 -0
- package/dist/chunks/github-FH7PPWVW.js.map +6 -0
- package/dist/chunks/{home-RT2I6VTQ.js → home-B3DTR4JZ.js} +3 -3
- package/dist/chunks/{host-queries-ZXGOA6ZL.js → host-queries-RIHABSRA.js} +15 -15
- package/dist/chunks/{learn-5KKZ4ZFX.js → learn-FVDHNZ3E.js} +13 -13
- package/dist/chunks/{learn-builtin-MSUF4MEJ.js → learn-builtin-DIGVMU2K.js} +16 -16
- package/dist/chunks/{lifecycle-TZU6D46R.js → lifecycle-T5KZCOME.js} +23 -23
- package/dist/chunks/{list-QCWNMQED.js → list-ALYIIETE.js} +10 -10
- package/dist/chunks/{live-V7HRF5KR.js → live-QYXRKG27.js} +12 -12
- package/dist/chunks/{login-QFP3PIXG.js → login-YYDHSXYZ.js} +8 -8
- package/dist/chunks/{logs-XTXMS4JF.js → logs-HGYW5QG6.js} +4 -4
- package/dist/chunks/{mcp-WQFJJ4NO.js → mcp-DXCRUYBA.js} +15 -15
- package/dist/chunks/{message-command-QVNUJN47.js → message-command-7A2FC7PW.js} +36 -35
- package/dist/chunks/message-command-7A2FC7PW.js.map +6 -0
- package/dist/chunks/{operator-tools-2OYRNPCH.js → operator-tools-HM2DKEA3.js} +13 -13
- package/dist/chunks/{output-schema-ETVPLUXE.js → output-schema-S4OZKHPX.js} +3 -3
- package/dist/chunks/{pal-BYFZCLE2.js → pal-PISV32OY.js} +11 -11
- package/dist/chunks/{plain-report-73WHPLHX.js → plain-report-IOYN4O6N.js} +10 -2
- package/dist/chunks/{plain-report-73WHPLHX.js.map → plain-report-IOYN4O6N.js.map} +2 -2
- package/dist/chunks/{providers-KP5JHTTK.js → providers-UCHYI3MC.js} +6 -6
- package/dist/chunks/{resident-BROBTK35.js → resident-Y3WMPAB4.js} +24 -24
- package/dist/chunks/{resident-BROBTK35.js.map → resident-Y3WMPAB4.js.map} +1 -1
- package/dist/chunks/resume-PM73RFB2.js +23 -0
- package/dist/chunks/{resume-command-OKJ2MJPB.js → resume-command-TNYIW6PZ.js} +4 -4
- package/dist/chunks/{schedule-TVR3FE32.js → schedule-PPTJ3BJ7.js} +8 -8
- package/dist/chunks/{service-6A3TOQKV.js → service-OMRDQOPM.js} +22 -22
- package/dist/chunks/{session-step-N4GHA2YE.js → session-step-C54ZEOLL.js} +16 -16
- package/dist/chunks/{skills-WXYSPDKL.js → skills-CNZMMJFB.js} +8 -8
- package/dist/chunks/{start-check-BUCN5MCU.js → start-check-H4GSB34J.js} +2 -2
- package/dist/chunks/{state-PVAVIXHK.js → state-VEYKYIIF.js} +2 -2
- package/dist/chunks/{store-O3KC2PPZ.js → store-BGVZ7PVQ.js} +4 -4
- package/dist/chunks/{store-NB3KR4XA.js → store-FW3TZA4K.js} +14 -10
- package/dist/chunks/{store-D3XUEEAF.js → store-S3M6B7JR.js} +6 -6
- package/dist/chunks/{tui-2XOSCALL.js → tui-XJNDU54J.js} +1797 -875
- package/dist/chunks/tui-XJNDU54J.js.map +6 -0
- package/dist/chunks/{upgrade-FY5ULZQF.js → upgrade-XRCA3O4X.js} +6 -6
- package/dist/chunks/{worktree-MVW62U5G.js → worktree-C6G5PFNW.js} +12 -12
- package/dist/cli-runtime.d.ts +2 -0
- package/dist/cli-runtime.d.ts.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/commands/desktop-host.d.ts +3 -0
- package/dist/commands/desktop-host.d.ts.map +1 -1
- package/dist/commands/exec-flags.d.ts +14 -0
- package/dist/commands/exec-flags.d.ts.map +1 -1
- package/dist/commands/exec-json.d.ts +8 -1
- package/dist/commands/exec-json.d.ts.map +1 -1
- package/dist/commands/exec.d.ts.map +1 -1
- package/dist/commands/github.d.ts +20 -0
- package/dist/commands/github.d.ts.map +1 -0
- package/dist/commands/manifest.d.ts +1 -0
- package/dist/commands/manifest.d.ts.map +1 -1
- package/dist/commands/resident-flags.d.ts.map +1 -1
- package/dist/commands/resume.d.ts +4 -0
- package/dist/commands/resume.d.ts.map +1 -1
- package/dist/commands/stream-input.d.ts +4 -0
- package/dist/commands/stream-input.d.ts.map +1 -0
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/schema.d.ts +28 -2
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/context/environment.d.ts +17 -4
- package/dist/context/environment.d.ts.map +1 -1
- package/dist/context/system-prompt.d.ts +2 -2
- package/dist/context/system-prompt.d.ts.map +1 -1
- package/dist/index.js +16 -16
- package/dist/integrations/github/pull-request.d.ts +64 -0
- package/dist/integrations/github/pull-request.d.ts.map +1 -0
- package/dist/integrations/github/workflows.d.ts +49 -0
- package/dist/integrations/github/workflows.d.ts.map +1 -0
- package/dist/integrations/mcp/elicitation.d.ts +40 -0
- package/dist/integrations/mcp/elicitation.d.ts.map +1 -0
- package/dist/integrations/mcp/output.d.ts +9 -0
- package/dist/integrations/mcp/output.d.ts.map +1 -0
- package/dist/integrations/mcp/person-commands.d.ts +18 -0
- package/dist/integrations/mcp/person-commands.d.ts.map +1 -0
- package/dist/integrations/mcp/person-session.d.ts +15 -0
- package/dist/integrations/mcp/person-session.d.ts.map +1 -0
- package/dist/integrations/mcp/prompts.d.ts +18 -0
- package/dist/integrations/mcp/prompts.d.ts.map +1 -0
- package/dist/integrations/mcp/servers.d.ts +70 -3
- package/dist/integrations/mcp/servers.d.ts.map +1 -1
- package/dist/integrations/peers/runtime.d.ts.map +1 -1
- package/dist/integrations/plugins/files.d.ts +43 -0
- package/dist/integrations/plugins/files.d.ts.map +1 -0
- package/dist/integrations/plugins/runtime.d.ts +5 -1
- package/dist/integrations/plugins/runtime.d.ts.map +1 -1
- package/dist/integrations/resident/runner-worker.js +21 -21
- package/dist/integrations/resident/session-step.d.ts.map +1 -1
- package/dist/integrations/sessions/side-question.d.ts +46 -0
- package/dist/integrations/sessions/side-question.d.ts.map +1 -0
- package/dist/integrations/sessions/store.d.ts +23 -1
- package/dist/integrations/sessions/store.d.ts.map +1 -1
- package/dist/integrations/small-model/side-model.d.ts +13 -0
- package/dist/integrations/small-model/side-model.d.ts.map +1 -1
- package/dist/integrations/subagents/activity.d.ts.map +1 -1
- package/dist/integrations/subagents/agent-names.d.ts +21 -0
- package/dist/integrations/subagents/agent-names.d.ts.map +1 -0
- package/dist/integrations/subagents/definitions.d.ts +24 -2
- package/dist/integrations/subagents/definitions.d.ts.map +1 -1
- package/dist/integrations/subagents/failure-words.d.ts +2 -0
- package/dist/integrations/subagents/failure-words.d.ts.map +1 -0
- package/dist/integrations/subagents/fork.d.ts +29 -0
- package/dist/integrations/subagents/fork.d.ts.map +1 -0
- package/dist/integrations/subagents/runtime.d.ts +21 -0
- package/dist/integrations/subagents/runtime.d.ts.map +1 -1
- package/dist/integrations/telemetry/otlp-export.d.ts +67 -0
- package/dist/integrations/telemetry/otlp-export.d.ts.map +1 -0
- package/dist/permissions/auto-classifier.d.ts +12 -1
- package/dist/permissions/auto-classifier.d.ts.map +1 -1
- package/dist/permissions/delegated-mode.d.ts +25 -0
- package/dist/permissions/delegated-mode.d.ts.map +1 -0
- package/dist/permissions/live-mode.d.ts +5 -0
- package/dist/permissions/live-mode.d.ts.map +1 -1
- package/dist/permissions/live-rules.d.ts +12 -0
- package/dist/permissions/live-rules.d.ts.map +1 -0
- package/dist/permissions/path-rules.d.ts +43 -0
- package/dist/permissions/path-rules.d.ts.map +1 -0
- package/dist/permissions/rule-screen.d.ts +36 -0
- package/dist/permissions/rule-screen.d.ts.map +1 -0
- package/dist/permissions/rule-strings.d.ts +50 -0
- package/dist/permissions/rule-strings.d.ts.map +1 -0
- package/dist/permissions/rules.d.ts +7 -2
- package/dist/permissions/rules.d.ts.map +1 -1
- package/dist/permissions/session-allow.d.ts +2 -0
- package/dist/permissions/session-allow.d.ts.map +1 -1
- package/dist/reminders/changed-files.d.ts +24 -0
- package/dist/reminders/changed-files.d.ts.map +1 -0
- package/dist/reminders/frame.d.ts +1 -1
- package/dist/reminders/frame.d.ts.map +1 -1
- package/dist/reminders/index.d.ts +30 -0
- package/dist/reminders/index.d.ts.map +1 -1
- package/dist/reminders/mcp-instructions.d.ts +27 -0
- package/dist/reminders/mcp-instructions.d.ts.map +1 -0
- package/dist/reminders/memory-index.d.ts +28 -0
- package/dist/reminders/memory-index.d.ts.map +1 -0
- package/dist/reminders/model.d.ts +9 -0
- package/dist/reminders/model.d.ts.map +1 -0
- package/dist/reminders/skills.d.ts +27 -0
- package/dist/reminders/skills.d.ts.map +1 -0
- package/dist/skills/catalog.d.ts.map +1 -1
- package/dist/skills/store.d.ts.map +1 -1
- package/dist/tui/App.d.ts +2 -0
- package/dist/tui/App.d.ts.map +1 -1
- package/dist/tui/Composer.d.ts +17 -4
- package/dist/tui/Composer.d.ts.map +1 -1
- package/dist/tui/LiveActivity.d.ts.map +1 -1
- package/dist/tui/ResumePicker.d.ts.map +1 -1
- package/dist/tui/agent.d.ts +42 -1
- package/dist/tui/agent.d.ts.map +1 -1
- package/dist/tui/composer-undo.d.ts +31 -0
- package/dist/tui/composer-undo.d.ts.map +1 -0
- package/dist/tui/external-editor.d.ts +5 -1
- package/dist/tui/external-editor.d.ts.map +1 -1
- package/dist/tui/keymap.d.ts +152 -0
- package/dist/tui/keymap.d.ts.map +1 -0
- package/dist/tui/mention-file.d.ts +10 -0
- package/dist/tui/mention-file.d.ts.map +1 -0
- package/dist/tui/mention-sources.d.ts +31 -0
- package/dist/tui/mention-sources.d.ts.map +1 -0
- package/dist/tui/mentions.d.ts +55 -1
- package/dist/tui/mentions.d.ts.map +1 -1
- package/dist/tui/plugin-view.d.ts.map +1 -1
- package/dist/tui/resume-empty.d.ts +7 -0
- package/dist/tui/resume-empty.d.ts.map +1 -1
- package/dist/tui/resume-picker-state.d.ts +3 -0
- package/dist/tui/resume-picker-state.d.ts.map +1 -1
- package/dist/tui/self-mending-pause-row.d.ts +17 -0
- package/dist/tui/self-mending-pause-row.d.ts.map +1 -0
- package/dist/tui/slashCommands.d.ts +18 -0
- package/dist/tui/slashCommands.d.ts.map +1 -1
- package/dist/tui/thinking-label.d.ts +24 -0
- package/dist/tui/thinking-label.d.ts.map +1 -0
- package/dist/tui/tool-server-rows.d.ts +23 -0
- package/dist/tui/tool-server-rows.d.ts.map +1 -0
- package/dist/tui/types.d.ts +4 -0
- package/dist/tui/types.d.ts.map +1 -1
- package/dist/user-commands/store.d.ts +10 -1
- package/dist/user-commands/store.d.ts.map +1 -1
- package/package.json +6 -5
- package/dist/chunks/acp-ADQ2PRAY.js.map +0 -6
- package/dist/chunks/agent-session-3MUZCWQ4.js +0 -58
- package/dist/chunks/chunk-5XWMKWQQ.js.map +0 -6
- package/dist/chunks/chunk-6S4R2USK.js.map +0 -6
- package/dist/chunks/chunk-7E3V7NNN.js.map +0 -6
- package/dist/chunks/chunk-A4CKLHKM.js.map +0 -6
- package/dist/chunks/chunk-F6WVRMVY.js.map +0 -6
- package/dist/chunks/chunk-GOGBOZKO.js.map +0 -6
- package/dist/chunks/chunk-HOY7BUGW.js.map +0 -6
- package/dist/chunks/chunk-JXT47VT6.js.map +0 -6
- package/dist/chunks/chunk-QRGO6R2O.js.map +0 -6
- package/dist/chunks/chunk-QWBR6FBY.js.map +0 -6
- package/dist/chunks/chunk-SIWZZF4M.js.map +0 -6
- package/dist/chunks/chunk-WHOSI6UQ.js.map +0 -6
- package/dist/chunks/chunk-XMOKHCPV.js.map +0 -6
- package/dist/chunks/chunk-Y74CPWYC.js.map +0 -6
- package/dist/chunks/cli-runtime-HW6GQKC6.js +0 -186
- package/dist/chunks/cli-runtime-HW6GQKC6.js.map +0 -6
- package/dist/chunks/dist-AZ5T257L.js.map +0 -6
- package/dist/chunks/exec-KX46LZ36.js.map +0 -6
- package/dist/chunks/message-command-QVNUJN47.js.map +0 -6
- package/dist/chunks/resume-7V44GSEU.js +0 -23
- package/dist/chunks/tui-2XOSCALL.js.map +0 -6
- /package/dist/chunks/{activity-command-JROQLBPA.js.map → activity-command-WE45L6EF.js.map} +0 -0
- /package/dist/chunks/{add-ILLLF6YP.js.map → add-RLDOB23V.js.map} +0 -0
- /package/dist/chunks/{agent-YQI5KOPV.js.map → agent-VXVUHPUF.js.map} +0 -0
- /package/dist/chunks/{agent-session-3MUZCWQ4.js.map → agent-session-HLH4P7W4.js.map} +0 -0
- /package/dist/chunks/{archive-55KJKGJB.js.map → archive-M5SZWEBT.js.map} +0 -0
- /package/dist/chunks/{bin-main-332F5KRZ.js.map → bin-main-HCAGOSEJ.js.map} +0 -0
- /package/dist/chunks/{browser-C6AOJ3CH.js.map → browser-GO5REABI.js.map} +0 -0
- /package/dist/chunks/{chat-45H5F3KI.js.map → chat-ZV3OQQRQ.js.map} +0 -0
- /package/dist/chunks/{chunk-6GBZAUYW.js.map → chunk-2343E2J7.js.map} +0 -0
- /package/dist/chunks/{chunk-4TS6ZPOZ.js.map → chunk-26VFNQCY.js.map} +0 -0
- /package/dist/chunks/{chunk-XXUL6HHM.js.map → chunk-3IPE4LDE.js.map} +0 -0
- /package/dist/chunks/{chunk-L3QW53QL.js.map → chunk-3PSNEUBW.js.map} +0 -0
- /package/dist/chunks/{chunk-YM4DUQ3P.js.map → chunk-44OG65HR.js.map} +0 -0
- /package/dist/chunks/{chunk-AZPS37AQ.js.map → chunk-4C6462L3.js.map} +0 -0
- /package/dist/chunks/{chunk-YPHXWFKQ.js.map → chunk-4NBV2LZS.js.map} +0 -0
- /package/dist/chunks/{chunk-RVSVVL6O.js.map → chunk-4PSNBASI.js.map} +0 -0
- /package/dist/chunks/{chunk-HO2ZUI5Y.js.map → chunk-4TBPO43I.js.map} +0 -0
- /package/dist/chunks/{chunk-URJ7TITR.js.map → chunk-5OVJ2ZCX.js.map} +0 -0
- /package/dist/chunks/{chunk-HXAWIWOZ.js.map → chunk-5WHSDJCC.js.map} +0 -0
- /package/dist/chunks/{chunk-EWSIGY2A.js.map → chunk-5WJAAPVQ.js.map} +0 -0
- /package/dist/chunks/{chunk-BDLDDNNO.js.map → chunk-5WJXI4JR.js.map} +0 -0
- /package/dist/chunks/{chunk-Y3I7AAD6.js.map → chunk-6LLUYDBO.js.map} +0 -0
- /package/dist/chunks/{chunk-FSKJ3EZC.js.map → chunk-7M6ZU2NT.js.map} +0 -0
- /package/dist/chunks/{chunk-W2PJ6ZHY.js.map → chunk-7S2H77Y7.js.map} +0 -0
- /package/dist/chunks/{chunk-CW2N2QS2.js.map → chunk-AN3DBA6N.js.map} +0 -0
- /package/dist/chunks/{chunk-FMEGRBJP.js.map → chunk-AX7KHJVF.js.map} +0 -0
- /package/dist/chunks/{chunk-XGVCAMNT.js.map → chunk-CC2HK5I5.js.map} +0 -0
- /package/dist/chunks/{chunk-4IIEEOCA.js.map → chunk-CECVIOY5.js.map} +0 -0
- /package/dist/chunks/{chunk-N4OY22M2.js.map → chunk-CQC6GJQE.js.map} +0 -0
- /package/dist/chunks/{chunk-DLL2FPUY.js.map → chunk-DU27LH3W.js.map} +0 -0
- /package/dist/chunks/{chunk-Y2DZ27P6.js.map → chunk-DW3ML3PZ.js.map} +0 -0
- /package/dist/chunks/{chunk-RGVJHSMU.js.map → chunk-E2F7P6GI.js.map} +0 -0
- /package/dist/chunks/{chunk-23NRJ2RC.js.map → chunk-FVYKDRVT.js.map} +0 -0
- /package/dist/chunks/{chunk-JD2HLKFO.js.map → chunk-G7D7FNRZ.js.map} +0 -0
- /package/dist/chunks/{chunk-N56FVHCU.js.map → chunk-GQ6ZQA7C.js.map} +0 -0
- /package/dist/chunks/{chunk-YP7AINGL.js.map → chunk-HOWIEIPK.js.map} +0 -0
- /package/dist/chunks/{chunk-FTMTO72X.js.map → chunk-HSEIISLI.js.map} +0 -0
- /package/dist/chunks/{chunk-ESZ7X37S.js.map → chunk-JLZP3PRV.js.map} +0 -0
- /package/dist/chunks/{chunk-A3AF5WXZ.js.map → chunk-LAAQCLVV.js.map} +0 -0
- /package/dist/chunks/{chunk-K6LLMOB2.js.map → chunk-LC4R7FEV.js.map} +0 -0
- /package/dist/chunks/{chunk-HQZ3GBQI.js.map → chunk-LYI2HXN4.js.map} +0 -0
- /package/dist/chunks/{chunk-S4KDR6G5.js.map → chunk-ON4RSB2L.js.map} +0 -0
- /package/dist/chunks/{chunk-IQQ6TY4W.js.map → chunk-OQMQL3WF.js.map} +0 -0
- /package/dist/chunks/{chunk-YVIM3MXU.js.map → chunk-PAB3MJVU.js.map} +0 -0
- /package/dist/chunks/{chunk-HOIDWHGC.js.map → chunk-PLYCCNXW.js.map} +0 -0
- /package/dist/chunks/{chunk-6PNBIMWH.js.map → chunk-PYMCT4ZA.js.map} +0 -0
- /package/dist/chunks/{chunk-R2LYGFCI.js.map → chunk-Q7NNEWMZ.js.map} +0 -0
- /package/dist/chunks/{chunk-3LNTQLQ4.js.map → chunk-QRC4LSKT.js.map} +0 -0
- /package/dist/chunks/{chunk-BRKD6FMO.js.map → chunk-QXRLKALD.js.map} +0 -0
- /package/dist/chunks/{chunk-XCMCPWMB.js.map → chunk-R4MQECAY.js.map} +0 -0
- /package/dist/chunks/{chunk-M46GKTOI.js.map → chunk-R7IUMUGJ.js.map} +0 -0
- /package/dist/chunks/{chunk-N3C5X6BW.js.map → chunk-SLVAGDHU.js.map} +0 -0
- /package/dist/chunks/{chunk-SRYIMLOK.js.map → chunk-UFSCA2XZ.js.map} +0 -0
- /package/dist/chunks/{chunk-6LVWHXT6.js.map → chunk-UQKTVCUV.js.map} +0 -0
- /package/dist/chunks/{chunk-QT6KYBCC.js.map → chunk-USAZW2SV.js.map} +0 -0
- /package/dist/chunks/{chunk-TW5BCDA5.js.map → chunk-V3P5BZE4.js.map} +0 -0
- /package/dist/chunks/{chunk-35VTE7V5.js.map → chunk-VHS5I4HA.js.map} +0 -0
- /package/dist/chunks/{chunk-J4IES4SO.js.map → chunk-WALXUBIZ.js.map} +0 -0
- /package/dist/chunks/{chunk-QUELENQP.js.map → chunk-WPECMU3F.js.map} +0 -0
- /package/dist/chunks/{chunk-SNC5D5UG.js.map → chunk-XS2JWCGM.js.map} +0 -0
- /package/dist/chunks/{chunk-4NO5XFK2.js.map → chunk-YV227DWZ.js.map} +0 -0
- /package/dist/chunks/{commands-JZT6JJY5.js.map → commands-OWQUB7JT.js.map} +0 -0
- /package/dist/chunks/{crash-report-TWMWHNKY.js.map → crash-report-KDMLQRS6.js.map} +0 -0
- /package/dist/chunks/{dist-POSMI3PI.js.map → dist-5A3XKURK.js.map} +0 -0
- /package/dist/chunks/{dist-CLKFY67B.js.map → dist-FURVCE4N.js.map} +0 -0
- /package/dist/chunks/{dist-4EGZFRWY.js.map → dist-RS5H5LHE.js.map} +0 -0
- /package/dist/chunks/{dist-6ORFQIRV.js.map → dist-VKC2OF2P.js.map} +0 -0
- /package/dist/chunks/{dist-K5JIOWIQ.js.map → dist-WPETBMRE.js.map} +0 -0
- /package/dist/chunks/{dist-MVLQAON2.js.map → dist-XFPIH4KV.js.map} +0 -0
- /package/dist/chunks/{doctor-UVZBNUNF.js.map → doctor-ZDM3LGPR.js.map} +0 -0
- /package/dist/chunks/{drain-27E6XUNK.js.map → drain-BCDD6WT4.js.map} +0 -0
- /package/dist/chunks/{eval-NRRIWDET.js.map → eval-CWHRB4CM.js.map} +0 -0
- /package/dist/chunks/{home-RT2I6VTQ.js.map → home-B3DTR4JZ.js.map} +0 -0
- /package/dist/chunks/{host-queries-ZXGOA6ZL.js.map → host-queries-RIHABSRA.js.map} +0 -0
- /package/dist/chunks/{learn-5KKZ4ZFX.js.map → learn-FVDHNZ3E.js.map} +0 -0
- /package/dist/chunks/{learn-builtin-MSUF4MEJ.js.map → learn-builtin-DIGVMU2K.js.map} +0 -0
- /package/dist/chunks/{lifecycle-TZU6D46R.js.map → lifecycle-T5KZCOME.js.map} +0 -0
- /package/dist/chunks/{list-QCWNMQED.js.map → list-ALYIIETE.js.map} +0 -0
- /package/dist/chunks/{live-V7HRF5KR.js.map → live-QYXRKG27.js.map} +0 -0
- /package/dist/chunks/{login-QFP3PIXG.js.map → login-YYDHSXYZ.js.map} +0 -0
- /package/dist/chunks/{logs-XTXMS4JF.js.map → logs-HGYW5QG6.js.map} +0 -0
- /package/dist/chunks/{mcp-WQFJJ4NO.js.map → mcp-DXCRUYBA.js.map} +0 -0
- /package/dist/chunks/{operator-tools-2OYRNPCH.js.map → operator-tools-HM2DKEA3.js.map} +0 -0
- /package/dist/chunks/{output-schema-ETVPLUXE.js.map → output-schema-S4OZKHPX.js.map} +0 -0
- /package/dist/chunks/{pal-BYFZCLE2.js.map → pal-PISV32OY.js.map} +0 -0
- /package/dist/chunks/{providers-KP5JHTTK.js.map → providers-UCHYI3MC.js.map} +0 -0
- /package/dist/chunks/{resume-7V44GSEU.js.map → resume-PM73RFB2.js.map} +0 -0
- /package/dist/chunks/{resume-command-OKJ2MJPB.js.map → resume-command-TNYIW6PZ.js.map} +0 -0
- /package/dist/chunks/{schedule-TVR3FE32.js.map → schedule-PPTJ3BJ7.js.map} +0 -0
- /package/dist/chunks/{service-6A3TOQKV.js.map → service-OMRDQOPM.js.map} +0 -0
- /package/dist/chunks/{session-step-N4GHA2YE.js.map → session-step-C54ZEOLL.js.map} +0 -0
- /package/dist/chunks/{skills-WXYSPDKL.js.map → skills-CNZMMJFB.js.map} +0 -0
- /package/dist/chunks/{start-check-BUCN5MCU.js.map → start-check-H4GSB34J.js.map} +0 -0
- /package/dist/chunks/{state-PVAVIXHK.js.map → state-VEYKYIIF.js.map} +0 -0
- /package/dist/chunks/{store-D3XUEEAF.js.map → store-BGVZ7PVQ.js.map} +0 -0
- /package/dist/chunks/{store-NB3KR4XA.js.map → store-FW3TZA4K.js.map} +0 -0
- /package/dist/chunks/{store-O3KC2PPZ.js.map → store-S3M6B7JR.js.map} +0 -0
- /package/dist/chunks/{upgrade-FY5ULZQF.js.map → upgrade-XRCA3O4X.js.map} +0 -0
- /package/dist/chunks/{worktree-MVW62U5G.js.map → worktree-C6G5PFNW.js.map} +0 -0
|
@@ -2,7 +2,7 @@ import { createRequire as __namzuCreateRequire } from 'node:module';
|
|
|
2
2
|
const require = __namzuCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
setUserConfigValue
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-5WJAAPVQ.js";
|
|
6
6
|
import {
|
|
7
7
|
isCompletionArgument
|
|
8
8
|
} from "./chunk-JV3LONAU.js";
|
|
@@ -16,21 +16,29 @@ import {
|
|
|
16
16
|
explainFailure,
|
|
17
17
|
resolveTurnGuards,
|
|
18
18
|
sandboxRunsShellUnasked
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-ON4RSB2L.js";
|
|
20
|
+
import {
|
|
21
|
+
localConfigPath
|
|
22
|
+
} from "./chunk-ARCMOPO3.js";
|
|
20
23
|
import {
|
|
21
24
|
discoverSkills,
|
|
22
25
|
loadSkillBody
|
|
23
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-3J4ALTG2.js";
|
|
24
27
|
import {
|
|
25
28
|
CLI_VERSION
|
|
26
29
|
} from "./chunk-HE7WUOX2.js";
|
|
27
30
|
import {
|
|
31
|
+
LOCAL_CONFIG_FILE,
|
|
28
32
|
THEME_NAMES,
|
|
33
|
+
foldRuleLists,
|
|
34
|
+
parseRuleString,
|
|
29
35
|
parseThemeSetting,
|
|
36
|
+
patternOf,
|
|
37
|
+
readPermissionLayers,
|
|
30
38
|
renderConfigDebug,
|
|
31
39
|
resolveTheme,
|
|
32
40
|
themeLabel
|
|
33
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-2AUFXSKS.js";
|
|
34
42
|
import {
|
|
35
43
|
displayPath,
|
|
36
44
|
homePath,
|
|
@@ -40,10 +48,13 @@ import {
|
|
|
40
48
|
permissionModeDescription,
|
|
41
49
|
permissionModeFromName,
|
|
42
50
|
permissionModeLabel
|
|
43
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-WALXUBIZ.js";
|
|
44
52
|
import {
|
|
45
53
|
terminalDisplayText
|
|
46
54
|
} from "./chunk-IYUW2RAA.js";
|
|
55
|
+
import {
|
|
56
|
+
isPermissionEffect
|
|
57
|
+
} from "./chunk-GLCZ7227.js";
|
|
47
58
|
import {
|
|
48
59
|
PERMISSION_MODE_NAMES
|
|
49
60
|
} from "./chunk-WMEZTDLT.js";
|
|
@@ -52,13 +63,13 @@ import {
|
|
|
52
63
|
} from "./chunk-U5UV2YRE.js";
|
|
53
64
|
import {
|
|
54
65
|
namzuHomePath
|
|
55
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-PAB3MJVU.js";
|
|
56
67
|
import {
|
|
57
68
|
RegistryCollisionError,
|
|
58
69
|
isMemoryType,
|
|
59
70
|
kernelHostCommands,
|
|
60
71
|
parseFrontmatter
|
|
61
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-GYW5IJ5R.js";
|
|
62
73
|
import {
|
|
63
74
|
__commonJS,
|
|
64
75
|
__name,
|
|
@@ -459,8 +470,8 @@ var require_react_production = __commonJS({
|
|
|
459
470
|
exports.use = function(usable) {
|
|
460
471
|
return ReactSharedInternals.H.use(usable);
|
|
461
472
|
};
|
|
462
|
-
exports.useActionState = function(
|
|
463
|
-
return ReactSharedInternals.H.useActionState(
|
|
473
|
+
exports.useActionState = function(action2, initialState, permalink) {
|
|
474
|
+
return ReactSharedInternals.H.useActionState(action2, initialState, permalink);
|
|
464
475
|
};
|
|
465
476
|
exports.useCallback = function(callback, deps) {
|
|
466
477
|
return ReactSharedInternals.H.useCallback(callback, deps);
|
|
@@ -1445,9 +1456,9 @@ var require_react_development = __commonJS({
|
|
|
1445
1456
|
exports.use = function(usable) {
|
|
1446
1457
|
return resolveDispatcher().use(usable);
|
|
1447
1458
|
};
|
|
1448
|
-
exports.useActionState = function(
|
|
1459
|
+
exports.useActionState = function(action2, initialState, permalink) {
|
|
1449
1460
|
return resolveDispatcher().useActionState(
|
|
1450
|
-
|
|
1461
|
+
action2,
|
|
1451
1462
|
initialState,
|
|
1452
1463
|
permalink
|
|
1453
1464
|
);
|
|
@@ -1541,7 +1552,7 @@ var require_react = __commonJS({
|
|
|
1541
1552
|
// src/user-commands/store.ts
|
|
1542
1553
|
import { readFileSync, readdirSync, realpathSync } from "node:fs";
|
|
1543
1554
|
import { platform } from "node:os";
|
|
1544
|
-
import { dirname, join, resolve } from "node:path";
|
|
1555
|
+
import { basename, dirname, join, resolve } from "node:path";
|
|
1545
1556
|
function displayHint(hint) {
|
|
1546
1557
|
return /^[[<(]/.test(hint) ? hint : `[${hint}]`;
|
|
1547
1558
|
}
|
|
@@ -1555,7 +1566,7 @@ function projectCommandsDir(cwd = process.cwd()) {
|
|
|
1555
1566
|
return join(cwd, ".namzu", "commands");
|
|
1556
1567
|
}
|
|
1557
1568
|
__name(projectCommandsDir, "projectCommandsDir");
|
|
1558
|
-
function readCommandsFrom(dir, source) {
|
|
1569
|
+
function readCommandsFrom(dir, source, plugin) {
|
|
1559
1570
|
let files;
|
|
1560
1571
|
try {
|
|
1561
1572
|
files = readdirSync(dir, { withFileTypes: true }).filter((e) => e.isFile() && e.name.endsWith(".md")).map((e) => e.name);
|
|
@@ -1565,7 +1576,7 @@ function readCommandsFrom(dir, source) {
|
|
|
1565
1576
|
const out = [];
|
|
1566
1577
|
for (const file of files) {
|
|
1567
1578
|
const path = join(dir, file);
|
|
1568
|
-
const name = file.slice(0, -".md".length)
|
|
1579
|
+
const name = `${plugin !== void 0 ? `${plugin}__` : ""}${file.slice(0, -".md".length)}`;
|
|
1569
1580
|
let raw;
|
|
1570
1581
|
try {
|
|
1571
1582
|
raw = readFileSync(path, "utf8");
|
|
@@ -1610,6 +1621,9 @@ function discoverUserCommands(opts = {}) {
|
|
|
1610
1621
|
const project = samePhysicalDirectory(userDir, projectDir) ? [] : readCommandsFrom(projectDir, "project");
|
|
1611
1622
|
const byName = /* @__PURE__ */ new Map();
|
|
1612
1623
|
for (const c of skillCommands(opts)) byName.set(c.name, c);
|
|
1624
|
+
for (const source of opts.pluginCommandDirs ?? []) {
|
|
1625
|
+
for (const c of readCommandsFrom(source.dir, "plugin", source.plugin)) byName.set(c.name, c);
|
|
1626
|
+
}
|
|
1613
1627
|
for (const c of user) byName.set(c.name, c);
|
|
1614
1628
|
for (const c of project) byName.set(c.name, c);
|
|
1615
1629
|
return [...byName.values()].map(
|
|
@@ -1702,13 +1716,13 @@ function expandCommand(command, args) {
|
|
|
1702
1716
|
return { ok: true, prompt: command.template.split(ARGUMENTS_TOKEN).join(trimmed) };
|
|
1703
1717
|
}
|
|
1704
1718
|
if (trimmed.length === 0) return { ok: true, prompt: command.template };
|
|
1719
|
+
const file = basename(command.path);
|
|
1720
|
+
const fileName = file === "SKILL.md" ? `${basename(dirname(command.path))}/${file}` : file;
|
|
1705
1721
|
return {
|
|
1706
1722
|
ok: false,
|
|
1707
1723
|
reason: [
|
|
1708
|
-
`/${command.name}
|
|
1709
|
-
|
|
1710
|
-
`Add ${ARGUMENTS_TOKEN} where they belong in ${command.path}, and they will be`,
|
|
1711
|
-
"substituted there. Running it now would silently discard them."
|
|
1724
|
+
`/${command.name} does not take extra text, so \u201C${trimmed}\u201D was not used.`,
|
|
1725
|
+
`Run /${command.name} on its own, or edit ${fileName} to say where extra text goes.`
|
|
1712
1726
|
].join("\n")
|
|
1713
1727
|
};
|
|
1714
1728
|
}
|
|
@@ -1758,6 +1772,196 @@ function installationRows() {
|
|
|
1758
1772
|
}
|
|
1759
1773
|
__name(installationRows, "installationRows");
|
|
1760
1774
|
|
|
1775
|
+
// src/permissions/rule-screen.ts
|
|
1776
|
+
import { existsSync, readFileSync as readFileSync3, renameSync, writeFileSync } from "node:fs";
|
|
1777
|
+
var SOURCE_NAMES = {
|
|
1778
|
+
"user-file": "your user settings",
|
|
1779
|
+
"project-file": "this project",
|
|
1780
|
+
"local-file": "this project, local",
|
|
1781
|
+
managed: "managed settings"
|
|
1782
|
+
};
|
|
1783
|
+
function ruleText(tool, pattern) {
|
|
1784
|
+
return pattern === void 0 || pattern === "*" ? tool : `${tool}(${pattern})`;
|
|
1785
|
+
}
|
|
1786
|
+
__name(ruleText, "ruleText");
|
|
1787
|
+
function ruleEntries(layers) {
|
|
1788
|
+
const out = [];
|
|
1789
|
+
for (const layer of layers) {
|
|
1790
|
+
for (const [tool, value] of Object.entries(layer.permissions)) {
|
|
1791
|
+
const base = { source: SOURCE_NAMES[layer.source], removable: layer.source === "local-file" };
|
|
1792
|
+
if (typeof value === "string") {
|
|
1793
|
+
out.push({ ...base, effect: value, rule: tool });
|
|
1794
|
+
continue;
|
|
1795
|
+
}
|
|
1796
|
+
for (const [pattern, effect] of Object.entries(value)) {
|
|
1797
|
+
out.push({ ...base, effect, rule: ruleText(tool, pattern) });
|
|
1798
|
+
}
|
|
1799
|
+
}
|
|
1800
|
+
}
|
|
1801
|
+
const order = ["allow", "ask", "deny"];
|
|
1802
|
+
return out.sort((a, b) => order.indexOf(a.effect) - order.indexOf(b.effect));
|
|
1803
|
+
}
|
|
1804
|
+
__name(ruleEntries, "ruleEntries");
|
|
1805
|
+
var TITLES = {
|
|
1806
|
+
allow: "Allowed without asking",
|
|
1807
|
+
ask: "Always asks",
|
|
1808
|
+
deny: "Never allowed"
|
|
1809
|
+
};
|
|
1810
|
+
function renderRules(entries, only) {
|
|
1811
|
+
const lines = [];
|
|
1812
|
+
for (const effect of ["allow", "ask", "deny"]) {
|
|
1813
|
+
if (only && effect !== only) continue;
|
|
1814
|
+
const mine = entries.filter((e) => e.effect === effect);
|
|
1815
|
+
lines.push(`${TITLES[effect]} (${mine.length})`);
|
|
1816
|
+
if (mine.length === 0) lines.push(" None.");
|
|
1817
|
+
for (const e of mine) lines.push(` ${e.rule} (${e.source})`);
|
|
1818
|
+
lines.push("");
|
|
1819
|
+
}
|
|
1820
|
+
if (!only) {
|
|
1821
|
+
lines.push("Add one with /permissions add <allow|ask|deny> <rule>, for example");
|
|
1822
|
+
lines.push("/permissions add deny Bash(rm -rf *). Remove one with /permissions remove <rule>.");
|
|
1823
|
+
lines.push(
|
|
1824
|
+
`Both change ${LOCAL_CONFIG_FILE} and update later calls in this conversation. Rules from other files are changed in those files.`
|
|
1825
|
+
);
|
|
1826
|
+
}
|
|
1827
|
+
return lines.join("\n").trimEnd();
|
|
1828
|
+
}
|
|
1829
|
+
__name(renderRules, "renderRules");
|
|
1830
|
+
function isRecord(value) {
|
|
1831
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1832
|
+
}
|
|
1833
|
+
__name(isRecord, "isRecord");
|
|
1834
|
+
function readLocal(cwd) {
|
|
1835
|
+
const path = localConfigPath(cwd);
|
|
1836
|
+
if (!existsSync(path)) return { document: {} };
|
|
1837
|
+
let parsed;
|
|
1838
|
+
try {
|
|
1839
|
+
parsed = JSON.parse(readFileSync3(path, "utf-8"));
|
|
1840
|
+
} catch {
|
|
1841
|
+
return { error: `${LOCAL_CONFIG_FILE} is not valid JSON, so it was left alone.` };
|
|
1842
|
+
}
|
|
1843
|
+
if (!isRecord(parsed)) return { error: `${LOCAL_CONFIG_FILE} is not a JSON object.` };
|
|
1844
|
+
if (parsed.permissions !== void 0 && !isRecord(parsed.permissions)) {
|
|
1845
|
+
return { error: `${LOCAL_CONFIG_FILE} has a permissions value that is not a table.` };
|
|
1846
|
+
}
|
|
1847
|
+
return { document: parsed };
|
|
1848
|
+
}
|
|
1849
|
+
__name(readLocal, "readLocal");
|
|
1850
|
+
function save(cwd, document) {
|
|
1851
|
+
const path = localConfigPath(cwd);
|
|
1852
|
+
try {
|
|
1853
|
+
const staging = `${path}.${process.pid}.tmp`;
|
|
1854
|
+
writeFileSync(staging, `${JSON.stringify(document, null, " ")}
|
|
1855
|
+
`, { mode: 384 });
|
|
1856
|
+
renameSync(staging, path);
|
|
1857
|
+
return void 0;
|
|
1858
|
+
} catch (cause) {
|
|
1859
|
+
return cause instanceof Error ? cause.message : String(cause);
|
|
1860
|
+
}
|
|
1861
|
+
}
|
|
1862
|
+
__name(save, "save");
|
|
1863
|
+
function addLocalRule(cwd, effect, rule) {
|
|
1864
|
+
if (!parseRuleString(rule)) {
|
|
1865
|
+
return {
|
|
1866
|
+
ok: false,
|
|
1867
|
+
message: "That is not a rule. Write a tool name, or a tool name with a specifier in parentheses, such as Bash(git status *)."
|
|
1868
|
+
};
|
|
1869
|
+
}
|
|
1870
|
+
const read = readLocal(cwd);
|
|
1871
|
+
if ("error" in read) return { ok: false, message: read.error };
|
|
1872
|
+
const permissions = isRecord(read.document.permissions) ? { ...read.document.permissions } : {};
|
|
1873
|
+
const { table, problem } = foldRuleLists({ [effect]: [rule] });
|
|
1874
|
+
if (problem) return { ok: false, message: problem.message };
|
|
1875
|
+
for (const [tool, wanted] of Object.entries(table)) {
|
|
1876
|
+
const had = permissions[tool];
|
|
1877
|
+
if (typeof wanted === "string") {
|
|
1878
|
+
if (isRecord(had)) permissions[tool] = { ...had, "*": wanted };
|
|
1879
|
+
else permissions[tool] = wanted;
|
|
1880
|
+
continue;
|
|
1881
|
+
}
|
|
1882
|
+
const patterns = isRecord(wanted) ? wanted : {};
|
|
1883
|
+
const base = isRecord(had) ? had : isPermissionEffect(had) ? { "*": had } : {};
|
|
1884
|
+
permissions[tool] = { ...base, ...patterns };
|
|
1885
|
+
}
|
|
1886
|
+
const failed = save(cwd, { ...read.document, permissions });
|
|
1887
|
+
if (failed) return { ok: false, message: `Could not save the rule: ${failed}` };
|
|
1888
|
+
return {
|
|
1889
|
+
ok: true,
|
|
1890
|
+
message: `Added ${effect} rule ${rule} to ${LOCAL_CONFIG_FILE}.`
|
|
1891
|
+
};
|
|
1892
|
+
}
|
|
1893
|
+
__name(addLocalRule, "addLocalRule");
|
|
1894
|
+
function removeLocalRule(cwd, rule) {
|
|
1895
|
+
const parsed = parseRuleString(rule);
|
|
1896
|
+
if (!parsed) return { ok: false, message: `That is not a rule: ${rule}` };
|
|
1897
|
+
const read = readLocal(cwd);
|
|
1898
|
+
if ("error" in read) return { ok: false, message: read.error };
|
|
1899
|
+
const permissions = isRecord(read.document.permissions) ? { ...read.document.permissions } : {};
|
|
1900
|
+
let removed = false;
|
|
1901
|
+
const entry = permissions[parsed.tool];
|
|
1902
|
+
if (parsed.specifier === void 0) {
|
|
1903
|
+
if (isPermissionEffect(entry)) {
|
|
1904
|
+
delete permissions[parsed.tool];
|
|
1905
|
+
removed = true;
|
|
1906
|
+
} else if (isRecord(entry) && entry["*"] !== void 0) {
|
|
1907
|
+
const { "*": _gone, ...rest } = entry;
|
|
1908
|
+
if (Object.keys(rest).length === 0) delete permissions[parsed.tool];
|
|
1909
|
+
else permissions[parsed.tool] = rest;
|
|
1910
|
+
removed = true;
|
|
1911
|
+
}
|
|
1912
|
+
} else if (isRecord(entry)) {
|
|
1913
|
+
for (const effect of ["allow", "ask", "deny"]) {
|
|
1914
|
+
const key = patternOf(parsed.tool, parsed.specifier, effect);
|
|
1915
|
+
if (entry[key] === effect) {
|
|
1916
|
+
const { [key]: _gone, ...rest } = entry;
|
|
1917
|
+
if (Object.keys(rest).length === 0) delete permissions[parsed.tool];
|
|
1918
|
+
else permissions[parsed.tool] = rest;
|
|
1919
|
+
removed = true;
|
|
1920
|
+
break;
|
|
1921
|
+
}
|
|
1922
|
+
}
|
|
1923
|
+
}
|
|
1924
|
+
for (const list of ["allow", "ask", "deny"]) {
|
|
1925
|
+
const value = permissions[list];
|
|
1926
|
+
if (Array.isArray(value) && value.includes(rule)) {
|
|
1927
|
+
const kept = value.filter((item) => item !== rule);
|
|
1928
|
+
if (kept.length === 0) delete permissions[list];
|
|
1929
|
+
else permissions[list] = kept;
|
|
1930
|
+
removed = true;
|
|
1931
|
+
}
|
|
1932
|
+
}
|
|
1933
|
+
if (!removed) {
|
|
1934
|
+
return {
|
|
1935
|
+
ok: false,
|
|
1936
|
+
message: `No rule ${rule} in ${LOCAL_CONFIG_FILE}. Rules from other files are removed by editing those files (see /permissions rules).`
|
|
1937
|
+
};
|
|
1938
|
+
}
|
|
1939
|
+
const document = { ...read.document, permissions };
|
|
1940
|
+
if (Object.keys(permissions).length === 0) {
|
|
1941
|
+
;
|
|
1942
|
+
document.permissions = void 0;
|
|
1943
|
+
}
|
|
1944
|
+
const failed = save(cwd, document);
|
|
1945
|
+
if (failed) return { ok: false, message: `Could not save the change: ${failed}` };
|
|
1946
|
+
return {
|
|
1947
|
+
ok: true,
|
|
1948
|
+
message: `Removed ${rule} from ${LOCAL_CONFIG_FILE}.`
|
|
1949
|
+
};
|
|
1950
|
+
}
|
|
1951
|
+
__name(removeLocalRule, "removeLocalRule");
|
|
1952
|
+
function renderRecentDenials(rows) {
|
|
1953
|
+
if (!rows || rows.length === 0) {
|
|
1954
|
+
return "No recent denials. Calls refused by auto mode will be listed here.";
|
|
1955
|
+
}
|
|
1956
|
+
const lines = [`Recently refused by auto mode (${rows.length}, newest first)`];
|
|
1957
|
+
for (const row of rows) {
|
|
1958
|
+
lines.push(` ${row.tool}${row.summary ? `: ${row.summary}` : ""}`);
|
|
1959
|
+
lines.push(` ${row.reason}`);
|
|
1960
|
+
}
|
|
1961
|
+
return lines.join("\n");
|
|
1962
|
+
}
|
|
1963
|
+
__name(renderRecentDenials, "renderRecentDenials");
|
|
1964
|
+
|
|
1761
1965
|
// src/tui/status-card.ts
|
|
1762
1966
|
function statusCard(rows, columns = 80) {
|
|
1763
1967
|
const width = Math.min(96, Math.max(12, columns - 6));
|
|
@@ -1788,6 +1992,35 @@ function statusCard(rows, columns = 80) {
|
|
|
1788
1992
|
}
|
|
1789
1993
|
__name(statusCard, "statusCard");
|
|
1790
1994
|
|
|
1995
|
+
// src/tui/tool-server-rows.ts
|
|
1996
|
+
function plainToolServerReason(reason) {
|
|
1997
|
+
const flat = terminalDisplayText(reason).replace(/\s+/g, " ").trim();
|
|
1998
|
+
if (isToolServerTimeout(flat)) return "It did not answer in time.";
|
|
1999
|
+
if (flat === "") return "No reason was given.";
|
|
2000
|
+
return /[.!?]$/.test(flat) ? flat : `${flat}.`;
|
|
2001
|
+
}
|
|
2002
|
+
__name(plainToolServerReason, "plainToolServerReason");
|
|
2003
|
+
var isToolServerTimeout = /* @__PURE__ */ __name((reason) => /did not answer within \d+\s*ms/i.test(reason), "isToolServerTimeout");
|
|
2004
|
+
function toolServerRow(name, status) {
|
|
2005
|
+
const label = terminalDisplayText(name);
|
|
2006
|
+
const connected = status.connected.find((server) => server.name === name);
|
|
2007
|
+
if (connected) {
|
|
2008
|
+
return {
|
|
2009
|
+
level: "notice",
|
|
2010
|
+
text: `Tool server ${label} \xB7 ${plural(connected.toolCount, "tool")}`
|
|
2011
|
+
};
|
|
2012
|
+
}
|
|
2013
|
+
const failed = status.failed.find((server) => server.name === name);
|
|
2014
|
+
if (failed) {
|
|
2015
|
+
return {
|
|
2016
|
+
level: "warning",
|
|
2017
|
+
text: `Tool server ${label} is not available. ${plainToolServerReason(failed.reason)}`
|
|
2018
|
+
};
|
|
2019
|
+
}
|
|
2020
|
+
return void 0;
|
|
2021
|
+
}
|
|
2022
|
+
__name(toolServerRow, "toolServerRow");
|
|
2023
|
+
|
|
1791
2024
|
// src/tui/turn-limits-settings.ts
|
|
1792
2025
|
var TURN_LIMIT_FIELDS = [
|
|
1793
2026
|
{
|
|
@@ -1868,7 +2101,7 @@ function turnLimitCommands(limits) {
|
|
|
1868
2101
|
__name(turnLimitCommands, "turnLimitCommands");
|
|
1869
2102
|
|
|
1870
2103
|
// src/release-notes.ts
|
|
1871
|
-
import { readFileSync as
|
|
2104
|
+
import { readFileSync as readFileSync4 } from "node:fs";
|
|
1872
2105
|
import { dirname as dirname3, join as join3 } from "node:path";
|
|
1873
2106
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
1874
2107
|
function changelogSection(changelog, version) {
|
|
@@ -1893,7 +2126,7 @@ __name(changelogVersions, "changelogVersions");
|
|
|
1893
2126
|
function readChangelog() {
|
|
1894
2127
|
try {
|
|
1895
2128
|
const here = dirname3(fileURLToPath2(new URL("../", import.meta.url).href + "release-notes.js"));
|
|
1896
|
-
return
|
|
2129
|
+
return readFileSync4(join3(here, "..", "CHANGELOG.md"), "utf8");
|
|
1897
2130
|
} catch {
|
|
1898
2131
|
return null;
|
|
1899
2132
|
}
|
|
@@ -1919,6 +2152,435 @@ ${shown.join("\n")}${cut}`;
|
|
|
1919
2152
|
}
|
|
1920
2153
|
__name(renderReleaseNotes, "renderReleaseNotes");
|
|
1921
2154
|
|
|
2155
|
+
// src/tui/keymap.ts
|
|
2156
|
+
var action = /* @__PURE__ */ __name((spec) => spec, "action");
|
|
2157
|
+
var ACTIONS = [
|
|
2158
|
+
action({
|
|
2159
|
+
id: "app:interrupt",
|
|
2160
|
+
context: "Global",
|
|
2161
|
+
group: "Conversation",
|
|
2162
|
+
keys: ["ctrl+c"],
|
|
2163
|
+
help: "Stop the reply; press twice to exit"
|
|
2164
|
+
}),
|
|
2165
|
+
action({
|
|
2166
|
+
id: "app:exit",
|
|
2167
|
+
context: "Global",
|
|
2168
|
+
group: "Conversation",
|
|
2169
|
+
keys: ["ctrl+d"],
|
|
2170
|
+
help: "Exit, on an empty message (press twice)"
|
|
2171
|
+
}),
|
|
2172
|
+
action({
|
|
2173
|
+
id: "app:toggleTranscript",
|
|
2174
|
+
context: "Global",
|
|
2175
|
+
group: "Conversation",
|
|
2176
|
+
keys: ["ctrl+o"],
|
|
2177
|
+
help: "Open the detailed transcript"
|
|
2178
|
+
}),
|
|
2179
|
+
action({
|
|
2180
|
+
id: "app:openAgents",
|
|
2181
|
+
context: "Global",
|
|
2182
|
+
group: "Agents and jobs",
|
|
2183
|
+
keys: ["ctrl+t"],
|
|
2184
|
+
help: "Open or close delegated work"
|
|
2185
|
+
}),
|
|
2186
|
+
action({
|
|
2187
|
+
id: "history:search",
|
|
2188
|
+
context: "Global",
|
|
2189
|
+
group: "Conversation",
|
|
2190
|
+
keys: ["ctrl+r"],
|
|
2191
|
+
help: "Search earlier messages"
|
|
2192
|
+
}),
|
|
2193
|
+
action({
|
|
2194
|
+
id: "historySearch:newer",
|
|
2195
|
+
context: "HistorySearch",
|
|
2196
|
+
group: "Conversation",
|
|
2197
|
+
keys: ["ctrl+s"],
|
|
2198
|
+
help: "While searching, go to a newer match"
|
|
2199
|
+
}),
|
|
2200
|
+
action({
|
|
2201
|
+
id: "chat:cancel",
|
|
2202
|
+
context: "Chat",
|
|
2203
|
+
group: "Conversation",
|
|
2204
|
+
keys: ["escape"],
|
|
2205
|
+
help: "Interrupt a reply; twice clears a draft, or on an empty message opens rewind"
|
|
2206
|
+
}),
|
|
2207
|
+
action({
|
|
2208
|
+
id: "chat:clearScreen",
|
|
2209
|
+
context: "Chat",
|
|
2210
|
+
group: "Conversation",
|
|
2211
|
+
keys: ["ctrl+l"],
|
|
2212
|
+
help: "Clear the screen (the conversation is kept)"
|
|
2213
|
+
}),
|
|
2214
|
+
action({
|
|
2215
|
+
id: "chat:submit",
|
|
2216
|
+
context: "Chat",
|
|
2217
|
+
group: "Conversation",
|
|
2218
|
+
keys: ["return"],
|
|
2219
|
+
help: "Send the message, or steer the reply in progress"
|
|
2220
|
+
}),
|
|
2221
|
+
action({
|
|
2222
|
+
id: "chat:queue",
|
|
2223
|
+
context: "Chat",
|
|
2224
|
+
group: "Conversation",
|
|
2225
|
+
keys: ["tab"],
|
|
2226
|
+
help: "Queue the message for after the reply"
|
|
2227
|
+
}),
|
|
2228
|
+
action({
|
|
2229
|
+
id: "chat:newline",
|
|
2230
|
+
context: "Chat",
|
|
2231
|
+
group: "Editing",
|
|
2232
|
+
keys: ["shift+return", "meta+return", "ctrl+j"],
|
|
2233
|
+
help: "New line"
|
|
2234
|
+
}),
|
|
2235
|
+
action({
|
|
2236
|
+
id: "chat:sendNow",
|
|
2237
|
+
context: "Chat",
|
|
2238
|
+
group: "Conversation",
|
|
2239
|
+
keys: ["ctrl+x ctrl+s"],
|
|
2240
|
+
help: "Send queued messages now"
|
|
2241
|
+
}),
|
|
2242
|
+
action({
|
|
2243
|
+
id: "chat:recallQueued",
|
|
2244
|
+
context: "Chat",
|
|
2245
|
+
group: "Conversation",
|
|
2246
|
+
keys: ["meta+up"],
|
|
2247
|
+
help: "Bring the last queued message back for editing"
|
|
2248
|
+
}),
|
|
2249
|
+
action({
|
|
2250
|
+
id: "chat:stash",
|
|
2251
|
+
context: "Chat",
|
|
2252
|
+
group: "Editing",
|
|
2253
|
+
keys: ["ctrl+s"],
|
|
2254
|
+
help: "Set the draft aside; press again on an empty message to bring it back"
|
|
2255
|
+
}),
|
|
2256
|
+
action({
|
|
2257
|
+
id: "chat:undo",
|
|
2258
|
+
context: "Chat",
|
|
2259
|
+
group: "Editing",
|
|
2260
|
+
keys: ["ctrl+_", "ctrl+-"],
|
|
2261
|
+
help: "Undo the last edit to the draft"
|
|
2262
|
+
}),
|
|
2263
|
+
action({
|
|
2264
|
+
id: "chat:externalEditor",
|
|
2265
|
+
context: "Chat",
|
|
2266
|
+
group: "Editing",
|
|
2267
|
+
keys: ["ctrl+g", "ctrl+x ctrl+e"],
|
|
2268
|
+
help: "Edit the draft in your editor"
|
|
2269
|
+
}),
|
|
2270
|
+
action({
|
|
2271
|
+
id: "chat:imagePaste",
|
|
2272
|
+
context: "Chat",
|
|
2273
|
+
group: "Editing",
|
|
2274
|
+
keys: ["ctrl+v", "meta+v"],
|
|
2275
|
+
help: "Paste an image from the clipboard"
|
|
2276
|
+
}),
|
|
2277
|
+
action({
|
|
2278
|
+
id: "chat:triggerToggle",
|
|
2279
|
+
context: "Chat",
|
|
2280
|
+
group: "Editing",
|
|
2281
|
+
keys: ["meta+w"],
|
|
2282
|
+
help: "Drop or restore the keyword nearest the cursor"
|
|
2283
|
+
}),
|
|
2284
|
+
action({
|
|
2285
|
+
id: "chat:cycleMode",
|
|
2286
|
+
context: "Chat",
|
|
2287
|
+
group: "Models and modes",
|
|
2288
|
+
keys: ["shift+tab"],
|
|
2289
|
+
help: "Change the permission mode"
|
|
2290
|
+
}),
|
|
2291
|
+
action({
|
|
2292
|
+
id: "chat:modelPicker",
|
|
2293
|
+
context: "Chat",
|
|
2294
|
+
group: "Models and modes",
|
|
2295
|
+
keys: ["meta+p"],
|
|
2296
|
+
help: "Choose a model"
|
|
2297
|
+
}),
|
|
2298
|
+
action({
|
|
2299
|
+
id: "chat:thinkingToggle",
|
|
2300
|
+
context: "Chat",
|
|
2301
|
+
group: "Models and modes",
|
|
2302
|
+
keys: ["meta+t"],
|
|
2303
|
+
help: "Switch thinking on or off"
|
|
2304
|
+
}),
|
|
2305
|
+
action({
|
|
2306
|
+
id: "chat:effortLower",
|
|
2307
|
+
context: "Chat",
|
|
2308
|
+
group: "Models and modes",
|
|
2309
|
+
keys: ["shift+down", "meta+,"],
|
|
2310
|
+
help: "Think less"
|
|
2311
|
+
}),
|
|
2312
|
+
action({
|
|
2313
|
+
id: "chat:effortRaise",
|
|
2314
|
+
context: "Chat",
|
|
2315
|
+
group: "Models and modes",
|
|
2316
|
+
keys: ["shift+up", "meta+."],
|
|
2317
|
+
help: "Think more"
|
|
2318
|
+
}),
|
|
2319
|
+
action({
|
|
2320
|
+
id: "task:background",
|
|
2321
|
+
context: "Task",
|
|
2322
|
+
group: "Agents and jobs",
|
|
2323
|
+
keys: ["ctrl+b"],
|
|
2324
|
+
help: "Move a running shell command to the background"
|
|
2325
|
+
}),
|
|
2326
|
+
action({
|
|
2327
|
+
id: "chat:killAgents",
|
|
2328
|
+
context: "Chat",
|
|
2329
|
+
group: "Agents and jobs",
|
|
2330
|
+
keys: ["ctrl+x ctrl+k"],
|
|
2331
|
+
help: "Stop all background agents"
|
|
2332
|
+
}),
|
|
2333
|
+
action({
|
|
2334
|
+
id: "edit:lineStart",
|
|
2335
|
+
context: "Chat",
|
|
2336
|
+
group: "Editing",
|
|
2337
|
+
keys: ["ctrl+a", "home"],
|
|
2338
|
+
help: "Start of the line"
|
|
2339
|
+
}),
|
|
2340
|
+
action({
|
|
2341
|
+
id: "edit:lineEnd",
|
|
2342
|
+
context: "Chat",
|
|
2343
|
+
group: "Editing",
|
|
2344
|
+
keys: ["ctrl+e", "end"],
|
|
2345
|
+
help: "End of the line"
|
|
2346
|
+
}),
|
|
2347
|
+
action({
|
|
2348
|
+
id: "edit:charLeft",
|
|
2349
|
+
context: "Chat",
|
|
2350
|
+
group: "Editing",
|
|
2351
|
+
keys: ["ctrl+b", "left"],
|
|
2352
|
+
help: "Back one character"
|
|
2353
|
+
}),
|
|
2354
|
+
action({
|
|
2355
|
+
id: "edit:charRight",
|
|
2356
|
+
context: "Chat",
|
|
2357
|
+
group: "Editing",
|
|
2358
|
+
keys: ["ctrl+f", "right"],
|
|
2359
|
+
help: "Forward one character"
|
|
2360
|
+
}),
|
|
2361
|
+
action({
|
|
2362
|
+
id: "edit:wordLeft",
|
|
2363
|
+
context: "Chat",
|
|
2364
|
+
group: "Editing",
|
|
2365
|
+
keys: ["meta+b", "ctrl+left", "meta+left"],
|
|
2366
|
+
help: "Back one word"
|
|
2367
|
+
}),
|
|
2368
|
+
action({
|
|
2369
|
+
id: "edit:wordRight",
|
|
2370
|
+
context: "Chat",
|
|
2371
|
+
group: "Editing",
|
|
2372
|
+
keys: ["meta+f", "ctrl+right", "meta+right"],
|
|
2373
|
+
help: "Forward one word"
|
|
2374
|
+
}),
|
|
2375
|
+
action({
|
|
2376
|
+
id: "edit:linePrevious",
|
|
2377
|
+
context: "Chat",
|
|
2378
|
+
group: "Editing",
|
|
2379
|
+
keys: ["up", "ctrl+p"],
|
|
2380
|
+
help: "Up a line, then through earlier messages"
|
|
2381
|
+
}),
|
|
2382
|
+
action({
|
|
2383
|
+
id: "edit:lineNext",
|
|
2384
|
+
context: "Chat",
|
|
2385
|
+
group: "Editing",
|
|
2386
|
+
keys: ["down", "ctrl+n"],
|
|
2387
|
+
help: "Down a line, then back to the draft"
|
|
2388
|
+
}),
|
|
2389
|
+
action({
|
|
2390
|
+
id: "edit:deleteForward",
|
|
2391
|
+
context: "Chat",
|
|
2392
|
+
group: "Editing",
|
|
2393
|
+
keys: ["delete", "ctrl+d"],
|
|
2394
|
+
help: "Delete the character after the cursor"
|
|
2395
|
+
}),
|
|
2396
|
+
action({
|
|
2397
|
+
id: "edit:deleteWordBack",
|
|
2398
|
+
context: "Chat",
|
|
2399
|
+
group: "Editing",
|
|
2400
|
+
keys: ["ctrl+w", "meta+backspace", "ctrl+backspace"],
|
|
2401
|
+
help: "Delete the word before the cursor"
|
|
2402
|
+
}),
|
|
2403
|
+
action({
|
|
2404
|
+
id: "edit:deleteWordForward",
|
|
2405
|
+
context: "Chat",
|
|
2406
|
+
group: "Editing",
|
|
2407
|
+
keys: ["meta+d"],
|
|
2408
|
+
help: "Delete the word after the cursor"
|
|
2409
|
+
}),
|
|
2410
|
+
action({
|
|
2411
|
+
id: "edit:deleteToLineStart",
|
|
2412
|
+
context: "Chat",
|
|
2413
|
+
group: "Editing",
|
|
2414
|
+
keys: ["ctrl+u"],
|
|
2415
|
+
help: "Delete to the start of the line"
|
|
2416
|
+
}),
|
|
2417
|
+
action({
|
|
2418
|
+
id: "edit:deleteToLineEnd",
|
|
2419
|
+
context: "Chat",
|
|
2420
|
+
group: "Editing",
|
|
2421
|
+
keys: ["ctrl+k"],
|
|
2422
|
+
help: "Delete to the end of the line"
|
|
2423
|
+
}),
|
|
2424
|
+
action({
|
|
2425
|
+
id: "edit:yank",
|
|
2426
|
+
context: "Chat",
|
|
2427
|
+
group: "Editing",
|
|
2428
|
+
keys: ["ctrl+y"],
|
|
2429
|
+
help: "Paste what was last deleted"
|
|
2430
|
+
})
|
|
2431
|
+
];
|
|
2432
|
+
var BY_ID = new Map(ACTIONS.map((spec) => [spec.id, spec]));
|
|
2433
|
+
function actionSpec(id) {
|
|
2434
|
+
const spec = BY_ID.get(id);
|
|
2435
|
+
if (!spec) throw new Error(`Unknown action ${id}`);
|
|
2436
|
+
return spec;
|
|
2437
|
+
}
|
|
2438
|
+
__name(actionSpec, "actionSpec");
|
|
2439
|
+
var STROKES = /* @__PURE__ */ new Map();
|
|
2440
|
+
function parseStroke(text) {
|
|
2441
|
+
const cached2 = STROKES.get(text);
|
|
2442
|
+
if (cached2) return cached2;
|
|
2443
|
+
const parts = text.split("+");
|
|
2444
|
+
const base = text.endsWith("+") ? "+" : parts.pop() ?? "";
|
|
2445
|
+
const mods = new Set(parts);
|
|
2446
|
+
const stroke = {
|
|
2447
|
+
ctrl: mods.has("ctrl"),
|
|
2448
|
+
meta: mods.has("meta") || mods.has("alt"),
|
|
2449
|
+
shift: mods.has("shift"),
|
|
2450
|
+
base
|
|
2451
|
+
};
|
|
2452
|
+
STROKES.set(text, stroke);
|
|
2453
|
+
return stroke;
|
|
2454
|
+
}
|
|
2455
|
+
__name(parseStroke, "parseStroke");
|
|
2456
|
+
var NAMED = {
|
|
2457
|
+
escape: "escape",
|
|
2458
|
+
return: "return",
|
|
2459
|
+
tab: "tab",
|
|
2460
|
+
backspace: "backspace",
|
|
2461
|
+
delete: "delete",
|
|
2462
|
+
up: "upArrow",
|
|
2463
|
+
down: "downArrow",
|
|
2464
|
+
left: "leftArrow",
|
|
2465
|
+
right: "rightArrow",
|
|
2466
|
+
pageup: "pageUp",
|
|
2467
|
+
pagedown: "pageDown",
|
|
2468
|
+
home: "home",
|
|
2469
|
+
end: "end"
|
|
2470
|
+
};
|
|
2471
|
+
var UNIT_SEPARATOR = "";
|
|
2472
|
+
function matchStroke(text, input, key) {
|
|
2473
|
+
const stroke = parseStroke(text);
|
|
2474
|
+
if (stroke.ctrl && !key.ctrl && !(stroke.base === "_" && input === UNIT_SEPARATOR)) return false;
|
|
2475
|
+
if (stroke.meta && !key.meta) return false;
|
|
2476
|
+
if (stroke.shift && !key.shift) return false;
|
|
2477
|
+
const named = NAMED[stroke.base];
|
|
2478
|
+
if (named !== void 0) return key[named] === true;
|
|
2479
|
+
if (stroke.base === "_" && stroke.ctrl && input === UNIT_SEPARATOR) return true;
|
|
2480
|
+
if (!stroke.ctrl && !stroke.meta) return false;
|
|
2481
|
+
return input === stroke.base;
|
|
2482
|
+
}
|
|
2483
|
+
__name(matchStroke, "matchStroke");
|
|
2484
|
+
function strokesOf(chord) {
|
|
2485
|
+
return chord.split(" ");
|
|
2486
|
+
}
|
|
2487
|
+
__name(strokesOf, "strokesOf");
|
|
2488
|
+
function isAction(id, input, key) {
|
|
2489
|
+
for (const chord of actionSpec(id).keys) {
|
|
2490
|
+
const strokes = strokesOf(chord);
|
|
2491
|
+
if (strokes.length === 1 && matchStroke(chord, input, key)) return true;
|
|
2492
|
+
}
|
|
2493
|
+
return false;
|
|
2494
|
+
}
|
|
2495
|
+
__name(isAction, "isAction");
|
|
2496
|
+
function isChordLead(input, key) {
|
|
2497
|
+
for (const spec of ACTIONS) {
|
|
2498
|
+
for (const chord of spec.keys) {
|
|
2499
|
+
const strokes = strokesOf(chord);
|
|
2500
|
+
const lead = strokes[0];
|
|
2501
|
+
if (strokes.length === 2 && lead !== void 0 && matchStroke(lead, input, key)) return true;
|
|
2502
|
+
}
|
|
2503
|
+
}
|
|
2504
|
+
return false;
|
|
2505
|
+
}
|
|
2506
|
+
__name(isChordLead, "isChordLead");
|
|
2507
|
+
function isChordAction(id, input, key) {
|
|
2508
|
+
for (const chord of actionSpec(id).keys) {
|
|
2509
|
+
const strokes = strokesOf(chord);
|
|
2510
|
+
const second = strokes[1];
|
|
2511
|
+
if (strokes.length === 2 && second !== void 0 && matchStroke(second, input, key)) return true;
|
|
2512
|
+
}
|
|
2513
|
+
return false;
|
|
2514
|
+
}
|
|
2515
|
+
__name(isChordAction, "isChordAction");
|
|
2516
|
+
function pressedKeyLabel(id, input, key, afterLead = false) {
|
|
2517
|
+
for (const chord of actionSpec(id).keys) {
|
|
2518
|
+
const strokes = strokesOf(chord);
|
|
2519
|
+
const stroke = afterLead ? strokes[1] : strokes[0];
|
|
2520
|
+
if (afterLead ? strokes.length !== 2 : strokes.length !== 1) continue;
|
|
2521
|
+
if (stroke !== void 0 && matchStroke(stroke, input, key)) return keyLabel(chord);
|
|
2522
|
+
}
|
|
2523
|
+
return "";
|
|
2524
|
+
}
|
|
2525
|
+
__name(pressedKeyLabel, "pressedKeyLabel");
|
|
2526
|
+
var NAME_LABELS = {
|
|
2527
|
+
meta: "Alt",
|
|
2528
|
+
ctrl: "Ctrl",
|
|
2529
|
+
shift: "Shift",
|
|
2530
|
+
escape: "Esc",
|
|
2531
|
+
return: "Enter",
|
|
2532
|
+
tab: "Tab",
|
|
2533
|
+
up: "Up",
|
|
2534
|
+
down: "Down",
|
|
2535
|
+
left: "Left",
|
|
2536
|
+
right: "Right",
|
|
2537
|
+
backspace: "Backspace",
|
|
2538
|
+
delete: "Delete",
|
|
2539
|
+
home: "Home",
|
|
2540
|
+
end: "End",
|
|
2541
|
+
pageup: "Page Up",
|
|
2542
|
+
pagedown: "Page Down"
|
|
2543
|
+
};
|
|
2544
|
+
function labelStroke(stroke) {
|
|
2545
|
+
if (stroke.endsWith("+")) return stroke.slice(0, -1).split("+").map(labelPart).join("+") + "++";
|
|
2546
|
+
return stroke.split("+").map(labelPart).join("+");
|
|
2547
|
+
}
|
|
2548
|
+
__name(labelStroke, "labelStroke");
|
|
2549
|
+
function labelPart(part) {
|
|
2550
|
+
return NAME_LABELS[part] ?? (part.length === 1 ? part.toUpperCase() : part);
|
|
2551
|
+
}
|
|
2552
|
+
__name(labelPart, "labelPart");
|
|
2553
|
+
function keyLabel(chord) {
|
|
2554
|
+
return strokesOf(chord).map(labelStroke).join(" ");
|
|
2555
|
+
}
|
|
2556
|
+
__name(keyLabel, "keyLabel");
|
|
2557
|
+
function primaryKeyLabel(id) {
|
|
2558
|
+
const first = actionSpec(id).keys[0];
|
|
2559
|
+
return first === void 0 ? "" : keyLabel(first);
|
|
2560
|
+
}
|
|
2561
|
+
__name(primaryKeyLabel, "primaryKeyLabel");
|
|
2562
|
+
var GROUP_ORDER = [
|
|
2563
|
+
"Conversation",
|
|
2564
|
+
"Models and modes",
|
|
2565
|
+
"Editing",
|
|
2566
|
+
"Agents and jobs"
|
|
2567
|
+
];
|
|
2568
|
+
function keysHelpText() {
|
|
2569
|
+
const lines = ["Keyboard shortcuts"];
|
|
2570
|
+
for (const group of GROUP_ORDER) {
|
|
2571
|
+
const rows = ACTIONS.filter((spec) => spec.group === group && spec.help !== "");
|
|
2572
|
+
if (rows.length === 0) continue;
|
|
2573
|
+
const labels = rows.map((spec) => spec.keys.map(keyLabel).join(" or "));
|
|
2574
|
+
const width = Math.max(...labels.map((label) => label.length));
|
|
2575
|
+
lines.push("", group);
|
|
2576
|
+
rows.forEach((spec, index) => {
|
|
2577
|
+
lines.push(` ${(labels[index] ?? "").padEnd(width)} ${spec.help}`);
|
|
2578
|
+
});
|
|
2579
|
+
}
|
|
2580
|
+
return lines.join("\n");
|
|
2581
|
+
}
|
|
2582
|
+
__name(keysHelpText, "keysHelpText");
|
|
2583
|
+
|
|
1922
2584
|
// src/tui/motion.ts
|
|
1923
2585
|
var import_react = __toESM(require_react(), 1);
|
|
1924
2586
|
var reduced = false;
|
|
@@ -2222,6 +2884,9 @@ function parseSlash(line) {
|
|
|
2222
2884
|
__name(parseSlash, "parseSlash");
|
|
2223
2885
|
function commandHelp(ctx, args) {
|
|
2224
2886
|
const name = args[0]?.replace(/^\//, "");
|
|
2887
|
+
if (args.length === 1 && name === "keys" && !(ctx.builtins ?? CLI_LOCAL_COMMANDS).some((c) => c.name === "keys")) {
|
|
2888
|
+
return { kind: "message", role: "system", content: keysHelpText() };
|
|
2889
|
+
}
|
|
2225
2890
|
if (args.length !== 1 || !name) {
|
|
2226
2891
|
return {
|
|
2227
2892
|
kind: "message",
|
|
@@ -2353,6 +3018,38 @@ var CLI_LOCAL_COMMANDS = [
|
|
|
2353
3018
|
description: "Write a short recap of this conversation now.",
|
|
2354
3019
|
action: /* @__PURE__ */ __name(() => ({ kind: "recap-now" }), "action")
|
|
2355
3020
|
},
|
|
3021
|
+
{
|
|
3022
|
+
name: "btw",
|
|
3023
|
+
help: {
|
|
3024
|
+
usage: ["/btw <question>"],
|
|
3025
|
+
details: [
|
|
3026
|
+
"Asks a quick side question while the main work goes on. The small model answers from the conversation so far and cannot read files or run commands; the question and the answer are shown once and are not added to the conversation."
|
|
3027
|
+
]
|
|
3028
|
+
},
|
|
3029
|
+
description: "Ask a quick side question; the work carries on.",
|
|
3030
|
+
action: /* @__PURE__ */ __name((_ctx, args) => args.length === 0 ? { kind: "message", role: "system", content: "Usage: /btw <question>" } : { kind: "side-question", question: args.join(" ") }, "action")
|
|
3031
|
+
},
|
|
3032
|
+
{
|
|
3033
|
+
name: "plan",
|
|
3034
|
+
help: {
|
|
3035
|
+
usage: ["/plan", "/plan <description>"],
|
|
3036
|
+
details: [
|
|
3037
|
+
"Switches this conversation to plan mode, where Namzu reads and plans but changes nothing until you approve the plan. With a description, it is sent as your next message."
|
|
3038
|
+
]
|
|
3039
|
+
},
|
|
3040
|
+
description: "Switch to plan mode, optionally with what to plan.",
|
|
3041
|
+
action: /* @__PURE__ */ __name((ctx, args) => {
|
|
3042
|
+
const description = args.join(" ").trim();
|
|
3043
|
+
if (ctx.permissions.currentMode().mode === "plan") {
|
|
3044
|
+
return description === "" ? { kind: "message", role: "system", content: "Already in plan mode." } : { kind: "prompt", text: description };
|
|
3045
|
+
}
|
|
3046
|
+
return {
|
|
3047
|
+
kind: "permission-mode",
|
|
3048
|
+
mode: "plan",
|
|
3049
|
+
...description === "" ? {} : { thenPrompt: description }
|
|
3050
|
+
};
|
|
3051
|
+
}, "action")
|
|
3052
|
+
},
|
|
2356
3053
|
{
|
|
2357
3054
|
name: "settings",
|
|
2358
3055
|
description: "View or change model, reasoning and permissions.",
|
|
@@ -2448,9 +3145,9 @@ var CLI_LOCAL_COMMANDS = [
|
|
|
2448
3145
|
name: "help",
|
|
2449
3146
|
description: "Browse commands, or show usage with /help <command>.",
|
|
2450
3147
|
help: {
|
|
2451
|
-
usage: ["/help", "/help <command>"],
|
|
3148
|
+
usage: ["/help", "/help <command>", "/help keys"],
|
|
2452
3149
|
details: [
|
|
2453
|
-
"Without a name, opens the command menu. With a name, shows help without running the command."
|
|
3150
|
+
"Without a name, opens the command menu. With a name, shows help without running the command. `/help keys` lists the keyboard shortcuts."
|
|
2454
3151
|
]
|
|
2455
3152
|
},
|
|
2456
3153
|
action: /* @__PURE__ */ __name((ctx, args) => {
|
|
@@ -2862,9 +3559,17 @@ ${dirs.map((d) => ` ${d}`).join("\n")}`
|
|
|
2862
3559
|
},
|
|
2863
3560
|
{
|
|
2864
3561
|
name: "mcp",
|
|
2865
|
-
help: {
|
|
2866
|
-
|
|
2867
|
-
|
|
3562
|
+
help: {
|
|
3563
|
+
usage: [
|
|
3564
|
+
"/mcp [tools|details]",
|
|
3565
|
+
"/mcp prompts [server]",
|
|
3566
|
+
"/mcp prompt <server> <name> [argument=value ...]",
|
|
3567
|
+
"/mcp resources [server]",
|
|
3568
|
+
"/mcp resource <server> <uri>"
|
|
3569
|
+
]
|
|
3570
|
+
},
|
|
3571
|
+
description: "Show tool servers, choose a prompt or attach a resource.",
|
|
3572
|
+
action: /* @__PURE__ */ __name((ctx, args) => ["prompts", "prompt", "resources", "resource"].includes(args[0] ?? "") ? { kind: "mcp-person", args } : reportCommand("mcp", args, (details) => renderMcp(ctx.mcp(), details), "tools"), "action")
|
|
2868
3573
|
},
|
|
2869
3574
|
{
|
|
2870
3575
|
name: "diff",
|
|
@@ -2962,8 +3667,18 @@ ${dirs.map((d) => ` ${d}`).join("\n")}`
|
|
|
2962
3667
|
name: "permissions",
|
|
2963
3668
|
description: "Choose which actions need your approval.",
|
|
2964
3669
|
help: {
|
|
2965
|
-
usage: [
|
|
3670
|
+
usage: [
|
|
3671
|
+
"/permissions",
|
|
3672
|
+
"/permissions details",
|
|
3673
|
+
"/permissions <mode>",
|
|
3674
|
+
"/permissions rules [allow|ask|deny]",
|
|
3675
|
+
"/permissions add <allow|ask|deny> <rule>",
|
|
3676
|
+
"/permissions remove <rule>",
|
|
3677
|
+
"/permissions denied",
|
|
3678
|
+
"/permissions dirs"
|
|
3679
|
+
],
|
|
2966
3680
|
details: [
|
|
3681
|
+
"Rules are listed with the file they come from. Add and remove change the local project file and update later calls in this conversation. Other permission layers and sandbox restrictions still apply. denied lists calls auto mode refused in this conversation; dirs lists the folders the file tools can reach.",
|
|
2967
3682
|
"Choose a preset in the menu, or use a typed mode:",
|
|
2968
3683
|
...PERMISSION_MODE_NAMES.map((name) => {
|
|
2969
3684
|
const mode = permissionModeFromName(name);
|
|
@@ -2974,6 +3689,8 @@ ${dirs.map((d) => ` ${d}`).join("\n")}`
|
|
|
2974
3689
|
},
|
|
2975
3690
|
action: /* @__PURE__ */ __name((ctx, args) => {
|
|
2976
3691
|
if (args.length === 0) return { kind: "permission-mode-picker" };
|
|
3692
|
+
const rulesReply = permissionRulesReply(ctx, args);
|
|
3693
|
+
if (rulesReply !== void 0) return { kind: "message", role: "system", content: rulesReply };
|
|
2977
3694
|
const mode = args.length === 1 ? args[0]?.toLowerCase() : void 0;
|
|
2978
3695
|
if (mode === "details") {
|
|
2979
3696
|
return {
|
|
@@ -3157,7 +3874,7 @@ __name(hypermodeAction, "hypermodeAction");
|
|
|
3157
3874
|
function renderHooks(hooks) {
|
|
3158
3875
|
const events = Object.entries(hooks ?? {}).filter(([, entries]) => (entries?.length ?? 0) > 0);
|
|
3159
3876
|
if (events.length === 0) {
|
|
3160
|
-
return "No hooks. Add a `hooks` key to namzu.config.json or ~/.namzu/config.yaml: event \u2192 list of
|
|
3877
|
+
return "No hooks. Add a `hooks` key to namzu.config.json or ~/.namzu/config.yaml: event \u2192 list of hooks: a command, an http address or a prompt, each with matcher, timeoutMs, if, once, statusMessage and onFailure if you want them.";
|
|
3161
3878
|
}
|
|
3162
3879
|
const lines = [];
|
|
3163
3880
|
for (const [event, entries] of events) {
|
|
@@ -3167,7 +3884,10 @@ function renderHooks(hooks) {
|
|
|
3167
3884
|
const deadline = entry.timeoutMs !== void 0 ? ` \xB7 ${Math.round(entry.timeoutMs / 1e3)}s` : "";
|
|
3168
3885
|
const filter = entry.if ? ` \xB7 if ${entry.if}` : "";
|
|
3169
3886
|
const once = entry.once ? " \xB7 once" : "";
|
|
3170
|
-
|
|
3887
|
+
const what = entry.type === "http" ? `POST ${entry.url}` : entry.type === "prompt" ? `ask: ${entry.prompt.replace(/\s+/g, " ").slice(0, 60)}` : entry.command;
|
|
3888
|
+
const background = entry.type === void 0 && entry.async ? " \xB7 in background" : "";
|
|
3889
|
+
const failure = entry.onFailure === "block" ? " \xB7 blocks when it fails" : "";
|
|
3890
|
+
lines.push(` ${what}${when}${filter}${once}${deadline}${background}${failure}`);
|
|
3171
3891
|
}
|
|
3172
3892
|
}
|
|
3173
3893
|
return lines.join("\n");
|
|
@@ -3377,14 +4097,21 @@ function reviewTargetPrompt(target) {
|
|
|
3377
4097
|
__name(reviewTargetPrompt, "reviewTargetPrompt");
|
|
3378
4098
|
function renderMcp(mcp, details = false) {
|
|
3379
4099
|
if (mcp === null) return "Not connected yet. Tool servers have not been checked.";
|
|
3380
|
-
|
|
4100
|
+
const pending = mcp.pending ?? [];
|
|
4101
|
+
if (mcp.connected.length === 0 && mcp.failed.length === 0 && pending.length === 0) {
|
|
3381
4102
|
return "No tool servers configured. Add mcpServers to namzu.config.json.";
|
|
3382
4103
|
}
|
|
3383
4104
|
const lines = [
|
|
3384
|
-
`Tool servers: ${
|
|
4105
|
+
`Tool servers: ${[
|
|
4106
|
+
`${mcp.connected.length} connected`,
|
|
4107
|
+
...mcp.failed.length > 0 ? [`${mcp.failed.length} unavailable`] : [],
|
|
4108
|
+
...pending.length > 0 ? [`${pending.length} connecting`] : []
|
|
4109
|
+
].join(", ")}.`
|
|
3385
4110
|
];
|
|
3386
4111
|
for (const server of mcp.connected) {
|
|
3387
|
-
lines.push(
|
|
4112
|
+
lines.push(
|
|
4113
|
+
`${server.name}: connected, ${server.tools.length} ${server.tools.length === 1 ? "tool" : "tools"}`
|
|
4114
|
+
);
|
|
3388
4115
|
const drift = server.drift;
|
|
3389
4116
|
if (drift) {
|
|
3390
4117
|
for (const name of drift.added) lines.push(` added: ${terminalDisplayText(name)}`);
|
|
@@ -3403,7 +4130,11 @@ function renderMcp(mcp, details = false) {
|
|
|
3403
4130
|
for (const tool of server.tools) lines.push(` ${tool}`);
|
|
3404
4131
|
}
|
|
3405
4132
|
}
|
|
3406
|
-
for (const server of mcp.failed)
|
|
4133
|
+
for (const server of mcp.failed) {
|
|
4134
|
+
const reason = isToolServerTimeout(server.reason) ? "did not answer in time" : server.reason;
|
|
4135
|
+
lines.push(`${server.name}: unavailable \u2014 ${reason}`);
|
|
4136
|
+
}
|
|
4137
|
+
for (const name of pending) lines.push(`${name}: connecting\u2026`);
|
|
3407
4138
|
if (!details && mcp.connected.length > 0) lines.push("/mcp tools to list available tools.");
|
|
3408
4139
|
return lines.join("\n");
|
|
3409
4140
|
}
|
|
@@ -3496,6 +4227,56 @@ function renderStatus(ctx, details = false) {
|
|
|
3496
4227
|
return lines.join("\n");
|
|
3497
4228
|
}
|
|
3498
4229
|
__name(renderStatus, "renderStatus");
|
|
4230
|
+
function applyRuleEdit(ctx, edit) {
|
|
4231
|
+
if (!edit.ok) return edit.message;
|
|
4232
|
+
if (!ctx.reloadPermissionRules) return `${edit.message} It applies when a new session starts.`;
|
|
4233
|
+
try {
|
|
4234
|
+
ctx.reloadPermissionRules();
|
|
4235
|
+
return `${edit.message} Applied to later calls. Other permission layers and sandbox restrictions still apply.`;
|
|
4236
|
+
} catch (cause) {
|
|
4237
|
+
return `${edit.message} Not applied to this session: ${cause instanceof Error ? cause.message : String(cause)}. The previous policy remains active.`;
|
|
4238
|
+
}
|
|
4239
|
+
}
|
|
4240
|
+
__name(applyRuleEdit, "applyRuleEdit");
|
|
4241
|
+
function permissionRulesReply(ctx, args) {
|
|
4242
|
+
const word = args[0]?.toLowerCase();
|
|
4243
|
+
if (word === "rules") {
|
|
4244
|
+
const only = args[1]?.toLowerCase();
|
|
4245
|
+
if (args.length > 2 || only !== void 0 && !isPermissionEffect(only)) {
|
|
4246
|
+
return "Usage: /permissions rules [allow|ask|deny]";
|
|
4247
|
+
}
|
|
4248
|
+
try {
|
|
4249
|
+
const entries = ruleEntries(readPermissionLayers({ cwd: ctx.cwd }));
|
|
4250
|
+
return renderRules(entries, only);
|
|
4251
|
+
} catch (cause) {
|
|
4252
|
+
return `Could not read the permission rules: ${cause instanceof Error ? cause.message : String(cause)}`;
|
|
4253
|
+
}
|
|
4254
|
+
}
|
|
4255
|
+
if (word === "add") {
|
|
4256
|
+
const effect = args[1]?.toLowerCase();
|
|
4257
|
+
const rule = args.slice(2).join(" ").trim();
|
|
4258
|
+
if (!isPermissionEffect(effect) || rule === "") {
|
|
4259
|
+
return "Usage: /permissions add <allow|ask|deny> <rule>, for example /permissions add allow Bash(git status *)";
|
|
4260
|
+
}
|
|
4261
|
+
return applyRuleEdit(ctx, addLocalRule(ctx.cwd, effect, rule));
|
|
4262
|
+
}
|
|
4263
|
+
if (word === "remove") {
|
|
4264
|
+
const rule = args.slice(1).join(" ").trim();
|
|
4265
|
+
if (rule === "") return "Usage: /permissions remove <rule>";
|
|
4266
|
+
return applyRuleEdit(ctx, removeLocalRule(ctx.cwd, rule));
|
|
4267
|
+
}
|
|
4268
|
+
if (word === "denied") return renderRecentDenials(ctx.recentDenials?.());
|
|
4269
|
+
if (word === "dirs") {
|
|
4270
|
+
const added = ctx.directories?.() ?? [];
|
|
4271
|
+
return [
|
|
4272
|
+
"Folders the file tools can reach",
|
|
4273
|
+
` ${ctx.cwd} (working folder)`,
|
|
4274
|
+
...added.map((dir) => ` ${dir}`)
|
|
4275
|
+
].join("\n");
|
|
4276
|
+
}
|
|
4277
|
+
return void 0;
|
|
4278
|
+
}
|
|
4279
|
+
__name(permissionRulesReply, "permissionRulesReply");
|
|
3499
4280
|
function renderPermissions(permissions, details = false, sandboxedShell = false) {
|
|
3500
4281
|
const current2 = permissions.currentMode();
|
|
3501
4282
|
const effective = current2.mode;
|
|
@@ -3586,6 +4367,7 @@ function renderAgents(ids) {
|
|
|
3586
4367
|
__name(renderAgents, "renderAgents");
|
|
3587
4368
|
function userCommandOrigin(command) {
|
|
3588
4369
|
if (command.source === "skill") return "Skill";
|
|
4370
|
+
if (command.source === "plugin") return "Plugin command";
|
|
3589
4371
|
return command.source === "project" ? "Project command" : "User command (all projects)";
|
|
3590
4372
|
}
|
|
3591
4373
|
__name(userCommandOrigin, "userCommandOrigin");
|
|
@@ -3636,6 +4418,12 @@ export {
|
|
|
3636
4418
|
useReducedMotion,
|
|
3637
4419
|
discoverUserCommands,
|
|
3638
4420
|
expandHeadlessCommand,
|
|
4421
|
+
isAction,
|
|
4422
|
+
isChordLead,
|
|
4423
|
+
isChordAction,
|
|
4424
|
+
pressedKeyLabel,
|
|
4425
|
+
primaryKeyLabel,
|
|
4426
|
+
toolServerRow,
|
|
3639
4427
|
saveTheme,
|
|
3640
4428
|
saveReducedMotion,
|
|
3641
4429
|
describeReducedMotion,
|
|
@@ -3679,4 +4467,4 @@ react/cjs/react.development.js:
|
|
|
3679
4467
|
* LICENSE file in the root directory of this source tree.
|
|
3680
4468
|
*)
|
|
3681
4469
|
*/
|
|
3682
|
-
//# sourceMappingURL=chunk-
|
|
4470
|
+
//# sourceMappingURL=chunk-VESQFRF3.js.map
|