@herbertgao/pi-extensions 2026.10.13 → 2026.10.15
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/README.md +16 -14
- package/THIRD_PARTY_NOTICES.md +3 -3
- package/node_modules/@herbertgao/pi-cc-extensions/README.en.md +2 -2
- package/node_modules/@herbertgao/pi-cc-extensions/README.md +2 -2
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/config.ts +1 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/panel.ts +3 -6
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/context.ts +22 -5
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/compact-mode.ts +44 -14
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/default-mode.ts +1 -5
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/index.ts +20 -5
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/markdown-enhance.ts +4 -1
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/interaction.ts +42 -18
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/layout.ts +12 -3
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/ccstyle-tool.ts +131 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/grouping.ts +217 -113
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/names.ts +12 -5
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/subagent-notification.ts +556 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/utils/ansi-text.ts +50 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/utils/format.ts +11 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/utils/patch-keys.ts +4 -0
- package/node_modules/@herbertgao/pi-cc-extensions/package.json +4 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/README.md +1 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/ask-user-question.ts +27 -3
- package/node_modules/@juicesharp/rpiv-ask-user-question/config.ts +23 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/docs/configuration.md +15 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/docs/keyboard.md +9 -2
- package/node_modules/@juicesharp/rpiv-ask-user-question/locales/de.json +7 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/locales/en.json +8 -5
- package/node_modules/@juicesharp/rpiv-ask-user-question/locales/es.json +7 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/locales/fr.json +7 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/locales/pt-BR.json +7 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/locales/pt.json +7 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/locales/ru.json +7 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/locales/uk.json +7 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/locales/zh.json +7 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/package.json +4 -3
- package/node_modules/@juicesharp/rpiv-ask-user-question/presentation.ts +11 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/build-questionnaire.ts +6 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/key-router.ts +49 -8
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/questionnaire-session.ts +6 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/state-reducer.ts +13 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/state.ts +2 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/preview/preview-block-renderer.ts +19 -7
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/dialog-builder.ts +36 -7
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/dialog-copy.ts +13 -2
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/tab-content-strategy.ts +24 -8
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/transcript.ts +144 -0
- package/node_modules/@narumitw/pi-btw/README.md +8 -3
- package/node_modules/@narumitw/pi-btw/dist/index.ts +448 -182
- package/node_modules/@narumitw/pi-btw/dist/index.ts.map +4 -4
- package/node_modules/@narumitw/pi-btw/docs/core-alignment.md +10 -2
- package/node_modules/@narumitw/pi-btw/docs/main-context-runtime.md +45 -0
- package/node_modules/@narumitw/pi-btw/docs/workflows.md +48 -5
- package/node_modules/@narumitw/pi-btw/package.json +5 -5
- package/node_modules/@narumitw/pi-btw/src/btw.ts +39 -14
- package/node_modules/@narumitw/pi-btw/src/fullscreen-ui.ts +83 -63
- package/node_modules/@narumitw/pi-btw/src/import-main-updates.ts +84 -0
- package/node_modules/@narumitw/pi-btw/src/keybindings.ts +29 -4
- package/node_modules/@narumitw/pi-btw/src/main-context-snapshot.ts +125 -0
- package/node_modules/@narumitw/pi-btw/src/menu.ts +1 -0
- package/node_modules/@narumitw/pi-btw/src/side-thread.ts +66 -17
- package/node_modules/@narumitw/pi-btw/src/transcript-markdown.ts +5 -5
- package/node_modules/@narumitw/pi-btw/src/transcript-pager.ts +47 -6
- package/node_modules/@narumitw/pi-caffeinate/package.json +3 -3
- package/node_modules/pi-lens/CHANGELOG.md +440 -0
- package/node_modules/pi-lens/README.md +13 -3
- package/node_modules/pi-lens/config/dependency-cruiser-eager-allowlist.json +1 -0
- package/node_modules/pi-lens/dist/chunk-22Y2BM7H.js +23 -0
- package/node_modules/pi-lens/dist/{chunk-ATKJFDQN.js → chunk-27VWVB23.js} +12 -14
- package/node_modules/pi-lens/dist/{chunk-S2HEXIWI.js → chunk-2FYKETQJ.js} +10 -6
- package/node_modules/pi-lens/dist/{chunk-SRYEJNES.js → chunk-2LDMXL2M.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-ZHH37KZL.js → chunk-2SDHYHHO.js} +17 -17
- package/node_modules/pi-lens/dist/chunk-2Y6OJRSI.js +38 -0
- package/node_modules/pi-lens/dist/chunk-3SNDVPOR.js +507 -0
- package/node_modules/pi-lens/dist/{chunk-5OFV52AM.js → chunk-3WCEHYOI.js} +1 -1
- package/node_modules/pi-lens/dist/chunk-44X7VIKR.js +73 -0
- package/node_modules/pi-lens/dist/{chunk-DEL2U6CM.js → chunk-4FHUGDKU.js} +16 -14
- package/node_modules/pi-lens/dist/{chunk-CT4MN5IU.js → chunk-4ODSZ35Z.js} +353 -359
- package/node_modules/pi-lens/dist/{chunk-ZIVJBOO3.js → chunk-4U7GDSZQ.js} +2 -2
- package/node_modules/pi-lens/dist/chunk-54NIOJJZ.js +25 -0
- package/node_modules/pi-lens/dist/{chunk-N5FLEO7W.js → chunk-5DKE4HGX.js} +37 -37
- package/node_modules/pi-lens/dist/{chunk-P63GXC37.js → chunk-5LRUKYFA.js} +31 -4
- package/node_modules/pi-lens/dist/{chunk-HRNHZA3N.js → chunk-63NMUNYP.js} +12 -16
- package/node_modules/pi-lens/dist/{chunk-HWCCCQNX.js → chunk-6XSESGWD.js} +13 -6
- package/node_modules/pi-lens/dist/{chunk-UMS2MFPZ.js → chunk-72J27ICO.js} +2 -3
- package/node_modules/pi-lens/dist/{chunk-ED36RF6Y.js → chunk-7FLRUH6B.js} +1 -1
- package/node_modules/pi-lens/dist/chunk-7IYC4ENJ.js +297 -0
- package/node_modules/pi-lens/dist/chunk-7WWQAW5P.js +30 -0
- package/node_modules/pi-lens/dist/{chunk-3DA2JDOL.js → chunk-7ZS7MC24.js} +551 -203
- package/node_modules/pi-lens/dist/{chunk-WMYE35PX.js → chunk-AHWA4AKM.js} +7 -5
- package/node_modules/pi-lens/dist/{chunk-JW3YWBVB.js → chunk-AI3GP74G.js} +17 -19
- package/node_modules/pi-lens/dist/{chunk-AGSS7277.js → chunk-APFJKOP6.js} +6 -23
- package/node_modules/pi-lens/dist/{chunk-ZVUL7QYY.js → chunk-ASRAO7KG.js} +29 -32
- package/node_modules/pi-lens/dist/{chunk-BW5KFIQC.js → chunk-AWQWXSW4.js} +1 -0
- package/node_modules/pi-lens/dist/{chunk-TLX72JTG.js → chunk-CG5V25HX.js} +1 -1
- package/node_modules/pi-lens/dist/chunk-CKEQFGLT.js +32 -0
- package/node_modules/pi-lens/dist/{chunk-Y6GZHWSJ.js → chunk-COOUUC5W.js} +6 -6
- package/node_modules/pi-lens/dist/{chunk-XTBDCR27.js → chunk-CPZ5JJW6.js} +4 -4
- package/node_modules/pi-lens/dist/{chunk-RKKOYPRA.js → chunk-DS2USX5G.js} +13 -15
- package/node_modules/pi-lens/dist/chunk-EA2ZRG44.js +27 -0
- package/node_modules/pi-lens/dist/{chunk-GSLNCYGG.js → chunk-EDMLIW6W.js} +13 -14
- package/node_modules/pi-lens/dist/{chunk-2EECBNC5.js → chunk-EIKRZ32J.js} +75 -0
- package/node_modules/pi-lens/dist/chunk-EKNWOL2I.js +27 -0
- package/node_modules/pi-lens/dist/{chunk-R3T7CLQ2.js → chunk-ELZRSR5N.js} +41 -41
- package/node_modules/pi-lens/dist/{chunk-GMX5OS7B.js → chunk-EN5AM7PX.js} +11 -12
- package/node_modules/pi-lens/dist/{chunk-3RKP3FMS.js → chunk-EWXXLS26.js} +226 -24
- package/node_modules/pi-lens/dist/chunk-EX4EXBW7.js +37 -0
- package/node_modules/pi-lens/dist/{chunk-XHJBS436.js → chunk-EXVXBSGN.js} +25 -25
- package/node_modules/pi-lens/dist/{chunk-MZGQNL3Y.js → chunk-F7BO6FWH.js} +12 -13
- package/node_modules/pi-lens/dist/{chunk-V35JG4JB.js → chunk-FEDWAYDS.js} +152 -334
- package/node_modules/pi-lens/dist/{chunk-J64T55EI.js → chunk-FWZRGGGY.js} +73 -9
- package/node_modules/pi-lens/dist/{chunk-T57LYLZT.js → chunk-G224FADB.js} +1 -1
- package/node_modules/pi-lens/dist/chunk-G5UCJFT7.js +26 -0
- package/node_modules/pi-lens/dist/{chunk-LLJNQKQW.js → chunk-GLW3YDZZ.js} +20 -13
- package/node_modules/pi-lens/dist/{chunk-GXFV6MYU.js → chunk-GTDSYEA2.js} +72 -39
- package/node_modules/pi-lens/dist/{chunk-DUO2TU77.js → chunk-GYRZ72R4.js} +10 -4
- package/node_modules/pi-lens/dist/chunk-HYVXA3BB.js +49 -0
- package/node_modules/pi-lens/dist/{chunk-W66O5E25.js → chunk-IEBJF3PN.js} +13 -15
- package/node_modules/pi-lens/dist/{chunk-GAQ7OQG6.js → chunk-IL7K66ZQ.js} +83 -94
- package/node_modules/pi-lens/dist/{chunk-T7FEBKXN.js → chunk-JWOVP5BL.js} +7 -9
- package/node_modules/pi-lens/dist/{chunk-UBOQLVT2.js → chunk-K2GUZ4DN.js} +4 -4
- package/node_modules/pi-lens/dist/{chunk-5VSF4UUQ.js → chunk-K4SZB56V.js} +34 -39
- package/node_modules/pi-lens/dist/{chunk-7D6L4MTX.js → chunk-KCBRHV5E.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-GSM5UU7A.js → chunk-KFXCL4OV.js} +38 -28
- package/node_modules/pi-lens/dist/{chunk-J6MPGQTS.js → chunk-KJJAVH3X.js} +81 -15
- package/node_modules/pi-lens/dist/{chunk-BWD5EPKO.js → chunk-KPVLQHCZ.js} +4 -6
- package/node_modules/pi-lens/dist/{chunk-MPNJLASA.js → chunk-KX56K73G.js} +10 -13
- package/node_modules/pi-lens/dist/{chunk-AWSCPCN2.js → chunk-LMCTHJ2H.js} +19 -19
- package/node_modules/pi-lens/dist/{chunk-IWDLU6K3.js → chunk-MEFLGBCS.js} +4 -6
- package/node_modules/pi-lens/dist/{chunk-TOY6QKOH.js → chunk-MKPCELNI.js} +17 -17
- package/node_modules/pi-lens/dist/{chunk-POMLXPMY.js → chunk-N3PLNNCW.js} +1 -1
- package/node_modules/pi-lens/dist/chunk-N5FBM25N.js +22 -0
- package/node_modules/pi-lens/dist/{chunk-CYRKQRPM.js → chunk-NFNVDDGB.js} +2 -4
- package/node_modules/pi-lens/dist/{chunk-RMLC67LF.js → chunk-NLIVE7L6.js} +2 -30
- package/node_modules/pi-lens/dist/{chunk-24AKHFGP.js → chunk-OMJ3OFBJ.js} +6 -6
- package/node_modules/pi-lens/dist/{chunk-IQWN5JCP.js → chunk-OZNCKLOX.js} +13 -14
- package/node_modules/pi-lens/dist/chunk-P5XUGPIX.js +31 -0
- package/node_modules/pi-lens/dist/{chunk-2KXTHF3M.js → chunk-PJXNTPB2.js} +253 -33
- package/node_modules/pi-lens/dist/chunk-PKOXJIVT.js +88 -0
- package/node_modules/pi-lens/dist/{chunk-DGUKIYSI.js → chunk-PP2A5V2T.js} +8 -10
- package/node_modules/pi-lens/dist/{chunk-KAPJINKN.js → chunk-Q42LJANT.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-UZ2XCLYS.js → chunk-Q4BKKOVC.js} +8 -8
- package/node_modules/pi-lens/dist/{chunk-TIQ2PKDW.js → chunk-QT66NEYN.js} +4 -4
- package/node_modules/pi-lens/dist/{chunk-U44DJXQP.js → chunk-RCHO5W7M.js} +15 -18
- package/node_modules/pi-lens/dist/{chunk-YH5MVY2U.js → chunk-RG3MXTRI.js} +7 -7
- package/node_modules/pi-lens/dist/chunk-RG7OODGM.js +57 -0
- package/node_modules/pi-lens/dist/{chunk-OHKJ7PQF.js → chunk-RU34BA4D.js} +43 -39
- package/node_modules/pi-lens/dist/{chunk-JMYYOTQG.js → chunk-S26LC76R.js} +13 -1
- package/node_modules/pi-lens/dist/{chunk-XBJVAEEO.js → chunk-S55TEC7I.js} +3 -2
- package/node_modules/pi-lens/dist/{chunk-RVK72CZX.js → chunk-SJHC3BCZ.js} +1397 -481
- package/node_modules/pi-lens/dist/{chunk-IYNJ6YPZ.js → chunk-SNEUMLM7.js} +4 -4
- package/node_modules/pi-lens/dist/{chunk-S67KYG37.js → chunk-T4NGVFYI.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-YCWYO6TQ.js → chunk-THEXI2QO.js} +48 -45
- package/node_modules/pi-lens/dist/{chunk-AMERCH6V.js → chunk-TL2TCJYL.js} +15 -16
- package/node_modules/pi-lens/dist/{chunk-KUA4OJ5Y.js → chunk-TPYYEDP5.js} +823 -350
- package/node_modules/pi-lens/dist/{chunk-YNE3RP52.js → chunk-TVZRLTG6.js} +8 -1
- package/node_modules/pi-lens/dist/{chunk-ROYSX2S5.js → chunk-UCVMSOXF.js} +2 -2
- package/node_modules/pi-lens/dist/chunk-UL5SXQVX.js +32 -0
- package/node_modules/pi-lens/dist/{chunk-7HXE67BN.js → chunk-UO66IMVP.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-VOOAPROD.js → chunk-UVY4TOJH.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-RKBXZN3A.js → chunk-VIDEKABZ.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-2FN63LPV.js → chunk-VITFDI3O.js} +13 -14
- package/node_modules/pi-lens/dist/{chunk-6DLWKFEX.js → chunk-VUAVE3QC.js} +41 -42
- package/node_modules/pi-lens/dist/{chunk-FM4RDMKT.js → chunk-WUY4BZEP.js} +10 -12
- package/node_modules/pi-lens/dist/{chunk-SD4I7ZO4.js → chunk-X3UTCXAA.js} +43 -53
- package/node_modules/pi-lens/dist/chunk-XHDBJODR.js +45 -0
- package/node_modules/pi-lens/dist/{chunk-5IUSNGOC.js → chunk-XHLK33VM.js} +28 -21
- package/node_modules/pi-lens/dist/{chunk-3KAZU3VR.js → chunk-XI34NWDI.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-QBFBRV2B.js → chunk-XWFIHYCH.js} +4 -2
- package/node_modules/pi-lens/dist/{chunk-JUKMK5Y4.js → chunk-Y2TPADJR.js} +10 -11
- package/node_modules/pi-lens/dist/{chunk-EBC36LNN.js → chunk-Y5KTA2OB.js} +17 -17
- package/node_modules/pi-lens/dist/{chunk-HYGZEMX6.js → chunk-YKVDBNPO.js} +11 -5
- package/node_modules/pi-lens/dist/{chunk-KN35K52N.js → chunk-YSDPVDFC.js} +3 -3
- package/node_modules/pi-lens/dist/chunk-YWNO5Q4R.js +44 -0
- package/node_modules/pi-lens/dist/{chunk-US7ECLD7.js → chunk-YWWG4AQA.js} +119 -28
- package/node_modules/pi-lens/dist/{chunk-O4NWQT6I.js → chunk-YXDCRUKQ.js} +4 -4
- package/node_modules/pi-lens/dist/{chunk-XYURS6EN.js → chunk-YXGRRORB.js} +15 -17
- package/node_modules/pi-lens/dist/{chunk-IUE7SSKV.js → chunk-ZAPSUBLU.js} +13 -7
- package/node_modules/pi-lens/dist/{chunk-EUXZEFTV.js → chunk-ZPJM7DID.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-5HSRT26B.js → chunk-ZSUX7KEM.js} +16 -15
- package/node_modules/pi-lens/dist/index.js +37155 -32210
- package/node_modules/pi-lens/dist/mcp/analyze-cli.js +11 -12
- package/node_modules/pi-lens/dist/mcp/cli.js +46 -45
- package/node_modules/pi-lens/dist/mcp/server.js +1210 -574
- package/node_modules/pi-lens/dist/mcp/worker.js +65 -65
- package/node_modules/pi-lens/dist/probes/installer.js +21 -23
- package/node_modules/pi-lens/docs/adr/0010-trace-validation-session-lifecycle.md +390 -0
- package/node_modules/pi-lens/docs/adr/README.md +1 -0
- package/node_modules/pi-lens/docs/ast-grep_rules_catalog.md +5 -3
- package/node_modules/pi-lens/docs/configuration.md +9 -0
- package/node_modules/pi-lens/docs/engineering-principles.md +12 -0
- package/node_modules/pi-lens/docs/environment-variables.md +20 -0
- package/node_modules/pi-lens/docs/features.md +16 -1
- package/node_modules/pi-lens/docs/globalconfig.md +37 -8
- package/node_modules/pi-lens/docs/lsp-capability-matrix.md +105 -12
- package/node_modules/pi-lens/docs/lsp-idle-eviction.md +37 -18
- package/node_modules/pi-lens/docs/pi-lens-fixer.md +22 -1
- package/node_modules/pi-lens/docs/pi-lens-investigator.md +14 -0
- package/node_modules/pi-lens/docs/pi-lens-merge-policy.md +23 -10
- package/node_modules/pi-lens/docs/pi-lens-monitor.md +64 -8
- package/node_modules/pi-lens/docs/pi-lens-retro.md +2 -2
- package/node_modules/pi-lens/docs/pi-lens-reviewer.md +48 -1
- package/node_modules/pi-lens/docs/pi-lens-subagent.md +8 -1
- package/node_modules/pi-lens/docs/release-qa-baseline.md +19 -7
- package/node_modules/pi-lens/docs/servercapabilities.md +47 -47
- package/node_modules/pi-lens/docs/settings.md +9 -5
- package/node_modules/pi-lens/docs/subagent-compat.md +1 -1
- package/node_modules/pi-lens/docs/usage.md +1 -0
- package/node_modules/pi-lens/package.json +6 -4
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-return-value-in-generator-test.yml +17 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-sql-in-code-execute-js-test.yml +86 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-sql-in-code-execute-test.yml +86 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/unchecked-numeric-parse-python-test.yml +15 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-return-value-in-generator.yml +9 -4
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-sql-in-code-execute-js.yml +119 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-sql-in-code-execute.yml +119 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/unchecked-numeric-parse-python.yml +13 -2
- package/node_modules/pi-lens/rules/rule-catalog.json +25 -1
- package/node_modules/pi-lens/scripts/analyze-pi-lens-logs.mjs +15 -5
- package/node_modules/pi-lens/scripts/lib/is-main-module.mjs +27 -0
- package/node_modules/pi-lens/scripts/lib/scratch-home-env.mjs +21 -0
- package/node_modules/pi-lens/scripts/rpc-load-check.mjs +4 -6
- package/node_modules/pi-lens/scripts/warm-loader-cache.mjs +2 -5
- package/node_modules/pi-next-cue/package.json +4 -1
- package/node_modules/pi-typesafe/README.md +6 -6
- package/node_modules/pi-typesafe/dist/ask.js +9 -2
- package/node_modules/pi-typesafe/dist/auth.d.ts +3 -2
- package/node_modules/pi-typesafe/dist/auth.js +2 -2
- package/node_modules/pi-typesafe/dist/backends.d.ts +20 -5
- package/node_modules/pi-typesafe/dist/backends.js +32 -8
- package/node_modules/pi-typesafe/dist/batch.d.ts +1 -1
- package/node_modules/pi-typesafe/dist/batch.js +2 -2
- package/node_modules/pi-typesafe/dist/client.d.ts +1 -1
- package/node_modules/pi-typesafe/dist/client.js +24 -12
- package/node_modules/pi-typesafe/dist/credentials.d.ts +8 -6
- package/node_modules/pi-typesafe/dist/credentials.js +70 -16
- package/node_modules/pi-typesafe/dist/extension.js +118 -26
- package/node_modules/pi-typesafe/dist/index.d.ts +1 -1
- package/node_modules/pi-typesafe/dist/index.js +1 -1
- package/node_modules/pi-typesafe/dist/key-prompt.d.ts +1 -1
- package/node_modules/pi-typesafe/dist/key-prompt.js +6 -6
- package/node_modules/pi-typesafe/dist/login.d.ts +11 -10
- package/node_modules/pi-typesafe/dist/login.js +24 -21
- package/node_modules/pi-typesafe/dist/schema.d.ts +8 -8
- package/node_modules/pi-typesafe/dist/schema.js +29 -7
- package/node_modules/pi-typesafe/package.json +2 -2
- package/node_modules/pi-web-access/CHANGELOG.md +40 -0
- package/node_modules/pi-web-access/README.md +96 -22
- package/node_modules/pi-web-access/brave-rate-limit.ts +2 -2
- package/node_modules/pi-web-access/curator-page.ts +3 -1
- package/node_modules/pi-web-access/curator-server.ts +1 -0
- package/node_modules/pi-web-access/dist/index.js +2607 -1674
- package/node_modules/pi-web-access/dist/mcp-cli.js +1119 -327
- package/node_modules/pi-web-access/duckduckgo-rate-limit.ts +95 -0
- package/node_modules/pi-web-access/duckduckgo.ts +51 -45
- package/node_modules/pi-web-access/exa.ts +48 -6
- package/node_modules/pi-web-access/extract.ts +2 -2
- package/node_modules/pi-web-access/fetch-params.ts +5 -4
- package/node_modules/pi-web-access/field-extract.ts +347 -0
- package/node_modules/pi-web-access/gemini-search.ts +151 -13
- package/node_modules/pi-web-access/index.ts +128 -125
- package/node_modules/pi-web-access/mistral-search.ts +1 -1
- package/node_modules/pi-web-access/ninerouter.ts +92 -0
- package/node_modules/pi-web-access/offtopic-judge.ts +72 -0
- package/node_modules/pi-web-access/openai-search.ts +36 -10
- package/node_modules/pi-web-access/package.json +1 -1
- package/node_modules/pi-web-access/perplexity.ts +1 -0
- package/node_modules/pi-web-access/query-rewrite.ts +39 -13
- package/node_modules/pi-web-access/source-check.ts +31 -15
- package/node_modules/pi-web-access/summary-model-scope.ts +19 -1
- package/node_modules/pi-web-access/summary-review.ts +13 -20
- package/node_modules/pi-web-access/tool-arguments.ts +1 -1
- package/node_modules/pi-web-access/upgrade-notice.ts +47 -0
- package/node_modules/pi-web-access/utils.ts +26 -1
- package/node_modules/pi-web-access/web-tool-contract.ts +4 -1
- package/node_modules/pi-web-access/web-tool-core.ts +99 -19
- package/node_modules/pi-web-access/xai-search.ts +3 -3
- package/package.json +15 -15
- package/node_modules/pi-lens/dist/chunk-3PTHXJXR.js +0 -28
- package/node_modules/pi-lens/dist/chunk-3QED2P4V.js +0 -31
- package/node_modules/pi-lens/dist/chunk-5WRPDP2A.js +0 -47
- package/node_modules/pi-lens/dist/chunk-ABBOA7UD.js +0 -157
- package/node_modules/pi-lens/dist/chunk-CUHSHSB6.js +0 -273
- package/node_modules/pi-lens/dist/chunk-GL5LUMZE.js +0 -51
- package/node_modules/pi-lens/dist/chunk-HAD7QRQI.js +0 -30
- package/node_modules/pi-lens/dist/chunk-JORED7EX.js +0 -44
- package/node_modules/pi-lens/dist/chunk-KYUB6QDC.js +0 -72
- package/node_modules/pi-lens/dist/chunk-LZSEQW6A.js +0 -57
- package/node_modules/pi-lens/dist/chunk-M2IFVFWU.js +0 -79
- package/node_modules/pi-lens/dist/chunk-M2UD3LPU.js +0 -88
- package/node_modules/pi-lens/dist/chunk-MBKQHGA7.js +0 -39
- package/node_modules/pi-lens/dist/chunk-R7YOCSNV.js +0 -23
- package/node_modules/pi-lens/dist/chunk-SKAMFC7A.js +0 -28
- package/node_modules/pi-lens/dist/chunk-SYE6T2EB.js +0 -28
- package/node_modules/pi-lens/dist/chunk-TRETHTQO.js +0 -26
- package/node_modules/pi-lens/dist/chunk-UA7ZXYDR.js +0 -184
- package/node_modules/pi-lens/dist/chunk-XTFDJI3T.js +0 -24
- package/node_modules/pi-lens/dist/chunk-Z3CCVDUB.js +0 -76
- package/node_modules/pi-next-cue/.github/workflows/publish.yml +0 -20
|
@@ -1,12 +1,33 @@
|
|
|
1
1
|
import { Text } from "@earendil-works/pi-tui";
|
|
2
|
-
import { DEFAULT_BACKEND,
|
|
2
|
+
import { BACKEND_ENV, DEFAULT_BACKEND, DECISIONS_BACKENDS, MODEL_ENV, backendFromEnvironment, backendHost, modelFromEnvironment, resolveBackend, sentModelId } from "./backends.js";
|
|
3
3
|
import { createTypeSafe, DEFAULT_MAX_REQUESTS } from "./client.js";
|
|
4
4
|
import { authState, clearAuthState, describeAuth } from "./auth.js";
|
|
5
5
|
import { clearStoredApiKey, credentialsPath, keySituation, keySourceLabel } from "./credentials.js";
|
|
6
6
|
import { TypeSafeIntegrationError, safeError } from "./errors.js";
|
|
7
7
|
import { loginWithPrompt } from "./login.js";
|
|
8
8
|
import { DEFAULT_MAX_INPUT_BYTES, evaluationSchema, normalizeEvaluationRequest, prepareEvaluationRequest } from "./schema.js";
|
|
9
|
-
const
|
|
9
|
+
const fixedDisclosure = "Submitted state and questions will be sent to api.typesafe.ai and may incur charges. Do not include secrets. The extension does not collect files or conversation history. Results are model judgments, not proof or authorization.";
|
|
10
|
+
/**
|
|
11
|
+
* The consent sentence for the backend this session actually uses, and whether it names the model sent. The default
|
|
12
|
+
* backend with no model override returns the fixed sentence unchanged, so an install that selects nothing reads
|
|
13
|
+
* exactly what it read before. Every other session is told the host, the backend, and the model id the request
|
|
14
|
+
* carries — the same `sentModelId` value the client sends, so consent cannot describe a model that is not sent.
|
|
15
|
+
*/
|
|
16
|
+
function consentFor(backend, model) {
|
|
17
|
+
const namesModel = backend !== DEFAULT_BACKEND || model !== undefined;
|
|
18
|
+
if (!namesModel)
|
|
19
|
+
return { text: fixedDisclosure, namesModel };
|
|
20
|
+
const config = resolveBackend(backend);
|
|
21
|
+
return {
|
|
22
|
+
text: `Submitted state and questions will be sent to ${backendHost(backend)} (${config.label}) as model ${JSON.stringify(sentModelId(backend, model))} and may incur charges. Do not include secrets. The extension does not collect files or conversation history. Results are model judgments, not proof or authorization.`,
|
|
23
|
+
namesModel,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/** The status line naming the backend, its host, and its key variable; the model is stated once, by `Model:` or the consent sentence. */
|
|
27
|
+
function backendLine(backend) {
|
|
28
|
+
const config = resolveBackend(backend);
|
|
29
|
+
return `${config.label} backend: ${backendHost(backend)}, key from ${config.keyEnv}.`;
|
|
30
|
+
}
|
|
10
31
|
const sample = {
|
|
11
32
|
state: { message: "I was charged twice for my subscription. Please help today." },
|
|
12
33
|
questions: {
|
|
@@ -15,6 +36,8 @@ const sample = {
|
|
|
15
36
|
frustration: { type: "score", instructions: "How frustrated does the sender sound?", criteria: ["Neutral request", "Frustrated but civil", "Angry or threatening"] },
|
|
16
37
|
},
|
|
17
38
|
};
|
|
39
|
+
/** 0.7.0 reports a count it did not measure as null; name it instead of printing "null". */
|
|
40
|
+
const formatNumber = (count) => (count === null ? "not reported" : String(count));
|
|
18
41
|
function format(result, expanded = false) {
|
|
19
42
|
const lines = [`TypeSafe · ${JSON.stringify(result.model)} · ${result.elapsedMs} ms`];
|
|
20
43
|
for (const [id, answer] of Object.entries(result.answers)) {
|
|
@@ -23,22 +46,37 @@ function format(result, expanded = false) {
|
|
|
23
46
|
lines.push(`${label}: P(yes) = ${answer.noul.toFixed(3)}`);
|
|
24
47
|
else if (answer.type === "choice")
|
|
25
48
|
lines.push(`${label}: ${JSON.stringify(answer.choice)} · confidence ${answer.confidence.toFixed(3)}`);
|
|
26
|
-
else
|
|
49
|
+
else if (answer.type === "score")
|
|
27
50
|
lines.push(`${label}: ${answer.score.toFixed(3)} · confidence ${answer.confidence.toFixed(3)}`);
|
|
28
|
-
|
|
51
|
+
else
|
|
52
|
+
lines.push(`${label}: box ${JSON.stringify(answer.box)} · confidence ${formatNumber(answer.confidence)}`);
|
|
53
|
+
if (expanded && (answer.type === "choice" || answer.type === "score"))
|
|
29
54
|
lines.push(` ${JSON.stringify(answer.probabilities)}`);
|
|
30
55
|
}
|
|
31
|
-
lines.push(`${result.usage.input_tokens} input / ${result.usage.output_tokens} output tokens`);
|
|
56
|
+
lines.push(`${formatNumber(result.usage.input_tokens)} input / ${formatNumber(result.usage.output_tokens)} output tokens`);
|
|
32
57
|
lines.push("Confidence is distribution concentration, not proof of correctness.");
|
|
33
58
|
return lines.join("\n");
|
|
34
59
|
}
|
|
35
60
|
/** Native Pi registration; importing the root library does not load this module. */
|
|
36
61
|
export default function typesafeExtension(pi) {
|
|
37
62
|
let enabled = process.env.PI_TYPESAFE_ENABLED === "1";
|
|
63
|
+
// Resolved once per process: the backend names the host every request goes to, so it cannot change mid-session.
|
|
64
|
+
let backend;
|
|
65
|
+
let model;
|
|
66
|
+
let backendError;
|
|
67
|
+
try {
|
|
68
|
+
backend = backendFromEnvironment();
|
|
69
|
+
model = modelFromEnvironment();
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
backend = DEFAULT_BACKEND;
|
|
73
|
+
backendError = safeError(error).message;
|
|
74
|
+
}
|
|
75
|
+
const consent = consentFor(backend, model);
|
|
38
76
|
let client;
|
|
39
77
|
// One callout per distinct degradation per session: a long run must not bury the reason in repeated notices.
|
|
40
78
|
let calledOut;
|
|
41
|
-
const getClient = () => client ??= createTypeSafe();
|
|
79
|
+
const getClient = () => client ??= createTypeSafe({ backend, ...(model === undefined ? {} : { model }) });
|
|
42
80
|
const callOut = (ctx, key, text) => {
|
|
43
81
|
if (calledOut === key)
|
|
44
82
|
return;
|
|
@@ -59,16 +97,19 @@ export default function typesafeExtension(pi) {
|
|
|
59
97
|
calledOut = undefined;
|
|
60
98
|
// An enabled extension with no usable key used to look exactly like a working one. Say it at startup; an
|
|
61
99
|
// unverified-but-present key stays quiet, because the first request is what proves it.
|
|
62
|
-
const auth = describeAuth(authState());
|
|
63
|
-
|
|
100
|
+
const auth = describeAuth(authState({ backend }));
|
|
101
|
+
// A backend name the registry does not know means no judgment can be sent at all, whether or not it is enabled.
|
|
102
|
+
if (backendError !== undefined)
|
|
103
|
+
callOut(ctx, `start:backend`, `${backendError} Judgments are skipped until ${BACKEND_ENV} names a valid backend or is unset.`);
|
|
104
|
+
else if (enabled && auth.level === "error")
|
|
64
105
|
callOut(ctx, `start:${auth.level}`, `TypeSafe is enabled but judgments are skipped. ${auth.text}`);
|
|
65
106
|
});
|
|
66
107
|
pi.registerEntryRenderer("typesafe-result", (entry, { expanded }) => new Text(entry.data ? format(entry.data, expanded) : "TypeSafe · no result", 0, 0));
|
|
67
108
|
pi.registerTool({
|
|
68
109
|
name: "typesafe_evaluate",
|
|
69
110
|
label: "TypeSafe",
|
|
70
|
-
description: `Evaluate supplied state with independent Choice, Score, and Noul questions in one
|
|
71
|
-
promptSnippet:
|
|
111
|
+
description: `Evaluate supplied state with independent Choice, Score, and Noul questions in one ${resolveBackend(backend).label} request. Each question judges the whole state, so when several items are involved, put each item in a named state field (e.g. \`reports.r1\`) and ask one question per item per dimension (e.g. \`r1_owner\`, \`r2_owner\`), naming the field in the instructions; never aggregate several items into one question. ${consent.text} Requires operator opt-in via /typesafe enable or PI_TYPESAFE_ENABLED=1. Limit: 32 questions, ${DEFAULT_MAX_INPUT_BYTES / 1024} KiB JSON, ${DEFAULT_MAX_REQUESTS} attempts per session; no retries.`,
|
|
112
|
+
promptSnippet: `Ask batched structured questions with ${resolveBackend(backend).label} (external service; operator opt-in required)`,
|
|
72
113
|
promptGuidelines: [
|
|
73
114
|
// The payload shape is what models get wrong on the first call; the same sample the playground edits is the cheapest way to show it.
|
|
74
115
|
// Every session pays for this line on every tool listing, so the sample stays short.
|
|
@@ -84,6 +125,8 @@ export default function typesafeExtension(pi) {
|
|
|
84
125
|
async execute(_id, params, signal, _onUpdate, ctx) {
|
|
85
126
|
if (!enabled)
|
|
86
127
|
throw new TypeSafeIntegrationError("configuration", "TypeSafe is disabled. Ask the operator to run /typesafe enable; do not enable it by editing configuration or environment files.");
|
|
128
|
+
if (backendError !== undefined)
|
|
129
|
+
throw new TypeSafeIntegrationError("configuration", backendError);
|
|
87
130
|
// The tool admits through the same rule as the library; evaluate() re-runs it idempotently.
|
|
88
131
|
const request = prepareEvaluationRequest(params);
|
|
89
132
|
try {
|
|
@@ -115,37 +158,82 @@ export default function typesafeExtension(pi) {
|
|
|
115
158
|
pi.registerCommand("typesafe", {
|
|
116
159
|
description: "TypeSafe login, consent, usage, sample test, and JSON playground",
|
|
117
160
|
getArgumentCompletions(prefix) {
|
|
161
|
+
const [verb, ...rest] = prefix.split(/\s+/);
|
|
162
|
+
if (rest.length && (verb === "login" || verb === "logout")) {
|
|
163
|
+
const typed = rest.join(" ");
|
|
164
|
+
const names = Object.keys(DECISIONS_BACKENDS).filter(name => name.startsWith(typed));
|
|
165
|
+
return names.length ? names.map(name => ({ value: `${verb} ${name}`, label: name })) : null;
|
|
166
|
+
}
|
|
118
167
|
const matches = actions.filter(action => action.startsWith(prefix)).map(action => ({ value: action, label: action }));
|
|
119
168
|
return matches.length ? matches : null;
|
|
120
169
|
},
|
|
121
170
|
async handler(args, ctx) {
|
|
122
|
-
const action = args.trim()
|
|
171
|
+
const [action = "status", ...rest] = args.trim().split(/\s+/).filter(Boolean);
|
|
172
|
+
const backendArg = rest[0];
|
|
173
|
+
const backendChoices = Object.keys(DECISIONS_BACKENDS).join(", ");
|
|
123
174
|
const report = (text, level = "info") => {
|
|
124
175
|
if (ctx.hasUI)
|
|
125
176
|
ctx.ui.notify(text, level);
|
|
126
177
|
else
|
|
127
178
|
pi.sendMessage({ customType: "typesafe-status", content: text, display: true });
|
|
128
179
|
};
|
|
180
|
+
// No key change makes an unusable backend name work: decline instead of prompting for a key or deleting the
|
|
181
|
+
// stored one a later valid run would want.
|
|
182
|
+
if (backendError !== undefined && (action === "login" || action === "logout")) {
|
|
183
|
+
report(`${backendError} No key change fixes that, so /typesafe ${action} does nothing: fix or unset ${BACKEND_ENV} first.`, "warning");
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
129
186
|
try {
|
|
187
|
+
// A backend the command names, or this session's own backend when it names none, so the commands act on
|
|
188
|
+
// what judgments actually use. resolveBackend refuses a name the registry does not know.
|
|
189
|
+
const spec = backendArg === undefined ? backend : backendArg;
|
|
190
|
+
const config = resolveBackend(spec);
|
|
191
|
+
const isActive = config.keyEnv === resolveBackend(backend).keyEnv;
|
|
192
|
+
const situation = keySituation(backend);
|
|
130
193
|
if (action === "status") {
|
|
131
194
|
const spend = client?.getSpend();
|
|
132
|
-
const auth = describeAuth(authState());
|
|
195
|
+
const auth = describeAuth(authState({ backend }));
|
|
133
196
|
const session = spend
|
|
134
197
|
? `Session ${spend.session.requestsStarted}/${DEFAULT_MAX_REQUESTS} attempts, ${spend.session.requestsSucceeded} successful, ${spend.session.requestsFailed} failed, ${spend.session.inputTokens} input tokens (~$${spend.session.estimatedUsd.toFixed(4)}).`
|
|
135
198
|
: `Session 0/${DEFAULT_MAX_REQUESTS} attempts; no client yet in this session.`;
|
|
136
199
|
const today = spend
|
|
137
200
|
? `Today ${spend.today.requestsStarted} requests (${spend.today.requestsSucceeded} ok, ${spend.today.requestsFailed} failed), ${spend.today.inputTokens} input tokens, ~$${spend.today.estimatedUsd.toFixed(4)}.`
|
|
138
201
|
: "";
|
|
139
|
-
const blocked = spend?.blocked ? `
|
|
140
|
-
|
|
202
|
+
const blocked = spend?.blocked ? `Cap reached: ${spend.blocked.cap} ${spend.blocked.used}/${spend.blocked.limit} on ${spend.blocked.day}; no request will be submitted until the local day rolls over.` : "";
|
|
203
|
+
// The backend, host, and key source lead, so a status line cannot describe the TypeSafe key while another
|
|
204
|
+
// backend serves the requests. The model is named once: by `Model:` when the consent sentence is the fixed
|
|
205
|
+
// one that names none, otherwise by the consent sentence itself. An unusable name sends nothing, so that
|
|
206
|
+
// status names no model and quotes no consent.
|
|
207
|
+
const route = backendError !== undefined
|
|
208
|
+
? `Backend: ${BACKEND_ENV} is invalid — ${backendError} Judgments are skipped.`
|
|
209
|
+
: backendLine(backend);
|
|
210
|
+
const version = backendError === undefined && !consent.namesModel ? `Model: ${sentModelId(backend, model)}.` : "";
|
|
211
|
+
report([
|
|
212
|
+
`TypeSafe: ${enabled ? "enabled" : "disabled"}.`,
|
|
213
|
+
route,
|
|
214
|
+
auth.text,
|
|
215
|
+
session,
|
|
216
|
+
today,
|
|
217
|
+
blocked,
|
|
218
|
+
version,
|
|
219
|
+
backend === DEFAULT_BACKEND ? "" : `Set ${MODEL_ENV} to send another model.`,
|
|
220
|
+
"Session limits reset on session start/reload; daily counters persist and caps come from client options or PI_TYPESAFE_MAX_* environment variables.",
|
|
221
|
+
backendError === undefined ? consent.text : "",
|
|
222
|
+
].filter((part) => part !== "").join(" "), (auth.level === "error" && enabled) || backendError !== undefined ? "warning" : "info");
|
|
141
223
|
return;
|
|
142
224
|
}
|
|
143
225
|
if (action === "logout") {
|
|
144
|
-
const removed = clearStoredApiKey();
|
|
226
|
+
const removed = clearStoredApiKey(spec);
|
|
145
227
|
clearAuthState();
|
|
146
228
|
client = undefined;
|
|
147
|
-
|
|
148
|
-
|
|
229
|
+
const env = process.env[config.keyEnv]?.trim();
|
|
230
|
+
// A session with consent but no key can only fail the next call; logging out another backend's key changes nothing.
|
|
231
|
+
if (isActive && !env)
|
|
232
|
+
enabled = false;
|
|
233
|
+
const tail = env
|
|
234
|
+
? ` ${config.keyEnv} is still set in the environment and takes precedence over a stored key.`
|
|
235
|
+
: (isActive ? " Judgments are off for this session." : "");
|
|
236
|
+
report(`${removed ? `Removed the stored ${config.label} key at ${credentialsPath()}.` : `No stored ${config.label} key to remove.`}${tail}`);
|
|
149
237
|
return;
|
|
150
238
|
}
|
|
151
239
|
if (action === "disable") {
|
|
@@ -154,26 +242,30 @@ export default function typesafeExtension(pi) {
|
|
|
154
242
|
return;
|
|
155
243
|
}
|
|
156
244
|
if (!actions.includes(action)) {
|
|
157
|
-
report(`Usage: /typesafe ${actions.join(" | ")}
|
|
245
|
+
report(`Usage: /typesafe ${actions.join(" | ")}. login and logout take a backend name: ${backendChoices}.`, "warning");
|
|
158
246
|
return;
|
|
159
247
|
}
|
|
160
248
|
if (!ctx.hasUI) {
|
|
161
|
-
report(
|
|
249
|
+
report(`This command needs interactive Pi. For headless tool use, explicitly set PI_TYPESAFE_ENABLED=1 and ${config.keyEnv} before launching Pi.`, "warning");
|
|
162
250
|
return;
|
|
163
251
|
}
|
|
164
|
-
const situation = keySituation();
|
|
165
252
|
if (action === "login" || (action === "setup" && situation.kind === "missing")) {
|
|
166
|
-
|
|
167
|
-
|
|
253
|
+
// The one rule for every backend: the stored key is used unless the backend's variable is set, and then it wins.
|
|
254
|
+
if (process.env[config.keyEnv]?.trim()) {
|
|
255
|
+
report(`${config.keyEnv} is set in the environment and takes precedence over a stored key. Unset it before using /typesafe login.`, "warning");
|
|
168
256
|
return;
|
|
169
257
|
}
|
|
170
|
-
const login = await loginWithPrompt(ctx);
|
|
258
|
+
const login = await loginWithPrompt(ctx, { backend: spec });
|
|
171
259
|
if (login === undefined) {
|
|
172
260
|
report("Login cancelled; nothing was saved.");
|
|
173
261
|
return;
|
|
174
262
|
}
|
|
175
263
|
client = undefined;
|
|
176
|
-
|
|
264
|
+
const proof = login.models === undefined ? "verified with one request" : `verified (${login.models} model${login.models === 1 ? "" : "s"} available)`;
|
|
265
|
+
const hint = isActive
|
|
266
|
+
? (enabled ? "" : " Run /typesafe enable to allow agent tool calls.")
|
|
267
|
+
: ` ${BACKEND_ENV} is ${backend}; set it to ${config.name} to send judgments there.`;
|
|
268
|
+
report(`${config.label} key ${proof} and saved to ${login.path} with owner-only permissions.${hint}`);
|
|
177
269
|
return;
|
|
178
270
|
}
|
|
179
271
|
if (action === "setup") {
|
|
@@ -192,7 +284,7 @@ export default function typesafeExtension(pi) {
|
|
|
192
284
|
report(`The stored key cannot be used. ${situation.reason}`, "warning");
|
|
193
285
|
return;
|
|
194
286
|
}
|
|
195
|
-
if (await ctx.ui.confirm("Enable TypeSafe for this session?",
|
|
287
|
+
if (await ctx.ui.confirm("Enable TypeSafe for this session?", consent.text)) {
|
|
196
288
|
enabled = true;
|
|
197
289
|
report(`TypeSafe enabled. Up to ${DEFAULT_MAX_REQUESTS} attempts in this session; /typesafe disable stops future agent calls.`);
|
|
198
290
|
}
|
|
@@ -212,7 +304,7 @@ export default function typesafeExtension(pi) {
|
|
|
212
304
|
}
|
|
213
305
|
}
|
|
214
306
|
const validated = prepareEvaluationRequest(request);
|
|
215
|
-
if (!await ctx.ui.confirm("Send this TypeSafe request?",
|
|
307
|
+
if (!await ctx.ui.confirm("Send this TypeSafe request?", consent.text))
|
|
216
308
|
return;
|
|
217
309
|
const result = await getClient().evaluate(validated);
|
|
218
310
|
// Playground results stay out of LLM context; the agent tool returns its own results normally.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { createTypeSafe, backendHost, backendPrice, resolveBackend, DEFAULT_MAX_REQUESTS, DECISIONS_BACKENDS, DEFAULT_BACKEND } from "./client.js";
|
|
1
|
+
export { createTypeSafe, backendHost, backendPrice, backendFromEnvironment, modelFromEnvironment, resolveBackend, sentModelId, BACKEND_ENV, MODEL_ENV, DEFAULT_MAX_REQUESTS, DECISIONS_BACKENDS, DEFAULT_BACKEND } from "./client.js";
|
|
2
2
|
export type { TypeSafe, TypeSafeOptions, EvaluationOptions, Evaluation, UsageSnapshot, SpendReport, TypeSafeBackend, BackendConfig, BackendEndpoint, BackendSpec, RegistryBackendConfig, ResolvedBackend, } from "./client.js";
|
|
3
3
|
export { ask, DEFAULT_ASK_TIMEOUT_MS } from "./ask.js";
|
|
4
4
|
export type { AskAnswer, AskOptions, Judge } from "./ask.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { createTypeSafe, backendHost, backendPrice, resolveBackend, DEFAULT_MAX_REQUESTS, DECISIONS_BACKENDS, DEFAULT_BACKEND } from "./client.js";
|
|
1
|
+
export { createTypeSafe, backendHost, backendPrice, backendFromEnvironment, modelFromEnvironment, resolveBackend, sentModelId, BACKEND_ENV, MODEL_ENV, DEFAULT_MAX_REQUESTS, DECISIONS_BACKENDS, DEFAULT_BACKEND } from "./client.js";
|
|
2
2
|
export { ask, DEFAULT_ASK_TIMEOUT_MS } from "./ask.js";
|
|
3
3
|
export { fanOut, DEFAULT_CONCURRENCY, evaluateMany, evaluateAll, chunkEvaluationRequest } from "./batch.js";
|
|
4
4
|
export { authState, authStatePath, clearAuthState, describeAuth, recordAuthFailure, recordAuthVerified } from "./auth.js";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
/** Hidden input in the TUI; falls back to Pi's plain input dialog where custom components are unavailable. */
|
|
3
|
-
export declare function promptForApiKey(ctx: ExtensionCommandContext): Promise<string | undefined>;
|
|
3
|
+
export declare function promptForApiKey(ctx: ExtensionCommandContext, label?: string): Promise<string | undefined>;
|
|
@@ -11,10 +11,10 @@ class SecretInput extends Input {
|
|
|
11
11
|
class KeyPrompt extends Container {
|
|
12
12
|
input = new SecretInput();
|
|
13
13
|
isFocused = false;
|
|
14
|
-
constructor(theme, done) {
|
|
14
|
+
constructor(theme, label, done) {
|
|
15
15
|
super();
|
|
16
|
-
this.addChild(new Text(theme.fg("accent", theme.bold(
|
|
17
|
-
this.addChild(new Text(theme.fg("muted", "Paste the key
|
|
16
|
+
this.addChild(new Text(theme.fg("accent", theme.bold(`${label} API key`)), 1, 0));
|
|
17
|
+
this.addChild(new Text(theme.fg("muted", "Paste the key. Input is hidden. Enter saves, Esc cancels."), 1, 0));
|
|
18
18
|
this.addChild(this.input);
|
|
19
19
|
this.input.onSubmit = value => done(value);
|
|
20
20
|
this.input.onEscape = () => done(undefined);
|
|
@@ -35,9 +35,9 @@ class KeyPrompt extends Container {
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
/** Hidden input in the TUI; falls back to Pi's plain input dialog where custom components are unavailable. */
|
|
38
|
-
export async function promptForApiKey(ctx) {
|
|
38
|
+
export async function promptForApiKey(ctx, label = "TypeSafe") {
|
|
39
39
|
if (typeof ctx.ui.custom === "function") {
|
|
40
|
-
return ctx.ui.custom((_tui, theme, _keybindings, done) => new KeyPrompt(theme, done));
|
|
40
|
+
return ctx.ui.custom((_tui, theme, _keybindings, done) => new KeyPrompt(theme, label, done));
|
|
41
41
|
}
|
|
42
|
-
return ctx.ui.input(
|
|
42
|
+
return ctx.ui.input(`${label} API key (visible while typing)`, "Paste the key, then press Enter");
|
|
43
43
|
}
|
|
@@ -4,16 +4,18 @@ import type { KeySource } from "./credentials.js";
|
|
|
4
4
|
export interface LoginResult {
|
|
5
5
|
/** Where the verified key was saved. */
|
|
6
6
|
path: string;
|
|
7
|
-
/**
|
|
8
|
-
models
|
|
7
|
+
/** Models the key can access, when the backend's model list proves the key. Absent when one judge request proved it. */
|
|
8
|
+
models?: number;
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
|
-
* Prompt for
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* key.
|
|
11
|
+
* Prompt for one backend's key (hidden input), prove it before saving, and store it for every pi-typesafe consumer.
|
|
12
|
+
* A backend whose model list is public is proved with one judge question instead, because that list accepts any key.
|
|
13
|
+
* Resolves to undefined when the user cancels. Rejects with TypeSafeIntegrationError for an invalid or unverifiable
|
|
14
|
+
* key. Refuses when the backend's environment variable is set, because the environment would shadow the stored key.
|
|
15
15
|
*/
|
|
16
|
-
export declare function loginWithPrompt(ctx: ExtensionCommandContext
|
|
16
|
+
export declare function loginWithPrompt(ctx: ExtensionCommandContext, options?: {
|
|
17
|
+
backend?: BackendSpec;
|
|
18
|
+
}): Promise<LoginResult | undefined>;
|
|
17
19
|
export type EnsureApiKeyResult = {
|
|
18
20
|
source: KeySource;
|
|
19
21
|
login?: undefined;
|
|
@@ -24,9 +26,8 @@ export type EnsureApiKeyResult = {
|
|
|
24
26
|
/**
|
|
25
27
|
* Use the configured key for the backend if there is one; otherwise run the login prompt. `undefined` means the user
|
|
26
28
|
* cancelled. A store that must not be read throws `configuration` with the reason instead of prompting, so a
|
|
27
|
-
* permissions problem stays visible; the result shape is frozen for existing callers.
|
|
28
|
-
*
|
|
29
|
-
* the prompt would verify the key against the wrong service and store it where the TypeSafe key lives.
|
|
29
|
+
* permissions problem stays visible; the result shape is frozen for existing callers. Every backend has a login store,
|
|
30
|
+
* so the prompt proves the key against the backend it was asked for and saves it under that backend.
|
|
30
31
|
*/
|
|
31
32
|
export declare function ensureApiKey(ctx: ExtensionCommandContext, options?: {
|
|
32
33
|
backend?: BackendSpec;
|
|
@@ -1,35 +1,42 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { noul } from "@typesafe-ai/sdk";
|
|
2
|
+
import { DEFAULT_BACKEND, resolveBackend } from "./backends.js";
|
|
2
3
|
import { createTypeSafe } from "./client.js";
|
|
3
4
|
import { keySituation, normalizeApiKey, storeApiKey } from "./credentials.js";
|
|
4
5
|
import { TypeSafeIntegrationError } from "./errors.js";
|
|
5
6
|
import { promptForApiKey } from "./key-prompt.js";
|
|
6
7
|
/**
|
|
7
|
-
* Prompt for
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* key.
|
|
8
|
+
* Prompt for one backend's key (hidden input), prove it before saving, and store it for every pi-typesafe consumer.
|
|
9
|
+
* A backend whose model list is public is proved with one judge question instead, because that list accepts any key.
|
|
10
|
+
* Resolves to undefined when the user cancels. Rejects with TypeSafeIntegrationError for an invalid or unverifiable
|
|
11
|
+
* key. Refuses when the backend's environment variable is set, because the environment would shadow the stored key.
|
|
11
12
|
*/
|
|
12
|
-
export async function loginWithPrompt(ctx) {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
export async function loginWithPrompt(ctx, options = {}) {
|
|
14
|
+
const spec = options.backend ?? DEFAULT_BACKEND;
|
|
15
|
+
const config = resolveBackend(spec);
|
|
16
|
+
if (process.env[config.keyEnv]?.trim()) {
|
|
17
|
+
throw new TypeSafeIntegrationError("configuration", `${config.keyEnv} is set in the environment and takes precedence over a stored key. Unset it before logging in interactively.`);
|
|
15
18
|
}
|
|
16
19
|
if (!ctx.hasUI) {
|
|
17
|
-
throw new TypeSafeIntegrationError("configuration",
|
|
20
|
+
throw new TypeSafeIntegrationError("configuration", `Logging in needs an interactive session. Set ${config.keyEnv} in the environment instead.`);
|
|
18
21
|
}
|
|
19
|
-
const entered = await promptForApiKey(ctx);
|
|
22
|
+
const entered = await promptForApiKey(ctx, config.label);
|
|
20
23
|
if (entered === undefined)
|
|
21
24
|
return undefined;
|
|
22
25
|
const key = normalizeApiKey(entered);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
const client = createTypeSafe({ apiKey: key, backend: spec });
|
|
27
|
+
if (config.modelsVerifyKey) {
|
|
28
|
+
const models = await client.listModels();
|
|
29
|
+
return { path: storeApiKey(key, spec), models: models.length };
|
|
30
|
+
}
|
|
31
|
+
// A public model list accepts any key; one judge question proves this one.
|
|
32
|
+
await client.evaluate({ state: "login", questions: { key: noul("Is this key accepted?") } });
|
|
33
|
+
return { path: storeApiKey(key, spec) };
|
|
26
34
|
}
|
|
27
35
|
/**
|
|
28
36
|
* Use the configured key for the backend if there is one; otherwise run the login prompt. `undefined` means the user
|
|
29
37
|
* cancelled. A store that must not be read throws `configuration` with the reason instead of prompting, so a
|
|
30
|
-
* permissions problem stays visible; the result shape is frozen for existing callers.
|
|
31
|
-
*
|
|
32
|
-
* the prompt would verify the key against the wrong service and store it where the TypeSafe key lives.
|
|
38
|
+
* permissions problem stays visible; the result shape is frozen for existing callers. Every backend has a login store,
|
|
39
|
+
* so the prompt proves the key against the backend it was asked for and saves it under that backend.
|
|
33
40
|
*/
|
|
34
41
|
export async function ensureApiKey(ctx, options = {}) {
|
|
35
42
|
const backend = options.backend ?? DEFAULT_BACKEND;
|
|
@@ -38,10 +45,6 @@ export async function ensureApiKey(ctx, options = {}) {
|
|
|
38
45
|
return { source: situation.kind };
|
|
39
46
|
if (situation.kind === "unusable")
|
|
40
47
|
throw new TypeSafeIntegrationError("configuration", situation.reason);
|
|
41
|
-
const
|
|
42
|
-
if (!usesTypesafeKey(config)) {
|
|
43
|
-
throw new TypeSafeIntegrationError("configuration", `No ${config.label} key. Set ${config.keyEnv} in the environment; /typesafe login stores a TypeSafe key only.`);
|
|
44
|
-
}
|
|
45
|
-
const login = await loginWithPrompt(ctx);
|
|
48
|
+
const login = await loginWithPrompt(ctx, { backend });
|
|
46
49
|
return login ? { source: "stored", login } : undefined;
|
|
47
50
|
}
|
|
@@ -19,22 +19,22 @@ export interface BackendLimits {
|
|
|
19
19
|
export declare const DEFAULT_BACKEND_LIMITS: BackendLimits;
|
|
20
20
|
/** The JSON schema used by both the Pi tool and the programmatic interface. */
|
|
21
21
|
export declare const evaluationSchema: Type.TObject<{
|
|
22
|
-
state: Type.TUnion<
|
|
22
|
+
state: Type.TUnion<(Type.TArray<Type.TUnknown> | Type.TRecord<"^.*$", Type.TUnknown> | Type.TString)[]>;
|
|
23
23
|
questions: Type.TRecord<"^.*$", Type.TUnion<[Type.TObject<{
|
|
24
24
|
type: Type.TLiteral<"noul">;
|
|
25
|
-
instructions: Type.TOptional<Type.TUnion<[Type.
|
|
25
|
+
instructions: Type.TOptional<Type.TUnion<[...(Type.TArray<Type.TUnknown> | Type.TRecord<"^.*$", Type.TUnknown> | Type.TString)[], Type.TNull]>>;
|
|
26
26
|
criteria: Type.TOptional<Type.TUnion<[Type.TNull, Type.TObject<{
|
|
27
|
-
true: Type.TOptional<Type.TUnion<[Type.
|
|
28
|
-
false: Type.TOptional<Type.TUnion<[Type.
|
|
27
|
+
true: Type.TOptional<Type.TUnion<[...(Type.TArray<Type.TUnknown> | Type.TRecord<"^.*$", Type.TUnknown> | Type.TString)[], Type.TNull]>>;
|
|
28
|
+
false: Type.TOptional<Type.TUnion<[...(Type.TArray<Type.TUnknown> | Type.TRecord<"^.*$", Type.TUnknown> | Type.TString)[], Type.TNull]>>;
|
|
29
29
|
}>]>>;
|
|
30
30
|
}>, Type.TObject<{
|
|
31
31
|
type: Type.TLiteral<"choice">;
|
|
32
|
-
instructions: Type.TOptional<Type.TUnion<[Type.
|
|
33
|
-
criteria: Type.TRecord<"^.*$", Type.TUnion<[Type.
|
|
32
|
+
instructions: Type.TOptional<Type.TUnion<[...(Type.TArray<Type.TUnknown> | Type.TRecord<"^.*$", Type.TUnknown> | Type.TString)[], Type.TNull]>>;
|
|
33
|
+
criteria: Type.TRecord<"^.*$", Type.TUnion<[...(Type.TArray<Type.TUnknown> | Type.TRecord<"^.*$", Type.TUnknown> | Type.TString)[], Type.TNull]>>;
|
|
34
34
|
}>, Type.TObject<{
|
|
35
35
|
type: Type.TLiteral<"score">;
|
|
36
|
-
instructions: Type.TOptional<Type.TUnion<[Type.
|
|
37
|
-
criteria: Type.TArray<Type.TUnion<[Type.
|
|
36
|
+
instructions: Type.TOptional<Type.TUnion<[...(Type.TArray<Type.TUnknown> | Type.TRecord<"^.*$", Type.TUnknown> | Type.TString)[], Type.TNull]>>;
|
|
37
|
+
criteria: Type.TArray<Type.TUnion<[...(Type.TArray<Type.TUnknown> | Type.TRecord<"^.*$", Type.TUnknown> | Type.TString)[], Type.TNull]>>;
|
|
38
38
|
}>]>>;
|
|
39
39
|
model: Type.TOptional<Type.TString>;
|
|
40
40
|
}>;
|
|
@@ -9,12 +9,10 @@ export const DEFAULT_MAX_QUESTIONS = 32;
|
|
|
9
9
|
export const DEFAULT_BACKEND_LIMITS = Object.freeze({ maxQuestions: DEFAULT_MAX_QUESTIONS, minChoiceOptions: 1, maxChoiceOptions: 64, maxScoreLevels: 32 });
|
|
10
10
|
// The API accepts structured descriptions, not only strings. The schema is the only shape guidance the model gets
|
|
11
11
|
// before its first call, so every field the agent authors says what it means.
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
Type.Record(Type.String(), Type.Unknown()),
|
|
17
|
-
], description === undefined ? {} : { description });
|
|
12
|
+
const content = () => [Type.String(), Type.Array(Type.Unknown()), Type.Record(Type.String(), Type.Unknown())];
|
|
13
|
+
const entry = (description) => Type.Union([...content(), Type.Null()], description === undefined ? {} : { description });
|
|
14
|
+
/** `state` alone is non-null: @typesafe-ai/sdk 0.7.0 types it as `NonNullable<EntryType>`. */
|
|
15
|
+
const state = Type.Union(content(), { description: "What to judge: text, or an object whose fields the questions name. Not null." });
|
|
18
16
|
const instructions = Type.Optional(entry("One judgment about the whole state, phrased as a question or a statement."));
|
|
19
17
|
const question = Type.Union([
|
|
20
18
|
Type.Object({
|
|
@@ -42,7 +40,7 @@ const question = Type.Union([
|
|
|
42
40
|
]);
|
|
43
41
|
/** The JSON schema used by both the Pi tool and the programmatic interface. */
|
|
44
42
|
export const evaluationSchema = Type.Object({
|
|
45
|
-
state
|
|
43
|
+
state,
|
|
46
44
|
questions: Type.Record(Type.String({ minLength: 1, maxLength: 100 }), question, {
|
|
47
45
|
minProperties: 1,
|
|
48
46
|
maxProperties: DEFAULT_MAX_QUESTIONS,
|
|
@@ -51,6 +49,29 @@ export const evaluationSchema = Type.Object({
|
|
|
51
49
|
model: Type.Optional(Type.String({ minLength: 1, maxLength: 100, description: "Jev model id, e.g. jev-latest. Omit for the default." })),
|
|
52
50
|
}, { additionalProperties: false });
|
|
53
51
|
const usage = `Expected { state, questions: { <id>: { type: "choice", instructions, criteria: { label: description|null } } | { type: "score", instructions, criteria: [level0, level1, ...] } | { type: "noul", instructions } } }; 1–${DEFAULT_MAX_QUESTIONS} questions, Choice 1–64 options, Score 2–32 levels.`;
|
|
52
|
+
/** Question types this package sends. The SDK also offers `box`, which locates a subject in the request's image. */
|
|
53
|
+
const SUPPORTED_QUESTION_TYPES = new Set(["noul", "choice", "score"]);
|
|
54
|
+
/**
|
|
55
|
+
* Name the two refusals the schema can otherwise only report as a union mismatch: a `box` question, and a `null`
|
|
56
|
+
* state. Both are shapes @typesafe-ai/sdk 0.7.0 added or tightened; neither is something this package can send.
|
|
57
|
+
*/
|
|
58
|
+
function refuseUnsupported(value) {
|
|
59
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
60
|
+
return;
|
|
61
|
+
const request = value;
|
|
62
|
+
if (request.state === null) {
|
|
63
|
+
throw new TypeSafeIntegrationError("validation", `state must not be null: send what to judge as text, an object, or an array. ${usage}`);
|
|
64
|
+
}
|
|
65
|
+
const questions = request.questions;
|
|
66
|
+
if (!questions || typeof questions !== "object" || Array.isArray(questions))
|
|
67
|
+
return;
|
|
68
|
+
for (const [id, question] of Object.entries(questions)) {
|
|
69
|
+
const type = question && typeof question === "object" && !Array.isArray(question) ? question.type : undefined;
|
|
70
|
+
if (typeof type === "string" && !SUPPORTED_QUESTION_TYPES.has(type)) {
|
|
71
|
+
throw new TypeSafeIntegrationError("validation", `Invalid evaluation request at questions.${id.slice(0, 100)}.type: ${JSON.stringify(type.slice(0, 40))} is not a question type this package sends. ${usage}`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
54
75
|
/** Paths and messages only; never the submitted values. */
|
|
55
76
|
function describeSchemaErrors(value) {
|
|
56
77
|
const details = [];
|
|
@@ -67,6 +88,7 @@ export function parseEvaluationRequest(value) {
|
|
|
67
88
|
if (value !== null && typeof value === "object" && !Array.isArray(value) && !isJsonSafe(value)) {
|
|
68
89
|
throw new TypeSafeIntegrationError("validation", `Invalid evaluation request: state and questions must be plain JSON. ${usage}`);
|
|
69
90
|
}
|
|
91
|
+
refuseUnsupported(value);
|
|
70
92
|
if (!Check(evaluationSchema, value)) {
|
|
71
93
|
throw new TypeSafeIntegrationError("validation", `Invalid evaluation request at ${describeSchemaErrors(value)}. ${usage}`);
|
|
72
94
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-typesafe",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "TypeSafe AI (Jev) decisions for Pi: batched Choice/Score/Noul evaluation tool, terminal playground, and a typed API other extensions build on.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"prepack": "npm run build"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@typesafe-ai/sdk": "^0.
|
|
67
|
+
"@typesafe-ai/sdk": "^0.7.0"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
70
|
"@earendil-works/pi-coding-agent": "*",
|
|
@@ -4,6 +4,46 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.45.0] - 2026-10-25
|
|
8
|
+
|
|
9
|
+
### Highlights
|
|
10
|
+
|
|
11
|
+
- Pull exact facts off a page. Ask for "price: number" and get 29 back with the line it came from, not 40KB of HTML. It says when a value isn't there instead of guessing. Opt-in.
|
|
12
|
+
- Summaries can run on the model your Pi session is using, so they stay on your local or self-hosted model.
|
|
13
|
+
- The web tools take 60% less of every request to the model (2.8k → 1.1k tokens).
|
|
14
|
+
- Search moves to the next provider when one comes back empty, you can put a time limit on the whole search, and DuckDuckGo no longer gets your IP blocked.
|
|
15
|
+
- Search through Azure with Bing, or pick the model for a single search.
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
19
|
+
- `fetch_content` can read specific values off a page instead of returning all of it: a price, a release date, a rate limit, a list of supported platforms. It is off unless you add `"extract"` to `fetch.allowedModes`, and it uses Cloudflare's Clairic model with the Cloudflare key you set up in Pi (`CLOUDFLARE_API_KEY` and `CLOUDFLARE_ACCOUNT_ID`); with a `CLOUDFLARE_GATEWAY_ID` in Pi, the requests go through that Cloudflare AI Gateway. Call it with `mode: "extract"` and `fields` such as `{ "price": "number: Pro plan monthly price" }`; each field comes back as a typed value, as an uncertain guess, or as not on the page, and a value is reported only when the model is confident and it has the right type. Once it is on, the agent's tool list tells it to use extract when it needs a specific value rather than the whole page. The page text is sent to Cloudflare. Pi only; [docs/field-extract.md](https://github.com/nicobailon/pi-web-access/blob/main/docs/field-extract.md) has the details and measurements.
|
|
20
|
+
- Extract mode shows the page line each text or number value was found on, so you can check and cite it. Text the model is confident about but that isn't on the page comes back as uncertain, not extracted ([#616](https://github.com/nicobailon/pi-web-access/issues/616)).
|
|
21
|
+
- Codemode scripts that call `fetch_content` with `mode: "extract"` get each page's typed values as data, under `extraction` for each URL, so a script doesn't have to parse text ([#618](https://github.com/nicobailon/pi-web-access/issues/618)).
|
|
22
|
+
- After an update, the first Pi session shows the highlights of the releases you skipped, once, with a link to the full changelog. A fresh install or a downgrade shows nothing.
|
|
23
|
+
- Search through a self-hosted [9router](https://github.com/decolua/9router) with `provider: "ninerouter"` and `ninerouterBaseUrl`, so every search backend set up in the router works from Pi. Thanks to [@giovannirandykusuma](https://github.com/giovannirandykusuma) for [PR #612](https://github.com/nicobailon/pi-web-access/pull/612).
|
|
24
|
+
- Search routing can skip a provider whose results have nothing to do with your query. Add `"off-topic"` to `searchRouting.fallbackOn` and pick a classifier model in `searchRouting.offTopicModel`; it then checks each routed answer and moves on when the results are off-topic ([#619](https://github.com/nicobailon/pi-web-access/issues/619)).
|
|
25
|
+
- Search routing can move on to the next provider when one answers with no results, or with no results from the domains you asked for. Turn it on by adding `"empty"` or `"domain-miss"` to `searchRouting.fallbackOn`. If every provider answers that way, you get the first answer. A routed search can also be given a total time limit with `searchRouting.timeoutMs` (1 to 600000 milliseconds), which includes the time spent checking whether each provider is set up and signed in; when it runs out, you get the first answer passed over, or an error that says the route ran out of time. Thanks to [@isjiajia01](https://github.com/isjiajia01) for [PR #594](https://github.com/nicobailon/pi-web-access/pull/594).
|
|
26
|
+
- `queryRewriteModel` chooses the model the curator uses to rewrite a search query: `"current"` for the model your Pi session is running, or a `provider/model-id`, each with an optional thinking level such as `"current:low"`. When set, no other model is tried. Unset, the rewrite still uses its built-in list of cloud models.
|
|
27
|
+
- `summaryModel` accepts `"current"` or `"current:<level>"` to write summaries with the model your Pi session is running, which keeps them on a local or self-hosted model. Pi `enabledModels` still applies.
|
|
28
|
+
- `web_search` takes an optional `model` to pick the search model for one call, for example `provider: "openai", model: "gpt-6-luna"`, without changing your config. It works with the OpenAI, xAI, Mistral, and Gemini providers, and only when you name exactly one of them as `provider`. If that model fails, you get the error; the search is not retried with a different model or provider. Thanks to [@IdrisGit](https://github.com/IdrisGit) for [PR #598](https://github.com/nicobailon/pi-web-access/pull/598).
|
|
29
|
+
- `"allowHttpBaseUrls": true` (or `PI_WEB_ACCESS_ALLOW_HTTP_BASE_URLS=true`) lets provider gateway base URLs such as `braveBaseUrl` use plain `http://` on any host, for example an internal Kubernetes Service. Without it, gateway URLs must still use HTTPS unless they point at your own machine. HTTP sends API keys unencrypted, so use it only on a trusted network. Thanks to [@Coder-Sang](https://github.com/Coder-Sang) for [PR #592](https://github.com/nicobailon/pi-web-access/pull/592).
|
|
30
|
+
- Web search through Azure OpenAI, which grounds answers with Bing. Point `openaiResponsesUrl` at your Azure resource's `/openai/v1/responses` endpoint and set `openaiSearchModel` to your deployment name; an Azure API key is sent in the `api-key` header and a Microsoft Entra token as Bearer auth. A Pi Azure provider can be reused with `openaiUseProviderBaseUrl`, and an active Pi model on an Azure endpoint works with `searchRouting.useCurrentModel`. Azure doesn't support `openaiUseAlphaSearch`, so that setting is rejected before any request. Bing grounding is billed separately by Microsoft; see the README for cost and privacy notes. Thanks to [@abhishek944](https://github.com/abhishek944) for [PR #599](https://github.com/nicobailon/pi-web-access/pull/599).
|
|
31
|
+
- Exa search results show each source's published date and authors, and results from Exa's `publication` category (its research paper index) also show the citation count and DOI. `publication` replaces `research paper` as the documented category; `research paper` still works. Thanks to [@kestermcullough](https://github.com/kestermcullough) for [PR #596](https://github.com/nicobailon/pi-web-access/pull/596).
|
|
32
|
+
|
|
33
|
+
### Changed
|
|
34
|
+
|
|
35
|
+
- `source_check` shows the passages it found under each source, up to 4,000 characters, so the agent can weigh the claim without a second `get_search_content` call. Before, the result listed only titles and links.
|
|
36
|
+
- The web tools now add about 1,100 tokens to every request to the model instead of about 2,800: the definitions of `web_search`, `source_check`, `fetch_content`, and `get_search_content` shrank from about 11,000 to about 4,400 characters. Every parameter is still there; the longer explanations moved to the README ([#595](https://github.com/nicobailon/pi-web-access/issues/595)).
|
|
37
|
+
- The `provider` argument of `web_search` and `source_check` is now a plain string. To search several providers at once, pass comma-separated names such as `"brave,exa"` instead of a list. An unknown name now returns an error that lists the valid names, instead of quietly using automatic selection. The `provider` setting in `web-search.json`, including lists, works as before ([#595](https://github.com/nicobailon/pi-web-access/issues/595)).
|
|
38
|
+
- When `summaryModel` is set, summaries use only that model. Before, if it was missing, signed out, or failed, the summary quietly switched to a built-in cloud model such as Claude Haiku, which could bill a provider you did not choose. Now you get the plain summary built from the search results, with the reason it failed, and the curator preselects your model even when it is unavailable. An invalid `summaryModel`, including an empty string, stops the summary with an error naming the config file instead of being ignored. If `summaryModel` is not set, nothing changes. Thanks to [@Meetsch](https://github.com/Meetsch) for [issue #597](https://github.com/nicobailon/pi-web-access/issues/597).
|
|
39
|
+
|
|
40
|
+
### Fixed
|
|
41
|
+
|
|
42
|
+
- DuckDuckGo search no longer locks itself out. Several searches at once, such as a `queries` list, used to trigger DuckDuckGo's bot check for the whole IP address for 10 to 15 minutes, and every retry kept the block in place. DuckDuckGo searches now run one at a time, at least 2 seconds apart. After a bot check the provider stops sending requests for 5 minutes, doubling up to 1 hour, and fails at once with a `quota` error, so search routing can fall back right away.
|
|
43
|
+
- A DuckDuckGo search that times out now fails as a network error instead of an abort, so search routing falls back to the next provider. Its 30-second limit also counts the time spent waiting behind other DuckDuckGo searches. Thanks to [@kestermcullough](https://github.com/kestermcullough) for [PR #593](https://github.com/nicobailon/pi-web-access/pull/593).
|
|
44
|
+
- `source_check` passages from fetched pages keep the whole sentence when it contains a period inside a word, such as `example.com`. Before, the passage started after the last such period and lost its subject. Thanks to [@appe233](https://github.com/appe233) for reporting [#600](https://github.com/nicobailon/pi-web-access/issues/600).
|
|
45
|
+
- `source_check` picks the sentences from fetched pages that match the claim. Before, when the search result had a snippet, it matched the snippet instead and the claim was ignored. Acronyms and numbers such as `API`, `TLS` and `429` now count as matching words.
|
|
46
|
+
|
|
7
47
|
## [0.44.0] - 2026-10-20
|
|
8
48
|
|
|
9
49
|
### Highlights
|