@askexenow/exe-os 0.9.111 → 0.9.112

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/dist/bin/agentic-ontology-backfill.js +8 -1
  2. package/dist/bin/agentic-reflection-backfill.js +8 -1
  3. package/dist/bin/agentic-semantic-label.js +8 -1
  4. package/dist/bin/backfill-conversations.js +8 -1
  5. package/dist/bin/backfill-responses.js +8 -1
  6. package/dist/bin/backfill-vectors.js +8 -1
  7. package/dist/bin/bulk-sync-postgres.js +8 -1
  8. package/dist/bin/cleanup-stale-review-tasks.js +8 -1
  9. package/dist/bin/cli.js +19 -4
  10. package/dist/bin/exe-agent.js +1 -1
  11. package/dist/bin/exe-assign.js +8 -1
  12. package/dist/bin/exe-boot.js +19 -4
  13. package/dist/bin/exe-call.js +1 -1
  14. package/dist/bin/exe-cloud.js +8 -1
  15. package/dist/bin/exe-dispatch.js +460 -5
  16. package/dist/bin/exe-doctor.js +8 -1
  17. package/dist/bin/exe-export-behaviors.js +13 -3
  18. package/dist/bin/exe-forget.js +8 -1
  19. package/dist/bin/exe-gateway.js +19 -4
  20. package/dist/bin/exe-heartbeat.js +8 -1
  21. package/dist/bin/exe-kill.js +8 -1
  22. package/dist/bin/exe-launch-agent.js +13 -3
  23. package/dist/bin/exe-new-employee.js +1 -1
  24. package/dist/bin/exe-pending-messages.js +8 -1
  25. package/dist/bin/exe-pending-notifications.js +8 -1
  26. package/dist/bin/exe-pending-reviews.js +8 -1
  27. package/dist/bin/exe-rename.js +8 -1
  28. package/dist/bin/exe-review.js +8 -1
  29. package/dist/bin/exe-search.js +8 -1
  30. package/dist/bin/exe-session-cleanup.js +460 -5
  31. package/dist/bin/exe-start-codex.js +13 -3
  32. package/dist/bin/exe-start-opencode.js +13 -3
  33. package/dist/bin/exe-status.js +8 -1
  34. package/dist/bin/exe-team.js +8 -1
  35. package/dist/bin/git-sweep.js +460 -5
  36. package/dist/bin/graph-backfill.js +8 -1
  37. package/dist/bin/graph-export.js +8 -1
  38. package/dist/bin/intercom-check.js +460 -5
  39. package/dist/bin/pre-publish.js +1 -1
  40. package/dist/bin/scan-tasks.js +460 -5
  41. package/dist/bin/setup.js +8 -1
  42. package/dist/bin/shard-migrate.js +8 -1
  43. package/dist/gateway/index.js +460 -5
  44. package/dist/hooks/bug-report-worker.js +460 -5
  45. package/dist/hooks/codex-stop-task-finalizer.js +467 -5
  46. package/dist/hooks/commit-complete.js +460 -5
  47. package/dist/hooks/error-recall.js +8 -1
  48. package/dist/hooks/ingest.js +8 -1
  49. package/dist/hooks/instructions-loaded.js +8 -1
  50. package/dist/hooks/notification.js +8 -1
  51. package/dist/hooks/post-compact.js +8 -1
  52. package/dist/hooks/post-tool-combined.js +8 -1
  53. package/dist/hooks/pre-compact.js +460 -5
  54. package/dist/hooks/pre-tool-use.js +8 -1
  55. package/dist/hooks/prompt-submit.js +469 -8
  56. package/dist/hooks/session-end.js +460 -5
  57. package/dist/hooks/session-start.js +8 -1
  58. package/dist/hooks/stop.js +8 -1
  59. package/dist/hooks/subagent-stop.js +8 -1
  60. package/dist/hooks/summary-worker.js +8 -1
  61. package/dist/index.js +469 -8
  62. package/dist/lib/cloud-sync.js +7 -0
  63. package/dist/lib/database.js +7 -0
  64. package/dist/lib/db.js +7 -0
  65. package/dist/lib/device-registry.js +7 -0
  66. package/dist/lib/employee-templates.js +1 -1
  67. package/dist/lib/exe-daemon.js +216 -12
  68. package/dist/lib/hybrid-search.js +8 -1
  69. package/dist/lib/schedules.js +8 -1
  70. package/dist/lib/skill-learning.js +488 -7
  71. package/dist/lib/store.js +8 -1
  72. package/dist/lib/tasks.js +452 -4
  73. package/dist/lib/tmux-routing.js +452 -4
  74. package/dist/mcp/server.js +69 -11
  75. package/dist/mcp/tools/create-task.js +452 -4
  76. package/dist/mcp/tools/update-task.js +452 -4
  77. package/dist/runtime/index.js +469 -8
  78. package/dist/tui/App.js +19 -4
  79. package/package.json +1 -1
