@herbertgao/pi-extensions 2026.10.17 → 2026.10.18
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 +6 -6
- package/node_modules/@dietrichgebert/ponytail/.qoder-plugin/plugin.json +1 -1
- package/node_modules/@dietrichgebert/ponytail/hooks/band/metrics.ts +5 -11
- package/node_modules/@dietrichgebert/ponytail/hooks/band/register.tsx +69 -46
- package/node_modules/@dietrichgebert/ponytail/hooks/band/types.d.ts +0 -1
- package/node_modules/@dietrichgebert/ponytail/hooks/claude-codex-hooks.json +3 -3
- package/node_modules/@dietrichgebert/ponytail/hooks/copilot-hooks.json +2 -2
- package/node_modules/@dietrichgebert/ponytail/hooks/cursor-hooks.json +2 -2
- package/node_modules/@dietrichgebert/ponytail/hooks/ponytail-activate.js +4 -3
- package/node_modules/@dietrichgebert/ponytail/hooks/ponytail-map.js +4 -1
- package/node_modules/@dietrichgebert/ponytail/package.json +1 -1
- package/node_modules/@narumitw/pi-btw/README.md +3 -1
- package/node_modules/@narumitw/pi-btw/dist/index.ts +26 -5
- package/node_modules/@narumitw/pi-btw/dist/index.ts.map +2 -2
- package/node_modules/@narumitw/pi-btw/docs/core-alignment.md +40 -0
- package/node_modules/@narumitw/pi-btw/docs/workflows.md +3 -0
- package/node_modules/@narumitw/pi-btw/package.json +1 -1
- package/node_modules/@narumitw/pi-btw/src/btw.ts +31 -5
- package/node_modules/@narumitw/pi-btw/src/fullscreen-ui.ts +13 -0
- package/node_modules/pi-lens/CHANGELOG.md +83 -0
- package/node_modules/pi-lens/README.md +5 -1
- package/node_modules/pi-lens/dist/{chunk-JL6CXUMW.js → chunk-24BILSZW.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-S67UJDGQ.js → chunk-2TF6RXWB.js} +5 -5
- package/node_modules/pi-lens/dist/{chunk-ARD426WI.js → chunk-3F6BMY53.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-5ZR3APIM.js → chunk-3FRLWYBG.js} +26 -26
- package/node_modules/pi-lens/dist/{chunk-T7FTXGS3.js → chunk-3K2F6UDZ.js} +30 -30
- package/node_modules/pi-lens/dist/{chunk-HK6JVFZC.js → chunk-3YY7IXIL.js} +2 -2
- package/node_modules/pi-lens/dist/chunk-46TNM7XZ.js +88 -0
- package/node_modules/pi-lens/dist/{chunk-4AVZ3TG7.js → chunk-4L36HG27.js} +8 -8
- package/node_modules/pi-lens/dist/{chunk-PO45POGF.js → chunk-4LM3VAZH.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-UN4TEBWN.js → chunk-4LOE5R5P.js} +9 -9
- package/node_modules/pi-lens/dist/{chunk-KLQVC3XC.js → chunk-4YHYPW2G.js} +30 -7
- package/node_modules/pi-lens/dist/{chunk-W5LGKNET.js → chunk-4ZYJHQMB.js} +6 -6
- package/node_modules/pi-lens/dist/{chunk-W2V54OCL.js → chunk-6IR3ZYIB.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-FJIVKLPH.js → chunk-72OKUXSD.js} +10 -10
- package/node_modules/pi-lens/dist/{chunk-7RQXA5GG.js → chunk-75GAYVNO.js} +10 -9
- package/node_modules/pi-lens/dist/{chunk-V3APN3DY.js → chunk-7E2563GA.js} +12 -12
- package/node_modules/pi-lens/dist/{chunk-4WX4CTUE.js → chunk-7GLOLOSH.js} +25 -25
- package/node_modules/pi-lens/dist/{chunk-BWYQUPOS.js → chunk-ABPKUVA4.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-IPDG45G5.js → chunk-AKUUMGD5.js} +9 -9
- package/node_modules/pi-lens/dist/{chunk-Q6D6VMI4.js → chunk-ASUXV767.js} +6 -6
- package/node_modules/pi-lens/dist/{chunk-BM5GS6ZH.js → chunk-AWDSEDER.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-MA77RSFN.js → chunk-BZARLRJW.js} +4 -4
- package/node_modules/pi-lens/dist/{chunk-EVDGNG4F.js → chunk-CB4WHS4H.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-FA5LDARD.js → chunk-CCV2EU7T.js} +7 -7
- package/node_modules/pi-lens/dist/{chunk-U6OC3QEM.js → chunk-CE6VMBCB.js} +15 -15
- package/node_modules/pi-lens/dist/{chunk-AMXIUN2R.js → chunk-CPSR3AVL.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-SXGD4ANG.js → chunk-CTADOKYM.js} +7 -7
- package/node_modules/pi-lens/dist/{chunk-63RIVFQI.js → chunk-DH5JPM3K.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-MT6BVNFW.js → chunk-DPGEAHZT.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-4PCQCU47.js → chunk-DQZFQSR5.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-BHUWL2Y3.js → chunk-E7HJ56Y7.js} +5 -5
- package/node_modules/pi-lens/dist/{chunk-DQXSPYRI.js → chunk-EAOK7MIZ.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-2RLWJO5K.js → chunk-EKWX4WD3.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-WIZWZR4C.js → chunk-F7K5IBZG.js} +30 -28
- package/node_modules/pi-lens/dist/{chunk-VQH24FIP.js → chunk-FB5SCCPT.js} +9 -9
- package/node_modules/pi-lens/dist/{chunk-GZE7WOI4.js → chunk-FZKFVUEC.js} +438 -140
- package/node_modules/pi-lens/dist/{chunk-TIYGSODX.js → chunk-H7OR7DFZ.js} +15 -13
- package/node_modules/pi-lens/dist/{chunk-CJYKEW2L.js → chunk-HO6LWE2E.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-YSBHPOY6.js → chunk-HR3OJ3TH.js} +8 -8
- package/node_modules/pi-lens/dist/{chunk-CFRQMBGP.js → chunk-HWDAVBFU.js} +14 -14
- package/node_modules/pi-lens/dist/{chunk-2X4VLOCC.js → chunk-JJ2RRESP.js} +8 -5
- package/node_modules/pi-lens/dist/{chunk-YBSONGSZ.js → chunk-JMEKXFOL.js} +24 -24
- package/node_modules/pi-lens/dist/{chunk-MKVZQUEG.js → chunk-KDX35VXP.js} +69 -13
- package/node_modules/pi-lens/dist/{chunk-75SY4F24.js → chunk-KKCK636N.js} +7 -7
- package/node_modules/pi-lens/dist/{chunk-OLAWH5UQ.js → chunk-KPPJTH44.js} +2 -1
- package/node_modules/pi-lens/dist/{chunk-5APMQ2IJ.js → chunk-KW5JQPO5.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-SCIUNBPF.js → chunk-L3CMBQMH.js} +11 -11
- package/node_modules/pi-lens/dist/{chunk-GAACZY6R.js → chunk-L5JYIU47.js} +7 -7
- package/node_modules/pi-lens/dist/{chunk-2DDDCJDL.js → chunk-LBLBAFG3.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-NNKXDXXS.js → chunk-LLS45EWB.js} +8 -0
- package/node_modules/pi-lens/dist/{chunk-WQOIR3QY.js → chunk-LS3QJRUB.js} +7 -7
- package/node_modules/pi-lens/dist/{chunk-XCUHKYCQ.js → chunk-LSC3VADM.js} +6 -6
- package/node_modules/pi-lens/dist/{chunk-GMTFDAOK.js → chunk-LUBPZN36.js} +6 -6
- package/node_modules/pi-lens/dist/{chunk-DMSLNKF7.js → chunk-LV4UMYVH.js} +19 -19
- package/node_modules/pi-lens/dist/{chunk-XAIT2YGS.js → chunk-MB6PXBUA.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-AE37FEGH.js → chunk-MNJIXFX4.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-OJLTLYHB.js → chunk-MPKRJBPK.js} +30 -10
- package/node_modules/pi-lens/dist/{chunk-QGSTQH4D.js → chunk-N5WSK2K7.js} +6 -6
- package/node_modules/pi-lens/dist/{chunk-Z7IGUAXL.js → chunk-NA7SEXHE.js} +10 -6
- package/node_modules/pi-lens/dist/{chunk-UHGF5UT5.js → chunk-O4BJFESU.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-UCGQT677.js → chunk-OE5ZBP7F.js} +10 -10
- package/node_modules/pi-lens/dist/{chunk-KSR7RGQY.js → chunk-OXOI55RU.js} +4 -4
- package/node_modules/pi-lens/dist/{chunk-NDMCVUYK.js → chunk-PR6PO3ES.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-NIU2IPC5.js → chunk-PUZ3E2J4.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-2DMLM3ZO.js → chunk-QHSNL7B2.js} +8 -8
- package/node_modules/pi-lens/dist/{chunk-ZYNI26MI.js → chunk-QOE342SU.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-3WEPUD2V.js → chunk-R5MOQM2H.js} +98 -31
- package/node_modules/pi-lens/dist/{chunk-PPIBVH4R.js → chunk-RC2Z6K47.js} +4 -4
- package/node_modules/pi-lens/dist/{chunk-LEJOJDXL.js → chunk-RORGS5II.js} +4 -4
- package/node_modules/pi-lens/dist/{chunk-K2YGBXOA.js → chunk-RQS4QQSD.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-XQCSWV2G.js → chunk-RRV3FNNM.js} +10 -10
- package/node_modules/pi-lens/dist/{chunk-GTAI2J6U.js → chunk-SHLDT3OI.js} +8 -8
- package/node_modules/pi-lens/dist/{chunk-VPBIMOAQ.js → chunk-SNDXCFRS.js} +11 -9
- package/node_modules/pi-lens/dist/{chunk-Q4FCYCRE.js → chunk-T7A2HK2B.js} +10 -10
- package/node_modules/pi-lens/dist/{chunk-MN7MHUXQ.js → chunk-U5HPROLA.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-ZUUI3ZSA.js → chunk-U6VN4NVL.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-W5R5SABV.js → chunk-U7BD2QL7.js} +6 -6
- package/node_modules/pi-lens/dist/{chunk-P4QNXS6I.js → chunk-UF7RTZSO.js} +8 -8
- package/node_modules/pi-lens/dist/{chunk-A3YNG5KP.js → chunk-URCQWAQ4.js} +11 -11
- package/node_modules/pi-lens/dist/{chunk-FFL3A2VP.js → chunk-VUZWQ7UG.js} +4 -4
- package/node_modules/pi-lens/dist/{chunk-YRD4ISED.js → chunk-W4WP2ERB.js} +10 -10
- package/node_modules/pi-lens/dist/{chunk-OOU2WZZE.js → chunk-WDBICWH3.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-BI5LAQ3Y.js → chunk-WGRJOXED.js} +114 -148
- package/node_modules/pi-lens/dist/{chunk-ZQ6NZZTB.js → chunk-WME2OQST.js} +33 -0
- package/node_modules/pi-lens/dist/{chunk-DC4CFXM5.js → chunk-XT2HTCJ5.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-SJJYRZB4.js → chunk-Y7F7IEE3.js} +55 -23
- package/node_modules/pi-lens/dist/{chunk-2F47TQOA.js → chunk-YES5CACN.js} +29 -29
- package/node_modules/pi-lens/dist/{chunk-H7HTEQUZ.js → chunk-YHC2O2WO.js} +7 -7
- package/node_modules/pi-lens/dist/{chunk-Q3UZHW6N.js → chunk-YVHBNSME.js} +6 -10
- package/node_modules/pi-lens/dist/{chunk-3MYEA7QD.js → chunk-ZE3KXHS7.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-VG5JS5SW.js → chunk-ZGSJDWQU.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-5CV5ITZF.js → chunk-ZJTT47IG.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-Q4EMRFNA.js → chunk-ZMAUPOMG.js} +24 -24
- package/node_modules/pi-lens/dist/index.js +1925 -944
- package/node_modules/pi-lens/dist/mcp/analyze-cli.js +6 -6
- package/node_modules/pi-lens/dist/mcp/cli.js +30 -30
- package/node_modules/pi-lens/dist/mcp/server.js +707 -455
- package/node_modules/pi-lens/dist/mcp/worker.js +48 -48
- package/node_modules/pi-lens/dist/probes/installer.js +13 -13
- package/node_modules/pi-lens/docs/agent-tools.md +11 -3
- package/node_modules/pi-lens/docs/defect-shapes.md +15 -1
- package/node_modules/pi-lens/docs/dependencies.md +1 -0
- package/node_modules/pi-lens/docs/environment-variables.md +14 -0
- package/node_modules/pi-lens/docs/features.md +11 -1
- package/node_modules/pi-lens/docs/globalconfig.md +12 -1
- package/node_modules/pi-lens/docs/invariants/git-guard-host.md +34 -0
- package/node_modules/pi-lens/docs/invariants/lsp-trust-exec.md +6 -0
- package/node_modules/pi-lens/docs/invariants/session-telemetry.md +42 -2
- package/node_modules/pi-lens/docs/lsp-capability-matrix.md +89 -45
- package/node_modules/pi-lens/docs/lsp-idle-eviction.md +3 -5
- package/node_modules/pi-lens/docs/pi-lens-fixer.md +8 -1
- package/node_modules/pi-lens/docs/pi-lens-merge-policy.md +7 -4
- package/node_modules/pi-lens/docs/pi-lens-subagent.md +7 -4
- package/node_modules/pi-lens/docs/schema/pi-lens-config-v1.json +23 -0
- package/node_modules/pi-lens/docs/servercapabilities.md +1 -1
- package/node_modules/pi-lens/docs/settings.md +5 -0
- package/node_modules/pi-lens/docs/usage.md +5 -0
- package/node_modules/pi-lens/package.json +1 -1
- package/node_modules/pi-web-access/CHANGELOG.md +32 -1
- package/node_modules/pi-web-access/README.md +53 -15
- package/node_modules/pi-web-access/cloudflare-search.ts +237 -0
- package/node_modules/pi-web-access/curator-page.ts +12 -1
- package/node_modules/pi-web-access/curator-server.ts +3 -0
- package/node_modules/pi-web-access/dist/index.js +9450 -8642
- package/node_modules/pi-web-access/dist/mcp-cli.js +16742 -15954
- package/node_modules/pi-web-access/exa.ts +94 -20
- package/node_modules/pi-web-access/extract.ts +61 -9
- package/node_modules/pi-web-access/gemini-search.ts +17 -7
- package/node_modules/pi-web-access/index.ts +6 -0
- package/node_modules/pi-web-access/mcp-tool-definitions.ts +50 -34
- package/node_modules/pi-web-access/openai-search.ts +3 -1
- package/node_modules/pi-web-access/package.json +3 -2
- package/node_modules/pi-web-access/page-query.ts +13 -3
- package/node_modules/pi-web-access/pdf-extract.ts +1 -5
- package/node_modules/pi-web-access/perplexity.ts +2 -0
- package/node_modules/pi-web-access/searchapi.ts +202 -0
- package/node_modules/pi-web-access/source-check.ts +7 -0
- package/node_modules/pi-web-access/ssrf-protection.ts +25 -1
- package/node_modules/pi-web-access/summary-review.ts +21 -10
- package/node_modules/pi-web-access/tabstack.ts +289 -0
- package/node_modules/pi-web-access/utils.ts +79 -16
- package/node_modules/pi-web-access/web-tool-core.ts +10 -1
- package/node_modules/pi-web-access/xai-search.ts +3 -1
- package/package.json +5 -5
- package/node_modules/pi-lens/dist/chunk-G2B7F6ZU.js +0 -88
package/README.md
CHANGED
|
@@ -22,9 +22,9 @@ The package bundles 6 active `@herbertgao/*` child packages—`pi-agency`, `pi-b
|
|
|
22
22
|
|
|
23
23
|
- `pi-antigravity@0.11.0`
|
|
24
24
|
- `pi-provider-qoder@0.6.6`
|
|
25
|
-
- `@dietrichgebert/ponytail@5.3.
|
|
25
|
+
- `@dietrichgebert/ponytail@5.3.3`
|
|
26
26
|
- `@juicesharp/rpiv-ask-user-question@2.15.0`
|
|
27
|
-
- `@narumitw/pi-btw@0.63.
|
|
27
|
+
- `@narumitw/pi-btw@0.63.3`
|
|
28
28
|
- `@narumitw/pi-caffeinate@0.49.13`
|
|
29
29
|
- `@pi-plugins/fast-mode@0.1.14`
|
|
30
30
|
- `@tifan/pi-copy-response@0.2.7`
|
|
@@ -36,8 +36,8 @@ The package bundles 6 active `@herbertgao/*` child packages—`pi-agency`, `pi-b
|
|
|
36
36
|
- `@tifan/pi-rename@0.6.0`
|
|
37
37
|
- `pi-typesafe@0.13.1`
|
|
38
38
|
- `pi-next-cue@1.0.8`
|
|
39
|
-
- `pi-lens@4.4.
|
|
40
|
-
- `pi-web-access@0.
|
|
39
|
+
- `pi-lens@4.4.7`
|
|
40
|
+
- `pi-web-access@0.46.0`
|
|
41
41
|
|
|
42
42
|
Pi loads their extensions and skills through `node_modules/` paths inside one package root. The upstream companions are pinned and bundled, not forked or renamed.
|
|
43
43
|
|
|
@@ -59,11 +59,11 @@ Impeccable `4.8.0` is vendored as `@herbertgao/pi-impeccable` and loaded with `/
|
|
|
59
59
|
|
|
60
60
|
`@narumitw/pi-caffeinate@0.49.13` uses the host platform's sleep inhibitor during each Pi agent run. On macOS, `/caffeinate sleep` keeps the system awake while allowing the display to sleep; `/caffeinate display` also keeps the display awake. It releases the inhibitor when the run or session ends. Its D-Bus dependency remains on the normal socket transport under Node; Bun on Linux/macOS can use FFI and an in-process reader thread for Unix file-descriptor transport, and that thread can be unreferenced so the connection need not keep the process alive. It falls back when FFI is unavailable. No daemon or build step is added.
|
|
61
61
|
|
|
62
|
-
`@narumitw/pi-btw@0.63.
|
|
62
|
+
`@narumitw/pi-btw@0.63.3` opens its side workspace through the `@narumitw/pi-tui-kit@^0.68.0` fullscreen handoff. It does not start that UI when the flow is already disposed or the parent terminal cannot be restored. Only one BTW flow can be open per session; a second `/btw` warns and stays closed. In split layout, mounting the first split releases Pi's idle wait so the main input stays usable. Importing new main-thread context stays manual. Settings rows keep a clipped label or value in full under the list, and a searchable model choice shows how many results match.
|
|
63
63
|
|
|
64
64
|
`clef` asks Cloudflare Clef-flash an on-demand yes/no, choice, or score and prints the questions and answers in the transcript, plus a one-line notice. It is not a permission gate. `pi-typesafe@0.13.1` provides `/typesafe` and `typesafe_evaluate` for explicit structured decisions; `/typesafe enable` or `PI_TYPESAFE_ENABLED=1` is still required for agent tool calls. The default backend remains `https://api.typesafe.ai`. `PI_TYPESAFE_BACKEND` and `PI_TYPESAFE_MODEL` select the session backend and model, and `/typesafe login` stores a key for the named backend. Daily request, token, and USD caps are opt-in. OpenRouter, Command Code, Liquid, SubQ, and a named endpoint stay explicit and use that backend's own key. The promoted SDK is `@typesafe-ai/sdk@0.7.0`. Under Bun, the judge transport reads each response body once and replays it, so the SDK can still read the result after Bun marks the original body used.
|
|
65
65
|
|
|
66
|
-
`@herbertgao/sol-pi` adds opt-in Action Fusion, ObservationPack, Evidence-Preserving Reducer, and Online Context Compact; see its [configuration guide](../sol-pi/docs/configuration.md). `pi-lens@4.4.
|
|
66
|
+
`@herbertgao/sol-pi` adds opt-in Action Fusion, ObservationPack, Evidence-Preserving Reducer, and Online Context Compact; see its [configuration guide](../sol-pi/docs/configuration.md). `pi-lens@4.4.7` publishes a public LSP config schema, reads user-level custom rule directories (project before user before built-in), normalizes argv-style server entries, downgrades `throw-new-error` to a warning, and counts Docker, JSON, and Jedi servers in idle eviction; language routing and the retained multi-root diagnostic facts are unchanged. It promotes `@ast-grep/cli` to `0.51.0` and `@ast-grep/napi` to `^0.51.0`. Concatenated SQL passed to `.execute()` is an advisory full-analysis finding; a parameterized `execute(sql, values)` call stays quiet. Keeping injected findings in later requests is opt-in. A workspace edit through a dangling symlink is refused, and a symlink that resolves outside the workspace is refused; the fallback Biome config no longer names a nursery rule. `pi-web-access@0.46.0` provides configurable web search and fetch tools; its `toolActivation` defaults to `auto`, choosing eager or dynamic tool activation per model. `toolActivation: "none"` stays opt-in and still requires deferred exposure. Field extraction, 9router, empty or off-topic search fallback, and plain HTTP gateway URLs stay off unless configured. An unknown tool-call provider name fails instead of selecting a provider automatically, and DuckDuckGo searches stay spaced apart after a bot check. It adds structured search/fetch data for codemode and an optional, manually started `pi-web-access-mcp` stdio CLI; installing the aggregate does not start that server. Degoog, Keenable, Ceramic, Linkup, DeepSeek fetch, Cloudflare search, SearchApi, and Tabstack are explicit-only, excluded from automatic and `all` selection. Optional `fetchContent.curl` and Exa/Tabstack fetch routing stay off unless configured. Provider gateway base URLs are opt-in and are not configured by the aggregate. OpenAI search now defaults to `gpt-6-luna`, results and clone cleanup are scoped per extension instance, and the promoted `@modelcontextprotocol/sdk@^1.32.1` moves the bundle off GHSA-6qxp-vccf-f47h. Perplexity search now uses the Search API's ranked pages and snippets rather than a Sonar-generated answer; requests requiring prose still use Sonar. `pi-antigravity@0.11.0` reads Pi 0.86+ transcript system messages, so Antigravity requests carry Pi's system prompt and tools; it also registers `google_search` and `generate_image` tools that use the signed-in Antigravity account. `pi-provider-qoder@0.6.6` registers the `qoder` and `qoder-cn` model providers. A queued model-busy response reports its wait instead of being ignored; a ready busy response stays retryable. Sign in with `/login qoder` (browser or a personal access token from [qoder.com/account/integrations](https://qoder.com/account/integrations)) or `/login qoder-cn` (token from [qoder.com.cn/account/integrations](https://qoder.com.cn/account/integrations)). `QODER_PERSONAL_ACCESS_TOKEN` and `QODERCN_PERSONAL_ACCESS_TOKEN` log those providers in at startup. `/qoder-usage footer on` replaces the status-bar footer for that session, so leave it off while the pi-cc footer is in use. Preferred Thinking 1.0.2 preserves an explicit subagent `--thinking` choice. Deprecated `@tifan/pi-titlebar-spinner` is no longer bundled; Rename remains the single owner of Herdr tab naming.
|
|
67
67
|
|
|
68
68
|
`pi-stash` is no longer bundled: `/btw` already preserves the main editor draft while handling side questions outside the main conversation. Prior `@herbertgao/pi-stash` releases remain available but are no longer maintained here.
|
|
69
69
|
|
|
@@ -76,17 +76,11 @@ export function callsIn(text: string, known: Map<string, string>, own: string[])
|
|
|
76
76
|
return [...names]
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
for (const [other, where] of known) {
|
|
85
|
-
const at = where.slice(0, where.lastIndexOf(':'))
|
|
86
|
-
const sameFile = file === at || file.endsWith(`/${at}`)
|
|
87
|
-
if (norm(other) === norm(name) && !sameFile) return `${other} (${where})`
|
|
88
|
-
}
|
|
89
|
-
return undefined
|
|
79
|
+
// Whether a file lies under the project root; Windows paths may use either slash.
|
|
80
|
+
export function inProject(file: string, root: string): boolean {
|
|
81
|
+
const f = file.replace(/\\/g, '/')
|
|
82
|
+
const r = root.replace(/\\/g, '/').replace(/\/+$/, '')
|
|
83
|
+
return f === r || f.startsWith(`${r}/`)
|
|
90
84
|
}
|
|
91
85
|
|
|
92
86
|
const TEST_CMD = /\b(npm (run )?test|pnpm (run )?test|yarn test|bun test|npx (jest|vitest)|jest|vitest|pytest|python3? -m pytest|go test|cargo test|mvn test|gradle test|rspec|phpunit|dotnet test|node --test|deno test|make test)\b/
|
|
@@ -11,10 +11,10 @@ import {
|
|
|
11
11
|
addedLines,
|
|
12
12
|
callsIn,
|
|
13
13
|
defsIn,
|
|
14
|
-
duplicateOf,
|
|
15
14
|
elapsed,
|
|
16
15
|
fmtTokens,
|
|
17
16
|
hits,
|
|
17
|
+
inProject,
|
|
18
18
|
isCode,
|
|
19
19
|
isSource,
|
|
20
20
|
isTestCommand,
|
|
@@ -52,7 +52,6 @@ const EMPTY: Band = {
|
|
|
52
52
|
transcript: '',
|
|
53
53
|
reused: [],
|
|
54
54
|
created: [],
|
|
55
|
-
dupes: [],
|
|
56
55
|
removed: [],
|
|
57
56
|
openCallers: [],
|
|
58
57
|
tests: { state: 'none' },
|
|
@@ -69,7 +68,6 @@ const TASK = {
|
|
|
69
68
|
model: '',
|
|
70
69
|
reused: [],
|
|
71
70
|
created: [],
|
|
72
|
-
dupes: [],
|
|
73
71
|
removed: [],
|
|
74
72
|
openCallers: [],
|
|
75
73
|
tests: { state: 'none' as const },
|
|
@@ -127,6 +125,24 @@ async function readModel($: EngineInterface, transcript: string): Promise<string
|
|
|
127
125
|
return grep?.exitCode === 0 ? mainModel(grep.stdout) : ''
|
|
128
126
|
}
|
|
129
127
|
|
|
128
|
+
// Where Claude Code keeps the session's transcript: on managed, Team and Enterprise machines its cc-plugin-sec-default skips every classic.* hook, so no hook hands the path over.
|
|
129
|
+
// First the folder its rule names, then every project folder: it hashes names past 200 characters, and /cd, worktrees and /resume can put the file elsewhere.
|
|
130
|
+
// shortcut: with persistence off there is no file, so every turn checks every folder, read the path from the engine once it offers one.
|
|
131
|
+
async function findTranscript($: EngineInterface, session: string): Promise<string> {
|
|
132
|
+
const projects = `${await claudeDir($)}/projects`
|
|
133
|
+
const exists = (file: string) => $.fs.exists(file).catch(() => false)
|
|
134
|
+
const root = await $.session.root().catch(() => '')
|
|
135
|
+
const named = `${projects}/${root.replace(/[^a-zA-Z0-9]/g, '-')}/${session}.jsonl`
|
|
136
|
+
if (root !== '' && (await exists(named))) return named
|
|
137
|
+
const dirs = (await $.fs.list(projects).catch(() => [])).filter(d => d.kind === 'dir')
|
|
138
|
+
// One at a time: thousands of checks in flight at once are slower than in turn.
|
|
139
|
+
for (const dir of dirs) {
|
|
140
|
+
const file = `${projects}/${dir.name}/${session}.jsonl`
|
|
141
|
+
if (await exists(file)) return file
|
|
142
|
+
}
|
|
143
|
+
return ''
|
|
144
|
+
}
|
|
145
|
+
|
|
130
146
|
// Where the task ledgers and the board live.
|
|
131
147
|
// shortcut: ~/.config only (XDG respected); Windows would want %APPDATA%.
|
|
132
148
|
async function ledgerDir($: EngineInterface) {
|
|
@@ -181,39 +197,50 @@ async function openBoard($: EngineInterface) {
|
|
|
181
197
|
await $.process.run(windows ? ['cmd', '/c', 'start', '', file] : [mac ? 'open' : 'xdg-open', file])
|
|
182
198
|
}
|
|
183
199
|
|
|
200
|
+
// Sets the band up for a session (level, project, task row, cost baseline); returns the definitions that exist now.
|
|
201
|
+
async function start($: EngineInterface): Promise<Map<string, string>> {
|
|
202
|
+
const grep = await $.process.run(['git', 'grep', '--untracked', '-nE', GREP_DEFS]).catch(() => undefined)
|
|
203
|
+
const level = await readLevel($)
|
|
204
|
+
const details = (await $.store.get('details')) === true
|
|
205
|
+
const repo = await $.session.repo().catch(() => null)
|
|
206
|
+
const project = base(repo?.root ?? (await $.session.cwd()))
|
|
207
|
+
const session = await $.session.id()
|
|
208
|
+
// The cost so far is the baseline for the last turn's own cost.
|
|
209
|
+
const usage = await $.session.usage().catch(() => undefined)
|
|
210
|
+
const csv = usage ? await $.fs.read(ledgerFile(await ledgerDir($), project)).catch(() => '') : ''
|
|
211
|
+
const key = usage ? taskKey(session, usage.startedAt) : ''
|
|
212
|
+
await update($, band, b => resume({ ...EMPTY, ...b, level, details, project, session, cost: usage?.cost?.usd ?? b.cost }, csv, key))
|
|
213
|
+
return grep?.exitCode === 0 ? parseDefs(grep.stdout) : new Map()
|
|
214
|
+
}
|
|
215
|
+
|
|
184
216
|
export const register: Register = (on, options) => {
|
|
185
217
|
// Definitions that existed when the session started: what new code can reuse.
|
|
186
218
|
let known = new Map<string, string>()
|
|
187
219
|
|
|
188
220
|
on('session.start', async ($, e, next) => {
|
|
189
|
-
|
|
190
|
-
known = grep?.exitCode === 0 ? parseDefs(grep.stdout) : new Map()
|
|
191
|
-
const level = await readLevel($)
|
|
192
|
-
const details = (await $.store.get('details')) === true
|
|
193
|
-
const repo = await $.session.repo().catch(() => null)
|
|
194
|
-
const project = base(repo?.root ?? (await $.session.cwd()))
|
|
195
|
-
const session = await $.session.id()
|
|
196
|
-
// The cost so far is the baseline for the last turn's own cost.
|
|
197
|
-
const usage = await $.session.usage().catch(() => undefined)
|
|
198
|
-
const csv = usage ? await $.fs.read(ledgerFile(await ledgerDir($), project)).catch(() => '') : ''
|
|
199
|
-
const key = usage ? taskKey(session, usage.startedAt) : ''
|
|
200
|
-
await update($, band, b => resume({ ...EMPTY, ...b, level, details, project, session, cost: usage?.cost?.usd ?? b.cost }, csv, key))
|
|
201
|
-
|
|
221
|
+
known = await start($)
|
|
202
222
|
return next(e)
|
|
203
223
|
}).catch(($, e, next) => next(e))
|
|
204
224
|
|
|
225
|
+
// /clear, /resume and /branch go on under another session id with an empty band and no session.start, so the band
|
|
226
|
+
// showed "off" until the first turn ended. Set it up again once one of them has moved the session.
|
|
227
|
+
// Only these commands: the engine labels a command's output with every plugin its hook chain ran through, so a hook on
|
|
228
|
+
// every command printed "ponytail+<plugin>:" before other plugins' commands.
|
|
229
|
+
// shortcut: after /clear, ponytail-activate.js may reset the flag to the default level after this, so a level switched
|
|
230
|
+
// before /clear can show until the first turn ends; a session skips a plugin's classic.SessionStart hook, the one later point.
|
|
231
|
+
on('command.run', { command: ['clear', 'resume', 'branch'] }, async ($, e, next) => {
|
|
232
|
+
const session = await $.session.id()
|
|
233
|
+
const result = await next(e)
|
|
234
|
+
if ((await $.session.id()) !== session) known = await start($).catch(() => known)
|
|
235
|
+
return result
|
|
236
|
+
}).catch(($, e, next) => next(e))
|
|
237
|
+
|
|
205
238
|
// /clear starts a new task: the counters start over, the cost baseline stays.
|
|
206
239
|
on('session.end', async ($, e, next) => {
|
|
207
240
|
if (e.reason === 'clear') await update($, band, b => ({ ...EMPTY, ...b, ...TASK }))
|
|
208
241
|
return next(e)
|
|
209
242
|
}).catch(($, e, next) => next(e))
|
|
210
243
|
|
|
211
|
-
// Only the classic hook input carries the transcript path, which holds the sidebar name.
|
|
212
|
-
on('classic.UserPromptSubmit', async ($, e, next) => {
|
|
213
|
-
await update($, band, b => (b.transcript === e.transcript_path ? b : { ...EMPTY, ...b, transcript: e.transcript_path }))
|
|
214
|
-
return next(e)
|
|
215
|
-
}).catch(($, e, next) => next(e))
|
|
216
|
-
|
|
217
244
|
// The first prompt names the task until the session has a sidebar name.
|
|
218
245
|
on('prompt.submit', async ($, e, next) => {
|
|
219
246
|
const text = e.text.trim()
|
|
@@ -237,6 +264,9 @@ export const register: Register = (on, options) => {
|
|
|
237
264
|
if (e.tool !== 'Edit' && e.tool !== 'Write') return next(e)
|
|
238
265
|
|
|
239
266
|
const file = e.file_path
|
|
267
|
+
// A scratch script outside the project is never reused or called by it (#1300).
|
|
268
|
+
const repo = await $.session.repo().catch(() => null)
|
|
269
|
+
if (!inProject(file, repo?.root ?? (await $.session.cwd()))) return next(e)
|
|
240
270
|
const before = e.tool === 'Write' ? await $.fs.read(file).catch(() => '') : e.old_string
|
|
241
271
|
const after = e.tool === 'Write' ? e.content : e.new_string
|
|
242
272
|
const ran = await next(e)
|
|
@@ -247,16 +277,11 @@ export const register: Register = (on, options) => {
|
|
|
247
277
|
const created = isSource(file) ? newDefs.filter(n => !oldDefs.includes(n)) : []
|
|
248
278
|
const removed = oldDefs.filter(n => !newDefs.includes(n))
|
|
249
279
|
const reused = isSource(file) ? callsIn(addedLines(before, after), known, newDefs) : []
|
|
250
|
-
const dupes = created.flatMap(name => {
|
|
251
|
-
const like = duplicateOf(name, file, known)
|
|
252
|
-
return like ? [{ name, like }] : []
|
|
253
|
-
})
|
|
254
280
|
|
|
255
281
|
await update($, band, b => ({
|
|
256
282
|
...b,
|
|
257
283
|
reused: union(b.reused, reused),
|
|
258
284
|
created: union(b.created, created),
|
|
259
|
-
dupes: [...b.dupes, ...dupes.filter(d => !b.dupes.some(x => x.name === d.name))],
|
|
260
285
|
removed: union(b.removed, removed),
|
|
261
286
|
tests: isCode(file) && b.tests.state !== 'none' ? { ...b.tests, state: 'stale' as const } : b.tests,
|
|
262
287
|
}))
|
|
@@ -275,7 +300,11 @@ export const register: Register = (on, options) => {
|
|
|
275
300
|
const usage = await $.session.usage()
|
|
276
301
|
const turns = await $.session.turns()
|
|
277
302
|
const level = await readLevel($)
|
|
278
|
-
const { removed, transcript } = await load($)
|
|
303
|
+
const { removed, transcript: saved } = await load($)
|
|
304
|
+
const session = await $.session.id()
|
|
305
|
+
// Here, not at start: the first turn writes the file, and a new id (/clear, /resume) or a move (/cd, a worktree) changes it.
|
|
306
|
+
const kept = base(saved) === `${session}.jsonl` && (await $.fs.exists(saved).catch(() => false))
|
|
307
|
+
const transcript = kept ? saved : await findTranscript($, session)
|
|
279
308
|
const title = await readTitle($, transcript)
|
|
280
309
|
const model = await readModel($, transcript)
|
|
281
310
|
|
|
@@ -303,6 +332,7 @@ export const register: Register = (on, options) => {
|
|
|
303
332
|
return {
|
|
304
333
|
...b,
|
|
305
334
|
level,
|
|
335
|
+
transcript,
|
|
306
336
|
cost,
|
|
307
337
|
// Cost and turns are the session's own totals, so a reload or a second band never starts them over.
|
|
308
338
|
spent: usage.cost?.usd ?? b.spent + turn,
|
|
@@ -351,7 +381,9 @@ export const register: Register = (on, options) => {
|
|
|
351
381
|
}
|
|
352
382
|
|
|
353
383
|
const { Box, Text, Button } = $.ui.resolve(e)
|
|
354
|
-
|
|
384
|
+
// bodyColumns counts terminal cells; a graphical surface draws Buttons wider than their cells, so a row sized to it wraps there.
|
|
385
|
+
const width = e.surface === 'terminal' ? e.props.bodyColumns : undefined
|
|
386
|
+
const stack =(mine: NonNullable<typeof below>) => (below ? <Box flexDirection="column">{mine}{below}</Box> : mine)
|
|
355
387
|
|
|
356
388
|
const testsText =
|
|
357
389
|
b.tests.state === 'pass'
|
|
@@ -362,13 +394,11 @@ export const register: Register = (on, options) => {
|
|
|
362
394
|
? 'no test since change'
|
|
363
395
|
: ''
|
|
364
396
|
const testsColor = b.tests.state === 'pass' ? 'success' : b.tests.state === 'fail' ? 'error' : undefined
|
|
365
|
-
const dupe = b.dupes[0]
|
|
366
|
-
const hasDupes = dupe !== undefined
|
|
367
397
|
const hasOpen = b.openCallers.length > 0
|
|
368
398
|
|
|
369
399
|
if (!b.details) {
|
|
370
400
|
return stack(
|
|
371
|
-
<Box flexDirection="row" alignItems="center" gap={2} width={
|
|
401
|
+
<Box flexDirection="row" alignItems="center" gap={2} width={width}>
|
|
372
402
|
{/* A click opens the four levels: one click, one turn, no stops on levels nobody wanted. */}
|
|
373
403
|
<Button key="level" plain onPress={toggle}>
|
|
374
404
|
<Text color={b.level === 'off' ? 'inactive' : 'suggestion'}>●</Text> {b.level}
|
|
@@ -377,7 +407,6 @@ export const register: Register = (on, options) => {
|
|
|
377
407
|
{last !== undefined && <Text dimColor>last ${last.toFixed(2)}</Text>}
|
|
378
408
|
<Text dimColor>{elapsed(b.busyMs)}</Text>
|
|
379
409
|
{reuse !== undefined && <Text>{reuse}% reuse</Text>}
|
|
380
|
-
{hasDupes && <Text color="warning">{b.dupes.length} duplicate?</Text>}
|
|
381
410
|
{hasOpen && <Text color="warning">⚠ {b.openCallers.length} callers open</Text>}
|
|
382
411
|
{testsText !== '' && (
|
|
383
412
|
<Text color={testsColor} dimColor={b.tests.state === 'stale'}>
|
|
@@ -396,18 +425,10 @@ export const register: Register = (on, options) => {
|
|
|
396
425
|
// Only columns that say something; callers and tests appear once there is something to report.
|
|
397
426
|
const cols: Col[] = [
|
|
398
427
|
{ key: 'cost', label: 'cost', value: `$${b.spent.toFixed(2)}`, sub: last === undefined ? '' : `last $${last.toFixed(2)} · ⌀ $${avg.toFixed(2)}` },
|
|
399
|
-
{ key: 'tokens', label: 'tokens', value: fmtTokens(totalTokens(b.tokens)), sub: `${
|
|
428
|
+
{ key: 'tokens', label: 'tokens', value: fmtTokens(totalTokens(b.tokens)), sub: `${b.turns} ${b.turns === 1 ? 'turn' : 'turns'}` },
|
|
400
429
|
{ key: 'time', label: 'agent time', value: elapsed(b.busyMs), sub: b.turns > 0 ? `⌀ ${elapsed(b.busyMs / b.turns)} / turn` : '' },
|
|
401
430
|
]
|
|
402
|
-
if (
|
|
403
|
-
cols.push({
|
|
404
|
-
key: 'reuse',
|
|
405
|
-
label: 'reuse',
|
|
406
|
-
value: reuse === undefined ? `${b.created.length} new` : `${reuse}%`,
|
|
407
|
-
sub: dupe ? `${dupe.name} ≈ ${dupe.like}` : reuse === undefined ? `${b.reused.length} reused` : `${b.reused.length} used · ${b.created.length} new`,
|
|
408
|
-
tone: hasDupes ? 'warning' : undefined,
|
|
409
|
-
})
|
|
410
|
-
}
|
|
431
|
+
if (reuse !== undefined) cols.push({ key: 'reuse', label: 'reuse', value: `${reuse}%`, sub: '' })
|
|
411
432
|
if (hasOpen) {
|
|
412
433
|
cols.push({ key: 'callers', label: 'callers', value: `${b.openCallers.length} open`, sub: b.openCallers.slice(0, 2).join(', '), tone: 'warning' })
|
|
413
434
|
}
|
|
@@ -422,13 +443,14 @@ export const register: Register = (on, options) => {
|
|
|
422
443
|
}
|
|
423
444
|
|
|
424
445
|
let metrics = (
|
|
425
|
-
<Box flexDirection="column"
|
|
446
|
+
<Box flexDirection="column">
|
|
426
447
|
<Text dimColor wrap="truncate-end">
|
|
427
448
|
{'─'.repeat(e.props.bodyColumns)}
|
|
428
449
|
</Text>
|
|
429
450
|
<Box flexDirection="row" gap={2}>
|
|
430
451
|
{cols.map(c => (
|
|
431
|
-
|
|
452
|
+
// Off the terminal the columns share the row; a width in cells would leave most of it empty and cut the text.
|
|
453
|
+
<Box key={c.key} flexDirection="column" {...(width === undefined ? { flexGrow: 1 } : { width: Math.max(10, Math.floor(width / cols.length) - 2) })}>
|
|
432
454
|
<Text dimColor>{c.label}</Text>
|
|
433
455
|
<Text bold color={c.tone}>
|
|
434
456
|
{c.value}
|
|
@@ -448,7 +470,8 @@ export const register: Register = (on, options) => {
|
|
|
448
470
|
}
|
|
449
471
|
|
|
450
472
|
return stack(
|
|
451
|
-
|
|
473
|
+
// The desktop's SVG draws its own line at the top, which would touch the buttons without the gap.
|
|
474
|
+
<Box flexDirection="column" width={width} gap={e.surface === 'desktop' ? 1 : 0}>
|
|
452
475
|
<Box flexDirection="row" alignItems="center" gap={1}>
|
|
453
476
|
{LEVELS.map(level => (
|
|
454
477
|
<Button
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
{
|
|
8
8
|
"type": "command",
|
|
9
9
|
"command": "node -e \"require(require('path').join(process.env.CLAUDE_PLUGIN_ROOT.split(String.fromCharCode(92)).join('/'), 'hooks/ponytail-activate.js'))\"",
|
|
10
|
-
"timeout":
|
|
10
|
+
"timeout": 15,
|
|
11
11
|
"statusMessage": "Loading ponytail mode..."
|
|
12
12
|
}
|
|
13
13
|
]
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
{
|
|
20
20
|
"type": "command",
|
|
21
21
|
"command": "node -e \"require(require('path').join(process.env.CLAUDE_PLUGIN_ROOT.split(String.fromCharCode(92)).join('/'), 'hooks/ponytail-subagent.js'))\"",
|
|
22
|
-
"timeout":
|
|
22
|
+
"timeout": 15,
|
|
23
23
|
"statusMessage": "Loading ponytail mode..."
|
|
24
24
|
}
|
|
25
25
|
]
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
{
|
|
32
32
|
"type": "command",
|
|
33
33
|
"command": "node -e \"require(require('path').join(process.env.CLAUDE_PLUGIN_ROOT.split(String.fromCharCode(92)).join('/'), 'hooks/ponytail-mode-tracker.js'))\"",
|
|
34
|
-
"timeout":
|
|
34
|
+
"timeout": 15,
|
|
35
35
|
"statusMessage": "Tracking ponytail mode..."
|
|
36
36
|
}
|
|
37
37
|
]
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"type": "command",
|
|
7
7
|
"bash": "node -e \"require(require('path').join(process.env.PLUGIN_ROOT.split(String.fromCharCode(92)).join('/'), 'hooks/ponytail-activate.js'))\" || exit 0",
|
|
8
8
|
"powershell": "if (Get-Command node -ErrorAction SilentlyContinue) { node -e \"require(require('path').join(process.env.PLUGIN_ROOT.split(String.fromCharCode(92)).join('/'), 'hooks/ponytail-activate.js'))\" }",
|
|
9
|
-
"timeoutSec":
|
|
9
|
+
"timeoutSec": 15
|
|
10
10
|
}
|
|
11
11
|
],
|
|
12
12
|
"userPromptSubmitted": [
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"type": "command",
|
|
15
15
|
"bash": "node -e \"require(require('path').join(process.env.PLUGIN_ROOT.split(String.fromCharCode(92)).join('/'), 'hooks/ponytail-mode-tracker.js'))\" || exit 0",
|
|
16
16
|
"powershell": "if (Get-Command node -ErrorAction SilentlyContinue) { node -e \"require(require('path').join(process.env.PLUGIN_ROOT.split(String.fromCharCode(92)).join('/'), 'hooks/ponytail-mode-tracker.js'))\" }",
|
|
17
|
-
"timeoutSec":
|
|
17
|
+
"timeoutSec": 15
|
|
18
18
|
}
|
|
19
19
|
]
|
|
20
20
|
}
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
"sessionStart": [
|
|
5
5
|
{
|
|
6
6
|
"command": "node \"PONYTAIL_DIR/hooks/ponytail-activate.js\"",
|
|
7
|
-
"timeout":
|
|
7
|
+
"timeout": 15
|
|
8
8
|
}
|
|
9
9
|
],
|
|
10
10
|
"beforeSubmitPrompt": [
|
|
11
11
|
{
|
|
12
12
|
"command": "node \"PONYTAIL_DIR/hooks/ponytail-mode-tracker.js\"",
|
|
13
|
-
"timeout":
|
|
13
|
+
"timeout": 15
|
|
14
14
|
}
|
|
15
15
|
]
|
|
16
16
|
}
|
|
@@ -60,11 +60,12 @@ function activate(mode) {
|
|
|
60
60
|
// 2. Emit the ponytail ruleset, filtered to the active intensity level.
|
|
61
61
|
let output = getPonytailInstructions(mode);
|
|
62
62
|
|
|
63
|
-
// 2b. Codebase map: what already exists, so "reuse first" costs no search. Fail open:
|
|
64
|
-
//
|
|
63
|
+
// 2b. Codebase map: what already exists, so "reuse first" costs no search. Fail open: the map
|
|
64
|
+
// gets 3 s, well inside the 15 s hook limit, so a stalled map never costs the rules (#1079, #1157).
|
|
65
|
+
// shortcut: a map slower than 3 s is still dropped; a cached per-repo map would lift that if it shows up.
|
|
65
66
|
if (mode !== 'review' && process.env.PONYTAIL_MAP !== '0') try {
|
|
66
67
|
const map = execFileSync(process.execPath, [path.join(__dirname, 'ponytail-map.js')], {
|
|
67
|
-
encoding: 'utf8', timeout:
|
|
68
|
+
encoding: 'utf8', timeout: 3000, maxBuffer: 64 * 1024, stdio: ['ignore', 'pipe', 'ignore'],
|
|
68
69
|
}).trimEnd();
|
|
69
70
|
if (map) output += '\n\n' + map;
|
|
70
71
|
} catch (e) { /* no map */ }
|
|
@@ -36,7 +36,10 @@ const LANG = { py: 'py', js: 'js', jsx: 'js', mjs: 'js', cjs: 'js', ts: 'js', ts
|
|
|
36
36
|
|
|
37
37
|
function listFiles(root) {
|
|
38
38
|
try {
|
|
39
|
-
|
|
39
|
+
// 64 MiB: in repos with many tracked files `git ls-files` overflows Node's 1 MiB
|
|
40
|
+
// default, and the catch below reads that as "not a git repo" and falls back to a
|
|
41
|
+
// walk that ignores .gitignore. The list is capped at MAX_FILES * 5 lines anyway.
|
|
42
|
+
const tracked = execFileSync('git', ['ls-files'], { cwd: root, encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'], timeout: 3000, maxBuffer: 64 * 1024 * 1024 })
|
|
40
43
|
.split('\n').filter(Boolean).slice(0, MAX_FILES * 5);
|
|
41
44
|
if (tracked.length) return tracked;
|
|
42
45
|
} catch (e) { /* not a git repo: walk below */ }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dietrichgebert/ponytail",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.3",
|
|
4
4
|
"description": "Lazy senior dev mode for AI agents. The best code is the code you never wrote.",
|
|
5
5
|
"keywords": ["opencode-plugin", "opencode", "ponytail", "pi-package", "pi", "skills", "qoder"],
|
|
6
6
|
"license": "MIT",
|
|
@@ -54,6 +54,7 @@ The side thread stays separate until you explicitly bring context to the main ed
|
|
|
54
54
|
| `/btw <question>` | Start a new side thread immediately with the supplied question. |
|
|
55
55
|
|
|
56
56
|
Both routes require TUI mode and a model with usable credentials; see [Settings](#-settings).
|
|
57
|
+
Only one BTW flow can be open per session; close it before running `/btw` again.
|
|
57
58
|
Side questions and selected conversation context are sent to that model's provider.
|
|
58
59
|
Bringing context back fills the main editor without submitting; replacing an existing draft requires confirmation.
|
|
59
60
|
Ctrl+C cancels the response and discards the current draft and queued questions, but completed exchanges remain resumable in memory.
|
|
@@ -122,7 +123,8 @@ Accepted values are `fullscreen`, `left-pane`, and `right-pane`.
|
|
|
122
123
|
The pane names identify the side thread's position; the other pane reuses Pi's native main-thread rendering at pane width and stays current while BTW is open.
|
|
123
124
|
A single muted divider separates the panes; click either pane or use the pane-switch shortcut to move keyboard focus.
|
|
124
125
|
The footer below the editor shows **BTW focus** or **Main focus** and the available switch key.
|
|
125
|
-
|
|
126
|
+
Main-focus submissions use Pi's normal submission and steering behavior without closing BTW, including when the workspace opens while the main agent is idle.
|
|
127
|
+
The footer also shows the selected side model and thinking level when space permits; narrow or short views omit optional fields and hints before the active input row.
|
|
126
128
|
Drag the divider with the primary mouse button to resize both panes.
|
|
127
129
|
The side-thread share is limited to 20–80% and saved as `sidePaneRatio` when the button is released, independent of whether the side thread is on the left or right.
|
|
128
130
|
If the save fails, the workspace restores the last saved ratio and reports the error.
|
|
@@ -2037,6 +2037,7 @@ var BtwFullscreenHost = class {
|
|
|
2037
2037
|
removeHardCancelListener;
|
|
2038
2038
|
removeUpstreamAbortListener;
|
|
2039
2039
|
started = false;
|
|
2040
|
+
splitReady = false;
|
|
2040
2041
|
disposed = false;
|
|
2041
2042
|
finished = false;
|
|
2042
2043
|
parentRestorePromise;
|
|
@@ -2458,6 +2459,10 @@ var BtwFullscreenHost = class {
|
|
|
2458
2459
|
}
|
|
2459
2460
|
fullscreen.setFocus(component);
|
|
2460
2461
|
fullscreen.requestRender();
|
|
2462
|
+
if (splitPane && !this.splitReady && !this.disposed && !this.finished && !this.lifetimeController.signal.aborted) {
|
|
2463
|
+
this.splitReady = true;
|
|
2464
|
+
this.options.onSplitReady?.();
|
|
2465
|
+
}
|
|
2461
2466
|
}
|
|
2462
2467
|
}).catch(fail);
|
|
2463
2468
|
});
|
|
@@ -4638,6 +4643,7 @@ function btw(pi, dependencies = {}) {
|
|
|
4638
4643
|
const subscribeMainThreadUpdates = registerBtwMainThreadUpdates(pi);
|
|
4639
4644
|
const getLifetime = registerBtwSessionLifetimes(pi);
|
|
4640
4645
|
const sessionThreads = /* @__PURE__ */ new WeakMap();
|
|
4646
|
+
const activeCommands = /* @__PURE__ */ new WeakSet();
|
|
4641
4647
|
let nextThreadNumber = 1;
|
|
4642
4648
|
const listResumeThreads = (resumableThreads) => [...resumableThreads.values()].reverse().filter((state) => state.thread.turns.length > 0 && state.title || state.thread.updates.length > 0).sort((first, second) => second.updatedAt - first.updatedAt || second.createdAt - first.createdAt).map((state) => ({
|
|
4643
4649
|
id: state.id,
|
|
@@ -4651,14 +4657,28 @@ function btw(pi, dependencies = {}) {
|
|
|
4651
4657
|
if (lifetime.signal.aborted) return Promise.resolve();
|
|
4652
4658
|
const commandCtx = Object.create(ctx);
|
|
4653
4659
|
Object.defineProperty(commandCtx, "signal", { value: lifetime.signal, configurable: true });
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4660
|
+
if (activeCommands.has(lifetime)) {
|
|
4661
|
+
notifySafely3(commandCtx, "A /btw workspace is already open; close it before opening another.", "warning");
|
|
4662
|
+
return Promise.resolve();
|
|
4663
|
+
}
|
|
4664
|
+
activeCommands.add(lifetime);
|
|
4665
|
+
const ready = Promise.withResolvers();
|
|
4666
|
+
let released = false;
|
|
4667
|
+
const task = lifetime.track(
|
|
4668
|
+
handleCommand(args, commandCtx, lifetime, () => {
|
|
4669
|
+
if (lifetime.signal.aborted) return;
|
|
4670
|
+
released = true;
|
|
4671
|
+
ready.resolve();
|
|
4672
|
+
}).catch((error) => {
|
|
4673
|
+
if (lifetime.signal.aborted) return;
|
|
4674
|
+
if (!released) throw error;
|
|
4675
|
+
notifySafely3(commandCtx, `Pi BTW: ${formatError6(error)}`, "error");
|
|
4676
|
+
}).finally(() => activeCommands.delete(lifetime))
|
|
4658
4677
|
);
|
|
4678
|
+
return Promise.race([task, ready.promise]);
|
|
4659
4679
|
}
|
|
4660
4680
|
});
|
|
4661
|
-
async function handleCommand(args, ctx, lifetime) {
|
|
4681
|
+
async function handleCommand(args, ctx, lifetime, releaseMainInput) {
|
|
4662
4682
|
let resumableThreads = sessionThreads.get(lifetime);
|
|
4663
4683
|
if (!resumableThreads) {
|
|
4664
4684
|
resumableThreads = /* @__PURE__ */ new Map();
|
|
@@ -4749,6 +4769,7 @@ function btw(pi, dependencies = {}) {
|
|
|
4749
4769
|
canRestoreParent: lifetime.canRestoreParent,
|
|
4750
4770
|
copyOnSelect: effectiveFullscreenCopyOnSelect(settings),
|
|
4751
4771
|
layout: effectiveBtwLayout(settings),
|
|
4772
|
+
...effectiveBtwLayout(settings) !== "fullscreen" ? { onSplitReady: releaseMainInput } : {},
|
|
4752
4773
|
sidePaneRatio: effectiveBtwSidePaneRatio(settings),
|
|
4753
4774
|
persistSidePaneRatio: (ratio, signal) => updateBtwSettings({ sidePaneRatio: ratio }, { signal }).then(() => void 0),
|
|
4754
4775
|
subscribeMainThreadUpdates: (listener) => subscribeMainThreadUpdates(ctx.sessionManager, listener),
|