@agent-webui/ai-desk 1.0.56 → 1.0.58
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/bin/aidesk.js +5 -32
- package/package.json +3 -3
package/bin/aidesk.js
CHANGED
|
@@ -7,7 +7,6 @@ const { spawnSync } = require('child_process');
|
|
|
7
7
|
const PACKAGE_NAME = '@agent-webui/ai-desk';
|
|
8
8
|
const SKIP_UPDATE_ENV = 'AI_DESK_SKIP_SELF_UPDATE';
|
|
9
9
|
const UPDATE_COMMANDS = new Set(['start', 'restart']);
|
|
10
|
-
const OFFICIAL_NPM_REGISTRY = 'https://registry.npmjs.org/';
|
|
11
10
|
|
|
12
11
|
function readJSON(filePath) {
|
|
13
12
|
return JSON.parse(fs.readFileSync(filePath, 'utf8'));
|
|
@@ -69,40 +68,14 @@ function runNpm(args, options = {}) {
|
|
|
69
68
|
});
|
|
70
69
|
}
|
|
71
70
|
|
|
72
|
-
function npmOutput(result) {
|
|
73
|
-
return `${result.stderr || ''}${result.stdout || ''}`.trim();
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
function withOfficialRegistry(args) {
|
|
77
|
-
return [...args, `--registry=${OFFICIAL_NPM_REGISTRY}`];
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function runNpmWithRegistryFallback(args, options = {}) {
|
|
81
|
-
const primaryResult = runNpm(withOfficialRegistry(args), options);
|
|
82
|
-
if (primaryResult.status === 0) {
|
|
83
|
-
return primaryResult;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
const fallbackResult = runNpm(args, options);
|
|
87
|
-
if (fallbackResult.status === 0) {
|
|
88
|
-
return fallbackResult;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
fallbackResult.primaryError = npmOutput(primaryResult);
|
|
92
|
-
return fallbackResult;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
71
|
function latestPublishedVersion() {
|
|
96
|
-
const result =
|
|
72
|
+
const result = runNpm(['view', PACKAGE_NAME, 'version'], {
|
|
97
73
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
98
74
|
});
|
|
99
75
|
|
|
100
76
|
if (result.status !== 0) {
|
|
101
|
-
const output =
|
|
102
|
-
|
|
103
|
-
const fallbackError = output ? `Fallback registry error: ${output}` : '';
|
|
104
|
-
const errorMessage = `${primaryError}${fallbackError}`.trim();
|
|
105
|
-
throw new Error(errorMessage || 'Unable to check npm registry');
|
|
77
|
+
const output = `${result.stderr || ''}${result.stdout || ''}`.trim();
|
|
78
|
+
throw new Error(output || 'Unable to check npm registry');
|
|
106
79
|
}
|
|
107
80
|
|
|
108
81
|
return String(result.stdout || '').trim();
|
|
@@ -160,13 +133,13 @@ function installLatestVersion(latestVersion) {
|
|
|
160
133
|
const installTarget = `${PACKAGE_NAME}@${latestVersion}`;
|
|
161
134
|
|
|
162
135
|
if (projectRoot) {
|
|
163
|
-
return
|
|
136
|
+
return runNpm(['install', installTarget, '--include=optional'], {
|
|
164
137
|
cwd: projectRoot,
|
|
165
138
|
stdio: 'inherit',
|
|
166
139
|
});
|
|
167
140
|
}
|
|
168
141
|
|
|
169
|
-
return
|
|
142
|
+
return runNpm(['install', '-g', installTarget, '--include=optional'], {
|
|
170
143
|
stdio: 'inherit',
|
|
171
144
|
});
|
|
172
145
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-webui/ai-desk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.58",
|
|
4
4
|
"description": "Single-install AI Desk package with daemon and default harnesses",
|
|
5
5
|
"bin": {
|
|
6
6
|
"aidesk": "bin/aidesk.js"
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"README.md"
|
|
15
15
|
],
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@agent-webui/ai-desk-daemon": "1.0.
|
|
18
|
-
"@agent-webui/ai-desk-harness-gimp": "1.0.
|
|
17
|
+
"@agent-webui/ai-desk-daemon": "1.0.58",
|
|
18
|
+
"@agent-webui/ai-desk-harness-gimp": "1.0.58"
|
|
19
19
|
},
|
|
20
20
|
"license": "MIT"
|
|
21
21
|
}
|