@@ -1811,6 +1811,13 @@ async function ensureSchema() {
1811
1811
  } catch (e) {
1812
1812
  logCatchDebug("migration", e);
1813
1813
  }
1814
+ for (const col of ["created_by_agent TEXT", "created_by_device TEXT", "source_session_id TEXT"]) {
1815
+ try {
1816
+ await client.execute({ sql: `ALTER TABLE behaviors ADD COLUMN ${col}`, args: [] });
1817
+ } catch (e) {
1818
+ logCatchDebug("migration", e);
1819
+ }
1820
+ }
1814
1821
  try {
1815
1822
  await client.execute({
1816
1823
  sql: `ALTER TABLE tasks ADD COLUMN blocked_by TEXT`,
@@ -3782,7 +3789,7 @@ var init_platform_procedures = __esm({
3782
3789
  title: "MCP tool dispatch \u2014 all tools use action parameter",
3783
3790
  domain: "tool-use",
3784
3791
  priority: "p0",
3785
- content: 'exe-os MCP tools come in two surfaces depending on EXE_MCP_TOOL_SURFACE config. Consolidated (19 tools): action-based dispatch \u2014 memory(action="recall"), task(action="create"), etc. Legacy (108 tools): one tool per operation \u2014 recall_my_memory, create_task, etc. Both surfaces have identical functionality. Use whichever tool names are available in your session. If you see domain tools (memory, task, config, etc.), use the action parameter. If you see specific tools (recall_my_memory, create_task, etc.), call them directly.'
3792
+ content: 'exe-os MCP tools use consolidated action-based dispatch by default (19 tools). Call domain tools with an action parameter: memory(action="recall"), task(action="create"), config(action="list_employees"), etc. Legacy mode (108 separate tools like recall_my_memory, create_task) is still available via EXE_MCP_TOOL_SURFACE=legacy but will be removed in a future version. If you see specific tool names, call them directly \u2014 both surfaces are identical. Consolidated is the default and recommended surface.'
3786
3793
  },
3787
3794
  {
3788
3795
  title: "MCP tools \u2014 memory, decision, and search",
@@ -1811,6 +1811,13 @@ async function ensureSchema() {
1811
1811
  } catch (e) {
1812
1812
  logCatchDebug("migration", e);
1813
1813
  }
1814
+ for (const col of ["created_by_agent TEXT", "created_by_device TEXT", "source_session_id TEXT"]) {
1815
+ try {
1816
+ await client.execute({ sql: `ALTER TABLE behaviors ADD COLUMN ${col}`, args: [] });
1817
+ } catch (e) {
1818
+ logCatchDebug("migration", e);
1819
+ }
1820
+ }
1814
1821
  try {
1815
1822
  await client.execute({
1816
1823
  sql: `ALTER TABLE tasks ADD COLUMN blocked_by TEXT`,
@@ -3782,7 +3789,7 @@ var init_platform_procedures = __esm({
3782
3789
  title: "MCP tool dispatch \u2014 all tools use action parameter",
3783
3790
  domain: "tool-use",
3784
3791
  priority: "p0",
3785
- content: 'exe-os MCP tools come in two surfaces depending on EXE_MCP_TOOL_SURFACE config. Consolidated (19 tools): action-based dispatch \u2014 memory(action="recall"), task(action="create"), etc. Legacy (108 tools): one tool per operation \u2014 recall_my_memory, create_task, etc. Both surfaces have identical functionality. Use whichever tool names are available in your session. If you see domain tools (memory, task, config, etc.), use the action parameter. If you see specific tools (recall_my_memory, create_task, etc.), call them directly.'
3792
+ content: 'exe-os MCP tools use consolidated action-based dispatch by default (19 tools). Call domain tools with an action parameter: memory(action="recall"), task(action="create"), config(action="list_employees"), etc. Legacy mode (108 separate tools like recall_my_memory, create_task) is still available via EXE_MCP_TOOL_SURFACE=legacy but will be removed in a future version. If you see specific tool names, call them directly \u2014 both surfaces are identical. Consolidated is the default and recommended surface.'
3786
3793
  },
3787
3794
  {
3788
3795
  title: "MCP tools \u2014 memory, decision, and search",
@@ -1811,6 +1811,13 @@ async function ensureSchema() {
1811
1811
  } catch (e) {
1812
1812
  logCatchDebug("migration", e);
1813
1813
  }
1814
+ for (const col of ["created_by_agent TEXT", "created_by_device TEXT", "source_session_id TEXT"]) {
1815
+ try {
1816
+ await client.execute({ sql: `ALTER TABLE behaviors ADD COLUMN ${col}`, args: [] });
1817
+ } catch (e) {
1818
+ logCatchDebug("migration", e);
1819
+ }
1820
+ }
1814
1821
  try {
1815
1822
  await client.execute({
1816
1823
  sql: `ALTER TABLE tasks ADD COLUMN blocked_by TEXT`,
@@ -3782,7 +3789,7 @@ var init_platform_procedures = __esm({
3782
3789
  title: "MCP tool dispatch \u2014 all tools use action parameter",
3783
3790
  domain: "tool-use",
3784
3791
  priority: "p0",
3785
- content: 'exe-os MCP tools come in two surfaces depending on EXE_MCP_TOOL_SURFACE config. Consolidated (19 tools): action-based dispatch \u2014 memory(action="recall"), task(action="create"), etc. Legacy (108 tools): one tool per operation \u2014 recall_my_memory, create_task, etc. Both surfaces have identical functionality. Use whichever tool names are available in your session. If you see domain tools (memory, task, config, etc.), use the action parameter. If you see specific tools (recall_my_memory, create_task, etc.), call them directly.'
3792
+ content: 'exe-os MCP tools use consolidated action-based dispatch by default (19 tools). Call domain tools with an action parameter: memory(action="recall"), task(action="create"), config(action="list_employees"), etc. Legacy mode (108 separate tools like recall_my_memory, create_task) is still available via EXE_MCP_TOOL_SURFACE=legacy but will be removed in a future version. If you see specific tool names, call them directly \u2014 both surfaces are identical. Consolidated is the default and recommended surface.'
3786
3793
  },
3787
3794
  {
3788
3795
  title: "MCP tools \u2014 memory, decision, and search",
@@ -1951,6 +1951,13 @@ async function ensureSchema() {
1951
1951
  } catch (e) {
1952
1952
  logCatchDebug("migration", e);
1953
1953
  }
1954
+ for (const col of ["created_by_agent TEXT", "created_by_device TEXT", "source_session_id TEXT"]) {
1955
+ try {
1956
+ await client.execute({ sql: `ALTER TABLE behaviors ADD COLUMN ${col}`, args: [] });
1957
+ } catch (e) {
1958
+ logCatchDebug("migration", e);
1959
+ }
1960
+ }
1954
1961
  try {
1955
1962
  await client.execute({
1956
1963
  sql: `ALTER TABLE tasks ADD COLUMN blocked_by TEXT`,
@@ -3922,7 +3929,7 @@ var init_platform_procedures = __esm({
3922
3929
  title: "MCP tool dispatch \u2014 all tools use action parameter",
3923
3930
  domain: "tool-use",
3924
3931
  priority: "p0",
3925
- content: 'exe-os MCP tools come in two surfaces depending on EXE_MCP_TOOL_SURFACE config. Consolidated (19 tools): action-based dispatch \u2014 memory(action="recall"), task(action="create"), etc. Legacy (108 tools): one tool per operation \u2014 recall_my_memory, create_task, etc. Both surfaces have identical functionality. Use whichever tool names are available in your session. If you see domain tools (memory, task, config, etc.), use the action parameter. If you see specific tools (recall_my_memory, create_task, etc.), call them directly.'
3932
+ content: 'exe-os MCP tools use consolidated action-based dispatch by default (19 tools). Call domain tools with an action parameter: memory(action="recall"), task(action="create"), config(action="list_employees"), etc. Legacy mode (108 separate tools like recall_my_memory, create_task) is still available via EXE_MCP_TOOL_SURFACE=legacy but will be removed in a future version. If you see specific tool names, call them directly \u2014 both surfaces are identical. Consolidated is the default and recommended surface.'
3926
3933
  },
3927
3934
  {
3928
3935
  title: "MCP tools \u2014 memory, decision, and search",
@@ -1951,6 +1951,13 @@ async function ensureSchema() {
1951
1951
  } catch (e) {
1952
1952
  logCatchDebug("migration", e);
1953
1953
  }
1954
+ for (const col of ["created_by_agent TEXT", "created_by_device TEXT", "source_session_id TEXT"]) {
1955
+ try {
1956
+ await client.execute({ sql: `ALTER TABLE behaviors ADD COLUMN ${col}`, args: [] });
1957
+ } catch (e) {
1958
+ logCatchDebug("migration", e);
1959
+ }
1960
+ }
1954
1961
  try {
1955
1962
  await client.execute({
1956
1963
  sql: `ALTER TABLE tasks ADD COLUMN blocked_by TEXT`,
@@ -3922,7 +3929,7 @@ var init_platform_procedures = __esm({
3922
3929
  title: "MCP tool dispatch \u2014 all tools use action parameter",
3923
3930
  domain: "tool-use",
3924
3931
  priority: "p0",
3925
- content: 'exe-os MCP tools come in two surfaces depending on EXE_MCP_TOOL_SURFACE config. Consolidated (19 tools): action-based dispatch \u2014 memory(action="recall"), task(action="create"), etc. Legacy (108 tools): one tool per operation \u2014 recall_my_memory, create_task, etc. Both surfaces have identical functionality. Use whichever tool names are available in your session. If you see domain tools (memory, task, config, etc.), use the action parameter. If you see specific tools (recall_my_memory, create_task, etc.), call them directly.'
3932
+ content: 'exe-os MCP tools use consolidated action-based dispatch by default (19 tools). Call domain tools with an action parameter: memory(action="recall"), task(action="create"), config(action="list_employees"), etc. Legacy mode (108 separate tools like recall_my_memory, create_task) is still available via EXE_MCP_TOOL_SURFACE=legacy but will be removed in a future version. If you see specific tool names, call them directly \u2014 both surfaces are identical. Consolidated is the default and recommended surface.'
3926
3933
  },
3927
3934
  {
3928
3935
  title: "MCP tools \u2014 memory, decision, and search",
@@ -1947,6 +1947,13 @@ async function ensureSchema() {
1947
1947
  } catch (e) {
1948
1948
  logCatchDebug("migration", e);
1949
1949
  }
1950
+ for (const col of ["created_by_agent TEXT", "created_by_device TEXT", "source_session_id TEXT"]) {
1951
+ try {
1952
+ await client.execute({ sql: `ALTER TABLE behaviors ADD COLUMN ${col}`, args: [] });
1953
+ } catch (e) {
1954
+ logCatchDebug("migration", e);
1955
+ }
1956
+ }
1950
1957
  try {
1951
1958
  await client.execute({
1952
1959
  sql: `ALTER TABLE tasks ADD COLUMN blocked_by TEXT`,
@@ -3918,7 +3925,7 @@ var init_platform_procedures = __esm({
3918
3925
  title: "MCP tool dispatch \u2014 all tools use action parameter",
3919
3926
  domain: "tool-use",
3920
3927
  priority: "p0",
3921
- content: 'exe-os MCP tools come in two surfaces depending on EXE_MCP_TOOL_SURFACE config. Consolidated (19 tools): action-based dispatch \u2014 memory(action="recall"), task(action="create"), etc. Legacy (108 tools): one tool per operation \u2014 recall_my_memory, create_task, etc. Both surfaces have identical functionality. Use whichever tool names are available in your session. If you see domain tools (memory, task, config, etc.), use the action parameter. If you see specific tools (recall_my_memory, create_task, etc.), call them directly.'
3928
+ content: 'exe-os MCP tools use consolidated action-based dispatch by default (19 tools). Call domain tools with an action parameter: memory(action="recall"), task(action="create"), config(action="list_employees"), etc. Legacy mode (108 separate tools like recall_my_memory, create_task) is still available via EXE_MCP_TOOL_SURFACE=legacy but will be removed in a future version. If you see specific tool names, call them directly \u2014 both surfaces are identical. Consolidated is the default and recommended surface.'
3922
3929
  },
3923
3930
  {
3924
3931
  title: "MCP tools \u2014 memory, decision, and search",
@@ -1811,6 +1811,13 @@ async function ensureSchema() {
1811
1811
  } catch (e) {
1812
1812
  logCatchDebug("migration", e);
1813
1813
  }
1814
+ for (const col of ["created_by_agent TEXT", "created_by_device TEXT", "source_session_id TEXT"]) {
1815
+ try {
1816
+ await client.execute({ sql: `ALTER TABLE behaviors ADD COLUMN ${col}`, args: [] });
1817
+ } catch (e) {
1818
+ logCatchDebug("migration", e);
1819
+ }
1820
+ }
1814
1821
  try {
1815
1822
  await client.execute({
1816
1823
  sql: `ALTER TABLE tasks ADD COLUMN blocked_by TEXT`,
@@ -4090,7 +4097,7 @@ var init_platform_procedures = __esm({
4090
4097
  title: "MCP tool dispatch \u2014 all tools use action parameter",
4091
4098
  domain: "tool-use",
4092
4099
  priority: "p0",
4093
- content: 'exe-os MCP tools come in two surfaces depending on EXE_MCP_TOOL_SURFACE config. Consolidated (19 tools): action-based dispatch \u2014 memory(action="recall"), task(action="create"), etc. Legacy (108 tools): one tool per operation \u2014 recall_my_memory, create_task, etc. Both surfaces have identical functionality. Use whichever tool names are available in your session. If you see domain tools (memory, task, config, etc.), use the action parameter. If you see specific tools (recall_my_memory, create_task, etc.), call them directly.'
4100
+ content: 'exe-os MCP tools use consolidated action-based dispatch by default (19 tools). Call domain tools with an action parameter: memory(action="recall"), task(action="create"), config(action="list_employees"), etc. Legacy mode (108 separate tools like recall_my_memory, create_task) is still available via EXE_MCP_TOOL_SURFACE=legacy but will be removed in a future version. If you see specific tool names, call them directly \u2014 both surfaces are identical. Consolidated is the default and recommended surface.'
4094
4101
  },
4095
4102
  {
4096
4103
  title: "MCP tools \u2014 memory, decision, and search",
@@ -2037,6 +2037,13 @@ async function ensureSchema() {
2037
2037
  } catch (e) {
2038
2038
  logCatchDebug("migration", e);
2039
2039
  }
2040
+ for (const col of ["created_by_agent TEXT", "created_by_device TEXT", "source_session_id TEXT"]) {
2041
+ try {
2042
+ await client.execute({ sql: `ALTER TABLE behaviors ADD COLUMN ${col}`, args: [] });
2043
+ } catch (e) {
2044
+ logCatchDebug("migration", e);
2045
+ }
2046
+ }
2040
2047
  try {
2041
2048
  await client.execute({
2042
2049
  sql: `ALTER TABLE tasks ADD COLUMN blocked_by TEXT`,
@@ -4565,7 +4572,7 @@ var init_platform_procedures = __esm({
4565
4572
  title: "MCP tool dispatch \u2014 all tools use action parameter",
4566
4573
  domain: "tool-use",
4567
4574
  priority: "p0",
4568
- content: 'exe-os MCP tools come in two surfaces depending on EXE_MCP_TOOL_SURFACE config. Consolidated (19 tools): action-based dispatch \u2014 memory(action="recall"), task(action="create"), etc. Legacy (108 tools): one tool per operation \u2014 recall_my_memory, create_task, etc. Both surfaces have identical functionality. Use whichever tool names are available in your session. If you see domain tools (memory, task, config, etc.), use the action parameter. If you see specific tools (recall_my_memory, create_task, etc.), call them directly.'
4575
+ content: 'exe-os MCP tools use consolidated action-based dispatch by default (19 tools). Call domain tools with an action parameter: memory(action="recall"), task(action="create"), config(action="list_employees"), etc. Legacy mode (108 separate tools like recall_my_memory, create_task) is still available via EXE_MCP_TOOL_SURFACE=legacy but will be removed in a future version. If you see specific tool names, call them directly \u2014 both surfaces are identical. Consolidated is the default and recommended surface.'
4569
4576
  },
4570
4577
  {
4571
4578
  title: "MCP tools \u2014 memory, decision, and search",
package/dist/bin/cli.js CHANGED
@@ -4692,6 +4692,13 @@ async function ensureSchema() {
4692
4692
  } catch (e) {
4693
4693
  logCatchDebug("migration", e);
4694
4694
  }
4695
+ for (const col of ["created_by_agent TEXT", "created_by_device TEXT", "source_session_id TEXT"]) {
4696
+ try {
4697
+ await client.execute({ sql: `ALTER TABLE behaviors ADD COLUMN ${col}`, args: [] });
4698
+ } catch (e) {
4699
+ logCatchDebug("migration", e);
4700
+ }
4701
+ }
4695
4702
  try {
4696
4703
  await client.execute({
4697
4704
  sql: `ALTER TABLE tasks ADD COLUMN blocked_by TEXT`,
@@ -9271,7 +9278,7 @@ var init_platform_procedures = __esm({
9271
9278
  title: "MCP tool dispatch \u2014 all tools use action parameter",
9272
9279
  domain: "tool-use",
9273
9280
  priority: "p0",
9274
- content: 'exe-os MCP tools come in two surfaces depending on EXE_MCP_TOOL_SURFACE config. Consolidated (19 tools): action-based dispatch \u2014 memory(action="recall"), task(action="create"), etc. Legacy (108 tools): one tool per operation \u2014 recall_my_memory, create_task, etc. Both surfaces have identical functionality. Use whichever tool names are available in your session. If you see domain tools (memory, task, config, etc.), use the action parameter. If you see specific tools (recall_my_memory, create_task, etc.), call them directly.'
9281
+ content: 'exe-os MCP tools use consolidated action-based dispatch by default (19 tools). Call domain tools with an action parameter: memory(action="recall"), task(action="create"), config(action="list_employees"), etc. Legacy mode (108 separate tools like recall_my_memory, create_task) is still available via EXE_MCP_TOOL_SURFACE=legacy but will be removed in a future version. If you see specific tool names, call them directly \u2014 both surfaces are identical. Consolidated is the default and recommended surface.'
9275
9282
  },
9276
9283
  {
9277
9284
  title: "MCP tools \u2014 memory, decision, and search",
@@ -15424,10 +15431,18 @@ async function storeBehavior(opts) {
15424
15431
  vector = new Float32Array(vec);
15425
15432
  } catch {
15426
15433
  }
15434
+ let createdByDevice = null;
15435
+ try {
15436
+ const { loadDeviceId: loadDeviceId2 } = await Promise.resolve().then(() => (init_license(), license_exports));
15437
+ createdByDevice = loadDeviceId2() ?? null;
15438
+ } catch {
15439
+ }
15440
+ const createdByAgent = process.env.AGENT_ID ?? null;
15441
+ const sourceSessionId = process.env.CLAUDE_SESSION_ID ?? process.env.SESSION_ID ?? null;
15427
15442
  await client.execute({
15428
- sql: `INSERT INTO behaviors (id, agent_id, project_name, domain, priority, content, active, created_at, updated_at, vector)
15429
- VALUES (?, ?, ?, ?, ?, ?, 1, ?, ?, ?)`,
15430
- args: [id, opts.agentId, opts.projectName ?? null, opts.domain ?? null, opts.priority ?? "p1", opts.content, now2, now2, vector ? vector.buffer : null]
15443
+ sql: `INSERT INTO behaviors (id, agent_id, project_name, domain, priority, content, active, created_at, updated_at, vector, created_by_agent, created_by_device, source_session_id)
15444
+ VALUES (?, ?, ?, ?, ?, ?, 1, ?, ?, ?, ?, ?, ?)`,
15445
+ args: [id, opts.agentId, opts.projectName ?? null, opts.domain ?? null, opts.priority ?? "p1", opts.content, now2, now2, vector ? vector.buffer : null, createdByAgent, createdByDevice, sourceSessionId]
15431
15446
  });
15432
15447
  return id;
15433
15448
  }
@@ -1542,7 +1542,7 @@ var PLATFORM_PROCEDURES = [
1542
1542
  title: "MCP tool dispatch \u2014 all tools use action parameter",
1543
1543
  domain: "tool-use",
1544
1544
  priority: "p0",
1545
- content: 'exe-os MCP tools come in two surfaces depending on EXE_MCP_TOOL_SURFACE config. Consolidated (19 tools): action-based dispatch \u2014 memory(action="recall"), task(action="create"), etc. Legacy (108 tools): one tool per operation \u2014 recall_my_memory, create_task, etc. Both surfaces have identical functionality. Use whichever tool names are available in your session. If you see domain tools (memory, task, config, etc.), use the action parameter. If you see specific tools (recall_my_memory, create_task, etc.), call them directly.'
1545
+ content: 'exe-os MCP tools use consolidated action-based dispatch by default (19 tools). Call domain tools with an action parameter: memory(action="recall"), task(action="create"), config(action="list_employees"), etc. Legacy mode (108 separate tools like recall_my_memory, create_task) is still available via EXE_MCP_TOOL_SURFACE=legacy but will be removed in a future version. If you see specific tool names, call them directly \u2014 both surfaces are identical. Consolidated is the default and recommended surface.'
1546
1546
  },
1547
1547
  {
1548
1548
  title: "MCP tools \u2014 memory, decision, and search",
@@ -1961,6 +1961,13 @@ async function ensureSchema() {
1961
1961
  } catch (e) {
1962
1962
  logCatchDebug("migration", e);
1963
1963
  }
1964
+ for (const col of ["created_by_agent TEXT", "created_by_device TEXT", "source_session_id TEXT"]) {
1965
+ try {
1966
+ await client.execute({ sql: `ALTER TABLE behaviors ADD COLUMN ${col}`, args: [] });
1967
+ } catch (e) {
1968
+ logCatchDebug("migration", e);
1969
+ }
1970
+ }
1964
1971
  try {
1965
1972
  await client.execute({
1966
1973
  sql: `ALTER TABLE tasks ADD COLUMN blocked_by TEXT`,
@@ -3932,7 +3939,7 @@ var init_platform_procedures = __esm({
3932
3939
  title: "MCP tool dispatch \u2014 all tools use action parameter",
3933
3940
  domain: "tool-use",
3934
3941
  priority: "p0",
3935
- content: 'exe-os MCP tools come in two surfaces depending on EXE_MCP_TOOL_SURFACE config. Consolidated (19 tools): action-based dispatch \u2014 memory(action="recall"), task(action="create"), etc. Legacy (108 tools): one tool per operation \u2014 recall_my_memory, create_task, etc. Both surfaces have identical functionality. Use whichever tool names are available in your session. If you see domain tools (memory, task, config, etc.), use the action parameter. If you see specific tools (recall_my_memory, create_task, etc.), call them directly.'
3942
+ content: 'exe-os MCP tools use consolidated action-based dispatch by default (19 tools). Call domain tools with an action parameter: memory(action="recall"), task(action="create"), config(action="list_employees"), etc. Legacy mode (108 separate tools like recall_my_memory, create_task) is still available via EXE_MCP_TOOL_SURFACE=legacy but will be removed in a future version. If you see specific tool names, call them directly \u2014 both surfaces are identical. Consolidated is the default and recommended surface.'
3936
3943
  },
3937
3944
  {
3938
3945
  title: "MCP tools \u2014 memory, decision, and search",
@@ -2113,6 +2113,13 @@ async function ensureSchema() {
2113
2113
  } catch (e) {
2114
2114
  logCatchDebug("migration", e);
2115
2115
  }
2116
+ for (const col of ["created_by_agent TEXT", "created_by_device TEXT", "source_session_id TEXT"]) {
2117
+ try {
2118
+ await client.execute({ sql: `ALTER TABLE behaviors ADD COLUMN ${col}`, args: [] });
2119
+ } catch (e) {
2120
+ logCatchDebug("migration", e);
2121
+ }
2122
+ }
2116
2123
  try {
2117
2124
  await client.execute({
2118
2125
  sql: `ALTER TABLE tasks ADD COLUMN blocked_by TEXT`,
@@ -3620,7 +3627,7 @@ var init_platform_procedures = __esm({
3620
3627
  title: "MCP tool dispatch \u2014 all tools use action parameter",
3621
3628
  domain: "tool-use",
3622
3629
  priority: "p0",
3623
- content: 'exe-os MCP tools come in two surfaces depending on EXE_MCP_TOOL_SURFACE config. Consolidated (19 tools): action-based dispatch \u2014 memory(action="recall"), task(action="create"), etc. Legacy (108 tools): one tool per operation \u2014 recall_my_memory, create_task, etc. Both surfaces have identical functionality. Use whichever tool names are available in your session. If you see domain tools (memory, task, config, etc.), use the action parameter. If you see specific tools (recall_my_memory, create_task, etc.), call them directly.'
3630
+ content: 'exe-os MCP tools use consolidated action-based dispatch by default (19 tools). Call domain tools with an action parameter: memory(action="recall"), task(action="create"), config(action="list_employees"), etc. Legacy mode (108 separate tools like recall_my_memory, create_task) is still available via EXE_MCP_TOOL_SURFACE=legacy but will be removed in a future version. If you see specific tool names, call them directly \u2014 both surfaces are identical. Consolidated is the default and recommended surface.'
3624
3631
  },
3625
3632
  {
3626
3633
  title: "MCP tools \u2014 memory, decision, and search",
@@ -7573,10 +7580,18 @@ async function storeBehavior(opts) {
7573
7580
  vector = new Float32Array(vec);
7574
7581
  } catch {
7575
7582
  }
7583
+ let createdByDevice = null;
7584
+ try {
7585
+ const { loadDeviceId: loadDeviceId2 } = await Promise.resolve().then(() => (init_license(), license_exports));
7586
+ createdByDevice = loadDeviceId2() ?? null;
7587
+ } catch {
7588
+ }
7589
+ const createdByAgent = process.env.AGENT_ID ?? null;
7590
+ const sourceSessionId = process.env.CLAUDE_SESSION_ID ?? process.env.SESSION_ID ?? null;
7576
7591
  await client.execute({
7577
- sql: `INSERT INTO behaviors (id, agent_id, project_name, domain, priority, content, active, created_at, updated_at, vector)
7578
- VALUES (?, ?, ?, ?, ?, ?, 1, ?, ?, ?)`,
7579
- args: [id, opts.agentId, opts.projectName ?? null, opts.domain ?? null, opts.priority ?? "p1", opts.content, now, now, vector ? vector.buffer : null]
7592
+ sql: `INSERT INTO behaviors (id, agent_id, project_name, domain, priority, content, active, created_at, updated_at, vector, created_by_agent, created_by_device, source_session_id)
7593
+ VALUES (?, ?, ?, ?, ?, ?, 1, ?, ?, ?, ?, ?, ?)`,
7594
+ args: [id, opts.agentId, opts.projectName ?? null, opts.domain ?? null, opts.priority ?? "p1", opts.content, now, now, vector ? vector.buffer : null, createdByAgent, createdByDevice, sourceSessionId]
7580
7595
  });
7581
7596
  return id;
7582
7597
  }
@@ -479,7 +479,7 @@ var init_platform_procedures = __esm({
479
479
  title: "MCP tool dispatch \u2014 all tools use action parameter",
480
480
  domain: "tool-use",
481
481
  priority: "p0",
482
- content: 'exe-os MCP tools come in two surfaces depending on EXE_MCP_TOOL_SURFACE config. Consolidated (19 tools): action-based dispatch \u2014 memory(action="recall"), task(action="create"), etc. Legacy (108 tools): one tool per operation \u2014 recall_my_memory, create_task, etc. Both surfaces have identical functionality. Use whichever tool names are available in your session. If you see domain tools (memory, task, config, etc.), use the action parameter. If you see specific tools (recall_my_memory, create_task, etc.), call them directly.'
482
+ content: 'exe-os MCP tools use consolidated action-based dispatch by default (19 tools). Call domain tools with an action parameter: memory(action="recall"), task(action="create"), config(action="list_employees"), etc. Legacy mode (108 separate tools like recall_my_memory, create_task) is still available via EXE_MCP_TOOL_SURFACE=legacy but will be removed in a future version. If you see specific tool names, call them directly \u2014 both surfaces are identical. Consolidated is the default and recommended surface.'
483
483
  },
484
484
  {
485
485
  title: "MCP tools \u2014 memory, decision, and search",
@@ -2549,6 +2549,13 @@ async function ensureSchema() {
2549
2549
  } catch (e) {
2550
2550
  logCatchDebug("migration", e);
2551
2551
  }
2552
+ for (const col of ["created_by_agent TEXT", "created_by_device TEXT", "source_session_id TEXT"]) {
2553
+ try {
2554
+ await client.execute({ sql: `ALTER TABLE behaviors ADD COLUMN ${col}`, args: [] });
2555
+ } catch (e) {
2556
+ logCatchDebug("migration", e);
2557
+ }
2558
+ }
2552
2559
  try {
2553
2560
  await client.execute({
2554
2561
  sql: `ALTER TABLE tasks ADD COLUMN blocked_by TEXT`,
@@ -7080,7 +7087,7 @@ var init_platform_procedures = __esm({
7080
7087
  title: "MCP tool dispatch \u2014 all tools use action parameter",
7081
7088
  domain: "tool-use",
7082
7089
  priority: "p0",
7083
- content: 'exe-os MCP tools come in two surfaces depending on EXE_MCP_TOOL_SURFACE config. Consolidated (19 tools): action-based dispatch \u2014 memory(action="recall"), task(action="create"), etc. Legacy (108 tools): one tool per operation \u2014 recall_my_memory, create_task, etc. Both surfaces have identical functionality. Use whichever tool names are available in your session. If you see domain tools (memory, task, config, etc.), use the action parameter. If you see specific tools (recall_my_memory, create_task, etc.), call them directly.'
7090
+ content: 'exe-os MCP tools use consolidated action-based dispatch by default (19 tools). Call domain tools with an action parameter: memory(action="recall"), task(action="create"), config(action="list_employees"), etc. Legacy mode (108 separate tools like recall_my_memory, create_task) is still available via EXE_MCP_TOOL_SURFACE=legacy but will be removed in a future version. If you see specific tool names, call them directly \u2014 both surfaces are identical. Consolidated is the default and recommended surface.'
7084
7091
  },
7085
7092
  {
7086
7093
  title: "MCP tools \u2014 memory, decision, and search",