@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
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* reconcile — mid-session lifecycle reconciliation for ask_user_question.
|
|
3
|
+
*
|
|
4
|
+
* Strips or re-adds the tool to the active set so it is invisible to the LLM
|
|
5
|
+
* in non-interactive runs (no UI) and present in interactive ones. Mirrors the
|
|
6
|
+
* advisor's reconcileAdvisorTool / registerAdvisorBeforeAgentStart pattern
|
|
7
|
+
* (packages/rpiv-advisor/advisor/handlers.ts), simplified: ask_user_question's
|
|
8
|
+
* only gating signal is ctx.hasUI (no model or executor blocklist), so it
|
|
9
|
+
* reads the flag directly and omits the notify.
|
|
10
|
+
*
|
|
11
|
+
* RPC hosts (ctx.mode === "rpc": VSCode pendant, Zed, Paseo) are deliberately
|
|
12
|
+
* NOT stripped: since PR #100 the tool renders there via the select/input
|
|
13
|
+
* dialog walker (rpc-fallback.ts), so hasUI is the honest signal again. The
|
|
14
|
+
* brief period where RPC was stripped (872ef1c) predates that fallback.
|
|
15
|
+
*/
|
|
16
|
+
import { ASK_USER_QUESTION_TOOL_NAME } from "./ask-user-question.js";
|
|
17
|
+
/**
|
|
18
|
+
* Strip-or-restore `ask_user_question` to match `ctx.hasUI`. Reads the active
|
|
19
|
+
* tool list itself. Idempotent: when the tool is already in the right state it
|
|
20
|
+
* leaves the active set (and sibling tools) untouched.
|
|
21
|
+
*/
|
|
22
|
+
export function reconcileAskUserQuestionTool(pi, ctx) {
|
|
23
|
+
const active = pi.getActiveTools();
|
|
24
|
+
const hasTool = active.includes(ASK_USER_QUESTION_TOOL_NAME);
|
|
25
|
+
// !hasUI → strip so the tool never reaches the LLM's tool list in
|
|
26
|
+
// non-interactive runs; hasUI → restore. The in-handler guards in
|
|
27
|
+
// ask-user-question.ts (!hasUI, and the custom()-undefined → dialog-walker /
|
|
28
|
+
// no_custom_ui backstop) remain as one-turn backstops if a future Pi change
|
|
29
|
+
// reorders the tool-list snapshot ahead of before_agent_start, or a host
|
|
30
|
+
// reports hasUI without any usable rendering primitive.
|
|
31
|
+
if (!ctx.hasUI && hasTool) {
|
|
32
|
+
pi.setActiveTools(active.filter((n) => n !== ASK_USER_QUESTION_TOOL_NAME));
|
|
33
|
+
}
|
|
34
|
+
else if (ctx.hasUI && !hasTool) {
|
|
35
|
+
pi.setActiveTools([...active, ASK_USER_QUESTION_TOOL_NAME]);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Attach the reconciler to `before_agent_start` so the active set is fixed up
|
|
40
|
+
* before each turn's tool-list snapshot is read. Safe to call once at load.
|
|
41
|
+
*/
|
|
42
|
+
export function registerAskUserQuestionReconciler(pi) {
|
|
43
|
+
pi.on("before_agent_start", (_event, ctx) => reconcileAskUserQuestionTool(pi, ctx));
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=reconcile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reconcile.js","sourceRoot":"","sources":["../../../../../src/humain/ask-user-question/vendor/ask/reconcile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAErE;;;;GAIG;AACH,MAAM,UAAU,4BAA4B,CAAC,EAAgB,EAAE,GAAqB;IACnF,MAAM,MAAM,GAAG,EAAE,CAAC,cAAc,EAAE,CAAC;IACnC,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,2BAA2B,CAAC,CAAC;IAC7D,kEAAkE;IAClE,kEAAkE;IAClE,6EAA6E;IAC7E,4EAA4E;IAC5E,yEAAyE;IACzE,wDAAwD;IACxD,IAAI,CAAC,GAAG,CAAC,KAAK,IAAI,OAAO,EAAE,CAAC;QAC3B,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,2BAA2B,CAAC,CAAC,CAAC;IAC5E,CAAC;SAAM,IAAI,GAAG,CAAC,KAAK,IAAI,CAAC,OAAO,EAAE,CAAC;QAClC,EAAE,CAAC,cAAc,CAAC,CAAC,GAAG,MAAM,EAAE,2BAA2B,CAAC,CAAC,CAAC;IAC7D,CAAC;AACF,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iCAAiC,CAAC,EAAgB;IACjE,EAAE,CAAC,EAAE,CAAC,oBAAoB,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,CAAC,4BAA4B,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC;AACrF,CAAC","sourcesContent":["/**\n * reconcile — mid-session lifecycle reconciliation for ask_user_question.\n *\n * Strips or re-adds the tool to the active set so it is invisible to the LLM\n * in non-interactive runs (no UI) and present in interactive ones. Mirrors the\n * advisor's reconcileAdvisorTool / registerAdvisorBeforeAgentStart pattern\n * (packages/rpiv-advisor/advisor/handlers.ts), simplified: ask_user_question's\n * only gating signal is ctx.hasUI (no model or executor blocklist), so it\n * reads the flag directly and omits the notify.\n *\n * RPC hosts (ctx.mode === \"rpc\": VSCode pendant, Zed, Paseo) are deliberately\n * NOT stripped: since PR #100 the tool renders there via the select/input\n * dialog walker (rpc-fallback.ts), so hasUI is the honest signal again. The\n * brief period where RPC was stripped (872ef1c) predates that fallback.\n */\n\nimport type { ExtensionAPI, ExtensionContext } from \"../../../../core/extensions/types.ts\";\nimport { ASK_USER_QUESTION_TOOL_NAME } from \"./ask-user-question.ts\";\n\n/**\n * Strip-or-restore `ask_user_question` to match `ctx.hasUI`. Reads the active\n * tool list itself. Idempotent: when the tool is already in the right state it\n * leaves the active set (and sibling tools) untouched.\n */\nexport function reconcileAskUserQuestionTool(pi: ExtensionAPI, ctx: ExtensionContext): void {\n\tconst active = pi.getActiveTools();\n\tconst hasTool = active.includes(ASK_USER_QUESTION_TOOL_NAME);\n\t// !hasUI → strip so the tool never reaches the LLM's tool list in\n\t// non-interactive runs; hasUI → restore. The in-handler guards in\n\t// ask-user-question.ts (!hasUI, and the custom()-undefined → dialog-walker /\n\t// no_custom_ui backstop) remain as one-turn backstops if a future Pi change\n\t// reorders the tool-list snapshot ahead of before_agent_start, or a host\n\t// reports hasUI without any usable rendering primitive.\n\tif (!ctx.hasUI && hasTool) {\n\t\tpi.setActiveTools(active.filter((n) => n !== ASK_USER_QUESTION_TOOL_NAME));\n\t} else if (ctx.hasUI && !hasTool) {\n\t\tpi.setActiveTools([...active, ASK_USER_QUESTION_TOOL_NAME]);\n\t}\n}\n\n/**\n * Attach the reconciler to `before_agent_start` so the active set is fixed up\n * before each turn's tool-list snapshot is read. Safe to call once at load.\n */\nexport function registerAskUserQuestionReconciler(pi: ExtensionAPI): void {\n\tpi.on(\"before_agent_start\", (_event, ctx) => reconcileAskUserQuestionTool(pi, ctx));\n}\n"]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RPC / dialog-primitive fallback for `ask_user_question`.
|
|
3
|
+
*
|
|
4
|
+
* The canonical TUI path (`ctx.ui.custom()`) renders a tabbed overlay that
|
|
5
|
+
* needs a real terminal. RPC-mode hosts (the VSCode pendant, ACP clients such
|
|
6
|
+
* as Zed or Paseo) report `hasUI: true` because pi's dialog sub-protocol
|
|
7
|
+
* (`extension_ui_request`/`extension_ui_response`) works, but `ui.custom()`
|
|
8
|
+
* resolves `undefined` without rendering anything (issue #78). `ui.select()`
|
|
9
|
+
* and `ui.input()` ARE functional there — the host renders them natively — so
|
|
10
|
+
* this module walks the questions sequentially with those primitives and
|
|
11
|
+
* returns the same `QuestionnaireResult` shapes the TUI produces, feeding the
|
|
12
|
+
* shared `buildQuestionnaireResponse` envelope.
|
|
13
|
+
*
|
|
14
|
+
* Parity trade-offs vs the TUI, inherent to the select/input API surface: no
|
|
15
|
+
* side-by-side preview pane (previews are folded into the prompt title), no
|
|
16
|
+
* tabbed multi-question review (one dialog per question), and multi-select is
|
|
17
|
+
* a free-text numbers input instead of checkbox rows. The input accepts selected
|
|
18
|
+
* option numbers, custom text, or both separated by a semicolon.
|
|
19
|
+
*/
|
|
20
|
+
import type { QuestionnaireResult, QuestionParams } from "./tool/types.ts";
|
|
21
|
+
/**
|
|
22
|
+
* The dialog-primitive slice of `ExtensionUIContext` this walker needs.
|
|
23
|
+
* Structural on purpose: the pinned pi 0.74 peer types predate `ctx.mode`,
|
|
24
|
+
* and jiti transpiles without type-checking — `hasDialogUI` is the runtime
|
|
25
|
+
* gate that makes the shape trustworthy.
|
|
26
|
+
*/
|
|
27
|
+
export type DialogUI = {
|
|
28
|
+
select: (title: string, options: string[]) => Promise<string | undefined>;
|
|
29
|
+
input: (title: string, placeholder?: string) => Promise<string | undefined>;
|
|
30
|
+
};
|
|
31
|
+
/** True when the host implements the select/input dialog primitives. */
|
|
32
|
+
export declare function hasDialogUI(ui: unknown): ui is DialogUI;
|
|
33
|
+
/**
|
|
34
|
+
* Walk the questionnaire one native dialog at a time. Dismissing a question's
|
|
35
|
+
* dialog (the primitive resolves `undefined`) cancels the whole questionnaire —
|
|
36
|
+
* mirroring Esc in the TUI — and the shared envelope emits DECLINE. A
|
|
37
|
+
* `QuestionAnswer` is produced per question otherwise, so the envelope is
|
|
38
|
+
* identical to the TUI path's.
|
|
39
|
+
*/
|
|
40
|
+
export declare function runRpcQuestionnaire(ui: DialogUI, params: QuestionParams): Promise<QuestionnaireResult>;
|
|
41
|
+
//# sourceMappingURL=rpc-fallback.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpc-fallback.d.ts","sourceRoot":"","sources":["../../../../../src/humain/ask-user-question/vendor/ask/rpc-fallback.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EAAgC,mBAAmB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAgBzG;;;;;GAKG;AACH,MAAM,MAAM,QAAQ,GAAG;IACtB,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAC1E,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CAC5E,CAAC;AAEF,wEAAwE;AACxE,wBAAgB,WAAW,CAAC,EAAE,EAAE,OAAO,GAAG,EAAE,IAAI,QAAQ,CAGvD;AA4BD;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CAAC,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAU5G"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RPC / dialog-primitive fallback for `ask_user_question`.
|
|
3
|
+
*
|
|
4
|
+
* The canonical TUI path (`ctx.ui.custom()`) renders a tabbed overlay that
|
|
5
|
+
* needs a real terminal. RPC-mode hosts (the VSCode pendant, ACP clients such
|
|
6
|
+
* as Zed or Paseo) report `hasUI: true` because pi's dialog sub-protocol
|
|
7
|
+
* (`extension_ui_request`/`extension_ui_response`) works, but `ui.custom()`
|
|
8
|
+
* resolves `undefined` without rendering anything (issue #78). `ui.select()`
|
|
9
|
+
* and `ui.input()` ARE functional there — the host renders them natively — so
|
|
10
|
+
* this module walks the questions sequentially with those primitives and
|
|
11
|
+
* returns the same `QuestionnaireResult` shapes the TUI produces, feeding the
|
|
12
|
+
* shared `buildQuestionnaireResponse` envelope.
|
|
13
|
+
*
|
|
14
|
+
* Parity trade-offs vs the TUI, inherent to the select/input API surface: no
|
|
15
|
+
* side-by-side preview pane (previews are folded into the prompt title), no
|
|
16
|
+
* tabbed multi-question review (one dialog per question), and multi-select is
|
|
17
|
+
* a free-text numbers input instead of checkbox rows. The input accepts selected
|
|
18
|
+
* option numbers, custom text, or both separated by a semicolon.
|
|
19
|
+
*/
|
|
20
|
+
import { displayLabel, t } from "./state/i18n-bridge.js";
|
|
21
|
+
/**
|
|
22
|
+
* Canonical-English fallbacks; resolved through `t()` at dialog time so the
|
|
23
|
+
* live locale applies (top-level `const x = t(...)` would bake load-time
|
|
24
|
+
* English in — see i18n-bridge.ts). The sentinel row label comes from
|
|
25
|
+
* `displayLabel("other")` — same source as the TUI row.
|
|
26
|
+
*/
|
|
27
|
+
const MULTI_SELECT_INSTRUCTIONS = 'Enter the numbers of all that apply, comma-separated (e.g. "1,3"). Add "; custom answer" to include your own text, or type only custom text.';
|
|
28
|
+
const CUSTOM_ANSWER_TITLE = "Type your answer:";
|
|
29
|
+
const MULTI_SELECT_PLACEHOLDER = "1,3; custom answer";
|
|
30
|
+
/** Longest preview slice folded into a select title before truncation. */
|
|
31
|
+
const MAX_PREVIEW_CHARS = 600;
|
|
32
|
+
/** True when the host implements the select/input dialog primitives. */
|
|
33
|
+
export function hasDialogUI(ui) {
|
|
34
|
+
const u = ui;
|
|
35
|
+
return typeof u?.select === "function" && typeof u?.input === "function";
|
|
36
|
+
}
|
|
37
|
+
function formatOptionLine(option, index) {
|
|
38
|
+
return `${index + 1}. ${option.label} — ${option.description}`;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Parse a user-entered (or select-returned) "N…" token to a 0-based option
|
|
42
|
+
* index. `parseInt` reads the leading digits of "2. B — b" as 2; NaN and
|
|
43
|
+
* out-of-range fail the bounds check and return null.
|
|
44
|
+
*/
|
|
45
|
+
function parseIndex(token, count) {
|
|
46
|
+
const i = Number.parseInt(token, 10) - 1;
|
|
47
|
+
return i >= 0 && i < count ? i : null;
|
|
48
|
+
}
|
|
49
|
+
/** Previews folded into the select title — RPC has no side-by-side pane. */
|
|
50
|
+
function buildPreviewBlock(question) {
|
|
51
|
+
const blocks = question.options.flatMap((o, i) => o.preview && o.preview.length > 0
|
|
52
|
+
? [`--- ${i + 1}. ${o.label} preview ---\n${o.preview.slice(0, MAX_PREVIEW_CHARS)}`]
|
|
53
|
+
: []);
|
|
54
|
+
return blocks.length > 0 ? `\n\n${blocks.join("\n\n")}` : "";
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Walk the questionnaire one native dialog at a time. Dismissing a question's
|
|
58
|
+
* dialog (the primitive resolves `undefined`) cancels the whole questionnaire —
|
|
59
|
+
* mirroring Esc in the TUI — and the shared envelope emits DECLINE. A
|
|
60
|
+
* `QuestionAnswer` is produced per question otherwise, so the envelope is
|
|
61
|
+
* identical to the TUI path's.
|
|
62
|
+
*/
|
|
63
|
+
export async function runRpcQuestionnaire(ui, params) {
|
|
64
|
+
const answers = [];
|
|
65
|
+
for (let qi = 0; qi < params.questions.length; qi++) {
|
|
66
|
+
const q = params.questions[qi];
|
|
67
|
+
const header = q.header ? `[${q.header}] ` : "";
|
|
68
|
+
const answer = q.multiSelect ? await askMultiSelect(ui, q, qi, header) : await askSingleSelect(ui, q, qi, header);
|
|
69
|
+
if (answer === undefined)
|
|
70
|
+
return { answers, cancelled: true };
|
|
71
|
+
answers.push(answer);
|
|
72
|
+
}
|
|
73
|
+
return { answers, cancelled: false };
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* `undefined` means the user dismissed the option dialog (cancel the questionnaire).
|
|
77
|
+
*
|
|
78
|
+
* Hosts return the chosen option line, but some also let the user type a reply in
|
|
79
|
+
* place of picking (T3 Code's "Type your own answer" box) and return that text
|
|
80
|
+
* (#299). A reply is therefore read as: an offered line → that option; a bare
|
|
81
|
+
* number → that option (hosts that return an index); a reply equal to an option
|
|
82
|
+
* label → that option; any other non-empty text → the user's own answer, verbatim
|
|
83
|
+
* — never a dismissal, and never "option N plus discarded text". Cancelling the
|
|
84
|
+
* "Type something." follow-up returns to the options instead of cancelling the
|
|
85
|
+
* whole questionnaire (#142), and that input repeats the option list so the user
|
|
86
|
+
* can refer to it while typing (#194).
|
|
87
|
+
*/
|
|
88
|
+
async function askSingleSelect(ui, q, questionIndex, header) {
|
|
89
|
+
const options = q.options.map(formatOptionLine);
|
|
90
|
+
options.push(`${q.options.length + 1}. ${displayLabel("other")}`);
|
|
91
|
+
const title = `${header}${q.question}${buildPreviewBlock(q)}`;
|
|
92
|
+
for (;;) {
|
|
93
|
+
const chosen = await ui.select(title, options);
|
|
94
|
+
if (chosen == null)
|
|
95
|
+
return undefined;
|
|
96
|
+
const reply = chosen.trim();
|
|
97
|
+
if (reply.length === 0)
|
|
98
|
+
return undefined;
|
|
99
|
+
const idx = resolveSingleSelectReply(chosen, reply, options, q);
|
|
100
|
+
if (idx === undefined)
|
|
101
|
+
return { questionIndex, question: q.question, kind: "custom", answer: reply };
|
|
102
|
+
if (idx < q.options.length) {
|
|
103
|
+
const o = q.options[idx];
|
|
104
|
+
return {
|
|
105
|
+
questionIndex,
|
|
106
|
+
question: q.question,
|
|
107
|
+
kind: "option",
|
|
108
|
+
answer: o.label,
|
|
109
|
+
preview: o.preview && o.preview.length > 0 ? o.preview : undefined,
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
// "Type something." sentinel → free-text follow-up; cancelling it, or a blank reply (#301),
|
|
113
|
+
// goes back to the options.
|
|
114
|
+
const typed = await ui.input(`${header}${q.question}\n\n${q.options.map(formatOptionLine).join("\n")}\n\n${t("rpc.custom_answer_title", CUSTOM_ANSWER_TITLE)}`, "");
|
|
115
|
+
if (typed == null || typed.trim().length === 0)
|
|
116
|
+
continue;
|
|
117
|
+
return { questionIndex, question: q.question, kind: "custom", answer: typed };
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
/** Option index for a select reply, or `undefined` when the reply is the user's own text. */
|
|
121
|
+
function resolveSingleSelectReply(chosen, reply, lines, q) {
|
|
122
|
+
const line = lines.indexOf(chosen);
|
|
123
|
+
if (line >= 0)
|
|
124
|
+
return line;
|
|
125
|
+
if (/^\d+\.?$/.test(reply))
|
|
126
|
+
return parseIndex(reply, lines.length) ?? undefined;
|
|
127
|
+
const label = q.options.findIndex((o) => o.label === reply);
|
|
128
|
+
return label >= 0 ? label : undefined;
|
|
129
|
+
}
|
|
130
|
+
/** `undefined` means the user dismissed the dialog (cancel the questionnaire). */
|
|
131
|
+
async function askMultiSelect(ui, q, questionIndex, header) {
|
|
132
|
+
const list = q.options.map(formatOptionLine).join("\n");
|
|
133
|
+
const value = await ui.input(`${header}${q.question}\n\n${list}\n\n${t("rpc.multi_instructions", MULTI_SELECT_INSTRUCTIONS)}`, MULTI_SELECT_PLACEHOLDER);
|
|
134
|
+
if (value == null)
|
|
135
|
+
return undefined;
|
|
136
|
+
const trimmed = value.trim();
|
|
137
|
+
if (trimmed.length === 0) {
|
|
138
|
+
// Deliberate empty commit — same as pressing "Next" with nothing toggled.
|
|
139
|
+
return { questionIndex, question: q.question, kind: "multi", answer: null, selected: [] };
|
|
140
|
+
}
|
|
141
|
+
const [selectionPart = "", ...customParts] = trimmed.split(";");
|
|
142
|
+
const selection = selectionPart.trim();
|
|
143
|
+
const custom = customParts.join(";").trim();
|
|
144
|
+
const tokens = selection.split(/[,\s]+/).filter((tok) => tok.length > 0);
|
|
145
|
+
const indices = tokens.map((tok) => (/^\d+\.?$/.test(tok) ? parseIndex(tok, q.options.length) : null));
|
|
146
|
+
if (selection.length === 0 || indices.every((i) => i != null)) {
|
|
147
|
+
const selected = [];
|
|
148
|
+
for (const i of indices) {
|
|
149
|
+
if (i == null)
|
|
150
|
+
continue;
|
|
151
|
+
const label = q.options[i].label;
|
|
152
|
+
if (!selected.includes(label))
|
|
153
|
+
selected.push(label);
|
|
154
|
+
}
|
|
155
|
+
return {
|
|
156
|
+
questionIndex,
|
|
157
|
+
question: q.question,
|
|
158
|
+
kind: "multi",
|
|
159
|
+
answer: custom.length > 0 ? custom : null,
|
|
160
|
+
selected,
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
// Preserve unparseable input verbatim as custom text rather than dropping it.
|
|
164
|
+
return { questionIndex, question: q.question, kind: "multi", answer: trimmed, selected: [] };
|
|
165
|
+
}
|
|
166
|
+
//# sourceMappingURL=rpc-fallback.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpc-fallback.js","sourceRoot":"","sources":["../../../../../src/humain/ask-user-question/vendor/ask/rpc-fallback.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAGzD;;;;;GAKG;AACH,MAAM,yBAAyB,GAC9B,8IAA8I,CAAC;AAChJ,MAAM,mBAAmB,GAAG,mBAAmB,CAAC;AAChD,MAAM,wBAAwB,GAAG,oBAAoB,CAAC;AAEtD,0EAA0E;AAC1E,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAa9B,wEAAwE;AACxE,MAAM,UAAU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YACjC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC;gBAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACrD,CAAC;QACD,OAAO;YACN,aAAa;YACb,QAAQ,EAAE,CAAC,CAAC,QAAQ;YACpB,IAAI,EAAE,OAAO;YACb,MAAM,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI;YACzC,QAAQ;SACR,CAAC;IACH,CAAC;IACD,8EAA8E;IAC9E,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;AAC9F,CAAC","sourcesContent":["/**\n * RPC / dialog-primitive fallback for `ask_user_question`.\n *\n * The canonical TUI path (`ctx.ui.custom()`) renders a tabbed overlay that\n * needs a real terminal. RPC-mode hosts (the VSCode pendant, ACP clients such\n * as Zed or Paseo) report `hasUI: true` because pi's dialog sub-protocol\n * (`extension_ui_request`/`extension_ui_response`) works, but `ui.custom()`\n * resolves `undefined` without rendering anything (issue #78). `ui.select()`\n * and `ui.input()` ARE functional there — the host renders them natively — so\n * this module walks the questions sequentially with those primitives and\n * returns the same `QuestionnaireResult` shapes the TUI produces, feeding the\n * shared `buildQuestionnaireResponse` envelope.\n *\n * Parity trade-offs vs the TUI, inherent to the select/input API surface: no\n * side-by-side preview pane (previews are folded into the prompt title), no\n * tabbed multi-question review (one dialog per question), and multi-select is\n * a free-text numbers input instead of checkbox rows. The input accepts selected\n * option numbers, custom text, or both separated by a semicolon.\n */\n\nimport { displayLabel, t } from \"./state/i18n-bridge.ts\";\nimport type { QuestionAnswer, QuestionData, QuestionnaireResult, QuestionParams } from \"./tool/types.ts\";\n\n/**\n * Canonical-English fallbacks; resolved through `t()` at dialog time so the\n * live locale applies (top-level `const x = t(...)` would bake load-time\n * English in — see i18n-bridge.ts). The sentinel row label comes from\n * `displayLabel(\"other\")` — same source as the TUI row.\n */\nconst MULTI_SELECT_INSTRUCTIONS =\n\t'Enter the numbers of all that apply, comma-separated (e.g. \"1,3\"). Add \"; custom answer\" to include your own text, or type only custom text.';\nconst CUSTOM_ANSWER_TITLE = \"Type your answer:\";\nconst MULTI_SELECT_PLACEHOLDER = \"1,3; custom answer\";\n\n/** Longest preview slice folded into a select title before truncation. */\nconst MAX_PREVIEW_CHARS = 600;\n\n/**\n * The dialog-primitive slice of `ExtensionUIContext` this walker needs.\n * Structural on purpose: the pinned pi 0.74 peer types predate `ctx.mode`,\n * and jiti transpiles without type-checking — `hasDialogUI` is the runtime\n * gate that makes the shape trustworthy.\n */\nexport type DialogUI = {\n\tselect: (title: string, options: string[]) => Promise<string | undefined>;\n\tinput: (title: string, placeholder?: string) => Promise<string | undefined>;\n};\n\n/** True when the host implements the select/input dialog primitives. */\nexport function hasDialogUI(ui: unknown): ui is DialogUI {\n\tconst u = ui as Partial<Record<\"select\" | \"input\", unknown>> | null | undefined;\n\treturn typeof u?.select === \"function\" && typeof u?.input === \"function\";\n}\n\ntype Option = QuestionData[\"options\"][number];\n\nfunction formatOptionLine(option: Option, index: number): string {\n\treturn `${index + 1}. ${option.label} — ${option.description}`;\n}\n\n/**\n * Parse a user-entered (or select-returned) \"N…\" token to a 0-based option\n * index. `parseInt` reads the leading digits of \"2. B — b\" as 2; NaN and\n * out-of-range fail the bounds check and return null.\n */\nfunction parseIndex(token: string, count: number): number | null {\n\tconst i = Number.parseInt(token, 10) - 1;\n\treturn i >= 0 && i < count ? i : null;\n}\n\n/** Previews folded into the select title — RPC has no side-by-side pane. */\nfunction buildPreviewBlock(question: QuestionData): string {\n\tconst blocks = question.options.flatMap((o, i) =>\n\t\to.preview && o.preview.length > 0\n\t\t\t? [`--- ${i + 1}. ${o.label} preview ---\\n${o.preview.slice(0, MAX_PREVIEW_CHARS)}`]\n\t\t\t: [],\n\t);\n\treturn blocks.length > 0 ? `\\n\\n${blocks.join(\"\\n\\n\")}` : \"\";\n}\n\n/**\n * Walk the questionnaire one native dialog at a time. Dismissing a question's\n * dialog (the primitive resolves `undefined`) cancels the whole questionnaire —\n * mirroring Esc in the TUI — and the shared envelope emits DECLINE. A\n * `QuestionAnswer` is produced per question otherwise, so the envelope is\n * identical to the TUI path's.\n */\nexport async function runRpcQuestionnaire(ui: DialogUI, params: QuestionParams): Promise<QuestionnaireResult> {\n\tconst answers: QuestionAnswer[] = [];\n\tfor (let qi = 0; qi < params.questions.length; qi++) {\n\t\tconst q = params.questions[qi];\n\t\tconst header = q.header ? `[${q.header}] ` : \"\";\n\t\tconst answer = q.multiSelect ? await askMultiSelect(ui, q, qi, header) : await askSingleSelect(ui, q, qi, header);\n\t\tif (answer === undefined) return { answers, cancelled: true };\n\t\tanswers.push(answer);\n\t}\n\treturn { answers, cancelled: false };\n}\n\n/**\n * `undefined` means the user dismissed the option dialog (cancel the questionnaire).\n *\n * Hosts return the chosen option line, but some also let the user type a reply in\n * place of picking (T3 Code's \"Type your own answer\" box) and return that text\n * (#299). A reply is therefore read as: an offered line → that option; a bare\n * number → that option (hosts that return an index); a reply equal to an option\n * label → that option; any other non-empty text → the user's own answer, verbatim\n * — never a dismissal, and never \"option N plus discarded text\". Cancelling the\n * \"Type something.\" follow-up returns to the options instead of cancelling the\n * whole questionnaire (#142), and that input repeats the option list so the user\n * can refer to it while typing (#194).\n */\nasync function askSingleSelect(\n\tui: DialogUI,\n\tq: QuestionData,\n\tquestionIndex: number,\n\theader: string,\n): Promise<QuestionAnswer | undefined> {\n\tconst options = q.options.map(formatOptionLine);\n\toptions.push(`${q.options.length + 1}. ${displayLabel(\"other\")}`);\n\tconst title = `${header}${q.question}${buildPreviewBlock(q)}`;\n\tfor (;;) {\n\t\tconst chosen = await ui.select(title, options);\n\t\tif (chosen == null) return undefined;\n\t\tconst reply = chosen.trim();\n\t\tif (reply.length === 0) return undefined;\n\t\tconst idx = resolveSingleSelectReply(chosen, reply, options, q);\n\t\tif (idx === undefined) return { questionIndex, question: q.question, kind: \"custom\", answer: reply };\n\t\tif (idx < q.options.length) {\n\t\t\tconst o = q.options[idx];\n\t\t\treturn {\n\t\t\t\tquestionIndex,\n\t\t\t\tquestion: q.question,\n\t\t\t\tkind: \"option\",\n\t\t\t\tanswer: o.label,\n\t\t\t\tpreview: o.preview && o.preview.length > 0 ? o.preview : undefined,\n\t\t\t};\n\t\t}\n\t\t// \"Type something.\" sentinel → free-text follow-up; cancelling it, or a blank reply (#301),\n\t\t// goes back to the options.\n\t\tconst typed = await ui.input(\n\t\t\t`${header}${q.question}\\n\\n${q.options.map(formatOptionLine).join(\"\\n\")}\\n\\n${t(\"rpc.custom_answer_title\", CUSTOM_ANSWER_TITLE)}`,\n\t\t\t\"\",\n\t\t);\n\t\tif (typed == null || typed.trim().length === 0) continue;\n\t\treturn { questionIndex, question: q.question, kind: \"custom\", answer: typed };\n\t}\n}\n\n/** Option index for a select reply, or `undefined` when the reply is the user's own text. */\nfunction resolveSingleSelectReply(\n\tchosen: string,\n\treply: string,\n\tlines: readonly string[],\n\tq: QuestionData,\n): number | undefined {\n\tconst line = lines.indexOf(chosen);\n\tif (line >= 0) return line;\n\tif (/^\\d+\\.?$/.test(reply)) return parseIndex(reply, lines.length) ?? undefined;\n\tconst label = q.options.findIndex((o) => o.label === reply);\n\treturn label >= 0 ? label : undefined;\n}\n\n/** `undefined` means the user dismissed the dialog (cancel the questionnaire). */\nasync function askMultiSelect(\n\tui: DialogUI,\n\tq: QuestionData,\n\tquestionIndex: number,\n\theader: string,\n): Promise<QuestionAnswer | undefined> {\n\tconst list = q.options.map(formatOptionLine).join(\"\\n\");\n\tconst value = await ui.input(\n\t\t`${header}${q.question}\\n\\n${list}\\n\\n${t(\"rpc.multi_instructions\", MULTI_SELECT_INSTRUCTIONS)}`,\n\t\tMULTI_SELECT_PLACEHOLDER,\n\t);\n\tif (value == null) return undefined;\n\tconst trimmed = value.trim();\n\tif (trimmed.length === 0) {\n\t\t// Deliberate empty commit — same as pressing \"Next\" with nothing toggled.\n\t\treturn { questionIndex, question: q.question, kind: \"multi\", answer: null, selected: [] };\n\t}\n\tconst [selectionPart = \"\", ...customParts] = trimmed.split(\";\");\n\tconst selection = selectionPart.trim();\n\tconst custom = customParts.join(\";\").trim();\n\tconst tokens = selection.split(/[,\\s]+/).filter((tok) => tok.length > 0);\n\tconst indices = tokens.map((tok) => (/^\\d+\\.?$/.test(tok) ? parseIndex(tok, q.options.length) : null));\n\tif (selection.length === 0 || indices.every((i): i is number => i != null)) {\n\t\tconst selected: string[] = [];\n\t\tfor (const i of indices) {\n\t\t\tif (i == null) continue;\n\t\t\tconst label = q.options[i].label;\n\t\t\tif (!selected.includes(label)) selected.push(label);\n\t\t}\n\t\treturn {\n\t\t\tquestionIndex,\n\t\t\tquestion: q.question,\n\t\t\tkind: \"multi\",\n\t\t\tanswer: custom.length > 0 ? custom : null,\n\t\t\tselected,\n\t\t};\n\t}\n\t// Preserve unparseable input verbatim as custom text rather than dropping it.\n\treturn { questionIndex, question: q.question, kind: \"multi\", answer: trimmed, selected: [] };\n}\n"]}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Editor, type TUI } from "@earendil-works/pi-tui";
|
|
2
|
+
import { type Theme } from "../../../../../modes/interactive/theme/theme.ts";
|
|
3
|
+
import type { QuestionData } from "../tool/types.ts";
|
|
4
|
+
import type { WrappingSelectItem } from "../view/components/wrapping-select.ts";
|
|
5
|
+
import { QuestionnairePropsAdapter } from "../view/props-adapter.ts";
|
|
6
|
+
import type { QuestionnaireState } from "./state.ts";
|
|
7
|
+
export interface QuestionnaireBuildConfig {
|
|
8
|
+
tui: TUI;
|
|
9
|
+
theme: Theme;
|
|
10
|
+
questions: readonly QuestionData[];
|
|
11
|
+
itemsByTab: ReadonlyArray<readonly WrappingSelectItem[]>;
|
|
12
|
+
isMulti: boolean;
|
|
13
|
+
initialState: QuestionnaireState;
|
|
14
|
+
getCurrentTab: () => number;
|
|
15
|
+
/**
|
|
16
|
+
* Resolved collapse key spec (`"ctrl+]"`, `"alt+o"`, or `"off"`). Threaded to
|
|
17
|
+
* `DialogConfig` as construction-time config so the footer hint can name the
|
|
18
|
+
* real key — deliberately NOT part of `QuestionnaireState`, which stays free
|
|
19
|
+
* of runtime context.
|
|
20
|
+
*/
|
|
21
|
+
collapseKey: string;
|
|
22
|
+
/** Resolved notes key (`resolveNotesKey` output), threaded to the hints that name it. */
|
|
23
|
+
notesKey: string;
|
|
24
|
+
/**
|
|
25
|
+
* Maps `tui.terminal.rows` to the rows the dialog may render — identity for the
|
|
26
|
+
* overlay, a capped share for the inline editor slot (`../presentation.ts`). Applied
|
|
27
|
+
* inside `getTerminalRows`, so `DialogView`'s overflow partition is mode-agnostic.
|
|
28
|
+
*/
|
|
29
|
+
rowBudget: (terminalRows: number) => number;
|
|
30
|
+
}
|
|
31
|
+
export interface QuestionnaireBuilt {
|
|
32
|
+
adapter: QuestionnairePropsAdapter;
|
|
33
|
+
notesInput: Editor;
|
|
34
|
+
inlineInput: Editor;
|
|
35
|
+
render: (width: number) => string[];
|
|
36
|
+
invalidate: () => void;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Pure factory: assembles every TUI component, the props adapter, and a
|
|
40
|
+
* lifecycle handle. Session-state dependencies arrive via `getCurrentTab`; live
|
|
41
|
+
* custom text stays in the headless Editor. Initial paint is delegated to
|
|
42
|
+
* `adapter.apply(initialState)` (called by the session at construction-end);
|
|
43
|
+
* no selector is invoked here.
|
|
44
|
+
*/
|
|
45
|
+
export declare function buildQuestionnaire(config: QuestionnaireBuildConfig): QuestionnaireBuilt;
|
|
46
|
+
//# sourceMappingURL=build-questionnaire.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-questionnaire.d.ts","sourceRoot":"","sources":["../../../../../../src/humain/ask-user-question/vendor/ask/state/build-questionnaire.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE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me.js";
|
|
3
|
+
import { globalBinding, perTabBinding, } from "../view/component-binding.js";
|
|
4
|
+
import { MultiSelectView } from "../view/components/multi-select-view.js";
|
|
5
|
+
import { OptionListView } from "../view/components/option-list-view.js";
|
|
6
|
+
import { PreviewBlockRenderer } from "../view/components/preview/preview-block-renderer.js";
|
|
7
|
+
import { crossTabLeftWidthWithDonation } from "../view/components/preview/preview-layout-decider.js";
|
|
8
|
+
import { PreviewPane } from "../view/components/preview/preview-pane.js";
|
|
9
|
+
import { SubmitPicker } from "../view/components/submit-picker.js";
|
|
10
|
+
import { TabBar } from "../view/components/tab-bar.js";
|
|
11
|
+
import { DialogView } from "../view/dialog-builder.js";
|
|
12
|
+
import { QuestionnairePropsAdapter } from "../view/props-adapter.js";
|
|
13
|
+
import { selectActivePreviewPaneIndex } from "./selectors/derivations.js";
|
|
14
|
+
import { selectDialogProps, selectMultiSelectProps, selectOptionListProps, selectPreviewPaneProps, selectSubmitPickerProps, selectTabBarProps, } from "./selectors/projections.js";
|
|
15
|
+
function previewBodyHeights(pane) {
|
|
16
|
+
return (width) => {
|
|
17
|
+
const current = pane.naturalHeight(width);
|
|
18
|
+
return { current, max: Math.max(current, pane.maxNaturalHeight(width)) };
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function editorTheme(theme) {
|
|
22
|
+
return {
|
|
23
|
+
borderColor: (text) => theme.fg("borderMuted", text),
|
|
24
|
+
selectList: {
|
|
25
|
+
selectedPrefix: (text) => theme.bg("selectedBg", theme.fg("accent", text)),
|
|
26
|
+
selectedText: (text) => theme.bg("selectedBg", theme.bold(text)),
|
|
27
|
+
description: (text) => theme.fg("muted", text),
|
|
28
|
+
scrollInfo: (text) => theme.fg("dim", text),
|
|
29
|
+
noMatch: (text) => theme.fg("warning", text),
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function multiSelectBodyHeights(view) {
|
|
34
|
+
return (width) => {
|
|
35
|
+
const h = view.naturalHeight(width);
|
|
36
|
+
return { current: h, max: h };
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
const isActiveTab = (s, ctx) => ctx.i === selectActivePreviewPaneIndex(s.currentTab, ctx.totalQuestions);
|
|
40
|
+
/**
|
|
41
|
+
* Pure factory: assembles every TUI component, the props adapter, and a
|
|
42
|
+
* lifecycle handle. Session-state dependencies arrive via `getCurrentTab`; live
|
|
43
|
+
* custom text stays in the headless Editor. Initial paint is delegated to
|
|
44
|
+
* `adapter.apply(initialState)` (called by the session at construction-end);
|
|
45
|
+
* no selector is invoked here.
|
|
46
|
+
*/
|
|
47
|
+
export function buildQuestionnaire(config) {
|
|
48
|
+
return new QuestionnaireBuilder(config).build();
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Programming-by-intention assembly: each private method names one
|
|
52
|
+
* construction step from `build()`. Read top-down; the class is build-only and
|
|
53
|
+
* discarded once the handle is returned.
|
|
54
|
+
*/
|
|
55
|
+
class QuestionnaireBuilder {
|
|
56
|
+
tui;
|
|
57
|
+
theme;
|
|
58
|
+
questions;
|
|
59
|
+
itemsByTab;
|
|
60
|
+
isMulti;
|
|
61
|
+
initialState;
|
|
62
|
+
getCurrentTab;
|
|
63
|
+
collapseKey;
|
|
64
|
+
notesKey;
|
|
65
|
+
rowBudget;
|
|
66
|
+
selectTheme;
|
|
67
|
+
markdownTheme = getMarkdownTheme();
|
|
68
|
+
notesInput;
|
|
69
|
+
inlineInput;
|
|
70
|
+
getTerminalWidth = () => this.tui.terminal.columns;
|
|
71
|
+
getTerminalRows = () => this.rowBudget(this.tui.terminal.rows);
|
|
72
|
+
constructor(config) {
|
|
73
|
+
this.tui = config.tui;
|
|
74
|
+
this.theme = config.theme;
|
|
75
|
+
this.questions = config.questions;
|
|
76
|
+
this.itemsByTab = config.itemsByTab;
|
|
77
|
+
this.isMulti = config.isMulti;
|
|
78
|
+
this.initialState = config.initialState;
|
|
79
|
+
this.getCurrentTab = config.getCurrentTab;
|
|
80
|
+
this.collapseKey = config.collapseKey;
|
|
81
|
+
this.notesKey = config.notesKey;
|
|
82
|
+
this.rowBudget = config.rowBudget;
|
|
83
|
+
this.selectTheme = this.makeSelectTheme();
|
|
84
|
+
const textEditorTheme = editorTheme(this.theme);
|
|
85
|
+
this.notesInput = new Editor(this.tui, textEditorTheme);
|
|
86
|
+
this.inlineInput = new Editor(this.tui, textEditorTheme);
|
|
87
|
+
// The key router owns confirm/submit semantics; keys reaching these headless
|
|
88
|
+
// editors are text-editing only. Without this, a `tui.input.submit` match inside
|
|
89
|
+
// Editor.handleInput would run submitValue(), which resets the buffer and
|
|
90
|
+
// silently destroys the draft — no onSubmit is wired here, so the text is
|
|
91
|
+
// unrecoverable (#156).
|
|
92
|
+
this.notesInput.disableSubmit = true;
|
|
93
|
+
this.inlineInput.disableSubmit = true;
|
|
94
|
+
}
|
|
95
|
+
build() {
|
|
96
|
+
const tabs = this.buildTabComponents();
|
|
97
|
+
this.injectGlobalLeftWidth(tabs);
|
|
98
|
+
const submitPicker = this.buildSubmitPicker();
|
|
99
|
+
const tabBar = this.buildTabBar();
|
|
100
|
+
const heights = this.buildHeightComputers(tabs);
|
|
101
|
+
const dialog = this.buildDialog(tabs, submitPicker, tabBar, heights);
|
|
102
|
+
const globalBindings = this.buildGlobalBindings(dialog, submitPicker, tabBar);
|
|
103
|
+
const perTabBindings = this.buildPerTabBindings();
|
|
104
|
+
const adapter = this.buildAdapter(tabs, globalBindings, perTabBindings);
|
|
105
|
+
return this.handle(adapter, dialog);
|
|
106
|
+
}
|
|
107
|
+
makeSelectTheme() {
|
|
108
|
+
const t = this.theme;
|
|
109
|
+
return {
|
|
110
|
+
selectedText: (s) => t.fg("accent", t.bold(s)),
|
|
111
|
+
description: (s) => t.fg("muted", s),
|
|
112
|
+
scrollInfo: (s) => t.fg("dim", s),
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
buildTabComponents() {
|
|
116
|
+
return this.questions.map((q, i) => this.buildTabFor(q, i));
|
|
117
|
+
}
|
|
118
|
+
buildTabFor(question, index) {
|
|
119
|
+
const optionList = new OptionListView({
|
|
120
|
+
items: this.itemsByTab[index] ?? [],
|
|
121
|
+
theme: this.selectTheme,
|
|
122
|
+
});
|
|
123
|
+
const previewBlock = new PreviewBlockRenderer({
|
|
124
|
+
question,
|
|
125
|
+
theme: this.theme,
|
|
126
|
+
markdownTheme: this.markdownTheme,
|
|
127
|
+
notesKey: this.notesKey,
|
|
128
|
+
});
|
|
129
|
+
const preview = new PreviewPane({
|
|
130
|
+
question,
|
|
131
|
+
theme: this.theme,
|
|
132
|
+
getTerminalWidth: this.getTerminalWidth,
|
|
133
|
+
optionListView: optionList,
|
|
134
|
+
previewBlock,
|
|
135
|
+
});
|
|
136
|
+
const multiSelect = question.multiSelect ? new MultiSelectView(this.theme, question) : undefined;
|
|
137
|
+
const bodyHeights = this.buildBodyHeights(question, preview, multiSelect);
|
|
138
|
+
return { optionList, preview, multiSelect, bodyHeights };
|
|
139
|
+
}
|
|
140
|
+
buildBodyHeights(question, preview, multiSelect) {
|
|
141
|
+
return question.multiSelect ? multiSelectBodyHeights(multiSelect) : previewBodyHeights(preview);
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Compute cross-tab max adaptive left width and inject into each PreviewPane.
|
|
145
|
+
* Mirrors buildHeightComputers pattern — iterates all tabs, takes max.
|
|
146
|
+
* Called after buildTabComponents, before buildDialog (so setGlobalLeftWidth
|
|
147
|
+
* is set before any rendering occurs).
|
|
148
|
+
*/
|
|
149
|
+
injectGlobalLeftWidth(tabs) {
|
|
150
|
+
const questions = this.questions;
|
|
151
|
+
const itemsByTab = this.itemsByTab;
|
|
152
|
+
const tabsDescriptor = questions.map((q) => ({ multiSelect: q.multiSelect }));
|
|
153
|
+
const globalLeftWidth = (paneWidth) => crossTabLeftWidthWithDonation(tabsDescriptor, itemsByTab, questions, paneWidth);
|
|
154
|
+
for (const tab of tabs) {
|
|
155
|
+
tab.preview.setGlobalLeftWidth(globalLeftWidth);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
buildSubmitPicker() {
|
|
159
|
+
return this.isMulti ? new SubmitPicker(this.theme) : undefined;
|
|
160
|
+
}
|
|
161
|
+
buildTabBar() {
|
|
162
|
+
return this.isMulti ? new TabBar(this.theme) : undefined;
|
|
163
|
+
}
|
|
164
|
+
buildHeightComputers(tabs) {
|
|
165
|
+
const global = (width) => {
|
|
166
|
+
let max = 0;
|
|
167
|
+
for (const tab of tabs) {
|
|
168
|
+
const h = tab.bodyHeights(width).max;
|
|
169
|
+
if (h > max)
|
|
170
|
+
max = h;
|
|
171
|
+
}
|
|
172
|
+
return Math.max(1, max);
|
|
173
|
+
};
|
|
174
|
+
const current = (width) => {
|
|
175
|
+
const idx = Math.min(this.getCurrentTab(), tabs.length - 1);
|
|
176
|
+
return Math.max(0, tabs[idx]?.bodyHeights(width).current ?? 0);
|
|
177
|
+
};
|
|
178
|
+
return { global, current };
|
|
179
|
+
}
|
|
180
|
+
pickInitialActivePreview(tabs) {
|
|
181
|
+
const idx = selectActivePreviewPaneIndex(this.initialState.currentTab, this.questions.length);
|
|
182
|
+
return tabs[idx]?.preview ?? tabs[0].preview;
|
|
183
|
+
}
|
|
184
|
+
buildDialog(tabs, submitPicker, tabBar, heights) {
|
|
185
|
+
return new DialogView({
|
|
186
|
+
theme: this.theme,
|
|
187
|
+
questions: this.questions,
|
|
188
|
+
tabBar,
|
|
189
|
+
notesInput: this.notesInput,
|
|
190
|
+
isMulti: this.isMulti,
|
|
191
|
+
tabsByIndex: tabs,
|
|
192
|
+
submitPicker,
|
|
193
|
+
getBodyHeight: heights.global,
|
|
194
|
+
getCurrentBodyHeight: heights.current,
|
|
195
|
+
getTerminalRows: this.getTerminalRows,
|
|
196
|
+
collapseKey: this.collapseKey,
|
|
197
|
+
notesKey: this.notesKey,
|
|
198
|
+
}, { state: this.initialState, activePreviewPane: this.pickInitialActivePreview(tabs) });
|
|
199
|
+
}
|
|
200
|
+
buildGlobalBindings(dialog, submitPicker, tabBar) {
|
|
201
|
+
return [
|
|
202
|
+
globalBinding({ component: dialog, select: selectDialogProps }),
|
|
203
|
+
...(submitPicker ? [globalBinding({ component: submitPicker, select: selectSubmitPickerProps })] : []),
|
|
204
|
+
...(tabBar ? [globalBinding({ component: tabBar, select: selectTabBarProps })] : []),
|
|
205
|
+
];
|
|
206
|
+
}
|
|
207
|
+
buildPerTabBindings() {
|
|
208
|
+
return [
|
|
209
|
+
perTabBinding({
|
|
210
|
+
resolve: (tab) => tab.optionList,
|
|
211
|
+
predicate: isActiveTab,
|
|
212
|
+
select: selectOptionListProps,
|
|
213
|
+
}),
|
|
214
|
+
perTabBinding({
|
|
215
|
+
resolve: (tab) => tab.preview,
|
|
216
|
+
predicate: isActiveTab,
|
|
217
|
+
select: selectPreviewPaneProps,
|
|
218
|
+
}),
|
|
219
|
+
perTabBinding({
|
|
220
|
+
resolve: (tab) => tab.multiSelect,
|
|
221
|
+
select: selectMultiSelectProps,
|
|
222
|
+
}),
|
|
223
|
+
];
|
|
224
|
+
}
|
|
225
|
+
buildAdapter(tabs, globalBindings, perTabBindings) {
|
|
226
|
+
return new QuestionnairePropsAdapter({
|
|
227
|
+
tui: this.tui,
|
|
228
|
+
questions: this.questions,
|
|
229
|
+
itemsByTab: this.itemsByTab,
|
|
230
|
+
tabsByIndex: tabs,
|
|
231
|
+
inlineInput: this.inlineInput,
|
|
232
|
+
globalBindings,
|
|
233
|
+
perTabBindings,
|
|
234
|
+
extraInvalidatables: [this.notesInput],
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
handle(adapter, dialog) {
|
|
238
|
+
return {
|
|
239
|
+
adapter,
|
|
240
|
+
notesInput: this.notesInput,
|
|
241
|
+
inlineInput: this.inlineInput,
|
|
242
|
+
render: (w) => dialog.render(w),
|
|
243
|
+
invalidate: () => adapter.invalidate(),
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
//# sourceMappingURL=build-questionnaire.js.map
|