pi-harness-runtime 1.1.511 → 1.1.513
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +181 -0
- package/footer-status.ts +112 -43
- package/harness/cookie-import-refresh.ts +60 -0
- package/harness/quota-credential-choice.ts +67 -0
- package/harness/quota-refresh-coordinator.ts +129 -0
- package/index.ts +182 -97
- package/package.json +1 -1
- package/packages/agent-policy/package.json +1 -1
- package/packages/auth/package.json +1 -1
- package/packages/autonomous-runtime/package.json +1 -1
- package/packages/checkpoint/package.json +1 -1
- package/packages/clipboard/package.json +1 -1
- package/packages/codex-watcher/package.json +1 -1
- package/packages/config-capture/package.json +1 -1
- package/packages/contracts/package.json +1 -1
- package/packages/cookie-sanitizer/dist/detect-format.d.ts +26 -12
- package/packages/cookie-sanitizer/dist/detect-format.d.ts.map +1 -1
- package/packages/cookie-sanitizer/dist/detect-format.js +54 -39
- package/packages/cookie-sanitizer/dist/detect-format.js.map +1 -1
- package/packages/cookie-sanitizer/dist/index.d.ts +9 -3
- package/packages/cookie-sanitizer/dist/index.d.ts.map +1 -1
- package/packages/cookie-sanitizer/dist/index.js +5 -3
- package/packages/cookie-sanitizer/dist/index.js.map +1 -1
- package/packages/cookie-sanitizer/dist/parse-netscape-space.d.ts +73 -0
- package/packages/cookie-sanitizer/dist/parse-netscape-space.d.ts.map +1 -0
- package/packages/cookie-sanitizer/dist/parse-netscape-space.js +154 -0
- package/packages/cookie-sanitizer/dist/parse-netscape-space.js.map +1 -0
- package/packages/cookie-sanitizer/dist/parse-netscape.d.ts +28 -1
- package/packages/cookie-sanitizer/dist/parse-netscape.d.ts.map +1 -1
- package/packages/cookie-sanitizer/dist/parse-netscape.js +50 -13
- package/packages/cookie-sanitizer/dist/parse-netscape.js.map +1 -1
- package/packages/cookie-sanitizer/dist/source-state.d.ts +56 -0
- package/packages/cookie-sanitizer/dist/source-state.d.ts.map +1 -0
- package/packages/cookie-sanitizer/dist/source-state.js +61 -0
- package/packages/cookie-sanitizer/dist/source-state.js.map +1 -0
- package/packages/cookie-sanitizer/dist/sync.d.ts +9 -0
- package/packages/cookie-sanitizer/dist/sync.d.ts.map +1 -1
- package/packages/cookie-sanitizer/dist/sync.js +47 -16
- package/packages/cookie-sanitizer/dist/sync.js.map +1 -1
- package/packages/cookie-sanitizer/dist/types.d.ts +1 -1
- package/packages/cookie-sanitizer/dist/types.d.ts.map +1 -1
- package/packages/cookie-sanitizer/package.json +1 -1
- package/packages/cookie-sanitizer/src/detect-format.ts +78 -41
- package/packages/cookie-sanitizer/src/index.ts +34 -1
- package/packages/cookie-sanitizer/src/parse-netscape-space.ts +188 -0
- package/packages/cookie-sanitizer/src/parse-netscape.ts +81 -13
- package/packages/cookie-sanitizer/src/source-state.ts +95 -0
- package/packages/cookie-sanitizer/src/sync.ts +59 -16
- package/packages/cookie-sanitizer/src/types.ts +4 -1
- package/packages/evaluation-engine/package.json +1 -1
- package/packages/event-bus/package.json +1 -1
- package/packages/event-store/package.json +1 -1
- package/packages/experience-replay/package.json +1 -1
- package/packages/file-copy-helper/package.json +1 -1
- package/packages/intent-analyzer/package.json +1 -1
- package/packages/jev-judge/package.json +1 -1
- package/packages/knowledge-retrieval/package.json +1 -1
- package/packages/learning-engine/package.json +1 -1
- package/packages/logging/dist/server/index-store.d.ts +19 -1
- package/packages/logging/dist/server/index-store.d.ts.map +1 -1
- package/packages/logging/dist/server/index-store.js +25 -2
- package/packages/logging/dist/server/index-store.js.map +1 -1
- package/packages/logging/package.json +1 -1
- package/packages/logging/src/server/index-store.ts +40 -2
- package/packages/memory-engine/package.json +1 -1
- package/packages/notification/package.json +1 -1
- package/packages/paperclip-integration/package.json +1 -1
- package/packages/performance-optimizer/package.json +1 -1
- package/packages/privilege-broker/package.json +1 -1
- package/packages/prompt-compiler/package.json +1 -1
- package/packages/providers/package.json +1 -1
- package/packages/qdrant-skills/package.json +1 -1
- package/packages/quota-manager/package.json +1 -1
- package/packages/relay/package.json +1 -1
- package/packages/skill-mcp-client/package.json +1 -1
- package/packages/skills/package.json +1 -1
- package/packages/todo-bd-sync/package.json +1 -1
- package/packages/token-estimation/package.json +1 -1
- package/packages/tooling-preference/package.json +1 -1
- package/packages/trajectory/package.json +1 -1
- package/packages/tui/package.json +1 -1
- package/packages/two-phase-review/package.json +1 -1
- package/packages/types/package.json +1 -1
- package/packages/webmcp-tester/package.json +1 -1
- package/packages/wiki/package.json +1 -1
- package/packages/write-review/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,187 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [1.1.513](https://github.com/ManotLuijiu/pi-harness-runtime/compare/v1.1.448...v1.1.513) (2026-11-17)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **actions:** register the job resume, the GLM countdown and the queued continuations ([177c964](https://github.com/ManotLuijiu/pi-harness-runtime/commit/177c964555b0057e6bc7d293dafab10c95eabbf9))
|
|
11
|
+
* **cookies:** the space-separated export is imported, the quota refresh is shared ([85e01dc](https://github.com/ManotLuijiu/pi-harness-runtime/commit/85e01dcc3836fc08ba33ea4aee9cc946c559bcb3))
|
|
12
|
+
* **delegation:** a child is only a child when it really ran ([ac4e678](https://github.com/ManotLuijiu/pi-harness-runtime/commit/ac4e6782d7d4bc4941e458425c8a9f38a51fc9d4))
|
|
13
|
+
* **delegation:** the scope of a request is measured before it is judged ([684b6a5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/684b6a55184f63d3be24c48dcecfb0b13410dc15))
|
|
14
|
+
* **harness:** the startup tells the user that the session keeps its issues with bd ([81d63c5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/81d63c5dc2452b9f08001756866db80046a2532a))
|
|
15
|
+
* **honcho:** the memory service speaks the native MCP of Pi ([f9f740c](https://github.com/ManotLuijiu/pi-harness-runtime/commit/f9f740c12869bae4c4380afbe8c76e12388bb744))
|
|
16
|
+
* **jev:** one decision per question, bound to the question it was evaluated for ([03448aa](https://github.com/ManotLuijiu/pi-harness-runtime/commit/03448aaa17f2d0c3bcf644b0b1d5949727dfff8c))
|
|
17
|
+
* **jev:** the evaluation of a choice sees what the options mean ([f0c207e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/f0c207e074701e6b7dab0965170ec39453d9d502))
|
|
18
|
+
* **jev:** the pending question carries the ask and the answer ([a792133](https://github.com/ManotLuijiu/pi-harness-runtime/commit/a792133e517fb8c12d3363e98942f3af30270f27))
|
|
19
|
+
* **jev:** the pending question counts down to the decision ([d0cc171](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d0cc171223986b2d32c670b6c1c74712fe0a4ad8))
|
|
20
|
+
* **keys:** tell the user what to do about an exposed key file ([7031003](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7031003574307351b7a8f28ee14159b58e17b793))
|
|
21
|
+
* **keys:** the key files are repaired when their permissions are unsafe ([e9c2c26](https://github.com/ManotLuijiu/pi-harness-runtime/commit/e9c2c26b287665b56ed749de269737e8403bb8af))
|
|
22
|
+
* **mcp:** the harness connects the registered servers when nobody else does ([7fef951](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7fef95137ad4664df57f045cd91b7d233315b0bc))
|
|
23
|
+
* **merge:** a manual run can leave the merge to the pull request event ([b3d1950](https://github.com/ManotLuijiu/pi-harness-runtime/commit/b3d1950b5941c78ccd56951acdafd1d4afbe1bff))
|
|
24
|
+
* **phase:** the agent owns the todo list and the harness says so ([c489370](https://github.com/ManotLuijiu/pi-harness-runtime/commit/c489370bd7926aece8cb1a77aa20ca2d2672f1fb))
|
|
25
|
+
* **providers:** a shared registry of the pending automatic actions and a bounded recovery ([c5f955b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/c5f955bc82adcb6999a89d5bc278fa87fccee022))
|
|
26
|
+
* **providers:** one failure has one executor, and the retry bridge is checked ([e73c4c7](https://github.com/ManotLuijiu/pi-harness-runtime/commit/e73c4c76ff20a9708083659bdcefe74870a84837))
|
|
27
|
+
* **questions:** refuse the deletion of a temporary path without the judge ([ab29694](https://github.com/ManotLuijiu/pi-harness-runtime/commit/ab29694f36c1ff020b3b19ca542a27b37847055c))
|
|
28
|
+
* **quota:** a fresh capture and a low allowance decide the MiniMax recovery ([06d7b8e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/06d7b8e971e0da58a344f75778c98edb442562bd))
|
|
29
|
+
* **quota:** the empty week waits for the human, the overload of a compaction shares the executor ([bbb0c39](https://github.com/ManotLuijiu/pi-harness-runtime/commit/bbb0c3909b11735343e84be690c4c47e67a563bb))
|
|
30
|
+
* **recovery:** a MiniMax quota exhaustion waits for the captured reset plus ten minutes ([5af08a0](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5af08a0e86c8c93fa5b7ff64a7b08e4514bc68f3))
|
|
31
|
+
* **review:** the review starts on its own when the implementation is done ([04f51f5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/04f51f599cd3222b6c74dd8fadb1373bd72d9bd7))
|
|
32
|
+
* **scope:** a marked resume and a backlog that only an approval starts ([19d3320](https://github.com/ManotLuijiu/pi-harness-runtime/commit/19d33204819cf05e678996fddf4c4621f0dd7d2f))
|
|
33
|
+
* **status:** the status line names the phase, the progress and the children ([0167bf3](https://github.com/ManotLuijiu/pi-harness-runtime/commit/0167bf396a0b987c1d44f3b869351976a951dd65))
|
|
34
|
+
* **test:** the task waits for the final tier of the validation plan ([fa147db](https://github.com/ManotLuijiu/pi-harness-runtime/commit/fa147dbf7d50d56e6ea48c6d8fbb4fcb190caf8a))
|
|
35
|
+
* **validation:** a large job starts with a measured pilot ([425964b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/425964b04a3d4fa02adfabed47ff62c5ec2b9c28))
|
|
36
|
+
* **validation:** the size of a job is a fact, not a phrase ([8aa6c11](https://github.com/ManotLuijiu/pi-harness-runtime/commit/8aa6c119565d0f8412dc8aeafa6b295d47d3f093))
|
|
37
|
+
* **workspace:** a Frappe bench names the mode of the workspace ([9d58517](https://github.com/ManotLuijiu/pi-harness-runtime/commit/9d585172063a330992fee933316e268ae9985e3c))
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
### Bug Fixes
|
|
41
|
+
|
|
42
|
+
* **ci:** every run of a required check counts, and the worst one decides ([da9e0da](https://github.com/ManotLuijiu/pi-harness-runtime/commit/da9e0da6b0ca29cb320764fd5fc1b8a8dee8b1e0))
|
|
43
|
+
* **ci:** the newest attempt of a run decides, not the attempt that failed ([9d7adcc](https://github.com/ManotLuijiu/pi-harness-runtime/commit/9d7adcc31cbacc517c3c1a9bcd3956be94c908ef))
|
|
44
|
+
* **harness:** a raw control byte hid the request scope from the review ([852b1ff](https://github.com/ManotLuijiu/pi-harness-runtime/commit/852b1ff3afc21adb71e92b85d21ff1c88e14816a))
|
|
45
|
+
* **honcho:** a handshake that never finishes is named instead of hanging the startup ([d66005f](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d66005f928a4f8df5de5b8a0579cbd4f8df37ff9))
|
|
46
|
+
* **honcho:** a probe that the end of the session cuts off is not a failure ([493fd93](https://github.com/ManotLuijiu/pi-harness-runtime/commit/493fd938ba09fdcf57bed4aaf259d81c4040909e))
|
|
47
|
+
* **honcho:** a slow connector is not a failed one, the row is corrected when the tools appear ([b62ac5b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/b62ac5b16ad93e2bfb10cbec589b80a09b7e20b3))
|
|
48
|
+
* **honcho:** a tools listing that the end of the session cuts off is not a failure ([62cc8c3](https://github.com/ManotLuijiu/pi-harness-runtime/commit/62cc8c376aade01c953ce2a1c6501ed07b74a1e9))
|
|
49
|
+
* **honcho:** the report names the state of the MCP server, not the registration ([762f4d5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/762f4d59e4eabcab9a1c21a61aa522c3267621b3))
|
|
50
|
+
* **hooks:** a tag is checked through the commit behind it ([c823e8e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/c823e8e1f6973c62b5449a97c101759a4d5cbba5))
|
|
51
|
+
* **jev:** a completion question, a stale check and a pending validation ([827120b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/827120b4138b6f5ae253e69154de190085703de8))
|
|
52
|
+
* **jev:** a new request does not inherit the completion of the old one ([0f863c7](https://github.com/ManotLuijiu/pi-harness-runtime/commit/0f863c7fcaf35e261beabebef15b8ab634132fdc))
|
|
53
|
+
* **jev:** a prohibition must not hide a destructive action ([78a6cc1](https://github.com/ManotLuijiu/pi-harness-runtime/commit/78a6cc199e647f812e145483f7e94991358d8f34))
|
|
54
|
+
* **jev:** a refusal without punctuation, and only a decline of an action ([ef3dbf8](https://github.com/ManotLuijiu/pi-harness-runtime/commit/ef3dbf87a2a1725373281613a0d48881ed5d2239))
|
|
55
|
+
* **jev:** a rejection during the countdown pauses the work ([9b018ce](https://github.com/ManotLuijiu/pi-harness-runtime/commit/9b018ce1152b6724dee73cdc901b8a360ecc91ab))
|
|
56
|
+
* **jev:** a session switch ends the wait of the old session ([ca03d39](https://github.com/ManotLuijiu/pi-harness-runtime/commit/ca03d399c0d4a1b2dd428ac39836ab53c0e51ab6))
|
|
57
|
+
* **jev:** an open question is not a permission to answer it ([e20eca2](https://github.com/ManotLuijiu/pi-harness-runtime/commit/e20eca24bb88d385198bb12ee3ebf573af9aea86))
|
|
58
|
+
* **jev:** keep a comparative caveat with the option it constrains ([7be306b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7be306b0d0872713ebca9386d613ae5a8da9d5b6))
|
|
59
|
+
* **jev:** the action of the question on its own text, and a reply is not an authorization ([7c3fdd6](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7c3fdd6822b58bd6ccfa3bcdf1c5282cb3db52dd))
|
|
60
|
+
* **jev:** the action of the question, and an open question blocks the work ([1f9ff39](https://github.com/ManotLuijiu/pi-harness-runtime/commit/1f9ff39efc4ee17464c54c2ca9b583245093dbac))
|
|
61
|
+
* **jev:** the alternatives of a question are parsed without a quadratic pattern ([63016a3](https://github.com/ManotLuijiu/pi-harness-runtime/commit/63016a3f0488acb801990dd46770c00d382b5858))
|
|
62
|
+
* **jev:** the countdown of an obsolete question does not outlive the work ([fe78b29](https://github.com/ManotLuijiu/pi-harness-runtime/commit/fe78b29e6fc513b11a6993bc68fd9418dc77f79b))
|
|
63
|
+
* **jev:** the facts of an option survive the wording of the agent ([5a6250c](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5a6250c07aa8d965bc6ae242cccbf519477598f8))
|
|
64
|
+
* **jev:** the scope decides the question, the identity guards the awaits ([ed348b2](https://github.com/ManotLuijiu/pi-harness-runtime/commit/ed348b2f94460a3b3ac11c01afd4420ee4ec1020))
|
|
65
|
+
* **jev:** the scope of a request on every human path, and the todos it touched ([cec8f36](https://github.com/ManotLuijiu/pi-harness-runtime/commit/cec8f3644333b1d13a203340df80a30fef5c1ac0))
|
|
66
|
+
* **jev:** the subject of the scope decides, a clarification is preserved ([faf6a0f](https://github.com/ManotLuijiu/pi-harness-runtime/commit/faf6a0fe7d0dce94d4fa48d0d7a57d126556ba6d))
|
|
67
|
+
* **keys:** the key directory is audited as a tree ([081cc75](https://github.com/ManotLuijiu/pi-harness-runtime/commit/081cc75ac8ceff36b0d619c3f76371dc08459d3c))
|
|
68
|
+
* **logging:** the query window no longer rots with the wall clock ([cd3f5b1](https://github.com/ManotLuijiu/pi-harness-runtime/commit/cd3f5b18d8a4b8850a201d060699e18bf789a647))
|
|
69
|
+
* **logging:** the sanitizer of a message writes its control characters as escapes ([f4bbdb9](https://github.com/ManotLuijiu/pi-harness-runtime/commit/f4bbdb94bc1801d4228142bc1a1b31505c42a575))
|
|
70
|
+
* **mcp:** the connector and the watcher stop with the session ([4d1b87d](https://github.com/ManotLuijiu/pi-harness-runtime/commit/4d1b87d14d015749025b62bf54d6d0b6137295f7))
|
|
71
|
+
* **mcp:** the connector survives a runtime that cannot list the servers ([d0f555f](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d0f555fa14f51de33591e572a41ded5b59a3e4dd))
|
|
72
|
+
* **merge:** the boolean input is read as a boolean ([971b716](https://github.com/ManotLuijiu/pi-harness-runtime/commit/971b7169a43db382dbdeb6bb9bab02ab56e0351c))
|
|
73
|
+
* **merge:** the manual job needs the right of the merge ([7ba685e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7ba685ec43d815f90aa35b742579e87e76c69209))
|
|
74
|
+
* **merge:** the merge of the pull request is the GraphQL mutation ([972bab4](https://github.com/ManotLuijiu/pi-harness-runtime/commit/972bab4b0f7faf1b0047f3bb767ef6db3de4b2fa))
|
|
75
|
+
* **merge:** the workflow merges the pull request the gates cleared ([d7639ec](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d7639ec9b83723510acb4a5c4e23d5d6167c3af6))
|
|
76
|
+
* **providers:** the escape of the user stops the recovery, and a permanent failure clears it ([cfe5797](https://github.com/ManotLuijiu/pi-harness-runtime/commit/cfe57976bf463c327e45b874fd297c3e942246b8))
|
|
77
|
+
* **providers:** the pause wins over a retry, and the retry starts when the run settles ([e016dd2](https://github.com/ManotLuijiu/pi-harness-runtime/commit/e016dd2a5add5b0f3c848a225a28a59e0f5fc7f3))
|
|
78
|
+
* **recovery:** a cancelled countdown does not own the next attempt ([7b79f30](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7b79f301389fae48201e696d3086d257ed722fb9))
|
|
79
|
+
* **recovery:** a cancelled retry of Pi is a cancelled decision, a spent budget is not ([7e13f15](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7e13f156a279cded2b2d4b0c99358100b3d5e038))
|
|
80
|
+
* **recovery:** a manual request takes the work back from the countdown ([fa81d8f](https://github.com/ManotLuijiu/pi-harness-runtime/commit/fa81d8fd9d6160166a095e07bdf17049bbafa32d))
|
|
81
|
+
* **recovery:** the predicate of Pi decides the retry, the provider identity is normalized ([6c8c17b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/6c8c17b53302cea1602d192251eacd0ebbd3e8c9))
|
|
82
|
+
* **release:** a manual release keeps the version of its manifest ([122e661](https://github.com/ManotLuijiu/pi-harness-runtime/commit/122e661ea48cb8aff14c71dbd0221a4cf0ba4c8e))
|
|
83
|
+
* **release:** the alignment names the reason of a failure ([5814dd0](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5814dd0b780f5839cf8011ed0cbbbb31e7eb0418))
|
|
84
|
+
* **release:** the channels of the package name the release ([a7a273f](https://github.com/ManotLuijiu/pi-harness-runtime/commit/a7a273ffe8398e2b5b07ef1c321777de41792c6e))
|
|
85
|
+
* **release:** the release publishes and leaves the channels alone ([5871746](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5871746589c1281d855dbeb591b02419fa43f22e))
|
|
86
|
+
* **release:** the release pull request names the version of its branch ([a846e83](https://github.com/ManotLuijiu/pi-harness-runtime/commit/a846e83e6de6e529f4bca05e869db0b5eebb37c5))
|
|
87
|
+
* **release:** the release scans the tree of the commit it publishes ([7d47a0b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7d47a0b5406480a1e1d3a52623a76aabd1e2d0ba))
|
|
88
|
+
* **scope:** a session that ends leaves no proposal behind ([9aad01e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/9aad01e1f13446da1d01032e9967cadf66772792))
|
|
89
|
+
* **scope:** the findings of the review of the scope expansion ([92372e5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/92372e51ca31198593025ce8671b226d2ca7182e))
|
|
90
|
+
* **scope:** the question of a proposal is not obsolete and a rejection is named ([d4c58c3](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d4c58c3e63e27449ef1de0f8e4e55ebbf342ff7d))
|
|
91
|
+
* **test:** the quota capture integration needs the runtime of bun ([86fae7d](https://github.com/ManotLuijiu/pi-harness-runtime/commit/86fae7de31e76414aa31bb75eb136155f62d7a40))
|
|
92
|
+
* **workspace:** a strong bench signal decides, and the question is not a fact of an option ([303a828](https://github.com/ManotLuijiu/pi-harness-runtime/commit/303a828f55aa7c4e0a611231f482489b530ff5a3))
|
|
93
|
+
* **workspace:** keep a client name out of the comment about the search depth ([b572e0a](https://github.com/ManotLuijiu/pi-harness-runtime/commit/b572e0af16ff562203bda2b5c47b41807cff5a95))
|
|
94
|
+
* **workspace:** the repository names the mode before the mode stays unknown ([188a32c](https://github.com/ManotLuijiu/pi-harness-runtime/commit/188a32c7a6af1465dd24714278fccc73d06f6477))
|
|
95
|
+
|
|
96
|
+
### [1.1.512](https://github.com/ManotLuijiu/pi-harness-runtime/compare/v1.1.448...v1.1.512) (2026-11-16)
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
### Features
|
|
100
|
+
|
|
101
|
+
* **actions:** register the job resume, the GLM countdown and the queued continuations ([177c964](https://github.com/ManotLuijiu/pi-harness-runtime/commit/177c964555b0057e6bc7d293dafab10c95eabbf9))
|
|
102
|
+
* **delegation:** a child is only a child when it really ran ([ac4e678](https://github.com/ManotLuijiu/pi-harness-runtime/commit/ac4e6782d7d4bc4941e458425c8a9f38a51fc9d4))
|
|
103
|
+
* **delegation:** the scope of a request is measured before it is judged ([684b6a5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/684b6a55184f63d3be24c48dcecfb0b13410dc15))
|
|
104
|
+
* **harness:** the startup tells the user that the session keeps its issues with bd ([81d63c5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/81d63c5dc2452b9f08001756866db80046a2532a))
|
|
105
|
+
* **honcho:** the memory service speaks the native MCP of Pi ([f9f740c](https://github.com/ManotLuijiu/pi-harness-runtime/commit/f9f740c12869bae4c4380afbe8c76e12388bb744))
|
|
106
|
+
* **jev:** one decision per question, bound to the question it was evaluated for ([03448aa](https://github.com/ManotLuijiu/pi-harness-runtime/commit/03448aaa17f2d0c3bcf644b0b1d5949727dfff8c))
|
|
107
|
+
* **jev:** the evaluation of a choice sees what the options mean ([f0c207e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/f0c207e074701e6b7dab0965170ec39453d9d502))
|
|
108
|
+
* **jev:** the pending question carries the ask and the answer ([a792133](https://github.com/ManotLuijiu/pi-harness-runtime/commit/a792133e517fb8c12d3363e98942f3af30270f27))
|
|
109
|
+
* **jev:** the pending question counts down to the decision ([d0cc171](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d0cc171223986b2d32c670b6c1c74712fe0a4ad8))
|
|
110
|
+
* **keys:** tell the user what to do about an exposed key file ([7031003](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7031003574307351b7a8f28ee14159b58e17b793))
|
|
111
|
+
* **keys:** the key files are repaired when their permissions are unsafe ([e9c2c26](https://github.com/ManotLuijiu/pi-harness-runtime/commit/e9c2c26b287665b56ed749de269737e8403bb8af))
|
|
112
|
+
* **mcp:** the harness connects the registered servers when nobody else does ([7fef951](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7fef95137ad4664df57f045cd91b7d233315b0bc))
|
|
113
|
+
* **merge:** a manual run can leave the merge to the pull request event ([b3d1950](https://github.com/ManotLuijiu/pi-harness-runtime/commit/b3d1950b5941c78ccd56951acdafd1d4afbe1bff))
|
|
114
|
+
* **phase:** the agent owns the todo list and the harness says so ([c489370](https://github.com/ManotLuijiu/pi-harness-runtime/commit/c489370bd7926aece8cb1a77aa20ca2d2672f1fb))
|
|
115
|
+
* **providers:** a shared registry of the pending automatic actions and a bounded recovery ([c5f955b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/c5f955bc82adcb6999a89d5bc278fa87fccee022))
|
|
116
|
+
* **providers:** one failure has one executor, and the retry bridge is checked ([e73c4c7](https://github.com/ManotLuijiu/pi-harness-runtime/commit/e73c4c76ff20a9708083659bdcefe74870a84837))
|
|
117
|
+
* **questions:** refuse the deletion of a temporary path without the judge ([ab29694](https://github.com/ManotLuijiu/pi-harness-runtime/commit/ab29694f36c1ff020b3b19ca542a27b37847055c))
|
|
118
|
+
* **quota:** a fresh capture and a low allowance decide the MiniMax recovery ([06d7b8e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/06d7b8e971e0da58a344f75778c98edb442562bd))
|
|
119
|
+
* **quota:** the empty week waits for the human, the overload of a compaction shares the executor ([bbb0c39](https://github.com/ManotLuijiu/pi-harness-runtime/commit/bbb0c3909b11735343e84be690c4c47e67a563bb))
|
|
120
|
+
* **recovery:** a MiniMax quota exhaustion waits for the captured reset plus ten minutes ([5af08a0](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5af08a0e86c8c93fa5b7ff64a7b08e4514bc68f3))
|
|
121
|
+
* **review:** the review starts on its own when the implementation is done ([04f51f5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/04f51f599cd3222b6c74dd8fadb1373bd72d9bd7))
|
|
122
|
+
* **scope:** a marked resume and a backlog that only an approval starts ([19d3320](https://github.com/ManotLuijiu/pi-harness-runtime/commit/19d33204819cf05e678996fddf4c4621f0dd7d2f))
|
|
123
|
+
* **status:** the status line names the phase, the progress and the children ([0167bf3](https://github.com/ManotLuijiu/pi-harness-runtime/commit/0167bf396a0b987c1d44f3b869351976a951dd65))
|
|
124
|
+
* **test:** the task waits for the final tier of the validation plan ([fa147db](https://github.com/ManotLuijiu/pi-harness-runtime/commit/fa147dbf7d50d56e6ea48c6d8fbb4fcb190caf8a))
|
|
125
|
+
* **validation:** a large job starts with a measured pilot ([425964b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/425964b04a3d4fa02adfabed47ff62c5ec2b9c28))
|
|
126
|
+
* **validation:** the size of a job is a fact, not a phrase ([8aa6c11](https://github.com/ManotLuijiu/pi-harness-runtime/commit/8aa6c119565d0f8412dc8aeafa6b295d47d3f093))
|
|
127
|
+
* **workspace:** a Frappe bench names the mode of the workspace ([9d58517](https://github.com/ManotLuijiu/pi-harness-runtime/commit/9d585172063a330992fee933316e268ae9985e3c))
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
### Bug Fixes
|
|
131
|
+
|
|
132
|
+
* **ci:** every run of a required check counts, and the worst one decides ([da9e0da](https://github.com/ManotLuijiu/pi-harness-runtime/commit/da9e0da6b0ca29cb320764fd5fc1b8a8dee8b1e0))
|
|
133
|
+
* **ci:** the newest attempt of a run decides, not the attempt that failed ([9d7adcc](https://github.com/ManotLuijiu/pi-harness-runtime/commit/9d7adcc31cbacc517c3c1a9bcd3956be94c908ef))
|
|
134
|
+
* **harness:** a raw control byte hid the request scope from the review ([852b1ff](https://github.com/ManotLuijiu/pi-harness-runtime/commit/852b1ff3afc21adb71e92b85d21ff1c88e14816a))
|
|
135
|
+
* **honcho:** a handshake that never finishes is named instead of hanging the startup ([d66005f](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d66005f928a4f8df5de5b8a0579cbd4f8df37ff9))
|
|
136
|
+
* **honcho:** a probe that the end of the session cuts off is not a failure ([493fd93](https://github.com/ManotLuijiu/pi-harness-runtime/commit/493fd938ba09fdcf57bed4aaf259d81c4040909e))
|
|
137
|
+
* **honcho:** a slow connector is not a failed one, the row is corrected when the tools appear ([b62ac5b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/b62ac5b16ad93e2bfb10cbec589b80a09b7e20b3))
|
|
138
|
+
* **honcho:** a tools listing that the end of the session cuts off is not a failure ([62cc8c3](https://github.com/ManotLuijiu/pi-harness-runtime/commit/62cc8c376aade01c953ce2a1c6501ed07b74a1e9))
|
|
139
|
+
* **honcho:** the report names the state of the MCP server, not the registration ([762f4d5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/762f4d59e4eabcab9a1c21a61aa522c3267621b3))
|
|
140
|
+
* **hooks:** a tag is checked through the commit behind it ([c823e8e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/c823e8e1f6973c62b5449a97c101759a4d5cbba5))
|
|
141
|
+
* **jev:** a completion question, a stale check and a pending validation ([827120b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/827120b4138b6f5ae253e69154de190085703de8))
|
|
142
|
+
* **jev:** a new request does not inherit the completion of the old one ([0f863c7](https://github.com/ManotLuijiu/pi-harness-runtime/commit/0f863c7fcaf35e261beabebef15b8ab634132fdc))
|
|
143
|
+
* **jev:** a prohibition must not hide a destructive action ([78a6cc1](https://github.com/ManotLuijiu/pi-harness-runtime/commit/78a6cc199e647f812e145483f7e94991358d8f34))
|
|
144
|
+
* **jev:** a refusal without punctuation, and only a decline of an action ([ef3dbf8](https://github.com/ManotLuijiu/pi-harness-runtime/commit/ef3dbf87a2a1725373281613a0d48881ed5d2239))
|
|
145
|
+
* **jev:** a rejection during the countdown pauses the work ([9b018ce](https://github.com/ManotLuijiu/pi-harness-runtime/commit/9b018ce1152b6724dee73cdc901b8a360ecc91ab))
|
|
146
|
+
* **jev:** a session switch ends the wait of the old session ([ca03d39](https://github.com/ManotLuijiu/pi-harness-runtime/commit/ca03d399c0d4a1b2dd428ac39836ab53c0e51ab6))
|
|
147
|
+
* **jev:** an open question is not a permission to answer it ([e20eca2](https://github.com/ManotLuijiu/pi-harness-runtime/commit/e20eca24bb88d385198bb12ee3ebf573af9aea86))
|
|
148
|
+
* **jev:** keep a comparative caveat with the option it constrains ([7be306b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7be306b0d0872713ebca9386d613ae5a8da9d5b6))
|
|
149
|
+
* **jev:** the action of the question on its own text, and a reply is not an authorization ([7c3fdd6](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7c3fdd6822b58bd6ccfa3bcdf1c5282cb3db52dd))
|
|
150
|
+
* **jev:** the action of the question, and an open question blocks the work ([1f9ff39](https://github.com/ManotLuijiu/pi-harness-runtime/commit/1f9ff39efc4ee17464c54c2ca9b583245093dbac))
|
|
151
|
+
* **jev:** the alternatives of a question are parsed without a quadratic pattern ([63016a3](https://github.com/ManotLuijiu/pi-harness-runtime/commit/63016a3f0488acb801990dd46770c00d382b5858))
|
|
152
|
+
* **jev:** the countdown of an obsolete question does not outlive the work ([fe78b29](https://github.com/ManotLuijiu/pi-harness-runtime/commit/fe78b29e6fc513b11a6993bc68fd9418dc77f79b))
|
|
153
|
+
* **jev:** the facts of an option survive the wording of the agent ([5a6250c](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5a6250c07aa8d965bc6ae242cccbf519477598f8))
|
|
154
|
+
* **jev:** the scope decides the question, the identity guards the awaits ([ed348b2](https://github.com/ManotLuijiu/pi-harness-runtime/commit/ed348b2f94460a3b3ac11c01afd4420ee4ec1020))
|
|
155
|
+
* **jev:** the scope of a request on every human path, and the todos it touched ([cec8f36](https://github.com/ManotLuijiu/pi-harness-runtime/commit/cec8f3644333b1d13a203340df80a30fef5c1ac0))
|
|
156
|
+
* **jev:** the subject of the scope decides, a clarification is preserved ([faf6a0f](https://github.com/ManotLuijiu/pi-harness-runtime/commit/faf6a0fe7d0dce94d4fa48d0d7a57d126556ba6d))
|
|
157
|
+
* **keys:** the key directory is audited as a tree ([081cc75](https://github.com/ManotLuijiu/pi-harness-runtime/commit/081cc75ac8ceff36b0d619c3f76371dc08459d3c))
|
|
158
|
+
* **logging:** the query window no longer rots with the wall clock ([cd3f5b1](https://github.com/ManotLuijiu/pi-harness-runtime/commit/cd3f5b18d8a4b8850a201d060699e18bf789a647))
|
|
159
|
+
* **logging:** the sanitizer of a message writes its control characters as escapes ([f4bbdb9](https://github.com/ManotLuijiu/pi-harness-runtime/commit/f4bbdb94bc1801d4228142bc1a1b31505c42a575))
|
|
160
|
+
* **mcp:** the connector and the watcher stop with the session ([4d1b87d](https://github.com/ManotLuijiu/pi-harness-runtime/commit/4d1b87d14d015749025b62bf54d6d0b6137295f7))
|
|
161
|
+
* **mcp:** the connector survives a runtime that cannot list the servers ([d0f555f](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d0f555fa14f51de33591e572a41ded5b59a3e4dd))
|
|
162
|
+
* **merge:** the boolean input is read as a boolean ([971b716](https://github.com/ManotLuijiu/pi-harness-runtime/commit/971b7169a43db382dbdeb6bb9bab02ab56e0351c))
|
|
163
|
+
* **merge:** the manual job needs the right of the merge ([7ba685e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7ba685ec43d815f90aa35b742579e87e76c69209))
|
|
164
|
+
* **merge:** the merge of the pull request is the GraphQL mutation ([972bab4](https://github.com/ManotLuijiu/pi-harness-runtime/commit/972bab4b0f7faf1b0047f3bb767ef6db3de4b2fa))
|
|
165
|
+
* **merge:** the workflow merges the pull request the gates cleared ([d7639ec](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d7639ec9b83723510acb4a5c4e23d5d6167c3af6))
|
|
166
|
+
* **providers:** the escape of the user stops the recovery, and a permanent failure clears it ([cfe5797](https://github.com/ManotLuijiu/pi-harness-runtime/commit/cfe57976bf463c327e45b874fd297c3e942246b8))
|
|
167
|
+
* **providers:** the pause wins over a retry, and the retry starts when the run settles ([e016dd2](https://github.com/ManotLuijiu/pi-harness-runtime/commit/e016dd2a5add5b0f3c848a225a28a59e0f5fc7f3))
|
|
168
|
+
* **recovery:** a cancelled countdown does not own the next attempt ([7b79f30](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7b79f301389fae48201e696d3086d257ed722fb9))
|
|
169
|
+
* **recovery:** a cancelled retry of Pi is a cancelled decision, a spent budget is not ([7e13f15](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7e13f156a279cded2b2d4b0c99358100b3d5e038))
|
|
170
|
+
* **recovery:** a manual request takes the work back from the countdown ([fa81d8f](https://github.com/ManotLuijiu/pi-harness-runtime/commit/fa81d8fd9d6160166a095e07bdf17049bbafa32d))
|
|
171
|
+
* **recovery:** the predicate of Pi decides the retry, the provider identity is normalized ([6c8c17b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/6c8c17b53302cea1602d192251eacd0ebbd3e8c9))
|
|
172
|
+
* **release:** a manual release keeps the version of its manifest ([122e661](https://github.com/ManotLuijiu/pi-harness-runtime/commit/122e661ea48cb8aff14c71dbd0221a4cf0ba4c8e))
|
|
173
|
+
* **release:** the alignment names the reason of a failure ([5814dd0](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5814dd0b780f5839cf8011ed0cbbbb31e7eb0418))
|
|
174
|
+
* **release:** the channels of the package name the release ([a7a273f](https://github.com/ManotLuijiu/pi-harness-runtime/commit/a7a273ffe8398e2b5b07ef1c321777de41792c6e))
|
|
175
|
+
* **release:** the release publishes and leaves the channels alone ([5871746](https://github.com/ManotLuijiu/pi-harness-runtime/commit/5871746589c1281d855dbeb591b02419fa43f22e))
|
|
176
|
+
* **release:** the release pull request names the version of its branch ([a846e83](https://github.com/ManotLuijiu/pi-harness-runtime/commit/a846e83e6de6e529f4bca05e869db0b5eebb37c5))
|
|
177
|
+
* **release:** the release scans the tree of the commit it publishes ([7d47a0b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7d47a0b5406480a1e1d3a52623a76aabd1e2d0ba))
|
|
178
|
+
* **scope:** a session that ends leaves no proposal behind ([9aad01e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/9aad01e1f13446da1d01032e9967cadf66772792))
|
|
179
|
+
* **scope:** the findings of the review of the scope expansion ([92372e5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/92372e51ca31198593025ce8671b226d2ca7182e))
|
|
180
|
+
* **scope:** the question of a proposal is not obsolete and a rejection is named ([d4c58c3](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d4c58c3e63e27449ef1de0f8e4e55ebbf342ff7d))
|
|
181
|
+
* **test:** the quota capture integration needs the runtime of bun ([86fae7d](https://github.com/ManotLuijiu/pi-harness-runtime/commit/86fae7de31e76414aa31bb75eb136155f62d7a40))
|
|
182
|
+
* **workspace:** a strong bench signal decides, and the question is not a fact of an option ([303a828](https://github.com/ManotLuijiu/pi-harness-runtime/commit/303a828f55aa7c4e0a611231f482489b530ff5a3))
|
|
183
|
+
* **workspace:** keep a client name out of the comment about the search depth ([b572e0a](https://github.com/ManotLuijiu/pi-harness-runtime/commit/b572e0af16ff562203bda2b5c47b41807cff5a95))
|
|
184
|
+
* **workspace:** the repository names the mode before the mode stays unknown ([188a32c](https://github.com/ManotLuijiu/pi-harness-runtime/commit/188a32c7a6af1465dd24714278fccc73d06f6477))
|
|
185
|
+
|
|
5
186
|
### [1.1.511](https://github.com/ManotLuijiu/pi-harness-runtime/compare/v1.1.448...v1.1.511) (2026-11-16)
|
|
6
187
|
|
|
7
188
|
|
package/footer-status.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { MirrorRecord, ProviderMirrorRecord } from "./mirror.ts";
|
|
2
|
+
import type { CookieSourceStage } from "./packages/cookie-sanitizer/src/source-state.ts";
|
|
3
|
+
import type { QuotaAuthSource } from "./harness/quota-refresh-coordinator.ts";
|
|
2
4
|
|
|
3
5
|
import {
|
|
4
6
|
parseContextWindowStatusLine,
|
|
@@ -43,12 +45,21 @@ function getLimitTypeLabel(provider: string, limitType?: string): string {
|
|
|
43
45
|
return limitType ?? "tokens";
|
|
44
46
|
}
|
|
45
47
|
|
|
48
|
+
/**
|
|
49
|
+
* The text for a reset that is not known.
|
|
50
|
+
*
|
|
51
|
+
* A missing reset is not a near reset. "resets soon" claimed a timing that
|
|
52
|
+
* the runtime does not have; the honest text says that the reset time is
|
|
53
|
+
* unknown.
|
|
54
|
+
*/
|
|
55
|
+
export const UNKNOWN_RESET_TEXT = "reset time unknown";
|
|
56
|
+
|
|
46
57
|
/**
|
|
47
58
|
* Format reset time for display.
|
|
48
59
|
* Converts ISO strings or human-readable times to a compact format.
|
|
49
60
|
*/
|
|
50
61
|
function formatResetTime(resetAt?: string): string {
|
|
51
|
-
if (!resetAt) return
|
|
62
|
+
if (!resetAt) return UNKNOWN_RESET_TEXT;
|
|
52
63
|
|
|
53
64
|
// If it's already a short human-readable string, return as-is
|
|
54
65
|
if (/^\d+\s*(hr|min|day|d|h|m|s)/i.test(resetAt)) {
|
|
@@ -86,6 +97,17 @@ function formatResetTime(resetAt?: string): string {
|
|
|
86
97
|
return resetAt;
|
|
87
98
|
}
|
|
88
99
|
|
|
100
|
+
/**
|
|
101
|
+
* The phrase that names a reset.
|
|
102
|
+
*
|
|
103
|
+
* "resets Aug 25 01:47" when the reset is known, "reset time unknown" when
|
|
104
|
+
* it is not.
|
|
105
|
+
*/
|
|
106
|
+
function formatResetPhrase(resetAt?: string): string {
|
|
107
|
+
if (!resetAt) return UNKNOWN_RESET_TEXT;
|
|
108
|
+
return `resets ${formatResetTime(resetAt)}`;
|
|
109
|
+
}
|
|
110
|
+
|
|
89
111
|
/**
|
|
90
112
|
* Build a TUI-signal exhaustion status line with optional countdown.
|
|
91
113
|
* This is used when a provider (like GLM) hits its limit.
|
|
@@ -97,14 +119,14 @@ export function buildExhaustionStatusLine(
|
|
|
97
119
|
): string {
|
|
98
120
|
const label = providerDisplayName(provider);
|
|
99
121
|
const limitTypeLabel = getLimitTypeLabel(provider, view.limitType);
|
|
100
|
-
const
|
|
122
|
+
const resetPhrase = formatResetPhrase(view.resets_at ?? view.h5_resets_at);
|
|
101
123
|
|
|
102
124
|
if (countdownSeconds !== undefined && countdownSeconds > 0) {
|
|
103
125
|
const countdown = formatCountdownForDisplay(countdownSeconds);
|
|
104
126
|
return `${label}: ⏳ ${countdown} (${limitTypeLabel})`;
|
|
105
127
|
}
|
|
106
128
|
|
|
107
|
-
return `${label}: ${limitTypeLabel} hit,
|
|
129
|
+
return `${label}: ${limitTypeLabel} hit, ${resetPhrase}`;
|
|
108
130
|
}
|
|
109
131
|
import { getProviderLabel } from "./packages/types/src/ai-providers.ts";
|
|
110
132
|
import {
|
|
@@ -155,43 +177,95 @@ function providerDisplayName(provider: string | null | undefined): string {
|
|
|
155
177
|
return getProviderLabel(provider);
|
|
156
178
|
}
|
|
157
179
|
|
|
180
|
+
/**
|
|
181
|
+
* The state of the credential source, as the footer needs it.
|
|
182
|
+
*
|
|
183
|
+
* The stage says whether a credential was found and imported; the last
|
|
184
|
+
* fetch says whether the provider accepted it. They are different facts
|
|
185
|
+
* and the footer keeps them apart.
|
|
186
|
+
*/
|
|
187
|
+
export interface FooterQuotaSource {
|
|
188
|
+
/** How far the cookie source got. */
|
|
189
|
+
stage: CookieSourceStage;
|
|
190
|
+
/** The outcome of the last fetch, when one ran. */
|
|
191
|
+
lastFetch?: {
|
|
192
|
+
ok: boolean;
|
|
193
|
+
source: QuotaAuthSource;
|
|
194
|
+
reason?: string;
|
|
195
|
+
} | null;
|
|
196
|
+
}
|
|
197
|
+
|
|
158
198
|
/**
|
|
159
199
|
* Hint shown when the provider has no usage data yet.
|
|
160
200
|
* Covers all 9 known providers from KNOWN_AI_PROVIDERS.
|
|
161
201
|
*/
|
|
162
202
|
function missingDataHint(
|
|
163
203
|
provider: string | null | undefined,
|
|
164
|
-
|
|
204
|
+
source: FooterQuotaSource,
|
|
165
205
|
): string {
|
|
166
206
|
if (!provider) return "no usage source configured";
|
|
167
207
|
|
|
208
|
+
let hint: string;
|
|
209
|
+
|
|
168
210
|
// MiniMax: needs cookies for continuous scrape
|
|
169
211
|
if (provider === "minimax") {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
212
|
+
if (source.stage === "none") {
|
|
213
|
+
hint = "drop minimax cookies into ~/.pi-harness-runtime/cookies/";
|
|
214
|
+
} else if (source.stage === "discovered") {
|
|
215
|
+
// A file was found but the import did not publish a cache.
|
|
216
|
+
hint = "the cookie file was found but not imported yet";
|
|
217
|
+
} else {
|
|
218
|
+
hint = "no data yet (updates after first scrape)";
|
|
219
|
+
}
|
|
220
|
+
} else if (providerHasTUISignal(provider)) {
|
|
221
|
+
// TUI signal providers: one-shot signal on limit hit
|
|
222
|
+
hint = "no signal yet (updates on first limit hit)";
|
|
223
|
+
} else if (provider === "deepseek") {
|
|
224
|
+
// Providers without any tracking implementation yet
|
|
225
|
+
hint = "deepseek usage tracking not yet implemented";
|
|
226
|
+
} else if (provider === "gemini") {
|
|
227
|
+
hint = "gemini usage tracking not yet implemented";
|
|
228
|
+
} else if (provider === "kimi") {
|
|
229
|
+
hint = "kimi usage tracking not yet implemented";
|
|
230
|
+
} else if (source.stage === "none") {
|
|
231
|
+
// Generic fallback for any other unknown provider
|
|
232
|
+
hint = "no usage source configured";
|
|
233
|
+
} else {
|
|
234
|
+
hint = "no data yet";
|
|
173
235
|
}
|
|
174
236
|
|
|
175
|
-
|
|
176
|
-
if (
|
|
177
|
-
return
|
|
237
|
+
const lastFetch = source.lastFetch;
|
|
238
|
+
if (lastFetch && !lastFetch.ok && lastFetch.reason) {
|
|
239
|
+
return `${hint} (the last refresh failed: ${lastFetch.reason})`;
|
|
178
240
|
}
|
|
241
|
+
return hint;
|
|
242
|
+
}
|
|
179
243
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
244
|
+
/**
|
|
245
|
+
* The window line of a provider that reports percentages.
|
|
246
|
+
*
|
|
247
|
+
* Returns null when the record holds no percentage: a missing window is
|
|
248
|
+
* not a window of zero.
|
|
249
|
+
*/
|
|
250
|
+
function windowStatusLine(
|
|
251
|
+
provider: string,
|
|
252
|
+
view: ProviderMirrorRecord,
|
|
253
|
+
): string | null {
|
|
254
|
+
if (view.h5_used_pct === undefined && view.weekly_used_pct === undefined) {
|
|
255
|
+
return null;
|
|
187
256
|
}
|
|
188
|
-
|
|
189
|
-
|
|
257
|
+
const weeklyPct = view.weekly_used_pct ?? 0;
|
|
258
|
+
const weeklyLeft = Math.max(0, 100 - weeklyPct);
|
|
259
|
+
const weeklyResets = formatResetPhrase(view.weekly_resets_at);
|
|
260
|
+
|
|
261
|
+
if (view.h5_used_pct === undefined) {
|
|
262
|
+
// OpenAI: weekly-only (no 5h window)
|
|
263
|
+
return `week: ${weeklyLeft.toFixed(0)}% left (${weeklyResets})`;
|
|
190
264
|
}
|
|
191
265
|
|
|
192
|
-
//
|
|
193
|
-
|
|
194
|
-
return
|
|
266
|
+
// MiniMax/GLM: has both 5h and weekly windows
|
|
267
|
+
const h5Left = Math.max(0, 100 - view.h5_used_pct);
|
|
268
|
+
return `5h: ${h5Left.toFixed(0)}% left (${formatResetPhrase(view.h5_resets_at)}) - week: ${weeklyLeft.toFixed(0)}% left (${weeklyResets})`;
|
|
195
269
|
}
|
|
196
270
|
|
|
197
271
|
/** Normalize an unknown mirror record into a ProviderMirrorRecord view. */
|
|
@@ -218,7 +292,7 @@ export function buildFooterStatusValue(
|
|
|
218
292
|
local: { today: { tokens: number; cost: number } },
|
|
219
293
|
mirror: MirrorRecord | ProviderMirrorRecord | null,
|
|
220
294
|
freshness: "fresh" | "stale" | "expired" | "missing",
|
|
221
|
-
|
|
295
|
+
source: FooterQuotaSource = { stage: "imported" },
|
|
222
296
|
activeProvider: string | null = null,
|
|
223
297
|
): string {
|
|
224
298
|
const view = toProviderView(mirror);
|
|
@@ -226,7 +300,10 @@ export function buildFooterStatusValue(
|
|
|
226
300
|
const label = providerDisplayName(provider);
|
|
227
301
|
|
|
228
302
|
// TUI-signal exhaustion path: fires when limit is hit (one-shot signal).
|
|
229
|
-
//
|
|
303
|
+
// A signal is not proof that an allowance is zero, so the window
|
|
304
|
+
// percentages stay visible next to the signal when the record holds
|
|
305
|
+
// them: the failure information and the valid percentages are separate
|
|
306
|
+
// facts.
|
|
230
307
|
if (
|
|
231
308
|
provider &&
|
|
232
309
|
view &&
|
|
@@ -239,8 +316,14 @@ export function buildFooterStatusValue(
|
|
|
239
316
|
provider,
|
|
240
317
|
view.limitType ?? undefined,
|
|
241
318
|
);
|
|
242
|
-
const
|
|
243
|
-
|
|
319
|
+
const exhaustionNote = `${limitTypeLabel} hit, ${formatResetPhrase(view.resets_at ?? view.h5_resets_at)}`;
|
|
320
|
+
const windows = windowStatusLine(provider, view);
|
|
321
|
+
if (windows) {
|
|
322
|
+
const suffix =
|
|
323
|
+
freshness === "fresh" || freshness === "missing" ? "" : ` · ${freshness}`;
|
|
324
|
+
return `${label}: ${windows} · ${exhaustionNote}${suffix}`;
|
|
325
|
+
}
|
|
326
|
+
return `${label}: ${exhaustionNote}`;
|
|
244
327
|
}
|
|
245
328
|
|
|
246
329
|
// Continuous data path: providers with continuous scrape (MiniMax has 5h+weekly, OpenAI has weekly-only)
|
|
@@ -251,21 +334,7 @@ export function buildFooterStatusValue(
|
|
|
251
334
|
freshness !== "expired" &&
|
|
252
335
|
(view.h5_used_pct !== undefined || view.weekly_used_pct !== undefined)
|
|
253
336
|
) {
|
|
254
|
-
const
|
|
255
|
-
const weeklyLeft = Math.max(0, 100 - weeklyPct);
|
|
256
|
-
const weeklyResets = view.weekly_resets_at ?? "soon";
|
|
257
|
-
const h5Resets = view.h5_resets_at ?? "soon";
|
|
258
|
-
|
|
259
|
-
let statusLine: string;
|
|
260
|
-
if (view.h5_used_pct === undefined) {
|
|
261
|
-
// OpenAI: weekly-only (no 5h window)
|
|
262
|
-
statusLine = `week: ${weeklyLeft.toFixed(0)}% left (resets ${weeklyResets})`;
|
|
263
|
-
} else {
|
|
264
|
-
// MiniMax/GLM: has both 5h and weekly windows
|
|
265
|
-
const h5Pct = view.h5_used_pct;
|
|
266
|
-
const h5Left = Math.max(0, 100 - h5Pct);
|
|
267
|
-
statusLine = `5h: ${h5Left.toFixed(0)}% left (resets ${h5Resets}) - week: ${weeklyLeft.toFixed(0)}% left (resets ${weeklyResets})`;
|
|
268
|
-
}
|
|
337
|
+
const statusLine = windowStatusLine(provider, view) ?? "";
|
|
269
338
|
|
|
270
339
|
const freshnessSuffix =
|
|
271
340
|
freshness === "fresh" || freshness === "missing" ? "" : ` · ${freshness}`;
|
|
@@ -292,10 +361,10 @@ export function buildFooterStatusValue(
|
|
|
292
361
|
provider &&
|
|
293
362
|
(!view || freshness === "expired" || freshness === "missing")
|
|
294
363
|
) {
|
|
295
|
-
const hint = missingDataHint(provider,
|
|
364
|
+
const hint = missingDataHint(provider, source);
|
|
296
365
|
// MiniMax-on-fresh-machine still gets the cookie hint; for others
|
|
297
366
|
// the hint explains the signal-driven design.
|
|
298
|
-
if (provider === "minimax" &&
|
|
367
|
+
if (provider === "minimax" && source.stage === "none") {
|
|
299
368
|
return `${label}: 5h: -- (${hint})`;
|
|
300
369
|
}
|
|
301
370
|
return `${label}: 5h: -- · week: -- (${hint})`;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The reaction to a cookie import.
|
|
3
|
+
*
|
|
4
|
+
* The sanitizer watches the drop folder. When an import publishes a new
|
|
5
|
+
* canonical cache, the quota of the provider is probably different, so one
|
|
6
|
+
* refresh is asked for. The refresh is the shared one: a burst of watcher
|
|
7
|
+
* events asks once, not once per event.
|
|
8
|
+
*
|
|
9
|
+
* The handler lives outside the extension so that the reaction can be
|
|
10
|
+
* tested with fake events and a fake refresh, without a browser and
|
|
11
|
+
* without a provider.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import type { WatcherEvent } from "../packages/cookie-sanitizer/src/types.ts";
|
|
15
|
+
|
|
16
|
+
/** The options of the handler. */
|
|
17
|
+
export interface CookieImportRefreshOptions {
|
|
18
|
+
/**
|
|
19
|
+
* Ask for the shared quota refresh.
|
|
20
|
+
*
|
|
21
|
+
* The call is fire and forget: the import does not wait for the
|
|
22
|
+
* provider.
|
|
23
|
+
*/
|
|
24
|
+
requestRefresh: (trigger: string) => void;
|
|
25
|
+
/** The log sink. It never receives a cookie value. */
|
|
26
|
+
log: (message: string) => void;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** The trigger of the refresh that an import asks for. */
|
|
30
|
+
export const COOKIE_IMPORT_TRIGGER = "cookie-import";
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Handle one event of the cookie watcher.
|
|
34
|
+
*
|
|
35
|
+
* A successful import asks for one refresh. A failure is logged with its
|
|
36
|
+
* reason and asks for nothing.
|
|
37
|
+
*/
|
|
38
|
+
export function handleCookieWatcherEvent(
|
|
39
|
+
event: WatcherEvent,
|
|
40
|
+
options: CookieImportRefreshOptions,
|
|
41
|
+
): void {
|
|
42
|
+
if (event.kind === "sync-error" || event.kind === "watcher-error") {
|
|
43
|
+
const msg = "message" in event ? event.message : "";
|
|
44
|
+
if (msg.includes("ENOSPC")) {
|
|
45
|
+
options.log(
|
|
46
|
+
"cookie-sanitizer: ENOSPC — inotify watchers exhausted.\n" +
|
|
47
|
+
" Fix (run once as sudo):\n" +
|
|
48
|
+
" echo fs.inotify.max_user_watches=524288 | sudo tee /etc/sysctl.d/99-watch.conf\n" +
|
|
49
|
+
" sudo sysctl --system",
|
|
50
|
+
);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
options.log(`cookie-sanitizer: ${msg}`);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (event.kind === "sync-ok") {
|
|
58
|
+
options.requestRefresh(COOKIE_IMPORT_TRIGGER);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The choice of the credential of a quota refresh.
|
|
3
|
+
*
|
|
4
|
+
* Two credentials can answer a quota request:
|
|
5
|
+
*
|
|
6
|
+
* - the browser profile: a logged-in session that needs no import,
|
|
7
|
+
* - the canonical cookie cache: the normalized output of the sanitizer.
|
|
8
|
+
*
|
|
9
|
+
* The browser profile comes first, and its success does not depend on the
|
|
10
|
+
* drop folder at all: a machine whose drop file is malformed can still
|
|
11
|
+
* read its quota through the profile.
|
|
12
|
+
*
|
|
13
|
+
* The cookie cache comes second, and only when an import published it. A
|
|
14
|
+
* file that was found but not imported gives a scraper nothing to read,
|
|
15
|
+
* and asking the provider with nothing is a failure with a name.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import type { CookieSourceStage } from "../packages/cookie-sanitizer/src/source-state.ts";
|
|
19
|
+
|
|
20
|
+
/** The credential that answers a quota refresh. */
|
|
21
|
+
export type QuotaCredentialChoice = "browser-profile" | "cookie-cache" | "none";
|
|
22
|
+
|
|
23
|
+
/** The facts the choice is made from. */
|
|
24
|
+
export interface QuotaCredentialFacts {
|
|
25
|
+
/**
|
|
26
|
+
* The outcome of the browser profile, when it ran.
|
|
27
|
+
*
|
|
28
|
+
* `ok` means the profile held a quota reading.
|
|
29
|
+
*/
|
|
30
|
+
browserProfile?: { ok: boolean; reason?: string } | null;
|
|
31
|
+
/** The stage of the cookie source. */
|
|
32
|
+
cookieStage: CookieSourceStage;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Choose the credential of a quota refresh.
|
|
37
|
+
*
|
|
38
|
+
* The reason of a "none" names the failure, never a credential.
|
|
39
|
+
*/
|
|
40
|
+
export function chooseQuotaCredential(facts: QuotaCredentialFacts): {
|
|
41
|
+
choice: QuotaCredentialChoice;
|
|
42
|
+
reason?: string;
|
|
43
|
+
} {
|
|
44
|
+
const profile = facts.browserProfile;
|
|
45
|
+
if (profile?.ok) {
|
|
46
|
+
return { choice: "browser-profile" };
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (facts.cookieStage === "imported") {
|
|
50
|
+
return { choice: "cookie-cache" };
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (facts.cookieStage === "discovered") {
|
|
54
|
+
return {
|
|
55
|
+
choice: "none",
|
|
56
|
+
reason:
|
|
57
|
+
"the cookie file was found but not imported into the canonical cache",
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return {
|
|
62
|
+
choice: "none",
|
|
63
|
+
reason: profile?.reason
|
|
64
|
+
? `no imported cookie cache is available (${profile.reason})`
|
|
65
|
+
: "no imported cookie cache is available",
|
|
66
|
+
};
|
|
67
|
+
}
|