@namzu/cli 39.2.1 → 40.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 +72 -0
- package/dist/bin.js +1 -1
- package/dist/checkpoints/manifest.d.ts +7 -0
- package/dist/checkpoints/manifest.d.ts.map +1 -1
- package/dist/checkpoints/rewind-stats.d.ts +31 -0
- package/dist/checkpoints/rewind-stats.d.ts.map +1 -0
- package/dist/checkpoints/store.d.ts +24 -3
- package/dist/checkpoints/store.d.ts.map +1 -1
- package/dist/chunks/{acp-VDM66X7T.js → acp-E7XNZWFV.js} +40 -39
- package/dist/chunks/acp-E7XNZWFV.js.map +6 -0
- package/dist/chunks/{activity-command-23DPNYXT.js → activity-command-QANVT2PA.js} +13 -12
- package/dist/chunks/activity-command-QANVT2PA.js.map +6 -0
- package/dist/chunks/{add-Y2UMHBTC.js → add-VDRMBSNZ.js} +19 -17
- package/dist/chunks/add-VDRMBSNZ.js.map +6 -0
- package/dist/chunks/{agent-LCCOMK5H.js → agent-PPQJZWBO.js} +31 -30
- package/dist/chunks/agent-session-PISYPFO2.js +54 -0
- package/dist/chunks/{archive-YUZ62G7R.js → archive-SH4IG6KC.js} +11 -10
- package/dist/chunks/archive-SH4IG6KC.js.map +6 -0
- package/dist/chunks/{bin-main-LFPYUV3K.js → bin-main-D45Q7FMM.js} +5 -4
- package/dist/chunks/bin-main-D45Q7FMM.js.map +6 -0
- package/dist/chunks/{browser-X6UIDIQQ.js → browser-EUFWHKYD.js} +6 -6
- package/dist/chunks/{chat-EMEYQKRR.js → chat-QDWGHEEL.js} +14 -14
- package/dist/chunks/{chunk-E6LQB5Z7.js → chunk-2I3Z65TV.js} +13 -13
- package/dist/chunks/{chunk-W6JEZMOJ.js → chunk-4HUZHYCY.js} +4 -4
- package/dist/chunks/{chunk-XNQI4ZDH.js → chunk-53GEER6F.js} +3 -3
- package/dist/chunks/{chunk-HHOTJDZW.js → chunk-5HSG2XFD.js} +2 -2
- package/dist/chunks/{chunk-V6UEMLTT.js → chunk-6PAE7AWD.js} +2 -2
- package/dist/chunks/{chunk-HLIXL5RK.js → chunk-6UDJ3PVE.js} +7 -7
- package/dist/chunks/{chunk-M2PQMMDW.js → chunk-73G5WDGM.js} +3 -3
- package/dist/chunks/{chunk-MCXVRO4B.js → chunk-7M6IZGAK.js} +58 -12
- package/dist/chunks/chunk-7M6IZGAK.js.map +6 -0
- package/dist/chunks/{chunk-2PH7EQQP.js → chunk-AHPIP5IE.js} +2 -2
- package/dist/chunks/{chunk-LS7PT6RY.js → chunk-AQL5A442.js} +10 -4
- package/dist/chunks/{chunk-LS7PT6RY.js.map → chunk-AQL5A442.js.map} +1 -1
- package/dist/chunks/{chunk-N3JNFZOW.js → chunk-AUFSSABF.js} +3 -3
- package/dist/chunks/{chunk-BPDKRVGW.js → chunk-BJNHDKU6.js} +2 -2
- package/dist/chunks/{chunk-QENCNE7Q.js → chunk-BQ7PN64G.js} +10 -10
- package/dist/chunks/{chunk-QENCNE7Q.js.map → chunk-BQ7PN64G.js.map} +1 -1
- package/dist/chunks/{chunk-T64F5OER.js → chunk-BZ4U5L7N.js} +9 -9
- package/dist/chunks/{chunk-FXMJ5NVM.js → chunk-BZJNXGWW.js} +5 -5
- package/dist/chunks/{chunk-HBTPB6ON.js → chunk-C3APHRQB.js} +2 -2
- package/dist/chunks/{chunk-A34Y6ZPM.js → chunk-C3ZJQLUX.js} +2 -2
- package/dist/chunks/{chunk-B2GM4GON.js → chunk-C723P7SP.js} +6 -6
- package/dist/chunks/{chunk-OPIC6ZIL.js → chunk-D63T5UQN.js} +561 -32
- package/dist/chunks/chunk-D63T5UQN.js.map +6 -0
- package/dist/chunks/{chunk-5NVONQBW.js → chunk-DGV5W2BU.js} +3 -3
- package/dist/chunks/{chunk-AP4B5Z3D.js → chunk-DWSATEAY.js} +2 -2
- package/dist/chunks/{chunk-45GT626R.js → chunk-EKFNDKPO.js} +3 -3
- package/dist/chunks/{chunk-KONYGNG6.js → chunk-EUBCYTOK.js} +3 -152
- package/dist/chunks/chunk-EUBCYTOK.js.map +6 -0
- package/dist/chunks/{chunk-IVZB7YKX.js → chunk-FBY4LGL7.js} +3 -3
- package/dist/chunks/chunk-G6LK7V7F.js +440 -0
- package/dist/chunks/chunk-G6LK7V7F.js.map +6 -0
- package/dist/chunks/{chunk-HWM73622.js → chunk-GDVYFXOR.js} +12 -12
- package/dist/chunks/{chunk-WNVYEZUQ.js → chunk-GTWNJ7GL.js} +4 -4
- package/dist/chunks/{chunk-2L3JDLC5.js → chunk-HBDBVQ3R.js} +12 -12
- package/dist/chunks/{chunk-3MT5KLBF.js → chunk-HLYTSH5W.js} +2 -2
- package/dist/chunks/{chunk-A25FQQTW.js → chunk-HPLVGTBH.js} +2 -2
- package/dist/chunks/{chunk-EGP3MB37.js → chunk-I7LUF577.js} +11 -5
- package/dist/chunks/chunk-I7LUF577.js.map +6 -0
- package/dist/chunks/{chunk-B4DC7NC7.js → chunk-IAL3F2OI.js} +8 -8
- package/dist/chunks/{chunk-JEHKZEIB.js → chunk-ILTHOMHL.js} +4 -4
- package/dist/chunks/{chunk-EEDZOGV4.js → chunk-IYUW2RAA.js} +27 -2
- package/dist/chunks/chunk-IYUW2RAA.js.map +6 -0
- package/dist/chunks/{chunk-TACSPIUK.js → chunk-JAHVXTO4.js} +2 -2
- package/dist/chunks/{chunk-BZIUFNYR.js → chunk-KKYIGLKI.js} +4 -4
- package/dist/chunks/{chunk-7WUSJ454.js → chunk-KOYEUNX7.js} +4 -4
- package/dist/chunks/{chunk-OT5X76XI.js → chunk-KWRJTEV5.js} +3 -3
- package/dist/chunks/{chunk-XJT5DL3I.js → chunk-L2GX4GAQ.js} +2 -2
- package/dist/chunks/{chunk-M3TJHQF7.js → chunk-LFI6O7WL.js} +5 -5
- package/dist/chunks/{chunk-ISN4VZCX.js → chunk-LM3W6AEK.js} +2 -2
- package/dist/chunks/{chunk-IYPP6HSK.js → chunk-O2B3B2TM.js} +1 -6
- package/dist/chunks/chunk-O2B3B2TM.js.map +6 -0
- package/dist/chunks/{chunk-DNHHMNVG.js → chunk-O3L5C2WT.js} +2 -2
- package/dist/chunks/{chunk-EXVGLN6V.js → chunk-PXKXXNFU.js} +2 -2
- package/dist/chunks/{chunk-MIM4YRP2.js → chunk-QPEGCKRA.js} +2 -2
- package/dist/chunks/{chunk-OVG3QY7U.js → chunk-R7XQP4PZ.js} +3 -3
- package/dist/chunks/{chunk-ESMVELWA.js → chunk-RAS4ZA5C.js} +5 -5
- package/dist/chunks/chunk-RLMKDLGK.js +3604 -0
- package/dist/chunks/chunk-RLMKDLGK.js.map +6 -0
- package/dist/chunks/{chunk-PV4ZAFVQ.js → chunk-RVNLS4BN.js} +2 -2
- package/dist/chunks/{chunk-QR5YS5QW.js → chunk-RVSGU3JS.js} +2 -2
- package/dist/chunks/{chunk-JII5GOH2.js → chunk-SOE4Q55L.js} +2 -2
- package/dist/chunks/{chunk-7OXYUJSY.js → chunk-SUDXOGE6.js} +29 -29
- package/dist/chunks/{chunk-NUJCTZOM.js → chunk-T6INV7EZ.js} +7 -7
- package/dist/chunks/{chunk-37YQDLHZ.js → chunk-TTDBVPB2.js} +4238 -3639
- package/dist/chunks/chunk-TTDBVPB2.js.map +6 -0
- package/dist/chunks/{chunk-MEHYOYTW.js → chunk-U5KONGAN.js} +3 -3
- package/dist/chunks/{chunk-KS5X3GMX.js → chunk-U5PL5D27.js} +3 -3
- package/dist/chunks/{chunk-AXCOWIIH.js → chunk-U5UV2YRE.js} +2 -139
- package/dist/chunks/chunk-U5UV2YRE.js.map +6 -0
- package/dist/chunks/{chunk-YIFOFVWM.js → chunk-WYULBUCG.js} +4 -4
- package/dist/chunks/{chunk-ONKQPPSY.js → chunk-X54VNEWE.js} +2 -2
- package/dist/chunks/{chunk-YZOR7643.js → chunk-XDGIOXTU.js} +156 -3
- package/dist/chunks/chunk-XDGIOXTU.js.map +6 -0
- package/dist/chunks/{chunk-FKSIOYXA.js → chunk-XLGTH7JD.js} +4 -4
- package/dist/chunks/chunk-XPS3W7FC.js +147 -0
- package/dist/chunks/chunk-XPS3W7FC.js.map +6 -0
- package/dist/chunks/chunk-XSCT3DLE.js +161 -0
- package/dist/chunks/chunk-XSCT3DLE.js.map +6 -0
- package/dist/chunks/{chunk-363DTX3M.js → chunk-YTEGBYGL.js} +4 -4
- package/dist/chunks/{chunk-7C6DG66T.js → chunk-ZPIHARMI.js} +4 -4
- package/dist/chunks/{cli-runtime-XHGO7QSK.js → cli-runtime-YD7OZGEU.js} +16 -14
- package/dist/chunks/cli-runtime-YD7OZGEU.js.map +6 -0
- package/dist/chunks/{commands-GDF5OOXO.js → commands-5P4RLRXG.js} +5 -5
- package/dist/chunks/{crash-report-N7ZQ2UB4.js → crash-report-F5G32A7S.js} +9 -8
- package/dist/chunks/{dist-547VSBMV.js → dist-6O3HSFZP.js} +2 -2
- package/dist/chunks/{dist-IJ3AAED4.js → dist-7B6PZO7C.js} +2 -2
- package/dist/chunks/{dist-MZNKQTW4.js → dist-DFLFYX3A.js} +2 -2
- package/dist/chunks/{dist-36LBIFJ6.js → dist-SX66KAH4.js} +2 -2
- package/dist/chunks/{dist-T2NJ6SVO.js → dist-WB355CNL.js} +44 -16
- package/dist/chunks/dist-WB355CNL.js.map +6 -0
- package/dist/chunks/{dist-TCILCQPG.js → dist-Y6SGSSMO.js} +2 -2
- package/dist/chunks/{dist-TCIDRGW5.js → dist-ZAGIMP7N.js} +2 -2
- package/dist/chunks/{doctor-T7SC3VSE.js → doctor-2AOB47IO.js} +8 -8
- package/dist/chunks/{drain-OA5MO7SQ.js → drain-M6AGCMJX.js} +10 -10
- package/dist/chunks/{eval-D5Q2WZ7S.js → eval-YHY3VO7B.js} +2 -2
- package/dist/chunks/{exec-MG5S7OJN.js → exec-KCISQ4M7.js} +33 -28
- package/dist/chunks/exec-KCISQ4M7.js.map +6 -0
- package/dist/chunks/{home-Z7L4BJTW.js → home-AC5LQKDR.js} +3 -3
- package/dist/chunks/{host-queries-LL56A6NY.js → host-queries-YQVRKUWC.js} +14 -14
- package/dist/chunks/{lifecycle-TCRLU6B5.js → lifecycle-CQXCTLAZ.js} +28 -26
- package/dist/chunks/{list-RBOLXDHG.js → list-LNKKJZSZ.js} +16 -14
- package/dist/chunks/list-LNKKJZSZ.js.map +6 -0
- package/dist/chunks/{login-RZCJNDAJ.js → login-YA652CIL.js} +8 -8
- package/dist/chunks/{logs-KDEGF3FA.js → logs-2PREHSOD.js} +4 -4
- package/dist/chunks/{mcp-7L7NYLKG.js → mcp-WJB2UVQW.js} +21 -19
- package/dist/chunks/mcp-WJB2UVQW.js.map +6 -0
- package/dist/chunks/{message-command-NTLYNKUW.js → message-command-IXUASFZO.js} +37 -36
- package/dist/chunks/message-command-IXUASFZO.js.map +6 -0
- package/dist/chunks/{operator-tools-DXU6UK4S.js → operator-tools-QOZZZVEC.js} +12 -12
- package/dist/chunks/{output-schema-UMOAOTW2.js → output-schema-JTPOC3NL.js} +3 -3
- package/dist/chunks/{pal-FDOF3S5J.js → pal-FNSNP47Q.js} +13 -12
- package/dist/chunks/pal-FNSNP47Q.js.map +6 -0
- package/dist/chunks/{providers-HOY5QHWL.js → providers-M5HWW7DH.js} +6 -6
- package/dist/chunks/{resident-XIM5KNNX.js → resident-R2RCAHYR.js} +24 -22
- package/dist/chunks/resident-R2RCAHYR.js.map +6 -0
- package/dist/chunks/resume-UKK4HVCO.js +22 -0
- package/dist/chunks/{resume-command-DIVGMVMA.js → resume-command-LPN33FIF.js} +6 -5
- package/dist/chunks/{schedule-YRHGK6CD.js → schedule-J2IY3SVE.js} +8 -8
- package/dist/chunks/{service-DRXVEYFA.js → service-LEAVOYGP.js} +27 -25
- package/dist/chunks/service-LEAVOYGP.js.map +6 -0
- package/dist/chunks/session-step-2B46NVE7.js +30 -0
- package/dist/chunks/{skills-C5ZXOJEA.js → skills-X2V3TNTK.js} +10 -9
- package/dist/chunks/skills-X2V3TNTK.js.map +6 -0
- package/dist/chunks/{state-BVKWZF6F.js → state-VDTYWZ5S.js} +4 -3
- package/dist/chunks/state-VDTYWZ5S.js.map +6 -0
- package/dist/chunks/{store-GKY55UEV.js → store-C27Q22UV.js} +4 -4
- package/dist/chunks/{store-ZXFXXY4S.js → store-DRPRQLDD.js} +9 -9
- package/dist/chunks/{store-A4VHV4I2.js → store-S4QRR5DH.js} +6 -6
- package/dist/chunks/{tui-PY2FQXVO.js → tui-RU6CRMLX.js} +13396 -11956
- package/dist/chunks/tui-RU6CRMLX.js.map +6 -0
- package/dist/chunks/{upgrade-WSBGA3FW.js → upgrade-I2GMLDWZ.js} +3 -4
- package/dist/chunks/upgrade-I2GMLDWZ.js.map +6 -0
- package/dist/chunks/{worktree-HLE7PBLL.js → worktree-F632OJNE.js} +13 -12
- package/dist/chunks/worktree-F632OJNE.js.map +6 -0
- package/dist/config/load.d.ts +6 -1
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/schema.d.ts +45 -0
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/user-config.d.ts.map +1 -1
- package/dist/index.js +16 -14
- package/dist/integrations/compaction/idle-compaction.d.ts +84 -0
- package/dist/integrations/compaction/idle-compaction.d.ts.map +1 -0
- package/dist/integrations/providers/prompt-cache-ttl.d.ts +14 -0
- package/dist/integrations/providers/prompt-cache-ttl.d.ts.map +1 -0
- package/dist/integrations/resident/runner-worker.js +20 -19
- package/dist/integrations/resident/runner-worker.js.map +1 -1
- package/dist/integrations/sessions/recap.d.ts +56 -0
- package/dist/integrations/sessions/recap.d.ts.map +1 -0
- package/dist/integrations/sessions/store.d.ts +7 -1
- package/dist/integrations/sessions/store.d.ts.map +1 -1
- package/dist/integrations/subagents/runtime.d.ts.map +1 -1
- package/dist/memory/typed.d.ts +11 -0
- package/dist/memory/typed.d.ts.map +1 -1
- package/dist/tui/App.d.ts +17 -1
- package/dist/tui/App.d.ts.map +1 -1
- package/dist/tui/BrandHeader.d.ts.map +1 -1
- package/dist/tui/Checklist.d.ts +2 -0
- package/dist/tui/Checklist.d.ts.map +1 -1
- package/dist/tui/ChoicePicker.d.ts +4 -1
- package/dist/tui/ChoicePicker.d.ts.map +1 -1
- package/dist/tui/Composer.d.ts +15 -3
- package/dist/tui/Composer.d.ts.map +1 -1
- package/dist/tui/ComposerFrame.d.ts.map +1 -1
- package/dist/tui/ContextGridRow.d.ts +6 -0
- package/dist/tui/ContextGridRow.d.ts.map +1 -0
- package/dist/tui/LiveActivity.d.ts +9 -1
- package/dist/tui/LiveActivity.d.ts.map +1 -1
- package/dist/tui/Markdown.d.ts.map +1 -1
- package/dist/tui/ReadSearchGroup.d.ts +14 -0
- package/dist/tui/ReadSearchGroup.d.ts.map +1 -0
- package/dist/tui/RewindPicker.d.ts +14 -0
- package/dist/tui/RewindPicker.d.ts.map +1 -0
- package/dist/tui/StatusBar.d.ts +31 -12
- package/dist/tui/StatusBar.d.ts.map +1 -1
- package/dist/tui/ThemeSample.d.ts +5 -0
- package/dist/tui/ThemeSample.d.ts.map +1 -0
- package/dist/tui/Transcript.d.ts +13 -0
- package/dist/tui/Transcript.d.ts.map +1 -1
- package/dist/tui/TranscriptScreen.d.ts +24 -0
- package/dist/tui/TranscriptScreen.d.ts.map +1 -0
- package/dist/tui/agent-transcript-rows.d.ts.map +1 -1
- package/dist/tui/agent-view-commands.d.ts.map +1 -1
- package/dist/tui/agent.d.ts +62 -1
- package/dist/tui/agent.d.ts.map +1 -1
- package/dist/tui/away-recap.d.ts +73 -0
- package/dist/tui/away-recap.d.ts.map +1 -0
- package/dist/tui/context-grid.d.ts +121 -0
- package/dist/tui/context-grid.d.ts.map +1 -0
- package/dist/tui/context-meter.d.ts +9 -0
- package/dist/tui/context-meter.d.ts.map +1 -1
- package/dist/tui/context-usage.d.ts +70 -0
- package/dist/tui/context-usage.d.ts.map +1 -0
- package/dist/tui/diff-view.d.ts +1 -1
- package/dist/tui/edit-prompts.d.ts.map +1 -1
- package/dist/tui/focus-reporting.d.ts +45 -0
- package/dist/tui/focus-reporting.d.ts.map +1 -0
- package/dist/tui/group-rows.d.ts +10 -0
- package/dist/tui/group-rows.d.ts.map +1 -0
- package/dist/tui/index.d.ts.map +1 -1
- package/dist/tui/live-window.d.ts +5 -8
- package/dist/tui/live-window.d.ts.map +1 -1
- package/dist/tui/logo.d.ts +0 -1
- package/dist/tui/logo.d.ts.map +1 -1
- package/dist/tui/motion.d.ts +14 -0
- package/dist/tui/motion.d.ts.map +1 -0
- package/dist/tui/next-task.d.ts +11 -0
- package/dist/tui/next-task.d.ts.map +1 -0
- package/dist/tui/notifications.d.ts +69 -0
- package/dist/tui/notifications.d.ts.map +1 -0
- package/dist/tui/plain-interruption.d.ts +1 -1
- package/dist/tui/plain-interruption.d.ts.map +1 -1
- package/dist/tui/read-search-group.d.ts +97 -0
- package/dist/tui/read-search-group.d.ts.map +1 -0
- package/dist/tui/recap-setting.d.ts +36 -0
- package/dist/tui/recap-setting.d.ts.map +1 -0
- package/dist/tui/recap-turns.d.ts +13 -0
- package/dist/tui/recap-turns.d.ts.map +1 -0
- package/dist/tui/restored-rows.d.ts.map +1 -1
- package/dist/tui/rewind.d.ts +142 -0
- package/dist/tui/rewind.d.ts.map +1 -0
- package/dist/tui/slashCommands.d.ts +45 -0
- package/dist/tui/slashCommands.d.ts.map +1 -1
- package/dist/tui/spinner-tips-setting.d.ts +10 -0
- package/dist/tui/spinner-tips-setting.d.ts.map +1 -0
- package/dist/tui/spinner-tips.d.ts +39 -0
- package/dist/tui/spinner-tips.d.ts.map +1 -0
- package/dist/tui/stale-history-retry.d.ts +17 -0
- package/dist/tui/stale-history-retry.d.ts.map +1 -0
- package/dist/tui/system-rows.d.ts +4 -0
- package/dist/tui/system-rows.d.ts.map +1 -1
- package/dist/tui/terminal-display.d.ts +7 -0
- package/dist/tui/terminal-display.d.ts.map +1 -1
- package/dist/tui/terminal-focus.d.ts +29 -0
- package/dist/tui/terminal-focus.d.ts.map +1 -0
- package/dist/tui/terminal-title.d.ts +19 -0
- package/dist/tui/terminal-title.d.ts.map +1 -1
- package/dist/tui/theme-command.d.ts +20 -0
- package/dist/tui/theme-command.d.ts.map +1 -0
- package/dist/tui/theme-detect.d.ts +41 -0
- package/dist/tui/theme-detect.d.ts.map +1 -0
- package/dist/tui/theme-launch.d.ts +16 -0
- package/dist/tui/theme-launch.d.ts.map +1 -0
- package/dist/tui/theme-palettes.d.ts +121 -0
- package/dist/tui/theme-palettes.d.ts.map +1 -0
- package/dist/tui/theme-store.d.ts +35 -0
- package/dist/tui/theme-store.d.ts.map +1 -0
- package/dist/tui/theme.d.ts +35 -64
- package/dist/tui/theme.d.ts.map +1 -1
- package/dist/tui/tidy-tool-output.d.ts +17 -0
- package/dist/tui/tidy-tool-output.d.ts.map +1 -1
- package/dist/tui/tip-history.d.ts +25 -0
- package/dist/tui/tip-history.d.ts.map +1 -0
- package/dist/tui/title-frame.d.ts +7 -0
- package/dist/tui/title-frame.d.ts.map +1 -0
- package/dist/tui/tool-end-rows.d.ts +4 -1
- package/dist/tui/tool-end-rows.d.ts.map +1 -1
- package/dist/tui/tool-failure-text.d.ts.map +1 -1
- package/dist/tui/transcript-screen.d.ts +31 -0
- package/dist/tui/transcript-screen.d.ts.map +1 -0
- package/dist/tui/transcript-scroll.d.ts.map +1 -1
- package/dist/tui/types.d.ts +26 -1
- package/dist/tui/types.d.ts.map +1 -1
- package/dist/tui/update-notice.d.ts +12 -0
- package/dist/tui/update-notice.d.ts.map +1 -0
- package/dist/tui/use-idle-compaction.d.ts +29 -0
- package/dist/tui/use-idle-compaction.d.ts.map +1 -0
- package/dist/tui/use-spinner-tip.d.ts +23 -0
- package/dist/tui/use-spinner-tip.d.ts.map +1 -0
- package/dist/tui/useNotifications.d.ts +14 -0
- package/dist/tui/useNotifications.d.ts.map +1 -0
- package/dist/tui/useReadSearchGroup.d.ts +21 -0
- package/dist/tui/useReadSearchGroup.d.ts.map +1 -0
- package/package.json +6 -6
- package/dist/chunks/acp-VDM66X7T.js.map +0 -6
- package/dist/chunks/activity-command-23DPNYXT.js.map +0 -6
- package/dist/chunks/add-Y2UMHBTC.js.map +0 -6
- package/dist/chunks/agent-session-6ZFR55NO.js +0 -53
- package/dist/chunks/archive-YUZ62G7R.js.map +0 -6
- package/dist/chunks/bin-main-LFPYUV3K.js.map +0 -6
- package/dist/chunks/chunk-37YQDLHZ.js.map +0 -6
- package/dist/chunks/chunk-6YFMOYKD.js +0 -1796
- package/dist/chunks/chunk-6YFMOYKD.js.map +0 -6
- package/dist/chunks/chunk-AURV7PCK.js +0 -111
- package/dist/chunks/chunk-AURV7PCK.js.map +0 -6
- package/dist/chunks/chunk-AXCOWIIH.js.map +0 -6
- package/dist/chunks/chunk-CDYUGK7F.js +0 -70
- package/dist/chunks/chunk-CDYUGK7F.js.map +0 -6
- package/dist/chunks/chunk-EEDZOGV4.js.map +0 -6
- package/dist/chunks/chunk-EGP3MB37.js.map +0 -6
- package/dist/chunks/chunk-IYPP6HSK.js.map +0 -6
- package/dist/chunks/chunk-KONYGNG6.js.map +0 -6
- package/dist/chunks/chunk-MCXVRO4B.js.map +0 -6
- package/dist/chunks/chunk-OPIC6ZIL.js.map +0 -6
- package/dist/chunks/chunk-YZOR7643.js.map +0 -6
- package/dist/chunks/cli-runtime-XHGO7QSK.js.map +0 -6
- package/dist/chunks/dist-T2NJ6SVO.js.map +0 -6
- package/dist/chunks/exec-MG5S7OJN.js.map +0 -6
- package/dist/chunks/list-RBOLXDHG.js.map +0 -6
- package/dist/chunks/mcp-7L7NYLKG.js.map +0 -6
- package/dist/chunks/message-command-NTLYNKUW.js.map +0 -6
- package/dist/chunks/pal-FDOF3S5J.js.map +0 -6
- package/dist/chunks/resident-XIM5KNNX.js.map +0 -6
- package/dist/chunks/resume-3OP5GB7S.js +0 -22
- package/dist/chunks/service-DRXVEYFA.js.map +0 -6
- package/dist/chunks/session-step-ZD3D55SM.js +0 -29
- package/dist/chunks/skills-C5ZXOJEA.js.map +0 -6
- package/dist/chunks/state-BVKWZF6F.js.map +0 -6
- package/dist/chunks/tui-PY2FQXVO.js.map +0 -6
- package/dist/chunks/upgrade-WSBGA3FW.js.map +0 -6
- package/dist/chunks/worktree-HLE7PBLL.js.map +0 -6
- package/dist/tui/EditPromptPicker.d.ts +0 -8
- package/dist/tui/EditPromptPicker.d.ts.map +0 -1
- package/dist/tui/ToolOutputViewer.d.ts +0 -11
- package/dist/tui/ToolOutputViewer.d.ts.map +0 -1
- /package/dist/chunks/{agent-LCCOMK5H.js.map → agent-PPQJZWBO.js.map} +0 -0
- /package/dist/chunks/{agent-session-6ZFR55NO.js.map → agent-session-PISYPFO2.js.map} +0 -0
- /package/dist/chunks/{browser-X6UIDIQQ.js.map → browser-EUFWHKYD.js.map} +0 -0
- /package/dist/chunks/{chat-EMEYQKRR.js.map → chat-QDWGHEEL.js.map} +0 -0
- /package/dist/chunks/{chunk-E6LQB5Z7.js.map → chunk-2I3Z65TV.js.map} +0 -0
- /package/dist/chunks/{chunk-W6JEZMOJ.js.map → chunk-4HUZHYCY.js.map} +0 -0
- /package/dist/chunks/{chunk-XNQI4ZDH.js.map → chunk-53GEER6F.js.map} +0 -0
- /package/dist/chunks/{chunk-HHOTJDZW.js.map → chunk-5HSG2XFD.js.map} +0 -0
- /package/dist/chunks/{chunk-V6UEMLTT.js.map → chunk-6PAE7AWD.js.map} +0 -0
- /package/dist/chunks/{chunk-HLIXL5RK.js.map → chunk-6UDJ3PVE.js.map} +0 -0
- /package/dist/chunks/{chunk-M2PQMMDW.js.map → chunk-73G5WDGM.js.map} +0 -0
- /package/dist/chunks/{chunk-2PH7EQQP.js.map → chunk-AHPIP5IE.js.map} +0 -0
- /package/dist/chunks/{chunk-N3JNFZOW.js.map → chunk-AUFSSABF.js.map} +0 -0
- /package/dist/chunks/{chunk-BPDKRVGW.js.map → chunk-BJNHDKU6.js.map} +0 -0
- /package/dist/chunks/{chunk-T64F5OER.js.map → chunk-BZ4U5L7N.js.map} +0 -0
- /package/dist/chunks/{chunk-FXMJ5NVM.js.map → chunk-BZJNXGWW.js.map} +0 -0
- /package/dist/chunks/{chunk-HBTPB6ON.js.map → chunk-C3APHRQB.js.map} +0 -0
- /package/dist/chunks/{chunk-A34Y6ZPM.js.map → chunk-C3ZJQLUX.js.map} +0 -0
- /package/dist/chunks/{chunk-B2GM4GON.js.map → chunk-C723P7SP.js.map} +0 -0
- /package/dist/chunks/{chunk-5NVONQBW.js.map → chunk-DGV5W2BU.js.map} +0 -0
- /package/dist/chunks/{chunk-AP4B5Z3D.js.map → chunk-DWSATEAY.js.map} +0 -0
- /package/dist/chunks/{chunk-45GT626R.js.map → chunk-EKFNDKPO.js.map} +0 -0
- /package/dist/chunks/{chunk-IVZB7YKX.js.map → chunk-FBY4LGL7.js.map} +0 -0
- /package/dist/chunks/{chunk-HWM73622.js.map → chunk-GDVYFXOR.js.map} +0 -0
- /package/dist/chunks/{chunk-WNVYEZUQ.js.map → chunk-GTWNJ7GL.js.map} +0 -0
- /package/dist/chunks/{chunk-2L3JDLC5.js.map → chunk-HBDBVQ3R.js.map} +0 -0
- /package/dist/chunks/{chunk-3MT5KLBF.js.map → chunk-HLYTSH5W.js.map} +0 -0
- /package/dist/chunks/{chunk-A25FQQTW.js.map → chunk-HPLVGTBH.js.map} +0 -0
- /package/dist/chunks/{chunk-B4DC7NC7.js.map → chunk-IAL3F2OI.js.map} +0 -0
- /package/dist/chunks/{chunk-JEHKZEIB.js.map → chunk-ILTHOMHL.js.map} +0 -0
- /package/dist/chunks/{chunk-TACSPIUK.js.map → chunk-JAHVXTO4.js.map} +0 -0
- /package/dist/chunks/{chunk-BZIUFNYR.js.map → chunk-KKYIGLKI.js.map} +0 -0
- /package/dist/chunks/{chunk-7WUSJ454.js.map → chunk-KOYEUNX7.js.map} +0 -0
- /package/dist/chunks/{chunk-OT5X76XI.js.map → chunk-KWRJTEV5.js.map} +0 -0
- /package/dist/chunks/{chunk-XJT5DL3I.js.map → chunk-L2GX4GAQ.js.map} +0 -0
- /package/dist/chunks/{chunk-M3TJHQF7.js.map → chunk-LFI6O7WL.js.map} +0 -0
- /package/dist/chunks/{chunk-ISN4VZCX.js.map → chunk-LM3W6AEK.js.map} +0 -0
- /package/dist/chunks/{chunk-DNHHMNVG.js.map → chunk-O3L5C2WT.js.map} +0 -0
- /package/dist/chunks/{chunk-EXVGLN6V.js.map → chunk-PXKXXNFU.js.map} +0 -0
- /package/dist/chunks/{chunk-MIM4YRP2.js.map → chunk-QPEGCKRA.js.map} +0 -0
- /package/dist/chunks/{chunk-OVG3QY7U.js.map → chunk-R7XQP4PZ.js.map} +0 -0
- /package/dist/chunks/{chunk-ESMVELWA.js.map → chunk-RAS4ZA5C.js.map} +0 -0
- /package/dist/chunks/{chunk-PV4ZAFVQ.js.map → chunk-RVNLS4BN.js.map} +0 -0
- /package/dist/chunks/{chunk-QR5YS5QW.js.map → chunk-RVSGU3JS.js.map} +0 -0
- /package/dist/chunks/{chunk-JII5GOH2.js.map → chunk-SOE4Q55L.js.map} +0 -0
- /package/dist/chunks/{chunk-7OXYUJSY.js.map → chunk-SUDXOGE6.js.map} +0 -0
- /package/dist/chunks/{chunk-NUJCTZOM.js.map → chunk-T6INV7EZ.js.map} +0 -0
- /package/dist/chunks/{chunk-MEHYOYTW.js.map → chunk-U5KONGAN.js.map} +0 -0
- /package/dist/chunks/{chunk-KS5X3GMX.js.map → chunk-U5PL5D27.js.map} +0 -0
- /package/dist/chunks/{chunk-YIFOFVWM.js.map → chunk-WYULBUCG.js.map} +0 -0
- /package/dist/chunks/{chunk-ONKQPPSY.js.map → chunk-X54VNEWE.js.map} +0 -0
- /package/dist/chunks/{chunk-FKSIOYXA.js.map → chunk-XLGTH7JD.js.map} +0 -0
- /package/dist/chunks/{chunk-363DTX3M.js.map → chunk-YTEGBYGL.js.map} +0 -0
- /package/dist/chunks/{chunk-7C6DG66T.js.map → chunk-ZPIHARMI.js.map} +0 -0
- /package/dist/chunks/{commands-GDF5OOXO.js.map → commands-5P4RLRXG.js.map} +0 -0
- /package/dist/chunks/{crash-report-N7ZQ2UB4.js.map → crash-report-F5G32A7S.js.map} +0 -0
- /package/dist/chunks/{dist-547VSBMV.js.map → dist-6O3HSFZP.js.map} +0 -0
- /package/dist/chunks/{dist-IJ3AAED4.js.map → dist-7B6PZO7C.js.map} +0 -0
- /package/dist/chunks/{dist-MZNKQTW4.js.map → dist-DFLFYX3A.js.map} +0 -0
- /package/dist/chunks/{dist-36LBIFJ6.js.map → dist-SX66KAH4.js.map} +0 -0
- /package/dist/chunks/{dist-TCILCQPG.js.map → dist-Y6SGSSMO.js.map} +0 -0
- /package/dist/chunks/{dist-TCIDRGW5.js.map → dist-ZAGIMP7N.js.map} +0 -0
- /package/dist/chunks/{doctor-T7SC3VSE.js.map → doctor-2AOB47IO.js.map} +0 -0
- /package/dist/chunks/{drain-OA5MO7SQ.js.map → drain-M6AGCMJX.js.map} +0 -0
- /package/dist/chunks/{eval-D5Q2WZ7S.js.map → eval-YHY3VO7B.js.map} +0 -0
- /package/dist/chunks/{home-Z7L4BJTW.js.map → home-AC5LQKDR.js.map} +0 -0
- /package/dist/chunks/{host-queries-LL56A6NY.js.map → host-queries-YQVRKUWC.js.map} +0 -0
- /package/dist/chunks/{lifecycle-TCRLU6B5.js.map → lifecycle-CQXCTLAZ.js.map} +0 -0
- /package/dist/chunks/{login-RZCJNDAJ.js.map → login-YA652CIL.js.map} +0 -0
- /package/dist/chunks/{logs-KDEGF3FA.js.map → logs-2PREHSOD.js.map} +0 -0
- /package/dist/chunks/{operator-tools-DXU6UK4S.js.map → operator-tools-QOZZZVEC.js.map} +0 -0
- /package/dist/chunks/{output-schema-UMOAOTW2.js.map → output-schema-JTPOC3NL.js.map} +0 -0
- /package/dist/chunks/{providers-HOY5QHWL.js.map → providers-M5HWW7DH.js.map} +0 -0
- /package/dist/chunks/{resume-3OP5GB7S.js.map → resume-UKK4HVCO.js.map} +0 -0
- /package/dist/chunks/{resume-command-DIVGMVMA.js.map → resume-command-LPN33FIF.js.map} +0 -0
- /package/dist/chunks/{schedule-YRHGK6CD.js.map → schedule-J2IY3SVE.js.map} +0 -0
- /package/dist/chunks/{session-step-ZD3D55SM.js.map → session-step-2B46NVE7.js.map} +0 -0
- /package/dist/chunks/{store-A4VHV4I2.js.map → store-C27Q22UV.js.map} +0 -0
- /package/dist/chunks/{store-GKY55UEV.js.map → store-DRPRQLDD.js.map} +0 -0
- /package/dist/chunks/{store-ZXFXXY4S.js.map → store-S4QRR5DH.js.map} +0 -0
|
@@ -0,0 +1,3604 @@
|
|
|
1
|
+
import { createRequire as __namzuCreateRequire } from 'node:module';
|
|
2
|
+
const require = __namzuCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
choiceDisplayText
|
|
5
|
+
} from "./chunk-LFI6O7WL.js";
|
|
6
|
+
import {
|
|
7
|
+
setUserConfigValue
|
|
8
|
+
} from "./chunk-AQL5A442.js";
|
|
9
|
+
import {
|
|
10
|
+
isCompletionArgument
|
|
11
|
+
} from "./chunk-JV3LONAU.js";
|
|
12
|
+
import {
|
|
13
|
+
SKILL_NAME_MAX_CHARS,
|
|
14
|
+
SKILL_NAME_PATTERN,
|
|
15
|
+
applyPalette,
|
|
16
|
+
explainFailure,
|
|
17
|
+
resolveTurnGuards
|
|
18
|
+
} from "./chunk-XDGIOXTU.js";
|
|
19
|
+
import {
|
|
20
|
+
THEME_NAMES,
|
|
21
|
+
parseThemeSetting,
|
|
22
|
+
renderConfigDebug,
|
|
23
|
+
resolveTheme,
|
|
24
|
+
themeLabel
|
|
25
|
+
} from "./chunk-G6LK7V7F.js";
|
|
26
|
+
import {
|
|
27
|
+
displayPath,
|
|
28
|
+
homePath,
|
|
29
|
+
plural
|
|
30
|
+
} from "./chunk-XPS3W7FC.js";
|
|
31
|
+
import {
|
|
32
|
+
CLI_VERSION
|
|
33
|
+
} from "./chunk-HE7WUOX2.js";
|
|
34
|
+
import {
|
|
35
|
+
permissionModeDescription,
|
|
36
|
+
permissionModeFromName,
|
|
37
|
+
permissionModeLabel
|
|
38
|
+
} from "./chunk-LM3W6AEK.js";
|
|
39
|
+
import {
|
|
40
|
+
terminalDisplayText
|
|
41
|
+
} from "./chunk-IYUW2RAA.js";
|
|
42
|
+
import {
|
|
43
|
+
PERMISSION_MODE_NAMES
|
|
44
|
+
} from "./chunk-WMEZTDLT.js";
|
|
45
|
+
import {
|
|
46
|
+
stringWidth
|
|
47
|
+
} from "./chunk-U5UV2YRE.js";
|
|
48
|
+
import {
|
|
49
|
+
namzuHomePath
|
|
50
|
+
} from "./chunk-DWSATEAY.js";
|
|
51
|
+
import {
|
|
52
|
+
RegistryCollisionError,
|
|
53
|
+
isMemoryType,
|
|
54
|
+
kernelHostCommands,
|
|
55
|
+
parseFrontmatter
|
|
56
|
+
} from "./chunk-D63T5UQN.js";
|
|
57
|
+
import {
|
|
58
|
+
__commonJS,
|
|
59
|
+
__name,
|
|
60
|
+
__toESM
|
|
61
|
+
} from "./chunk-76FLAFCG.js";
|
|
62
|
+
|
|
63
|
+
// ../../node_modules/.pnpm/react@19.2.6/node_modules/react/cjs/react.production.js
|
|
64
|
+
var require_react_production = __commonJS({
|
|
65
|
+
"../../node_modules/.pnpm/react@19.2.6/node_modules/react/cjs/react.production.js"(exports) {
|
|
66
|
+
"use strict";
|
|
67
|
+
var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element");
|
|
68
|
+
var REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal");
|
|
69
|
+
var REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
70
|
+
var REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode");
|
|
71
|
+
var REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler");
|
|
72
|
+
var REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer");
|
|
73
|
+
var REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context");
|
|
74
|
+
var REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref");
|
|
75
|
+
var REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense");
|
|
76
|
+
var REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo");
|
|
77
|
+
var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
|
|
78
|
+
var REACT_ACTIVITY_TYPE = /* @__PURE__ */ Symbol.for("react.activity");
|
|
79
|
+
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
|
80
|
+
function getIteratorFn(maybeIterable) {
|
|
81
|
+
if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
|
|
82
|
+
maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
|
|
83
|
+
return "function" === typeof maybeIterable ? maybeIterable : null;
|
|
84
|
+
}
|
|
85
|
+
__name(getIteratorFn, "getIteratorFn");
|
|
86
|
+
var ReactNoopUpdateQueue = {
|
|
87
|
+
isMounted: /* @__PURE__ */ __name(function() {
|
|
88
|
+
return false;
|
|
89
|
+
}, "isMounted"),
|
|
90
|
+
enqueueForceUpdate: /* @__PURE__ */ __name(function() {
|
|
91
|
+
}, "enqueueForceUpdate"),
|
|
92
|
+
enqueueReplaceState: /* @__PURE__ */ __name(function() {
|
|
93
|
+
}, "enqueueReplaceState"),
|
|
94
|
+
enqueueSetState: /* @__PURE__ */ __name(function() {
|
|
95
|
+
}, "enqueueSetState")
|
|
96
|
+
};
|
|
97
|
+
var assign = Object.assign;
|
|
98
|
+
var emptyObject = {};
|
|
99
|
+
function Component(props, context, updater) {
|
|
100
|
+
this.props = props;
|
|
101
|
+
this.context = context;
|
|
102
|
+
this.refs = emptyObject;
|
|
103
|
+
this.updater = updater || ReactNoopUpdateQueue;
|
|
104
|
+
}
|
|
105
|
+
__name(Component, "Component");
|
|
106
|
+
Component.prototype.isReactComponent = {};
|
|
107
|
+
Component.prototype.setState = function(partialState, callback) {
|
|
108
|
+
if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState)
|
|
109
|
+
throw Error(
|
|
110
|
+
"takes an object of state variables to update or a function which returns an object of state variables."
|
|
111
|
+
);
|
|
112
|
+
this.updater.enqueueSetState(this, partialState, callback, "setState");
|
|
113
|
+
};
|
|
114
|
+
Component.prototype.forceUpdate = function(callback) {
|
|
115
|
+
this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
|
|
116
|
+
};
|
|
117
|
+
function ComponentDummy() {
|
|
118
|
+
}
|
|
119
|
+
__name(ComponentDummy, "ComponentDummy");
|
|
120
|
+
ComponentDummy.prototype = Component.prototype;
|
|
121
|
+
function PureComponent(props, context, updater) {
|
|
122
|
+
this.props = props;
|
|
123
|
+
this.context = context;
|
|
124
|
+
this.refs = emptyObject;
|
|
125
|
+
this.updater = updater || ReactNoopUpdateQueue;
|
|
126
|
+
}
|
|
127
|
+
__name(PureComponent, "PureComponent");
|
|
128
|
+
var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
|
|
129
|
+
pureComponentPrototype.constructor = PureComponent;
|
|
130
|
+
assign(pureComponentPrototype, Component.prototype);
|
|
131
|
+
pureComponentPrototype.isPureReactComponent = true;
|
|
132
|
+
var isArrayImpl = Array.isArray;
|
|
133
|
+
function noop() {
|
|
134
|
+
}
|
|
135
|
+
__name(noop, "noop");
|
|
136
|
+
var ReactSharedInternals = { H: null, A: null, T: null, S: null };
|
|
137
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
138
|
+
function ReactElement(type, key, props) {
|
|
139
|
+
var refProp = props.ref;
|
|
140
|
+
return {
|
|
141
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
142
|
+
type,
|
|
143
|
+
key,
|
|
144
|
+
ref: void 0 !== refProp ? refProp : null,
|
|
145
|
+
props
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
__name(ReactElement, "ReactElement");
|
|
149
|
+
function cloneAndReplaceKey(oldElement, newKey) {
|
|
150
|
+
return ReactElement(oldElement.type, newKey, oldElement.props);
|
|
151
|
+
}
|
|
152
|
+
__name(cloneAndReplaceKey, "cloneAndReplaceKey");
|
|
153
|
+
function isValidElement(object) {
|
|
154
|
+
return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
155
|
+
}
|
|
156
|
+
__name(isValidElement, "isValidElement");
|
|
157
|
+
function escape(key) {
|
|
158
|
+
var escaperLookup = { "=": "=0", ":": "=2" };
|
|
159
|
+
return "$" + key.replace(/[=:]/g, function(match) {
|
|
160
|
+
return escaperLookup[match];
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
__name(escape, "escape");
|
|
164
|
+
var userProvidedKeyEscapeRegex = /\/+/g;
|
|
165
|
+
function getElementKey(element, index) {
|
|
166
|
+
return "object" === typeof element && null !== element && null != element.key ? escape("" + element.key) : index.toString(36);
|
|
167
|
+
}
|
|
168
|
+
__name(getElementKey, "getElementKey");
|
|
169
|
+
function resolveThenable(thenable) {
|
|
170
|
+
switch (thenable.status) {
|
|
171
|
+
case "fulfilled":
|
|
172
|
+
return thenable.value;
|
|
173
|
+
case "rejected":
|
|
174
|
+
throw thenable.reason;
|
|
175
|
+
default:
|
|
176
|
+
switch ("string" === typeof thenable.status ? thenable.then(noop, noop) : (thenable.status = "pending", thenable.then(
|
|
177
|
+
function(fulfilledValue) {
|
|
178
|
+
"pending" === thenable.status && (thenable.status = "fulfilled", thenable.value = fulfilledValue);
|
|
179
|
+
},
|
|
180
|
+
function(error) {
|
|
181
|
+
"pending" === thenable.status && (thenable.status = "rejected", thenable.reason = error);
|
|
182
|
+
}
|
|
183
|
+
)), thenable.status) {
|
|
184
|
+
case "fulfilled":
|
|
185
|
+
return thenable.value;
|
|
186
|
+
case "rejected":
|
|
187
|
+
throw thenable.reason;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
throw thenable;
|
|
191
|
+
}
|
|
192
|
+
__name(resolveThenable, "resolveThenable");
|
|
193
|
+
function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
|
|
194
|
+
var type = typeof children;
|
|
195
|
+
if ("undefined" === type || "boolean" === type) children = null;
|
|
196
|
+
var invokeCallback = false;
|
|
197
|
+
if (null === children) invokeCallback = true;
|
|
198
|
+
else
|
|
199
|
+
switch (type) {
|
|
200
|
+
case "bigint":
|
|
201
|
+
case "string":
|
|
202
|
+
case "number":
|
|
203
|
+
invokeCallback = true;
|
|
204
|
+
break;
|
|
205
|
+
case "object":
|
|
206
|
+
switch (children.$$typeof) {
|
|
207
|
+
case REACT_ELEMENT_TYPE:
|
|
208
|
+
case REACT_PORTAL_TYPE:
|
|
209
|
+
invokeCallback = true;
|
|
210
|
+
break;
|
|
211
|
+
case REACT_LAZY_TYPE:
|
|
212
|
+
return invokeCallback = children._init, mapIntoArray(
|
|
213
|
+
invokeCallback(children._payload),
|
|
214
|
+
array,
|
|
215
|
+
escapedPrefix,
|
|
216
|
+
nameSoFar,
|
|
217
|
+
callback
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
if (invokeCallback)
|
|
222
|
+
return callback = callback(children), invokeCallback = "" === nameSoFar ? "." + getElementKey(children, 0) : nameSoFar, isArrayImpl(callback) ? (escapedPrefix = "", null != invokeCallback && (escapedPrefix = invokeCallback.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), mapIntoArray(callback, array, escapedPrefix, "", function(c) {
|
|
223
|
+
return c;
|
|
224
|
+
})) : null != callback && (isValidElement(callback) && (callback = cloneAndReplaceKey(
|
|
225
|
+
callback,
|
|
226
|
+
escapedPrefix + (null == callback.key || children && children.key === callback.key ? "" : ("" + callback.key).replace(
|
|
227
|
+
userProvidedKeyEscapeRegex,
|
|
228
|
+
"$&/"
|
|
229
|
+
) + "/") + invokeCallback
|
|
230
|
+
)), array.push(callback)), 1;
|
|
231
|
+
invokeCallback = 0;
|
|
232
|
+
var nextNamePrefix = "" === nameSoFar ? "." : nameSoFar + ":";
|
|
233
|
+
if (isArrayImpl(children))
|
|
234
|
+
for (var i = 0; i < children.length; i++)
|
|
235
|
+
nameSoFar = children[i], type = nextNamePrefix + getElementKey(nameSoFar, i), invokeCallback += mapIntoArray(
|
|
236
|
+
nameSoFar,
|
|
237
|
+
array,
|
|
238
|
+
escapedPrefix,
|
|
239
|
+
type,
|
|
240
|
+
callback
|
|
241
|
+
);
|
|
242
|
+
else if (i = getIteratorFn(children), "function" === typeof i)
|
|
243
|
+
for (children = i.call(children), i = 0; !(nameSoFar = children.next()).done; )
|
|
244
|
+
nameSoFar = nameSoFar.value, type = nextNamePrefix + getElementKey(nameSoFar, i++), invokeCallback += mapIntoArray(
|
|
245
|
+
nameSoFar,
|
|
246
|
+
array,
|
|
247
|
+
escapedPrefix,
|
|
248
|
+
type,
|
|
249
|
+
callback
|
|
250
|
+
);
|
|
251
|
+
else if ("object" === type) {
|
|
252
|
+
if ("function" === typeof children.then)
|
|
253
|
+
return mapIntoArray(
|
|
254
|
+
resolveThenable(children),
|
|
255
|
+
array,
|
|
256
|
+
escapedPrefix,
|
|
257
|
+
nameSoFar,
|
|
258
|
+
callback
|
|
259
|
+
);
|
|
260
|
+
array = String(children);
|
|
261
|
+
throw Error(
|
|
262
|
+
"Objects are not valid as a React child (found: " + ("[object Object]" === array ? "object with keys {" + Object.keys(children).join(", ") + "}" : array) + "). If you meant to render a collection of children, use an array instead."
|
|
263
|
+
);
|
|
264
|
+
}
|
|
265
|
+
return invokeCallback;
|
|
266
|
+
}
|
|
267
|
+
__name(mapIntoArray, "mapIntoArray");
|
|
268
|
+
function mapChildren(children, func, context) {
|
|
269
|
+
if (null == children) return children;
|
|
270
|
+
var result = [], count = 0;
|
|
271
|
+
mapIntoArray(children, result, "", "", function(child) {
|
|
272
|
+
return func.call(context, child, count++);
|
|
273
|
+
});
|
|
274
|
+
return result;
|
|
275
|
+
}
|
|
276
|
+
__name(mapChildren, "mapChildren");
|
|
277
|
+
function lazyInitializer(payload) {
|
|
278
|
+
if (-1 === payload._status) {
|
|
279
|
+
var ctor = payload._result;
|
|
280
|
+
ctor = ctor();
|
|
281
|
+
ctor.then(
|
|
282
|
+
function(moduleObject) {
|
|
283
|
+
if (0 === payload._status || -1 === payload._status)
|
|
284
|
+
payload._status = 1, payload._result = moduleObject;
|
|
285
|
+
},
|
|
286
|
+
function(error) {
|
|
287
|
+
if (0 === payload._status || -1 === payload._status)
|
|
288
|
+
payload._status = 2, payload._result = error;
|
|
289
|
+
}
|
|
290
|
+
);
|
|
291
|
+
-1 === payload._status && (payload._status = 0, payload._result = ctor);
|
|
292
|
+
}
|
|
293
|
+
if (1 === payload._status) return payload._result.default;
|
|
294
|
+
throw payload._result;
|
|
295
|
+
}
|
|
296
|
+
__name(lazyInitializer, "lazyInitializer");
|
|
297
|
+
var reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
|
|
298
|
+
if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
|
|
299
|
+
var event = new window.ErrorEvent("error", {
|
|
300
|
+
bubbles: true,
|
|
301
|
+
cancelable: true,
|
|
302
|
+
message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
|
|
303
|
+
error
|
|
304
|
+
});
|
|
305
|
+
if (!window.dispatchEvent(event)) return;
|
|
306
|
+
} else if ("object" === typeof process && "function" === typeof process.emit) {
|
|
307
|
+
process.emit("uncaughtException", error);
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
console.error(error);
|
|
311
|
+
};
|
|
312
|
+
var Children = {
|
|
313
|
+
map: mapChildren,
|
|
314
|
+
forEach: /* @__PURE__ */ __name(function(children, forEachFunc, forEachContext) {
|
|
315
|
+
mapChildren(
|
|
316
|
+
children,
|
|
317
|
+
function() {
|
|
318
|
+
forEachFunc.apply(this, arguments);
|
|
319
|
+
},
|
|
320
|
+
forEachContext
|
|
321
|
+
);
|
|
322
|
+
}, "forEach"),
|
|
323
|
+
count: /* @__PURE__ */ __name(function(children) {
|
|
324
|
+
var n = 0;
|
|
325
|
+
mapChildren(children, function() {
|
|
326
|
+
n++;
|
|
327
|
+
});
|
|
328
|
+
return n;
|
|
329
|
+
}, "count"),
|
|
330
|
+
toArray: /* @__PURE__ */ __name(function(children) {
|
|
331
|
+
return mapChildren(children, function(child) {
|
|
332
|
+
return child;
|
|
333
|
+
}) || [];
|
|
334
|
+
}, "toArray"),
|
|
335
|
+
only: /* @__PURE__ */ __name(function(children) {
|
|
336
|
+
if (!isValidElement(children))
|
|
337
|
+
throw Error(
|
|
338
|
+
"React.Children.only expected to receive a single React element child."
|
|
339
|
+
);
|
|
340
|
+
return children;
|
|
341
|
+
}, "only")
|
|
342
|
+
};
|
|
343
|
+
exports.Activity = REACT_ACTIVITY_TYPE;
|
|
344
|
+
exports.Children = Children;
|
|
345
|
+
exports.Component = Component;
|
|
346
|
+
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
347
|
+
exports.Profiler = REACT_PROFILER_TYPE;
|
|
348
|
+
exports.PureComponent = PureComponent;
|
|
349
|
+
exports.StrictMode = REACT_STRICT_MODE_TYPE;
|
|
350
|
+
exports.Suspense = REACT_SUSPENSE_TYPE;
|
|
351
|
+
exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
|
|
352
|
+
exports.__COMPILER_RUNTIME = {
|
|
353
|
+
__proto__: null,
|
|
354
|
+
c: /* @__PURE__ */ __name(function(size) {
|
|
355
|
+
return ReactSharedInternals.H.useMemoCache(size);
|
|
356
|
+
}, "c")
|
|
357
|
+
};
|
|
358
|
+
exports.cache = function(fn) {
|
|
359
|
+
return function() {
|
|
360
|
+
return fn.apply(null, arguments);
|
|
361
|
+
};
|
|
362
|
+
};
|
|
363
|
+
exports.cacheSignal = function() {
|
|
364
|
+
return null;
|
|
365
|
+
};
|
|
366
|
+
exports.cloneElement = function(element, config, children) {
|
|
367
|
+
if (null === element || void 0 === element)
|
|
368
|
+
throw Error(
|
|
369
|
+
"The argument must be a React element, but you passed " + element + "."
|
|
370
|
+
);
|
|
371
|
+
var props = assign({}, element.props), key = element.key;
|
|
372
|
+
if (null != config)
|
|
373
|
+
for (propName in void 0 !== config.key && (key = "" + config.key), config)
|
|
374
|
+
!hasOwnProperty.call(config, propName) || "key" === propName || "__self" === propName || "__source" === propName || "ref" === propName && void 0 === config.ref || (props[propName] = config[propName]);
|
|
375
|
+
var propName = arguments.length - 2;
|
|
376
|
+
if (1 === propName) props.children = children;
|
|
377
|
+
else if (1 < propName) {
|
|
378
|
+
for (var childArray = Array(propName), i = 0; i < propName; i++)
|
|
379
|
+
childArray[i] = arguments[i + 2];
|
|
380
|
+
props.children = childArray;
|
|
381
|
+
}
|
|
382
|
+
return ReactElement(element.type, key, props);
|
|
383
|
+
};
|
|
384
|
+
exports.createContext = function(defaultValue) {
|
|
385
|
+
defaultValue = {
|
|
386
|
+
$$typeof: REACT_CONTEXT_TYPE,
|
|
387
|
+
_currentValue: defaultValue,
|
|
388
|
+
_currentValue2: defaultValue,
|
|
389
|
+
_threadCount: 0,
|
|
390
|
+
Provider: null,
|
|
391
|
+
Consumer: null
|
|
392
|
+
};
|
|
393
|
+
defaultValue.Provider = defaultValue;
|
|
394
|
+
defaultValue.Consumer = {
|
|
395
|
+
$$typeof: REACT_CONSUMER_TYPE,
|
|
396
|
+
_context: defaultValue
|
|
397
|
+
};
|
|
398
|
+
return defaultValue;
|
|
399
|
+
};
|
|
400
|
+
exports.createElement = function(type, config, children) {
|
|
401
|
+
var propName, props = {}, key = null;
|
|
402
|
+
if (null != config)
|
|
403
|
+
for (propName in void 0 !== config.key && (key = "" + config.key), config)
|
|
404
|
+
hasOwnProperty.call(config, propName) && "key" !== propName && "__self" !== propName && "__source" !== propName && (props[propName] = config[propName]);
|
|
405
|
+
var childrenLength = arguments.length - 2;
|
|
406
|
+
if (1 === childrenLength) props.children = children;
|
|
407
|
+
else if (1 < childrenLength) {
|
|
408
|
+
for (var childArray = Array(childrenLength), i = 0; i < childrenLength; i++)
|
|
409
|
+
childArray[i] = arguments[i + 2];
|
|
410
|
+
props.children = childArray;
|
|
411
|
+
}
|
|
412
|
+
if (type && type.defaultProps)
|
|
413
|
+
for (propName in childrenLength = type.defaultProps, childrenLength)
|
|
414
|
+
void 0 === props[propName] && (props[propName] = childrenLength[propName]);
|
|
415
|
+
return ReactElement(type, key, props);
|
|
416
|
+
};
|
|
417
|
+
exports.createRef = function() {
|
|
418
|
+
return { current: null };
|
|
419
|
+
};
|
|
420
|
+
exports.forwardRef = function(render) {
|
|
421
|
+
return { $$typeof: REACT_FORWARD_REF_TYPE, render };
|
|
422
|
+
};
|
|
423
|
+
exports.isValidElement = isValidElement;
|
|
424
|
+
exports.lazy = function(ctor) {
|
|
425
|
+
return {
|
|
426
|
+
$$typeof: REACT_LAZY_TYPE,
|
|
427
|
+
_payload: { _status: -1, _result: ctor },
|
|
428
|
+
_init: lazyInitializer
|
|
429
|
+
};
|
|
430
|
+
};
|
|
431
|
+
exports.memo = function(type, compare) {
|
|
432
|
+
return {
|
|
433
|
+
$$typeof: REACT_MEMO_TYPE,
|
|
434
|
+
type,
|
|
435
|
+
compare: void 0 === compare ? null : compare
|
|
436
|
+
};
|
|
437
|
+
};
|
|
438
|
+
exports.startTransition = function(scope) {
|
|
439
|
+
var prevTransition = ReactSharedInternals.T, currentTransition = {};
|
|
440
|
+
ReactSharedInternals.T = currentTransition;
|
|
441
|
+
try {
|
|
442
|
+
var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S;
|
|
443
|
+
null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
|
|
444
|
+
"object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && returnValue.then(noop, reportGlobalError);
|
|
445
|
+
} catch (error) {
|
|
446
|
+
reportGlobalError(error);
|
|
447
|
+
} finally {
|
|
448
|
+
null !== prevTransition && null !== currentTransition.types && (prevTransition.types = currentTransition.types), ReactSharedInternals.T = prevTransition;
|
|
449
|
+
}
|
|
450
|
+
};
|
|
451
|
+
exports.unstable_useCacheRefresh = function() {
|
|
452
|
+
return ReactSharedInternals.H.useCacheRefresh();
|
|
453
|
+
};
|
|
454
|
+
exports.use = function(usable) {
|
|
455
|
+
return ReactSharedInternals.H.use(usable);
|
|
456
|
+
};
|
|
457
|
+
exports.useActionState = function(action, initialState, permalink) {
|
|
458
|
+
return ReactSharedInternals.H.useActionState(action, initialState, permalink);
|
|
459
|
+
};
|
|
460
|
+
exports.useCallback = function(callback, deps) {
|
|
461
|
+
return ReactSharedInternals.H.useCallback(callback, deps);
|
|
462
|
+
};
|
|
463
|
+
exports.useContext = function(Context) {
|
|
464
|
+
return ReactSharedInternals.H.useContext(Context);
|
|
465
|
+
};
|
|
466
|
+
exports.useDebugValue = function() {
|
|
467
|
+
};
|
|
468
|
+
exports.useDeferredValue = function(value, initialValue) {
|
|
469
|
+
return ReactSharedInternals.H.useDeferredValue(value, initialValue);
|
|
470
|
+
};
|
|
471
|
+
exports.useEffect = function(create, deps) {
|
|
472
|
+
return ReactSharedInternals.H.useEffect(create, deps);
|
|
473
|
+
};
|
|
474
|
+
exports.useEffectEvent = function(callback) {
|
|
475
|
+
return ReactSharedInternals.H.useEffectEvent(callback);
|
|
476
|
+
};
|
|
477
|
+
exports.useId = function() {
|
|
478
|
+
return ReactSharedInternals.H.useId();
|
|
479
|
+
};
|
|
480
|
+
exports.useImperativeHandle = function(ref, create, deps) {
|
|
481
|
+
return ReactSharedInternals.H.useImperativeHandle(ref, create, deps);
|
|
482
|
+
};
|
|
483
|
+
exports.useInsertionEffect = function(create, deps) {
|
|
484
|
+
return ReactSharedInternals.H.useInsertionEffect(create, deps);
|
|
485
|
+
};
|
|
486
|
+
exports.useLayoutEffect = function(create, deps) {
|
|
487
|
+
return ReactSharedInternals.H.useLayoutEffect(create, deps);
|
|
488
|
+
};
|
|
489
|
+
exports.useMemo = function(create, deps) {
|
|
490
|
+
return ReactSharedInternals.H.useMemo(create, deps);
|
|
491
|
+
};
|
|
492
|
+
exports.useOptimistic = function(passthrough, reducer) {
|
|
493
|
+
return ReactSharedInternals.H.useOptimistic(passthrough, reducer);
|
|
494
|
+
};
|
|
495
|
+
exports.useReducer = function(reducer, initialArg, init) {
|
|
496
|
+
return ReactSharedInternals.H.useReducer(reducer, initialArg, init);
|
|
497
|
+
};
|
|
498
|
+
exports.useRef = function(initialValue) {
|
|
499
|
+
return ReactSharedInternals.H.useRef(initialValue);
|
|
500
|
+
};
|
|
501
|
+
exports.useState = function(initialState) {
|
|
502
|
+
return ReactSharedInternals.H.useState(initialState);
|
|
503
|
+
};
|
|
504
|
+
exports.useSyncExternalStore = function(subscribe3, getSnapshot, getServerSnapshot) {
|
|
505
|
+
return ReactSharedInternals.H.useSyncExternalStore(
|
|
506
|
+
subscribe3,
|
|
507
|
+
getSnapshot,
|
|
508
|
+
getServerSnapshot
|
|
509
|
+
);
|
|
510
|
+
};
|
|
511
|
+
exports.useTransition = function() {
|
|
512
|
+
return ReactSharedInternals.H.useTransition();
|
|
513
|
+
};
|
|
514
|
+
exports.version = "19.2.6";
|
|
515
|
+
}
|
|
516
|
+
});
|
|
517
|
+
|
|
518
|
+
// ../../node_modules/.pnpm/react@19.2.6/node_modules/react/cjs/react.development.js
|
|
519
|
+
var require_react_development = __commonJS({
|
|
520
|
+
"../../node_modules/.pnpm/react@19.2.6/node_modules/react/cjs/react.development.js"(exports, module) {
|
|
521
|
+
"use strict";
|
|
522
|
+
"production" !== process.env.NODE_ENV && (function() {
|
|
523
|
+
function defineDeprecationWarning(methodName, info) {
|
|
524
|
+
Object.defineProperty(Component.prototype, methodName, {
|
|
525
|
+
get: /* @__PURE__ */ __name(function() {
|
|
526
|
+
console.warn(
|
|
527
|
+
"%s(...) is deprecated in plain JavaScript React classes. %s",
|
|
528
|
+
info[0],
|
|
529
|
+
info[1]
|
|
530
|
+
);
|
|
531
|
+
}, "get")
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
__name(defineDeprecationWarning, "defineDeprecationWarning");
|
|
535
|
+
function getIteratorFn(maybeIterable) {
|
|
536
|
+
if (null === maybeIterable || "object" !== typeof maybeIterable)
|
|
537
|
+
return null;
|
|
538
|
+
maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
|
|
539
|
+
return "function" === typeof maybeIterable ? maybeIterable : null;
|
|
540
|
+
}
|
|
541
|
+
__name(getIteratorFn, "getIteratorFn");
|
|
542
|
+
function warnNoop(publicInstance, callerName) {
|
|
543
|
+
publicInstance = (publicInstance = publicInstance.constructor) && (publicInstance.displayName || publicInstance.name) || "ReactClass";
|
|
544
|
+
var warningKey = publicInstance + "." + callerName;
|
|
545
|
+
didWarnStateUpdateForUnmountedComponent[warningKey] || (console.error(
|
|
546
|
+
"Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",
|
|
547
|
+
callerName,
|
|
548
|
+
publicInstance
|
|
549
|
+
), didWarnStateUpdateForUnmountedComponent[warningKey] = true);
|
|
550
|
+
}
|
|
551
|
+
__name(warnNoop, "warnNoop");
|
|
552
|
+
function Component(props, context, updater) {
|
|
553
|
+
this.props = props;
|
|
554
|
+
this.context = context;
|
|
555
|
+
this.refs = emptyObject;
|
|
556
|
+
this.updater = updater || ReactNoopUpdateQueue;
|
|
557
|
+
}
|
|
558
|
+
__name(Component, "Component");
|
|
559
|
+
function ComponentDummy() {
|
|
560
|
+
}
|
|
561
|
+
__name(ComponentDummy, "ComponentDummy");
|
|
562
|
+
function PureComponent(props, context, updater) {
|
|
563
|
+
this.props = props;
|
|
564
|
+
this.context = context;
|
|
565
|
+
this.refs = emptyObject;
|
|
566
|
+
this.updater = updater || ReactNoopUpdateQueue;
|
|
567
|
+
}
|
|
568
|
+
__name(PureComponent, "PureComponent");
|
|
569
|
+
function noop() {
|
|
570
|
+
}
|
|
571
|
+
__name(noop, "noop");
|
|
572
|
+
function testStringCoercion(value) {
|
|
573
|
+
return "" + value;
|
|
574
|
+
}
|
|
575
|
+
__name(testStringCoercion, "testStringCoercion");
|
|
576
|
+
function checkKeyStringCoercion(value) {
|
|
577
|
+
try {
|
|
578
|
+
testStringCoercion(value);
|
|
579
|
+
var JSCompiler_inline_result = false;
|
|
580
|
+
} catch (e) {
|
|
581
|
+
JSCompiler_inline_result = true;
|
|
582
|
+
}
|
|
583
|
+
if (JSCompiler_inline_result) {
|
|
584
|
+
JSCompiler_inline_result = console;
|
|
585
|
+
var JSCompiler_temp_const = JSCompiler_inline_result.error;
|
|
586
|
+
var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
|
587
|
+
JSCompiler_temp_const.call(
|
|
588
|
+
JSCompiler_inline_result,
|
|
589
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
590
|
+
JSCompiler_inline_result$jscomp$0
|
|
591
|
+
);
|
|
592
|
+
return testStringCoercion(value);
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
__name(checkKeyStringCoercion, "checkKeyStringCoercion");
|
|
596
|
+
function getComponentNameFromType(type) {
|
|
597
|
+
if (null == type) return null;
|
|
598
|
+
if ("function" === typeof type)
|
|
599
|
+
return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
|
|
600
|
+
if ("string" === typeof type) return type;
|
|
601
|
+
switch (type) {
|
|
602
|
+
case REACT_FRAGMENT_TYPE:
|
|
603
|
+
return "Fragment";
|
|
604
|
+
case REACT_PROFILER_TYPE:
|
|
605
|
+
return "Profiler";
|
|
606
|
+
case REACT_STRICT_MODE_TYPE:
|
|
607
|
+
return "StrictMode";
|
|
608
|
+
case REACT_SUSPENSE_TYPE:
|
|
609
|
+
return "Suspense";
|
|
610
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
611
|
+
return "SuspenseList";
|
|
612
|
+
case REACT_ACTIVITY_TYPE:
|
|
613
|
+
return "Activity";
|
|
614
|
+
}
|
|
615
|
+
if ("object" === typeof type)
|
|
616
|
+
switch ("number" === typeof type.tag && console.error(
|
|
617
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
618
|
+
), type.$$typeof) {
|
|
619
|
+
case REACT_PORTAL_TYPE:
|
|
620
|
+
return "Portal";
|
|
621
|
+
case REACT_CONTEXT_TYPE:
|
|
622
|
+
return type.displayName || "Context";
|
|
623
|
+
case REACT_CONSUMER_TYPE:
|
|
624
|
+
return (type._context.displayName || "Context") + ".Consumer";
|
|
625
|
+
case REACT_FORWARD_REF_TYPE:
|
|
626
|
+
var innerType = type.render;
|
|
627
|
+
type = type.displayName;
|
|
628
|
+
type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
|
|
629
|
+
return type;
|
|
630
|
+
case REACT_MEMO_TYPE:
|
|
631
|
+
return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
|
|
632
|
+
case REACT_LAZY_TYPE:
|
|
633
|
+
innerType = type._payload;
|
|
634
|
+
type = type._init;
|
|
635
|
+
try {
|
|
636
|
+
return getComponentNameFromType(type(innerType));
|
|
637
|
+
} catch (x) {
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
return null;
|
|
641
|
+
}
|
|
642
|
+
__name(getComponentNameFromType, "getComponentNameFromType");
|
|
643
|
+
function getTaskName(type) {
|
|
644
|
+
if (type === REACT_FRAGMENT_TYPE) return "<>";
|
|
645
|
+
if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE)
|
|
646
|
+
return "<...>";
|
|
647
|
+
try {
|
|
648
|
+
var name = getComponentNameFromType(type);
|
|
649
|
+
return name ? "<" + name + ">" : "<...>";
|
|
650
|
+
} catch (x) {
|
|
651
|
+
return "<...>";
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
__name(getTaskName, "getTaskName");
|
|
655
|
+
function getOwner() {
|
|
656
|
+
var dispatcher = ReactSharedInternals.A;
|
|
657
|
+
return null === dispatcher ? null : dispatcher.getOwner();
|
|
658
|
+
}
|
|
659
|
+
__name(getOwner, "getOwner");
|
|
660
|
+
function UnknownOwner() {
|
|
661
|
+
return Error("react-stack-top-frame");
|
|
662
|
+
}
|
|
663
|
+
__name(UnknownOwner, "UnknownOwner");
|
|
664
|
+
function hasValidKey(config) {
|
|
665
|
+
if (hasOwnProperty.call(config, "key")) {
|
|
666
|
+
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
|
667
|
+
if (getter && getter.isReactWarning) return false;
|
|
668
|
+
}
|
|
669
|
+
return void 0 !== config.key;
|
|
670
|
+
}
|
|
671
|
+
__name(hasValidKey, "hasValidKey");
|
|
672
|
+
function defineKeyPropWarningGetter(props, displayName) {
|
|
673
|
+
function warnAboutAccessingKey() {
|
|
674
|
+
specialPropKeyWarningShown || (specialPropKeyWarningShown = true, console.error(
|
|
675
|
+
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
676
|
+
displayName
|
|
677
|
+
));
|
|
678
|
+
}
|
|
679
|
+
__name(warnAboutAccessingKey, "warnAboutAccessingKey");
|
|
680
|
+
warnAboutAccessingKey.isReactWarning = true;
|
|
681
|
+
Object.defineProperty(props, "key", {
|
|
682
|
+
get: warnAboutAccessingKey,
|
|
683
|
+
configurable: true
|
|
684
|
+
});
|
|
685
|
+
}
|
|
686
|
+
__name(defineKeyPropWarningGetter, "defineKeyPropWarningGetter");
|
|
687
|
+
function elementRefGetterWithDeprecationWarning() {
|
|
688
|
+
var componentName = getComponentNameFromType(this.type);
|
|
689
|
+
didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = true, console.error(
|
|
690
|
+
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
691
|
+
));
|
|
692
|
+
componentName = this.props.ref;
|
|
693
|
+
return void 0 !== componentName ? componentName : null;
|
|
694
|
+
}
|
|
695
|
+
__name(elementRefGetterWithDeprecationWarning, "elementRefGetterWithDeprecationWarning");
|
|
696
|
+
function ReactElement(type, key, props, owner, debugStack, debugTask) {
|
|
697
|
+
var refProp = props.ref;
|
|
698
|
+
type = {
|
|
699
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
700
|
+
type,
|
|
701
|
+
key,
|
|
702
|
+
props,
|
|
703
|
+
_owner: owner
|
|
704
|
+
};
|
|
705
|
+
null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", {
|
|
706
|
+
enumerable: false,
|
|
707
|
+
get: elementRefGetterWithDeprecationWarning
|
|
708
|
+
}) : Object.defineProperty(type, "ref", { enumerable: false, value: null });
|
|
709
|
+
type._store = {};
|
|
710
|
+
Object.defineProperty(type._store, "validated", {
|
|
711
|
+
configurable: false,
|
|
712
|
+
enumerable: false,
|
|
713
|
+
writable: true,
|
|
714
|
+
value: 0
|
|
715
|
+
});
|
|
716
|
+
Object.defineProperty(type, "_debugInfo", {
|
|
717
|
+
configurable: false,
|
|
718
|
+
enumerable: false,
|
|
719
|
+
writable: true,
|
|
720
|
+
value: null
|
|
721
|
+
});
|
|
722
|
+
Object.defineProperty(type, "_debugStack", {
|
|
723
|
+
configurable: false,
|
|
724
|
+
enumerable: false,
|
|
725
|
+
writable: true,
|
|
726
|
+
value: debugStack
|
|
727
|
+
});
|
|
728
|
+
Object.defineProperty(type, "_debugTask", {
|
|
729
|
+
configurable: false,
|
|
730
|
+
enumerable: false,
|
|
731
|
+
writable: true,
|
|
732
|
+
value: debugTask
|
|
733
|
+
});
|
|
734
|
+
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
|
735
|
+
return type;
|
|
736
|
+
}
|
|
737
|
+
__name(ReactElement, "ReactElement");
|
|
738
|
+
function cloneAndReplaceKey(oldElement, newKey) {
|
|
739
|
+
newKey = ReactElement(
|
|
740
|
+
oldElement.type,
|
|
741
|
+
newKey,
|
|
742
|
+
oldElement.props,
|
|
743
|
+
oldElement._owner,
|
|
744
|
+
oldElement._debugStack,
|
|
745
|
+
oldElement._debugTask
|
|
746
|
+
);
|
|
747
|
+
oldElement._store && (newKey._store.validated = oldElement._store.validated);
|
|
748
|
+
return newKey;
|
|
749
|
+
}
|
|
750
|
+
__name(cloneAndReplaceKey, "cloneAndReplaceKey");
|
|
751
|
+
function validateChildKeys(node) {
|
|
752
|
+
isValidElement(node) ? node._store && (node._store.validated = 1) : "object" === typeof node && null !== node && node.$$typeof === REACT_LAZY_TYPE && ("fulfilled" === node._payload.status ? isValidElement(node._payload.value) && node._payload.value._store && (node._payload.value._store.validated = 1) : node._store && (node._store.validated = 1));
|
|
753
|
+
}
|
|
754
|
+
__name(validateChildKeys, "validateChildKeys");
|
|
755
|
+
function isValidElement(object) {
|
|
756
|
+
return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
757
|
+
}
|
|
758
|
+
__name(isValidElement, "isValidElement");
|
|
759
|
+
function escape(key) {
|
|
760
|
+
var escaperLookup = { "=": "=0", ":": "=2" };
|
|
761
|
+
return "$" + key.replace(/[=:]/g, function(match) {
|
|
762
|
+
return escaperLookup[match];
|
|
763
|
+
});
|
|
764
|
+
}
|
|
765
|
+
__name(escape, "escape");
|
|
766
|
+
function getElementKey(element, index) {
|
|
767
|
+
return "object" === typeof element && null !== element && null != element.key ? (checkKeyStringCoercion(element.key), escape("" + element.key)) : index.toString(36);
|
|
768
|
+
}
|
|
769
|
+
__name(getElementKey, "getElementKey");
|
|
770
|
+
function resolveThenable(thenable) {
|
|
771
|
+
switch (thenable.status) {
|
|
772
|
+
case "fulfilled":
|
|
773
|
+
return thenable.value;
|
|
774
|
+
case "rejected":
|
|
775
|
+
throw thenable.reason;
|
|
776
|
+
default:
|
|
777
|
+
switch ("string" === typeof thenable.status ? thenable.then(noop, noop) : (thenable.status = "pending", thenable.then(
|
|
778
|
+
function(fulfilledValue) {
|
|
779
|
+
"pending" === thenable.status && (thenable.status = "fulfilled", thenable.value = fulfilledValue);
|
|
780
|
+
},
|
|
781
|
+
function(error) {
|
|
782
|
+
"pending" === thenable.status && (thenable.status = "rejected", thenable.reason = error);
|
|
783
|
+
}
|
|
784
|
+
)), thenable.status) {
|
|
785
|
+
case "fulfilled":
|
|
786
|
+
return thenable.value;
|
|
787
|
+
case "rejected":
|
|
788
|
+
throw thenable.reason;
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
throw thenable;
|
|
792
|
+
}
|
|
793
|
+
__name(resolveThenable, "resolveThenable");
|
|
794
|
+
function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
|
|
795
|
+
var type = typeof children;
|
|
796
|
+
if ("undefined" === type || "boolean" === type) children = null;
|
|
797
|
+
var invokeCallback = false;
|
|
798
|
+
if (null === children) invokeCallback = true;
|
|
799
|
+
else
|
|
800
|
+
switch (type) {
|
|
801
|
+
case "bigint":
|
|
802
|
+
case "string":
|
|
803
|
+
case "number":
|
|
804
|
+
invokeCallback = true;
|
|
805
|
+
break;
|
|
806
|
+
case "object":
|
|
807
|
+
switch (children.$$typeof) {
|
|
808
|
+
case REACT_ELEMENT_TYPE:
|
|
809
|
+
case REACT_PORTAL_TYPE:
|
|
810
|
+
invokeCallback = true;
|
|
811
|
+
break;
|
|
812
|
+
case REACT_LAZY_TYPE:
|
|
813
|
+
return invokeCallback = children._init, mapIntoArray(
|
|
814
|
+
invokeCallback(children._payload),
|
|
815
|
+
array,
|
|
816
|
+
escapedPrefix,
|
|
817
|
+
nameSoFar,
|
|
818
|
+
callback
|
|
819
|
+
);
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
if (invokeCallback) {
|
|
823
|
+
invokeCallback = children;
|
|
824
|
+
callback = callback(invokeCallback);
|
|
825
|
+
var childKey = "" === nameSoFar ? "." + getElementKey(invokeCallback, 0) : nameSoFar;
|
|
826
|
+
isArrayImpl(callback) ? (escapedPrefix = "", null != childKey && (escapedPrefix = childKey.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), mapIntoArray(callback, array, escapedPrefix, "", function(c) {
|
|
827
|
+
return c;
|
|
828
|
+
})) : null != callback && (isValidElement(callback) && (null != callback.key && (invokeCallback && invokeCallback.key === callback.key || checkKeyStringCoercion(callback.key)), escapedPrefix = cloneAndReplaceKey(
|
|
829
|
+
callback,
|
|
830
|
+
escapedPrefix + (null == callback.key || invokeCallback && invokeCallback.key === callback.key ? "" : ("" + callback.key).replace(
|
|
831
|
+
userProvidedKeyEscapeRegex,
|
|
832
|
+
"$&/"
|
|
833
|
+
) + "/") + childKey
|
|
834
|
+
), "" !== nameSoFar && null != invokeCallback && isValidElement(invokeCallback) && null == invokeCallback.key && invokeCallback._store && !invokeCallback._store.validated && (escapedPrefix._store.validated = 2), callback = escapedPrefix), array.push(callback));
|
|
835
|
+
return 1;
|
|
836
|
+
}
|
|
837
|
+
invokeCallback = 0;
|
|
838
|
+
childKey = "" === nameSoFar ? "." : nameSoFar + ":";
|
|
839
|
+
if (isArrayImpl(children))
|
|
840
|
+
for (var i = 0; i < children.length; i++)
|
|
841
|
+
nameSoFar = children[i], type = childKey + getElementKey(nameSoFar, i), invokeCallback += mapIntoArray(
|
|
842
|
+
nameSoFar,
|
|
843
|
+
array,
|
|
844
|
+
escapedPrefix,
|
|
845
|
+
type,
|
|
846
|
+
callback
|
|
847
|
+
);
|
|
848
|
+
else if (i = getIteratorFn(children), "function" === typeof i)
|
|
849
|
+
for (i === children.entries && (didWarnAboutMaps || console.warn(
|
|
850
|
+
"Using Maps as children is not supported. Use an array of keyed ReactElements instead."
|
|
851
|
+
), didWarnAboutMaps = true), children = i.call(children), i = 0; !(nameSoFar = children.next()).done; )
|
|
852
|
+
nameSoFar = nameSoFar.value, type = childKey + getElementKey(nameSoFar, i++), invokeCallback += mapIntoArray(
|
|
853
|
+
nameSoFar,
|
|
854
|
+
array,
|
|
855
|
+
escapedPrefix,
|
|
856
|
+
type,
|
|
857
|
+
callback
|
|
858
|
+
);
|
|
859
|
+
else if ("object" === type) {
|
|
860
|
+
if ("function" === typeof children.then)
|
|
861
|
+
return mapIntoArray(
|
|
862
|
+
resolveThenable(children),
|
|
863
|
+
array,
|
|
864
|
+
escapedPrefix,
|
|
865
|
+
nameSoFar,
|
|
866
|
+
callback
|
|
867
|
+
);
|
|
868
|
+
array = String(children);
|
|
869
|
+
throw Error(
|
|
870
|
+
"Objects are not valid as a React child (found: " + ("[object Object]" === array ? "object with keys {" + Object.keys(children).join(", ") + "}" : array) + "). If you meant to render a collection of children, use an array instead."
|
|
871
|
+
);
|
|
872
|
+
}
|
|
873
|
+
return invokeCallback;
|
|
874
|
+
}
|
|
875
|
+
__name(mapIntoArray, "mapIntoArray");
|
|
876
|
+
function mapChildren(children, func, context) {
|
|
877
|
+
if (null == children) return children;
|
|
878
|
+
var result = [], count = 0;
|
|
879
|
+
mapIntoArray(children, result, "", "", function(child) {
|
|
880
|
+
return func.call(context, child, count++);
|
|
881
|
+
});
|
|
882
|
+
return result;
|
|
883
|
+
}
|
|
884
|
+
__name(mapChildren, "mapChildren");
|
|
885
|
+
function lazyInitializer(payload) {
|
|
886
|
+
if (-1 === payload._status) {
|
|
887
|
+
var ioInfo = payload._ioInfo;
|
|
888
|
+
null != ioInfo && (ioInfo.start = ioInfo.end = performance.now());
|
|
889
|
+
ioInfo = payload._result;
|
|
890
|
+
var thenable = ioInfo();
|
|
891
|
+
thenable.then(
|
|
892
|
+
function(moduleObject) {
|
|
893
|
+
if (0 === payload._status || -1 === payload._status) {
|
|
894
|
+
payload._status = 1;
|
|
895
|
+
payload._result = moduleObject;
|
|
896
|
+
var _ioInfo = payload._ioInfo;
|
|
897
|
+
null != _ioInfo && (_ioInfo.end = performance.now());
|
|
898
|
+
void 0 === thenable.status && (thenable.status = "fulfilled", thenable.value = moduleObject);
|
|
899
|
+
}
|
|
900
|
+
},
|
|
901
|
+
function(error) {
|
|
902
|
+
if (0 === payload._status || -1 === payload._status) {
|
|
903
|
+
payload._status = 2;
|
|
904
|
+
payload._result = error;
|
|
905
|
+
var _ioInfo2 = payload._ioInfo;
|
|
906
|
+
null != _ioInfo2 && (_ioInfo2.end = performance.now());
|
|
907
|
+
void 0 === thenable.status && (thenable.status = "rejected", thenable.reason = error);
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
);
|
|
911
|
+
ioInfo = payload._ioInfo;
|
|
912
|
+
if (null != ioInfo) {
|
|
913
|
+
ioInfo.value = thenable;
|
|
914
|
+
var displayName = thenable.displayName;
|
|
915
|
+
"string" === typeof displayName && (ioInfo.name = displayName);
|
|
916
|
+
}
|
|
917
|
+
-1 === payload._status && (payload._status = 0, payload._result = thenable);
|
|
918
|
+
}
|
|
919
|
+
if (1 === payload._status)
|
|
920
|
+
return ioInfo = payload._result, void 0 === ioInfo && console.error(
|
|
921
|
+
"lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?",
|
|
922
|
+
ioInfo
|
|
923
|
+
), "default" in ioInfo || console.error(
|
|
924
|
+
"lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",
|
|
925
|
+
ioInfo
|
|
926
|
+
), ioInfo.default;
|
|
927
|
+
throw payload._result;
|
|
928
|
+
}
|
|
929
|
+
__name(lazyInitializer, "lazyInitializer");
|
|
930
|
+
function resolveDispatcher() {
|
|
931
|
+
var dispatcher = ReactSharedInternals.H;
|
|
932
|
+
null === dispatcher && console.error(
|
|
933
|
+
"Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."
|
|
934
|
+
);
|
|
935
|
+
return dispatcher;
|
|
936
|
+
}
|
|
937
|
+
__name(resolveDispatcher, "resolveDispatcher");
|
|
938
|
+
function releaseAsyncTransition() {
|
|
939
|
+
ReactSharedInternals.asyncTransitions--;
|
|
940
|
+
}
|
|
941
|
+
__name(releaseAsyncTransition, "releaseAsyncTransition");
|
|
942
|
+
function enqueueTask(task) {
|
|
943
|
+
if (null === enqueueTaskImpl)
|
|
944
|
+
try {
|
|
945
|
+
var requireString = ("require" + Math.random()).slice(0, 7);
|
|
946
|
+
enqueueTaskImpl = (module && module[requireString]).call(
|
|
947
|
+
module,
|
|
948
|
+
"timers"
|
|
949
|
+
).setImmediate;
|
|
950
|
+
} catch (_err) {
|
|
951
|
+
enqueueTaskImpl = /* @__PURE__ */ __name(function(callback) {
|
|
952
|
+
false === didWarnAboutMessageChannel && (didWarnAboutMessageChannel = true, "undefined" === typeof MessageChannel && console.error(
|
|
953
|
+
"This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."
|
|
954
|
+
));
|
|
955
|
+
var channel2 = new MessageChannel();
|
|
956
|
+
channel2.port1.onmessage = callback;
|
|
957
|
+
channel2.port2.postMessage(void 0);
|
|
958
|
+
}, "enqueueTaskImpl");
|
|
959
|
+
}
|
|
960
|
+
return enqueueTaskImpl(task);
|
|
961
|
+
}
|
|
962
|
+
__name(enqueueTask, "enqueueTask");
|
|
963
|
+
function aggregateErrors(errors) {
|
|
964
|
+
return 1 < errors.length && "function" === typeof AggregateError ? new AggregateError(errors) : errors[0];
|
|
965
|
+
}
|
|
966
|
+
__name(aggregateErrors, "aggregateErrors");
|
|
967
|
+
function popActScope(prevActQueue, prevActScopeDepth) {
|
|
968
|
+
prevActScopeDepth !== actScopeDepth - 1 && console.error(
|
|
969
|
+
"You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "
|
|
970
|
+
);
|
|
971
|
+
actScopeDepth = prevActScopeDepth;
|
|
972
|
+
}
|
|
973
|
+
__name(popActScope, "popActScope");
|
|
974
|
+
function recursivelyFlushAsyncActWork(returnValue, resolve2, reject) {
|
|
975
|
+
var queue = ReactSharedInternals.actQueue;
|
|
976
|
+
if (null !== queue)
|
|
977
|
+
if (0 !== queue.length)
|
|
978
|
+
try {
|
|
979
|
+
flushActQueue(queue);
|
|
980
|
+
enqueueTask(function() {
|
|
981
|
+
return recursivelyFlushAsyncActWork(returnValue, resolve2, reject);
|
|
982
|
+
});
|
|
983
|
+
return;
|
|
984
|
+
} catch (error) {
|
|
985
|
+
ReactSharedInternals.thrownErrors.push(error);
|
|
986
|
+
}
|
|
987
|
+
else ReactSharedInternals.actQueue = null;
|
|
988
|
+
0 < ReactSharedInternals.thrownErrors.length ? (queue = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, reject(queue)) : resolve2(returnValue);
|
|
989
|
+
}
|
|
990
|
+
__name(recursivelyFlushAsyncActWork, "recursivelyFlushAsyncActWork");
|
|
991
|
+
function flushActQueue(queue) {
|
|
992
|
+
if (!isFlushing) {
|
|
993
|
+
isFlushing = true;
|
|
994
|
+
var i = 0;
|
|
995
|
+
try {
|
|
996
|
+
for (; i < queue.length; i++) {
|
|
997
|
+
var callback = queue[i];
|
|
998
|
+
do {
|
|
999
|
+
ReactSharedInternals.didUsePromise = false;
|
|
1000
|
+
var continuation = callback(false);
|
|
1001
|
+
if (null !== continuation) {
|
|
1002
|
+
if (ReactSharedInternals.didUsePromise) {
|
|
1003
|
+
queue[i] = callback;
|
|
1004
|
+
queue.splice(0, i);
|
|
1005
|
+
return;
|
|
1006
|
+
}
|
|
1007
|
+
callback = continuation;
|
|
1008
|
+
} else break;
|
|
1009
|
+
} while (1);
|
|
1010
|
+
}
|
|
1011
|
+
queue.length = 0;
|
|
1012
|
+
} catch (error) {
|
|
1013
|
+
queue.splice(0, i + 1), ReactSharedInternals.thrownErrors.push(error);
|
|
1014
|
+
} finally {
|
|
1015
|
+
isFlushing = false;
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
__name(flushActQueue, "flushActQueue");
|
|
1020
|
+
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
1021
|
+
var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo"), REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = /* @__PURE__ */ Symbol.for("react.activity"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator, didWarnStateUpdateForUnmountedComponent = {}, ReactNoopUpdateQueue = {
|
|
1022
|
+
isMounted: /* @__PURE__ */ __name(function() {
|
|
1023
|
+
return false;
|
|
1024
|
+
}, "isMounted"),
|
|
1025
|
+
enqueueForceUpdate: /* @__PURE__ */ __name(function(publicInstance) {
|
|
1026
|
+
warnNoop(publicInstance, "forceUpdate");
|
|
1027
|
+
}, "enqueueForceUpdate"),
|
|
1028
|
+
enqueueReplaceState: /* @__PURE__ */ __name(function(publicInstance) {
|
|
1029
|
+
warnNoop(publicInstance, "replaceState");
|
|
1030
|
+
}, "enqueueReplaceState"),
|
|
1031
|
+
enqueueSetState: /* @__PURE__ */ __name(function(publicInstance) {
|
|
1032
|
+
warnNoop(publicInstance, "setState");
|
|
1033
|
+
}, "enqueueSetState")
|
|
1034
|
+
}, assign = Object.assign, emptyObject = {};
|
|
1035
|
+
Object.freeze(emptyObject);
|
|
1036
|
+
Component.prototype.isReactComponent = {};
|
|
1037
|
+
Component.prototype.setState = function(partialState, callback) {
|
|
1038
|
+
if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState)
|
|
1039
|
+
throw Error(
|
|
1040
|
+
"takes an object of state variables to update or a function which returns an object of state variables."
|
|
1041
|
+
);
|
|
1042
|
+
this.updater.enqueueSetState(this, partialState, callback, "setState");
|
|
1043
|
+
};
|
|
1044
|
+
Component.prototype.forceUpdate = function(callback) {
|
|
1045
|
+
this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
|
|
1046
|
+
};
|
|
1047
|
+
var deprecatedAPIs = {
|
|
1048
|
+
isMounted: [
|
|
1049
|
+
"isMounted",
|
|
1050
|
+
"Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."
|
|
1051
|
+
],
|
|
1052
|
+
replaceState: [
|
|
1053
|
+
"replaceState",
|
|
1054
|
+
"Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."
|
|
1055
|
+
]
|
|
1056
|
+
};
|
|
1057
|
+
for (fnName in deprecatedAPIs)
|
|
1058
|
+
deprecatedAPIs.hasOwnProperty(fnName) && defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
|
|
1059
|
+
ComponentDummy.prototype = Component.prototype;
|
|
1060
|
+
deprecatedAPIs = PureComponent.prototype = new ComponentDummy();
|
|
1061
|
+
deprecatedAPIs.constructor = PureComponent;
|
|
1062
|
+
assign(deprecatedAPIs, Component.prototype);
|
|
1063
|
+
deprecatedAPIs.isPureReactComponent = true;
|
|
1064
|
+
var isArrayImpl = Array.isArray, REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for("react.client.reference"), ReactSharedInternals = {
|
|
1065
|
+
H: null,
|
|
1066
|
+
A: null,
|
|
1067
|
+
T: null,
|
|
1068
|
+
S: null,
|
|
1069
|
+
actQueue: null,
|
|
1070
|
+
asyncTransitions: 0,
|
|
1071
|
+
isBatchingLegacy: false,
|
|
1072
|
+
didScheduleLegacyUpdate: false,
|
|
1073
|
+
didUsePromise: false,
|
|
1074
|
+
thrownErrors: [],
|
|
1075
|
+
getCurrentStack: null,
|
|
1076
|
+
recentlyCreatedOwnerStacks: 0
|
|
1077
|
+
}, hasOwnProperty = Object.prototype.hasOwnProperty, createTask = console.createTask ? console.createTask : function() {
|
|
1078
|
+
return null;
|
|
1079
|
+
};
|
|
1080
|
+
deprecatedAPIs = {
|
|
1081
|
+
react_stack_bottom_frame: /* @__PURE__ */ __name(function(callStackForError) {
|
|
1082
|
+
return callStackForError();
|
|
1083
|
+
}, "react_stack_bottom_frame")
|
|
1084
|
+
};
|
|
1085
|
+
var specialPropKeyWarningShown, didWarnAboutOldJSXRuntime;
|
|
1086
|
+
var didWarnAboutElementRef = {};
|
|
1087
|
+
var unknownOwnerDebugStack = deprecatedAPIs.react_stack_bottom_frame.bind(
|
|
1088
|
+
deprecatedAPIs,
|
|
1089
|
+
UnknownOwner
|
|
1090
|
+
)();
|
|
1091
|
+
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
|
1092
|
+
var didWarnAboutMaps = false, userProvidedKeyEscapeRegex = /\/+/g, reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
|
|
1093
|
+
if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
|
|
1094
|
+
var event = new window.ErrorEvent("error", {
|
|
1095
|
+
bubbles: true,
|
|
1096
|
+
cancelable: true,
|
|
1097
|
+
message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
|
|
1098
|
+
error
|
|
1099
|
+
});
|
|
1100
|
+
if (!window.dispatchEvent(event)) return;
|
|
1101
|
+
} else if ("object" === typeof process && "function" === typeof process.emit) {
|
|
1102
|
+
process.emit("uncaughtException", error);
|
|
1103
|
+
return;
|
|
1104
|
+
}
|
|
1105
|
+
console.error(error);
|
|
1106
|
+
}, didWarnAboutMessageChannel = false, enqueueTaskImpl = null, actScopeDepth = 0, didWarnNoAwaitAct = false, isFlushing = false, queueSeveralMicrotasks = "function" === typeof queueMicrotask ? function(callback) {
|
|
1107
|
+
queueMicrotask(function() {
|
|
1108
|
+
return queueMicrotask(callback);
|
|
1109
|
+
});
|
|
1110
|
+
} : enqueueTask;
|
|
1111
|
+
deprecatedAPIs = Object.freeze({
|
|
1112
|
+
__proto__: null,
|
|
1113
|
+
c: /* @__PURE__ */ __name(function(size) {
|
|
1114
|
+
return resolveDispatcher().useMemoCache(size);
|
|
1115
|
+
}, "c")
|
|
1116
|
+
});
|
|
1117
|
+
var fnName = {
|
|
1118
|
+
map: mapChildren,
|
|
1119
|
+
forEach: /* @__PURE__ */ __name(function(children, forEachFunc, forEachContext) {
|
|
1120
|
+
mapChildren(
|
|
1121
|
+
children,
|
|
1122
|
+
function() {
|
|
1123
|
+
forEachFunc.apply(this, arguments);
|
|
1124
|
+
},
|
|
1125
|
+
forEachContext
|
|
1126
|
+
);
|
|
1127
|
+
}, "forEach"),
|
|
1128
|
+
count: /* @__PURE__ */ __name(function(children) {
|
|
1129
|
+
var n = 0;
|
|
1130
|
+
mapChildren(children, function() {
|
|
1131
|
+
n++;
|
|
1132
|
+
});
|
|
1133
|
+
return n;
|
|
1134
|
+
}, "count"),
|
|
1135
|
+
toArray: /* @__PURE__ */ __name(function(children) {
|
|
1136
|
+
return mapChildren(children, function(child) {
|
|
1137
|
+
return child;
|
|
1138
|
+
}) || [];
|
|
1139
|
+
}, "toArray"),
|
|
1140
|
+
only: /* @__PURE__ */ __name(function(children) {
|
|
1141
|
+
if (!isValidElement(children))
|
|
1142
|
+
throw Error(
|
|
1143
|
+
"React.Children.only expected to receive a single React element child."
|
|
1144
|
+
);
|
|
1145
|
+
return children;
|
|
1146
|
+
}, "only")
|
|
1147
|
+
};
|
|
1148
|
+
exports.Activity = REACT_ACTIVITY_TYPE;
|
|
1149
|
+
exports.Children = fnName;
|
|
1150
|
+
exports.Component = Component;
|
|
1151
|
+
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
1152
|
+
exports.Profiler = REACT_PROFILER_TYPE;
|
|
1153
|
+
exports.PureComponent = PureComponent;
|
|
1154
|
+
exports.StrictMode = REACT_STRICT_MODE_TYPE;
|
|
1155
|
+
exports.Suspense = REACT_SUSPENSE_TYPE;
|
|
1156
|
+
exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
|
|
1157
|
+
exports.__COMPILER_RUNTIME = deprecatedAPIs;
|
|
1158
|
+
exports.act = function(callback) {
|
|
1159
|
+
var prevActQueue = ReactSharedInternals.actQueue, prevActScopeDepth = actScopeDepth;
|
|
1160
|
+
actScopeDepth++;
|
|
1161
|
+
var queue = ReactSharedInternals.actQueue = null !== prevActQueue ? prevActQueue : [], didAwaitActCall = false;
|
|
1162
|
+
try {
|
|
1163
|
+
var result = callback();
|
|
1164
|
+
} catch (error) {
|
|
1165
|
+
ReactSharedInternals.thrownErrors.push(error);
|
|
1166
|
+
}
|
|
1167
|
+
if (0 < ReactSharedInternals.thrownErrors.length)
|
|
1168
|
+
throw popActScope(prevActQueue, prevActScopeDepth), callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
|
|
1169
|
+
if (null !== result && "object" === typeof result && "function" === typeof result.then) {
|
|
1170
|
+
var thenable = result;
|
|
1171
|
+
queueSeveralMicrotasks(function() {
|
|
1172
|
+
didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error(
|
|
1173
|
+
"You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"
|
|
1174
|
+
));
|
|
1175
|
+
});
|
|
1176
|
+
return {
|
|
1177
|
+
then: /* @__PURE__ */ __name(function(resolve2, reject) {
|
|
1178
|
+
didAwaitActCall = true;
|
|
1179
|
+
thenable.then(
|
|
1180
|
+
function(returnValue) {
|
|
1181
|
+
popActScope(prevActQueue, prevActScopeDepth);
|
|
1182
|
+
if (0 === prevActScopeDepth) {
|
|
1183
|
+
try {
|
|
1184
|
+
flushActQueue(queue), enqueueTask(function() {
|
|
1185
|
+
return recursivelyFlushAsyncActWork(
|
|
1186
|
+
returnValue,
|
|
1187
|
+
resolve2,
|
|
1188
|
+
reject
|
|
1189
|
+
);
|
|
1190
|
+
});
|
|
1191
|
+
} catch (error$0) {
|
|
1192
|
+
ReactSharedInternals.thrownErrors.push(error$0);
|
|
1193
|
+
}
|
|
1194
|
+
if (0 < ReactSharedInternals.thrownErrors.length) {
|
|
1195
|
+
var _thrownError = aggregateErrors(
|
|
1196
|
+
ReactSharedInternals.thrownErrors
|
|
1197
|
+
);
|
|
1198
|
+
ReactSharedInternals.thrownErrors.length = 0;
|
|
1199
|
+
reject(_thrownError);
|
|
1200
|
+
}
|
|
1201
|
+
} else resolve2(returnValue);
|
|
1202
|
+
},
|
|
1203
|
+
function(error) {
|
|
1204
|
+
popActScope(prevActQueue, prevActScopeDepth);
|
|
1205
|
+
0 < ReactSharedInternals.thrownErrors.length ? (error = aggregateErrors(
|
|
1206
|
+
ReactSharedInternals.thrownErrors
|
|
1207
|
+
), ReactSharedInternals.thrownErrors.length = 0, reject(error)) : reject(error);
|
|
1208
|
+
}
|
|
1209
|
+
);
|
|
1210
|
+
}, "then")
|
|
1211
|
+
};
|
|
1212
|
+
}
|
|
1213
|
+
var returnValue$jscomp$0 = result;
|
|
1214
|
+
popActScope(prevActQueue, prevActScopeDepth);
|
|
1215
|
+
0 === prevActScopeDepth && (flushActQueue(queue), 0 !== queue.length && queueSeveralMicrotasks(function() {
|
|
1216
|
+
didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error(
|
|
1217
|
+
"A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"
|
|
1218
|
+
));
|
|
1219
|
+
}), ReactSharedInternals.actQueue = null);
|
|
1220
|
+
if (0 < ReactSharedInternals.thrownErrors.length)
|
|
1221
|
+
throw callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
|
|
1222
|
+
return {
|
|
1223
|
+
then: /* @__PURE__ */ __name(function(resolve2, reject) {
|
|
1224
|
+
didAwaitActCall = true;
|
|
1225
|
+
0 === prevActScopeDepth ? (ReactSharedInternals.actQueue = queue, enqueueTask(function() {
|
|
1226
|
+
return recursivelyFlushAsyncActWork(
|
|
1227
|
+
returnValue$jscomp$0,
|
|
1228
|
+
resolve2,
|
|
1229
|
+
reject
|
|
1230
|
+
);
|
|
1231
|
+
})) : resolve2(returnValue$jscomp$0);
|
|
1232
|
+
}, "then")
|
|
1233
|
+
};
|
|
1234
|
+
};
|
|
1235
|
+
exports.cache = function(fn) {
|
|
1236
|
+
return function() {
|
|
1237
|
+
return fn.apply(null, arguments);
|
|
1238
|
+
};
|
|
1239
|
+
};
|
|
1240
|
+
exports.cacheSignal = function() {
|
|
1241
|
+
return null;
|
|
1242
|
+
};
|
|
1243
|
+
exports.captureOwnerStack = function() {
|
|
1244
|
+
var getCurrentStack = ReactSharedInternals.getCurrentStack;
|
|
1245
|
+
return null === getCurrentStack ? null : getCurrentStack();
|
|
1246
|
+
};
|
|
1247
|
+
exports.cloneElement = function(element, config, children) {
|
|
1248
|
+
if (null === element || void 0 === element)
|
|
1249
|
+
throw Error(
|
|
1250
|
+
"The argument must be a React element, but you passed " + element + "."
|
|
1251
|
+
);
|
|
1252
|
+
var props = assign({}, element.props), key = element.key, owner = element._owner;
|
|
1253
|
+
if (null != config) {
|
|
1254
|
+
var JSCompiler_inline_result;
|
|
1255
|
+
a: {
|
|
1256
|
+
if (hasOwnProperty.call(config, "ref") && (JSCompiler_inline_result = Object.getOwnPropertyDescriptor(
|
|
1257
|
+
config,
|
|
1258
|
+
"ref"
|
|
1259
|
+
).get) && JSCompiler_inline_result.isReactWarning) {
|
|
1260
|
+
JSCompiler_inline_result = false;
|
|
1261
|
+
break a;
|
|
1262
|
+
}
|
|
1263
|
+
JSCompiler_inline_result = void 0 !== config.ref;
|
|
1264
|
+
}
|
|
1265
|
+
JSCompiler_inline_result && (owner = getOwner());
|
|
1266
|
+
hasValidKey(config) && (checkKeyStringCoercion(config.key), key = "" + config.key);
|
|
1267
|
+
for (propName in config)
|
|
1268
|
+
!hasOwnProperty.call(config, propName) || "key" === propName || "__self" === propName || "__source" === propName || "ref" === propName && void 0 === config.ref || (props[propName] = config[propName]);
|
|
1269
|
+
}
|
|
1270
|
+
var propName = arguments.length - 2;
|
|
1271
|
+
if (1 === propName) props.children = children;
|
|
1272
|
+
else if (1 < propName) {
|
|
1273
|
+
JSCompiler_inline_result = Array(propName);
|
|
1274
|
+
for (var i = 0; i < propName; i++)
|
|
1275
|
+
JSCompiler_inline_result[i] = arguments[i + 2];
|
|
1276
|
+
props.children = JSCompiler_inline_result;
|
|
1277
|
+
}
|
|
1278
|
+
props = ReactElement(
|
|
1279
|
+
element.type,
|
|
1280
|
+
key,
|
|
1281
|
+
props,
|
|
1282
|
+
owner,
|
|
1283
|
+
element._debugStack,
|
|
1284
|
+
element._debugTask
|
|
1285
|
+
);
|
|
1286
|
+
for (key = 2; key < arguments.length; key++)
|
|
1287
|
+
validateChildKeys(arguments[key]);
|
|
1288
|
+
return props;
|
|
1289
|
+
};
|
|
1290
|
+
exports.createContext = function(defaultValue) {
|
|
1291
|
+
defaultValue = {
|
|
1292
|
+
$$typeof: REACT_CONTEXT_TYPE,
|
|
1293
|
+
_currentValue: defaultValue,
|
|
1294
|
+
_currentValue2: defaultValue,
|
|
1295
|
+
_threadCount: 0,
|
|
1296
|
+
Provider: null,
|
|
1297
|
+
Consumer: null
|
|
1298
|
+
};
|
|
1299
|
+
defaultValue.Provider = defaultValue;
|
|
1300
|
+
defaultValue.Consumer = {
|
|
1301
|
+
$$typeof: REACT_CONSUMER_TYPE,
|
|
1302
|
+
_context: defaultValue
|
|
1303
|
+
};
|
|
1304
|
+
defaultValue._currentRenderer = null;
|
|
1305
|
+
defaultValue._currentRenderer2 = null;
|
|
1306
|
+
return defaultValue;
|
|
1307
|
+
};
|
|
1308
|
+
exports.createElement = function(type, config, children) {
|
|
1309
|
+
for (var i = 2; i < arguments.length; i++)
|
|
1310
|
+
validateChildKeys(arguments[i]);
|
|
1311
|
+
i = {};
|
|
1312
|
+
var key = null;
|
|
1313
|
+
if (null != config)
|
|
1314
|
+
for (propName in didWarnAboutOldJSXRuntime || !("__self" in config) || "key" in config || (didWarnAboutOldJSXRuntime = true, console.warn(
|
|
1315
|
+
"Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform"
|
|
1316
|
+
)), hasValidKey(config) && (checkKeyStringCoercion(config.key), key = "" + config.key), config)
|
|
1317
|
+
hasOwnProperty.call(config, propName) && "key" !== propName && "__self" !== propName && "__source" !== propName && (i[propName] = config[propName]);
|
|
1318
|
+
var childrenLength = arguments.length - 2;
|
|
1319
|
+
if (1 === childrenLength) i.children = children;
|
|
1320
|
+
else if (1 < childrenLength) {
|
|
1321
|
+
for (var childArray = Array(childrenLength), _i = 0; _i < childrenLength; _i++)
|
|
1322
|
+
childArray[_i] = arguments[_i + 2];
|
|
1323
|
+
Object.freeze && Object.freeze(childArray);
|
|
1324
|
+
i.children = childArray;
|
|
1325
|
+
}
|
|
1326
|
+
if (type && type.defaultProps)
|
|
1327
|
+
for (propName in childrenLength = type.defaultProps, childrenLength)
|
|
1328
|
+
void 0 === i[propName] && (i[propName] = childrenLength[propName]);
|
|
1329
|
+
key && defineKeyPropWarningGetter(
|
|
1330
|
+
i,
|
|
1331
|
+
"function" === typeof type ? type.displayName || type.name || "Unknown" : type
|
|
1332
|
+
);
|
|
1333
|
+
var propName = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
1334
|
+
return ReactElement(
|
|
1335
|
+
type,
|
|
1336
|
+
key,
|
|
1337
|
+
i,
|
|
1338
|
+
getOwner(),
|
|
1339
|
+
propName ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
|
|
1340
|
+
propName ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
|
1341
|
+
);
|
|
1342
|
+
};
|
|
1343
|
+
exports.createRef = function() {
|
|
1344
|
+
var refObject = { current: null };
|
|
1345
|
+
Object.seal(refObject);
|
|
1346
|
+
return refObject;
|
|
1347
|
+
};
|
|
1348
|
+
exports.forwardRef = function(render) {
|
|
1349
|
+
null != render && render.$$typeof === REACT_MEMO_TYPE ? console.error(
|
|
1350
|
+
"forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."
|
|
1351
|
+
) : "function" !== typeof render ? console.error(
|
|
1352
|
+
"forwardRef requires a render function but was given %s.",
|
|
1353
|
+
null === render ? "null" : typeof render
|
|
1354
|
+
) : 0 !== render.length && 2 !== render.length && console.error(
|
|
1355
|
+
"forwardRef render functions accept exactly two parameters: props and ref. %s",
|
|
1356
|
+
1 === render.length ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined."
|
|
1357
|
+
);
|
|
1358
|
+
null != render && null != render.defaultProps && console.error(
|
|
1359
|
+
"forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?"
|
|
1360
|
+
);
|
|
1361
|
+
var elementType = { $$typeof: REACT_FORWARD_REF_TYPE, render }, ownName;
|
|
1362
|
+
Object.defineProperty(elementType, "displayName", {
|
|
1363
|
+
enumerable: false,
|
|
1364
|
+
configurable: true,
|
|
1365
|
+
get: /* @__PURE__ */ __name(function() {
|
|
1366
|
+
return ownName;
|
|
1367
|
+
}, "get"),
|
|
1368
|
+
set: /* @__PURE__ */ __name(function(name) {
|
|
1369
|
+
ownName = name;
|
|
1370
|
+
render.name || render.displayName || (Object.defineProperty(render, "name", { value: name }), render.displayName = name);
|
|
1371
|
+
}, "set")
|
|
1372
|
+
});
|
|
1373
|
+
return elementType;
|
|
1374
|
+
};
|
|
1375
|
+
exports.isValidElement = isValidElement;
|
|
1376
|
+
exports.lazy = function(ctor) {
|
|
1377
|
+
ctor = { _status: -1, _result: ctor };
|
|
1378
|
+
var lazyType = {
|
|
1379
|
+
$$typeof: REACT_LAZY_TYPE,
|
|
1380
|
+
_payload: ctor,
|
|
1381
|
+
_init: lazyInitializer
|
|
1382
|
+
}, ioInfo = {
|
|
1383
|
+
name: "lazy",
|
|
1384
|
+
start: -1,
|
|
1385
|
+
end: -1,
|
|
1386
|
+
value: null,
|
|
1387
|
+
owner: null,
|
|
1388
|
+
debugStack: Error("react-stack-top-frame"),
|
|
1389
|
+
debugTask: console.createTask ? console.createTask("lazy()") : null
|
|
1390
|
+
};
|
|
1391
|
+
ctor._ioInfo = ioInfo;
|
|
1392
|
+
lazyType._debugInfo = [{ awaited: ioInfo }];
|
|
1393
|
+
return lazyType;
|
|
1394
|
+
};
|
|
1395
|
+
exports.memo = function(type, compare) {
|
|
1396
|
+
null == type && console.error(
|
|
1397
|
+
"memo: The first argument must be a component. Instead received: %s",
|
|
1398
|
+
null === type ? "null" : typeof type
|
|
1399
|
+
);
|
|
1400
|
+
compare = {
|
|
1401
|
+
$$typeof: REACT_MEMO_TYPE,
|
|
1402
|
+
type,
|
|
1403
|
+
compare: void 0 === compare ? null : compare
|
|
1404
|
+
};
|
|
1405
|
+
var ownName;
|
|
1406
|
+
Object.defineProperty(compare, "displayName", {
|
|
1407
|
+
enumerable: false,
|
|
1408
|
+
configurable: true,
|
|
1409
|
+
get: /* @__PURE__ */ __name(function() {
|
|
1410
|
+
return ownName;
|
|
1411
|
+
}, "get"),
|
|
1412
|
+
set: /* @__PURE__ */ __name(function(name) {
|
|
1413
|
+
ownName = name;
|
|
1414
|
+
type.name || type.displayName || (Object.defineProperty(type, "name", { value: name }), type.displayName = name);
|
|
1415
|
+
}, "set")
|
|
1416
|
+
});
|
|
1417
|
+
return compare;
|
|
1418
|
+
};
|
|
1419
|
+
exports.startTransition = function(scope) {
|
|
1420
|
+
var prevTransition = ReactSharedInternals.T, currentTransition = {};
|
|
1421
|
+
currentTransition._updatedFibers = /* @__PURE__ */ new Set();
|
|
1422
|
+
ReactSharedInternals.T = currentTransition;
|
|
1423
|
+
try {
|
|
1424
|
+
var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S;
|
|
1425
|
+
null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
|
|
1426
|
+
"object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && (ReactSharedInternals.asyncTransitions++, returnValue.then(releaseAsyncTransition, releaseAsyncTransition), returnValue.then(noop, reportGlobalError));
|
|
1427
|
+
} catch (error) {
|
|
1428
|
+
reportGlobalError(error);
|
|
1429
|
+
} finally {
|
|
1430
|
+
null === prevTransition && currentTransition._updatedFibers && (scope = currentTransition._updatedFibers.size, currentTransition._updatedFibers.clear(), 10 < scope && console.warn(
|
|
1431
|
+
"Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."
|
|
1432
|
+
)), null !== prevTransition && null !== currentTransition.types && (null !== prevTransition.types && prevTransition.types !== currentTransition.types && console.error(
|
|
1433
|
+
"We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."
|
|
1434
|
+
), prevTransition.types = currentTransition.types), ReactSharedInternals.T = prevTransition;
|
|
1435
|
+
}
|
|
1436
|
+
};
|
|
1437
|
+
exports.unstable_useCacheRefresh = function() {
|
|
1438
|
+
return resolveDispatcher().useCacheRefresh();
|
|
1439
|
+
};
|
|
1440
|
+
exports.use = function(usable) {
|
|
1441
|
+
return resolveDispatcher().use(usable);
|
|
1442
|
+
};
|
|
1443
|
+
exports.useActionState = function(action, initialState, permalink) {
|
|
1444
|
+
return resolveDispatcher().useActionState(
|
|
1445
|
+
action,
|
|
1446
|
+
initialState,
|
|
1447
|
+
permalink
|
|
1448
|
+
);
|
|
1449
|
+
};
|
|
1450
|
+
exports.useCallback = function(callback, deps) {
|
|
1451
|
+
return resolveDispatcher().useCallback(callback, deps);
|
|
1452
|
+
};
|
|
1453
|
+
exports.useContext = function(Context) {
|
|
1454
|
+
var dispatcher = resolveDispatcher();
|
|
1455
|
+
Context.$$typeof === REACT_CONSUMER_TYPE && console.error(
|
|
1456
|
+
"Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"
|
|
1457
|
+
);
|
|
1458
|
+
return dispatcher.useContext(Context);
|
|
1459
|
+
};
|
|
1460
|
+
exports.useDebugValue = function(value, formatterFn) {
|
|
1461
|
+
return resolveDispatcher().useDebugValue(value, formatterFn);
|
|
1462
|
+
};
|
|
1463
|
+
exports.useDeferredValue = function(value, initialValue) {
|
|
1464
|
+
return resolveDispatcher().useDeferredValue(value, initialValue);
|
|
1465
|
+
};
|
|
1466
|
+
exports.useEffect = function(create, deps) {
|
|
1467
|
+
null == create && console.warn(
|
|
1468
|
+
"React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"
|
|
1469
|
+
);
|
|
1470
|
+
return resolveDispatcher().useEffect(create, deps);
|
|
1471
|
+
};
|
|
1472
|
+
exports.useEffectEvent = function(callback) {
|
|
1473
|
+
return resolveDispatcher().useEffectEvent(callback);
|
|
1474
|
+
};
|
|
1475
|
+
exports.useId = function() {
|
|
1476
|
+
return resolveDispatcher().useId();
|
|
1477
|
+
};
|
|
1478
|
+
exports.useImperativeHandle = function(ref, create, deps) {
|
|
1479
|
+
return resolveDispatcher().useImperativeHandle(ref, create, deps);
|
|
1480
|
+
};
|
|
1481
|
+
exports.useInsertionEffect = function(create, deps) {
|
|
1482
|
+
null == create && console.warn(
|
|
1483
|
+
"React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"
|
|
1484
|
+
);
|
|
1485
|
+
return resolveDispatcher().useInsertionEffect(create, deps);
|
|
1486
|
+
};
|
|
1487
|
+
exports.useLayoutEffect = function(create, deps) {
|
|
1488
|
+
null == create && console.warn(
|
|
1489
|
+
"React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"
|
|
1490
|
+
);
|
|
1491
|
+
return resolveDispatcher().useLayoutEffect(create, deps);
|
|
1492
|
+
};
|
|
1493
|
+
exports.useMemo = function(create, deps) {
|
|
1494
|
+
return resolveDispatcher().useMemo(create, deps);
|
|
1495
|
+
};
|
|
1496
|
+
exports.useOptimistic = function(passthrough, reducer) {
|
|
1497
|
+
return resolveDispatcher().useOptimistic(passthrough, reducer);
|
|
1498
|
+
};
|
|
1499
|
+
exports.useReducer = function(reducer, initialArg, init) {
|
|
1500
|
+
return resolveDispatcher().useReducer(reducer, initialArg, init);
|
|
1501
|
+
};
|
|
1502
|
+
exports.useRef = function(initialValue) {
|
|
1503
|
+
return resolveDispatcher().useRef(initialValue);
|
|
1504
|
+
};
|
|
1505
|
+
exports.useState = function(initialState) {
|
|
1506
|
+
return resolveDispatcher().useState(initialState);
|
|
1507
|
+
};
|
|
1508
|
+
exports.useSyncExternalStore = function(subscribe3, getSnapshot, getServerSnapshot) {
|
|
1509
|
+
return resolveDispatcher().useSyncExternalStore(
|
|
1510
|
+
subscribe3,
|
|
1511
|
+
getSnapshot,
|
|
1512
|
+
getServerSnapshot
|
|
1513
|
+
);
|
|
1514
|
+
};
|
|
1515
|
+
exports.useTransition = function() {
|
|
1516
|
+
return resolveDispatcher().useTransition();
|
|
1517
|
+
};
|
|
1518
|
+
exports.version = "19.2.6";
|
|
1519
|
+
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
1520
|
+
})();
|
|
1521
|
+
}
|
|
1522
|
+
});
|
|
1523
|
+
|
|
1524
|
+
// ../../node_modules/.pnpm/react@19.2.6/node_modules/react/index.js
|
|
1525
|
+
var require_react = __commonJS({
|
|
1526
|
+
"../../node_modules/.pnpm/react@19.2.6/node_modules/react/index.js"(exports, module) {
|
|
1527
|
+
"use strict";
|
|
1528
|
+
if (process.env.NODE_ENV === "production") {
|
|
1529
|
+
module.exports = require_react_production();
|
|
1530
|
+
} else {
|
|
1531
|
+
module.exports = require_react_development();
|
|
1532
|
+
}
|
|
1533
|
+
}
|
|
1534
|
+
});
|
|
1535
|
+
|
|
1536
|
+
// src/user-commands/store.ts
|
|
1537
|
+
import { readFileSync, readdirSync, realpathSync } from "node:fs";
|
|
1538
|
+
import { platform } from "node:os";
|
|
1539
|
+
import { join, resolve } from "node:path";
|
|
1540
|
+
var ARGUMENTS_TOKEN = "$ARGUMENTS";
|
|
1541
|
+
function userCommandsDir(home) {
|
|
1542
|
+
return join(namzuHomePath(home), "commands");
|
|
1543
|
+
}
|
|
1544
|
+
__name(userCommandsDir, "userCommandsDir");
|
|
1545
|
+
function projectCommandsDir(cwd = process.cwd()) {
|
|
1546
|
+
return join(cwd, ".namzu", "commands");
|
|
1547
|
+
}
|
|
1548
|
+
__name(projectCommandsDir, "projectCommandsDir");
|
|
1549
|
+
function readCommandsFrom(dir, source) {
|
|
1550
|
+
let files;
|
|
1551
|
+
try {
|
|
1552
|
+
files = readdirSync(dir, { withFileTypes: true }).filter((e) => e.isFile() && e.name.endsWith(".md")).map((e) => e.name);
|
|
1553
|
+
} catch {
|
|
1554
|
+
return [];
|
|
1555
|
+
}
|
|
1556
|
+
const out = [];
|
|
1557
|
+
for (const file of files) {
|
|
1558
|
+
const path = join(dir, file);
|
|
1559
|
+
const name = file.slice(0, -".md".length);
|
|
1560
|
+
let raw;
|
|
1561
|
+
try {
|
|
1562
|
+
raw = readFileSync(path, "utf8");
|
|
1563
|
+
} catch {
|
|
1564
|
+
continue;
|
|
1565
|
+
}
|
|
1566
|
+
try {
|
|
1567
|
+
if (!raw.trimStart().startsWith("---")) {
|
|
1568
|
+
out.push({ name, description: "(no description)", template: raw.trim(), path, source });
|
|
1569
|
+
continue;
|
|
1570
|
+
}
|
|
1571
|
+
const { values, body } = parseFrontmatter(raw, path);
|
|
1572
|
+
const description = values.description?.kind === "scalar" ? values.description.value : "(no description)";
|
|
1573
|
+
out.push({ name, description, template: body, path, source });
|
|
1574
|
+
} catch (err) {
|
|
1575
|
+
out.push({
|
|
1576
|
+
name,
|
|
1577
|
+
description: "(could not be read)",
|
|
1578
|
+
template: "",
|
|
1579
|
+
path,
|
|
1580
|
+
source,
|
|
1581
|
+
problem: err instanceof Error ? err.message : String(err)
|
|
1582
|
+
});
|
|
1583
|
+
}
|
|
1584
|
+
}
|
|
1585
|
+
return out;
|
|
1586
|
+
}
|
|
1587
|
+
__name(readCommandsFrom, "readCommandsFrom");
|
|
1588
|
+
function discoverUserCommands(opts = {}) {
|
|
1589
|
+
const reserved = new Set(opts.reserved ?? []);
|
|
1590
|
+
const userDir = userCommandsDir(opts.home);
|
|
1591
|
+
const projectDir = projectCommandsDir(opts.cwd);
|
|
1592
|
+
const user = readCommandsFrom(userDir, "user");
|
|
1593
|
+
const project = samePhysicalDirectory(userDir, projectDir) ? [] : readCommandsFrom(projectDir, "project");
|
|
1594
|
+
const byName = /* @__PURE__ */ new Map();
|
|
1595
|
+
for (const c of user) byName.set(c.name, c);
|
|
1596
|
+
for (const c of project) byName.set(c.name, c);
|
|
1597
|
+
return [...byName.values()].map(
|
|
1598
|
+
(c) => reserved.has(c.name) ? { ...c, problem: `"/${c.name}" is a built-in command, so this file is not used.` } : c
|
|
1599
|
+
).sort((a, b) => a.name.localeCompare(b.name));
|
|
1600
|
+
}
|
|
1601
|
+
__name(discoverUserCommands, "discoverUserCommands");
|
|
1602
|
+
function samePhysicalDirectory(left, right) {
|
|
1603
|
+
const canonical = /* @__PURE__ */ __name((path) => {
|
|
1604
|
+
let value;
|
|
1605
|
+
try {
|
|
1606
|
+
value = realpathSync(path);
|
|
1607
|
+
} catch {
|
|
1608
|
+
value = resolve(path);
|
|
1609
|
+
}
|
|
1610
|
+
return platform() === "win32" ? value.toLocaleLowerCase("en-US") : value;
|
|
1611
|
+
}, "canonical");
|
|
1612
|
+
return canonical(left) === canonical(right);
|
|
1613
|
+
}
|
|
1614
|
+
__name(samePhysicalDirectory, "samePhysicalDirectory");
|
|
1615
|
+
function expandHeadlessCommand(prompt, opts = {}) {
|
|
1616
|
+
const trimmed = prompt.trim();
|
|
1617
|
+
if (!trimmed.startsWith("/")) return { kind: "unchanged", prompt };
|
|
1618
|
+
const [token, ...rest] = trimmed.slice(1).split(/\s+/);
|
|
1619
|
+
const name = token ?? "";
|
|
1620
|
+
if (!name) return { kind: "unchanged", prompt };
|
|
1621
|
+
const builtins = new Set(opts.builtins ?? []);
|
|
1622
|
+
if (rest.length === 0 && builtins.has(name)) {
|
|
1623
|
+
return {
|
|
1624
|
+
kind: "refused",
|
|
1625
|
+
reason: `/${name} is an interactive command and does nothing in \`namzu exec\`. Run \`namzu\` for the terminal agent, or pass a prompt instead.`,
|
|
1626
|
+
fixable: true
|
|
1627
|
+
};
|
|
1628
|
+
}
|
|
1629
|
+
const commands = discoverUserCommands({
|
|
1630
|
+
...opts.home !== void 0 ? { home: opts.home } : {},
|
|
1631
|
+
...opts.cwd !== void 0 ? { cwd: opts.cwd } : {},
|
|
1632
|
+
reserved: [...builtins]
|
|
1633
|
+
});
|
|
1634
|
+
const found = commands.find((c) => c.name === name);
|
|
1635
|
+
if (!found) return { kind: "unchanged", prompt };
|
|
1636
|
+
const expanded = expandCommand(found, rest.join(" "));
|
|
1637
|
+
return expanded.ok ? { kind: "expanded", prompt: expanded.prompt, name } : (
|
|
1638
|
+
// A command whose FILE is the problem is not fixable by sending a
|
|
1639
|
+
// different prompt. Taken from `found.problem` rather than from the
|
|
1640
|
+
// refusal reason, because that is where the fact lives — reading it back
|
|
1641
|
+
// out of the sentence would make the sentence unrewordable.
|
|
1642
|
+
{ kind: "refused", reason: expanded.reason, fixable: found.problem === void 0 }
|
|
1643
|
+
);
|
|
1644
|
+
}
|
|
1645
|
+
__name(expandHeadlessCommand, "expandHeadlessCommand");
|
|
1646
|
+
function expandCommand(command, args) {
|
|
1647
|
+
if (command.problem) return { ok: false, reason: command.problem };
|
|
1648
|
+
const trimmed = args.trim();
|
|
1649
|
+
if (command.template.includes(ARGUMENTS_TOKEN)) {
|
|
1650
|
+
return { ok: true, prompt: command.template.split(ARGUMENTS_TOKEN).join(trimmed) };
|
|
1651
|
+
}
|
|
1652
|
+
if (trimmed.length === 0) return { ok: true, prompt: command.template };
|
|
1653
|
+
return {
|
|
1654
|
+
ok: false,
|
|
1655
|
+
reason: [
|
|
1656
|
+
`/${command.name} takes no arguments, but you gave: ${trimmed}`,
|
|
1657
|
+
"",
|
|
1658
|
+
`Add ${ARGUMENTS_TOKEN} where they belong in ${command.path}, and they will be`,
|
|
1659
|
+
"substituted there. Running it now would silently discard them."
|
|
1660
|
+
].join("\n")
|
|
1661
|
+
};
|
|
1662
|
+
}
|
|
1663
|
+
__name(expandCommand, "expandCommand");
|
|
1664
|
+
|
|
1665
|
+
// src/installation.ts
|
|
1666
|
+
import { createHash } from "node:crypto";
|
|
1667
|
+
import { readFileSync as readFileSync2, readdirSync as readdirSync2 } from "node:fs";
|
|
1668
|
+
import { dirname, join as join2, relative } from "node:path";
|
|
1669
|
+
import { fileURLToPath } from "node:url";
|
|
1670
|
+
function fingerprintCli(directory) {
|
|
1671
|
+
const hash = createHash("sha256");
|
|
1672
|
+
const visit = /* @__PURE__ */ __name((folder) => {
|
|
1673
|
+
for (const entry of readdirSync2(folder, { withFileTypes: true }).sort(
|
|
1674
|
+
(a, b) => a.name.localeCompare(b.name, "en")
|
|
1675
|
+
)) {
|
|
1676
|
+
const path = join2(folder, entry.name);
|
|
1677
|
+
if (entry.isDirectory() && !["node_modules", "__tests__", "__fixtures__"].includes(entry.name))
|
|
1678
|
+
visit(path);
|
|
1679
|
+
else if (entry.isFile() && /\.(js|ts|tsx)$/.test(entry.name) && !/\.(d|test|proc-test)\.(js|ts|tsx)$/.test(entry.name)) {
|
|
1680
|
+
hash.update(relative(directory, path).replaceAll("\\", "/"));
|
|
1681
|
+
hash.update("\0");
|
|
1682
|
+
hash.update(readFileSync2(path));
|
|
1683
|
+
hash.update("\0");
|
|
1684
|
+
}
|
|
1685
|
+
}
|
|
1686
|
+
}, "visit");
|
|
1687
|
+
visit(directory);
|
|
1688
|
+
return hash.digest("hex").slice(0, 16);
|
|
1689
|
+
}
|
|
1690
|
+
__name(fingerprintCli, "fingerprintCli");
|
|
1691
|
+
var cached;
|
|
1692
|
+
function installationRows() {
|
|
1693
|
+
if (cached) return cached;
|
|
1694
|
+
const directory = dirname(fileURLToPath(new URL("../", import.meta.url).href + "installation.js"));
|
|
1695
|
+
let fingerprint = "unavailable";
|
|
1696
|
+
try {
|
|
1697
|
+
fingerprint = fingerprintCli(directory);
|
|
1698
|
+
} catch {
|
|
1699
|
+
}
|
|
1700
|
+
cached = [
|
|
1701
|
+
["Version", CLI_VERSION],
|
|
1702
|
+
["Build", fingerprint],
|
|
1703
|
+
["Executable", join2(directory, (new URL("../", import.meta.url).href + "installation.js").endsWith(".ts") ? "bin.ts" : "bin.js")]
|
|
1704
|
+
];
|
|
1705
|
+
return cached;
|
|
1706
|
+
}
|
|
1707
|
+
__name(installationRows, "installationRows");
|
|
1708
|
+
|
|
1709
|
+
// src/tui/status-card.ts
|
|
1710
|
+
function statusCard(rows, columns = 80) {
|
|
1711
|
+
const width = Math.min(96, Math.max(12, columns - 6));
|
|
1712
|
+
const lines = rows.map(([label, value]) => `${label}: ${choiceDisplayText(value)}`);
|
|
1713
|
+
if (width < 30) return ["NAMZU / STATUS", ...lines].join("\n");
|
|
1714
|
+
const inside = width - 4;
|
|
1715
|
+
const title = "\u250C\u2500 NAMZU / STATUS ";
|
|
1716
|
+
const result = [`${title}${"\u2500".repeat(width - stringWidth(title) - 1)}\u2510`];
|
|
1717
|
+
for (const line of lines) {
|
|
1718
|
+
let text = "";
|
|
1719
|
+
let cells = 0;
|
|
1720
|
+
for (const { segment } of new Intl.Segmenter(void 0, { granularity: "grapheme" }).segment(
|
|
1721
|
+
line
|
|
1722
|
+
)) {
|
|
1723
|
+
const size = stringWidth(segment);
|
|
1724
|
+
if (cells + size > inside) {
|
|
1725
|
+
result.push(`\u2502 ${text}${" ".repeat(inside - cells)} \u2502`);
|
|
1726
|
+
text = " ";
|
|
1727
|
+
cells = 2;
|
|
1728
|
+
}
|
|
1729
|
+
text += segment;
|
|
1730
|
+
cells += size;
|
|
1731
|
+
}
|
|
1732
|
+
result.push(`\u2502 ${text}${" ".repeat(Math.max(0, inside - cells))} \u2502`);
|
|
1733
|
+
}
|
|
1734
|
+
result.push(`\u2514${"\u2500".repeat(width - 2)}\u2518`);
|
|
1735
|
+
return result.join("\n");
|
|
1736
|
+
}
|
|
1737
|
+
__name(statusCard, "statusCard");
|
|
1738
|
+
|
|
1739
|
+
// src/tui/turn-limits-settings.ts
|
|
1740
|
+
var TURN_LIMIT_FIELDS = [
|
|
1741
|
+
{
|
|
1742
|
+
name: "tokens",
|
|
1743
|
+
key: "tokenBudget",
|
|
1744
|
+
label: "Token budget",
|
|
1745
|
+
hint: "Whole tokens across the reply and its agents; 0 or unlimited removes the cap."
|
|
1746
|
+
},
|
|
1747
|
+
{
|
|
1748
|
+
name: "iterations",
|
|
1749
|
+
key: "maxIterations",
|
|
1750
|
+
label: "Model calls",
|
|
1751
|
+
hint: "Whole model calls per reply; 0 or unlimited removes the cap."
|
|
1752
|
+
},
|
|
1753
|
+
{
|
|
1754
|
+
name: "time",
|
|
1755
|
+
key: "timeoutMs",
|
|
1756
|
+
label: "Reply duration",
|
|
1757
|
+
hint: "Duration such as 30m, 2h or 1500ms; a bare number is milliseconds. 0 or unlimited removes the cap."
|
|
1758
|
+
}
|
|
1759
|
+
];
|
|
1760
|
+
function turnLimitsAction(args) {
|
|
1761
|
+
if (args.length === 0) return { kind: "turn-limits-picker" };
|
|
1762
|
+
if (args.length === 1 && args[0] === "unlimited")
|
|
1763
|
+
return { kind: "turn-limits-set", limits: resolveTurnGuards() };
|
|
1764
|
+
const field = TURN_LIMIT_FIELDS.find((field2) => field2.name === args[0]);
|
|
1765
|
+
if (field && args.length === 1) return { kind: "turn-limit-editor", key: field.key };
|
|
1766
|
+
if (field && args.length === 2) {
|
|
1767
|
+
try {
|
|
1768
|
+
const raw = (args[1] ?? "").toLowerCase();
|
|
1769
|
+
const duration = field.key === "timeoutMs" ? /^(\d+(?:\.\d+)?)(ms|s|m|h)$/.exec(raw) : null;
|
|
1770
|
+
const value = raw === "unlimited" ? 0 : duration ? Number(duration[1]) * ({ ms: 1, s: 1e3, m: 6e4, h: 36e5 }[duration[2] ?? "ms"] ?? 1) : /^\d+$/.test(raw) ? Number(raw) : Number.NaN;
|
|
1771
|
+
resolveTurnGuards({ [field.key]: value });
|
|
1772
|
+
return { kind: "turn-limits-set", limits: { [field.key]: value } };
|
|
1773
|
+
} catch {
|
|
1774
|
+
return {
|
|
1775
|
+
kind: "message",
|
|
1776
|
+
role: "system",
|
|
1777
|
+
content: `${field.label} was not changed: ${field.key === "timeoutMs" ? "use a time such as 90s, 5m or 2h" : "use a whole number"}, or 0 or unlimited for no limit. ${field.hint}`
|
|
1778
|
+
};
|
|
1779
|
+
}
|
|
1780
|
+
}
|
|
1781
|
+
return {
|
|
1782
|
+
kind: "message",
|
|
1783
|
+
role: "system",
|
|
1784
|
+
content: "Usage: /config limits [tokens|iterations|time] [value]; /config limits unlimited removes all three caps."
|
|
1785
|
+
};
|
|
1786
|
+
}
|
|
1787
|
+
__name(turnLimitsAction, "turnLimitsAction");
|
|
1788
|
+
function formatTurnLimit(key, value) {
|
|
1789
|
+
if (value === 0) return "Unlimited";
|
|
1790
|
+
if (key === "timeoutMs") {
|
|
1791
|
+
for (const [unit, divisor] of [
|
|
1792
|
+
["h", 36e5],
|
|
1793
|
+
["m", 6e4],
|
|
1794
|
+
["s", 1e3]
|
|
1795
|
+
])
|
|
1796
|
+
if (value % divisor === 0) return `${value / divisor}${unit}`;
|
|
1797
|
+
return `${value}ms`;
|
|
1798
|
+
}
|
|
1799
|
+
return value.toLocaleString("en-US");
|
|
1800
|
+
}
|
|
1801
|
+
__name(formatTurnLimit, "formatTurnLimit");
|
|
1802
|
+
function turnLimitCommands(limits) {
|
|
1803
|
+
return [
|
|
1804
|
+
...TURN_LIMIT_FIELDS.map((field) => ({
|
|
1805
|
+
name: `config limits ${field.name}`,
|
|
1806
|
+
label: field.label,
|
|
1807
|
+
description: formatTurnLimit(field.key, limits[field.key])
|
|
1808
|
+
})),
|
|
1809
|
+
{
|
|
1810
|
+
name: "config limits unlimited",
|
|
1811
|
+
label: "Remove all reply limits",
|
|
1812
|
+
description: "Unlimited tokens, model calls and duration. Usage is still measured."
|
|
1813
|
+
}
|
|
1814
|
+
];
|
|
1815
|
+
}
|
|
1816
|
+
__name(turnLimitCommands, "turnLimitCommands");
|
|
1817
|
+
|
|
1818
|
+
// src/release-notes.ts
|
|
1819
|
+
import { readFileSync as readFileSync3 } from "node:fs";
|
|
1820
|
+
import { dirname as dirname2, join as join3 } from "node:path";
|
|
1821
|
+
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
1822
|
+
function changelogSection(changelog, version) {
|
|
1823
|
+
const lines = changelog.split("\n");
|
|
1824
|
+
const start = lines.findIndex((line) => line.trim() === `## ${version}`);
|
|
1825
|
+
if (start === -1) return null;
|
|
1826
|
+
let end = lines.length;
|
|
1827
|
+
for (let i = start + 1; i < lines.length; i++) {
|
|
1828
|
+
if (lines[i]?.startsWith("## ")) {
|
|
1829
|
+
end = i;
|
|
1830
|
+
break;
|
|
1831
|
+
}
|
|
1832
|
+
}
|
|
1833
|
+
const body = lines.slice(start + 1, end).join("\n").trim();
|
|
1834
|
+
return { version, body };
|
|
1835
|
+
}
|
|
1836
|
+
__name(changelogSection, "changelogSection");
|
|
1837
|
+
function changelogVersions(changelog) {
|
|
1838
|
+
return changelog.split("\n").filter((line) => line.startsWith("## ")).map((line) => line.slice(3).trim());
|
|
1839
|
+
}
|
|
1840
|
+
__name(changelogVersions, "changelogVersions");
|
|
1841
|
+
function readChangelog() {
|
|
1842
|
+
try {
|
|
1843
|
+
const here = dirname2(fileURLToPath2(new URL("../", import.meta.url).href + "release-notes.js"));
|
|
1844
|
+
return readFileSync3(join3(here, "..", "CHANGELOG.md"), "utf8");
|
|
1845
|
+
} catch {
|
|
1846
|
+
return null;
|
|
1847
|
+
}
|
|
1848
|
+
}
|
|
1849
|
+
__name(readChangelog, "readChangelog");
|
|
1850
|
+
var RELEASE_NOTES_MAX_LINES = 80;
|
|
1851
|
+
function renderReleaseNotes(changelog, version = CLI_VERSION) {
|
|
1852
|
+
if (changelog === null) {
|
|
1853
|
+
return "No release notes: this install has no CHANGELOG.md beside its package.json.";
|
|
1854
|
+
}
|
|
1855
|
+
const section = changelogSection(changelog, version);
|
|
1856
|
+
if (!section) {
|
|
1857
|
+
const known = changelogVersions(changelog).slice(0, 8);
|
|
1858
|
+
return `No notes for ${version}. Versions with notes: ${known.join(", ")}${known.length < changelogVersions(changelog).length ? ", \u2026" : ""}.`;
|
|
1859
|
+
}
|
|
1860
|
+
const lines = section.body.split("\n");
|
|
1861
|
+
const shown = lines.slice(0, RELEASE_NOTES_MAX_LINES);
|
|
1862
|
+
const cut = lines.length > shown.length ? `
|
|
1863
|
+
\u2026 ${lines.length - shown.length} more lines in CHANGELOG.md` : "";
|
|
1864
|
+
return `@namzu/cli ${section.version}
|
|
1865
|
+
|
|
1866
|
+
${shown.join("\n")}${cut}`;
|
|
1867
|
+
}
|
|
1868
|
+
__name(renderReleaseNotes, "renderReleaseNotes");
|
|
1869
|
+
|
|
1870
|
+
// src/tui/motion.ts
|
|
1871
|
+
var import_react = __toESM(require_react(), 1);
|
|
1872
|
+
var reduced = false;
|
|
1873
|
+
var listeners = /* @__PURE__ */ new Set();
|
|
1874
|
+
function setReducedMotion(value) {
|
|
1875
|
+
if (reduced === value) return;
|
|
1876
|
+
reduced = value;
|
|
1877
|
+
for (const listener of [...listeners]) listener();
|
|
1878
|
+
}
|
|
1879
|
+
__name(setReducedMotion, "setReducedMotion");
|
|
1880
|
+
function reducedMotion() {
|
|
1881
|
+
return reduced;
|
|
1882
|
+
}
|
|
1883
|
+
__name(reducedMotion, "reducedMotion");
|
|
1884
|
+
function motionAllowed(env = process.env) {
|
|
1885
|
+
return !reduced && env.NO_COLOR === void 0 && env.FORCE_COLOR !== "0" && env.TERM !== "dumb";
|
|
1886
|
+
}
|
|
1887
|
+
__name(motionAllowed, "motionAllowed");
|
|
1888
|
+
function subscribe(listener) {
|
|
1889
|
+
listeners.add(listener);
|
|
1890
|
+
return () => listeners.delete(listener);
|
|
1891
|
+
}
|
|
1892
|
+
__name(subscribe, "subscribe");
|
|
1893
|
+
function useReducedMotion() {
|
|
1894
|
+
return (0, import_react.useSyncExternalStore)(
|
|
1895
|
+
subscribe,
|
|
1896
|
+
() => reduced,
|
|
1897
|
+
() => reduced
|
|
1898
|
+
);
|
|
1899
|
+
}
|
|
1900
|
+
__name(useReducedMotion, "useReducedMotion");
|
|
1901
|
+
|
|
1902
|
+
// src/tui/theme-store.ts
|
|
1903
|
+
var import_react2 = __toESM(require_react(), 1);
|
|
1904
|
+
|
|
1905
|
+
// src/tui/theme-detect.ts
|
|
1906
|
+
var BACKGROUND_QUERY = "\x1B]11;?\x07";
|
|
1907
|
+
function backgroundFromColorFgBg(value) {
|
|
1908
|
+
if (value === void 0) return void 0;
|
|
1909
|
+
const last = value.split(";").pop() ?? "";
|
|
1910
|
+
if (!/^\d{1,2}$/.test(last)) return void 0;
|
|
1911
|
+
const index = Number(last);
|
|
1912
|
+
if (index > 15) return void 0;
|
|
1913
|
+
return index <= 6 || index === 8 ? "dark" : "light";
|
|
1914
|
+
}
|
|
1915
|
+
__name(backgroundFromColorFgBg, "backgroundFromColorFgBg");
|
|
1916
|
+
function channel(hex) {
|
|
1917
|
+
if (!/^[0-9a-fA-F]{1,4}$/.test(hex)) return void 0;
|
|
1918
|
+
return Number.parseInt(hex, 16) / (16 ** hex.length - 1);
|
|
1919
|
+
}
|
|
1920
|
+
__name(channel, "channel");
|
|
1921
|
+
function parseBackgroundReply(reply) {
|
|
1922
|
+
const rgb = /rgb:([0-9a-fA-F]{1,4})\/([0-9a-fA-F]{1,4})\/([0-9a-fA-F]{1,4})/.exec(reply);
|
|
1923
|
+
let channels;
|
|
1924
|
+
if (rgb) channels = [channel(rgb[1] ?? ""), channel(rgb[2] ?? ""), channel(rgb[3] ?? "")];
|
|
1925
|
+
else {
|
|
1926
|
+
const hash = /#([0-9a-fA-F]{6})(?![0-9a-fA-F])/.exec(reply);
|
|
1927
|
+
if (hash) {
|
|
1928
|
+
const digits = hash[1] ?? "";
|
|
1929
|
+
channels = [
|
|
1930
|
+
channel(digits.slice(0, 2)),
|
|
1931
|
+
channel(digits.slice(2, 4)),
|
|
1932
|
+
channel(digits.slice(4, 6))
|
|
1933
|
+
];
|
|
1934
|
+
}
|
|
1935
|
+
}
|
|
1936
|
+
if (!channels) return void 0;
|
|
1937
|
+
const [r, g, b] = channels;
|
|
1938
|
+
if (r === void 0 || g === void 0 || b === void 0) return void 0;
|
|
1939
|
+
return 0.2126 * r + 0.7152 * g + 0.0722 * b > 0.5 ? "light" : "dark";
|
|
1940
|
+
}
|
|
1941
|
+
__name(parseBackgroundReply, "parseBackgroundReply");
|
|
1942
|
+
var COMPLETE_REPLY = /\u001b\]11;[^\u0007\u001b]*(?:\u0007|\u001b\\)/;
|
|
1943
|
+
function queryTerminalBackground(streams, giveUp) {
|
|
1944
|
+
const { input, output } = streams;
|
|
1945
|
+
if (input.isTTY !== true || output.isTTY !== true) return Promise.resolve(void 0);
|
|
1946
|
+
return new Promise((resolve2) => {
|
|
1947
|
+
const wasRaw = input.isRaw === true;
|
|
1948
|
+
let buffer = "";
|
|
1949
|
+
let settled = false;
|
|
1950
|
+
const finish = /* @__PURE__ */ __name((result) => {
|
|
1951
|
+
if (settled) return;
|
|
1952
|
+
settled = true;
|
|
1953
|
+
input.off("data", onData);
|
|
1954
|
+
if (!wasRaw) input.setRawMode?.(false);
|
|
1955
|
+
input.pause?.();
|
|
1956
|
+
resolve2(result);
|
|
1957
|
+
}, "finish");
|
|
1958
|
+
const onData = /* @__PURE__ */ __name((chunk) => {
|
|
1959
|
+
buffer += chunk.toString();
|
|
1960
|
+
const match = COMPLETE_REPLY.exec(buffer);
|
|
1961
|
+
if (match) finish(parseBackgroundReply(match[0]));
|
|
1962
|
+
}, "onData");
|
|
1963
|
+
input.on("data", onData);
|
|
1964
|
+
if (!wasRaw) input.setRawMode?.(true);
|
|
1965
|
+
input.resume?.();
|
|
1966
|
+
output.write(BACKGROUND_QUERY);
|
|
1967
|
+
void giveUp.then(() => finish(void 0));
|
|
1968
|
+
});
|
|
1969
|
+
}
|
|
1970
|
+
__name(queryTerminalBackground, "queryTerminalBackground");
|
|
1971
|
+
function detectBackground(reported2, env = process.env) {
|
|
1972
|
+
return reported2 ?? backgroundFromColorFgBg(env.COLORFGBG) ?? "dark";
|
|
1973
|
+
}
|
|
1974
|
+
__name(detectBackground, "detectBackground");
|
|
1975
|
+
|
|
1976
|
+
// src/tui/theme-store.ts
|
|
1977
|
+
var saved = "dark";
|
|
1978
|
+
var reported;
|
|
1979
|
+
var preview;
|
|
1980
|
+
var epoch = 0;
|
|
1981
|
+
var listeners2 = /* @__PURE__ */ new Set();
|
|
1982
|
+
var current = "dark";
|
|
1983
|
+
function recompute(env) {
|
|
1984
|
+
const shown = preview ?? saved;
|
|
1985
|
+
const detected = shown === "auto" ? detectBackground(reported, env) : void 0;
|
|
1986
|
+
const next = resolveTheme(shown, detected);
|
|
1987
|
+
if (next === current) return;
|
|
1988
|
+
current = next;
|
|
1989
|
+
applyPalette(next);
|
|
1990
|
+
epoch += 1;
|
|
1991
|
+
for (const listener of [...listeners2]) listener();
|
|
1992
|
+
}
|
|
1993
|
+
__name(recompute, "recompute");
|
|
1994
|
+
function setThemeSetting(setting, options = {}) {
|
|
1995
|
+
saved = setting;
|
|
1996
|
+
if (options.reported !== void 0) reported = options.reported;
|
|
1997
|
+
recompute(options.env ?? process.env);
|
|
1998
|
+
}
|
|
1999
|
+
__name(setThemeSetting, "setThemeSetting");
|
|
2000
|
+
function setThemePreview(setting, env = process.env) {
|
|
2001
|
+
preview = setting;
|
|
2002
|
+
recompute(env);
|
|
2003
|
+
}
|
|
2004
|
+
__name(setThemePreview, "setThemePreview");
|
|
2005
|
+
function savedThemeSetting() {
|
|
2006
|
+
return saved;
|
|
2007
|
+
}
|
|
2008
|
+
__name(savedThemeSetting, "savedThemeSetting");
|
|
2009
|
+
function shownTheme() {
|
|
2010
|
+
return current;
|
|
2011
|
+
}
|
|
2012
|
+
__name(shownTheme, "shownTheme");
|
|
2013
|
+
function subscribe2(listener) {
|
|
2014
|
+
listeners2.add(listener);
|
|
2015
|
+
return () => listeners2.delete(listener);
|
|
2016
|
+
}
|
|
2017
|
+
__name(subscribe2, "subscribe");
|
|
2018
|
+
var ThemeEpochContext = (0, import_react2.createContext)(0);
|
|
2019
|
+
function useThemeEpoch() {
|
|
2020
|
+
return (0, import_react2.useContext)(ThemeEpochContext);
|
|
2021
|
+
}
|
|
2022
|
+
__name(useThemeEpoch, "useThemeEpoch");
|
|
2023
|
+
function useThemeSubscription() {
|
|
2024
|
+
return (0, import_react2.useSyncExternalStore)(
|
|
2025
|
+
subscribe2,
|
|
2026
|
+
() => epoch,
|
|
2027
|
+
() => epoch
|
|
2028
|
+
);
|
|
2029
|
+
}
|
|
2030
|
+
__name(useThemeSubscription, "useThemeSubscription");
|
|
2031
|
+
|
|
2032
|
+
// src/tui/theme-command.ts
|
|
2033
|
+
function parseThemeArgument(args) {
|
|
2034
|
+
if (args.length !== 1) return void 0;
|
|
2035
|
+
return parseThemeSetting(args[0]?.toLowerCase());
|
|
2036
|
+
}
|
|
2037
|
+
__name(parseThemeArgument, "parseThemeArgument");
|
|
2038
|
+
var THEME_USAGE = `Usage: /theme [auto|${THEME_NAMES.join("|")}]`;
|
|
2039
|
+
function saveTheme(setting, opts = {}) {
|
|
2040
|
+
setThemeSetting(setting, opts.env ? { env: opts.env } : {});
|
|
2041
|
+
try {
|
|
2042
|
+
setUserConfigValue(["tui", "theme"], setting, opts);
|
|
2043
|
+
} catch (error) {
|
|
2044
|
+
return `${explainFailure(error, "Could not save that setting.")} The theme stays ${themeLabel(setting)} until Namzu closes.`;
|
|
2045
|
+
}
|
|
2046
|
+
return `Theme set to ${themeLabel(setting)}.`;
|
|
2047
|
+
}
|
|
2048
|
+
__name(saveTheme, "saveTheme");
|
|
2049
|
+
function saveReducedMotion(on, opts = {}) {
|
|
2050
|
+
setReducedMotion(on);
|
|
2051
|
+
const saying = on ? "Reduced motion is on: the working line and the composer stay still." : "Reduced motion is off.";
|
|
2052
|
+
try {
|
|
2053
|
+
setUserConfigValue(["tui", "reducedMotion"], on, opts);
|
|
2054
|
+
} catch (error) {
|
|
2055
|
+
return `${explainFailure(error, "Could not save that setting.")} ${saying} It lasts until Namzu closes.`;
|
|
2056
|
+
}
|
|
2057
|
+
return saying;
|
|
2058
|
+
}
|
|
2059
|
+
__name(saveReducedMotion, "saveReducedMotion");
|
|
2060
|
+
function describeReducedMotion() {
|
|
2061
|
+
return reducedMotion() ? "Reduced motion is on. /config motion off turns the movement back on." : "Reduced motion is off. /config motion on keeps the working line and the composer still.";
|
|
2062
|
+
}
|
|
2063
|
+
__name(describeReducedMotion, "describeReducedMotion");
|
|
2064
|
+
|
|
2065
|
+
// src/tui/slashCommands.ts
|
|
2066
|
+
function renameConversationAction(_ctx, args) {
|
|
2067
|
+
const text = args.join(" ").trim();
|
|
2068
|
+
if (text.toLowerCase() === "clear") return { kind: "title", title: "", clear: true };
|
|
2069
|
+
return { kind: "title", title: text, clear: false };
|
|
2070
|
+
}
|
|
2071
|
+
__name(renameConversationAction, "renameConversationAction");
|
|
2072
|
+
function matchSlashCommands(value, userCommands = [], builtins = CLI_LOCAL_COMMANDS) {
|
|
2073
|
+
const m = /^\/([\w-]*)$/.exec(value);
|
|
2074
|
+
if (!m) return [];
|
|
2075
|
+
const prefix = (m[1] ?? "").toLowerCase();
|
|
2076
|
+
const own = userCommands.map((c) => ({
|
|
2077
|
+
name: c.name,
|
|
2078
|
+
description: c.problem ? `Unavailable: ${c.problem}` : c.description,
|
|
2079
|
+
action: /* @__PURE__ */ __name(() => ({ kind: "none" }), "action")
|
|
2080
|
+
}));
|
|
2081
|
+
const matches = [...builtins.filter((command) => command.discoverable !== false), ...own].filter(
|
|
2082
|
+
(command) => command.name.startsWith(prefix)
|
|
2083
|
+
);
|
|
2084
|
+
if (prefix.length === 0) return matches;
|
|
2085
|
+
const exact = matches.findIndex((command) => command.name === prefix);
|
|
2086
|
+
if (exact <= 0) return matches;
|
|
2087
|
+
const exactMatch = matches[exact];
|
|
2088
|
+
if (!exactMatch) return matches;
|
|
2089
|
+
return [exactMatch, ...matches.slice(0, exact), ...matches.slice(exact + 1)];
|
|
2090
|
+
}
|
|
2091
|
+
__name(matchSlashCommands, "matchSlashCommands");
|
|
2092
|
+
var CommandNameCollisionError = class extends RegistryCollisionError {
|
|
2093
|
+
static {
|
|
2094
|
+
__name(this, "CommandNameCollisionError");
|
|
2095
|
+
}
|
|
2096
|
+
constructor(name) {
|
|
2097
|
+
super(
|
|
2098
|
+
"SlashCommands",
|
|
2099
|
+
name,
|
|
2100
|
+
`/${name} is registered by the kernel AND by this host. One of them would silently never run, and which depends on merge order \u2014 rename one.`
|
|
2101
|
+
);
|
|
2102
|
+
this.name = "CommandNameCollisionError";
|
|
2103
|
+
}
|
|
2104
|
+
};
|
|
2105
|
+
var HOST_OWNED_COMMAND_NAMES = ["skills", "agents", "goal"];
|
|
2106
|
+
function mergeHostCommands(descriptors, locals = CLI_LOCAL_COMMANDS) {
|
|
2107
|
+
const localNames = new Set(locals.map((c) => c.name));
|
|
2108
|
+
const owned = new Set(HOST_OWNED_COMMAND_NAMES);
|
|
2109
|
+
const fromKernel = descriptors.filter((descriptor) => !owned.has(descriptor.name));
|
|
2110
|
+
for (const descriptor of fromKernel) {
|
|
2111
|
+
if (localNames.has(descriptor.name)) throw new CommandNameCollisionError(descriptor.name);
|
|
2112
|
+
}
|
|
2113
|
+
return [
|
|
2114
|
+
...locals,
|
|
2115
|
+
...fromKernel.map(
|
|
2116
|
+
(descriptor) => ({
|
|
2117
|
+
name: descriptor.name,
|
|
2118
|
+
description: descriptor.description,
|
|
2119
|
+
help: {
|
|
2120
|
+
// An arbitrary JSON Schema does not declare positional CLI syntax.
|
|
2121
|
+
usage: [`/${descriptor.name}${descriptor.args ? " [arguments]" : ""}`],
|
|
2122
|
+
...descriptor.hint ? { details: [descriptor.hint] } : {}
|
|
2123
|
+
},
|
|
2124
|
+
action: /* @__PURE__ */ __name((_ctx, args) => ({
|
|
2125
|
+
kind: "host-command",
|
|
2126
|
+
name: descriptor.name,
|
|
2127
|
+
args
|
|
2128
|
+
}), "action")
|
|
2129
|
+
})
|
|
2130
|
+
)
|
|
2131
|
+
];
|
|
2132
|
+
}
|
|
2133
|
+
__name(mergeHostCommands, "mergeHostCommands");
|
|
2134
|
+
function renderOutcome(outcome) {
|
|
2135
|
+
switch (outcome.kind) {
|
|
2136
|
+
case "ack":
|
|
2137
|
+
return outcome.message;
|
|
2138
|
+
case "prompt":
|
|
2139
|
+
return outcome.text;
|
|
2140
|
+
case "refused":
|
|
2141
|
+
return outcome.reason;
|
|
2142
|
+
case "report": {
|
|
2143
|
+
if (outcome.rows.length === 0) return `${outcome.title}: none.`;
|
|
2144
|
+
const columns = [...new Set(outcome.rows.flatMap((r) => Object.keys(r)))];
|
|
2145
|
+
return [
|
|
2146
|
+
`${outcome.title} (${outcome.rows.length}):`,
|
|
2147
|
+
...outcome.rows.map(
|
|
2148
|
+
(row) => ` ${columns.map((c) => row[c] === null || row[c] === void 0 ? "-" : String(row[c])).join(" ")}`
|
|
2149
|
+
)
|
|
2150
|
+
].join("\n");
|
|
2151
|
+
}
|
|
2152
|
+
}
|
|
2153
|
+
}
|
|
2154
|
+
__name(renderOutcome, "renderOutcome");
|
|
2155
|
+
function hostCommandNames(descriptors = kernelCommandDescriptors(), locals = CLI_LOCAL_COMMANDS) {
|
|
2156
|
+
return mergeHostCommands(descriptors, locals).map((c) => c.name);
|
|
2157
|
+
}
|
|
2158
|
+
__name(hostCommandNames, "hostCommandNames");
|
|
2159
|
+
function kernelCommandDescriptors() {
|
|
2160
|
+
return kernelHostCommands({}).map(({ handler: _handler, ...rest }) => rest);
|
|
2161
|
+
}
|
|
2162
|
+
__name(kernelCommandDescriptors, "kernelCommandDescriptors");
|
|
2163
|
+
function parseSlash(line) {
|
|
2164
|
+
const trimmed = line.trim();
|
|
2165
|
+
if (!trimmed.startsWith("/")) return null;
|
|
2166
|
+
const [name, ...args] = trimmed.slice(1).split(/\s+/);
|
|
2167
|
+
if (!name) return null;
|
|
2168
|
+
return { name, args };
|
|
2169
|
+
}
|
|
2170
|
+
__name(parseSlash, "parseSlash");
|
|
2171
|
+
function commandHelp(ctx, args) {
|
|
2172
|
+
const name = args[0]?.replace(/^\//, "");
|
|
2173
|
+
if (args.length !== 1 || !name) {
|
|
2174
|
+
return {
|
|
2175
|
+
kind: "message",
|
|
2176
|
+
role: "system",
|
|
2177
|
+
content: "Usage: /help [command]. For example: /help permissions."
|
|
2178
|
+
};
|
|
2179
|
+
}
|
|
2180
|
+
const command = (ctx.builtins ?? CLI_LOCAL_COMMANDS).find((entry) => entry.name === name);
|
|
2181
|
+
if (command) {
|
|
2182
|
+
const reason = command.unavailable?.(ctx);
|
|
2183
|
+
return {
|
|
2184
|
+
kind: "message",
|
|
2185
|
+
role: "system",
|
|
2186
|
+
content: [
|
|
2187
|
+
`/${command.name}`,
|
|
2188
|
+
command.description,
|
|
2189
|
+
"",
|
|
2190
|
+
"Usage:",
|
|
2191
|
+
...(command.help?.usage ?? [`/${command.name}`]).map((usage) => ` ${usage}`),
|
|
2192
|
+
...command.help?.details?.length ? ["", ...command.help.details] : [],
|
|
2193
|
+
...reason ? ["", `Unavailable: ${reason}`] : []
|
|
2194
|
+
].join("\n")
|
|
2195
|
+
};
|
|
2196
|
+
}
|
|
2197
|
+
const user = ctx.userCommands.find((entry) => entry.name === name);
|
|
2198
|
+
if (user) {
|
|
2199
|
+
const acceptsArguments = user.template.includes(ARGUMENTS_TOKEN);
|
|
2200
|
+
return {
|
|
2201
|
+
kind: "message",
|
|
2202
|
+
role: "system",
|
|
2203
|
+
content: [
|
|
2204
|
+
`/${user.name}`,
|
|
2205
|
+
user.description,
|
|
2206
|
+
"",
|
|
2207
|
+
...user.problem ? [] : [
|
|
2208
|
+
"Usage:",
|
|
2209
|
+
` /${user.name}${acceptsArguments ? " [arguments]" : ""}`,
|
|
2210
|
+
"",
|
|
2211
|
+
"Running this command sends its saved prompt to the model."
|
|
2212
|
+
],
|
|
2213
|
+
`${user.source === "project" ? "Project command" : "User command (all projects)"}: ${user.path}`,
|
|
2214
|
+
...user.problem ? [`Unavailable: ${user.problem}`] : []
|
|
2215
|
+
].join("\n")
|
|
2216
|
+
};
|
|
2217
|
+
}
|
|
2218
|
+
return {
|
|
2219
|
+
kind: "message",
|
|
2220
|
+
role: "system",
|
|
2221
|
+
content: `Unknown command: /${name}. Use /help to browse available commands.`
|
|
2222
|
+
};
|
|
2223
|
+
}
|
|
2224
|
+
__name(commandHelp, "commandHelp");
|
|
2225
|
+
var CLI_LOCAL_COMMANDS = [
|
|
2226
|
+
{
|
|
2227
|
+
name: "setup",
|
|
2228
|
+
description: "Check provider installation and access; install optional CLIs or connect.",
|
|
2229
|
+
action: /* @__PURE__ */ __name(() => ({ kind: "provider-setup" }), "action")
|
|
2230
|
+
},
|
|
2231
|
+
{
|
|
2232
|
+
name: "config",
|
|
2233
|
+
description: "View or change model, reasoning, permissions and limits.",
|
|
2234
|
+
help: {
|
|
2235
|
+
usage: [
|
|
2236
|
+
"/config",
|
|
2237
|
+
"/config sources",
|
|
2238
|
+
"/config limits [tokens|iterations|time] [value]",
|
|
2239
|
+
"/config limits unlimited",
|
|
2240
|
+
"/config triggers [on|off|list]",
|
|
2241
|
+
"/config theme [auto|dark|light|dark-daltonized|light-daltonized|dark-ansi|light-ansi]",
|
|
2242
|
+
"/config motion [on|off|list]",
|
|
2243
|
+
"/config recap [on|off|list]",
|
|
2244
|
+
"/config tips [on|off|list]"
|
|
2245
|
+
],
|
|
2246
|
+
details: [
|
|
2247
|
+
'/config triggers off stops words in a message (hypermode, "save this as a skill") from acting for that message, in your user config; /config triggers on turns them back on; /config triggers lists what is in force.',
|
|
2248
|
+
"/config recap off stops the one-line recap shown when you come back after a few minutes away, in your user config; /config recap on turns it back on.",
|
|
2249
|
+
"/config theme picks the colours with a preview, the same as /theme; /config theme light sets one by name.",
|
|
2250
|
+
"/config motion on keeps the working line and the composer still, in your user config; /config motion off lets them move again.",
|
|
2251
|
+
"/config tips off hides the tip under the working row, in your user config; /config tips on shows it again. The next task still shows."
|
|
2252
|
+
]
|
|
2253
|
+
},
|
|
2254
|
+
action: /* @__PURE__ */ __name((ctx, args) => {
|
|
2255
|
+
if (args.length === 0) return { kind: "settings-picker" };
|
|
2256
|
+
if (args[0] === "limits") return turnLimitsAction(args.slice(1));
|
|
2257
|
+
if (args[0] === "motion") {
|
|
2258
|
+
const setting = (args[1] ?? "list").toLowerCase();
|
|
2259
|
+
if (args.length <= 2 && (setting === "on" || setting === "off" || setting === "list"))
|
|
2260
|
+
return { kind: "reduced-motion", setting };
|
|
2261
|
+
return { kind: "message", role: "system", content: "Usage: /config motion [on|off|list]" };
|
|
2262
|
+
}
|
|
2263
|
+
if (args[0] === "tips") {
|
|
2264
|
+
const setting = (args[1] ?? "list").toLowerCase();
|
|
2265
|
+
if (args.length <= 2 && (setting === "on" || setting === "off"))
|
|
2266
|
+
return { kind: "spinner-tips", on: setting === "on" };
|
|
2267
|
+
if (args.length <= 2 && setting === "list") return { kind: "spinner-tips", on: "list" };
|
|
2268
|
+
return { kind: "message", role: "system", content: "Usage: /config tips [on|off|list]" };
|
|
2269
|
+
}
|
|
2270
|
+
if (args[0] === "theme") {
|
|
2271
|
+
if (args.length === 1) return { kind: "theme-picker" };
|
|
2272
|
+
const setting = parseThemeArgument(args.slice(1));
|
|
2273
|
+
if (setting !== void 0) return { kind: "theme", setting };
|
|
2274
|
+
return { kind: "message", role: "system", content: THEME_USAGE };
|
|
2275
|
+
}
|
|
2276
|
+
if (args[0] === "triggers") {
|
|
2277
|
+
const setting = (args[1] ?? "list").toLowerCase();
|
|
2278
|
+
if (args.length <= 2 && (setting === "on" || setting === "off" || setting === "list"))
|
|
2279
|
+
return { kind: "composer-triggers", setting };
|
|
2280
|
+
return {
|
|
2281
|
+
kind: "message",
|
|
2282
|
+
role: "system",
|
|
2283
|
+
content: "Usage: /config triggers [on|off|list]"
|
|
2284
|
+
};
|
|
2285
|
+
}
|
|
2286
|
+
if (args[0] === "recap") {
|
|
2287
|
+
const setting = (args[1] ?? "list").toLowerCase();
|
|
2288
|
+
if (args.length <= 2 && (setting === "on" || setting === "off" || setting === "list"))
|
|
2289
|
+
return { kind: "recap-setting", setting };
|
|
2290
|
+
return { kind: "message", role: "system", content: "Usage: /config recap [on|off|list]" };
|
|
2291
|
+
}
|
|
2292
|
+
return {
|
|
2293
|
+
kind: "message",
|
|
2294
|
+
role: "system",
|
|
2295
|
+
content: args.join(" ") === "sources" ? renderConfigDebug(ctx.configDebug) : "Usage: /config [sources|limits|triggers|theme|motion|recap|tips]"
|
|
2296
|
+
};
|
|
2297
|
+
}, "action")
|
|
2298
|
+
},
|
|
2299
|
+
{
|
|
2300
|
+
name: "recap",
|
|
2301
|
+
description: "Write a short recap of this conversation now.",
|
|
2302
|
+
action: /* @__PURE__ */ __name(() => ({ kind: "recap-now" }), "action")
|
|
2303
|
+
},
|
|
2304
|
+
{
|
|
2305
|
+
name: "settings",
|
|
2306
|
+
description: "View or change model, reasoning and permissions.",
|
|
2307
|
+
action: /* @__PURE__ */ __name(() => ({ kind: "settings-picker" }), "action")
|
|
2308
|
+
},
|
|
2309
|
+
{
|
|
2310
|
+
name: "peers",
|
|
2311
|
+
description: "Find and message other live terminals in this project.",
|
|
2312
|
+
help: { usage: ["/peers [list|on|off]", "/peers send <ref> <message>"] },
|
|
2313
|
+
action: /* @__PURE__ */ __name((_ctx, args) => ({ kind: "peers", args }), "action")
|
|
2314
|
+
},
|
|
2315
|
+
{
|
|
2316
|
+
name: "agents",
|
|
2317
|
+
description: "Inspect delegated agents; /agents available lists configured agents, /agents batches lists past and running batches of delegated work.",
|
|
2318
|
+
help: { usage: ["/agents [running|available|batches]"] },
|
|
2319
|
+
// The subcommands are the delegation UI's (`agentsSlashCommand`): App hands
|
|
2320
|
+
// it the arguments and renders what it answers, usage line included.
|
|
2321
|
+
action: /* @__PURE__ */ __name((_ctx, args) => ({ kind: "agents", args }), "action")
|
|
2322
|
+
},
|
|
2323
|
+
{
|
|
2324
|
+
name: "workflows",
|
|
2325
|
+
description: "List this conversation\u2019s workflows and open one.",
|
|
2326
|
+
help: { usage: ["/workflows"] },
|
|
2327
|
+
action: /* @__PURE__ */ __name(() => ({ kind: "workflows" }), "action")
|
|
2328
|
+
},
|
|
2329
|
+
{
|
|
2330
|
+
name: "goal",
|
|
2331
|
+
description: "Manage this conversation\u2019s goal and automatic continuation.",
|
|
2332
|
+
help: {
|
|
2333
|
+
usage: [
|
|
2334
|
+
"/goal",
|
|
2335
|
+
"/goal status",
|
|
2336
|
+
"/goal set [objective]",
|
|
2337
|
+
"/goal edit [objective]",
|
|
2338
|
+
"/goal pause|resume|clear"
|
|
2339
|
+
],
|
|
2340
|
+
details: [
|
|
2341
|
+
"Set and edit open an editor when no objective is supplied. Direct /goal <objective> also creates a goal.",
|
|
2342
|
+
"Creating or resuming a goal enables automatic work. Pausing or clearing stops future automatic replies."
|
|
2343
|
+
]
|
|
2344
|
+
},
|
|
2345
|
+
action: /* @__PURE__ */ __name((_ctx, args) => {
|
|
2346
|
+
if (args.length === 0) return { kind: "goal-picker" };
|
|
2347
|
+
if (args.length === 1 && args[0] === "status") {
|
|
2348
|
+
return { kind: "host-command", name: "goal", args: [] };
|
|
2349
|
+
}
|
|
2350
|
+
if (args.length === 1 && (args[0] === "set" || args[0] === "edit")) {
|
|
2351
|
+
return { kind: "goal-editor", edit: args[0] === "edit" };
|
|
2352
|
+
}
|
|
2353
|
+
return { kind: "host-command", name: "goal", args };
|
|
2354
|
+
}, "action")
|
|
2355
|
+
},
|
|
2356
|
+
{
|
|
2357
|
+
name: "schedule",
|
|
2358
|
+
description: "Scheduled jobs that run while namzu is closed: list, confirm, pause, run, add.",
|
|
2359
|
+
help: {
|
|
2360
|
+
usage: [
|
|
2361
|
+
"/schedule",
|
|
2362
|
+
"/schedule confirm|pause|resume|run|remove <job>",
|
|
2363
|
+
'/schedule add <name> "<when>" <read-only|edit-in-folder> <prompt\u2026>'
|
|
2364
|
+
],
|
|
2365
|
+
details: [
|
|
2366
|
+
"A run waiting for your approval is answered with /resume of its conversation in its folder.",
|
|
2367
|
+
"The scheduler itself is installed with `namzu schedule install`."
|
|
2368
|
+
]
|
|
2369
|
+
},
|
|
2370
|
+
action: /* @__PURE__ */ __name((_ctx, args) => ({ kind: "host-command", name: "schedule", args }), "action")
|
|
2371
|
+
},
|
|
2372
|
+
{
|
|
2373
|
+
name: "browser",
|
|
2374
|
+
description: "The browser this conversation drives: engine, profile, site rules; switch profile.",
|
|
2375
|
+
help: {
|
|
2376
|
+
usage: ["/browser", "/browser profile <name>"],
|
|
2377
|
+
details: [
|
|
2378
|
+
"A profile holds your sign-ins; sign in once with `namzu browser login <profile> <url>`.",
|
|
2379
|
+
"Site rules come from `browser.sites` in your config."
|
|
2380
|
+
]
|
|
2381
|
+
},
|
|
2382
|
+
action: /* @__PURE__ */ __name((_ctx, args) => ({ kind: "browser", args }), "action")
|
|
2383
|
+
},
|
|
2384
|
+
{
|
|
2385
|
+
name: "loop",
|
|
2386
|
+
description: "Re-send a prompt on an interval, between replies.",
|
|
2387
|
+
help: {
|
|
2388
|
+
usage: ["/loop <interval> <prompt or /command>", "/loop list", "/loop stop <id>|all"],
|
|
2389
|
+
details: [
|
|
2390
|
+
"5m, 1h, or a five-field cron expression. Fires once when idle, never once per missed interval; expires after 7 days."
|
|
2391
|
+
]
|
|
2392
|
+
},
|
|
2393
|
+
action: /* @__PURE__ */ __name((_ctx, args) => ({ kind: "host-command", name: "loop", args }), "action")
|
|
2394
|
+
},
|
|
2395
|
+
{
|
|
2396
|
+
name: "help",
|
|
2397
|
+
description: "Browse commands, or show usage with /help <command>.",
|
|
2398
|
+
help: {
|
|
2399
|
+
usage: ["/help", "/help <command>"],
|
|
2400
|
+
details: [
|
|
2401
|
+
"Without a name, opens the command menu. With a name, shows help without running the command."
|
|
2402
|
+
]
|
|
2403
|
+
},
|
|
2404
|
+
action: /* @__PURE__ */ __name((ctx, args) => {
|
|
2405
|
+
if (args.length > 0) return commandHelp(ctx, args);
|
|
2406
|
+
return {
|
|
2407
|
+
kind: "command-picker",
|
|
2408
|
+
commands: [
|
|
2409
|
+
...(ctx.builtins ?? CLI_LOCAL_COMMANDS).filter((command) => command.discoverable !== false).map((command) => ({
|
|
2410
|
+
name: command.name,
|
|
2411
|
+
description: command.description,
|
|
2412
|
+
...command.unavailable?.(ctx) ? { problem: command.unavailable(ctx) } : {}
|
|
2413
|
+
})),
|
|
2414
|
+
...ctx.userCommands.map((command) => ({
|
|
2415
|
+
name: command.name,
|
|
2416
|
+
description: command.description,
|
|
2417
|
+
...command.problem ? { problem: command.problem } : {}
|
|
2418
|
+
}))
|
|
2419
|
+
]
|
|
2420
|
+
};
|
|
2421
|
+
}, "action")
|
|
2422
|
+
},
|
|
2423
|
+
{
|
|
2424
|
+
name: "feedback",
|
|
2425
|
+
help: { usage: ["/feedback", "/feedback good|bad [note]"] },
|
|
2426
|
+
unavailable: /* @__PURE__ */ __name((ctx) => ctx.lastAssistantMessageId() ? void 0 : "Nothing to rate yet. Wait for an assistant answer.", "unavailable"),
|
|
2427
|
+
description: "Rate the last answer; choose good/bad or add an optional note.",
|
|
2428
|
+
action: /* @__PURE__ */ __name((ctx, args) => {
|
|
2429
|
+
if (args.length === 0) {
|
|
2430
|
+
const messageId2 = ctx.lastAssistantMessageId();
|
|
2431
|
+
return messageId2 ? { kind: "feedback-picker", messageId: messageId2 } : {
|
|
2432
|
+
kind: "message",
|
|
2433
|
+
role: "system",
|
|
2434
|
+
content: "Nothing to rate yet \u2014 /feedback applies to the last answer in this reply."
|
|
2435
|
+
};
|
|
2436
|
+
}
|
|
2437
|
+
const [rating, ...rest] = args;
|
|
2438
|
+
if (rating !== "good" && rating !== "bad") {
|
|
2439
|
+
return {
|
|
2440
|
+
kind: "message",
|
|
2441
|
+
role: "system",
|
|
2442
|
+
content: "Usage: /feedback good|bad [note]"
|
|
2443
|
+
};
|
|
2444
|
+
}
|
|
2445
|
+
const messageId = ctx.lastAssistantMessageId();
|
|
2446
|
+
if (!messageId) {
|
|
2447
|
+
return {
|
|
2448
|
+
kind: "message",
|
|
2449
|
+
role: "system",
|
|
2450
|
+
content: "Nothing to rate yet \u2014 /feedback applies to the last answer in this reply."
|
|
2451
|
+
};
|
|
2452
|
+
}
|
|
2453
|
+
const note = rest.join(" ").trim();
|
|
2454
|
+
return { kind: "feedback", rating, messageId, ...note ? { note } : {} };
|
|
2455
|
+
}, "action")
|
|
2456
|
+
},
|
|
2457
|
+
{
|
|
2458
|
+
name: "clear",
|
|
2459
|
+
description: "Clear the terminal and start a fresh conversation.",
|
|
2460
|
+
action: /* @__PURE__ */ __name(() => ({ kind: "new-conversation", clearScreen: true }), "action")
|
|
2461
|
+
},
|
|
2462
|
+
{
|
|
2463
|
+
name: "new",
|
|
2464
|
+
description: "Start a fresh conversation without clearing the terminal.",
|
|
2465
|
+
action: /* @__PURE__ */ __name(() => ({ kind: "new-conversation", clearScreen: false }), "action")
|
|
2466
|
+
},
|
|
2467
|
+
{
|
|
2468
|
+
name: "archive",
|
|
2469
|
+
description: "Archive this conversation and exit after confirmation.",
|
|
2470
|
+
action: /* @__PURE__ */ __name(() => ({ kind: "archive-picker" }), "action")
|
|
2471
|
+
},
|
|
2472
|
+
{
|
|
2473
|
+
name: "unarchive",
|
|
2474
|
+
description: "Restore an archived conversation in this project.",
|
|
2475
|
+
action: /* @__PURE__ */ __name(() => ({ kind: "unarchive" }), "action")
|
|
2476
|
+
},
|
|
2477
|
+
{
|
|
2478
|
+
name: "exit",
|
|
2479
|
+
description: "Exit namzu.",
|
|
2480
|
+
action: /* @__PURE__ */ __name(() => ({ kind: "exit" }), "action")
|
|
2481
|
+
},
|
|
2482
|
+
{
|
|
2483
|
+
name: "rename",
|
|
2484
|
+
help: { usage: ["/rename [name]", "/rename clear"] },
|
|
2485
|
+
description: "Rename this conversation; opens an editor when no name is supplied. /rename clear removes the saved name.",
|
|
2486
|
+
action: renameConversationAction
|
|
2487
|
+
},
|
|
2488
|
+
{
|
|
2489
|
+
name: "fork",
|
|
2490
|
+
description: "Continue in a copy, leaving the original unchanged.",
|
|
2491
|
+
action: /* @__PURE__ */ __name(() => ({ kind: "fork" }), "action")
|
|
2492
|
+
},
|
|
2493
|
+
{
|
|
2494
|
+
name: "worktree",
|
|
2495
|
+
help: {
|
|
2496
|
+
usage: ["/worktree [list|create [name]|fork [name]|resume <name>]"]
|
|
2497
|
+
},
|
|
2498
|
+
description: "List or create separate Git checkouts; fork this conversation into one.",
|
|
2499
|
+
action: /* @__PURE__ */ __name((_ctx, args) => ({ kind: "worktree", args }), "action")
|
|
2500
|
+
},
|
|
2501
|
+
{
|
|
2502
|
+
name: "add-dir",
|
|
2503
|
+
help: {
|
|
2504
|
+
usage: ["/add-dir [path]"],
|
|
2505
|
+
details: ["Without a path, lists added directories. Paths may contain spaces."]
|
|
2506
|
+
},
|
|
2507
|
+
description: "Let the file tools reach another directory in this conversation: /add-dir <path>. Alone, list them.",
|
|
2508
|
+
action: /* @__PURE__ */ __name((ctx, args) => {
|
|
2509
|
+
const path = args.join(" ").trim();
|
|
2510
|
+
if (path.length === 0) {
|
|
2511
|
+
const dirs = ctx.directories?.() ?? [];
|
|
2512
|
+
return {
|
|
2513
|
+
kind: "message",
|
|
2514
|
+
role: "system",
|
|
2515
|
+
content: dirs.length === 0 ? "No added directories. The file tools reach the working directory without asking; a path elsewhere is asked about call by call (refused inside the sandbox). /add-dir <path> adds one for this conversation, after asking when it is outside the working directory; `additionalDirectories` in the config file adds one for every session." : `Added directories (reachable by absolute path, bound into the sandbox):
|
|
2516
|
+
${dirs.map((d) => ` ${d}`).join("\n")}`
|
|
2517
|
+
};
|
|
2518
|
+
}
|
|
2519
|
+
return { kind: "add-dir", path };
|
|
2520
|
+
}, "action")
|
|
2521
|
+
},
|
|
2522
|
+
{
|
|
2523
|
+
name: "rewind",
|
|
2524
|
+
help: {
|
|
2525
|
+
usage: ["/rewind"],
|
|
2526
|
+
details: [
|
|
2527
|
+
"Pick an earlier prompt, then restore the files, the conversation, or both to the point before it, or summarize around it. Restoring the conversation continues in a new branch; the original stays in /resume. Pressing Esc twice on an empty message does the same."
|
|
2528
|
+
]
|
|
2529
|
+
},
|
|
2530
|
+
description: "Restore the code and/or conversation to a previous point.",
|
|
2531
|
+
action: /* @__PURE__ */ __name(() => ({ kind: "rewind" }), "action")
|
|
2532
|
+
},
|
|
2533
|
+
{
|
|
2534
|
+
name: "undo",
|
|
2535
|
+
help: { usage: ["/undo"], details: ["Same as /rewind."] },
|
|
2536
|
+
description: "Same as /rewind.",
|
|
2537
|
+
action: /* @__PURE__ */ __name(() => ({ kind: "rewind" }), "action")
|
|
2538
|
+
},
|
|
2539
|
+
{
|
|
2540
|
+
name: "checkpoint",
|
|
2541
|
+
help: { usage: ["/checkpoint"], details: ["Same as /rewind."] },
|
|
2542
|
+
description: "Same as /rewind.",
|
|
2543
|
+
action: /* @__PURE__ */ __name(() => ({ kind: "rewind" }), "action")
|
|
2544
|
+
},
|
|
2545
|
+
{
|
|
2546
|
+
name: "restore",
|
|
2547
|
+
help: {
|
|
2548
|
+
usage: ["/restore [number]"],
|
|
2549
|
+
details: ["Run /restore to list restore points before choosing one."]
|
|
2550
|
+
},
|
|
2551
|
+
description: "Put files back to how they were before a reply: /restore lists the restore points, /restore N restores.",
|
|
2552
|
+
action: /* @__PURE__ */ __name((_ctx, args) => {
|
|
2553
|
+
const raw = args[0]?.trim();
|
|
2554
|
+
if (!raw) return { kind: "restore" };
|
|
2555
|
+
const turn = Number.parseInt(raw, 10);
|
|
2556
|
+
if (!Number.isInteger(turn) || turn < 1 || String(turn) !== raw) {
|
|
2557
|
+
return {
|
|
2558
|
+
kind: "message",
|
|
2559
|
+
role: "system",
|
|
2560
|
+
content: `/restore takes a number from the list: /restore 3. Not: ${raw}`
|
|
2561
|
+
};
|
|
2562
|
+
}
|
|
2563
|
+
return { kind: "restore", turn };
|
|
2564
|
+
}, "action")
|
|
2565
|
+
},
|
|
2566
|
+
{
|
|
2567
|
+
name: "memory",
|
|
2568
|
+
help: {
|
|
2569
|
+
usage: [
|
|
2570
|
+
"/memory [show|list]",
|
|
2571
|
+
"/memory add [--type user|feedback|project|reference] <text>",
|
|
2572
|
+
"/memory --user add <text>",
|
|
2573
|
+
"/memory import-notes"
|
|
2574
|
+
],
|
|
2575
|
+
details: [
|
|
2576
|
+
"Show and list read stored and curated memory, with what turns recorded on their own in a section of its own. Add saves a typed memory file for this project (type project unless --type says otherwise); --user appends a note to the curated file for all projects.",
|
|
2577
|
+
"Direct /memory <text> also saves a project note. To save a reserved word as a note, use /memory add show.",
|
|
2578
|
+
"import-notes copies every top-level bullet of the project\u2019s curated MEMORY.md, where #note used to append, into typed memory files, skipping any already stored. The curated file is never changed; delete bullets from it yourself."
|
|
2579
|
+
]
|
|
2580
|
+
},
|
|
2581
|
+
description: "Show memory, or save a note with /memory add <text>. Use /memory --user add <text> for every project.",
|
|
2582
|
+
action: /* @__PURE__ */ __name((_ctx, args) => {
|
|
2583
|
+
const user = args[0] === "--user";
|
|
2584
|
+
const memoryArgs = user ? args.slice(1) : args;
|
|
2585
|
+
const text = memoryArgs.join(" ").trim();
|
|
2586
|
+
if (text.length === 0 || ["show", "list"].includes(text.toLowerCase())) {
|
|
2587
|
+
return { kind: "show-memory" };
|
|
2588
|
+
}
|
|
2589
|
+
if (text.toLowerCase() === "import-notes") {
|
|
2590
|
+
if (user) {
|
|
2591
|
+
return {
|
|
2592
|
+
kind: "message",
|
|
2593
|
+
role: "system",
|
|
2594
|
+
content: "import-notes copies project notes; the curated file for all projects stays as it is."
|
|
2595
|
+
};
|
|
2596
|
+
}
|
|
2597
|
+
return { kind: "import-notes" };
|
|
2598
|
+
}
|
|
2599
|
+
if (memoryArgs[0]?.toLowerCase() === "add") {
|
|
2600
|
+
let rest = memoryArgs.slice(1);
|
|
2601
|
+
let memoryType;
|
|
2602
|
+
if (rest[0] === "--type") {
|
|
2603
|
+
const requested = rest[1]?.toLowerCase();
|
|
2604
|
+
if (!isMemoryType(requested) || user) {
|
|
2605
|
+
return {
|
|
2606
|
+
kind: "message",
|
|
2607
|
+
role: "system",
|
|
2608
|
+
content: user ? "--type applies to project memories; /memory --user add appends to the curated file for all projects." : "Usage: /memory add --type user|feedback|project|reference <text>."
|
|
2609
|
+
};
|
|
2610
|
+
}
|
|
2611
|
+
memoryType = requested;
|
|
2612
|
+
rest = rest.slice(2);
|
|
2613
|
+
}
|
|
2614
|
+
const fact = rest.join(" ").trim();
|
|
2615
|
+
if (fact.length === 0) {
|
|
2616
|
+
return {
|
|
2617
|
+
kind: "message",
|
|
2618
|
+
role: "system",
|
|
2619
|
+
content: "Usage: /memory add <text> or /memory --user add <text>. /memory show displays saved memory."
|
|
2620
|
+
};
|
|
2621
|
+
}
|
|
2622
|
+
return {
|
|
2623
|
+
kind: "remember",
|
|
2624
|
+
text: fact,
|
|
2625
|
+
scope: user ? "user" : "project",
|
|
2626
|
+
...memoryType ? { memoryType } : {}
|
|
2627
|
+
};
|
|
2628
|
+
}
|
|
2629
|
+
return { kind: "remember", text, scope: user ? "user" : "project" };
|
|
2630
|
+
}, "action")
|
|
2631
|
+
},
|
|
2632
|
+
{
|
|
2633
|
+
name: "skills",
|
|
2634
|
+
help: {
|
|
2635
|
+
usage: [
|
|
2636
|
+
"/skills",
|
|
2637
|
+
"/skills list",
|
|
2638
|
+
"/skills new [what it should do]",
|
|
2639
|
+
"/skills save [name]",
|
|
2640
|
+
"/skills save off|on",
|
|
2641
|
+
"/skills <name>"
|
|
2642
|
+
],
|
|
2643
|
+
details: [
|
|
2644
|
+
"/skills new starts the skill-creator interview; the model drafts a SKILL.md and nothing is saved until you choose where on its confirmation screen.",
|
|
2645
|
+
"/skills save turns what this conversation just did into a skill, generalised and without secrets or tool output, ending on the same confirmation screen.",
|
|
2646
|
+
"/skills save off stops the proposal printed after a multi-step task, in your user config; /skills save on turns it back on."
|
|
2647
|
+
]
|
|
2648
|
+
},
|
|
2649
|
+
description: "Choose an available skill; /skills list shows them all, /skills new makes one.",
|
|
2650
|
+
action: /* @__PURE__ */ __name((_ctx, args) => {
|
|
2651
|
+
const choice = args.join(" ").trim();
|
|
2652
|
+
if (choice.length === 0) return { kind: "skill-picker" };
|
|
2653
|
+
if (choice.toLowerCase() === "list") return { kind: "list-skills" };
|
|
2654
|
+
if (args[0]?.toLowerCase() === "new")
|
|
2655
|
+
return { kind: "new-skill", idea: args.slice(1).join(" ").trim() };
|
|
2656
|
+
if (args[0]?.toLowerCase() === "save") {
|
|
2657
|
+
const rest = args.slice(1).join(" ").trim();
|
|
2658
|
+
const word = rest.toLowerCase();
|
|
2659
|
+
if (word === "off" || word === "on") return { kind: "skill-suggestions", on: word === "on" };
|
|
2660
|
+
if (rest.length === 0) return { kind: "save-skill" };
|
|
2661
|
+
if (!SKILL_NAME_PATTERN.test(rest) || rest.length > SKILL_NAME_MAX_CHARS) {
|
|
2662
|
+
return {
|
|
2663
|
+
kind: "message",
|
|
2664
|
+
role: "system",
|
|
2665
|
+
content: `"${rest}" is not a skill name: use lowercase letters, digits and single hyphens, at most ${SKILL_NAME_MAX_CHARS} characters (/skills save release-notes).`
|
|
2666
|
+
};
|
|
2667
|
+
}
|
|
2668
|
+
return { kind: "save-skill", name: rest };
|
|
2669
|
+
}
|
|
2670
|
+
return { kind: "load-skill", name: choice };
|
|
2671
|
+
}, "action")
|
|
2672
|
+
},
|
|
2673
|
+
{
|
|
2674
|
+
name: "plugins",
|
|
2675
|
+
description: "See plugins and turn them on or off.",
|
|
2676
|
+
help: {
|
|
2677
|
+
usage: ["/plugins", "/plugins list", "/plugins <name>"],
|
|
2678
|
+
details: [
|
|
2679
|
+
"Choose a plugin to inspect its contributions or turn it on or off for this conversation. Changes wait until the current reply has finished. Use Keep enabled/disabled after restart to remember its state for future conversations and model switches. Plugin loading must first be enabled in configuration."
|
|
2680
|
+
]
|
|
2681
|
+
},
|
|
2682
|
+
action: /* @__PURE__ */ __name((_ctx, args) => args.length > 1 ? {
|
|
2683
|
+
kind: "message",
|
|
2684
|
+
role: "system",
|
|
2685
|
+
content: "Usage: /plugins [list|name]"
|
|
2686
|
+
} : {
|
|
2687
|
+
kind: "plugins",
|
|
2688
|
+
list: args[0] === "list",
|
|
2689
|
+
...args[0] && args[0] !== "list" ? { name: args[0] } : {}
|
|
2690
|
+
}, "action")
|
|
2691
|
+
},
|
|
2692
|
+
{
|
|
2693
|
+
name: "resume",
|
|
2694
|
+
description: "Continue a paused reply, or resume a past conversation.",
|
|
2695
|
+
action: /* @__PURE__ */ __name(() => ({ kind: "resume" }), "action")
|
|
2696
|
+
},
|
|
2697
|
+
{
|
|
2698
|
+
name: "abandon",
|
|
2699
|
+
description: "Close a paused or stopped reply without resuming it.",
|
|
2700
|
+
help: { usage: ["/abandon [reason]"] },
|
|
2701
|
+
action: /* @__PURE__ */ __name((_ctx, args) => ({
|
|
2702
|
+
kind: "abandon",
|
|
2703
|
+
reason: args.join(" ").trim() || "Abandoned by the operator with /abandon."
|
|
2704
|
+
}), "action")
|
|
2705
|
+
},
|
|
2706
|
+
{
|
|
2707
|
+
name: "model",
|
|
2708
|
+
description: "Choose a model, or change providers.",
|
|
2709
|
+
help: {
|
|
2710
|
+
usage: ["/model", "/model <model-or-provider/model>"],
|
|
2711
|
+
details: [
|
|
2712
|
+
"Pass a model ID to change only this conversation, without a model request. Without an ID, open the searchable picker; press / to search names starting with a reserved shortcut.",
|
|
2713
|
+
"Press p in the model picker to change providers. Normal selections are saved for future launches; temporary credentials keep the selection in this conversation."
|
|
2714
|
+
]
|
|
2715
|
+
},
|
|
2716
|
+
action: /* @__PURE__ */ __name(() => ({ kind: "repick" }), "action")
|
|
2717
|
+
},
|
|
2718
|
+
{
|
|
2719
|
+
name: "login",
|
|
2720
|
+
description: "Sign in with a Claude or Codex subscription.",
|
|
2721
|
+
help: {
|
|
2722
|
+
usage: ["/login", "/login <callback-address-or-code>"],
|
|
2723
|
+
details: [
|
|
2724
|
+
"Start sign-in with /login, then paste the callback address or code when requested."
|
|
2725
|
+
]
|
|
2726
|
+
},
|
|
2727
|
+
action: /* @__PURE__ */ __name((_ctx, args) => isCompletionArgument(args) ? { kind: "login", pasted: args.join(" ").trim() } : { kind: "login" }, "action")
|
|
2728
|
+
},
|
|
2729
|
+
{
|
|
2730
|
+
name: "logout",
|
|
2731
|
+
help: { usage: ["/logout [claude|codex|gemini|all]"] },
|
|
2732
|
+
description: "Remove a Namzu-owned credential: /logout [claude|codex|gemini|all].",
|
|
2733
|
+
action: /* @__PURE__ */ __name((_ctx, args) => {
|
|
2734
|
+
const target = args.join(" ").trim().toLowerCase();
|
|
2735
|
+
if (target.length === 0) return { kind: "logout" };
|
|
2736
|
+
if (target === "claude" || target === "anthropic") {
|
|
2737
|
+
return { kind: "logout", target: "anthropic" };
|
|
2738
|
+
}
|
|
2739
|
+
if (target === "codex" || target === "chatgpt") return { kind: "logout", target: "codex" };
|
|
2740
|
+
if (target === "gemini" || target === "google") return { kind: "logout", target: "google" };
|
|
2741
|
+
if (target === "all") return { kind: "logout", target: "all" };
|
|
2742
|
+
return {
|
|
2743
|
+
kind: "message",
|
|
2744
|
+
role: "system",
|
|
2745
|
+
content: "Usage: /logout [claude|codex|gemini|all]"
|
|
2746
|
+
};
|
|
2747
|
+
}, "action")
|
|
2748
|
+
},
|
|
2749
|
+
{
|
|
2750
|
+
name: "cost",
|
|
2751
|
+
help: { usage: ["/cost [details]"] },
|
|
2752
|
+
description: "Show usage and cost for the current or latest reply.",
|
|
2753
|
+
action: /* @__PURE__ */ __name((ctx, args) => reportCommand("cost", args, (details) => renderCost(ctx.usage, ctx.compaction, details)), "action")
|
|
2754
|
+
},
|
|
2755
|
+
{
|
|
2756
|
+
name: "jobs",
|
|
2757
|
+
description: "See background shells, read output, stop one.",
|
|
2758
|
+
help: { usage: ["/jobs", "/jobs list"] },
|
|
2759
|
+
action: /* @__PURE__ */ __name((ctx, args) => args.length === 0 ? { kind: "jobs" } : args.length === 1 && args[0] === "list" ? { kind: "message", role: "system", content: renderJobs(ctx.jobs()) } : { kind: "message", role: "system", content: "Usage: /jobs [list]" }, "action")
|
|
2760
|
+
},
|
|
2761
|
+
{
|
|
2762
|
+
name: "release-notes",
|
|
2763
|
+
help: { usage: ["/release-notes [version]"] },
|
|
2764
|
+
description: "Show what changed in the version that is running: /release-notes [version].",
|
|
2765
|
+
action: /* @__PURE__ */ __name((_ctx, args) => ({
|
|
2766
|
+
kind: "message",
|
|
2767
|
+
role: "system",
|
|
2768
|
+
content: renderReleaseNotes(readChangelog(), args[0]?.trim() || void 0)
|
|
2769
|
+
}), "action")
|
|
2770
|
+
},
|
|
2771
|
+
{
|
|
2772
|
+
name: "hooks",
|
|
2773
|
+
description: "List the shell hooks this conversation runs, by event.",
|
|
2774
|
+
action: /* @__PURE__ */ __name((ctx) => ({
|
|
2775
|
+
kind: "message",
|
|
2776
|
+
role: "system",
|
|
2777
|
+
content: renderHooks(ctx.hooks?.())
|
|
2778
|
+
}), "action")
|
|
2779
|
+
},
|
|
2780
|
+
{
|
|
2781
|
+
name: "context",
|
|
2782
|
+
help: { usage: ["/context [details]"] },
|
|
2783
|
+
description: "Show where the context goes, as a grid.",
|
|
2784
|
+
action: /* @__PURE__ */ __name((ctx, args) => {
|
|
2785
|
+
const option = args.join(" ").trim().toLowerCase();
|
|
2786
|
+
if (option !== "" && option !== "details" && option !== "all")
|
|
2787
|
+
return { kind: "message", role: "system", content: "Usage: /context [details]" };
|
|
2788
|
+
return { kind: "context", details: option === "details" };
|
|
2789
|
+
}, "action")
|
|
2790
|
+
},
|
|
2791
|
+
{
|
|
2792
|
+
name: "review",
|
|
2793
|
+
help: {
|
|
2794
|
+
usage: ["/review [instructions]"],
|
|
2795
|
+
details: [
|
|
2796
|
+
"Without instructions, opens the review target menu. Starting a review uses the selected model."
|
|
2797
|
+
]
|
|
2798
|
+
},
|
|
2799
|
+
description: "Choose a review target, or provide custom instructions: /review [instructions].",
|
|
2800
|
+
action: /* @__PURE__ */ __name((_ctx, args) => {
|
|
2801
|
+
const instructions = args.join(" ").trim();
|
|
2802
|
+
return instructions ? { kind: "review", instructions } : { kind: "review" };
|
|
2803
|
+
}, "action")
|
|
2804
|
+
},
|
|
2805
|
+
{
|
|
2806
|
+
name: "mcp",
|
|
2807
|
+
help: { usage: ["/mcp [tools|details]"] },
|
|
2808
|
+
description: "Show connected tool servers and connection problems.",
|
|
2809
|
+
action: /* @__PURE__ */ __name((ctx, args) => reportCommand("mcp", args, (details) => renderMcp(ctx.mcp(), details), "tools"), "action")
|
|
2810
|
+
},
|
|
2811
|
+
{
|
|
2812
|
+
name: "diff",
|
|
2813
|
+
description: "Show what is uncommitted in this working tree.",
|
|
2814
|
+
action: /* @__PURE__ */ __name(() => ({ kind: "diff" }), "action")
|
|
2815
|
+
},
|
|
2816
|
+
{
|
|
2817
|
+
name: "compact",
|
|
2818
|
+
description: "Summarise older messages to free up context.",
|
|
2819
|
+
help: {
|
|
2820
|
+
usage: ["/compact [what to keep]"],
|
|
2821
|
+
details: [
|
|
2822
|
+
"Summarising condenses older messages.",
|
|
2823
|
+
"Text after the command says what the summary must keep, and uses a model call."
|
|
2824
|
+
]
|
|
2825
|
+
},
|
|
2826
|
+
action: /* @__PURE__ */ __name((_ctx, args) => {
|
|
2827
|
+
const instructions = args.join(" ").trim();
|
|
2828
|
+
return instructions.length > 0 ? { kind: "compact", instructions } : { kind: "compact" };
|
|
2829
|
+
}, "action")
|
|
2830
|
+
},
|
|
2831
|
+
{
|
|
2832
|
+
name: "copy",
|
|
2833
|
+
description: "Copy the latest answer, a code block or a quote.",
|
|
2834
|
+
action: /* @__PURE__ */ __name(() => ({ kind: "copy" }), "action")
|
|
2835
|
+
},
|
|
2836
|
+
{
|
|
2837
|
+
name: "raw",
|
|
2838
|
+
help: { usage: ["/raw [on|off]"] },
|
|
2839
|
+
description: "Toggle copy-friendly plain transcript rendering: /raw [on|off].",
|
|
2840
|
+
action: /* @__PURE__ */ __name((_ctx, args) => {
|
|
2841
|
+
const choice = args.join(" ").trim().toLowerCase();
|
|
2842
|
+
if (choice.length === 0) return { kind: "raw", enabled: "toggle" };
|
|
2843
|
+
if (choice === "on") return { kind: "raw", enabled: true };
|
|
2844
|
+
if (choice === "off") return { kind: "raw", enabled: false };
|
|
2845
|
+
return {
|
|
2846
|
+
kind: "message",
|
|
2847
|
+
role: "system",
|
|
2848
|
+
content: "Usage: /raw [on|off]"
|
|
2849
|
+
};
|
|
2850
|
+
}, "action")
|
|
2851
|
+
},
|
|
2852
|
+
{
|
|
2853
|
+
name: "export",
|
|
2854
|
+
help: {
|
|
2855
|
+
usage: ["/export [path]"],
|
|
2856
|
+
details: [
|
|
2857
|
+
"Without a path, choose the clipboard or a Markdown file. Existing files are not overwritten. Paths may contain spaces."
|
|
2858
|
+
]
|
|
2859
|
+
},
|
|
2860
|
+
description: "Export this conversation to the clipboard or a file.",
|
|
2861
|
+
action: /* @__PURE__ */ __name((_ctx, args) => {
|
|
2862
|
+
const path = args.join(" ").trim();
|
|
2863
|
+
return path.length > 0 ? { kind: "export", path } : { kind: "export-picker" };
|
|
2864
|
+
}, "action")
|
|
2865
|
+
},
|
|
2866
|
+
{
|
|
2867
|
+
name: "status",
|
|
2868
|
+
help: { usage: ["/status [details|config|tools]"] },
|
|
2869
|
+
description: "Show the model, permissions, workspace and latest cost.",
|
|
2870
|
+
action: /* @__PURE__ */ __name((ctx, args) => {
|
|
2871
|
+
const which = args.join(" ").trim().toLowerCase();
|
|
2872
|
+
if (which === "config") {
|
|
2873
|
+
return {
|
|
2874
|
+
kind: "message",
|
|
2875
|
+
role: "system",
|
|
2876
|
+
content: renderConfigDebug(ctx.configDebug)
|
|
2877
|
+
};
|
|
2878
|
+
}
|
|
2879
|
+
if (which === "tools") {
|
|
2880
|
+
const tools = ctx.availableTools();
|
|
2881
|
+
return {
|
|
2882
|
+
kind: "message",
|
|
2883
|
+
role: "system",
|
|
2884
|
+
content: tools.length === 0 ? "No tools registered yet \u2014 the model may still be connecting." : `Registered tools (${tools.length}):
|
|
2885
|
+
${tools.join("\n ")}`
|
|
2886
|
+
};
|
|
2887
|
+
}
|
|
2888
|
+
if (which.length > 0 && which !== "details") {
|
|
2889
|
+
return {
|
|
2890
|
+
kind: "message",
|
|
2891
|
+
role: "system",
|
|
2892
|
+
content: "Usage: /status [details|config|tools]"
|
|
2893
|
+
};
|
|
2894
|
+
}
|
|
2895
|
+
return {
|
|
2896
|
+
kind: "message",
|
|
2897
|
+
role: "system",
|
|
2898
|
+
content: renderStatus(ctx, which === "details"),
|
|
2899
|
+
...which === "" ? { statusRows: statusRows(ctx) } : {}
|
|
2900
|
+
};
|
|
2901
|
+
}, "action")
|
|
2902
|
+
},
|
|
2903
|
+
{
|
|
2904
|
+
name: "permissions",
|
|
2905
|
+
description: "Choose which actions need your approval.",
|
|
2906
|
+
help: {
|
|
2907
|
+
usage: ["/permissions", "/permissions details", "/permissions <mode>"],
|
|
2908
|
+
details: [
|
|
2909
|
+
"Choose a preset in the menu, or use a typed mode:",
|
|
2910
|
+
...PERMISSION_MODE_NAMES.map((name) => {
|
|
2911
|
+
const mode = permissionModeFromName(name);
|
|
2912
|
+
return ` ${name}: ${permissionModeDescription(mode)}`;
|
|
2913
|
+
}),
|
|
2914
|
+
"Changes apply to this conversation. Explicit deny rules and sandbox restrictions still apply."
|
|
2915
|
+
]
|
|
2916
|
+
},
|
|
2917
|
+
action: /* @__PURE__ */ __name((ctx, args) => {
|
|
2918
|
+
if (args.length === 0) return { kind: "permission-mode-picker" };
|
|
2919
|
+
const mode = args.length === 1 ? args[0]?.toLowerCase() : void 0;
|
|
2920
|
+
if (mode === "details") {
|
|
2921
|
+
return {
|
|
2922
|
+
kind: "message",
|
|
2923
|
+
role: "system",
|
|
2924
|
+
content: renderPermissions(ctx.permissions, true)
|
|
2925
|
+
};
|
|
2926
|
+
}
|
|
2927
|
+
const chosen = permissionModeFromName(mode);
|
|
2928
|
+
if (chosen !== void 0) return { kind: "permission-mode", mode: chosen };
|
|
2929
|
+
return {
|
|
2930
|
+
kind: "message",
|
|
2931
|
+
role: "system",
|
|
2932
|
+
content: "Usage: /permissions opens the permission menu. Choose a preset there, or use /permissions details to view rules."
|
|
2933
|
+
};
|
|
2934
|
+
}, "action")
|
|
2935
|
+
},
|
|
2936
|
+
{
|
|
2937
|
+
name: "theme",
|
|
2938
|
+
help: {
|
|
2939
|
+
usage: ["/theme [auto|dark|light|dark-daltonized|light-daltonized|dark-ansi|light-ansi]"],
|
|
2940
|
+
details: [
|
|
2941
|
+
"Run /theme to pick the colours with a live preview. Auto follows the terminal\u2019s light or dark background. The colorblind-friendly themes use blue and red in place of green and red; the ANSI themes use only the terminal\u2019s own sixteen colors."
|
|
2942
|
+
]
|
|
2943
|
+
},
|
|
2944
|
+
description: "Change the colors: /theme [name].",
|
|
2945
|
+
action: /* @__PURE__ */ __name((_ctx, args) => {
|
|
2946
|
+
if (args.length === 0) return { kind: "theme-picker" };
|
|
2947
|
+
const setting = parseThemeArgument(args);
|
|
2948
|
+
if (setting !== void 0) return { kind: "theme", setting };
|
|
2949
|
+
return { kind: "message", role: "system", content: THEME_USAGE };
|
|
2950
|
+
}, "action")
|
|
2951
|
+
},
|
|
2952
|
+
{
|
|
2953
|
+
name: "effort",
|
|
2954
|
+
help: {
|
|
2955
|
+
usage: ["/effort [level|default]"],
|
|
2956
|
+
details: [
|
|
2957
|
+
"Run /effort to see the levels supported by the selected model and usable fallbacks. Changes affect future replies in this conversation."
|
|
2958
|
+
]
|
|
2959
|
+
},
|
|
2960
|
+
description: "Choose reasoning effort for future replies: /effort [level|default].",
|
|
2961
|
+
action: /* @__PURE__ */ __name((ctx, args) => {
|
|
2962
|
+
if (args.length === 0) {
|
|
2963
|
+
if (!ctx.providerSummary) {
|
|
2964
|
+
return {
|
|
2965
|
+
kind: "message",
|
|
2966
|
+
role: "system",
|
|
2967
|
+
content: "No provider is active yet. Pick one with /model before changing reasoning."
|
|
2968
|
+
};
|
|
2969
|
+
}
|
|
2970
|
+
if (ctx.reasoningEffort.levels === void 0) {
|
|
2971
|
+
return {
|
|
2972
|
+
kind: "message",
|
|
2973
|
+
role: "system",
|
|
2974
|
+
content: `${ctx.modelSummary ?? "This model"} has no reasoning levels to choose from.`
|
|
2975
|
+
};
|
|
2976
|
+
}
|
|
2977
|
+
return { kind: "reasoning-effort-picker" };
|
|
2978
|
+
}
|
|
2979
|
+
if (!ctx.providerSummary) {
|
|
2980
|
+
return {
|
|
2981
|
+
kind: "message",
|
|
2982
|
+
role: "system",
|
|
2983
|
+
content: "No provider is active yet. Pick one with /model before changing reasoning."
|
|
2984
|
+
};
|
|
2985
|
+
}
|
|
2986
|
+
const token = args.length === 1 ? args[0]?.toLowerCase() : void 0;
|
|
2987
|
+
if (token === "default") return { kind: "reasoning-effort", effort: null };
|
|
2988
|
+
const offered = ctx.reasoningEffort.levels;
|
|
2989
|
+
if (offered === void 0) {
|
|
2990
|
+
return {
|
|
2991
|
+
kind: "message",
|
|
2992
|
+
role: "system",
|
|
2993
|
+
content: `Reasoning was not changed: ${ctx.modelSummary ?? "this model"} has no reasoning levels to choose from. It keeps the provider default.`
|
|
2994
|
+
};
|
|
2995
|
+
}
|
|
2996
|
+
const effort = offered.find((level) => level === token);
|
|
2997
|
+
if (effort) return { kind: "reasoning-effort", effort };
|
|
2998
|
+
const levels = offered.length > 0 ? offered.join("|") : "<none>";
|
|
2999
|
+
return {
|
|
3000
|
+
kind: "message",
|
|
3001
|
+
role: "system",
|
|
3002
|
+
content: `Usage: /effort [${levels}|default]`
|
|
3003
|
+
};
|
|
3004
|
+
}, "action")
|
|
3005
|
+
},
|
|
3006
|
+
{
|
|
3007
|
+
name: "hypermode",
|
|
3008
|
+
help: {
|
|
3009
|
+
usage: ["/hypermode [on|off]"],
|
|
3010
|
+
details: [
|
|
3011
|
+
"An independent on/off switch for this conversation, not a reasoning-effort level: it never changes effort. On, the model is told to use the workflow tool for substantial tasks. Off, the tool is still listed, but the model may call it only after you opt in: the word hypermode in a message, the word workflow, or asking for one in your own words. With no argument, toggles the current state. Choosing an effort level never turns hypermode off.",
|
|
3012
|
+
"For one message only, start or end that message with the word hypermode: the model is told to use the workflow tool for that reply only, then it goes back to the standing state."
|
|
3013
|
+
]
|
|
3014
|
+
},
|
|
3015
|
+
description: "Toggle hypermode for this conversation: /hypermode [on|off].",
|
|
3016
|
+
action: /* @__PURE__ */ __name((_ctx, args) => hypermodeAction(args), "action")
|
|
3017
|
+
},
|
|
3018
|
+
{
|
|
3019
|
+
name: "orchestrate",
|
|
3020
|
+
help: {
|
|
3021
|
+
usage: ["/orchestrate [on|off]"],
|
|
3022
|
+
details: [
|
|
3023
|
+
"Deprecated: the mode is now called hypermode. Does what /hypermode does, after saying so."
|
|
3024
|
+
]
|
|
3025
|
+
},
|
|
3026
|
+
description: "Deprecated: use /hypermode.",
|
|
3027
|
+
action: /* @__PURE__ */ __name((_ctx, args) => hypermodeAction(args, "orchestrate"), "action")
|
|
3028
|
+
},
|
|
3029
|
+
{
|
|
3030
|
+
name: "init",
|
|
3031
|
+
description: "Write an AGENTS.md describing this project to future agents.",
|
|
3032
|
+
help: {
|
|
3033
|
+
usage: ["/init"],
|
|
3034
|
+
details: [
|
|
3035
|
+
"Asks the selected model to read the project and write instructions. Existing instructions are read before changes are proposed."
|
|
3036
|
+
]
|
|
3037
|
+
},
|
|
3038
|
+
action: /* @__PURE__ */ __name((ctx) => {
|
|
3039
|
+
if (!ctx.providerSummary) {
|
|
3040
|
+
return {
|
|
3041
|
+
kind: "message",
|
|
3042
|
+
role: "system",
|
|
3043
|
+
content: "/init asks the agent to read this repository and write the file, so it needs a provider. Run /model to pick one."
|
|
3044
|
+
};
|
|
3045
|
+
}
|
|
3046
|
+
return { kind: "prompt", text: initPrompt(ctx.instructionFiles) };
|
|
3047
|
+
}, "action")
|
|
3048
|
+
}
|
|
3049
|
+
];
|
|
3050
|
+
function initPrompt(instructionFiles) {
|
|
3051
|
+
const existing = instructionFiles.length > 0 ? [
|
|
3052
|
+
"",
|
|
3053
|
+
"This project ALREADY has project instructions, loaded from:",
|
|
3054
|
+
...instructionFiles.map((f) => ` ${f}`),
|
|
3055
|
+
"",
|
|
3056
|
+
"Do not overwrite them. Read them first, then propose specific edits \u2014",
|
|
3057
|
+
"what is now wrong, what is missing \u2014 and make only the changes I agree to."
|
|
3058
|
+
].join("\n") : ["", "This project has no AGENTS.md yet. Create one at the repository root."].join("\n");
|
|
3059
|
+
return [
|
|
3060
|
+
"Write the project instructions that a coding agent joining this repository would need.",
|
|
3061
|
+
"",
|
|
3062
|
+
"Verify every claim against the tree before you write it. Do not describe a",
|
|
3063
|
+
"command you have not found, a layout you have not opened, or a convention you",
|
|
3064
|
+
"have inferred from one file. If you cannot establish something, leave it out \u2014",
|
|
3065
|
+
"an AGENTS.md full of plausible inventions is worse than a short true one,",
|
|
3066
|
+
"because the next agent will follow it.",
|
|
3067
|
+
existing,
|
|
3068
|
+
"",
|
|
3069
|
+
"Cover what a newcomer cannot get from the file listing:",
|
|
3070
|
+
" - what this project is, in a sentence or two",
|
|
3071
|
+
" - the build, test and lint commands that actually work here (check the",
|
|
3072
|
+
" package manifest or task runner rather than assuming the usual ones)",
|
|
3073
|
+
" - the layout, and any part of it that is deliberate rather than incidental",
|
|
3074
|
+
" - conventions the code visibly holds to, with the evidence that shows it",
|
|
3075
|
+
" - anything that would let someone break the project without noticing",
|
|
3076
|
+
"",
|
|
3077
|
+
"Keep it short enough to be read in full. Every line costs context on every",
|
|
3078
|
+
"future turn, so a sentence that says nothing is not free."
|
|
3079
|
+
].join("\n");
|
|
3080
|
+
}
|
|
3081
|
+
__name(initPrompt, "initPrompt");
|
|
3082
|
+
function hypermodeAction(args, via) {
|
|
3083
|
+
const choice = args.join(" ").trim().toLowerCase();
|
|
3084
|
+
const alias = via ? { via } : {};
|
|
3085
|
+
if (choice.length === 0) return { kind: "hypermode", enabled: "toggle", ...alias };
|
|
3086
|
+
if (choice === "on") return { kind: "hypermode", enabled: true, ...alias };
|
|
3087
|
+
if (choice === "off") return { kind: "hypermode", enabled: false, ...alias };
|
|
3088
|
+
return {
|
|
3089
|
+
kind: "message",
|
|
3090
|
+
role: "system",
|
|
3091
|
+
content: `Usage: /${via ?? "hypermode"} [on|off]`
|
|
3092
|
+
};
|
|
3093
|
+
}
|
|
3094
|
+
__name(hypermodeAction, "hypermodeAction");
|
|
3095
|
+
function renderHooks(hooks) {
|
|
3096
|
+
const events = Object.entries(hooks ?? {}).filter(([, entries]) => (entries?.length ?? 0) > 0);
|
|
3097
|
+
if (events.length === 0) {
|
|
3098
|
+
return "No hooks. Add a `hooks` key to namzu.config.json or ~/.namzu/config.yaml: event \u2192 list of { command, matcher?, timeoutMs?, if?, once?, statusMessage? }.";
|
|
3099
|
+
}
|
|
3100
|
+
const lines = [];
|
|
3101
|
+
for (const [event, entries] of events) {
|
|
3102
|
+
lines.push(`${event}`);
|
|
3103
|
+
for (const entry of entries ?? []) {
|
|
3104
|
+
const when = entry.matcher ? ` \xB7 matches ${entry.matcher}` : "";
|
|
3105
|
+
const deadline = entry.timeoutMs !== void 0 ? ` \xB7 ${Math.round(entry.timeoutMs / 1e3)}s` : "";
|
|
3106
|
+
const filter = entry.if ? ` \xB7 if ${entry.if}` : "";
|
|
3107
|
+
const once = entry.once ? " \xB7 once" : "";
|
|
3108
|
+
lines.push(` ${entry.command}${when}${filter}${once}${deadline}`);
|
|
3109
|
+
}
|
|
3110
|
+
}
|
|
3111
|
+
return lines.join("\n");
|
|
3112
|
+
}
|
|
3113
|
+
__name(renderHooks, "renderHooks");
|
|
3114
|
+
function renderJobs(jobs) {
|
|
3115
|
+
if (jobs.length === 0) {
|
|
3116
|
+
return "No background jobs in this conversation. The agent starts one with `run_in_background` on bash.";
|
|
3117
|
+
}
|
|
3118
|
+
const lines = jobs.map((job) => {
|
|
3119
|
+
const state = job.status === "running" ? `running for ${Math.max(1, Math.round((Date.now() - job.startedAt) / 1e3))}s` : job.status === "killed" ? "stopped" : `exited ${job.exitCode ?? "?"}`;
|
|
3120
|
+
return `${state.padEnd(16)} ${job.command}`;
|
|
3121
|
+
});
|
|
3122
|
+
return [
|
|
3123
|
+
`${jobs.length} background shell${jobs.length === 1 ? "" : "s"} in this conversation:`,
|
|
3124
|
+
...lines,
|
|
3125
|
+
"",
|
|
3126
|
+
"Use /jobs to inspect output or stop a running shell; /exit stops them all."
|
|
3127
|
+
].join("\n");
|
|
3128
|
+
}
|
|
3129
|
+
__name(renderJobs, "renderJobs");
|
|
3130
|
+
function reportCommand(name, args, render, detailName = "details") {
|
|
3131
|
+
const option = args.join(" ").trim().toLowerCase();
|
|
3132
|
+
const details = option === detailName || option === "details";
|
|
3133
|
+
return {
|
|
3134
|
+
kind: "message",
|
|
3135
|
+
role: "system",
|
|
3136
|
+
content: option.length === 0 || details ? render(details) : `Usage: /${name} [${detailName}]`
|
|
3137
|
+
};
|
|
3138
|
+
}
|
|
3139
|
+
__name(reportCommand, "reportCommand");
|
|
3140
|
+
function commandPickerDescription(description) {
|
|
3141
|
+
const clause = description.split(/[;:]\s|\.\s/u, 1)[0] ?? description;
|
|
3142
|
+
return clause.trim().replace(/\.$/u, "");
|
|
3143
|
+
}
|
|
3144
|
+
__name(commandPickerDescription, "commandPickerDescription");
|
|
3145
|
+
function humanTokens(value) {
|
|
3146
|
+
if (value < 1e3) return String(value);
|
|
3147
|
+
if (value < 1e6) return `${Number((value / 1e3).toFixed(1))}k`;
|
|
3148
|
+
return `${Number((value / 1e6).toFixed(2))}M`;
|
|
3149
|
+
}
|
|
3150
|
+
__name(humanTokens, "humanTokens");
|
|
3151
|
+
function contextMeasurement(usage, details = false) {
|
|
3152
|
+
const context = usage?.context;
|
|
3153
|
+
if (!context || context.windowTokens <= 0)
|
|
3154
|
+
return ["No context size yet. It appears after the first reply."];
|
|
3155
|
+
const percent = Math.min(999, Math.round(context.tokens / context.windowTokens * 100));
|
|
3156
|
+
const approx = context.measured && !context.windowAssumed ? "" : "~";
|
|
3157
|
+
if (!details) {
|
|
3158
|
+
const about = context.measured && !context.windowAssumed ? "" : "about ";
|
|
3159
|
+
return [
|
|
3160
|
+
`Context: ${humanTokens(context.tokens)} of ${humanTokens(context.windowTokens)} used (${about}${percent}%)`
|
|
3161
|
+
];
|
|
3162
|
+
}
|
|
3163
|
+
return [
|
|
3164
|
+
`Context: ${context.tokens.toLocaleString("en-US")} / ${context.windowTokens.toLocaleString("en-US")} tokens (${approx}${percent}%)`,
|
|
3165
|
+
`${context.measured ? "Counted by the provider" : "Estimated by Namzu"}; window ${context.windowAssumed ? "assumed from a table or default" : "declared by the provider or config"}.`
|
|
3166
|
+
];
|
|
3167
|
+
}
|
|
3168
|
+
__name(contextMeasurement, "contextMeasurement");
|
|
3169
|
+
function renderContext(usage, compaction, details = false) {
|
|
3170
|
+
const lines = contextMeasurement(usage, details);
|
|
3171
|
+
if (usage?.context && details)
|
|
3172
|
+
lines.push("Latest reported context size; not cumulative token usage.");
|
|
3173
|
+
lines.push(...contextCleanupLines(compaction, details));
|
|
3174
|
+
if (!details) lines.push("/context details for how it was summarised.");
|
|
3175
|
+
return lines.join("\n");
|
|
3176
|
+
}
|
|
3177
|
+
__name(renderContext, "renderContext");
|
|
3178
|
+
function contextCleanupLines(compaction, details = false) {
|
|
3179
|
+
const lines = [];
|
|
3180
|
+
if (!compaction) {
|
|
3181
|
+
lines.push("Older messages are summarised automatically when the context fills.");
|
|
3182
|
+
return lines;
|
|
3183
|
+
}
|
|
3184
|
+
lines.push(
|
|
3185
|
+
compaction.passes === 0 ? "Nothing summarised yet." : compaction.reclaimedTokens > 0 ? `Summarised ${plural(compaction.passes, "time")}, freeing about ${humanTokens(compaction.reclaimedTokens)} tokens.` : `Summarised ${plural(compaction.passes, "time")}.`
|
|
3186
|
+
);
|
|
3187
|
+
if (details) {
|
|
3188
|
+
const pct = /* @__PURE__ */ __name((fraction) => `${Math.round(fraction * 100)}%`, "pct");
|
|
3189
|
+
lines.push(`Strategy: ${compaction.strategy}`);
|
|
3190
|
+
if (compaction.strategy === "salience") {
|
|
3191
|
+
lines.push(
|
|
3192
|
+
`Older, less useful content is shortened from ${pct(compaction.softTarget)} of the window; older history is summarised at ${pct(compaction.triggerThreshold)}.`
|
|
3193
|
+
);
|
|
3194
|
+
} else {
|
|
3195
|
+
lines.push(
|
|
3196
|
+
`Older tool results are cleared at ${pct(compaction.triggerThreshold)} of the window; history is summarised if needed.`
|
|
3197
|
+
);
|
|
3198
|
+
}
|
|
3199
|
+
lines.push(
|
|
3200
|
+
`Tool results cleared: ${compaction.clearedResults.toLocaleString("en-US")}`,
|
|
3201
|
+
`Messages shortened: ${compaction.stubbedNarrations.toLocaleString("en-US")}`,
|
|
3202
|
+
`Summaries written: ${compaction.summaries.toLocaleString("en-US")}`
|
|
3203
|
+
);
|
|
3204
|
+
}
|
|
3205
|
+
return lines;
|
|
3206
|
+
}
|
|
3207
|
+
__name(contextCleanupLines, "contextCleanupLines");
|
|
3208
|
+
function costAmount(cost) {
|
|
3209
|
+
if (cost.unpricedTokens > 0) {
|
|
3210
|
+
return cost.totalCost > 0 ? `at least $${cost.totalCost.toFixed(4)}` : "not known";
|
|
3211
|
+
}
|
|
3212
|
+
return `$${cost.totalCost.toFixed(4)}${cost.totalCost === 0 ? " (measured zero)" : ""}`;
|
|
3213
|
+
}
|
|
3214
|
+
__name(costAmount, "costAmount");
|
|
3215
|
+
function renderCost(usage, compaction = null, details = false) {
|
|
3216
|
+
if (usage === null) return "No usage reported yet. Send a message to begin.";
|
|
3217
|
+
const lines = [
|
|
3218
|
+
"Latest reply",
|
|
3219
|
+
`Tokens: ${usage.totalTokens.toLocaleString("en-US")}`,
|
|
3220
|
+
`Cost: ${costAmount(usage.cost)}`
|
|
3221
|
+
];
|
|
3222
|
+
if (usage.cost.unpricedTokens > 0) {
|
|
3223
|
+
lines.push(
|
|
3224
|
+
`${usage.cost.unpricedTokens.toLocaleString("en-US")} tokens have no known price and are left out of the cost.`
|
|
3225
|
+
);
|
|
3226
|
+
}
|
|
3227
|
+
if (usage.budget) {
|
|
3228
|
+
lines.push(
|
|
3229
|
+
`With the agents it started: ${usage.budget.treeTokens.toLocaleString("en-US")} tokens`
|
|
3230
|
+
);
|
|
3231
|
+
if (usage.budget.limit !== 0)
|
|
3232
|
+
lines.push(`Limit: ${usage.budget.limit.toLocaleString("en-US")} tokens`);
|
|
3233
|
+
if ((usage.budget.unresolvedRequests ?? 0) > 0)
|
|
3234
|
+
lines.push(
|
|
3235
|
+
`${plural(usage.budget.unresolvedRequests ?? 0, "request")} without confirmed usage; token totals are measured usage, not a complete spend total.`
|
|
3236
|
+
);
|
|
3237
|
+
if (usage.budget.poisoned)
|
|
3238
|
+
lines.push("Further spending is blocked until usage for those requests is confirmed.");
|
|
3239
|
+
}
|
|
3240
|
+
if (details) {
|
|
3241
|
+
lines.push(
|
|
3242
|
+
"Cost covers the latest reply\u2019s own model calls, excluding delegated work and earlier replies. These are not conversation totals."
|
|
3243
|
+
);
|
|
3244
|
+
if (usage.cost.unpricedTokens > 0) {
|
|
3245
|
+
lines.push("Missing prices do not mean those tokens were free.");
|
|
3246
|
+
} else {
|
|
3247
|
+
lines.push("All reported tokens have a known rate.");
|
|
3248
|
+
}
|
|
3249
|
+
if (usage.cost.cacheDiscount > 0)
|
|
3250
|
+
lines.push(`Cache discount: $${usage.cost.cacheDiscount.toFixed(4)}`);
|
|
3251
|
+
if (usage.context && usage.context.windowTokens > 0) {
|
|
3252
|
+
lines.push("", ...contextMeasurement(usage, true), "/context details for automatic cleanup.");
|
|
3253
|
+
}
|
|
3254
|
+
if (compaction) lines.push(`Cleanup passes in this conversation: ${compaction.passes}.`);
|
|
3255
|
+
} else {
|
|
3256
|
+
lines.push("/cost details for scope and pricing; /context for context size.");
|
|
3257
|
+
}
|
|
3258
|
+
return lines.join("\n");
|
|
3259
|
+
}
|
|
3260
|
+
__name(renderCost, "renderCost");
|
|
3261
|
+
function reviewPrompt(stat, untracked) {
|
|
3262
|
+
const lines = [
|
|
3263
|
+
"Review the uncommitted work in this repository.",
|
|
3264
|
+
"",
|
|
3265
|
+
"`git diff HEAD` reports:",
|
|
3266
|
+
"",
|
|
3267
|
+
stat.length > 0 ? stat : "(no tracked file changed)"
|
|
3268
|
+
];
|
|
3269
|
+
if (untracked.length > 0) {
|
|
3270
|
+
lines.push("", "Untracked, which no diff shows:", ...untracked.map((p) => ` ${p}`));
|
|
3271
|
+
}
|
|
3272
|
+
lines.push(
|
|
3273
|
+
"",
|
|
3274
|
+
"Read what you need \u2014 the diff, the files around it, the tests. Then report:",
|
|
3275
|
+
"",
|
|
3276
|
+
"- Correctness problems, each tied to a file and line, with the input or",
|
|
3277
|
+
" state that produces the wrong behaviour. If you cannot name one, do not",
|
|
3278
|
+
" raise the finding.",
|
|
3279
|
+
"- Anything the change claims in a comment or a message that the code does",
|
|
3280
|
+
" not do.",
|
|
3281
|
+
"- Tests that would pass whether or not the change is correct.",
|
|
3282
|
+
"",
|
|
3283
|
+
"Do not summarise the diff back to me \u2014 I can read it, and a summary is what",
|
|
3284
|
+
"a review turns into when it has nothing to say. If the work looks right,",
|
|
3285
|
+
"say so in one line and stop. Say plainly what you did not examine."
|
|
3286
|
+
);
|
|
3287
|
+
return lines.join("\n");
|
|
3288
|
+
}
|
|
3289
|
+
__name(reviewPrompt, "reviewPrompt");
|
|
3290
|
+
function baseBranchReviewPrompt(mergeBaseSha) {
|
|
3291
|
+
return reviewTargetPrompt([
|
|
3292
|
+
"Review the changes between the current working tree and its selected base branch.",
|
|
3293
|
+
`The host resolved the merge base to ${mergeBaseSha}.`,
|
|
3294
|
+
`Use \`git diff ${mergeBaseSha}\` as the comparison boundary.`
|
|
3295
|
+
]);
|
|
3296
|
+
}
|
|
3297
|
+
__name(baseBranchReviewPrompt, "baseBranchReviewPrompt");
|
|
3298
|
+
function commitReviewPrompt(sha) {
|
|
3299
|
+
return reviewTargetPrompt([
|
|
3300
|
+
`Review the code changes introduced by commit ${sha}.`,
|
|
3301
|
+
`Use \`git show --stat --oneline ${sha}\` and \`git diff ${sha}^ ${sha}\` as the boundary.`
|
|
3302
|
+
]);
|
|
3303
|
+
}
|
|
3304
|
+
__name(commitReviewPrompt, "commitReviewPrompt");
|
|
3305
|
+
function reviewTargetPrompt(target) {
|
|
3306
|
+
return [
|
|
3307
|
+
...target,
|
|
3308
|
+
"",
|
|
3309
|
+
"Read the changed files and surrounding code, then report prioritized, actionable findings.",
|
|
3310
|
+
"Every finding must name the file, line and concrete state that produces the wrong behavior.",
|
|
3311
|
+
"Do not summarize the change back to me. If there are no findings, say so in one line.",
|
|
3312
|
+
"Say plainly what you did not examine."
|
|
3313
|
+
].join("\n");
|
|
3314
|
+
}
|
|
3315
|
+
__name(reviewTargetPrompt, "reviewTargetPrompt");
|
|
3316
|
+
function renderMcp(mcp, details = false) {
|
|
3317
|
+
if (mcp === null) return "Not connected yet. Tool servers have not been checked.";
|
|
3318
|
+
if (mcp.connected.length === 0 && mcp.failed.length === 0) {
|
|
3319
|
+
return "No tool servers configured. Add mcpServers to namzu.config.json.";
|
|
3320
|
+
}
|
|
3321
|
+
const lines = [
|
|
3322
|
+
`Tool servers: ${mcp.connected.length} connected, ${mcp.failed.length} unavailable.`
|
|
3323
|
+
];
|
|
3324
|
+
for (const server of mcp.connected) {
|
|
3325
|
+
lines.push(`${server.name}: connected, ${server.tools.length} tools`);
|
|
3326
|
+
const drift = server.drift;
|
|
3327
|
+
if (drift) {
|
|
3328
|
+
for (const name of drift.added) lines.push(` added: ${terminalDisplayText(name)}`);
|
|
3329
|
+
for (const name of drift.removed) lines.push(` removed: ${terminalDisplayText(name)}`);
|
|
3330
|
+
for (const name of drift.changed)
|
|
3331
|
+
lines.push(` changed, earlier definition held: ${terminalDisplayText(name)}`);
|
|
3332
|
+
}
|
|
3333
|
+
for (const item of server.refused ?? []) {
|
|
3334
|
+
lines.push(` refused ${item.kind}: ${terminalDisplayText(item.name)} (${item.reason})`);
|
|
3335
|
+
}
|
|
3336
|
+
if (details) {
|
|
3337
|
+
if (server.instructions) {
|
|
3338
|
+
const safe = terminalDisplayText(server.instructions).replace(/\s+/g, " ").trim();
|
|
3339
|
+
lines.push(` instructions: ${safe.length > 300 ? `${safe.slice(0, 300)}\u2026` : safe}`);
|
|
3340
|
+
}
|
|
3341
|
+
for (const tool of server.tools) lines.push(` ${tool}`);
|
|
3342
|
+
}
|
|
3343
|
+
}
|
|
3344
|
+
for (const server of mcp.failed) lines.push(`${server.name}: unavailable \u2014 ${server.reason}`);
|
|
3345
|
+
if (!details && mcp.connected.length > 0) lines.push("/mcp tools to list available tools.");
|
|
3346
|
+
return lines.join("\n");
|
|
3347
|
+
}
|
|
3348
|
+
__name(renderMcp, "renderMcp");
|
|
3349
|
+
function statusRows(ctx) {
|
|
3350
|
+
const current2 = ctx.permissions.currentMode();
|
|
3351
|
+
const permissions = current2.mode;
|
|
3352
|
+
const rows = [
|
|
3353
|
+
["Version", CLI_VERSION],
|
|
3354
|
+
["Model", ctx.modelSummary ?? "Not selected"],
|
|
3355
|
+
["Reasoning", ctx.reasoningEffort.current() ?? "Model default"],
|
|
3356
|
+
["Provider", ctx.providerSummary ?? "None. Run /model to choose one."],
|
|
3357
|
+
["Folder", displayPath(ctx.cwd, Math.max(16, Math.min(96, (ctx.columns ?? 80) - 6) - 20))],
|
|
3358
|
+
["Permissions", permissionModeLabel(permissions)],
|
|
3359
|
+
["Sandbox", sandboxInWords(ctx.sandbox)],
|
|
3360
|
+
["Web search", ctx.webSearchSummary ?? "Not set up yet"],
|
|
3361
|
+
["Instructions", ctx.instructionFiles.map((file) => homePath(file)).join(", ") || "None"]
|
|
3362
|
+
];
|
|
3363
|
+
if (ctx.sandbox?.workspace)
|
|
3364
|
+
rows.push([
|
|
3365
|
+
"Workspace",
|
|
3366
|
+
ctx.sandbox.workspace === "ephemeral" ? "Temporary files, removed when the reply ends" : "Your real project files; edits are kept"
|
|
3367
|
+
]);
|
|
3368
|
+
if (ctx.usage) {
|
|
3369
|
+
rows.push(["Tokens", `${ctx.usage.totalTokens.toLocaleString("en-US")} \xB7 latest reply`]);
|
|
3370
|
+
rows.push(["Spend", `${costAmount(ctx.usage.cost)} \xB7 latest reply`]);
|
|
3371
|
+
if (ctx.usage.context) {
|
|
3372
|
+
const context = ctx.usage.context;
|
|
3373
|
+
rows.push([
|
|
3374
|
+
"Context",
|
|
3375
|
+
`${humanTokens(context.tokens)} of ${humanTokens(context.windowTokens)}${context.measured && !context.windowAssumed ? "" : " \xB7 estimated"}`
|
|
3376
|
+
]);
|
|
3377
|
+
}
|
|
3378
|
+
}
|
|
3379
|
+
return rows;
|
|
3380
|
+
}
|
|
3381
|
+
__name(statusRows, "statusRows");
|
|
3382
|
+
function sandboxInWords(sandbox) {
|
|
3383
|
+
if (!sandbox) return "Not set up yet";
|
|
3384
|
+
if (sandbox.unconfined) return "Off. Commands run on this computer with your access.";
|
|
3385
|
+
return `${sandbox.environment ?? "On"}${sandbox.enforced.length > 0 ? ` \xB7 limits ${sandbox.enforced.join(", ")}` : ""}`;
|
|
3386
|
+
}
|
|
3387
|
+
__name(sandboxInWords, "sandboxInWords");
|
|
3388
|
+
function renderStatus(ctx, details = false) {
|
|
3389
|
+
if (!details)
|
|
3390
|
+
return `${statusCard(statusRows(ctx), ctx.columns)}
|
|
3391
|
+
/config changes settings \xB7 /status details for the full report`;
|
|
3392
|
+
const lines = [
|
|
3393
|
+
`Provider: ${ctx.providerSummary ?? "none \u2014 run /model to choose one"}`,
|
|
3394
|
+
`Model: ${ctx.modelSummary ?? "not selected"}`,
|
|
3395
|
+
`Working directory: ${homePath(ctx.cwd)}`,
|
|
3396
|
+
...installationRows().map(
|
|
3397
|
+
([key, value]) => `${key}: ${key === "Executable" ? homePath(value) : value}`
|
|
3398
|
+
),
|
|
3399
|
+
...ctx.sessionId ? [`Conversation: ${ctx.sessionId}`] : [],
|
|
3400
|
+
...renderPermissions(ctx.permissions, details).split("\n")
|
|
3401
|
+
];
|
|
3402
|
+
const sandbox = ctx.sandbox;
|
|
3403
|
+
if (!sandbox) {
|
|
3404
|
+
lines.push("Sandbox: not resolved yet.");
|
|
3405
|
+
} else if (sandbox.unconfined) {
|
|
3406
|
+
lines.push("Sandbox: commands are not confined; they have this shell\u2019s access.");
|
|
3407
|
+
} else {
|
|
3408
|
+
lines.push(
|
|
3409
|
+
`Sandbox: ${sandbox.environment ?? "active"}; enforces ${sandbox.enforced.join(", ") || "no reported restrictions"}.`
|
|
3410
|
+
);
|
|
3411
|
+
}
|
|
3412
|
+
if (sandbox?.workspace === "ephemeral") {
|
|
3413
|
+
lines.push("Workspace: temporary files; removed when the reply ends.");
|
|
3414
|
+
} else if (sandbox?.workspace === "working-directory" || sandbox?.workspace === "host") {
|
|
3415
|
+
lines.push("Workspace: real project files; edits persist.");
|
|
3416
|
+
}
|
|
3417
|
+
if (details) {
|
|
3418
|
+
for (const dir of ctx.directories?.() ?? []) lines.push(`Additional directory: ${dir}`);
|
|
3419
|
+
if (sandbox) {
|
|
3420
|
+
lines.push(
|
|
3421
|
+
`Required isolation: ${sandbox.required.length > 0 ? sandbox.required.join(", ") : "none"}.`
|
|
3422
|
+
);
|
|
3423
|
+
if (sandbox.required.length > 0)
|
|
3424
|
+
lines.push("Without the required isolation, Namzu will not start.");
|
|
3425
|
+
}
|
|
3426
|
+
lines.push("/status config for setting sources; /status tools for available tools.");
|
|
3427
|
+
}
|
|
3428
|
+
if (ctx.usage) lines.push(`Spend (latest reply): ${costAmount(ctx.usage.cost)}`);
|
|
3429
|
+
if (!details) lines.push("/status details for rules and workspace details.");
|
|
3430
|
+
return lines.join("\n");
|
|
3431
|
+
}
|
|
3432
|
+
__name(renderStatus, "renderStatus");
|
|
3433
|
+
function renderPermissions(permissions, details = false) {
|
|
3434
|
+
const current2 = permissions.currentMode();
|
|
3435
|
+
const effective = current2.mode;
|
|
3436
|
+
const lines = [
|
|
3437
|
+
`Permissions: ${permissionModeLabel(effective)}. ${permissionModeDescription(effective)}`
|
|
3438
|
+
];
|
|
3439
|
+
if (!details) return lines.join("\n");
|
|
3440
|
+
if (current2.source === "launch-bypass")
|
|
3441
|
+
lines.push("Selected at launch with --dangerously-skip-permissions.");
|
|
3442
|
+
if (current2.source === "launch-flag") lines.push("Selected at launch with --permission-mode.");
|
|
3443
|
+
if (current2.source === "config-default")
|
|
3444
|
+
lines.push("Selected by permissions.defaultMode in your configuration.");
|
|
3445
|
+
lines.push("Explicit deny rules and the built-in safety gate apply in every mode.");
|
|
3446
|
+
if (current2.mode === "plan")
|
|
3447
|
+
lines.push("Plan mode also blocks writes that an allow rule would otherwise permit.");
|
|
3448
|
+
const exempt = permissions.neverPrompted();
|
|
3449
|
+
if (exempt.length > 0) {
|
|
3450
|
+
lines.push(`Tools exempt from ordinary prompts: ${exempt.join(", ")}.`);
|
|
3451
|
+
lines.push(
|
|
3452
|
+
"Destructive calls still require review; the selected mode decides whether to allow, ask or refuse. Plan mode still requires read-only tools."
|
|
3453
|
+
);
|
|
3454
|
+
}
|
|
3455
|
+
if (effective === "prompt" || effective === "accept-edits" || effective === "plan") {
|
|
3456
|
+
lines.push(
|
|
3457
|
+
'Read-only agents (explore, or an agent file with readOnly: true) on the conversation\u2019s model start without asking; each call they make is still reviewed. A permissions rule Agent: "ask" asks about every launch.'
|
|
3458
|
+
);
|
|
3459
|
+
}
|
|
3460
|
+
if (permissions.rules.length > 0) {
|
|
3461
|
+
lines.push(
|
|
3462
|
+
`Rules (${permissions.rules.length}):`,
|
|
3463
|
+
...permissions.rules.map((rule) => ` ${describeRule(rule)}`)
|
|
3464
|
+
);
|
|
3465
|
+
} else {
|
|
3466
|
+
lines.push("No custom rules. Configure permissions in namzu.config.json.");
|
|
3467
|
+
}
|
|
3468
|
+
return lines.join("\n");
|
|
3469
|
+
}
|
|
3470
|
+
__name(renderPermissions, "renderPermissions");
|
|
3471
|
+
function describeRule(rule) {
|
|
3472
|
+
switch (rule.type) {
|
|
3473
|
+
case "deny_by_name":
|
|
3474
|
+
return `deny ${rule.toolNames.join(", ")}`;
|
|
3475
|
+
case "allow_by_name":
|
|
3476
|
+
return `allow ${rule.toolNames.join(", ")}`;
|
|
3477
|
+
case "by_source": {
|
|
3478
|
+
const verb = rule.decision === "review" ? "review" : rule.decision;
|
|
3479
|
+
return `${verb} tools from source ${rule.sources.join(", ")}`;
|
|
3480
|
+
}
|
|
3481
|
+
case "allow_by_category":
|
|
3482
|
+
return `allow any tool in category: ${rule.categories.join(", ")}`;
|
|
3483
|
+
case "allow_by_tier":
|
|
3484
|
+
return `allow any tool in tier: ${rule.tiers.join(", ")}`;
|
|
3485
|
+
case "allow_read_only":
|
|
3486
|
+
return "allow any tool that only observes";
|
|
3487
|
+
case "deny_dangerous_patterns":
|
|
3488
|
+
return "deny the built-in catastrophic-command patterns";
|
|
3489
|
+
case "argument_pattern": {
|
|
3490
|
+
const verb = rule.decision === "deny" ? "deny " : "allow ";
|
|
3491
|
+
return `${verb} ${rule.toolNames.join(", ")} when ${rule.argument} matches ${rule.pattern}`;
|
|
3492
|
+
}
|
|
3493
|
+
case "custom_pattern": {
|
|
3494
|
+
const verb = rule.decision === "deny" ? "deny " : "allow ";
|
|
3495
|
+
const where = rule.target === "both" ? "name+args" : rule.target;
|
|
3496
|
+
return `${verb} ${where} matching ${rule.pattern}`;
|
|
3497
|
+
}
|
|
3498
|
+
case "predicate":
|
|
3499
|
+
return `decide ${rule.description}`;
|
|
3500
|
+
default: {
|
|
3501
|
+
const exhaustive = rule;
|
|
3502
|
+
return `unrecognised rule: ${JSON.stringify(exhaustive)}`;
|
|
3503
|
+
}
|
|
3504
|
+
}
|
|
3505
|
+
}
|
|
3506
|
+
__name(describeRule, "describeRule");
|
|
3507
|
+
function renderAgents(ids) {
|
|
3508
|
+
if (ids.length === 0) {
|
|
3509
|
+
return "No delegates. This conversation has no delegation tool, so it does the work itself.";
|
|
3510
|
+
}
|
|
3511
|
+
return [
|
|
3512
|
+
`Delegates (${ids.length}):`,
|
|
3513
|
+
...ids.map((id) => ` ${id}`),
|
|
3514
|
+
"",
|
|
3515
|
+
"The agent dispatches to these itself when a task suits one. It may also",
|
|
3516
|
+
"define a specialist for a single task, which is not listed here because",
|
|
3517
|
+
"it does not exist until the agent asks for it."
|
|
3518
|
+
].join("\n");
|
|
3519
|
+
}
|
|
3520
|
+
__name(renderAgents, "renderAgents");
|
|
3521
|
+
function runSlash(line, ctx, builtins = CLI_LOCAL_COMMANDS) {
|
|
3522
|
+
const parsed = parseSlash(line);
|
|
3523
|
+
if (!parsed) return null;
|
|
3524
|
+
const cmd = builtins.find((c) => c.name === parsed.name);
|
|
3525
|
+
if (cmd) {
|
|
3526
|
+
const commandContext = { ...ctx, builtins };
|
|
3527
|
+
const reason = cmd.unavailable?.(commandContext);
|
|
3528
|
+
return reason ? { kind: "message", role: "system", content: reason } : cmd.action(commandContext, parsed.args);
|
|
3529
|
+
}
|
|
3530
|
+
const user = ctx.userCommands.find((c) => c.name === parsed.name);
|
|
3531
|
+
if (user) {
|
|
3532
|
+
const expanded = expandCommand(user, parsed.args.join(" "));
|
|
3533
|
+
return expanded.ok ? { kind: "prompt", text: expanded.prompt } : { kind: "message", role: "system", content: expanded.reason };
|
|
3534
|
+
}
|
|
3535
|
+
return {
|
|
3536
|
+
kind: "message",
|
|
3537
|
+
role: "system",
|
|
3538
|
+
content: `Unknown command: /${parsed.name}. Try /help.`
|
|
3539
|
+
};
|
|
3540
|
+
}
|
|
3541
|
+
__name(runSlash, "runSlash");
|
|
3542
|
+
|
|
3543
|
+
export {
|
|
3544
|
+
TURN_LIMIT_FIELDS,
|
|
3545
|
+
turnLimitCommands,
|
|
3546
|
+
discoverUserCommands,
|
|
3547
|
+
expandHeadlessCommand,
|
|
3548
|
+
require_react,
|
|
3549
|
+
setReducedMotion,
|
|
3550
|
+
reducedMotion,
|
|
3551
|
+
motionAllowed,
|
|
3552
|
+
useReducedMotion,
|
|
3553
|
+
backgroundFromColorFgBg,
|
|
3554
|
+
queryTerminalBackground,
|
|
3555
|
+
setThemeSetting,
|
|
3556
|
+
setThemePreview,
|
|
3557
|
+
savedThemeSetting,
|
|
3558
|
+
shownTheme,
|
|
3559
|
+
ThemeEpochContext,
|
|
3560
|
+
useThemeEpoch,
|
|
3561
|
+
useThemeSubscription,
|
|
3562
|
+
saveTheme,
|
|
3563
|
+
saveReducedMotion,
|
|
3564
|
+
describeReducedMotion,
|
|
3565
|
+
matchSlashCommands,
|
|
3566
|
+
mergeHostCommands,
|
|
3567
|
+
renderOutcome,
|
|
3568
|
+
hostCommandNames,
|
|
3569
|
+
kernelCommandDescriptors,
|
|
3570
|
+
parseSlash,
|
|
3571
|
+
commandPickerDescription,
|
|
3572
|
+
renderContext,
|
|
3573
|
+
contextCleanupLines,
|
|
3574
|
+
reviewPrompt,
|
|
3575
|
+
baseBranchReviewPrompt,
|
|
3576
|
+
commitReviewPrompt,
|
|
3577
|
+
renderAgents,
|
|
3578
|
+
runSlash
|
|
3579
|
+
};
|
|
3580
|
+
/*! Bundled license information:
|
|
3581
|
+
|
|
3582
|
+
react/cjs/react.production.js:
|
|
3583
|
+
(**
|
|
3584
|
+
* @license React
|
|
3585
|
+
* react.production.js
|
|
3586
|
+
*
|
|
3587
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3588
|
+
*
|
|
3589
|
+
* This source code is licensed under the MIT license found in the
|
|
3590
|
+
* LICENSE file in the root directory of this source tree.
|
|
3591
|
+
*)
|
|
3592
|
+
|
|
3593
|
+
react/cjs/react.development.js:
|
|
3594
|
+
(**
|
|
3595
|
+
* @license React
|
|
3596
|
+
* react.development.js
|
|
3597
|
+
*
|
|
3598
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3599
|
+
*
|
|
3600
|
+
* This source code is licensed under the MIT license found in the
|
|
3601
|
+
* LICENSE file in the root directory of this source tree.
|
|
3602
|
+
*)
|
|
3603
|
+
*/
|
|
3604
|
+
//# sourceMappingURL=chunk-RLMKDLGK.js.map
|