@yeaft/webchat-agent 1.0.445 → 1.0.446
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/Dockerfile +5 -2
- package/cli.js +9 -0
- package/connection/upgrade.js +18 -0
- package/container-manager.js +1 -0
- package/index.js +5 -2
- package/local-runtime/agent/container-manager.js +1 -0
- package/local-runtime/server/handlers/client-misc.js +15 -0
- package/local-runtime/version.json +1 -1
- package/local-runtime/web/app.bundle.js +25 -25
- package/local-runtime/web/app.bundle.js.gz +0 -0
- package/local-runtime/web/index.html +1 -1
- package/package.json +1 -1
- package/upgrade-command.js +19 -0
|
Binary file
|
package/package.json
CHANGED
package/upgrade-command.js
CHANGED
|
@@ -5,6 +5,25 @@ import { setTimeout as delay } from 'node:timers/promises';
|
|
|
5
5
|
|
|
6
6
|
export const DEFAULT_UPGRADE_REGISTRY = 'https://pkg.yeaft.com/';
|
|
7
7
|
export const SAFE_REMOTE_UPGRADE_CAPABILITY = 'remote_upgrade_safe';
|
|
8
|
+
export const CONTAINER_AGENT_CAPABILITY = 'container_agent';
|
|
9
|
+
export const CONTAINER_IMAGE_UPGRADE_REASON = 'container_image_upgrade_required';
|
|
10
|
+
|
|
11
|
+
export function isContainerAgentRuntime(env = process.env) {
|
|
12
|
+
return String(env?.YEAFT_AGENT_RUNTIME || '').trim() === CONTAINER_AGENT_CAPABILITY;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function getAgentUpgradeCapability(env = process.env) {
|
|
16
|
+
return isContainerAgentRuntime(env) ? CONTAINER_AGENT_CAPABILITY : SAFE_REMOTE_UPGRADE_CAPABILITY;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function buildContainerImageUpgradeMessage(version = null) {
|
|
20
|
+
const subject = version ? `Container Agent v${version}` : 'This Container Agent';
|
|
21
|
+
return `${subject} is managed as a Docker image and cannot upgrade itself with npm. ` +
|
|
22
|
+
'On the Docker Host, run "docker pull <configured-agent-image>", then recreate the same container ' +
|
|
23
|
+
'through the existing Server/Sandbox lifecycle or the original "yeaft-agent container install" command. ' +
|
|
24
|
+
'Keep the existing /home/yeaft/.yeaft and /workspace persistent volumes and reuse the original host-side ' +
|
|
25
|
+
'0600 agent-secret file; do not remove those volumes during recreation.';
|
|
26
|
+
}
|
|
8
27
|
|
|
9
28
|
const WINDOWS_UPGRADE_LOCK_NAME = 'active.lock';
|
|
10
29
|
|