@askexenow/exe-os 0.9.116 → 0.9.118

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 (117) hide show
  1. package/deploy/compose/.env.example +22 -12
  2. package/deploy/compose/docker-compose.yml +6 -6
  3. package/deploy/compose/generate-env.ts +3 -3
  4. package/dist/bin/age-ontology-load.js +2 -2
  5. package/dist/bin/agentic-ontology-backfill.js +13 -4
  6. package/dist/bin/agentic-reflection-backfill.js +13 -4
  7. package/dist/bin/agentic-semantic-label.js +13 -4
  8. package/dist/bin/backfill-conversations.js +13 -4
  9. package/dist/bin/backfill-responses.js +13 -4
  10. package/dist/bin/backfill-vectors.js +13 -4
  11. package/dist/bin/bulk-sync-postgres.js +13 -4
  12. package/dist/bin/cc-doctor.js +2 -2
  13. package/dist/bin/cleanup-stale-review-tasks.js +45 -6
  14. package/dist/bin/cli.js +61 -58
  15. package/dist/bin/customer-readiness.js +1 -1
  16. package/dist/bin/exe-agent-config.js +2 -2
  17. package/dist/bin/exe-agent.js +3 -3
  18. package/dist/bin/exe-assign.js +13 -4
  19. package/dist/bin/exe-boot.js +62 -24
  20. package/dist/bin/exe-call.js +3 -3
  21. package/dist/bin/exe-cloud.js +16 -6
  22. package/dist/bin/exe-dispatch.js +57 -15
  23. package/dist/bin/exe-doctor.js +13 -4
  24. package/dist/bin/exe-export-behaviors.js +13 -4
  25. package/dist/bin/exe-forget.js +13 -4
  26. package/dist/bin/exe-gateway.js +61 -20
  27. package/dist/bin/exe-healthcheck.js +2 -2
  28. package/dist/bin/exe-heartbeat.js +45 -6
  29. package/dist/bin/exe-kill.js +13 -4
  30. package/dist/bin/exe-launch-agent.js +15 -6
  31. package/dist/bin/exe-new-employee.js +3 -30
  32. package/dist/bin/exe-pending-messages.js +45 -6
  33. package/dist/bin/exe-pending-notifications.js +45 -6
  34. package/dist/bin/exe-pending-reviews.js +45 -6
  35. package/dist/bin/exe-rename.js +13 -4
  36. package/dist/bin/exe-review.js +13 -4
  37. package/dist/bin/exe-search.js +17 -6
  38. package/dist/bin/exe-session-cleanup.js +57 -15
  39. package/dist/bin/exe-settings.js +2 -2
  40. package/dist/bin/exe-start-codex.js +15 -6
  41. package/dist/bin/exe-start-opencode.js +15 -6
  42. package/dist/bin/exe-status.js +45 -6
  43. package/dist/bin/exe-support.js +2 -2
  44. package/dist/bin/exe-team.js +13 -4
  45. package/dist/bin/git-sweep.js +57 -15
  46. package/dist/bin/graph-backfill.js +16 -8
  47. package/dist/bin/graph-export.js +13 -4
  48. package/dist/bin/install.js +2 -29
  49. package/dist/bin/intercom-check.js +57 -15
  50. package/dist/bin/postgres-agentic-reflection-backfill.js +2 -2
  51. package/dist/bin/postgres-agentic-semantic-backfill.js +2 -2
  52. package/dist/bin/pre-publish.js +1 -1
  53. package/dist/bin/scan-tasks.js +57 -15
  54. package/dist/bin/setup.js +6 -32
  55. package/dist/bin/shard-migrate.js +13 -4
  56. package/dist/bin/stack-update.js +2 -2
  57. package/dist/bin/update.js +2 -2
  58. package/dist/gateway/index.js +61 -20
  59. package/dist/hooks/bug-report-worker.js +57 -15
  60. package/dist/hooks/codex-stop-task-finalizer.js +56 -13
  61. package/dist/hooks/commit-complete.js +57 -15
  62. package/dist/hooks/error-recall.js +18 -7
  63. package/dist/hooks/exe-heartbeat-hook.js +3 -3
  64. package/dist/hooks/ingest-worker.js +2 -2
  65. package/dist/hooks/ingest.js +59 -25
  66. package/dist/hooks/instructions-loaded.js +14 -5
  67. package/dist/hooks/notification.js +14 -5
  68. package/dist/hooks/post-compact.js +47 -16
  69. package/dist/hooks/post-tool-combined.js +56 -20
  70. package/dist/hooks/pre-compact.js +59 -25
  71. package/dist/hooks/pre-tool-use.js +47 -16
  72. package/dist/hooks/prompt-submit.js +63 -27
  73. package/dist/hooks/session-end.js +98 -26
  74. package/dist/hooks/session-start.js +38 -10
  75. package/dist/hooks/stop.js +111 -23
  76. package/dist/hooks/subagent-stop.js +47 -16
  77. package/dist/hooks/summary-worker.js +48 -8
  78. package/dist/index.js +61 -20
  79. package/dist/lib/agent-config.js +2 -2
  80. package/dist/lib/cloud-sync.js +5 -4
  81. package/dist/lib/config.js +2 -2
  82. package/dist/lib/consolidation.js +2 -2
  83. package/dist/lib/database.js +2 -2
  84. package/dist/lib/db-daemon-client.js +2 -2
  85. package/dist/lib/db.js +2 -2
  86. package/dist/lib/device-registry.js +2 -2
  87. package/dist/lib/embedder.js +2 -2
  88. package/dist/lib/employee-templates.js +3 -3
  89. package/dist/lib/employees.js +2 -2
  90. package/dist/lib/exe-daemon-client.js +2 -2
  91. package/dist/lib/exe-daemon.js +10076 -28652
  92. package/dist/lib/hybrid-search.js +17 -6
  93. package/dist/lib/identity.js +2 -2
  94. package/dist/lib/license.js +2 -2
  95. package/dist/lib/messaging.js +35 -5
  96. package/dist/lib/reminders.js +2 -2
  97. package/dist/lib/schedules.js +13 -4
  98. package/dist/lib/session-wrappers.js +0 -27
  99. package/dist/lib/skill-learning.js +12 -8
  100. package/dist/lib/store.js +13 -4
  101. package/dist/lib/task-router.js +2 -2
  102. package/dist/lib/tasks.js +46 -13
  103. package/dist/lib/tmux-routing.js +46 -13
  104. package/dist/lib/token-spend.js +2 -2
  105. package/dist/mcp/register-tools.js +32277 -0
  106. package/dist/mcp/server.js +62 -27
  107. package/dist/mcp/tools/complete-reminder.js +2 -2
  108. package/dist/mcp/tools/create-reminder.js +2 -2
  109. package/dist/mcp/tools/create-task.js +48 -23
  110. package/dist/mcp/tools/deactivate-behavior.js +3 -3
  111. package/dist/mcp/tools/list-reminders.js +2 -2
  112. package/dist/mcp/tools/list-tasks.js +36 -14
  113. package/dist/mcp/tools/send-message.js +37 -15
  114. package/dist/mcp/tools/update-task.js +46 -26
  115. package/dist/runtime/index.js +57 -15
  116. package/dist/tui/App.js +57 -15
  117. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- # exe-os CUSTOMER VPS stack — Hygo/customer example environment variables
