pi-t3-bridge 0.4.0 → 0.5.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.
Files changed (90) hide show
  1. package/README.md +12 -2
  2. package/package.json +2 -2
  3. package/pstack/skills/create-verification-skill/SKILL.md +1 -1
  4. package/pstack/skills/poteto-mode/scripts/node_modules/commander/LICENSE +22 -0
  5. package/pstack/skills/poteto-mode/scripts/node_modules/commander/Readme.md +1172 -0
  6. package/pstack/skills/poteto-mode/scripts/node_modules/commander/index.js +21 -0
  7. package/pstack/skills/poteto-mode/scripts/node_modules/commander/lib/argument.js +147 -0
  8. package/pstack/skills/poteto-mode/scripts/node_modules/commander/lib/command.js +2790 -0
  9. package/pstack/skills/poteto-mode/scripts/node_modules/commander/lib/error.js +36 -0
  10. package/pstack/skills/poteto-mode/scripts/node_modules/commander/lib/help.js +731 -0
  11. package/pstack/skills/poteto-mode/scripts/node_modules/commander/lib/option.js +377 -0
  12. package/pstack/skills/poteto-mode/scripts/node_modules/commander/lib/suggestSimilar.js +99 -0
  13. package/pstack/skills/poteto-mode/scripts/node_modules/commander/package-support.json +19 -0
  14. package/pstack/skills/poteto-mode/scripts/node_modules/commander/package.json +64 -0
  15. package/pstack/skills/poteto-mode/scripts/node_modules/commander/typings/index.d.ts +1113 -0
  16. package/pstack/skills/setup-pstack/scripts/t3-sheet.mjs +10 -1
  17. package/pstack/skills/statechart/scripts/node_modules/.package-lock.json +46 -0
  18. package/pstack/skills/statechart/scripts/node_modules/fast-check/LICENSE +21 -0
  19. package/pstack/skills/statechart/scripts/node_modules/fast-check/README.md +263 -0
  20. package/pstack/skills/statechart/scripts/node_modules/fast-check/lib/cjs/fast-check.d.ts +5165 -0
  21. package/pstack/skills/statechart/scripts/node_modules/fast-check/lib/cjs/fast-check.js +12147 -0
  22. package/pstack/skills/statechart/scripts/node_modules/fast-check/lib/cjs/package.json +3 -0
  23. package/pstack/skills/statechart/scripts/node_modules/fast-check/lib/cjs/types57/fast-check.d.ts +5165 -0
  24. package/pstack/skills/statechart/scripts/node_modules/fast-check/lib/fast-check.d.ts +5165 -0
  25. package/pstack/skills/statechart/scripts/node_modules/fast-check/lib/fast-check.js +12011 -0
  26. package/pstack/skills/statechart/scripts/node_modules/fast-check/lib/rolldown-runtime-D7D4PA-g.js +13 -0
  27. package/pstack/skills/statechart/scripts/node_modules/fast-check/lib/types57/fast-check.d.ts +5165 -0
  28. package/pstack/skills/statechart/scripts/node_modules/fast-check/package.json +94 -0
  29. package/pstack/skills/statechart/scripts/node_modules/pure-rand/LICENSE +21 -0
  30. package/pstack/skills/statechart/scripts/node_modules/pure-rand/README.md +168 -0
  31. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/RandomGenerator-DcXj09Ch.d.ts +14 -0
  32. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/distribution/uniformBigInt.d.ts +15 -0
  33. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/distribution/uniformBigInt.js +38 -0
  34. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/distribution/uniformFloat32.d.ts +15 -0
  35. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/distribution/uniformFloat32.js +18 -0
  36. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/distribution/uniformFloat64.d.ts +15 -0
  37. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/distribution/uniformFloat64.js +22 -0
  38. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/distribution/uniformInt.d.ts +15 -0
  39. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/distribution/uniformInt.js +134 -0
  40. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/esm/RandomGenerator-DcXj09Ch.d.ts +14 -0
  41. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/esm/distribution/uniformBigInt.d.ts +15 -0
  42. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/esm/distribution/uniformBigInt.js +37 -0
  43. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/esm/distribution/uniformFloat32.d.ts +15 -0
  44. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/esm/distribution/uniformFloat32.js +17 -0
  45. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/esm/distribution/uniformFloat64.d.ts +15 -0
  46. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/esm/distribution/uniformFloat64.js +21 -0
  47. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/esm/distribution/uniformInt.d.ts +15 -0
  48. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/esm/distribution/uniformInt.js +133 -0
  49. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/esm/generator/congruential32.d.ts +7 -0
  50. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/esm/generator/congruential32.js +44 -0
  51. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/esm/generator/mersenne.d.ts +7 -0
  52. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/esm/generator/mersenne.js +90 -0
  53. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/esm/generator/xoroshiro128plus.d.ts +7 -0
  54. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/esm/generator/xoroshiro128plus.js +80 -0
  55. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/esm/generator/xorshift128plus.d.ts +7 -0
  56. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/esm/generator/xorshift128plus.js +78 -0
  57. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/esm/package.json +3 -0
  58. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/esm/types/JumpableRandomGenerator.d.ts +16 -0
  59. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/esm/types/JumpableRandomGenerator.js +0 -0
  60. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/esm/types/RandomGenerator.d.ts +2 -0
  61. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/esm/types/RandomGenerator.js +0 -0
  62. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/esm/utils/generateN.d.ts +6 -0
  63. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/esm/utils/generateN.js +8 -0
  64. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/esm/utils/purify.d.ts +12 -0
  65. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/esm/utils/purify.js +9 -0
  66. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/esm/utils/skipN.d.ts +6 -0
  67. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/esm/utils/skipN.js +6 -0
  68. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/generator/congruential32.d.ts +7 -0
  69. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/generator/congruential32.js +46 -0
  70. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/generator/mersenne.d.ts +7 -0
  71. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/generator/mersenne.js +92 -0
  72. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/generator/xoroshiro128plus.d.ts +7 -0
  73. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/generator/xoroshiro128plus.js +82 -0
  74. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/generator/xorshift128plus.d.ts +7 -0
  75. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/generator/xorshift128plus.js +80 -0
  76. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/types/JumpableRandomGenerator.d.ts +16 -0
  77. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/types/JumpableRandomGenerator.js +0 -0
  78. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/types/RandomGenerator.d.ts +2 -0
  79. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/types/RandomGenerator.js +0 -0
  80. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/utils/generateN.d.ts +6 -0
  81. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/utils/generateN.js +9 -0
  82. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/utils/purify.d.ts +12 -0
  83. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/utils/purify.js +10 -0
  84. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/utils/skipN.d.ts +6 -0
  85. package/pstack/skills/statechart/scripts/node_modules/pure-rand/lib/utils/skipN.js +7 -0
  86. package/pstack/skills/statechart/scripts/node_modules/pure-rand/package.json +133 -0
  87. package/src/bridge/bridge-trim.ts +16 -21
  88. package/src/bridge/config.ts +6 -0
  89. package/src/bridge/steer-judge.ts +236 -16
  90. package/src/pstack/overlay.ts +2 -2
