@ryantest/openclaw-qqbot 1.6.7-beta.4 → 1.6.7-beta.6
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/README.md +1 -1
- package/README.zh.md +1 -1
- package/dist/src/commands/bot-clear-storage.d.ts +1 -0
- package/dist/src/commands/bot-clear-storage.js +157 -0
- package/dist/src/commands/bot-help.d.ts +1 -0
- package/dist/src/commands/bot-help.js +24 -0
- package/dist/src/commands/bot-logs.d.ts +1 -0
- package/dist/src/commands/bot-logs.js +232 -0
- package/dist/src/commands/bot-ping.d.ts +1 -0
- package/dist/src/commands/bot-ping.js +29 -0
- package/dist/src/commands/bot-upgrade.d.ts +1 -0
- package/dist/src/commands/bot-upgrade.js +252 -0
- package/dist/src/commands/bot-version.d.ts +1 -0
- package/dist/src/commands/bot-version.js +33 -0
- package/dist/src/slash-commands.d.ts +21 -6
- package/dist/src/slash-commands.js +35 -1455
- package/dist/src/upgrade-utils.d.ts +74 -0
- package/dist/src/upgrade-utils.js +634 -0
- package/package.json +1 -1
- package/scripts/upgrade-via-npm.sh +23 -7
- package/src/commands/bot-clear-storage.ts +176 -0
- package/src/commands/bot-help.ts +26 -0
- package/src/commands/bot-logs.ts +234 -0
- package/src/commands/bot-ping.ts +31 -0
- package/src/commands/bot-upgrade.ts +281 -0
- package/src/commands/bot-version.ts +32 -0
- package/src/slash-commands.ts +33 -1522
- package/src/upgrade-utils.ts +673 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 热更新相关工具函数
|
|
3
|
+
*
|
|
4
|
+
* 包含:框架版本检测、CLI 查找、升级脚本查找/下载/复制、
|
|
5
|
+
* 环境兼容性检查、配置操作、热更新执行引擎
|
|
6
|
+
*/
|
|
7
|
+
export declare function getFrameworkVersion(): string;
|
|
8
|
+
/**
|
|
9
|
+
* 解析框架版本字符串中的日期版本号
|
|
10
|
+
* 输入示例: "OpenClaw 2026.3.13 (61d171a)" → "2026.3.13"
|
|
11
|
+
*/
|
|
12
|
+
export declare function parseFrameworkDateVersion(versionStr: string): string | null;
|
|
13
|
+
/**
|
|
14
|
+
* 找到 CLI 命令名或完整路径(openclaw / clawdbot / moltbot)
|
|
15
|
+
*/
|
|
16
|
+
export declare function findCli(): string | null;
|
|
17
|
+
/**
|
|
18
|
+
* 同步执行 CLI 命令。
|
|
19
|
+
*/
|
|
20
|
+
export declare function execCliSync(cliPath: string, args: string[]): string | null;
|
|
21
|
+
/**
|
|
22
|
+
* 异步执行 CLI 命令。
|
|
23
|
+
*/
|
|
24
|
+
export declare function execCliAsync(cliPath: string, args: string[], opts: {
|
|
25
|
+
timeout?: number;
|
|
26
|
+
env?: NodeJS.ProcessEnv;
|
|
27
|
+
windowsHide?: boolean;
|
|
28
|
+
}, cb: (error: Error | null, stdout: string, stderr: string) => void): void;
|
|
29
|
+
/**
|
|
30
|
+
* 找到升级脚本路径(兼容源码运行、dist 运行、已安装扩展目录、pnpm 全局、打包环境)
|
|
31
|
+
*/
|
|
32
|
+
export declare function getUpgradeScriptPath(): string | null;
|
|
33
|
+
/**
|
|
34
|
+
* 将升级脚本复制到临时位置
|
|
35
|
+
*/
|
|
36
|
+
export declare function copyScriptToTemp(scriptPath: string): string | null;
|
|
37
|
+
/**
|
|
38
|
+
* 从远端下载升级脚本到临时目录,返回临时脚本路径,失败返回 null。
|
|
39
|
+
*/
|
|
40
|
+
export declare function downloadRemoteUpgradeScript(): string | null;
|
|
41
|
+
/**
|
|
42
|
+
* 清理临时升级脚本目录
|
|
43
|
+
*/
|
|
44
|
+
export declare function cleanupTempScript(): void;
|
|
45
|
+
export interface UpgradeCompatResult {
|
|
46
|
+
ok: boolean;
|
|
47
|
+
errors: string[];
|
|
48
|
+
warnings: string[];
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* 检查当前环境是否满足热更新要求
|
|
52
|
+
*/
|
|
53
|
+
export declare function checkUpgradeCompatibility(): UpgradeCompatResult;
|
|
54
|
+
export declare function findBash(): string | null;
|
|
55
|
+
export declare function findPowerShell(): string | null;
|
|
56
|
+
/**
|
|
57
|
+
* 将 openclaw.json 中的 qqbot 插件 source 从 "path" 切换为 "npm"。
|
|
58
|
+
*/
|
|
59
|
+
export declare function switchPluginSourceToNpm(): void;
|
|
60
|
+
/**
|
|
61
|
+
* 热更新前保存当前账户的 appId/secret 到暂存文件。
|
|
62
|
+
*/
|
|
63
|
+
export declare function preUpgradeCredentialBackup(accountId: string, appId: string): void;
|
|
64
|
+
export declare function saveUpgradeGreetingTarget(accountId: string, appId: string, openid: string): void;
|
|
65
|
+
export declare function isUpgrading(): boolean;
|
|
66
|
+
export declare function setUpgrading(v: boolean): void;
|
|
67
|
+
export type HotUpgradeStartResult = {
|
|
68
|
+
ok: boolean;
|
|
69
|
+
reason?: "no-script" | "no-cli" | "no-bash" | "no-powershell";
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* 执行热更新:执行脚本(--no-restart) → 立即触发 gateway restart
|
|
73
|
+
*/
|
|
74
|
+
export declare function fireHotUpgrade(targetVersion?: string, pkg?: string, useLocal?: boolean): HotUpgradeStartResult;
|