abtars 0.3.4-alpha.5 → 0.3.4-alpha.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.
Files changed (25) hide show
  1. package/bundle/abtars.js +10 -53
  2. package/bundle/abtars.js.map +3 -3
  3. package/bundle/{chunk-F6VDEYK3.js → chunk-IRZOWJ5S.js} +4 -4
  4. package/bundle/{chunk-GP4XUKI5.js → chunk-MGHNCO5V.js} +78 -2
  5. package/bundle/chunk-MGHNCO5V.js.map +7 -0
  6. package/bundle/{chunk-QZCKZPWF.js → chunk-NC72HN4Y.js} +4 -4
  7. package/bundle/{commands-W4BHW3NM.js → commands-BARN6XQ7.js} +2 -2
  8. package/bundle/{discord-adapter-NUEBQD2T.js → discord-adapter-6GRRMO4M.js} +2 -2
  9. package/bundle/{heartbeat-system-TDDIOVTC.js → heartbeat-system-OATYKHRV.js} +3 -2
  10. package/bundle/{heartbeat-tier3-MIIONKJR.js → heartbeat-tier3-JT422XQ4.js} +4 -4
  11. package/bundle/{message-pipeline-LSK33TOO.js → message-pipeline-X6ENVZBZ.js} +2 -2
  12. package/bundle/meta.json +124 -95
  13. package/bundle/{system-status-ATGKRRQI.js → system-status-FDVKSAFK.js} +2 -2
  14. package/bundle/{telegram-adapter-5O4CJFH5.js → telegram-adapter-SIW2DMQX.js} +3 -3
  15. package/package.json +1 -1
  16. package/bundle/chunk-GP4XUKI5.js.map +0 -7
  17. /package/bundle/{chunk-F6VDEYK3.js.map → chunk-IRZOWJ5S.js.map} +0 -0
  18. /package/bundle/{chunk-QZCKZPWF.js.map → chunk-NC72HN4Y.js.map} +0 -0
  19. /package/bundle/{commands-W4BHW3NM.js.map → commands-BARN6XQ7.js.map} +0 -0
  20. /package/bundle/{discord-adapter-NUEBQD2T.js.map → discord-adapter-6GRRMO4M.js.map} +0 -0
  21. /package/bundle/{heartbeat-system-TDDIOVTC.js.map → heartbeat-system-OATYKHRV.js.map} +0 -0
  22. /package/bundle/{heartbeat-tier3-MIIONKJR.js.map → heartbeat-tier3-JT422XQ4.js.map} +0 -0
  23. /package/bundle/{message-pipeline-LSK33TOO.js.map → message-pipeline-X6ENVZBZ.js.map} +0 -0
  24. /package/bundle/{system-status-ATGKRRQI.js.map → system-status-FDVKSAFK.js.map} +0 -0
  25. /package/bundle/{telegram-adapter-5O4CJFH5.js.map → telegram-adapter-SIW2DMQX.js.map} +0 -0
package/bundle/abtars.js CHANGED
@@ -19,17 +19,19 @@ import {
19
19
  createSkillStatsFlushTask,
20
20
  createUpdateCheckTask,
21
21
  phasePipelineDeps
22
- } from "./chunk-F6VDEYK3.js";
22
+ } from "./chunk-IRZOWJ5S.js";
23
23
  import {
24
24
  loadNLMConfig
25
- } from "./chunk-QZCKZPWF.js";
25
+ } from "./chunk-NC72HN4Y.js";
26
26
  import "./chunk-63A7ZRIH.js";
27
27
  import "./chunk-OKAQICWY.js";
28
28
  import {
29
29
  HeartbeatSystem,
30
+ classifyResume,
30
31
  init_heartbeat_system,
32
+ init_platform_detect,
31
33
  setHeartbeatInstance
32
- } from "./chunk-GP4XUKI5.js";
34
+ } from "./chunk-MGHNCO5V.js";
33
35
  import {
34
36
  sendNotification
35
37
  } from "./chunk-7BSQ5UQO.js";
