@askexenow/exe-os 0.9.60 → 0.9.61

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 (73) hide show
  1. package/dist/bin/backfill-conversations.js +72 -5
  2. package/dist/bin/backfill-responses.js +72 -5
  3. package/dist/bin/backfill-vectors.js +72 -5
  4. package/dist/bin/cc-doctor.js +376 -0
  5. package/dist/bin/cleanup-stale-review-tasks.js +72 -5
  6. package/dist/bin/cli.js +157 -55
  7. package/dist/bin/customer-readiness.js +33 -0
  8. package/dist/bin/exe-agent.js +1 -1
  9. package/dist/bin/exe-assign.js +72 -5
  10. package/dist/bin/exe-boot.js +78 -11
  11. package/dist/bin/exe-call.js +1 -1
  12. package/dist/bin/exe-dispatch.js +72 -5
  13. package/dist/bin/exe-doctor.js +72 -5
  14. package/dist/bin/exe-export-behaviors.js +72 -5
  15. package/dist/bin/exe-forget.js +72 -5
  16. package/dist/bin/exe-gateway.js +72 -5
  17. package/dist/bin/exe-heartbeat.js +72 -5
  18. package/dist/bin/exe-kill.js +72 -5
  19. package/dist/bin/exe-launch-agent.js +72 -5
  20. package/dist/bin/exe-link.js +74 -7
  21. package/dist/bin/exe-new-employee.js +48 -19
  22. package/dist/bin/exe-pending-messages.js +72 -5
  23. package/dist/bin/exe-pending-notifications.js +72 -5
  24. package/dist/bin/exe-pending-reviews.js +72 -5
  25. package/dist/bin/exe-rename.js +72 -5
  26. package/dist/bin/exe-review.js +72 -5
  27. package/dist/bin/exe-search.js +72 -5
  28. package/dist/bin/exe-session-cleanup.js +72 -5
  29. package/dist/bin/exe-start-codex.js +115 -18
  30. package/dist/bin/exe-start-opencode.js +93 -7
  31. package/dist/bin/exe-status.js +72 -5
  32. package/dist/bin/exe-team.js +72 -5
  33. package/dist/bin/git-sweep.js +72 -5
  34. package/dist/bin/graph-backfill.js +72 -5
  35. package/dist/bin/graph-export.js +72 -5
  36. package/dist/bin/install.js +56 -31
  37. package/dist/bin/intercom-check.js +72 -5
  38. package/dist/bin/pre-build-guard.js +98 -0
  39. package/dist/bin/scan-tasks.js +72 -5
  40. package/dist/bin/setup.js +75 -8
  41. package/dist/bin/shard-migrate.js +72 -5
  42. package/dist/gateway/index.js +78 -11
  43. package/dist/hooks/bug-report-worker.js +72 -5
  44. package/dist/hooks/codex-stop-task-finalizer.js +72 -5
  45. package/dist/hooks/commit-complete.js +72 -5
  46. package/dist/hooks/error-recall.js +72 -5
  47. package/dist/hooks/ingest.js +72 -5
  48. package/dist/hooks/instructions-loaded.js +72 -5
  49. package/dist/hooks/notification.js +72 -5
  50. package/dist/hooks/post-compact.js +72 -5
  51. package/dist/hooks/post-tool-combined.js +72 -5
  52. package/dist/hooks/pre-compact.js +72 -5
  53. package/dist/hooks/pre-tool-use.js +72 -5
  54. package/dist/hooks/prompt-submit.js +72 -5
  55. package/dist/hooks/session-end.js +72 -5
  56. package/dist/hooks/session-start.js +72 -5
  57. package/dist/hooks/stop.js +72 -5
  58. package/dist/hooks/subagent-stop.js +72 -5
  59. package/dist/hooks/summary-worker.js +78 -11
  60. package/dist/index.js +78 -11
  61. package/dist/lib/cloud-sync.js +74 -7
  62. package/dist/lib/database.js +68 -1
  63. package/dist/lib/db.js +68 -1
  64. package/dist/lib/device-registry.js +68 -1
  65. package/dist/lib/employee-templates.js +1 -1
  66. package/dist/lib/exe-daemon.js +103 -26
  67. package/dist/lib/hybrid-search.js +72 -5
  68. package/dist/lib/schedules.js +72 -5
  69. package/dist/lib/store.js +72 -5
  70. package/dist/mcp/server.js +103 -26
  71. package/dist/runtime/index.js +72 -5
  72. package/dist/tui/App.js +80 -13
  73. package/package.json +1 -1