1
+ # exe-os VPS stack — example environment variables
2
2
  # Copy to .env before deployment and replace every CHANGEME_* value.
3
3
  # Values under # SET_MANUALLY must be provided by the operator.
4
4
 
@@ -14,13 +14,13 @@ CLICKHOUSE_PASSWORD=CHANGEME_CLICKHOUSE_PASSWORD
14
14
  REDIS_PASSWORD=CHANGEME_REDIS_PASSWORD
15
15
 
16
16
  # --- CRM ---
17
- CRM_IMAGE_TAG=registry.askexe.com/askexe/exe-crm:v0.9.3
17
+ CRM_IMAGE_TAG=ghcr.io/askexe/exe-crm:v0.9.2
18
18
  CRM_SERVER_URL=https://CHANGEME_DOMAIN
19
19
  CRM_APP_SECRET=CHANGEME_CRM_APP_SECRET
20
20
  CRM_HOST_PORT=3000
21
21
 
22
22
  # --- Wiki ---
23
- WIKI_IMAGE_TAG=registry.askexe.com/askexe/exe-wiki:v0.9.3
23
+ WIKI_IMAGE_TAG=ghcr.io/askexe/exe-wiki:v0.9.2
24
24
  WIKI_DB_SCHEMA=wiki
25
25
  WIKI_VECTOR_DB=postgres
26
26
  WIKI_AUTH_TOKEN=CHANGEME_WIKI_AUTH_TOKEN
@@ -30,22 +30,22 @@ WIKI_SIG_SALT=CHANGEME_WIKI_SIG_SALT
30
30
  WIKI_HOST_PORT=3001
31
31
 
32
32
  # --- exed ---
33
- EXED_IMAGE_TAG=registry.askexe.com/askexe/exed:v0.9.7
33
+ EXED_IMAGE_TAG=ghcr.io/askexe/exed:v0.9.2
34
34
  EXED_MCP_TOKEN=CHANGEME_EXED_MCP_TOKEN
35
- EXED_DEVICE_ID=hygo-vps
35
+ EXED_DEVICE_ID=vps-default
36
36
  # VPS-only: enables cloud/local SQLite -> exe-db Postgres projection.
37
37
  # Keep false on laptops/dev boxes.
38
38
  EXE_CLOUD_SYNC_TO_POSTGRES=true
39
39
 
40
40
  # --- Gateway ---
41
- GATEWAY_IMAGE_TAG=registry.askexe.com/askexe/exe-gateway:v0.9.3
41
+ GATEWAY_IMAGE_TAG=ghcr.io/askexe/exe-gateway:v0.9.2
42
42
  EXE_GATEWAY_AUTH_TOKEN=CHANGEME_EXE_GATEWAY_AUTH_TOKEN
43
43
  EXE_GATEWAY_WS_RELAY_AUTH_TOKEN=CHANGEME_EXE_GATEWAY_WS_RELAY_AUTH_TOKEN
44
44
  EXE_GATEWAY_WHATSAPP_VERIFY_TOKEN=CHANGEME_EXE_GATEWAY_WHATSAPP_VERIFY_TOKEN
45
45
  # SET_MANUALLY
46
- WHATSAPP_ACCESS_TOKEN=
46
+ WHATSAPP_ACCESS_TOKEN=CHANGEME_WHATSAPP_ACCESS_TOKEN
47
47
  API_ROUTER_URL=https://gateway.askexe.com
48
- API_ROUTER_KEY=exe_rk_CHANGEME_API_ROUTER_KEY
48
+ API_ROUTER_KEY=CHANGEME_API_ROUTER_KEY
49
49
  # BYOK: to use your own API keys instead of the Exe API Router,
50
50
  # set BYOK_ENABLED=true and provide ANTHROPIC_API_KEY below.
51
51
  # BYOK_ENABLED=false
@@ -54,15 +54,25 @@ GATEWAY_HTTP_HOST_PORT=3100
54
54
  GATEWAY_WS_HOST_PORT=3101
55
55
 
56
56
  # --- Monitoring agent (standard for managed customer VPSs) ---
57
- MONITOR_AGENT_IMAGE_TAG=registry.askexe.com/askexe/exe-monitor-agent:v0.9.3
57
+ MONITOR_AGENT_IMAGE_TAG=ghcr.io/askexe/exe-monitor-agent:v0.9.2
58
58
  MONITOR_HUB_URL=https://monitor.askexe.com
59
- # Required: values copied from monitor.askexe.com when adding the Hygo/customer system.
59
+ # Values copied from monitor.askexe.com when adding a new system.
60
60
  MONITOR_AGENT_TOKEN=CHANGEME_MONITOR_AGENT_TOKEN_FROM_MONITOR_HUB
