@askexenow/exe-os 0.9.86 → 0.9.88

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 (103) hide show
  1. package/deploy/compose/docker-compose.yml +3 -3
  2. package/dist/bin/age-ontology-load.js +8 -2
  3. package/dist/bin/agentic-ontology-backfill.js +29 -0
  4. package/dist/bin/agentic-reflection-backfill.js +29 -0
  5. package/dist/bin/agentic-semantic-label.js +29 -0
  6. package/dist/bin/backfill-conversations.js +30 -0
  7. package/dist/bin/backfill-responses.js +30 -0
  8. package/dist/bin/backfill-vectors.js +30 -0
  9. package/dist/bin/bulk-sync-postgres.js +47 -1
  10. package/dist/bin/cc-doctor.js +3 -2
  11. package/dist/bin/cleanup-stale-review-tasks.js +30 -0
  12. package/dist/bin/cli.js +357 -19
  13. package/dist/bin/exe-agent.js +19 -0
  14. package/dist/bin/exe-assign.js +30 -0
  15. package/dist/bin/exe-boot.js +157 -4
  16. package/dist/bin/exe-call.js +20 -0
  17. package/dist/bin/exe-cloud.js +156 -3
  18. package/dist/bin/exe-dispatch.js +30 -1
  19. package/dist/bin/exe-doctor.js +30 -0
  20. package/dist/bin/exe-export-behaviors.js +29 -0
  21. package/dist/bin/exe-forget.js +30 -0
  22. package/dist/bin/exe-gateway.js +150 -35
  23. package/dist/bin/exe-healthcheck.js +2 -1
  24. package/dist/bin/exe-heartbeat.js +30 -0
  25. package/dist/bin/exe-kill.js +29 -0
  26. package/dist/bin/exe-launch-agent.js +29 -0
  27. package/dist/bin/exe-new-employee.js +37 -4
  28. package/dist/bin/exe-pending-messages.js +29 -0
  29. package/dist/bin/exe-pending-notifications.js +30 -0
  30. package/dist/bin/exe-pending-reviews.js +30 -0
  31. package/dist/bin/exe-rename.js +30 -0
  32. package/dist/bin/exe-review.js +30 -0
  33. package/dist/bin/exe-search.js +30 -0
  34. package/dist/bin/exe-session-cleanup.js +30 -1
  35. package/dist/bin/exe-settings.js +3 -0
  36. package/dist/bin/exe-start-codex.js +31 -2
  37. package/dist/bin/exe-start-opencode.js +31 -2
  38. package/dist/bin/exe-status.js +30 -0
  39. package/dist/bin/exe-team.js +30 -0
  40. package/dist/bin/git-sweep.js +30 -1
  41. package/dist/bin/graph-backfill.js +29 -0
  42. package/dist/bin/graph-export.js +29 -0
  43. package/dist/bin/graph-layer-benchmark.js +9 -1
  44. package/dist/bin/install.js +9 -0
  45. package/dist/bin/intercom-check.js +31 -1
  46. package/dist/bin/list-providers.js +1 -0
  47. package/dist/bin/postgres-agentic-reflection-backfill.js +7 -1
  48. package/dist/bin/postgres-agentic-semantic-backfill.js +7 -1
  49. package/dist/bin/registry-proxy.js +1 -0
  50. package/dist/bin/scan-tasks.js +31 -1
  51. package/dist/bin/setup.js +165 -9
  52. package/dist/bin/shard-migrate.js +29 -0
  53. package/dist/bin/stack-update.js +24 -7
  54. package/dist/bin/update.js +5 -0
  55. package/dist/gateway/index.js +30 -1
  56. package/dist/hooks/bug-report-worker.js +30 -1
  57. package/dist/hooks/codex-stop-task-finalizer.js +30 -1
  58. package/dist/hooks/commit-complete.js +30 -1
  59. package/dist/hooks/error-recall.js +29 -0
  60. package/dist/hooks/ingest.js +29 -0
  61. package/dist/hooks/instructions-loaded.js +29 -0
  62. package/dist/hooks/notification.js +29 -0
  63. package/dist/hooks/post-compact.js +29 -0
  64. package/dist/hooks/post-tool-combined.js +29 -0
  65. package/dist/hooks/pre-compact.js +30 -1
  66. package/dist/hooks/pre-tool-use.js +29 -0
  67. package/dist/hooks/prompt-submit.js +30 -1
  68. package/dist/hooks/session-end.js +30 -1
  69. package/dist/hooks/session-start.js +29 -0
  70. package/dist/hooks/stop.js +29 -0
  71. package/dist/hooks/subagent-stop.js +29 -0
  72. package/dist/hooks/summary-worker.js +155 -3
  73. package/dist/index.js +30 -1
  74. package/dist/lib/cloud-sync.js +136 -2
  75. package/dist/lib/consolidation.js +1 -0
  76. package/dist/lib/database.js +11 -0
  77. package/dist/lib/db.js +11 -0
  78. package/dist/lib/device-registry.js +11 -0
  79. package/dist/lib/employee-templates.js +19 -0
  80. package/dist/lib/exe-daemon.js +1455 -208
  81. package/dist/lib/hybrid-search.js +29 -0
  82. package/dist/lib/identity-templates.js +6 -2
  83. package/dist/lib/identity.js +1 -0
  84. package/dist/lib/messaging.js +2 -1
  85. package/dist/lib/reminders.js +1 -0
  86. package/dist/lib/schedules.js +29 -0
  87. package/dist/lib/skill-learning.js +1 -0
  88. package/dist/lib/store.js +29 -0
  89. package/dist/lib/tasks.js +2 -1
  90. package/dist/lib/tmux-routing.js +2 -1
  91. package/dist/lib/token-spend.js +1 -0
  92. package/dist/mcp/server.js +1278 -165
  93. package/dist/mcp/tools/complete-reminder.js +1 -0
  94. package/dist/mcp/tools/create-reminder.js +1 -0
  95. package/dist/mcp/tools/create-task.js +8 -3
  96. package/dist/mcp/tools/deactivate-behavior.js +1 -0
  97. package/dist/mcp/tools/list-reminders.js +1 -0
  98. package/dist/mcp/tools/list-tasks.js +1 -0
  99. package/dist/mcp/tools/send-message.js +2 -1
  100. package/dist/mcp/tools/update-task.js +2 -1
  101. package/dist/runtime/index.js +30 -1
  102. package/dist/tui/App.js +30 -1
  103. package/package.json +2 -2
