@askexenow/exe-os 0.9.112 → 0.9.113

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 (95) hide show
  1. package/README.md +9 -7
  2. package/dist/bin/agentic-ontology-backfill.js +54 -11
  3. package/dist/bin/agentic-reflection-backfill.js +29 -1
  4. package/dist/bin/agentic-semantic-label.js +29 -1
  5. package/dist/bin/backfill-conversations.js +53 -10
  6. package/dist/bin/backfill-responses.js +54 -11
  7. package/dist/bin/backfill-vectors.js +29 -1
  8. package/dist/bin/bulk-sync-postgres.js +55 -12
  9. package/dist/bin/cleanup-stale-review-tasks.js +75 -15
  10. package/dist/bin/cli.js +293 -76
  11. package/dist/bin/exe-agent-config.js +7 -1
  12. package/dist/bin/exe-agent.js +28 -2
  13. package/dist/bin/exe-assign.js +54 -11
  14. package/dist/bin/exe-boot.js +481 -147
  15. package/dist/bin/exe-call.js +45 -4
  16. package/dist/bin/exe-cloud.js +93 -15
  17. package/dist/bin/exe-dispatch.js +369 -24
  18. package/dist/bin/exe-doctor.js +53 -10
  19. package/dist/bin/exe-export-behaviors.js +54 -11
  20. package/dist/bin/exe-forget.js +54 -11
  21. package/dist/bin/exe-gateway.js +128 -23
  22. package/dist/bin/exe-heartbeat.js +75 -15
  23. package/dist/bin/exe-kill.js +54 -11
  24. package/dist/bin/exe-launch-agent.js +70 -12
  25. package/dist/bin/exe-new-employee.js +175 -7
  26. package/dist/bin/exe-pending-messages.js +75 -15
  27. package/dist/bin/exe-pending-notifications.js +75 -15
  28. package/dist/bin/exe-pending-reviews.js +75 -15
  29. package/dist/bin/exe-rename.js +54 -11
  30. package/dist/bin/exe-review.js +54 -11
  31. package/dist/bin/exe-search.js +54 -11
  32. package/dist/bin/exe-session-cleanup.js +491 -146
  33. package/dist/bin/exe-settings.js +10 -4
  34. package/dist/bin/exe-start-codex.js +524 -245
  35. package/dist/bin/exe-start-opencode.js +534 -165
  36. package/dist/bin/exe-status.js +75 -15
  37. package/dist/bin/exe-support.js +1 -1
  38. package/dist/bin/exe-team.js +54 -11
  39. package/dist/bin/git-sweep.js +369 -24
  40. package/dist/bin/graph-backfill.js +54 -11
  41. package/dist/bin/graph-export.js +54 -11
  42. package/dist/bin/install.js +62 -4
  43. package/dist/bin/intercom-check.js +491 -146
  44. package/dist/bin/pre-publish.js +13 -1
  45. package/dist/bin/scan-tasks.js +369 -24
  46. package/dist/bin/setup.js +91 -13
  47. package/dist/bin/shard-migrate.js +54 -11
  48. package/dist/bin/stack-update.js +1 -1
  49. package/dist/bin/update.js +3 -3
  50. package/dist/gateway/index.js +128 -23
  51. package/dist/hooks/bug-report-worker.js +128 -23
  52. package/dist/hooks/codex-stop-task-finalizer.js +512 -140
  53. package/dist/hooks/commit-complete.js +369 -24
  54. package/dist/hooks/error-recall.js +54 -11
  55. package/dist/hooks/ingest.js +4575 -252
  56. package/dist/hooks/instructions-loaded.js +54 -11
  57. package/dist/hooks/notification.js +54 -11
  58. package/dist/hooks/post-compact.js +75 -15
  59. package/dist/hooks/post-tool-combined.js +75 -15
  60. package/dist/hooks/pre-compact.js +449 -104
  61. package/dist/hooks/pre-tool-use.js +90 -15
  62. package/dist/hooks/prompt-submit.js +129 -24
  63. package/dist/hooks/session-end.js +451 -109
  64. package/dist/hooks/session-start.js +104 -16
  65. package/dist/hooks/stop.js +74 -14
  66. package/dist/hooks/subagent-stop.js +75 -15
  67. package/dist/hooks/summary-worker.js +73 -7
  68. package/dist/index.js +128 -23
  69. package/dist/lib/agent-config.js +16 -1
  70. package/dist/lib/cloud-sync.js +38 -1
  71. package/dist/lib/consolidation.js +16 -1
  72. package/dist/lib/database.js +16 -0
  73. package/dist/lib/db.js +16 -0
  74. package/dist/lib/device-registry.js +16 -0
  75. package/dist/lib/employee-templates.js +29 -3
  76. package/dist/lib/employees.js +16 -1
  77. package/dist/lib/exe-daemon.js +268 -42
  78. package/dist/lib/hybrid-search.js +54 -11
  79. package/dist/lib/license.js +3 -3
  80. package/dist/lib/messaging.js +21 -4
  81. package/dist/lib/schedules.js +29 -1
  82. package/dist/lib/skill-learning.js +458 -70
  83. package/dist/lib/status-brief.js +14 -1
  84. package/dist/lib/store.js +54 -11
  85. package/dist/lib/tasks.js +393 -91
  86. package/dist/lib/tmux-routing.js +316 -14
  87. package/dist/mcp/server.js +169 -30
  88. package/dist/mcp/tools/create-task.js +75 -13
  89. package/dist/mcp/tools/deactivate-behavior.js +33 -24
  90. package/dist/mcp/tools/list-tasks.js +21 -4
  91. package/dist/mcp/tools/send-message.js +21 -4
  92. package/dist/mcp/tools/update-task.js +390 -91
  93. package/dist/runtime/index.js +446 -101
  94. package/dist/tui/App.js +208 -54
  95. package/package.json +1 -1
