pi-harness-runtime 1.1.197 → 1.1.199
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/package.json +1 -1
- package/packages/a2a-adapter/package.json +1 -1
- package/packages/agent-policy/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/codex-watcher/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/e2e-tester/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/file-copy-helper/src/index.ts +1 -0
- package/packages/file-copy-helper/src/intent-detector.ts +393 -0
- 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/dist/continuation-controller.d.ts.map +1 -1
- package/packages/jev-judge/dist/continuation-controller.js +34 -3
- package/packages/jev-judge/dist/continuation-controller.js.map +1 -1
- package/packages/jev-judge/package.json +1 -1
- package/packages/jev-judge/src/continuation-controller.ts +36 -3
- 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/dist/conversation-bridge.d.ts.map +1 -1
- package/packages/notification/dist/conversation-bridge.js +19 -0
- package/packages/notification/dist/conversation-bridge.js.map +1 -1
- package/packages/notification/package.json +4 -2
- package/packages/notification/src/conversation-bridge.ts +21 -0
- package/packages/observability/package.json +1 -1
- package/packages/okf-indexer/package.json +1 -1
- package/packages/paperclip-integration/package.json +1 -1
- package/packages/performance-optimizer/package.json +1 -1
- package/packages/privilege-broker/package.json +1 -1
- package/packages/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/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-mcp-client/package.json +1 -1
- package/packages/skill-registry/package.json +1 -1
- package/packages/skills/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/telegram/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/package.json +1 -1
- package/packages/tui/package.json +1 -1
- package/packages/types/package.json +1 -1
- package/packages/webmcp-tester/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/package.json +1 -1
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Intent Detector - Routes user requests to appropriate modules
|
|
3
|
+
*
|
|
4
|
+
* Detects user intent from keywords and activates relevant modules.
|
|
5
|
+
* DEBUG: All events logged to /tmp/intent-detector-debug.log (NOT TUI)
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import type { ExtensionAPI, InputEvent, InputEventResult } from "@earendil-works/pi-coding-agent";
|
|
9
|
+
import * as fs from "fs";
|
|
10
|
+
|
|
11
|
+
// Debug log file
|
|
12
|
+
const DEBUG_LOG = "/tmp/intent-detector-debug.log";
|
|
13
|
+
|
|
14
|
+
function debugLog(label: string, data?: unknown): void {
|
|
15
|
+
const timestamp = new Date().toISOString();
|
|
16
|
+
const entry = `[${timestamp}] [${label}] ${data ? JSON.stringify(data, null, 2) : ""}\n`;
|
|
17
|
+
try {
|
|
18
|
+
fs.appendFileSync(DEBUG_LOG, entry);
|
|
19
|
+
} catch {
|
|
20
|
+
// Silently fail
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Intent types
|
|
25
|
+
export type IntentType =
|
|
26
|
+
| "rea" // Reverse engineering / app analysis
|
|
27
|
+
| "file_copy" // Mimic, clone, copy files
|
|
28
|
+
| "code_review" // Review code
|
|
29
|
+
| "security" // Security audit
|
|
30
|
+
| "general"; // Default
|
|
31
|
+
|
|
32
|
+
// Intent result
|
|
33
|
+
export interface IntentResult {
|
|
34
|
+
type: IntentType;
|
|
35
|
+
confidence: number; // 0-1
|
|
36
|
+
keywords: string[]; // Matched keywords
|
|
37
|
+
module: string; // Module to activate
|
|
38
|
+
guidance?: string; // Optional brief guidance
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// REA Keywords - Reverse Engineering / App Analysis
|
|
42
|
+
const REA_KEYWORDS = [
|
|
43
|
+
// English
|
|
44
|
+
"reverse engineer",
|
|
45
|
+
"reverse engineering",
|
|
46
|
+
"rea",
|
|
47
|
+
"analyze binary",
|
|
48
|
+
"decompile",
|
|
49
|
+
"disassemble",
|
|
50
|
+
"inspect binary",
|
|
51
|
+
"understand how",
|
|
52
|
+
"replicate app",
|
|
53
|
+
"clone app",
|
|
54
|
+
"copy app",
|
|
55
|
+
"mimic app",
|
|
56
|
+
// Chinese
|
|
57
|
+
"逆向",
|
|
58
|
+
"逆向工程",
|
|
59
|
+
"反编译",
|
|
60
|
+
"分析二进制",
|
|
61
|
+
"克隆应用",
|
|
62
|
+
"复制应用",
|
|
63
|
+
// Common patterns
|
|
64
|
+
"see a feature",
|
|
65
|
+
"understand.*binary",
|
|
66
|
+
];
|
|
67
|
+
|
|
68
|
+
// File Copy Keywords
|
|
69
|
+
const FILE_COPY_KEYWORDS = [
|
|
70
|
+
// English
|
|
71
|
+
"mimic",
|
|
72
|
+
"clone",
|
|
73
|
+
"replicate",
|
|
74
|
+
"copy file",
|
|
75
|
+
"copy folder",
|
|
76
|
+
"copy from",
|
|
77
|
+
"migrate",
|
|
78
|
+
"deploy",
|
|
79
|
+
"sync to",
|
|
80
|
+
// Chinese
|
|
81
|
+
"克隆",
|
|
82
|
+
"复制",
|
|
83
|
+
"迁移",
|
|
84
|
+
// Code patterns
|
|
85
|
+
"cp -r",
|
|
86
|
+
"sudo cp",
|
|
87
|
+
];
|
|
88
|
+
|
|
89
|
+
// Code Review Keywords
|
|
90
|
+
const CODE_REVIEW_KEYWORDS = [
|
|
91
|
+
"review code",
|
|
92
|
+
"review this",
|
|
93
|
+
"audit",
|
|
94
|
+
"check for bugs",
|
|
95
|
+
"security audit",
|
|
96
|
+
"find vulnerabilities",
|
|
97
|
+
];
|
|
98
|
+
|
|
99
|
+
// Security Keywords
|
|
100
|
+
const SECURITY_KEYWORDS = [
|
|
101
|
+
"security",
|
|
102
|
+
"vulnerability",
|
|
103
|
+
"exploit",
|
|
104
|
+
"attack",
|
|
105
|
+
"pentest",
|
|
106
|
+
"penetration test",
|
|
107
|
+
];
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Detect user intent from text using keyword matching
|
|
111
|
+
*/
|
|
112
|
+
function keywordDetect(text: string): { type: IntentType; keywords: string[] } {
|
|
113
|
+
const lower = text.toLowerCase();
|
|
114
|
+
const matchedKeywords: string[] = [];
|
|
115
|
+
|
|
116
|
+
// Check REA keywords (highest priority for reverse engineering)
|
|
117
|
+
for (const keyword of REA_KEYWORDS) {
|
|
118
|
+
if (keyword.startsWith("^")) {
|
|
119
|
+
if (new RegExp(keyword, "i").test(text)) {
|
|
120
|
+
matchedKeywords.push(keyword);
|
|
121
|
+
}
|
|
122
|
+
} else if (lower.includes(keyword.toLowerCase())) {
|
|
123
|
+
matchedKeywords.push(keyword);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
if (matchedKeywords.length > 0) {
|
|
127
|
+
return { type: "rea", keywords: matchedKeywords };
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// Check File Copy keywords
|
|
131
|
+
matchedKeywords.length = 0;
|
|
132
|
+
for (const keyword of FILE_COPY_KEYWORDS) {
|
|
133
|
+
if (lower.includes(keyword.toLowerCase())) {
|
|
134
|
+
matchedKeywords.push(keyword);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
if (matchedKeywords.length > 0) {
|
|
138
|
+
return { type: "file_copy", keywords: matchedKeywords };
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// Check Code Review keywords
|
|
142
|
+
matchedKeywords.length = 0;
|
|
143
|
+
for (const keyword of CODE_REVIEW_KEYWORDS) {
|
|
144
|
+
if (lower.includes(keyword.toLowerCase())) {
|
|
145
|
+
matchedKeywords.push(keyword);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
if (matchedKeywords.length > 0) {
|
|
149
|
+
return { type: "code_review", keywords: matchedKeywords };
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// Check Security keywords
|
|
153
|
+
matchedKeywords.length = 0;
|
|
154
|
+
for (const keyword of SECURITY_KEYWORDS) {
|
|
155
|
+
if (lower.includes(keyword.toLowerCase())) {
|
|
156
|
+
matchedKeywords.push(keyword);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
if (matchedKeywords.length > 0) {
|
|
160
|
+
return { type: "security", keywords: matchedKeywords };
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
return { type: "general", keywords: [] };
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Jev-based intent classifier for ambiguous cases
|
|
168
|
+
*/
|
|
169
|
+
async function jevClassify(
|
|
170
|
+
_text: string,
|
|
171
|
+
baseIntent: IntentType,
|
|
172
|
+
keywords: string[],
|
|
173
|
+
): Promise<{ confirmed: boolean; confidence: number; reasoning: string }> {
|
|
174
|
+
// For clear cases (high keyword count), skip Jev
|
|
175
|
+
if (keywords.length >= 2) {
|
|
176
|
+
return {
|
|
177
|
+
confirmed: true,
|
|
178
|
+
confidence: Math.min(1, keywords.length * 0.3),
|
|
179
|
+
reasoning: `Strong keyword match: ${keywords.join(", ")}`,
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// For ambiguous cases, use Jev judgment
|
|
184
|
+
// This would integrate with the JevJudge from jev-judge package
|
|
185
|
+
// For now, return based on single keyword presence
|
|
186
|
+
|
|
187
|
+
if (baseIntent === "rea") {
|
|
188
|
+
return {
|
|
189
|
+
confirmed: keywords.length >= 1,
|
|
190
|
+
confidence: 0.5,
|
|
191
|
+
reasoning: "Single REA keyword detected - confirming with context",
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
if (baseIntent === "file_copy") {
|
|
196
|
+
return {
|
|
197
|
+
confirmed: keywords.length >= 1,
|
|
198
|
+
confidence: 0.5,
|
|
199
|
+
reasoning: "Single file copy keyword detected - confirming with context",
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
return {
|
|
204
|
+
confirmed: false,
|
|
205
|
+
confidence: 0,
|
|
206
|
+
reasoning: "No clear intent detected",
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Detect user intent from text
|
|
212
|
+
*/
|
|
213
|
+
async function detectIntent(text: string): Promise<IntentResult> {
|
|
214
|
+
// Step 1: Keyword-based detection
|
|
215
|
+
const { type, keywords } = keywordDetect(text);
|
|
216
|
+
|
|
217
|
+
// Step 2: Jev-based confirmation for ambiguous cases
|
|
218
|
+
const jevResult = await jevClassify(text, type, keywords);
|
|
219
|
+
|
|
220
|
+
if (!jevResult.confirmed) {
|
|
221
|
+
return {
|
|
222
|
+
type: "general",
|
|
223
|
+
confidence: 0,
|
|
224
|
+
keywords: [],
|
|
225
|
+
module: "default",
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// Step 3: Build result based on confirmed intent
|
|
230
|
+
const confidence = jevResult.confidence || Math.min(1, keywords.length * 0.3);
|
|
231
|
+
|
|
232
|
+
if (type === "rea") {
|
|
233
|
+
return {
|
|
234
|
+
type: "rea",
|
|
235
|
+
confidence,
|
|
236
|
+
keywords,
|
|
237
|
+
module: "@pi-harness/rea",
|
|
238
|
+
guidance: "REA: Use Hopper/Ghidra/IDA for binary analysis. Check https://github.com/morluto/rea",
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
if (type === "file_copy") {
|
|
243
|
+
return {
|
|
244
|
+
type: "file_copy",
|
|
245
|
+
confidence,
|
|
246
|
+
keywords,
|
|
247
|
+
module: "@pi-harness/file-copy-helper",
|
|
248
|
+
guidance: "COPY: Use sudo cp instead of reading files first",
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
if (type === "code_review") {
|
|
253
|
+
return {
|
|
254
|
+
type: "code_review",
|
|
255
|
+
confidence,
|
|
256
|
+
keywords,
|
|
257
|
+
module: "@pi-harness/code-review",
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
if (type === "security") {
|
|
262
|
+
return {
|
|
263
|
+
type: "security",
|
|
264
|
+
confidence,
|
|
265
|
+
keywords,
|
|
266
|
+
module: "@pi-harness/security-auditor",
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
return {
|
|
271
|
+
type: "general",
|
|
272
|
+
confidence: 0,
|
|
273
|
+
keywords: [],
|
|
274
|
+
module: "default",
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Get REA knowledge base reference
|
|
280
|
+
*/
|
|
281
|
+
function getREAKnowledge(): string {
|
|
282
|
+
return `
|
|
283
|
+
## REA Integration - Reverse Engineering
|
|
284
|
+
|
|
285
|
+
When user requests reverse engineering or app analysis:
|
|
286
|
+
|
|
287
|
+
1. **Check REA capabilities**: https://github.com/morluto/rea
|
|
288
|
+
|
|
289
|
+
2. **Analysis Providers Available**:
|
|
290
|
+
- Hopper Disassembler (macOS native)
|
|
291
|
+
- Ghidra (cross-platform)
|
|
292
|
+
- IDA Pro (commercial)
|
|
293
|
+
- Pwntools (ELF/binary analysis)
|
|
294
|
+
- Browser CDP (web app inspection)
|
|
295
|
+
- Android APK (JADX decompilation)
|
|
296
|
+
|
|
297
|
+
3. **Key REA Workflow**:
|
|
298
|
+
- Setup REA MCP server with agent
|
|
299
|
+
- Agent asks "analyze this binary"
|
|
300
|
+
- REA routes to appropriate provider
|
|
301
|
+
- Evidence recorded to InvestigationRecords
|
|
302
|
+
- Agent summarizes findings
|
|
303
|
+
|
|
304
|
+
4. **No binary?** Use browser inspection:
|
|
305
|
+
- CDP for web apps
|
|
306
|
+
- Source maps for JS
|
|
307
|
+
- AST analysis for bundles
|
|
308
|
+
`;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Get file copy guidance
|
|
313
|
+
*/
|
|
314
|
+
function getFileCopyGuidance(): string {
|
|
315
|
+
return `
|
|
316
|
+
## File Copy - Use sudo cp
|
|
317
|
+
|
|
318
|
+
When user asks to mimic/clone/copy files:
|
|
319
|
+
|
|
320
|
+
1. **DO NOT read source files** - just copy directly
|
|
321
|
+
2. **Use sudo cp** - preserves permissions
|
|
322
|
+
3. **Copy recursively** with -r for folders
|
|
323
|
+
|
|
324
|
+
Examples:
|
|
325
|
+
\`\`\`bash
|
|
326
|
+
sudo cp /source/file.ts /dest/file.ts
|
|
327
|
+
sudo cp -r /source/folder/ /dest/folder/
|
|
328
|
+
\`\`\`
|
|
329
|
+
|
|
330
|
+
**STOP**: No read/cat/expand needed. Copy preserves everything.
|
|
331
|
+
`;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* Register the intent detector extension
|
|
336
|
+
*/
|
|
337
|
+
export function registerIntentDetector(pi: ExtensionAPI): void {
|
|
338
|
+
// Clear debug log on startup
|
|
339
|
+
fs.writeFileSync(DEBUG_LOG, `[${new Date().toISOString()}] === INTENT DETECTOR STARTED ===\n`);
|
|
340
|
+
|
|
341
|
+
debugLog("INIT", "Intent detector registered");
|
|
342
|
+
|
|
343
|
+
// Listen to input events
|
|
344
|
+
pi.on("input", async (event: InputEvent): Promise<InputEventResult | undefined> => {
|
|
345
|
+
// Only process user input
|
|
346
|
+
if (event.source !== "interactive") {
|
|
347
|
+
return;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
const text = event.text.trim();
|
|
351
|
+
if (!text || text.length < 5) {
|
|
352
|
+
return;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
// Detect intent with Jev classification
|
|
356
|
+
const intent = await detectIntent(text);
|
|
357
|
+
debugLog("DETECTED", intent);
|
|
358
|
+
|
|
359
|
+
// If high confidence, inject guidance
|
|
360
|
+
if (intent.confidence >= 0.5 && intent.type !== "general") {
|
|
361
|
+
let guidance = "";
|
|
362
|
+
|
|
363
|
+
if (intent.type === "rea") {
|
|
364
|
+
guidance = getREAKnowledge();
|
|
365
|
+
} else if (intent.type === "file_copy") {
|
|
366
|
+
guidance = getFileCopyGuidance();
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
if (guidance) {
|
|
370
|
+
debugLog("INJECT_GUIDANCE", { type: intent.type, confidence: intent.confidence });
|
|
371
|
+
return {
|
|
372
|
+
action: "transform",
|
|
373
|
+
text: text + guidance,
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
return;
|
|
379
|
+
});
|
|
380
|
+
|
|
381
|
+
// Broadcast intent for other modules
|
|
382
|
+
pi.on("input", async (event: InputEvent) => {
|
|
383
|
+
if (event.source !== "interactive") return;
|
|
384
|
+
|
|
385
|
+
const intent = await detectIntent(event.text);
|
|
386
|
+
debugLog("BROADCAST_INTENT", intent);
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
// Default export
|
|
391
|
+
export default function intentDetectorExtension(pi: ExtensionAPI): void {
|
|
392
|
+
registerIntentDetector(pi);
|
|
393
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"continuation-controller.d.ts","sourceRoot":"","sources":["../src/continuation-controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"continuation-controller.d.ts","sourceRoot":"","sources":["../src/continuation-controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAmBnD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC,4CAA4C;IAC5C,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,yCAAyC;IACzC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,qCAAqC;IACrC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,qCAAqC;IACrC,SAAS,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,UAAU,EAAE,OAAO,CAAC;IACpB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,aAAa,EAAE,MAAM,CAAC;IACtB,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;CACpC;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC,MAAM,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,KAAK,CAAC;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,qBAAa,0BAA0B;IACtC,OAAO,CAAC,EAAE,CAAe;IACzB,OAAO,CAAC,MAAM,CAA+B;IAC7C,OAAO,CAAC,YAAY,CAAwB;IAE5C,OAAO,CAAC,KAAK,CAYX;IAEF,YAAY,EAAE,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,kBAAkB,EASxD;IAED;;OAEG;IACH,QAAQ,IAAI,IAAI,CAwCf;IAED;;OAEG;YACW,oBAAoB;IA8DlC;;OAEG;YACW,YAAY;IAmB1B;;OAEG;IACG,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAmBnD;IAED;;OAEG;IACG,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAIjD;IAED;;OAEG;IACH,KAAK,IAAI,IAAI,CAIZ;IAED;;OAEG;IACH,OAAO,CAAC,KAAK;IAgBb;;OAEG;IACH,OAAO,CAAC,OAAO;IAMf;;OAEG;IACH,QAAQ,IAAI;QAAE,OAAO,EAAE,QAAQ,GAAG,IAAI,CAAC;QAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAM7E;CACD;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACrC,EAAE,EAAE,YAAY,EAChB,MAAM,CAAC,EAAE,kBAAkB,GACzB,0BAA0B,CAI5B"}
|
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
import { createTodoProvider } from "./todo-provider.js";
|
|
2
|
+
/**
|
|
3
|
+
* Simple debug logger that writes to file, not stdout
|
|
4
|
+
*/
|
|
5
|
+
const DEBUG_LOG_FILE = "/tmp/pi-harness-debug.log";
|
|
6
|
+
function debugLog(component, ...args) {
|
|
7
|
+
try {
|
|
8
|
+
const timestamp = new Date().toISOString();
|
|
9
|
+
const msg = `[${timestamp}] [${component}] ${args.map(a => String(a)).join(" ")}\n`;
|
|
10
|
+
import("node:fs").then(({ appendFileSync }) => {
|
|
11
|
+
appendFileSync(DEBUG_LOG_FILE, msg);
|
|
12
|
+
}).catch(() => { });
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
// Silently fail
|
|
16
|
+
}
|
|
17
|
+
}
|
|
2
18
|
/**
|
|
3
19
|
* Todo-Driven Continuation Controller
|
|
4
20
|
*
|
|
@@ -35,9 +51,11 @@ export class TodoContinuationController {
|
|
|
35
51
|
* Register lifecycle hooks
|
|
36
52
|
*/
|
|
37
53
|
register() {
|
|
54
|
+
debugLog("TodoContinuation", "Registering hooks");
|
|
38
55
|
// Session start - reset state
|
|
39
56
|
this.pi.on("session_start", () => {
|
|
40
57
|
this.reset();
|
|
58
|
+
debugLog("TodoContinuation", "Session started");
|
|
41
59
|
});
|
|
42
60
|
// Agent settled - evaluate continuation
|
|
43
61
|
this.pi.on("agent_settled", () => {
|
|
@@ -65,6 +83,7 @@ export class TodoContinuationController {
|
|
|
65
83
|
this.state.continuationQueued = false;
|
|
66
84
|
}
|
|
67
85
|
});
|
|
86
|
+
debugLog("TodoContinuation", "Lifecycle hooks registered");
|
|
68
87
|
}
|
|
69
88
|
/**
|
|
70
89
|
* Evaluate continuation decision and execute it
|
|
@@ -72,12 +91,14 @@ export class TodoContinuationController {
|
|
|
72
91
|
async evaluateContinuation() {
|
|
73
92
|
// 1. Check user pause
|
|
74
93
|
if (this.state.userPaused) {
|
|
94
|
+
debugLog("TodoContinuation", "User paused, stopping");
|
|
75
95
|
return;
|
|
76
96
|
}
|
|
77
97
|
// 2. Get current todo snapshot
|
|
78
98
|
const availability = await this.todoProvider.availability();
|
|
79
99
|
if (!availability.available) {
|
|
80
100
|
// No todo provider - don't auto-continue
|
|
101
|
+
debugLog("TodoContinuation", "Provider unavailable:", availability.error);
|
|
81
102
|
return;
|
|
82
103
|
}
|
|
83
104
|
try {
|
|
@@ -90,6 +111,7 @@ export class TodoContinuationController {
|
|
|
90
111
|
// 4. If there's work in progress, continue it
|
|
91
112
|
if (inProgressItems.length > 0) {
|
|
92
113
|
const item = inProgressItems[0];
|
|
114
|
+
debugLog("TodoContinuation", "In-progress item:", item.subject);
|
|
93
115
|
await this.continueItem(item);
|
|
94
116
|
return;
|
|
95
117
|
}
|
|
@@ -97,7 +119,7 @@ export class TodoContinuationController {
|
|
|
97
119
|
const totalItems = completedItems.length + pendingItems.length + inProgressItems.length;
|
|
98
120
|
const hasWork = pendingItems.length > 0 || inProgressItems.length > 0;
|
|
99
121
|
if (!hasWork && totalItems === 0) {
|
|
100
|
-
|
|
122
|
+
debugLog("TodoContinuation", "All items complete");
|
|
101
123
|
return;
|
|
102
124
|
}
|
|
103
125
|
if (pendingItems.length > 0) {
|
|
@@ -105,6 +127,8 @@ export class TodoContinuationController {
|
|
|
105
127
|
const blockedItems = await this.todoProvider.getBlocked();
|
|
106
128
|
if (blockedItems.length === pendingItems.length) {
|
|
107
129
|
// All pending items are blocked - don't auto-continue
|
|
130
|
+
const blocker = blockedItems[0];
|
|
131
|
+
debugLog("TodoContinuation", "Items blocked:", blocker?.subject);
|
|
108
132
|
return;
|
|
109
133
|
}
|
|
110
134
|
// Continue the first non-blocked pending item
|
|
@@ -114,8 +138,8 @@ export class TodoContinuationController {
|
|
|
114
138
|
}
|
|
115
139
|
}
|
|
116
140
|
}
|
|
117
|
-
catch {
|
|
118
|
-
|
|
141
|
+
catch (err) {
|
|
142
|
+
debugLog("TodoContinuation", "Evaluation error:", err);
|
|
119
143
|
}
|
|
120
144
|
}
|
|
121
145
|
/**
|
|
@@ -123,6 +147,7 @@ export class TodoContinuationController {
|
|
|
123
147
|
*/
|
|
124
148
|
async continueItem(item) {
|
|
125
149
|
if (this.state.steerAttempts >= this.config.maxSteerAttempts) {
|
|
150
|
+
debugLog("TodoContinuation", "Max steer attempts reached");
|
|
126
151
|
return;
|
|
127
152
|
}
|
|
128
153
|
this.state.steerAttempts++;
|
|
@@ -132,6 +157,7 @@ export class TodoContinuationController {
|
|
|
132
157
|
? `Continue task: ${item.subject}\n\n${item.description}`
|
|
133
158
|
: `Continue task: ${item.subject}`;
|
|
134
159
|
this.state.lastSteerMessage = message;
|
|
160
|
+
debugLog("TodoContinuation", "Continuing:", item.subject);
|
|
135
161
|
// Note: Pi does not expose sendUserMessage API.
|
|
136
162
|
// The Telegram notification system will prompt user for ambiguous cases.
|
|
137
163
|
}
|
|
@@ -140,6 +166,7 @@ export class TodoContinuationController {
|
|
|
140
166
|
*/
|
|
141
167
|
async steerToContinue(itemId) {
|
|
142
168
|
if (this.state.steerAttempts >= this.config.maxSteerAttempts) {
|
|
169
|
+
debugLog("TodoContinuation", "Max steer attempts reached");
|
|
143
170
|
return;
|
|
144
171
|
}
|
|
145
172
|
this.state.steerAttempts++;
|
|
@@ -151,11 +178,13 @@ export class TodoContinuationController {
|
|
|
151
178
|
: `Continue work on the next ready task.`;
|
|
152
179
|
this.state.lastSteerMessage = message;
|
|
153
180
|
this.state.todoRevision = snapshot.revision;
|
|
181
|
+
debugLog("TodoContinuation", "Steering to continue item", itemId);
|
|
154
182
|
}
|
|
155
183
|
/**
|
|
156
184
|
* Mark a todo item as complete
|
|
157
185
|
*/
|
|
158
186
|
async markComplete(_itemId) {
|
|
187
|
+
debugLog("TodoContinuation", "Marking item complete");
|
|
159
188
|
this.state.currentItemId = null;
|
|
160
189
|
this.state.generation++;
|
|
161
190
|
}
|
|
@@ -163,6 +192,7 @@ export class TodoContinuationController {
|
|
|
163
192
|
* User paused
|
|
164
193
|
*/
|
|
165
194
|
pause() {
|
|
195
|
+
debugLog("TodoContinuation", "User paused");
|
|
166
196
|
this.state.userPaused = true;
|
|
167
197
|
this.state.continuationQueued = false;
|
|
168
198
|
}
|
|
@@ -188,6 +218,7 @@ export class TodoContinuationController {
|
|
|
188
218
|
* Cleanup on shutdown
|
|
189
219
|
*/
|
|
190
220
|
cleanup() {
|
|
221
|
+
debugLog("TodoContinuation", "Cleaning up");
|
|
191
222
|
this.state.continuationQueued = false;
|
|
192
223
|
this.state.generation++;
|
|
193
224
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"continuation-controller.js","sourceRoot":"","sources":["../src/continuation-controller.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"continuation-controller.js","sourceRoot":"","sources":["../src/continuation-controller.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD;;GAEG;AACH,MAAM,cAAc,GAAG,2BAA2B,CAAC;AACnD,SAAS,QAAQ,CAAC,SAAiB,EAAE,GAAG,IAAe;IACtD,IAAI,CAAC;QACJ,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QAC3C,MAAM,GAAG,GAAG,IAAI,SAAS,MAAM,SAAS,KAAK,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC;QACpF,MAAM,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,cAAc,EAAE,EAAE,EAAE;YAC7C,cAAc,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IACpB,CAAC;IAAC,MAAM,CAAC;QACR,gBAAgB;IACjB,CAAC;AACF,CAAC;AA2CD;;;;GAIG;AACH,MAAM,OAAO,0BAA0B;IAC9B,EAAE,CAAe;IACjB,MAAM,CAA+B;IACrC,YAAY,GAAG,kBAAkB,EAAE,CAAC;IAEpC,KAAK,GAAsB;QAClC,SAAS,EAAE,EAAE;QACb,UAAU,EAAE,CAAC;QACb,YAAY,EAAE,CAAC;QACf,aAAa,EAAE,IAAI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