@askexenow/exe-os 0.9.69 → 0.9.71

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 (79) hide show
  1. package/deploy/stack-manifests/v0.9.json +96 -16
  2. package/dist/bin/agentic-ontology-backfill.js +33 -0
  3. package/dist/bin/agentic-reflection-backfill.js +33 -0
  4. package/dist/bin/agentic-semantic-label.js +33 -0
  5. package/dist/bin/backfill-conversations.js +33 -0
  6. package/dist/bin/backfill-responses.js +33 -0
  7. package/dist/bin/backfill-vectors.js +33 -0
  8. package/dist/bin/bulk-sync-postgres.js +33 -0
  9. package/dist/bin/cleanup-stale-review-tasks.js +33 -0
  10. package/dist/bin/cli.js +1284 -178
  11. package/dist/bin/exe-agent.js +6 -0
  12. package/dist/bin/exe-assign.js +33 -0
  13. package/dist/bin/exe-boot.js +33 -0
  14. package/dist/bin/exe-call.js +6 -0
  15. package/dist/bin/exe-cloud.js +33 -0
  16. package/dist/bin/exe-dispatch.js +33 -0
  17. package/dist/bin/exe-doctor.js +33 -0
  18. package/dist/bin/exe-export-behaviors.js +33 -0
  19. package/dist/bin/exe-forget.js +33 -0
  20. package/dist/bin/exe-gateway.js +178 -110
  21. package/dist/bin/exe-heartbeat.js +33 -0
  22. package/dist/bin/exe-kill.js +33 -0
  23. package/dist/bin/exe-launch-agent.js +33 -0
  24. package/dist/bin/exe-new-employee.js +6 -0
  25. package/dist/bin/exe-pending-messages.js +33 -0
  26. package/dist/bin/exe-pending-notifications.js +33 -0
  27. package/dist/bin/exe-pending-reviews.js +33 -0
  28. package/dist/bin/exe-rename.js +40 -4
  29. package/dist/bin/exe-review.js +33 -0
  30. package/dist/bin/exe-search.js +33 -0
  31. package/dist/bin/exe-session-cleanup.js +33 -0
  32. package/dist/bin/exe-start-codex.js +33 -0
  33. package/dist/bin/exe-start-opencode.js +33 -0
  34. package/dist/bin/exe-status.js +33 -0
  35. package/dist/bin/exe-team.js +33 -0
  36. package/dist/bin/git-sweep.js +33 -0
  37. package/dist/bin/graph-backfill.js +177 -110
  38. package/dist/bin/graph-export.js +33 -0
  39. package/dist/bin/intercom-check.js +33 -0
  40. package/dist/bin/registry-proxy.js +207 -0
  41. package/dist/bin/scan-tasks.js +33 -0
  42. package/dist/bin/setup.js +33 -0
  43. package/dist/bin/shard-migrate.js +33 -0
  44. package/dist/bin/stack-update.js +128 -0
  45. package/dist/gateway/index.js +178 -110
  46. package/dist/hooks/bug-report-worker.js +33 -0
  47. package/dist/hooks/codex-stop-task-finalizer.js +33 -0
  48. package/dist/hooks/commit-complete.js +33 -0
  49. package/dist/hooks/error-recall.js +33 -0
  50. package/dist/hooks/ingest.js +33 -0
  51. package/dist/hooks/instructions-loaded.js +33 -0
  52. package/dist/hooks/notification.js +33 -0
  53. package/dist/hooks/post-compact.js +33 -0
  54. package/dist/hooks/post-tool-combined.js +698 -17
  55. package/dist/hooks/pre-compact.js +33 -0
  56. package/dist/hooks/pre-tool-use.js +33 -0
  57. package/dist/hooks/prompt-submit.js +314 -0
  58. package/dist/hooks/session-end.js +33 -0
  59. package/dist/hooks/session-start.js +33 -0
  60. package/dist/hooks/stop.js +279 -12
  61. package/dist/hooks/subagent-stop.js +33 -0
  62. package/dist/hooks/summary-worker.js +33 -0
  63. package/dist/index.js +178 -110
  64. package/dist/lib/cloud-sync.js +27 -0
  65. package/dist/lib/database.js +27 -0
  66. package/dist/lib/db.js +27 -0
  67. package/dist/lib/device-registry.js +27 -0
  68. package/dist/lib/employee-templates.js +6 -0
  69. package/dist/lib/exe-daemon.js +639 -259
  70. package/dist/lib/hybrid-search.js +33 -0
  71. package/dist/lib/registry-proxy.js +162 -0
  72. package/dist/lib/schedules.js +33 -0
  73. package/dist/lib/store.js +33 -0
  74. package/dist/mcp/server.js +561 -244
  75. package/dist/runtime/index.js +33 -0
  76. package/dist/tui/App.js +33 -0
  77. package/package.json +3 -2
  78. package/stack.release.json +6 -4
  79. package/stack.release.schema.json +89 -18
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "latest": "0.9.2",
3
+ "latest": "0.9.3",
4
4
  "stacks": {
5
5
  "0.9.0": {
6
6
  "version": "0.9.0",
@@ -20,26 +20,31 @@
20
20
  "crm": {
21
21
  "env": "CRM_IMAGE_TAG",
22
22
  "image": "ghcr.io/askexe/exe-crm:v0.9.0",
23
- "healthUrl": "http://127.0.0.1:3000/healthz"
23
+ "healthUrl": "http://127.0.0.1:3000/healthz",
24
+ "deploymentScope": "customer"
24
25
  },
25
26
  "wiki": {
26
27
  "env": "WIKI_IMAGE_TAG",
27
28
  "image": "ghcr.io/askexe/exe-wiki:v0.9.0",
28
- "healthUrl": "http://127.0.0.1:3001/api/ping"
29
+ "healthUrl": "http://127.0.0.1:3001/api/ping",
30
+ "deploymentScope": "customer"
29
31
  },
30
32
  "exed": {
31
33
  "env": "EXED_IMAGE_TAG",
32
34
  "image": "ghcr.io/askexe/exed:v0.9.66",
33
- "healthUrl": "http://127.0.0.1:8765/health"
35
+ "healthUrl": "http://127.0.0.1:8765/health",
36
+ "deploymentScope": "customer"
34
37
  },
35
38
  "gateway": {
36
39
  "env": "GATEWAY_IMAGE_TAG",
37
40
  "image": "ghcr.io/askexe/exe-gateway:v0.9.0",
38
- "healthUrl": "http://127.0.0.1:3100/health"
41
+ "healthUrl": "http://127.0.0.1:3100/health",
42
+ "deploymentScope": "customer"
39
43
  },
40
44
  "monitorAgent": {
41
45
  "env": "MONITOR_AGENT_IMAGE_TAG",
42
- "image": "ghcr.io/askexe/exe-monitor-agent:v0.9.0"
46
+ "image": "ghcr.io/askexe/exe-monitor-agent:v0.9.0",
47
+ "deploymentScope": "customer"
43
48
  }
44
49
  },
45
50
  "releaseDescriptors": {
@@ -69,26 +74,31 @@
69
74
  "crm": {
70
75
  "env": "CRM_IMAGE_TAG",
71
76
  "image": "ghcr.io/askexe/exe-crm:v0.9.1",
72
- "healthUrl": "http://127.0.0.1:3000/healthz"
77
+ "healthUrl": "http://127.0.0.1:3000/healthz",
78
+ "deploymentScope": "customer"
73
79
  },
74
80
  "wiki": {
75
81
  "env": "WIKI_IMAGE_TAG",
76
82
  "image": "ghcr.io/askexe/exe-wiki:v0.9.1",
77
- "healthUrl": "http://127.0.0.1:3001/api/ping"
83
+ "healthUrl": "http://127.0.0.1:3001/api/ping",
84
+ "deploymentScope": "customer"
78
85
  },
79
86
  "exed": {
80
87
  "env": "EXED_IMAGE_TAG",
81
88
  "image": "ghcr.io/askexe/exed:v0.9.66",
82
- "healthUrl": "http://127.0.0.1:8765/health"
89
+ "healthUrl": "http://127.0.0.1:8765/health",
90
+ "deploymentScope": "customer"
83
91
  },
84
92
  "gateway": {
85
93
  "env": "GATEWAY_IMAGE_TAG",
86
94
  "image": "ghcr.io/askexe/exe-gateway:v0.9.1",
87
- "healthUrl": "http://127.0.0.1:3100/health"
95
+ "healthUrl": "http://127.0.0.1:3100/health",
96
+ "deploymentScope": "customer"
88
97
  },
89
98
  "monitorAgent": {
90
99
  "env": "MONITOR_AGENT_IMAGE_TAG",
91
- "image": "ghcr.io/askexe/exe-monitor-agent:v0.9.1"
100
+ "image": "ghcr.io/askexe/exe-monitor-agent:v0.9.1",
101
+ "deploymentScope": "customer"
92
102
  }
93
103
  },
94
104
  "releaseDescriptors": {
@@ -118,26 +128,31 @@
118
128
  "crm": {
119
129
  "env": "CRM_IMAGE_TAG",
120
130
  "image": "ghcr.io/askexe/exe-crm:v0.9.2",
121
- "healthUrl": "http://127.0.0.1:3000/healthz"
131
+ "healthUrl": "http://127.0.0.1:3000/healthz",
132
+ "deploymentScope": "customer"
122
133
  },
123
134
  "wiki": {
124
135
  "env": "WIKI_IMAGE_TAG",
125
136
  "image": "ghcr.io/askexe/exe-wiki:v0.9.2",
126
- "healthUrl": "http://127.0.0.1:3001/api/ping"
137
+ "healthUrl": "http://127.0.0.1:3001/api/ping",
138
+ "deploymentScope": "customer"
127
139
  },
128
140
  "exed": {
129
141
  "env": "EXED_IMAGE_TAG",
130
142
  "image": "ghcr.io/askexe/exed:v0.9.2",
131
- "healthUrl": "http://127.0.0.1:8765/health"
143
+ "healthUrl": "http://127.0.0.1:8765/health",
144
+ "deploymentScope": "customer"
132
145
  },
133
146
  "gateway": {
134
147
  "env": "GATEWAY_IMAGE_TAG",
135
148
  "image": "ghcr.io/askexe/exe-gateway:v0.9.2",
136
- "healthUrl": "http://127.0.0.1:3100/health"
149
+ "healthUrl": "http://127.0.0.1:3100/health",
150
+ "deploymentScope": "customer"
137
151
  },
138
152
  "monitorAgent": {
139
153
  "env": "MONITOR_AGENT_IMAGE_TAG",
140
- "image": "ghcr.io/askexe/exe-monitor-agent:v0.9.2"
154
+ "image": "ghcr.io/askexe/exe-monitor-agent:v0.9.2",
155
+ "deploymentScope": "customer"
141
156
  }
142
157
  },
143
158
  "releaseDescriptors": {
@@ -148,6 +163,71 @@
148
163
  "db": "AskExe/exe-db@0.9.2:stack.release.json",
149
164
  "monitorAgent": "AskExe/exe-monitor@0.9.2:stack.release.json"
150
165
  }
166
+ },
167
+ "0.9.3": {
168
+ "version": "0.9.3",
169
+ "releasedAt": "2026-05-12T00:00:00Z",
170
+ "notes": "Hygo fresh customer stack release. Rebuilds all Hygo deployable images from latest approved repo heads after deployment-boundary/doc hardening and exe-monitor live monitoring updates.",
171
+ "breakingChanges": [
172
+ {
173
+ "id": "whatsapp_relink_required",
174
+ "title": "WhatsApp QR re-link required for Baileys v7",
175
+ "description": "exe-gateway uses Baileys v7. Existing WhatsApp 6.x linked-device auth state must be backed up and re-linked once with a new QR code.",
176
+ "requiredAction": "Open https://<gateway-domain>/pair/default?token=<admin-token> and scan from WhatsApp \u2192 Linked Devices after the update.",
177
+ "expectedDowntimeMinutes": "2-5",
178
+ "requiresConfirmation": true
179
+ }
180
+ ],
181
+ "services": {
182
+ "crm": {
183
+ "env": "CRM_IMAGE_TAG",
184
+ "image": "registry.askexe.com/askexe/exe-crm:v0.9.3",
185
+ "healthUrl": "http://127.0.0.1:3000/healthz",
186
+ "deploymentScope": "customer"
187
+ },
188
+ "wiki": {
189
+ "env": "WIKI_IMAGE_TAG",
190
+ "image": "registry.askexe.com/askexe/exe-wiki:v0.9.3",
191
+ "healthUrl": "http://127.0.0.1:3001/api/ping",
192
+ "deploymentScope": "customer"
193
+ },
194
+ "exed": {
195
+ "env": "EXED_IMAGE_TAG",
196
+ "image": "registry.askexe.com/askexe/exed:v0.9.3",
197
+ "healthUrl": "http://127.0.0.1:8765/health",
198
+ "deploymentScope": "customer"
199
+ },
200
+ "gateway": {
201
+ "env": "GATEWAY_IMAGE_TAG",
202
+ "image": "registry.askexe.com/askexe/exe-gateway:v0.9.3",
203
+ "healthUrl": "http://127.0.0.1:3100/health",
204
+ "deploymentScope": "customer"
205
+ },
206
+ "monitorAgent": {
207
+ "env": "MONITOR_AGENT_IMAGE_TAG",
208
+ "image": "registry.askexe.com/askexe/exe-monitor-agent:v0.9.3",
209
+ "deploymentScope": "customer"
210
+ }
211
+ },
212
+ "releaseDescriptors": {
213
+ "exed": "AskExe/exe-os@0.9.3:stack.release.json",
214
+ "crm": "AskExe/exe-crm@0.9.3:stack.release.json",
215
+ "wiki": "AskExe/exe-wiki@0.9.3:stack.release.json",
216
+ "gateway": "AskExe/exe-gateway@0.9.3:stack.release.json",
217
+ "db": "AskExe/exe-db@0.9.3:stack.release.json",
218
+ "monitorAgent": "AskExe/exe-monitor@0.9.3:stack.release.json"
219
+ },
220
+ "componentVersions": {
221
+ "exe-os": {
222
+ "repo": "AskExe/exe-os",
223
+ "npmPackage": "@askexenow/exe-os",
224
+ "npmVersion": "0.9.69",
225
+ "image": "registry.askexe.com/askexe/exed:v0.9.3",
226
+ "imageVersion": "0.9.3",
227
+ "note": "npm package version and customer stack image tag are separate version tracks; Hygo pulls the exed image through registry.askexe.com, which proxies the GHCR artifact server-side.",
228
+ "sourceRef": "v0.9.3"
229
+ }
230
+ }
151
231
  }