@@ -111,35 +111,12 @@ var init_config = __esm({
111
111
  }
112
112
  });
113
113
 
114
- // src/types/memory.ts
115
- var init_memory = __esm({
116
- "src/types/memory.ts"() {
117
- "use strict";
118
- }
119
- });
120
-
121
- // src/mcp/tools/deactivate-behavior.ts
122
- import { z } from "zod";
123
-
124
- // src/lib/behaviors.ts
125
- import crypto from "crypto";
126
-
127
- // src/lib/database.ts
128
- import { chmodSync as chmodSync2, existsSync as existsSync4, statSync, copyFileSync, unlinkSync as unlinkSync2, openSync, closeSync, mkdirSync as mkdirSync2 } from "fs";
129
- import { createClient } from "@libsql/client";
130
- import { homedir } from "os";
131
- import { join } from "path";
132
-
133
114
  // src/lib/employees.ts
134
- init_config();
135
115
  import { readFile as readFile2, writeFile as writeFile2, mkdir as mkdir2 } from "fs/promises";
136
116
  import { existsSync as existsSync3, symlinkSync, readlinkSync, readFileSync as readFileSync2, renameSync as renameSync2, unlinkSync, writeFileSync } from "fs";
137
117
  import { execSync } from "child_process";
138
118
  import path2 from "path";
139
119
  import os2 from "os";
140
- var EMPLOYEES_PATH = path2.join(EXE_AI_DIR, "exe-employees.json");
141
- var DEFAULT_COORDINATOR_TEMPLATE_NAME = "exe";
142
- var COORDINATOR_ROLE = "COO";
143
120
  function normalizeRole(role) {
144
121
  return (role ?? "").trim().toLowerCase();
145
122
  }