@@ -3017,7 +3017,7 @@ async function ensureSchema() {
3017
3017
  ON session_kills(agent_id);
3018
3018
  `);
3019
3019
  await client.execute(`
3020
- CREATE TABLE IF NOT EXISTS global_procedures (
3020
+ CREATE TABLE IF NOT EXISTS company_procedures (
3021
3021
  id TEXT PRIMARY KEY,
3022
3022
  title TEXT NOT NULL,
3023
3023
  content TEXT NOT NULL,
@@ -3028,6 +3028,73 @@ async function ensureSchema() {
3028
3028
  updated_at TEXT NOT NULL
3029
3029
  )
3030
3030
  `);
3031
+ const legacyProcedureObject = await client.execute({
3032
+ sql: "SELECT type FROM sqlite_master WHERE name = 'global_procedures'",
3033
+ args: []
3034
+ });
3035
+ const legacyProcedureType = legacyProcedureObject.rows[0]?.type == null ? null : String(legacyProcedureObject.rows[0].type);
3036
+ if (legacyProcedureType === "table") {
3037
+ await client.execute(`
3038
+ INSERT OR IGNORE INTO company_procedures
3039
+ (id, title, content, priority, domain, active, created_at, updated_at)
3040
+ SELECT id, title, content, priority, domain, active, created_at, updated_at
3041
+ FROM global_procedures
3042
+ `);
3043
+ await client.executeMultiple(`
3044
+ CREATE TRIGGER IF NOT EXISTS global_procedures_mirror_insert
3045
+ AFTER INSERT ON global_procedures
3046
+ BEGIN
3047
+ INSERT OR IGNORE INTO company_procedures
3048
+ (id, title, content, priority, domain, active, created_at, updated_at)
3049
+ VALUES
3050
+ (NEW.id, NEW.title, NEW.content, NEW.priority, NEW.domain, NEW.active, NEW.created_at, NEW.updated_at);
3051
+ END;
3052
+
3053
+ CREATE TRIGGER IF NOT EXISTS global_procedures_mirror_update
3054
+ AFTER UPDATE ON global_procedures
3055
+ BEGIN
3056
+ UPDATE company_procedures
3057
+ SET title = NEW.title,
3058
+ content = NEW.content,
3059
+ priority = NEW.priority,
3060
+ domain = NEW.domain,
3061
+ active = NEW.active,
3062
+ created_at = NEW.created_at,
3063
+ updated_at = NEW.updated_at
3064
+ WHERE id = OLD.id;
3065
+ END;
3066
+ `);
3067
+ } else {
3068
+ await client.execute(`
3069
+ CREATE VIEW IF NOT EXISTS global_procedures AS
3070
+ SELECT id, title, content, priority, domain, active, created_at, updated_at
3071
+ FROM company_procedures
3072
+ `);
3073
+ await client.executeMultiple(`
3074
+ CREATE TRIGGER IF NOT EXISTS global_procedures_insert
3075
+ INSTEAD OF INSERT ON global_procedures
3076
+ BEGIN
3077
+ INSERT INTO company_procedures
3078
+ (id, title, content, priority, domain, active, created_at, updated_at)
3079
+ VALUES
3080
+ (NEW.id, NEW.title, NEW.content, NEW.priority, NEW.domain, NEW.active, NEW.created_at, NEW.updated_at);
3081
+ END;
3082
+
3083
+ CREATE TRIGGER IF NOT EXISTS global_procedures_update
3084
+ INSTEAD OF UPDATE ON global_procedures
3085
+ BEGIN
3086
+ UPDATE company_procedures
3087
+ SET title = NEW.title,
3088
+ content = NEW.content,
3089
+ priority = NEW.priority,
3090
+ domain = NEW.domain,
3091
+ active = NEW.active,
3092
+ created_at = NEW.created_at,
3093
+ updated_at = NEW.updated_at
3094
+ WHERE id = OLD.id;
3095
+ END;
3096
+ `);
3097
+ }
3031
3098
  await client.executeMultiple(`
3032
3099
  CREATE TABLE IF NOT EXISTS conversations (
3033
3100
  id TEXT PRIMARY KEY,
@@ -7569,7 +7636,7 @@ var init_platform_procedures = __esm({
7569
7636
  title: "MCP tools \u2014 advanced (triggers, skills, orchestration)",
7570
7637
  domain: "tool-use",
7571
7638
  priority: "p1",
7572
- content: "create_trigger: set up a scheduled recurring agent job (cron). list_triggers: view active triggers. load_skill: load a slash-command skill dynamically. apply_starter_pack: import a pre-built behavior + identity pack for a role. export_orchestration: export full org state (tasks, behaviors, identities) as portable JSON. import_orchestration: import org state into a new instance. deploy_client: deploy a customer client instance. query_company_brain: unified RAG query across all company knowledge. create_reminder: set a text reminder (shown in boot brief). list_reminders: view pending reminders. complete_reminder: mark a reminder done. global_procedure: manage customer-owned company procedures (Layer 0; actions: store, list, deactivate). Legacy aliases: store_global_procedure, list_global_procedures, deactivate_global_procedure."
7639
+ content: "create_trigger: set up a scheduled recurring agent job (cron). list_triggers: view active triggers. load_skill: load a slash-command skill dynamically. apply_starter_pack: import a pre-built behavior + identity pack for a role. export_orchestration: export full org state (tasks, behaviors, identities) as portable JSON. import_orchestration: import org state into a new instance. deploy_client: deploy a customer client instance. query_company_brain: unified RAG query across all company knowledge. create_reminder: set a text reminder (shown in boot brief). list_reminders: view pending reminders. complete_reminder: mark a reminder done. company_procedure: manage customer-owned company procedures (Layer 0; actions: store, list, deactivate). Legacy aliases: global_procedure, store_global_procedure, list_global_procedures, deactivate_global_procedure."
7573
7640
  }
7574
7641
  ];
7575
7642
  PLATFORM_PROCEDURE_TITLES = new Set(
@@ -7590,7 +7657,7 @@ import { randomUUID as randomUUID3 } from "crypto";
7590
7657
  async function loadGlobalProcedures() {
7591
7658
  const client = getClient();
7592
7659
  const result = await client.execute({
7593
- sql: "SELECT * FROM global_procedures WHERE active = 1 ORDER BY priority ASC, created_at ASC",
7660
+ sql: "SELECT * FROM company_procedures WHERE active = 1 ORDER BY priority ASC, created_at ASC",
7594
7661
  args: []
7595
7662
  });
7596
7663
  const allRows = result.rows;
@@ -7619,7 +7686,7 @@ async function storeGlobalProcedure(input) {
7619
7686
  const now = (/* @__PURE__ */ new Date()).toISOString();
7620
7687
  const client = getClient();
7621
7688
  await client.execute({
7622
- sql: `INSERT INTO global_procedures (id, title, content, priority, domain, active, created_at, updated_at)
7689
+ sql: `INSERT INTO company_procedures (id, title, content, priority, domain, active, created_at, updated_at)
7623
7690
  VALUES (?, ?, ?, ?, ?, 1, ?, ?)`,
7624
7691
  args: [id, input.title, input.content, input.priority ?? "p0", input.domain ?? null, now, now]
7625
7692
  });
@@ -7630,7 +7697,7 @@ async function deactivateGlobalProcedure(id) {
7630
7697
  const now = (/* @__PURE__ */ new Date()).toISOString();
7631
7698
  const client = getClient();
7632
7699
  const result = await client.execute({
7633
- sql: "UPDATE global_procedures SET active = 0, updated_at = ? WHERE id = ?",
7700
+ sql: "UPDATE company_procedures SET active = 0, updated_at = ? WHERE id = ?",
7634
7701
  args: [now, id]
7635
7702
  });
7636
7703
  await loadGlobalProcedures();
@@ -2289,7 +2289,7 @@ async function ensureSchema() {
2289
2289
  ON session_kills(agent_id);
2290
2290
  `);
2291
2291
  await client.execute(`
2292
- CREATE TABLE IF NOT EXISTS global_procedures (
2292
+ CREATE TABLE IF NOT EXISTS company_procedures (
2293
2293
  id TEXT PRIMARY KEY,
2294
2294
  title TEXT NOT NULL,
2295
2295
  content TEXT NOT NULL,
@@ -2300,6 +2300,73 @@ async function ensureSchema() {
2300
2300
  updated_at TEXT NOT NULL
2301
2301
  )
2302
2302
  `);
2303
+ const legacyProcedureObject = await client.execute({
2304
+ sql: "SELECT type FROM sqlite_master WHERE name = 'global_procedures'",
2305
+ args: []
2306
+ });
2307
+ const legacyProcedureType = legacyProcedureObject.rows[0]?.type == null ? null : String(legacyProcedureObject.rows[0].type);
2308
+ if (legacyProcedureType === "table") {
2309
+ await client.execute(`
2310
+ INSERT OR IGNORE INTO company_procedures
2311
+ (id, title, content, priority, domain, active, created_at, updated_at)
2312
+ SELECT id, title, content, priority, domain, active, created_at, updated_at
2313
+ FROM global_procedures
2314
+ `);
2315
+ await client.executeMultiple(`
2316
+ CREATE TRIGGER IF NOT EXISTS global_procedures_mirror_insert
2317
+ AFTER INSERT ON global_procedures
2318
+ BEGIN
2319
+ INSERT OR IGNORE INTO company_procedures
2320
+ (id, title, content, priority, domain, active, created_at, updated_at)
2321
+ VALUES
2322
+ (NEW.id, NEW.title, NEW.content, NEW.priority, NEW.domain, NEW.active, NEW.created_at, NEW.updated_at);
2323
+ END;
2324
+
2325
+ CREATE TRIGGER IF NOT EXISTS global_procedures_mirror_update
2326
+ AFTER UPDATE ON global_procedures
2327
+ BEGIN
2328
+ UPDATE company_procedures
2329
+ SET title = NEW.title,
2330
+ content = NEW.content,
2331
+ priority = NEW.priority,
2332
+ domain = NEW.domain,
2333
+ active = NEW.active,
2334
+ created_at = NEW.created_at,
2335
+ updated_at = NEW.updated_at
2336
+ WHERE id = OLD.id;
2337
+ END;
2338
+ `);
2339
+ } else {
2340
+ await client.execute(`
2341
+ CREATE VIEW IF NOT EXISTS global_procedures AS
2342
+ SELECT id, title, content, priority, domain, active, created_at, updated_at
2343
+ FROM company_procedures
2344
+ `);
2345
+ await client.executeMultiple(`
2346
+ CREATE TRIGGER IF NOT EXISTS global_procedures_insert
2347
+ INSTEAD OF INSERT ON global_procedures
2348
+ BEGIN
2349
+ INSERT INTO company_procedures
2350
+ (id, title, content, priority, domain, active, created_at, updated_at)
2351
+ VALUES
2352
+ (NEW.id, NEW.title, NEW.content, NEW.priority, NEW.domain, NEW.active, NEW.created_at, NEW.updated_at);
2353
+ END;
2354
+
2355
+ CREATE TRIGGER IF NOT EXISTS global_procedures_update
2356
+ INSTEAD OF UPDATE ON global_procedures
2357
+ BEGIN
2358
+ UPDATE company_procedures
2359
+ SET title = NEW.title,
2360
+ content = NEW.content,
2361
+ priority = NEW.priority,
2362
+ domain = NEW.domain,
2363
+ active = NEW.active,
2364
+ created_at = NEW.created_at,
2365
+ updated_at = NEW.updated_at
2366
+ WHERE id = OLD.id;
2367
+ END;
2368
+ `);
2369
+ }
2303
2370
  await client.executeMultiple(`
2304
2371
  CREATE TABLE IF NOT EXISTS conversations (
2305
2372
  id TEXT PRIMARY KEY,
@@ -3176,7 +3243,7 @@ var init_platform_procedures = __esm({
3176
3243
  title: "MCP tools \u2014 advanced (triggers, skills, orchestration)",
3177
3244
  domain: "tool-use",
3178
3245
  priority: "p1",
3179
- content: "create_trigger: set up a scheduled recurring agent job (cron). list_triggers: view active triggers. load_skill: load a slash-command skill dynamically. apply_starter_pack: import a pre-built behavior + identity pack for a role. export_orchestration: export full org state (tasks, behaviors, identities) as portable JSON. import_orchestration: import org state into a new instance. deploy_client: deploy a customer client instance. query_company_brain: unified RAG query across all company knowledge. create_reminder: set a text reminder (shown in boot brief). list_reminders: view pending reminders. complete_reminder: mark a reminder done. global_procedure: manage customer-owned company procedures (Layer 0; actions: store, list, deactivate). Legacy aliases: store_global_procedure, list_global_procedures, deactivate_global_procedure."
3246
+ content: "create_trigger: set up a scheduled recurring agent job (cron). list_triggers: view active triggers. load_skill: load a slash-command skill dynamically. apply_starter_pack: import a pre-built behavior + identity pack for a role. export_orchestration: export full org state (tasks, behaviors, identities) as portable JSON. import_orchestration: import org state into a new instance. deploy_client: deploy a customer client instance. query_company_brain: unified RAG query across all company knowledge. create_reminder: set a text reminder (shown in boot brief). list_reminders: view pending reminders. complete_reminder: mark a reminder done. company_procedure: manage customer-owned company procedures (Layer 0; actions: store, list, deactivate). Legacy aliases: global_procedure, store_global_procedure, list_global_procedures, deactivate_global_procedure."
3180
3247
  }
3181
3248
  ];
3182
3249
  PLATFORM_PROCEDURE_TITLES = new Set(
@@ -3197,7 +3264,7 @@ import { randomUUID as randomUUID2 } from "crypto";
3197
3264
  async function loadGlobalProcedures() {
3198
3265
  const client = getClient();
3199
3266
  const result = await client.execute({
3200
- sql: "SELECT * FROM global_procedures WHERE active = 1 ORDER BY priority ASC, created_at ASC",
3267
+ sql: "SELECT * FROM company_procedures WHERE active = 1 ORDER BY priority ASC, created_at ASC",
3201
3268
  args: []
3202
3269
  });
3203
3270
  const allRows = result.rows;
@@ -3226,7 +3293,7 @@ async function storeGlobalProcedure(input) {
3226
3293
  const now = (/* @__PURE__ */ new Date()).toISOString();
3227
3294
  const client = getClient();
3228
3295
  await client.execute({
3229
- sql: `INSERT INTO global_procedures (id, title, content, priority, domain, active, created_at, updated_at)
3296
+ sql: `INSERT INTO company_procedures (id, title, content, priority, domain, active, created_at, updated_at)
3230
3297
  VALUES (?, ?, ?, ?, ?, 1, ?, ?)`,
3231
3298
  args: [id, input.title, input.content, input.priority ?? "p0", input.domain ?? null, now, now]
3232
3299
  });
@@ -3237,7 +3304,7 @@ async function deactivateGlobalProcedure(id) {
3237
3304
  const now = (/* @__PURE__ */ new Date()).toISOString();
3238
3305
  const client = getClient();
3239
3306
  const result = await client.execute({
3240
- sql: "UPDATE global_procedures SET active = 0, updated_at = ? WHERE id = ?",
3307
+ sql: "UPDATE company_procedures SET active = 0, updated_at = ? WHERE id = ?",
3241
3308
  args: [now, id]
3242
3309
  });
3243
3310
  await loadGlobalProcedures();
@@ -2504,7 +2504,7 @@ async function ensureSchema() {
2504
2504
  ON session_kills(agent_id);
2505
2505
  `);
2506
2506
  await client.execute(`
2507
- CREATE TABLE IF NOT EXISTS global_procedures (
2507
+ CREATE TABLE IF NOT EXISTS company_procedures (
2508
2508
  id TEXT PRIMARY KEY,
2509
2509
  title TEXT NOT NULL,
2510
2510
  content TEXT NOT NULL,
@@ -2515,6 +2515,73 @@ async function ensureSchema() {
2515
2515
  updated_at TEXT NOT NULL
2516
2516
  )
2517
2517
  `);
2518
+ const legacyProcedureObject = await client.execute({
2519
+ sql: "SELECT type FROM sqlite_master WHERE name = 'global_procedures'",
2520
+ args: []
2521
+ });
2522
+ const legacyProcedureType = legacyProcedureObject.rows[0]?.type == null ? null : String(legacyProcedureObject.rows[0].type);
2523
+ if (legacyProcedureType === "table") {
2524
+ await client.execute(`
2525
+ INSERT OR IGNORE INTO company_procedures
2526
+ (id, title, content, priority, domain, active, created_at, updated_at)
2527
+ SELECT id, title, content, priority, domain, active, created_at, updated_at
2528
+ FROM global_procedures
2529
+ `);
2530
+ await client.executeMultiple(`
2531
+ CREATE TRIGGER IF NOT EXISTS global_procedures_mirror_insert
2532
+ AFTER INSERT ON global_procedures
2533
+ BEGIN
2534
+ INSERT OR IGNORE INTO company_procedures
2535
+ (id, title, content, priority, domain, active, created_at, updated_at)
2536
+ VALUES
2537
+ (NEW.id, NEW.title, NEW.content, NEW.priority, NEW.domain, NEW.active, NEW.created_at, NEW.updated_at);
2538
+ END;
2539
+
2540
+ CREATE TRIGGER IF NOT EXISTS global_procedures_mirror_update
2541
+ AFTER UPDATE ON global_procedures
2542
+ BEGIN
2543
+ UPDATE company_procedures
2544
+ SET title = NEW.title,
2545
+ content = NEW.content,
2546
+ priority = NEW.priority,
2547
+ domain = NEW.domain,
2548
+ active = NEW.active,
2549
+ created_at = NEW.created_at,
2550
+ updated_at = NEW.updated_at
2551
+ WHERE id = OLD.id;
2552
+ END;
2553
+ `);
2554
+ } else {
2555
+ await client.execute(`
2556
+ CREATE VIEW IF NOT EXISTS global_procedures AS
2557
+ SELECT id, title, content, priority, domain, active, created_at, updated_at
2558
+ FROM company_procedures
2559
+ `);
2560
+ await client.executeMultiple(`
2561
+ CREATE TRIGGER IF NOT EXISTS global_procedures_insert
2562
+ INSTEAD OF INSERT ON global_procedures
2563
+ BEGIN
2564
+ INSERT INTO company_procedures
2565
+ (id, title, content, priority, domain, active, created_at, updated_at)
2566
+ VALUES
2567
+ (NEW.id, NEW.title, NEW.content, NEW.priority, NEW.domain, NEW.active, NEW.created_at, NEW.updated_at);
2568
+ END;
2569
+
2570
+ CREATE TRIGGER IF NOT EXISTS global_procedures_update
2571
+ INSTEAD OF UPDATE ON global_procedures
2572
+ BEGIN
2573
+ UPDATE company_procedures
2574
+ SET title = NEW.title,
2575
+ content = NEW.content,
2576
+ priority = NEW.priority,
2577
+ domain = NEW.domain,
2578
+ active = NEW.active,
2579
+ created_at = NEW.created_at,
2580
+ updated_at = NEW.updated_at
2581
+ WHERE id = OLD.id;
2582
+ END;
2583
+ `);
2584
+ }
2518
2585
  await client.executeMultiple(`
2519
2586
  CREATE TABLE IF NOT EXISTS conversations (
2520
2587
  id TEXT PRIMARY KEY,
@@ -3863,7 +3930,7 @@ var init_platform_procedures = __esm({
3863
3930
  title: "MCP tools \u2014 advanced (triggers, skills, orchestration)",
3864
3931
  domain: "tool-use",
3865
3932
  priority: "p1",
3866
- content: "create_trigger: set up a scheduled recurring agent job (cron). list_triggers: view active triggers. load_skill: load a slash-command skill dynamically. apply_starter_pack: import a pre-built behavior + identity pack for a role. export_orchestration: export full org state (tasks, behaviors, identities) as portable JSON. import_orchestration: import org state into a new instance. deploy_client: deploy a customer client instance. query_company_brain: unified RAG query across all company knowledge. create_reminder: set a text reminder (shown in boot brief). list_reminders: view pending reminders. complete_reminder: mark a reminder done. global_procedure: manage customer-owned company procedures (Layer 0; actions: store, list, deactivate). Legacy aliases: store_global_procedure, list_global_procedures, deactivate_global_procedure."
3933
+ content: "create_trigger: set up a scheduled recurring agent job (cron). list_triggers: view active triggers. load_skill: load a slash-command skill dynamically. apply_starter_pack: import a pre-built behavior + identity pack for a role. export_orchestration: export full org state (tasks, behaviors, identities) as portable JSON. import_orchestration: import org state into a new instance. deploy_client: deploy a customer client instance. query_company_brain: unified RAG query across all company knowledge. create_reminder: set a text reminder (shown in boot brief). list_reminders: view pending reminders. complete_reminder: mark a reminder done. company_procedure: manage customer-owned company procedures (Layer 0; actions: store, list, deactivate). Legacy aliases: global_procedure, store_global_procedure, list_global_procedures, deactivate_global_procedure."
3867
3934
  }
3868
3935
  ];
3869
3936
  PLATFORM_PROCEDURE_TITLES = new Set(
@@ -3884,7 +3951,7 @@ import { randomUUID as randomUUID2 } from "crypto";
3884
3951
  async function loadGlobalProcedures() {
3885
3952
  const client = getClient();
3886
3953
  const result = await client.execute({
3887
- sql: "SELECT * FROM global_procedures WHERE active = 1 ORDER BY priority ASC, created_at ASC",
3954
+ sql: "SELECT * FROM company_procedures WHERE active = 1 ORDER BY priority ASC, created_at ASC",
3888
3955
  args: []
3889
3956
  });
3890
3957
  const allRows = result.rows;
@@ -3913,7 +3980,7 @@ async function storeGlobalProcedure(input) {
3913
3980
  const now = (/* @__PURE__ */ new Date()).toISOString();
3914
3981
  const client = getClient();
3915
3982
  await client.execute({
3916
- sql: `INSERT INTO global_procedures (id, title, content, priority, domain, active, created_at, updated_at)
3983
+ sql: `INSERT INTO company_procedures (id, title, content, priority, domain, active, created_at, updated_at)
3917
3984
  VALUES (?, ?, ?, ?, ?, 1, ?, ?)`,
3918
3985
  args: [id, input.title, input.content, input.priority ?? "p0", input.domain ?? null, now, now]
3919
3986
  });
@@ -3924,7 +3991,7 @@ async function deactivateGlobalProcedure(id) {
3924
3991
  const now = (/* @__PURE__ */ new Date()).toISOString();
3925
3992
  const client = getClient();
3926
3993
  const result = await client.execute({
3927
- sql: "UPDATE global_procedures SET active = 0, updated_at = ? WHERE id = ?",
3994
+ sql: "UPDATE company_procedures SET active = 0, updated_at = ? WHERE id = ?",
3928
3995
  args: [now, id]
3929
3996
  });
3930
3997
  await loadGlobalProcedures();
@@ -608,6 +608,39 @@ var init_preferences = __esm({
608
608
  }
609
609
  });
610
610
 
611
+ // src/adapters/runtime-hook-manifest.ts
612
+ function commandHasAnyMarker(command, markers) {
613
+ return markers.some((marker) => command.includes(marker));
614
+ }
615
+ function isLegacySplitPostToolCommand(command) {
616
+ return commandHasAnyMarker(command, LEGACY_SPLIT_POST_TOOL_HOOK_MARKERS);
617
+ }
618
+ var EXE_HOOKS, LEGACY_SPLIT_POST_TOOL_HOOK_MARKERS;
619
+ var init_runtime_hook_manifest = __esm({
620
+ "src/adapters/runtime-hook-manifest.ts"() {
621
+ "use strict";
622
+ EXE_HOOKS = {
623
+ postToolCombined: "dist/hooks/post-tool-combined.js",
624
+ sessionStart: "dist/hooks/session-start.js",
625
+ promptSubmit: "dist/hooks/prompt-submit.js",
626
+ heartbeat: "dist/hooks/exe-heartbeat-hook.js",
627
+ stop: "dist/hooks/stop.js",
628
+ preToolUse: "dist/hooks/pre-tool-use.js",
629
+ subagentStop: "dist/hooks/subagent-stop.js",
630
+ preCompact: "dist/hooks/pre-compact.js",
631
+ postCompact: "dist/hooks/post-compact.js",
632
+ sessionEnd: "dist/hooks/session-end.js",
633
+ notification: "dist/hooks/notification.js",
634
+ instructionsLoaded: "dist/hooks/instructions-loaded.js"
635
+ };
636
+ LEGACY_SPLIT_POST_TOOL_HOOK_MARKERS = [
637
+ "dist/hooks/ingest.js",
638
+ "dist/hooks/error-recall.js",
639
+ "dist/hooks/ingest-worker.js"
640
+ ];
641
+ }
642
+ });
643
+
611
644
  // src/adapters/claude/installer.ts
612
645
  import { readFile as readFile3, writeFile as writeFile3, mkdir as mkdir3, readdir } from "fs/promises";
613
646
  import { existsSync as existsSync7, readFileSync as readFileSync5, writeFileSync as writeFileSync4, copyFileSync, mkdirSync as mkdirSync3, chmodSync as chmodSync2 } from "fs";
@@ -917,7 +950,7 @@ async function mergeHooks(packageRoot, homeDir = os5.homedir()) {
917
950
  }
918
951
  ]
919
952
  },
920
- marker: "dist/hooks/post-tool-combined.js"
953
+ marker: EXE_HOOKS.postToolCombined
921
954
  },
922
955
  {
923
956
  event: "SessionStart",
@@ -930,7 +963,7 @@ async function mergeHooks(packageRoot, homeDir = os5.homedir()) {
930
963
  }
931
964
  ]
932
965
  },
933
- marker: "dist/hooks/session-start.js"
966
+ marker: EXE_HOOKS.sessionStart
934
967
  },
935
968
  {
936
969
  event: "UserPromptSubmit",
@@ -942,7 +975,7 @@ async function mergeHooks(packageRoot, homeDir = os5.homedir()) {
942
975
  }
943
976
  ]
944
977
  },
945
- marker: "dist/hooks/prompt-submit.js"
978
+ marker: EXE_HOOKS.promptSubmit
946
979
  },
947
980
  {
948
981
  event: "UserPromptSubmit",
@@ -955,7 +988,7 @@ async function mergeHooks(packageRoot, homeDir = os5.homedir()) {
955
988
  }
956
989
  ]
957
990
  },
958
- marker: "dist/hooks/exe-heartbeat-hook.js"
991
+ marker: EXE_HOOKS.heartbeat
959
992
  },
960
993
  {
961
994
  event: "Stop",
@@ -967,7 +1000,7 @@ async function mergeHooks(packageRoot, homeDir = os5.homedir()) {
967
1000
  }
968
1001
  ]
969
1002
  },
970
- marker: "dist/hooks/stop.js"
1003
+ marker: EXE_HOOKS.stop
971
1004
  },
972
1005
  {
973
1006
  event: "PreToolUse",
@@ -980,7 +1013,7 @@ async function mergeHooks(packageRoot, homeDir = os5.homedir()) {
980
1013
  }
981
1014
  ]
982
1015
  },
983
- marker: "dist/hooks/pre-tool-use.js"
1016
+ marker: EXE_HOOKS.preToolUse
984
1017
  },
985
1018
  {
986
1019
  event: "SubagentStop",
@@ -992,7 +1025,7 @@ async function mergeHooks(packageRoot, homeDir = os5.homedir()) {
992
1025
  }
993
1026
  ]
994
1027
  },
995
- marker: "dist/hooks/subagent-stop.js"
1028
+ marker: EXE_HOOKS.subagentStop
996
1029
  },
997
1030
  {
998
1031
  event: "PreCompact",
@@ -1005,7 +1038,7 @@ async function mergeHooks(packageRoot, homeDir = os5.homedir()) {
1005
1038
  }
1006
1039
  ]
1007
1040
  },
1008
- marker: "dist/hooks/pre-compact.js"
1041
+ marker: EXE_HOOKS.preCompact
1009
1042
  },
1010
1043
  {
1011
1044
  event: "SessionEnd",
@@ -1017,7 +1050,7 @@ async function mergeHooks(packageRoot, homeDir = os5.homedir()) {
1017
1050
  }
1018
1051
  ]
1019
1052
  },
1020
- marker: "dist/hooks/session-end.js"
1053
+ marker: EXE_HOOKS.sessionEnd
1021
1054
  },
1022
1055
  {
1023
1056
  event: "Notification",
@@ -1029,7 +1062,7 @@ async function mergeHooks(packageRoot, homeDir = os5.homedir()) {
1029
1062
  }
1030
1063
  ]
1031
1064
  },
1032
- marker: "dist/hooks/notification.js"
1065
+ marker: EXE_HOOKS.notification
1033
1066
  },
1034
1067
  {
1035
1068
  event: "PostCompact",
@@ -1042,7 +1075,7 @@ async function mergeHooks(packageRoot, homeDir = os5.homedir()) {
1042
1075
  }
1043
1076
  ]
1044
1077
  },
1045
- marker: "dist/hooks/post-compact.js"
1078
+ marker: EXE_HOOKS.postCompact
1046
1079
  },
1047
1080
  {
1048
1081
  event: "InstructionsLoaded",
@@ -1054,21 +1087,16 @@ async function mergeHooks(packageRoot, homeDir = os5.homedir()) {
1054
1087
  }
1055
1088
  ]
1056
1089
  },
1057
- marker: "dist/hooks/instructions-loaded.js"
1090
+ marker: EXE_HOOKS.instructionsLoaded
1058
1091
  }
1059
1092
  ];
1060
1093
  let added = 0;
1061
1094
  let skipped = 0;
1062
- const legacyPostToolMarkers = [
1063
- "dist/hooks/ingest.js",
1064
- "dist/hooks/error-recall.js",
1065
- "dist/hooks/ingest-worker.js"
1066
- ];
1067
1095
  const postToolGroups = settings.hooks["PostToolUse"];
1068
1096
  if (Array.isArray(postToolGroups)) {
1069
1097
  settings.hooks["PostToolUse"] = postToolGroups.map((g) => ({
1070
1098
  ...g,
1071
- hooks: g.hooks.filter((h) => !legacyPostToolMarkers.some((marker) => h.command.includes(marker)))
1099
+ hooks: g.hooks.filter((h) => !isLegacySplitPostToolCommand(h.command))
1072
1100
  })).filter((g) => g.hooks.length > 0);
1073
1101
  }
1074
1102
  for (const { event, group, marker } of hooksToRegister) {
@@ -1545,6 +1573,7 @@ var init_installer = __esm({
1545
1573
  init_agent_symlinks();
1546
1574
  init_mcp_prefix();
1547
1575
  init_preferences();
1576
+ init_runtime_hook_manifest();
1548
1577
  EXE_SECTION_START = "<!-- exe-os:orchestration-start -->";
1549
1578
  EXE_SECTION_END = "<!-- exe-os:orchestration-end -->";
1550
1579
  ORCHESTRATION_RULES = `${EXE_SECTION_START}
@@ -1606,7 +1635,7 @@ async function mergeCodexHooks(packageRoot, homeDir = os6.homedir()) {
1606
1635
  }
1607
1636
  ]
1608
1637
  },
1609
- marker: "dist/hooks/session-start.js"
1638
+ marker: EXE_HOOKS.sessionStart
1610
1639
  },
1611
1640
  {
1612
1641
  event: "PostToolUse",
@@ -1621,7 +1650,7 @@ async function mergeCodexHooks(packageRoot, homeDir = os6.homedir()) {
1621
1650
  }
1622
1651
  ]
1623
1652
  },
1624
- marker: "dist/hooks/post-tool-combined.js"
1653
+ marker: EXE_HOOKS.postToolCombined
1625
1654
  },
1626
1655
  {
1627
1656
  event: "UserPromptSubmit",
@@ -1635,7 +1664,7 @@ async function mergeCodexHooks(packageRoot, homeDir = os6.homedir()) {
1635
1664
  }
1636
1665
  ]
1637
1666
  },
1638
- marker: "dist/hooks/prompt-submit.js"
1667
+ marker: EXE_HOOKS.promptSubmit
1639
1668
  },
1640
1669
  {
1641
1670
  event: "Stop",
@@ -1647,7 +1676,7 @@ async function mergeCodexHooks(packageRoot, homeDir = os6.homedir()) {
1647
1676
  }
1648
1677
  ]
1649
1678
  },
1650
- marker: "dist/hooks/stop.js"
1679
+ marker: EXE_HOOKS.stop
1651
1680
  },
1652
1681
  {
1653
1682
  event: "PreToolUse",
@@ -1660,21 +1689,16 @@ async function mergeCodexHooks(packageRoot, homeDir = os6.homedir()) {
1660
1689
  }
1661
1690
  ]
1662
1691
  },
1663
- marker: "dist/hooks/pre-tool-use.js"
1692
+ marker: EXE_HOOKS.preToolUse
1664
1693
  }
1665
1694
  ];
1666
1695
  let added = 0;
1667
1696
  let skipped = 0;
1668
- const legacyPostToolMarkers = [
1669
- "dist/hooks/ingest.js",
1670
- "dist/hooks/error-recall.js",
1671
- "dist/hooks/ingest-worker.js"
1672
- ];
1673
1697
  const postToolGroups = hooksJson.hooks["PostToolUse"];
1674
1698
  if (Array.isArray(postToolGroups)) {
1675
1699
  hooksJson.hooks["PostToolUse"] = postToolGroups.map((g) => ({
1676
1700
  ...g,
1677
- hooks: g.hooks.filter((h) => !legacyPostToolMarkers.some((marker) => h.command.includes(marker)))
1701
+ hooks: g.hooks.filter((h) => !isLegacySplitPostToolCommand(h.command))
1678
1702
  })).filter((g) => g.hooks.length > 0);
1679
1703
  }
1680
1704
  for (const { event, group, marker } of hooksToRegister) {
@@ -1717,11 +1741,11 @@ function verifyCodexHooks(homeDir = os6.homedir()) {
1717
1741
  }
1718
1742
  }
1719
1743
  const postToolCommands = (hooksJson.hooks.PostToolUse ?? []).flatMap((g) => g.hooks.map((h) => h.command));
1720
- if (!postToolCommands.some((cmd) => cmd.includes("dist/hooks/post-tool-combined.js"))) {
1744
+ if (!postToolCommands.some((cmd) => cmd.includes(EXE_HOOKS.postToolCombined))) {
1721
1745
  return false;
1722
1746
  }
1723
1747
  if (postToolCommands.some(
1724
- (cmd) => cmd.includes("dist/hooks/ingest.js") || cmd.includes("dist/hooks/error-recall.js") || cmd.includes("dist/hooks/ingest-worker.js")
1748
+ (cmd) => isLegacySplitPostToolCommand(cmd)
1725
1749
  )) {
1726
1750
  return false;
1727
1751
  }
@@ -1882,6 +1906,7 @@ var init_installer2 = __esm({
1882
1906
  "use strict";
1883
1907
  init_installer();
1884
1908
  init_preferences();
1909
+ init_runtime_hook_manifest();
1885
1910
  DEFAULT_CODEX_STATUS_LINE = [
1886
1911
  "model-with-reasoning",
1887
1912
  "current-dir",