pi-harness-runtime 1.1.95 → 1.1.97
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 +33 -0
- package/harness/loop-runtime.ts +3 -0
- package/index.ts +130 -29
- package/package.json +2 -1
- package/packages/a2a-adapter/package.json +1 -1
- package/packages/architecture-generator/package.json +1 -1
- package/packages/auth/package.json +1 -1
- package/packages/autonomous-refactor/package.json +1 -1
- package/packages/autonomous-runtime/package.json +1 -1
- package/packages/cache-strategy/package.json +1 -1
- package/packages/capability-registry/package.json +1 -1
- package/packages/checkpoint/package.json +1 -1
- package/packages/cli-plugin-sdk/package.json +1 -1
- package/packages/clipboard/package.json +1 -1
- package/packages/clipboard-plugin/package.json +1 -1
- package/packages/code-generation/package.json +1 -1
- package/packages/code-review/package.json +1 -1
- package/packages/codex-adapter/package.json +1 -1
- package/packages/config-capture/package.json +1 -1
- package/packages/context-compiler/package.json +1 -1
- package/packages/context-discovery/package.json +1 -1
- package/packages/context-manager/package.json +1 -1
- package/packages/cookie-sanitizer/package.json +1 -1
- package/packages/cost-optimizer/package.json +1 -1
- package/packages/dependency-analyzer/package.json +1 -1
- package/packages/django-plugin/package.json +1 -1
- package/packages/doc-generator/package.json +1 -1
- package/packages/evaluation-engine/package.json +1 -1
- package/packages/evaluation-runner/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/feedback-collector/package.json +1 -1
- package/packages/file-copy-helper/package.json +1 -1
- package/packages/framework-detector/package.json +1 -1
- package/packages/framework-plugin-sdk/package.json +1 -1
- package/packages/frappe-plugin/package.json +1 -1
- package/packages/generic-web-plugin/package.json +1 -1
- package/packages/health-monitor/package.json +1 -1
- package/packages/intent-analyzer/package.json +1 -1
- package/packages/jev-judge/package.json +1 -1
- package/packages/knowledge-graph/package.json +1 -1
- package/packages/knowledge-retrieval/package.json +1 -1
- package/packages/laravel-plugin/package.json +1 -1
- package/packages/learning-engine/package.json +1 -1
- package/packages/mcp-adapter/package.json +1 -1
- package/packages/memory-engine/package.json +1 -1
- package/packages/milestone-manager/package.json +1 -1
- package/packages/model-registry/package.json +1 -1
- package/packages/nextjs-plugin/package.json +1 -1
- package/packages/notification/package.json +1 -1
- package/packages/observability/package.json +1 -1
- package/packages/okf-indexer/package.json +1 -1
- package/packages/performance-optimizer/package.json +1 -1
- package/packages/privilege-broker/package.json +1 -1
- package/packages/project-analyzer/package.json +1 -1
- package/packages/project-bootstrap/package.json +1 -1
- package/packages/projection-engine/package.json +1 -1
- package/packages/prompt-compiler/package.json +1 -1
- package/packages/prompt-versioning/package.json +1 -1
- package/packages/provider-adapter-sdk/package.json +1 -1
- package/packages/provider-router/package.json +1 -1
- package/packages/provider-selector/package.json +1 -1
- package/packages/providers/package.json +1 -1
- package/packages/qdrant-skills/dist/client.d.ts +51 -0
- package/packages/qdrant-skills/dist/client.d.ts.map +1 -0
- package/packages/qdrant-skills/dist/client.js +105 -0
- package/packages/qdrant-skills/dist/client.js.map +1 -0
- package/packages/qdrant-skills/dist/embedder.d.ts +39 -0
- package/packages/qdrant-skills/dist/embedder.d.ts.map +1 -0
- package/packages/qdrant-skills/dist/embedder.js +101 -0
- package/packages/qdrant-skills/dist/embedder.js.map +1 -0
- package/packages/qdrant-skills/dist/index.d.ts +25 -0
- package/packages/qdrant-skills/dist/index.d.ts.map +1 -0
- package/packages/qdrant-skills/dist/index.js +25 -0
- package/packages/qdrant-skills/dist/index.js.map +1 -0
- package/packages/qdrant-skills/package.json +27 -0
- package/packages/qdrant-skills/src/client.ts +178 -0
- package/packages/qdrant-skills/src/embedder.ts +137 -0
- package/packages/qdrant-skills/src/index.ts +42 -0
- package/packages/quota-manager/package.json +1 -1
- package/packages/rate-limiter/package.json +1 -1
- package/packages/react-vite-plugin/package.json +1 -1
- package/packages/release-manager/package.json +1 -1
- package/packages/requirement-compiler/package.json +1 -1
- package/packages/runtime/package.json +1 -1
- package/packages/scheduler/package.json +1 -1
- package/packages/scheduler-adapter/package.json +1 -1
- package/packages/session/package.json +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-mcp-client/package.json +1 -1
- package/packages/skill-registry/package.json +1 -1
- package/packages/skills/dist/index.d.ts +40 -0
- package/packages/skills/dist/index.d.ts.map +1 -0
- package/packages/skills/dist/index.js +84 -0
- package/packages/skills/dist/index.js.map +1 -0
- package/packages/skills/dist/linter.d.ts +38 -0
- package/packages/skills/dist/linter.d.ts.map +1 -0
- package/packages/skills/dist/linter.js +323 -0
- package/packages/skills/dist/linter.js.map +1 -0
- package/packages/skills/dist/loader.d.ts +74 -0
- package/packages/skills/dist/loader.d.ts.map +1 -0
- package/packages/skills/dist/loader.js +280 -0
- package/packages/skills/dist/loader.js.map +1 -0
- package/packages/skills/dist/parser.d.ts +32 -0
- package/packages/skills/dist/parser.d.ts.map +1 -0
- package/packages/skills/dist/parser.js +459 -0
- package/packages/skills/dist/parser.js.map +1 -0
- package/packages/skills/dist/scanner.d.ts +33 -0
- package/packages/skills/dist/scanner.d.ts.map +1 -0
- package/packages/skills/dist/scanner.js +257 -0
- package/packages/skills/dist/scanner.js.map +1 -0
- package/packages/skills/dist/skill-commands.d.ts +33 -0
- package/packages/skills/dist/skill-commands.d.ts.map +1 -0
- package/packages/skills/dist/skill-commands.js +239 -0
- package/packages/skills/dist/skill-commands.js.map +1 -0
- package/packages/skills/dist/skill-tool.d.ts +120 -0
- package/packages/skills/dist/skill-tool.d.ts.map +1 -0
- package/packages/skills/dist/skill-tool.js +239 -0
- package/packages/skills/dist/skill-tool.js.map +1 -0
- package/packages/skills/dist/skill-versioning.d.ts +123 -0
- package/packages/skills/dist/skill-versioning.d.ts.map +1 -0
- package/packages/skills/dist/skill-versioning.js +240 -0
- package/packages/skills/dist/skill-versioning.js.map +1 -0
- package/packages/skills/dist/types.d.ts +226 -0
- package/packages/skills/dist/types.d.ts.map +1 -0
- package/packages/skills/dist/types.js +21 -0
- package/packages/skills/dist/types.js.map +1 -0
- package/packages/skills/package.json +46 -0
- package/packages/skills/src/index.ts +95 -0
- package/packages/skills/src/linter.ts +371 -0
- package/packages/skills/src/loader.ts +335 -0
- package/packages/skills/src/parser.ts +548 -0
- package/packages/skills/src/scanner.ts +322 -0
- package/packages/skills/src/skill-commands.ts +318 -0
- package/packages/skills/src/skill-tool.ts +324 -0
- package/packages/skills/src/skill-versioning.ts +345 -0
- package/packages/skills/src/types.ts +259 -0
- package/packages/skills/test/init-skills.test.ts +118 -0
- package/packages/sprint-planner/package.json +1 -1
- package/packages/subscription-engine/package.json +1 -1
- package/packages/task-compiler/package.json +1 -1
- package/packages/tencentdb-memory/package.json +1 -1
- package/packages/tencentdb-sync/package.json +1 -1
- package/packages/test-data-generator/package.json +1 -1
- package/packages/test-generator/package.json +1 -1
- package/packages/todo-bd-sync/package.json +1 -1
- package/packages/token-estimation/package.json +1 -1
- package/packages/token-optimizer/package.json +1 -1
- package/packages/trajectory/dist/src/curator.d.ts +189 -0
- package/packages/trajectory/dist/src/curator.d.ts.map +1 -0
- package/packages/trajectory/dist/src/curator.js +340 -0
- package/packages/trajectory/dist/src/curator.js.map +1 -0
- package/packages/trajectory/dist/src/journey-renderer.d.ts +53 -0
- package/packages/trajectory/dist/src/journey-renderer.d.ts.map +1 -0
- package/packages/trajectory/dist/src/journey-renderer.js +324 -0
- package/packages/trajectory/dist/src/journey-renderer.js.map +1 -0
- package/packages/trajectory/dist/src/learning-graph.d.ts +159 -0
- package/packages/trajectory/dist/src/learning-graph.d.ts.map +1 -0
- package/packages/trajectory/dist/src/learning-graph.js +258 -0
- package/packages/trajectory/dist/src/learning-graph.js.map +1 -0
- package/packages/trajectory/dist/src/memory-store.d.ts +146 -0
- package/packages/trajectory/dist/src/memory-store.d.ts.map +1 -0
- package/packages/trajectory/dist/src/memory-store.js +472 -0
- package/packages/trajectory/dist/src/memory-store.js.map +1 -0
- package/packages/trajectory/dist/src/review-fork.d.ts +164 -0
- package/packages/trajectory/dist/src/review-fork.d.ts.map +1 -0
- package/packages/trajectory/dist/src/review-fork.js +332 -0
- package/packages/trajectory/dist/src/review-fork.js.map +1 -0
- package/packages/trajectory/dist/src/write-approval.d.ts +136 -0
- package/packages/trajectory/dist/src/write-approval.d.ts.map +1 -0
- package/packages/trajectory/dist/src/write-approval.js +281 -0
- package/packages/trajectory/dist/src/write-approval.js.map +1 -0
- package/packages/trajectory/package.json +1 -1
- package/packages/trajectory/src/curator.ts +485 -0
- package/packages/trajectory/src/journey-renderer.ts +399 -0
- package/packages/trajectory/src/learning-graph.ts +363 -0
- package/packages/trajectory/src/memory-store.ts +578 -0
- package/packages/trajectory/src/review-fork.ts +450 -0
- package/packages/trajectory/src/write-approval.ts +372 -0
- package/packages/tui/package.json +1 -1
- package/packages/types/package.json +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/packages/write-review/dist/blackboard.d.ts +98 -0
- package/packages/write-review/dist/blackboard.d.ts.map +1 -0
- package/packages/write-review/dist/blackboard.js +289 -0
- package/packages/write-review/dist/blackboard.js.map +1 -0
- package/packages/write-review/dist/event-bus.d.ts +106 -0
- package/packages/write-review/dist/event-bus.d.ts.map +1 -0
- package/packages/write-review/dist/event-bus.js +294 -0
- package/packages/write-review/dist/event-bus.js.map +1 -0
- package/packages/write-review/dist/gate.d.ts +37 -0
- package/packages/write-review/dist/gate.d.ts.map +1 -0
- package/packages/write-review/dist/gate.js +138 -0
- package/packages/write-review/dist/gate.js.map +1 -0
- package/packages/write-review/dist/index.d.ts +22 -0
- package/packages/write-review/dist/index.d.ts.map +1 -0
- package/packages/write-review/dist/index.js +60 -0
- package/packages/write-review/dist/index.js.map +1 -0
- package/packages/write-review/dist/injection.d.ts +40 -0
- package/packages/write-review/dist/injection.d.ts.map +1 -0
- package/packages/write-review/dist/injection.js +179 -0
- package/packages/write-review/dist/injection.js.map +1 -0
- package/packages/write-review/dist/review.d.ts +54 -0
- package/packages/write-review/dist/review.d.ts.map +1 -0
- package/packages/write-review/dist/review.js +154 -0
- package/packages/write-review/dist/review.js.map +1 -0
- package/packages/write-review/dist/trigger.d.ts +39 -0
- package/packages/write-review/dist/trigger.d.ts.map +1 -0
- package/packages/write-review/dist/trigger.js +107 -0
- package/packages/write-review/dist/trigger.js.map +1 -0
- package/packages/write-review/dist/types.d.ts +78 -0
- package/packages/write-review/dist/types.d.ts.map +1 -0
- package/packages/write-review/dist/types.js +26 -0
- package/packages/write-review/dist/types.js.map +1 -0
- package/packages/write-review/package.json +1 -1
- package/packages/write-review/src/event-bus.ts +351 -0
- package/packages/write-review/src/index.ts +1 -0
- package/packages/write-review/src/injection.ts +25 -3
- package/proactive-compact.ts +51 -7
- package/scripts/sync-skills.ts +275 -0
- package/scripts/sync-to-qdrant.ts +398 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,39 @@
|
|
|
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.75](https://github.com/ManotLuijiu/pi-harness-runtime/compare/v1.1.95...v1.1.75) (2026-09-29)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* Add comprehensive 529 error logging for debugging ([18c602d](https://github.com/ManotLuijiu/pi-harness-runtime/commit/18c602dbe6ac11fea00af2f5b632f0564a14a8a3))
|
|
11
|
+
* Add Qdrant skills integration for team sharing ([7ffcaab](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7ffcaab9af30b39b28cc6bf23a85d5b586c2130f))
|
|
12
|
+
* Implement Hermes-style self-improvement system + fix critical bugs ([2c477af](https://github.com/ManotLuijiu/pi-harness-runtime/commit/2c477afc810ceaa4d57ded859b88e61d37999807))
|
|
13
|
+
* Implement Hermes-style skill system ([b871ad5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/b871ad5107b50757ee9c18aa5d7c144c1b70f9de))
|
|
14
|
+
* Implement ping-pong event bus for two-agent coordination ([ed259c8](https://github.com/ManotLuijiu/pi-harness-runtime/commit/ed259c8f0f912446782c9c31f55165ad397f89d3))
|
|
15
|
+
* Qdrant integration working - E2E tests pass ([1a12f7c](https://github.com/ManotLuijiu/pi-harness-runtime/commit/1a12f7c5ce0508f689b246f88f4c3d8e79c80f86))
|
|
16
|
+
* **qdrant:** Official @qdrant/js-client-rest integration ([efaa47b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/efaa47b7c86601b69fe4ae56feae66815f6387ea))
|
|
17
|
+
|
|
18
|
+
### [1.1.74](https://github.com/ManotLuijiu/pi-harness-runtime/compare/v1.1.95...v1.1.74) (2026-09-29)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Features
|
|
22
|
+
|
|
23
|
+
* Add comprehensive 529 error logging for debugging ([18c602d](https://github.com/ManotLuijiu/pi-harness-runtime/commit/18c602dbe6ac11fea00af2f5b632f0564a14a8a3))
|
|
24
|
+
* Add Qdrant skills integration for team sharing ([7ffcaab](https://github.com/ManotLuijiu/pi-harness-runtime/commit/7ffcaab9af30b39b28cc6bf23a85d5b586c2130f))
|
|
25
|
+
* Implement Hermes-style self-improvement system + fix critical bugs ([2c477af](https://github.com/ManotLuijiu/pi-harness-runtime/commit/2c477afc810ceaa4d57ded859b88e61d37999807))
|
|
26
|
+
* Implement Hermes-style skill system ([b871ad5](https://github.com/ManotLuijiu/pi-harness-runtime/commit/b871ad5107b50757ee9c18aa5d7c144c1b70f9de))
|
|
27
|
+
* Implement ping-pong event bus for two-agent coordination ([ed259c8](https://github.com/ManotLuijiu/pi-harness-runtime/commit/ed259c8f0f912446782c9c31f55165ad397f89d3))
|
|
28
|
+
* Qdrant integration working - E2E tests pass ([1a12f7c](https://github.com/ManotLuijiu/pi-harness-runtime/commit/1a12f7c5ce0508f689b246f88f4c3d8e79c80f86))
|
|
29
|
+
* **qdrant:** Official @qdrant/js-client-rest integration ([efaa47b](https://github.com/ManotLuijiu/pi-harness-runtime/commit/efaa47b7c86601b69fe4ae56feae66815f6387ea))
|
|
30
|
+
|
|
31
|
+
### [1.1.72](https://github.com/ManotLuijiu/pi-harness-runtime/compare/v1.1.95...v1.1.72) (2026-09-29)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Features
|
|
35
|
+
|
|
36
|
+
* Implement Hermes-style self-improvement system + fix critical bugs ([2c477af](https://github.com/ManotLuijiu/pi-harness-runtime/commit/2c477afc810ceaa4d57ded859b88e61d37999807))
|
|
37
|
+
|
|
5
38
|
### [1.1.71-1](https://github.com/ManotLuijiu/pi-harness-runtime/compare/v1.1.69...v1.1.71-1) (2026-09-19)
|
|
6
39
|
|
|
7
40
|
|
package/harness/loop-runtime.ts
CHANGED
|
@@ -780,6 +780,8 @@ export class LoopRuntime {
|
|
|
780
780
|
|
|
781
781
|
private async saveCheckpoint(): Promise<void> {
|
|
782
782
|
const now = new Date().toISOString();
|
|
783
|
+
// Preserve resumeAt from current checkpoint if set
|
|
784
|
+
const currentCheckpoint = this.jobState.getCheckpoint();
|
|
783
785
|
const checkpoint: RuntimeCheckpoint = {
|
|
784
786
|
version: 1,
|
|
785
787
|
jobId: this.state.jobId,
|
|
@@ -787,6 +789,7 @@ export class LoopRuntime {
|
|
|
787
789
|
taskId: this.state.currentTaskId ?? undefined,
|
|
788
790
|
iteration: this.state.iteration,
|
|
789
791
|
status: this.state.status,
|
|
792
|
+
resumeAt: currentCheckpoint?.resumeAt,
|
|
790
793
|
createdAt: now,
|
|
791
794
|
updatedAt: now,
|
|
792
795
|
};
|
package/index.ts
CHANGED
|
@@ -339,6 +339,35 @@ async function initLoopCompletions(pi: ExtensionAPI): Promise<void> {
|
|
|
339
339
|
}
|
|
340
340
|
}
|
|
341
341
|
|
|
342
|
+
/**
|
|
343
|
+
* Initialize Hermes-style skill system
|
|
344
|
+
* - Register skill commands with pi
|
|
345
|
+
* - Scan skills from ~/.pi-harness-runtime/skills/
|
|
346
|
+
*/
|
|
347
|
+
async function initHermesSkills(pi: ExtensionAPI): Promise<void> {
|
|
348
|
+
try {
|
|
349
|
+
// Dynamically import to avoid circular deps
|
|
350
|
+
const { initSkills } =
|
|
351
|
+
await import("./packages/skills/src/index.js");
|
|
352
|
+
|
|
353
|
+
// Scan skills from default locations
|
|
354
|
+
const result = initSkills();
|
|
355
|
+
console.error(`[pi-harness] Scanned ${result.skills.length} skills`);
|
|
356
|
+
|
|
357
|
+
// Register /skill commands
|
|
358
|
+
try {
|
|
359
|
+
const { initSkillCommands } = await import("./packages/skills/src/skill-commands.js");
|
|
360
|
+
initSkillCommands(pi);
|
|
361
|
+
console.error("[pi-harness] Registered skill commands");
|
|
362
|
+
} catch (err) {
|
|
363
|
+
console.error(`[pi-harness] Failed to register skill commands:`, err);
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
} catch (err) {
|
|
367
|
+
console.error(`[pi-harness] Failed to initialize skills:`, err);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
|
|
342
371
|
interface LoopCompletion {
|
|
343
372
|
taskId: string;
|
|
344
373
|
request: string;
|
|
@@ -381,11 +410,11 @@ function processCompletionFile(filePath: string, pi: ExtensionAPI): void {
|
|
|
381
410
|
// --- Debug logging (file only, no console override) ---------------
|
|
382
411
|
// Logs written to file only. Real console output preserved for pi's TUI.
|
|
383
412
|
import { homedir } from "node:os";
|
|
384
|
-
import { existsSync, mkdirSync } from "node:fs";
|
|
385
|
-
import { join } from "node:path";
|
|
413
|
+
import { existsSync, mkdirSync, symlinkSync } from "node:fs";
|
|
414
|
+
import { join, dirname } from "node:path";
|
|
386
415
|
|
|
387
416
|
// --- Harness Runtime State --------------------------------------------
|
|
388
|
-
const HARNESS_ROOT_DIR = join(homedir(), ".pi
|
|
417
|
+
const HARNESS_ROOT_DIR = join(homedir(), ".pi-harness-runtime");
|
|
389
418
|
|
|
390
419
|
interface HarnessSession {
|
|
391
420
|
jobId: string;
|
|
@@ -431,15 +460,76 @@ function readMessageText(message: unknown): string {
|
|
|
431
460
|
}
|
|
432
461
|
}
|
|
433
462
|
|
|
463
|
+
/**
|
|
464
|
+
* Skill directories for Hermes-style skill system
|
|
465
|
+
*/
|
|
466
|
+
const SKILLS_DIR = join(homedir(), ".pi-harness-runtime", "skills");
|
|
467
|
+
const MEMORY_DIR = join(homedir(), ".pi-harness-runtime", "memory");
|
|
468
|
+
const TRAJECTORY_DIR = join(homedir(), ".pi-harness-runtime", "trajectory");
|
|
469
|
+
const PI_SKILLS_DIR = join(homedir(), ".pi", "skills");
|
|
470
|
+
|
|
434
471
|
function ensureHarnessDir() {
|
|
435
472
|
if (!existsSync(HARNESS_ROOT_DIR)) {
|
|
436
473
|
mkdirSync(HARNESS_ROOT_DIR, { recursive: true });
|
|
437
474
|
}
|
|
438
|
-
//
|
|
439
|
-
const
|
|
440
|
-
|
|
441
|
-
|
|
475
|
+
// Hermes-style directory structure
|
|
476
|
+
for (const dir of [SKILLS_DIR, MEMORY_DIR, TRAJECTORY_DIR, COOKIE_DROP_DIR]) {
|
|
477
|
+
if (!existsSync(dir)) {
|
|
478
|
+
mkdirSync(dir, { recursive: true });
|
|
479
|
+
}
|
|
442
480
|
}
|
|
481
|
+
// Create symlink so pi.dev discovers our skills
|
|
482
|
+
ensurePiSkillsSymlink();
|
|
483
|
+
console.error(
|
|
484
|
+
`[pi-harness] Initialized ~/.pi-harness-runtime/ with skills/, memory/, trajectory/, cookies/`,
|
|
485
|
+
);
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
/**
|
|
489
|
+
* Create symlink from ~/.pi/skills to ~/.pi-harness-runtime/skills
|
|
490
|
+
* This allows pi.dev to discover our Hermes-style skills
|
|
491
|
+
*/
|
|
492
|
+
function ensurePiSkillsSymlink(): void {
|
|
493
|
+
// SAFETY: Only create symlink if ~/.pi/skills doesn't exist
|
|
494
|
+
if (existsSync(PI_SKILLS_DIR)) {
|
|
495
|
+
return; // User has their own skills dir, don't override
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
try {
|
|
499
|
+
// SAFETY: Ensure parent dir exists
|
|
500
|
+
const parentDir = dirname(PI_SKILLS_DIR);
|
|
501
|
+
if (!existsSync(parentDir)) {
|
|
502
|
+
mkdirSync(parentDir, { recursive: true });
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
// Create symlink: ~/.pi/skills -> ~/.pi-harness-runtime/skills
|
|
506
|
+
symlinkSync(SKILLS_DIR, PI_SKILLS_DIR, "junction");
|
|
507
|
+
console.error(`[pi-harness] Created symlink: ~/.pi/skills -> ~/.pi-harness-runtime/skills`);
|
|
508
|
+
} catch {
|
|
509
|
+
// Ignore errors (may fail due to permissions or existing file)
|
|
510
|
+
// User can create the symlink manually if needed
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
/**
|
|
515
|
+
* Get skill directory path (for pi-harness/skills package)
|
|
516
|
+
*/
|
|
517
|
+
export function getSkillsDir(): string {
|
|
518
|
+
return SKILLS_DIR;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
/**
|
|
522
|
+
* Get memory directory path (for trajectory/memory package)
|
|
523
|
+
*/
|
|
524
|
+
export function getMemoryDir(): string {
|
|
525
|
+
return MEMORY_DIR;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
/**
|
|
529
|
+
* Get trajectory directory path (for trajectory package)
|
|
530
|
+
*/
|
|
531
|
+
export function getTrajectoryDir(): string {
|
|
532
|
+
return TRAJECTORY_DIR;
|
|
443
533
|
}
|
|
444
534
|
|
|
445
535
|
async function getCheckpointManager(): Promise<CheckpointManager> {
|
|
@@ -506,6 +596,10 @@ export default function (pi: ExtensionAPI) {
|
|
|
506
596
|
// --- loop-completions: Watch daemon completions → agent TUI todos --------
|
|
507
597
|
void initLoopCompletions(pi);
|
|
508
598
|
|
|
599
|
+
// --- Hermes-style skills: Initialize skill system ----------------------
|
|
600
|
+
// Scan skills from ~/.pi-harness-runtime/skills/ and register with pi.dev
|
|
601
|
+
void initHermesSkills(pi);
|
|
602
|
+
|
|
509
603
|
// --- TASK TRACKING TERMINOLOGY CLARIFICATION ------------------------
|
|
510
604
|
// CRITICAL: This project has TWO separate task trackers. Agents often confuse them.
|
|
511
605
|
const TASK_TERMINOLOGY_CLARIFICATION = `
|
|
@@ -722,10 +816,14 @@ Run \`bd ready\` to see current bd issues.
|
|
|
722
816
|
)
|
|
723
817
|
) {
|
|
724
818
|
providerOverloadResumeAttempts += 1;
|
|
819
|
+
console.error(`[pi-harness] Scheduling provider overload resume #${providerOverloadResumeAttempts}`);
|
|
725
820
|
scheduleProviderOverloadResume(() => ctx.hasPendingMessages());
|
|
726
821
|
} else if (m.stopReason === "stop") {
|
|
727
822
|
outputLimitResumeAttempts = 0;
|
|
728
823
|
pendingOutputLimitResumeAfterSettled = false;
|
|
824
|
+
if (providerOverloadResumeAttempts > 0) {
|
|
825
|
+
console.error(`[pi-harness] Counter reset (stopReason=stop), was=${providerOverloadResumeAttempts}`);
|
|
826
|
+
}
|
|
729
827
|
providerOverloadResumeAttempts = 0;
|
|
730
828
|
clearProviderOverloadResume();
|
|
731
829
|
}
|
|
@@ -877,9 +975,9 @@ Run \`bd ready\` to see current bd issues.
|
|
|
877
975
|
}
|
|
878
976
|
}
|
|
879
977
|
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
978
|
+
// Store only the setStatus function, NOT the ctx itself.
|
|
979
|
+
// Storing ctx causes stale-context errors after pi reload/restart.
|
|
980
|
+
let footerSetStatus: ((key: string, value: string) => void) | null = null;
|
|
883
981
|
let quotaAutoFetchInFlight = false;
|
|
884
982
|
let proactiveCompactInFlight = false;
|
|
885
983
|
let lastProactiveCompactAt = 0;
|
|
@@ -944,9 +1042,9 @@ Run \`bd ready\` to see current bd issues.
|
|
|
944
1042
|
// JSON.stringify(record),
|
|
945
1043
|
// );
|
|
946
1044
|
mirrorStore.writeProvider(provider, { ...record, provider });
|
|
947
|
-
if (
|
|
1045
|
+
if (footerSetStatus) {
|
|
948
1046
|
refreshFooterStatus(
|
|
949
|
-
|
|
1047
|
+
footerSetStatus,
|
|
950
1048
|
tracker,
|
|
951
1049
|
mirrorStore,
|
|
952
1050
|
hasCookieSource,
|
|
@@ -983,9 +1081,9 @@ Run \`bd ready\` to see current bd issues.
|
|
|
983
1081
|
// );
|
|
984
1082
|
if (p !== lastActiveProvider) {
|
|
985
1083
|
lastActiveProvider = p;
|
|
986
|
-
if (
|
|
1084
|
+
if (footerSetStatus) {
|
|
987
1085
|
refreshFooterStatus(
|
|
988
|
-
|
|
1086
|
+
footerSetStatus,
|
|
989
1087
|
tracker,
|
|
990
1088
|
mirrorStore,
|
|
991
1089
|
hasCookieSource,
|
|
@@ -1460,9 +1558,9 @@ Run \`bd ready\` to see current bd issues.
|
|
|
1460
1558
|
"Mirror cleared. The next auto refresh will repopulate it.",
|
|
1461
1559
|
"info",
|
|
1462
1560
|
);
|
|
1463
|
-
|
|
1561
|
+
footerSetStatus = ctx.ui.setStatus.bind(ctx.ui);
|
|
1464
1562
|
refreshFooterStatus(
|
|
1465
|
-
|
|
1563
|
+
footerSetStatus,
|
|
1466
1564
|
tracker,
|
|
1467
1565
|
mirrorStore,
|
|
1468
1566
|
hasCookieSource,
|
|
@@ -1757,9 +1855,10 @@ Run \`bd ready\` to see current bd issues.
|
|
|
1757
1855
|
|
|
1758
1856
|
// --- Footer status (persistent badge) --------------------------------
|
|
1759
1857
|
pi.on("session_start", (_event, ctx) => {
|
|
1760
|
-
|
|
1858
|
+
// Capture only the setStatus function, not the ctx
|
|
1859
|
+
footerSetStatus = ctx.ui.setStatus.bind(ctx.ui);
|
|
1761
1860
|
refreshFooterStatus(
|
|
1762
|
-
|
|
1861
|
+
footerSetStatus,
|
|
1763
1862
|
tracker,
|
|
1764
1863
|
mirrorStore,
|
|
1765
1864
|
hasCookieSource,
|
|
@@ -1769,9 +1868,10 @@ Run \`bd ready\` to see current bd issues.
|
|
|
1769
1868
|
|
|
1770
1869
|
pi.on("turn_end", (_event, ctx) => {
|
|
1771
1870
|
noteActiveProvider(ctx.model?.id ?? null);
|
|
1772
|
-
|
|
1871
|
+
// Capture only the setStatus function, not the ctx
|
|
1872
|
+
footerSetStatus = ctx.ui.setStatus.bind(ctx.ui);
|
|
1773
1873
|
refreshFooterStatus(
|
|
1774
|
-
|
|
1874
|
+
footerSetStatus,
|
|
1775
1875
|
tracker,
|
|
1776
1876
|
mirrorStore,
|
|
1777
1877
|
hasCookieSource,
|
|
@@ -1797,13 +1897,14 @@ Run \`bd ready\` to see current bd issues.
|
|
|
1797
1897
|
});
|
|
1798
1898
|
|
|
1799
1899
|
pi.on("session_compact", (event, ctx) => {
|
|
1800
|
-
|
|
1900
|
+
// Capture only the setStatus function, not the ctx
|
|
1901
|
+
footerSetStatus = ctx.ui.setStatus.bind(ctx.ui);
|
|
1801
1902
|
proactiveCompactInFlight = false;
|
|
1802
1903
|
lastProactiveCompactAt = Date.now();
|
|
1803
1904
|
consecutiveCompactFailures = 0;
|
|
1804
1905
|
proactiveCompactCircuitReported = false;
|
|
1805
1906
|
refreshFooterStatus(
|
|
1806
|
-
|
|
1907
|
+
footerSetStatus,
|
|
1807
1908
|
tracker,
|
|
1808
1909
|
mirrorStore,
|
|
1809
1910
|
hasCookieSource,
|
|
@@ -1841,9 +1942,9 @@ Run \`bd ready\` to see current bd issues.
|
|
|
1841
1942
|
setInterval(() => {
|
|
1842
1943
|
void maybeAutoFetchQuota(lastActiveProvider ?? null);
|
|
1843
1944
|
// Also refresh footer status so user sees updated quota data
|
|
1844
|
-
if (
|
|
1945
|
+
if (footerSetStatus) {
|
|
1845
1946
|
refreshFooterStatus(
|
|
1846
|
-
|
|
1947
|
+
footerSetStatus,
|
|
1847
1948
|
tracker,
|
|
1848
1949
|
mirrorStore,
|
|
1849
1950
|
hasCookieSource,
|
|
@@ -1866,13 +1967,13 @@ Run \`bd ready\` to see current bd issues.
|
|
|
1866
1967
|
const delayMs = getProviderOverloadResumeDelayMs();
|
|
1867
1968
|
const delayMinutes = Math.max(1, Math.round(delayMs / 60_000));
|
|
1868
1969
|
console.error(
|
|
1869
|
-
|
|
1870
|
-
delayMinutes +
|
|
1871
|
-
" min",
|
|
1970
|
+
`[pi-harness] Provider overloaded; scheduling resume in ${delayMinutes} min (${delayMs}ms) attempt=${providerOverloadResumeAttempts}`,
|
|
1872
1971
|
);
|
|
1873
1972
|
providerOverloadResumeTimer = setTimeout(() => {
|
|
1874
1973
|
providerOverloadResumeTimer = null;
|
|
1974
|
+
console.error(`[pi-harness] Provider resume timer fired, sending "resume"`);
|
|
1875
1975
|
if (hasPendingMessages()) {
|
|
1976
|
+
console.error(`[pi-harness] Resume skipped: hasPendingMessages=true`);
|
|
1876
1977
|
return;
|
|
1877
1978
|
}
|
|
1878
1979
|
queueAutoResume(
|
|
@@ -1948,7 +2049,7 @@ Run \`bd ready\` to see current bd issues.
|
|
|
1948
2049
|
// Helper: refresh persistent footer status with one-line summary
|
|
1949
2050
|
// ----------------------------------------------------------------------
|
|
1950
2051
|
function refreshFooterStatus(
|
|
1951
|
-
|
|
2052
|
+
setStatus: (key: string, value: string) => void,
|
|
1952
2053
|
tracker: UsageTracker,
|
|
1953
2054
|
mirrorStore: MirrorStore,
|
|
1954
2055
|
hasCookieSource: () => boolean,
|
|
@@ -1962,7 +2063,7 @@ function refreshFooterStatus(
|
|
|
1962
2063
|
// mirror ? JSON.stringify(mirror) : null,
|
|
1963
2064
|
// );
|
|
1964
2065
|
const freshness = mirrorStore.freshness(mirror, nowMs);
|
|
1965
|
-
|
|
2066
|
+
setStatus(
|
|
1966
2067
|
"harness-runtime",
|
|
1967
2068
|
buildFooterStatusValue(local, mirror, freshness, hasCookieSource(), provider),
|
|
1968
2069
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-harness-runtime",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.97",
|
|
4
4
|
"description": "[BETA] Codex-style /usage status + autonomous coding harness for pi. Not production ready — expect breaking changes.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -95,6 +95,7 @@
|
|
|
95
95
|
"@langchain/langgraph": "^1.4.13",
|
|
96
96
|
"@langchain/langgraph-checkpoint": "^1.1.5",
|
|
97
97
|
"@langchain/openai": "^1.5.10",
|
|
98
|
+
"@qdrant/js-client-rest": "^1.19.0",
|
|
98
99
|
"chokidar": "^5.0.0",
|
|
99
100
|
"deepagents": "^1.10.5",
|
|
100
101
|
"langchain": "^1.5.10",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-harness/capability-registry",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.97",
|
|
4
4
|
"description": "Capability Registry for pi-harness-runtime — tracks model capabilities and enables capability-based routing",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|