neoagent 2.1.1 → 2.1.2
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/lib/install_helpers.js +92 -0
- package/lib/manager.js +22 -46
- package/package.json +1 -1
- package/server/public/assets/fonts/MaterialIcons-Regular.otf +0 -0
- package/server/public/flutter_bootstrap.js +1 -1
- package/server/public/main.dart.js +54559 -54167
- package/server/routes/settings.js +38 -3
- package/server/services/ai/engine.js +11 -6
- package/server/services/ai/models.js +155 -25
- package/server/services/ai/providers/anthropic.js +2 -1
- package/server/services/ai/providers/grok.js +1 -1
- package/server/services/ai/providers/openai.js +2 -1
- package/server/services/ai/settings.js +131 -17
- package/server/services/android/controller.js +65 -6
- package/server/services/memory/manager.js +2 -2
- package/server/services/messaging/telegram.js +3 -36
- package/server/services/messaging/telnyx.js +28 -83
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
|
|
4
|
+
function withInstallEnv(extraEnv = {}) {
|
|
5
|
+
return {
|
|
6
|
+
...process.env,
|
|
7
|
+
PUPPETEER_SKIP_DOWNLOAD: process.env.PUPPETEER_SKIP_DOWNLOAD || 'true',
|
|
8
|
+
...extraEnv,
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function commandExists(runCommand, cmd) {
|
|
13
|
+
const result = runCommand('bash', ['-lc', `command -v ${cmd}`]);
|
|
14
|
+
return result.status === 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function hasBundledWebClient(webClientDir) {
|
|
18
|
+
return fs.existsSync(path.join(webClientDir, 'index.html'));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function buildBundledWebClientIfPossible({
|
|
22
|
+
flutterAppDir,
|
|
23
|
+
webClientDir,
|
|
24
|
+
runCommand,
|
|
25
|
+
commandExistsFn,
|
|
26
|
+
onMissingSources,
|
|
27
|
+
onUsingBundledClient,
|
|
28
|
+
onMissingFlutter,
|
|
29
|
+
onBuildStart,
|
|
30
|
+
onBuildSuccess,
|
|
31
|
+
onBuildFailed,
|
|
32
|
+
fail,
|
|
33
|
+
required = false,
|
|
34
|
+
}) {
|
|
35
|
+
if (!fs.existsSync(flutterAppDir)) {
|
|
36
|
+
if (hasBundledWebClient(webClientDir)) {
|
|
37
|
+
onUsingBundledClient?.();
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
if (required) {
|
|
41
|
+
fail(`Missing Flutter app sources at ${flutterAppDir}`);
|
|
42
|
+
}
|
|
43
|
+
onMissingSources?.();
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (!commandExistsFn('flutter')) {
|
|
48
|
+
if (hasBundledWebClient(webClientDir)) {
|
|
49
|
+
onMissingFlutter?.();
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
fail(
|
|
53
|
+
'Flutter SDK is required to build the web client because no bundled client was found.',
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
onBuildStart?.();
|
|
58
|
+
const build = runCommand(
|
|
59
|
+
'flutter',
|
|
60
|
+
[
|
|
61
|
+
'build',
|
|
62
|
+
'web',
|
|
63
|
+
'--output',
|
|
64
|
+
'../server/public',
|
|
65
|
+
`--dart-define=NEOAGENT_BACKEND_URL=${
|
|
66
|
+
process.env.NEOAGENT_BACKEND_URL || ''
|
|
67
|
+
}`,
|
|
68
|
+
],
|
|
69
|
+
{
|
|
70
|
+
cwd: flutterAppDir,
|
|
71
|
+
env: process.env,
|
|
72
|
+
},
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
if (build.status !== 0) {
|
|
76
|
+
if (hasBundledWebClient(webClientDir)) {
|
|
77
|
+
onBuildFailed?.();
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
fail('Flutter web build failed and no bundled web client is available.');
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
onBuildSuccess?.();
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
module.exports = {
|
|
88
|
+
buildBundledWebClientIfPossible,
|
|
89
|
+
commandExists,
|
|
90
|
+
hasBundledWebClient,
|
|
91
|
+
withInstallEnv,
|
|
92
|
+
};
|
package/lib/manager.js
CHANGED
|
@@ -5,6 +5,12 @@ const net = require('net');
|
|
|
5
5
|
const crypto = require('crypto');
|
|
6
6
|
const readline = require('readline');
|
|
7
7
|
const { spawn, spawnSync } = require('child_process');
|
|
8
|
+
const {
|
|
9
|
+
buildBundledWebClientIfPossible: buildWebClient,
|
|
10
|
+
commandExists: sharedCommandExists,
|
|
11
|
+
hasBundledWebClient,
|
|
12
|
+
withInstallEnv,
|
|
13
|
+
} = require('./install_helpers');
|
|
8
14
|
const {
|
|
9
15
|
APP_DIR,
|
|
10
16
|
RUNTIME_HOME,
|
|
@@ -164,17 +170,8 @@ function currentInstalledVersionLabel() {
|
|
|
164
170
|
return pkg;
|
|
165
171
|
}
|
|
166
172
|
|
|
167
|
-
function withInstallEnv(extraEnv = {}) {
|
|
168
|
-
return {
|
|
169
|
-
...process.env,
|
|
170
|
-
PUPPETEER_SKIP_DOWNLOAD: process.env.PUPPETEER_SKIP_DOWNLOAD || 'true',
|
|
171
|
-
...extraEnv
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
|
|
175
173
|
function commandExists(cmd) {
|
|
176
|
-
|
|
177
|
-
return res.status === 0;
|
|
174
|
+
return sharedCommandExists((command, args) => runQuiet(command, args), cmd);
|
|
178
175
|
}
|
|
179
176
|
|
|
180
177
|
function ensureLogDir() {
|
|
@@ -300,45 +297,24 @@ function installDependencies() {
|
|
|
300
297
|
logOk('Dependencies installed');
|
|
301
298
|
}
|
|
302
299
|
|
|
303
|
-
function hasBundledWebClient() {
|
|
304
|
-
return fs.existsSync(path.join(WEB_CLIENT_DIR, 'index.html'));
|
|
305
|
-
}
|
|
306
|
-
|
|
307
300
|
function buildBundledWebClientIfPossible({ required = false } = {}) {
|
|
308
301
|
heading('Web Client');
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
logWarn('Flutter
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
logWarn('Flutter SDK not found; using bundled web client');
|
|
325
|
-
return false;
|
|
326
|
-
}
|
|
327
|
-
throw new Error('Flutter SDK is required to build the web client because no bundled client was found.');
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
runOrThrow('flutter', [
|
|
331
|
-
'build',
|
|
332
|
-
'web',
|
|
333
|
-
'--output',
|
|
334
|
-
'../server/public',
|
|
335
|
-
`--dart-define=NEOAGENT_BACKEND_URL=${process.env.NEOAGENT_BACKEND_URL || ''}`
|
|
336
|
-
], {
|
|
337
|
-
cwd: FLUTTER_APP_DIR,
|
|
338
|
-
env: process.env
|
|
302
|
+
return buildWebClient({
|
|
303
|
+
flutterAppDir: FLUTTER_APP_DIR,
|
|
304
|
+
webClientDir: WEB_CLIENT_DIR,
|
|
305
|
+
runCommand: (command, args, options = {}) =>
|
|
306
|
+
runQuiet(command, args, options.stdio ? options : { ...options, stdio: 'inherit' }),
|
|
307
|
+
commandExistsFn: commandExists,
|
|
308
|
+
onMissingSources: () =>
|
|
309
|
+
logWarn('Flutter app sources not found; keeping existing bundled web client'),
|
|
310
|
+
onUsingBundledClient: () => logOk('Using bundled Flutter web client'),
|
|
311
|
+
onMissingFlutter: () => logWarn('Flutter SDK not found; using bundled web client'),
|
|
312
|
+
onBuildSuccess: () => logOk('Bundled Flutter web client updated'),
|
|
313
|
+
fail: (message) => {
|
|
314
|
+
throw new Error(message);
|
|
315
|
+
},
|
|
316
|
+
required,
|
|
339
317
|
});
|
|
340
|
-
logOk('Bundled Flutter web client updated');
|
|
341
|
-
return true;
|
|
342
318
|
}
|
|
343
319
|
|
|
344
320
|
function installMacService() {
|
package/package.json
CHANGED
|
Binary file
|
|
@@ -37,6 +37,6 @@ _flutter.buildConfig = {"engineRevision":"052f31d115eceda8cbff1b3481fcde4330c4ae
|
|
|
37
37
|
|
|
38
38
|
_flutter.loader.load({
|
|
39
39
|
serviceWorkerSettings: {
|
|
40
|
-
serviceWorkerVersion: "
|
|
40
|
+
serviceWorkerVersion: "4158642491" /* Flutter's service worker is deprecated and will be removed in a future Flutter release. */
|
|
41
41
|
}
|
|
42
42
|
});
|