pi-harness-runtime 0.9.25 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -7
- package/README.md +51 -51
- package/harness/auto-compact.ts +1 -1
- package/harness/autonomous-review.ts +88 -0
- package/harness/context-compact-orchestrator.ts +23 -23
- package/harness/context-window-manager.ts +5 -5
- package/harness/continue-prompt.ts +3 -3
- package/harness/e2e/minimax-quota-scraper.ts +1 -1
- package/harness/forked-summarizer.ts +4 -4
- package/harness/herdr-agents.ts +91 -0
- package/harness/index.ts +5 -5
- package/harness/loop-code-agent.ts +284 -0
- package/harness/loop-controller.ts +201 -0
- package/harness/loop-review-agent.ts +295 -0
- package/harness/loop-runtime.ts +10 -10
- package/harness/loop-types.ts +118 -0
- package/harness/notification-events.ts +3 -3
- package/harness/output-limit-handler.ts +1 -1
- package/harness/partial-recovery.ts +3 -3
- package/harness/session-memory.ts +5 -5
- package/index.ts +46 -32
- package/package.json +1 -1
- package/packages/a2a-adapter/package.json +1 -1
- package/packages/a2a-adapter/src/types.ts +5 -5
- package/packages/auth/package.json +1 -1
- package/packages/autonomous-refactor/package.json +1 -1
- package/packages/autonomous-runtime/dist/inbox.d.ts +3 -3
- package/packages/autonomous-runtime/dist/inbox.js +12 -12
- package/packages/autonomous-runtime/dist/lease.js +14 -14
- package/packages/autonomous-runtime/dist/types.js +1 -1
- package/packages/autonomous-runtime/package.json +1 -1
- package/packages/autonomous-runtime/src/inbox.ts +12 -12
- package/packages/autonomous-runtime/src/lease.ts +15 -15
- package/packages/autonomous-runtime/src/types.ts +13 -13
- package/packages/autonomous-runtime/tsconfig.tsbuildinfo +1 -1
- package/packages/cache-strategy/package.json +1 -1
- package/packages/capability-registry/dist/types.js +1 -1
- package/packages/capability-registry/package.json +1 -1
- package/packages/capability-registry/src/types.ts +5 -5
- package/packages/checkpoint/README.md +6 -6
- package/packages/checkpoint/dist/differ.js +2 -2
- package/packages/checkpoint/dist/engine.js +3 -3
- package/packages/checkpoint/dist/index.js +5 -5
- package/packages/checkpoint/dist/storage.js +3 -3
- package/packages/checkpoint/dist/types.js +1 -1
- package/packages/checkpoint/package.json +1 -1
- package/packages/checkpoint/src/differ.ts +2 -2
- package/packages/checkpoint/src/engine.ts +3 -3
- package/packages/checkpoint/src/index.ts +5 -5
- package/packages/checkpoint/src/storage.ts +3 -3
- package/packages/checkpoint/src/types.ts +10 -10
- package/packages/checkpoint/tsconfig.tsbuildinfo +1 -1
- package/packages/cli-plugin-sdk/package.json +1 -1
- package/packages/clipboard/dist/src/clipboard.d.ts.map +1 -1
- package/packages/clipboard/dist/src/clipboard.js +15 -7
- package/packages/clipboard/dist/src/clipboard.js.map +1 -1
- package/packages/clipboard/package.json +1 -1
- package/packages/clipboard/src/clipboard.ts +16 -9
- package/packages/code-generation/README.md +13 -13
- package/packages/code-generation/dist/faker.js +4 -4
- package/packages/code-generation/dist/generator.js +3 -3
- package/packages/code-generation/dist/index.js +3 -3
- package/packages/code-generation/dist/templates/registry.js +1 -1
- package/packages/code-generation/dist/types.js +1 -1
- package/packages/code-generation/package.json +1 -1
- package/packages/code-generation/src/faker.ts +5 -5
- package/packages/code-generation/src/generator.ts +4 -4
- package/packages/code-generation/src/index.ts +3 -3
- package/packages/code-generation/src/templates/registry.ts +1 -1
- package/packages/code-generation/src/types.ts +10 -10
- package/packages/code-generation/tsconfig.tsbuildinfo +1 -1
- package/packages/code-review/README.md +13 -13
- package/packages/code-review/dist/engine.js +3 -3
- package/packages/code-review/dist/index.js +3 -3
- package/packages/code-review/dist/types.js +1 -1
- package/packages/code-review/package.json +1 -1
- package/packages/code-review/src/engine.ts +3 -3
- package/packages/code-review/src/index.ts +3 -3
- package/packages/code-review/src/types.ts +10 -10
- package/packages/code-review/tsconfig.tsbuildinfo +1 -1
- package/packages/codex-adapter/package.json +1 -1
- package/packages/context-compiler/dist/compiler.js +1 -1
- package/packages/context-compiler/package.json +1 -1
- package/packages/context-compiler/src/compiler.ts +1 -1
- package/packages/context-compiler/src/types.ts +11 -11
- package/packages/context-compiler/test/context-compiler.test.ts +11 -11
- package/packages/context-discovery/package.json +1 -1
- package/packages/context-manager/package.json +1 -1
- package/packages/cookie-sanitizer/README.md +27 -27
- package/packages/cookie-sanitizer/package.json +1 -1
- package/packages/cost-optimizer/package.json +1 -1
- package/packages/cost-optimizer/src/types.ts +5 -5
- package/packages/dependency-analyzer/package.json +1 -1
- package/packages/django-plugin/dist/analyzer.js +7 -7
- package/packages/django-plugin/package.json +1 -1
- package/packages/django-plugin/src/analyzer.ts +7 -7
- package/packages/doc-generator/package.json +1 -1
- package/packages/evaluation-engine/dist/engine.js +9 -9
- package/packages/evaluation-engine/package.json +1 -1
- package/packages/evaluation-engine/src/engine.ts +9 -9
- package/packages/evaluation-engine/src/types.ts +3 -3
- package/packages/evaluation-runner/package.json +1 -1
- package/packages/event-bus/dist/src/herdr-bus.d.ts +121 -0
- package/packages/event-bus/dist/src/herdr-bus.d.ts.map +1 -0
- package/packages/event-bus/dist/src/herdr-bus.js +322 -0
- package/packages/event-bus/dist/src/herdr-bus.js.map +1 -0
- package/packages/event-bus/dist/src/index.d.ts +2 -0
- package/packages/event-bus/dist/src/index.d.ts.map +1 -1
- package/packages/event-bus/dist/src/index.js +1 -0
- package/packages/event-bus/dist/src/index.js.map +1 -1
- package/packages/event-bus/package.json +1 -1
- package/packages/event-bus/src/herdr-bus.ts +525 -0
- package/packages/event-bus/src/index.ts +29 -0
- package/packages/event-store/package.json +1 -1
- package/packages/experience-replay/dist/replay.js +7 -7
- package/packages/experience-replay/package.json +1 -1
- package/packages/experience-replay/src/replay.ts +7 -7
- package/packages/experience-replay/src/types.ts +5 -5
- package/packages/feedback-collector/package.json +1 -1
- package/packages/framework-detector/README.md +18 -18
- package/packages/framework-detector/dist/detector.js +3 -3
- package/packages/framework-detector/dist/index.js +3 -3
- package/packages/framework-detector/dist/signatures/registry.js +24 -24
- package/packages/framework-detector/dist/types.js +1 -1
- package/packages/framework-detector/package.json +1 -1
- package/packages/framework-detector/src/detector.ts +3 -3
- package/packages/framework-detector/src/index.ts +3 -3
- package/packages/framework-detector/src/signatures/registry.ts +24 -24
- package/packages/framework-detector/src/types.ts +7 -7
- package/packages/framework-detector/tsconfig.tsbuildinfo +1 -1
- package/packages/framework-plugin-sdk/README.md +23 -23
- package/packages/framework-plugin-sdk/dist/index.js +2 -2
- package/packages/framework-plugin-sdk/dist/manager.js +3 -3
- package/packages/framework-plugin-sdk/dist/types.js +2 -2
- package/packages/framework-plugin-sdk/package.json +1 -1
- package/packages/framework-plugin-sdk/src/index.ts +2 -2
- package/packages/framework-plugin-sdk/src/manager.ts +3 -3
- package/packages/framework-plugin-sdk/src/types.ts +10 -10
- package/packages/framework-plugin-sdk/tsconfig.tsbuildinfo +1 -1
- package/packages/frappe-plugin/dist/analyzer.js +8 -8
- package/packages/frappe-plugin/dist/types.js +1 -1
- package/packages/frappe-plugin/package.json +1 -1
- package/packages/frappe-plugin/src/analyzer.ts +8 -8
- package/packages/frappe-plugin/src/types.ts +10 -10
- package/packages/generic-web-plugin/dist/analyzer.js +5 -5
- package/packages/generic-web-plugin/package.json +1 -1
- package/packages/generic-web-plugin/src/analyzer.ts +5 -5
- package/packages/health-monitor/package.json +1 -1
- package/packages/health-monitor/src/monitor.ts +1 -1
- package/packages/intent-analyzer/package.json +1 -1
- package/packages/laravel-plugin/dist/analyzer.js +11 -11
- package/packages/laravel-plugin/package.json +1 -1
- package/packages/laravel-plugin/src/analyzer.ts +11 -11
- package/packages/learning-engine/dist/engine.js +5 -5
- package/packages/learning-engine/dist/types.js +1 -1
- package/packages/learning-engine/package.json +1 -1
- package/packages/learning-engine/src/engine.ts +5 -5
- package/packages/learning-engine/src/types.ts +6 -6
- package/packages/mcp-adapter/package.json +1 -1
- package/packages/memory-engine/dist/engine.js +8 -8
- package/packages/memory-engine/dist/types.js +2 -2
- package/packages/memory-engine/package.json +1 -1
- package/packages/memory-engine/src/engine.ts +8 -8
- package/packages/memory-engine/src/types.ts +9 -9
- package/packages/model-registry/package.json +1 -1
- package/packages/model-registry/src/types.ts +4 -4
- package/packages/nextjs-plugin/dist/analyzer.js +9 -9
- package/packages/nextjs-plugin/package.json +1 -1
- package/packages/nextjs-plugin/src/analyzer.ts +9 -9
- package/packages/notification/dist/notification-center.js +1 -1
- package/packages/notification/package.json +1 -1
- package/packages/notification/src/notification-center.ts +1 -1
- package/packages/observability/dist/alerts.js +2 -2
- package/packages/observability/dist/health.js +4 -4
- package/packages/observability/dist/index.js +6 -6
- package/packages/observability/dist/logger.js +7 -7
- package/packages/observability/dist/metrics.js +11 -11
- package/packages/observability/dist/tracer.js +3 -3
- package/packages/observability/dist/types.js +1 -1
- package/packages/observability/package.json +1 -1
- package/packages/observability/src/alerts.ts +2 -2
- package/packages/observability/src/health.ts +4 -4
- package/packages/observability/src/index.ts +6 -6
- package/packages/observability/src/logger.ts +7 -7
- package/packages/observability/src/metrics.ts +11 -11
- package/packages/observability/src/tracer.ts +3 -3
- package/packages/observability/src/types.ts +7 -7
- package/packages/observability/test/observability.test.ts +4 -4
- package/packages/observability/tsconfig.tsbuildinfo +1 -1
- package/packages/performance-optimizer/dist/optimizer.js +1 -1
- package/packages/performance-optimizer/package.json +1 -1
- package/packages/performance-optimizer/src/optimizer.ts +1 -1
- package/packages/performance-optimizer/src/types.ts +4 -4
- package/packages/privilege-broker/package.json +1 -1
- package/packages/project-analyzer/dist/analyzer.js +4 -4
- package/packages/project-analyzer/dist/index.js +8 -8
- package/packages/project-analyzer/dist/signals.js +3 -3
- package/packages/project-analyzer/dist/types.js +1 -1
- package/packages/project-analyzer/package.json +1 -1
- package/packages/project-analyzer/src/analyzer.ts +4 -4
- package/packages/project-analyzer/src/index.ts +9 -9
- package/packages/project-analyzer/src/signals.ts +4 -4
- package/packages/project-analyzer/src/types.ts +15 -15
- package/packages/project-analyzer/test/index.test.ts +17 -17
- package/packages/project-analyzer/tsconfig.tsbuildinfo +1 -1
- package/packages/projection-engine/package.json +1 -1
- package/packages/prompt-compiler/dist/section-builder.js +1 -1
- package/packages/prompt-compiler/dist/types.js +3 -3
- package/packages/prompt-compiler/package.json +1 -1
- package/packages/prompt-compiler/src/section-builder.ts +1 -1
- package/packages/prompt-compiler/src/types.ts +12 -12
- package/packages/prompt-compiler/test/prompt-compiler.test.ts +12 -12
- package/packages/prompt-versioning/package.json +1 -1
- package/packages/provider-adapter-sdk/dist/builder.js +1 -1
- package/packages/provider-adapter-sdk/dist/index.js +5 -5
- package/packages/provider-adapter-sdk/dist/registry.js +1 -1
- package/packages/provider-adapter-sdk/dist/tester.js +1 -1
- package/packages/provider-adapter-sdk/dist/types.js +1 -1
- package/packages/provider-adapter-sdk/package.json +1 -1
- package/packages/provider-adapter-sdk/src/builder.ts +1 -1
- package/packages/provider-adapter-sdk/src/index.ts +6 -6
- package/packages/provider-adapter-sdk/src/registry.ts +1 -1
- package/packages/provider-adapter-sdk/src/tester.ts +1 -1
- package/packages/provider-adapter-sdk/src/types.ts +5 -5
- package/packages/provider-adapter-sdk/tsconfig.tsbuildinfo +1 -1
- package/packages/provider-router/package.json +1 -1
- package/packages/provider-router/src/types.ts +4 -4
- package/packages/provider-selector/package.json +1 -1
- package/packages/providers/dist/deepagents-adapter.js +1 -1
- package/packages/providers/package.json +1 -1
- package/packages/providers/src/deepagents-adapter.ts +1 -1
- package/packages/quota-manager/package.json +1 -1
- package/packages/rate-limiter/package.json +1 -1
- package/packages/react-vite-plugin/dist/analyzer.js +7 -7
- package/packages/react-vite-plugin/package.json +1 -1
- package/packages/react-vite-plugin/src/analyzer.ts +7 -7
- package/packages/release-manager/package.json +1 -1
- package/packages/requirement-compiler/dist/compiler.js +17 -17
- package/packages/requirement-compiler/dist/types.js +2 -2
- package/packages/requirement-compiler/package.json +1 -1
- package/packages/requirement-compiler/src/compiler.ts +17 -17
- package/packages/requirement-compiler/src/types.ts +21 -21
- package/packages/requirement-compiler/test/requirement-compiler.test.ts +17 -17
- package/packages/runtime/dist/command-executor.js +1 -1
- package/packages/runtime/dist/local-runtime-agent.js +1 -1
- package/packages/runtime/dist/policy-engine.js +1 -1
- package/packages/runtime/dist/runtime-api.js +1 -1
- package/packages/runtime/dist/workspace-manager.js +1 -1
- package/packages/runtime/package.json +1 -1
- package/packages/runtime/src/command-executor.ts +1 -1
- package/packages/runtime/src/local-runtime-agent.ts +1 -1
- package/packages/runtime/src/policy-engine.ts +1 -1
- package/packages/runtime/src/runtime-api.ts +1 -1
- package/packages/runtime/src/workspace-manager.ts +1 -1
- package/packages/scheduler/package.json +1 -1
- package/packages/scheduler-adapter/package.json +1 -1
- package/packages/session/README.md +18 -18
- package/packages/session/dist/history.js +3 -3
- package/packages/session/dist/index.js +5 -5
- package/packages/session/dist/manager.js +3 -3
- package/packages/session/dist/policy.js +2 -2
- package/packages/session/dist/store.js +2 -2
- package/packages/session/dist/types.js +1 -1
- package/packages/session/package.json +1 -1
- package/packages/session/src/history.ts +3 -3
- package/packages/session/src/index.ts +5 -5
- package/packages/session/src/manager.ts +3 -3
- package/packages/session/src/policy.ts +4 -4
- package/packages/session/src/store.ts +3 -3
- package/packages/session/src/types.ts +10 -10
- package/packages/session/tsconfig.tsbuildinfo +1 -1
- package/packages/session-api/package.json +1 -1
- package/packages/session-export/package.json +1 -1
- package/packages/shared-context/package.json +1 -1
- package/packages/skill-registry/package.json +1 -1
- package/packages/skill-registry/src/types.ts +4 -4
- package/packages/sprint-planner/package.json +1 -1
- package/packages/subscription-engine/package.json +1 -1
- package/packages/task-compiler/dist/compiler.js +7 -7
- package/packages/task-compiler/dist/decompose.js +11 -11
- package/packages/task-compiler/dist/file-scope.js +6 -6
- package/packages/task-compiler/dist/graph.js +6 -6
- package/packages/task-compiler/dist/index.js +2 -2
- package/packages/task-compiler/dist/types.js +5 -5
- package/packages/task-compiler/dist/validate.js +2 -2
- package/packages/task-compiler/dist/verification.js +2 -2
- package/packages/task-compiler/package.json +1 -1
- package/packages/task-compiler/src/command-policy.ts +1 -1
- package/packages/task-compiler/src/compiler.ts +7 -7
- package/packages/task-compiler/src/decompose.ts +11 -11
- package/packages/task-compiler/src/file-scope.ts +6 -6
- package/packages/task-compiler/src/graph.ts +6 -6
- package/packages/task-compiler/src/index.ts +3 -3
- package/packages/task-compiler/src/types.ts +14 -14
- package/packages/task-compiler/src/validate.ts +2 -2
- package/packages/task-compiler/src/verification.ts +2 -2
- package/packages/task-compiler/test/task-compiler.test.ts +10 -10
- package/packages/test-data-generator/README.md +13 -13
- package/packages/test-data-generator/dist/faker-adapter.js +4 -4
- package/packages/test-data-generator/dist/generator.js +3 -3
- package/packages/test-data-generator/dist/index.js +3 -3
- package/packages/test-data-generator/dist/types.js +1 -1
- package/packages/test-data-generator/package.json +1 -1
- package/packages/test-data-generator/src/faker-adapter.ts +4 -4
- package/packages/test-data-generator/src/generator.ts +3 -3
- package/packages/test-data-generator/src/index.ts +3 -3
- package/packages/test-data-generator/src/types.ts +9 -9
- package/packages/test-data-generator/tsconfig.tsbuildinfo +1 -1
- package/packages/test-generator/package.json +1 -1
- package/packages/token-estimation/package.json +1 -1
- package/packages/token-optimizer/package.json +1 -1
- package/packages/tui/package.json +1 -1
- package/packages/types/package.json +1 -1
- package/packages/types/src/agent-worker-types.ts +5 -5
- package/packages/types/src/runtime-types.ts +12 -12
- package/packages/types/tsconfig.tsbuildinfo +1 -1
- package/packages/workflow-events/package.json +1 -1
- package/packages/workspace-scanner/package.json +1 -1
- package/packages/worktree/package.json +1 -1
- package/renderer.ts +7 -7
- package/skills/harness-runtime/SKILL.md +15 -15
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,26 @@
|
|
|
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
|
+
## [0.10.0](https://github.com/ManotLuijiu/pi-harness-runtime/compare/v0.9.24...v0.10.0) (2026-07-30)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* blackboard-coordinated loop controller with early exit ([f3cf3ea](https://github.com/ManotLuijiu/pi-harness-runtime/commit/f3cf3ea479170dd75b7e9a7c3515dde230bb0da7))
|
|
11
|
+
* herdr inter-agent event bus for autonomous code review ([1490cdd](https://github.com/ManotLuijiu/pi-harness-runtime/commit/1490cddec80dac812065c3c681984524ad3194e1))
|
|
12
|
+
* loop controller for write-review cycles with early exit ([95066ce](https://github.com/ManotLuijiu/pi-harness-runtime/commit/95066ce8cb58c55eaa14d69fd826b5aaff680c16))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* **clipboard:** pass UTF-8 bytes directly to xclip via stdin, avoid pipeline corruption ([051ca18](https://github.com/ManotLuijiu/pi-harness-runtime/commit/051ca18fb1deb1169a8a4da16aa9314d2e6ec66d))
|
|
18
|
+
* herdr-bus refactoring — rename publishers to *Simple variants ([d727591](https://github.com/ManotLuijiu/pi-harness-runtime/commit/d7275913a89deb56a6bcfdb912ea9d17e3a80ce1))
|
|
19
|
+
* import LoopConfig from index.js, remove unused LoopNextAction import ([1100a4e](https://github.com/ManotLuijiu/pi-harness-runtime/commit/1100a4e87433e54416259dfdad41bc5e0def19b3))
|
|
20
|
+
* periodic quota refresh every 15 minutes via setInterval ([f28e700](https://github.com/ManotLuijiu/pi-harness-runtime/commit/f28e7004d089aeada1659f4d55a35461baba76fc))
|
|
21
|
+
* replace all Unicode box-drawing characters with ASCII ([dd4223a](https://github.com/ManotLuijiu/pi-harness-runtime/commit/dd4223abb0e25f746ee09ced05f6b3e40a10eb85))
|
|
22
|
+
* replace Unicode dashes and arrows with ASCII equivalents ([e9027e6](https://github.com/ManotLuijiu/pi-harness-runtime/commit/e9027e689c06fdc1ca2ac4a6365ed6a6a0a384fd))
|
|
23
|
+
* trigger cookie sync on startup so pre-existing cookies aren't ignored ([2914299](https://github.com/ManotLuijiu/pi-harness-runtime/commit/2914299b8caa02acbb06620c7cb8e4870acfa40e))
|
|
24
|
+
|
|
5
25
|
### [0.9.25](https://github.com/ManotLuijiu/pi-harness-runtime/compare/v0.9.21...v0.9.25) (2026-07-27)
|
|
6
26
|
|
|
7
27
|
|
|
@@ -117,7 +137,7 @@ All notable changes to this project will be documented in this file. See [standa
|
|
|
117
137
|
### Bug Fixes
|
|
118
138
|
|
|
119
139
|
* publish missing runtime modules ([3fc7058](https://github.com/ManotLuijiu/pi-harness-runtime/commit/3fc70586d0cd10f4d38eab67e4cadaec20aaeb56))
|
|
120
|
-
* **release:** remove redundant Bump version step — was double-bumping version (0.7.1
|
|
140
|
+
* **release:** remove redundant Bump version step — was double-bumping version (0.7.1->0.8.0) when tag pushed ([413ad6d](https://github.com/ManotLuijiu/pi-harness-runtime/commit/413ad6d49356ec62b94e9a4e09d3475ef39bebd6))
|
|
121
141
|
|
|
122
142
|
## [0.9.0](https://github.com/ManotLuijiu/pi-harness-runtime/compare/v0.7.1...v0.9.0) (2026-07-13)
|
|
123
143
|
|
|
@@ -127,7 +147,7 @@ All notable changes to this project will be documented in this file. See [standa
|
|
|
127
147
|
|
|
128
148
|
### Bug Fixes
|
|
129
149
|
|
|
130
|
-
* **release:** remove redundant Bump version step — was double-bumping version (0.7.1
|
|
150
|
+
* **release:** remove redundant Bump version step — was double-bumping version (0.7.1->0.8.0) when tag pushed ([413ad6d](https://github.com/ManotLuijiu/pi-harness-runtime/commit/413ad6d49356ec62b94e9a4e09d3475ef39bebd6))
|
|
131
151
|
|
|
132
152
|
### [0.7.1](https://github.com/ManotLuijiu/pi-harness-runtime/compare/v0.6.3...v0.7.1) (2026-07-13)
|
|
133
153
|
|
|
@@ -158,11 +178,11 @@ All notable changes to this project will be documented in this file. See [standa
|
|
|
158
178
|
|
|
159
179
|
### Changed
|
|
160
180
|
|
|
161
|
-
* **Project rename**: `pi-usage-status`
|
|
162
|
-
* npm package name: `pi-usage-status`
|
|
163
|
-
* Repository: `ManotLuijiu/pi-usage-status`
|
|
164
|
-
* Bundled skill: `usage-status`
|
|
165
|
-
* Status bar key: `usage-status`
|
|
181
|
+
* **Project rename**: `pi-usage-status` -> `pi-harness-runtime`
|
|
182
|
+
* npm package name: `pi-usage-status` -> `pi-harness-runtime`
|
|
183
|
+
* Repository: `ManotLuijiu/pi-usage-status` -> `ManotLuijiu/pi-harness-runtime`
|
|
184
|
+
* Bundled skill: `usage-status` -> `harness-runtime` (file path `skills/usage-status/` -> `skills/harness-runtime/`)
|
|
185
|
+
* Status bar key: `usage-status` -> `harness-runtime`
|
|
166
186
|
* **Data directory unchanged**: still `~/.pi/usage-status/` (preserves existing user data)
|
|
167
187
|
* **Env var unchanged**: still `PI_USAGE_DIR` (preserves existing user configs)
|
|
168
188
|
* **Extension symlink unchanged**: still `~/.pi/agent/extensions/pi-usage-status` (repointed to renamed project directory)
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
5
|
[]()
|
|
6
6
|
|
|
7
|
-
>
|
|
7
|
+
> !️ **Beta Notice — Not Production Ready !️**
|
|
8
8
|
> This project is in active development. Core features work.
|
|
9
9
|
|
|
10
10
|
**Autonomous AI coding harness for pi: local token tracking + provider mirror + task orchestration.**
|
|
@@ -54,10 +54,10 @@ Requires Pi v0.37.3+.
|
|
|
54
54
|
/harness start Build a REST API with JWT authentication
|
|
55
55
|
|
|
56
56
|
# Runtime creates task graph:
|
|
57
|
-
# task-001: Analyze requirements
|
|
58
|
-
# task-002: Implement API
|
|
59
|
-
# task-003: Write tests
|
|
60
|
-
# task-004: Code review
|
|
57
|
+
# task-001: Analyze requirements -> ready
|
|
58
|
+
# task-002: Implement API -> depends on task-001
|
|
59
|
+
# task-003: Write tests -> depends on task-002
|
|
60
|
+
# task-004: Code review -> depends on task-003
|
|
61
61
|
|
|
62
62
|
/harness status
|
|
63
63
|
# Job: job-123, Status: running
|
|
@@ -74,48 +74,48 @@ Requires Pi v0.37.3+.
|
|
|
74
74
|
# When all tasks complete:
|
|
75
75
|
/harness status
|
|
76
76
|
# Job: job-123, Status: ready_for_client
|
|
77
|
-
# Tasks: 4/4 done
|
|
77
|
+
# Tasks: 4/4 done [x]
|
|
78
78
|
```
|
|
79
79
|
|
|
80
80
|
## Architecture
|
|
81
81
|
|
|
82
82
|
```
|
|
83
83
|
pi-harness-runtime/
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
84
|
+
+-- index.ts # Extension entry point
|
|
85
|
+
+-- footer-status.ts # Footer bar renderer (local vs. mirror mode)
|
|
86
|
+
+-- mirror.ts # Per-provider quota mirror (mirror.json)
|
|
87
|
+
+-- harness/
|
|
88
|
+
| +-- job-state-machine.ts # 14-state lifecycle machine
|
|
89
|
+
| +-- task-graph.ts # DAG-based task management
|
|
90
|
+
| +-- master-planner.ts # Requirement -> task graph
|
|
91
|
+
| +-- loop-runtime.ts # Core execution loop
|
|
92
|
+
| +-- repair-engine.ts # Auto-fix failures
|
|
93
|
+
| +-- blackboard.ts # Agent coordination
|
|
94
|
+
| +-- context-window-manager.ts # Context tracking
|
|
95
|
+
| +-- agent-handoff.ts # Clean agent transitions
|
|
96
|
+
| +-- e2e/
|
|
97
|
+
| | +-- minimax-quota-scraper.ts # Playwright MiniMax scraper
|
|
98
|
+
| | +-- playwright-runner.ts # Browser automation
|
|
99
|
+
| +-- project-detector/
|
|
100
|
+
| +-- detector.ts # Auto-detect project type
|
|
101
|
+
+-- packages/
|
|
102
|
+
| +-- cookie-sanitizer/ # Live cookie-file sync via chokidar
|
|
103
|
+
| +-- providers/ # MiniMax, OpenAI, Codex adapters
|
|
104
|
+
| +-- quota-manager/ # Quota signal collection
|
|
105
|
+
| +-- auth/ # MiniMax browser auth
|
|
106
|
+
| +-- worktree/ # Git worktree per task
|
|
107
|
+
+-- skills/
|
|
108
|
+
+-- harness-runtime/
|
|
109
|
+
+-- SKILL.md # Skill documentation
|
|
110
110
|
```
|
|
111
111
|
|
|
112
112
|
## Job State Machine
|
|
113
113
|
|
|
114
114
|
```
|
|
115
|
-
created
|
|
116
|
-
|
|
115
|
+
created -> planning -> queued -> running -> testing -> reviewing
|
|
116
|
+
v v v v v
|
|
117
117
|
cancelled blocked waiting_human repairing ready_for_client
|
|
118
|
-
|
|
118
|
+
v v
|
|
119
119
|
paused_quota archived
|
|
120
120
|
```
|
|
121
121
|
|
|
@@ -136,18 +136,18 @@ All data stored locally in `~/.pi/`:
|
|
|
136
136
|
|
|
137
137
|
```
|
|
138
138
|
~/.pi/
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
139
|
+
+-- usage-status/ # /usage data
|
|
140
|
+
| +-- usage.jsonl
|
|
141
|
+
| +-- mirror.json # per-provider quota mirror
|
|
142
|
+
+-- harness/ # /harness data
|
|
143
|
+
| +-- jobs/
|
|
144
|
+
| +-- <job-id>/
|
|
145
|
+
| +-- checkpoint.json
|
|
146
|
+
| +-- events.jsonl
|
|
147
|
+
| +-- task-graph.json
|
|
148
|
+
| +-- blackboard/
|
|
149
|
+
| +-- repair-tasks.jsonl
|
|
150
|
+
+-- okf/ # (optional) Your custom OKF knowledge
|
|
151
151
|
```
|
|
152
152
|
|
|
153
153
|
## Custom OKF Knowledge (Optional)
|
|
@@ -156,9 +156,9 @@ Create `~/.pi/okf/` to add your custom knowledge that the runtime reads during c
|
|
|
156
156
|
|
|
157
157
|
```
|
|
158
158
|
~/.pi/okf/
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
159
|
+
+-- <skill-name>.md # Your custom skill/procedure
|
|
160
|
+
+-- <domain>.md # Domain-specific knowledge
|
|
161
|
+
+-- <project>.md # Project-specific rules
|
|
162
162
|
```
|
|
163
163
|
|
|
164
164
|
The runtime automatically detects and reads these files. If the folder doesn't exist, compilation proceeds without them.
|
|
@@ -221,7 +221,7 @@ MiniMax: cookies not found — drop any cookie file into
|
|
|
221
221
|
|
|
222
222
|
The runtime watches `~/.pi-harness-runtime/cookies/` for cookie files. Drop any cookie export there — it syncs within ~1 second:
|
|
223
223
|
|
|
224
|
-
1. **Install EditThisCookie** Chrome extension
|
|
224
|
+
1. **Install EditThisCookie** Chrome extension -> export from `platform.minimax.io`
|
|
225
225
|
2. **Create the drop folder:**
|
|
226
226
|
|
|
227
227
|
```bash
|
package/harness/auto-compact.ts
CHANGED
|
@@ -256,7 +256,7 @@ export class AutoCompactEngine {
|
|
|
256
256
|
return existsSync(join(this.rootDir, "continue_prompt.md"));
|
|
257
257
|
}
|
|
258
258
|
|
|
259
|
-
//
|
|
259
|
+
// --- Private Methods ------------------------------------------------
|
|
260
260
|
|
|
261
261
|
private ensureDir(): void {
|
|
262
262
|
if (!existsSync(this.rootDir)) {
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Autonomous Review Agent — polls for code.written events and auto-triggers review.
|
|
3
|
+
* Human on the loop, not in the loop.
|
|
4
|
+
*/
|
|
5
|
+
import { existsSync, readFileSync, writeFileSync } from "fs";
|
|
6
|
+
import { join } from "path";
|
|
7
|
+
import {
|
|
8
|
+
createHerdrBus,
|
|
9
|
+
ensureHerdrWorkspace,
|
|
10
|
+
publishReviewCompletedSimple,
|
|
11
|
+
publishReviewRequestedSimple,
|
|
12
|
+
} from "../packages/event-bus/src/herdr-bus.js";
|
|
13
|
+
|
|
14
|
+
const AGENT_ID = "review-agent";
|
|
15
|
+
const REVIEW_TIMEOUT_MS = 5 * 60 * 1000;
|
|
16
|
+
|
|
17
|
+
type CodeWrittenPayload = { taskId: string; files: string[]; branch?: string };
|
|
18
|
+
|
|
19
|
+
async function runReview(
|
|
20
|
+
bus: ReturnType<typeof createHerdrBus>,
|
|
21
|
+
codePayload: CodeWrittenPayload,
|
|
22
|
+
): Promise<void> {
|
|
23
|
+
const { taskId, files } = codePayload;
|
|
24
|
+
const reportFile = join(
|
|
25
|
+
ensureHerdrWorkspace().reviews,
|
|
26
|
+
`${taskId}-review.md`,
|
|
27
|
+
);
|
|
28
|
+
console.log(`[${AGENT_ID}] Reviewing task ${taskId}, ${files.length} files`);
|
|
29
|
+
|
|
30
|
+
try {
|
|
31
|
+
publishReviewRequestedSimple(bus, taskId, taskId);
|
|
32
|
+
|
|
33
|
+
const fileBlocks = await Promise.all(
|
|
34
|
+
files.map(async (file) => {
|
|
35
|
+
const content = existsSync(file)
|
|
36
|
+
? readFileSync(file, "utf-8").slice(0, 5000)
|
|
37
|
+
: `[Not found: ${file}]`;
|
|
38
|
+
return `## ${file}\n\n\`\`\`\n${content}\n\`\`\`\n`;
|
|
39
|
+
}),
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
const report = `# Code Review — Task ${taskId}
|
|
43
|
+
## Files: ${files.join(", ")}
|
|
44
|
+
|
|
45
|
+
> Auto-generated. GPT review tab fills this in.
|
|
46
|
+
|
|
47
|
+
${fileBlocks.join("\n")}
|
|
48
|
+
`;
|
|
49
|
+
writeFileSync(reportFile, report);
|
|
50
|
+
console.log(`[${AGENT_ID}] Report: ${reportFile}`);
|
|
51
|
+
publishReviewCompletedSimple(bus, taskId, reportFile, "changes_requested");
|
|
52
|
+
|
|
53
|
+
// Wait for GPT tab to update
|
|
54
|
+
await waitForGptReview(reportFile);
|
|
55
|
+
} catch (err) {
|
|
56
|
+
console.error(`[${AGENT_ID}] Review failed:`, err);
|
|
57
|
+
publishReviewCompletedSimple(bus, taskId, reportFile, "failed");
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async function waitForGptReview(reportFile: string): Promise<void> {
|
|
62
|
+
const deadline = Date.now() + REVIEW_TIMEOUT_MS;
|
|
63
|
+
while (Date.now() < deadline) {
|
|
64
|
+
if (existsSync(reportFile)) {
|
|
65
|
+
const content = readFileSync(reportFile, "utf-8");
|
|
66
|
+
if (!content.includes("Pending")) return;
|
|
67
|
+
}
|
|
68
|
+
await new Promise((r) => setTimeout(r, 5000));
|
|
69
|
+
}
|
|
70
|
+
console.log(`[${AGENT_ID}] GPT review timed out`);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
async function main(): Promise<void> {
|
|
74
|
+
console.log(`[${AGENT_ID}] Starting...`);
|
|
75
|
+
const bus = createHerdrBus(AGENT_ID);
|
|
76
|
+
ensureHerdrWorkspace();
|
|
77
|
+
bus.subscribe("code.written");
|
|
78
|
+
bus.startPolling(async (payload) => {
|
|
79
|
+
if (payload.topic === "code.written") {
|
|
80
|
+
const data = payload.data as CodeWrittenPayload;
|
|
81
|
+
if (data.files?.length) runReview(bus, data).catch(console.error);
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
console.log(`[${AGENT_ID}] Workspace: ${bus.getWorkspace()}`);
|
|
85
|
+
console.log(`[${AGENT_ID}] Polling for code.written...`);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
main().catch(console.error);
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Architecture:
|
|
8
8
|
* LoopRuntime.executeTask()
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
9
|
+
* +-> CompactOrchestrator.invokeWithCompact()
|
|
10
|
+
* +-> beforeInvoke():
|
|
11
|
+
* | 1. Estimate token count with buffer awareness
|
|
12
|
+
* | 2. Check circuit breaker status
|
|
13
|
+
* | 3. Microcompact: prune old tool results if time-based
|
|
14
|
+
* | 4. If over autoCompactThreshold → Full compact via forked summarization
|
|
15
|
+
* +-> afterInvoke():
|
|
16
16
|
* 1. Update token stats
|
|
17
17
|
* 2. Handle reactive 413 (context too long)
|
|
18
18
|
* 3. Generate continue prompt
|
|
@@ -38,12 +38,12 @@ import {
|
|
|
38
38
|
} from "./context-window-manager.js";
|
|
39
39
|
import { continuePromptGenerator } from "./continue-prompt.js";
|
|
40
40
|
|
|
41
|
-
//
|
|
41
|
+
// --- Re-exports ----------------------------------------------------------------
|
|
42
42
|
|
|
43
43
|
/** Re-export CompactTriggerReason so harness/index.ts can re-export from here */
|
|
44
44
|
export type { CompactTriggerReason } from "../packages/types/src/runtime-types.js";
|
|
45
45
|
|
|
46
|
-
//
|
|
46
|
+
// --- Callbacks ----------------------------------------------------------------
|
|
47
47
|
|
|
48
48
|
/** Callbacks provided by the harness to handle compact side-effects */
|
|
49
49
|
export interface CompactOrchestratorCallbacks {
|
|
@@ -74,7 +74,7 @@ export interface CompactOrchestratorCallbacks {
|
|
|
74
74
|
) => Promise<{ summary: string; droppedCount: number }>;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
//
|
|
77
|
+
// --- Config -------------------------------------------------------------------
|
|
78
78
|
|
|
79
79
|
export interface CompactOrchestratorConfig {
|
|
80
80
|
jobId: string;
|
|
@@ -96,7 +96,7 @@ export interface CompactOrchestratorConfig {
|
|
|
96
96
|
contextWindowSize?: number;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
//
|
|
99
|
+
// --- Orchestrator -------------------------------------------------------------
|
|
100
100
|
|
|
101
101
|
/**
|
|
102
102
|
* Compact Orchestrator
|
|
@@ -166,7 +166,7 @@ export class CompactOrchestrator {
|
|
|
166
166
|
const { messages, model, maxOutputTokens } = opts;
|
|
167
167
|
this.compactAttempts++;
|
|
168
168
|
|
|
169
|
-
//
|
|
169
|
+
// -- Estimate tokens with buffer awareness -----------------------------
|
|
170
170
|
const estimate = this.contextWindow.estimateTokensWithBuffer({
|
|
171
171
|
messages,
|
|
172
172
|
tools: opts.tools,
|
|
@@ -175,7 +175,7 @@ export class CompactOrchestrator {
|
|
|
175
175
|
model: model ?? this.model,
|
|
176
176
|
});
|
|
177
177
|
|
|
178
|
-
//
|
|
178
|
+
// -- Circuit breaker check ---------------------------------------------
|
|
179
179
|
if (this.contextWindow.shouldCircuitBreak()) {
|
|
180
180
|
return {
|
|
181
181
|
success: false,
|
|
@@ -183,7 +183,7 @@ export class CompactOrchestrator {
|
|
|
183
183
|
};
|
|
184
184
|
}
|
|
185
185
|
|
|
186
|
-
//
|
|
186
|
+
// -- Blocking: must compact before API call ---------------------------
|
|
187
187
|
if (this.contextWindow.shouldBlockApiCall(estimate)) {
|
|
188
188
|
callbacks.onPreCompact?.("token_threshold");
|
|
189
189
|
const compact = await this.runFullCompact(
|
|
@@ -206,10 +206,10 @@ export class CompactOrchestrator {
|
|
|
206
206
|
this.contextWindow.recordCompactSuccess();
|
|
207
207
|
}
|
|
208
208
|
|
|
209
|
-
//
|
|
209
|
+
// -- Time-based microcompact -----------------------------------------
|
|
210
210
|
this.tryMicrocompact(messages);
|
|
211
211
|
|
|
212
|
-
//
|
|
212
|
+
// -- Proactive auto-compact at 85% ----------------------------------
|
|
213
213
|
if (this.contextWindow.shouldProactiveCompact(estimate)) {
|
|
214
214
|
callbacks.onPreCompact?.("token_threshold");
|
|
215
215
|
const compact = await this.runFullCompact(
|
|
@@ -228,7 +228,7 @@ export class CompactOrchestrator {
|
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
230
|
|
|
231
|
-
//
|
|
231
|
+
// -- Make the LLM call -----------------------------------------------
|
|
232
232
|
const invoke = opts.invokeAgent ?? callbacks.invokeAgent;
|
|
233
233
|
if (!invoke) {
|
|
234
234
|
return {
|
|
@@ -242,7 +242,7 @@ export class CompactOrchestrator {
|
|
|
242
242
|
// Track tool results
|
|
243
243
|
this.trackToolResults(messages);
|
|
244
244
|
|
|
245
|
-
//
|
|
245
|
+
// -- Update stats -----------------------------------------------------
|
|
246
246
|
if (result.usage) {
|
|
247
247
|
this.contextWindow.updateStats({
|
|
248
248
|
provider: this.provider,
|
|
@@ -252,7 +252,7 @@ export class CompactOrchestrator {
|
|
|
252
252
|
});
|
|
253
253
|
}
|
|
254
254
|
|
|
255
|
-
//
|
|
255
|
+
// -- Reactive compact on context-too-long error ---------------------
|
|
256
256
|
const isContextError = this.isContextTooLongError(result.error);
|
|
257
257
|
|
|
258
258
|
if (isContextError) {
|
|
@@ -326,7 +326,7 @@ export class CompactOrchestrator {
|
|
|
326
326
|
return { success: false, error: "Nothing to compact" };
|
|
327
327
|
}
|
|
328
328
|
|
|
329
|
-
//
|
|
329
|
+
// -- Generate summary ------------------------------------------------
|
|
330
330
|
let summary = "";
|
|
331
331
|
let droppedCount = oldMessages.length;
|
|
332
332
|
|
|
@@ -345,7 +345,7 @@ export class CompactOrchestrator {
|
|
|
345
345
|
summary = this.heuristicSummary(oldMessages, reason);
|
|
346
346
|
}
|
|
347
347
|
|
|
348
|
-
//
|
|
348
|
+
// -- Build compact boundary message -----------------------------------
|
|
349
349
|
const boundaryMsg: CompactableMessage = {
|
|
350
350
|
role: "system",
|
|
351
351
|
content: continuePromptGenerator.generateBoundary({
|
|
@@ -361,7 +361,7 @@ export class CompactOrchestrator {
|
|
|
361
361
|
},
|
|
362
362
|
};
|
|
363
363
|
|
|
364
|
-
//
|
|
364
|
+
// -- Preserve tool results from recent messages -----------------------
|
|
365
365
|
const preservedRecent = recentMessages.map((msg) => {
|
|
366
366
|
if (msg.role !== "assistant" || !msg.toolResults) return msg;
|
|
367
367
|
return {
|
|
@@ -373,7 +373,7 @@ export class CompactOrchestrator {
|
|
|
373
373
|
};
|
|
374
374
|
});
|
|
375
375
|
|
|
376
|
-
//
|
|
376
|
+
// -- Rebuild message array -------------------------------------------
|
|
377
377
|
messages.length = 0;
|
|
378
378
|
messages.push(boundaryMsg, ...preservedRecent);
|
|
379
379
|
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
roughMessagesTokens,
|
|
23
23
|
} from "../packages/token-estimation/src/index.ts";
|
|
24
24
|
|
|
25
|
-
//
|
|
25
|
+
// --- Constants ----------------------------------------------------------------
|
|
26
26
|
|
|
27
27
|
/** Proactive compact triggers at this many tokens before limit */
|
|
28
28
|
export const AUTOCOMPACT_BUFFER_TOKENS = 13_000;
|
|
@@ -36,7 +36,7 @@ export const BLOCKING_THRESHOLD_BUFFER_TOKENS = 20_000;
|
|
|
36
36
|
/** Maximum consecutive compact failures before circuit breaker */
|
|
37
37
|
export const MAX_CONSECUTIVE_COMPACT_FAILURES = 3;
|
|
38
38
|
|
|
39
|
-
//
|
|
39
|
+
// --- Types ------------------------------------------------------------------
|
|
40
40
|
|
|
41
41
|
export interface CompactThresholds {
|
|
42
42
|
/** Trigger proactive compact at this utilization (0.85) */
|
|
@@ -60,7 +60,7 @@ export interface TokenEstimate {
|
|
|
60
60
|
shouldBlock: boolean;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
//
|
|
63
|
+
// --- Context Window Manager -------------------------------------------------
|
|
64
64
|
|
|
65
65
|
export class ContextWindowManager {
|
|
66
66
|
private stats: Map<string, ContextWindowStats> = new Map();
|
|
@@ -95,7 +95,7 @@ export class ContextWindowManager {
|
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
//
|
|
98
|
+
// --- Public API -----------------------------------------------------------
|
|
99
99
|
|
|
100
100
|
/**
|
|
101
101
|
* Update context window stats after a request
|
|
@@ -399,7 +399,7 @@ export class ContextWindowManager {
|
|
|
399
399
|
}
|
|
400
400
|
}
|
|
401
401
|
|
|
402
|
-
//
|
|
402
|
+
// --- Microcompact Helpers ---------------------------------------------------
|
|
403
403
|
|
|
404
404
|
/**
|
|
405
405
|
* Microcompact: prune old tool results based on time gap.
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import type { CompactableMessage } from "../packages/types/src/runtime-types.js";
|
|
9
9
|
|
|
10
|
-
//
|
|
10
|
+
// --- Types ------------------------------------------------------------------
|
|
11
11
|
|
|
12
12
|
export interface ContinueContext {
|
|
13
13
|
/** Task identifier */
|
|
@@ -35,7 +35,7 @@ export interface MinimalContinueContext {
|
|
|
35
35
|
recentMessages: CompactableMessage[];
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
//
|
|
38
|
+
// --- Continue Prompt Generator -----------------------------------------------
|
|
39
39
|
|
|
40
40
|
export class ContinuePromptGenerator {
|
|
41
41
|
/**
|
|
@@ -237,6 +237,6 @@ export class ContinuePromptGenerator {
|
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
|
|
240
|
-
//
|
|
240
|
+
// --- Singleton Instance ------------------------------------------------------
|
|
241
241
|
|
|
242
242
|
export const continuePromptGenerator = new ContinuePromptGenerator();
|
|
@@ -555,7 +555,7 @@ MiniMax Quota Scraper Setup Instructions
|
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
557
|
|
|
558
|
-
//
|
|
558
|
+
// --- Quota Manager Integration -----------------------------------------------
|
|
559
559
|
|
|
560
560
|
/**
|
|
561
561
|
* Quota Manager that periodically fetches MiniMax quota data
|
|
@@ -12,7 +12,7 @@ import type {
|
|
|
12
12
|
InvokeResult,
|
|
13
13
|
} from "../packages/types/src/runtime-types.js";
|
|
14
14
|
|
|
15
|
-
//
|
|
15
|
+
// --- Types ------------------------------------------------------------------
|
|
16
16
|
|
|
17
17
|
export interface SummarizerConfig {
|
|
18
18
|
/** Model to use for summarization */
|
|
@@ -43,7 +43,7 @@ export interface InvokeOptions {
|
|
|
43
43
|
systemPrompt?: string;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
//
|
|
46
|
+
// --- Default System Prompt ---------------------------------------------------
|
|
47
47
|
|
|
48
48
|
const DEFAULT_SUMMARY_SYSTEM = `You are a conversation summarizer. Your task is to create concise, accurate summaries that preserve essential context for continuing a conversation.
|
|
49
49
|
|
|
@@ -70,7 +70,7 @@ const DECISIONS_FOCUS = `Focus specifically on:
|
|
|
70
70
|
4. What constraints or requirements influenced the decisions?
|
|
71
71
|
5. Any lessons learned or trade-offs considered?`;
|
|
72
72
|
|
|
73
|
-
//
|
|
73
|
+
// --- Forked Summarizer ------------------------------------------------------
|
|
74
74
|
|
|
75
75
|
export class ForkedSummarizer {
|
|
76
76
|
private readonly config: SummarizerConfig;
|
|
@@ -283,7 +283,7 @@ Do not include verbatim tool results — summarize their outcomes instead.`;
|
|
|
283
283
|
}
|
|
284
284
|
}
|
|
285
285
|
|
|
286
|
-
//
|
|
286
|
+
// --- Convenience Factory ----------------------------------------------------
|
|
287
287
|
|
|
288
288
|
/**
|
|
289
289
|
* Create a ForkedSummarizer with default config
|