pi-harness-runtime 0.9.22 → 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 +49 -7
- package/README.md +51 -51
- package/footer-status.ts +84 -44
- package/harness/auto-compact.ts +1 -1
- package/harness/auto-quota-resume.ts +15 -12
- 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 +10 -10
- package/harness/e2e/openai-quota-scraper.ts +442 -0
- 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 +21 -17
- 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 +211 -80
- package/package.json +2 -2
- package/packages/a2a-adapter/package.json +1 -1
- package/packages/a2a-adapter/src/types.ts +5 -5
- package/packages/auth/dist/minimax-browser-auth.d.ts +89 -0
- package/packages/auth/dist/minimax-browser-auth.d.ts.map +1 -0
- package/packages/auth/dist/minimax-browser-auth.js +890 -0
- package/packages/auth/dist/minimax-browser-auth.js.map +1 -0
- package/packages/auth/dist/run-minimax-auth.d.ts +19 -0
- package/packages/auth/dist/run-minimax-auth.d.ts.map +1 -0
- package/packages/auth/dist/run-minimax-auth.js +112 -0
- package/packages/auth/dist/run-minimax-auth.js.map +1 -0
- package/packages/auth/package.json +1 -1
- package/packages/auth/tsconfig.json +9 -0
- 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/dist/provider-id.d.ts +5 -0
- package/packages/providers/dist/provider-id.d.ts.map +1 -1
- package/packages/providers/dist/provider-id.js +6 -1
- package/packages/providers/dist/provider-id.js.map +1 -1
- package/packages/providers/package.json +1 -1
- package/packages/providers/src/deepagents-adapter.ts +1 -1
- package/packages/providers/src/provider-id.ts +6 -1
- package/packages/quota-manager/dist/tui-usage-monitor.d.ts.map +1 -1
- package/packages/quota-manager/dist/tui-usage-monitor.js +0 -6
- package/packages/quota-manager/dist/tui-usage-monitor.js.map +1 -1
- package/packages/quota-manager/package.json +1 -1
- package/packages/quota-manager/src/tui-usage-monitor.ts +0 -21
- 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/packages/dependency-analyzer/dist/analyzer.d.ts +0 -17
- package/packages/dependency-analyzer/dist/analyzer.d.ts.map +0 -1
- package/packages/dependency-analyzer/dist/analyzer.js +0 -106
- package/packages/dependency-analyzer/dist/analyzer.js.map +0 -1
- package/packages/dependency-analyzer/dist/imports.d.ts +0 -12
- package/packages/dependency-analyzer/dist/imports.d.ts.map +0 -1
- package/packages/dependency-analyzer/dist/imports.js +0 -73
- package/packages/dependency-analyzer/dist/imports.js.map +0 -1
- package/packages/dependency-analyzer/dist/index.d.ts +0 -4
- package/packages/dependency-analyzer/dist/index.d.ts.map +0 -1
- package/packages/dependency-analyzer/dist/index.js +0 -3
- package/packages/dependency-analyzer/dist/index.js.map +0 -1
- package/packages/dependency-analyzer/dist/test/analyzer.test.js +0 -37
- package/packages/dependency-analyzer/dist/types.d.ts +0 -28
- package/packages/dependency-analyzer/dist/types.d.ts.map +0 -1
- package/packages/dependency-analyzer/dist/types.js +0 -5
- package/packages/dependency-analyzer/dist/types.js.map +0 -1
- package/packages/intent-analyzer/dist/analyzer.d.ts +0 -13
- package/packages/intent-analyzer/dist/analyzer.d.ts.map +0 -1
- package/packages/intent-analyzer/dist/analyzer.js +0 -72
- package/packages/intent-analyzer/dist/analyzer.js.map +0 -1
- package/packages/intent-analyzer/dist/index.d.ts +0 -3
- package/packages/intent-analyzer/dist/index.d.ts.map +0 -1
- package/packages/intent-analyzer/dist/index.js +0 -2
- package/packages/intent-analyzer/dist/index.js.map +0 -1
- package/packages/intent-analyzer/dist/test/analyzer.test.js +0 -56
- package/packages/intent-analyzer/dist/types.d.ts +0 -26
- package/packages/intent-analyzer/dist/types.d.ts.map +0 -1
- package/packages/intent-analyzer/dist/types.js +0 -7
- package/packages/intent-analyzer/dist/types.js.map +0 -1
- package/packages/workspace-scanner/dist/detect.d.ts +0 -3
- package/packages/workspace-scanner/dist/detect.d.ts.map +0 -1
- package/packages/workspace-scanner/dist/detect.js +0 -58
- package/packages/workspace-scanner/dist/detect.js.map +0 -1
- package/packages/workspace-scanner/dist/git.d.ts +0 -7
- package/packages/workspace-scanner/dist/git.d.ts.map +0 -1
- package/packages/workspace-scanner/dist/git.js +0 -75
- package/packages/workspace-scanner/dist/git.js.map +0 -1
- package/packages/workspace-scanner/dist/index.d.ts +0 -5
- package/packages/workspace-scanner/dist/index.d.ts.map +0 -1
- package/packages/workspace-scanner/dist/index.js +0 -4
- package/packages/workspace-scanner/dist/index.js.map +0 -1
- package/packages/workspace-scanner/dist/scanner.d.ts +0 -11
- package/packages/workspace-scanner/dist/scanner.d.ts.map +0 -1
- package/packages/workspace-scanner/dist/scanner.js +0 -46
- package/packages/workspace-scanner/dist/scanner.js.map +0 -1
- package/packages/workspace-scanner/dist/test/scanner.test.js +0 -34
- package/packages/workspace-scanner/dist/types.d.ts +0 -35
- package/packages/workspace-scanner/dist/types.d.ts.map +0 -1
- package/packages/workspace-scanner/dist/types.js +0 -5
- package/packages/workspace-scanner/dist/types.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,48 @@
|
|
|
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
|
+
|
|
25
|
+
### [0.9.25](https://github.com/ManotLuijiu/pi-harness-runtime/compare/v0.9.21...v0.9.25) (2026-07-27)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Bug Fixes
|
|
29
|
+
|
|
30
|
+
* **ci:** explicitly list test files to exclude cookie auth tests in release workflow ([1c96002](https://github.com/ManotLuijiu/pi-harness-runtime/commit/1c9600232282a1ef9323300fbd763c962aff49f6))
|
|
31
|
+
* **ci:** skip browser auth tests in release workflow ([6117ed5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/6117ed5af11357c6f12d11f4cd8d3441de519043))
|
|
32
|
+
* **ci:** skip tests in release workflow ([8357ecd](https://github.com/ManotLuijiu/pi-harness-runtime/commit/8357ecd0b7d9c0c6ef81680902ca731da59a37c4))
|
|
33
|
+
* **e2e:** add OpenAIUsageResponse type to fix rate_limit TS error ([2ed0891](https://github.com/ManotLuijiu/pi-harness-runtime/commit/2ed08911410ec07815d828028db1a6c9eaf2df2c))
|
|
34
|
+
* **release:** add --workspaces=false to npm publish so only pi-harness-runtime is published ([31e715d](https://github.com/ManotLuijiu/pi-harness-runtime/commit/31e715d97e7fce5b82b503a95b86037d757db906))
|
|
35
|
+
|
|
36
|
+
### [0.9.24](https://github.com/ManotLuijiu/pi-harness-runtime/compare/v0.9.21...v0.9.24) (2026-07-27)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
### Bug Fixes
|
|
40
|
+
|
|
41
|
+
* **ci:** skip browser auth tests in release workflow ([6117ed5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/6117ed5af11357c6f12d11f4cd8d3441de519043))
|
|
42
|
+
* **e2e:** add OpenAIUsageResponse type to fix rate_limit TS error ([2ed0891](https://github.com/ManotLuijiu/pi-harness-runtime/commit/2ed08911410ec07815d828028db1a6c9eaf2df2c))
|
|
43
|
+
* **release:** add --workspaces=false to npm publish so only pi-harness-runtime is published ([31e715d](https://github.com/ManotLuijiu/pi-harness-runtime/commit/31e715d97e7fce5b82b503a95b86037d757db906))
|
|
44
|
+
|
|
45
|
+
### [0.9.23](https://github.com/ManotLuijiu/pi-harness-runtime/compare/v0.9.21...v0.9.23) (2026-07-27)
|
|
46
|
+
|
|
5
47
|
### [0.9.22](https://github.com/ManotLuijiu/pi-harness-runtime/compare/v0.9.21...v0.9.22) (2026-07-27)
|
|
6
48
|
|
|
7
49
|
### [0.9.11](https://github.com/ManotLuijiu/pi-harness-runtime/compare/v0.9.8...v0.9.11) (2026-07-23)
|
|
@@ -95,7 +137,7 @@ All notable changes to this project will be documented in this file. See [standa
|
|
|
95
137
|
### Bug Fixes
|
|
96
138
|
|
|
97
139
|
* publish missing runtime modules ([3fc7058](https://github.com/ManotLuijiu/pi-harness-runtime/commit/3fc70586d0cd10f4d38eab67e4cadaec20aaeb56))
|
|
98
|
-
* **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))
|
|
99
141
|
|
|
100
142
|
## [0.9.0](https://github.com/ManotLuijiu/pi-harness-runtime/compare/v0.7.1...v0.9.0) (2026-07-13)
|
|
101
143
|
|
|
@@ -105,7 +147,7 @@ All notable changes to this project will be documented in this file. See [standa
|
|
|
105
147
|
|
|
106
148
|
### Bug Fixes
|
|
107
149
|
|
|
108
|
-
* **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))
|
|
109
151
|
|
|
110
152
|
### [0.7.1](https://github.com/ManotLuijiu/pi-harness-runtime/compare/v0.6.3...v0.7.1) (2026-07-13)
|
|
111
153
|
|
|
@@ -136,11 +178,11 @@ All notable changes to this project will be documented in this file. See [standa
|
|
|
136
178
|
|
|
137
179
|
### Changed
|
|
138
180
|
|
|
139
|
-
* **Project rename**: `pi-usage-status`
|
|
140
|
-
* npm package name: `pi-usage-status`
|
|
141
|
-
* Repository: `ManotLuijiu/pi-usage-status`
|
|
142
|
-
* Bundled skill: `usage-status`
|
|
143
|
-
* 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`
|
|
144
186
|
* **Data directory unchanged**: still `~/.pi/usage-status/` (preserves existing user data)
|
|
145
187
|
* **Env var unchanged**: still `PI_USAGE_DIR` (preserves existing user configs)
|
|
146
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/footer-status.ts
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import type { MirrorRecord, ProviderMirrorRecord } from "./mirror.ts";
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
import {
|
|
4
4
|
parseContextWindowStatusLine,
|
|
5
5
|
parseQuotaUsageStatusLine,
|
|
6
6
|
type ParsedContextWindowUsage,
|
|
7
7
|
type ParsedQuotaUsageData,
|
|
8
8
|
} from "./status-parsers.ts";
|
|
9
|
+
import { getProviderLabel } from "./packages/types/src/ai-providers.js";
|
|
10
|
+
import {
|
|
11
|
+
providerHasContinuousScrape,
|
|
12
|
+
providerHasTUISignal,
|
|
13
|
+
} from "./packages/providers/src/provider-id.js";
|
|
9
14
|
|
|
10
15
|
export type ParsedFooterStatusValue =
|
|
11
16
|
| { kind: "quota"; value: ParsedQuotaUsageData }
|
|
@@ -39,46 +44,52 @@ export function parseFooterStatusValue(value: string): ParsedFooterStatusValue {
|
|
|
39
44
|
return { kind: "unknown", value: null };
|
|
40
45
|
}
|
|
41
46
|
|
|
42
|
-
/**
|
|
47
|
+
/**
|
|
48
|
+
* Get display label for a provider id.
|
|
49
|
+
* Uses the canonical getProviderLabel() from packages/types/src/ai-providers.ts
|
|
50
|
+
* which handles all 9 known providers: minimax, openai, anthropic, glm,
|
|
51
|
+
* openrouter, openai-codex, deepseek, gemini, kimi.
|
|
52
|
+
*/
|
|
43
53
|
function providerDisplayName(provider: string | null | undefined): string {
|
|
44
54
|
if (!provider) return "Provider";
|
|
45
|
-
|
|
46
|
-
case "minimax":
|
|
47
|
-
return "MiniMax";
|
|
48
|
-
case "openai":
|
|
49
|
-
return "OpenAI";
|
|
50
|
-
case "openai-codex":
|
|
51
|
-
return "OpenAI Codex";
|
|
52
|
-
case "glm":
|
|
53
|
-
return "GLM";
|
|
54
|
-
case "anthropic":
|
|
55
|
-
return "Anthropic";
|
|
56
|
-
case "openrouter":
|
|
57
|
-
return "OpenRouter";
|
|
58
|
-
default:
|
|
59
|
-
return provider;
|
|
60
|
-
}
|
|
55
|
+
return getProviderLabel(provider);
|
|
61
56
|
}
|
|
62
57
|
|
|
63
|
-
/**
|
|
58
|
+
/**
|
|
59
|
+
* Hint shown when the provider has no usage data yet.
|
|
60
|
+
* Covers all 9 known providers from KNOWN_AI_PROVIDERS.
|
|
61
|
+
*/
|
|
64
62
|
function missingDataHint(
|
|
65
63
|
provider: string | null | undefined,
|
|
66
64
|
hasCookieSource: boolean,
|
|
67
65
|
): string {
|
|
66
|
+
if (!provider) return "no usage source configured";
|
|
67
|
+
|
|
68
|
+
// MiniMax: needs cookies for continuous scrape
|
|
68
69
|
if (provider === "minimax") {
|
|
69
|
-
return
|
|
70
|
+
return hasCookieSource
|
|
71
|
+
? "no data yet (updates after first scrape)"
|
|
72
|
+
: "drop minimax cookies into ~/.pi-harness-runtime/cookies/";
|
|
70
73
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
if (
|
|
75
|
-
provider === "openai" ||
|
|
76
|
-
provider === "glm" ||
|
|
77
|
-
provider === "anthropic" ||
|
|
78
|
-
provider === "openrouter"
|
|
79
|
-
) {
|
|
74
|
+
|
|
75
|
+
// TUI signal providers: one-shot signal on limit hit
|
|
76
|
+
if (providerHasTUISignal(provider)) {
|
|
80
77
|
return "no signal yet (updates on first limit hit)";
|
|
81
78
|
}
|
|
79
|
+
|
|
80
|
+
// Providers without any tracking implementation yet
|
|
81
|
+
// deepseek, gemini, kimi, or any unknown provider
|
|
82
|
+
if (provider === "deepseek") {
|
|
83
|
+
return "deepseek usage tracking not yet implemented";
|
|
84
|
+
}
|
|
85
|
+
if (provider === "gemini") {
|
|
86
|
+
return "gemini usage tracking not yet implemented";
|
|
87
|
+
}
|
|
88
|
+
if (provider === "kimi") {
|
|
89
|
+
return "kimi usage tracking not yet implemented";
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Generic fallback for any other unknown provider
|
|
82
93
|
if (!hasCookieSource) return "no usage source configured";
|
|
83
94
|
return "no data yet";
|
|
84
95
|
}
|
|
@@ -114,33 +125,62 @@ export function buildFooterStatusValue(
|
|
|
114
125
|
const provider = activeProvider ?? view?.provider ?? null;
|
|
115
126
|
const label = providerDisplayName(provider);
|
|
116
127
|
|
|
117
|
-
//
|
|
128
|
+
// TUI-signal exhaustion path: fires when limit is hit (one-shot signal).
|
|
129
|
+
// This takes priority over continuous data to show the most recent state.
|
|
118
130
|
if (
|
|
131
|
+
provider &&
|
|
132
|
+
view &&
|
|
133
|
+
view.exhausted &&
|
|
134
|
+
(view.limitType !== undefined ||
|
|
135
|
+
view.resets_at !== undefined ||
|
|
136
|
+
view.h5_resets_at !== undefined)
|
|
137
|
+
) {
|
|
138
|
+
const reset = view.resets_at ?? view.h5_resets_at ?? "soon";
|
|
139
|
+
const limitType = view.limitType ?? "tokens";
|
|
140
|
+
return `${label}: limit hit (${limitType}), reset ${reset}`;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// Continuous data path: providers with continuous scrape (MiniMax has 5h+weekly, OpenAI has weekly-only)
|
|
144
|
+
if (
|
|
145
|
+
provider &&
|
|
146
|
+
providerHasContinuousScrape(provider) &&
|
|
119
147
|
view &&
|
|
120
148
|
freshness !== "expired" &&
|
|
121
149
|
(view.h5_used_pct !== undefined || view.weekly_used_pct !== undefined)
|
|
122
150
|
) {
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
151
|
+
const weeklyPct = view.weekly_used_pct ?? 0;
|
|
152
|
+
const weeklyLeft = Math.max(0, 100 - weeklyPct);
|
|
153
|
+
const weeklyResets = view.weekly_resets_at ?? "soon";
|
|
154
|
+
|
|
155
|
+
let statusLine: string;
|
|
156
|
+
if (view.h5_used_pct !== undefined) {
|
|
157
|
+
// MiniMax: has both 5h and weekly windows
|
|
158
|
+
const h5Pct = view.h5_used_pct;
|
|
159
|
+
const h5Left = Math.max(0, 100 - h5Pct);
|
|
160
|
+
statusLine = `5h: ${h5Left.toFixed(0)}% left · week: ${weeklyLeft.toFixed(0)}% left`;
|
|
161
|
+
} else {
|
|
162
|
+
// OpenAI: weekly-only (no 5h window)
|
|
163
|
+
statusLine = `week: ${weeklyLeft.toFixed(0)}% left (resets ${weeklyResets})`;
|
|
164
|
+
}
|
|
165
|
+
|
|
131
166
|
const freshnessSuffix =
|
|
132
167
|
freshness === "fresh" || freshness === "missing" ? "" : ` · ${freshness}`;
|
|
133
|
-
return `${label}: ${
|
|
168
|
+
return `${label}: ${statusLine}${freshnessSuffix}`;
|
|
134
169
|
}
|
|
135
170
|
|
|
136
|
-
// TUI
|
|
171
|
+
// TUI signal providers (OpenAI, Anthropic, GLM, OpenRouter):
|
|
172
|
+
// Show monitoring status when we have a record but haven't hit limits.
|
|
173
|
+
// These providers only emit data when a limit is hit.
|
|
137
174
|
if (
|
|
175
|
+
provider &&
|
|
176
|
+
providerHasTUISignal(provider) &&
|
|
138
177
|
view &&
|
|
139
|
-
|
|
140
|
-
(view.limitType !== undefined || view.resets_at !== undefined)
|
|
178
|
+
freshness !== "expired"
|
|
141
179
|
) {
|
|
142
|
-
|
|
143
|
-
|
|
180
|
+
// If exhausted is not set, we're monitoring normally
|
|
181
|
+
if (!view.exhausted) {
|
|
182
|
+
return `${label}: monitoring (no limits hit)`;
|
|
183
|
+
}
|
|
144
184
|
}
|
|
145
185
|
|
|
146
186
|
// Discoverable hint when we have no data yet.
|
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)) {
|
|
@@ -58,17 +58,20 @@ export function scheduleAutoResume(
|
|
|
58
58
|
|
|
59
59
|
const resetEpoch = record.h5_resets_at_epoch;
|
|
60
60
|
const now = Date.now();
|
|
61
|
-
const delayMs = Math.max(
|
|
61
|
+
const delayMs = Math.max(
|
|
62
|
+
resetEpoch - now - RESUME_BUFFER_MS,
|
|
63
|
+
MIN_RESUME_DELAY_MS,
|
|
64
|
+
);
|
|
62
65
|
const resumeAt = now + delayMs;
|
|
63
66
|
const resumeAtIso = new Date(resumeAt).toISOString();
|
|
64
67
|
|
|
65
68
|
// Persist to checkpoint so resumeAt survives worker restart
|
|
66
69
|
machine.setResumeTime(resumeAtIso);
|
|
67
70
|
|
|
68
|
-
console.log(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
);
|
|
71
|
+
// console.log(
|
|
72
|
+
// `[auto-quota-resume] ${provider} 5h quota exhausted.` +
|
|
73
|
+
// ` Auto-resume scheduled at ${resumeAtIso} (in ${Math.round(delayMs / 1000)}s)`,
|
|
74
|
+
// );
|
|
72
75
|
|
|
73
76
|
const timeout = setTimeout(async () => {
|
|
74
77
|
activeTimers.delete(jobId);
|
|
@@ -84,10 +87,10 @@ export function scheduleAutoResume(
|
|
|
84
87
|
if (updated?.h5_resets_at_epoch) {
|
|
85
88
|
const stillExhausted = Date.now() < updated.h5_resets_at_epoch;
|
|
86
89
|
if (stillExhausted) {
|
|
87
|
-
console.log(
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
);
|
|
90
|
+
// console.log(
|
|
91
|
+
// `[auto-quota-resume] ${provider} still exhausted at scheduled time.` +
|
|
92
|
+
// ` Re-scheduling...`,
|
|
93
|
+
// );
|
|
91
94
|
scheduleAutoResume(provider, machine, mirrorStore);
|
|
92
95
|
return;
|
|
93
96
|
}
|
|
@@ -95,9 +98,9 @@ export function scheduleAutoResume(
|
|
|
95
98
|
|
|
96
99
|
const result = await machine.transition("running");
|
|
97
100
|
if (result.success) {
|
|
98
|
-
console.log(
|
|
99
|
-
|
|
100
|
-
);
|
|
101
|
+
// console.log(
|
|
102
|
+
// `[auto-quota-resume] Job ${jobId} auto-resumed after ${provider} 5h quota reset.`,
|
|
103
|
+
// );
|
|
101
104
|
} else {
|
|
102
105
|
console.error(
|
|
103
106
|
`[auto-quota-resume] Auto-resume failed for ${jobId}: ${result.error}`,
|
|
@@ -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);
|