152
232
  }
153
233
  }
@@ -2222,6 +2222,33 @@ async function ensureSchema() {
2222
2222
  CREATE INDEX IF NOT EXISTS idx_chat_history_session
2223
2223
  ON chat_history(session_id, id);
2224
2224
  `);
2225
+ await client.executeMultiple(`
2226
+ CREATE TABLE IF NOT EXISTS session_events (
2227
+ id TEXT PRIMARY KEY,
2228
+ agent_id TEXT NOT NULL,
2229
+ agent_role TEXT NOT NULL,
2230
+ session_id TEXT NOT NULL,
2231
+ session_scope TEXT,
2232
+ project_name TEXT NOT NULL,
2233
+ event_index INTEGER NOT NULL,
2234
+ event_type TEXT NOT NULL,
2235
+ tool_name TEXT,
2236
+ tool_use_id TEXT,
2237
+ content TEXT NOT NULL,
2238
+ payload_json TEXT,
2239
+ has_error INTEGER NOT NULL DEFAULT 0,
2240
+ created_at TEXT NOT NULL
2241
+ );
2242
+
2243
+ CREATE INDEX IF NOT EXISTS idx_session_events_agent_time
2244
+ ON session_events(agent_id, created_at DESC);
2245
+
2246
+ CREATE INDEX IF NOT EXISTS idx_session_events_session_index
2247
+ ON session_events(session_id, event_index);
2248
+
2249
+ CREATE INDEX IF NOT EXISTS idx_session_events_scope_agent_time
2250
+ ON session_events(session_scope, agent_id, created_at DESC);
2251
+ `);
2225
2252
  await client.executeMultiple(`
2226
2253
  CREATE TABLE IF NOT EXISTS workspaces (
2227
2254
  id TEXT PRIMARY KEY,
@@ -3353,6 +3380,12 @@ var init_platform_procedures = __esm({
3353
3380
  priority: "p0",
3354
3381
  content: "exe-build-adv is MANDATORY for ALL work touching 3+ files. Run /exe-build-adv --auto BEFORE implementation. Pipeline: Spec \u2192 AC \u2192 Tests \u2192 Evaluate \u2192 Fix. No multi-file feature ships without pipeline artifacts. No exceptions \u2014 managers reject work without them."
3355
3382
  },
3383
+ {
3384
+ title: "Code context first for repository orientation",
3385
+ domain: "workflow",
3386
+ priority: "p1",
3387
+ content: "Before broad repo exploration, symbol tracing, blast-radius review, or codebase Q&A, agents should use the consolidated code_context MCP tool instead of manual grep/read loops. Use action=index or stats to refresh/check the index; action=search with query, limit, offset, languages, paths, refresh_index for fresh multi-language code/doc search; action=trace for symbol imports/dependents; action=blast_radius for impact analysis before edits. CLI parity exists via exe-os code-context init|index|status|stats|search|doctor. Keep code_context separate from durable employee memory: promote only validated decisions, procedures, or lessons into store_memory/commit_memory."
3388
+ },
3356
3389
  {
3357
3390
  title: "Commit discipline \u2014 never leave verified work floating",
3358
3391
  domain: "workflow",
@@ -2222,6 +2222,33 @@ async function ensureSchema() {
2222
2222
  CREATE INDEX IF NOT EXISTS idx_chat_history_session
2223
2223
  ON chat_history(session_id, id);
2224
2224
  `);
2225
+ await client.executeMultiple(`
2226
+ CREATE TABLE IF NOT EXISTS session_events (
2227
+ id TEXT PRIMARY KEY,
2228
+ agent_id TEXT NOT NULL,
2229
+ agent_role TEXT NOT NULL,
2230
+ session_id TEXT NOT NULL,
2231
+ session_scope TEXT,
2232
+ project_name TEXT NOT NULL,
2233
+ event_index INTEGER NOT NULL,
2234
+ event_type TEXT NOT NULL,
2235
+ tool_name TEXT,
2236
+ tool_use_id TEXT,
2237
+ content TEXT NOT NULL,
2238
+ payload_json TEXT,
2239
+ has_error INTEGER NOT NULL DEFAULT 0,
2240
+ created_at TEXT NOT NULL
2241
+ );
2242
+
2243
+ CREATE INDEX IF NOT EXISTS idx_session_events_agent_time
2244
+ ON session_events(agent_id, created_at DESC);
2245
+
2246
+ CREATE INDEX IF NOT EXISTS idx_session_events_session_index
2247
+ ON session_events(session_id, event_index);
2248
+
2249
+ CREATE INDEX IF NOT EXISTS idx_session_events_scope_agent_time
2250
+ ON session_events(session_scope, agent_id, created_at DESC);
2251
+ `);
2225
2252
  await client.executeMultiple(`
2226
2253
  CREATE TABLE IF NOT EXISTS workspaces (
2227
2254
  id TEXT PRIMARY KEY,
@@ -3353,6 +3380,12 @@ var init_platform_procedures = __esm({
3353
3380
  priority: "p0",
3354
3381
  content: "exe-build-adv is MANDATORY for ALL work touching 3+ files. Run /exe-build-adv --auto BEFORE implementation. Pipeline: Spec \u2192 AC \u2192 Tests \u2192 Evaluate \u2192 Fix. No multi-file feature ships without pipeline artifacts. No exceptions \u2014 managers reject work without them."
3355
3382
  },
3383
+ {
3384
+ title: "Code context first for repository orientation",
3385
+ domain: "workflow",
3386
+ priority: "p1",
3387
+ content: "Before broad repo exploration, symbol tracing, blast-radius review, or codebase Q&A, agents should use the consolidated code_context MCP tool instead of manual grep/read loops. Use action=index or stats to refresh/check the index; action=search with query, limit, offset, languages, paths, refresh_index for fresh multi-language code/doc search; action=trace for symbol imports/dependents; action=blast_radius for impact analysis before edits. CLI parity exists via exe-os code-context init|index|status|stats|search|doctor. Keep code_context separate from durable employee memory: promote only validated decisions, procedures, or lessons into store_memory/commit_memory."
3388
+ },
3356
3389
  {
3357
3390
  title: "Commit discipline \u2014 never leave verified work floating",
3358
3391
  domain: "workflow",
@@ -2222,6 +2222,33 @@ async function ensureSchema() {
2222
2222
  CREATE INDEX IF NOT EXISTS idx_chat_history_session
2223
2223
  ON chat_history(session_id, id);
2224
2224
  `);
2225
+ await client.executeMultiple(`
2226
+ CREATE TABLE IF NOT EXISTS session_events (
2227
+ id TEXT PRIMARY KEY,
2228
+ agent_id TEXT NOT NULL,
2229
+ agent_role TEXT NOT NULL,
2230
+ session_id TEXT NOT NULL,
2231
+ session_scope TEXT,
2232
+ project_name TEXT NOT NULL,
2233
+ event_index INTEGER NOT NULL,
2234
+ event_type TEXT NOT NULL,
2235
+ tool_name TEXT,
2236
+ tool_use_id TEXT,
2237
+ content TEXT NOT NULL,
2238
+ payload_json TEXT,
2239
+ has_error INTEGER NOT NULL DEFAULT 0,
2240
+ created_at TEXT NOT NULL
2241
+ );
2242
+
2243
+ CREATE INDEX IF NOT EXISTS idx_session_events_agent_time
2244
+ ON session_events(agent_id, created_at DESC);
2245
+
2246
+ CREATE INDEX IF NOT EXISTS idx_session_events_session_index
2247
+ ON session_events(session_id, event_index);
2248
+
2249
+ CREATE INDEX IF NOT EXISTS idx_session_events_scope_agent_time
2250
+ ON session_events(session_scope, agent_id, created_at DESC);
2251
+ `);
2225
2252
  await client.executeMultiple(`
2226
2253
  CREATE TABLE IF NOT EXISTS workspaces (
2227
2254
  id TEXT PRIMARY KEY,
@@ -3353,6 +3380,12 @@ var init_platform_procedures = __esm({
3353
3380
  priority: "p0",
3354
3381
  content: "exe-build-adv is MANDATORY for ALL work touching 3+ files. Run /exe-build-adv --auto BEFORE implementation. Pipeline: Spec \u2192 AC \u2192 Tests \u2192 Evaluate \u2192 Fix. No multi-file feature ships without pipeline artifacts. No exceptions \u2014 managers reject work without them."
3355
3382
  },
3383
+ {
3384
+ title: "Code context first for repository orientation",
3385
+ domain: "workflow",
3386
+ priority: "p1",
3387
+ content: "Before broad repo exploration, symbol tracing, blast-radius review, or codebase Q&A, agents should use the consolidated code_context MCP tool instead of manual grep/read loops. Use action=index or stats to refresh/check the index; action=search with query, limit, offset, languages, paths, refresh_index for fresh multi-language code/doc search; action=trace for symbol imports/dependents; action=blast_radius for impact analysis before edits. CLI parity exists via exe-os code-context init|index|status|stats|search|doctor. Keep code_context separate from durable employee memory: promote only validated decisions, procedures, or lessons into store_memory/commit_memory."
3388
+ },
3356
3389
  {
3357
3390
  title: "Commit discipline \u2014 never leave verified work floating",
3358
3391
  domain: "workflow",
@@ -2362,6 +2362,33 @@ async function ensureSchema() {
2362
2362
  CREATE INDEX IF NOT EXISTS idx_chat_history_session
2363
2363
  ON chat_history(session_id, id);
2364
2364
  `);
2365
+ await client.executeMultiple(`
2366
+ CREATE TABLE IF NOT EXISTS session_events (
2367
+ id TEXT PRIMARY KEY,
2368
+ agent_id TEXT NOT NULL,
2369
+ agent_role TEXT NOT NULL,
2370
+ session_id TEXT NOT NULL,
2371
+ session_scope TEXT,
2372
+ project_name TEXT NOT NULL,
2373
+ event_index INTEGER NOT NULL,
2374
+ event_type TEXT NOT NULL,
2375
+ tool_name TEXT,
2376
+ tool_use_id TEXT,
2377
+ content TEXT NOT NULL,
2378
+ payload_json TEXT,
2379
+ has_error INTEGER NOT NULL DEFAULT 0,
2380
+ created_at TEXT NOT NULL
2381
+ );
2382
+
2383
+ CREATE INDEX IF NOT EXISTS idx_session_events_agent_time
2384
+ ON session_events(agent_id, created_at DESC);
2385
+
2386
+ CREATE INDEX IF NOT EXISTS idx_session_events_session_index
2387
+ ON session_events(session_id, event_index);
2388
+
2389
+ CREATE INDEX IF NOT EXISTS idx_session_events_scope_agent_time
2390
+ ON session_events(session_scope, agent_id, created_at DESC);
2391
+ `);
2365
2392
  await client.executeMultiple(`
2366
2393
  CREATE TABLE IF NOT EXISTS workspaces (
2367
2394
  id TEXT PRIMARY KEY,
@@ -3493,6 +3520,12 @@ var init_platform_procedures = __esm({
3493
3520
  priority: "p0",
3494
3521
  content: "exe-build-adv is MANDATORY for ALL work touching 3+ files. Run /exe-build-adv --auto BEFORE implementation. Pipeline: Spec \u2192 AC \u2192 Tests \u2192 Evaluate \u2192 Fix. No multi-file feature ships without pipeline artifacts. No exceptions \u2014 managers reject work without them."
3495
3522
  },
3523
+ {
3524
+ title: "Code context first for repository orientation",
3525
+ domain: "workflow",
3526
+ priority: "p1",
3527
+ content: "Before broad repo exploration, symbol tracing, blast-radius review, or codebase Q&A, agents should use the consolidated code_context MCP tool instead of manual grep/read loops. Use action=index or stats to refresh/check the index; action=search with query, limit, offset, languages, paths, refresh_index for fresh multi-language code/doc search; action=trace for symbol imports/dependents; action=blast_radius for impact analysis before edits. CLI parity exists via exe-os code-context init|index|status|stats|search|doctor. Keep code_context separate from durable employee memory: promote only validated decisions, procedures, or lessons into store_memory/commit_memory."
3528
+ },
3496
3529
  {
3497
3530
  title: "Commit discipline \u2014 never leave verified work floating",
3498
3531
  domain: "workflow",
@@ -2362,6 +2362,33 @@ async function ensureSchema() {
2362
2362
  CREATE INDEX IF NOT EXISTS idx_chat_history_session
2363
2363
  ON chat_history(session_id, id);
2364
2364
  `);
2365
+ await client.executeMultiple(`
2366
+ CREATE TABLE IF NOT EXISTS session_events (
2367
+ id TEXT PRIMARY KEY,
2368
+ agent_id TEXT NOT NULL,
2369
+ agent_role TEXT NOT NULL,
2370
+ session_id TEXT NOT NULL,
2371
+ session_scope TEXT,
2372
+ project_name TEXT NOT NULL,
2373
+ event_index INTEGER NOT NULL,
2374
+ event_type TEXT NOT NULL,
2375
+ tool_name TEXT,
2376
+ tool_use_id TEXT,
2377
+ content TEXT NOT NULL,
2378
+ payload_json TEXT,
2379
+ has_error INTEGER NOT NULL DEFAULT 0,
2380
+ created_at TEXT NOT NULL
2381
+ );
2382
+
2383
+ CREATE INDEX IF NOT EXISTS idx_session_events_agent_time
2384
+ ON session_events(agent_id, created_at DESC);
2385
+
2386
+ CREATE INDEX IF NOT EXISTS idx_session_events_session_index
2387
+ ON session_events(session_id, event_index);
2388
+
2389
+ CREATE INDEX IF NOT EXISTS idx_session_events_scope_agent_time
2390
+ ON session_events(session_scope, agent_id, created_at DESC);
2391
+ `);
2365
2392
  await client.executeMultiple(`
2366
2393
  CREATE TABLE IF NOT EXISTS workspaces (
2367
2394
  id TEXT PRIMARY KEY,
@@ -3493,6 +3520,12 @@ var init_platform_procedures = __esm({
3493
3520
  priority: "p0",
3494
3521
  content: "exe-build-adv is MANDATORY for ALL work touching 3+ files. Run /exe-build-adv --auto BEFORE implementation. Pipeline: Spec \u2192 AC \u2192 Tests \u2192 Evaluate \u2192 Fix. No multi-file feature ships without pipeline artifacts. No exceptions \u2014 managers reject work without them."
3495
3522
  },
3523
+ {
3524
+ title: "Code context first for repository orientation",
3525
+ domain: "workflow",
3526
+ priority: "p1",
3527
+ content: "Before broad repo exploration, symbol tracing, blast-radius review, or codebase Q&A, agents should use the consolidated code_context MCP tool instead of manual grep/read loops. Use action=index or stats to refresh/check the index; action=search with query, limit, offset, languages, paths, refresh_index for fresh multi-language code/doc search; action=trace for symbol imports/dependents; action=blast_radius for impact analysis before edits. CLI parity exists via exe-os code-context init|index|status|stats|search|doctor. Keep code_context separate from durable employee memory: promote only validated decisions, procedures, or lessons into store_memory/commit_memory."
3528
+ },
3496
3529
  {
3497
3530
  title: "Commit discipline \u2014 never leave verified work floating",
3498
3531
  domain: "workflow",
@@ -2358,6 +2358,33 @@ async function ensureSchema() {
2358
2358
  CREATE INDEX IF NOT EXISTS idx_chat_history_session
2359
2359
  ON chat_history(session_id, id);
2360
2360
  `);
2361
+ await client.executeMultiple(`
2362
+ CREATE TABLE IF NOT EXISTS session_events (
2363
+ id TEXT PRIMARY KEY,
2364
+ agent_id TEXT NOT NULL,
2365
+ agent_role TEXT NOT NULL,
2366
+ session_id TEXT NOT NULL,
2367
+ session_scope TEXT,
2368
+ project_name TEXT NOT NULL,
2369
+ event_index INTEGER NOT NULL,
2370
+ event_type TEXT NOT NULL,
2371
+ tool_name TEXT,
2372
+ tool_use_id TEXT,
2373
+ content TEXT NOT NULL,
2374
+ payload_json TEXT,
2375
+ has_error INTEGER NOT NULL DEFAULT 0,
2376
+ created_at TEXT NOT NULL
2377
+ );
2378
+
2379
+ CREATE INDEX IF NOT EXISTS idx_session_events_agent_time
2380
+ ON session_events(agent_id, created_at DESC);
2381
+
2382
+ CREATE INDEX IF NOT EXISTS idx_session_events_session_index
2383
+ ON session_events(session_id, event_index);
2384
+
2385
+ CREATE INDEX IF NOT EXISTS idx_session_events_scope_agent_time
2386
+ ON session_events(session_scope, agent_id, created_at DESC);
2387
+ `);
2361
2388
  await client.executeMultiple(`
2362
2389
  CREATE TABLE IF NOT EXISTS workspaces (
2363
2390
  id TEXT PRIMARY KEY,
@@ -3489,6 +3516,12 @@ var init_platform_procedures = __esm({
3489
3516
  priority: "p0",
3490
3517
  content: "exe-build-adv is MANDATORY for ALL work touching 3+ files. Run /exe-build-adv --auto BEFORE implementation. Pipeline: Spec \u2192 AC \u2192 Tests \u2192 Evaluate \u2192 Fix. No multi-file feature ships without pipeline artifacts. No exceptions \u2014 managers reject work without them."
3491
3518
  },
3519
+ {
3520
+ title: "Code context first for repository orientation",
3521
+ domain: "workflow",
3522
+ priority: "p1",
3523
+ content: "Before broad repo exploration, symbol tracing, blast-radius review, or codebase Q&A, agents should use the consolidated code_context MCP tool instead of manual grep/read loops. Use action=index or stats to refresh/check the index; action=search with query, limit, offset, languages, paths, refresh_index for fresh multi-language code/doc search; action=trace for symbol imports/dependents; action=blast_radius for impact analysis before edits. CLI parity exists via exe-os code-context init|index|status|stats|search|doctor. Keep code_context separate from durable employee memory: promote only validated decisions, procedures, or lessons into store_memory/commit_memory."
3524
+ },
3492
3525
  {
3493
3526
  title: "Commit discipline \u2014 never leave verified work floating",
3494
3527
  domain: "workflow",
@@ -2222,6 +2222,33 @@ async function ensureSchema() {
2222
2222
  CREATE INDEX IF NOT EXISTS idx_chat_history_session
2223
2223
  ON chat_history(session_id, id);
2224
2224
  `);
2225
+ await client.executeMultiple(`
2226
+ CREATE TABLE IF NOT EXISTS session_events (
2227
+ id TEXT PRIMARY KEY,
2228
+ agent_id TEXT NOT NULL,
2229
+ agent_role TEXT NOT NULL,
2230
+ session_id TEXT NOT NULL,
2231
+ session_scope TEXT,
2232
+ project_name TEXT NOT NULL,
2233
+ event_index INTEGER NOT NULL,
2234
+ event_type TEXT NOT NULL,
2235
+ tool_name TEXT,
2236
+ tool_use_id TEXT,
2237
+ content TEXT NOT NULL,
2238
+ payload_json TEXT,
2239
+ has_error INTEGER NOT NULL DEFAULT 0,
2240
+ created_at TEXT NOT NULL
2241
+ );
2242
+
2243
+ CREATE INDEX IF NOT EXISTS idx_session_events_agent_time
2244
+ ON session_events(agent_id, created_at DESC);
2245
+
2246
+ CREATE INDEX IF NOT EXISTS idx_session_events_session_index
2247
+ ON session_events(session_id, event_index);
2248
+
2249
+ CREATE INDEX IF NOT EXISTS idx_session_events_scope_agent_time
2250
+ ON session_events(session_scope, agent_id, created_at DESC);
2251
+ `);
2225
2252
  await client.executeMultiple(`
2226
2253
  CREATE TABLE IF NOT EXISTS workspaces (
2227
2254
  id TEXT PRIMARY KEY,
@@ -3661,6 +3688,12 @@ var init_platform_procedures = __esm({
3661
3688
  priority: "p0",
3662
3689
  content: "exe-build-adv is MANDATORY for ALL work touching 3+ files. Run /exe-build-adv --auto BEFORE implementation. Pipeline: Spec \u2192 AC \u2192 Tests \u2192 Evaluate \u2192 Fix. No multi-file feature ships without pipeline artifacts. No exceptions \u2014 managers reject work without them."
3663
3690
  },
3691
+ {
3692
+ title: "Code context first for repository orientation",
3693
+ domain: "workflow",
3694
+ priority: "p1",
3695
+ content: "Before broad repo exploration, symbol tracing, blast-radius review, or codebase Q&A, agents should use the consolidated code_context MCP tool instead of manual grep/read loops. Use action=index or stats to refresh/check the index; action=search with query, limit, offset, languages, paths, refresh_index for fresh multi-language code/doc search; action=trace for symbol imports/dependents; action=blast_radius for impact analysis before edits. CLI parity exists via exe-os code-context init|index|status|stats|search|doctor. Keep code_context separate from durable employee memory: promote only validated decisions, procedures, or lessons into store_memory/commit_memory."
3696
+ },
3664
3697
  {
3665
3698
  title: "Commit discipline \u2014 never leave verified work floating",
3666
3699
  domain: "workflow",
@@ -2448,6 +2448,33 @@ async function ensureSchema() {
2448
2448
  CREATE INDEX IF NOT EXISTS idx_chat_history_session
2449
2449
  ON chat_history(session_id, id);
2450
2450
  `);
2451
+ await client.executeMultiple(`
2452
+ CREATE TABLE IF NOT EXISTS session_events (
2453
+ id TEXT PRIMARY KEY,
2454
+ agent_id TEXT NOT NULL,
2455
+ agent_role TEXT NOT NULL,
2456
+ session_id TEXT NOT NULL,
2457
+ session_scope TEXT,
2458
+ project_name TEXT NOT NULL,
2459
+ event_index INTEGER NOT NULL,
2460
+ event_type TEXT NOT NULL,
2461
+ tool_name TEXT,
2462
+ tool_use_id TEXT,
2463
+ content TEXT NOT NULL,
2464
+ payload_json TEXT,
2465
+ has_error INTEGER NOT NULL DEFAULT 0,
2466
+ created_at TEXT NOT NULL
2467
+ );
2468
+
2469
+ CREATE INDEX IF NOT EXISTS idx_session_events_agent_time
2470
+ ON session_events(agent_id, created_at DESC);
2471
+
2472
+ CREATE INDEX IF NOT EXISTS idx_session_events_session_index
2473
+ ON session_events(session_id, event_index);
2474
+
2475
+ CREATE INDEX IF NOT EXISTS idx_session_events_scope_agent_time
2476
+ ON session_events(session_scope, agent_id, created_at DESC);
2477
+ `);
2451
2478
  await client.executeMultiple(`
2452
2479
  CREATE TABLE IF NOT EXISTS workspaces (
2453
2480
  id TEXT PRIMARY KEY,
@@ -4136,6 +4163,12 @@ var init_platform_procedures = __esm({
4136
4163
  priority: "p0",
4137
4164
  content: "exe-build-adv is MANDATORY for ALL work touching 3+ files. Run /exe-build-adv --auto BEFORE implementation. Pipeline: Spec \u2192 AC \u2192 Tests \u2192 Evaluate \u2192 Fix. No multi-file feature ships without pipeline artifacts. No exceptions \u2014 managers reject work without them."
4138
4165
  },
4166
+ {
4167
+ title: "Code context first for repository orientation",
4168
+ domain: "workflow",
4169
+ priority: "p1",
4170
+ content: "Before broad repo exploration, symbol tracing, blast-radius review, or codebase Q&A, agents should use the consolidated code_context MCP tool instead of manual grep/read loops. Use action=index or stats to refresh/check the index; action=search with query, limit, offset, languages, paths, refresh_index for fresh multi-language code/doc search; action=trace for symbol imports/dependents; action=blast_radius for impact analysis before edits. CLI parity exists via exe-os code-context init|index|status|stats|search|doctor. Keep code_context separate from durable employee memory: promote only validated decisions, procedures, or lessons into store_memory/commit_memory."
4171
+ },
4139
4172
  {
4140
4173
  title: "Commit discipline \u2014 never leave verified work floating",
4141
4174
  domain: "workflow",