package/README.md CHANGED
@@ -142,7 +142,13 @@ The bridge caps every shell command at 300 seconds, in the main thread and in ch
142
142
 
143
143
  ### Stop checks
144
144
 
145
- When a run is about to stop, the bridge asks a classifier how the run ended. The classifier is `typesafe/jev-latest` from your Pi model catalog. When the classifier says the agent gave up partway, the bridge adds a note and gives the agent one more turn, at most twice per prompt. Every 3 turns during a run, the bridge also asks the classifier whether the agent shows a known failure, and it adds a note when one is likely. The failures it checks for come from the MAST list of agent failures:
145
+ When a run is about to stop, the bridge asks a classifier how the run ended. It picks the classifier in this order:
146
+
147
+ 1. The chat model named by `classifierModel` in the config, as `"provider/modelId"`.
148
+ 2. `typesafe/jev-latest`, when it is in your Pi model catalog and you have access to it.
149
+ 3. The model of the current session.
150
+
151
+ A chat model gets the same questions through one tool call, and the bridge reads its answers from the tool arguments. A chat model's probabilities are its own estimates. They are not calibrated like Jev's, and the stop thresholds were fitted on Jev, so a chat model may nudge more or less often. If Jev is available but its call fails, the bridge does not fall back to a chat model. A `classifierModel` that is not in the catalog or has no auth is an error, and the bridge does not fall back from it either. When the classifier says the agent gave up partway, the bridge adds a note and gives the agent one more turn, at most twice per prompt. Every 3 turns during a run, the bridge also asks the classifier whether the agent shows a known failure, and it adds a note when one is likely. The failures it checks for come from the MAST list of agent failures:
146
152
 
147
153
  - Stuck in a loop
148
154
  - Doesn't know when to stop
@@ -161,6 +167,8 @@ on(run about to stop)
161
167
 
