@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
|
@@ -7,33 +7,64 @@ const scopes = new AsyncLocalStorage();
|
|
|
7
7
|
/** Run a final check with optional OS-enforced immutability; unavailable backends retain normal invalidation. */
|
|
8
8
|
export async function withReadOnlyAcceptanceCommand(id, command, cwd, signal, run) {
|
|
9
9
|
const filter = socketFilter();
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
const available = !!filter && (await sandboxAvailable(filter, signal));
|
|
11
|
+
const reason = process.platform !== "linux"
|
|
12
|
+
? "unsupported-platform"
|
|
13
|
+
: !filter
|
|
14
|
+
? "unsupported-architecture"
|
|
15
|
+
: !available
|
|
16
|
+
? "backend-unavailable"
|
|
17
|
+
: "execution-unconfirmed";
|
|
18
|
+
return scopes.run({ id, command, cwd, executions: 0, completed: false, available, reason }, run);
|
|
13
19
|
}
|
|
14
20
|
/** Only the exact local execution, not tool names or result metadata, can issue a receipt. */
|
|
15
21
|
export function acceptanceCommandIsReadOnly(id) {
|
|
16
22
|
const scope = scopes.getStore();
|
|
17
23
|
return scope?.id === id && scope.executions === 1 && scope.completed;
|
|
18
24
|
}
|
|
25
|
+
/** Return a typed failure reason only within the matching final-check scope. */
|
|
26
|
+
export function acceptanceCommandIsolationReason(id) {
|
|
27
|
+
const scope = scopes.getStore();
|
|
28
|
+
return scope?.id === id && !acceptanceCommandIsReadOnly(id) ? scope.reason : undefined;
|
|
29
|
+
}
|
|
19
30
|
/** Adapt a matching local shell spawn without changing its command bytes or trusting custom tool output. */
|
|
20
31
|
export function readOnlyAcceptanceSpawn(command, cwd, shell, env) {
|
|
21
32
|
const scope = scopes.getStore();
|
|
22
|
-
if (!scope || scope.command !== command || scope.cwd !== cwd || hasLoaderOverrides(env))
|
|
33
|
+
if (!scope?.available || scope.command !== command || scope.cwd !== cwd || hasLoaderOverrides(env))
|
|
23
34
|
return undefined;
|
|
24
35
|
scope.executions++;
|
|
25
36
|
return {
|
|
26
37
|
shell: "/usr/bin/bwrap",
|
|
27
|
-
args: [...sandboxArgs(), "--", shell.shell, ...shell.args],
|
|
38
|
+
args: [...sandboxArgs(), "--json-status-fd", "4", "--", shell.shell, ...shell.args],
|
|
28
39
|
commandTransport: shell.commandTransport,
|
|
29
40
|
filter: socketFilter(),
|
|
30
|
-
completed: () => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
41
|
+
completed: (exitCode, metadata) => {
|
|
42
|
+
// bwrap's monitor closes this FD in the sandbox child. Its exit document is emitted only
|
|
43
|
+
// after successful exec, unlike its own exit status or any untrusted stdout/stderr bytes.
|
|
44
|
+
// The shell's reserved cannot-execute/not-found statuses do not prove the requested program ran.
|
|
45
|
+
if (metadata === undefined || exitCode >= 126)
|
|
46
|
+
return;
|
|
47
|
+
try {
|
|
48
|
+
const documents = metadata
|
|
49
|
+
.trim()
|
|
50
|
+
.split("\n")
|
|
51
|
+
.map((line) => JSON.parse(line));
|
|
52
|
+
const [start, finish] = documents;
|
|
53
|
+
if (documents.length === 2 &&
|
|
54
|
+
start !== null &&
|
|
55
|
+
typeof start === "object" &&
|
|
56
|
+
"child-pid" in start &&
|
|
57
|
+
Number.isSafeInteger(start["child-pid"]) &&
|
|
58
|
+
Number(start["child-pid"]) > 0 &&
|
|
59
|
+
finish !== null &&
|
|
60
|
+
typeof finish === "object" &&
|
|
61
|
+
"exit-code" in finish &&
|
|
62
|
+
finish["exit-code"] === exitCode)
|
|
63
|
+
scope.completed = true;
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
// Missing, malformed or incompatible backend metadata is not execution evidence.
|
|
67
|
+
}
|
|
37
68
|
},
|
|
38
69
|
};
|
|
39
70
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acceptance-command.js","sourceRoot":"","sources":["../../src/core/acceptance-command.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EACN,oBAAoB,EAEpB,qBAAqB,EACrB,uBAAuB,GACvB,MAAM,mBAAmB,CAAC;AAU3B,MAAM,MAAM,GAAG,IAAI,iBAAiB,EAAgB,CAAC;AAErD,iHAAiH;AACjH,MAAM,CAAC,KAAK,UAAU,6BAA6B,CAClD,EAAU,EACV,OAAe,EACf,GAAW,EACX,MAAmB,EACnB,GAAqB;IAErB,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;IAC9B,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAAE,OAAO,GAAG,EAAE,CAAC;IACvE,OAAO,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,GAAG,CAAC,CAAC;AAC/E,CAAC;AAED,8FAA8F;AAC9F,MAAM,UAAU,2BAA2B,CAAC,EAAU;IACrD,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;IAChC,OAAO,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,KAAK,CAAC,UAAU,KAAK,CAAC,IAAI,KAAK,CAAC,SAAS,CAAC;AACtE,CAAC;AAED,4GAA4G;AAC5G,MAAM,UAAU,uBAAuB,CAAC,OAAe,EAAE,GAAW,EAAE,KAAkB,EAAE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C,CAAC;IACvD,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC7B,IAAI,KAAK,IAAI,KAAK,IAAI,KAAK,EAAE,CAAC;QAC7B,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QAC5B,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACnB,CAAC;IACD,IAAI,SAAS,GAAG,KAAK,CAAC;IACtB,IAAI,CAAC;QACJ,SAAS,GAAG,CAAC,MAAM,mBAAmB,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC;IACtD,CAAC;IAAC,MAAM,CAAC;QACR,qFAAqF;IACtF,CAAC;YAAS,CAAC;QACV,IAAI,KAAK,CAAC,GAAG,EAAE,CAAC;YACf,SAAS,GAAG,CAAC,MAAM,oBAAoB,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,IAAI,SAAS,CAAC;YAC3E,uBAAuB,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC3C,CAAC;IACF,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC","sourcesContent":["// Host-only read-only execution receipts for final acceptance commands.\nimport { AsyncLocalStorage } from \"node:async_hooks\";\nimport { spawn } from \"node:child_process\";\nimport { waitForChildProcess } from \"../utils/child-process.ts\";\nimport {\n\tkillProcessTreeAsync,\n\ttype ShellConfig,\n\ttrackDetachedChildPid,\n\tuntrackDetachedChildPid,\n} from \"../utils/shell.ts\";\n\ninterface CommandScope {\n\tid: string;\n\tcommand: string;\n\tcwd: string;\n\texecutions: number;\n\tcompleted: boolean;\n}\n\nconst scopes = new AsyncLocalStorage<CommandScope>();\n\n/** Run a final check with optional OS-enforced immutability; unavailable backends retain normal invalidation. */\nexport async function withReadOnlyAcceptanceCommand<T>(\n\tid: string,\n\tcommand: string,\n\tcwd: string,\n\tsignal: AbortSignal,\n\trun: () => Promise<T>,\n): Promise<T> {\n\tconst filter = socketFilter();\n\tif (!filter || !(await sandboxAvailable(filter, signal))) return run();\n\treturn scopes.run({ id, command, cwd, executions: 0, completed: false }, run);\n}\n\n/** Only the exact local execution, not tool names or result metadata, can issue a receipt. */\nexport function acceptanceCommandIsReadOnly(id: string): boolean {\n\tconst scope = scopes.getStore();\n\treturn scope?.id === id && scope.executions === 1 && scope.completed;\n}\n\n/** Adapt a matching local shell spawn without changing its command bytes or trusting custom tool output. */\nexport function readOnlyAcceptanceSpawn(command: string, cwd: string, shell: ShellConfig, env: NodeJS.ProcessEnv) {\n\tconst scope = scopes.getStore();\n\tif (!scope || scope.command !== command || scope.cwd !== cwd || hasLoaderOverrides(env)) return undefined;\n\tscope.executions++;\n\treturn {\n\t\tshell: \"/usr/bin/bwrap\",\n\t\targs: [...sandboxArgs(), \"--\", shell.shell, ...shell.args],\n\t\tcommandTransport: shell.commandTransport,\n\t\tfilter: socketFilter()!,\n\t\tcompleted: () => {\n\t\t\tscope.completed = true;\n\t\t},\n\t\tretry: <T>(run: () => Promise<T>): Promise<T> => {\n\t\t\t// Retrying outside isolation may mutate any earlier input; this scope can never attest it.\n\t\t\tscope.executions++;\n\t\t\treturn scopes.exit(run);\n\t\t},\n\t};\n}\n\nfunction sandboxArgs(): string[] {\n\t// A read-only mount alone still exposes Unix sockets. Seccomp denies creation of sockets and io_uring;\n\t// private PID/IPC/network namespaces, fresh devices and dropped caps close the other host-write paths.\n\treturn [\n\t\t\"--unshare-all\",\n\t\t\"--unshare-user\",\n\t\t\"--disable-userns\",\n\t\t\"--cap-drop\",\n\t\t\"ALL\",\n\t\t\"--ro-bind\",\n\t\t\"/\",\n\t\t\"/\",\n\t\t\"--proc\",\n\t\t\"/proc\",\n\t\t\"--dev\",\n\t\t\"/dev\",\n\t\t\"--die-with-parent\",\n\t\t\"--new-session\",\n\t\t\"--seccomp\",\n\t\t\"3\",\n\t];\n}\n\nfunction socketFilter(): Buffer | undefined {\n\tif (process.platform !== \"linux\" || ![\"x64\", \"arm64\"].includes(process.arch)) return undefined;\n\tconst arch = process.arch === \"x64\" ? 0xc000003e : 0xc00000b7;\n\tconst denied =\n\t\tprocess.arch === \"x64\"\n\t\t\t? [41, 42, 44, 46, 85, 248, 249, 250, 303, 307]\n\t\t\t: [198, 203, 206, 211, 217, 218, 219, 265, 269];\n\tconst opens =\n\t\tprocess.arch === \"x64\"\n\t\t\t? [\n\t\t\t\t\t[2, 1],\n\t\t\t\t\t[257, 2],\n\t\t\t\t]\n\t\t\t: [[56, 2]];\n\t// Classic BPF over seccomp_data: reject other ABIs (including x32), network, device ioctl,\n\t// host keyring mutation, and interfaces whose pointer arguments cannot be checked (openat2/io_uring).\n\t// socketpair remains available for Node test-runner IPC, but cannot reconnect/send to a host Unix socket.\n\tconst instructions = [\n\t\t[0x20, 0, 0, 4],\n\t\t[0x15, 1, 0, arch],\n\t\t[0x06, 0, 0, 0x80000000],\n\t\t[0x20, 0, 0, 0],\n\t\t[0x35, 0, 1, 0x40000000],\n\t\t[0x06, 0, 0, 0x80000000],\n\t\t// libuv needs FIONBIO on its stdio pipes; no device-control ioctl receives permission.\n\t\t[0x15, 0, 4, process.arch === \"x64\" ? 16 : 29],\n\t\t[0x20, 0, 0, 24],\n\t\t[0x15, 1, 0, 0x5421],\n\t\t[0x06, 0, 0, 0x00050001],\n\t\t[0x06, 0, 0, 0x7fff0000],\n\t\t// Read-only mounts do not stop writes to existing FIFOs/devices. Reject writable opens too.\n\t\t...opens.flatMap(([syscall, flagsArgument]) => [\n\t\t\t[0x15, 0, 4, syscall],\n\t\t\t[0x20, 0, 0, 16 + flagsArgument * 8],\n\t\t\t[0x45, 0, 1, 3 | 64 | 512 | 1024],\n\t\t\t[0x06, 0, 0, 0x00050001],\n\t\t\t[0x20, 0, 0, 0],\n\t\t]),\n\t\t...[...denied, 425, 426, 427, 437].flatMap((syscall) => [\n\t\t\t[0x15, 0, 1, syscall],\n\t\t\t[0x06, 0, 0, 0x00050001],\n\t\t]),\n\t\t[0x06, 0, 0, 0x7fff0000],\n\t];\n\tconst buffer = Buffer.alloc(instructions.length * 8);\n\tfor (const [index, instruction] of instructions.entries()) {\n\t\tbuffer.writeUInt16LE(instruction[0], index * 8);\n\t\tbuffer[index * 8 + 2] = instruction[1];\n\t\tbuffer[index * 8 + 3] = instruction[2];\n\t\tbuffer.writeUInt32LE(instruction[3], index * 8 + 4);\n\t}\n\treturn buffer;\n}\n\nfunction hasLoaderOverrides(env: NodeJS.ProcessEnv): boolean {\n\t// The loader runs before bwrap installs isolation; never attest execution with injected loader code.\n\treturn Object.keys(env).some((name) => /^(?:LD_|GLIBC_TUNABLES$)/.test(name) && env[name] !== undefined);\n}\n\nasync function sandboxAvailable(filter: Buffer, signal: AbortSignal): Promise<boolean> {\n\t// Probe the actual kernel/backend, not just a PATH entry. No installation or permissive fallback receipt.\n\tif (signal.aborted || hasLoaderOverrides(process.env)) return false;\n\tconst child = spawn(\"/usr/bin/bwrap\", [...sandboxArgs(), \"--\", \"/bin/true\"], {\n\t\tstdio: [\"ignore\", \"ignore\", \"ignore\", \"pipe\"],\n\t\tdetached: true,\n\t\tsignal: AbortSignal.any([signal, AbortSignal.timeout(2000)]),\n\t\tkillSignal: \"SIGKILL\",\n\t});\n\tif (child.pid) trackDetachedChildPid(child.pid, child);\n\tconst input = child.stdio[3];\n\tif (input && \"end\" in input) {\n\t\tinput.on(\"error\", () => {});\n\t\tinput.end(filter);\n\t}\n\tlet available = false;\n\ttry {\n\t\tavailable = (await waitForChildProcess(child)) === 0;\n\t} catch {\n\t\t// Missing backend, aborted admission, or rejected namespaces cannot issue a receipt.\n\t} finally {\n\t\tif (child.pid) {\n\t\t\tavailable = (await killProcessTreeAsync(child.pid, 0, child)) && available;\n\t\t\tuntrackDetachedChildPid(child.pid, child);\n\t\t}\n\t}\n\treturn available;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"acceptance-command.js","sourceRoot":"","sources":["../../src/core/acceptance-command.ts"],"names":[],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EAAE,GAAE,CAAC,CAAC,CAAC;QAC5B,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACnB,CAAC;IACD,IAAI,SAAS,GAAG,KAAK,CAAC;IACtB,IAAI,CAAC;QACJ,SAAS,GAAG,CAAC,MAAM,mBAAmB,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC;IACtD,CAAC;IAAC,MAAM,CAAC;QACR,qFAAqF;IACtF,CAAC;YAAS,CAAC;QACV,IAAI,KAAK,CAAC,GAAG,EAAE,CAAC;YACf,SAAS,GAAG,CAAC,MAAM,oBAAoB,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,IAAI,SAAS,CAAC;YAC3E,uBAAuB,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC3C,CAAC;IACF,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC","sourcesContent":["// Host-only read-only execution receipts for final acceptance commands.\nimport { AsyncLocalStorage } from \"node:async_hooks\";\nimport { spawn } from \"node:child_process\";\nimport { waitForChildProcess } from \"../utils/child-process.ts\";\nimport {\n\tkillProcessTreeAsync,\n\ttype ShellConfig,\n\ttrackDetachedChildPid,\n\tuntrackDetachedChildPid,\n} from \"../utils/shell.ts\";\n\n/** Why a final acceptance execution could not obtain an OS-isolation receipt. */\nexport type AcceptanceIsolationReason =\n\t| \"unsupported-platform\"\n\t| \"unsupported-architecture\"\n\t| \"backend-unavailable\"\n\t| \"execution-unconfirmed\";\n\ninterface CommandScope {\n\tid: string;\n\tcommand: string;\n\tcwd: string;\n\texecutions: number;\n\tcompleted: boolean;\n\tavailable: boolean;\n\treason: AcceptanceIsolationReason;\n}\n\nconst scopes = new AsyncLocalStorage<CommandScope>();\n\n/** Run a final check with optional OS-enforced immutability; unavailable backends retain normal invalidation. */\nexport async function withReadOnlyAcceptanceCommand<T>(\n\tid: string,\n\tcommand: string,\n\tcwd: string,\n\tsignal: AbortSignal,\n\trun: () => Promise<T>,\n): Promise<T> {\n\tconst filter = socketFilter();\n\tconst available = !!filter && (await sandboxAvailable(filter, signal));\n\tconst reason: AcceptanceIsolationReason =\n\t\tprocess.platform !== \"linux\"\n\t\t\t? \"unsupported-platform\"\n\t\t\t: !filter\n\t\t\t\t? \"unsupported-architecture\"\n\t\t\t\t: !available\n\t\t\t\t\t? \"backend-unavailable\"\n\t\t\t\t\t: \"execution-unconfirmed\";\n\treturn scopes.run({ id, command, cwd, executions: 0, completed: false, available, reason }, run);\n}\n\n/** Only the exact local execution, not tool names or result metadata, can issue a receipt. */\nexport function acceptanceCommandIsReadOnly(id: string): boolean {\n\tconst scope = scopes.getStore();\n\treturn scope?.id === id && scope.executions === 1 && scope.completed;\n}\n\n/** Return a typed failure reason only within the matching final-check scope. */\nexport function acceptanceCommandIsolationReason(id: string): AcceptanceIsolationReason | undefined {\n\tconst scope = scopes.getStore();\n\treturn scope?.id === id && !acceptanceCommandIsReadOnly(id) ? scope.reason : undefined;\n}\n\n/** Adapt a matching local shell spawn without changing its command bytes or trusting custom tool output. */\nexport function readOnlyAcceptanceSpawn(command: string, cwd: string, shell: ShellConfig, env: NodeJS.ProcessEnv) {\n\tconst scope = scopes.getStore();\n\tif (!scope?.available || scope.command !== command || scope.cwd !== cwd || hasLoaderOverrides(env)) return undefined;\n\tscope.executions++;\n\treturn {\n\t\tshell: \"/usr/bin/bwrap\",\n\t\targs: [...sandboxArgs(), \"--json-status-fd\", \"4\", \"--\", shell.shell, ...shell.args],\n\t\tcommandTransport: shell.commandTransport,\n\t\tfilter: socketFilter()!,\n\t\tcompleted: (exitCode: number, metadata: string | undefined) => {\n\t\t\t// bwrap's monitor closes this FD in the sandbox child. Its exit document is emitted only\n\t\t\t// after successful exec, unlike its own exit status or any untrusted stdout/stderr bytes.\n\t\t\t// The shell's reserved cannot-execute/not-found statuses do not prove the requested program ran.\n\t\t\tif (metadata === undefined || exitCode >= 126) return;\n\t\t\ttry {\n\t\t\t\tconst documents: unknown[] = metadata\n\t\t\t\t\t.trim()\n\t\t\t\t\t.split(\"\\n\")\n\t\t\t\t\t.map((line) => JSON.parse(line));\n\t\t\t\tconst [start, finish] = documents;\n\t\t\t\tif (\n\t\t\t\t\tdocuments.length === 2 &&\n\t\t\t\t\tstart !== null &&\n\t\t\t\t\ttypeof start === \"object\" &&\n\t\t\t\t\t\"child-pid\" in start &&\n\t\t\t\t\tNumber.isSafeInteger(start[\"child-pid\"]) &&\n\t\t\t\t\tNumber(start[\"child-pid\"]) > 0 &&\n\t\t\t\t\tfinish !== null &&\n\t\t\t\t\ttypeof finish === \"object\" &&\n\t\t\t\t\t\"exit-code\" in finish &&\n\t\t\t\t\tfinish[\"exit-code\"] === exitCode\n\t\t\t\t)\n\t\t\t\t\tscope.completed = true;\n\t\t\t} catch {\n\t\t\t\t// Missing, malformed or incompatible backend metadata is not execution evidence.\n\t\t\t}\n\t\t},\n\t};\n}\n\nfunction sandboxArgs(): string[] {\n\t// A read-only mount alone still exposes Unix sockets. Seccomp denies creation of sockets and io_uring;\n\t// private PID/IPC/network namespaces, fresh devices and dropped caps close the other host-write paths.\n\treturn [\n\t\t\"--unshare-all\",\n\t\t\"--unshare-user\",\n\t\t\"--disable-userns\",\n\t\t\"--cap-drop\",\n\t\t\"ALL\",\n\t\t\"--ro-bind\",\n\t\t\"/\",\n\t\t\"/\",\n\t\t\"--proc\",\n\t\t\"/proc\",\n\t\t\"--dev\",\n\t\t\"/dev\",\n\t\t\"--die-with-parent\",\n\t\t\"--new-session\",\n\t\t\"--seccomp\",\n\t\t\"3\",\n\t];\n}\n\nfunction socketFilter(): Buffer | undefined {\n\tif (process.platform !== \"linux\" || ![\"x64\", \"arm64\"].includes(process.arch)) return undefined;\n\tconst arch = process.arch === \"x64\" ? 0xc000003e : 0xc00000b7;\n\tconst denied =\n\t\tprocess.arch === \"x64\"\n\t\t\t? [41, 42, 44, 46, 85, 248, 249, 250, 303, 307]\n\t\t\t: [198, 203, 206, 211, 217, 218, 219, 265, 269];\n\tconst opens =\n\t\tprocess.arch === \"x64\"\n\t\t\t? [\n\t\t\t\t\t[2, 1],\n\t\t\t\t\t[257, 2],\n\t\t\t\t]\n\t\t\t: [[56, 2]];\n\t// Classic BPF over seccomp_data: reject other ABIs (including x32), network, device ioctl,\n\t// host keyring mutation, and interfaces whose pointer arguments cannot be checked (openat2/io_uring).\n\t// socketpair remains available for Node test-runner IPC, but cannot reconnect/send to a host Unix socket.\n\tconst instructions = [\n\t\t[0x20, 0, 0, 4],\n\t\t[0x15, 1, 0, arch],\n\t\t[0x06, 0, 0, 0x80000000],\n\t\t[0x20, 0, 0, 0],\n\t\t[0x35, 0, 1, 0x40000000],\n\t\t[0x06, 0, 0, 0x80000000],\n\t\t// libuv needs FIONBIO on its stdio pipes; no device-control ioctl receives permission.\n\t\t[0x15, 0, 4, process.arch === \"x64\" ? 16 : 29],\n\t\t[0x20, 0, 0, 24],\n\t\t[0x15, 1, 0, 0x5421],\n\t\t[0x06, 0, 0, 0x00050001],\n\t\t[0x06, 0, 0, 0x7fff0000],\n\t\t// Read-only mounts do not stop writes to existing FIFOs/devices. Reject writable opens too.\n\t\t...opens.flatMap(([syscall, flagsArgument]) => [\n\t\t\t[0x15, 0, 4, syscall],\n\t\t\t[0x20, 0, 0, 16 + flagsArgument * 8],\n\t\t\t[0x45, 0, 1, 3 | 64 | 512 | 1024],\n\t\t\t[0x06, 0, 0, 0x00050001],\n\t\t\t[0x20, 0, 0, 0],\n\t\t]),\n\t\t...[...denied, 425, 426, 427, 437].flatMap((syscall) => [\n\t\t\t[0x15, 0, 1, syscall],\n\t\t\t[0x06, 0, 0, 0x00050001],\n\t\t]),\n\t\t[0x06, 0, 0, 0x7fff0000],\n\t];\n\tconst buffer = Buffer.alloc(instructions.length * 8);\n\tfor (const [index, instruction] of instructions.entries()) {\n\t\tbuffer.writeUInt16LE(instruction[0], index * 8);\n\t\tbuffer[index * 8 + 2] = instruction[1];\n\t\tbuffer[index * 8 + 3] = instruction[2];\n\t\tbuffer.writeUInt32LE(instruction[3], index * 8 + 4);\n\t}\n\treturn buffer;\n}\n\nfunction hasLoaderOverrides(env: NodeJS.ProcessEnv): boolean {\n\t// The loader runs before bwrap installs isolation; never attest execution with injected loader code.\n\treturn Object.keys(env).some((name) => /^(?:LD_|GLIBC_TUNABLES$)/.test(name) && env[name] !== undefined);\n}\n\nasync function sandboxAvailable(filter: Buffer, signal: AbortSignal): Promise<boolean> {\n\t// Probe the actual kernel/backend, not just a PATH entry. No installation or permissive fallback receipt.\n\tif (signal.aborted || hasLoaderOverrides(process.env)) return false;\n\tconst child = spawn(\"/usr/bin/bwrap\", [...sandboxArgs(), \"--\", \"/bin/true\"], {\n\t\tstdio: [\"ignore\", \"ignore\", \"ignore\", \"pipe\"],\n\t\tdetached: true,\n\t\tsignal: AbortSignal.any([signal, AbortSignal.timeout(2000)]),\n\t\tkillSignal: \"SIGKILL\",\n\t});\n\tif (child.pid) trackDetachedChildPid(child.pid, child);\n\tconst input = child.stdio[3];\n\tif (input && \"end\" in input) {\n\t\tinput.on(\"error\", () => {});\n\t\tinput.end(filter);\n\t}\n\tlet available = false;\n\ttry {\n\t\tavailable = (await waitForChildProcess(child)) === 0;\n\t} catch {\n\t\t// Missing backend, aborted admission, or rejected namespaces cannot issue a receipt.\n\t} finally {\n\t\tif (child.pid) {\n\t\t\tavailable = (await killProcessTreeAsync(child.pid, 0, child)) && available;\n\t\t\tuntrackDetachedChildPid(child.pid, child);\n\t\t}\n\t}\n\treturn available;\n}\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ToolResultObservation } from "@earendil-works/pi-agent-core";
|
|
2
|
+
import { type AcceptanceIsolationReason } from "./acceptance-command.ts";
|
|
2
3
|
export type AcceptanceCheck = {
|
|
3
4
|
kind: "command";
|
|
4
5
|
command: string;
|
|
@@ -19,6 +20,7 @@ export interface AcceptanceCriterion {
|
|
|
19
20
|
check: AcceptanceCheck;
|
|
20
21
|
status: "pending" | "checked" | "unmet" | "uncheckable";
|
|
21
22
|
evidence: string[];
|
|
23
|
+
isolationReason?: AcceptanceIsolationReason;
|
|
22
24
|
}
|
|
23
25
|
export interface AcceptanceSettlement {
|
|
24
26
|
type: "acceptance_settled";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acceptance-ledger.d.ts","sourceRoot":"","sources":["../../src/core/acceptance-ledger.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"acceptance-ledger.d.ts","sourceRoot":"","sources":["../../src/core/acceptance-ledger.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAE3E,OAAO,EACN,KAAK,yBAAyB,EAG9B,MAAM,yBAAyB,CAAC;AAEjC,MAAM,MAAM,eAAe,GACxB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACpC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GACjD;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAChC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzC,MAAM,WAAW,mBAAmB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,eAAe,CAAC;IACvB,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,aAAa,CAAC;IACxD,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,eAAe,CAAC,EAAE,yBAAyB,CAAC;CAC5C;AAED,MAAM,WAAW,oBAAoB;IACpC,IAAI,EAAE,oBAAoB,CAAC;IAC3B,UAAU,EAAE,UAAU,GAAG,SAAS,GAAG,YAAY,CAAC;IAClD,QAAQ,EAAE,mBAAmB,EAAE,CAAC;IAChC,MAAM,EAAE,MAAM,CAAC;CACf;AAED,oGAAoG;AACpG,qBAAa,gBAAgB;IAC5B,QAAQ,EAAE,mBAAmB,EAAE,CAAM;IACrC,OAAO,CAAC,QAAQ,CAAK;IACrB,OAAO,CAAC,iBAAiB,CAAQ;IACjC,OAAO,CAAC,kBAAkB,CAAQ;IAClC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAgB;IAChD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAqB;IAC/C,OAAO,CAAC,QAAQ,CAAC,KAAK,CASlB;IAEJ,YAAY,IAAI,EAAE,MAAM,EAAE,eAAe,GAAE,MAAM,OAAqB,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,EAG3F;IAED,6FAA6F;IAC7F,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,GAAE,MAAM,EAAO,GAAG,IAAI,CAmDpD;IAED,8EAA8E;IAC9E,IAAI,iBAAiB,IAAI,OAAO,CAO/B;IAED,6FAA6F;IAC7F,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,CAqB3D;IAED,+GAA+G;IAC/G,OAAO,CAAC,WAAW,EAAE,QAAQ,CAAC,qBAAqB,CAAC,GAAG,IAAI,CAwF1D;IAED,gGAAgG;IAChG,UAAU,IAAI,mBAAmB,EAAE,CAclC;IAED,wGAAwG;IACxG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,SAAS,GAAG,OAAO,GAAG,oBAAoB,CAmDvF;CACD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Marked } from "@earendil-works/pi-tui";
|
|
2
|
-
import { acceptanceCommandIsReadOnly } from "./acceptance-command.js";
|
|
2
|
+
import { acceptanceCommandIsolationReason, acceptanceCommandIsReadOnly, } from "./acceptance-command.js";
|
|
3
3
|
/** Keeps task scope separate from assistant claims and settles only criterion-specific evidence. */
|
|
4
4
|
export class AcceptanceLedger {
|
|
5
5
|
criteria = [];
|
|
@@ -154,6 +154,18 @@ export class AcceptanceLedger {
|
|
|
154
154
|
status = "unmet";
|
|
155
155
|
evidence += "; file does not exist";
|
|
156
156
|
}
|
|
157
|
+
if (check.kind === "command") {
|
|
158
|
+
// Launch-free builtins already have custody without OS isolation.
|
|
159
|
+
const reason = acceptanceCommandIsolationReason(observation.toolCallId);
|
|
160
|
+
criterion.isolationReason =
|
|
161
|
+
reason === "execution-unconfirmed" || status === "uncheckable" || this.hasOwnedEffects()
|
|
162
|
+
? reason
|
|
163
|
+
: undefined;
|
|
164
|
+
if (criterion.isolationReason) {
|
|
165
|
+
status = "uncheckable";
|
|
166
|
+
evidence += `; isolation unavailable: ${criterion.isolationReason}`;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
157
169
|
if (status === "uncheckable")
|
|
158
170
|
evidence += `; ${loss ? "incomplete evidence" : `${observation.source} result cannot establish the criterion`}`;
|
|
159
171
|
criterion.status = status;
|
|
@@ -164,9 +176,8 @@ export class AcceptanceLedger {
|
|
|
164
176
|
!this.hasOwnedEffects() &&
|
|
165
177
|
call.revision === this.revision &&
|
|
166
178
|
observation.source === "executed" &&
|
|
167
|
-
!observation.isError &&
|
|
168
179
|
!loss &&
|
|
169
|
-
structured.exit_code ===
|
|
180
|
+
typeof structured.exit_code === "number" &&
|
|
170
181
|
acceptanceCommandIsReadOnly(observation.toolCallId)) {
|
|
171
182
|
// Only an executor-issued OS-isolation receipt can undo invalidation; command text is never proof.
|
|
172
183
|
for (const { criterion, status } of call.priorCommands) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acceptance-ledger.js","sourceRoot":"","sources":["../../src/core/acceptance-ledger.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAc,MAAM,wBAAwB,CAAC;AAC5D,O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,CAAC,CAAC;IACnD,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AAC9D,CAAC;AAED,SAAS,MAAM,CAAC,KAAc;IAC7B,4FAA4F;IAC5F,OAAO,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAE,KAAiC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC9F,CAAC","sourcesContent":["// Task-derived acceptance and raw tool evidence for direct session settlement; no model calls.\nimport type { ToolResultObservation } from \"@earendil-works/pi-agent-core\";\nimport { Marked, type Token } from \"@earendil-works/pi-tui\";\nimport { acceptanceCommandIsReadOnly } from \"./acceptance-command.ts\";\n\nexport type AcceptanceCheck =\n\t| { kind: \"command\"; command: string }\n\t| { kind: \"file\"; path: string; contains?: string }\n\t| { kind: \"output\"; text: string }\n\t| { kind: \"manual\"; readback?: string };\n\nexport interface AcceptanceCriterion {\n\tid: string;\n\trequirement: string;\n\tcheck: AcceptanceCheck;\n\tstatus: \"pending\" | \"checked\" | \"unmet\" | \"uncheckable\";\n\tevidence: string[];\n}\n\nexport interface AcceptanceSettlement {\n\ttype: \"acceptance_settled\";\n\tcompletion: \"verified\" | \"partial\" | \"unverified\";\n\tcriteria: AcceptanceCriterion[];\n\treport: string;\n}\n\n/** Keeps task scope separate from assistant claims and settles only criterion-specific evidence. */\nexport class AcceptanceLedger {\n\tcriteria: AcceptanceCriterion[] = [];\n\tprivate revision = 0;\n\tprivate automaticCommands = true;\n\tprivate automaticReadbacks = true;\n\tprivate readonly hasOwnedEffects: () => boolean;\n\tprivate readonly mutations = new Set<string>();\n\tprivate readonly calls = new Map<\n\t\tstring,\n\t\t{\n\t\t\tname: string;\n\t\t\targs: Record<string, unknown>;\n\t\t\trevision: number;\n\t\t\toverlapsMutation: boolean;\n\t\t\tpriorCommands: Array<{ criterion: AcceptanceCriterion; status: \"checked\" | \"unmet\" }>;\n\t\t}\n\t>();\n\n\tconstructor(task: string, hasOwnedEffects: () => boolean = () => false, fileTexts?: string[]) {\n\t\tthis.hasOwnedEffects = hasOwnedEffects;\n\t\tthis.addTask(task, fileTexts);\n\t}\n\n\t/** Preserve prose requirements too: unsupported assertions remain explicitly uncheckable. */\n\taddTask(task: string, fileTexts: string[] = []): void {\n\t\t// Fail closed on task restrictions; do not guess exceptions for an automatic tool call.\n\t\tif (\n\t\t\t/\\b(?:do not|don't|never|must not|without|avoid|no)\\b[^\\n.!?]*\\b(?:run|running|execute|executing|execution|test|testing)\\b/i.test(\n\t\t\t\ttask,\n\t\t\t)\n\t\t)\n\t\t\tthis.automaticCommands = false;\n\t\tif (/\\b(?:do not|don't|never|must not)\\s+(?:read|open|inspect|access)\\b/i.test(task))\n\t\t\tthis.automaticReadbacks = false;\n\t\tif (/\\b(?:do not|don't|never|must not)\\s+(?:use|call)\\s+(?:any\\s+)?tools\\b|\\bno tools\\b/i.test(task)) {\n\t\t\tthis.automaticCommands = false;\n\t\t\tthis.automaticReadbacks = false;\n\t\t}\n\t\t// Inlined @file text is data beside an instruction: it states no requirement and authorizes no check.\n\t\tconst attached = fileTexts.join(\"\").trimEnd();\n\t\t// A rewritten prompt hides the boundary: its lines stay listed, but nothing runs on their word.\n\t\tconst found = task.includes(attached);\n\t\tif (!found) this.automaticCommands = this.automaticReadbacks = false;\n\t\t// Every verbatim copy is removed, so neither its content nor a copy in piped text can move the boundary: first\n\t\t// the attachments as inlined, then copies of one file, longest first as one file may contain another.\n\t\tlet instructions = attached ? task.replaceAll(attached, () => \"\\n\\n\") : task;\n\t\tif (found)\n\t\t\tfor (const text of fileTexts.map((text) => text.trimEnd()).sort((a, b) => b.length - a.length))\n\t\t\t\tif (text) instructions = instructions.replaceAll(text, () => \"\\n\\n\");\n\t\t// Alone, the attachments are the task, but a command in an attachment never runs on its word, even then.\n\t\tconst alone = found && !instructions.trim();\n\t\tconst prose = alone ? attached : instructions;\n\t\tconst tokens = new Marked().lexer(prose);\n\t\tconst lines = taskRequirements(tokens).map(({ requirement, check }) => ({\n\t\t\trequirement,\n\t\t\tcheck: alone && check.kind === \"command\" ? ({ kind: \"manual\" } as const) : check,\n\t\t}));\n\t\t// An instruction that only hands the work to an attached document lists its lines but checks only its explicit\n\t\t// file lines: its commands never run, files it mentions are not read, and its output lines describe the work,\n\t\t// not this reply. Attachments alone open with a file tag, never with such a sentence.\n\t\tif (found)\n\t\t\tfor (const content of delegatedDocuments(tokens, fileTexts))\n\t\t\t\tfor (const { requirement, check } of taskRequirements(new Marked().lexer(content)))\n\t\t\t\t\tlines.push({ requirement, check: check.kind === \"file\" ? check : { kind: \"manual\" } });\n\t\tif (lines.length === 0)\n\t\t\tlines.push({ requirement: prose.trim() || \"Task requirements unavailable\", check: { kind: \"manual\" } });\n\t\tfor (const { requirement, check } of lines) {\n\t\t\tthis.criteria.push({\n\t\t\t\tid: `acceptance-${this.criteria.length + 1}`,\n\t\t\t\trequirement,\n\t\t\t\tcheck,\n\t\t\t\tstatus: \"pending\",\n\t\t\t\tevidence: [],\n\t\t\t});\n\t\t}\n\t}\n\n\t/** Avoid tool snapshots when no task criterion can use execution evidence. */\n\tget needsToolEvidence(): boolean {\n\t\treturn this.criteria.some(\n\t\t\t(criterion) =>\n\t\t\t\tcriterion.check.kind === \"command\" ||\n\t\t\t\tcriterion.check.kind === \"file\" ||\n\t\t\t\t(criterion.check.kind === \"manual\" && criterion.check.readback !== undefined),\n\t\t);\n\t}\n\n\t/** Correlate validated tool arguments with observations, including nested tool execution. */\n\tbeginToolCall(id: string, name: string, args: unknown): void {\n\t\tif (!this.needsToolEvidence) return;\n\t\tconst input = record(args);\n\t\tconst overlapsMutation = this.mutations.size > 0 || this.hasOwnedEffects();\n\t\tconst priorCommands = this.criteria.flatMap((criterion) =>\n\t\t\tcriterion.check.kind === \"command\" && (criterion.status === \"checked\" || criterion.status === \"unmet\")\n\t\t\t\t? [{ criterion, status: criterion.status }]\n\t\t\t\t: [],\n\t\t);\n\t\tif (![\"read\", \"ls\", \"grep\", \"find\", \"tool_search\"].includes(name)) {\n\t\t\tthis.mutations.add(id);\n\t\t\tthis.revision++;\n\t\t\tfor (const criterion of this.criteria) {\n\t\t\t\t// Even a requested test command can mutate another command's inputs.\n\t\t\t\tif (criterion.status !== \"checked\" && criterion.status !== \"unmet\") continue;\n\t\t\t\tcriterion.status = \"pending\";\n\t\t\t\tcriterion.evidence.push(`Evidence invalidated by ${name} (${id}); final state needs verification`);\n\t\t\t}\n\t\t}\n\t\t// A read begun after a mutation starts can share its revision and still precede its final write.\n\t\tthis.calls.set(id, { name, args: input, revision: this.revision, overlapsMutation, priorCommands });\n\t}\n\n\t/** Observe execution before extension result replacement; synthetic or blocked results never prove success. */\n\tobserve(observation: Readonly<ToolResultObservation>): void {\n\t\tif (observation.phase !== \"executed\") return;\n\t\tconst call = this.calls.get(observation.toolCallId);\n\t\tthis.calls.delete(observation.toolCallId);\n\t\tthis.mutations.delete(observation.toolCallId);\n\t\tif (!call) return;\n\t\tconst snapshot = record(observation.resultSnapshot);\n\t\tconst structured = record(snapshot.structuredContent);\n\t\tconst content = Array.isArray(snapshot.content) ? snapshot.content.map((part) => record(part)) : [];\n\t\tconst text = content\n\t\t\t.filter((part) => part.type === \"text\")\n\t\t\t.map((part) => part.text)\n\t\t\t.join(\"\\n\");\n\t\tconst loss = !Array.isArray(snapshot.loss) || snapshot.loss.length > 0;\n\t\tfor (const criterion of this.criteria) {\n\t\t\tconst check = criterion.check;\n\t\t\tconst matches =\n\t\t\t\tcheck.kind === \"command\"\n\t\t\t\t\t? call.name === \"bash\" && call.args.command === check.command\n\t\t\t\t\t: call.name === \"read\" &&\n\t\t\t\t\t\t((check.kind === \"file\" && call.args.path === check.path) ||\n\t\t\t\t\t\t\t(check.kind === \"manual\" && check.readback !== undefined && call.args.path === check.readback));\n\t\t\tif (!matches) continue;\n\t\t\tlet status: AcceptanceCriterion[\"status\"] = \"uncheckable\";\n\t\t\tlet evidence = `${call.name} (${observation.toolCallId}): ${check.kind === \"command\" ? check.command : check.kind === \"file\" ? check.path : check.kind === \"manual\" ? check.readback : \"\"}`;\n\t\t\tif (call.overlapsMutation || this.hasOwnedEffects() || call.revision !== this.revision) {\n\t\t\t\tevidence += \"; a mutating call overlapped this check; final state needs verification\";\n\t\t\t} else if (observation.source === \"executed\" && !loss) {\n\t\t\t\tif (check.kind === \"command\" && typeof structured.exit_code === \"number\") {\n\t\t\t\t\tstatus = structured.exit_code === 0 && !observation.isError ? \"checked\" : \"unmet\";\n\t\t\t\t\tevidence += `; exit code ${structured.exit_code}`;\n\t\t\t\t} else if (check.kind === \"manual\" && !observation.isError) {\n\t\t\t\t\tevidence += \"; supporting file readback only; behaviour still requires manual verification\";\n\t\t\t\t} else if (check.kind === \"file\" && !observation.isError) {\n\t\t\t\t\t// Raw tool metadata is the content boundary; notices and image labels are not file bytes.\n\t\t\t\t\tconst readback = record(record(snapshot.details).readback);\n\t\t\t\t\tconst truncated = readback.complete !== true;\n\t\t\t\t\tstatus =\n\t\t\t\t\t\tcheck.contains === undefined\n\t\t\t\t\t\t\t? \"checked\"\n\t\t\t\t\t\t\t: typeof readback.text === \"string\" && readback.text.includes(check.contains)\n\t\t\t\t\t\t\t\t? \"checked\"\n\t\t\t\t\t\t\t\t: truncated\n\t\t\t\t\t\t\t\t\t? \"uncheckable\"\n\t\t\t\t\t\t\t\t\t: \"unmet\";\n\t\t\t\t\tevidence +=\n\t\t\t\t\t\tcheck.contains === undefined\n\t\t\t\t\t\t\t? \"; file read back\"\n\t\t\t\t\t\t\t: `; required content ${status === \"checked\" ? \"found\" : truncated ? \"not found in partial read\" : \"missing\"}`;\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"file\" && observation.source === \"synthetic\" && /ENOENT|no such file/i.test(text)) {\n\t\t\t\tstatus = \"unmet\";\n\t\t\t\tevidence += \"; file does not exist\";\n\t\t\t}\n\t\t\tif (status === \"uncheckable\")\n\t\t\t\tevidence += `; ${loss ? \"incomplete evidence\" : `${observation.source} result cannot establish the criterion`}`;\n\t\t\tcriterion.status = status;\n\t\t\tcriterion.evidence.push(evidence);\n\t\t}\n\t\tif (\n\t\t\tcall.name === \"bash\" &&\n\t\t\t!call.overlapsMutation &&\n\t\t\t!this.hasOwnedEffects() &&\n\t\t\tcall.revision === this.revision &&\n\t\t\tobservation.source === \"executed\" &&\n\t\t\t!observation.isError &&\n\t\t\t!loss &&\n\t\t\tstructured.exit_code === 0 &&\n\t\t\tacceptanceCommandIsReadOnly(observation.toolCallId)\n\t\t) {\n\t\t\t// Only an executor-issued OS-isolation receipt can undo invalidation; command text is never proof.\n\t\t\tfor (const { criterion, status } of call.priorCommands) {\n\t\t\t\tif (criterion.status !== \"pending\") continue;\n\t\t\t\tcriterion.status = status;\n\t\t\t\tcriterion.evidence.push(`Common final state preserved by read-only execution (${observation.toolCallId})`);\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Return only still-open executable checks; a failed check is eligible for one final round. */\n\topenChecks(): AcceptanceCriterion[] {\n\t\tconst commands = this.criteria.filter(\n\t\t\t(criterion) => criterion.status !== \"checked\" && criterion.check.kind === \"command\",\n\t\t);\n\t\tconst files = this.criteria.filter(\n\t\t\t(criterion) => criterion.check.kind === \"file\" && (commands.length > 0 || criterion.status !== \"checked\"),\n\t\t);\n\t\tconst readbacks = this.criteria.filter(\n\t\t\t(criterion) => criterion.check.kind === \"manual\" && criterion.check.readback !== undefined,\n\t\t);\n\t\treturn [\n\t\t\t...(this.automaticCommands ? commands : []),\n\t\t\t...(this.automaticReadbacks ? [...files, ...readbacks] : []),\n\t\t];\n\t}\n\n\t/** Settle all criteria and render an authoritative completion qualifier, never a bare success claim. */\n\tsettle(output: string, outcome: \"completed\" | \"aborted\" | \"error\"): AcceptanceSettlement {\n\t\tconst ownedEffectsActive = this.hasOwnedEffects();\n\t\tconst criteria = this.criteria.map((criterion): AcceptanceCriterion => {\n\t\t\tlet { status } = criterion;\n\t\t\tconst evidence = [...criterion.evidence];\n\t\t\tif (criterion.check.kind === \"output\") {\n\t\t\t\tstatus = output.trim() === criterion.check.text ? \"checked\" : \"unmet\";\n\t\t\t\tevidence.push(\n\t\t\t\t\t`Final assistant output ${status === \"checked\" ? \"matches\" : \"does not match\"} the requested exact output`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (ownedEffectsActive) {\n\t\t\t\tif (criterion.check.kind !== \"output\") status = \"uncheckable\";\n\t\t\t\tevidence.push(\n\t\t\t\t\t\"Session-owned background effects are not confirmed quiescent; final state needs verification\",\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (outcome !== \"completed\" && status === \"checked\") {\n\t\t\t\tstatus = \"uncheckable\";\n\t\t\t\tevidence.push(`Run ${outcome}; completion was not established`);\n\t\t\t}\n\t\t\tif (status === \"pending\") {\n\t\t\t\tstatus = \"uncheckable\";\n\t\t\t\tif (\n\t\t\t\t\t(criterion.check.kind === \"command\" && !this.automaticCommands) ||\n\t\t\t\t\t((criterion.check.kind === \"file\" || criterion.check.kind === \"manual\") && !this.automaticReadbacks)\n\t\t\t\t)\n\t\t\t\t\tevidence.push(\"Automatic verification withheld because of a task restriction\");\n\t\t\t}\n\t\t\tif (evidence.length === 0)\n\t\t\t\tevidence.push(\n\t\t\t\t\tcriterion.check.kind === \"manual\"\n\t\t\t\t\t\t? \"No runnable criterion-specific check was identified; requires manual verification\"\n\t\t\t\t\t\t: \"No completed criterion-specific check; tool unavailable, round budget exhausted, or run interrupted\",\n\t\t\t\t);\n\t\t\treturn { ...criterion, status, evidence };\n\t\t});\n\t\tconst completion =\n\t\t\t!ownedEffectsActive && criteria.length > 0 && criteria.every((criterion) => criterion.status === \"checked\")\n\t\t\t\t? \"verified\"\n\t\t\t\t: criteria.some((criterion) => criterion.status === \"checked\" || criterion.status === \"unmet\")\n\t\t\t\t\t? \"partial\"\n\t\t\t\t\t: \"unverified\";\n\t\tconst report = [\n\t\t\t`Completion: ${completion}`,\n\t\t\t...criteria.map(\n\t\t\t\t(criterion) =>\n\t\t\t\t\t`- ${criterion.status}: ${criterion.requirement}\\n Evidence: ${criterion.evidence.join(\"; \")}`,\n\t\t\t),\n\t\t].join(\"\\n\");\n\t\treturn { type: \"acceptance_settled\", completion, criteria, report };\n\t}\n}\n\nfunction taskRequirements(\n\ttokens: Token[],\n\tquotation: { end?: string } = {},\n): Array<{ requirement: string; check: AcceptanceCheck }> {\n\treturn tokens.flatMap((token) => {\n\t\tif (token.type === \"space\") return [];\n\t\tif (token.type === \"list\")\n\t\t\treturn token.items.flatMap((item: { tokens: Token[] }) => taskRequirements(item.tokens, quotation));\n\t\t// Task prose is the authorization boundary; quoted/code/HTML blocks are data, not tool instructions.\n\t\tconst prose = token.type === \"paragraph\" || token.type === \"text\" || token.type === \"heading\";\n\t\tconst text: string = prose ? token.text : token.raw;\n\t\tconst instructions = prose\n\t\t\t? (token.tokens ?? [{ raw: text }])\n\t\t\t\t\t.map((part: Token | { raw: string }) =>\n\t\t\t\t\t\t\"type\" in part && part.type === \"codespan\" ? part.raw.replace(/[^\\n]/g, \" \") : part.raw,\n\t\t\t\t\t)\n\t\t\t\t\t.join(\"\")\n\t\t\t\t\t.split(/\\r?\\n/)\n\t\t\t: [];\n\t\treturn text.split(/\\r?\\n/).flatMap((line, index) => {\n\t\t\tconst requirement = line.trim();\n\t\t\tif (!requirement) return [];\n\t\t\tif (!prose) return [{ requirement, check: { kind: \"manual\" as const } }];\n\t\t\tconst instruction = instructions[index] ?? \"\";\n\t\t\tlet quoted = quotation.end !== undefined || /^(?: {4}|\\t)/.test(line) || !instruction.trim();\n\t\t\t// Ignore apostrophes inside words and quotes inside inline code, but retain quotation state across blocks.\n\t\t\tfor (const match of instruction.matchAll(/[\"“”]|(?<![\\p{L}\\p{N}])['‘]|['’](?![\\p{L}\\p{N}])/gu)) {\n\t\t\t\tquoted = true;\n\t\t\t\tif (quotation.end === match[0]) quotation.end = undefined;\n\t\t\t\telse if (!quotation.end && !/[”’]/.test(match[0]))\n\t\t\t\t\tquotation.end = match[0] === \"“\" ? \"”\" : match[0] === \"‘\" ? \"’\" : match[0];\n\t\t\t}\n\t\t\treturn [{ requirement, check: !quoted ? extractCheck(requirement) : { kind: \"manual\" as const } }];\n\t\t});\n\t});\n}\n\nconst DOCUMENT_NOUN =\n\t\"(?:specs?|specification|requirements|instructions|steps|tasks|plan|checklist|rules|guidelines|design|file|document|doc)\";\n// The one sentence form that hands the work over, on lowercased words where DOC<n> is the nth attached document.\nconst DELEGATION = new RegExp(\n\t\"^(?:(?:please|now|then|next|finally|also|you should|you must|your task is to|i want you to|i need you to) )*\" +\n\t\t\"(?:implement|follow|fulfill?|satisfy|carry out) \" +\n\t\t`(?:all (?:of )?)?(?:(?:the|these|this) ${DOCUMENT_NOUN} (?:in|from|of|described in|listed in) )?` +\n\t\t`((?:the attached )?DOC\\\\d+(?: (?:and )?DOC\\\\d+)*|(?:the|this) (?:attached ${DOCUMENT_NOUN}|attachment))` +\n\t\t\"(?: (?:please|exactly|carefully|fully|completely))?$\",\n);\n\n/** Contents of the attached documents that the instruction, being one handover sentence, hands the work to. */\nfunction delegatedDocuments(tokens: Token[], fileTexts: string[]): string[] {\n\t// shortcut: one fixed sentence form over prose documents, not language understanding. Any other text, before or\n\t// after it, could qualify or withdraw the handover (\"Implement spec.md. Skip step 3.\"), so it leaves data.\n\tconst [first, ...rest] = tokens.filter((token) => token.type !== \"space\");\n\tif (first?.type !== \"paragraph\" || rest.length > 0) return [];\n\tconst tail = (path: string) => `/${path.replaceAll(\"\\\\\", \"/\").toLowerCase()}`;\n\tconst documents = fileTexts.flatMap((text) => {\n\t\tconst [, path, content] =\n\t\t\ttext.match(/^<file name=\"(.*\\.(?:md|markdown|txt|rst|adoc))\">\\n([\\s\\S]*)\\n<\\/file>\\n?$/i) ?? [];\n\t\treturn path === undefined ? [] : [{ path: tail(path), content }];\n\t});\n\tconst documentName = (word: string) => {\n\t\tconst name = tail(word.replace(/^@+/, \"\").replace(/^(?:[a-z]:)?(?:\\.{0,2}[\\\\/])+/i, \"\"));\n\t\tconst matches = documents.flatMap(({ path }, index) => (path.endsWith(name) ? [index] : []));\n\t\treturn matches.length === 1 ? `DOC${matches[0]}` : undefined;\n\t};\n\t// A code span is one filename at this authorization boundary, never a list of whitespace-separated names.\n\t// Unknown or ambiguous spans keep their delimiters, so neither their parts nor their prose can match the form.\n\tconst parts: Token[] = first.tokens ?? [];\n\tconst words = parts\n\t\t.map((part, index) => {\n\t\t\tif (part.type === \"codespan\") return documentName(part.text) ?? part.raw;\n\t\t\t// Only a final \".\" or \"!\" goes: a second sentence or question must still prevent a handover.\n\t\t\tconst text = index === parts.length - 1 ? part.raw.trimEnd().replace(/[.!]$/, \"\") : part.raw;\n\t\t\t// Lowercased, no word of the instruction can pose as a document; malformed backticks stay unmatched.\n\t\t\treturn text.replace(/\\S+/g, (word) => documentName(word.replace(/,{1,2}$/, \"\")) ?? word.toLowerCase());\n\t\t})\n\t\t.join(\"\")\n\t\t.replace(/(DOC\\d+),{1,2}(?=\\s|$)/g, \"$1\")\n\t\t.trim()\n\t\t.replace(/\\s+/g, \" \");\n\tconst reference = words.match(DELEGATION)?.[1];\n\tif (reference === undefined) return [];\n\t// \"The attached …\" is unambiguous only when the one attached file is a document.\n\tconst named = [...reference.matchAll(/DOC(\\d+)/g)].map(([, index]) => documents[Number(index)]);\n\tconst handed = named.length > 0 ? named : fileTexts.length === 1 ? documents : [];\n\treturn [...new Set(handed.map(({ content }) => content))];\n}\n\nfunction extractCheck(requirement: string): AcceptanceCheck {\n\t// shortcut: only unambiguous check syntax is executable; other prose needs manual evidence, not guessed success.\n\tconst command = requirement.match(\n\t\t/^(?:Run|Test with|Verify with)\\s+`([^`]+)`(?:\\s*(?:must pass|successfully))?\\.?$/i,\n\t)?.[1];\n\t// Task text is an execution boundary: never interpret shell syntax, install packages, or update snapshots.\n\tif (\n\t\tcommand &&\n\t\t/^[\\w ./@:=+-]+$/.test(command) &&\n\t\t!/(?:^|\\s)(?:-u|--update(?:Snapshot)?)(?:\\s|$)/.test(command) &&\n\t\t/^(?:node --test\\s+\\S|npm (?:test(?:\\s|$)|run (?:check|test)(?:[\\w:-]*)(?:\\s|$))|(?:vitest|pytest)(?:\\s|$))/.test(\n\t\t\tcommand,\n\t\t)\n\t) {\n\t\treturn { kind: \"command\", command };\n\t}\n\tconst file = requirement.match(/^File `([^`]+)` must (?:contain `([^`]+)`|exist)\\.?$/i);\n\tif (file) return { kind: \"file\", path: file[1], ...(file[2] !== undefined ? { contains: file[2] } : {}) };\n\tconst output = requirement.match(/^(?:Output|Return|Say) exactly `([^`]+)`\\.?$/i);\n\tif (output) return { kind: \"output\", text: output[1] };\n\tconst readback = /\\b(?:do not|don't|never|must not)\\b/i.test(requirement)\n\t\t? undefined\n\t\t: requirement.match(/`([\\w./@-]+\\.[\\w-]+)`/)?.[1];\n\treturn { kind: \"manual\", ...(readback ? { readback } : {}) };\n}\n\nfunction record(value: unknown): Record<string, unknown> {\n\t// Tool arguments and bounded snapshots cross the tool/extension boundary as unknown values.\n\treturn value !== null && typeof value === \"object\" ? (value as Record<string, unknown>) : {};\n}\n"]}
|
|
1
|
+
{"version":3,"file":"acceptance-ledger.js","sourceRoot":"","sources":["../../src/core/acceptance-ledger.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAc,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAEN,gCAAgC,EAChC,2BAA2B,GAC3B,MAAM,yBAAyB,CAAC;AAwBjC,oGAAoG;AACpG,MAAM,OAAO,gBAAgB;IAC5B,QAAQ,GAA0B,EAAE,CAAC;IAC7B,QAAQ,GAAG,CAAC,CAAC;IACb,iBAAiB,GAAG,IAAI,CAAC;IACzB,kBAAkB,GAAG,IAAI,CAAC;IACjB,eAAe,CAAgB;IAC/B,SAAS,GAAG,IAAI,GAAG,EAAU,CAAC;IAC9B,KAAK,GAAG,IAAI,GAAG,EAS7B,CAAC;IAEJ,YAAY,IAAY,EAAE,eAAe,GA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AS;QACX,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,uBAAuB,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACnD,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AAC9D,CAAC;AAED,SAAS,MAAM,CAAC,KAAc;IAC7B,4FAA4F;IAC5F,OAAO,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAE,KAAiC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC9F,CAAC","sourcesContent":["// Task-derived acceptance and raw tool evidence for direct session settlement; no model calls.\nimport type { ToolResultObservation } from \"@earendil-works/pi-agent-core\";\nimport { Marked, type Token } from \"@earendil-works/pi-tui\";\nimport {\n\ttype AcceptanceIsolationReason,\n\tacceptanceCommandIsolationReason,\n\tacceptanceCommandIsReadOnly,\n} from \"./acceptance-command.ts\";\n\nexport type AcceptanceCheck =\n\t| { kind: \"command\"; command: string }\n\t| { kind: \"file\"; path: string; contains?: string }\n\t| { kind: \"output\"; text: string }\n\t| { kind: \"manual\"; readback?: string };\n\nexport interface AcceptanceCriterion {\n\tid: string;\n\trequirement: string;\n\tcheck: AcceptanceCheck;\n\tstatus: \"pending\" | \"checked\" | \"unmet\" | \"uncheckable\";\n\tevidence: string[];\n\tisolationReason?: AcceptanceIsolationReason;\n}\n\nexport interface AcceptanceSettlement {\n\ttype: \"acceptance_settled\";\n\tcompletion: \"verified\" | \"partial\" | \"unverified\";\n\tcriteria: AcceptanceCriterion[];\n\treport: string;\n}\n\n/** Keeps task scope separate from assistant claims and settles only criterion-specific evidence. */\nexport class AcceptanceLedger {\n\tcriteria: AcceptanceCriterion[] = [];\n\tprivate revision = 0;\n\tprivate automaticCommands = true;\n\tprivate automaticReadbacks = true;\n\tprivate readonly hasOwnedEffects: () => boolean;\n\tprivate readonly mutations = new Set<string>();\n\tprivate readonly calls = new Map<\n\t\tstring,\n\t\t{\n\t\t\tname: string;\n\t\t\targs: Record<string, unknown>;\n\t\t\trevision: number;\n\t\t\toverlapsMutation: boolean;\n\t\t\tpriorCommands: Array<{ criterion: AcceptanceCriterion; status: \"checked\" | \"unmet\" }>;\n\t\t}\n\t>();\n\n\tconstructor(task: string, hasOwnedEffects: () => boolean = () => false, fileTexts?: string[]) {\n\t\tthis.hasOwnedEffects = hasOwnedEffects;\n\t\tthis.addTask(task, fileTexts);\n\t}\n\n\t/** Preserve prose requirements too: unsupported assertions remain explicitly uncheckable. */\n\taddTask(task: string, fileTexts: string[] = []): void {\n\t\t// Fail closed on task restrictions; do not guess exceptions for an automatic tool call.\n\t\tif (\n\t\t\t/\\b(?:do not|don't|never|must not|without|avoid|no)\\b[^\\n.!?]*\\b(?:run|running|execute|executing|execution|test|testing)\\b/i.test(\n\t\t\t\ttask,\n\t\t\t)\n\t\t)\n\t\t\tthis.automaticCommands = false;\n\t\tif (/\\b(?:do not|don't|never|must not)\\s+(?:read|open|inspect|access)\\b/i.test(task))\n\t\t\tthis.automaticReadbacks = false;\n\t\tif (/\\b(?:do not|don't|never|must not)\\s+(?:use|call)\\s+(?:any\\s+)?tools\\b|\\bno tools\\b/i.test(task)) {\n\t\t\tthis.automaticCommands = false;\n\t\t\tthis.automaticReadbacks = false;\n\t\t}\n\t\t// Inlined @file text is data beside an instruction: it states no requirement and authorizes no check.\n\t\tconst attached = fileTexts.join(\"\").trimEnd();\n\t\t// A rewritten prompt hides the boundary: its lines stay listed, but nothing runs on their word.\n\t\tconst found = task.includes(attached);\n\t\tif (!found) this.automaticCommands = this.automaticReadbacks = false;\n\t\t// Every verbatim copy is removed, so neither its content nor a copy in piped text can move the boundary: first\n\t\t// the attachments as inlined, then copies of one file, longest first as one file may contain another.\n\t\tlet instructions = attached ? task.replaceAll(attached, () => \"\\n\\n\") : task;\n\t\tif (found)\n\t\t\tfor (const text of fileTexts.map((text) => text.trimEnd()).sort((a, b) => b.length - a.length))\n\t\t\t\tif (text) instructions = instructions.replaceAll(text, () => \"\\n\\n\");\n\t\t// Alone, the attachments are the task, but a command in an attachment never runs on its word, even then.\n\t\tconst alone = found && !instructions.trim();\n\t\tconst prose = alone ? attached : instructions;\n\t\tconst tokens = new Marked().lexer(prose);\n\t\tconst lines = taskRequirements(tokens).map(({ requirement, check }) => ({\n\t\t\trequirement,\n\t\t\tcheck: alone && check.kind === \"command\" ? ({ kind: \"manual\" } as const) : check,\n\t\t}));\n\t\t// An instruction that only hands the work to an attached document lists its lines but checks only its explicit\n\t\t// file lines: its commands never run, files it mentions are not read, and its output lines describe the work,\n\t\t// not this reply. Attachments alone open with a file tag, never with such a sentence.\n\t\tif (found)\n\t\t\tfor (const content of delegatedDocuments(tokens, fileTexts))\n\t\t\t\tfor (const { requirement, check } of taskRequirements(new Marked().lexer(content)))\n\t\t\t\t\tlines.push({ requirement, check: check.kind === \"file\" ? check : { kind: \"manual\" } });\n\t\tif (lines.length === 0)\n\t\t\tlines.push({ requirement: prose.trim() || \"Task requirements unavailable\", check: { kind: \"manual\" } });\n\t\tfor (const { requirement, check } of lines) {\n\t\t\tthis.criteria.push({\n\t\t\t\tid: `acceptance-${this.criteria.length + 1}`,\n\t\t\t\trequirement,\n\t\t\t\tcheck,\n\t\t\t\tstatus: \"pending\",\n\t\t\t\tevidence: [],\n\t\t\t});\n\t\t}\n\t}\n\n\t/** Avoid tool snapshots when no task criterion can use execution evidence. */\n\tget needsToolEvidence(): boolean {\n\t\treturn this.criteria.some(\n\t\t\t(criterion) =>\n\t\t\t\tcriterion.check.kind === \"command\" ||\n\t\t\t\tcriterion.check.kind === \"file\" ||\n\t\t\t\t(criterion.check.kind === \"manual\" && criterion.check.readback !== undefined),\n\t\t);\n\t}\n\n\t/** Correlate validated tool arguments with observations, including nested tool execution. */\n\tbeginToolCall(id: string, name: string, args: unknown): void {\n\t\tif (!this.needsToolEvidence) return;\n\t\tconst input = record(args);\n\t\tconst overlapsMutation = this.mutations.size > 0 || this.hasOwnedEffects();\n\t\tconst priorCommands = this.criteria.flatMap((criterion) =>\n\t\t\tcriterion.check.kind === \"command\" && (criterion.status === \"checked\" || criterion.status === \"unmet\")\n\t\t\t\t? [{ criterion, status: criterion.status }]\n\t\t\t\t: [],\n\t\t);\n\t\tif (![\"read\", \"ls\", \"grep\", \"find\", \"tool_search\"].includes(name)) {\n\t\t\tthis.mutations.add(id);\n\t\t\tthis.revision++;\n\t\t\tfor (const criterion of this.criteria) {\n\t\t\t\t// Even a requested test command can mutate another command's inputs.\n\t\t\t\tif (criterion.status !== \"checked\" && criterion.status !== \"unmet\") continue;\n\t\t\t\tcriterion.status = \"pending\";\n\t\t\t\tcriterion.evidence.push(`Evidence invalidated by ${name} (${id}); final state needs verification`);\n\t\t\t}\n\t\t}\n\t\t// A read begun after a mutation starts can share its revision and still precede its final write.\n\t\tthis.calls.set(id, { name, args: input, revision: this.revision, overlapsMutation, priorCommands });\n\t}\n\n\t/** Observe execution before extension result replacement; synthetic or blocked results never prove success. */\n\tobserve(observation: Readonly<ToolResultObservation>): void {\n\t\tif (observation.phase !== \"executed\") return;\n\t\tconst call = this.calls.get(observation.toolCallId);\n\t\tthis.calls.delete(observation.toolCallId);\n\t\tthis.mutations.delete(observation.toolCallId);\n\t\tif (!call) return;\n\t\tconst snapshot = record(observation.resultSnapshot);\n\t\tconst structured = record(snapshot.structuredContent);\n\t\tconst content = Array.isArray(snapshot.content) ? snapshot.content.map((part) => record(part)) : [];\n\t\tconst text = content\n\t\t\t.filter((part) => part.type === \"text\")\n\t\t\t.map((part) => part.text)\n\t\t\t.join(\"\\n\");\n\t\tconst loss = !Array.isArray(snapshot.loss) || snapshot.loss.length > 0;\n\t\tfor (const criterion of this.criteria) {\n\t\t\tconst check = criterion.check;\n\t\t\tconst matches =\n\t\t\t\tcheck.kind === \"command\"\n\t\t\t\t\t? call.name === \"bash\" && call.args.command === check.command\n\t\t\t\t\t: call.name === \"read\" &&\n\t\t\t\t\t\t((check.kind === \"file\" && call.args.path === check.path) ||\n\t\t\t\t\t\t\t(check.kind === \"manual\" && check.readback !== undefined && call.args.path === check.readback));\n\t\t\tif (!matches) continue;\n\t\t\tlet status: AcceptanceCriterion[\"status\"] = \"uncheckable\";\n\t\t\tlet evidence = `${call.name} (${observation.toolCallId}): ${check.kind === \"command\" ? check.command : check.kind === \"file\" ? check.path : check.kind === \"manual\" ? check.readback : \"\"}`;\n\t\t\tif (call.overlapsMutation || this.hasOwnedEffects() || call.revision !== this.revision) {\n\t\t\t\tevidence += \"; a mutating call overlapped this check; final state needs verification\";\n\t\t\t} else if (observation.source === \"executed\" && !loss) {\n\t\t\t\tif (check.kind === \"command\" && typeof structured.exit_code === \"number\") {\n\t\t\t\t\tstatus = structured.exit_code === 0 && !observation.isError ? \"checked\" : \"unmet\";\n\t\t\t\t\tevidence += `; exit code ${structured.exit_code}`;\n\t\t\t\t} else if (check.kind === \"manual\" && !observation.isError) {\n\t\t\t\t\tevidence += \"; supporting file readback only; behaviour still requires manual verification\";\n\t\t\t\t} else if (check.kind === \"file\" && !observation.isError) {\n\t\t\t\t\t// Raw tool metadata is the content boundary; notices and image labels are not file bytes.\n\t\t\t\t\tconst readback = record(record(snapshot.details).readback);\n\t\t\t\t\tconst truncated = readback.complete !== true;\n\t\t\t\t\tstatus =\n\t\t\t\t\t\tcheck.contains === undefined\n\t\t\t\t\t\t\t? \"checked\"\n\t\t\t\t\t\t\t: typeof readback.text === \"string\" && readback.text.includes(check.contains)\n\t\t\t\t\t\t\t\t? \"checked\"\n\t\t\t\t\t\t\t\t: truncated\n\t\t\t\t\t\t\t\t\t? \"uncheckable\"\n\t\t\t\t\t\t\t\t\t: \"unmet\";\n\t\t\t\t\tevidence +=\n\t\t\t\t\t\tcheck.contains === undefined\n\t\t\t\t\t\t\t? \"; file read back\"\n\t\t\t\t\t\t\t: `; required content ${status === \"checked\" ? \"found\" : truncated ? \"not found in partial read\" : \"missing\"}`;\n\t\t\t\t}\n\t\t\t} else if (check.kind === \"file\" && observation.source === \"synthetic\" && /ENOENT|no such file/i.test(text)) {\n\t\t\t\tstatus = \"unmet\";\n\t\t\t\tevidence += \"; file does not exist\";\n\t\t\t}\n\t\t\tif (check.kind === \"command\") {\n\t\t\t\t// Launch-free builtins already have custody without OS isolation.\n\t\t\t\tconst reason = acceptanceCommandIsolationReason(observation.toolCallId);\n\t\t\t\tcriterion.isolationReason =\n\t\t\t\t\treason === \"execution-unconfirmed\" || status === \"uncheckable\" || this.hasOwnedEffects()\n\t\t\t\t\t\t? reason\n\t\t\t\t\t\t: undefined;\n\t\t\t\tif (criterion.isolationReason) {\n\t\t\t\t\tstatus = \"uncheckable\";\n\t\t\t\t\tevidence += `; isolation unavailable: ${criterion.isolationReason}`;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (status === \"uncheckable\")\n\t\t\t\tevidence += `; ${loss ? \"incomplete evidence\" : `${observation.source} result cannot establish the criterion`}`;\n\t\t\tcriterion.status = status;\n\t\t\tcriterion.evidence.push(evidence);\n\t\t}\n\t\tif (\n\t\t\tcall.name === \"bash\" &&\n\t\t\t!call.overlapsMutation &&\n\t\t\t!this.hasOwnedEffects() &&\n\t\t\tcall.revision === this.revision &&\n\t\t\tobservation.source === \"executed\" &&\n\t\t\t!loss &&\n\t\t\ttypeof structured.exit_code === \"number\" &&\n\t\t\tacceptanceCommandIsReadOnly(observation.toolCallId)\n\t\t) {\n\t\t\t// Only an executor-issued OS-isolation receipt can undo invalidation; command text is never proof.\n\t\t\tfor (const { criterion, status } of call.priorCommands) {\n\t\t\t\tif (criterion.status !== \"pending\") continue;\n\t\t\t\tcriterion.status = status;\n\t\t\t\tcriterion.evidence.push(`Common final state preserved by read-only execution (${observation.toolCallId})`);\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Return only still-open executable checks; a failed check is eligible for one final round. */\n\topenChecks(): AcceptanceCriterion[] {\n\t\tconst commands = this.criteria.filter(\n\t\t\t(criterion) => criterion.status !== \"checked\" && criterion.check.kind === \"command\",\n\t\t);\n\t\tconst files = this.criteria.filter(\n\t\t\t(criterion) => criterion.check.kind === \"file\" && (commands.length > 0 || criterion.status !== \"checked\"),\n\t\t);\n\t\tconst readbacks = this.criteria.filter(\n\t\t\t(criterion) => criterion.check.kind === \"manual\" && criterion.check.readback !== undefined,\n\t\t);\n\t\treturn [\n\t\t\t...(this.automaticCommands ? commands : []),\n\t\t\t...(this.automaticReadbacks ? [...files, ...readbacks] : []),\n\t\t];\n\t}\n\n\t/** Settle all criteria and render an authoritative completion qualifier, never a bare success claim. */\n\tsettle(output: string, outcome: \"completed\" | \"aborted\" | \"error\"): AcceptanceSettlement {\n\t\tconst ownedEffectsActive = this.hasOwnedEffects();\n\t\tconst criteria = this.criteria.map((criterion): AcceptanceCriterion => {\n\t\t\tlet { status } = criterion;\n\t\t\tconst evidence = [...criterion.evidence];\n\t\t\tif (criterion.check.kind === \"output\") {\n\t\t\t\tstatus = output.trim() === criterion.check.text ? \"checked\" : \"unmet\";\n\t\t\t\tevidence.push(\n\t\t\t\t\t`Final assistant output ${status === \"checked\" ? \"matches\" : \"does not match\"} the requested exact output`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (ownedEffectsActive) {\n\t\t\t\tif (criterion.check.kind !== \"output\") status = \"uncheckable\";\n\t\t\t\tevidence.push(\n\t\t\t\t\t\"Session-owned background effects are not confirmed quiescent; final state needs verification\",\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (outcome !== \"completed\" && status === \"checked\") {\n\t\t\t\tstatus = \"uncheckable\";\n\t\t\t\tevidence.push(`Run ${outcome}; completion was not established`);\n\t\t\t}\n\t\t\tif (status === \"pending\") {\n\t\t\t\tstatus = \"uncheckable\";\n\t\t\t\tif (\n\t\t\t\t\t(criterion.check.kind === \"command\" && !this.automaticCommands) ||\n\t\t\t\t\t((criterion.check.kind === \"file\" || criterion.check.kind === \"manual\") && !this.automaticReadbacks)\n\t\t\t\t)\n\t\t\t\t\tevidence.push(\"Automatic verification withheld because of a task restriction\");\n\t\t\t}\n\t\t\tif (evidence.length === 0)\n\t\t\t\tevidence.push(\n\t\t\t\t\tcriterion.check.kind === \"manual\"\n\t\t\t\t\t\t? \"No runnable criterion-specific check was identified; requires manual verification\"\n\t\t\t\t\t\t: \"No completed criterion-specific check; tool unavailable, round budget exhausted, or run interrupted\",\n\t\t\t\t);\n\t\t\treturn { ...criterion, status, evidence };\n\t\t});\n\t\tconst completion =\n\t\t\t!ownedEffectsActive && criteria.length > 0 && criteria.every((criterion) => criterion.status === \"checked\")\n\t\t\t\t? \"verified\"\n\t\t\t\t: criteria.some((criterion) => criterion.status === \"checked\" || criterion.status === \"unmet\")\n\t\t\t\t\t? \"partial\"\n\t\t\t\t\t: \"unverified\";\n\t\tconst report = [\n\t\t\t`Completion: ${completion}`,\n\t\t\t...criteria.map(\n\t\t\t\t(criterion) =>\n\t\t\t\t\t`- ${criterion.status}: ${criterion.requirement}\\n Evidence: ${criterion.evidence.join(\"; \")}`,\n\t\t\t),\n\t\t].join(\"\\n\");\n\t\treturn { type: \"acceptance_settled\", completion, criteria, report };\n\t}\n}\n\nfunction taskRequirements(\n\ttokens: Token[],\n\tquotation: { end?: string } = {},\n): Array<{ requirement: string; check: AcceptanceCheck }> {\n\treturn tokens.flatMap((token) => {\n\t\tif (token.type === \"space\") return [];\n\t\tif (token.type === \"list\")\n\t\t\treturn token.items.flatMap((item: { tokens: Token[] }) => taskRequirements(item.tokens, quotation));\n\t\t// Task prose is the authorization boundary; quoted/code/HTML blocks are data, not tool instructions.\n\t\tconst prose = token.type === \"paragraph\" || token.type === \"text\" || token.type === \"heading\";\n\t\tconst text: string = prose ? token.text : token.raw;\n\t\tconst instructions = prose\n\t\t\t? (token.tokens ?? [{ raw: text }])\n\t\t\t\t\t.map((part: Token | { raw: string }) =>\n\t\t\t\t\t\t\"type\" in part && part.type === \"codespan\" ? part.raw.replace(/[^\\n]/g, \" \") : part.raw,\n\t\t\t\t\t)\n\t\t\t\t\t.join(\"\")\n\t\t\t\t\t.split(/\\r?\\n/)\n\t\t\t: [];\n\t\treturn text.split(/\\r?\\n/).flatMap((line, index) => {\n\t\t\tconst requirement = line.trim();\n\t\t\tif (!requirement) return [];\n\t\t\tif (!prose) return [{ requirement, check: { kind: \"manual\" as const } }];\n\t\t\tconst instruction = instructions[index] ?? \"\";\n\t\t\tlet quoted = quotation.end !== undefined || /^(?: {4}|\\t)/.test(line) || !instruction.trim();\n\t\t\t// Ignore apostrophes inside words and quotes inside inline code, but retain quotation state across blocks.\n\t\t\tfor (const match of instruction.matchAll(/[\"“”]|(?<![\\p{L}\\p{N}])['‘]|['’](?![\\p{L}\\p{N}])/gu)) {\n\t\t\t\tquoted = true;\n\t\t\t\tif (quotation.end === match[0]) quotation.end = undefined;\n\t\t\t\telse if (!quotation.end && !/[”’]/.test(match[0]))\n\t\t\t\t\tquotation.end = match[0] === \"“\" ? \"”\" : match[0] === \"‘\" ? \"’\" : match[0];\n\t\t\t}\n\t\t\treturn [{ requirement, check: !quoted ? extractCheck(requirement) : { kind: \"manual\" as const } }];\n\t\t});\n\t});\n}\n\nconst DOCUMENT_NOUN =\n\t\"(?:specs?|specification|requirements|instructions|steps|tasks|plan|checklist|rules|guidelines|design|file|document|doc)\";\n// The one sentence form that hands the work over, on lowercased words where DOC<n> is the nth attached document.\nconst DELEGATION = new RegExp(\n\t\"^(?:(?:please|now|then|next|finally|also|you should|you must|your task is to|i want you to|i need you to) )*\" +\n\t\t\"(?:implement|follow|fulfill?|satisfy|carry out) \" +\n\t\t`(?:all (?:of )?)?(?:(?:the|these|this) ${DOCUMENT_NOUN} (?:in|from|of|described in|listed in) )?` +\n\t\t`((?:the attached )?DOC\\\\d+(?: (?:and )?DOC\\\\d+)*|(?:the|this) (?:attached ${DOCUMENT_NOUN}|attachment))` +\n\t\t\"(?: (?:please|exactly|carefully|fully|completely))?$\",\n);\n\n/** Contents of the attached documents that the instruction, being one handover sentence, hands the work to. */\nfunction delegatedDocuments(tokens: Token[], fileTexts: string[]): string[] {\n\t// shortcut: one fixed sentence form over prose documents, not language understanding. Any other text, before or\n\t// after it, could qualify or withdraw the handover (\"Implement spec.md. Skip step 3.\"), so it leaves data.\n\tconst [first, ...rest] = tokens.filter((token) => token.type !== \"space\");\n\tif (first?.type !== \"paragraph\" || rest.length > 0) return [];\n\tconst tail = (path: string) => `/${path.replaceAll(\"\\\\\", \"/\").toLowerCase()}`;\n\tconst documents = fileTexts.flatMap((text) => {\n\t\tconst [, path, content] =\n\t\t\ttext.match(/^<file name=\"(.*\\.(?:md|markdown|txt|rst|adoc))\">\\n([\\s\\S]*)\\n<\\/file>\\n?$/i) ?? [];\n\t\treturn path === undefined ? [] : [{ path: tail(path), content }];\n\t});\n\tconst documentName = (word: string) => {\n\t\tconst name = tail(word.replace(/^@+/, \"\").replace(/^(?:[a-z]:)?(?:\\.{0,2}[\\\\/])+/i, \"\"));\n\t\tconst matches = documents.flatMap(({ path }, index) => (path.endsWith(name) ? [index] : []));\n\t\treturn matches.length === 1 ? `DOC${matches[0]}` : undefined;\n\t};\n\t// A code span is one filename at this authorization boundary, never a list of whitespace-separated names.\n\t// Unknown or ambiguous spans keep their delimiters, so neither their parts nor their prose can match the form.\n\tconst parts: Token[] = first.tokens ?? [];\n\tconst words = parts\n\t\t.map((part, index) => {\n\t\t\tif (part.type === \"codespan\") return documentName(part.text) ?? part.raw;\n\t\t\t// Only a final \".\" or \"!\" goes: a second sentence or question must still prevent a handover.\n\t\t\tconst text = index === parts.length - 1 ? part.raw.trimEnd().replace(/[.!]$/, \"\") : part.raw;\n\t\t\t// Lowercased, no word of the instruction can pose as a document; malformed backticks stay unmatched.\n\t\t\treturn text.replace(/\\S+/g, (word) => documentName(word.replace(/,{1,2}$/, \"\")) ?? word.toLowerCase());\n\t\t})\n\t\t.join(\"\")\n\t\t.replace(/(DOC\\d+),{1,2}(?=\\s|$)/g, \"$1\")\n\t\t.trim()\n\t\t.replace(/\\s+/g, \" \");\n\tconst reference = words.match(DELEGATION)?.[1];\n\tif (reference === undefined) return [];\n\t// \"The attached …\" is unambiguous only when the one attached file is a document.\n\tconst named = [...reference.matchAll(/DOC(\\d+)/g)].map(([, index]) => documents[Number(index)]);\n\tconst handed = named.length > 0 ? named : fileTexts.length === 1 ? documents : [];\n\treturn [...new Set(handed.map(({ content }) => content))];\n}\n\nfunction extractCheck(requirement: string): AcceptanceCheck {\n\t// shortcut: only unambiguous check syntax is executable; other prose needs manual evidence, not guessed success.\n\tconst command = requirement.match(\n\t\t/^(?:Run|Test with|Verify with)\\s+`([^`]+)`(?:\\s*(?:must pass|successfully))?\\.?$/i,\n\t)?.[1];\n\t// Task text is an execution boundary: never interpret shell syntax, install packages, or update snapshots.\n\tif (\n\t\tcommand &&\n\t\t/^[\\w ./@:=+-]+$/.test(command) &&\n\t\t!/(?:^|\\s)(?:-u|--update(?:Snapshot)?)(?:\\s|$)/.test(command) &&\n\t\t/^(?:node --test\\s+\\S|npm (?:test(?:\\s|$)|run (?:check|test)(?:[\\w:-]*)(?:\\s|$))|(?:vitest|pytest)(?:\\s|$))/.test(\n\t\t\tcommand,\n\t\t)\n\t) {\n\t\treturn { kind: \"command\", command };\n\t}\n\tconst file = requirement.match(/^File `([^`]+)` must (?:contain `([^`]+)`|exist)\\.?$/i);\n\tif (file) return { kind: \"file\", path: file[1], ...(file[2] !== undefined ? { contains: file[2] } : {}) };\n\tconst output = requirement.match(/^(?:Output|Return|Say) exactly `([^`]+)`\\.?$/i);\n\tif (output) return { kind: \"output\", text: output[1] };\n\tconst readback = /\\b(?:do not|don't|never|must not)\\b/i.test(requirement)\n\t\t? undefined\n\t\t: requirement.match(/`([\\w./@-]+\\.[\\w-]+)`/)?.[1];\n\treturn { kind: \"manual\", ...(readback ? { readback } : {}) };\n}\n\nfunction record(value: unknown): Record<string, unknown> {\n\t// Tool arguments and bounded snapshots cross the tool/extension boundary as unknown values.\n\treturn value !== null && typeof value === \"object\" ? (value as Record<string, unknown>) : {};\n}\n"]}
|
|
@@ -64,12 +64,19 @@ export declare class AgentSessionRuntime {
|
|
|
64
64
|
/**
|
|
65
65
|
* Return the current runtime's diagnostics that were not reported yet, and mark them reported.
|
|
66
66
|
*
|
|
67
|
-
* The host calls this at startup
|
|
68
|
-
*
|
|
69
|
-
* message as one returned before is left out, so an unchanged settings warning is not repeated
|
|
70
|
-
* on every replacement.
|
|
67
|
+
* The host calls this at startup, after each session replacement (/new, /resume, /fork, import),
|
|
68
|
+
* whose runtime collects its diagnostics again, and after reload(). A diagnostic with the same type
|
|
69
|
+
* and message as one returned before is left out, so an unchanged settings warning is not repeated
|
|
70
|
+
* on every replacement or reload.
|
|
71
71
|
*/
|
|
72
72
|
takeUnreportedDiagnostics(): AgentSessionRuntimeDiagnostic[];
|
|
73
|
+
/**
|
|
74
|
+
* Reload the current session's settings, resources and extensions in place. Settings errors found
|
|
75
|
+
* by the reload are added to the diagnostics, for the host to report with takeUnreportedDiagnostics().
|
|
76
|
+
*/
|
|
77
|
+
reload(options?: {
|
|
78
|
+
beforeSessionStart?: () => void | Promise<void>;
|
|
79
|
+
}): Promise<void>;
|
|
73
80
|
setRebindSession(rebindSession?: (session: AgentSession) => Promise<void>): void;
|
|
74
81
|
/**
|
|
75
82
|
* Set a synchronous callback that runs after `session_shutdown` handlers finish
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-session-runtime.d.ts","sourceRoot":"","sources":["../../src/core/agent-session-runtime.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,6BAA6B,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACvG,OAAO,KAAK,EACX,mBAAmB,EACnB,sBAAsB,EAEtB,iBAAiB,EACjB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAEzD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC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AAC;IAC/B,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CACtC,GACC,OAAO,CAAC,mBAAmB,CAAC,CAW9B;AAED,OAAO,EACN,KAAK,6BAA6B,EAClC,KAAK,oBAAoB,EACzB,KAAK,qCAAqC,EAC1C,KAAK,iCAAiC,EACtC,8BAA8B,EAC9B,0BAA0B,GAC1B,MAAM,6BAA6B,CAAC"}
|
|
@@ -4,6 +4,7 @@ import { pathsEqual, resolvePath } from "../utils/paths.js";
|
|
|
4
4
|
import { emitSessionShutdownEvent } from "./extensions/runner.js";
|
|
5
5
|
import { assertSessionCwdExists } from "./session-cwd.js";
|
|
6
6
|
import { SessionManager } from "./session-manager.js";
|
|
7
|
+
import { collectSettingsDiagnostics } from "./settings-diagnostics.js";
|
|
7
8
|
import { takeTraceIngestCredentials } from "./trace/config.js";
|
|
8
9
|
/**
|
|
9
10
|
* Thrown when /import references a JSONL file path that does not exist.
|
|
@@ -73,10 +74,10 @@ export class AgentSessionRuntime {
|
|
|
73
74
|
/**
|
|
74
75
|
* Return the current runtime's diagnostics that were not reported yet, and mark them reported.
|
|
75
76
|
*
|
|
76
|
-
* The host calls this at startup
|
|
77
|
-
*
|
|
78
|
-
* message as one returned before is left out, so an unchanged settings warning is not repeated
|
|
79
|
-
* on every replacement.
|
|
77
|
+
* The host calls this at startup, after each session replacement (/new, /resume, /fork, import),
|
|
78
|
+
* whose runtime collects its diagnostics again, and after reload(). A diagnostic with the same type
|
|
79
|
+
* and message as one returned before is left out, so an unchanged settings warning is not repeated
|
|
80
|
+
* on every replacement or reload.
|
|
80
81
|
*/
|
|
81
82
|
takeUnreportedDiagnostics() {
|
|
82
83
|
return this._diagnostics.filter((diagnostic) => {
|
|
@@ -87,6 +88,14 @@ export class AgentSessionRuntime {
|
|
|
87
88
|
return true;
|
|
88
89
|
});
|
|
89
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* Reload the current session's settings, resources and extensions in place. Settings errors found
|
|
93
|
+
* by the reload are added to the diagnostics, for the host to report with takeUnreportedDiagnostics().
|
|
94
|
+
*/
|
|
95
|
+
async reload(options) {
|
|
96
|
+
await this.session.reload(options);
|
|
97
|
+
this._diagnostics = [...this._diagnostics, ...collectSettingsDiagnostics(this.session.settingsManager)];
|
|
98
|
+
}
|
|
90
99
|
setRebindSession(rebindSession) {
|
|
91
100
|
this.rebindSession = rebindSession;
|
|
92
101
|
}
|