@gricha/perry 0.3.8 → 0.3.9
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/dist/agent/index.js +8 -0
- package/dist/docker/eager-pull.js +16 -3
- package/dist/perry-worker +0 -0
- package/dist/session-manager/adapters/claude.js +6 -1
- package/dist/session-manager/adapters/opencode.js +7 -1
- package/dist/terminal/base-handler.js +10 -1
- package/dist/worker/session-index.js +4 -2
- package/package.json +1 -1
package/dist/agent/index.js
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { startAgent } from './run';
|
|
3
|
+
process.on('unhandledRejection', (reason, promise) => {
|
|
4
|
+
console.error('[agent] Unhandled promise rejection:', reason);
|
|
5
|
+
console.error('[agent] Promise:', promise);
|
|
6
|
+
});
|
|
7
|
+
process.on('uncaughtException', (err) => {
|
|
8
|
+
console.error('[agent] Uncaught exception:', err);
|
|
9
|
+
process.exit(1);
|
|
10
|
+
});
|
|
3
11
|
startAgent().catch((err) => {
|
|
4
12
|
console.error('[agent] Fatal error:', err);
|
|
5
13
|
process.exit(1);
|
|
@@ -53,7 +53,12 @@ export async function startEagerImagePull() {
|
|
|
53
53
|
if (attempt === 1) {
|
|
54
54
|
console.log('[agent] Docker not available - will retry in background');
|
|
55
55
|
}
|
|
56
|
-
const timer = setTimeout(() =>
|
|
56
|
+
const timer = setTimeout(() => {
|
|
57
|
+
attemptPull(attempt + 1).catch((err) => {
|
|
58
|
+
console.error('[agent] Error during image pull retry:', err);
|
|
59
|
+
pullInProgress = false;
|
|
60
|
+
});
|
|
61
|
+
}, RETRY_INTERVAL_MS);
|
|
57
62
|
timer.unref();
|
|
58
63
|
return;
|
|
59
64
|
}
|
|
@@ -63,11 +68,19 @@ export async function startEagerImagePull() {
|
|
|
63
68
|
pullInProgress = false;
|
|
64
69
|
}
|
|
65
70
|
else if (!signal.aborted) {
|
|
66
|
-
const timer = setTimeout(() =>
|
|
71
|
+
const timer = setTimeout(() => {
|
|
72
|
+
attemptPull(attempt + 1).catch((err) => {
|
|
73
|
+
console.error('[agent] Error during image pull retry:', err);
|
|
74
|
+
pullInProgress = false;
|
|
75
|
+
});
|
|
76
|
+
}, RETRY_INTERVAL_MS);
|
|
67
77
|
timer.unref();
|
|
68
78
|
}
|
|
69
79
|
};
|
|
70
|
-
attemptPull(1)
|
|
80
|
+
attemptPull(1).catch((err) => {
|
|
81
|
+
console.error('[agent] Error during initial image pull:', err);
|
|
82
|
+
pullInProgress = false;
|
|
83
|
+
});
|
|
71
84
|
}
|
|
72
85
|
export function stopEagerImagePull() {
|
|
73
86
|
if (abortController) {
|
package/dist/perry-worker
CHANGED
|
Binary file
|
|
@@ -85,8 +85,13 @@ export class ClaudeCodeAdapter {
|
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
87
|
this.terminal = this.process.terminal;
|
|
88
|
-
this.process.exited
|
|
88
|
+
this.process.exited
|
|
89
|
+
.then((code) => {
|
|
89
90
|
this.handleProcessExit(code);
|
|
91
|
+
})
|
|
92
|
+
.catch((err) => {
|
|
93
|
+
console.error('[claude] Process exit error:', err);
|
|
94
|
+
this.handleProcessExit(1);
|
|
90
95
|
});
|
|
91
96
|
}
|
|
92
97
|
buildCommand(userMessage) {
|
|
@@ -377,7 +377,13 @@ export class OpenCodeAdapter {
|
|
|
377
377
|
resolved = true;
|
|
378
378
|
reject(new Error('SSE stream ended unexpectedly without session.idle'));
|
|
379
379
|
}
|
|
380
|
-
})()
|
|
380
|
+
})().catch((err) => {
|
|
381
|
+
clearTimeout(timeout);
|
|
382
|
+
if (!resolved) {
|
|
383
|
+
resolved = true;
|
|
384
|
+
reject(err);
|
|
385
|
+
}
|
|
386
|
+
});
|
|
381
387
|
});
|
|
382
388
|
}
|
|
383
389
|
cleanup() {
|
|
@@ -28,12 +28,21 @@ export class BaseTerminalSession {
|
|
|
28
28
|
},
|
|
29
29
|
});
|
|
30
30
|
this.terminal = this.process.terminal;
|
|
31
|
-
this.process.exited
|
|
31
|
+
this.process.exited
|
|
32
|
+
.then((code) => {
|
|
32
33
|
this.process = null;
|
|
33
34
|
this.terminal = null;
|
|
34
35
|
if (this.onExit) {
|
|
35
36
|
this.onExit(code);
|
|
36
37
|
}
|
|
38
|
+
})
|
|
39
|
+
.catch((err) => {
|
|
40
|
+
console.error('[terminal] Process exit error:', err);
|
|
41
|
+
this.process = null;
|
|
42
|
+
this.terminal = null;
|
|
43
|
+
if (this.onExit) {
|
|
44
|
+
this.onExit(1);
|
|
45
|
+
}
|
|
37
46
|
});
|
|
38
47
|
}
|
|
39
48
|
write(data) {
|
|
@@ -176,8 +176,10 @@ class SessionIndex {
|
|
|
176
176
|
if (entry?.debounceTimer) {
|
|
177
177
|
clearTimeout(entry.debounceTimer);
|
|
178
178
|
}
|
|
179
|
-
const timer = setTimeout(
|
|
180
|
-
|
|
179
|
+
const timer = setTimeout(() => {
|
|
180
|
+
this.handleFileChange(dir, filename, agentType).catch((err) => {
|
|
181
|
+
console.error('[session-index] Error handling file change:', err);
|
|
182
|
+
});
|
|
181
183
|
}, 100);
|
|
182
184
|
if (entry) {
|
|
183
185
|
entry.debounceTimer = timer;
|