162
168
  The stop check and the notes come from [pi-mast-steer](https://github.com/dbreunig/pi-mast-steer). Set `steer` to `"shadow"` in the config to log verdicts without changing the session, or to `"off"` to turn the checks off.
163
169
 
170
+ A chat-model judge costs tokens on your account, one call per stop check and one every 3 turns.
171
+
164
172
  ## The pstack extension
165
173
 
166
174
  The pstack extension adds the pstack skills to Pi's skill catalog, and it adds a note to each prompt that tells the agent when to enter `poteto-mode`. `poteto-mode` picks the workflow that fits your goal, for example a bug fix, a feature, a design review, or a PR watch. The skills come from [pstack](https://github.com/cursor/plugins/tree/main/pstack) by way of [t3-pstack](https://github.com/chhoumann/t3-pstack), and they live unchanged under `pstack/`.
@@ -223,6 +231,7 @@ The bridge reads one JSON file per machine, at `~/.config/pi-t3/config.json`. Ev
223
231
  {
224
232
  "bashTimeoutSeconds": 300,
225
233
  "childSandbox": "on",
234
+ "classifierModel": "anthropic/claude-sonnet-4-5",
226
235
  "mcpUrl": "http://127.0.0.1:3773/mcp",
227
236
  "steer": "on"
228
237
  }
@@ -232,6 +241,7 @@ The bridge reads one JSON file per machine, at `~/.config/pi-t3/config.json`. Ev
232
241
  | --- | --- | --- |
233
242
  | `bashTimeoutSeconds` | `300` | The longest a shell command can run, in seconds. |
234
243
  | `childSandbox` | `"on"` | Whether a delegated child's shell commands need a sandbox. With `"on"`, a child's `bash` is blocked when no sandbox can run. With `"off"`, commands run with no sandbox on every platform, and the child's report says `SANDBOX: off`. |
244
+ | `classifierModel` | unset | A chat model that judges the stop checks, as `"provider/modelId"`. The model id may contain more slashes. When unset, the bridge uses `typesafe/jev-latest` if it is available, and the session model if not. A chat model's probabilities are its own estimates, not Jev-calibrated. |
235
245
  | `mcpUrl` | `http://127.0.0.1:3773/mcp` | The T3 MCP endpoint to use outside a T3 thread. |
236
246
  | `steer` | `"on"` | The stop checks, as `"on"`, `"shadow"`, or `"off"`. |
237
247
 
@@ -251,7 +261,7 @@ Earlier releases kept the state and the model sheet under `t3-pstack`. The first
251
261
 
252
262
  ## Data handling
253
263
 
254
- The package has no server and sends no telemetry. The stop checks send parts of the session transcript to the classifier provider in your Pi model catalog, and any file a skill asks the agent to read goes to your model provider. Scripts run on your machine, and the PR tools use your GitHub CLI login.
264
+ The package has no server and sends no telemetry. The stop checks send parts of the session transcript to the classifier provider, which is Jev, the model you name in `classifierModel`, or your session model, and any file a skill asks the agent to read goes to your model provider. Scripts run on your machine, and the PR tools use your GitHub CLI login.
255
265
 
256
266
  ## Development
257
267
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-t3-bridge",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "Pi extension adapter for t3-pstack inside T3 Code.",
5
5
  "keywords": [
6
6
  "pi-extension",
@@ -85,7 +85,7 @@
85
85
  ]
86
86
  },
87
87
  "upstreams": {
88
- "t3": "0.1.5-nightly.20261029.3877",
88
+ "t3": "0.1.7",
89
89
  "tstack": "1085050f3baed1ac724caa4a8166145fb2ac88af"
90
90
  }
91
91
  }
@@ -14,7 +14,7 @@ Answer these from the codebase and only ask the user what you cannot observe:
14
14
 
15
15
  - **Surface:** what does a user actually touch? A web UI, a CLI/TUI, a desktop app, an API, a mobile app, a library? A repo can have several; pick the primary one and note the rest.
16
16
  - **Run:** how does the app start locally? Prefer the repo's own documented dev command (package scripts, Makefile, README quickstart). Note ports, env vars, seed data, auth.
17
- - **Drive:** how can an agent interact with it programmatically? Existing harnesses first — Playwright/Cypress specs, expect scripts, PTY helpers, curl-able endpoints, a debug port. Only then pick a generic recipe: browser/CDP for web and Electron, a tmux/PTY harness for CLI/TUI, plain HTTP for services.
17
+ - **Drive:** how can an agent interact with it programmatically? Existing harnesses first — browser test specs, expect scripts, PTY helpers, curl-able endpoints, a debug port. Only then pick a generic recipe: browser/CDP for web and Electron, a tmux/PTY harness for CLI/TUI, plain HTTP for services.
18
18
  - **Observe:** what evidence can be captured? Screenshots, terminal transcripts, response bodies, logs, exit codes, DB state.
19
19
  - **Isolate:** can two instances run side by side (ports, data dirs, profiles)? If not, say so in the generated skill: refusing to double-drive a shared instance beats corrupting the user's session.
20
20
 
@@ -0,0 +1,22 @@
1
+ (The MIT License)
2
+
3
+ Copyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ 'Software'), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.