@aiyiran/myclaw 1.1.133 → 1.1.134

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.
@@ -179,12 +179,18 @@ function run(cliArgs) {
179
179
  if (agent.agentDir) agentDirs.set(agent.agentDir, agent.id);
180
180
  }
181
181
 
182
- // 检测 openclaw 版本,决定写入目标
183
- // 6.X 使用 node:sqlite (DatabaseSync),5.X 使用 auth-profiles.json
182
+ // 写入目标说明:
183
+ // - auth-profiles.json:所有模式都写(5.X 鉴权源,6.X 仅作展示/审计,不参与运行时加载)
184
+ // - openclaw-agent.sqlite:仅 --beta 写(6.X 运行时唯一的鉴权源)
185
+ // 6.X 运行时只从 SQLite 的 auth_profile_store 读 key,完全不读 auth-profiles.json,
186
+ // 因此 6.X 必须靠 --beta 写 SQLite 才能让 minimax 鉴权成功。
187
+ // 非 --beta 模式不碰 SQLite,避免覆盖其他 provider 已有的凭据。
184
188
  let DatabaseSync = null;
185
- try {
186
- ({ DatabaseSync } = require('node:sqlite'));
187
- } catch { /* Node < 22,无内置 sqlite,用 JSON 方式 */ }
189
+ if (betaMode) {
190
+ try {
191
+ ({ DatabaseSync } = require('node:sqlite'));
192
+ } catch { /* Node < 22,无内置 sqlite */ }
193
+ }
188
194
 
189
195
  const SQLITE_SCHEMA = `
190
196
  CREATE TABLE IF NOT EXISTS auth_profile_store (
@@ -218,9 +224,9 @@ CREATE TABLE IF NOT EXISTS auth_profile_state (
218
224
  profiles.lastGood["minimax"] = "minimax:cn";
219
225
  try { fs.writeFileSync(profilesPath, JSON.stringify(profiles, null, 2) + '\n', 'utf8'); } catch { /* ignore */ }
220
226
 
221
- // ── 6.X:写入 openclaw-agent.sqlite ──
227
+ // ── 6.X (--beta):写入 openclaw-agent.sqlite(运行时唯一鉴权源)──
222
228
  let sqliteOk = false;
223
- if (DatabaseSync) {
229
+ if (DatabaseSync) { // 仅 betaMode 下 DatabaseSync 才被赋值
224
230
  const dbPath = path.join(agentDir, 'openclaw-agent.sqlite');
225
231
  try {
226
232
  const db = new DatabaseSync(dbPath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiyiran/myclaw",
3
- "version": "1.1.133",
3
+ "version": "1.1.134",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {