@askexenow/exe-os 0.8.37 → 0.8.38

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 (66) hide show
  1. package/dist/bin/backfill-conversations.js +66 -60
  2. package/dist/bin/backfill-responses.js +7 -8
  3. package/dist/bin/backfill-vectors.js +1 -8
  4. package/dist/bin/cleanup-stale-review-tasks.js +1 -8
  5. package/dist/bin/cli.js +520 -325
  6. package/dist/bin/exe-assign.js +7 -8
  7. package/dist/bin/exe-boot.js +54 -21
  8. package/dist/bin/exe-call.js +9 -4
  9. package/dist/bin/exe-cloud.js +37 -3
  10. package/dist/bin/exe-doctor.js +1 -8
  11. package/dist/bin/exe-export-behaviors.js +4 -11
  12. package/dist/bin/exe-forget.js +1 -8
  13. package/dist/bin/exe-gateway.js +72 -30
  14. package/dist/bin/exe-heartbeat.js +4 -11
  15. package/dist/bin/exe-kill.js +1 -8
  16. package/dist/bin/exe-launch-agent.js +51 -14
  17. package/dist/bin/exe-link.js +13 -3
  18. package/dist/bin/exe-new-employee.js +35 -10
  19. package/dist/bin/exe-pending-messages.js +1 -8
  20. package/dist/bin/exe-pending-notifications.js +1 -8
  21. package/dist/bin/exe-pending-reviews.js +4 -11
  22. package/dist/bin/exe-review.js +7 -8
  23. package/dist/bin/exe-search.js +10 -11
  24. package/dist/bin/exe-session-cleanup.js +11 -12
  25. package/dist/bin/exe-status.js +1 -8
  26. package/dist/bin/exe-team.js +1 -8
  27. package/dist/bin/git-sweep.js +7 -8
  28. package/dist/bin/graph-backfill.js +1 -8
  29. package/dist/bin/graph-export.js +1 -8
  30. package/dist/bin/install.js +9 -0
  31. package/dist/bin/scan-tasks.js +7 -8
  32. package/dist/bin/setup.js +396 -245
  33. package/dist/bin/shard-migrate.js +1 -8
  34. package/dist/bin/wiki-sync.js +1 -8
  35. package/dist/gateway/index.js +30 -30
  36. package/dist/hooks/bug-report-worker.js +4 -11
  37. package/dist/hooks/commit-complete.js +7 -8
  38. package/dist/hooks/error-recall.js +11 -12
  39. package/dist/hooks/ingest-worker.js +24 -9
  40. package/dist/hooks/instructions-loaded.js +7 -8
  41. package/dist/hooks/notification.js +7 -8
  42. package/dist/hooks/post-compact.js +7 -8
  43. package/dist/hooks/pre-compact.js +7 -8
  44. package/dist/hooks/pre-tool-use.js +7 -8
  45. package/dist/hooks/prompt-ingest-worker.js +19 -4
  46. package/dist/hooks/prompt-submit.js +14 -9
  47. package/dist/hooks/response-ingest-worker.js +20 -5
  48. package/dist/hooks/session-end.js +11 -12
  49. package/dist/hooks/session-start.js +11 -12
  50. package/dist/hooks/stop.js +7 -8
  51. package/dist/hooks/subagent-stop.js +7 -8
  52. package/dist/hooks/summary-worker.js +24 -9
  53. package/dist/index.js +11 -5
  54. package/dist/lib/cloud-sync.js +19 -2
  55. package/dist/lib/employee-templates.js +5 -0
  56. package/dist/lib/exe-daemon.js +24 -8
  57. package/dist/lib/hybrid-search.js +10 -11
  58. package/dist/lib/identity-templates.js +16 -7
  59. package/dist/lib/license.js +43 -2
  60. package/dist/lib/schedules.js +1 -8
  61. package/dist/lib/store.js +7 -8
  62. package/dist/mcp/server.js +184 -113
  63. package/dist/mcp/tools/list-tasks.js +35 -27
  64. package/dist/runtime/index.js +7 -2
  65. package/dist/tui/App.js +44 -5
  66. package/package.json +4 -2
@@ -1,12 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
5
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
6
- }) : x)(function(x) {
7
- if (typeof require !== "undefined") return require.apply(this, arguments);
8
- throw Error('Dynamic require of "' + x + '" is not supported');
9
- });
10
4
  var __esm = (fn, res) => function __init() {
11
5
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
12
6
  };
@@ -218,7 +212,7 @@ __export(shard_manager_exports, {
218
212
  shardExists: () => shardExists
219
213
  });
220
214
  import path5 from "path";
221
- import { existsSync as existsSync5, mkdirSync } from "fs";
215
+ import { existsSync as existsSync5, mkdirSync, readdirSync } from "fs";
222
216
  import { createClient as createClient2 } from "@libsql/client";
223
217
  function initShardManager(encryptionKey) {
224
218
  _encryptionKey = encryptionKey;
@@ -257,7 +251,6 @@ function shardExists(projectName) {
257
251
  }
258
252
  function listShards() {
259
253
  if (!existsSync5(SHARDS_DIR)) return [];
260
- const { readdirSync } = __require("fs");
261
254
  return readdirSync(SHARDS_DIR).filter((f) => f.endsWith(".db")).map((f) => f.replace(".db", ""));
262
255
  }
263
256
  async function ensureShardSchema(client) {
@@ -1933,6 +1926,12 @@ async function writeMemory(record) {
1933
1926
  supersedes_id: record.supersedes_id ?? null
1934
1927
  };
1935
1928
  _pendingRecords.push(dbRow);
1929
+ const MAX_PENDING = 1e3;
1930
+ if (_pendingRecords.length > MAX_PENDING) {
1931
+ const dropped = _pendingRecords.length - MAX_PENDING;
1932
+ _pendingRecords = _pendingRecords.slice(-MAX_PENDING);
1933
+ console.warn(`[store] Dropped ${dropped} oldest pending records (overflow)`);
1934
+ }
1936
1935
  if (_flushTimer === null) {
1937
1936
  _flushTimer = setInterval(() => {
1938
1937
  void flushBatch();
@@ -1408,7 +1408,7 @@ __export(shard_manager_exports, {
1408
1408
  shardExists: () => shardExists
1409
1409
  });
1410
1410
  import path4 from "path";
1411
- import { existsSync as existsSync4, mkdirSync } from "fs";
1411
+ import { existsSync as existsSync4, mkdirSync, readdirSync } from "fs";
1412
1412
  import { createClient as createClient2 } from "@libsql/client";
1413
1413
  function initShardManager(encryptionKey) {
1414
1414
  _encryptionKey = encryptionKey;
@@ -1447,8 +1447,7 @@ function shardExists(projectName) {
1447
1447
  }
1448
1448
  function listShards() {
1449
1449
  if (!existsSync4(SHARDS_DIR)) return [];
1450
- const { readdirSync: readdirSync7 } = __require("fs");
1451
- return readdirSync7(SHARDS_DIR).filter((f) => f.endsWith(".db")).map((f) => f.replace(".db", ""));
1450
+ return readdirSync(SHARDS_DIR).filter((f) => f.endsWith(".db")).map((f) => f.replace(".db", ""));
1452
1451
  }
1453
1452
  async function ensureShardSchema(client) {
1454
1453
  await client.execute("PRAGMA journal_mode = WAL");
@@ -1698,7 +1697,7 @@ import path5 from "path";
1698
1697
  import os2 from "os";
1699
1698
  import {
1700
1699
  readFileSync as readFileSync3,
1701
- readdirSync,
1700
+ readdirSync as readdirSync2,
1702
1701
  unlinkSync,
1703
1702
  existsSync as existsSync5,
1704
1703
  rmdirSync
@@ -1818,7 +1817,7 @@ async function migrateJsonNotifications() {
1818
1817
  if (!existsSync5(notifDir)) return 0;
1819
1818
  let migrated = 0;
1820
1819
  try {
1821
- const files = readdirSync(notifDir).filter((f) => f.endsWith(".json"));
1820
+ const files = readdirSync2(notifDir).filter((f) => f.endsWith(".json"));
1822
1821
  if (files.length === 0) return 0;
1823
1822
  const client = getClient();
1824
1823
  for (const file of files) {
@@ -1846,7 +1845,7 @@ async function migrateJsonNotifications() {
1846
1845
  }
1847
1846
  }
1848
1847
  try {
1849
- const remaining = readdirSync(notifDir);
1848
+ const remaining = readdirSync2(notifDir);
1850
1849
  if (remaining.length === 0) {
1851
1850
  rmdirSync(notifDir);
1852
1851
  }
@@ -2202,6 +2201,8 @@ __export(license_exports, {
2202
2201
  loadLicense: () => loadLicense,
2203
2202
  mirrorLicenseKey: () => mirrorLicenseKey,
2204
2203
  saveLicense: () => saveLicense,
2204
+ startLicenseRevalidation: () => startLicenseRevalidation,
2205
+ stopLicenseRevalidation: () => stopLicenseRevalidation,
2205
2206
  validateLicense: () => validateLicense
2206
2207
  });
2207
2208
  import { readFileSync as readFileSync7, writeFileSync as writeFileSync4, existsSync as existsSync8, mkdirSync as mkdirSync5 } from "fs";
@@ -2326,14 +2327,23 @@ async function validateLicense(apiKey, deviceId) {
2326
2327
  } catch {
2327
2328
  const cached = await getCachedLicense();
2328
2329
  if (cached) return cached;
2329
- return FREE_LICENSE;
2330
+ return { ...FREE_LICENSE, valid: false, error: "offline" };
2331
+ }
2332
+ }
2333
+ function getCacheAgeMs() {
2334
+ try {
2335
+ const { statSync: statSync2 } = __require("fs");
2336
+ const s = statSync2(CACHE_PATH);
2337
+ return Date.now() - s.mtimeMs;
2338
+ } catch {
2339
+ return Infinity;
2330
2340
  }
2331
2341
  }
2332
2342
  async function checkLicense() {
2333
2343
  const key = loadLicense();
2334
2344
  if (!key) return FREE_LICENSE;
2335
2345
  const cached = await getCachedLicense();
2336
- if (cached) return cached;
2346
+ if (cached && getCacheAgeMs() < CACHE_MAX_AGE_MS) return cached;
2337
2347
  const deviceId = loadDeviceId();
2338
2348
  return validateLicense(key, deviceId);
2339
2349
  }
@@ -2454,7 +2464,28 @@ async function assertVpsLicense(opts) {
2454
2464
  `License validation unreachable for more than ${graceDays} days. Restore network connectivity to https://askexe.com/cloud and retry. This VPS image refuses to boot after the offline grace window.`
2455
2465
  );
2456
2466
  }
2457
- var LICENSE_PATH, CACHE_PATH, DEVICE_ID_PATH, API_BASE, LICENSE_PUBLIC_KEY_PEM, LICENSE_JWT_ALG, PLAN_LIMITS, FREE_LICENSE;
2467
+ function startLicenseRevalidation(intervalMs = 36e5) {
2468
+ if (_revalTimer) return;
2469
+ _revalTimer = setInterval(async () => {
2470
+ try {
2471
+ const license = await checkLicense();
2472
+ if (!license.valid) {
2473
+ process.stderr.write("[exe-os] License expired or invalid \u2014 features may be restricted\n");
2474
+ }
2475
+ } catch {
2476
+ }
2477
+ }, intervalMs);
2478
+ if (_revalTimer && typeof _revalTimer === "object" && "unref" in _revalTimer) {
2479
+ _revalTimer.unref();
2480
+ }
2481
+ }
2482
+ function stopLicenseRevalidation() {
2483
+ if (_revalTimer) {
2484
+ clearInterval(_revalTimer);
2485
+ _revalTimer = null;
2486
+ }
2487
+ }
2488
+ var LICENSE_PATH, CACHE_PATH, DEVICE_ID_PATH, API_BASE, LICENSE_PUBLIC_KEY_PEM, LICENSE_JWT_ALG, PLAN_LIMITS, FREE_LICENSE, CACHE_MAX_AGE_MS, _revalTimer;
2458
2489
  var init_license = __esm({
2459
2490
  "src/lib/license.ts"() {
2460
2491
  "use strict";
@@ -2484,6 +2515,8 @@ MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEeHztAMOpR/ZMh+rWuOASjEZ54CGY
2484
2515
  employeeLimit: 1,
2485
2516
  memoryLimit: 5e3
2486
2517
  };
2518
+ CACHE_MAX_AGE_MS = 36e5;
2519
+ _revalTimer = null;
2487
2520
  }
2488
2521
  });
2489
2522
 
@@ -3124,7 +3157,7 @@ __export(task_scanner_exports, {
3124
3157
  formatText: () => formatText,
3125
3158
  scanAgentTasks: () => scanAgentTasks
3126
3159
  });
3127
- import { readdirSync as readdirSync3, readFileSync as readFileSync10, existsSync as existsSync11, statSync } from "fs";
3160
+ import { readdirSync as readdirSync4, readFileSync as readFileSync10, existsSync as existsSync11, statSync } from "fs";
3128
3161
  import { execSync as execSync7 } from "child_process";
3129
3162
  import path12 from "path";
3130
3163
  function getProjectRoot() {
@@ -3146,7 +3179,7 @@ function scanAgentTasks(agentId) {
3146
3179
  let total = 0;
3147
3180
  if (!existsSync11(taskDir)) return { open, inProgress, done, total };
3148
3181
  try {
3149
- const files = readdirSync3(taskDir).filter((f) => f.endsWith(".md"));
3182
+ const files = readdirSync4(taskDir).filter((f) => f.endsWith(".md"));
3150
3183
  total = files.length;
3151
3184
  for (const f of files) {
3152
3185
  try {
@@ -3702,7 +3735,7 @@ var init_tasks_crud = __esm({
3702
3735
 
3703
3736
  // src/lib/tasks-review.ts
3704
3737
  import path15 from "path";
3705
- import { existsSync as existsSync13, readdirSync as readdirSync4, unlinkSync as unlinkSync4 } from "fs";
3738
+ import { existsSync as existsSync13, readdirSync as readdirSync5, unlinkSync as unlinkSync4 } from "fs";
3706
3739
  async function countPendingReviews() {
3707
3740
  const client = getClient();
3708
3741
  const result = await client.execute({
@@ -3824,7 +3857,7 @@ async function cleanupReviewFile(row, taskFile, _baseDir) {
3824
3857
  try {
3825
3858
  const cacheDir = path15.join(EXE_AI_DIR, "session-cache");
3826
3859
  if (existsSync13(cacheDir)) {
3827
- for (const f of readdirSync4(cacheDir)) {
3860
+ for (const f of readdirSync5(cacheDir)) {
3828
3861
  if (f.startsWith("review-notified-")) {
3829
3862
  unlinkSync4(path15.join(cacheDir, f));
3830
3863
  }
@@ -4728,7 +4761,7 @@ __export(cloud_sync_exports, {
4728
4761
  mergeConfig: () => mergeConfig,
4729
4762
  mergeRosterFromRemote: () => mergeRosterFromRemote
4730
4763
  });
4731
- import { readFileSync as readFileSync12, writeFileSync as writeFileSync7, existsSync as existsSync14, readdirSync as readdirSync5, mkdirSync as mkdirSync8, appendFileSync as appendFileSync2 } from "fs";
4764
+ import { readFileSync as readFileSync12, writeFileSync as writeFileSync7, existsSync as existsSync14, readdirSync as readdirSync6, mkdirSync as mkdirSync8, appendFileSync as appendFileSync2 } from "fs";
4732
4765
  import path18 from "path";
4733
4766
  import { homedir } from "os";
4734
4767
  function logError(msg) {
@@ -4995,7 +5028,7 @@ function buildRosterBlob(paths) {
4995
5028
  }
4996
5029
  const identities = {};
4997
5030
  if (existsSync14(identityDir)) {
4998
- for (const file of readdirSync5(identityDir).filter((f) => f.endsWith(".md"))) {
5031
+ for (const file of readdirSync6(identityDir).filter((f) => f.endsWith(".md"))) {
4999
5032
  try {
5000
5033
  identities[file] = readFileSync12(path18.join(identityDir, file), "utf-8");
5001
5034
  } catch {
@@ -5695,7 +5728,7 @@ var init_schedules = __esm({
5695
5728
  init_employees();
5696
5729
  import path19 from "path";
5697
5730
  import { mkdir as mkdir5, writeFile as writeFile6 } from "fs/promises";
5698
- import { existsSync as existsSync15, readFileSync as readFileSync13, readdirSync as readdirSync6, unlinkSync as unlinkSync6 } from "fs";
5731
+ import { existsSync as existsSync15, readFileSync as readFileSync13, readdirSync as readdirSync7, unlinkSync as unlinkSync6 } from "fs";
5699
5732
  import os6 from "os";
5700
5733
 
5701
5734
  // src/lib/employee-templates.ts
@@ -6034,7 +6067,7 @@ init_notifications();
6034
6067
 
6035
6068
  // src/adapters/claude/active-agent.ts
6036
6069
  init_config();
6037
- import { readFileSync as readFileSync4, writeFileSync, mkdirSync as mkdirSync2, unlinkSync as unlinkSync2, readdirSync as readdirSync2 } from "fs";
6070
+ import { readFileSync as readFileSync4, writeFileSync, mkdirSync as mkdirSync2, unlinkSync as unlinkSync2, readdirSync as readdirSync3 } from "fs";
6038
6071
  import { execSync as execSync3 } from "child_process";
6039
6072
  import path6 from "path";
6040
6073
 
@@ -6144,18 +6177,18 @@ async function boot(options) {
6144
6177
  } catch {
6145
6178
  }
6146
6179
  try {
6147
- const { readdirSync: readdirSync7, readFileSync: readFs } = await import("fs");
6180
+ const { readdirSync: readdirSync8, readFileSync: readFs } = await import("fs");
6148
6181
  const { STATUS_RE: STATUS_RE2, PRIORITY_RE: PRIORITY_RE2, TITLE_RE: TITLE_RE2 } = await Promise.resolve().then(() => (init_task_scanner(), task_scanner_exports));
6149
6182
  const { getProjectName: getProjectName2 } = await Promise.resolve().then(() => (init_project_name(), project_name_exports));
6150
6183
  const exeDir = "exe";
6151
- const entries = readdirSync7(exeDir, { withFileTypes: true });
6184
+ const entries = readdirSync8(exeDir, { withFileTypes: true });
6152
6185
  const employeeDirs = entries.filter((e) => e.isDirectory() && !["output", "research"].includes(e.name));
6153
6186
  for (const dir of employeeDirs) {
6154
6187
  const employee = dir.name;
6155
6188
  const taskDir = path19.join(exeDir, employee);
6156
6189
  let files;
6157
6190
  try {
6158
- files = readdirSync7(taskDir).filter((f) => f.endsWith(".md"));
6191
+ files = readdirSync8(taskDir).filter((f) => f.endsWith(".md"));
6159
6192
  } catch {
6160
6193
  continue;
6161
6194
  }
@@ -6249,7 +6282,7 @@ async function boot(options) {
6249
6282
  try {
6250
6283
  const exeExeDir = path19.join(process.cwd(), "exe", "exe");
6251
6284
  if (existsSync15(exeExeDir)) {
6252
- for (const f of readdirSync6(exeExeDir)) {
6285
+ for (const f of readdirSync7(exeExeDir)) {
6253
6286
  if (f.startsWith("review-") && f.endsWith(".md")) {
6254
6287
  try {
6255
6288
  unlinkSync6(path19.join(exeExeDir, f));
@@ -249,6 +249,7 @@ __export(employee_templates_exports, {
249
249
  buildCustomEmployeePrompt: () => buildCustomEmployeePrompt,
250
250
  getSessionPrompt: () => getSessionPrompt,
251
251
  getTemplate: () => getTemplate,
252
+ getTemplateByRole: () => getTemplateByRole,
252
253
  personalizePrompt: () => personalizePrompt,
253
254
  renderClientCOOTemplate: () => renderClientCOOTemplate
254
255
  });
@@ -264,6 +265,10 @@ function buildCustomEmployeePrompt(name, role) {
264
265
  function getTemplate(name) {
265
266
  return TEMPLATES[name];
266
267
  }
268
+ function getTemplateByRole(role) {
269
+ const lower = role.toLowerCase();
270
+ return Object.values(TEMPLATES).find((t) => t.role.toLowerCase() === lower);
271
+ }
267
272
  function personalizePrompt(prompt, templateName, actualName) {
268
273
  if (templateName === actualName) return prompt;
269
274
  const escaped = templateName.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
@@ -907,7 +912,8 @@ if (isMainModule(import.meta.url)) {
907
912
  const bootPath = path3.join(__dirname, "exe-boot.js");
908
913
  try {
909
914
  execSync2(`node "${bootPath}"`, { stdio: "inherit" });
910
- } catch {
915
+ } catch (err) {
916
+ console.error(`Failed to boot exe: ${err instanceof Error ? err.message : String(err)}`);
911
917
  process.exit(1);
912
918
  }
913
919
  process.exit(0);
@@ -944,9 +950,8 @@ if (isMainModule(import.meta.url)) {
944
950
  );
945
951
  execSync2("claude --dangerously-skip-permissions", { stdio: "inherit", env });
946
952
  } catch (err) {
947
- console.error(
948
- err instanceof Error ? err.message : String(err)
949
- );
953
+ console.error(`Failed to launch employee session: ${err instanceof Error ? err.message : String(err)}`);
954
+ console.error("Try running: exe-os team");
950
955
  process.exit(1);
951
956
  }
952
957
  }
@@ -223,6 +223,8 @@ __export(license_exports, {
223
223
  loadLicense: () => loadLicense,
224
224
  mirrorLicenseKey: () => mirrorLicenseKey,
225
225
  saveLicense: () => saveLicense,
226
+ startLicenseRevalidation: () => startLicenseRevalidation,
227
+ stopLicenseRevalidation: () => stopLicenseRevalidation,
226
228
  validateLicense: () => validateLicense
227
229
  });
228
230
  import { readFileSync as readFileSync2, writeFileSync, existsSync as existsSync3, mkdirSync } from "fs";
@@ -347,14 +349,23 @@ async function validateLicense(apiKey, deviceId) {
347
349
  } catch {
348
350
  const cached = await getCachedLicense();
349
351
  if (cached) return cached;
350
- return FREE_LICENSE;
352
+ return { ...FREE_LICENSE, valid: false, error: "offline" };
353
+ }
354
+ }
355
+ function getCacheAgeMs() {
356
+ try {
357
+ const { statSync } = __require("fs");
358
+ const s = statSync(CACHE_PATH);
359
+ return Date.now() - s.mtimeMs;
360
+ } catch {
361
+ return Infinity;
351
362
  }
352
363
  }
353
364
  async function checkLicense() {
354
365
  const key = loadLicense();
355
366
  if (!key) return FREE_LICENSE;
356
367
  const cached = await getCachedLicense();
357
- if (cached) return cached;
368
+ if (cached && getCacheAgeMs() < CACHE_MAX_AGE_MS) return cached;
358
369
  const deviceId = loadDeviceId();
359
370
  return validateLicense(key, deviceId);
360
371
  }
@@ -475,7 +486,28 @@ async function assertVpsLicense(opts) {
475
486
  `License validation unreachable for more than ${graceDays} days. Restore network connectivity to https://askexe.com/cloud and retry. This VPS image refuses to boot after the offline grace window.`
476
487
  );
477
488
  }
478
- var LICENSE_PATH, CACHE_PATH, DEVICE_ID_PATH, API_BASE, LICENSE_PUBLIC_KEY_PEM, LICENSE_JWT_ALG, PLAN_LIMITS, FREE_LICENSE;
489
+ function startLicenseRevalidation(intervalMs = 36e5) {
490
+ if (_revalTimer) return;
491
+ _revalTimer = setInterval(async () => {
492
+ try {
493
+ const license = await checkLicense();
494
+ if (!license.valid) {
495
+ process.stderr.write("[exe-os] License expired or invalid \u2014 features may be restricted\n");
496
+ }
497
+ } catch {
498
+ }
499
+ }, intervalMs);
500
+ if (_revalTimer && typeof _revalTimer === "object" && "unref" in _revalTimer) {
501
+ _revalTimer.unref();
502
+ }
503
+ }
504
+ function stopLicenseRevalidation() {
505
+ if (_revalTimer) {
506
+ clearInterval(_revalTimer);
507
+ _revalTimer = null;
508
+ }
509
+ }
510
+ var LICENSE_PATH, CACHE_PATH, DEVICE_ID_PATH, API_BASE, LICENSE_PUBLIC_KEY_PEM, LICENSE_JWT_ALG, PLAN_LIMITS, FREE_LICENSE, CACHE_MAX_AGE_MS, _revalTimer;
479
511
  var init_license = __esm({
480
512
  "src/lib/license.ts"() {
481
513
  "use strict";
@@ -505,6 +537,8 @@ MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEeHztAMOpR/ZMh+rWuOASjEZ54CGY
505
537
  employeeLimit: 1,
506
538
  memoryLimit: 5e3
507
539
  };
540
+ CACHE_MAX_AGE_MS = 36e5;
541
+ _revalTimer = null;
508
542
  }
509
543
  });
510
544
 
@@ -1,12 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
5
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
6
- }) : x)(function(x) {
7
- if (typeof require !== "undefined") return require.apply(this, arguments);
8
- throw Error('Dynamic require of "' + x + '" is not supported');
9
- });
10
4
  var __esm = (fn, res) => function __init() {
11
5
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
12
6
  };
@@ -218,7 +212,7 @@ __export(shard_manager_exports, {
218
212
  shardExists: () => shardExists
219
213
  });
220
214
  import path3 from "path";
221
- import { existsSync as existsSync3, mkdirSync } from "fs";
215
+ import { existsSync as existsSync3, mkdirSync, readdirSync } from "fs";
222
216
  import { createClient as createClient2 } from "@libsql/client";
223
217
  function initShardManager(encryptionKey) {
224
218
  _encryptionKey = encryptionKey;
@@ -257,7 +251,6 @@ function shardExists(projectName) {
257
251
  }
258
252
  function listShards() {
259
253
  if (!existsSync3(SHARDS_DIR)) return [];
260
- const { readdirSync } = __require("fs");
261
254
  return readdirSync(SHARDS_DIR).filter((f) => f.endsWith(".db")).map((f) => f.replace(".db", ""));
262
255
  }
263
256
  async function ensureShardSchema(client) {
@@ -1,12 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
5
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
6
- }) : x)(function(x) {
7
- if (typeof require !== "undefined") return require.apply(this, arguments);
8
- throw Error('Dynamic require of "' + x + '" is not supported');
9
- });
10
4
  var __esm = (fn, res) => function __init() {
11
5
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
12
6
  };
@@ -218,7 +212,7 @@ __export(shard_manager_exports, {
218
212
  shardExists: () => shardExists
219
213
  });
220
214
  import path3 from "path";
221
- import { existsSync as existsSync3, mkdirSync } from "fs";
215
+ import { existsSync as existsSync3, mkdirSync, readdirSync } from "fs";
222
216
  import { createClient as createClient2 } from "@libsql/client";
223
217
  function initShardManager(encryptionKey) {
224
218
  _encryptionKey = encryptionKey;
@@ -257,8 +251,7 @@ function shardExists(projectName2) {
257
251
  }
258
252
  function listShards() {
259
253
  if (!existsSync3(SHARDS_DIR)) return [];
260
- const { readdirSync: readdirSync2 } = __require("fs");
261
- return readdirSync2(SHARDS_DIR).filter((f) => f.endsWith(".db")).map((f) => f.replace(".db", ""));
254
+ return readdirSync(SHARDS_DIR).filter((f) => f.endsWith(".db")).map((f) => f.replace(".db", ""));
262
255
  }
263
256
  async function ensureShardSchema(client) {
264
257
  await client.execute("PRAGMA journal_mode = WAL");
@@ -1573,7 +1566,7 @@ import path4 from "path";
1573
1566
  import {
1574
1567
  existsSync as existsSync4,
1575
1568
  mkdirSync as mkdirSync2,
1576
- readdirSync,
1569
+ readdirSync as readdirSync2,
1577
1570
  statSync,
1578
1571
  unlinkSync,
1579
1572
  writeFileSync
@@ -1621,7 +1614,7 @@ function sweepStaleBehaviorExports(now = Date.now()) {
1621
1614
  if (!existsSync4(BEHAVIORS_EXPORT_DIR)) return;
1622
1615
  let entries;
1623
1616
  try {
1624
- entries = readdirSync(BEHAVIORS_EXPORT_DIR);
1617
+ entries = readdirSync2(BEHAVIORS_EXPORT_DIR);
1625
1618
  } catch {
1626
1619
  return;
1627
1620
  }
@@ -1,12 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
5
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
6
- }) : x)(function(x) {
7
- if (typeof require !== "undefined") return require.apply(this, arguments);
8
- throw Error('Dynamic require of "' + x + '" is not supported');
9
- });
10
4
  var __esm = (fn, res) => function __init() {
11
5
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
12
6
  };
@@ -1161,7 +1155,7 @@ __export(shard_manager_exports, {
1161
1155
  shardExists: () => shardExists
1162
1156
  });
1163
1157
  import path3 from "path";
1164
- import { existsSync as existsSync3, mkdirSync } from "fs";
1158
+ import { existsSync as existsSync3, mkdirSync, readdirSync } from "fs";
1165
1159
  import { createClient as createClient2 } from "@libsql/client";
1166
1160
  function initShardManager(encryptionKey) {
1167
1161
  _encryptionKey = encryptionKey;
@@ -1200,7 +1194,6 @@ function shardExists(projectName) {
1200
1194
  }
1201
1195
  function listShards() {
1202
1196
  if (!existsSync3(SHARDS_DIR)) return [];
1203
- const { readdirSync } = __require("fs");
1204
1197
  return readdirSync(SHARDS_DIR).filter((f) => f.endsWith(".db")).map((f) => f.replace(".db", ""));
1205
1198
  }
1206
1199
  async function ensureShardSchema(client) {