@@ -170,7 +147,37 @@ function loadEmployeesSync(employeesPath = EMPLOYEES_PATH) {
170
147
  function getEmployee(employees, name) {
171
148
  return employees.find((e) => e.name.toLowerCase() === name.toLowerCase());
172
149
  }
173
- var IDENTITY_DIR = path2.join(EXE_AI_DIR, "identity");
150
+ var EMPLOYEES_PATH, DEFAULT_COORDINATOR_TEMPLATE_NAME, COORDINATOR_ROLE, IDENTITY_DIR;
151
+ var init_employees = __esm({
152
+ "src/lib/employees.ts"() {
153
+ "use strict";
154
+ init_config();
155
+ EMPLOYEES_PATH = path2.join(EXE_AI_DIR, "exe-employees.json");
156
+ DEFAULT_COORDINATOR_TEMPLATE_NAME = "exe";
157
+ COORDINATOR_ROLE = "COO";
158
+ IDENTITY_DIR = path2.join(EXE_AI_DIR, "identity");
159
+ }
160
+ });
161
+
162
+ // src/types/memory.ts
163
+ var init_memory = __esm({
164
+ "src/types/memory.ts"() {
165
+ "use strict";
166
+ }
167
+ });
168
+
169
+ // src/mcp/tools/deactivate-behavior.ts
170
+ import { z } from "zod";
171
+
172
+ // src/lib/behaviors.ts
173
+ import crypto from "crypto";
174
+
175
+ // src/lib/database.ts
176
+ import { chmodSync as chmodSync2, existsSync as existsSync4, statSync, copyFileSync, unlinkSync as unlinkSync2, openSync, closeSync, mkdirSync as mkdirSync2 } from "fs";
177
+ import { createClient } from "@libsql/client";
178
+ import { homedir } from "os";
179
+ import { join } from "path";
180
+ init_employees();
174
181
 
175
182
  // src/lib/database-adapter.ts
176
183
  import os3 from "os";
@@ -313,6 +320,7 @@ function getAgentContext() {
313
320
  }
314
321
 
315
322
  // src/lib/active-agent.ts
323
+ init_employees();
316
324
  var CACHE_DIR = path4.join(EXE_AI_DIR, "session-cache");
317
325
  var STALE_MS = 24 * 60 * 60 * 1e3;
318
326
  function isNameWithOptionalInstance(candidate, baseName) {
@@ -406,6 +414,7 @@ function getActiveAgent() {
406
414
  }
407
415
 
408
416
  // src/mcp/tools/deactivate-behavior.ts
417
+ init_employees();
409
418
  function registerDeactivateBehavior(server) {
410
419
  server.registerTool(
411
420
  "deactivate_behavior",
@@ -553,7 +553,7 @@ var init_license = __esm({
553
553
  LICENSE_PATH = path7.join(EXE_AI_DIR, "license.key");
554
554
  CACHE_PATH = path7.join(EXE_AI_DIR, "license-cache.json");
555
555
  DEVICE_ID_PATH = path7.join(EXE_AI_DIR, "device-id");
556
- API_BASE = process.env.EXE_CLOUD_ENDPOINT ?? "https://askexe.com/cloud";
556
+ API_BASE = process.env.EXE_CLOUD_ENDPOINT ?? "https://cloud.askexe.com";
557
557
  }
558
558
  });
559
559
 
@@ -606,6 +606,18 @@ function extractRootExe(name) {
606
606
  const parts = name.split("-").filter(Boolean);
607
607
  return parts.length > 0 ? parts[parts.length - 1] : null;
608
608
  }
609
+ function registerParentExe(sessionKey, parentExe, dispatchedBy) {
610
+ if (!existsSync10(SESSION_CACHE)) {
611
+ mkdirSync6(SESSION_CACHE, { recursive: true });
612
+ }
613
+ const rootExe = extractRootExe(parentExe) ?? parentExe;
614
+ const filePath = path10.join(SESSION_CACHE, `parent-exe-${sessionKey}.json`);
615
+ writeFileSync5(filePath, JSON.stringify({
616
+ parentExe: rootExe,
617
+ dispatchedBy: dispatchedBy || rootExe,
618
+ registeredAt: (/* @__PURE__ */ new Date()).toISOString()
619
+ }));
620
+ }
609
621
  function getParentExe(sessionKey) {
610
622
  try {
611
623
  const data = JSON.parse(readFileSync7(path10.join(SESSION_CACHE, `parent-exe-${sessionKey}.json`), "utf8"));
@@ -615,11 +627,12 @@ function getParentExe(sessionKey) {
615
627
  }
616
628
  }
617
629
  function resolveExeSession() {
630
+ if (process.env.EXE_SESSION_NAME) {
631
+ const fromEnv = extractRootExe(process.env.EXE_SESSION_NAME) ?? process.env.EXE_SESSION_NAME;
632
+ if (fromEnv) return fromEnv;
633
+ }
618
634
  const mySession = getMySession();
619
635
  if (!mySession) {
620
- if (process.env.EXE_SESSION_NAME) {
621
- return extractRootExe(process.env.EXE_SESSION_NAME) ?? process.env.EXE_SESSION_NAME;
622
- }
623
636
  return null;
624
637
  }
625
638
  const fromSessionName = extractRootExe(mySession);
@@ -634,6 +647,10 @@ function resolveExeSession() {
634
647
  `[tmux-routing] WARN: cache says "${fromCache}" but session name says "${fromSessionName}". Trusting session name.
635
648
  `
636
649
  );
650
+ try {
651
+ registerParentExe(key, fromSessionName);
652
+ } catch {
653
+ }
637
654
  candidate = fromSessionName;
638
655
  } else {
639
656
  candidate = fromCache;
@@ -616,7 +616,7 @@ var init_license = __esm({
616
616
  LICENSE_PATH = path7.join(EXE_AI_DIR, "license.key");
617
617
  CACHE_PATH = path7.join(EXE_AI_DIR, "license-cache.json");
618
618
  DEVICE_ID_PATH = path7.join(EXE_AI_DIR, "device-id");
619
- API_BASE = process.env.EXE_CLOUD_ENDPOINT ?? "https://askexe.com/cloud";
619
+ API_BASE = process.env.EXE_CLOUD_ENDPOINT ?? "https://cloud.askexe.com";
620
620
  }
621
621
  });
622
622
 
@@ -693,6 +693,18 @@ function extractRootExe(name) {
693
693
  const parts = name.split("-").filter(Boolean);
694
694
  return parts.length > 0 ? parts[parts.length - 1] : null;
695
695
  }
696
+ function registerParentExe(sessionKey, parentExe, dispatchedBy) {
697
+ if (!existsSync10(SESSION_CACHE)) {
698
+ mkdirSync6(SESSION_CACHE, { recursive: true });
699
+ }
700
+ const rootExe = extractRootExe(parentExe) ?? parentExe;
701
+ const filePath = path10.join(SESSION_CACHE, `parent-exe-${sessionKey}.json`);
702
+ writeFileSync5(filePath, JSON.stringify({
703
+ parentExe: rootExe,
704
+ dispatchedBy: dispatchedBy || rootExe,
705
+ registeredAt: (/* @__PURE__ */ new Date()).toISOString()
706
+ }));
707
+ }
696
708
  function getParentExe(sessionKey) {
697
709
  try {
698
710
  const data = JSON.parse(readFileSync7(path10.join(SESSION_CACHE, `parent-exe-${sessionKey}.json`), "utf8"));
@@ -702,11 +714,12 @@ function getParentExe(sessionKey) {
702
714
  }
703
715
  }
704
716
  function resolveExeSession() {
717
+ if (process.env.EXE_SESSION_NAME) {
718
+ const fromEnv = extractRootExe(process.env.EXE_SESSION_NAME) ?? process.env.EXE_SESSION_NAME;
719
+ if (fromEnv) return fromEnv;
720
+ }
705
721
  const mySession = getMySession();
706
722
  if (!mySession) {
707
- if (process.env.EXE_SESSION_NAME) {
708
- return extractRootExe(process.env.EXE_SESSION_NAME) ?? process.env.EXE_SESSION_NAME;
709
- }
710
723
  return null;
711
724
  }
712
725
  const fromSessionName = extractRootExe(mySession);
@@ -721,6 +734,10 @@ function resolveExeSession() {
721
734
  `[tmux-routing] WARN: cache says "${fromCache}" but session name says "${fromSessionName}". Trusting session name.
722
735
  `
723
736
  );
737
+ try {
738
+ registerParentExe(key, fromSessionName);
739
+ } catch {
740
+ }
724
741
  candidate = fromSessionName;
725
742
  } else {
726
743
  candidate = fromCache;