@herbertgao/pi-extensions 2026.10.18 → 2026.11.0
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 +19 -5
- package/THIRD_PARTY_NOTICES.md +53 -3
- package/node_modules/@herbertgao/pi-subagents/CHANGELOG.md +6 -0
- package/node_modules/@herbertgao/pi-subagents/README.md +142 -45
- package/node_modules/@herbertgao/pi-subagents/docs/rpc.md +17 -7
- package/node_modules/@herbertgao/pi-subagents/package.json +4 -4
- package/node_modules/@herbertgao/pi-subagents/src/agent-manager.ts +111 -59
- package/node_modules/@herbertgao/pi-subagents/src/agent-runner.ts +135 -117
- package/node_modules/@herbertgao/pi-subagents/src/cross-extension-rpc.ts +41 -14
- package/node_modules/@herbertgao/pi-subagents/src/index.ts +110 -19
- package/node_modules/@herbertgao/pi-subagents/src/nested-tools.ts +8 -0
- package/node_modules/@herbertgao/pi-subagents/src/prompts.ts +31 -0
- package/node_modules/@tintinweb/pi-tasks/CHANGELOG.md +270 -0
- package/node_modules/@tintinweb/pi-tasks/CONTRIBUTING.md +67 -0
- package/node_modules/@tintinweb/pi-tasks/CUSTOMIZING.md +289 -0
- package/node_modules/@tintinweb/pi-tasks/LICENSE +21 -0
- package/node_modules/@tintinweb/pi-tasks/README.md +417 -0
- package/node_modules/@tintinweb/pi-tasks/SECURITY.md +107 -0
- package/node_modules/@tintinweb/pi-tasks/dist/auto-clear.d.ts +64 -0
- package/node_modules/@tintinweb/pi-tasks/dist/auto-clear.js +129 -0
- package/node_modules/@tintinweb/pi-tasks/dist/index.d.ts +17 -0
- package/node_modules/@tintinweb/pi-tasks/dist/index.js +1338 -0
- package/node_modules/@tintinweb/pi-tasks/dist/process-tracker.d.ts +29 -0
- package/node_modules/@tintinweb/pi-tasks/dist/process-tracker.js +121 -0
- package/node_modules/@tintinweb/pi-tasks/dist/reminder-cadence.d.ts +39 -0
- package/node_modules/@tintinweb/pi-tasks/dist/reminder-cadence.js +61 -0
- package/node_modules/@tintinweb/pi-tasks/dist/task-glyphs.d.ts +48 -0
- package/node_modules/@tintinweb/pi-tasks/dist/task-glyphs.js +68 -0
- package/node_modules/@tintinweb/pi-tasks/dist/task-paths.d.ts +44 -0
- package/node_modules/@tintinweb/pi-tasks/dist/task-paths.js +60 -0
- package/node_modules/@tintinweb/pi-tasks/dist/task-sort.d.ts +23 -0
- package/node_modules/@tintinweb/pi-tasks/dist/task-sort.js +69 -0
- package/node_modules/@tintinweb/pi-tasks/dist/task-store.d.ts +61 -0
- package/node_modules/@tintinweb/pi-tasks/dist/task-store.js +397 -0
- package/node_modules/@tintinweb/pi-tasks/dist/tasks-config.d.ts +16 -0
- package/node_modules/@tintinweb/pi-tasks/dist/tasks-config.js +51 -0
- package/node_modules/@tintinweb/pi-tasks/dist/types.d.ts +36 -0
- package/node_modules/@tintinweb/pi-tasks/dist/types.js +4 -0
- package/node_modules/@tintinweb/pi-tasks/dist/ui/settings-menu.d.ts +15 -0
- package/node_modules/@tintinweb/pi-tasks/dist/ui/settings-menu.js +140 -0
- package/node_modules/@tintinweb/pi-tasks/dist/ui/task-widget.d.ts +69 -0
- package/node_modules/@tintinweb/pi-tasks/dist/ui/task-widget.js +278 -0
- package/node_modules/@tintinweb/pi-tasks/package.json +57 -0
- package/node_modules/@tintinweb/pi-tasks/src/auto-clear.ts +134 -0
- package/node_modules/@tintinweb/pi-tasks/src/index.ts +1417 -0
- package/node_modules/@tintinweb/pi-tasks/src/process-tracker.ts +140 -0
- package/node_modules/@tintinweb/pi-tasks/src/reminder-cadence.ts +90 -0
- package/node_modules/@tintinweb/pi-tasks/src/task-glyphs.ts +110 -0
- package/node_modules/@tintinweb/pi-tasks/src/task-paths.ts +65 -0
- package/node_modules/@tintinweb/pi-tasks/src/task-sort.ts +90 -0
- package/node_modules/@tintinweb/pi-tasks/src/task-store.ts +402 -0
- package/node_modules/@tintinweb/pi-tasks/src/tasks-config.ts +77 -0
- package/node_modules/@tintinweb/pi-tasks/src/types.ts +40 -0
- package/node_modules/@tintinweb/pi-tasks/src/ui/settings-menu.ts +174 -0
- package/node_modules/@tintinweb/pi-tasks/src/ui/task-widget.ts +325 -0
- package/node_modules/pi-commandcode-provider/CHANGELOG.md +330 -0
- package/node_modules/pi-commandcode-provider/CONTRIBUTING.md +192 -0
- package/node_modules/pi-commandcode-provider/LICENSE +21 -0
- package/node_modules/pi-commandcode-provider/README.md +243 -0
- package/node_modules/pi-commandcode-provider/RELEASE.md +194 -0
- package/node_modules/pi-commandcode-provider/index.ts +309 -0
- package/node_modules/pi-commandcode-provider/package.json +91 -0
- package/node_modules/pi-commandcode-provider/scripts/live-e2e-profile.mjs +87 -0
- package/node_modules/pi-commandcode-provider/scripts/pi-authenticated.mjs +50 -0
- package/node_modules/pi-commandcode-provider/scripts/pi-isolated.mjs +79 -0
- package/node_modules/pi-commandcode-provider/src/api-key.ts +69 -0
- package/node_modules/pi-commandcode-provider/src/auth-server.ts +229 -0
- package/node_modules/pi-commandcode-provider/src/commandcode-catalog-overrides.ts +28 -0
- package/node_modules/pi-commandcode-provider/src/commandcode-catalog.ts +260 -0
- package/node_modules/pi-commandcode-provider/src/converters.ts +477 -0
- package/node_modules/pi-commandcode-provider/src/core.ts +836 -0
- package/node_modules/pi-commandcode-provider/src/cost.ts +76 -0
- package/node_modules/pi-commandcode-provider/src/json-schema.ts +417 -0
- package/node_modules/pi-commandcode-provider/src/models.ts +515 -0
- package/node_modules/pi-commandcode-provider/src/oauth.ts +229 -0
- package/node_modules/pi-commandcode-provider/src/overflow.ts +120 -0
- package/node_modules/pi-commandcode-provider/src/pricing.ts +370 -0
- package/node_modules/pi-commandcode-provider/src/quota-command.ts +66 -0
- package/node_modules/pi-commandcode-provider/src/quota-format.ts +143 -0
- package/node_modules/pi-commandcode-provider/src/quota-types.ts +47 -0
- package/node_modules/pi-commandcode-provider/src/quota.ts +357 -0
- package/node_modules/pi-commandcode-provider/src/responses-stream.ts +249 -0
- package/node_modules/pi-commandcode-provider/src/runtime.ts +330 -0
- package/node_modules/pi-commandcode-provider/src/transcript.ts +56 -0
- package/node_modules/pi-commandcode-provider/src/transport.ts +147 -0
- package/node_modules/pi-commandcode-provider/src/types.ts +212 -0
- package/node_modules/pi-commandcode-provider/src/usage.ts +261 -0
- package/node_modules/pi-lens/CHANGELOG.md +149 -0
- package/node_modules/pi-lens/README.md +12 -2
- package/node_modules/pi-lens/config/markdownlint/run-no-fix.mjs +36 -0
- package/node_modules/pi-lens/dist/{chunk-WME2OQST.js → chunk-2453RRJ2.js} +11 -6
- package/node_modules/pi-lens/dist/{chunk-FZKFVUEC.js → chunk-2BKUFQKR.js} +276 -208
- package/node_modules/pi-lens/dist/chunk-2TS4GLOJ.js +31 -0
- package/node_modules/pi-lens/dist/{chunk-QHSNL7B2.js → chunk-2ZE3AUJQ.js} +12 -14
- package/node_modules/pi-lens/dist/{chunk-MPKRJBPK.js → chunk-35WKJWO5.js} +28 -30
- package/node_modules/pi-lens/dist/chunk-3JAHQBSY.js +27 -0
- package/node_modules/pi-lens/dist/{chunk-4LM3VAZH.js → chunk-3O5EII3W.js} +2 -2
- package/node_modules/pi-lens/dist/chunk-447YZL4S.js +25 -0
- package/node_modules/pi-lens/dist/{chunk-H7OR7DFZ.js → chunk-4B2YFN4U.js} +25 -21
- package/node_modules/pi-lens/dist/{chunk-OSTKYB55.js → chunk-4BKU7PV3.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-RRV3FNNM.js → chunk-4LL2VRNY.js} +27 -28
- package/node_modules/pi-lens/dist/{chunk-BZARLRJW.js → chunk-4NBWFYWW.js} +9 -9
- package/node_modules/pi-lens/dist/{chunk-KKCK636N.js → chunk-4QG55RRC.js} +12 -12
- package/node_modules/pi-lens/dist/{chunk-RQS4QQSD.js → chunk-4W52ZKZX.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-Z2XAOKHK.js → chunk-565VRUP4.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-HWDAVBFU.js → chunk-57X2CDRX.js} +23 -23
- package/node_modules/pi-lens/dist/{chunk-MB6PXBUA.js → chunk-5F3XF3SX.js} +7 -15
- package/node_modules/pi-lens/dist/{chunk-O4BJFESU.js → chunk-5RNB4HVK.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-ZMAUPOMG.js → chunk-5T5A6YAJ.js} +35 -34
- package/node_modules/pi-lens/dist/{chunk-4ZYJHQMB.js → chunk-6FIRFP6A.js} +12 -12
- package/node_modules/pi-lens/dist/{chunk-4YHYPW2G.js → chunk-6GMGEKQN.js} +9 -5
- package/node_modules/pi-lens/dist/{chunk-4LOE5R5P.js → chunk-6LJOJ6EO.js} +20 -15
- package/node_modules/pi-lens/dist/{chunk-3YY7IXIL.js → chunk-6YUNI7B5.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-PKES3ISE.js → chunk-7ANZ7XDD.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-FB5SCCPT.js → chunk-7CGIDRIK.js} +16 -15
- package/node_modules/pi-lens/dist/{chunk-L3CMBQMH.js → chunk-7MAD5ZAY.js} +16 -17
- package/node_modules/pi-lens/dist/{chunk-WDBICWH3.js → chunk-7TNILKGY.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-RORGS5II.js → chunk-A5GRLYPZ.js} +9 -9
- package/node_modules/pi-lens/dist/{chunk-MNJIXFX4.js → chunk-AGGUWKRK.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-ABPKUVA4.js → chunk-BBET6HD6.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-L5JYIU47.js → chunk-BHWW6FAX.js} +14 -13
- package/node_modules/pi-lens/dist/{chunk-URCQWAQ4.js → chunk-BOPDQ7AZ.js} +23 -21
- package/node_modules/pi-lens/dist/{chunk-KDX35VXP.js → chunk-BQG2QFVO.js} +158 -133
- package/node_modules/pi-lens/dist/{chunk-CB4WHS4H.js → chunk-BUZIQDFS.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-2PHMIAKO.js → chunk-CM73PPGD.js} +4 -4
- package/node_modules/pi-lens/dist/{chunk-DH5JPM3K.js → chunk-CUDD35TW.js} +10 -9
- package/node_modules/pi-lens/dist/{chunk-AWDSEDER.js → chunk-CZL44WFN.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-N5WSK2K7.js → chunk-DIWK3LBC.js} +12 -15
- package/node_modules/pi-lens/dist/{chunk-24BILSZW.js → chunk-DYRZGUMA.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-PR6PO3ES.js → chunk-FHEV6T4L.js} +22 -18
- package/node_modules/pi-lens/dist/{chunk-DQZFQSR5.js → chunk-FRLAUP2B.js} +4 -4
- package/node_modules/pi-lens/dist/{chunk-RZOXUSPC.js → chunk-G5GV2Q7K.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-EKWX4WD3.js → chunk-G6JKM4O7.js} +7 -7
- package/node_modules/pi-lens/dist/chunk-GGYOZWHW.js +27 -0
- package/node_modules/pi-lens/dist/{chunk-XT2HTCJ5.js → chunk-GIRBSBGL.js} +6 -5
- package/node_modules/pi-lens/dist/{chunk-PQJFG24Z.js → chunk-GMROJJRN.js} +1292 -946
- package/node_modules/pi-lens/dist/{chunk-U6VN4NVL.js → chunk-HHR7WGCI.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-TIQJPRDD.js → chunk-HKIL6DCL.js} +3 -2
- package/node_modules/pi-lens/dist/{chunk-SNDXCFRS.js → chunk-HUAM7QG3.js} +11 -11
- package/node_modules/pi-lens/dist/{chunk-QOE342SU.js → chunk-HXFUTMX2.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-U7BD2QL7.js → chunk-I22THIHI.js} +12 -12
- package/node_modules/pi-lens/dist/chunk-IE5D3RA5.js +58 -0
- package/node_modules/pi-lens/dist/{chunk-DPGEAHZT.js → chunk-IYVYZQRL.js} +10 -16
- package/node_modules/pi-lens/dist/{chunk-3F6BMY53.js → chunk-JBP7KESM.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-U5HPROLA.js → chunk-JE6HKLC7.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-ZE3KXHS7.js → chunk-JPRDTY5S.js} +85 -3
- package/node_modules/pi-lens/dist/{chunk-HO6LWE2E.js → chunk-JYLOYTZD.js} +17 -1
- package/node_modules/pi-lens/dist/{chunk-KW5JQPO5.js → chunk-JZRP4DGP.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-CPSR3AVL.js → chunk-KZ4ALBCH.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-6IR3ZYIB.js → chunk-L3CLUGDY.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-LV4UMYVH.js → chunk-L4NEVZ4T.js} +28 -27
- package/node_modules/pi-lens/dist/chunk-LPYTPNOJ.js +22 -0
- package/node_modules/pi-lens/dist/{chunk-WGRJOXED.js → chunk-LSFXZLPW.js} +1016 -636
- package/node_modules/pi-lens/dist/{chunk-LBLBAFG3.js → chunk-MC6VB2E5.js} +4 -4
- package/node_modules/pi-lens/dist/{chunk-U2SDMG7C.js → chunk-NM2NWH55.js} +5 -5
- package/node_modules/pi-lens/dist/{chunk-T7A2HK2B.js → chunk-NSPVR3FN.js} +19 -18
- package/node_modules/pi-lens/dist/{chunk-ZGSJDWQU.js → chunk-O2ARHQKF.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-OXOI55RU.js → chunk-O4N5BQ3T.js} +10 -10
- package/node_modules/pi-lens/dist/{chunk-3FRLWYBG.js → chunk-OC7VWJBZ.js} +39 -40
- package/node_modules/pi-lens/dist/chunk-OFNMHPBT.js +89 -0
- package/node_modules/pi-lens/dist/{chunk-HR3OJ3TH.js → chunk-OWTG6UMO.js} +21 -21
- package/node_modules/pi-lens/dist/{chunk-75GAYVNO.js → chunk-OY7WZI7Q.js} +6 -6
- package/node_modules/pi-lens/dist/{chunk-ZJTT47IG.js → chunk-OZWXLJMX.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-F6X3YJWD.js → chunk-PIQQM32Y.js} +2 -2
- package/node_modules/pi-lens/dist/chunk-PKLB2XJL.js +8 -0
- package/node_modules/pi-lens/dist/{chunk-EAOK7MIZ.js → chunk-PKSUMEPT.js} +17 -4
- package/node_modules/pi-lens/dist/{chunk-YISME6ON.js → chunk-PPKECBPP.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-4L36HG27.js → chunk-R2QQC33W.js} +14 -14
- package/node_modules/pi-lens/dist/{chunk-LUBPZN36.js → chunk-R4QWJQ2H.js} +11 -11
- package/node_modules/pi-lens/dist/{chunk-V63BC55Q.js → chunk-RGGH6M34.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-Y7F7IEE3.js → chunk-RZG472YW.js} +65 -7
- package/node_modules/pi-lens/dist/{chunk-PUZ3E2J4.js → chunk-SDFKOLSF.js} +6 -6
- package/node_modules/pi-lens/dist/{chunk-YHC2O2WO.js → chunk-SFLHSL5R.js} +9 -9
- package/node_modules/pi-lens/dist/{chunk-CCV2EU7T.js → chunk-SP4TFY5F.js} +14 -13
- package/node_modules/pi-lens/dist/{chunk-J6JP25XU.js → chunk-SQC7K3SP.js} +4 -3
- package/node_modules/pi-lens/dist/{chunk-3K2F6UDZ.js → chunk-T2S3FNNJ.js} +44 -42
- package/node_modules/pi-lens/dist/{chunk-2TF6RXWB.js → chunk-TV6RXRYH.js} +10 -10
- package/node_modules/pi-lens/dist/{chunk-GNSIWBAT.js → chunk-U3AS2FR6.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-F7K5IBZG.js → chunk-UHHLR2VY.js} +40 -40
- package/node_modules/pi-lens/dist/chunk-UYXV5NIS.js +20 -0
- package/node_modules/pi-lens/dist/{chunk-VSFLRN5Y.js → chunk-VLQ7UKZH.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-VUZWQ7UG.js → chunk-VN3L2JWZ.js} +46 -72
- package/node_modules/pi-lens/dist/{chunk-NA7SEXHE.js → chunk-VOP4PJKA.js} +7 -7
- package/node_modules/pi-lens/dist/{chunk-F5Z6URKM.js → chunk-VOXTCULR.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-LLS45EWB.js → chunk-VPLBLWFO.js} +6 -8
- package/node_modules/pi-lens/dist/chunk-W3BGKBBK.js +27 -0
- package/node_modules/pi-lens/dist/{chunk-ZKXQKGWZ.js → chunk-WC6WRNQT.js} +4 -3
- package/node_modules/pi-lens/dist/{chunk-YVHBNSME.js → chunk-WMDUT4KH.js} +1148 -1132
- package/node_modules/pi-lens/dist/{chunk-KXF5R4UN.js → chunk-WQV6BI4Q.js} +1 -1
- package/node_modules/pi-lens/dist/chunk-WXUDRAG6.js +24 -0
- package/node_modules/pi-lens/dist/{chunk-KPPJTH44.js → chunk-X35S7HSB.js} +28 -10
- package/node_modules/pi-lens/dist/{chunk-JMEKXFOL.js → chunk-X66YJ2SS.js} +40 -34
- package/node_modules/pi-lens/dist/{chunk-CE6VMBCB.js → chunk-XOMGO63G.js} +22 -21
- package/node_modules/pi-lens/dist/{chunk-LS3QJRUB.js → chunk-XWIME22V.js} +13 -13
- package/node_modules/pi-lens/dist/{chunk-R5MOQM2H.js → chunk-XYLC35E4.js} +119 -87
- package/node_modules/pi-lens/dist/{chunk-OE5ZBP7F.js → chunk-YHGYAEFH.js} +18 -18
- package/node_modules/pi-lens/dist/{chunk-7E2563GA.js → chunk-ZFORSIED.js} +13 -13
- package/node_modules/pi-lens/dist/{chunk-E7HJ56Y7.js → chunk-ZKLTNLAW.js} +64 -73
- package/node_modules/pi-lens/dist/chunk-ZONZ6YY3.js +74 -0
- package/node_modules/pi-lens/dist/chunk-ZSM35JF4.js +30 -0
- package/node_modules/pi-lens/dist/{chunk-RC2Z6K47.js → chunk-ZZDIOAAJ.js} +15 -6
- package/node_modules/pi-lens/dist/index.js +6993 -5396
- package/node_modules/pi-lens/dist/mcp/analyze-cli.js +10 -10
- package/node_modules/pi-lens/dist/mcp/cli.js +44 -42
- package/node_modules/pi-lens/dist/mcp/server.js +1627 -504
- package/node_modules/pi-lens/dist/mcp/worker.js +62 -61
- package/node_modules/pi-lens/dist/probes/installer.js +20 -19
- package/node_modules/pi-lens/docs/adr/0003-git-guard-latch-writer.md +11 -6
- package/node_modules/pi-lens/docs/agent-tools.md +18 -8
- package/node_modules/pi-lens/docs/alignment-families.md +29 -0
- package/node_modules/pi-lens/docs/ast-grep_rules_catalog.md +6 -4
- package/node_modules/pi-lens/docs/ci-bot-pr-checks.md +126 -0
- package/node_modules/pi-lens/docs/configuration.md +99 -3
- package/node_modules/pi-lens/docs/defect-shapes.md +55 -12
- package/node_modules/pi-lens/docs/engineering-principles.md +27 -2
- package/node_modules/pi-lens/docs/features.md +2 -2
- package/node_modules/pi-lens/docs/invariants/git-guard-host.md +7 -3
- package/node_modules/pi-lens/docs/invariants/language-config.md +15 -4
- package/node_modules/pi-lens/docs/invariants/lsp-trust-exec.md +16 -2
- package/node_modules/pi-lens/docs/invariants/paths-os.md +4 -2
- package/node_modules/pi-lens/docs/lsp-capability-matrix.md +119 -39
- package/node_modules/pi-lens/docs/merge-queue-rollout.md +1 -1
- package/node_modules/pi-lens/docs/pi-lens-fixer.md +24 -17
- package/node_modules/pi-lens/docs/pi-lens-merge-policy.md +20 -11
- package/node_modules/pi-lens/docs/pi-lens-monitor.md +9 -0
- package/node_modules/pi-lens/docs/pi-lens-orchestration.md +4 -1
- package/node_modules/pi-lens/docs/pi-lens-reviewer.md +5 -5
- package/node_modules/pi-lens/docs/pi-lens-subagent.md +6 -3
- package/node_modules/pi-lens/docs/public-api-stability.md +18 -2
- package/node_modules/pi-lens/docs/schema/pi-lens-config-v1.json +10 -0
- package/node_modules/pi-lens/docs/settings.md +10 -6
- package/node_modules/pi-lens/docs/word-index.md +17 -5
- package/node_modules/pi-lens/package.json +5 -3
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-accumulating-spread-js-test.yml +37 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/ts-redundant-filter-map-test.yml +12 -1
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests-disabled/filter-then-map-js-test.yml +12 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests-disabled/filter-then-map-test.yml +25 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-accumulating-spread-js.yml +49 -1
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/ts-redundant-filter-map.yml +9 -1
- package/node_modules/pi-lens/rules/ast-grep-rules/rules-disabled/filter-then-map-js.yml +17 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules-disabled/filter-then-map.yml +36 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/self-scan-baseline.json +1 -1
- package/node_modules/pi-provider-qoder/README.md +22 -0
- package/node_modules/pi-provider-qoder/dist/index.js +370 -11
- package/node_modules/pi-provider-qoder/package.json +5 -2
- package/package.json +11 -11
- package/node_modules/@tifan/pi-inline-skills/README.md +0 -41
- package/node_modules/@tifan/pi-inline-skills/package.json +0 -44
- package/node_modules/@tifan/pi-inline-skills/src/index.ts +0 -646
- package/node_modules/@tifan/pi-preferred-thinking/README.md +0 -54
- package/node_modules/@tifan/pi-preferred-thinking/package.json +0 -43
- package/node_modules/@tifan/pi-preferred-thinking/src/index.ts +0 -236
- package/node_modules/pi-lens/dist/chunk-46TNM7XZ.js +0 -88
- package/node_modules/pi-lens/dist/chunk-72OKUXSD.js +0 -31
- package/node_modules/pi-lens/dist/chunk-7GLOLOSH.js +0 -57
- package/node_modules/pi-lens/dist/chunk-AKUUMGD5.js +0 -26
- package/node_modules/pi-lens/dist/chunk-ASUXV767.js +0 -22
- package/node_modules/pi-lens/dist/chunk-CTADOKYM.js +0 -25
- package/node_modules/pi-lens/dist/chunk-JJ2RRESP.js +0 -58
- package/node_modules/pi-lens/dist/chunk-LSC3VADM.js +0 -23
- package/node_modules/pi-lens/dist/chunk-SHLDT3OI.js +0 -27
- package/node_modules/pi-lens/dist/chunk-UF7RTZSO.js +0 -27
- package/node_modules/pi-lens/dist/chunk-W4WP2ERB.js +0 -30
- package/node_modules/pi-lens/dist/chunk-YES5CACN.js +0 -73
|
@@ -56,6 +56,18 @@ Context uses the largest live catalog option (often 1M). Output is 128K.
|
|
|
56
56
|
| Usage | `https://openapi.qoder.sh/api/v2/quota/usage` | `https://openapi.qoder.com.cn/api/v2/quota/usage` |
|
|
57
57
|
| Chat gateway | `https://api3.qoder.sh/` | `https://gateway.qoder.com.cn/` |
|
|
58
58
|
|
|
59
|
+
Agent chat is not bound to the node in this table. At startup the extension asks
|
|
60
|
+
`region/endpoints` for the account's node map and routes chat to the remote-agent node
|
|
61
|
+
(`dataNodeMap.remote_agent`), which is the node Qoder's own CLI uses; the model catalog
|
|
62
|
+
stays on the inference node. The resolved node is cached in
|
|
63
|
+
`~/.pi/agent/qoder-endpoints-cache.json` for one hour.
|
|
64
|
+
|
|
65
|
+
If a chat request is rejected with `403 code 110 "Billing daily count exceeded"`, the
|
|
66
|
+
account has exhausted that node's daily chat allowance — Qoder counts it per node, so
|
|
67
|
+
another node in the map can still serve the same account. The extension then switches to
|
|
68
|
+
the next candidate (remote-agent, then inference, then security), retries, and persists
|
|
69
|
+
whichever node served the request. Discovery failures fall back to the table above.
|
|
70
|
+
|
|
59
71
|
## Request and account Credits
|
|
60
72
|
|
|
61
73
|
The footer shows **actual session deductions in Credits**, accumulated from Qoder's
|
|
@@ -119,6 +131,16 @@ already-selected model, run `/qoder-usage`; otherwise the next supported lifecyc
|
|
|
119
131
|
rechecks identity. No account quota is written to disk. Per-request Credits are stored
|
|
120
132
|
with the assistant usage in the host's session log.
|
|
121
133
|
|
|
134
|
+
### `omp usage`
|
|
135
|
+
|
|
136
|
+
OMP's built-in usage view reads a provider-level `usage` slot, so a logged-in Qoder
|
|
137
|
+
account appears there with the same account quota: one row per Credit bucket (user,
|
|
138
|
+
add-on, organization), the numeric used/limit/remaining amounts, the plan expiry when
|
|
139
|
+
one exists, and the account kind. The read reuses the quota endpoint behind
|
|
140
|
+
`/qoder-usage` and is account-wide; a failed quota read shows as missing data and never
|
|
141
|
+
marks the credential unhealthy. pi has no such slot, so there `/qoder-usage` remains the
|
|
142
|
+
quota view.
|
|
143
|
+
|
|
122
144
|
### Offline visual preview
|
|
123
145
|
|
|
124
146
|
```bash
|
|
@@ -276,11 +276,22 @@ function getQoderRegionConfig(mode) {
|
|
|
276
276
|
function getQoderBaseUrl(mode) {
|
|
277
277
|
return getQoderRegionConfig(mode).baseUrl;
|
|
278
278
|
}
|
|
279
|
+
var chatBaseUrlOverrides = /* @__PURE__ */ new Map();
|
|
280
|
+
function getQoderChatBaseUrl(mode) {
|
|
281
|
+
return chatBaseUrlOverrides.get(mode) ?? getQoderBaseUrl(mode);
|
|
282
|
+
}
|
|
283
|
+
function setQoderChatBaseUrl(mode, url) {
|
|
284
|
+
if (!url) {
|
|
285
|
+
chatBaseUrlOverrides.delete(mode);
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
chatBaseUrlOverrides.set(mode, url.endsWith("/") ? url : `${url}/`);
|
|
289
|
+
}
|
|
279
290
|
function getQoderModelListURL(mode) {
|
|
280
291
|
return `${getQoderBaseUrl(mode)}algo/api/v2/model/list?Encode=1`;
|
|
281
292
|
}
|
|
282
293
|
function getQoderChatURL(mode) {
|
|
283
|
-
return `${
|
|
294
|
+
return `${getQoderChatBaseUrl(mode)}algo/api/v2/service/pro/sse/agent_chat_generation?FetchKeys=llm_model_result&AgentId=agent_common&Encode=1`;
|
|
284
295
|
}
|
|
285
296
|
function getQoderExchangeURL(mode) {
|
|
286
297
|
return `${getQoderRegionConfig(mode).openApiUrl}/api/v1/jobToken/exchange`;
|
|
@@ -9433,12 +9444,10 @@ function registerQoderCreditDisplay(pi, service = new QoderQuotaService()) {
|
|
|
9433
9444
|
});
|
|
9434
9445
|
}
|
|
9435
9446
|
|
|
9436
|
-
// src/
|
|
9437
|
-
import
|
|
9438
|
-
import
|
|
9439
|
-
import {
|
|
9440
|
-
clampThinkingLevel
|
|
9441
|
-
} from "@earendil-works/pi-ai";
|
|
9447
|
+
// src/endpoints.ts
|
|
9448
|
+
import { existsSync as existsSync5, mkdirSync as mkdirSync5, readFileSync as readFileSync5, writeFileSync as writeFileSync5 } from "node:fs";
|
|
9449
|
+
import { homedir as homedir5 } from "node:os";
|
|
9450
|
+
import { dirname as dirname5, join as join5 } from "node:path";
|
|
9442
9451
|
|
|
9443
9452
|
// src/protocol/encoding.ts
|
|
9444
9453
|
var qoderCustomAlphabet = "_doRTgHZBKcGVjlvpC,@aFSx#DPuNJme&i*MzLOEn)sUrthbf%Y^w.(kIQyXqWA!";
|
|
@@ -9451,6 +9460,14 @@ for (let i = 0; i < qoderStdAlphabet.length; i++) {
|
|
|
9451
9460
|
encodeTable[qoderStdAlphabet.charCodeAt(i)] = qoderCustomAlphabet.charCodeAt(i);
|
|
9452
9461
|
}
|
|
9453
9462
|
encodeTable["=".charCodeAt(0)] = "$".charCodeAt(0);
|
|
9463
|
+
var decodeTable = new Uint8Array(256);
|
|
9464
|
+
for (let i = 0; i < decodeTable.length; i++) {
|
|
9465
|
+
decodeTable[i] = i;
|
|
9466
|
+
}
|
|
9467
|
+
for (let i = 0; i < qoderStdAlphabet.length; i++) {
|
|
9468
|
+
decodeTable[qoderCustomAlphabet.charCodeAt(i)] = qoderStdAlphabet.charCodeAt(i);
|
|
9469
|
+
}
|
|
9470
|
+
decodeTable["$".charCodeAt(0)] = "=".charCodeAt(0);
|
|
9454
9471
|
function qoderEncodeBody(plaintext) {
|
|
9455
9472
|
const std = Buffer.isBuffer(plaintext) ? plaintext.toString("base64") : Buffer.from(plaintext).toString("base64");
|
|
9456
9473
|
const n = std.length;
|
|
@@ -9468,6 +9485,197 @@ function qoderEncodeBody(plaintext) {
|
|
|
9468
9485
|
}
|
|
9469
9486
|
return out;
|
|
9470
9487
|
}
|
|
9488
|
+
function qoderDecodeBody(encoded) {
|
|
9489
|
+
const src = Buffer.isBuffer(encoded) ? encoded : Buffer.from(encoded, "ascii");
|
|
9490
|
+
const n = src.length;
|
|
9491
|
+
if (n === 0) return "";
|
|
9492
|
+
const a = Math.floor(n / 3);
|
|
9493
|
+
const std = Buffer.allocUnsafe(n);
|
|
9494
|
+
for (let i = 0; i < a; i++) {
|
|
9495
|
+
std[n - a + i] = decodeTable[src[i]];
|
|
9496
|
+
}
|
|
9497
|
+
for (let i = a; i < n - a; i++) {
|
|
9498
|
+
std[i] = decodeTable[src[i]];
|
|
9499
|
+
}
|
|
9500
|
+
for (let i = n - a; i < n; i++) {
|
|
9501
|
+
std[i - (n - a)] = decodeTable[src[i]];
|
|
9502
|
+
}
|
|
9503
|
+
return Buffer.from(std.toString("latin1"), "base64").toString("utf8");
|
|
9504
|
+
}
|
|
9505
|
+
|
|
9506
|
+
// src/endpoints.ts
|
|
9507
|
+
var CACHE_VERSION = 1;
|
|
9508
|
+
var CACHE_TTL_MS = 60 * 60 * 1e3;
|
|
9509
|
+
var discovered = /* @__PURE__ */ new Map();
|
|
9510
|
+
function getHomeDir5() {
|
|
9511
|
+
return process.env.HOME || process.env.USERPROFILE || homedir5();
|
|
9512
|
+
}
|
|
9513
|
+
function getCachePath() {
|
|
9514
|
+
return process.env.QODER_ENDPOINTS_CACHE_PATH || join5(getHomeDir5(), ".pi", "agent", "qoder-endpoints-cache.json");
|
|
9515
|
+
}
|
|
9516
|
+
function normalizeBaseUrl(url) {
|
|
9517
|
+
const trimmed = url.trim();
|
|
9518
|
+
if (!trimmed) return void 0;
|
|
9519
|
+
const withScheme = /^[a-z][a-z0-9+.-]*:\/\//i.test(trimmed) ? trimmed : `https://${trimmed}`;
|
|
9520
|
+
return withScheme.endsWith("/") ? withScheme : `${withScheme}/`;
|
|
9521
|
+
}
|
|
9522
|
+
function asRecord2(value) {
|
|
9523
|
+
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
9524
|
+
}
|
|
9525
|
+
function stringArray(value) {
|
|
9526
|
+
if (!Array.isArray(value)) return [];
|
|
9527
|
+
const out = [];
|
|
9528
|
+
for (const item of value) {
|
|
9529
|
+
if (typeof item !== "string") continue;
|
|
9530
|
+
const normalized = normalizeBaseUrl(item);
|
|
9531
|
+
if (normalized) out.push(normalized);
|
|
9532
|
+
}
|
|
9533
|
+
return out;
|
|
9534
|
+
}
|
|
9535
|
+
function parseQoderRegionEndpoints(payload) {
|
|
9536
|
+
const root = asRecord2(payload);
|
|
9537
|
+
if (!root) return void 0;
|
|
9538
|
+
const dataNodes = asRecord2(root.dataNodeMap) ?? {};
|
|
9539
|
+
const endpoints = {
|
|
9540
|
+
inferNodes: stringArray(root.inferNodes),
|
|
9541
|
+
remoteAgentNodes: stringArray(dataNodes.remote_agent),
|
|
9542
|
+
securityNodes: stringArray(root.security),
|
|
9543
|
+
centerNodes: stringArray(root.centerNodes)
|
|
9544
|
+
};
|
|
9545
|
+
if (endpoints.inferNodes.length === 0 && endpoints.remoteAgentNodes.length === 0 && endpoints.securityNodes.length === 0) {
|
|
9546
|
+
return void 0;
|
|
9547
|
+
}
|
|
9548
|
+
return endpoints;
|
|
9549
|
+
}
|
|
9550
|
+
function chatEndpointCandidates(endpoints, fallback) {
|
|
9551
|
+
const seen = /* @__PURE__ */ new Set();
|
|
9552
|
+
const out = [];
|
|
9553
|
+
const push = (url) => {
|
|
9554
|
+
if (!url) return;
|
|
9555
|
+
const normalized = normalizeBaseUrl(url);
|
|
9556
|
+
if (!normalized || seen.has(normalized)) return;
|
|
9557
|
+
seen.add(normalized);
|
|
9558
|
+
out.push(normalized);
|
|
9559
|
+
};
|
|
9560
|
+
push(fallback);
|
|
9561
|
+
for (const url of endpoints?.remoteAgentNodes ?? []) push(url);
|
|
9562
|
+
for (const url of endpoints?.inferNodes ?? []) push(url);
|
|
9563
|
+
for (const url of endpoints?.securityNodes ?? []) push(url);
|
|
9564
|
+
return out;
|
|
9565
|
+
}
|
|
9566
|
+
function readCacheFile() {
|
|
9567
|
+
const path = getCachePath();
|
|
9568
|
+
if (!existsSync5(path)) return { version: CACHE_VERSION, modes: {} };
|
|
9569
|
+
try {
|
|
9570
|
+
const parsed = JSON.parse(readFileSync5(path, "utf8"));
|
|
9571
|
+
const modes = asRecord2(parsed.modes) ?? {};
|
|
9572
|
+
const clean = {};
|
|
9573
|
+
for (const [key, value] of Object.entries(modes)) {
|
|
9574
|
+
const entry = asRecord2(value);
|
|
9575
|
+
if (!entry) continue;
|
|
9576
|
+
const chatBaseUrl = typeof entry.chatBaseUrl === "string" ? normalizeBaseUrl(entry.chatBaseUrl) : void 0;
|
|
9577
|
+
const updatedAt = typeof entry.updatedAt === "number" ? entry.updatedAt : 0;
|
|
9578
|
+
if (chatBaseUrl) clean[key] = { chatBaseUrl, updatedAt };
|
|
9579
|
+
}
|
|
9580
|
+
return { version: CACHE_VERSION, modes: clean };
|
|
9581
|
+
} catch {
|
|
9582
|
+
return { version: CACHE_VERSION, modes: {} };
|
|
9583
|
+
}
|
|
9584
|
+
}
|
|
9585
|
+
function writeCacheFile(file) {
|
|
9586
|
+
const path = getCachePath();
|
|
9587
|
+
try {
|
|
9588
|
+
mkdirSync5(dirname5(path), { recursive: true });
|
|
9589
|
+
writeFileSync5(path, JSON.stringify({ ...file, version: CACHE_VERSION }, null, 2), { encoding: "utf8", mode: 384 });
|
|
9590
|
+
} catch {
|
|
9591
|
+
}
|
|
9592
|
+
}
|
|
9593
|
+
function getCachedChatBaseUrl(mode, now = Date.now()) {
|
|
9594
|
+
const entry = readCacheFile().modes[mode];
|
|
9595
|
+
if (!entry) return void 0;
|
|
9596
|
+
if (now - entry.updatedAt > CACHE_TTL_MS) return void 0;
|
|
9597
|
+
return entry.chatBaseUrl;
|
|
9598
|
+
}
|
|
9599
|
+
function rememberChatBaseUrl(mode, chatBaseUrl, now = Date.now()) {
|
|
9600
|
+
const normalized = normalizeBaseUrl(chatBaseUrl);
|
|
9601
|
+
if (!normalized) return;
|
|
9602
|
+
const file = readCacheFile();
|
|
9603
|
+
file.modes[mode] = { chatBaseUrl: normalized, updatedAt: now };
|
|
9604
|
+
writeCacheFile(file);
|
|
9605
|
+
}
|
|
9606
|
+
function applyCachedChatEndpoint(mode) {
|
|
9607
|
+
const cached = getCachedChatBaseUrl(mode);
|
|
9608
|
+
if (!cached) return void 0;
|
|
9609
|
+
setQoderChatBaseUrl(mode, cached);
|
|
9610
|
+
return cached;
|
|
9611
|
+
}
|
|
9612
|
+
function getRegionEndpointsURL(mode) {
|
|
9613
|
+
return `${getQoderRegionConfig(mode).centerUrl}/algo/api/v3/service/region/endpoints`;
|
|
9614
|
+
}
|
|
9615
|
+
async function fetchQoderRegionEndpoints(mode, credentials) {
|
|
9616
|
+
const url = getRegionEndpointsURL(mode);
|
|
9617
|
+
try {
|
|
9618
|
+
const headers = buildAuthHeaders(null, url, {
|
|
9619
|
+
userID: credentials.userID,
|
|
9620
|
+
authToken: credentials.authToken,
|
|
9621
|
+
name: credentials.name ?? "",
|
|
9622
|
+
email: credentials.email ?? "",
|
|
9623
|
+
machineID: credentials.machineID
|
|
9624
|
+
});
|
|
9625
|
+
const response = await fetch(url, {
|
|
9626
|
+
method: "GET",
|
|
9627
|
+
headers: { Accept: "application/json", ...headers }
|
|
9628
|
+
});
|
|
9629
|
+
if (!response.ok) return void 0;
|
|
9630
|
+
const text = await response.text();
|
|
9631
|
+
let payload;
|
|
9632
|
+
try {
|
|
9633
|
+
payload = JSON.parse(text);
|
|
9634
|
+
} catch {
|
|
9635
|
+
payload = JSON.parse(qoderDecodeBody(text));
|
|
9636
|
+
}
|
|
9637
|
+
return parseQoderRegionEndpoints(payload);
|
|
9638
|
+
} catch {
|
|
9639
|
+
return void 0;
|
|
9640
|
+
}
|
|
9641
|
+
}
|
|
9642
|
+
async function getRegionEndpoints(mode, credentials) {
|
|
9643
|
+
const cached = discovered.get(mode);
|
|
9644
|
+
if (cached && Date.now() - cached.at <= CACHE_TTL_MS) return cached.endpoints;
|
|
9645
|
+
const endpoints = await fetchQoderRegionEndpoints(mode, credentials);
|
|
9646
|
+
if (!endpoints) return cached?.endpoints;
|
|
9647
|
+
discovered.set(mode, { at: Date.now(), endpoints });
|
|
9648
|
+
return endpoints;
|
|
9649
|
+
}
|
|
9650
|
+
async function refreshChatEndpoint(mode, credentials) {
|
|
9651
|
+
if (!credentials?.authToken) return void 0;
|
|
9652
|
+
const endpoints = await getRegionEndpoints(mode, credentials);
|
|
9653
|
+
if (!endpoints) return void 0;
|
|
9654
|
+
const candidates = chatEndpointCandidates(endpoints, getQoderBaseUrl(mode));
|
|
9655
|
+
const preferred = candidates.find((url) => endpoints.remoteAgentNodes.includes(url)) ?? candidates[0];
|
|
9656
|
+
if (!preferred) return void 0;
|
|
9657
|
+
setQoderChatBaseUrl(mode, preferred);
|
|
9658
|
+
rememberChatBaseUrl(mode, preferred);
|
|
9659
|
+
return preferred;
|
|
9660
|
+
}
|
|
9661
|
+
async function rotateChatEndpoint(mode, credentials, attempted) {
|
|
9662
|
+
const current = normalizeBaseUrl(getQoderChatBaseUrl(mode));
|
|
9663
|
+
if (current) attempted.add(current);
|
|
9664
|
+
const endpoints = credentials ? await getRegionEndpoints(mode, credentials) : void 0;
|
|
9665
|
+
const candidates = chatEndpointCandidates(endpoints, getQoderBaseUrl(mode));
|
|
9666
|
+
const next = candidates.find((url) => !attempted.has(url));
|
|
9667
|
+
if (!next) return void 0;
|
|
9668
|
+
attempted.add(next);
|
|
9669
|
+
setQoderChatBaseUrl(mode, next);
|
|
9670
|
+
return next;
|
|
9671
|
+
}
|
|
9672
|
+
|
|
9673
|
+
// src/protocol/stream.ts
|
|
9674
|
+
import crypto3 from "node:crypto";
|
|
9675
|
+
import * as PiAi from "@earendil-works/pi-ai";
|
|
9676
|
+
import {
|
|
9677
|
+
clampThinkingLevel
|
|
9678
|
+
} from "@earendil-works/pi-ai";
|
|
9471
9679
|
|
|
9472
9680
|
// src/protocol/thinking.ts
|
|
9473
9681
|
var THINKING_TAG_VARIANTS = [
|
|
@@ -9854,6 +10062,16 @@ var MODEL_BUSY_CODE = "10605";
|
|
|
9854
10062
|
var DEFAULT_MODEL_BUSY_RETRIES = 2;
|
|
9855
10063
|
var MAX_MODEL_BUSY_RETRIES = 10;
|
|
9856
10064
|
var MODEL_BUSY_MAX_WAIT_MS = 5e3;
|
|
10065
|
+
var DAILY_CHAT_LIMIT_CODE = "110";
|
|
10066
|
+
var MAX_CHAT_ENDPOINT_SWITCHES = 3;
|
|
10067
|
+
var QoderDailyChatLimitError = class extends Error {
|
|
10068
|
+
constructor(message, sawModelOutput = false) {
|
|
10069
|
+
super(message);
|
|
10070
|
+
this.sawModelOutput = sawModelOutput;
|
|
10071
|
+
this.name = "QoderDailyChatLimitError";
|
|
10072
|
+
}
|
|
10073
|
+
sawModelOutput;
|
|
10074
|
+
};
|
|
9857
10075
|
var QoderModelBusyError = class extends Error {
|
|
9858
10076
|
constructor(message, retryAfterMs, sawModelOutput = false) {
|
|
9859
10077
|
super(message);
|
|
@@ -9875,6 +10093,12 @@ function parseJsonObject(value, depth = 0) {
|
|
|
9875
10093
|
}
|
|
9876
10094
|
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
9877
10095
|
}
|
|
10096
|
+
function isDailyChatLimitRejection(body) {
|
|
10097
|
+
const root = parseJsonObject(body);
|
|
10098
|
+
if (!root) return false;
|
|
10099
|
+
const code = root.code;
|
|
10100
|
+
return code === DAILY_CHAT_LIMIT_CODE || code === Number(DAILY_CHAT_LIMIT_CODE);
|
|
10101
|
+
}
|
|
9878
10102
|
function parseModelBusyRejection(body) {
|
|
9879
10103
|
const outer = parseJsonObject(body);
|
|
9880
10104
|
const busy = parseJsonObject(outer?.message);
|
|
@@ -10213,7 +10437,10 @@ function streamQoder(model, context, options) {
|
|
|
10213
10437
|
begin_at: Date.now()
|
|
10214
10438
|
}
|
|
10215
10439
|
};
|
|
10216
|
-
|
|
10440
|
+
let chatURL = getQoderChatURL(providerMode);
|
|
10441
|
+
const attemptedChatBases = /* @__PURE__ */ new Set();
|
|
10442
|
+
let switchedChatEndpoint = false;
|
|
10443
|
+
let chatEndpointSwitches = 0;
|
|
10217
10444
|
const modelSource = modelConfig.source || "system";
|
|
10218
10445
|
const requestedRetries = options?.maxRetries;
|
|
10219
10446
|
const modelBusyRetries = Math.min(
|
|
@@ -10265,6 +10492,9 @@ function streamQoder(model, context, options) {
|
|
|
10265
10492
|
});
|
|
10266
10493
|
if (!response.ok) {
|
|
10267
10494
|
const errText = await response.text();
|
|
10495
|
+
if (isDailyChatLimitRejection(errText)) {
|
|
10496
|
+
throw new QoderDailyChatLimitError(`Upstream status ${response.status}: ${errText}`, false);
|
|
10497
|
+
}
|
|
10268
10498
|
throw new Error(`Qoder API request failed: ${response.status} ${response.statusText}. Response: ${errText}`);
|
|
10269
10499
|
}
|
|
10270
10500
|
const reader = response.body?.getReader();
|
|
@@ -10316,6 +10546,12 @@ function streamQoder(model, context, options) {
|
|
|
10316
10546
|
}
|
|
10317
10547
|
throw formatQueuedBusyError(busy);
|
|
10318
10548
|
}
|
|
10549
|
+
if (isDailyChatLimitRejection(envelope.body)) {
|
|
10550
|
+
throw new QoderDailyChatLimitError(
|
|
10551
|
+
`Upstream status ${envelope.statusCodeValue}: ${envelope.body}`,
|
|
10552
|
+
sawModelOutput
|
|
10553
|
+
);
|
|
10554
|
+
}
|
|
10319
10555
|
throw new Error(`Upstream status ${envelope.statusCodeValue}: ${envelope.body}`);
|
|
10320
10556
|
}
|
|
10321
10557
|
const innerStr = envelope.body;
|
|
@@ -10580,8 +10816,34 @@ function streamQoder(model, context, options) {
|
|
|
10580
10816
|
for (let attempt = 0; ; attempt++) {
|
|
10581
10817
|
try {
|
|
10582
10818
|
await runAttempt();
|
|
10819
|
+
if (switchedChatEndpoint) {
|
|
10820
|
+
rememberChatBaseUrl(providerMode, getQoderChatBaseUrl(providerMode));
|
|
10821
|
+
}
|
|
10583
10822
|
return;
|
|
10584
10823
|
} catch (e) {
|
|
10824
|
+
if (e instanceof QoderDailyChatLimitError) {
|
|
10825
|
+
if (!e.sawModelOutput && chatEndpointSwitches < MAX_CHAT_ENDPOINT_SWITCHES) {
|
|
10826
|
+
const nextBase = await rotateChatEndpoint(
|
|
10827
|
+
providerMode,
|
|
10828
|
+
{ userID, authToken: accessToken, name, email, machineID },
|
|
10829
|
+
attemptedChatBases
|
|
10830
|
+
);
|
|
10831
|
+
if (nextBase) {
|
|
10832
|
+
chatEndpointSwitches++;
|
|
10833
|
+
switchedChatEndpoint = true;
|
|
10834
|
+
chatURL = getQoderChatURL(providerMode);
|
|
10835
|
+
headers = buildAuthHeaders(encodedBytes, chatURL, {
|
|
10836
|
+
userID,
|
|
10837
|
+
authToken: accessToken,
|
|
10838
|
+
name,
|
|
10839
|
+
email,
|
|
10840
|
+
machineID
|
|
10841
|
+
});
|
|
10842
|
+
continue;
|
|
10843
|
+
}
|
|
10844
|
+
}
|
|
10845
|
+
throw e;
|
|
10846
|
+
}
|
|
10585
10847
|
if (!(e instanceof QoderModelBusyError)) throw e;
|
|
10586
10848
|
if (e.sawModelOutput || output.content.length > 0) {
|
|
10587
10849
|
throw new Error("Qoder model rejected the request after partial output (10605 RESOURCE_LIMIT)");
|
|
@@ -10627,6 +10889,90 @@ function streamQoder(model, context, options) {
|
|
|
10627
10889
|
return stream;
|
|
10628
10890
|
}
|
|
10629
10891
|
|
|
10892
|
+
// src/usage-provider.ts
|
|
10893
|
+
var KNOWN_UNITS = {
|
|
10894
|
+
percent: true,
|
|
10895
|
+
tokens: true,
|
|
10896
|
+
requests: true,
|
|
10897
|
+
credits: true,
|
|
10898
|
+
usd: true,
|
|
10899
|
+
minutes: true,
|
|
10900
|
+
bytes: true
|
|
10901
|
+
};
|
|
10902
|
+
function unitFor(raw) {
|
|
10903
|
+
const lowered = raw?.toLowerCase();
|
|
10904
|
+
if (!lowered) return "credits";
|
|
10905
|
+
return KNOWN_UNITS[lowered] === true ? lowered : "unknown";
|
|
10906
|
+
}
|
|
10907
|
+
function statusFor(usedFraction, remaining, exceeded) {
|
|
10908
|
+
if (exceeded || remaining !== void 0 && remaining <= 0) return "exhausted";
|
|
10909
|
+
if (usedFraction !== void 0 && usedFraction >= 0.9) return "warning";
|
|
10910
|
+
return "ok";
|
|
10911
|
+
}
|
|
10912
|
+
var NO_EXPIRY_FROM_MS = Date.UTC(3e3, 0, 1);
|
|
10913
|
+
function toUsageReport(usage, providerID, fetchedAt = Date.now()) {
|
|
10914
|
+
const buckets = usage.usageBuckets ?? [];
|
|
10915
|
+
if (buckets.length === 0) return null;
|
|
10916
|
+
const parsedReset = usage.resetAt === void 0 ? Number.NaN : Date.parse(usage.resetAt);
|
|
10917
|
+
const resetsAt = Number.isFinite(parsedReset) && parsedReset < NO_EXPIRY_FROM_MS ? parsedReset : void 0;
|
|
10918
|
+
const raw = usage.raw;
|
|
10919
|
+
const exceeded = raw?.isQuotaExceeded === true;
|
|
10920
|
+
const snapshot = normalizeQoderQuotaSnapshot(usage.raw);
|
|
10921
|
+
const amountsFor = (id) => {
|
|
10922
|
+
if (id === "user-quota") return snapshot?.userQuota;
|
|
10923
|
+
if (id === "add-on-quota") return snapshot?.addOnQuota;
|
|
10924
|
+
if (id === "org-resource-package") return snapshot?.orgResourcePackage;
|
|
10925
|
+
return void 0;
|
|
10926
|
+
};
|
|
10927
|
+
const limits = buckets.map((bucket) => {
|
|
10928
|
+
const amounts = amountsFor(bucket.id);
|
|
10929
|
+
const usedFraction = amounts?.used !== void 0 && amounts.total !== void 0 && amounts.total > 0 ? amounts.used / amounts.total : void 0;
|
|
10930
|
+
return {
|
|
10931
|
+
id: bucket.id,
|
|
10932
|
+
label: bucket.label,
|
|
10933
|
+
scope: { provider: providerID },
|
|
10934
|
+
...resetsAt !== void 0 ? {
|
|
10935
|
+
window: {
|
|
10936
|
+
id: "period",
|
|
10937
|
+
label: usage.subscriptionTitle ?? "Billing period",
|
|
10938
|
+
resetsAt,
|
|
10939
|
+
resetLabel: usage.subscriptionTitle ? "plan expires" : "resets"
|
|
10940
|
+
}
|
|
10941
|
+
} : {},
|
|
10942
|
+
amount: {
|
|
10943
|
+
unit: unitFor(amounts?.unit ?? bucket.unit),
|
|
10944
|
+
...amounts?.used !== void 0 ? { used: amounts.used } : {},
|
|
10945
|
+
...amounts?.total !== void 0 ? { limit: amounts.total } : {},
|
|
10946
|
+
...amounts?.remaining !== void 0 ? { remaining: amounts.remaining } : {},
|
|
10947
|
+
...usedFraction !== void 0 ? { usedFraction: Math.min(1, Math.max(0, usedFraction)) } : {}
|
|
10948
|
+
},
|
|
10949
|
+
status: statusFor(usedFraction, amounts?.remaining, exceeded)
|
|
10950
|
+
};
|
|
10951
|
+
});
|
|
10952
|
+
const notes = [];
|
|
10953
|
+
if (typeof raw?.userType === "string" && raw.userType) notes.push(`Account kind: ${raw.userType}`);
|
|
10954
|
+
if (usage.summary) notes.push(usage.summary);
|
|
10955
|
+
if (usage.manageUrl) notes.push(`Manage: ${usage.manageUrl}`);
|
|
10956
|
+
return { provider: providerID, fetchedAt, limits, ...notes.length > 0 ? { notes } : {} };
|
|
10957
|
+
}
|
|
10958
|
+
function createQoderUsageProvider(mode, providerID) {
|
|
10959
|
+
return {
|
|
10960
|
+
id: providerID,
|
|
10961
|
+
validatesCredentials: false,
|
|
10962
|
+
async fetchUsage(params) {
|
|
10963
|
+
const cred = params.credential;
|
|
10964
|
+
const access = typeof cred?.accessToken === "string" ? cred.accessToken : cred?.access;
|
|
10965
|
+
if (typeof access !== "string" || access.length === 0) return null;
|
|
10966
|
+
try {
|
|
10967
|
+
const usage = await fetchQoderUsageForMode({ ...cred, access }, mode, params.signal);
|
|
10968
|
+
return toUsageReport(usage, providerID);
|
|
10969
|
+
} catch {
|
|
10970
|
+
return null;
|
|
10971
|
+
}
|
|
10972
|
+
}
|
|
10973
|
+
};
|
|
10974
|
+
}
|
|
10975
|
+
|
|
10630
10976
|
// src/index.ts
|
|
10631
10977
|
var QODER_API = "qoder-api";
|
|
10632
10978
|
async function registerQoderApi() {
|
|
@@ -10668,15 +11014,17 @@ function createQoderOAuth(mode) {
|
|
|
10668
11014
|
function registerQoderProvider(pi, mode) {
|
|
10669
11015
|
const providerID = getQoderRegionConfig(mode).providerID;
|
|
10670
11016
|
const oauth = createQoderOAuth(mode);
|
|
10671
|
-
|
|
11017
|
+
const config = {
|
|
10672
11018
|
baseUrl: getQoderBaseUrl(mode),
|
|
10673
11019
|
api: QODER_API,
|
|
10674
11020
|
models: modelsForProvider(mode, providerID),
|
|
10675
11021
|
oauth,
|
|
10676
11022
|
// pi-coding-agent resolves its own nested @earendil-works/pi-ai copy, so the
|
|
10677
11023
|
// structurally identical Model/Context types are nominally distinct here.
|
|
10678
|
-
streamSimple: streamQoder
|
|
10679
|
-
|
|
11024
|
+
streamSimple: streamQoder,
|
|
11025
|
+
usage: createQoderUsageProvider(mode, providerID)
|
|
11026
|
+
};
|
|
11027
|
+
pi.registerProvider(providerID, config);
|
|
10680
11028
|
}
|
|
10681
11029
|
async function refreshModelsAtStartup(mode) {
|
|
10682
11030
|
const providerID = getQoderRegionConfig(mode).providerID;
|
|
@@ -10696,8 +11044,19 @@ async function index_default(pi) {
|
|
|
10696
11044
|
await registerQoderApi();
|
|
10697
11045
|
for (const mode of QODER_MODES) {
|
|
10698
11046
|
const providerID = getQoderRegionConfig(mode).providerID;
|
|
11047
|
+
applyCachedChatEndpoint(mode);
|
|
10699
11048
|
try {
|
|
10700
11049
|
await autoLoginQoderFromEnvironment(providerID, mode);
|
|
11050
|
+
const credentials = getCachedCredentials("", providerID);
|
|
11051
|
+
if (credentials?.access) {
|
|
11052
|
+
await refreshChatEndpoint(mode, {
|
|
11053
|
+
userID: credentials.userID || "qoder-user",
|
|
11054
|
+
authToken: credentials.access,
|
|
11055
|
+
name: credentials.name,
|
|
11056
|
+
email: credentials.email,
|
|
11057
|
+
machineID: credentials.machineID
|
|
11058
|
+
});
|
|
11059
|
+
}
|
|
10701
11060
|
await refreshModelsAtStartup(mode);
|
|
10702
11061
|
} catch (error) {
|
|
10703
11062
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-provider-qoder",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.8",
|
|
4
4
|
"description": "Pi extension for Qoder AI — with OAuth authentication, COSY signatures and WAF bypass",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -53,5 +53,8 @@
|
|
|
53
53
|
"bugs": {
|
|
54
54
|
"url": "https://github.com/simonsmh/pi-provider-qoder/issues"
|
|
55
55
|
},
|
|
56
|
-
"homepage": "https://github.com/simonsmh/pi-provider-qoder#readme"
|
|
56
|
+
"homepage": "https://github.com/simonsmh/pi-provider-qoder#readme",
|
|
57
|
+
"overrides": {
|
|
58
|
+
"undici": "8.12.2"
|
|
59
|
+
}
|
|
57
60
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@herbertgao/pi-extensions",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.11.0",
|
|
4
4
|
"description": "Aggregate installer for HerbertGao-maintained Pi extensions.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"extensions",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@herbertgao/pi-bark": "0.2.1",
|
|
43
43
|
"@herbertgao/pi-cc-extensions": "1.0.12-local.1",
|
|
44
44
|
"@herbertgao/pi-impeccable": "0.1.0",
|
|
45
|
-
"@herbertgao/pi-subagents": "0.22.
|
|
45
|
+
"@herbertgao/pi-subagents": "0.22.1-local.1",
|
|
46
46
|
"@herbertgao/sol-pi": "0.4.2",
|
|
47
47
|
"@juicesharp/rpiv-ask-user-question": "2.15.0",
|
|
48
48
|
"@juicesharp/rpiv-config": "^2.15.0",
|
|
@@ -56,11 +56,10 @@
|
|
|
56
56
|
"@shikijs/cli": "^4.0.2",
|
|
57
57
|
"@tifan/pi-copy-response": "0.2.7",
|
|
58
58
|
"@tifan/pi-handoff": "2.2.2",
|
|
59
|
-
"@tifan/pi-inline-skills": "1.0.7",
|
|
60
59
|
"@tifan/pi-mermaid-open": "0.2.2",
|
|
61
|
-
"@tifan/pi-preferred-thinking": "1.0.2",
|
|
62
60
|
"@tifan/pi-recap": "0.4.8",
|
|
63
61
|
"@tifan/pi-rename": "0.6.0",
|
|
62
|
+
"@tintinweb/pi-tasks": "0.9.1",
|
|
64
63
|
"@typesafe-ai/sdk": "0.7.0",
|
|
65
64
|
"croner": "^10.0.1",
|
|
66
65
|
"dbus-native": "^0.16.2",
|
|
@@ -69,13 +68,14 @@
|
|
|
69
68
|
"jiti": "^2.7.0",
|
|
70
69
|
"js-yaml": "^5.2.2",
|
|
71
70
|
"linkedom": "^0.16.0",
|
|
72
|
-
"minimatch": "^
|
|
71
|
+
"minimatch": "^11.0.1",
|
|
73
72
|
"nanoid": "^5.0.0",
|
|
74
73
|
"p-limit": "^6.1.0",
|
|
75
74
|
"pi-antigravity": "0.11.0",
|
|
76
|
-
"pi-
|
|
75
|
+
"pi-commandcode-provider": "0.7.11",
|
|
76
|
+
"pi-lens": "4.4.8",
|
|
77
77
|
"pi-next-cue": "1.0.8",
|
|
78
|
-
"pi-provider-qoder": "0.6.
|
|
78
|
+
"pi-provider-qoder": "0.6.8",
|
|
79
79
|
"pi-typesafe": "0.13.1",
|
|
80
80
|
"pi-web-access": "0.46.0",
|
|
81
81
|
"pidusage": "^4.0.1",
|
|
@@ -113,13 +113,13 @@
|
|
|
113
113
|
"@pi-plugins/fast-mode",
|
|
114
114
|
"@tifan/pi-copy-response",
|
|
115
115
|
"@tifan/pi-handoff",
|
|
116
|
-
"@tifan/pi-inline-skills",
|
|
117
116
|
"@tifan/pi-mermaid-open",
|
|
118
|
-
"@tifan/pi-preferred-thinking",
|
|
119
117
|
"@tifan/pi-recap",
|
|
120
118
|
"@tifan/pi-rename",
|
|
119
|
+
"@tintinweb/pi-tasks",
|
|
121
120
|
"grok-mermaid",
|
|
122
121
|
"pi-antigravity",
|
|
122
|
+
"pi-commandcode-provider",
|
|
123
123
|
"pi-lens",
|
|
124
124
|
"pi-next-cue",
|
|
125
125
|
"pi-provider-qoder",
|
|
@@ -137,12 +137,11 @@
|
|
|
137
137
|
"./node_modules/@tifan/pi-copy-response/src/index.ts",
|
|
138
138
|
"./node_modules/@tifan/pi-handoff/src/index.ts",
|
|
139
139
|
"./node_modules/@tifan/pi-handoff/src/session-query.ts",
|
|
140
|
-
"./node_modules/@tifan/pi-inline-skills/src/index.ts",
|
|
141
140
|
"./node_modules/@tifan/pi-mermaid-open/src/index.ts",
|
|
142
|
-
"./node_modules/@tifan/pi-preferred-thinking/src/index.ts",
|
|
143
141
|
"./node_modules/@tifan/pi-recap/src/index.ts",
|
|
144
142
|
"./node_modules/@tifan/pi-rename/src/index.ts",
|
|
145
143
|
"./node_modules/@herbertgao/pi-subagents/src/index.ts",
|
|
144
|
+
"./node_modules/@tintinweb/pi-tasks/src/index.ts",
|
|
146
145
|
"./node_modules/@herbertgao/pi-agency/src/index.ts",
|
|
147
146
|
"./node_modules/@juicesharp/rpiv-ask-user-question/index.ts",
|
|
148
147
|
"./node_modules/@herbertgao/pi-bark/src/index.ts",
|
|
@@ -156,6 +155,7 @@
|
|
|
156
155
|
"./node_modules/pi-antigravity/src/features/google-search.ts",
|
|
157
156
|
"./node_modules/pi-antigravity/src/features/generate-image.ts",
|
|
158
157
|
"./node_modules/pi-provider-qoder/dist/index.js",
|
|
158
|
+
"./node_modules/pi-commandcode-provider/index.ts",
|
|
159
159
|
"./node_modules/pi-typesafe/extensions/index.js",
|
|
160
160
|
"./extensions/clef.mjs"
|
|
161
161
|
],
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
# @tifan/pi-inline-skills
|
|
2
|
-
|
|
3
|
-
Load skills from inside a pi prompt.
|
|
4
|
-
|
|
5
|
-
Type `/` and part of a skill name, pick a skill, then keep writing. On submit, the prompt stays unchanged and the matching skill content is loaded for that turn.
|
|
6
|
-
|
|
7
|
-

|
|
8
|
-
|
|
9
|
-
## Install
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
pi install npm:@tifan/pi-inline-skills
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Usage
|
|
16
|
-
|
|
17
|
-
```text
|
|
18
|
-
let's /tdd this and /review when done
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
This loads `tdd` and `review` behind the scenes. Slash tokens stay in the visible prompt, so rewinding and editing previous prompts is easy.
|
|
22
|
-
|
|
23
|
-
Notes:
|
|
24
|
-
|
|
25
|
-
- Already-loaded skills are not injected again on the same session branch.
|
|
26
|
-
- Skills with `disable-model-invocation: true` work because this extension reads skill files directly.
|
|
27
|
-
- A registered pi command wins at the start of a prompt. Otherwise, a starting token like `/tdd` is treated as an inline skill.
|
|
28
|
-
|
|
29
|
-
## Commands
|
|
30
|
-
|
|
31
|
-
- `/loaded-skills`: List skills loaded in the current session.
|
|
32
|
-
|
|
33
|
-

|
|
34
|
-
|
|
35
|
-
## Release notes
|
|
36
|
-
|
|
37
|
-
See [CHANGELOG.md](https://github.com/tifandotme/pi-extensions/blob/master/packages/pi-inline-skills/CHANGELOG.md)
|
|
38
|
-
|
|
39
|
-
## License
|
|
40
|
-
|
|
41
|
-
[MIT](https://github.com/tifandotme/pi-extensions/blob/master/LICENSE)
|