61
61
  MONITOR_AGENT_KEY=CHANGEME_MONITOR_AGENT_PUBLIC_KEY_FROM_MONITOR_HUB
62
62
  MONITOR_AGENT_LISTEN=:45876
63
63
 
64
- # --- AskExe central monitoring hub ---
65
- # Not included on customer VPSs. Hygo/customer deployments run exe-monitor-agent above, never the hub.
64
+ # --- AskExe central monitoring hub auth (AskExe-owned infra only) ---
65
+ # Customer VPSs normally run only MONITOR_AGENT_* above. These hub values are
66
+ # for monitor.askexe.com on exe-db-jkt.
67
+ MONITOR_HUB_PUBLIC_URL=https://monitor.askexe.com
68
+ MONITOR_HUB_SOURCE_DIR=/opt/exe-monitor
69
+ MONITOR_HUB_HOST_PORT=8090
70
+ MONITOR_HUB_DATA_DIR=/opt/exe-monitor-data
71
+ MONITOR_TRUSTED_AUTH_HEADER=X-AskExe-User-Email
72
+ # Keep false during bootstrap; flip true after the GoTrue auth proxy is live.
73
+ MONITOR_DISABLE_PASSWORD_AUTH=false
74
+ MONITOR_USER_CREATION=true
75
+ MONITOR_SHARE_ALL_SYSTEMS=false
66
76
 
67
77
  # --- License ---
68
78
  # injected by deploy_client
@@ -108,7 +108,7 @@ services:
108
108
  # ------------------------------------------------------------------
109
109
 
110
110
  exe-crm:
111
- image: ${CRM_IMAGE_TAG:-registry.askexe.com/askexe/exe-crm:v0.9.3}
111
+ image: ${CRM_IMAGE_TAG:-ghcr.io/askexe/exe-crm:v0.9.2}
112
112
  container_name: exe-crm
113
113
  restart: unless-stopped
114
114
  depends_on:
@@ -154,7 +154,7 @@ services:
154
154
  options: { max-size: "10m", max-file: "3" }
155
155
 
156
156
  exe-crm-worker:
157
- image: ${CRM_IMAGE_TAG:-registry.askexe.com/askexe/exe-crm:v0.9.3}
157
+ image: ${CRM_IMAGE_TAG:-ghcr.io/askexe/exe-crm:v0.9.2}
158
158
  container_name: exe-crm-worker
159
159
  restart: unless-stopped
160
160
  command: ["yarn", "worker:prod"]
@@ -194,7 +194,7 @@ services:
194
194
  options: { max-size: "10m", max-file: "3" }
195
195
 
196
196
  exe-wiki:
197
- image: ${WIKI_IMAGE_TAG:-registry.askexe.com/askexe/exe-wiki:v0.9.3}
197
+ image: ${WIKI_IMAGE_TAG:-ghcr.io/askexe/exe-wiki:v0.9.2}
198
198
  container_name: exe-wiki
199
199
  restart: unless-stopped
200
200
  depends_on:
@@ -236,7 +236,7 @@ services:
236
236
  options: { max-size: "10m", max-file: "3" }
237
237
 
238
238
  exed:
239
- image: ${EXED_IMAGE_TAG:-registry.askexe.com/askexe/exed:v0.9.7}
239
+ image: ${EXED_IMAGE_TAG:-ghcr.io/askexe/exed:v0.9.2}
240
240
  container_name: exed
241
241
  restart: unless-stopped
242
242
  env_file:
@@ -272,7 +272,7 @@ services:
272
272
  options: { max-size: "10m", max-file: "3" }
273
273
 
274
274
  exe-gateway:
275
- image: ${GATEWAY_IMAGE_TAG:-registry.askexe.com/askexe/exe-gateway:v0.9.3}
275
+ image: ${GATEWAY_IMAGE_TAG:-ghcr.io/askexe/exe-gateway:v0.9.2}
276
276
  container_name: exe-gateway
277
277
  restart: unless-stopped
278
278
  depends_on:
@@ -322,7 +322,7 @@ services:
322
322
  options: { max-size: "10m", max-file: "3" }
323
323
 
324
324
  exe-monitor-agent:
325
- image: ${MONITOR_AGENT_IMAGE_TAG:-registry.askexe.com/askexe/exe-monitor-agent:v0.9.3}
325
+ image: ${MONITOR_AGENT_IMAGE_TAG:-ghcr.io/askexe/exe-monitor-agent:v0.9.2}
326
326
  container_name: exe-monitor-agent
327
327
  restart: unless-stopped
328
328
  environment:
@@ -87,7 +87,7 @@ export function generateEnv(options: GenerateEnvOptions): string {
87
87
  MANUAL_VALUE_COMMENT,
88
88
  "WHATSAPP_ACCESS_TOKEN=",
89
89
  `API_ROUTER_URL=${DEFAULT_API_ROUTER_URL}`,
90
- `API_ROUTER_KEY=exe_rk_${randomSecret(48)}`,
90
+ `API_ROUTER_KEY=${randomSecret(48)}`,
91
91
  "# BYOK: to use your own API keys instead of the Exe API Router,",
92
92
  "# set BYOK_ENABLED=true and provide ANTHROPIC_API_KEY below.",
93
93
  "# BYOK_ENABLED=false",
@@ -155,9 +155,9 @@ export function generateExampleEnv(): string {
155
155
  "EXE_GATEWAY_WS_RELAY_AUTH_TOKEN=CHANGEME_EXE_GATEWAY_WS_RELAY_AUTH_TOKEN",
156
156
  "EXE_GATEWAY_WHATSAPP_VERIFY_TOKEN=CHANGEME_EXE_GATEWAY_WHATSAPP_VERIFY_TOKEN",
157
157
  MANUAL_VALUE_COMMENT,
158
- "WHATSAPP_ACCESS_TOKEN=",
158
+ "WHATSAPP_ACCESS_TOKEN=CHANGEME_WHATSAPP_ACCESS_TOKEN",
159
159
  `API_ROUTER_URL=${DEFAULT_API_ROUTER_URL}`,
160
- "API_ROUTER_KEY=exe_rk_CHANGEME_API_ROUTER_KEY",
160
+ "API_ROUTER_KEY=CHANGEME_API_ROUTER_KEY",
161
161
  "# BYOK: to use your own API keys instead of the Exe API Router,",
162
162
  "# set BYOK_ENABLED=true and provide ANTHROPIC_API_KEY below.",
163
163
  "# BYOK_ENABLED=false",
@@ -72,8 +72,8 @@ var DEFAULT_CONFIG = {
72
72
  rerankerAutoTrigger: {
73
73
  enabled: true,
74
74
  broadQueryMinCardinality: 5e4,
75
- fetchTopK: 200,
76
- returnTopK: 20
75
+ fetchTopK: 150,
76
+ returnTopK: 5
77
77
  }
78
78
  },
79
79
  graphRagEnabled: true,
@@ -278,8 +278,8 @@ var init_config = __esm({
278
278
  rerankerAutoTrigger: {
279
279
  enabled: true,
280
280
  broadQueryMinCardinality: 5e4,
281
- fetchTopK: 200,
282
- returnTopK: 20
281
+ fetchTopK: 150,
282
+ returnTopK: 5
283
283
  }
284
284
  },
285
285
  graphRagEnabled: true,
@@ -3372,7 +3372,16 @@ async function ensureShardSchema(client) {
3372
3372
  "ALTER TABLE memories ADD COLUMN audience TEXT",
3373
3373
  "ALTER TABLE memories ADD COLUMN language_type TEXT",
3374
3374
  "ALTER TABLE memories ADD COLUMN parent_memory_id TEXT",
3375
- "ALTER TABLE memories ADD COLUMN deleted_at TEXT"
3375
+ "ALTER TABLE memories ADD COLUMN deleted_at TEXT",
3376
+ // Temporal validity (must match database.ts)
3377
+ "ALTER TABLE memories ADD COLUMN valid_from TEXT",
3378
+ "ALTER TABLE memories ADD COLUMN invalid_at TEXT",
3379
+ // Multi-agent visibility (must match database.ts)
3380
+ "ALTER TABLE memories ADD COLUMN visibility TEXT DEFAULT 'private'",
3381
+ // Procedure binding (AFM-3, must match database.ts)
3382
+ "ALTER TABLE memories ADD COLUMN procedure_for TEXT",
3383
+ // Memory strength scoring — Ebbinghaus decay (must match database.ts)
3384
+ "ALTER TABLE memories ADD COLUMN strength REAL DEFAULT 1.0"
3376
3385
  ]) {
3377
3386
  try {
3378
3387
  await client.execute(col);
@@ -3637,7 +3646,7 @@ var init_platform_procedures = __esm({
3637
3646
  title: "Routing slot vs display title \u2014 internal 'coo' is plumbing, not your name",
3638
3647
  domain: "identity",
3639
3648
  priority: "p0",
3640
- content: "These procedures reference 'COO' as a shorthand for the coordinator role. This is an INTERNAL routing slot used by exe-os code (chain-of-command checks, dispatch logic, session detection). It is NOT your display title. Your actual title comes from your identity file's `title:` field \u2014 that is what you use externally: introductions, sign-offs, team comms, and any user-facing text. If your identity says `title: AI Chief of Staff`, you are the AI Chief of Staff. The routing slot stays `role: coo` for code compatibility \u2014 never rename it, but also never introduce yourself as 'COO' unless your identity file explicitly says so. The founder chose your title; respect it."
3649
+ content: "These procedures reference 'COO' as a shorthand for the coordinator role. This is an INTERNAL routing slot used by exe-os code (chain-of-command checks, dispatch logic, session detection). It is NOT your display title. Your actual title comes from your identity file's `title:` field \u2014 that is what you use externally: introductions, sign-offs, team comms, and any user-facing text. If your identity says `title: AI Chief of Staff`, you are the AI Chief of Staff. The internal routing slot stays unchanged for code compatibility \u2014 never rename it, but also never introduce yourself as 'COO' unless your identity file explicitly says so. The founder chose your title; respect it."
3641
3650
  },
3642
3651
  {
3643
3652
  title: "Single dispatch path \u2014 create_task only",
@@ -278,8 +278,8 @@ var init_config = __esm({
278
278
  rerankerAutoTrigger: {
279
279
  enabled: true,
280
280
  broadQueryMinCardinality: 5e4,
281
- fetchTopK: 200,
282
- returnTopK: 20
281
+ fetchTopK: 150,
282
+ returnTopK: 5
283
283
  }
284
284
  },
285
285
  graphRagEnabled: true,
@@ -3372,7 +3372,16 @@ async function ensureShardSchema(client) {
3372
3372
  "ALTER TABLE memories ADD COLUMN audience TEXT",
3373
3373
  "ALTER TABLE memories ADD COLUMN language_type TEXT",
3374
3374
  "ALTER TABLE memories ADD COLUMN parent_memory_id TEXT",
3375
- "ALTER TABLE memories ADD COLUMN deleted_at TEXT"
3375
+ "ALTER TABLE memories ADD COLUMN deleted_at TEXT",
3376
+ // Temporal validity (must match database.ts)
3377
+ "ALTER TABLE memories ADD COLUMN valid_from TEXT",
3378
+ "ALTER TABLE memories ADD COLUMN invalid_at TEXT",
3379
+ // Multi-agent visibility (must match database.ts)
3380
+ "ALTER TABLE memories ADD COLUMN visibility TEXT DEFAULT 'private'",
3381
+ // Procedure binding (AFM-3, must match database.ts)
3382
+ "ALTER TABLE memories ADD COLUMN procedure_for TEXT",
3383
+ // Memory strength scoring — Ebbinghaus decay (must match database.ts)
3384
+ "ALTER TABLE memories ADD COLUMN strength REAL DEFAULT 1.0"
3376
3385
  ]) {
3377
3386
  try {
3378
3387
  await client.execute(col);
@@ -3637,7 +3646,7 @@ var init_platform_procedures = __esm({
3637
3646
  title: "Routing slot vs display title \u2014 internal 'coo' is plumbing, not your name",
3638
3647
  domain: "identity",
3639
3648
  priority: "p0",
3640
- content: "These procedures reference 'COO' as a shorthand for the coordinator role. This is an INTERNAL routing slot used by exe-os code (chain-of-command checks, dispatch logic, session detection). It is NOT your display title. Your actual title comes from your identity file's `title:` field \u2014 that is what you use externally: introductions, sign-offs, team comms, and any user-facing text. If your identity says `title: AI Chief of Staff`, you are the AI Chief of Staff. The routing slot stays `role: coo` for code compatibility \u2014 never rename it, but also never introduce yourself as 'COO' unless your identity file explicitly says so. The founder chose your title; respect it."
3649
+ content: "These procedures reference 'COO' as a shorthand for the coordinator role. This is an INTERNAL routing slot used by exe-os code (chain-of-command checks, dispatch logic, session detection). It is NOT your display title. Your actual title comes from your identity file's `title:` field \u2014 that is what you use externally: introductions, sign-offs, team comms, and any user-facing text. If your identity says `title: AI Chief of Staff`, you are the AI Chief of Staff. The internal routing slot stays unchanged for code compatibility \u2014 never rename it, but also never introduce yourself as 'COO' unless your identity file explicitly says so. The founder chose your title; respect it."
3641
3650
  },
3642
3651
  {
3643
3652
  title: "Single dispatch path \u2014 create_task only",
@@ -278,8 +278,8 @@ var init_config = __esm({
278
278
  rerankerAutoTrigger: {
279
279
  enabled: true,
280
280
  broadQueryMinCardinality: 5e4,
281
- fetchTopK: 200,
282
- returnTopK: 20
281
+ fetchTopK: 150,
282
+ returnTopK: 5
283
283
  }
284
284
  },
285
285
  graphRagEnabled: true,
@@ -3372,7 +3372,16 @@ async function ensureShardSchema(client) {
3372
3372
  "ALTER TABLE memories ADD COLUMN audience TEXT",
3373
3373
  "ALTER TABLE memories ADD COLUMN language_type TEXT",
3374
3374
  "ALTER TABLE memories ADD COLUMN parent_memory_id TEXT",
3375
- "ALTER TABLE memories ADD COLUMN deleted_at TEXT"
3375
+ "ALTER TABLE memories ADD COLUMN deleted_at TEXT",
3376
+ // Temporal validity (must match database.ts)
3377
+ "ALTER TABLE memories ADD COLUMN valid_from TEXT",
3378
+ "ALTER TABLE memories ADD COLUMN invalid_at TEXT",
3379
+ // Multi-agent visibility (must match database.ts)
3380
+ "ALTER TABLE memories ADD COLUMN visibility TEXT DEFAULT 'private'",
3381
+ // Procedure binding (AFM-3, must match database.ts)
3382
+ "ALTER TABLE memories ADD COLUMN procedure_for TEXT",
3383
+ // Memory strength scoring — Ebbinghaus decay (must match database.ts)
3384
+ "ALTER TABLE memories ADD COLUMN strength REAL DEFAULT 1.0"
3376
3385
  ]) {
3377
3386
  try {
3378
3387
  await client.execute(col);
@@ -3637,7 +3646,7 @@ var init_platform_procedures = __esm({
3637
3646
  title: "Routing slot vs display title \u2014 internal 'coo' is plumbing, not your name",
3638
3647
  domain: "identity",
3639
3648
  priority: "p0",
3640
- content: "These procedures reference 'COO' as a shorthand for the coordinator role. This is an INTERNAL routing slot used by exe-os code (chain-of-command checks, dispatch logic, session detection). It is NOT your display title. Your actual title comes from your identity file's `title:` field \u2014 that is what you use externally: introductions, sign-offs, team comms, and any user-facing text. If your identity says `title: AI Chief of Staff`, you are the AI Chief of Staff. The routing slot stays `role: coo` for code compatibility \u2014 never rename it, but also never introduce yourself as 'COO' unless your identity file explicitly says so. The founder chose your title; respect it."
3649
+ content: "These procedures reference 'COO' as a shorthand for the coordinator role. This is an INTERNAL routing slot used by exe-os code (chain-of-command checks, dispatch logic, session detection). It is NOT your display title. Your actual title comes from your identity file's `title:` field \u2014 that is what you use externally: introductions, sign-offs, team comms, and any user-facing text. If your identity says `title: AI Chief of Staff`, you are the AI Chief of Staff. The internal routing slot stays unchanged for code compatibility \u2014 never rename it, but also never introduce yourself as 'COO' unless your identity file explicitly says so. The founder chose your title; respect it."
3641
3650
  },
3642
3651
  {
3643
3652
  title: "Single dispatch path \u2014 create_task only",
@@ -278,8 +278,8 @@ var init_config = __esm({
278
278
  rerankerAutoTrigger: {
279
279
  enabled: true,
280
280
  broadQueryMinCardinality: 5e4,
281
- fetchTopK: 200,
282
- returnTopK: 20
281
+ fetchTopK: 150,
282
+ returnTopK: 5
283
283
  }
284
284
  },
285
285
  graphRagEnabled: true,
@@ -3512,7 +3512,16 @@ async function ensureShardSchema(client) {
3512
3512
  "ALTER TABLE memories ADD COLUMN audience TEXT",
3513
3513
  "ALTER TABLE memories ADD COLUMN language_type TEXT",
3514
3514
  "ALTER TABLE memories ADD COLUMN parent_memory_id TEXT",
3515
- "ALTER TABLE memories ADD COLUMN deleted_at TEXT"
3515
+ "ALTER TABLE memories ADD COLUMN deleted_at TEXT",
3516
+ // Temporal validity (must match database.ts)
3517
+ "ALTER TABLE memories ADD COLUMN valid_from TEXT",
3518
+ "ALTER TABLE memories ADD COLUMN invalid_at TEXT",
3519
+ // Multi-agent visibility (must match database.ts)
3520
+ "ALTER TABLE memories ADD COLUMN visibility TEXT DEFAULT 'private'",
3521
+ // Procedure binding (AFM-3, must match database.ts)
3522
+ "ALTER TABLE memories ADD COLUMN procedure_for TEXT",
3523
+ // Memory strength scoring — Ebbinghaus decay (must match database.ts)
3524
+ "ALTER TABLE memories ADD COLUMN strength REAL DEFAULT 1.0"
3516
3525
  ]) {
3517
3526
  try {
3518
3527
  await client.execute(col);
@@ -3777,7 +3786,7 @@ var init_platform_procedures = __esm({
3777
3786
  title: "Routing slot vs display title \u2014 internal 'coo' is plumbing, not your name",
3778
3787
  domain: "identity",
3779
3788
  priority: "p0",
3780
- content: "These procedures reference 'COO' as a shorthand for the coordinator role. This is an INTERNAL routing slot used by exe-os code (chain-of-command checks, dispatch logic, session detection). It is NOT your display title. Your actual title comes from your identity file's `title:` field \u2014 that is what you use externally: introductions, sign-offs, team comms, and any user-facing text. If your identity says `title: AI Chief of Staff`, you are the AI Chief of Staff. The routing slot stays `role: coo` for code compatibility \u2014 never rename it, but also never introduce yourself as 'COO' unless your identity file explicitly says so. The founder chose your title; respect it."
3789
+ content: "These procedures reference 'COO' as a shorthand for the coordinator role. This is an INTERNAL routing slot used by exe-os code (chain-of-command checks, dispatch logic, session detection). It is NOT your display title. Your actual title comes from your identity file's `title:` field \u2014 that is what you use externally: introductions, sign-offs, team comms, and any user-facing text. If your identity says `title: AI Chief of Staff`, you are the AI Chief of Staff. The internal routing slot stays unchanged for code compatibility \u2014 never rename it, but also never introduce yourself as 'COO' unless your identity file explicitly says so. The founder chose your title; respect it."
3781
3790
  },
3782
3791
  {
3783
3792
  title: "Single dispatch path \u2014 create_task only",
@@ -278,8 +278,8 @@ var init_config = __esm({
278
278
  rerankerAutoTrigger: {
279
279
  enabled: true,
280
280
  broadQueryMinCardinality: 5e4,
281
- fetchTopK: 200,
282
- returnTopK: 20
281
+ fetchTopK: 150,
282
+ returnTopK: 5
283
283
  }
284
284
  },
285
285
  graphRagEnabled: true,
@@ -3512,7 +3512,16 @@ async function ensureShardSchema(client) {
3512
3512
  "ALTER TABLE memories ADD COLUMN audience TEXT",
3513
3513
  "ALTER TABLE memories ADD COLUMN language_type TEXT",
3514
3514
  "ALTER TABLE memories ADD COLUMN parent_memory_id TEXT",
3515
- "ALTER TABLE memories ADD COLUMN deleted_at TEXT"
3515
+ "ALTER TABLE memories ADD COLUMN deleted_at TEXT",
3516
+ // Temporal validity (must match database.ts)
3517
+ "ALTER TABLE memories ADD COLUMN valid_from TEXT",
3518
+ "ALTER TABLE memories ADD COLUMN invalid_at TEXT",
3519
+ // Multi-agent visibility (must match database.ts)
3520
+ "ALTER TABLE memories ADD COLUMN visibility TEXT DEFAULT 'private'",
3521
+ // Procedure binding (AFM-3, must match database.ts)
3522
+ "ALTER TABLE memories ADD COLUMN procedure_for TEXT",
3523
+ // Memory strength scoring — Ebbinghaus decay (must match database.ts)
3524
+ "ALTER TABLE memories ADD COLUMN strength REAL DEFAULT 1.0"
3516
3525
  ]) {
3517
3526
  try {
3518
3527
  await client.execute(col);
@@ -3777,7 +3786,7 @@ var init_platform_procedures = __esm({
3777
3786
  title: "Routing slot vs display title \u2014 internal 'coo' is plumbing, not your name",
3778
3787
  domain: "identity",
3779
3788
  priority: "p0",
3780
- content: "These procedures reference 'COO' as a shorthand for the coordinator role. This is an INTERNAL routing slot used by exe-os code (chain-of-command checks, dispatch logic, session detection). It is NOT your display title. Your actual title comes from your identity file's `title:` field \u2014 that is what you use externally: introductions, sign-offs, team comms, and any user-facing text. If your identity says `title: AI Chief of Staff`, you are the AI Chief of Staff. The routing slot stays `role: coo` for code compatibility \u2014 never rename it, but also never introduce yourself as 'COO' unless your identity file explicitly says so. The founder chose your title; respect it."
3789
+ content: "These procedures reference 'COO' as a shorthand for the coordinator role. This is an INTERNAL routing slot used by exe-os code (chain-of-command checks, dispatch logic, session detection). It is NOT your display title. Your actual title comes from your identity file's `title:` field \u2014 that is what you use externally: introductions, sign-offs, team comms, and any user-facing text. If your identity says `title: AI Chief of Staff`, you are the AI Chief of Staff. The internal routing slot stays unchanged for code compatibility \u2014 never rename it, but also never introduce yourself as 'COO' unless your identity file explicitly says so. The founder chose your title; respect it."
3781
3790
  },
3782
3791
  {
3783
3792
  title: "Single dispatch path \u2014 create_task only",
@@ -278,8 +278,8 @@ var init_config = __esm({
278
278
  rerankerAutoTrigger: {
279
279
  enabled: true,
280
280
  broadQueryMinCardinality: 5e4,
281
- fetchTopK: 200,
282
- returnTopK: 20
281
+ fetchTopK: 150,
282
+ returnTopK: 5
283
283
  }
284
284
  },
285
285
  graphRagEnabled: true,
@@ -3508,7 +3508,16 @@ async function ensureShardSchema(client) {
3508
3508
  "ALTER TABLE memories ADD COLUMN audience TEXT",
3509
3509
  "ALTER TABLE memories ADD COLUMN language_type TEXT",
3510
3510
  "ALTER TABLE memories ADD COLUMN parent_memory_id TEXT",
3511
- "ALTER TABLE memories ADD COLUMN deleted_at TEXT"
3511
+ "ALTER TABLE memories ADD COLUMN deleted_at TEXT",
3512
+ // Temporal validity (must match database.ts)
3513
+ "ALTER TABLE memories ADD COLUMN valid_from TEXT",
3514
+ "ALTER TABLE memories ADD COLUMN invalid_at TEXT",
3515
+ // Multi-agent visibility (must match database.ts)
3516
+ "ALTER TABLE memories ADD COLUMN visibility TEXT DEFAULT 'private'",
3517
+ // Procedure binding (AFM-3, must match database.ts)
3518
+ "ALTER TABLE memories ADD COLUMN procedure_for TEXT",
3519
+ // Memory strength scoring — Ebbinghaus decay (must match database.ts)
3520
+ "ALTER TABLE memories ADD COLUMN strength REAL DEFAULT 1.0"
3512
3521
  ]) {
3513
3522
  try {
3514
3523
  await client.execute(col);
@@ -3773,7 +3782,7 @@ var init_platform_procedures = __esm({
3773
3782
  title: "Routing slot vs display title \u2014 internal 'coo' is plumbing, not your name",
3774
3783
  domain: "identity",
3775
3784
  priority: "p0",
3776
- content: "These procedures reference 'COO' as a shorthand for the coordinator role. This is an INTERNAL routing slot used by exe-os code (chain-of-command checks, dispatch logic, session detection). It is NOT your display title. Your actual title comes from your identity file's `title:` field \u2014 that is what you use externally: introductions, sign-offs, team comms, and any user-facing text. If your identity says `title: AI Chief of Staff`, you are the AI Chief of Staff. The routing slot stays `role: coo` for code compatibility \u2014 never rename it, but also never introduce yourself as 'COO' unless your identity file explicitly says so. The founder chose your title; respect it."
3785
+ content: "These procedures reference 'COO' as a shorthand for the coordinator role. This is an INTERNAL routing slot used by exe-os code (chain-of-command checks, dispatch logic, session detection). It is NOT your display title. Your actual title comes from your identity file's `title:` field \u2014 that is what you use externally: introductions, sign-offs, team comms, and any user-facing text. If your identity says `title: AI Chief of Staff`, you are the AI Chief of Staff. The internal routing slot stays unchanged for code compatibility \u2014 never rename it, but also never introduce yourself as 'COO' unless your identity file explicitly says so. The founder chose your title; respect it."
3777
3786
  },
3778
3787
  {
3779
3788
  title: "Single dispatch path \u2014 create_task only",
@@ -278,8 +278,8 @@ var init_config = __esm({
278
278
  rerankerAutoTrigger: {
279
279
  enabled: true,
280
280
  broadQueryMinCardinality: 5e4,
281
- fetchTopK: 200,
282
- returnTopK: 20
281
+ fetchTopK: 150,
282
+ returnTopK: 5
283
283
  }
284
284
  },
285
285
  graphRagEnabled: true,
@@ -3692,7 +3692,16 @@ async function ensureShardSchema(client) {
3692
3692
  "ALTER TABLE memories ADD COLUMN audience TEXT",
3693
3693
  "ALTER TABLE memories ADD COLUMN language_type TEXT",
3694
3694
  "ALTER TABLE memories ADD COLUMN parent_memory_id TEXT",
3695
- "ALTER TABLE memories ADD COLUMN deleted_at TEXT"
3695
+ "ALTER TABLE memories ADD COLUMN deleted_at TEXT",
3696
+ // Temporal validity (must match database.ts)
3697
+ "ALTER TABLE memories ADD COLUMN valid_from TEXT",
3698
+ "ALTER TABLE memories ADD COLUMN invalid_at TEXT",
3699
+ // Multi-agent visibility (must match database.ts)
3700
+ "ALTER TABLE memories ADD COLUMN visibility TEXT DEFAULT 'private'",
3701
+ // Procedure binding (AFM-3, must match database.ts)
3702
+ "ALTER TABLE memories ADD COLUMN procedure_for TEXT",
3703
+ // Memory strength scoring — Ebbinghaus decay (must match database.ts)
3704
+ "ALTER TABLE memories ADD COLUMN strength REAL DEFAULT 1.0"
3696
3705
  ]) {
3697
3706
  try {
3698
3707
  await client.execute(col);
@@ -3957,7 +3966,7 @@ var init_platform_procedures = __esm({
3957
3966
  title: "Routing slot vs display title \u2014 internal 'coo' is plumbing, not your name",
3958
3967
  domain: "identity",
3959
3968
  priority: "p0",
3960
- content: "These procedures reference 'COO' as a shorthand for the coordinator role. This is an INTERNAL routing slot used by exe-os code (chain-of-command checks, dispatch logic, session detection). It is NOT your display title. Your actual title comes from your identity file's `title:` field \u2014 that is what you use externally: introductions, sign-offs, team comms, and any user-facing text. If your identity says `title: AI Chief of Staff`, you are the AI Chief of Staff. The routing slot stays `role: coo` for code compatibility \u2014 never rename it, but also never introduce yourself as 'COO' unless your identity file explicitly says so. The founder chose your title; respect it."
3969
+ content: "These procedures reference 'COO' as a shorthand for the coordinator role. This is an INTERNAL routing slot used by exe-os code (chain-of-command checks, dispatch logic, session detection). It is NOT your display title. Your actual title comes from your identity file's `title:` field \u2014 that is what you use externally: introductions, sign-offs, team comms, and any user-facing text. If your identity says `title: AI Chief of Staff`, you are the AI Chief of Staff. The internal routing slot stays unchanged for code compatibility \u2014 never rename it, but also never introduce yourself as 'COO' unless your identity file explicitly says so. The founder chose your title; respect it."
3961
3970
  },
3962
3971
  {
3963
3972
  title: "Single dispatch path \u2014 create_task only",
@@ -79,8 +79,8 @@ var DEFAULT_CONFIG = {
79
79
  rerankerAutoTrigger: {
80
80
  enabled: true,
81
81
  broadQueryMinCardinality: 5e4,
82
- fetchTopK: 200,
83
- returnTopK: 20
82
+ fetchTopK: 150,
83
+ returnTopK: 5
84
84
  }
85
85
  },
86
86
  graphRagEnabled: true,
@@ -280,8 +280,8 @@ var init_config = __esm({
280
280
  rerankerAutoTrigger: {
281
281
  enabled: true,
282
282
  broadQueryMinCardinality: 5e4,
283
- fetchTopK: 200,
284
- returnTopK: 20
283
+ fetchTopK: 150,
284
+ returnTopK: 5
285
285
  }
286
286
  },
287
287
  graphRagEnabled: true,
@@ -4525,7 +4525,16 @@ async function ensureShardSchema(client) {
4525
4525
  "ALTER TABLE memories ADD COLUMN audience TEXT",
4526
4526
  "ALTER TABLE memories ADD COLUMN language_type TEXT",
4527
4527
  "ALTER TABLE memories ADD COLUMN parent_memory_id TEXT",
4528
- "ALTER TABLE memories ADD COLUMN deleted_at TEXT"
4528
+ "ALTER TABLE memories ADD COLUMN deleted_at TEXT",
4529
+ // Temporal validity (must match database.ts)
4530
+ "ALTER TABLE memories ADD COLUMN valid_from TEXT",
4531
+ "ALTER TABLE memories ADD COLUMN invalid_at TEXT",
4532
+ // Multi-agent visibility (must match database.ts)
4533
+ "ALTER TABLE memories ADD COLUMN visibility TEXT DEFAULT 'private'",
4534
+ // Procedure binding (AFM-3, must match database.ts)
4535
+ "ALTER TABLE memories ADD COLUMN procedure_for TEXT",
4536
+ // Memory strength scoring — Ebbinghaus decay (must match database.ts)
4537
+ "ALTER TABLE memories ADD COLUMN strength REAL DEFAULT 1.0"
4529
4538
  ]) {
4530
4539
  try {
4531
4540
  await client.execute(col);
@@ -4790,7 +4799,7 @@ var init_platform_procedures = __esm({
4790
4799
  title: "Routing slot vs display title \u2014 internal 'coo' is plumbing, not your name",
4791
4800
  domain: "identity",
4792
4801
  priority: "p0",
4793
- content: "These procedures reference 'COO' as a shorthand for the coordinator role. This is an INTERNAL routing slot used by exe-os code (chain-of-command checks, dispatch logic, session detection). It is NOT your display title. Your actual title comes from your identity file's `title:` field \u2014 that is what you use externally: introductions, sign-offs, team comms, and any user-facing text. If your identity says `title: AI Chief of Staff`, you are the AI Chief of Staff. The routing slot stays `role: coo` for code compatibility \u2014 never rename it, but also never introduce yourself as 'COO' unless your identity file explicitly says so. The founder chose your title; respect it."
4802
+ content: "These procedures reference 'COO' as a shorthand for the coordinator role. This is an INTERNAL routing slot used by exe-os code (chain-of-command checks, dispatch logic, session detection). It is NOT your display title. Your actual title comes from your identity file's `title:` field \u2014 that is what you use externally: introductions, sign-offs, team comms, and any user-facing text. If your identity says `title: AI Chief of Staff`, you are the AI Chief of Staff. The internal routing slot stays unchanged for code compatibility \u2014 never rename it, but also never introduce yourself as 'COO' unless your identity file explicitly says so. The founder chose your title; respect it."
4794
4803
  },
4795
4804
  {
4796
4805
  title: "Single dispatch path \u2014 create_task only",
@@ -6499,6 +6508,27 @@ var init_agent_symlinks = __esm({
6499
6508
  }
6500
6509
  });
6501
6510
 
6511
+ // src/lib/agent-context.ts
6512
+ var agent_context_exports = {};
6513
+ __export(agent_context_exports, {
6514
+ getAgentContext: () => getAgentContext,
6515
+ runWithAgent: () => runWithAgent
6516
+ });
6517
+ import { AsyncLocalStorage } from "async_hooks";
6518
+ function runWithAgent(ctx, fn) {
6519
+ return agentStore.run(ctx, fn);
6520
+ }
6521
+ function getAgentContext() {
6522
+ return agentStore.getStore();
6523
+ }
6524
+ var agentStore;
6525
+ var init_agent_context = __esm({
6526
+ "src/lib/agent-context.ts"() {
6527
+ "use strict";
6528
+ agentStore = new AsyncLocalStorage();
6529
+ }
6530
+ });
6531
+
6502
6532
  // src/lib/tmux-routing.ts
6503
6533
  import { readFileSync as readFileSync9, writeFileSync as writeFileSync6, mkdirSync as mkdirSync7, existsSync as existsSync14, appendFileSync, readdirSync as readdirSync2 } from "fs";
6504
6534
  import path14 from "path";
@@ -6558,8 +6588,17 @@ function getParentExe(sessionKey) {
6558
6588
  function resolveExeSession() {
6559
6589
  const mySession = getMySession();
6560
6590
  const fromSessionName = mySession ? extractRootExe(mySession) ?? null : null;
6561
- if (process.env.EXE_SESSION_NAME) {
6562
- const fromEnv = extractRootExe(process.env.EXE_SESSION_NAME) ?? process.env.EXE_SESSION_NAME;
6591
+ const alsHint = (() => {
6592
+ try {
6593
+ const { getAgentContext: getAgentContext2 } = (init_agent_context(), __toCommonJS(agent_context_exports));
6594
+ return getAgentContext2()?.sessionHint ?? "";
6595
+ } catch {
6596
+ return "";
6597
+ }
6598
+ })();
6599
+ const sessionHintRaw = alsHint || process.env.EXE_SESSION_NAME || "";
6600
+ if (sessionHintRaw) {
6601
+ const fromEnv = extractRootExe(sessionHintRaw) ?? sessionHintRaw;
6563
6602
  if (fromEnv) {
6564
6603
  if (!mySession) {
6565
6604
  return fromEnv;