libero3 0.3.2 → 0.3.3
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/dist/mcp/server-core.js +14 -0
- package/package.json +1 -1
package/dist/mcp/server-core.js
CHANGED
|
@@ -1293,6 +1293,20 @@ export function createToolRuntime(db) {
|
|
|
1293
1293
|
// MV-COACH-3 Slice 2: resolve default user_id once at server build
|
|
1294
1294
|
const defaultUser = resolveDefaultUserId({ db, env: process.env });
|
|
1295
1295
|
logResolvedDefaultUserId(defaultUser);
|
|
1296
|
+
// 2026-09-09 空库首跑自动建档(WorkBuddy 云/PC 双端实测 needs_confirm 陷阱:
|
|
1297
|
+
// env 只定 id 不建档 → 首个写操作被门拦 → agent 死循环重试)。空库才动,存量库零影响。
|
|
1298
|
+
{
|
|
1299
|
+
const { c } = db
|
|
1300
|
+
.prepare("SELECT COUNT(*) AS c FROM user_profile WHERE deleted_at IS NULL")
|
|
1301
|
+
.get();
|
|
1302
|
+
if (c === 0) {
|
|
1303
|
+
const uid = defaultUser.userId ?? "libero";
|
|
1304
|
+
const now = new Date().toISOString().replace("T", " ").replace("Z", "");
|
|
1305
|
+
db.prepare(`INSERT INTO user_profile (id, display_name, default_confirmed_at, created_at, updated_at)
|
|
1306
|
+
VALUES (?, ?, ?, ?, ?)`).run(uid, uid, now, now, now);
|
|
1307
|
+
console.error(`[libero-mcp] 空库首跑:已自动建档默认用户 ${uid}(needs_confirm 门槛不再出现)`);
|
|
1308
|
+
}
|
|
1309
|
+
}
|
|
1296
1310
|
const injector = makeUserIdInjector(defaultUser.userId, db);
|
|
1297
1311
|
const repos = createRepos(db);
|
|
1298
1312
|
const categories = createCategoryTools(repos.categoryRepo);
|