@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.
- package/dist/bin/backfill-conversations.js +72 -5
- package/dist/bin/backfill-responses.js +72 -5
- package/dist/bin/backfill-vectors.js +72 -5
- package/dist/bin/cc-doctor.js +376 -0
- package/dist/bin/cleanup-stale-review-tasks.js +72 -5
- package/dist/bin/cli.js +157 -55
- package/dist/bin/customer-readiness.js +33 -0
- package/dist/bin/exe-agent.js +1 -1
- package/dist/bin/exe-assign.js +72 -5
- package/dist/bin/exe-boot.js +78 -11
- package/dist/bin/exe-call.js +1 -1
- package/dist/bin/exe-dispatch.js +72 -5
- package/dist/bin/exe-doctor.js +72 -5
- package/dist/bin/exe-export-behaviors.js +72 -5
- package/dist/bin/exe-forget.js +72 -5
- package/dist/bin/exe-gateway.js +72 -5
- package/dist/bin/exe-heartbeat.js +72 -5
- package/dist/bin/exe-kill.js +72 -5
- package/dist/bin/exe-launch-agent.js +72 -5
- package/dist/bin/exe-link.js +74 -7
- package/dist/bin/exe-new-employee.js +48 -19
- package/dist/bin/exe-pending-messages.js +72 -5
- package/dist/bin/exe-pending-notifications.js +72 -5
- package/dist/bin/exe-pending-reviews.js +72 -5
- package/dist/bin/exe-rename.js +72 -5
- package/dist/bin/exe-review.js +72 -5
- package/dist/bin/exe-search.js +72 -5
- package/dist/bin/exe-session-cleanup.js +72 -5
- package/dist/bin/exe-start-codex.js +115 -18
- package/dist/bin/exe-start-opencode.js +93 -7
- package/dist/bin/exe-status.js +72 -5
- package/dist/bin/exe-team.js +72 -5
- package/dist/bin/git-sweep.js +72 -5
- package/dist/bin/graph-backfill.js +72 -5
- package/dist/bin/graph-export.js +72 -5
- package/dist/bin/install.js +56 -31
- package/dist/bin/intercom-check.js +72 -5
- package/dist/bin/pre-build-guard.js +98 -0
- package/dist/bin/scan-tasks.js +72 -5
- package/dist/bin/setup.js +75 -8
- package/dist/bin/shard-migrate.js +72 -5
- package/dist/gateway/index.js +78 -11
- package/dist/hooks/bug-report-worker.js +72 -5
- package/dist/hooks/codex-stop-task-finalizer.js +72 -5
- package/dist/hooks/commit-complete.js +72 -5
- package/dist/hooks/error-recall.js +72 -5
- package/dist/hooks/ingest.js +72 -5
- package/dist/hooks/instructions-loaded.js +72 -5
- package/dist/hooks/notification.js +72 -5
- package/dist/hooks/post-compact.js +72 -5
- package/dist/hooks/post-tool-combined.js +72 -5
- package/dist/hooks/pre-compact.js +72 -5
- package/dist/hooks/pre-tool-use.js +72 -5
- package/dist/hooks/prompt-submit.js +72 -5
- package/dist/hooks/session-end.js +72 -5
- package/dist/hooks/session-start.js +72 -5
- package/dist/hooks/stop.js +72 -5
- package/dist/hooks/subagent-stop.js +72 -5
- package/dist/hooks/summary-worker.js +78 -11
- package/dist/index.js +78 -11
- package/dist/lib/cloud-sync.js +74 -7
- package/dist/lib/database.js +68 -1
- package/dist/lib/db.js +68 -1
- package/dist/lib/device-registry.js +68 -1
- package/dist/lib/employee-templates.js +1 -1
- package/dist/lib/exe-daemon.js +103 -26
- package/dist/lib/hybrid-search.js +72 -5
- package/dist/lib/schedules.js +72 -5
- package/dist/lib/store.js +72 -5
- package/dist/mcp/server.js +103 -26
- package/dist/runtime/index.js +72 -5
- package/dist/tui/App.js +80 -13
- package/package.json +1 -1
|
@@ -2429,7 +2429,7 @@ async function ensureSchema() {
|
|
|
2429
2429
|
ON session_kills(agent_id);
|
|
2430
2430
|
`);
|
|
2431
2431
|
await client.execute(`
|
|
2432
|
-
CREATE TABLE IF NOT EXISTS
|
|
2432
|
+
CREATE TABLE IF NOT EXISTS company_procedures (
|
|
2433
2433
|
id TEXT PRIMARY KEY,
|
|
2434
2434
|
title TEXT NOT NULL,
|
|
2435
2435
|
content TEXT NOT NULL,
|
|
@@ -2440,6 +2440,73 @@ async function ensureSchema() {
|
|
|
2440
2440
|
updated_at TEXT NOT NULL
|
|
2441
2441
|
)
|
|
2442
2442
|
`);
|
|
2443
|
+
const legacyProcedureObject = await client.execute({
|
|
2444
|
+
sql: "SELECT type FROM sqlite_master WHERE name = 'global_procedures'",
|
|
2445
|
+
args: []
|
|
2446
|
+
});
|
|
2447
|
+
const legacyProcedureType = legacyProcedureObject.rows[0]?.type == null ? null : String(legacyProcedureObject.rows[0].type);
|
|
2448
|
+
if (legacyProcedureType === "table") {
|
|
2449
|
+
await client.execute(`
|
|
2450
|
+
INSERT OR IGNORE INTO company_procedures
|
|
2451
|
+
(id, title, content, priority, domain, active, created_at, updated_at)
|
|
2452
|
+
SELECT id, title, content, priority, domain, active, created_at, updated_at
|
|
2453
|
+
FROM global_procedures
|
|
2454
|
+
`);
|
|
2455
|
+
await client.executeMultiple(`
|
|
2456
|
+
CREATE TRIGGER IF NOT EXISTS global_procedures_mirror_insert
|
|
2457
|
+
AFTER INSERT ON global_procedures
|
|
2458
|
+
BEGIN
|
|
2459
|
+
INSERT OR IGNORE INTO company_procedures
|
|
2460
|
+
(id, title, content, priority, domain, active, created_at, updated_at)
|
|
2461
|
+
VALUES
|
|
2462
|
+
(NEW.id, NEW.title, NEW.content, NEW.priority, NEW.domain, NEW.active, NEW.created_at, NEW.updated_at);
|
|
2463
|
+
END;
|
|
2464
|
+
|
|
2465
|
+
CREATE TRIGGER IF NOT EXISTS global_procedures_mirror_update
|
|
2466
|
+
AFTER UPDATE ON global_procedures
|
|
2467
|
+
BEGIN
|
|
2468
|
+
UPDATE company_procedures
|
|
2469
|
+
SET title = NEW.title,
|
|
2470
|
+
content = NEW.content,
|
|
2471
|
+
priority = NEW.priority,
|
|
2472
|
+
domain = NEW.domain,
|
|
2473
|
+
active = NEW.active,
|
|
2474
|
+
created_at = NEW.created_at,
|
|
2475
|
+
updated_at = NEW.updated_at
|
|
2476
|
+
WHERE id = OLD.id;
|
|
2477
|
+
END;
|
|
2478
|
+
`);
|
|
2479
|
+
} else {
|
|
2480
|
+
await client.execute(`
|
|
2481
|
+
CREATE VIEW IF NOT EXISTS global_procedures AS
|
|
2482
|
+
SELECT id, title, content, priority, domain, active, created_at, updated_at
|
|
2483
|
+
FROM company_procedures
|
|
2484
|
+
`);
|
|
2485
|
+
await client.executeMultiple(`
|
|
2486
|
+
CREATE TRIGGER IF NOT EXISTS global_procedures_insert
|
|
2487
|
+
INSTEAD OF INSERT ON global_procedures
|
|
2488
|
+
BEGIN
|
|
2489
|
+
INSERT INTO company_procedures
|
|
2490
|
+
(id, title, content, priority, domain, active, created_at, updated_at)
|
|
2491
|
+
VALUES
|
|
2492
|
+
(NEW.id, NEW.title, NEW.content, NEW.priority, NEW.domain, NEW.active, NEW.created_at, NEW.updated_at);
|
|
2493
|
+
END;
|
|
2494
|
+
|
|
2495
|
+
CREATE TRIGGER IF NOT EXISTS global_procedures_update
|
|
2496
|
+
INSTEAD OF UPDATE ON global_procedures
|
|
2497
|
+
BEGIN
|
|
2498
|
+
UPDATE company_procedures
|
|
2499
|
+
SET title = NEW.title,
|
|
2500
|
+
content = NEW.content,
|
|
2501
|
+
priority = NEW.priority,
|
|
2502
|
+
domain = NEW.domain,
|
|
2503
|
+
active = NEW.active,
|
|
2504
|
+
created_at = NEW.created_at,
|
|
2505
|
+
updated_at = NEW.updated_at
|
|
2506
|
+
WHERE id = OLD.id;
|
|
2507
|
+
END;
|
|
2508
|
+
`);
|
|
2509
|
+
}
|
|
2443
2510
|
await client.executeMultiple(`
|
|
2444
2511
|
CREATE TABLE IF NOT EXISTS conversations (
|
|
2445
2512
|
id TEXT PRIMARY KEY,
|
|
@@ -3316,7 +3383,7 @@ var init_platform_procedures = __esm({
|
|
|
3316
3383
|
title: "MCP tools \u2014 advanced (triggers, skills, orchestration)",
|
|
3317
3384
|
domain: "tool-use",
|
|
3318
3385
|
priority: "p1",
|
|
3319
|
-
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.
|
|
3386
|
+
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."
|
|
3320
3387
|
}
|
|
3321
3388
|
];
|
|
3322
3389
|
PLATFORM_PROCEDURE_TITLES = new Set(
|
|
@@ -3337,7 +3404,7 @@ import { randomUUID as randomUUID2 } from "crypto";
|
|
|
3337
3404
|
async function loadGlobalProcedures() {
|
|
3338
3405
|
const client = getClient();
|
|
3339
3406
|
const result = await client.execute({
|
|
3340
|
-
sql: "SELECT * FROM
|
|
3407
|
+
sql: "SELECT * FROM company_procedures WHERE active = 1 ORDER BY priority ASC, created_at ASC",
|
|
3341
3408
|
args: []
|
|
3342
3409
|
});
|
|
3343
3410
|
const allRows = result.rows;
|
|
@@ -3366,7 +3433,7 @@ async function storeGlobalProcedure(input) {
|
|
|
3366
3433
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
3367
3434
|
const client = getClient();
|
|
3368
3435
|
await client.execute({
|
|
3369
|
-
sql: `INSERT INTO
|
|
3436
|
+
sql: `INSERT INTO company_procedures (id, title, content, priority, domain, active, created_at, updated_at)
|
|
3370
3437
|
VALUES (?, ?, ?, ?, ?, 1, ?, ?)`,
|
|
3371
3438
|
args: [id, input.title, input.content, input.priority ?? "p0", input.domain ?? null, now, now]
|
|
3372
3439
|
});
|
|
@@ -3377,7 +3444,7 @@ async function deactivateGlobalProcedure(id) {
|
|
|
3377
3444
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
3378
3445
|
const client = getClient();
|
|
3379
3446
|
const result = await client.execute({
|
|
3380
|
-
sql: "UPDATE
|
|
3447
|
+
sql: "UPDATE company_procedures SET active = 0, updated_at = ? WHERE id = ?",
|
|
3381
3448
|
args: [now, id]
|
|
3382
3449
|
});
|
|
3383
3450
|
await loadGlobalProcedures();
|
|
@@ -2429,7 +2429,7 @@ async function ensureSchema() {
|
|
|
2429
2429
|
ON session_kills(agent_id);
|
|
2430
2430
|
`);
|
|
2431
2431
|
await client.execute(`
|
|
2432
|
-
CREATE TABLE IF NOT EXISTS
|
|
2432
|
+
CREATE TABLE IF NOT EXISTS company_procedures (
|
|
2433
2433
|
id TEXT PRIMARY KEY,
|
|
2434
2434
|
title TEXT NOT NULL,
|
|
2435
2435
|
content TEXT NOT NULL,
|
|
@@ -2440,6 +2440,73 @@ async function ensureSchema() {
|
|
|
2440
2440
|
updated_at TEXT NOT NULL
|
|
2441
2441
|
)
|
|
2442
2442
|
`);
|
|
2443
|
+
const legacyProcedureObject = await client.execute({
|
|
2444
|
+
sql: "SELECT type FROM sqlite_master WHERE name = 'global_procedures'",
|
|
2445
|
+
args: []
|
|
2446
|
+
});
|
|
2447
|
+
const legacyProcedureType = legacyProcedureObject.rows[0]?.type == null ? null : String(legacyProcedureObject.rows[0].type);
|
|
2448
|
+
if (legacyProcedureType === "table") {
|
|
2449
|
+
await client.execute(`
|
|
2450
|
+
INSERT OR IGNORE INTO company_procedures
|
|
2451
|
+
(id, title, content, priority, domain, active, created_at, updated_at)
|
|
2452
|
+
SELECT id, title, content, priority, domain, active, created_at, updated_at
|
|
2453
|
+
FROM global_procedures
|
|
2454
|
+
`);
|
|
2455
|
+
await client.executeMultiple(`
|
|
2456
|
+
CREATE TRIGGER IF NOT EXISTS global_procedures_mirror_insert
|
|
2457
|
+
AFTER INSERT ON global_procedures
|
|
2458
|
+
BEGIN
|
|
2459
|
+
INSERT OR IGNORE INTO company_procedures
|
|
2460
|
+
(id, title, content, priority, domain, active, created_at, updated_at)
|
|
2461
|
+
VALUES
|
|
2462
|
+
(NEW.id, NEW.title, NEW.content, NEW.priority, NEW.domain, NEW.active, NEW.created_at, NEW.updated_at);
|
|
2463
|
+
END;
|
|
2464
|
+
|
|
2465
|
+
CREATE TRIGGER IF NOT EXISTS global_procedures_mirror_update
|
|
2466
|
+
AFTER UPDATE ON global_procedures
|
|
2467
|
+
BEGIN
|
|
2468
|
+
UPDATE company_procedures
|
|
2469
|
+
SET title = NEW.title,
|
|
2470
|
+
content = NEW.content,
|
|
2471
|
+
priority = NEW.priority,
|
|
2472
|
+
domain = NEW.domain,
|
|
2473
|
+
active = NEW.active,
|
|
2474
|
+
created_at = NEW.created_at,
|
|
2475
|
+
updated_at = NEW.updated_at
|
|
2476
|
+
WHERE id = OLD.id;
|
|
2477
|
+
END;
|
|
2478
|
+
`);
|
|
2479
|
+
} else {
|
|
2480
|
+
await client.execute(`
|
|
2481
|
+
CREATE VIEW IF NOT EXISTS global_procedures AS
|
|
2482
|
+
SELECT id, title, content, priority, domain, active, created_at, updated_at
|
|
2483
|
+
FROM company_procedures
|
|
2484
|
+
`);
|
|
2485
|
+
await client.executeMultiple(`
|
|
2486
|
+
CREATE TRIGGER IF NOT EXISTS global_procedures_insert
|
|
2487
|
+
INSTEAD OF INSERT ON global_procedures
|
|
2488
|
+
BEGIN
|
|
2489
|
+
INSERT INTO company_procedures
|
|
2490
|
+
(id, title, content, priority, domain, active, created_at, updated_at)
|
|
2491
|
+
VALUES
|
|
2492
|
+
(NEW.id, NEW.title, NEW.content, NEW.priority, NEW.domain, NEW.active, NEW.created_at, NEW.updated_at);
|
|
2493
|
+
END;
|
|
2494
|
+
|
|
2495
|
+
CREATE TRIGGER IF NOT EXISTS global_procedures_update
|
|
2496
|
+
INSTEAD OF UPDATE ON global_procedures
|
|
2497
|
+
BEGIN
|
|
2498
|
+
UPDATE company_procedures
|
|
2499
|
+
SET title = NEW.title,
|
|
2500
|
+
content = NEW.content,
|
|
2501
|
+
priority = NEW.priority,
|
|
2502
|
+
domain = NEW.domain,
|
|
2503
|
+
active = NEW.active,
|
|
2504
|
+
created_at = NEW.created_at,
|
|
2505
|
+
updated_at = NEW.updated_at
|
|
2506
|
+
WHERE id = OLD.id;
|
|
2507
|
+
END;
|
|
2508
|
+
`);
|
|
2509
|
+
}
|
|
2443
2510
|
await client.executeMultiple(`
|
|
2444
2511
|
CREATE TABLE IF NOT EXISTS conversations (
|
|
2445
2512
|
id TEXT PRIMARY KEY,
|
|
@@ -3316,7 +3383,7 @@ var init_platform_procedures = __esm({
|
|
|
3316
3383
|
title: "MCP tools \u2014 advanced (triggers, skills, orchestration)",
|
|
3317
3384
|
domain: "tool-use",
|
|
3318
3385
|
priority: "p1",
|
|
3319
|
-
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.
|
|
3386
|
+
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."
|
|
3320
3387
|
}
|
|
3321
3388
|
];
|
|
3322
3389
|
PLATFORM_PROCEDURE_TITLES = new Set(
|
|
@@ -3337,7 +3404,7 @@ import { randomUUID as randomUUID2 } from "crypto";
|
|
|
3337
3404
|
async function loadGlobalProcedures() {
|
|
3338
3405
|
const client = getClient();
|
|
3339
3406
|
const result = await client.execute({
|
|
3340
|
-
sql: "SELECT * FROM
|
|
3407
|
+
sql: "SELECT * FROM company_procedures WHERE active = 1 ORDER BY priority ASC, created_at ASC",
|
|
3341
3408
|
args: []
|
|
3342
3409
|
});
|
|
3343
3410
|
const allRows = result.rows;
|
|
@@ -3366,7 +3433,7 @@ async function storeGlobalProcedure(input) {
|
|
|
3366
3433
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
3367
3434
|
const client = getClient();
|
|
3368
3435
|
await client.execute({
|
|
3369
|
-
sql: `INSERT INTO
|
|
3436
|
+
sql: `INSERT INTO company_procedures (id, title, content, priority, domain, active, created_at, updated_at)
|
|
3370
3437
|
VALUES (?, ?, ?, ?, ?, 1, ?, ?)`,
|
|
3371
3438
|
args: [id, input.title, input.content, input.priority ?? "p0", input.domain ?? null, now, now]
|
|
3372
3439
|
});
|
|
@@ -3377,7 +3444,7 @@ async function deactivateGlobalProcedure(id) {
|
|
|
3377
3444
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
3378
3445
|
const client = getClient();
|
|
3379
3446
|
const result = await client.execute({
|
|
3380
|
-
sql: "UPDATE
|
|
3447
|
+
sql: "UPDATE company_procedures SET active = 0, updated_at = ? WHERE id = ?",
|
|
3381
3448
|
args: [now, id]
|
|
3382
3449
|
});
|
|
3383
3450
|
await loadGlobalProcedures();
|
|
@@ -2425,7 +2425,7 @@ async function ensureSchema() {
|
|
|
2425
2425
|
ON session_kills(agent_id);
|
|
2426
2426
|
`);
|
|
2427
2427
|
await client.execute(`
|
|
2428
|
-
CREATE TABLE IF NOT EXISTS
|
|
2428
|
+
CREATE TABLE IF NOT EXISTS company_procedures (
|
|
2429
2429
|
id TEXT PRIMARY KEY,
|
|
2430
2430
|
title TEXT NOT NULL,
|
|
2431
2431
|
content TEXT NOT NULL,
|
|
@@ -2436,6 +2436,73 @@ async function ensureSchema() {
|
|
|
2436
2436
|
updated_at TEXT NOT NULL
|
|
2437
2437
|
)
|
|
2438
2438
|
`);
|
|
2439
|
+
const legacyProcedureObject = await client.execute({
|
|
2440
|
+
sql: "SELECT type FROM sqlite_master WHERE name = 'global_procedures'",
|
|
2441
|
+
args: []
|
|
2442
|
+
});
|
|
2443
|
+
const legacyProcedureType = legacyProcedureObject.rows[0]?.type == null ? null : String(legacyProcedureObject.rows[0].type);
|
|
2444
|
+
if (legacyProcedureType === "table") {
|
|
2445
|
+
await client.execute(`
|
|
2446
|
+
INSERT OR IGNORE INTO company_procedures
|
|
2447
|
+
(id, title, content, priority, domain, active, created_at, updated_at)
|
|
2448
|
+
SELECT id, title, content, priority, domain, active, created_at, updated_at
|
|
2449
|
+
FROM global_procedures
|
|
2450
|
+
`);
|
|
2451
|
+
await client.executeMultiple(`
|
|
2452
|
+
CREATE TRIGGER IF NOT EXISTS global_procedures_mirror_insert
|
|
2453
|
+
AFTER INSERT ON global_procedures
|
|
2454
|
+
BEGIN
|
|
2455
|
+
INSERT OR IGNORE INTO company_procedures
|
|
2456
|
+
(id, title, content, priority, domain, active, created_at, updated_at)
|
|
2457
|
+
VALUES
|
|
2458
|
+
(NEW.id, NEW.title, NEW.content, NEW.priority, NEW.domain, NEW.active, NEW.created_at, NEW.updated_at);
|
|
2459
|
+
END;
|
|
2460
|
+
|
|
2461
|
+
CREATE TRIGGER IF NOT EXISTS global_procedures_mirror_update
|
|
2462
|
+
AFTER UPDATE ON global_procedures
|
|
2463
|
+
BEGIN
|
|
2464
|
+
UPDATE company_procedures
|
|
2465
|
+
SET title = NEW.title,
|
|
2466
|
+
content = NEW.content,
|
|
2467
|
+
priority = NEW.priority,
|
|
2468
|
+
domain = NEW.domain,
|
|
2469
|
+
active = NEW.active,
|
|
2470
|
+
created_at = NEW.created_at,
|
|
2471
|
+
updated_at = NEW.updated_at
|
|
2472
|
+
WHERE id = OLD.id;
|
|
2473
|
+
END;
|
|
2474
|
+
`);
|
|
2475
|
+
} else {
|
|
2476
|
+
await client.execute(`
|
|
2477
|
+
CREATE VIEW IF NOT EXISTS global_procedures AS
|
|
2478
|
+
SELECT id, title, content, priority, domain, active, created_at, updated_at
|
|
2479
|
+
FROM company_procedures
|
|
2480
|
+
`);
|
|
2481
|
+
await client.executeMultiple(`
|
|
2482
|
+
CREATE TRIGGER IF NOT EXISTS global_procedures_insert
|
|
2483
|
+
INSTEAD OF INSERT ON global_procedures
|
|
2484
|
+
BEGIN
|
|
2485
|
+
INSERT INTO company_procedures
|
|
2486
|
+
(id, title, content, priority, domain, active, created_at, updated_at)
|
|
2487
|
+
VALUES
|
|
2488
|
+
(NEW.id, NEW.title, NEW.content, NEW.priority, NEW.domain, NEW.active, NEW.created_at, NEW.updated_at);
|
|
2489
|
+
END;
|
|
2490
|
+
|
|
2491
|
+
CREATE TRIGGER IF NOT EXISTS global_procedures_update
|
|
2492
|
+
INSTEAD OF UPDATE ON global_procedures
|
|
2493
|
+
BEGIN
|
|
2494
|
+
UPDATE company_procedures
|
|
2495
|
+
SET title = NEW.title,
|
|
2496
|
+
content = NEW.content,
|
|
2497
|
+
priority = NEW.priority,
|
|
2498
|
+
domain = NEW.domain,
|
|
2499
|
+
active = NEW.active,
|
|
2500
|
+
created_at = NEW.created_at,
|
|
2501
|
+
updated_at = NEW.updated_at
|
|
2502
|
+
WHERE id = OLD.id;
|
|
2503
|
+
END;
|
|
2504
|
+
`);
|
|
2505
|
+
}
|
|
2439
2506
|
await client.executeMultiple(`
|
|
2440
2507
|
CREATE TABLE IF NOT EXISTS conversations (
|
|
2441
2508
|
id TEXT PRIMARY KEY,
|
|
@@ -3312,7 +3379,7 @@ var init_platform_procedures = __esm({
|
|
|
3312
3379
|
title: "MCP tools \u2014 advanced (triggers, skills, orchestration)",
|
|
3313
3380
|
domain: "tool-use",
|
|
3314
3381
|
priority: "p1",
|
|
3315
|
-
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.
|
|
3382
|
+
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."
|
|
3316
3383
|
}
|
|
3317
3384
|
];
|
|
3318
3385
|
PLATFORM_PROCEDURE_TITLES = new Set(
|
|
@@ -3333,7 +3400,7 @@ import { randomUUID as randomUUID2 } from "crypto";
|
|
|
3333
3400
|
async function loadGlobalProcedures() {
|
|
3334
3401
|
const client = getClient();
|
|
3335
3402
|
const result = await client.execute({
|
|
3336
|
-
sql: "SELECT * FROM
|
|
3403
|
+
sql: "SELECT * FROM company_procedures WHERE active = 1 ORDER BY priority ASC, created_at ASC",
|
|
3337
3404
|
args: []
|
|
3338
3405
|
});
|
|
3339
3406
|
const allRows = result.rows;
|
|
@@ -3362,7 +3429,7 @@ async function storeGlobalProcedure(input) {
|
|
|
3362
3429
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
3363
3430
|
const client = getClient();
|
|
3364
3431
|
await client.execute({
|
|
3365
|
-
sql: `INSERT INTO
|
|
3432
|
+
sql: `INSERT INTO company_procedures (id, title, content, priority, domain, active, created_at, updated_at)
|
|
3366
3433
|
VALUES (?, ?, ?, ?, ?, 1, ?, ?)`,
|
|
3367
3434
|
args: [id, input.title, input.content, input.priority ?? "p0", input.domain ?? null, now, now]
|
|
3368
3435
|
});
|
|
@@ -3373,7 +3440,7 @@ async function deactivateGlobalProcedure(id) {
|
|
|
3373
3440
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
3374
3441
|
const client = getClient();
|
|
3375
3442
|
const result = await client.execute({
|
|
3376
|
-
sql: "UPDATE
|
|
3443
|
+
sql: "UPDATE company_procedures SET active = 0, updated_at = ? WHERE id = ?",
|
|
3377
3444
|
args: [now, id]
|
|
3378
3445
|
});
|
|
3379
3446
|
await loadGlobalProcedures();
|