abtars 0.2.2 → 0.2.3-alpha.0
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/bundle/{_registry.generated-KYX63MGY.js → _registry.generated-KM6LXTNJ.js} +2 -2
- package/bundle/abtars-cli.js +6 -3
- package/bundle/abtars-cli.js.map +2 -2
- package/bundle/abtars.js +29 -28
- package/bundle/abtars.js.map +3 -3
- package/bundle/{agent-registry-PIS5XJHX.js → agent-registry-ABPFQXNL.js} +2 -2
- package/bundle/{chunk-QSC6QZ44.js → chunk-2SFN2VYD.js} +2 -2
- package/bundle/{chunk-BBTQKKDO.js → chunk-2W6JIHZ5.js} +2 -1
- package/bundle/chunk-2W6JIHZ5.js.map +7 -0
- package/bundle/{chunk-3IPMKYYH.js → chunk-6TSCOXF6.js} +56 -25
- package/bundle/chunk-6TSCOXF6.js.map +7 -0
- package/bundle/{chunk-7WFE2JI5.js → chunk-7B3GK5JQ.js} +2 -2
- package/bundle/{chunk-SMZQDMSZ.js → chunk-ENXQMPV3.js} +1 -2
- package/bundle/chunk-ENXQMPV3.js.map +7 -0
- package/bundle/{chunk-N24ROESF.js → chunk-HFPXN6NM.js} +1 -1
- package/bundle/chunk-HFPXN6NM.js.map +7 -0
- package/bundle/{chunk-Y2XBDQP3.js → chunk-SEXVA3GK.js} +144 -37
- package/bundle/chunk-SEXVA3GK.js.map +7 -0
- package/bundle/{commands-LAWVNQTO.js → commands-L6VIMPCR.js} +2 -2
- package/bundle/{direct-api-transport-QIWA5ES2.js → direct-api-transport-BK72AP3I.js} +1 -1
- package/bundle/{direct-api-transport-QIWA5ES2.js.map → direct-api-transport-BK72AP3I.js.map} +2 -2
- package/bundle/{discord-adapter-W6L5KJ6T.js → discord-adapter-DWIQRNDI.js} +3 -3
- package/bundle/{doctor-PIPSGI3H.js → doctor-WHTVSUOF.js} +36 -26
- package/bundle/doctor-WHTVSUOF.js.map +7 -0
- package/bundle/{install-I3CXVW52.js → install-Q4XNCPG7.js} +2 -2
- package/bundle/{message-pipeline-4CTBJ6K2.js → message-pipeline-GCSZCQWO.js} +2 -2
- package/bundle/meta.json +298 -279
- package/bundle/{phase-transport-INFD6ELA.js → phase-transport-F7GQRRYE.js} +3 -3
- package/bundle/{sleep-ENFZFUJJ.js → sleep-MYOZ73IU.js} +2 -2
- package/bundle/{subagent-runtime-5AYOXOU2.js → subagent-runtime-QA4LVU4C.js} +2 -2
- package/bundle/{system-status-7K2QTH3J.js → system-status-KMKPAC5Z.js} +4 -2
- package/bundle/system-status-KMKPAC5Z.js.map +7 -0
- package/bundle/{telegram-adapter-4KI4CJPG.js → telegram-adapter-TRMCC634.js} +7 -4
- package/bundle/telegram-adapter-TRMCC634.js.map +7 -0
- package/config/transport.default.json +2 -1
- package/install-manifest.json +0 -3
- package/package.json +1 -1
- package/scripts/abtars-daemon.service +0 -4
- package/scripts/abtars@.service +0 -4
- package/scripts/build-and-deploy.sh +15 -27
- package/bundle/agent-registry-5VL5KI6U.js +0 -19
- package/bundle/chunk-3IPMKYYH.js.map +0 -7
- package/bundle/chunk-4WKWPU6U.js +0 -1089
- package/bundle/chunk-4WKWPU6U.js.map +0 -7
- package/bundle/chunk-5WFIAUQC.js +0 -672
- package/bundle/chunk-5WFIAUQC.js.map +0 -7
- package/bundle/chunk-B52YRWR6.js +0 -257
- package/bundle/chunk-B52YRWR6.js.map +0 -7
- package/bundle/chunk-BBTQKKDO.js.map +0 -7
- package/bundle/chunk-HAS5NEK7.js +0 -189
- package/bundle/chunk-HAS5NEK7.js.map +0 -7
- package/bundle/chunk-HB54S5OY.js +0 -4036
- package/bundle/chunk-HB54S5OY.js.map +0 -7
- package/bundle/chunk-N24ROESF.js.map +0 -7
- package/bundle/chunk-N7UG4FID.js +0 -4036
- package/bundle/chunk-N7UG4FID.js.map +0 -7
- package/bundle/chunk-PUDGA4RR.js +0 -183
- package/bundle/chunk-QSC6QZ44.js.map +0 -7
- package/bundle/chunk-SMZQDMSZ.js.map +0 -7
- package/bundle/chunk-VY2BUO6L.js +0 -4035
- package/bundle/chunk-VY2BUO6L.js.map +0 -7
- package/bundle/chunk-Y2XBDQP3.js.map +0 -7
- package/bundle/chunk-YMGX6HNP.js +0 -131
- package/bundle/chunk-YMGX6HNP.js.map +0 -7
- package/bundle/commands-IGRSOSK6.js +0 -34
- package/bundle/commands-RBWY7YXB.js +0 -34
- package/bundle/commands-XFZNMZN6.js +0 -34
- package/bundle/direct-api-transport-OZICXTWQ.js +0 -889
- package/bundle/direct-api-transport-OZICXTWQ.js.map +0 -7
- package/bundle/discord-adapter-JFIIVG34.js +0 -589
- package/bundle/discord-adapter-U3FA5OTY.js +0 -589
- package/bundle/discord-adapter-U3FA5OTY.js.map +0 -7
- package/bundle/discord-adapter-W6L5KJ6T.js.map +0 -7
- package/bundle/discord-adapter-WWM6ROTW.js +0 -589
- package/bundle/discord-adapter-WWM6ROTW.js.map +0 -7
- package/bundle/doctor-PIPSGI3H.js.map +0 -7
- package/bundle/kanban-board-6Q5E5GEB.js +0 -31
- package/bundle/kanban-board-6Q5E5GEB.js.map +0 -7
- package/bundle/message-pipeline-4CTBJ6K2.js.map +0 -7
- package/bundle/message-pipeline-4KL7OWUH.js +0 -38
- package/bundle/message-pipeline-4KL7OWUH.js.map +0 -7
- package/bundle/message-pipeline-GFKSHRFU.js +0 -38
- package/bundle/message-pipeline-GFKSHRFU.js.map +0 -7
- package/bundle/message-pipeline-TGI2WJJM.js +0 -38
- package/bundle/message-pipeline-TGI2WJJM.js.map +0 -7
- package/bundle/phase-transport-INFD6ELA.js.map +0 -7
- package/bundle/phase-transport-KXFZ5BVF.js +0 -23
- package/bundle/phase-transport-KXFZ5BVF.js.map +0 -7
- package/bundle/sleep-ENFZFUJJ.js.map +0 -7
- package/bundle/subagent-runtime-5AYOXOU2.js.map +0 -7
- package/bundle/subagent-runtime-VKTX6Q2M.js +0 -13
- package/bundle/subagent-runtime-VKTX6Q2M.js.map +0 -7
- package/bundle/system-status-7K2QTH3J.js.map +0 -7
- package/bundle/telegram-adapter-4KI4CJPG.js.map +0 -7
- package/bundle/telegram-adapter-76B4JRJJ.js +0 -1080
- package/bundle/telegram-adapter-76B4JRJJ.js.map +0 -7
- package/bundle/telegram-adapter-VZA74EMT.js +0 -1080
- package/bundle/telegram-adapter-VZA74EMT.js.map +0 -7
- package/bundle/telegram-adapter-ZO2CLU22.js +0 -1080
- package/bundle/telegram-adapter-ZO2CLU22.js.map +0 -7
- package/bundle/tool-registry-TGNU5AMG.js +0 -43
- package/bundle/tool-registry-TGNU5AMG.js.map +0 -7
- /package/bundle/{_registry.generated-KYX63MGY.js.map → _registry.generated-KM6LXTNJ.js.map} +0 -0
- /package/bundle/{agent-registry-5VL5KI6U.js.map → agent-registry-ABPFQXNL.js.map} +0 -0
- /package/bundle/{chunk-PUDGA4RR.js.map → chunk-2SFN2VYD.js.map} +0 -0
- /package/bundle/{chunk-7WFE2JI5.js.map → chunk-7B3GK5JQ.js.map} +0 -0
- /package/bundle/{agent-registry-PIS5XJHX.js.map → commands-L6VIMPCR.js.map} +0 -0
- /package/bundle/{discord-adapter-JFIIVG34.js.map → discord-adapter-DWIQRNDI.js.map} +0 -0
- /package/bundle/{commands-IGRSOSK6.js.map → install-Q4XNCPG7.js.map} +0 -0
- /package/bundle/{commands-LAWVNQTO.js.map → message-pipeline-GCSZCQWO.js.map} +0 -0
- /package/bundle/{commands-RBWY7YXB.js.map → phase-transport-F7GQRRYE.js.map} +0 -0
- /package/bundle/{commands-XFZNMZN6.js.map → sleep-MYOZ73IU.js.map} +0 -0
- /package/bundle/{install-I3CXVW52.js.map → subagent-runtime-QA4LVU4C.js.map} +0 -0
|
@@ -1286,6 +1286,7 @@ function buildSessionStartPrompt(prompt, memory, userId, sessionKey, maxContext,
|
|
|
1286
1286
|
const type = typeMap[sessionType] ?? sessionType;
|
|
1287
1287
|
const index = parseInt(parts[2], 10);
|
|
1288
1288
|
contextParts.push(`[SESSION] #${index} (${type})`);
|
|
1289
|
+
logInfo(TAG3, `Injected session identity: #${index} (${type})`);
|
|
1289
1290
|
}
|
|
1290
1291
|
}
|
|
1291
1292
|
const isCodeSession = sessionType === "C";
|
|
@@ -1329,7 +1330,12 @@ You are now talking to ${user.userId} (${user.role}, ${CLASS_NAMES[user.maxClass
|
|
|
1329
1330
|
if (platform2) {
|
|
1330
1331
|
const CAPS = { telegram: "voice, reactions, typing, TTS, groups", discord: "reactions, typing, threads", irc: "text only" };
|
|
1331
1332
|
contextParts.push(`[SYSTEM] Platform: ${platform2} (${CAPS[platform2] ?? "unknown"})`);
|
|
1333
|
+
logInfo(TAG3, `Injected platform: ${platform2}`);
|
|
1332
1334
|
}
|
|
1335
|
+
const transportType = getEnv().defaultTransport === "acp" ? "ACP" : "Direct API";
|
|
1336
|
+
const runtimeLine = `[SYSTEM] Runtime: abtars bridge (${transportType}). All registered bridge tools are available.`;
|
|
1337
|
+
contextParts.push(runtimeLine);
|
|
1338
|
+
logInfo(TAG3, `Injected runtime identity: ${transportType}`);
|
|
1333
1339
|
const compSummary = null;
|
|
1334
1340
|
if (compSummary && sessionKey) {
|
|
1335
1341
|
} else {
|
|
@@ -1359,7 +1365,10 @@ You are now talking to ${user.userId} (${user.role}, ${CLASS_NAMES[user.maxClass
|
|
|
1359
1365
|
}
|
|
1360
1366
|
if (sessionKey && !sessionKey.includes("_C_")) {
|
|
1361
1367
|
const status = abmind().buildStatusBlock(memory);
|
|
1362
|
-
if (status)
|
|
1368
|
+
if (status) {
|
|
1369
|
+
contextParts.push(status);
|
|
1370
|
+
logInfo(TAG3, `Injected system status (${status.length} chars)`);
|
|
1371
|
+
}
|
|
1363
1372
|
}
|
|
1364
1373
|
}
|
|
1365
1374
|
} catch (err) {
|
|
@@ -1373,6 +1382,8 @@ ${contextParts.join("\n\n")}
|
|
|
1373
1382
|
` : "";
|
|
1374
1383
|
const result = contextBlock + prompt;
|
|
1375
1384
|
logTrace(TAG3, `session-start assembled: ${contextParts.length} parts, context=${contextBlock.length} chars, prompt=${prompt.length} chars, total=${result.length} chars`);
|
|
1385
|
+
logTrace(TAG3, `session-start injections:
|
|
1386
|
+
${contextParts.filter((p) => p.startsWith("[")).map((p) => " " + p.slice(0, 120)).join("\n")}`);
|
|
1376
1387
|
if (result.length < 5e3) {
|
|
1377
1388
|
logInfo(TAG3, `Session-start prompt suspiciously small (${result.length} chars) \u2014 SOUL may be missing`);
|
|
1378
1389
|
}
|
|
@@ -1949,7 +1960,32 @@ var TAG5 = "cmd_registry";
|
|
|
1949
1960
|
var exactCommands = {};
|
|
1950
1961
|
var prefixCommands = [];
|
|
1951
1962
|
var KNOWN_COMMANDS = /* @__PURE__ */ new Set();
|
|
1952
|
-
var NON_MASTER_COMMANDS = /* @__PURE__ */ new Set([
|
|
1963
|
+
var NON_MASTER_COMMANDS = /* @__PURE__ */ new Set([
|
|
1964
|
+
"/status",
|
|
1965
|
+
"/help",
|
|
1966
|
+
"/whoami",
|
|
1967
|
+
"/doctor",
|
|
1968
|
+
"/software",
|
|
1969
|
+
"/update",
|
|
1970
|
+
"/models",
|
|
1971
|
+
"/model",
|
|
1972
|
+
"/skills",
|
|
1973
|
+
"/skill",
|
|
1974
|
+
"/facts",
|
|
1975
|
+
"/tasks",
|
|
1976
|
+
"/task",
|
|
1977
|
+
"/usage",
|
|
1978
|
+
"/openrouter",
|
|
1979
|
+
"/session",
|
|
1980
|
+
"/hooks",
|
|
1981
|
+
"/memory",
|
|
1982
|
+
"/kanban",
|
|
1983
|
+
"/heartbeat",
|
|
1984
|
+
"/new",
|
|
1985
|
+
"/reset",
|
|
1986
|
+
"/stop",
|
|
1987
|
+
"/ctrlc"
|
|
1988
|
+
]);
|
|
1953
1989
|
function registerExact(name, handler) {
|
|
1954
1990
|
exactCommands[name] = handler;
|
|
1955
1991
|
KNOWN_COMMANDS.add(name);
|
|
@@ -1983,6 +2019,11 @@ async function handleCommand(text, ctx) {
|
|
|
1983
2019
|
if (text.startsWith("/") && /^\/\w+/.test(text) && !text.startsWith("//")) {
|
|
1984
2020
|
const cmd = text.split(/\s/)[0];
|
|
1985
2021
|
if (!KNOWN_COMMANDS.has(cmd)) {
|
|
2022
|
+
const match = fuzzyMatch(cmd);
|
|
2023
|
+
if (match) {
|
|
2024
|
+
const corrected = text.replace(cmd, match);
|
|
2025
|
+
return handleCommand(corrected, ctx);
|
|
2026
|
+
}
|
|
1986
2027
|
await ctx.reply(`\u2753 Unknown command: ${cmd}
|
|
1987
2028
|
Type /help for available commands.`);
|
|
1988
2029
|
return true;
|
|
@@ -2046,6 +2087,32 @@ function killWakeInhibit() {
|
|
|
2046
2087
|
function setWakeInhibitPid(pid) {
|
|
2047
2088
|
_wakeInhibitPid = pid;
|
|
2048
2089
|
}
|
|
2090
|
+
function levenshtein(a, b) {
|
|
2091
|
+
const m = a.length, n = b.length;
|
|
2092
|
+
const d = Array.from({ length: n + 1 }, (_, i) => i);
|
|
2093
|
+
for (let i = 1; i <= m; i++) {
|
|
2094
|
+
let prev = i - 1;
|
|
2095
|
+
d[0] = i;
|
|
2096
|
+
for (let j = 1; j <= n; j++) {
|
|
2097
|
+
const tmp = d[j];
|
|
2098
|
+
d[j] = a[i - 1] === b[j - 1] ? prev : 1 + Math.min(prev, d[j], d[j - 1]);
|
|
2099
|
+
prev = tmp;
|
|
2100
|
+
}
|
|
2101
|
+
}
|
|
2102
|
+
return d[n];
|
|
2103
|
+
}
|
|
2104
|
+
function fuzzyMatch(cmd) {
|
|
2105
|
+
let best = null;
|
|
2106
|
+
let bestDist = 3;
|
|
2107
|
+
for (const known of KNOWN_COMMANDS) {
|
|
2108
|
+
const dist = levenshtein(cmd, known);
|
|
2109
|
+
if (dist < bestDist) {
|
|
2110
|
+
best = known;
|
|
2111
|
+
bestDist = dist;
|
|
2112
|
+
}
|
|
2113
|
+
}
|
|
2114
|
+
return best;
|
|
2115
|
+
}
|
|
2049
2116
|
|
|
2050
2117
|
// src/components/commands/handlers-transport.ts
|
|
2051
2118
|
init_logger();
|
|
@@ -2389,6 +2456,16 @@ async function handleReasoning(text, ctx) {
|
|
|
2389
2456
|
}
|
|
2390
2457
|
return true;
|
|
2391
2458
|
}
|
|
2459
|
+
async function handleContinue(_text, ctx) {
|
|
2460
|
+
const response = await ctx.transport.sendPrompt(
|
|
2461
|
+
ctx.sessionKey,
|
|
2462
|
+
"[SYSTEM] Something went wrong during your previous response. Continue from where you left off.",
|
|
2463
|
+
void 0,
|
|
2464
|
+
ctx.userId
|
|
2465
|
+
);
|
|
2466
|
+
if (response) await ctx.reply(response);
|
|
2467
|
+
return true;
|
|
2468
|
+
}
|
|
2392
2469
|
|
|
2393
2470
|
// src/components/commands/exec-async.ts
|
|
2394
2471
|
import { execFile } from "node:child_process";
|
|
@@ -2422,7 +2499,7 @@ ${raw || "(no output)"}`);
|
|
|
2422
2499
|
}
|
|
2423
2500
|
return true;
|
|
2424
2501
|
}
|
|
2425
|
-
const { getDoctorReport, renderDoctorText } = await import("./doctor-
|
|
2502
|
+
const { getDoctorReport, renderDoctorText } = await import("./doctor-WHTVSUOF.js");
|
|
2426
2503
|
const force = arg === "force";
|
|
2427
2504
|
const svcStates = ctx.registry?.getStates() ?? {};
|
|
2428
2505
|
await ctx.reply("\u{1FA7A} Running diagnostics...");
|
|
@@ -2431,6 +2508,7 @@ ${raw || "(no output)"}`);
|
|
|
2431
2508
|
transport: ctx.transport,
|
|
2432
2509
|
telegramRunning: svcStates.telegram?.running ?? false,
|
|
2433
2510
|
discordRunning: svcStates.discord?.running ?? false,
|
|
2511
|
+
ircRunning: svcStates.irc?.running ?? false,
|
|
2434
2512
|
phaseHealth: ctx.phaseHealth
|
|
2435
2513
|
}, { force });
|
|
2436
2514
|
await ctx.reply(renderDoctorText(report));
|
|
@@ -2438,7 +2516,7 @@ ${raw || "(no output)"}`);
|
|
|
2438
2516
|
}
|
|
2439
2517
|
async function handleStatus(_text, ctx) {
|
|
2440
2518
|
if (ctx.phaseHealth && ctx.registry) {
|
|
2441
|
-
const { getSystemStatus, renderStatusText } = await import("./system-status-
|
|
2519
|
+
const { getSystemStatus, renderStatusText } = await import("./system-status-KMKPAC5Z.js");
|
|
2442
2520
|
const status = await getSystemStatus({
|
|
2443
2521
|
phaseHealth: ctx.phaseHealth,
|
|
2444
2522
|
registry: ctx.registry,
|
|
@@ -2477,6 +2555,12 @@ async function handleStop(_text, ctx) {
|
|
|
2477
2555
|
return true;
|
|
2478
2556
|
}
|
|
2479
2557
|
async function handleRestart(_text, ctx) {
|
|
2558
|
+
const arg = _text.replace(/^\/restart\s*/i, "").trim().toLowerCase();
|
|
2559
|
+
if (arg === "cold") {
|
|
2560
|
+
await ctx.reply("\u{1F9CA} Cold restart (process exit \u2192 supervisor respawn)...");
|
|
2561
|
+
setTimeout(() => process.exit(0), 500);
|
|
2562
|
+
return true;
|
|
2563
|
+
}
|
|
2480
2564
|
await ctx.reply("\u267B\uFE0F Restarting bridge...");
|
|
2481
2565
|
setTimeout(() => ctx.requestShutdown?.(0), 500);
|
|
2482
2566
|
return true;
|
|
@@ -2785,41 +2869,37 @@ async function handleSoftware(_text, ctx) {
|
|
|
2785
2869
|
}
|
|
2786
2870
|
try {
|
|
2787
2871
|
const { spawnSync } = await import("node:child_process");
|
|
2788
|
-
const { mkdirSync: mkdirSync2 } = await import("node:fs");
|
|
2872
|
+
const { mkdirSync: mkdirSync2, rmSync: rms } = await import("node:fs");
|
|
2789
2873
|
const srcDir = join2(home, "src", "abtars");
|
|
2790
2874
|
const abmindDir = join2(home, "src", "abmind");
|
|
2791
2875
|
logInfo("update", "Pull requested");
|
|
2792
|
-
|
|
2793
|
-
await ctx.reply("Cloning abtars repo...");
|
|
2876
|
+
const pullOrReclone = (dir, repo) => {
|
|
2794
2877
|
mkdirSync2(join2(home, "src"), { recursive: true });
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2878
|
+
if (existsSync(join2(dir, ".git"))) {
|
|
2879
|
+
spawnSync("git", ["-C", dir, "fetch", "origin", "dev"], { encoding: "utf-8", timeout: 3e4 });
|
|
2880
|
+
const r = spawnSync("git", ["-C", dir, "reset", "--hard", "origin/dev"], { encoding: "utf-8" });
|
|
2881
|
+
const hasConflicts = spawnSync("git", ["-C", dir, "grep", "-q", "^<<<<<<<"], { encoding: "utf-8" }).status === 0;
|
|
2882
|
+
if (r.status === 0 && !hasConflicts) {
|
|
2883
|
+
return { ok: true, msg: (r.stdout || "").trim().slice(0, 300) };
|
|
2884
|
+
}
|
|
2885
|
+
logInfo("update", `${dir}: reset failed or conflicts \u2014 recloning`);
|
|
2886
|
+
rms(dir, { recursive: true, force: true });
|
|
2801
2887
|
}
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2888
|
+
const cl = spawnSync("git", ["clone", "-b", "dev", repo, dir], { encoding: "utf-8", timeout: 6e4 });
|
|
2889
|
+
if (cl.status === 0) return { ok: true, msg: "cloned fresh" };
|
|
2890
|
+
return { ok: false, msg: (cl.stderr || "").trim().slice(0, 300) };
|
|
2891
|
+
};
|
|
2892
|
+
const abtarsResult = pullOrReclone(srcDir, "git@github.com:aksika/abtars.git");
|
|
2893
|
+
if (!abtarsResult.ok) {
|
|
2806
2894
|
await ctx.reply(`Pull failed (abtars):
|
|
2807
|
-
${
|
|
2895
|
+
${abtarsResult.msg}`);
|
|
2808
2896
|
return true;
|
|
2809
2897
|
}
|
|
2810
2898
|
let pulled = `Pulled:
|
|
2811
|
-
${
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
if (ab.status !== 0) {
|
|
2816
|
-
await ctx.reply(`Pull failed (abmind):
|
|
2817
|
-
${(ab.stderr || "").trim().slice(0, 300)}`);
|
|
2818
|
-
return true;
|
|
2819
|
-
}
|
|
2820
|
-
pulled += `
|
|
2821
|
-
abmind: ${(ab.stdout || "").trim().slice(0, 200)}`;
|
|
2822
|
-
}
|
|
2899
|
+
${abtarsResult.msg}`;
|
|
2900
|
+
const abmindResult = pullOrReclone(abmindDir, "git@github.com:aksika/abmind.git");
|
|
2901
|
+
pulled += `
|
|
2902
|
+
abmind: ${abmindResult.msg}`;
|
|
2823
2903
|
logInfo("update", `Pull complete`);
|
|
2824
2904
|
await ctx.reply(`${pulled}
|
|
2825
2905
|
|
|
@@ -2849,7 +2929,18 @@ Ready to deploy: /update deploy`);
|
|
|
2849
2929
|
return true;
|
|
2850
2930
|
}
|
|
2851
2931
|
logInfo("update", `Deploy starting (non-blocking)`);
|
|
2932
|
+
const markers = spawnSync("git", ["-C", srcDir, "grep", "-l", "^<<<<<<<"], { encoding: "utf-8", timeout: 1e4 });
|
|
2933
|
+
if (markers.stdout.trim()) {
|
|
2934
|
+
const files = markers.stdout.trim().split("\n").join(", ");
|
|
2935
|
+
await ctx.reply(`\u26A0\uFE0F Conflict markers found in source \u2014 refusing to deploy.
|
|
2936
|
+
Files: ${files}
|
|
2937
|
+
Repo has a broken commit. Notify dev team.`);
|
|
2938
|
+
return true;
|
|
2939
|
+
}
|
|
2852
2940
|
await ctx.reply("\u2699\uFE0F Deploying (building in background)...");
|
|
2941
|
+
const logFile = `deploy-${(/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "").slice(0, 15)}.log`;
|
|
2942
|
+
const { writeFileSync: wfs } = await import("node:fs");
|
|
2943
|
+
wfs(join2(home, "deploy.state"), JSON.stringify({ status: "running", startedAt: (/* @__PURE__ */ new Date()).toISOString(), logFile }) + "\n");
|
|
2853
2944
|
const script = join2(srcDir, "scripts", "build-and-deploy.sh");
|
|
2854
2945
|
spawn2("bash", [script, srcDir, abmindDir], {
|
|
2855
2946
|
detached: true,
|
|
@@ -2859,7 +2950,7 @@ Ready to deploy: /update deploy`);
|
|
|
2859
2950
|
await ctx.reply(`Deploy failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
2860
2951
|
}
|
|
2861
2952
|
return true;
|
|
2862
|
-
} else if (arg === "
|
|
2953
|
+
} else if (arg === "npm" || arg === "update npm") {
|
|
2863
2954
|
if (!isMaster) {
|
|
2864
2955
|
await ctx.reply("Requires master role.");
|
|
2865
2956
|
return true;
|
|
@@ -2960,6 +3051,23 @@ Ready to deploy: /update deploy`);
|
|
|
2960
3051
|
lines.push(` ${i}: (empty)`);
|
|
2961
3052
|
}
|
|
2962
3053
|
}
|
|
3054
|
+
try {
|
|
3055
|
+
const stateRaw = readFileSync(join2(home, "deploy.state"), "utf-8");
|
|
3056
|
+
const ds = JSON.parse(stateRaw);
|
|
3057
|
+
if (ds.status === "running") {
|
|
3058
|
+
const ago = Math.round((Date.now() - new Date(ds.startedAt).getTime()) / 6e4);
|
|
3059
|
+
lines.push(`
|
|
3060
|
+
\u{1F504} Deploy in progress (${ago}min ago)`);
|
|
3061
|
+
} else if (ds.status === "failed") {
|
|
3062
|
+
lines.push(`
|
|
3063
|
+
\u274C Last deploy failed: ${ds.error}
|
|
3064
|
+
Log: ~/.abtars/logs/${ds.logFile}`);
|
|
3065
|
+
} else if (ds.status === "partial") {
|
|
3066
|
+
lines.push(`
|
|
3067
|
+
\u26A0\uFE0F Last deploy incomplete: missing ${ds.missing?.join(", ")}`);
|
|
3068
|
+
}
|
|
3069
|
+
} catch {
|
|
3070
|
+
}
|
|
2963
3071
|
lines.push("");
|
|
2964
3072
|
lines.push(" /update [pull|deploy|npm] | /software rollback <version>");
|
|
2965
3073
|
await ctx.reply(lines.join("\n"));
|
|
@@ -3420,9 +3528,10 @@ async function handleKanban(text, ctx) {
|
|
|
3420
3528
|
return true;
|
|
3421
3529
|
}
|
|
3422
3530
|
const lines = cards.map((c) => {
|
|
3423
|
-
const icon = c.status === "delivered" ? "\
|
|
3531
|
+
const icon = c.status === "delivered" ? "\u2713" : c.status === "done" ? "+" : c.status === "running" ? "~" : c.status === "failed" ? "\u2717" : "-";
|
|
3424
3532
|
const due = c.due_at ? ` due:${c.due_at.slice(0, 10)}` : "";
|
|
3425
|
-
|
|
3533
|
+
const doneAt = c.delivered_at ? ` ${c.delivered_at.slice(2, 10).replace(/-/g, "")}:${c.delivered_at.slice(11, 16).replace(":", "")}` : "";
|
|
3534
|
+
return `${icon} #${c.id} ${c.title} (${c.source}/${c.priority})${doneAt}${due}`;
|
|
3426
3535
|
});
|
|
3427
3536
|
await ctx.reply(`\u{1F4CB} Kanban Board (${cards.length}):
|
|
3428
3537
|
${lines.join("\n")}`);
|
|
@@ -3996,7 +4105,6 @@ registerExact("/update", handleSoftware);
|
|
|
3996
4105
|
registerExact("/facts", handleFacts);
|
|
3997
4106
|
registerExact("/tasks", handleTasksList);
|
|
3998
4107
|
registerExact("/task", handleTasksList);
|
|
3999
|
-
registerExact("/cron", handleTasksList);
|
|
4000
4108
|
registerExact("/kanban", handleKanban);
|
|
4001
4109
|
registerPrefix("/kanban ", handleKanban);
|
|
4002
4110
|
registerExact("/memory", handleMemory);
|
|
@@ -4005,6 +4113,7 @@ registerExact("/models", handleModels);
|
|
|
4005
4113
|
registerExact("/model", handleModels);
|
|
4006
4114
|
registerExact("/change", (_, ctx) => handleModels("/model change", ctx));
|
|
4007
4115
|
registerExact("/reasoning", handleReasoning);
|
|
4116
|
+
registerExact("/continue", handleContinue);
|
|
4008
4117
|
registerExact("/emergency", handleEmergencyAlias);
|
|
4009
4118
|
registerExact("/help", handleHelp);
|
|
4010
4119
|
registerExact("/users", handleUsers);
|
|
@@ -4021,10 +4130,8 @@ registerExact("/session", handleSession);
|
|
|
4021
4130
|
registerPrefix("/session ", handleSession);
|
|
4022
4131
|
registerPrefix("/tasks run ", handleTasksTrigger);
|
|
4023
4132
|
registerPrefix("/task run ", handleTasksTrigger);
|
|
4024
|
-
registerPrefix("/cron run ", handleTasksTrigger);
|
|
4025
4133
|
registerPrefix("/tasks log ", handleTasksLog);
|
|
4026
4134
|
registerPrefix("/task log ", handleTasksLog);
|
|
4027
|
-
registerPrefix("/cron log ", handleTasksLog);
|
|
4028
4135
|
registerPrefix("/nlm", handleNlm);
|
|
4029
4136
|
registerPrefix("/sleep ", handleSleepSub);
|
|
4030
4137
|
registerPrefix("/usage ", handleUsage);
|
|
@@ -4052,4 +4159,4 @@ export {
|
|
|
4052
4159
|
handleInboundMessage,
|
|
4053
4160
|
startSession
|
|
4054
4161
|
};
|
|
4055
|
-
//# sourceMappingURL=chunk-
|
|
4162
|
+
//# sourceMappingURL=chunk-SEXVA3GK.js.map
|