pi-harness-runtime 0.10.3 → 0.10.5
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/index.ts +4 -1
- package/package.json +3 -2
- package/packages/a2a-adapter/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/code-generation/package.json +1 -1
- package/packages/code-review/package.json +1 -1
- package/packages/codex-adapter/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/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/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/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/performance-optimizer/package.json +1 -1
- package/packages/privilege-broker/package.json +1 -1
- package/packages/project-analyzer/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/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-registry/package.json +1 -1
- 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/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/todo-bd-sync/src/detector.ts +25 -4
- package/packages/todo-bd-sync/src/extension.ts +74 -58
- 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/workflow-events/package.json +1 -1
- package/packages/workspace-scanner/package.json +1 -1
- package/packages/worktree/package.json +1 -1
package/index.ts
CHANGED
|
@@ -906,7 +906,10 @@ The todo overlay persists and helps track progress across your conversation.
|
|
|
906
906
|
registerGithubLoginCommand(pi);
|
|
907
907
|
|
|
908
908
|
// --- Ctrl+Shift+C — Copy to clipboard + sync to Gist ------------
|
|
909
|
-
|
|
909
|
+
// NOTE: Shortcut disabled to avoid conflict with pi-usage-status extension
|
|
910
|
+
// which also registers ctrl+shift+c for clipboard sync.
|
|
911
|
+
// The copyAndSync function is still exported and can be called manually.
|
|
912
|
+
// registerCopySyncShortcut(pi, Key);
|
|
910
913
|
|
|
911
914
|
// --- /harness start — Start a new harness job ----------------------
|
|
912
915
|
pi.registerCommand("harness-start", {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-harness-runtime",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.5",
|
|
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": {
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
"auth:minimax:scrape": "bun packages/auth/src/run-minimax-auth.ts scrape",
|
|
17
17
|
"skills:sync": "bun scripts/skills-sync.ts",
|
|
18
18
|
"skills:sync:check": "bun scripts/skills-sync.ts --check-only",
|
|
19
|
-
"build": "for pkg in packages/*/; do [ -f \"${pkg}tsconfig.json\" ] && [ \"$pkg\" != \"packages/provider-router/\" ] && node_modules/.bin/tsc -p \"${pkg}tsconfig.json\" --skipLibCheck || true; done"
|
|
19
|
+
"build": "for pkg in packages/*/; do [ -f \"${pkg}tsconfig.json\" ] && [ \"$pkg\" != \"packages/provider-router/\" ] && node_modules/.bin/tsc -p \"${pkg}tsconfig.json\" --skipLibCheck || true; done",
|
|
20
|
+
"check:version": "bun scripts/check-version-sync.ts"
|
|
20
21
|
},
|
|
21
22
|
"bin": {
|
|
22
23
|
"harness-auth": "packages/auth/src/run-minimax-auth.ts"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-harness/capability-registry",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.5",
|
|
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",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-harness/provider-router",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.5",
|
|
4
4
|
"description": "Enhanced Provider Router for pi-harness-runtime — intelligent routing with capabilities, costs, and quotas",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/provider-router.js",
|
|
@@ -91,6 +91,16 @@ export function isBdInstalled(): boolean {
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
+
/**
|
|
95
|
+
* Check if bd is initialized in the current project
|
|
96
|
+
* (i.e., .beads/ directory exists)
|
|
97
|
+
*/
|
|
98
|
+
export function isBdInitialized(cwd?: string): boolean {
|
|
99
|
+
const projectDir = cwd || process.cwd();
|
|
100
|
+
const beadsDir = join(projectDir, ".beads");
|
|
101
|
+
return existsSync(beadsDir);
|
|
102
|
+
}
|
|
103
|
+
|
|
94
104
|
/**
|
|
95
105
|
* Get the version of bd CLI if installed
|
|
96
106
|
*/
|
|
@@ -106,6 +116,9 @@ export function getBdVersion(): string | null {
|
|
|
106
116
|
}
|
|
107
117
|
}
|
|
108
118
|
|
|
119
|
+
/**
|
|
120
|
+
* Get installation status of both dependencies
|
|
121
|
+
*/
|
|
109
122
|
/**
|
|
110
123
|
* Get installation status of both dependencies
|
|
111
124
|
*/
|
|
@@ -118,10 +131,13 @@ export interface DependencyStatus {
|
|
|
118
131
|
bd: {
|
|
119
132
|
installed: boolean;
|
|
120
133
|
version: string | null;
|
|
134
|
+
initialized: boolean;
|
|
135
|
+
installUrl: string;
|
|
121
136
|
};
|
|
122
137
|
}
|
|
123
138
|
|
|
124
|
-
export function getDependencyStatus(): DependencyStatus {
|
|
139
|
+
export function getDependencyStatus(cwd?: string): DependencyStatus {
|
|
140
|
+
const installed = isBdInstalled();
|
|
125
141
|
return {
|
|
126
142
|
rpivTodo: {
|
|
127
143
|
installed: isRpivTodoInstalled(),
|
|
@@ -129,8 +145,10 @@ export function getDependencyStatus(): DependencyStatus {
|
|
|
129
145
|
loaded: isRpivTodoLoaded(),
|
|
130
146
|
},
|
|
131
147
|
bd: {
|
|
132
|
-
installed
|
|
133
|
-
version: getBdVersion(),
|
|
148
|
+
installed,
|
|
149
|
+
version: installed ? getBdVersion() : null,
|
|
150
|
+
initialized: installed ? isBdInitialized(cwd) : false,
|
|
151
|
+
installUrl: "https://github.com/gastownhall/beads",
|
|
134
152
|
},
|
|
135
153
|
};
|
|
136
154
|
}
|
|
@@ -145,6 +163,9 @@ export function logDependencyStatus(): void {
|
|
|
145
163
|
` rpiv-todo: installed=${status.rpivTodo.installed}, version=${status.rpivTodo.version}, loaded=${status.rpivTodo.loaded}`,
|
|
146
164
|
);
|
|
147
165
|
console.log(
|
|
148
|
-
` bd: installed=${status.bd.installed}, version=${status.bd.version}`,
|
|
166
|
+
` bd: installed=${status.bd.installed}, version=${status.bd.version}, initialized=${status.bd.initialized}`,
|
|
149
167
|
);
|
|
168
|
+
if (!status.bd.installed) {
|
|
169
|
+
console.log(` bd install: ${status.bd.installUrl}`);
|
|
170
|
+
}
|
|
150
171
|
}
|
|
@@ -1,84 +1,100 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* todo-bd-sync extension entry point
|
|
3
3
|
*
|
|
4
|
-
* This
|
|
5
|
-
* 1.
|
|
6
|
-
* 2.
|
|
7
|
-
* 3.
|
|
4
|
+
* This extension:
|
|
5
|
+
* 1. Detects if bd is installed and initialized
|
|
6
|
+
* 2. Auto-injects "add tasks to todo-list" when task is complex
|
|
7
|
+
* 3. Provides two-way sync between rpiv-todo and bd (via rpiv-todo)
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
* 1. Install dependencies:
|
|
11
|
-
* pi install npm:@juicesharp/rpiv-todo
|
|
12
|
-
* (bd should already be installed)
|
|
13
|
-
*
|
|
14
|
-
* 2. The extension auto-enables when rpiv-todo is detected
|
|
9
|
+
* The magic phrase "add tasks to todo-list" triggers rpiv-todo to track the task.
|
|
15
10
|
*/
|
|
16
11
|
|
|
17
|
-
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
18
|
-
import {
|
|
19
|
-
createTodoBdSync,
|
|
20
|
-
type TodoBdSync,
|
|
21
|
-
type TodoBdSyncConfig,
|
|
22
|
-
} from "./index.js";
|
|
23
|
-
import { getDependencyStatus, logDependencyStatus } from "./detector.js";
|
|
24
|
-
import { createCustomReminder } from "./todo-reminder.js";
|
|
12
|
+
import type { ExtensionAPI, InputEvent, InputEventResult } from "@earendil-works/pi-coding-agent";
|
|
13
|
+
import { getDependencyStatus } from "./detector.js";
|
|
25
14
|
import { getOpenBdIssues } from "./sync.js";
|
|
15
|
+
import { decideAutoTodo, getTaskComplexityScore } from "./task-analyzer.js";
|
|
26
16
|
|
|
27
17
|
/**
|
|
28
18
|
* Register the todo-bd-sync extension
|
|
29
19
|
*/
|
|
30
|
-
export function registerTodoBdSync(
|
|
31
|
-
pi: ExtensionAPI,
|
|
32
|
-
config?: TodoBdSyncConfig,
|
|
33
|
-
): TodoBdSync | null {
|
|
20
|
+
export function registerTodoBdSync(pi: ExtensionAPI): void {
|
|
34
21
|
const deps = getDependencyStatus();
|
|
35
22
|
|
|
36
23
|
// Check if bd is installed
|
|
37
24
|
if (!deps.bd.installed) {
|
|
38
|
-
|
|
25
|
+
console.log(`
|
|
26
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
27
|
+
⚠️ bd (beads) is not installed
|
|
28
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
29
|
+
|
|
30
|
+
To use todo-bd-sync, install bd first:
|
|
31
|
+
|
|
32
|
+
https://github.com/gastownhall/beads
|
|
33
|
+
|
|
34
|
+
Quick install:
|
|
35
|
+
|
|
36
|
+
npm install -g @gastownhall/beads
|
|
37
|
+
|
|
38
|
+
OR
|
|
39
|
+
|
|
40
|
+
pi install npm:@gastownhall/beads
|
|
41
|
+
|
|
42
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
43
|
+
`);
|
|
44
|
+
return;
|
|
39
45
|
}
|
|
40
46
|
|
|
41
|
-
//
|
|
42
|
-
if (
|
|
43
|
-
|
|
47
|
+
// Check if bd is initialized in this project
|
|
48
|
+
if (!deps.bd.initialized) {
|
|
49
|
+
console.log(`
|
|
50
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
51
|
+
📋 bd (beads) detected but not initialized
|
|
52
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
53
|
+
|
|
54
|
+
Run the following command to initialize:
|
|
55
|
+
|
|
56
|
+
bd init
|
|
57
|
+
|
|
58
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
59
|
+
`);
|
|
44
60
|
}
|
|
45
61
|
|
|
46
|
-
//
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
62
|
+
// ── Smart Auto-Todo Injection ──────────────────────────────────────────
|
|
63
|
+
// Listen to user input and inject "add tasks to todo-list" when needed
|
|
64
|
+
|
|
65
|
+
pi.on("input", (event: InputEvent): InputEventResult | undefined => {
|
|
66
|
+
// Only process user input (not from extensions or RPC)
|
|
67
|
+
if (event.source !== "interactive") {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const text = event.text.trim();
|
|
72
|
+
if (!text || text.length < 10) {
|
|
73
|
+
return; // Skip very short inputs
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const pendingCount = getOpenBdIssues().filter(i => i.status !== "closed").length;
|
|
77
|
+
const decision = decideAutoTodo(text);
|
|
78
|
+
|
|
79
|
+
// If should create todo and phrase not already present
|
|
80
|
+
if (decision.shouldCreate && !text.toLowerCase().includes("add tasks to todo-list")) {
|
|
81
|
+
const score = getTaskComplexityScore(text);
|
|
82
|
+
console.log(`[auto-todo] Task detected: ${decision.reason} (score: ${score}/100, pending: ${pendingCount})`);
|
|
83
|
+
|
|
84
|
+
// Transform the input to add the magic phrase
|
|
85
|
+
return {
|
|
86
|
+
action: "transform",
|
|
87
|
+
text: `${text}\n\nadd tasks to todo-list`,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return;
|
|
52
92
|
});
|
|
53
93
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
// Start todo reminder (DISABLED by default — Phase 1 emergency containment)
|
|
57
|
-
// Reminder spam was causing transcript growth. Enable only after proper task scoping.
|
|
58
|
-
const reminder = createCustomReminder(
|
|
59
|
-
pi,
|
|
60
|
-
() => {
|
|
61
|
-
// Get remaining todos from bd
|
|
62
|
-
const issues = getOpenBdIssues();
|
|
63
|
-
return issues
|
|
64
|
-
.filter((i) => i.status !== "closed")
|
|
65
|
-
.map((i) => ({
|
|
66
|
-
id: i.id,
|
|
67
|
-
title: i.title,
|
|
68
|
-
status: i.status,
|
|
69
|
-
}));
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
autoRemind: false, // DISABLED — fix reminder spam before re-enabling
|
|
73
|
-
minPendingTasks: 1,
|
|
74
|
-
},
|
|
75
|
-
);
|
|
76
|
-
reminder.start();
|
|
77
|
-
|
|
78
|
-
return sync;
|
|
94
|
+
console.log("[todo-bd-sync] Started - smart auto-todo enabled");
|
|
79
95
|
}
|
|
80
96
|
|
|
81
97
|
// Default export for pi extension loading
|
|
82
98
|
export default function todoBdSyncExtension(pi: ExtensionAPI): void {
|
|
83
|
-
registerTodoBdSync(pi
|
|
99
|
+
registerTodoBdSync(pi);
|
|
84
100
|
}
|