@humain/humain-code 0.8.3 → 0.8.5
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 +147 -0
- package/dist/bundle/agent-monitor.js +1 -1
- package/dist/bundle/chunks/anthropic-messages-42CGJCSR.js +82 -0
- package/dist/bundle/chunks/ask-VH7GNX75.js +97 -0
- package/dist/bundle/chunks/azure-openai-responses-DOKKMBUN.js +15 -0
- package/dist/bundle/chunks/bedrock-converse-stream.js +200 -179
- package/dist/bundle/chunks/bowser-UX7KDMIY.js +92 -0
- package/dist/bundle/chunks/{chunk-46C6D7UC.js → chunk-2CYGUEQO.js} +1 -1
- package/dist/bundle/chunks/chunk-2RXTZK2V.js +177 -0
- package/dist/bundle/chunks/{chunk-2XD7TLKB.js → chunk-3OOOEJV4.js} +16 -16
- package/dist/bundle/chunks/chunk-3RXT35Y3.js +3 -0
- package/dist/bundle/chunks/{chunk-MPRAQ6ZI.js → chunk-4LGBXPUD.js} +1 -1
- package/dist/bundle/chunks/chunk-4SL6URR3.js +90 -0
- package/dist/bundle/chunks/{chunk-AW24RHGJ.js → chunk-53DWQSBC.js} +4 -4
- package/dist/bundle/chunks/{chunk-LSRXA7OS.js → chunk-5C5K4EVJ.js} +3 -3
- package/dist/bundle/chunks/{chunk-2JNJJ6SZ.js → chunk-5KUCY54O.js} +3 -3
- package/dist/bundle/chunks/{chunk-4TDNOR36.js → chunk-625QJSFJ.js} +1 -1
- package/dist/bundle/chunks/chunk-7DIRHF4H.js +17 -0
- package/dist/bundle/chunks/{chunk-QJB5YI3I.js → chunk-7PAXKU7M.js} +1 -1
- package/dist/bundle/chunks/chunk-7XRMMCKG.js +2477 -0
- package/dist/bundle/chunks/{chunk-R2KD2HFT.js → chunk-7YB3HRRN.js} +83 -196
- package/dist/bundle/chunks/{chunk-DCXHRP6C.js → chunk-A2UZYK23.js} +13 -13
- package/dist/bundle/chunks/chunk-A5ZMBTTM.js +12 -0
- package/dist/bundle/chunks/{chunk-JKX5EGOT.js → chunk-AER66CNP.js} +13 -13
- package/dist/bundle/chunks/chunk-B3FT6L6S.js +131 -0
- package/dist/bundle/chunks/{chunk-VSXVZVBE.js → chunk-BDNX23GT.js} +433 -412
- package/dist/bundle/chunks/chunk-BIC5BSNX.js +13 -0
- package/dist/bundle/chunks/{chunk-JSHKS7VH.js → chunk-BNZZJ4LO.js} +1 -1
- package/dist/bundle/chunks/{chunk-4MKATHT2.js → chunk-CG43CMFH.js} +1 -1
- package/dist/bundle/chunks/{chunk-VFLVWPLZ.js → chunk-CKFLQGJN.js} +20 -16
- package/dist/bundle/chunks/{chunk-7LSTTCSC.js → chunk-COZTJAOY.js} +348 -177
- package/dist/bundle/chunks/chunk-D4UCXXDP.js +115 -0
- package/dist/bundle/chunks/{chunk-HQMUDHC3.js → chunk-D6ZWWDW5.js} +6 -5
- package/dist/bundle/chunks/{chunk-MUN4ZZZP.js → chunk-EWPEY4F4.js} +1341 -1366
- package/dist/bundle/chunks/{chunk-FJIISX5W.js → chunk-F74XLJPC.js} +195 -192
- package/dist/bundle/chunks/chunk-FDRBTGFJ.js +4 -0
- package/dist/bundle/chunks/chunk-FHP5BULR.js +5 -0
- package/dist/bundle/chunks/{chunk-E4VUW4RI.js → chunk-FLWO3H5J.js} +12 -12
- package/dist/bundle/chunks/{chunk-KLSRGGOH.js → chunk-G2PFPQX7.js} +2 -2
- package/dist/bundle/chunks/chunk-GMPJWLZS.js +57 -0
- package/dist/bundle/chunks/{chunk-M5TVWJ5T.js → chunk-H35P7ROY.js} +462 -441
- package/dist/bundle/chunks/chunk-HCHCYBNK.js +2 -0
- package/dist/bundle/chunks/{chunk-7WE77IE3.js → chunk-HRNYDRL7.js} +1 -1
- package/dist/bundle/chunks/chunk-HWFAAGYK.js +23 -0
- package/dist/bundle/chunks/{chunk-PVNXN2TC.js → chunk-II5C7G67.js} +1 -1
- package/dist/bundle/chunks/{chunk-F2H47FRF.js → chunk-IMRZP5SC.js} +182 -137
- package/dist/bundle/chunks/chunk-J64VNQ6D.js +13 -0
- package/dist/bundle/chunks/{chunk-65FLSKDA.js → chunk-K5EFEIFP.js} +5 -4
- package/dist/bundle/chunks/{chunk-KI7CHPWC.js → chunk-KJ3QRSSY.js} +46 -43
- package/dist/bundle/chunks/{cli-6DJO467D.js → chunk-KSEO2LRK.js} +12 -10
- package/dist/bundle/chunks/{chunk-HHWVVNGG.js → chunk-MA2WCMSN.js} +2 -2
- package/dist/bundle/chunks/{chunk-L4J7SMJB.js → chunk-MAEKQSFU.js} +1 -1
- package/dist/bundle/chunks/chunk-MHQNLTZR.js +8 -0
- package/dist/bundle/chunks/chunk-MLOUZAVZ.js +122 -0
- package/dist/bundle/chunks/chunk-MQYR4Q6X.js +5 -0
- package/dist/bundle/chunks/chunk-MXF3KYLZ.js +4 -0
- package/dist/bundle/chunks/{chunk-GY663MNP.js → chunk-MZRTVX7F.js} +1 -1
- package/dist/bundle/chunks/chunk-MZYHSWHX.js +59 -0
- package/dist/bundle/chunks/chunk-N3W4ALAM.js +1151 -0
- package/dist/bundle/chunks/{chunk-6HTHDVJC.js → chunk-NPVRWPGX.js} +1 -1
- package/dist/bundle/chunks/{chunk-BRSLXHED.js → chunk-O44A4E4K.js} +1 -1
- package/dist/bundle/chunks/{chunk-T2ZGMEMV.js → chunk-OADQOW67.js} +175 -260
- package/dist/bundle/chunks/{chunk-J4GII2EE.js → chunk-P7SLTLSZ.js} +51 -46
- package/dist/bundle/chunks/{chunk-7OZNMWAJ.js → chunk-PPGSQZZF.js} +1 -1
- package/dist/bundle/chunks/chunk-PYX6ZCC7.js +29 -0
- package/dist/bundle/chunks/chunk-PZ7NYBHJ.js +8 -0
- package/dist/bundle/chunks/{chunk-VCMXBP5S.js → chunk-QESIDBMW.js} +1 -7
- package/dist/bundle/chunks/chunk-QUWVILLB.js +3 -0
- package/dist/bundle/chunks/chunk-QZWUXGY7.js +99 -0
- package/dist/bundle/chunks/{chunk-MIAXMK5F.js → chunk-QZXLTW7V.js} +8 -7
- package/dist/bundle/chunks/chunk-RP6MWUAP.js +4 -0
- package/dist/bundle/chunks/chunk-SASR4VNV.js +17 -0
- package/dist/bundle/chunks/{chunk-JSZBTGI6.js → chunk-SZZ5PNP6.js} +2 -2
- package/dist/bundle/chunks/chunk-T5WECB2D.js +7 -0
- package/dist/bundle/chunks/{chunk-2NVGOSBN.js → chunk-T7F2TEIS.js} +37 -13
- package/dist/bundle/chunks/{chunk-ZSWU5KKA.js → chunk-UOSJTMCL.js} +7 -3
- package/dist/bundle/chunks/{chunk-6P6MMQUH.js → chunk-UTRUALFN.js} +3 -3
- package/dist/bundle/chunks/{chunk-PWFM6AQQ.js → chunk-V2HTCZRF.js} +70 -67
- package/dist/bundle/chunks/{chunk-4GB7A76U.js → chunk-VWUEKLRH.js} +225 -348
- package/dist/bundle/chunks/{chunk-JX6YIPNK.js → chunk-WCKS2DPT.js} +1 -1
- package/dist/bundle/chunks/chunk-XGOJCV6Z.js +2 -0
- package/dist/bundle/chunks/{chunk-7WETECIB.js → chunk-Z7BWHPJ2.js} +1 -1
- package/dist/bundle/chunks/chunk-ZFFDBTG3.js +17 -0
- package/dist/bundle/chunks/cli-NJLV3XDZ.js +3 -0
- package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-JEZVYITT.js → cloudflare-workers-ai-system-one-ZAZW4M4B.js} +1 -1
- package/dist/bundle/chunks/{compat-4ILE5BEC.js → compat-2RC4CJNV.js} +12 -12
- package/dist/bundle/chunks/{curator-server-QB4GITGS.js → curator-server-MW645JI3.js} +2 -2
- package/dist/bundle/chunks/{dist-NXHRL2KY.js → dist-3DAGUOYC.js} +2 -2
- package/dist/bundle/chunks/{dist-I6CI3CG5.js → dist-K4QIXV5O.js} +9 -9
- package/dist/bundle/chunks/{dist-35STTNYA.js → dist-NI2PTSLH.js} +1 -1
- package/dist/bundle/chunks/{dist-CBODG4CA.js → dist-VXQT3DQY.js} +6 -6
- package/dist/bundle/chunks/{dist-cjs-EROMDUKS.js → dist-cjs-4JQA6W3S.js} +31 -31
- package/dist/bundle/chunks/doctor-EH7X36SK.js +83 -0
- package/dist/bundle/chunks/{easter-egg-3d-VZC5WOYV.js → easter-egg-3d-Z24JLXD4.js} +1 -1
- package/dist/bundle/chunks/entry-3EL6GOWK.js +2 -0
- package/dist/bundle/chunks/{entry-6XDR2IDE.js → entry-4IMREZBD.js} +80 -79
- package/dist/bundle/chunks/{execute-6MEJJF2T.js → execute-C4BZQRPQ.js} +23 -22
- package/dist/bundle/chunks/{extract-L373D6O7.js → extract-XVQCIS7D.js} +5 -5
- package/dist/bundle/chunks/{flow-implementer-XOP4MG5X.js → flow-implementer-J6QTLBTH.js} +5 -5
- package/dist/bundle/chunks/github-copilot.js +57 -56
- package/dist/bundle/chunks/google-generative-ai-P2P45MYP.js +22 -0
- package/dist/bundle/chunks/google-vertex-SHY4IS5F.js +26 -0
- package/dist/bundle/chunks/{host-WOLZCWQQ.js → host-YESS2VAB.js} +1 -1
- package/dist/bundle/chunks/{index.bundle-HONF3PUD.js → index.bundle-TZT64KLH.js} +102 -89
- package/dist/bundle/chunks/{inprocess-MBKFGDM2.js → inprocess-OHNEKTFB.js} +6 -6
- package/dist/bundle/chunks/interactive-mode-ZREVRX7W.js +5 -0
- package/dist/bundle/chunks/{llama-cpp-classify-KYZT532X.js → llama-cpp-classify-RSRH4KV2.js} +5 -5
- package/dist/bundle/chunks/mistral-conversations-YTMJKHHI.js +42 -0
- package/dist/bundle/chunks/{node-N7TPBUJB.js → node-FF6QQQLH.js} +1 -1
- package/dist/bundle/chunks/openai-codex-responses-NUCJOJSZ.js +97 -0
- package/dist/bundle/chunks/openai-completions-E5NRJUHA.js +91 -0
- package/dist/bundle/chunks/{openai-decisions-JMSDGR7K.js → openai-decisions-342J5ZYG.js} +1 -1
- package/dist/bundle/chunks/openai-responses-BN5Z4HFI.js +26 -0
- package/dist/bundle/chunks/openrouter-images-7RNG3JVF.js +12 -0
- package/dist/bundle/chunks/{pdfjs-FE3L72A6.js → pdfjs-LSTLRXQW.js} +1415 -1416
- package/dist/bundle/chunks/pi-messages-2L7FV5OK.js +22 -0
- package/dist/bundle/chunks/questionnaire-session-XEVAK7JS.js +123 -0
- package/dist/bundle/chunks/runtime-2FSZRUG5.js +2 -0
- package/dist/bundle/chunks/session-picker-666KJIVM.js +4 -0
- package/dist/bundle/chunks/startup-ui-INEVSNGK.js +3 -0
- package/dist/bundle/chunks/{trace-command-VM7FBWPE.js → trace-command-BCVMZ5ZD.js} +4 -4
- package/dist/bundle/chunks/typesafe-system-one-UJUNSZG4.js +3 -0
- package/dist/bundle/chunks/{undici-WVNE45GY.js → undici-7IGAYA4S.js} +1 -1
- package/dist/bundle/chunks/virtual-modules-6FVRJTM3.js +29 -0
- package/dist/bundle/cli-runtime.js +5 -5
- package/dist/bundle/flow/package.json +3 -3
- package/dist/bundle/index.js +13 -13
- package/dist/bundle/orchestrate/package.json +1 -1
- package/dist/bundle/rpc-entry.js +5 -4
- package/dist/cli/agent-dir-arg.d.ts +12 -0
- package/dist/cli/agent-dir-arg.d.ts.map +1 -0
- package/dist/cli/agent-dir-arg.js +15 -0
- package/dist/cli/agent-dir-arg.js.map +1 -0
- package/dist/cli/args.d.ts +9 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +19 -5
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/auth-check.d.ts +1 -1
- package/dist/cli/auth-check.d.ts.map +1 -1
- package/dist/cli/auth-check.js +4 -2
- package/dist/cli/auth-check.js.map +1 -1
- package/dist/cli/doctor-config.d.ts +14 -0
- package/dist/cli/doctor-config.d.ts.map +1 -0
- package/dist/cli/doctor-config.js +92 -0
- package/dist/cli/doctor-config.js.map +1 -0
- package/dist/cli/doctor-system.d.ts +12 -0
- package/dist/cli/doctor-system.d.ts.map +1 -0
- package/dist/cli/doctor-system.js +109 -0
- package/dist/cli/doctor-system.js.map +1 -0
- package/dist/cli/doctor.d.ts +11 -0
- package/dist/cli/doctor.d.ts.map +1 -0
- package/dist/cli/doctor.js +323 -0
- package/dist/cli/doctor.js.map +1 -0
- package/dist/cli/doctor.lazy.d.ts +3 -0
- package/dist/cli/doctor.lazy.d.ts.map +1 -0
- package/dist/cli/doctor.lazy.js +3 -0
- package/dist/cli/doctor.lazy.js.map +1 -0
- package/dist/cli/list-models.d.ts.map +1 -1
- package/dist/cli/list-models.js +0 -4
- package/dist/cli/list-models.js.map +1 -1
- package/dist/cli/project-trust.d.ts.map +1 -1
- package/dist/cli/project-trust.js +6 -6
- package/dist/cli/project-trust.js.map +1 -1
- package/dist/cli/startup-ui.d.ts +3 -2
- package/dist/cli/startup-ui.d.ts.map +1 -1
- package/dist/cli/startup-ui.js +23 -10
- package/dist/cli/startup-ui.js.map +1 -1
- package/dist/config.d.ts +5 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +13 -3
- package/dist/config.js.map +1 -1
- package/dist/coordination/broker/broker.d.ts +3 -3
- package/dist/coordination/broker/broker.d.ts.map +1 -1
- package/dist/coordination/broker/broker.js +15 -7
- package/dist/coordination/broker/broker.js.map +1 -1
- package/dist/core/acceptance-command.d.ts +6 -3
- package/dist/core/acceptance-command.d.ts.map +1 -1
- package/dist/core/acceptance-command.js +43 -12
- package/dist/core/acceptance-command.js.map +1 -1
- package/dist/core/acceptance-ledger.d.ts +2 -0
- package/dist/core/acceptance-ledger.d.ts.map +1 -1
- package/dist/core/acceptance-ledger.js +14 -3
- package/dist/core/acceptance-ledger.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts +11 -4
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +13 -4
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +6 -0
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session.d.ts +19 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +131 -36
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +7 -1
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/bash-executor.d.ts +3 -1
- package/dist/core/bash-executor.d.ts.map +1 -1
- package/dist/core/bash-executor.js +18 -8
- package/dist/core/bash-executor.js.map +1 -1
- package/dist/core/bug-report.d.ts +24 -1
- package/dist/core/bug-report.d.ts.map +1 -1
- package/dist/core/bug-report.js +216 -19
- package/dist/core/bug-report.js.map +1 -1
- package/dist/core/compaction/branch-summarization.d.ts +2 -2
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +9 -15
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +3 -0
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/export-html/index.d.ts.map +1 -1
- package/dist/core/export-html/index.js +12 -10
- package/dist/core/export-html/index.js.map +1 -1
- package/dist/core/export-html/template.js +23 -1
- package/dist/core/extensions/containment.d.ts +26 -0
- package/dist/core/extensions/containment.d.ts.map +1 -0
- package/dist/core/extensions/containment.js +66 -0
- package/dist/core/extensions/containment.js.map +1 -0
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +65 -7
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +2 -1
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +68 -12
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +14 -3
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/extensions/wrapper.d.ts.map +1 -1
- package/dist/core/extensions/wrapper.js +4 -1
- package/dist/core/extensions/wrapper.js.map +1 -1
- package/dist/core/footer-data-provider.d.ts.map +1 -1
- package/dist/core/footer-data-provider.js +2 -4
- package/dist/core/footer-data-provider.js.map +1 -1
- package/dist/core/http-dispatcher.d.ts +5 -2
- package/dist/core/http-dispatcher.d.ts.map +1 -1
- package/dist/core/http-dispatcher.js +6 -3
- package/dist/core/http-dispatcher.js.map +1 -1
- package/dist/core/keybindings.d.ts +20 -0
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +4 -1
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/mcp-servers.d.ts +29 -0
- package/dist/core/mcp-servers.d.ts.map +1 -1
- package/dist/core/mcp-servers.js +63 -17
- package/dist/core/mcp-servers.js.map +1 -1
- package/dist/core/messages.d.ts +4 -0
- package/dist/core/messages.d.ts.map +1 -1
- package/dist/core/messages.js +10 -2
- package/dist/core/messages.js.map +1 -1
- package/dist/core/model-config.d.ts +36 -0
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-resolver.js +1 -1
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +6 -2
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/nested-tool-calls.d.ts +6 -5
- package/dist/core/nested-tool-calls.d.ts.map +1 -1
- package/dist/core/nested-tool-calls.js +1 -3
- package/dist/core/nested-tool-calls.js.map +1 -1
- package/dist/core/os-secret-store.js +1 -1
- package/dist/core/os-secret-store.js.map +1 -1
- package/dist/core/package-manager.d.ts +3 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +25 -4
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/pi-ai-schemas.d.ts +4 -0
- package/dist/core/pi-ai-schemas.d.ts.map +1 -1
- package/dist/core/project-trust.d.ts.map +1 -1
- package/dist/core/project-trust.js +1 -1
- package/dist/core/project-trust.js.map +1 -1
- package/dist/core/provider-composer.d.ts +1 -0
- package/dist/core/provider-composer.d.ts.map +1 -1
- package/dist/core/provider-composer.js +1 -0
- package/dist/core/provider-composer.js.map +1 -1
- package/dist/core/resolve-config-value.d.ts +4 -0
- package/dist/core/resolve-config-value.d.ts.map +1 -1
- package/dist/core/resolve-config-value.js +14 -3
- package/dist/core/resolve-config-value.js.map +1 -1
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +40 -2
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/runtime-credentials.d.ts.map +1 -1
- package/dist/core/runtime-credentials.js +11 -7
- package/dist/core/runtime-credentials.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +8 -4
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager.d.ts +22 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +227 -37
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-defaults.d.ts +10 -1
- package/dist/core/settings-defaults.d.ts.map +1 -1
- package/dist/core/settings-defaults.js +7 -1
- package/dist/core/settings-defaults.js.map +1 -1
- package/dist/core/settings-manager.d.ts +14 -4
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +48 -15
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/settings-schema.d.ts +20 -2
- package/dist/core/settings-schema.d.ts.map +1 -1
- package/dist/core/settings-schema.js +27 -4
- package/dist/core/settings-schema.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +2 -0
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/tools/bash-jobs.js +2 -2
- package/dist/core/tools/bash-jobs.js.map +1 -1
- package/dist/core/tools/bash.d.ts +3 -0
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +78 -46
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit-diff.d.ts +7 -1
- package/dist/core/tools/edit-diff.d.ts.map +1 -1
- package/dist/core/tools/edit-diff.js +139 -75
- package/dist/core/tools/edit-diff.js.map +1 -1
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +4 -1
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/output-accumulator.d.ts +21 -6
- package/dist/core/tools/output-accumulator.d.ts.map +1 -1
- package/dist/core/tools/output-accumulator.js +90 -76
- package/dist/core/tools/output-accumulator.js.map +1 -1
- package/dist/core/tools/render-utils.d.ts +7 -2
- package/dist/core/tools/render-utils.d.ts.map +1 -1
- package/dist/core/tools/render-utils.js +14 -1
- package/dist/core/tools/render-utils.js.map +1 -1
- package/dist/core/tools/renderers/bash.d.ts.map +1 -1
- package/dist/core/tools/renderers/bash.js +9 -3
- package/dist/core/tools/renderers/bash.js.map +1 -1
- package/dist/core/tools/truncate.d.ts +1 -1
- package/dist/core/tools/truncate.d.ts.map +1 -1
- package/dist/core/tools/truncate.js +16 -7
- package/dist/core/tools/truncate.js.map +1 -1
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +2 -0
- package/dist/core/tools/write.js.map +1 -1
- package/dist/core/trust-manager.d.ts +2 -0
- package/dist/core/trust-manager.d.ts.map +1 -1
- package/dist/core/trust-manager.js +5 -4
- package/dist/core/trust-manager.js.map +1 -1
- package/dist/core/usage-totals.d.ts.map +1 -1
- package/dist/core/usage-totals.js +3 -0
- package/dist/core/usage-totals.js.map +1 -1
- package/dist/extensions/codemode/execute.d.ts.map +1 -1
- package/dist/extensions/codemode/execute.js +64 -20
- package/dist/extensions/codemode/execute.js.map +1 -1
- package/dist/extensions/codemode/renderer.d.ts.map +1 -1
- package/dist/extensions/codemode/renderer.js +8 -3
- package/dist/extensions/codemode/renderer.js.map +1 -1
- package/dist/extensions/codemode/tool.d.ts +5 -0
- package/dist/extensions/codemode/tool.d.ts.map +1 -1
- package/dist/extensions/codemode/tool.js.map +1 -1
- package/dist/extensions/llama/client.d.ts.map +1 -1
- package/dist/extensions/llama/client.js +3 -13
- package/dist/extensions/llama/client.js.map +1 -1
- package/dist/extensions/llama/ui.d.ts.map +1 -1
- package/dist/extensions/llama/ui.js +2 -1
- package/dist/extensions/llama/ui.js.map +1 -1
- package/dist/extensions/mcp/cli.d.ts +7 -0
- package/dist/extensions/mcp/cli.d.ts.map +1 -1
- package/dist/extensions/mcp/cli.js +35 -8
- package/dist/extensions/mcp/cli.js.map +1 -1
- package/dist/extensions/mcp/config.d.ts +33 -0
- package/dist/extensions/mcp/config.d.ts.map +1 -1
- package/dist/extensions/mcp/config.js +11 -2
- package/dist/extensions/mcp/config.js.map +1 -1
- package/dist/extensions/mcp/index.d.ts +8 -0
- package/dist/extensions/mcp/index.d.ts.map +1 -1
- package/dist/extensions/mcp/index.js +16 -0
- package/dist/extensions/mcp/index.js.map +1 -1
- package/dist/extensions/mcp/resources.d.ts +1 -1
- package/dist/extensions/mcp/resources.d.ts.map +1 -1
- package/dist/extensions/mcp/resources.js +4 -3
- package/dist/extensions/mcp/resources.js.map +1 -1
- package/dist/extensions/mcp/runtime.d.ts +1 -1
- package/dist/extensions/mcp/runtime.d.ts.map +1 -1
- package/dist/extensions/mcp/runtime.js +15 -14
- package/dist/extensions/mcp/runtime.js.map +1 -1
- package/dist/extensions/mcp/tools.d.ts +1 -24
- package/dist/extensions/mcp/tools.d.ts.map +1 -1
- package/dist/extensions/mcp/tools.js +10 -163
- package/dist/extensions/mcp/tools.js.map +1 -1
- package/dist/humain/ask-user-question/index.d.ts +4 -0
- package/dist/humain/ask-user-question/index.d.ts.map +1 -0
- package/dist/humain/ask-user-question/index.js +18 -0
- package/dist/humain/ask-user-question/index.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/answer-channel.d.ts +38 -0
- package/dist/humain/ask-user-question/vendor/ask/answer-channel.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/answer-channel.js +97 -0
- package/dist/humain/ask-user-question/vendor/ask/answer-channel.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/ask-user-question.d.ts +41 -0
- package/dist/humain/ask-user-question/vendor/ask/ask-user-question.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/ask-user-question.js +441 -0
- package/dist/humain/ask-user-question/vendor/ask/ask-user-question.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/config.d.ts +39 -0
- package/dist/humain/ask-user-question/vendor/ask/config.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/config.js +95 -0
- package/dist/humain/ask-user-question/vendor/ask/config.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/events.d.ts +132 -0
- package/dist/humain/ask-user-question/vendor/ask/events.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/events.js +50 -0
- package/dist/humain/ask-user-question/vendor/ask/events.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/index.d.ts +5 -0
- package/dist/humain/ask-user-question/vendor/ask/index.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/index.js +15 -0
- package/dist/humain/ask-user-question/vendor/ask/index.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/presentation.d.ts +81 -0
- package/dist/humain/ask-user-question/vendor/ask/presentation.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/presentation.js +105 -0
- package/dist/humain/ask-user-question/vendor/ask/presentation.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/reconcile.d.ts +28 -0
- package/dist/humain/ask-user-question/vendor/ask/reconcile.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/reconcile.js +45 -0
- package/dist/humain/ask-user-question/vendor/ask/reconcile.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/rpc-fallback.d.ts +41 -0
- package/dist/humain/ask-user-question/vendor/ask/rpc-fallback.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/rpc-fallback.js +166 -0
- package/dist/humain/ask-user-question/vendor/ask/rpc-fallback.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/state/build-questionnaire.d.ts +46 -0
- package/dist/humain/ask-user-question/vendor/ask/state/build-questionnaire.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/state/build-questionnaire.js +247 -0
- package/dist/humain/ask-user-question/vendor/ask/state/build-questionnaire.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/state/external-editor.d.ts +11 -0
- package/dist/humain/ask-user-question/vendor/ask/state/external-editor.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/state/external-editor.js +56 -0
- package/dist/humain/ask-user-question/vendor/ask/state/external-editor.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/state/i18n-bridge.d.ts +6 -0
- package/dist/humain/ask-user-question/vendor/ask/state/i18n-bridge.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/state/i18n-bridge.js +10 -0
- package/dist/humain/ask-user-question/vendor/ask/state/i18n-bridge.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/state/key-router.d.ts +57 -0
- package/dist/humain/ask-user-question/vendor/ask/state/key-router.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/state/key-router.js +357 -0
- package/dist/humain/ask-user-question/vendor/ask/state/key-router.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/state/questionnaire-session.d.ts +112 -0
- package/dist/humain/ask-user-question/vendor/ask/state/questionnaire-session.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/state/questionnaire-session.js +240 -0
- package/dist/humain/ask-user-question/vendor/ask/state/questionnaire-session.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/state/row-intent.d.ts +87 -0
- package/dist/humain/ask-user-question/vendor/ask/state/row-intent.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/state/row-intent.js +79 -0
- package/dist/humain/ask-user-question/vendor/ask/state/row-intent.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/state/selectors/contract.d.ts +22 -0
- package/dist/humain/ask-user-question/vendor/ask/state/selectors/contract.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/state/selectors/contract.js +2 -0
- package/dist/humain/ask-user-question/vendor/ask/state/selectors/contract.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/state/selectors/derivations.d.ts +27 -0
- package/dist/humain/ask-user-question/vendor/ask/state/selectors/derivations.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/state/selectors/derivations.js +48 -0
- package/dist/humain/ask-user-question/vendor/ask/state/selectors/derivations.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/state/selectors/focus.d.ts +13 -0
- package/dist/humain/ask-user-question/vendor/ask/state/selectors/focus.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/state/selectors/focus.js +15 -0
- package/dist/humain/ask-user-question/vendor/ask/state/selectors/focus.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/state/selectors/projections.d.ts +14 -0
- package/dist/humain/ask-user-question/vendor/ask/state/selectors/projections.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/state/selectors/projections.js +96 -0
- package/dist/humain/ask-user-question/vendor/ask/state/selectors/projections.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/state/state-reducer.d.ts +58 -0
- package/dist/humain/ask-user-question/vendor/ask/state/state-reducer.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/state/state-reducer.js +310 -0
- package/dist/humain/ask-user-question/vendor/ask/state/state-reducer.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/state/state.d.ts +68 -0
- package/dist/humain/ask-user-question/vendor/ask/state/state.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/state/state.js +2 -0
- package/dist/humain/ask-user-question/vendor/ask/state/state.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/tool/external-answer.d.ts +24 -0
- package/dist/humain/ask-user-question/vendor/ask/tool/external-answer.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/tool/external-answer.js +114 -0
- package/dist/humain/ask-user-question/vendor/ask/tool/external-answer.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/tool/format-answer.d.ts +18 -0
- package/dist/humain/ask-user-question/vendor/ask/tool/format-answer.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/tool/format-answer.js +29 -0
- package/dist/humain/ask-user-question/vendor/ask/tool/format-answer.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/tool/normalize-params.d.ts +41 -0
- package/dist/humain/ask-user-question/vendor/ask/tool/normalize-params.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/tool/normalize-params.js +99 -0
- package/dist/humain/ask-user-question/vendor/ask/tool/normalize-params.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/tool/response-envelope.d.ts +37 -0
- package/dist/humain/ask-user-question/vendor/ask/tool/response-envelope.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/tool/response-envelope.js +70 -0
- package/dist/humain/ask-user-question/vendor/ask/tool/response-envelope.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/tool/types.d.ts +129 -0
- package/dist/humain/ask-user-question/vendor/ask/tool/types.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/tool/types.js +76 -0
- package/dist/humain/ask-user-question/vendor/ask/tool/types.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/tool/validate-questionnaire.d.ts +21 -0
- package/dist/humain/ask-user-question/vendor/ask/tool/validate-questionnaire.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/tool/validate-questionnaire.js +49 -0
- package/dist/humain/ask-user-question/vendor/ask/tool/validate-questionnaire.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/view/component-binding.d.ts +23 -0
- package/dist/humain/ask-user-question/vendor/ask/view/component-binding.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/view/component-binding.js +16 -0
- package/dist/humain/ask-user-question/vendor/ask/view/component-binding.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/view/components/inline-input.d.ts +21 -0
- package/dist/humain/ask-user-question/vendor/ask/view/components/inline-input.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/view/components/inline-input.js +49 -0
- package/dist/humain/ask-user-question/vendor/ask/view/components/inline-input.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/view/components/multi-select-view.d.ts +43 -0
- package/dist/humain/ask-user-question/vendor/ask/view/components/multi-select-view.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/view/components/multi-select-view.js +130 -0
- package/dist/humain/ask-user-question/vendor/ask/view/components/multi-select-view.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/view/components/option-list-view.d.ts +45 -0
- package/dist/humain/ask-user-question/vendor/ask/view/components/option-list-view.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/view/components/option-list-view.js +39 -0
- package/dist/humain/ask-user-question/vendor/ask/view/components/option-list-view.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/view/components/preview/markdown-content-cache.d.ts +36 -0
- package/dist/humain/ask-user-question/vendor/ask/view/components/preview/markdown-content-cache.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/view/components/preview/markdown-content-cache.js +72 -0
- package/dist/humain/ask-user-question/vendor/ask/view/components/preview/markdown-content-cache.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-block-renderer.d.ts +61 -0
- package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-block-renderer.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-block-renderer.js +108 -0
- package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-block-renderer.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-box-renderer.d.ts +39 -0
- package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-box-renderer.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-box-renderer.js +76 -0
- package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-box-renderer.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-layout-decider.d.ts +123 -0
- package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-layout-decider.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-layout-decider.js +180 -0
- package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-layout-decider.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-pane.d.ts +108 -0
- package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-pane.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-pane.js +235 -0
- package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-pane.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/view/components/submit-picker.d.ts +37 -0
- package/dist/humain/ask-user-question/vendor/ask/view/components/submit-picker.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/view/components/submit-picker.js +47 -0
- package/dist/humain/ask-user-question/vendor/ask/view/components/submit-picker.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/view/components/tab-bar.d.ts +31 -0
- package/dist/humain/ask-user-question/vendor/ask/view/components/tab-bar.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/view/components/tab-bar.js +35 -0
- package/dist/humain/ask-user-question/vendor/ask/view/components/tab-bar.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/view/components/wrapping-select.d.ts +124 -0
- package/dist/humain/ask-user-question/vendor/ask/view/components/wrapping-select.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/view/components/wrapping-select.js +205 -0
- package/dist/humain/ask-user-question/vendor/ask/view/components/wrapping-select.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/view/dialog-builder.d.ts +83 -0
- package/dist/humain/ask-user-question/vendor/ask/view/dialog-builder.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/view/dialog-builder.js +186 -0
- package/dist/humain/ask-user-question/vendor/ask/view/dialog-builder.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/view/dialog-copy.d.ts +47 -0
- package/dist/humain/ask-user-question/vendor/ask/view/dialog-copy.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/view/dialog-copy.js +48 -0
- package/dist/humain/ask-user-question/vendor/ask/view/dialog-copy.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/view/props-adapter.d.ts +58 -0
- package/dist/humain/ask-user-question/vendor/ask/view/props-adapter.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/view/props-adapter.js +84 -0
- package/dist/humain/ask-user-question/vendor/ask/view/props-adapter.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/view/scroll-window.d.ts +20 -0
- package/dist/humain/ask-user-question/vendor/ask/view/scroll-window.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/view/scroll-window.js +55 -0
- package/dist/humain/ask-user-question/vendor/ask/view/scroll-window.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/view/stateful-view.d.ts +23 -0
- package/dist/humain/ask-user-question/vendor/ask/view/stateful-view.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/view/stateful-view.js +2 -0
- package/dist/humain/ask-user-question/vendor/ask/view/stateful-view.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/view/tab-components.d.ts +15 -0
- package/dist/humain/ask-user-question/vendor/ask/view/tab-components.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/view/tab-components.js +2 -0
- package/dist/humain/ask-user-question/vendor/ask/view/tab-components.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/view/tab-content-strategy.d.ts +98 -0
- package/dist/humain/ask-user-question/vendor/ask/view/tab-content-strategy.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/view/tab-content-strategy.js +248 -0
- package/dist/humain/ask-user-question/vendor/ask/view/tab-content-strategy.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/view/transcript.d.ts +23 -0
- package/dist/humain/ask-user-question/vendor/ask/view/transcript.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/ask/view/transcript.js +131 -0
- package/dist/humain/ask-user-question/vendor/ask/view/transcript.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/config/config.d.ts +132 -0
- package/dist/humain/ask-user-question/vendor/config/config.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/config/config.js +286 -0
- package/dist/humain/ask-user-question/vendor/config/config.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/config/index.d.ts +2 -0
- package/dist/humain/ask-user-question/vendor/config/index.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/config/index.js +2 -0
- package/dist/humain/ask-user-question/vendor/config/index.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/i18n/i18n.d.ts +64 -0
- package/dist/humain/ask-user-question/vendor/i18n/i18n.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/i18n/i18n.js +185 -0
- package/dist/humain/ask-user-question/vendor/i18n/i18n.js.map +1 -0
- package/dist/humain/ask-user-question/vendor/i18n/loader.d.ts +44 -0
- package/dist/humain/ask-user-question/vendor/i18n/loader.d.ts.map +1 -0
- package/dist/humain/ask-user-question/vendor/i18n/loader.js +55 -0
- package/dist/humain/ask-user-question/vendor/i18n/loader.js.map +1 -0
- package/dist/humain/bedrock-provider/vendor/index.bundle.mjs +26 -16
- package/dist/humain/brand-logo.d.ts +2 -0
- package/dist/humain/brand-logo.d.ts.map +1 -1
- package/dist/humain/brand-logo.js +4 -0
- package/dist/humain/brand-logo.js.map +1 -1
- package/dist/humain/bundled-extension-names.d.ts +1 -0
- package/dist/humain/bundled-extension-names.d.ts.map +1 -1
- package/dist/humain/bundled-extension-names.js +1 -0
- package/dist/humain/bundled-extension-names.js.map +1 -1
- package/dist/humain/checklist/footer-progress.d.ts +7 -0
- package/dist/humain/checklist/footer-progress.d.ts.map +1 -0
- package/dist/humain/checklist/footer-progress.js +15 -0
- package/dist/humain/checklist/footer-progress.js.map +1 -0
- package/dist/humain/checklist/glyphs.d.ts +7 -0
- package/dist/humain/checklist/glyphs.d.ts.map +1 -0
- package/dist/humain/checklist/glyphs.js +8 -0
- package/dist/humain/checklist/glyphs.js.map +1 -0
- package/dist/humain/checklist/index.d.ts +6 -0
- package/dist/humain/checklist/index.d.ts.map +1 -0
- package/dist/humain/checklist/index.js +37 -0
- package/dist/humain/checklist/index.js.map +1 -0
- package/dist/humain/checklist/progress.d.ts +37 -0
- package/dist/humain/checklist/progress.d.ts.map +1 -0
- package/dist/humain/checklist/progress.js +234 -0
- package/dist/humain/checklist/progress.js.map +1 -0
- package/dist/humain/checklist/projector.d.ts +53 -0
- package/dist/humain/checklist/projector.d.ts.map +1 -0
- package/dist/humain/checklist/projector.js +198 -0
- package/dist/humain/checklist/projector.js.map +1 -0
- package/dist/humain/checklist/sidebar.d.ts +18 -0
- package/dist/humain/checklist/sidebar.d.ts.map +1 -0
- package/dist/humain/checklist/sidebar.js +38 -0
- package/dist/humain/checklist/sidebar.js.map +1 -0
- package/dist/humain/checklist/status-segment.d.ts +19 -0
- package/dist/humain/checklist/status-segment.d.ts.map +1 -0
- package/dist/humain/checklist/status-segment.js +59 -0
- package/dist/humain/checklist/status-segment.js.map +1 -0
- package/dist/humain/checklist/vendor/add-task-dialog.d.ts +54 -0
- package/dist/humain/checklist/vendor/add-task-dialog.d.ts.map +1 -0
- package/dist/humain/checklist/vendor/add-task-dialog.js +238 -0
- package/dist/humain/checklist/vendor/add-task-dialog.js.map +1 -0
- package/dist/humain/checklist/vendor/commands.d.ts +38 -0
- package/dist/humain/checklist/vendor/commands.d.ts.map +1 -0
- package/dist/humain/checklist/vendor/commands.js +205 -0
- package/dist/humain/checklist/vendor/commands.js.map +1 -0
- package/dist/humain/checklist/vendor/index.d.ts +3 -0
- package/dist/humain/checklist/vendor/index.d.ts.map +1 -0
- package/dist/humain/checklist/vendor/index.js +276 -0
- package/dist/humain/checklist/vendor/index.js.map +1 -0
- package/dist/humain/checklist/vendor/render.d.ts +97 -0
- package/dist/humain/checklist/vendor/render.d.ts.map +1 -0
- package/dist/humain/checklist/vendor/render.js +354 -0
- package/dist/humain/checklist/vendor/render.js.map +1 -0
- package/dist/humain/checklist/vendor/settings.d.ts +11 -0
- package/dist/humain/checklist/vendor/settings.d.ts.map +1 -0
- package/dist/humain/checklist/vendor/settings.js +8 -0
- package/dist/humain/checklist/vendor/settings.js.map +1 -0
- package/dist/humain/checklist/vendor/store.d.ts +120 -0
- package/dist/humain/checklist/vendor/store.d.ts.map +1 -0
- package/dist/humain/checklist/vendor/store.js +990 -0
- package/dist/humain/checklist/vendor/store.js.map +1 -0
- package/dist/humain/checklist/vendor/tools.d.ts +21 -0
- package/dist/humain/checklist/vendor/tools.d.ts.map +1 -0
- package/dist/humain/checklist/vendor/tools.js +162 -0
- package/dist/humain/checklist/vendor/tools.js.map +1 -0
- package/dist/humain/checklist/vendor/types.d.ts +188 -0
- package/dist/humain/checklist/vendor/types.d.ts.map +1 -0
- package/dist/humain/checklist/vendor/types.js +32 -0
- package/dist/humain/checklist/vendor/types.js.map +1 -0
- package/dist/humain/flow-loader.d.ts.map +1 -1
- package/dist/humain/flow-loader.js +31 -5
- package/dist/humain/flow-loader.js.map +1 -1
- package/dist/humain/gateway/catalog.d.ts +1 -0
- package/dist/humain/gateway/catalog.d.ts.map +1 -1
- package/dist/humain/gateway/catalog.js +1 -0
- package/dist/humain/gateway/catalog.js.map +1 -1
- package/dist/humain/gateway/client.d.ts +1 -0
- package/dist/humain/gateway/client.d.ts.map +1 -1
- package/dist/humain/gateway/client.js +8 -1
- package/dist/humain/gateway/client.js.map +1 -1
- package/dist/humain/gateway/http.d.ts.map +1 -1
- package/dist/humain/gateway/http.js +11 -3
- package/dist/humain/gateway/http.js.map +1 -1
- package/dist/humain/gateway/images.d.ts +3 -0
- package/dist/humain/gateway/images.d.ts.map +1 -0
- package/dist/humain/gateway/images.js +73 -0
- package/dist/humain/gateway/images.js.map +1 -0
- package/dist/humain/gateway/provider.js +1 -1
- package/dist/humain/gateway/provider.js.map +1 -1
- package/dist/humain/hcode/account-store.d.ts.map +1 -1
- package/dist/humain/hcode/account-store.js +3 -1
- package/dist/humain/hcode/account-store.js.map +1 -1
- package/dist/humain/hcode/account.d.ts.map +1 -1
- package/dist/humain/hcode/account.js +23 -13
- package/dist/humain/hcode/account.js.map +1 -1
- package/dist/humain/hcode/images.d.ts.map +1 -1
- package/dist/humain/hcode/images.js +19 -13
- package/dist/humain/hcode/images.js.map +1 -1
- package/dist/humain/hcode/login-failure.d.ts +1 -0
- package/dist/humain/hcode/login-failure.d.ts.map +1 -1
- package/dist/humain/hcode/login-failure.js +1 -0
- package/dist/humain/hcode/login-failure.js.map +1 -1
- package/dist/humain/hcode/provider.d.ts.map +1 -1
- package/dist/humain/hcode/provider.js +2 -1
- package/dist/humain/hcode/provider.js.map +1 -1
- package/dist/humain/hcode/run-credential.d.ts +1 -0
- package/dist/humain/hcode/run-credential.d.ts.map +1 -1
- package/dist/humain/hcode/run-credential.js +12 -4
- package/dist/humain/hcode/run-credential.js.map +1 -1
- package/dist/humain/index.d.ts.map +1 -1
- package/dist/humain/index.js +4 -0
- package/dist/humain/index.js.map +1 -1
- package/dist/humain/node-provider.d.ts.map +1 -1
- package/dist/humain/node-provider.js +37 -8
- package/dist/humain/node-provider.js.map +1 -1
- package/dist/humain/web-access/vendor/index.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/index.js +11 -1
- package/dist/humain/web-access/vendor/index.js.map +1 -1
- package/dist/main.d.ts +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +36 -26
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/bug-report.d.ts.map +1 -1
- package/dist/modes/interactive/bug-report.js +48 -12
- package/dist/modes/interactive/bug-report.js.map +1 -1
- package/dist/modes/interactive/chat-viewport.js +1 -1
- package/dist/modes/interactive/chat-viewport.js.map +1 -1
- package/dist/modes/interactive/components/bash-execution.d.ts +2 -1
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/bash-execution.js +7 -4
- package/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/dist/modes/interactive/components/config-selector.js +1 -1
- package/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/dist/modes/interactive/components/custom-editor.d.ts +2 -0
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-editor.js +20 -1
- package/dist/modes/interactive/components/custom-editor.js.map +1 -1
- package/dist/modes/interactive/components/extension-editor.d.ts +1 -1
- package/dist/modes/interactive/components/extension-editor.js +2 -2
- package/dist/modes/interactive/components/extension-editor.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts +7 -0
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +74 -1
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/mermaid.d.ts.map +1 -1
- package/dist/modes/interactive/components/mermaid.js +11 -4
- package/dist/modes/interactive/components/mermaid.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts +2 -0
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +56 -8
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts +13 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.js +10 -9
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +3 -3
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +4 -3
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +83 -37
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-submenu.js +3 -3
- package/dist/modes/interactive/components/settings-submenu.js.map +1 -1
- package/dist/modes/interactive/components/status-indicator.d.ts +18 -7
- package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
- package/dist/modes/interactive/components/status-indicator.js +70 -24
- package/dist/modes/interactive/components/status-indicator.js.map +1 -1
- package/dist/modes/interactive/components/status-line.d.ts +16 -0
- package/dist/modes/interactive/components/status-line.d.ts.map +1 -0
- package/dist/modes/interactive/components/status-line.js +51 -0
- package/dist/modes/interactive/components/status-line.js.map +1 -0
- package/dist/modes/interactive/components/tool-execution.d.ts +5 -0
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +8 -1
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -1
- package/dist/modes/interactive/components/visual-truncate.js +11 -3
- package/dist/modes/interactive/components/visual-truncate.js.map +1 -1
- package/dist/modes/interactive/external-editor.d.ts.map +1 -1
- package/dist/modes/interactive/external-editor.js +13 -3
- package/dist/modes/interactive/external-editor.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +20 -4
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +260 -154
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/program-status-reporter.d.ts +2 -0
- package/dist/modes/interactive/program-status-reporter.d.ts.map +1 -1
- package/dist/modes/interactive/program-status-reporter.js +4 -0
- package/dist/modes/interactive/program-status-reporter.js.map +1 -1
- package/dist/modes/interactive/session-share.d.ts.map +1 -1
- package/dist/modes/interactive/session-share.js +9 -1
- package/dist/modes/interactive/session-share.js.map +1 -1
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +34 -7
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/rpc/jsonl.js +6 -5
- package/dist/modes/rpc/jsonl.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +2 -0
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +9 -2
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts +2 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +113 -13
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +22 -1
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/modes/uncaught-errors.d.ts +20 -0
- package/dist/modes/uncaught-errors.d.ts.map +1 -0
- package/dist/modes/uncaught-errors.js +56 -0
- package/dist/modes/uncaught-errors.js.map +1 -0
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +10 -1
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/utils/clipboard-image.js +1 -1
- package/dist/utils/clipboard-image.js.map +1 -1
- package/dist/utils/clipboard.js +2 -2
- package/dist/utils/clipboard.js.map +1 -1
- package/dist/utils/image-process.d.ts +5 -0
- package/dist/utils/image-process.d.ts.map +1 -1
- package/dist/utils/image-process.js +22 -4
- package/dist/utils/image-process.js.map +1 -1
- package/dist/utils/output-files.d.ts +44 -7
- package/dist/utils/output-files.d.ts.map +1 -1
- package/dist/utils/output-files.js +206 -12
- package/dist/utils/output-files.js.map +1 -1
- package/dist/utils/piped-stdin.d.ts +21 -0
- package/dist/utils/piped-stdin.d.ts.map +1 -0
- package/dist/utils/piped-stdin.js +60 -0
- package/dist/utils/piped-stdin.js.map +1 -0
- package/dist/utils/shell.d.ts +5 -2
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +77 -8
- package/dist/utils/shell.js.map +1 -1
- package/dist/utils/syntax-highlight.d.ts +33 -2
- package/dist/utils/syntax-highlight.d.ts.map +1 -1
- package/dist/utils/syntax-highlight.js +77 -10
- package/dist/utils/syntax-highlight.js.map +1 -1
- package/dist/utils/tools-manager.d.ts +1 -0
- package/dist/utils/tools-manager.d.ts.map +1 -1
- package/dist/utils/tools-manager.js +9 -8
- package/dist/utils/tools-manager.js.map +1 -1
- package/dist/utils/wsl.d.ts +8 -2
- package/dist/utils/wsl.d.ts.map +1 -1
- package/dist/utils/wsl.js +12 -3
- package/dist/utils/wsl.js.map +1 -1
- package/docs/cli.md +39 -3
- package/docs/codemode.md +7 -3
- package/docs/compaction.md +1 -1
- package/docs/development.md +6 -0
- package/docs/environment-variables.md +3 -2
- package/docs/extensions.md +21 -5
- package/docs/flow.md +2 -0
- package/docs/humain-code.md +1 -1
- package/docs/keybindings.md +2 -0
- package/docs/llama-cpp.md +2 -2
- package/docs/message-types.md +1 -0
- package/docs/models-configuration.md +14 -3
- package/docs/models.md +29 -7
- package/docs/providers.md +20 -2
- package/docs/rpc-commands.md +25 -2
- package/docs/rpc.md +20 -0
- package/docs/run-preflight.md +2 -2
- package/docs/session-format.md +9 -0
- package/docs/settings.md +35 -5
- package/docs/shell-aliases.md +1 -1
- package/docs/slash-commands.md +3 -1
- package/docs/terminal-setup.md +25 -0
- package/docs/windows.md +2 -1
- package/examples/extensions/custom-provider-anthropic/package-lock.json +4 -4
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/rpc-extension-ui.ts +8 -7
- package/npm-shrinkwrap.json +209 -180
- package/package.json +26 -20
- package/schemas/keybindings.schema.json +12 -0
- package/schemas/models.schema.json +20 -7
- package/schemas/settings.schema.json +43 -5
- package/src/coordination/UPSTREAM.md +27 -1
- package/src/coordination/upstream.json +3 -3
- package/src/humain/ask-user-question/UPSTREAM.md +31 -0
- package/src/humain/ask-user-question/upstream.json +258 -0
- package/src/humain/ask-user-question/vendor/ask/LICENSE +21 -0
- package/src/humain/ask-user-question/vendor/ask/locales/de.json +38 -0
- package/src/humain/ask-user-question/vendor/ask/locales/en.json +41 -0
- package/src/humain/ask-user-question/vendor/ask/locales/es.json +38 -0
- package/src/humain/ask-user-question/vendor/ask/locales/fr.json +38 -0
- package/src/humain/ask-user-question/vendor/ask/locales/pt-BR.json +38 -0
- package/src/humain/ask-user-question/vendor/ask/locales/pt.json +38 -0
- package/src/humain/ask-user-question/vendor/ask/locales/ru.json +38 -0
- package/src/humain/ask-user-question/vendor/ask/locales/uk.json +38 -0
- package/src/humain/ask-user-question/vendor/ask/locales/zh.json +40 -0
- package/src/humain/ask-user-question/vendor/config/LICENSE +21 -0
- package/src/humain/ask-user-question/vendor/i18n/LICENSE +21 -0
- package/src/humain/caveman/UPSTREAM.md +44 -11
- package/src/humain/caveman/upstream.json +3 -3
- package/src/humain/caveman/vendor/NOTICE +4 -0
- package/src/humain/web-access/UPSTREAM.md +8 -0
- package/dist/bundle/chunks/anthropic-messages-XFCDMGD6.js +0 -77
- package/dist/bundle/chunks/azure-openai-responses-F4KQM3NK.js +0 -15
- package/dist/bundle/chunks/bowser-DXKSTXFQ.js +0 -89
- package/dist/bundle/chunks/chunk-3E37CJCE.js +0 -34
- package/dist/bundle/chunks/chunk-3HVHETMU.js +0 -18
- package/dist/bundle/chunks/chunk-6JTCRCNF.js +0 -74
- package/dist/bundle/chunks/chunk-B3ZLWVDA.js +0 -80
- package/dist/bundle/chunks/chunk-F77J5EQZ.js +0 -3
- package/dist/bundle/chunks/chunk-GPLWWO5Q.js +0 -121
- package/dist/bundle/chunks/chunk-GV5OVRKK.js +0 -4
- package/dist/bundle/chunks/chunk-JBSWWCT5.js +0 -12
- package/dist/bundle/chunks/chunk-JWOPWHVH.js +0 -51
- package/dist/bundle/chunks/chunk-KRBELWQH.js +0 -7
- package/dist/bundle/chunks/chunk-PFBAIRCY.js +0 -56
- package/dist/bundle/chunks/chunk-Q5RKNQ2T.js +0 -73
- package/dist/bundle/chunks/chunk-QFDZEUFU.js +0 -12
- package/dist/bundle/chunks/chunk-SKCJ25SX.js +0 -24
- package/dist/bundle/chunks/chunk-UZOIHLNU.js +0 -23
- package/dist/bundle/chunks/chunk-YSWDFV2L.js +0 -11
- package/dist/bundle/chunks/chunk-YZMQXAJM.js +0 -8
- package/dist/bundle/chunks/chunk-ZAHVC5V2.js +0 -3591
- package/dist/bundle/chunks/entry-2GZ3PTWQ.js +0 -2
- package/dist/bundle/chunks/google-generative-ai-WIASMWS3.js +0 -22
- package/dist/bundle/chunks/google-vertex-WSPHRZIZ.js +0 -25
- package/dist/bundle/chunks/interactive-mode-3322RQEH.js +0 -5
- package/dist/bundle/chunks/mistral-conversations-7JYDDRUT.js +0 -43
- package/dist/bundle/chunks/openai-codex-responses-7PAML4NF.js +0 -102
- package/dist/bundle/chunks/openai-completions-UJDAIGTK.js +0 -87
- package/dist/bundle/chunks/openai-responses-2WNCE6AY.js +0 -26
- package/dist/bundle/chunks/openrouter-images-V3UCCO6X.js +0 -8
- package/dist/bundle/chunks/pi-messages-TQ7LJUNQ.js +0 -28
- package/dist/bundle/chunks/runtime-H7LYNKCZ.js +0 -2
- package/dist/bundle/chunks/session-picker-EYKCMFQR.js +0 -4
- package/dist/bundle/chunks/startup-ui-7ODOR34R.js +0 -3
- package/dist/bundle/chunks/typesafe-system-one-YP7GGN4C.js +0 -3
- package/dist/bundle/chunks/virtual-modules-47MGUPYN.js +0 -28
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Loader, truncateToWidth } from "@earendil-works/pi-tui";
|
|
1
|
+
import { Loader, truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
|
|
2
2
|
import { theme } from "../theme/theme.js";
|
|
3
3
|
import { CountdownTimer } from "./countdown-timer.js";
|
|
4
4
|
import { keyText } from "./keybinding-hints.js";
|
|
@@ -9,9 +9,13 @@ export class StatusIndicator extends Loader {
|
|
|
9
9
|
borderTexts = new Map();
|
|
10
10
|
borderWidth = -1;
|
|
11
11
|
constructor(kind, ui, spinnerColorFn, messageColorFn, message, indicator) {
|
|
12
|
-
super(ui, spinnerColorFn, messageColorFn, message, indicator,
|
|
12
|
+
super(ui, spinnerColorFn, messageColorFn, message, indicator, 100);
|
|
13
13
|
this.kind = kind;
|
|
14
14
|
}
|
|
15
|
+
/** Compact session status leaves elapsed timing to the right-hand status field. */
|
|
16
|
+
renderStatusInBorder(width) {
|
|
17
|
+
return this.renderInBorder(width);
|
|
18
|
+
}
|
|
15
19
|
renderInBorder(width) {
|
|
16
20
|
if (width !== this.borderWidth) {
|
|
17
21
|
this.borderTexts.clear();
|
|
@@ -66,8 +70,10 @@ export class WorkingStatusIndicator extends StatusIndicator {
|
|
|
66
70
|
lifeSuffix = "";
|
|
67
71
|
staticClassic = false;
|
|
68
72
|
classicColor;
|
|
69
|
-
constructor(ui, message, indicator, colorFn, style = "classic", level = "off", reducedMotion = false) {
|
|
70
|
-
super(
|
|
73
|
+
constructor(ui, message, indicator, colorFn, style = "classic", level = "off", reducedMotion = false, kind = "working") {
|
|
74
|
+
super(kind, ui, colorFn ?? ((text) => theme.fg("accent", text)), kind === "retry" ? (text) => theme.fg("muted", text) : (colorFn ?? ((text) => theme.fg("muted", text))), message, indicator);
|
|
75
|
+
this.phase = message;
|
|
76
|
+
this.classicColor = colorFn;
|
|
71
77
|
this.staticDisplay = reducedMotion || !process.stdout.isTTY || process.env.NO_COLOR !== undefined;
|
|
72
78
|
if (indicator || style === "classic") {
|
|
73
79
|
if (this.staticDisplay) {
|
|
@@ -122,6 +128,31 @@ export class WorkingStatusIndicator extends StatusIndicator {
|
|
|
122
128
|
this.rainBorder = columns + this.rainMetadata.length + 2 <= width ? line : truncateToWidth(line, width, "");
|
|
123
129
|
return this.rainBorder;
|
|
124
130
|
}
|
|
131
|
+
renderStatusInBorder(width) {
|
|
132
|
+
if (this.kind !== "working") {
|
|
133
|
+
const color = this.phaseColor ??
|
|
134
|
+
(this.kind === "retry" ? undefined : this.classicColor) ??
|
|
135
|
+
((text) => theme.fg("muted", text));
|
|
136
|
+
const full = this.engine && this.style !== "rain"
|
|
137
|
+
? this.getRenderedIndicator()
|
|
138
|
+
: `${this.getRenderedIndicator()} ${color(this.phase)}`;
|
|
139
|
+
if (visibleWidth(full) <= width)
|
|
140
|
+
return full;
|
|
141
|
+
const hint = `${keyText("app.interrupt")} to cancel`;
|
|
142
|
+
const action = this.kind === "retry"
|
|
143
|
+
? `Retrying in ${this.phase.match(/in (\d+s)/)?.[1] ?? "0s"}`
|
|
144
|
+
: this.kind === "compaction"
|
|
145
|
+
? "Compacting"
|
|
146
|
+
: "Summarizing";
|
|
147
|
+
const compact = `${action} · ${hint}`;
|
|
148
|
+
const withIndicator = `${this.getRenderedIndicator()} ${compact}`;
|
|
149
|
+
const text = visibleWidth(withIndicator) <= width ? withIndicator : visibleWidth(compact) <= width ? compact : hint;
|
|
150
|
+
return truncateToWidth(color(text), width, "");
|
|
151
|
+
}
|
|
152
|
+
if (!this.engine || this.style !== "rain")
|
|
153
|
+
return super.renderStatusInBorder(width);
|
|
154
|
+
return truncateToWidth(`${this.getRenderedIndicator()} ${this.phaseColor(this.phase)}`, width, "");
|
|
155
|
+
}
|
|
125
156
|
updateLevel(level) {
|
|
126
157
|
if (this.level === level || !this.engine)
|
|
127
158
|
return;
|
|
@@ -131,11 +162,20 @@ export class WorkingStatusIndicator extends StatusIndicator {
|
|
|
131
162
|
this.drawFrame();
|
|
132
163
|
this.schedule();
|
|
133
164
|
}
|
|
165
|
+
setMessage(message) {
|
|
166
|
+
this.setPhase(message);
|
|
167
|
+
}
|
|
134
168
|
setPhase(phase) {
|
|
135
|
-
if (phase === this.phase
|
|
169
|
+
if (phase === this.phase)
|
|
136
170
|
return;
|
|
137
171
|
this.phase = phase;
|
|
138
|
-
this.
|
|
172
|
+
this.rainElapsed = -1;
|
|
173
|
+
super.setMessage(phase);
|
|
174
|
+
if (!this.engine)
|
|
175
|
+
return;
|
|
176
|
+
this.lifeSuffix = this.phaseColor(` ${phase}`);
|
|
177
|
+
if (this.style === "decode" && this.kind === "working")
|
|
178
|
+
this.engine.resetDecode();
|
|
139
179
|
this.drawFrame();
|
|
140
180
|
this.schedule();
|
|
141
181
|
}
|
|
@@ -143,11 +183,11 @@ export class WorkingStatusIndicator extends StatusIndicator {
|
|
|
143
183
|
return ["off", "minimal", "low", "medium", "high", "xhigh", "max"].indexOf(this.level);
|
|
144
184
|
}
|
|
145
185
|
updatePalette() {
|
|
146
|
-
const color = theme.getThinkingBorderColor(this.level);
|
|
186
|
+
const color = (this.kind !== "working" && this.classicColor) || theme.getThinkingBorderColor(this.level);
|
|
147
187
|
this.phaseColor = color;
|
|
148
188
|
this.rainRuleLength = -1;
|
|
149
189
|
this.rainElapsed = -1;
|
|
150
|
-
this.lifeSuffix = color(
|
|
190
|
+
this.lifeSuffix = color(` ${this.phase}`);
|
|
151
191
|
// Strings and palette arrays are prepared on theme/level changes, never in a tick.
|
|
152
192
|
this.bitPalette = [
|
|
153
193
|
[theme.fg("dim", "0"), theme.fg("dim", "1")],
|
|
@@ -162,7 +202,7 @@ export class WorkingStatusIndicator extends StatusIndicator {
|
|
|
162
202
|
this.animationTimer = undefined;
|
|
163
203
|
if (!this.engine ||
|
|
164
204
|
this.staticDisplay ||
|
|
165
|
-
(this.style === "decode" && this.engine.decodedCells === this.
|
|
205
|
+
(this.style === "decode" && this.engine.decodedCells === this.decodeLength()))
|
|
166
206
|
return;
|
|
167
207
|
const interval = this.style === "life" ? Math.ceil(1000 / this.engine.stepsPerSecond) : 100;
|
|
168
208
|
this.animationTimer = setInterval(() => {
|
|
@@ -173,21 +213,27 @@ export class WorkingStatusIndicator extends StatusIndicator {
|
|
|
173
213
|
else if (this.style === "rain")
|
|
174
214
|
this.engine.tickRain(Math.min(this.rainWidth, this.engine.rainColumns));
|
|
175
215
|
else
|
|
176
|
-
this.engine.tickDecode(this.
|
|
216
|
+
this.engine.tickDecode(this.decodeLength());
|
|
177
217
|
this.drawFrame();
|
|
178
|
-
if (this.style === "decode" && this.engine.decodedCells === this.
|
|
218
|
+
if (this.style === "decode" && this.engine.decodedCells === this.decodeLength())
|
|
179
219
|
this.stop();
|
|
180
220
|
}, interval);
|
|
181
221
|
}
|
|
222
|
+
decodeLength() {
|
|
223
|
+
// Keep live countdowns and cancellation instructions outside the animated state word.
|
|
224
|
+
return this.kind === "working" ? this.phase.length : this.phase.indexOf(" ");
|
|
225
|
+
}
|
|
182
226
|
drawFrame() {
|
|
183
227
|
const engine = this.engine;
|
|
184
228
|
if (!engine)
|
|
185
229
|
return;
|
|
186
230
|
let frame = "";
|
|
187
231
|
if (this.style === "decode") {
|
|
188
|
-
const
|
|
189
|
-
|
|
190
|
-
|
|
232
|
+
const length = this.decodeLength();
|
|
233
|
+
const resolved = this.staticDisplay ? length : engine.decodedCells;
|
|
234
|
+
for (let i = 0; i < length; i++)
|
|
235
|
+
frame += i < resolved ? this.phase[i] : engine.cells[i % engine.cells.length];
|
|
236
|
+
frame += this.phase.slice(length);
|
|
191
237
|
frame = this.phaseColor(frame);
|
|
192
238
|
}
|
|
193
239
|
else if (this.style === "rain") {
|
|
@@ -196,7 +242,7 @@ export class WorkingStatusIndicator extends StatusIndicator {
|
|
|
196
242
|
const elapsed = Math.floor((Date.now() - this.started) / 1000);
|
|
197
243
|
if (elapsed !== this.rainElapsed) {
|
|
198
244
|
this.rainElapsed = elapsed;
|
|
199
|
-
this.rainMetadata = `${elapsed}s · ${this.level}`;
|
|
245
|
+
this.rainMetadata = `${this.phase === "Working" ? "" : `${this.phase} · `}${elapsed}s · ${this.level}`;
|
|
200
246
|
}
|
|
201
247
|
}
|
|
202
248
|
else {
|
|
@@ -225,11 +271,11 @@ export class WorkingStatusIndicator extends StatusIndicator {
|
|
|
225
271
|
this.animationTimer = undefined;
|
|
226
272
|
}
|
|
227
273
|
}
|
|
228
|
-
export class RetryStatusIndicator extends
|
|
274
|
+
export class RetryStatusIndicator extends WorkingStatusIndicator {
|
|
229
275
|
countdown;
|
|
230
|
-
constructor(ui, attempt, maxAttempts, delayMs) {
|
|
276
|
+
constructor(ui, attempt, maxAttempts, delayMs, config = {}) {
|
|
231
277
|
const retryMessage = (seconds) => `Retrying (${attempt}/${maxAttempts}) in ${seconds}s... (${keyText("app.interrupt")} to cancel)`;
|
|
232
|
-
super(
|
|
278
|
+
super(ui, retryMessage(Math.ceil(delayMs / 1000)), config.indicator, (text) => theme.fg("warning", text), config.style, config.level, config.reducedMotion, "retry");
|
|
233
279
|
this.countdown = new CountdownTimer(delayMs, ui, (seconds) => {
|
|
234
280
|
this.setMessage(retryMessage(seconds));
|
|
235
281
|
}, () => {
|
|
@@ -242,18 +288,18 @@ export class RetryStatusIndicator extends StatusIndicator {
|
|
|
242
288
|
super.dispose();
|
|
243
289
|
}
|
|
244
290
|
}
|
|
245
|
-
export class CompactionStatusIndicator extends
|
|
246
|
-
constructor(ui, reason, colorFn) {
|
|
291
|
+
export class CompactionStatusIndicator extends WorkingStatusIndicator {
|
|
292
|
+
constructor(ui, reason, colorFn, config = {}) {
|
|
247
293
|
const cancelHint = `(${keyText("app.interrupt")} to cancel)`;
|
|
248
294
|
const label = reason === "manual"
|
|
249
295
|
? `Compacting context... ${cancelHint}`
|
|
250
296
|
: `${reason === "overflow" ? "Context overflow detected, " : ""}Auto-compacting... ${cancelHint}`;
|
|
251
|
-
super(
|
|
297
|
+
super(ui, label, config.indicator, colorFn, config.style, config.level, config.reducedMotion, "compaction");
|
|
252
298
|
}
|
|
253
299
|
}
|
|
254
|
-
export class BranchSummaryStatusIndicator extends
|
|
255
|
-
constructor(ui) {
|
|
256
|
-
super(
|
|
300
|
+
export class BranchSummaryStatusIndicator extends WorkingStatusIndicator {
|
|
301
|
+
constructor(ui, config = {}) {
|
|
302
|
+
super(ui, `Summarizing branch... (${keyText("app.interrupt")} to cancel)`, config.indicator, undefined, config.style, config.level, config.reducedMotion, "branchSummary");
|
|
257
303
|
}
|
|
258
304
|
}
|
|
259
305
|
export class IdleStatus {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status-indicator.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components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// Derived from Pi-Bolt (MIT, Copyright (c) 2026 OpenSec (Pi-Bolt)), commit d82b859e; modified for HUMAIN Code CLI.\nimport type { ThinkingLevel } from \"@earendil-works/pi-agent-core\";\nimport { type Component, Loader, type TUI, truncateToWidth } from \"@earendil-works/pi-tui\";\nimport type { WorkingIndicatorOptions } from \"../../../core/extensions/index.ts\";\nimport { theme } from \"../theme/theme.ts\";\nimport { CountdownTimer } from \"./countdown-timer.ts\";\nimport { keyText } from \"./keybinding-hints.ts\";\nimport { WorkingIndicatorEngine } from \"./working-indicator-engine.ts\";\n\nexport type StatusIndicatorKind = \"working\" | \"retry\" | \"compaction\" | \"branchSummary\";\n\nexport class StatusIndicator extends Loader {\n\treadonly kind: StatusIndicatorKind;\n\t/** Wrapped border text per spinner frame, bounded and cleared when its rendering inputs change. */\n\tprivate borderTexts = new Map<string, string>();\n\tprivate borderWidth = -1;\n\n\tconstructor(\n\t\tkind: StatusIndicatorKind,\n\t\tui: TUI,\n\t\tspinnerColorFn: (str: string) => string,\n\t\tmessageColorFn: (str: string) => string,\n\t\tmessage: string,\n\t\tindicator?: WorkingIndicatorOptions,\n\t) {\n\t\tsuper(ui, spinnerColorFn, messageColorFn, message, indicator, kind === \"working\" ? 100 : 0);\n\t\tthis.kind = kind;\n\t}\n\n\trenderInBorder(width: number): string {\n\t\tif (width !== this.borderWidth) {\n\t\t\tthis.borderTexts.clear();\n\t\t\tthis.borderWidth = width;\n\t\t}\n\t\tconst key = this.getDisplayText();\n\t\tlet text = this.borderTexts.get(key);\n\t\tif (text === undefined) {\n\t\t\tconst line = super.render(width + 2)[1] ?? \"\";\n\t\t\ttext = truncateToWidth(line.startsWith(\" \") ? line.slice(1).trimEnd() : line.trimEnd(), width, \"\");\n\t\t\t// A changing message, such as a retry countdown, must not grow the cache without bound.\n\t\t\tif (this.borderTexts.size >= 64) this.borderTexts.clear();\n\t\t\tthis.borderTexts.set(key, text);\n\t\t}\n\t\treturn text;\n\t}\n\n\toverride invalidate(): void {\n\t\tthis.borderTexts.clear();\n\t\tsuper.invalidate();\n\t}\n\n\toverride setCustomBgFn(customBgFn?: (text: string) => string): void {\n\t\tthis.borderTexts.clear();\n\t\tsuper.setCustomBgFn(customBgFn);\n\t}\n\n\trenderSpinnerInBorder(width: number): string {\n\t\treturn truncateToWidth(this.getRenderedIndicator(), width, \"\");\n\t}\n\n\tdispose(): void {\n\t\tthis.stop();\n\t}\n}\n\nexport class WorkingStatusIndicator extends StatusIndicator {\n\tprivate animationTimer: ReturnType<typeof setInterval> | undefined;\n\tprivate phase = \"Working\";\n\tprivate rainMetadata = \"\";\n\tprivate rainElapsed = -1;\n\tprivate rainWidth = 12;\n\tprivate readonly rainGlyphs = new Array<string>(12).fill(\"\");\n\tprivate rainRule = \"\";\n\tprivate rainRuleLength = -1;\n\tprivate rainBorder: string | undefined;\n\tprivate animatedText: string | undefined;\n\tprivate engine: WorkingIndicatorEngine | undefined;\n\tprivate style: \"classic\" | \"life\" | \"rain\" | \"decode\" = \"classic\";\n\tprivate level: ThinkingLevel = \"off\";\n\tprivate staticDisplay = false;\n\tprivate started = 0;\n\tprivate animationUi: TUI | undefined;\n\tprivate bitPalette: string[][] = [];\n\tprivate phaseColor: ((text: string) => string) | undefined;\n\tprivate lifeSuffix = \"\";\n\tprivate staticClassic = false;\n\tprivate classicColor: ((text: string) => string) | undefined;\n\n\tconstructor(\n\t\tui: TUI,\n\t\tmessage: string,\n\t\tindicator?: WorkingIndicatorOptions,\n\t\tcolorFn?: (text: string) => string,\n\t\tstyle: \"classic\" | \"life\" | \"rain\" | \"decode\" = \"classic\",\n\t\tlevel: ThinkingLevel = \"off\",\n\t\treducedMotion = false,\n\t) {\n\t\tsuper(\n\t\t\t\"working\",\n\t\t\tui,\n\t\t\tcolorFn ?? ((text) => theme.fg(\"accent\", text)),\n\t\t\tcolorFn ?? ((text) => theme.fg(\"muted\", text)),\n\t\t\tmessage,\n\t\t\tindicator,\n\t\t);\n\t\tthis.staticDisplay = reducedMotion || !process.stdout.isTTY || process.env.NO_COLOR !== undefined;\n\t\tif (indicator || style === \"classic\") {\n\t\t\tif (this.staticDisplay) {\n\t\t\t\tthis.staticClassic = indicator === undefined;\n\t\t\t\tthis.classicColor = colorFn;\n\t\t\t\tthis.setIndicator({ frames: indicator?.frames?.slice(0, 1) ?? [\"⠋\"] });\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tthis.setIndicator({ frames: [] });\n\t\tthis.style = style;\n\t\tthis.level = level;\n\t\tthis.animationUi = ui;\n\t\tthis.started = Date.now();\n\t\tthis.engine = new WorkingIndicatorEngine(this.levelIndex(), this.started);\n\t\tthis.updatePalette();\n\t\tthis.drawFrame();\n\t\tthis.schedule();\n\t}\n\n\toverride invalidate(): void {\n\t\tsuper.invalidate();\n\t\tif (this.engine) {\n\t\t\tthis.updatePalette();\n\t\t\tthis.drawFrame();\n\t\t}\n\t}\n\n\tprotected override getRenderedIndicator(): string {\n\t\tif (this.staticClassic) return this.classicColor ? this.classicColor(\"⠋\") : theme.fg(\"accent\", \"⠋\");\n\t\treturn this.animatedText ?? super.getRenderedIndicator();\n\t}\n\n\toverride render(width: number): string[] {\n\t\treturn this.rainMetadata ? [\"\", ` ${this.renderInBorder(Math.max(1, width - 2))}`] : super.render(width);\n\t}\n\n\toverride renderInBorder(width: number): string {\n\t\tif (!this.engine || this.style !== \"rain\") return super.renderInBorder(width);\n\t\tif (width !== this.rainWidth) {\n\t\t\tthis.rainWidth = Math.max(0, width);\n\t\t\tthis.drawRain();\n\t\t}\n\t\tif (this.rainBorder !== undefined) return this.rainBorder;\n\t\tconst columns = Math.min(this.rainWidth, this.engine.rainColumns);\n\t\tconst ruleLength = Math.max(0, width - this.rainMetadata.length - columns - 2);\n\t\tif (ruleLength !== this.rainRuleLength) {\n\t\t\tthis.rainRuleLength = ruleLength;\n\t\t\tthis.rainRule = this.phaseColor!(\"─\".repeat(ruleLength));\n\t\t}\n\t\tconst line = `${this.animatedText} ${this.rainRule} ${this.rainMetadata}`;\n\t\t// Normal frames have known ASCII widths: avoid generic ANSI wrapping/scanning on every tick.\n\t\tthis.rainBorder = columns + this.rainMetadata.length + 2 <= width ? line : truncateToWidth(line, width, \"\");\n\t\treturn this.rainBorder;\n\t}\n\n\tupdateLevel(level: ThinkingLevel): void {\n\t\tif (this.level === level || !this.engine) return;\n\t\tthis.level = level;\n\t\tthis.engine = new WorkingIndicatorEngine(this.levelIndex(), Date.now());\n\t\tthis.updatePalette();\n\t\tthis.drawFrame();\n\t\tthis.schedule();\n\t}\n\n\tsetPhase(phase: string): void {\n\t\tif (phase === this.phase || this.style !== \"decode\") return;\n\t\tthis.phase = phase;\n\t\tthis.engine?.resetDecode();\n\t\tthis.drawFrame();\n\t\tthis.schedule();\n\t}\n\n\tprivate levelIndex(): number {\n\t\treturn [\"off\", \"minimal\", \"low\", \"medium\", \"high\", \"xhigh\", \"max\"].indexOf(this.level);\n\t}\n\n\tprivate updatePalette(): void {\n\t\tconst color = theme.getThinkingBorderColor(this.level);\n\t\tthis.phaseColor = color;\n\t\tthis.rainRuleLength = -1;\n\t\tthis.rainElapsed = -1;\n\t\tthis.lifeSuffix = color(\" Working\");\n\t\t// Strings and palette arrays are prepared on theme/level changes, never in a tick.\n\t\tthis.bitPalette = [\n\t\t\t[theme.fg(\"dim\", \"0\"), theme.fg(\"dim\", \"1\")],\n\t\t\t[color(\"\\x1b[2m0\\x1b[22m\"), color(\"\\x1b[2m1\\x1b[22m\")],\n\t\t\t[color(\"0\"), color(\"1\")],\n\t\t\t[color(\"\\x1b[1m0\\x1b[22m\"), color(\"\\x1b[1m1\\x1b[22m\")],\n\t\t];\n\t}\n\n\tprivate schedule(): void {\n\t\tif (this.animationTimer) clearInterval(this.animationTimer);\n\t\tthis.animationTimer = undefined;\n\t\tif (\n\t\t\t!this.engine ||\n\t\t\tthis.staticDisplay ||\n\t\t\t(this.style === \"decode\" && this.engine.decodedCells === this.phase.length)\n\t\t)\n\t\t\treturn;\n\t\tconst interval = this.style === \"life\" ? Math.ceil(1000 / this.engine.stepsPerSecond) : 100;\n\t\tthis.animationTimer = setInterval(() => {\n\t\t\tif (!this.engine) return;\n\t\t\tif (this.style === \"life\") this.engine.tick();\n\t\t\telse if (this.style === \"rain\") this.engine.tickRain(Math.min(this.rainWidth, this.engine.rainColumns));\n\t\t\telse this.engine.tickDecode(this.phase.length);\n\t\t\tthis.drawFrame();\n\t\t\tif (this.style === \"decode\" && this.engine.decodedCells === this.phase.length) this.stop();\n\t\t}, interval);\n\t}\n\n\tprivate drawFrame(): void {\n\t\tconst engine = this.engine;\n\t\tif (!engine) return;\n\t\tlet frame = \"\";\n\t\tif (this.style === \"decode\") {\n\t\t\tconst resolved = this.staticDisplay ? this.phase.length : engine.decodedCells;\n\t\t\tfor (let i = 0; i < this.phase.length; i++) frame += i < resolved ? this.phase[i] : engine.cells[i];\n\t\t\tframe = this.phaseColor!(frame);\n\t\t} else if (this.style === \"rain\") {\n\t\t\tthis.drawRain();\n\t\t\tframe = this.animatedText!;\n\t\t\tconst elapsed = Math.floor((Date.now() - this.started) / 1000);\n\t\t\tif (elapsed !== this.rainElapsed) {\n\t\t\t\tthis.rainElapsed = elapsed;\n\t\t\t\tthis.rainMetadata = `${elapsed}s · ${this.level}`;\n\t\t\t}\n\t\t} else {\n\t\t\tfor (let i = 0; i < engine.width; i++) frame += this.bitPalette[engine.cells[i] ? 3 : 0][engine.cells[i]];\n\t\t\tframe += this.lifeSuffix;\n\t\t}\n\t\tthis.animatedText = frame;\n\t\tthis.setText(frame);\n\t\tthis.animationUi?.requestRender();\n\t}\n\n\tprivate drawRain(): void {\n\t\tconst engine = this.engine!;\n\t\tthis.rainGlyphs.length = Math.min(this.rainWidth, engine.rainColumns);\n\t\tfor (let i = 0; i < this.rainGlyphs.length; i++) {\n\t\t\tthis.rainGlyphs[i] = this.bitPalette[engine.brightness[i]][engine.cells[i]];\n\t\t}\n\t\t// Reuse glyph/color strings and the scratch array; only the terminal's changed line needs a new string.\n\t\tthis.animatedText = this.rainGlyphs.join(\"\");\n\t\tthis.rainBorder = undefined;\n\t}\n\n\toverride stop(): void {\n\t\tsuper.stop();\n\t\tif (this.animationTimer) clearInterval(this.animationTimer);\n\t\tthis.animationTimer = undefined;\n\t}\n}\n\nexport class RetryStatusIndicator extends StatusIndicator {\n\tprivate countdown: CountdownTimer | undefined;\n\n\tconstructor(ui: TUI, attempt: number, maxAttempts: number, delayMs: number) {\n\t\tconst retryMessage = (seconds: number) =>\n\t\t\t`Retrying (${attempt}/${maxAttempts}) in ${seconds}s... (${keyText(\"app.interrupt\")} to cancel)`;\n\t\tsuper(\n\t\t\t\"retry\",\n\t\t\tui,\n\t\t\t(spinner) => theme.fg(\"warning\", spinner),\n\t\t\t(text) => theme.fg(\"muted\", text),\n\t\t\tretryMessage(Math.ceil(delayMs / 1000)),\n\t\t);\n\t\tthis.countdown = new CountdownTimer(\n\t\t\tdelayMs,\n\t\t\tui,\n\t\t\t(seconds) => {\n\t\t\t\tthis.setMessage(retryMessage(seconds));\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tthis.countdown = undefined;\n\t\t\t},\n\t\t);\n\t}\n\n\toverride dispose(): void {\n\t\tthis.countdown?.dispose();\n\t\tthis.countdown = undefined;\n\t\tsuper.dispose();\n\t}\n}\n\nexport type CompactionStatusReason = \"manual\" | \"threshold\" | \"overflow\";\n\nexport class CompactionStatusIndicator extends StatusIndicator {\n\tconstructor(ui: TUI, reason: CompactionStatusReason, colorFn?: (text: string) => string) {\n\t\tconst cancelHint = `(${keyText(\"app.interrupt\")} to cancel)`;\n\t\tconst label =\n\t\t\treason === \"manual\"\n\t\t\t\t? `Compacting context... ${cancelHint}`\n\t\t\t\t: `${reason === \"overflow\" ? \"Context overflow detected, \" : \"\"}Auto-compacting... ${cancelHint}`;\n\t\tsuper(\n\t\t\t\"compaction\",\n\t\t\tui,\n\t\t\tcolorFn ?? ((spinner) => theme.fg(\"accent\", spinner)),\n\t\t\tcolorFn ?? ((text) => theme.fg(\"muted\", text)),\n\t\t\tlabel,\n\t\t);\n\t}\n}\n\nexport class BranchSummaryStatusIndicator extends StatusIndicator {\n\tconstructor(ui: TUI) {\n\t\tsuper(\n\t\t\t\"branchSummary\",\n\t\t\tui,\n\t\t\t(spinner) => theme.fg(\"accent\", spinner),\n\t\t\t(text) => theme.fg(\"muted\", text),\n\t\t\t`Summarizing branch... (${keyText(\"app.interrupt\")} to cancel)`,\n\t\t);\n\t}\n}\n\nexport class IdleStatus implements Component {\n\tinvalidate(): void {\n\t\t// No cached state to invalidate.\n\t}\n\n\trender(width: number): string[] {\n\t\tconst emptyLine = \" \".repeat(width);\n\t\treturn [emptyLine, emptyLine];\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"status-indicator.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/status-indicator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkB,MAAM,EAAY,eAAe,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEzG,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAIvE,MAAM,OAAO,eAAgB,SAAQ,MAAM;IACjC,IAAI,CAAsB;IACnC,mGAAmG;IAC3F,WAAW,GAAG,IAAI,GAAG,EAAkB,CAAC;IACxC,WAAW,GAAG,CAAC,CAAC,CAAC;IAEzB,YACC,IAAyB,EACzB,EAAO,EACP,cAAuC,EACvC,cAAuC,EACvC,OAAe,EACf,SAAmC;QAEnC,KAAK,CAAC,EAAE,EAAE,cAAc,EAAE,cAAc,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC;QACnE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IAClB,CAAC;IAED,mFAAmF;IACnF,oBAAoB,CAAC,KAAa;QACjC,OAA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AC,CAAC,GAAG,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,6BAA6B,CAAC,CAAC,CAAC,EAAE,sBAAsB,UAAU,EAAE,CAAC;QACpG,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,SAAS,EAAE,OAAO,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC;IAC7G,CAAC;CACD;AAED,MAAM,OAAO,4BAA6B,SAAQ,sBAAsB;IACvE,YAAY,EAAO,EAAE,MAAM,GAAiC,EAAE;QAC7D,KAAK,CACJ,EAAE,EACF,0BAA0B,OAAO,CAAC,eAAe,CAAC,aAAa,EAC/D,MAAM,CAAC,SAAS,EAChB,SAAS,EACT,MAAM,CAAC,KAAK,EACZ,MAAM,CAAC,KAAK,EACZ,MAAM,CAAC,aAAa,EACpB,eAAe,CACf,CAAC;IACH,CAAC;CACD;AAED,MAAM,OAAO,UAAU;IACtB,UAAU;QACT,iCAAiC;IAClC,CAAC;IAED,MAAM,CAAC,KAAa;QACnB,MAAM,SAAS,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACpC,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IAC/B,CAAC;CACD","sourcesContent":["// Derived from Pi-Bolt (MIT, Copyright (c) 2026 OpenSec (Pi-Bolt)), commit d82b859e; modified for HUMAIN Code CLI.\nimport type { ThinkingLevel } from \"@earendil-works/pi-agent-core\";\nimport { type Component, Loader, type TUI, truncateToWidth, visibleWidth } from \"@earendil-works/pi-tui\";\nimport type { WorkingIndicatorOptions } from \"../../../core/extensions/index.ts\";\nimport { theme } from \"../theme/theme.ts\";\nimport { CountdownTimer } from \"./countdown-timer.ts\";\nimport { keyText } from \"./keybinding-hints.ts\";\nimport { WorkingIndicatorEngine } from \"./working-indicator-engine.ts\";\n\nexport type StatusIndicatorKind = \"working\" | \"retry\" | \"compaction\" | \"branchSummary\";\n\nexport class StatusIndicator extends Loader {\n\treadonly kind: StatusIndicatorKind;\n\t/** Wrapped border text per spinner frame, bounded and cleared when its rendering inputs change. */\n\tprivate borderTexts = new Map<string, string>();\n\tprivate borderWidth = -1;\n\n\tconstructor(\n\t\tkind: StatusIndicatorKind,\n\t\tui: TUI,\n\t\tspinnerColorFn: (str: string) => string,\n\t\tmessageColorFn: (str: string) => string,\n\t\tmessage: string,\n\t\tindicator?: WorkingIndicatorOptions,\n\t) {\n\t\tsuper(ui, spinnerColorFn, messageColorFn, message, indicator, 100);\n\t\tthis.kind = kind;\n\t}\n\n\t/** Compact session status leaves elapsed timing to the right-hand status field. */\n\trenderStatusInBorder(width: number): string {\n\t\treturn this.renderInBorder(width);\n\t}\n\n\trenderInBorder(width: number): string {\n\t\tif (width !== this.borderWidth) {\n\t\t\tthis.borderTexts.clear();\n\t\t\tthis.borderWidth = width;\n\t\t}\n\t\tconst key = this.getDisplayText();\n\t\tlet text = this.borderTexts.get(key);\n\t\tif (text === undefined) {\n\t\t\tconst line = super.render(width + 2)[1] ?? \"\";\n\t\t\ttext = truncateToWidth(line.startsWith(\" \") ? line.slice(1).trimEnd() : line.trimEnd(), width, \"\");\n\t\t\t// A changing message, such as a retry countdown, must not grow the cache without bound.\n\t\t\tif (this.borderTexts.size >= 64) this.borderTexts.clear();\n\t\t\tthis.borderTexts.set(key, text);\n\t\t}\n\t\treturn text;\n\t}\n\n\toverride invalidate(): void {\n\t\tthis.borderTexts.clear();\n\t\tsuper.invalidate();\n\t}\n\n\toverride setCustomBgFn(customBgFn?: (text: string) => string): void {\n\t\tthis.borderTexts.clear();\n\t\tsuper.setCustomBgFn(customBgFn);\n\t}\n\n\trenderSpinnerInBorder(width: number): string {\n\t\treturn truncateToWidth(this.getRenderedIndicator(), width, \"\");\n\t}\n\n\tdispose(): void {\n\t\tthis.stop();\n\t}\n}\n\nexport interface StatusIndicatorConfiguration {\n\tindicator?: WorkingIndicatorOptions;\n\tstyle?: \"classic\" | \"life\" | \"rain\" | \"decode\";\n\tlevel?: ThinkingLevel;\n\treducedMotion?: boolean;\n}\n\nexport class WorkingStatusIndicator extends StatusIndicator {\n\tprivate animationTimer: ReturnType<typeof setInterval> | undefined;\n\tprivate phase = \"Working\";\n\tprivate rainMetadata = \"\";\n\tprivate rainElapsed = -1;\n\tprivate rainWidth = 12;\n\tprivate readonly rainGlyphs = new Array<string>(12).fill(\"\");\n\tprivate rainRule = \"\";\n\tprivate rainRuleLength = -1;\n\tprivate rainBorder: string | undefined;\n\tprivate animatedText: string | undefined;\n\tprivate engine: WorkingIndicatorEngine | undefined;\n\tprivate style: \"classic\" | \"life\" | \"rain\" | \"decode\" = \"classic\";\n\tprivate level: ThinkingLevel = \"off\";\n\tprivate staticDisplay = false;\n\tprivate started = 0;\n\tprivate animationUi: TUI | undefined;\n\tprivate bitPalette: string[][] = [];\n\tprivate phaseColor: ((text: string) => string) | undefined;\n\tprivate lifeSuffix = \"\";\n\tprivate staticClassic = false;\n\tprivate classicColor: ((text: string) => string) | undefined;\n\n\tconstructor(\n\t\tui: TUI,\n\t\tmessage: string,\n\t\tindicator?: WorkingIndicatorOptions,\n\t\tcolorFn?: (text: string) => string,\n\t\tstyle: \"classic\" | \"life\" | \"rain\" | \"decode\" = \"classic\",\n\t\tlevel: ThinkingLevel = \"off\",\n\t\treducedMotion = false,\n\t\tkind: StatusIndicatorKind = \"working\",\n\t) {\n\t\tsuper(\n\t\t\tkind,\n\t\t\tui,\n\t\t\tcolorFn ?? ((text) => theme.fg(\"accent\", text)),\n\t\t\tkind === \"retry\" ? (text) => theme.fg(\"muted\", text) : (colorFn ?? ((text) => theme.fg(\"muted\", text))),\n\t\t\tmessage,\n\t\t\tindicator,\n\t\t);\n\t\tthis.phase = message;\n\t\tthis.classicColor = colorFn;\n\t\tthis.staticDisplay = reducedMotion || !process.stdout.isTTY || process.env.NO_COLOR !== undefined;\n\t\tif (indicator || style === \"classic\") {\n\t\t\tif (this.staticDisplay) {\n\t\t\t\tthis.staticClassic = indicator === undefined;\n\t\t\t\tthis.classicColor = colorFn;\n\t\t\t\tthis.setIndicator({ frames: indicator?.frames?.slice(0, 1) ?? [\"⠋\"] });\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tthis.setIndicator({ frames: [] });\n\t\tthis.style = style;\n\t\tthis.level = level;\n\t\tthis.animationUi = ui;\n\t\tthis.started = Date.now();\n\t\tthis.engine = new WorkingIndicatorEngine(this.levelIndex(), this.started);\n\t\tthis.updatePalette();\n\t\tthis.drawFrame();\n\t\tthis.schedule();\n\t}\n\n\toverride invalidate(): void {\n\t\tsuper.invalidate();\n\t\tif (this.engine) {\n\t\t\tthis.updatePalette();\n\t\t\tthis.drawFrame();\n\t\t}\n\t}\n\n\tprotected override getRenderedIndicator(): string {\n\t\tif (this.staticClassic) return this.classicColor ? this.classicColor(\"⠋\") : theme.fg(\"accent\", \"⠋\");\n\t\treturn this.animatedText ?? super.getRenderedIndicator();\n\t}\n\n\toverride render(width: number): string[] {\n\t\treturn this.rainMetadata ? [\"\", ` ${this.renderInBorder(Math.max(1, width - 2))}`] : super.render(width);\n\t}\n\n\toverride renderInBorder(width: number): string {\n\t\tif (!this.engine || this.style !== \"rain\") return super.renderInBorder(width);\n\t\tif (width !== this.rainWidth) {\n\t\t\tthis.rainWidth = Math.max(0, width);\n\t\t\tthis.drawRain();\n\t\t}\n\t\tif (this.rainBorder !== undefined) return this.rainBorder;\n\t\tconst columns = Math.min(this.rainWidth, this.engine.rainColumns);\n\t\tconst ruleLength = Math.max(0, width - this.rainMetadata.length - columns - 2);\n\t\tif (ruleLength !== this.rainRuleLength) {\n\t\t\tthis.rainRuleLength = ruleLength;\n\t\t\tthis.rainRule = this.phaseColor!(\"─\".repeat(ruleLength));\n\t\t}\n\t\tconst line = `${this.animatedText} ${this.rainRule} ${this.rainMetadata}`;\n\t\t// Normal frames have known ASCII widths: avoid generic ANSI wrapping/scanning on every tick.\n\t\tthis.rainBorder = columns + this.rainMetadata.length + 2 <= width ? line : truncateToWidth(line, width, \"\");\n\t\treturn this.rainBorder;\n\t}\n\n\toverride renderStatusInBorder(width: number): string {\n\t\tif (this.kind !== \"working\") {\n\t\t\tconst color =\n\t\t\t\tthis.phaseColor ??\n\t\t\t\t(this.kind === \"retry\" ? undefined : this.classicColor) ??\n\t\t\t\t((text: string) => theme.fg(\"muted\", text));\n\t\t\tconst full =\n\t\t\t\tthis.engine && this.style !== \"rain\"\n\t\t\t\t\t? this.getRenderedIndicator()\n\t\t\t\t\t: `${this.getRenderedIndicator()} ${color(this.phase)}`;\n\t\t\tif (visibleWidth(full) <= width) return full;\n\t\t\tconst hint = `${keyText(\"app.interrupt\")} to cancel`;\n\t\t\tconst action =\n\t\t\t\tthis.kind === \"retry\"\n\t\t\t\t\t? `Retrying in ${this.phase.match(/in (\\d+s)/)?.[1] ?? \"0s\"}`\n\t\t\t\t\t: this.kind === \"compaction\"\n\t\t\t\t\t\t? \"Compacting\"\n\t\t\t\t\t\t: \"Summarizing\";\n\t\t\tconst compact = `${action} · ${hint}`;\n\t\t\tconst withIndicator = `${this.getRenderedIndicator()} ${compact}`;\n\t\t\tconst text =\n\t\t\t\tvisibleWidth(withIndicator) <= width ? withIndicator : visibleWidth(compact) <= width ? compact : hint;\n\t\t\treturn truncateToWidth(color(text), width, \"\");\n\t\t}\n\t\tif (!this.engine || this.style !== \"rain\") return super.renderStatusInBorder(width);\n\t\treturn truncateToWidth(`${this.getRenderedIndicator()} ${this.phaseColor!(this.phase)}`, width, \"\");\n\t}\n\n\tupdateLevel(level: ThinkingLevel): void {\n\t\tif (this.level === level || !this.engine) return;\n\t\tthis.level = level;\n\t\tthis.engine = new WorkingIndicatorEngine(this.levelIndex(), Date.now());\n\t\tthis.updatePalette();\n\t\tthis.drawFrame();\n\t\tthis.schedule();\n\t}\n\n\toverride setMessage(message: string): void {\n\t\tthis.setPhase(message);\n\t}\n\n\tsetPhase(phase: string): void {\n\t\tif (phase === this.phase) return;\n\t\tthis.phase = phase;\n\t\tthis.rainElapsed = -1;\n\t\tsuper.setMessage(phase);\n\t\tif (!this.engine) return;\n\t\tthis.lifeSuffix = this.phaseColor!(` ${phase}`);\n\t\tif (this.style === \"decode\" && this.kind === \"working\") this.engine.resetDecode();\n\t\tthis.drawFrame();\n\t\tthis.schedule();\n\t}\n\n\tprivate levelIndex(): number {\n\t\treturn [\"off\", \"minimal\", \"low\", \"medium\", \"high\", \"xhigh\", \"max\"].indexOf(this.level);\n\t}\n\n\tprivate updatePalette(): void {\n\t\tconst color = (this.kind !== \"working\" && this.classicColor) || theme.getThinkingBorderColor(this.level);\n\t\tthis.phaseColor = color;\n\t\tthis.rainRuleLength = -1;\n\t\tthis.rainElapsed = -1;\n\t\tthis.lifeSuffix = color(` ${this.phase}`);\n\t\t// Strings and palette arrays are prepared on theme/level changes, never in a tick.\n\t\tthis.bitPalette = [\n\t\t\t[theme.fg(\"dim\", \"0\"), theme.fg(\"dim\", \"1\")],\n\t\t\t[color(\"\\x1b[2m0\\x1b[22m\"), color(\"\\x1b[2m1\\x1b[22m\")],\n\t\t\t[color(\"0\"), color(\"1\")],\n\t\t\t[color(\"\\x1b[1m0\\x1b[22m\"), color(\"\\x1b[1m1\\x1b[22m\")],\n\t\t];\n\t}\n\n\tprivate schedule(): void {\n\t\tif (this.animationTimer) clearInterval(this.animationTimer);\n\t\tthis.animationTimer = undefined;\n\t\tif (\n\t\t\t!this.engine ||\n\t\t\tthis.staticDisplay ||\n\t\t\t(this.style === \"decode\" && this.engine.decodedCells === this.decodeLength())\n\t\t)\n\t\t\treturn;\n\t\tconst interval = this.style === \"life\" ? Math.ceil(1000 / this.engine.stepsPerSecond) : 100;\n\t\tthis.animationTimer = setInterval(() => {\n\t\t\tif (!this.engine) return;\n\t\t\tif (this.style === \"life\") this.engine.tick();\n\t\t\telse if (this.style === \"rain\") this.engine.tickRain(Math.min(this.rainWidth, this.engine.rainColumns));\n\t\t\telse this.engine.tickDecode(this.decodeLength());\n\t\t\tthis.drawFrame();\n\t\t\tif (this.style === \"decode\" && this.engine.decodedCells === this.decodeLength()) this.stop();\n\t\t}, interval);\n\t}\n\n\tprivate decodeLength(): number {\n\t\t// Keep live countdowns and cancellation instructions outside the animated state word.\n\t\treturn this.kind === \"working\" ? this.phase.length : this.phase.indexOf(\" \");\n\t}\n\n\tprivate drawFrame(): void {\n\t\tconst engine = this.engine;\n\t\tif (!engine) return;\n\t\tlet frame = \"\";\n\t\tif (this.style === \"decode\") {\n\t\t\tconst length = this.decodeLength();\n\t\t\tconst resolved = this.staticDisplay ? length : engine.decodedCells;\n\t\t\tfor (let i = 0; i < length; i++) frame += i < resolved ? this.phase[i] : engine.cells[i % engine.cells.length];\n\t\t\tframe += this.phase.slice(length);\n\t\t\tframe = this.phaseColor!(frame);\n\t\t} else if (this.style === \"rain\") {\n\t\t\tthis.drawRain();\n\t\t\tframe = this.animatedText!;\n\t\t\tconst elapsed = Math.floor((Date.now() - this.started) / 1000);\n\t\t\tif (elapsed !== this.rainElapsed) {\n\t\t\t\tthis.rainElapsed = elapsed;\n\t\t\t\tthis.rainMetadata = `${this.phase === \"Working\" ? \"\" : `${this.phase} · `}${elapsed}s · ${this.level}`;\n\t\t\t}\n\t\t} else {\n\t\t\tfor (let i = 0; i < engine.width; i++) frame += this.bitPalette[engine.cells[i] ? 3 : 0][engine.cells[i]];\n\t\t\tframe += this.lifeSuffix;\n\t\t}\n\t\tthis.animatedText = frame;\n\t\tthis.setText(frame);\n\t\tthis.animationUi?.requestRender();\n\t}\n\n\tprivate drawRain(): void {\n\t\tconst engine = this.engine!;\n\t\tthis.rainGlyphs.length = Math.min(this.rainWidth, engine.rainColumns);\n\t\tfor (let i = 0; i < this.rainGlyphs.length; i++) {\n\t\t\tthis.rainGlyphs[i] = this.bitPalette[engine.brightness[i]][engine.cells[i]];\n\t\t}\n\t\t// Reuse glyph/color strings and the scratch array; only the terminal's changed line needs a new string.\n\t\tthis.animatedText = this.rainGlyphs.join(\"\");\n\t\tthis.rainBorder = undefined;\n\t}\n\n\toverride stop(): void {\n\t\tsuper.stop();\n\t\tif (this.animationTimer) clearInterval(this.animationTimer);\n\t\tthis.animationTimer = undefined;\n\t}\n}\n\nexport class RetryStatusIndicator extends WorkingStatusIndicator {\n\tprivate countdown: CountdownTimer | undefined;\n\n\tconstructor(\n\t\tui: TUI,\n\t\tattempt: number,\n\t\tmaxAttempts: number,\n\t\tdelayMs: number,\n\t\tconfig: StatusIndicatorConfiguration = {},\n\t) {\n\t\tconst retryMessage = (seconds: number) =>\n\t\t\t`Retrying (${attempt}/${maxAttempts}) in ${seconds}s... (${keyText(\"app.interrupt\")} to cancel)`;\n\t\tsuper(\n\t\t\tui,\n\t\t\tretryMessage(Math.ceil(delayMs / 1000)),\n\t\t\tconfig.indicator,\n\t\t\t(text) => theme.fg(\"warning\", text),\n\t\t\tconfig.style,\n\t\t\tconfig.level,\n\t\t\tconfig.reducedMotion,\n\t\t\t\"retry\",\n\t\t);\n\t\tthis.countdown = new CountdownTimer(\n\t\t\tdelayMs,\n\t\t\tui,\n\t\t\t(seconds) => {\n\t\t\t\tthis.setMessage(retryMessage(seconds));\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tthis.countdown = undefined;\n\t\t\t},\n\t\t);\n\t}\n\n\toverride dispose(): void {\n\t\tthis.countdown?.dispose();\n\t\tthis.countdown = undefined;\n\t\tsuper.dispose();\n\t}\n}\n\nexport type CompactionStatusReason = \"manual\" | \"threshold\" | \"overflow\";\n\nexport class CompactionStatusIndicator extends WorkingStatusIndicator {\n\tconstructor(\n\t\tui: TUI,\n\t\treason: CompactionStatusReason,\n\t\tcolorFn?: (text: string) => string,\n\t\tconfig: StatusIndicatorConfiguration = {},\n\t) {\n\t\tconst cancelHint = `(${keyText(\"app.interrupt\")} to cancel)`;\n\t\tconst label =\n\t\t\treason === \"manual\"\n\t\t\t\t? `Compacting context... ${cancelHint}`\n\t\t\t\t: `${reason === \"overflow\" ? \"Context overflow detected, \" : \"\"}Auto-compacting... ${cancelHint}`;\n\t\tsuper(ui, label, config.indicator, colorFn, config.style, config.level, config.reducedMotion, \"compaction\");\n\t}\n}\n\nexport class BranchSummaryStatusIndicator extends WorkingStatusIndicator {\n\tconstructor(ui: TUI, config: StatusIndicatorConfiguration = {}) {\n\t\tsuper(\n\t\t\tui,\n\t\t\t`Summarizing branch... (${keyText(\"app.interrupt\")} to cancel)`,\n\t\t\tconfig.indicator,\n\t\t\tundefined,\n\t\t\tconfig.style,\n\t\t\tconfig.level,\n\t\t\tconfig.reducedMotion,\n\t\t\t\"branchSummary\",\n\t\t);\n\t}\n}\n\nexport class IdleStatus implements Component {\n\tinvalidate(): void {\n\t\t// No cached state to invalidate.\n\t}\n\n\trender(width: number): string[] {\n\t\tconst emptyLine = \" \".repeat(width);\n\t\treturn [emptyLine, emptyLine];\n\t}\n}\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Container } from "@earendil-works/pi-tui";
|
|
2
|
+
/** Optional task data supplied by a checklist integration, without importing its implementation. */
|
|
3
|
+
export interface StatusTasksProvider {
|
|
4
|
+
getChecklistStatusSegment(): {
|
|
5
|
+
text: string;
|
|
6
|
+
} | undefined;
|
|
7
|
+
}
|
|
8
|
+
/** Keep state, model and context visible before admitting lower-priority fields. */
|
|
9
|
+
export declare function composeStatusLine(state: string, model: string, context: string, fields: readonly string[], width: number, priority?: "balanced" | "maintenance"): string;
|
|
10
|
+
/** A persistent status slot: legacy indicator children remain owned by their existing lifecycle. */
|
|
11
|
+
export declare class StatusLineContainer extends Container {
|
|
12
|
+
private readonly draw;
|
|
13
|
+
constructor(draw: (width: number) => string[]);
|
|
14
|
+
render(width: number): string[];
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=status-line.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status-line.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/status-line.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAiC,MAAM,wBAAwB,CAAC;AAElF,oGAAoG;AACpG,MAAM,WAAW,mBAAmB;IACnC,yBAAyB,IAAI;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;CAC1D;AAED,oFAAoF;AACpF,wBAAgB,iBAAiB,CAChC,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,KAAK,EAAE,MAAM,EACb,QAAQ,GAAE,UAAU,GAAG,aAA0B,GAC/C,MAAM,CAiCR;AAED,oGAAoG;AACpG,qBAAa,mBAAoB,SAAQ,SAAS;IACjD,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA8B;IACnD,YAAY,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,EAAE,EAG5C;IACQ,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAEvC;CACD"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// Compact, width-safe composition for the interactive status line.
|
|
2
|
+
import { Container, truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
|
|
3
|
+
/** Keep state, model and context visible before admitting lower-priority fields. */
|
|
4
|
+
export function composeStatusLine(state, model, context, fields, width, priority = "balanced") {
|
|
5
|
+
if (width < 1)
|
|
6
|
+
return "";
|
|
7
|
+
const separator = " › ";
|
|
8
|
+
if (priority === "maintenance") {
|
|
9
|
+
let line = truncateToWidth(state, width, "");
|
|
10
|
+
for (const field of [model, context, ...fields]) {
|
|
11
|
+
if (!field)
|
|
12
|
+
continue;
|
|
13
|
+
const next = `${line}${separator}${field}`;
|
|
14
|
+
if (visibleWidth(next) > width)
|
|
15
|
+
break;
|
|
16
|
+
line = next;
|
|
17
|
+
}
|
|
18
|
+
return line;
|
|
19
|
+
}
|
|
20
|
+
const essential = [state, model, context];
|
|
21
|
+
let line = essential.join(separator);
|
|
22
|
+
if (visibleWidth(line) > width) {
|
|
23
|
+
const budget = Math.max(0, width - visibleWidth(context) - 6);
|
|
24
|
+
const stateWidth = Math.min(visibleWidth(state), Math.floor(budget / 2));
|
|
25
|
+
line = [truncateToWidth(state, stateWidth, ""), truncateToWidth(model, budget - stateWidth, ""), context].join(separator);
|
|
26
|
+
return truncateToWidth(line, width, "");
|
|
27
|
+
}
|
|
28
|
+
for (const [index, field] of fields.entries()) {
|
|
29
|
+
if (!field)
|
|
30
|
+
continue;
|
|
31
|
+
const next = index < 2
|
|
32
|
+
? [state, model, ...fields.slice(0, index + 1), context].join(separator)
|
|
33
|
+
: `${line}${separator}${field}`;
|
|
34
|
+
if (visibleWidth(next) > width)
|
|
35
|
+
break;
|
|
36
|
+
line = next;
|
|
37
|
+
}
|
|
38
|
+
return line;
|
|
39
|
+
}
|
|
40
|
+
/** A persistent status slot: legacy indicator children remain owned by their existing lifecycle. */
|
|
41
|
+
export class StatusLineContainer extends Container {
|
|
42
|
+
draw;
|
|
43
|
+
constructor(draw) {
|
|
44
|
+
super();
|
|
45
|
+
this.draw = draw;
|
|
46
|
+
}
|
|
47
|
+
render(width) {
|
|
48
|
+
return this.draw(width);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=status-line.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status-line.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/status-line.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAOlF,oFAAoF;AACpF,MAAM,UAAU,iBAAiB,CAChC,KAAa,EACb,KAAa,EACb,OAAe,EACf,MAAyB,EACzB,KAAa,EACb,QAAQ,GAA+B,UAAU;IAEjD,IAAI,KAAK,GAAG,CAAC;QAAE,OAAO,EAAE,CAAC;IACzB,MAAM,SAAS,GAAG,KAAK,CAAC;IACxB,IAAI,QAAQ,KAAK,aAAa,EAAE,CAAC;QAChC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/C,IAAI,CAAC,KAAK;YAAE,SAAS;QACrB,MAAM,IAAI,GACT,KAAK,GAAG,CAAC;YACR,CAAC,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC;YACxE,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,KAAK,EAAE,CAAC;QAClC,IAAI,YAAY,CAAC,IAAI,CAAC,GAAG,KAAK;YAAE,MAAM;QACtC,IAAI,GAAG,IAAI,CAAC;IACb,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC;AAED,oGAAoG;AACpG,MAAM,OAAO,mBAAoB,SAAQ,SAAS;IAChC,IAAI,CAA8B;IACnD,YAAY,IAAiC;QAC5C,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IAClB,CAAC;IACQ,MAAM,CAAC,KAAa;QAC5B,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;CACD","sourcesContent":["// Compact, width-safe composition for the interactive status line.\nimport { Container, truncateToWidth, visibleWidth } from \"@earendil-works/pi-tui\";\n\n/** Optional task data supplied by a checklist integration, without importing its implementation. */\nexport interface StatusTasksProvider {\n\tgetChecklistStatusSegment(): { text: string } | undefined;\n}\n\n/** Keep state, model and context visible before admitting lower-priority fields. */\nexport function composeStatusLine(\n\tstate: string,\n\tmodel: string,\n\tcontext: string,\n\tfields: readonly string[],\n\twidth: number,\n\tpriority: \"balanced\" | \"maintenance\" = \"balanced\",\n): string {\n\tif (width < 1) return \"\";\n\tconst separator = \" › \";\n\tif (priority === \"maintenance\") {\n\t\tlet line = truncateToWidth(state, width, \"\");\n\t\tfor (const field of [model, context, ...fields]) {\n\t\t\tif (!field) continue;\n\t\t\tconst next = `${line}${separator}${field}`;\n\t\t\tif (visibleWidth(next) > width) break;\n\t\t\tline = next;\n\t\t}\n\t\treturn line;\n\t}\n\tconst essential = [state, model, context];\n\tlet line = essential.join(separator);\n\tif (visibleWidth(line) > width) {\n\t\tconst budget = Math.max(0, width - visibleWidth(context) - 6);\n\t\tconst stateWidth = Math.min(visibleWidth(state), Math.floor(budget / 2));\n\t\tline = [truncateToWidth(state, stateWidth, \"\"), truncateToWidth(model, budget - stateWidth, \"\"), context].join(\n\t\t\tseparator,\n\t\t);\n\t\treturn truncateToWidth(line, width, \"\");\n\t}\n\tfor (const [index, field] of fields.entries()) {\n\t\tif (!field) continue;\n\t\tconst next =\n\t\t\tindex < 2\n\t\t\t\t? [state, model, ...fields.slice(0, index + 1), context].join(separator)\n\t\t\t\t: `${line}${separator}${field}`;\n\t\tif (visibleWidth(next) > width) break;\n\t\tline = next;\n\t}\n\treturn line;\n}\n\n/** A persistent status slot: legacy indicator children remain owned by their existing lifecycle. */\nexport class StatusLineContainer extends Container {\n\tprivate readonly draw: (width: number) => string[];\n\tconstructor(draw: (width: number) => string[]) {\n\t\tsuper();\n\t\tthis.draw = draw;\n\t}\n\toverride render(width: number): string[] {\n\t\treturn this.draw(width);\n\t}\n}\n"]}
|
|
@@ -52,6 +52,11 @@ export declare class ToolExecutionComponent extends Container {
|
|
|
52
52
|
private createResultRegion;
|
|
53
53
|
/** Returns whether new arguments may change what this draws. */
|
|
54
54
|
updateArgs(args: unknown): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Stop what keeps this row asking for frames once it gets no final result: it left the transcript, or its run
|
|
57
|
+
* ended (Pi-Bolt 4adb6bb99). The elapsed time stays as it was.
|
|
58
|
+
*/
|
|
59
|
+
dispose(): void;
|
|
55
60
|
markExecutionStarted(): void;
|
|
56
61
|
setArgsComplete(): void;
|
|
57
62
|
updateResult(result: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-execution.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/tool-execution.ts"],"names":[],"mappings":"AACA,OAAO,EAGN,SAAS,EAYT,KAAK,GAAG,EACR,KAAK,aAAa,EAClB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,cAAc,EAAqB,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAE1G,mFAAmF;AACnF,YAAY,EAAE,aAAa,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"tool-execution.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/tool-execution.ts"],"names":[],"mappings":"AACA,OAAO,EAGN,SAAS,EAYT,KAAK,GAAG,EACR,KAAK,aAAa,EAClB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,cAAc,EAAqB,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAE1G,mFAAmF;AACnF,YAAY,EAAE,aAAa,EAAE,CAAC;AAc9B,MAAM,WAAW,oBAAoB;IACpC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,qBAAa,sBAAuB,SAAQ,SAAS;IACpD,OAAO,CAAC,UAAU,CAAM;IACxB,OAAO,CAAC,WAAW,CAAO;IAC1B,OAAO,CAAC,iBAAiB,CAAc;IACvC,OAAO,CAAC,mBAAmB,CAAY;IACvC,OAAO,CAAC,gBAAgB,CAAK;IAC7B,2FAA2F;IAC3F,OAAO,CAAC,eAAe,CAAC,CAAwB;IAChD,OAAO,CAAC,eAAe,CAAyB;IAChD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAyB;IACpD,OAAO,CAAC,qBAAqB,CAAC,CAAY;IAC1C,OAAO,CAAC,uBAAuB,CAAC,CAAY;IAC5C,OAAO,CAAC,aAAa,CAAW;IAChC,OAAO,CAAC,eAAe,CAAe;IACtC,sGAAsG;IACtG,OAAO,CAAC,YAAY,CAAqE;IACzF,OAAO,CAAC,YAAY,CAAgB;IACpC,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,U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CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QAClF,OAAO,CAAC,EAAE,GAAG,CAAC;QACd,OAAO,EAAE,OAAO,CAAC;QACjB,wCAAwC;QACxC,UAAU,CAAC,EAAE,MAAM,CAAC;KACpB,EACD,SAAS,UAAQ,GACf,IAAI,CAIN;IAED,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAGnC;IAED,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAGpC;IAED,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAGjC;IAED,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAGtC;IAEQ,UAAU,IAAI,IAAI,CAG1B;IAED,0FAA0F;IAC1F,YAAY,CAAC,SAAS,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,OAAO,CAEpD;IAEQ,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CA6CtD;IAEQ,WAAW,CAAC,KAAK,EAAE,aAAa,GAAG,UAAU,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAQ/E;IAED,OAAO,CAAC,aAAa;IA4HrB,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,mBAAmB;CAa3B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Derived from Pi-Bolt (MIT, Copyright (c) 2026 OpenSec (Pi-Bolt)), commits d82b859e, a6df6a2c; modified for HUMAIN Code CLI.
|
|
2
2
|
import { Box, Container, getCapabilities, Image, MouseRegion, markReportsChanges, renderChildLines, reportRenderChange, reportsChanges, Spacer, sanitizeTerminalText, setSubtreeReportsChanges, Text, } from "@earendil-works/pi-tui";
|
|
3
|
-
import { formatToolCallWithArgs, getTextOutput as getRenderedTextOutput } from "../../../core/tools/render-utils.js";
|
|
3
|
+
import { formatToolCallWithArgs, getTextOutput as getRenderedTextOutput, stopToolTimer, } from "../../../core/tools/render-utils.js";
|
|
4
4
|
import { renderersMayHighlight } from "../../../core/tools/renderers/highlighting.js";
|
|
5
5
|
import { ensurePngTranscoder } from "../../../utils/image-convert.js";
|
|
6
6
|
import { theme } from "../theme/theme.js";
|
|
@@ -140,6 +140,13 @@ export class ToolExecutionComponent extends Container {
|
|
|
140
140
|
this.ui.requestRender();
|
|
141
141
|
return true;
|
|
142
142
|
}
|
|
143
|
+
/**
|
|
144
|
+
* Stop what keeps this row asking for frames once it gets no final result: it left the transcript, or its run
|
|
145
|
+
* ended (Pi-Bolt 4adb6bb99). The elapsed time stays as it was.
|
|
146
|
+
*/
|
|
147
|
+
dispose() {
|
|
148
|
+
stopToolTimer(this.rendererState);
|
|
149
|
+
}
|
|
143
150
|
markExecutionStarted() {
|
|
144
151
|
this.executionStarted = true;
|
|
145
152
|
this.updateDisplay();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-execution.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/tool-execution.ts"],"names":[],"mappings":"AAAA,8HAA8H;AAC9H,OAAO,EACN,GAAG,EAEH,SAAS,EACT,eAAe,EACf,KAAK,EACL,WAAW,EACX,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,MAAM,EACN,oBAAoB,EACpB,wBAAwB,EACxB,IAAI,GAGJ,MAAM,wBAAwB,CAAC;AAMhC,OAAO,EAAE,sBAAsB,EAAE,aAAa,IAAI,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AACrH,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AACtF,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAQlC,MAAM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AC;QACF,CAAC;QAED,IAAI,IAAI,CAAC,qBAAqB,EAAE,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,eAAe,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACtF,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC3B,CAAC;QACD,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAEO,aAAa;QACpB,OAAO,qBAAqB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IAC5D,CAAC;IAEO,mBAAmB;QAC1B,IAAI,IAAI,GAAG,KAAK,CAAC,EAAE,CAAC,WAAW,EAAE,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAClF,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACnD,IAAI,OAAO,EAAE,CAAC;YACb,gGAAgG;YAChG,IAAI,IAAI,OAAO,oBAAoB,CAAC,OAAO,CAAC,EAAE,CAAC;QAChD,CAAC;QACD,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;QACpC,IAAI,MAAM,EAAE,CAAC;YACZ,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;QACvB,CAAC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;CACD;AAED,kBAAkB,CAAC,sBAAsB,CAAC,CAAC","sourcesContent":["// Derived from Pi-Bolt (MIT, Copyright (c) 2026 OpenSec (Pi-Bolt)), commits d82b859e, a6df6a2c; modified for HUMAIN Code CLI.\nimport {\n\tBox,\n\ttype Component,\n\tContainer,\n\tgetCapabilities,\n\tImage,\n\tMouseRegion,\n\tmarkReportsChanges,\n\trenderChildLines,\n\treportRenderChange,\n\treportsChanges,\n\tSpacer,\n\tsanitizeTerminalText,\n\tsetSubtreeReportsChanges,\n\tText,\n\ttype TUI,\n\ttype TuiMouseEvent,\n} from \"@earendil-works/pi-tui\";\nimport type { ToolDefinition, ToolRenderContext, ToolRenderers } from \"../../../core/extensions/types.ts\";\n\n/** What this component needs from a tool: how to draw it, without executing it. */\nexport type { ToolRenderers };\n\nimport { formatToolCallWithArgs, getTextOutput as getRenderedTextOutput } from \"../../../core/tools/render-utils.ts\";\nimport { renderersMayHighlight } from \"../../../core/tools/renderers/highlighting.ts\";\nimport { ensurePngTranscoder } from \"../../../utils/image-convert.ts\";\nimport { theme } from \"../theme/theme.ts\";\nimport { keyHint, keyText } from \"./keybinding-hints.ts\";\n\nconst FALLBACK_PREVIEW_LINES = 10;\n\nexport interface ToolExecutionOptions {\n\tshowImages?: boolean;\n\timageWidthCells?: number;\n\toutputPad?: number;\n}\n\nexport class ToolExecutionComponent extends Container {\n\tprivate contentBox: Box;\n\tprivate contentText: Text;\n\tprivate contentTextRegion: MouseRegion;\n\tprivate selfRenderContainer: Container;\n\tprivate selfRenderHeight = 0;\n\t/** What the self-rendered shell was joined from, and the joined lines (renderShared()). */\n\tprivate selfRenderParts?: (readonly string[])[];\n\tprivate selfRenderLines: readonly string[] = [];\n\tprivate readonly emptyLines: readonly string[] = [];\n\tprivate callRendererComponent?: Component;\n\tprivate resultRendererComponent?: Component;\n\tprivate rendererState: any = {};\n\tprivate imageComponents: Image[] = [];\n\t/** Inputs of imageComponents, so updateDisplay can reuse images and keep their converted PNG data. */\n\tprivate imageSources: Array<{ data: string; mimeType: string; widthCells: number }> = [];\n\tprivate imageSpacers: Spacer[] = [];\n\tprivate toolName: string;\n\tprivate toolCallId: string;\n\tprivate args: any;\n\tprivate expanded = false;\n\tprivate showImages: boolean;\n\tprivate imageWidthCells: number;\n\tprivate outputPad: number;\n\tprivate isPartial = true;\n\tprivate toolDefinition?: ToolRenderers;\n\tprivate ui: TUI;\n\tprivate cwd: string;\n\tprivate executionStarted = false;\n\tprivate argsComplete = false;\n\t/** `updateArgs()` ran since the last display update; the next render applies it. */\n\tprivate argsPending = false;\n\tprivate result?: {\n\t\tcontent: Array<{ type: string; text?: string; data?: string; mimeType?: string }>;\n\t\tisError: boolean;\n\t\tdetails?: any;\n\t\tdurationMs?: number;\n\t};\n\tprivate hideComponent = false;\n\n\tconstructor(\n\t\ttoolName: string,\n\t\ttoolCallId: string,\n\t\targs: any,\n\t\toptions: ToolExecutionOptions = {},\n\t\ttoolDefinition: ToolRenderers | ToolDefinition<any, any, any> | undefined,\n\t\tui: TUI,\n\t\tcwd: string,\n\t) {\n\t\tsuper();\n\t\tthis.toolName = toolName;\n\t\tthis.toolCallId = toolCallId;\n\t\tthis.args = args;\n\t\tthis.toolDefinition = toolDefinition;\n\t\tthis.showImages = options.showImages ?? true;\n\t\tthis.imageWidthCells = options.imageWidthCells ?? 60;\n\t\tthis.outputPad = options.outputPad ?? 1;\n\t\tthis.ui = ui;\n\t\tthis.cwd = cwd;\n\n\t\tthis.addChild(new Spacer(1));\n\n\t\t// Always create all shell variants. contentBox is used for default renderer-based composition.\n\t\t// selfRenderContainer is used when the tool renders its own framing.\n\t\t// contentText is reserved for generic fallback rendering when no tool definition exists.\n\t\tthis.contentBox = new Box(1, 1, (text: string) => theme.bg(\"toolPendingBg\", text));\n\t\t// (Its backgrounds read the theme, and every theme change invalidates the transcript.)\n\t\tthis.contentBox.setBackgroundReported(true);\n\t\tthis.contentText = new Text(\"\", 1, 1, (text: string) => theme.bg(\"toolPendingBg\", text));\n\t\tthis.contentTextRegion = this.createResultRegion(this.contentText);\n\t\tthis.selfRenderContainer = new Container();\n\n\t\tif (this.hasRendererDefinition()) {\n\t\t\tthis.addChild(this.getRenderShell() === \"self\" ? this.selfRenderContainer : this.contentBox);\n\t\t} else {\n\t\t\tthis.addChild(this.contentTextRegion);\n\t\t}\n\n\t\tthis.updateDisplay();\n\t}\n\n\tprivate getCallRenderer(): ToolDefinition<any, any>[\"renderCall\"] | undefined {\n\t\treturn this.toolDefinition?.renderCall;\n\t}\n\n\tprivate getResultRenderer(): ToolDefinition<any, any>[\"renderResult\"] | undefined {\n\t\treturn this.toolDefinition?.renderResult;\n\t}\n\n\tprivate hasRendererDefinition(): boolean {\n\t\treturn this.toolDefinition !== undefined;\n\t}\n\n\tprivate getRenderShell(): \"default\" | \"self\" {\n\t\treturn this.toolDefinition?.renderShell ?? \"default\";\n\t}\n\n\tprivate getRenderContext(lastComponent: Component | undefined): ToolRenderContext {\n\t\treturn {\n\t\t\targs: this.args,\n\t\t\ttoolCallId: this.toolCallId,\n\t\t\tinvalidate: () => {\n\t\t\t\tthis.invalidate();\n\t\t\t\tthis.ui.requestRender();\n\t\t\t},\n\t\t\tlastComponent,\n\t\t\tstate: this.rendererState,\n\t\t\tcwd: this.cwd,\n\t\t\texecutionStarted: this.executionStarted,\n\t\t\targsComplete: this.argsComplete,\n\t\t\tisPartial: this.isPartial,\n\t\t\texpanded: this.expanded,\n\t\t\tshowImages: this.showImages,\n\t\t\tisError: this.result?.isError ?? false,\n\t\t\tdurationMs: this.isPartial ? undefined : this.result?.durationMs,\n\t\t\toutputPad: this.outputPad,\n\t\t\tkeyText,\n\t\t\tkeyHint,\n\t\t};\n\t}\n\n\tprivate createCallFallback(): Component {\n\t\treturn new Text(formatToolCallWithArgs(this.toolName, this.args, theme, this.expanded), 0, 0);\n\t}\n\n\tprivate createResultFallback(): Component | undefined {\n\t\tconst output = this.getTextOutput();\n\t\tif (!output) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst lines = output.split(\"\\n\");\n\t\tconst displayLines = this.expanded ? lines : lines.slice(0, FALLBACK_PREVIEW_LINES);\n\t\tconst remaining = lines.length - displayLines.length;\n\t\tlet text = displayLines.map((line) => theme.fg(\"toolOutput\", line)).join(\"\\n\");\n\t\tif (remaining > 0) {\n\t\t\ttext += `${theme.fg(\"muted\", `\\n... (${remaining} more lines,`)} ${keyHint(\"app.tools.expand\", \"to expand\")}${theme.fg(\"muted\", \")\")}`;\n\t\t}\n\t\treturn new Text(text, 0, 0);\n\t}\n\n\tprivate createResultRegion(component: Component): MouseRegion {\n\t\treturn new MouseRegion(component, (event) => {\n\t\t\tif (!this.result || event.type !== \"click\" || event.button !== \"left\") return undefined;\n\t\t\tthis.setExpanded(!this.expanded);\n\t\t\treturn { handled: true };\n\t\t});\n\t}\n\n\t/** Returns whether new arguments may change what this draws. */\n\tupdateArgs(args: unknown): boolean {\n\t\t// Streaming parsers reuse arguments between parses; avoid redrawing the same large file preview.\n\t\tif (args === this.args) return false;\n\t\tthis.args = args;\n\t\tthis.argsPending = true;\n\t\treportRenderChange(this);\n\t\tthis.ui.requestRender();\n\t\treturn true;\n\t}\n\n\tmarkExecutionStarted(): void {\n\t\tthis.executionStarted = true;\n\t\tthis.updateDisplay();\n\t\tthis.ui.requestRender();\n\t}\n\n\tsetArgsComplete(): void {\n\t\tthis.argsComplete = true;\n\t\tthis.updateDisplay();\n\t\tthis.ui.requestRender();\n\t}\n\n\tupdateResult(\n\t\tresult: {\n\t\t\tcontent: Array<{ type: string; text?: string; data?: string; mimeType?: string }>;\n\t\t\tdetails?: any;\n\t\t\tisError: boolean;\n\t\t\t/** Execution time of a final result. */\n\t\t\tdurationMs?: number;\n\t\t},\n\t\tisPartial = false,\n\t): void {\n\t\tthis.result = result;\n\t\tthis.isPartial = isPartial;\n\t\tthis.updateDisplay();\n\t}\n\n\tsetExpanded(expanded: boolean): void {\n\t\tthis.expanded = expanded;\n\t\tthis.updateDisplay();\n\t}\n\n\tsetOutputPad(outputPad: number): void {\n\t\tthis.outputPad = outputPad;\n\t\tthis.updateDisplay();\n\t}\n\n\tsetShowImages(show: boolean): void {\n\t\tthis.showImages = show;\n\t\tthis.updateDisplay();\n\t}\n\n\tsetImageWidthCells(width: number): void {\n\t\tthis.imageWidthCells = Math.max(1, Math.floor(width));\n\t\tthis.updateDisplay();\n\t}\n\n\toverride invalidate(): void {\n\t\tsuper.invalidate();\n\t\tthis.updateDisplay();\n\t}\n\n\t/** Whether this row may show code highlighted in one of `languages` (lowercase names). */\n\tmayHighlight(languages: ReadonlySet<string>): boolean {\n\t\treturn renderersMayHighlight(this.toolDefinition, this.args, languages);\n\t}\n\n\toverride renderShared(width: number): readonly string[] {\n\t\tif (this.argsPending) this.updateDisplay();\n\t\tif (this.hideComponent) {\n\t\t\tthis.noteRendered();\n\t\t\treturn this.emptyLines;\n\t\t}\n\n\t\tif (this.hasRendererDefinition() && this.getRenderShell() === \"self\") {\n\t\t\tthis.noteRendered();\n\t\t\t// The parts' lines: all from components that keep their lines (renderSharedLines()), so the same arrays are the\n\t\t\t// same lines, and the joined lines are kept with them.\n\t\t\tconst parts = [renderChildLines(this, this.selfRenderContainer, width)];\n\t\t\tlet reports = reportsChanges(this.selfRenderContainer);\n\t\t\tfor (let i = 0; i < this.imageComponents.length; i++) {\n\t\t\t\tconst spacer = this.imageSpacers[i];\n\t\t\t\tif (spacer) parts.push(renderChildLines(this, spacer, width));\n\t\t\t\tconst imageComponent = this.imageComponents[i];\n\t\t\t\tif (imageComponent) {\n\t\t\t\t\tparts.push(renderChildLines(this, imageComponent, width));\n\t\t\t\t\tif (!reportsChanges(imageComponent)) reports = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tsetSubtreeReportsChanges(this, reports);\n\t\t\tconst previous = this.selfRenderParts;\n\t\t\tif (previous?.length === parts.length && previous.every((part, i) => part === parts[i])) {\n\t\t\t\treturn this.selfRenderLines;\n\t\t\t}\n\t\t\tconst contentLines = parts[0]!;\n\t\t\tthis.selfRenderHeight = contentLines.length;\n\t\t\tconst lines: string[] = [];\n\t\t\tif (contentLines.length > 0) {\n\t\t\t\tlines.push(\"\");\n\t\t\t\t// Append in a loop: spreading hundreds of thousands of wrapped lines exceeds V8's argument limit.\n\t\t\t\tfor (const line of contentLines) lines.push(line);\n\t\t\t}\n\t\t\tfor (let i = 1; i < parts.length; i++) {\n\t\t\t\tlines.push(...parts[i]!);\n\t\t\t}\n\t\t\tthis.selfRenderParts = parts;\n\t\t\tthis.selfRenderLines =\n\t\t\t\tcontentLines.length === 0 && this.imageComponents.length === 0 ? this.emptyLines : lines;\n\t\t\treturn this.selfRenderLines;\n\t\t}\n\n\t\treturn super.renderShared(width);\n\t}\n\n\toverride handleMouse(event: TuiMouseEvent): ReturnType<Container[\"handleMouse\"]> {\n\t\tif (!this.hasRendererDefinition() || this.getRenderShell() !== \"self\") return super.handleMouse(event);\n\t\tif (event.y <= 0 || event.y > this.selfRenderHeight) return undefined;\n\t\treturn this.selfRenderContainer.handleMouse({\n\t\t\t...event,\n\t\t\ty: event.y - 1,\n\t\t\theight: this.selfRenderHeight,\n\t\t});\n\t}\n\n\tprivate updateDisplay(): void {\n\t\tthis.argsPending = false;\n\t\tconst bgFn = this.isPartial\n\t\t\t? (text: string) => theme.bg(\"toolPendingBg\", text)\n\t\t\t: this.result?.isError\n\t\t\t\t? (text: string) => theme.bg(\"toolErrorBg\", text)\n\t\t\t\t: (text: string) => theme.bg(\"toolSuccessBg\", text);\n\n\t\tlet hasContent = false;\n\t\tthis.hideComponent = false;\n\t\tif (this.hasRendererDefinition()) {\n\t\t\tconst renderContainer = this.getRenderShell() === \"self\" ? this.selfRenderContainer : this.contentBox;\n\t\t\tif (renderContainer instanceof Box) {\n\t\t\t\trenderContainer.setBgFn(bgFn);\n\t\t\t\trenderContainer.setPaddingX(this.outputPad);\n\t\t\t}\n\t\t\trenderContainer.clear();\n\n\t\t\tconst callRenderer = this.getCallRenderer();\n\t\t\tif (!callRenderer) {\n\t\t\t\trenderContainer.addChild(this.createResultRegion(this.createCallFallback()));\n\t\t\t\thasContent = true;\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\tconst component = callRenderer(this.args, theme, this.getRenderContext(this.callRendererComponent));\n\t\t\t\t\tthis.callRendererComponent = component;\n\t\t\t\t\trenderContainer.addChild(this.createResultRegion(component));\n\t\t\t\t\thasContent = true;\n\t\t\t\t} catch {\n\t\t\t\t\tthis.callRendererComponent = undefined;\n\t\t\t\t\trenderContainer.addChild(this.createResultRegion(this.createCallFallback()));\n\t\t\t\t\thasContent = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.result) {\n\t\t\t\tconst resultRenderer = this.getResultRenderer();\n\t\t\t\tif (!resultRenderer) {\n\t\t\t\t\tconst component = this.createResultFallback();\n\t\t\t\t\tif (component) {\n\t\t\t\t\t\trenderContainer.addChild(this.createResultRegion(component));\n\t\t\t\t\t\thasContent = true;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst component = resultRenderer(\n\t\t\t\t\t\t\t{ content: this.result.content as any, details: this.result.details },\n\t\t\t\t\t\t\t{ expanded: this.expanded, isPartial: this.isPartial },\n\t\t\t\t\t\t\ttheme,\n\t\t\t\t\t\t\tthis.getRenderContext(this.resultRendererComponent),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tthis.resultRendererComponent = component;\n\t\t\t\t\t\trenderContainer.addChild(this.createResultRegion(component));\n\t\t\t\t\t\thasContent = true;\n\t\t\t\t\t} catch {\n\t\t\t\t\t\tthis.resultRendererComponent = undefined;\n\t\t\t\t\t\tconst component = this.createResultFallback();\n\t\t\t\t\t\tif (component) {\n\t\t\t\t\t\t\trenderContainer.addChild(this.createResultRegion(component));\n\t\t\t\t\t\t\thasContent = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthis.contentText.setCustomBgFn(bgFn);\n\t\t\tthis.contentText.setPaddingX(this.outputPad);\n\t\t\tthis.contentText.setText(this.formatToolExecution());\n\t\t\thasContent = true;\n\t\t}\n\n\t\tconst previousImages = this.imageComponents;\n\t\tconst previousSources = this.imageSources;\n\t\tfor (const img of this.imageComponents) {\n\t\t\tthis.removeChild(img);\n\t\t}\n\t\tthis.imageComponents = [];\n\t\tthis.imageSources = [];\n\t\tfor (const spacer of this.imageSpacers) {\n\t\t\tthis.removeChild(spacer);\n\t\t}\n\t\tthis.imageSpacers = [];\n\n\t\tif (this.result) {\n\t\t\tconst imageBlocks = this.result.content.filter((c) => c.type === \"image\");\n\t\t\tconst caps = getCapabilities();\n\t\t\tfor (const img of imageBlocks) {\n\t\t\t\tif (caps.images && this.showImages && img.data && img.mimeType) {\n\t\t\t\t\tconst spacer = new Spacer(1);\n\t\t\t\t\tthis.addChild(spacer);\n\t\t\t\t\tthis.imageSpacers.push(spacer);\n\t\t\t\t\tconst source = { data: img.data, mimeType: img.mimeType, widthCells: this.imageWidthCells };\n\t\t\t\t\tconst index = this.imageComponents.length;\n\t\t\t\t\tconst previous = previousSources[index];\n\t\t\t\t\tconst imageComponent =\n\t\t\t\t\t\tprevious?.data === source.data &&\n\t\t\t\t\t\tprevious.mimeType === source.mimeType &&\n\t\t\t\t\t\tprevious.widthCells === source.widthCells\n\t\t\t\t\t\t\t? previousImages[index]\n\t\t\t\t\t\t\t: new Image(\n\t\t\t\t\t\t\t\t\tsource.data,\n\t\t\t\t\t\t\t\t\tsource.mimeType,\n\t\t\t\t\t\t\t\t\t{ fallbackColor: (s: string) => theme.fg(\"toolOutput\", s) },\n\t\t\t\t\t\t\t\t\t{ maxWidthCells: source.widthCells },\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\tif (source.mimeType !== \"image/png\") {\n\t\t\t\t\t\tensurePngTranscoder(() => {\n\t\t\t\t\t\t\tthis.invalidate();\n\t\t\t\t\t\t\tthis.ui.requestRender();\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tthis.imageComponents.push(imageComponent);\n\t\t\t\t\tthis.imageSources.push(source);\n\t\t\t\t\tthis.addChild(imageComponent);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (this.hasRendererDefinition() && !hasContent && this.imageComponents.length === 0) {\n\t\t\tthis.hideComponent = true;\n\t\t}\n\t\treportRenderChange(this);\n\t}\n\n\tprivate getTextOutput(): string {\n\t\treturn getRenderedTextOutput(this.result, this.showImages);\n\t}\n\n\tprivate formatToolExecution(): string {\n\t\tlet text = theme.fg(\"toolTitle\", theme.bold(sanitizeTerminalText(this.toolName)));\n\t\tconst content = JSON.stringify(this.args, null, 2);\n\t\tif (content) {\n\t\t\t// (JSON.stringify() escapes C0 controls in the model's arguments, but not DEL and C1 controls.)\n\t\t\ttext += `\\n\\n${sanitizeTerminalText(content)}`;\n\t\t}\n\t\tconst output = this.getTextOutput();\n\t\tif (output) {\n\t\t\ttext += `\\n${output}`;\n\t\t}\n\t\treturn text;\n\t}\n}\n\nmarkReportsChanges(ToolExecutionComponent);\n"]}
|
|
1
|
+
{"version":3,"file":"tool-execution.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/tool-execution.ts"],"names":[],"mappings":"AAAA,8HAA8H;AAC9H,OAAO,EACN,GAAG,EAEH,SAAS,EACT,eAAe,EACf,KAAK,EACL,WAAW,EACX,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,MAAM,EACN,oBAAoB,EACpB,wBAAwB,EACxB,IAAI,GAGJ,MAAM,wBAAwB,CAAC;AAMhC,OAAO,EACN,sBAAsB,EACtB,aAAa,IAAI,qBAAqB,EACtC,aAAa,GACb,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AACtF,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAQlC,MAAM,OAAO,sBAAuB,SAAQ,SAAS;IAC5C,UAAU,CAAM;IAChB,WAAW,CAAO;IAClB,iBAAiB,CAAc;IAC/B,mBAAmB,CAAY;IAC/B,gBAAgB,GAAG,CAAC,CAAC;IAC7B,2FAA2F;IACnF,eAAe,CAAyB;IACxC,eAAe,GAAsB,EAAE,CAAC;IAC/B,UAAU,GAAsB,EAAE,CAAC;IAC5C,qBAAqB,C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C3B,CAAC;QACD,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAEO,aAAa;QACpB,OAAO,qBAAqB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IAC5D,CAAC;IAEO,mBAAmB;QAC1B,IAAI,IAAI,GAAG,KAAK,CAAC,EAAE,CAAC,WAAW,EAAE,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAClF,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACnD,IAAI,OAAO,EAAE,CAAC;YACb,gGAAgG;YAChG,IAAI,IAAI,OAAO,oBAAoB,CAAC,OAAO,CAAC,EAAE,CAAC;QAChD,CAAC;QACD,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;QACpC,IAAI,MAAM,EAAE,CAAC;YACZ,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;QACvB,CAAC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;CACD;AAED,kBAAkB,CAAC,sBAAsB,CAAC,CAAC","sourcesContent":["// Derived from Pi-Bolt (MIT, Copyright (c) 2026 OpenSec (Pi-Bolt)), commits d82b859e, a6df6a2c; modified for HUMAIN Code CLI.\nimport {\n\tBox,\n\ttype Component,\n\tContainer,\n\tgetCapabilities,\n\tImage,\n\tMouseRegion,\n\tmarkReportsChanges,\n\trenderChildLines,\n\treportRenderChange,\n\treportsChanges,\n\tSpacer,\n\tsanitizeTerminalText,\n\tsetSubtreeReportsChanges,\n\tText,\n\ttype TUI,\n\ttype TuiMouseEvent,\n} from \"@earendil-works/pi-tui\";\nimport type { ToolDefinition, ToolRenderContext, ToolRenderers } from \"../../../core/extensions/types.ts\";\n\n/** What this component needs from a tool: how to draw it, without executing it. */\nexport type { ToolRenderers };\n\nimport {\n\tformatToolCallWithArgs,\n\tgetTextOutput as getRenderedTextOutput,\n\tstopToolTimer,\n} from \"../../../core/tools/render-utils.ts\";\nimport { renderersMayHighlight } from \"../../../core/tools/renderers/highlighting.ts\";\nimport { ensurePngTranscoder } from \"../../../utils/image-convert.ts\";\nimport { theme } from \"../theme/theme.ts\";\nimport { keyHint, keyText } from \"./keybinding-hints.ts\";\n\nconst FALLBACK_PREVIEW_LINES = 10;\n\nexport interface ToolExecutionOptions {\n\tshowImages?: boolean;\n\timageWidthCells?: number;\n\toutputPad?: number;\n}\n\nexport class ToolExecutionComponent extends Container {\n\tprivate contentBox: Box;\n\tprivate contentText: Text;\n\tprivate contentTextRegion: MouseRegion;\n\tprivate selfRenderContainer: Container;\n\tprivate selfRenderHeight = 0;\n\t/** What the self-rendered shell was joined from, and the joined lines (renderShared()). */\n\tprivate selfRenderParts?: (readonly string[])[];\n\tprivate selfRenderLines: readonly string[] = [];\n\tprivate readonly emptyLines: readonly string[] = [];\n\tprivate callRendererComponent?: Component;\n\tprivate resultRendererComponent?: Component;\n\tprivate rendererState: any = {};\n\tprivate imageComponents: Image[] = [];\n\t/** Inputs of imageComponents, so updateDisplay can reuse images and keep their converted PNG data. */\n\tprivate imageSources: Array<{ data: string; mimeType: string; widthCells: number }> = [];\n\tprivate imageSpacers: Spacer[] = [];\n\tprivate toolName: string;\n\tprivate toolCallId: string;\n\tprivate args: any;\n\tprivate expanded = false;\n\tprivate showImages: boolean;\n\tprivate imageWidthCells: number;\n\tprivate outputPad: number;\n\tprivate isPartial = true;\n\tprivate toolDefinition?: ToolRenderers;\n\tprivate ui: TUI;\n\tprivate cwd: string;\n\tprivate executionStarted = false;\n\tprivate argsComplete = false;\n\t/** `updateArgs()` ran since the last display update; the next render applies it. */\n\tprivate argsPending = false;\n\tprivate result?: {\n\t\tcontent: Array<{ type: string; text?: string; data?: string; mimeType?: string }>;\n\t\tisError: boolean;\n\t\tdetails?: any;\n\t\tdurationMs?: number;\n\t};\n\tprivate hideComponent = false;\n\n\tconstructor(\n\t\ttoolName: string,\n\t\ttoolCallId: string,\n\t\targs: any,\n\t\toptions: ToolExecutionOptions = {},\n\t\ttoolDefinition: ToolRenderers | ToolDefinition<any, any, any> | undefined,\n\t\tui: TUI,\n\t\tcwd: string,\n\t) {\n\t\tsuper();\n\t\tthis.toolName = toolName;\n\t\tthis.toolCallId = toolCallId;\n\t\tthis.args = args;\n\t\tthis.toolDefinition = toolDefinition;\n\t\tthis.showImages = options.showImages ?? true;\n\t\tthis.imageWidthCells = options.imageWidthCells ?? 60;\n\t\tthis.outputPad = options.outputPad ?? 1;\n\t\tthis.ui = ui;\n\t\tthis.cwd = cwd;\n\n\t\tthis.addChild(new Spacer(1));\n\n\t\t// Always create all shell variants. contentBox is used for default renderer-based composition.\n\t\t// selfRenderContainer is used when the tool renders its own framing.\n\t\t// contentText is reserved for generic fallback rendering when no tool definition exists.\n\t\tthis.contentBox = new Box(1, 1, (text: string) => theme.bg(\"toolPendingBg\", text));\n\t\t// (Its backgrounds read the theme, and every theme change invalidates the transcript.)\n\t\tthis.contentBox.setBackgroundReported(true);\n\t\tthis.contentText = new Text(\"\", 1, 1, (text: string) => theme.bg(\"toolPendingBg\", text));\n\t\tthis.contentTextRegion = this.createResultRegion(this.contentText);\n\t\tthis.selfRenderContainer = new Container();\n\n\t\tif (this.hasRendererDefinition()) {\n\t\t\tthis.addChild(this.getRenderShell() === \"self\" ? this.selfRenderContainer : this.contentBox);\n\t\t} else {\n\t\t\tthis.addChild(this.contentTextRegion);\n\t\t}\n\n\t\tthis.updateDisplay();\n\t}\n\n\tprivate getCallRenderer(): ToolDefinition<any, any>[\"renderCall\"] | undefined {\n\t\treturn this.toolDefinition?.renderCall;\n\t}\n\n\tprivate getResultRenderer(): ToolDefinition<any, any>[\"renderResult\"] | undefined {\n\t\treturn this.toolDefinition?.renderResult;\n\t}\n\n\tprivate hasRendererDefinition(): boolean {\n\t\treturn this.toolDefinition !== undefined;\n\t}\n\n\tprivate getRenderShell(): \"default\" | \"self\" {\n\t\treturn this.toolDefinition?.renderShell ?? \"default\";\n\t}\n\n\tprivate getRenderContext(lastComponent: Component | undefined): ToolRenderContext {\n\t\treturn {\n\t\t\targs: this.args,\n\t\t\ttoolCallId: this.toolCallId,\n\t\t\tinvalidate: () => {\n\t\t\t\tthis.invalidate();\n\t\t\t\tthis.ui.requestRender();\n\t\t\t},\n\t\t\tlastComponent,\n\t\t\tstate: this.rendererState,\n\t\t\tcwd: this.cwd,\n\t\t\texecutionStarted: this.executionStarted,\n\t\t\targsComplete: this.argsComplete,\n\t\t\tisPartial: this.isPartial,\n\t\t\texpanded: this.expanded,\n\t\t\tshowImages: this.showImages,\n\t\t\tisError: this.result?.isError ?? false,\n\t\t\tdurationMs: this.isPartial ? undefined : this.result?.durationMs,\n\t\t\toutputPad: this.outputPad,\n\t\t\tkeyText,\n\t\t\tkeyHint,\n\t\t};\n\t}\n\n\tprivate createCallFallback(): Component {\n\t\treturn new Text(formatToolCallWithArgs(this.toolName, this.args, theme, this.expanded), 0, 0);\n\t}\n\n\tprivate createResultFallback(): Component | undefined {\n\t\tconst output = this.getTextOutput();\n\t\tif (!output) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst lines = output.split(\"\\n\");\n\t\tconst displayLines = this.expanded ? lines : lines.slice(0, FALLBACK_PREVIEW_LINES);\n\t\tconst remaining = lines.length - displayLines.length;\n\t\tlet text = displayLines.map((line) => theme.fg(\"toolOutput\", line)).join(\"\\n\");\n\t\tif (remaining > 0) {\n\t\t\ttext += `${theme.fg(\"muted\", `\\n... (${remaining} more lines,`)} ${keyHint(\"app.tools.expand\", \"to expand\")}${theme.fg(\"muted\", \")\")}`;\n\t\t}\n\t\treturn new Text(text, 0, 0);\n\t}\n\n\tprivate createResultRegion(component: Component): MouseRegion {\n\t\treturn new MouseRegion(component, (event) => {\n\t\t\tif (!this.result || event.type !== \"click\" || event.button !== \"left\") return undefined;\n\t\t\tthis.setExpanded(!this.expanded);\n\t\t\treturn { handled: true };\n\t\t});\n\t}\n\n\t/** Returns whether new arguments may change what this draws. */\n\tupdateArgs(args: unknown): boolean {\n\t\t// Streaming parsers reuse arguments between parses; avoid redrawing the same large file preview.\n\t\tif (args === this.args) return false;\n\t\tthis.args = args;\n\t\tthis.argsPending = true;\n\t\treportRenderChange(this);\n\t\tthis.ui.requestRender();\n\t\treturn true;\n\t}\n\n\t/**\n\t * Stop what keeps this row asking for frames once it gets no final result: it left the transcript, or its run\n\t * ended (Pi-Bolt 4adb6bb99). The elapsed time stays as it was.\n\t */\n\tdispose(): void {\n\t\tstopToolTimer(this.rendererState);\n\t}\n\n\tmarkExecutionStarted(): void {\n\t\tthis.executionStarted = true;\n\t\tthis.updateDisplay();\n\t\tthis.ui.requestRender();\n\t}\n\n\tsetArgsComplete(): void {\n\t\tthis.argsComplete = true;\n\t\tthis.updateDisplay();\n\t\tthis.ui.requestRender();\n\t}\n\n\tupdateResult(\n\t\tresult: {\n\t\t\tcontent: Array<{ type: string; text?: string; data?: string; mimeType?: string }>;\n\t\t\tdetails?: any;\n\t\t\tisError: boolean;\n\t\t\t/** Execution time of a final result. */\n\t\t\tdurationMs?: number;\n\t\t},\n\t\tisPartial = false,\n\t): void {\n\t\tthis.result = result;\n\t\tthis.isPartial = isPartial;\n\t\tthis.updateDisplay();\n\t}\n\n\tsetExpanded(expanded: boolean): void {\n\t\tthis.expanded = expanded;\n\t\tthis.updateDisplay();\n\t}\n\n\tsetOutputPad(outputPad: number): void {\n\t\tthis.outputPad = outputPad;\n\t\tthis.updateDisplay();\n\t}\n\n\tsetShowImages(show: boolean): void {\n\t\tthis.showImages = show;\n\t\tthis.updateDisplay();\n\t}\n\n\tsetImageWidthCells(width: number): void {\n\t\tthis.imageWidthCells = Math.max(1, Math.floor(width));\n\t\tthis.updateDisplay();\n\t}\n\n\toverride invalidate(): void {\n\t\tsuper.invalidate();\n\t\tthis.updateDisplay();\n\t}\n\n\t/** Whether this row may show code highlighted in one of `languages` (lowercase names). */\n\tmayHighlight(languages: ReadonlySet<string>): boolean {\n\t\treturn renderersMayHighlight(this.toolDefinition, this.args, languages);\n\t}\n\n\toverride renderShared(width: number): readonly string[] {\n\t\tif (this.argsPending) this.updateDisplay();\n\t\tif (this.hideComponent) {\n\t\t\tthis.noteRendered();\n\t\t\treturn this.emptyLines;\n\t\t}\n\n\t\tif (this.hasRendererDefinition() && this.getRenderShell() === \"self\") {\n\t\t\tthis.noteRendered();\n\t\t\t// The parts' lines: all from components that keep their lines (renderSharedLines()), so the same arrays are the\n\t\t\t// same lines, and the joined lines are kept with them.\n\t\t\tconst parts = [renderChildLines(this, this.selfRenderContainer, width)];\n\t\t\tlet reports = reportsChanges(this.selfRenderContainer);\n\t\t\tfor (let i = 0; i < this.imageComponents.length; i++) {\n\t\t\t\tconst spacer = this.imageSpacers[i];\n\t\t\t\tif (spacer) parts.push(renderChildLines(this, spacer, width));\n\t\t\t\tconst imageComponent = this.imageComponents[i];\n\t\t\t\tif (imageComponent) {\n\t\t\t\t\tparts.push(renderChildLines(this, imageComponent, width));\n\t\t\t\t\tif (!reportsChanges(imageComponent)) reports = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tsetSubtreeReportsChanges(this, reports);\n\t\t\tconst previous = this.selfRenderParts;\n\t\t\tif (previous?.length === parts.length && previous.every((part, i) => part === parts[i])) {\n\t\t\t\treturn this.selfRenderLines;\n\t\t\t}\n\t\t\tconst contentLines = parts[0]!;\n\t\t\tthis.selfRenderHeight = contentLines.length;\n\t\t\tconst lines: string[] = [];\n\t\t\tif (contentLines.length > 0) {\n\t\t\t\tlines.push(\"\");\n\t\t\t\t// Append in a loop: spreading hundreds of thousands of wrapped lines exceeds V8's argument limit.\n\t\t\t\tfor (const line of contentLines) lines.push(line);\n\t\t\t}\n\t\t\tfor (let i = 1; i < parts.length; i++) {\n\t\t\t\tlines.push(...parts[i]!);\n\t\t\t}\n\t\t\tthis.selfRenderParts = parts;\n\t\t\tthis.selfRenderLines =\n\t\t\t\tcontentLines.length === 0 && this.imageComponents.length === 0 ? this.emptyLines : lines;\n\t\t\treturn this.selfRenderLines;\n\t\t}\n\n\t\treturn super.renderShared(width);\n\t}\n\n\toverride handleMouse(event: TuiMouseEvent): ReturnType<Container[\"handleMouse\"]> {\n\t\tif (!this.hasRendererDefinition() || this.getRenderShell() !== \"self\") return super.handleMouse(event);\n\t\tif (event.y <= 0 || event.y > this.selfRenderHeight) return undefined;\n\t\treturn this.selfRenderContainer.handleMouse({\n\t\t\t...event,\n\t\t\ty: event.y - 1,\n\t\t\theight: this.selfRenderHeight,\n\t\t});\n\t}\n\n\tprivate updateDisplay(): void {\n\t\tthis.argsPending = false;\n\t\tconst bgFn = this.isPartial\n\t\t\t? (text: string) => theme.bg(\"toolPendingBg\", text)\n\t\t\t: this.result?.isError\n\t\t\t\t? (text: string) => theme.bg(\"toolErrorBg\", text)\n\t\t\t\t: (text: string) => theme.bg(\"toolSuccessBg\", text);\n\n\t\tlet hasContent = false;\n\t\tthis.hideComponent = false;\n\t\tif (this.hasRendererDefinition()) {\n\t\t\tconst renderContainer = this.getRenderShell() === \"self\" ? this.selfRenderContainer : this.contentBox;\n\t\t\tif (renderContainer instanceof Box) {\n\t\t\t\trenderContainer.setBgFn(bgFn);\n\t\t\t\trenderContainer.setPaddingX(this.outputPad);\n\t\t\t}\n\t\t\trenderContainer.clear();\n\n\t\t\tconst callRenderer = this.getCallRenderer();\n\t\t\tif (!callRenderer) {\n\t\t\t\trenderContainer.addChild(this.createResultRegion(this.createCallFallback()));\n\t\t\t\thasContent = true;\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\tconst component = callRenderer(this.args, theme, this.getRenderContext(this.callRendererComponent));\n\t\t\t\t\tthis.callRendererComponent = component;\n\t\t\t\t\trenderContainer.addChild(this.createResultRegion(component));\n\t\t\t\t\thasContent = true;\n\t\t\t\t} catch {\n\t\t\t\t\tthis.callRendererComponent = undefined;\n\t\t\t\t\trenderContainer.addChild(this.createResultRegion(this.createCallFallback()));\n\t\t\t\t\thasContent = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.result) {\n\t\t\t\tconst resultRenderer = this.getResultRenderer();\n\t\t\t\tif (!resultRenderer) {\n\t\t\t\t\tconst component = this.createResultFallback();\n\t\t\t\t\tif (component) {\n\t\t\t\t\t\trenderContainer.addChild(this.createResultRegion(component));\n\t\t\t\t\t\thasContent = true;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst component = resultRenderer(\n\t\t\t\t\t\t\t{ content: this.result.content as any, details: this.result.details },\n\t\t\t\t\t\t\t{ expanded: this.expanded, isPartial: this.isPartial },\n\t\t\t\t\t\t\ttheme,\n\t\t\t\t\t\t\tthis.getRenderContext(this.resultRendererComponent),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tthis.resultRendererComponent = component;\n\t\t\t\t\t\trenderContainer.addChild(this.createResultRegion(component));\n\t\t\t\t\t\thasContent = true;\n\t\t\t\t\t} catch {\n\t\t\t\t\t\tthis.resultRendererComponent = undefined;\n\t\t\t\t\t\tconst component = this.createResultFallback();\n\t\t\t\t\t\tif (component) {\n\t\t\t\t\t\t\trenderContainer.addChild(this.createResultRegion(component));\n\t\t\t\t\t\t\thasContent = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthis.contentText.setCustomBgFn(bgFn);\n\t\t\tthis.contentText.setPaddingX(this.outputPad);\n\t\t\tthis.contentText.setText(this.formatToolExecution());\n\t\t\thasContent = true;\n\t\t}\n\n\t\tconst previousImages = this.imageComponents;\n\t\tconst previousSources = this.imageSources;\n\t\tfor (const img of this.imageComponents) {\n\t\t\tthis.removeChild(img);\n\t\t}\n\t\tthis.imageComponents = [];\n\t\tthis.imageSources = [];\n\t\tfor (const spacer of this.imageSpacers) {\n\t\t\tthis.removeChild(spacer);\n\t\t}\n\t\tthis.imageSpacers = [];\n\n\t\tif (this.result) {\n\t\t\tconst imageBlocks = this.result.content.filter((c) => c.type === \"image\");\n\t\t\tconst caps = getCapabilities();\n\t\t\tfor (const img of imageBlocks) {\n\t\t\t\tif (caps.images && this.showImages && img.data && img.mimeType) {\n\t\t\t\t\tconst spacer = new Spacer(1);\n\t\t\t\t\tthis.addChild(spacer);\n\t\t\t\t\tthis.imageSpacers.push(spacer);\n\t\t\t\t\tconst source = { data: img.data, mimeType: img.mimeType, widthCells: this.imageWidthCells };\n\t\t\t\t\tconst index = this.imageComponents.length;\n\t\t\t\t\tconst previous = previousSources[index];\n\t\t\t\t\tconst imageComponent =\n\t\t\t\t\t\tprevious?.data === source.data &&\n\t\t\t\t\t\tprevious.mimeType === source.mimeType &&\n\t\t\t\t\t\tprevious.widthCells === source.widthCells\n\t\t\t\t\t\t\t? previousImages[index]\n\t\t\t\t\t\t\t: new Image(\n\t\t\t\t\t\t\t\t\tsource.data,\n\t\t\t\t\t\t\t\t\tsource.mimeType,\n\t\t\t\t\t\t\t\t\t{ fallbackColor: (s: string) => theme.fg(\"toolOutput\", s) },\n\t\t\t\t\t\t\t\t\t{ maxWidthCells: source.widthCells },\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\tif (source.mimeType !== \"image/png\") {\n\t\t\t\t\t\tensurePngTranscoder(() => {\n\t\t\t\t\t\t\tthis.invalidate();\n\t\t\t\t\t\t\tthis.ui.requestRender();\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tthis.imageComponents.push(imageComponent);\n\t\t\t\t\tthis.imageSources.push(source);\n\t\t\t\t\tthis.addChild(imageComponent);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (this.hasRendererDefinition() && !hasContent && this.imageComponents.length === 0) {\n\t\t\tthis.hideComponent = true;\n\t\t}\n\t\treportRenderChange(this);\n\t}\n\n\tprivate getTextOutput(): string {\n\t\treturn getRenderedTextOutput(this.result, this.showImages);\n\t}\n\n\tprivate formatToolExecution(): string {\n\t\tlet text = theme.fg(\"toolTitle\", theme.bold(sanitizeTerminalText(this.toolName)));\n\t\tconst content = JSON.stringify(this.args, null, 2);\n\t\tif (content) {\n\t\t\t// (JSON.stringify() escapes C0 controls in the model's arguments, but not DEL and C1 controls.)\n\t\t\ttext += `\\n\\n${sanitizeTerminalText(content)}`;\n\t\t}\n\t\tconst output = this.getTextOutput();\n\t\tif (output) {\n\t\t\ttext += `\\n${output}`;\n\t\t}\n\t\treturn text;\n\t}\n}\n\nmarkReportsChanges(ToolExecutionComponent);\n"]}
|