@humain/humain-code 0.8.2 → 0.8.4
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 +152 -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-3RXT35Y3.js +3 -0
- package/dist/bundle/chunks/chunk-4BNDLR6C.js +177 -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-PJXBU6CR.js → chunk-52642TYH.js} +394 -204
- 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-73YX5XGR.js +2461 -0
- 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-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-ARTF7ZMQ.js +5 -0
- package/dist/bundle/chunks/chunk-B3FT6L6S.js +131 -0
- 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-EFY2QPVP.js → chunk-CIAXW64K.js} +16 -16
- package/dist/bundle/chunks/{chunk-VFLVWPLZ.js → chunk-CKFLQGJN.js} +20 -16
- 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-U4EAJPMO.js → chunk-EVDQRT3I.js} +252 -371
- 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-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-G2QMON4O.js → chunk-HWXQCJDP.js} +408 -392
- 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-H2B3WLIM.js → chunk-J5YFXMTM.js} +4 -4
- 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-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-OTVHRZ67.js +17 -0
- 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-S2US54IU.js +37 -0
- package/dist/bundle/chunks/{chunk-H7UPU2SH.js → chunk-SOE25WIS.js} +1218 -1239
- 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-JX6YIPNK.js → chunk-WCKS2DPT.js} +1 -1
- package/dist/bundle/chunks/chunk-XGOJCV6Z.js +2 -0
- package/dist/bundle/chunks/chunk-XGSJX23G.js +1151 -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-ELBUCH6U.js → compat-7UJJAO4E.js} +12 -12
- package/dist/bundle/chunks/{curator-server-QB4GITGS.js → curator-server-MW645JI3.js} +2 -2
- package/dist/bundle/chunks/{dist-NERIS6SW.js → dist-7PCCEUQF.js} +2 -2
- package/dist/bundle/chunks/{dist-QSYDYE3Y.js → dist-I53JI67E.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-KJVAYG3F.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-SRYLSS5P.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-3P3BHQ7E.js → flow-implementer-GE2ARQKR.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-3PDJKE5F.js → inprocess-MGMVI6HN.js} +6 -6
- package/dist/bundle/chunks/interactive-mode-HHWOE4FD.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-UXSSFNV5.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/adapter/delivery.d.ts +27 -0
- package/dist/coordination/adapter/delivery.d.ts.map +1 -1
- package/dist/coordination/adapter/delivery.js +164 -4
- package/dist/coordination/adapter/delivery.js.map +1 -1
- package/dist/coordination/adapter/index.d.ts.map +1 -1
- package/dist/coordination/adapter/index.js +31 -5
- package/dist/coordination/adapter/index.js.map +1 -1
- package/dist/coordination/adapter/presence.d.ts +5 -0
- package/dist/coordination/adapter/presence.d.ts.map +1 -1
- package/dist/coordination/adapter/presence.js +25 -3
- package/dist/coordination/adapter/presence.js.map +1 -1
- package/dist/coordination/adapter/question-routing.d.ts +7 -0
- package/dist/coordination/adapter/question-routing.d.ts.map +1 -0
- package/dist/coordination/adapter/question-routing.js +40 -0
- package/dist/coordination/adapter/question-routing.js.map +1 -0
- package/dist/coordination/adapter/receipts.d.ts +7 -0
- package/dist/coordination/adapter/receipts.d.ts.map +1 -1
- package/dist/coordination/adapter/receipts.js +25 -2
- package/dist/coordination/adapter/receipts.js.map +1 -1
- package/dist/coordination/adapter/tool.d.ts +19 -3
- package/dist/coordination/adapter/tool.d.ts.map +1 -1
- package/dist/coordination/adapter/tool.js +93 -19
- package/dist/coordination/adapter/tool.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/coordination/client/client.d.ts +2 -2
- package/dist/coordination/client/client.d.ts.map +1 -1
- package/dist/coordination/client/client.js +4 -0
- package/dist/coordination/client/client.js.map +1 -1
- package/dist/coordination/transport/protocol.d.ts.map +1 -1
- package/dist/coordination/transport/protocol.js +23 -0
- package/dist/coordination/transport/protocol.js.map +1 -1
- package/dist/coordination/transport/types.d.ts +11 -1
- package/dist/coordination/transport/types.d.ts.map +1 -1
- package/dist/coordination/transport/types.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/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/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +13 -2
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +9 -1
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.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 +20 -10
- 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/oauth-account-pool.d.ts +14 -0
- package/dist/core/oauth-account-pool.d.ts.map +1 -1
- package/dist/core/oauth-account-pool.js +166 -14
- package/dist/core/oauth-account-pool.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/run-outcome.d.ts +1 -1
- package/dist/core/run-outcome.d.ts.map +1 -1
- package/dist/core/run-outcome.js +2 -2
- package/dist/core/run-outcome.js.map +1 -1
- package/dist/core/run-preflight.d.ts.map +1 -1
- package/dist/core/run-preflight.js +15 -8
- package/dist/core/run-preflight.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 +193 -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/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/main.d.ts +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +38 -26
- package/dist/main.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 +17 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +232 -108
- 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 +45 -3
- package/docs/codemode.md +7 -3
- package/docs/compaction.md +1 -1
- package/docs/coordination.md +16 -4
- package/docs/development.md +6 -0
- package/docs/environment-variables.md +5 -3
- package/docs/extensions.md +19 -5
- 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 +25 -3
- 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/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-3PJ7NPWN.js +0 -80
- package/dist/bundle/chunks/chunk-6JTCRCNF.js +0 -74
- 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-JQBZUFH7.js +0 -3580
- 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-UEW6TUSP.js +0 -36
- 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/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-SDUO5OLD.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-IU5KWB2C.js +0 -28
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { QuestionAnswer } from "./types.ts";
|
|
2
|
+
/**
|
|
3
|
+
* Placeholder for empty / null answer text. Used uniformly across both variants — the
|
|
4
|
+
* earlier `(no answer)` fallback in the dialog summary was accidental drift; tests pin
|
|
5
|
+
* `(no input)` only.
|
|
6
|
+
*/
|
|
7
|
+
export declare const NO_INPUT_PLACEHOLDER = "(no input)";
|
|
8
|
+
export type FormatAnswerVariant = "summary" | "envelope";
|
|
9
|
+
/**
|
|
10
|
+
* Format a `QuestionAnswer` to its scalar string form. `variant` is currently unused
|
|
11
|
+
* across all branches (the chat branch that once distinguished `envelope` from
|
|
12
|
+
* `summary` has been removed); it is retained on the signature for stability.
|
|
13
|
+
* The `kind: "custom"` empty-string handling and the option fallback both unify on
|
|
14
|
+
* `NO_INPUT_PLACEHOLDER`. Switch is exhaustive — non-`void` return enforces every
|
|
15
|
+
* variant is handled.
|
|
16
|
+
*/
|
|
17
|
+
export declare function formatAnswerScalar(a: QuestionAnswer, _variant: FormatAnswerVariant): string;
|
|
18
|
+
//# sourceMappingURL=format-answer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-answer.d.ts","sourceRoot":"","sources":["../../../../../../src/humain/ask-user-question/vendor/ask/tool/format-answer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,eAAe,CAAC;AAEjD,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,UAAU,CAAC;AAEzD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,cAAc,EAAE,QAAQ,EAAE,mBAAmB,GAAG,MAAM,CAY3F"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Placeholder for empty / null answer text. Used uniformly across both variants — the
|
|
3
|
+
* earlier `(no answer)` fallback in the dialog summary was accidental drift; tests pin
|
|
4
|
+
* `(no input)` only.
|
|
5
|
+
*/
|
|
6
|
+
export const NO_INPUT_PLACEHOLDER = "(no input)";
|
|
7
|
+
/**
|
|
8
|
+
* Format a `QuestionAnswer` to its scalar string form. `variant` is currently unused
|
|
9
|
+
* across all branches (the chat branch that once distinguished `envelope` from
|
|
10
|
+
* `summary` has been removed); it is retained on the signature for stability.
|
|
11
|
+
* The `kind: "custom"` empty-string handling and the option fallback both unify on
|
|
12
|
+
* `NO_INPUT_PLACEHOLDER`. Switch is exhaustive — non-`void` return enforces every
|
|
13
|
+
* variant is handled.
|
|
14
|
+
*/
|
|
15
|
+
export function formatAnswerScalar(a, _variant) {
|
|
16
|
+
switch (a.kind) {
|
|
17
|
+
case "multi": {
|
|
18
|
+
const values = [...(a.selected ?? [])];
|
|
19
|
+
if (a.answer && a.answer.length > 0)
|
|
20
|
+
values.push(a.answer);
|
|
21
|
+
return values.length > 0 ? values.join(", ") : NO_INPUT_PLACEHOLDER;
|
|
22
|
+
}
|
|
23
|
+
case "custom":
|
|
24
|
+
return a.answer && a.answer.length > 0 ? a.answer : NO_INPUT_PLACEHOLDER;
|
|
25
|
+
case "option":
|
|
26
|
+
return a.answer ?? NO_INPUT_PLACEHOLDER;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=format-answer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-answer.js","sourceRoot":"","sources":["../../../../../../src/humain/ask-user-question/vendor/ask/tool/format-answer.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,YAAY,CAAC;AAIjD;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAAC,CAAiB,EAAE,QAA6B;IAClF,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC;QAChB,KAAK,OAAO,EAAE,CAAC;YACd,MAAM,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,CAAC;YACvC,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC;gBAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;YAC3D,OAAO,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC;QACrE,CAAC;QACD,KAAK,QAAQ;YACZ,OAAO,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,oBAAoB,CAAC;QAC1E,KAAK,QAAQ;YACZ,OAAO,CAAC,CAAC,MAAM,IAAI,oBAAoB,CAAC;IAC1C,CAAC;AACF,CAAC","sourcesContent":["import type { QuestionAnswer } from \"./types.ts\";\n\n/**\n * Placeholder for empty / null answer text. Used uniformly across both variants — the\n * earlier `(no answer)` fallback in the dialog summary was accidental drift; tests pin\n * `(no input)` only.\n */\nexport const NO_INPUT_PLACEHOLDER = \"(no input)\";\n\nexport type FormatAnswerVariant = \"summary\" | \"envelope\";\n\n/**\n * Format a `QuestionAnswer` to its scalar string form. `variant` is currently unused\n * across all branches (the chat branch that once distinguished `envelope` from\n * `summary` has been removed); it is retained on the signature for stability.\n * The `kind: \"custom\"` empty-string handling and the option fallback both unify on\n * `NO_INPUT_PLACEHOLDER`. Switch is exhaustive — non-`void` return enforces every\n * variant is handled.\n */\nexport function formatAnswerScalar(a: QuestionAnswer, _variant: FormatAnswerVariant): string {\n\tswitch (a.kind) {\n\t\tcase \"multi\": {\n\t\t\tconst values = [...(a.selected ?? [])];\n\t\t\tif (a.answer && a.answer.length > 0) values.push(a.answer);\n\t\t\treturn values.length > 0 ? values.join(\", \") : NO_INPUT_PLACEHOLDER;\n\t\t}\n\t\tcase \"custom\":\n\t\t\treturn a.answer && a.answer.length > 0 ? a.answer : NO_INPUT_PLACEHOLDER;\n\t\tcase \"option\":\n\t\t\treturn a.answer ?? NO_INPUT_PLACEHOLDER;\n\t}\n}\n"]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { QuestionParams } from "./types.ts";
|
|
2
|
+
/**
|
|
3
|
+
* Normalize line terminators in one model-supplied text field (#192).
|
|
4
|
+
*
|
|
5
|
+
* Some models serialize a bare carriage return inside tool-call string
|
|
6
|
+
* arguments at token boundaries where the text was meant to be contiguous
|
|
7
|
+
* (`GEMBA\r_LOG\r_FILE` for `GEMBA_LOG_FILE`). A raw CR is a cursor-control
|
|
8
|
+
* byte, not text: pi-tui ≤0.80 writes it straight into the row, so the
|
|
9
|
+
* terminal returns to column 0 and later text overwrites the pointer and
|
|
10
|
+
* number; pi-tui ≥0.84 splits `wrapTextWithAnsi` on `\r`, so one option
|
|
11
|
+
* fragments into stacked rows. Both symptoms have the same fix at our
|
|
12
|
+
* boundary:
|
|
13
|
+
*
|
|
14
|
+
* - `\r\n` → `\n` keeps genuine multi-line content (preview markdown) intact.
|
|
15
|
+
* - a lone `\r` is deleted — never a space (phantom gaps inside words) and
|
|
16
|
+
* never `\n` (reintroduces the vertical fragmentation). This matches
|
|
17
|
+
* pi-coding-agent's own display normalization (`normalizeDisplayText`).
|
|
18
|
+
*/
|
|
19
|
+
export declare function normalizeLineTerminators(text: string): string;
|
|
20
|
+
/**
|
|
21
|
+
* Return a copy of the tool params with every user-facing string field
|
|
22
|
+
* (`question`, `header`, `options[].label`, `options[].description`,
|
|
23
|
+
* `options[].preview`) line-terminator-normalized. Runs once at tool entry,
|
|
24
|
+
* BEFORE `validateQuestionnaire`, so the reserved-label and duplicate-label
|
|
25
|
+
* guards compare the text the user will actually see (`"Other\r"` must not
|
|
26
|
+
* slip past `reserved_label`), and so the TUI, the RPC dialog walker, the
|
|
27
|
+
* envelope echo, and the `rpiv:ask-user:prompt` payload all carry the same
|
|
28
|
+
* clean text. Pure: the input object is never mutated.
|
|
29
|
+
*/
|
|
30
|
+
export declare function normalizeQuestionParams(params: QuestionParams): QuestionParams;
|
|
31
|
+
/**
|
|
32
|
+
* Pi's `prepareArguments` hook: undo double-encoded tool arguments before schema
|
|
33
|
+
* validation (#244). Some tool-call parsers (vLLM/LiteLLM-served GLM/Qwen-class
|
|
34
|
+
* models) intermittently emit nested structures as JSON strings — `questions` itself,
|
|
35
|
+
* or its elements (`questions.0: must be object`). Only a string at an array/object
|
|
36
|
+
* position is decoded, and only when it parses to the expected shape; anything else is
|
|
37
|
+
* passed through untouched so validation still reports the real problem. The same
|
|
38
|
+
* applies one level down to `options`. Well-formed arguments are returned as-is.
|
|
39
|
+
*/
|
|
40
|
+
export declare function prepareQuestionArguments(args: unknown): QuestionParams;
|
|
41
|
+
//# sourceMappingURL=normalize-params.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize-params.d.ts","sourceRoot":"","sources":["../../../../../../src/humain/ask-user-question/vendor/ask/tool/normalize-params.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE7D;AAgBD;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,cAAc,GAAG,cAAc,CAQ9E;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,OAAO,GAAG,cAAc,CAWtE"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normalize line terminators in one model-supplied text field (#192).
|
|
3
|
+
*
|
|
4
|
+
* Some models serialize a bare carriage return inside tool-call string
|
|
5
|
+
* arguments at token boundaries where the text was meant to be contiguous
|
|
6
|
+
* (`GEMBA\r_LOG\r_FILE` for `GEMBA_LOG_FILE`). A raw CR is a cursor-control
|
|
7
|
+
* byte, not text: pi-tui ≤0.80 writes it straight into the row, so the
|
|
8
|
+
* terminal returns to column 0 and later text overwrites the pointer and
|
|
9
|
+
* number; pi-tui ≥0.84 splits `wrapTextWithAnsi` on `\r`, so one option
|
|
10
|
+
* fragments into stacked rows. Both symptoms have the same fix at our
|
|
11
|
+
* boundary:
|
|
12
|
+
*
|
|
13
|
+
* - `\r\n` → `\n` keeps genuine multi-line content (preview markdown) intact.
|
|
14
|
+
* - a lone `\r` is deleted — never a space (phantom gaps inside words) and
|
|
15
|
+
* never `\n` (reintroduces the vertical fragmentation). This matches
|
|
16
|
+
* pi-coding-agent's own display normalization (`normalizeDisplayText`).
|
|
17
|
+
*/
|
|
18
|
+
export function normalizeLineTerminators(text) {
|
|
19
|
+
return text.replace(/\r\n/g, "\n").replace(/\r/g, "");
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Copy `obj`, normalizing the listed keys that hold strings. Keys absent from
|
|
23
|
+
* `obj` (e.g. an omitted `preview`) stay absent so `"preview" in option`
|
|
24
|
+
* checks and `hasPreview` derivations are unchanged.
|
|
25
|
+
*/
|
|
26
|
+
function normalizeStringFields(obj, keys) {
|
|
27
|
+
const out = { ...obj };
|
|
28
|
+
for (const key of keys) {
|
|
29
|
+
const value = obj[key];
|
|
30
|
+
if (typeof value === "string")
|
|
31
|
+
out[key] = normalizeLineTerminators(value);
|
|
32
|
+
}
|
|
33
|
+
return out;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Return a copy of the tool params with every user-facing string field
|
|
37
|
+
* (`question`, `header`, `options[].label`, `options[].description`,
|
|
38
|
+
* `options[].preview`) line-terminator-normalized. Runs once at tool entry,
|
|
39
|
+
* BEFORE `validateQuestionnaire`, so the reserved-label and duplicate-label
|
|
40
|
+
* guards compare the text the user will actually see (`"Other\r"` must not
|
|
41
|
+
* slip past `reserved_label`), and so the TUI, the RPC dialog walker, the
|
|
42
|
+
* envelope echo, and the `rpiv:ask-user:prompt` payload all carry the same
|
|
43
|
+
* clean text. Pure: the input object is never mutated.
|
|
44
|
+
*/
|
|
45
|
+
export function normalizeQuestionParams(params) {
|
|
46
|
+
return {
|
|
47
|
+
...params,
|
|
48
|
+
questions: params.questions.map((q) => ({
|
|
49
|
+
...normalizeStringFields(q, ["question", "header"]),
|
|
50
|
+
options: q.options.map((o) => normalizeStringFields(o, ["label", "description", "preview"])),
|
|
51
|
+
})),
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Pi's `prepareArguments` hook: undo double-encoded tool arguments before schema
|
|
56
|
+
* validation (#244). Some tool-call parsers (vLLM/LiteLLM-served GLM/Qwen-class
|
|
57
|
+
* models) intermittently emit nested structures as JSON strings — `questions` itself,
|
|
58
|
+
* or its elements (`questions.0: must be object`). Only a string at an array/object
|
|
59
|
+
* position is decoded, and only when it parses to the expected shape; anything else is
|
|
60
|
+
* passed through untouched so validation still reports the real problem. The same
|
|
61
|
+
* applies one level down to `options`. Well-formed arguments are returned as-is.
|
|
62
|
+
*/
|
|
63
|
+
export function prepareQuestionArguments(args) {
|
|
64
|
+
if (!isRecord(args))
|
|
65
|
+
return args;
|
|
66
|
+
const questions = decodeArray(args.questions);
|
|
67
|
+
if (!Array.isArray(questions))
|
|
68
|
+
return args;
|
|
69
|
+
const decoded = questions.map((q) => {
|
|
70
|
+
const question = decodeObject(q);
|
|
71
|
+
if (!isRecord(question))
|
|
72
|
+
return question;
|
|
73
|
+
const options = decodeArray(question.options);
|
|
74
|
+
return Array.isArray(options) ? { ...question, options: options.map(decodeObject) } : question;
|
|
75
|
+
});
|
|
76
|
+
return { ...args, questions: decoded };
|
|
77
|
+
}
|
|
78
|
+
function isRecord(value) {
|
|
79
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
80
|
+
}
|
|
81
|
+
/** A JSON string holding an array → that array; anything else unchanged. */
|
|
82
|
+
function decodeArray(value) {
|
|
83
|
+
const parsed = typeof value === "string" ? parseJson(value) : value;
|
|
84
|
+
return Array.isArray(parsed) ? parsed : value;
|
|
85
|
+
}
|
|
86
|
+
/** A JSON string holding an object → that object; anything else unchanged. */
|
|
87
|
+
function decodeObject(value) {
|
|
88
|
+
const parsed = typeof value === "string" ? parseJson(value) : value;
|
|
89
|
+
return isRecord(parsed) ? parsed : value;
|
|
90
|
+
}
|
|
91
|
+
function parseJson(text) {
|
|
92
|
+
try {
|
|
93
|
+
return JSON.parse(text);
|
|
94
|
+
}
|
|
95
|
+
catch {
|
|
96
|
+
return undefined;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=normalize-params.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize-params.js","sourceRoot":"","sources":["../../../../../../src/humain/ask-user-question/vendor/ask/tool/normalize-params.ts"],"names":[],"mappings":"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","sourcesContent":["import type { QuestionParams } from \"./types.ts\";\n\n/**\n * Normalize line terminators in one model-supplied text field (#192).\n *\n * Some models serialize a bare carriage return inside tool-call string\n * arguments at token boundaries where the text was meant to be contiguous\n * (`GEMBA\\r_LOG\\r_FILE` for `GEMBA_LOG_FILE`). A raw CR is a cursor-control\n * byte, not text: pi-tui ≤0.80 writes it straight into the row, so the\n * terminal returns to column 0 and later text overwrites the pointer and\n * number; pi-tui ≥0.84 splits `wrapTextWithAnsi` on `\\r`, so one option\n * fragments into stacked rows. Both symptoms have the same fix at our\n * boundary:\n *\n * - `\\r\\n` → `\\n` keeps genuine multi-line content (preview markdown) intact.\n * - a lone `\\r` is deleted — never a space (phantom gaps inside words) and\n * never `\\n` (reintroduces the vertical fragmentation). This matches\n * pi-coding-agent's own display normalization (`normalizeDisplayText`).\n */\nexport function normalizeLineTerminators(text: string): string {\n\treturn text.replace(/\\r\\n/g, \"\\n\").replace(/\\r/g, \"\");\n}\n\n/**\n * Copy `obj`, normalizing the listed keys that hold strings. Keys absent from\n * `obj` (e.g. an omitted `preview`) stay absent so `\"preview\" in option`\n * checks and `hasPreview` derivations are unchanged.\n */\nfunction normalizeStringFields<T extends object>(obj: T, keys: readonly (keyof T)[]): T {\n\tconst out = { ...obj };\n\tfor (const key of keys) {\n\t\tconst value = obj[key];\n\t\tif (typeof value === \"string\") out[key] = normalizeLineTerminators(value) as T[typeof key];\n\t}\n\treturn out;\n}\n\n/**\n * Return a copy of the tool params with every user-facing string field\n * (`question`, `header`, `options[].label`, `options[].description`,\n * `options[].preview`) line-terminator-normalized. Runs once at tool entry,\n * BEFORE `validateQuestionnaire`, so the reserved-label and duplicate-label\n * guards compare the text the user will actually see (`\"Other\\r\"` must not\n * slip past `reserved_label`), and so the TUI, the RPC dialog walker, the\n * envelope echo, and the `rpiv:ask-user:prompt` payload all carry the same\n * clean text. Pure: the input object is never mutated.\n */\nexport function normalizeQuestionParams(params: QuestionParams): QuestionParams {\n\treturn {\n\t\t...params,\n\t\tquestions: params.questions.map((q) => ({\n\t\t\t...normalizeStringFields(q, [\"question\", \"header\"]),\n\t\t\toptions: q.options.map((o) => normalizeStringFields(o, [\"label\", \"description\", \"preview\"])),\n\t\t})),\n\t};\n}\n\n/**\n * Pi's `prepareArguments` hook: undo double-encoded tool arguments before schema\n * validation (#244). Some tool-call parsers (vLLM/LiteLLM-served GLM/Qwen-class\n * models) intermittently emit nested structures as JSON strings — `questions` itself,\n * or its elements (`questions.0: must be object`). Only a string at an array/object\n * position is decoded, and only when it parses to the expected shape; anything else is\n * passed through untouched so validation still reports the real problem. The same\n * applies one level down to `options`. Well-formed arguments are returned as-is.\n */\nexport function prepareQuestionArguments(args: unknown): QuestionParams {\n\tif (!isRecord(args)) return args as QuestionParams;\n\tconst questions = decodeArray(args.questions);\n\tif (!Array.isArray(questions)) return args as QuestionParams;\n\tconst decoded = questions.map((q) => {\n\t\tconst question = decodeObject(q);\n\t\tif (!isRecord(question)) return question;\n\t\tconst options = decodeArray(question.options);\n\t\treturn Array.isArray(options) ? { ...question, options: options.map(decodeObject) } : question;\n\t});\n\treturn { ...args, questions: decoded } as unknown as QuestionParams;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\n/** A JSON string holding an array → that array; anything else unchanged. */\nfunction decodeArray(value: unknown): unknown {\n\tconst parsed = typeof value === \"string\" ? parseJson(value) : value;\n\treturn Array.isArray(parsed) ? parsed : value;\n}\n\n/** A JSON string holding an object → that object; anything else unchanged. */\nfunction decodeObject(value: unknown): unknown {\n\tconst parsed = typeof value === \"string\" ? parseJson(value) : value;\n\treturn isRecord(parsed) ? parsed : value;\n}\n\nfunction parseJson(text: string): unknown {\n\ttry {\n\t\treturn JSON.parse(text);\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { QuestionAnswer, QuestionnaireResult, QuestionParams } from "./types.ts";
|
|
2
|
+
export declare const DECLINE_MESSAGE = "User declined to answer questions";
|
|
3
|
+
export declare const ENVELOPE_PREFIX = "User has answered your questions:";
|
|
4
|
+
export declare const ENVELOPE_SUFFIX = "You can now continue with the user's answers in mind.";
|
|
5
|
+
/**
|
|
6
|
+
* Map a `QuestionnaireResult` (or null/cancelled) to the LLM-facing tool envelope.
|
|
7
|
+
* Pure of `(result, params)`; cancelled and "no segments" both fall to `DECLINE_MESSAGE`
|
|
8
|
+
* so the model sees a single canonical "didn't answer" signal regardless of why.
|
|
9
|
+
* "No segments" means no answers AND no global note — the `global note:` segment is
|
|
10
|
+
* pushed before the zero-segments check, so a note-bearing submit with zero answers
|
|
11
|
+
* still yields the answered envelope. A partial submit names the questions left blank
|
|
12
|
+
* in an `unanswered:` segment (and `details.unanswered`, their indexes) so the model can
|
|
13
|
+
* tell "not decided yet" from "settled" (#291); it never counts as an answer, and a fully
|
|
14
|
+
* answered result stays byte-identical.
|
|
15
|
+
*/
|
|
16
|
+
export declare function buildQuestionnaireResponse(result: QuestionnaireResult | null | undefined, params: QuestionParams): {
|
|
17
|
+
content: {
|
|
18
|
+
type: "text";
|
|
19
|
+
text: string;
|
|
20
|
+
}[];
|
|
21
|
+
details: QuestionnaireResult;
|
|
22
|
+
};
|
|
23
|
+
/** `unanswered: "<question>", "<question>".` — the questions shown but left blank on a partial submit. */
|
|
24
|
+
export declare function buildUnansweredSegment(indexes: readonly number[], params: QuestionParams): string;
|
|
25
|
+
/**
|
|
26
|
+
* Format a single answer segment for the envelope. Pure of `a`. The `"Q"="A"` shape and
|
|
27
|
+
* the optional `selected preview:` / `user notes:` suffixes are pinned by envelope tests.
|
|
28
|
+
*/
|
|
29
|
+
export declare function buildAnswerSegment(a: QuestionAnswer): string;
|
|
30
|
+
export declare function buildToolResult(text: string, details: QuestionnaireResult): {
|
|
31
|
+
content: {
|
|
32
|
+
type: "text";
|
|
33
|
+
text: string;
|
|
34
|
+
}[];
|
|
35
|
+
details: QuestionnaireResult;
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=response-envelope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response-envelope.d.ts","sourceRoot":"","sources":["../../../../../../src/humain/ask-user-question/vendor/ask/tool/response-envelope.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEtF,eAAO,MAAM,eAAe,sCAAsC,CAAC;AACnE,eAAO,MAAM,eAAe,sCAAsC,CAAC;AACnE,eAAO,MAAM,eAAe,0DAA0D,CAAC;AAEvF;;;;;;;;;;GAUG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,mBAAmB,GAAG,IAAI,GAAG,SAAS,EAAE,MAAM,EAAE,cAAc;;cA+C7F,MAAM;;;;EApBzB;AAED,0GAA0G;AAC1G,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,EAAE,cAAc,GAAG,MAAM,CAEjG;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,cAAc,GAAG,MAAM,CAK5D;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB;;cAEtD,MAAM;;;;EAGzB"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { formatAnswerScalar } from "./format-answer.js";
|
|
2
|
+
export const DECLINE_MESSAGE = "User declined to answer questions";
|
|
3
|
+
export const ENVELOPE_PREFIX = "User has answered your questions:";
|
|
4
|
+
export const ENVELOPE_SUFFIX = "You can now continue with the user's answers in mind.";
|
|
5
|
+
/**
|
|
6
|
+
* Map a `QuestionnaireResult` (or null/cancelled) to the LLM-facing tool envelope.
|
|
7
|
+
* Pure of `(result, params)`; cancelled and "no segments" both fall to `DECLINE_MESSAGE`
|
|
8
|
+
* so the model sees a single canonical "didn't answer" signal regardless of why.
|
|
9
|
+
* "No segments" means no answers AND no global note — the `global note:` segment is
|
|
10
|
+
* pushed before the zero-segments check, so a note-bearing submit with zero answers
|
|
11
|
+
* still yields the answered envelope. A partial submit names the questions left blank
|
|
12
|
+
* in an `unanswered:` segment (and `details.unanswered`, their indexes) so the model can
|
|
13
|
+
* tell "not decided yet" from "settled" (#291); it never counts as an answer, and a fully
|
|
14
|
+
* answered result stays byte-identical.
|
|
15
|
+
*/
|
|
16
|
+
export function buildQuestionnaireResponse(result, params) {
|
|
17
|
+
if (!result || result.cancelled) {
|
|
18
|
+
// Decline text stays canonical even when a global note rides the cancelled result;
|
|
19
|
+
// the note survives in `details` (like partial `answers`) for replay consumers.
|
|
20
|
+
return buildToolResult(DECLINE_MESSAGE, {
|
|
21
|
+
answers: result?.answers ?? [],
|
|
22
|
+
cancelled: true,
|
|
23
|
+
...(result?.globalNote && result.globalNote.length > 0 ? { globalNote: result.globalNote } : {}),
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
const segments = [];
|
|
27
|
+
const unanswered = [];
|
|
28
|
+
for (let i = 0; i < params.questions.length; i++) {
|
|
29
|
+
const a = result.answers.find((x) => x.questionIndex === i);
|
|
30
|
+
if (a)
|
|
31
|
+
segments.push(buildAnswerSegment(a));
|
|
32
|
+
else
|
|
33
|
+
unanswered.push(i);
|
|
34
|
+
}
|
|
35
|
+
const hasGlobalNote = result.globalNote !== undefined && result.globalNote.length > 0;
|
|
36
|
+
if (segments.length === 0 && !hasGlobalNote) {
|
|
37
|
+
return buildToolResult(DECLINE_MESSAGE, { answers: result.answers, cancelled: true });
|
|
38
|
+
}
|
|
39
|
+
if (unanswered.length > 0)
|
|
40
|
+
segments.push(buildUnansweredSegment(unanswered, params));
|
|
41
|
+
// Global note rides after the per-question segments: raw multiline echo (no
|
|
42
|
+
// reformatting), trailing period mirroring `buildAnswerSegment`'s shape.
|
|
43
|
+
if (hasGlobalNote)
|
|
44
|
+
segments.push(`global note: ${result.globalNote}.`);
|
|
45
|
+
const details = unanswered.length > 0 ? { ...result, unanswered } : result;
|
|
46
|
+
return buildToolResult(`${ENVELOPE_PREFIX} ${segments.join(" ")} ${ENVELOPE_SUFFIX}`, details);
|
|
47
|
+
}
|
|
48
|
+
/** `unanswered: "<question>", "<question>".` — the questions shown but left blank on a partial submit. */
|
|
49
|
+
export function buildUnansweredSegment(indexes, params) {
|
|
50
|
+
return `unanswered: ${indexes.map((i) => `"${params.questions[i]?.question}"`).join(", ")}.`;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Format a single answer segment for the envelope. Pure of `a`. The `"Q"="A"` shape and
|
|
54
|
+
* the optional `selected preview:` / `user notes:` suffixes are pinned by envelope tests.
|
|
55
|
+
*/
|
|
56
|
+
export function buildAnswerSegment(a) {
|
|
57
|
+
const parts = [`"${a.question}"="${formatAnswerScalar(a, "envelope")}"`];
|
|
58
|
+
if (a.preview && a.preview.length > 0)
|
|
59
|
+
parts.push(`selected preview: ${a.preview}`);
|
|
60
|
+
if (a.notes && a.notes.length > 0)
|
|
61
|
+
parts.push(`user notes: ${a.notes}`);
|
|
62
|
+
return `${parts.join(". ")}.`;
|
|
63
|
+
}
|
|
64
|
+
export function buildToolResult(text, details) {
|
|
65
|
+
return {
|
|
66
|
+
content: [{ type: "text", text }],
|
|
67
|
+
details,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=response-envelope.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response-envelope.js","sourceRoot":"","sources":["../../../../../../src/humain/ask-user-question/vendor/ask/tool/response-envelope.ts"],"names":[],"mappings":"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","sourcesContent":["import { formatAnswerScalar } from \"./format-answer.ts\";\nimport type { QuestionAnswer, QuestionnaireResult, QuestionParams } from \"./types.ts\";\n\nexport const DECLINE_MESSAGE = \"User declined to answer questions\";\nexport const ENVELOPE_PREFIX = \"User has answered your questions:\";\nexport const ENVELOPE_SUFFIX = \"You can now continue with the user's answers in mind.\";\n\n/**\n * Map a `QuestionnaireResult` (or null/cancelled) to the LLM-facing tool envelope.\n * Pure of `(result, params)`; cancelled and \"no segments\" both fall to `DECLINE_MESSAGE`\n * so the model sees a single canonical \"didn't answer\" signal regardless of why.\n * \"No segments\" means no answers AND no global note — the `global note:` segment is\n * pushed before the zero-segments check, so a note-bearing submit with zero answers\n * still yields the answered envelope. A partial submit names the questions left blank\n * in an `unanswered:` segment (and `details.unanswered`, their indexes) so the model can\n * tell \"not decided yet\" from \"settled\" (#291); it never counts as an answer, and a fully\n * answered result stays byte-identical.\n */\nexport function buildQuestionnaireResponse(result: QuestionnaireResult | null | undefined, params: QuestionParams) {\n\tif (!result || result.cancelled) {\n\t\t// Decline text stays canonical even when a global note rides the cancelled result;\n\t\t// the note survives in `details` (like partial `answers`) for replay consumers.\n\t\treturn buildToolResult(DECLINE_MESSAGE, {\n\t\t\tanswers: result?.answers ?? [],\n\t\t\tcancelled: true,\n\t\t\t...(result?.globalNote && result.globalNote.length > 0 ? { globalNote: result.globalNote } : {}),\n\t\t});\n\t}\n\tconst segments: string[] = [];\n\tconst unanswered: number[] = [];\n\tfor (let i = 0; i < params.questions.length; i++) {\n\t\tconst a = result.answers.find((x) => x.questionIndex === i);\n\t\tif (a) segments.push(buildAnswerSegment(a));\n\t\telse unanswered.push(i);\n\t}\n\tconst hasGlobalNote = result.globalNote !== undefined && result.globalNote.length > 0;\n\tif (segments.length === 0 && !hasGlobalNote) {\n\t\treturn buildToolResult(DECLINE_MESSAGE, { answers: result.answers, cancelled: true });\n\t}\n\tif (unanswered.length > 0) segments.push(buildUnansweredSegment(unanswered, params));\n\t// Global note rides after the per-question segments: raw multiline echo (no\n\t// reformatting), trailing period mirroring `buildAnswerSegment`'s shape.\n\tif (hasGlobalNote) segments.push(`global note: ${result.globalNote}.`);\n\tconst details = unanswered.length > 0 ? { ...result, unanswered } : result;\n\treturn buildToolResult(`${ENVELOPE_PREFIX} ${segments.join(\" \")} ${ENVELOPE_SUFFIX}`, details);\n}\n\n/** `unanswered: \"<question>\", \"<question>\".` — the questions shown but left blank on a partial submit. */\nexport function buildUnansweredSegment(indexes: readonly number[], params: QuestionParams): string {\n\treturn `unanswered: ${indexes.map((i) => `\"${params.questions[i]?.question}\"`).join(\", \")}.`;\n}\n\n/**\n * Format a single answer segment for the envelope. Pure of `a`. The `\"Q\"=\"A\"` shape and\n * the optional `selected preview:` / `user notes:` suffixes are pinned by envelope tests.\n */\nexport function buildAnswerSegment(a: QuestionAnswer): string {\n\tconst parts: string[] = [`\"${a.question}\"=\"${formatAnswerScalar(a, \"envelope\")}\"`];\n\tif (a.preview && a.preview.length > 0) parts.push(`selected preview: ${a.preview}`);\n\tif (a.notes && a.notes.length > 0) parts.push(`user notes: ${a.notes}`);\n\treturn `${parts.join(\". \")}.`;\n}\n\nexport function buildToolResult(text: string, details: QuestionnaireResult) {\n\treturn {\n\t\tcontent: [{ type: \"text\" as const, text }],\n\t\tdetails,\n\t};\n}\n"]}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { type Static, Type } from "typebox";
|
|
2
|
+
export declare const MAX_QUESTIONS = 4;
|
|
3
|
+
export declare const MIN_OPTIONS = 2;
|
|
4
|
+
export declare const MAX_OPTIONS = 4;
|
|
5
|
+
export declare const MAX_HEADER_LENGTH = 16;
|
|
6
|
+
export declare const MAX_LABEL_LENGTH = 60;
|
|
7
|
+
/**
|
|
8
|
+
* User-facing labels for the three runtime sentinel rows, keyed by their
|
|
9
|
+
* `WrappingSelectItem.kind` discriminator. Sourced from
|
|
10
|
+
* `ROW_INTENT_META` via `LABELS_BY_KIND` (`row-intent.ts`) — single source of
|
|
11
|
+
* truth. Adding a new sentinel requires extending the `WrappingSelectItem`
|
|
12
|
+
* union AND adding an entry to `ROW_INTENT_META`; this map then auto-extends.
|
|
13
|
+
*/
|
|
14
|
+
export declare const SENTINEL_LABELS: {
|
|
15
|
+
readonly next: string;
|
|
16
|
+
readonly other: string;
|
|
17
|
+
};
|
|
18
|
+
export type SentinelKind = keyof typeof SENTINEL_LABELS;
|
|
19
|
+
export type SentinelLabel = (typeof SENTINEL_LABELS)[SentinelKind];
|
|
20
|
+
/**
|
|
21
|
+
* Labels reserved for Pi-internal sentinels — authoring an option with any
|
|
22
|
+
* of these labels triggers the `reserved_label` runtime guard. Two of the
|
|
23
|
+
* three come from `ROW_INTENT_META` (the runtime kinds); `"Other"` is
|
|
24
|
+
* reserved for CC parity only (the model is conditioned to reach for
|
|
25
|
+
* "Other" in CC; we reject it so the runtime sentinel is the single source
|
|
26
|
+
* of truth) and has no runtime kind.
|
|
27
|
+
*
|
|
28
|
+
* Reserved unconditionally — every question mode rejects these labels, even
|
|
29
|
+
* when a given runtime sentinel is not appended in that mode.
|
|
30
|
+
*
|
|
31
|
+
* Order is pinned by `types.test.ts:292` — keep the explicit
|
|
32
|
+
* `["Other", other, next]` literal so consumers using
|
|
33
|
+
* `RESERVED_LABELS[i]` indexing or `Set` membership see no behavior change.
|
|
34
|
+
*/
|
|
35
|
+
export declare const RESERVED_LABELS: readonly ["Other", string, string];
|
|
36
|
+
export type ReservedLabel = (typeof RESERVED_LABELS)[number];
|
|
37
|
+
export declare const OptionSchema: Type.TObject<{
|
|
38
|
+
label: Type.TString;
|
|
39
|
+
description: Type.TString;
|
|
40
|
+
preview: Type.TOptional<Type.TString>;
|
|
41
|
+
}>;
|
|
42
|
+
export declare const QuestionSchema: Type.TObject<{
|
|
43
|
+
question: Type.TString;
|
|
44
|
+
header: Type.TString;
|
|
45
|
+
options: Type.TArray<Type.TObject<{
|
|
46
|
+
label: Type.TString;
|
|
47
|
+
description: Type.TString;
|
|
48
|
+
preview: Type.TOptional<Type.TString>;
|
|
49
|
+
}>>;
|
|
50
|
+
multiSelect: Type.TOptional<Type.TBoolean>;
|
|
51
|
+
}>;
|
|
52
|
+
export declare const QuestionsSchema: Type.TArray<Type.TObject<{
|
|
53
|
+
question: Type.TString;
|
|
54
|
+
header: Type.TString;
|
|
55
|
+
options: Type.TArray<Type.TObject<{
|
|
56
|
+
label: Type.TString;
|
|
57
|
+
description: Type.TString;
|
|
58
|
+
preview: Type.TOptional<Type.TString>;
|
|
59
|
+
}>>;
|
|
60
|
+
multiSelect: Type.TOptional<Type.TBoolean>;
|
|
61
|
+
}>>;
|
|
62
|
+
export declare const QuestionParamsSchema: Type.TObject<{
|
|
63
|
+
questions: Type.TArray<Type.TObject<{
|
|
64
|
+
question: Type.TString;
|
|
65
|
+
header: Type.TString;
|
|
66
|
+
options: Type.TArray<Type.TObject<{
|
|
67
|
+
label: Type.TString;
|
|
68
|
+
description: Type.TString;
|
|
69
|
+
preview: Type.TOptional<Type.TString>;
|
|
70
|
+
}>>;
|
|
71
|
+
multiSelect: Type.TOptional<Type.TBoolean>;
|
|
72
|
+
}>>;
|
|
73
|
+
}>;
|
|
74
|
+
export type OptionData = Static<typeof OptionSchema>;
|
|
75
|
+
export type QuestionData = Static<typeof QuestionSchema>;
|
|
76
|
+
export type QuestionParams = Static<typeof QuestionParamsSchema>;
|
|
77
|
+
/**
|
|
78
|
+
* Answer-intent discriminated union. `kind` is the single discriminator —
|
|
79
|
+
* pre-1.0.3 boolean flags have been removed (see `banned-flags.test.ts`).
|
|
80
|
+
* Mirrors the row-side `WrappingSelectItem.kind` vocabulary where possible;
|
|
81
|
+
* `multi` is the multi-select variant (no row-side analog).
|
|
82
|
+
*
|
|
83
|
+
* Variant semantics:
|
|
84
|
+
* - `option`: user picked one of the author-defined options. `answer` is the option's label.
|
|
85
|
+
* - `custom`: user typed free-text on a single-select question. `answer` is the typed text or null.
|
|
86
|
+
* - `multi`: user committed a multi-select question. `selected` carries chosen labels and `answer`
|
|
87
|
+
* carries optional custom text.
|
|
88
|
+
*/
|
|
89
|
+
export interface QuestionAnswer {
|
|
90
|
+
questionIndex: number;
|
|
91
|
+
question: string;
|
|
92
|
+
kind: "option" | "custom" | "multi";
|
|
93
|
+
answer: string | null;
|
|
94
|
+
selected?: string[];
|
|
95
|
+
notes?: string;
|
|
96
|
+
/**
|
|
97
|
+
* Markdown text from the matched option's `preview` field, populated only
|
|
98
|
+
* when the user lands on a single-select option carrying a `preview`.
|
|
99
|
+
* Used by `buildQuestionnaireResponse` to echo `selected preview: <preview>`
|
|
100
|
+
* into the LLM-facing envelope. Undefined for multi-select and custom-text
|
|
101
|
+
* (`kind: "custom"`) answers.
|
|
102
|
+
*/
|
|
103
|
+
preview?: string;
|
|
104
|
+
}
|
|
105
|
+
export type QuestionnaireError = "no_ui" | "no_custom_ui" | "no_questions" | "empty_options" | "too_many_questions" | "duplicate_question" | "duplicate_option_label" | "reserved_label" | "session_load_failed" | "stale_module_cache";
|
|
106
|
+
export interface QuestionnaireResult {
|
|
107
|
+
answers: QuestionAnswer[];
|
|
108
|
+
cancelled: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Global note authored on the Submit tab: `n` opens the shared notes editor there,
|
|
111
|
+
* and the committed text lives at the `notesByTab[questions.length]` pseudo-index
|
|
112
|
+
* (a slot no question tab can occupy) until `doneFor` lifts it onto the result —
|
|
113
|
+
* attached on both submit and cancel, like per-question `answers[].notes`.
|
|
114
|
+
* Conditional-spread contract, mirroring `QuestionAnswer.notes`: the key appears
|
|
115
|
+
* only via conditional spread of a non-empty string — never assigned `undefined`,
|
|
116
|
+
* never kept for an empty/whitespace-only draft — so note-free results stay
|
|
117
|
+
* byte-identical (`!("globalNote" in result)` holds).
|
|
118
|
+
*/
|
|
119
|
+
globalNote?: string;
|
|
120
|
+
/**
|
|
121
|
+
* Indexes of the questions left blank on a partial submit (#291), set only by the
|
|
122
|
+
* envelope builder on an answered result — never present when every question is
|
|
123
|
+
* answered or the result is a decline, so those stay byte-identical.
|
|
124
|
+
*/
|
|
125
|
+
unanswered?: number[];
|
|
126
|
+
error?: QuestionnaireError;
|
|
127
|
+
}
|
|
128
|
+
export declare function isQuestionnaireResult(value: unknown): value is QuestionnaireResult;
|
|
129
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/humain/ask-user-question/vendor/ask/tool/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAG5C,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,iBAAiB,KAAK,CAAC;AACpC,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC;;;;;;GAMG;AACH,eAAO,MAAM,eAAe;;;CAAiB,CAAC;AAE9C,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,eAAe,CAAC;AACxD,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,YAAY,CAAC,CAAC;AAEnE;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,eAAe,YAAI,OAAO,iBAAmE,CAAC;AAC3G,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7D,eAAO,MAAM,YAAY;;;;EAevB,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;;EAsBzB,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;GAI1B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;EAE/B,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,YAAY,CAAC,CAAC;AACrD,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,cAAc,CAAC,CAAC;AACzD,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAEjE;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,cAAc;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,kBAAkB,GAC3B,OAAO,GACP,cAAc,GACd,cAAc,GACd,eAAe,GACf,oBAAoB,GACpB,oBAAoB,GACpB,wBAAwB,GACxB,gBAAgB,GAChB,qBAAqB,GACrB,oBAAoB,CAAC;AAExB,MAAM,WAAW,mBAAmB;IACnC,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,SAAS,EAAE,OAAO,CAAC;IACnB;;;;;;;;;OASG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,kBAAkB,CAAC;CAC3B;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,mBAAmB,CAIlF"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { Type } from "typebox";
|
|
2
|
+
import { LABELS_BY_KIND, ROW_INTENT_META } from "../state/row-intent.js";
|
|
3
|
+
export const MAX_QUESTIONS = 4;
|
|
4
|
+
export const MIN_OPTIONS = 2;
|
|
5
|
+
export const MAX_OPTIONS = 4;
|
|
6
|
+
export const MAX_HEADER_LENGTH = 16;
|
|
7
|
+
export const MAX_LABEL_LENGTH = 60;
|
|
8
|
+
/**
|
|
9
|
+
* User-facing labels for the three runtime sentinel rows, keyed by their
|
|
10
|
+
* `WrappingSelectItem.kind` discriminator. Sourced from
|
|
11
|
+
* `ROW_INTENT_META` via `LABELS_BY_KIND` (`row-intent.ts`) — single source of
|
|
12
|
+
* truth. Adding a new sentinel requires extending the `WrappingSelectItem`
|
|
13
|
+
* union AND adding an entry to `ROW_INTENT_META`; this map then auto-extends.
|
|
14
|
+
*/
|
|
15
|
+
export const SENTINEL_LABELS = LABELS_BY_KIND;
|
|
16
|
+
/**
|
|
17
|
+
* Labels reserved for Pi-internal sentinels — authoring an option with any
|
|
18
|
+
* of these labels triggers the `reserved_label` runtime guard. Two of the
|
|
19
|
+
* three come from `ROW_INTENT_META` (the runtime kinds); `"Other"` is
|
|
20
|
+
* reserved for CC parity only (the model is conditioned to reach for
|
|
21
|
+
* "Other" in CC; we reject it so the runtime sentinel is the single source
|
|
22
|
+
* of truth) and has no runtime kind.
|
|
23
|
+
*
|
|
24
|
+
* Reserved unconditionally — every question mode rejects these labels, even
|
|
25
|
+
* when a given runtime sentinel is not appended in that mode.
|
|
26
|
+
*
|
|
27
|
+
* Order is pinned by `types.test.ts:292` — keep the explicit
|
|
28
|
+
* `["Other", other, next]` literal so consumers using
|
|
29
|
+
* `RESERVED_LABELS[i]` indexing or `Set` membership see no behavior change.
|
|
30
|
+
*/
|
|
31
|
+
export const RESERVED_LABELS = ["Other", ROW_INTENT_META.other.label, ROW_INTENT_META.next.label];
|
|
32
|
+
export const OptionSchema = Type.Object({
|
|
33
|
+
label: Type.String({
|
|
34
|
+
maxLength: MAX_LABEL_LENGTH,
|
|
35
|
+
description: `MAX ${MAX_LABEL_LENGTH} CHARACTERS — hard limit, requests over the limit are rejected. The display text for this option that the user will see and select. Should be concise (1-5 words) and clearly describe the choice.`,
|
|
36
|
+
}),
|
|
37
|
+
description: Type.String({
|
|
38
|
+
description: "Explanation of what this option means or what will happen if chosen. Useful for providing context about trade-offs or implications.",
|
|
39
|
+
}),
|
|
40
|
+
preview: Type.Optional(Type.String({
|
|
41
|
+
description: "Optional preview content rendered when this option is focused. Use for mockups, code snippets, or visual comparisons that help users compare options. See the tool description for the expected content format.",
|
|
42
|
+
})),
|
|
43
|
+
});
|
|
44
|
+
export const QuestionSchema = Type.Object({
|
|
45
|
+
question: Type.String({
|
|
46
|
+
description: 'The complete question to ask the user. Should be clear, specific, and end with a question mark. Example: "Which library should we use for date formatting?" If multiSelect is true, phrase it accordingly, e.g. "Which features do you want to enable?"',
|
|
47
|
+
}),
|
|
48
|
+
header: Type.String({
|
|
49
|
+
maxLength: MAX_HEADER_LENGTH,
|
|
50
|
+
description: `MAX ${MAX_HEADER_LENGTH} CHARACTERS — hard limit, requests over the limit are rejected. Very short chip/tag shown next to the question. Examples: "Auth method", "Library", "Approach".`,
|
|
51
|
+
}),
|
|
52
|
+
options: Type.Array(OptionSchema, {
|
|
53
|
+
minItems: MIN_OPTIONS,
|
|
54
|
+
maxItems: MAX_OPTIONS,
|
|
55
|
+
description: "The available choices for this question. Must have 2-4 options. Each option should be a distinct, mutually exclusive choice (unless multiSelect is enabled). The 'Type something.' row is appended automatically — do NOT author it.",
|
|
56
|
+
}),
|
|
57
|
+
multiSelect: Type.Optional(Type.Boolean({
|
|
58
|
+
default: false,
|
|
59
|
+
description: "Set to true to allow the user to select multiple options instead of just one. Use when choices are not mutually exclusive.",
|
|
60
|
+
})),
|
|
61
|
+
});
|
|
62
|
+
export const QuestionsSchema = Type.Array(QuestionSchema, {
|
|
63
|
+
minItems: 1,
|
|
64
|
+
maxItems: MAX_QUESTIONS,
|
|
65
|
+
description: "Questions to ask the user (1-4 questions)",
|
|
66
|
+
});
|
|
67
|
+
export const QuestionParamsSchema = Type.Object({
|
|
68
|
+
questions: QuestionsSchema,
|
|
69
|
+
});
|
|
70
|
+
export function isQuestionnaireResult(value) {
|
|
71
|
+
if (!value || typeof value !== "object")
|
|
72
|
+
return false;
|
|
73
|
+
const v = value;
|
|
74
|
+
return Array.isArray(v.answers) && typeof v.cancelled === "boolean";
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../src/humain/ask-user-question/vendor/ask/tool/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,IAAI,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzE,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC;AAC/B,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC;AAC7B,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC;AAC7B,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,CAAC;AACpC,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAEnC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,cAAc,CAAC;AAK9C;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,eAAe,CAAC,KAAK,CAAC,KAAK,EAAE,eAAe,CAAC,IAAI,CAAC,KAAK,CAAU,CAAC;AAG3G,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC;IACvC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC;QAClB,SAAS,EAAE,gBAAgB;QAC3B,WAAW,EAAE,OAAO,gBAAgB,oMAAoM;KACxO,CAAC;IACF,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC;QACxB,WAAW,EACV,qIAAqI;KACtI,CAAC;IACF,OAAO,EAAE,IAAI,CAAC,QAAQ,CACrB,IAAI,CAAC,MAAM,CAAC;QACX,WAAW,EACV,iNAAiN;KAClN,CAAC,CACF;CACD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC,MAAM,CAAC;IACzC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC;QACrB,WAAW,EACV,yPAAyP;KAC1P,CAAC;IACF,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;QACnB,SAAS,EAAE,iBAAiB;QAC5B,WAAW,EAAE,OAAO,iBAAiB,iKAAiK;KACtM,CAAC;IACF,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE;QACjC,QAAQ,EAAE,WAAW;QACrB,QAAQ,EAAE,WAAW;QACrB,WAAW,EACV,sOAAsO;KACvO,CAAC;IACF,WAAW,EAAE,IAAI,CAAC,QAAQ,CACzB,IAAI,CAAC,OAAO,CAAC;QACZ,OAAO,EAAE,KAAK;QACd,WAAW,EACV,4HAA4H;KAC7H,CAAC,CACF;CACD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE;IACzD,QAAQ,EAAE,CAAC;IACX,QAAQ,EAAE,aAAa;IACvB,WAAW,EAAE,2CAA2C;CACxD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC,MAAM,CAAC;IAC/C,SAAS,EAAE,eAAe;CAC1B,CAAC,CAAC;AAsEH,MAAM,UAAU,qBAAqB,CAAC,KAAc;IACnD,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IACtD,MAAM,CAAC,GAAG,KAAgC,CAAC;IAC3C,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC;AACrE,CAAC","sourcesContent":["import { type Static, Type } from \"typebox\";\nimport { LABELS_BY_KIND, ROW_INTENT_META } from \"../state/row-intent.ts\";\n\nexport const MAX_QUESTIONS = 4;\nexport const MIN_OPTIONS = 2;\nexport const MAX_OPTIONS = 4;\nexport const MAX_HEADER_LENGTH = 16;\nexport const MAX_LABEL_LENGTH = 60;\n\n/**\n * User-facing labels for the three runtime sentinel rows, keyed by their\n * `WrappingSelectItem.kind` discriminator. Sourced from\n * `ROW_INTENT_META` via `LABELS_BY_KIND` (`row-intent.ts`) — single source of\n * truth. Adding a new sentinel requires extending the `WrappingSelectItem`\n * union AND adding an entry to `ROW_INTENT_META`; this map then auto-extends.\n */\nexport const SENTINEL_LABELS = LABELS_BY_KIND;\n\nexport type SentinelKind = keyof typeof SENTINEL_LABELS;\nexport type SentinelLabel = (typeof SENTINEL_LABELS)[SentinelKind];\n\n/**\n * Labels reserved for Pi-internal sentinels — authoring an option with any\n * of these labels triggers the `reserved_label` runtime guard. Two of the\n * three come from `ROW_INTENT_META` (the runtime kinds); `\"Other\"` is\n * reserved for CC parity only (the model is conditioned to reach for\n * \"Other\" in CC; we reject it so the runtime sentinel is the single source\n * of truth) and has no runtime kind.\n *\n * Reserved unconditionally — every question mode rejects these labels, even\n * when a given runtime sentinel is not appended in that mode.\n *\n * Order is pinned by `types.test.ts:292` — keep the explicit\n * `[\"Other\", other, next]` literal so consumers using\n * `RESERVED_LABELS[i]` indexing or `Set` membership see no behavior change.\n */\nexport const RESERVED_LABELS = [\"Other\", ROW_INTENT_META.other.label, ROW_INTENT_META.next.label] as const;\nexport type ReservedLabel = (typeof RESERVED_LABELS)[number];\n\nexport const OptionSchema = Type.Object({\n\tlabel: Type.String({\n\t\tmaxLength: MAX_LABEL_LENGTH,\n\t\tdescription: `MAX ${MAX_LABEL_LENGTH} CHARACTERS — hard limit, requests over the limit are rejected. The display text for this option that the user will see and select. Should be concise (1-5 words) and clearly describe the choice.`,\n\t}),\n\tdescription: Type.String({\n\t\tdescription:\n\t\t\t\"Explanation of what this option means or what will happen if chosen. Useful for providing context about trade-offs or implications.\",\n\t}),\n\tpreview: Type.Optional(\n\t\tType.String({\n\t\t\tdescription:\n\t\t\t\t\"Optional preview content rendered when this option is focused. Use for mockups, code snippets, or visual comparisons that help users compare options. See the tool description for the expected content format.\",\n\t\t}),\n\t),\n});\n\nexport const QuestionSchema = Type.Object({\n\tquestion: Type.String({\n\t\tdescription:\n\t\t\t'The complete question to ask the user. Should be clear, specific, and end with a question mark. Example: \"Which library should we use for date formatting?\" If multiSelect is true, phrase it accordingly, e.g. \"Which features do you want to enable?\"',\n\t}),\n\theader: Type.String({\n\t\tmaxLength: MAX_HEADER_LENGTH,\n\t\tdescription: `MAX ${MAX_HEADER_LENGTH} CHARACTERS — hard limit, requests over the limit are rejected. Very short chip/tag shown next to the question. Examples: \"Auth method\", \"Library\", \"Approach\".`,\n\t}),\n\toptions: Type.Array(OptionSchema, {\n\t\tminItems: MIN_OPTIONS,\n\t\tmaxItems: MAX_OPTIONS,\n\t\tdescription:\n\t\t\t\"The available choices for this question. Must have 2-4 options. Each option should be a distinct, mutually exclusive choice (unless multiSelect is enabled). The 'Type something.' row is appended automatically — do NOT author it.\",\n\t}),\n\tmultiSelect: Type.Optional(\n\t\tType.Boolean({\n\t\t\tdefault: false,\n\t\t\tdescription:\n\t\t\t\t\"Set to true to allow the user to select multiple options instead of just one. Use when choices are not mutually exclusive.\",\n\t\t}),\n\t),\n});\n\nexport const QuestionsSchema = Type.Array(QuestionSchema, {\n\tminItems: 1,\n\tmaxItems: MAX_QUESTIONS,\n\tdescription: \"Questions to ask the user (1-4 questions)\",\n});\n\nexport const QuestionParamsSchema = Type.Object({\n\tquestions: QuestionsSchema,\n});\n\nexport type OptionData = Static<typeof OptionSchema>;\nexport type QuestionData = Static<typeof QuestionSchema>;\nexport type QuestionParams = Static<typeof QuestionParamsSchema>;\n\n/**\n * Answer-intent discriminated union. `kind` is the single discriminator —\n * pre-1.0.3 boolean flags have been removed (see `banned-flags.test.ts`).\n * Mirrors the row-side `WrappingSelectItem.kind` vocabulary where possible;\n * `multi` is the multi-select variant (no row-side analog).\n *\n * Variant semantics:\n * - `option`: user picked one of the author-defined options. `answer` is the option's label.\n * - `custom`: user typed free-text on a single-select question. `answer` is the typed text or null.\n * - `multi`: user committed a multi-select question. `selected` carries chosen labels and `answer`\n * carries optional custom text.\n */\nexport interface QuestionAnswer {\n\tquestionIndex: number;\n\tquestion: string;\n\tkind: \"option\" | \"custom\" | \"multi\";\n\tanswer: string | null;\n\tselected?: string[];\n\tnotes?: string;\n\t/**\n\t * Markdown text from the matched option's `preview` field, populated only\n\t * when the user lands on a single-select option carrying a `preview`.\n\t * Used by `buildQuestionnaireResponse` to echo `selected preview: <preview>`\n\t * into the LLM-facing envelope. Undefined for multi-select and custom-text\n\t * (`kind: \"custom\"`) answers.\n\t */\n\tpreview?: string;\n}\n\nexport type QuestionnaireError =\n\t| \"no_ui\"\n\t| \"no_custom_ui\"\n\t| \"no_questions\"\n\t| \"empty_options\"\n\t| \"too_many_questions\"\n\t| \"duplicate_question\"\n\t| \"duplicate_option_label\"\n\t| \"reserved_label\"\n\t| \"session_load_failed\"\n\t| \"stale_module_cache\";\n\nexport interface QuestionnaireResult {\n\tanswers: QuestionAnswer[];\n\tcancelled: boolean;\n\t/**\n\t * Global note authored on the Submit tab: `n` opens the shared notes editor there,\n\t * and the committed text lives at the `notesByTab[questions.length]` pseudo-index\n\t * (a slot no question tab can occupy) until `doneFor` lifts it onto the result —\n\t * attached on both submit and cancel, like per-question `answers[].notes`.\n\t * Conditional-spread contract, mirroring `QuestionAnswer.notes`: the key appears\n\t * only via conditional spread of a non-empty string — never assigned `undefined`,\n\t * never kept for an empty/whitespace-only draft — so note-free results stay\n\t * byte-identical (`!(\"globalNote\" in result)` holds).\n\t */\n\tglobalNote?: string;\n\t/**\n\t * Indexes of the questions left blank on a partial submit (#291), set only by the\n\t * envelope builder on an answered result — never present when every question is\n\t * answered or the result is a decline, so those stay byte-identical.\n\t */\n\tunanswered?: number[];\n\terror?: QuestionnaireError;\n}\n\nexport function isQuestionnaireResult(value: unknown): value is QuestionnaireResult {\n\tif (!value || typeof value !== \"object\") return false;\n\tconst v = value as Record<string, unknown>;\n\treturn Array.isArray(v.answers) && typeof v.cancelled === \"boolean\";\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type QuestionnaireError, type QuestionParams } from "./types.ts";
|
|
2
|
+
export declare const ERROR_NO_QUESTIONS = "Error: At least one question is required";
|
|
3
|
+
export declare const ERROR_TOO_MANY_QUESTIONS = "Error: At most 4 questions are allowed per invocation";
|
|
4
|
+
export declare const ERROR_DUPLICATE_QUESTION = "Error: Question text must be unique within an invocation";
|
|
5
|
+
export declare const ERROR_TOO_FEW_OPTIONS = "Error: Each question requires at least 2 options";
|
|
6
|
+
export declare const ERROR_RESERVED_LABEL: string;
|
|
7
|
+
export declare const ERROR_DUPLICATE_OPTION_LABEL = "Error: Option labels must be unique within a question";
|
|
8
|
+
export type ValidationResult = {
|
|
9
|
+
ok: true;
|
|
10
|
+
} | {
|
|
11
|
+
ok: false;
|
|
12
|
+
error: QuestionnaireError;
|
|
13
|
+
message: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Pure runtime validator for `QuestionParams`. Covers every guard except
|
|
17
|
+
* `no_ui` (which depends on `ctx.hasUI` and stays inline at the call site).
|
|
18
|
+
* `reserved_label` MUST short-circuit before `duplicate_option_label`.
|
|
19
|
+
*/
|
|
20
|
+
export declare function validateQuestionnaire(typed: QuestionParams): ValidationResult;
|
|
21
|
+
//# sourceMappingURL=validate-questionnaire.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-questionnaire.d.ts","sourceRoot":"","sources":["../../../../../../src/humain/ask-user-question/vendor/ask/tool/validate-questionnaire.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,KAAK,kBAAkB,EAAE,KAAK,cAAc,EAAmB,MAAM,YAAY,CAAC;AAEvH,eAAO,MAAM,kBAAkB,6CAA6C,CAAC;AAC7E,eAAO,MAAM,wBAAwB,0DAAyE,CAAC;AAC/G,eAAO,MAAM,wBAAwB,6DAA6D,CAAC;AACnG,eAAO,MAAM,qBAAqB,qDAAkE,CAAC;AACrG,eAAO,MAAM,oBAAoB,QAAoE,CAAC;AACtG,eAAO,MAAM,4BAA4B,0DAA0D,CAAC;AAIpG,MAAM,MAAM,gBAAgB,GAAG;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,kBAAkB,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAExG;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,cAAc,GAAG,gBAAgB,CAqC7E"}
|