@@ -1145,7 +1147,7 @@ async function phasePlatformsConnect(ctx) {
1145
1147
  registry.register("telegram", {
1146
1148
  configured: Boolean(config.telegram.botToken && config.telegram.allowedUserIds.size > 0),
1147
1149
  async create() {
1148
- const { TelegramAdapter } = await import("./telegram-adapter-5O4CJFH5.js");
1150
+ const { TelegramAdapter } = await import("./telegram-adapter-SIW2DMQX.js");
1149
1151
  const adapter = new TelegramAdapter(
1150
1152
  { botToken: config.telegram.botToken, allowedUserIds: config.telegram.allowedUserIds, pollTimeoutS: config.telegram.pollTimeoutS },
1151
1153
  { pipeline: { handleInbound: (msg) => recovery.handle(msg, adapter) }, conversationBuffer: ctx.conversationBuffer, transport: null, memory: null, sessionManager: ctx.sessionManager, actionGate: ctx.actionGate }
@@ -1177,7 +1179,7 @@ async function phasePlatformsConnect(ctx) {
1177
1179
  if (!config.discord.appId || !isValidSnowflake(config.discord.appId)) {
1178
1180
  throw new Error("DISCORD_APP_ID missing or invalid \u2014 Discord disabled");
1179
1181
  }
1180
- const { DiscordAdapter } = await import("./discord-adapter-NUEBQD2T.js");
1182
+ const { DiscordAdapter } = await import("./discord-adapter-6GRRMO4M.js");
1181
1183
  const adapter = new DiscordAdapter(
1182
1184
  { botToken: config.discord.botToken, appId: config.discord.appId, allowedUserIds: config.discord.allowedUserIds },
1183
1185
  { pipeline: { handleInbound: (msg) => recovery.handle(msg, adapter) }, transport: null, memory: null, conversationBuffer: ctx.conversationBuffer }
@@ -1301,53 +1303,7 @@ async function phaseCapabilities(ctx) {
1301
1303
  // src/boot/phase-heartbeat.ts
1302
1304
  init_log_and_swallow();
1303
1305
  init_heartbeat_system();
1304
-
1305
- // src/components/platform-detect.ts
1306
- init_log_and_swallow();
1307
- init_env_schema();
1308
- init_bridge_lock_transport();
1309
- import { execSync } from "node:child_process";
1310
- import { platform } from "node:os";
1311
- function classifyResume() {
1312
- const status = readBridgeLockField("sleepStatus");
1313
- if (status === "hw_sleep") {
1314
- const hour = (/* @__PURE__ */ new Date()).getHours();
1315
- const WAKE_HOUR = getEnv().wakeTime.hour;
1316
- const BED_HOUR = getEnv().bedTime.hour;
1317
- const inSleepWindow = BED_HOUR < WAKE_HOUR ? hour >= BED_HOUR && hour < WAKE_HOUR : hour >= BED_HOUR || hour < WAKE_HOUR;
1318
- return inSleepWindow ? "dark" : "full";
1319
- }
1320
- const os = platform();
1321
- if (os === "darwin") return classifyMacOS();
1322
- if (os === "linux") return classifyLinux();
1323
- return "unknown";
1324
- }
1325
- function classifyMacOS() {
1326
- try {
1327
- const out = execSync("pmset -g log 2>/dev/null", { timeout: 3e3, encoding: "utf-8" });
1328
- const lines = out.split("\n").filter((l) => /\bDarkWake\b|\bWake\b/.test(l) && !l.includes("Notification"));
1329
- const last = lines.at(-1) ?? "";
1330
- if (last.includes("DarkWake")) return "dark";
1331
- if (last.includes("Wake")) return "full";
1332
- } catch (err) {
1333
- logAndSwallow("platform_detect", "op", err);
1334
- }
1335
- return "unknown";
1336
- }
1337
- function classifyLinux() {
1338
- try {
1339
- const out = execSync(
1340
- "journalctl -b -u systemd-suspend.service --since '5 min ago' --no-pager -q 2>/dev/null",
1341
- { timeout: 3e3, encoding: "utf-8" }
1342
- );
1343
- if (out.trim().length > 0) return "full";
1344
- } catch (err) {
1345
- logAndSwallow("platform_detect", "op", err);
1346
- }
1347
- return "unknown";
1348
- }
1349
-
1350
- // src/boot/phase-heartbeat.ts
1306
+ init_platform_detect();
1351
1307
  init_bridge_lock_transport();
1352
1308
  init_user_registry();
1353
1309
  init_logger();
@@ -1355,6 +1311,7 @@ init_logger();
1355
1311
  // src/boot/heartbeat-watchdog.ts
1356
1312
  init_logger();
1357
1313
  init_bridge_lock_transport();
1314
+ init_platform_detect();
1358
1315
  var WD_CHECK_INTERVAL = 6e4;
1359
1316
  var WD_UNKNOWN_SUPPRESS_MS = 60 * 6e4;
1360
1317
  var CIRCUIT_BREAKER_MAX = 3;
@@ -1473,7 +1430,7 @@ async function phaseSleep(ctx) {
1473
1430
  return "skipped";
1474
1431
  }
1475
1432
  const { createSleepHandle } = await import("./sleep-36XS6MHJ.js");
1476
- const { killWakeInhibit } = await import("./commands-W4BHW3NM.js");
1433
+ const { killWakeInhibit } = await import("./commands-BARN6XQ7.js");
1477
1434
  const SLEEP_HOUR = parseInt(readEnvWithDefault("BED_TIME", "2", "bedtime hour").split(":")[0] ?? "2", 10);
1478
1435
  let subagent = null;
1479
1436
  const { getEnv: getEnv2 } = await import("./env-schema-4JXQUOH4.js");