neoagent 2.3.1-beta.74 → 2.3.1-beta.75
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/server/public/.last_build_id +1 -1
- package/server/public/flutter_bootstrap.js +1 -1
- package/server/public/main.dart.js +4 -4
- package/server/routes/triggers.js +5 -5
- package/server/services/runtime/backends/local-vm.js +8 -0
- package/server/services/runtime/qemu.js +13 -1
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
5fa6e453e140f8414c821572dfe267cf
|
|
@@ -37,6 +37,6 @@ _flutter.buildConfig = {"engineRevision":"42d3d75a56efe1a2e9902f52dc8006099c45d9
|
|
|
37
37
|
|
|
38
38
|
_flutter.loader.load({
|
|
39
39
|
serviceWorkerSettings: {
|
|
40
|
-
serviceWorkerVersion: "
|
|
40
|
+
serviceWorkerVersion: "2042185359" /* Flutter's service worker is deprecated and will be removed in a future Flutter release. */
|
|
41
41
|
}
|
|
42
42
|
});
|
|
@@ -127331,7 +127331,7 @@ r===$&&A.b()
|
|
|
127331
127331
|
o.push(A.id(p,A.iS(!1,new A.a3(B.tF,A.e_(new A.cU(B.h8,new A.a5o(r,p),p),p,p),p),!1,B.I,!0),p,p,0,0,0,p))}r=!1
|
|
127332
127332
|
if(!s.ay)if(!s.ch){r=s.e
|
|
127333
127333
|
r===$&&A.b()
|
|
127334
|
-
r=B.b.A("
|
|
127334
|
+
r=B.b.A("mp2fcpgc-823b5fa").length!==0&&r.b}if(r){r=s.d
|
|
127335
127335
|
r===$&&A.b()
|
|
127336
127336
|
r=r.V&&!r.a0?84:0
|
|
127337
127337
|
q=s.e
|
|
@@ -131991,7 +131991,7 @@ $S:324}
|
|
|
131991
131991
|
A.Y_.prototype={}
|
|
131992
131992
|
A.R_.prototype={
|
|
131993
131993
|
mJ(a){var s=this
|
|
131994
|
-
if(B.b.A("
|
|
131994
|
+
if(B.b.A("mp2fcpgc-823b5fa").length===0||s.a!=null)return
|
|
131995
131995
|
s.zY()
|
|
131996
131996
|
s.a=A.pN(B.Pq,new A.b3i(s))},
|
|
131997
131997
|
zY(){var s=0,r=A.l(t.H),q,p=2,o=[],n=this,m,l,k,j,i,h,g,f
|
|
@@ -132009,7 +132009,7 @@ if(!t.f.b(k)){s=1
|
|
|
132009
132009
|
break}i=J.Z(k,"buildId")
|
|
132010
132010
|
h=i==null?null:B.b.A(J.r(i))
|
|
132011
132011
|
j=h==null?"":h
|
|
132012
|
-
if(J.bi(j)===0||J.c(j,"
|
|
132012
|
+
if(J.bi(j)===0||J.c(j,"mp2fcpgc-823b5fa")){s=1
|
|
132013
132013
|
break}n.b=!0
|
|
132014
132014
|
n.J()
|
|
132015
132015
|
p=2
|
|
@@ -132026,7 +132026,7 @@ case 2:return A.i(o.at(-1),r)}})
|
|
|
132026
132026
|
return A.k($async$zY,r)},
|
|
132027
132027
|
v0(){var s=0,r=A.l(t.H),q,p=2,o=[],n=this,m,l,k,j,i,h,g,f,e,d,c,b,a,a0,a1
|
|
132028
132028
|
var $async$v0=A.h(function(a2,a3){if(a2===1){o.push(a3)
|
|
132029
|
-
s=p}for(;;)switch(s){case 0:if(B.b.A("
|
|
132029
|
+
s=p}for(;;)switch(s){case 0:if(B.b.A("mp2fcpgc-823b5fa").length===0||n.c){s=1
|
|
132030
132030
|
break}n.c=!0
|
|
132031
132031
|
n.J()
|
|
132032
132032
|
p=4
|
|
@@ -45,23 +45,23 @@ router.post('/notification', async (req, res) => {
|
|
|
45
45
|
const { app_package, title, body, action_taken } = req.body;
|
|
46
46
|
|
|
47
47
|
try {
|
|
48
|
-
const userRow = db.prepare('SELECT id FROM users WHERE id = ?').get(req.
|
|
48
|
+
const userRow = db.prepare('SELECT id FROM users WHERE id = ?').get(req.session.userId);
|
|
49
49
|
if (!userRow) return res.status(401).json({ error: 'Unauthorized' });
|
|
50
50
|
|
|
51
|
-
console.log(`[Triggers] Notification received: ${app_package} - ${title}`);
|
|
51
|
+
console.log(`[Triggers] Notification received: ${app_package} - ${title} for user ${req.session.userId}`);
|
|
52
52
|
|
|
53
53
|
db.prepare(`
|
|
54
54
|
INSERT INTO notification_history (user_id, app_package, title, body, action_taken)
|
|
55
55
|
VALUES (?, ?, ?, ?, ?)
|
|
56
|
-
`).run(req.
|
|
56
|
+
`).run(req.session.userId, app_package || 'unknown', title || '', body || '', action_taken || 'none');
|
|
57
57
|
|
|
58
58
|
// Notify agent engine to proactively evaluate the notification
|
|
59
59
|
const agentEngine = req.app.locals.agentEngine;
|
|
60
60
|
if (agentEngine) {
|
|
61
|
-
const defaultAgentId = db.prepare('SELECT id FROM agents WHERE user_id = ? ORDER BY is_default DESC LIMIT 1').get(req.
|
|
61
|
+
const defaultAgentId = db.prepare('SELECT id FROM agents WHERE user_id = ? ORDER BY is_default DESC LIMIT 1').get(req.session.userId)?.id;
|
|
62
62
|
|
|
63
63
|
if (defaultAgentId) {
|
|
64
|
-
agentEngine.handleBackgroundTrigger(req.
|
|
64
|
+
agentEngine.handleBackgroundTrigger(req.session.userId, defaultAgentId, {
|
|
65
65
|
source: 'notification',
|
|
66
66
|
app_package,
|
|
67
67
|
title,
|
|
@@ -33,10 +33,14 @@ class RuntimeHttpClient {
|
|
|
33
33
|
async waitForHealth(options = {}) {
|
|
34
34
|
const timeoutMs = Number(options.timeoutMs || 120000);
|
|
35
35
|
const intervalMs = Number(options.intervalMs || 1000);
|
|
36
|
+
const checkLiveness = options.checkLiveness || (() => true);
|
|
36
37
|
const startedAt = Date.now();
|
|
37
38
|
let lastError = null;
|
|
38
39
|
|
|
39
40
|
while (Date.now() - startedAt < timeoutMs) {
|
|
41
|
+
if (!checkLiveness()) {
|
|
42
|
+
throw new Error('Guest runtime process exited unexpectedly during bootstrap.');
|
|
43
|
+
}
|
|
40
44
|
const elapsed = Math.round((Date.now() - startedAt) / 1000);
|
|
41
45
|
try {
|
|
42
46
|
const health = await this.request('GET', '/health', undefined, { timeoutMs: 2000 });
|
|
@@ -368,6 +372,10 @@ class LocalVmExecutionBackend {
|
|
|
368
372
|
try {
|
|
369
373
|
await client.waitForHealth({
|
|
370
374
|
timeoutMs: Number(process.env.NEOAGENT_VM_BOOT_TIMEOUT_MS || 20 * 60 * 1000),
|
|
375
|
+
checkLiveness: () => {
|
|
376
|
+
const session = this.vmManager.instances.get(userId);
|
|
377
|
+
return session && session.process && !session.process.killed && session.process.exitCode === null;
|
|
378
|
+
},
|
|
371
379
|
});
|
|
372
380
|
} catch (error) {
|
|
373
381
|
const runtimeError = typeof session.getLastError === 'function' ? session.getLastError() : '';
|
|
@@ -623,8 +623,20 @@ class QemuVmManager {
|
|
|
623
623
|
let lastError = '';
|
|
624
624
|
const stderrDecoder = new StringDecoder('utf8');
|
|
625
625
|
child.stderr.on('data', (chunk) => {
|
|
626
|
-
|
|
626
|
+
const text = stderrDecoder.write(chunk);
|
|
627
|
+
if (text.trim()) console.error(`[VM:${key}:stderr] ${text.trim()}`);
|
|
628
|
+
lastError = [...`${lastError}${text}`].slice(-4000).join('');
|
|
627
629
|
});
|
|
630
|
+
|
|
631
|
+
if (consoleLogPath) {
|
|
632
|
+
// Stream serial output to console for easier debugging on remote machines
|
|
633
|
+
const serialStream = fs.createReadStream(consoleLogPath, { flags: 'r' });
|
|
634
|
+
serialStream.on('data', (chunk) => {
|
|
635
|
+
const text = chunk.toString('utf8');
|
|
636
|
+
if (text.trim()) console.log(`[VM:${key}:serial] ${text.trim()}`);
|
|
637
|
+
});
|
|
638
|
+
child.on('exit', () => serialStream.destroy());
|
|
639
|
+
}
|
|
628
640
|
child.stderr.on('close', () => {
|
|
629
641
|
const remainder = stderrDecoder.end();
|
|
630
642
|
if (remainder) {
|