@@ -1425,6 +1425,7 @@ __export(database_exports, {
1425
1425
  isInitialized: () => isInitialized,
1426
1426
  setExternalClient: () => setExternalClient
1427
1427
  });
1428
+ import { chmodSync as chmodSync2 } from "fs";
1428
1429
  import { createClient } from "@libsql/client";
1429
1430
  async function initDatabase(config) {
1430
1431
  if (_walCheckpointTimer) {
@@ -1466,6 +1467,16 @@ async function initDatabase(config) {
1466
1467
  if (process.env.DATABASE_URL && process.env.EXE_USE_POSTGRES === "1") {
1467
1468
  _adapterClient = await createPrismaDbAdapter(_resilientClient);
1468
1469
  }
1470
+ try {
1471
+ chmodSync2(config.dbPath, 384);
1472
+ for (const suffix of ["-wal", "-shm"]) {
1473
+ try {
1474
+ chmodSync2(config.dbPath + suffix, 384);
1475
+ } catch {
1476
+ }
1477
+ }
1478
+ } catch {
1479
+ }
1469
1480
  }
1470
1481
  function isInitialized() {
1471
1482
  return _adapterClient !== null || _client !== null;
@@ -3048,6 +3059,21 @@ var init_crdt_sync = __esm({
3048
3059
  }
3049
3060
  });
3050
3061
 
3062
+ // src/lib/pg-ssl.ts
3063
+ var pg_ssl_exports = {};
3064
+ __export(pg_ssl_exports, {
3065
+ pgSslConfig: () => pgSslConfig
3066
+ });
3067
+ function pgSslConfig() {
3068
+ if (process.env.EXE_DB_SSL_DISABLED === "true") return {};
3069
+ return { ssl: { rejectUnauthorized: process.env.EXE_DB_SSL_ALLOW_SELFSIGNED !== "true" } };
3070
+ }
3071
+ var init_pg_ssl = __esm({
3072
+ "src/lib/pg-ssl.ts"() {
3073
+ "use strict";
3074
+ }
3075
+ });
3076
+
3051
3077
  // src/lib/keychain.ts
3052
3078
  var keychain_exports = {};
3053
3079
  __export(keychain_exports, {
@@ -3801,7 +3827,8 @@ function loadPgClient() {
3801
3827
  return new Ctor();
3802
3828
  }
3803
3829
  const { Pool } = await import("pg");
3804
- const pool = new Pool({ connectionString: process.env.DATABASE_URL });
3830
+ const { pgSslConfig: pgSslConfig2 } = await Promise.resolve().then(() => (init_pg_ssl(), pg_ssl_exports));
3831
+ const pool = new Pool({ connectionString: process.env.DATABASE_URL, ...pgSslConfig2() });
3805
3832
  return {
3806
3833
  async $queryRawUnsafe(query, ...values) {
3807
3834
  const result = await pool.query(query, values);
@@ -4347,6 +4374,17 @@ async function cloudSync(config) {
4347
4374
  } catch (err) {
4348
4375
  logError(`[cloud-sync] DB backup upload error: ${err instanceof Error ? err.message : String(err)}`);
4349
4376
  }
4377
+ let codeContextResult = { pushed: 0, pulled: 0 };
4378
+ try {
4379
+ codeContextResult.pushed = await cloudPushCodeContext(config);
4380
+ } catch (err) {
4381
+ logError(`[cloud-sync] Code context push: ${err instanceof Error ? err.message : String(err)}`);
4382
+ }
4383
+ try {
4384
+ codeContextResult.pulled = await cloudPullCodeContext(config);
4385
+ } catch (err) {
4386
+ logError(`[cloud-sync] Code context pull: ${err instanceof Error ? err.message : String(err)}`);
4387
+ }
4350
4388
  return {
4351
4389
  pushed,
4352
4390
  pulled,
@@ -4356,7 +4394,8 @@ async function cloudSync(config) {
4356
4394
  tasks: tasksResult,
4357
4395
  conversations: conversationsResult,
4358
4396
  documents: documentsResult,
4359
- roster: rosterResult
4397
+ roster: rosterResult,
4398
+ codeContext: codeContextResult
4360
4399
  };
4361
4400
  }
4362
4401
  var ROSTER_DELETIONS_PATH = path10.join(EXE_AI_DIR, "roster-deletions.json");
@@ -4995,6 +5034,99 @@ async function cloudPullDocuments(config) {
4995
5034
  }
4996
5035
  return { pulled };
4997
5036
  }
5037
+ var CODE_CONTEXT_DIR = path10.join(EXE_AI_DIR, "code-context");
5038
+ async function cloudPushCodeContext(config) {
5039
+ assertSecureEndpoint(config.endpoint);
5040
+ if (!existsSync10(CODE_CONTEXT_DIR)) return 0;
5041
+ const files = readdirSync2(CODE_CONTEXT_DIR).filter(
5042
+ (f) => f.endsWith(".json") && !f.endsWith(".vectors.json") && !f.startsWith(".")
5043
+ );
5044
+ if (files.length === 0) return 0;
5045
+ const metaPath = path10.join(CODE_CONTEXT_DIR, ".sync-meta.json");
5046
+ let syncMeta = {};
5047
+ if (existsSync10(metaPath)) {
5048
+ try {
5049
+ syncMeta = JSON.parse(readFileSync7(metaPath, "utf-8"));
5050
+ } catch {
5051
+ }
5052
+ }
5053
+ let pushed = 0;
5054
+ for (const file of files) {
5055
+ const filePath = path10.join(CODE_CONTEXT_DIR, file);
5056
+ try {
5057
+ const stat = statSync4(filePath);
5058
+ const lastPushed = syncMeta[file] ?? 0;
5059
+ if (stat.mtimeMs <= lastPushed) continue;
5060
+ const content = readFileSync7(filePath, "utf-8");
5061
+ const header = content.substring(0, 300);
5062
+ if (header.includes("/tmp") || header.includes("/var/folders") || header.includes(".worktrees/")) continue;
5063
+ const compressed = compress(Buffer.from(content, "utf8"));
5064
+ const encrypted = encryptSyncBlob(compressed);
5065
+ const resp = await fetchWithRetry(`${config.endpoint}/sync/push-code-context`, {
5066
+ method: "POST",
5067
+ headers: {
5068
+ Authorization: `Bearer ${config.apiKey}`,
5069
+ "Content-Type": "application/json",
5070
+ "X-Device-Id": loadDeviceId()
5071
+ },
5072
+ body: JSON.stringify({ key: file, blob: encrypted })
5073
+ });
5074
+ if (resp.ok) {
5075
+ syncMeta[file] = stat.mtimeMs;
5076
+ pushed++;
5077
+ }
5078
+ } catch {
5079
+ }
5080
+ }
5081
+ if (pushed > 0) {
5082
+ try {
5083
+ writeFileSync5(metaPath, JSON.stringify(syncMeta));
5084
+ } catch {
5085
+ }
5086
+ }
5087
+ return pushed;
5088
+ }
5089
+ async function cloudPullCodeContext(config) {
5090
+ assertSecureEndpoint(config.endpoint);
5091
+ try {
5092
+ const resp = await fetchWithRetry(`${config.endpoint}/sync/pull-code-context`, {
5093
+ method: "GET",
5094
+ headers: {
5095
+ Authorization: `Bearer ${config.apiKey}`,
5096
+ "X-Device-Id": loadDeviceId()
5097
+ }
5098
+ });
5099
+ if (!resp.ok) return 0;
5100
+ const data = await resp.json();
5101
+ if (!data.indexes || data.indexes.length === 0) return 0;
5102
+ mkdirSync5(CODE_CONTEXT_DIR, { recursive: true });
5103
+ let pulled = 0;
5104
+ for (const { key, blob } of data.indexes) {
5105
+ try {
5106
+ if (key.endsWith(".vectors.json")) continue;
5107
+ const localPath = path10.join(CODE_CONTEXT_DIR, key);
5108
+ const compressed = decryptSyncBlob(blob);
5109
+ const content = decompress(compressed).toString("utf8");
5110
+ if (!existsSync10(localPath)) {
5111
+ writeFileSync5(localPath, content, "utf-8");
5112
+ pulled++;
5113
+ } else {
5114
+ const localContent = readFileSync7(localPath, "utf-8");
5115
+ if (localContent.length !== content.length) {
5116
+ writeFileSync5(localPath, content, "utf-8");
5117
+ pulled++;
5118
+ }
5119
+ }
5120
+ } catch {
5121
+ }
5122
+ }
5123
+ return pulled;
5124
+ } catch (err) {
5125
+ process.stderr.write(`[cloud-sync] Code context pull failed: ${err instanceof Error ? err.message : String(err)}
5126
+ `);
5127
+ return 0;
5128
+ }
5129
+ }
4998
5130
  export {
4999
5131
  CLOUD_REUPLOAD_REQUIRED_MESSAGE,
5000
5132
  assertSecureEndpoint,
@@ -5003,6 +5135,7 @@ export {
5003
5135
  cloudPull,
5004
5136
  cloudPullBehaviors,
5005
5137
  cloudPullBlob,
5138
+ cloudPullCodeContext,
5006
5139
  cloudPullConversations,
5007
5140
  cloudPullDocuments,
5008
5141
  cloudPullGlobalProcedures,
@@ -5012,6 +5145,7 @@ export {
5012
5145
  cloudPush,
5013
5146
  cloudPushBehaviors,
5014
5147
  cloudPushBlob,
5148
+ cloudPushCodeContext,
5015
5149
  cloudPushConversations,
5016
5150
  cloudPushDocuments,
5017
5151
  cloudPushGlobalProcedures,
@@ -541,6 +541,7 @@ var init_database_adapter = __esm({
541
541
  });
542
542
 
543
543
  // src/lib/database.ts
544
+ import { chmodSync as chmodSync2 } from "fs";
544
545
  import { createClient } from "@libsql/client";
545
546
  var init_database = __esm({
546
547
  "src/lib/database.ts"() {
@@ -670,6 +670,7 @@ var init_db_daemon_client = __esm({
670
670
  });
671
671
 
672
672
  // src/lib/database.ts
673
+ import { chmodSync as chmodSync2 } from "fs";
673
674
  import { createClient } from "@libsql/client";
674
675
 
675
676
  // src/lib/db-retry.ts
@@ -1381,6 +1382,16 @@ async function initDatabase(config) {
1381
1382
  if (process.env.DATABASE_URL && process.env.EXE_USE_POSTGRES === "1") {
1382
1383
  _adapterClient = await createPrismaDbAdapter(_resilientClient);
1383
1384
  }
1385
+ try {
1386
+ chmodSync2(config.dbPath, 384);
1387
+ for (const suffix of ["-wal", "-shm"]) {
1388
+ try {
1389
+ chmodSync2(config.dbPath + suffix, 384);
1390
+ } catch {
1391
+ }
1392
+ }
1393
+ } catch {
1394
+ }
1384
1395
  }
1385
1396
  function isInitialized() {
1386
1397
  return _adapterClient !== null || _client !== null;
package/dist/lib/db.js CHANGED
@@ -670,6 +670,7 @@ var init_db_daemon_client = __esm({
670
670
  });
671
671
 
672
672
  // src/lib/database.ts
673
+ import { chmodSync as chmodSync2 } from "fs";
673
674
  import { createClient } from "@libsql/client";
674
675
 
675
676
  // src/lib/db-retry.ts
@@ -1381,6 +1382,16 @@ async function initDatabase(config) {
1381
1382
  if (process.env.DATABASE_URL && process.env.EXE_USE_POSTGRES === "1") {
1382
1383
  _adapterClient = await createPrismaDbAdapter(_resilientClient);
1383
1384
  }
1385
+ try {
1386
+ chmodSync2(config.dbPath, 384);
1387
+ for (const suffix of ["-wal", "-shm"]) {
1388
+ try {
1389
+ chmodSync2(config.dbPath + suffix, 384);
1390
+ } catch {
1391
+ }
1392
+ }
1393
+ } catch {
1394
+ }
1384
1395
  }
1385
1396
  function isInitialized() {
1386
1397
  return _adapterClient !== null || _client !== null;
@@ -1370,6 +1370,7 @@ __export(database_exports, {
1370
1370
  isInitialized: () => isInitialized,
1371
1371
  setExternalClient: () => setExternalClient
1372
1372
  });
1373
+ import { chmodSync as chmodSync2 } from "fs";
1373
1374
  import { createClient } from "@libsql/client";
1374
1375
  async function initDatabase(config) {
1375
1376
  if (_walCheckpointTimer) {
@@ -1411,6 +1412,16 @@ async function initDatabase(config) {
1411
1412
  if (process.env.DATABASE_URL && process.env.EXE_USE_POSTGRES === "1") {
1412
1413
  _adapterClient = await createPrismaDbAdapter(_resilientClient);
1413
1414
  }
1415
+ try {
1416
+ chmodSync2(config.dbPath, 384);
1417
+ for (const suffix of ["-wal", "-shm"]) {
1418
+ try {
1419
+ chmodSync2(config.dbPath + suffix, 384);
1420
+ } catch {
1421
+ }
1422
+ }
1423
+ } catch {
1424
+ }
1414
1425
  }
1415
1426
  function isInitialized() {
1416
1427
  return _adapterClient !== null || _client !== null;
@@ -115,6 +115,7 @@ var init_config = __esm({
115
115
  import { randomUUID } from "crypto";
116
116
 
117
117
  // src/lib/database.ts
118
+ import { chmodSync as chmodSync2 } from "fs";
118
119
  import { createClient } from "@libsql/client";
119
120
 
120
121
  // src/lib/employees.ts
@@ -221,6 +222,24 @@ var PLATFORM_PROCEDURES = [
221
222
  priority: "p0",
222
223
  content: "When an agent encounters a suspected Exe OS bug, update breakage, MCP/tool failure, installer issue, memory/orchestration defect, or customer-local patch need, it MUST use create_bug_report. Do this before or alongside any local workaround so the report reaches AskExe support directly via the customer's license. Do NOT ask the founder for permission to file a required bug report. If create_bug_report is deferred/lazy-loaded, load it and call it. If it is unavailable in the live MCP surface, report 'create_bug_report unavailable in this session' and save a local report in exe/output \u2014 never claim the tool does not exist unless the live MCP surface was checked. If upstream delivery fails, call support_test (MCP) and include its result in the local report so AskExe can distinguish customer setup, license provisioning, and server intake issues; only ask the founder to run `exe-os support test` if MCP is disconnected/unavailable. Classify first: upstream_bug = reproducible exe-os/platform defect; customer_customization = identity, behavior, procedure, config, branding, workflow preference that belongs in customer-owned layers; emergency_hotfix = temporary local patch. For upstream bugs/emergency hotfixes include version, repro steps, expected/actual, files changed, workaround, and local diff summary. Avoid permanent platform-code patches unless founder approves; if a hotfix is unavoidable, document it in the bug report and re-check after npm update."
223
224
  },
225
+ {
226
+ title: "Bug report status check \u2014 surface available fixes on boot",
227
+ domain: "support",
228
+ priority: "p1",
229
+ content: "Once per session (COO boot only, never repeat), call list_my_bug_reports to check if any previously filed bug reports have been fixed by AskExe. If any report has status 'fixed' with a fixed_version, surface it to the founder immediately: '\u{1F527} N bug fix(es) available \u2014 run exe-os update to get version X.Y.Z'. This is a one-time check at boot, not a recurring poll. If no reports exist or none are fixed, skip silently. If the MCP tool is unavailable or the network call fails, skip silently \u2014 this is informational, not blocking."
230
+ },
231
+ {
232
+ title: "Feature request triage \u2014 upstream feature vs local customization",
233
+ domain: "support",
234
+ priority: "p0",
235
+ content: "When an agent or founder identifies a desired capability that exe-os does not yet provide, the COO (or equivalent coordinator) must decide: is this a local customization (identity, behavior, procedure, config, branding, workflow preference that can be configured in customer-owned layers) or an upstream feature request (a platform capability that requires changes to exe-os code, shipped via npm update)? Local customizations: implement immediately using store_behavior, update_identity, company_procedure, or config changes. Upstream features: use create_feature_request to submit to AskExe. Include use case, business impact, and current workaround. Do NOT ask the founder for permission to file a feature request \u2014 file it proactively when the need is clear."
236
+ },
237
+ {
238
+ title: "Feature request status check \u2014 surface shipped features on boot",
239
+ domain: "support",
240
+ priority: "p1",
241
+ content: "Once per session (COO boot only, never repeat), call list_my_feature_requests to check if any previously filed feature requests have been shipped by AskExe. If any request has status 'shipped' with a shipped_version, surface it to the founder immediately: '\u{1F680} N feature(s) shipped \u2014 run exe-os update to get version X.Y.Z'. This is a one-time check at boot, not a recurring poll. If no requests exist or none are shipped, skip silently. If the MCP tool is unavailable or the network call fails, skip silently \u2014 this is informational, not blocking."
242
+ },
224
243
  // --- Operations ---
225
244
  {
226
245
  title: "Managers must supervise deployed workers",