@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
package/dist/bin/exe-link.js
CHANGED
|
@@ -2779,7 +2779,7 @@ async function ensureSchema() {
|
|
|
2779
2779
|
ON session_kills(agent_id);
|
|
2780
2780
|
`);
|
|
2781
2781
|
await client.execute(`
|
|
2782
|
-
CREATE TABLE IF NOT EXISTS
|
|
2782
|
+
CREATE TABLE IF NOT EXISTS company_procedures (
|
|
2783
2783
|
id TEXT PRIMARY KEY,
|
|
2784
2784
|
title TEXT NOT NULL,
|
|
2785
2785
|
content TEXT NOT NULL,
|
|
@@ -2790,6 +2790,73 @@ async function ensureSchema() {
|
|
|
2790
2790
|
updated_at TEXT NOT NULL
|
|
2791
2791
|
)
|
|
2792
2792
|
`);
|
|
2793
|
+
const legacyProcedureObject = await client.execute({
|
|
2794
|
+
sql: "SELECT type FROM sqlite_master WHERE name = 'global_procedures'",
|
|
2795
|
+
args: []
|
|
2796
|
+
});
|
|
2797
|
+
const legacyProcedureType = legacyProcedureObject.rows[0]?.type == null ? null : String(legacyProcedureObject.rows[0].type);
|
|
2798
|
+
if (legacyProcedureType === "table") {
|
|
2799
|
+
await client.execute(`
|
|
2800
|
+
INSERT OR IGNORE INTO company_procedures
|
|
2801
|
+
(id, title, content, priority, domain, active, created_at, updated_at)
|
|
2802
|
+
SELECT id, title, content, priority, domain, active, created_at, updated_at
|
|
2803
|
+
FROM global_procedures
|
|
2804
|
+
`);
|
|
2805
|
+
await client.executeMultiple(`
|
|
2806
|
+
CREATE TRIGGER IF NOT EXISTS global_procedures_mirror_insert
|
|
2807
|
+
AFTER INSERT ON global_procedures
|
|
2808
|
+
BEGIN
|
|
2809
|
+
INSERT OR IGNORE INTO company_procedures
|
|
2810
|
+
(id, title, content, priority, domain, active, created_at, updated_at)
|
|
2811
|
+
VALUES
|
|
2812
|
+
(NEW.id, NEW.title, NEW.content, NEW.priority, NEW.domain, NEW.active, NEW.created_at, NEW.updated_at);
|
|
2813
|
+
END;
|
|
2814
|
+
|
|
2815
|
+
CREATE TRIGGER IF NOT EXISTS global_procedures_mirror_update
|
|
2816
|
+
AFTER UPDATE ON global_procedures
|
|
2817
|
+
BEGIN
|
|
2818
|
+
UPDATE company_procedures
|
|
2819
|
+
SET title = NEW.title,
|
|
2820
|
+
content = NEW.content,
|
|
2821
|
+
priority = NEW.priority,
|
|
2822
|
+
domain = NEW.domain,
|
|
2823
|
+
active = NEW.active,
|
|
2824
|
+
created_at = NEW.created_at,
|
|
2825
|
+
updated_at = NEW.updated_at
|
|
2826
|
+
WHERE id = OLD.id;
|
|
2827
|
+
END;
|
|
2828
|
+
`);
|
|
2829
|
+
} else {
|
|
2830
|
+
await client.execute(`
|
|
2831
|
+
CREATE VIEW IF NOT EXISTS global_procedures AS
|
|
2832
|
+
SELECT id, title, content, priority, domain, active, created_at, updated_at
|
|
2833
|
+
FROM company_procedures
|
|
2834
|
+
`);
|
|
2835
|
+
await client.executeMultiple(`
|
|
2836
|
+
CREATE TRIGGER IF NOT EXISTS global_procedures_insert
|
|
2837
|
+
INSTEAD OF INSERT ON global_procedures
|
|
2838
|
+
BEGIN
|
|
2839
|
+
INSERT INTO company_procedures
|
|
2840
|
+
(id, title, content, priority, domain, active, created_at, updated_at)
|
|
2841
|
+
VALUES
|
|
2842
|
+
(NEW.id, NEW.title, NEW.content, NEW.priority, NEW.domain, NEW.active, NEW.created_at, NEW.updated_at);
|
|
2843
|
+
END;
|
|
2844
|
+
|
|
2845
|
+
CREATE TRIGGER IF NOT EXISTS global_procedures_update
|
|
2846
|
+
INSTEAD OF UPDATE ON global_procedures
|
|
2847
|
+
BEGIN
|
|
2848
|
+
UPDATE company_procedures
|
|
2849
|
+
SET title = NEW.title,
|
|
2850
|
+
content = NEW.content,
|
|
2851
|
+
priority = NEW.priority,
|
|
2852
|
+
domain = NEW.domain,
|
|
2853
|
+
active = NEW.active,
|
|
2854
|
+
created_at = NEW.created_at,
|
|
2855
|
+
updated_at = NEW.updated_at
|
|
2856
|
+
WHERE id = OLD.id;
|
|
2857
|
+
END;
|
|
2858
|
+
`);
|
|
2859
|
+
}
|
|
2793
2860
|
await client.executeMultiple(`
|
|
2794
2861
|
CREATE TABLE IF NOT EXISTS conversations (
|
|
2795
2862
|
id TEXT PRIMARY KEY,
|
|
@@ -3892,12 +3959,12 @@ async function cloudSync(config) {
|
|
|
3892
3959
|
try {
|
|
3893
3960
|
await cloudPushGlobalProcedures(config);
|
|
3894
3961
|
} catch (err) {
|
|
3895
|
-
logError(`[cloud-sync]
|
|
3962
|
+
logError(`[cloud-sync] Company procedures push: ${err instanceof Error ? err.message : String(err)}`);
|
|
3896
3963
|
}
|
|
3897
3964
|
try {
|
|
3898
3965
|
await cloudPullGlobalProcedures(config);
|
|
3899
3966
|
} catch (err) {
|
|
3900
|
-
logError(`[cloud-sync]
|
|
3967
|
+
logError(`[cloud-sync] Company procedures pull: ${err instanceof Error ? err.message : String(err)}`);
|
|
3901
3968
|
}
|
|
3902
3969
|
const countRows = async (sql) => {
|
|
3903
3970
|
try {
|
|
@@ -4306,12 +4373,12 @@ async function cloudPullBlob(route, config) {
|
|
|
4306
4373
|
}
|
|
4307
4374
|
async function cloudPushGlobalProcedures(config) {
|
|
4308
4375
|
const client = getClient();
|
|
4309
|
-
const result = await client.execute("SELECT * FROM
|
|
4376
|
+
const result = await client.execute("SELECT * FROM company_procedures LIMIT 1000");
|
|
4310
4377
|
const rows = result.rows;
|
|
4311
4378
|
const { ok } = await cloudPushBlob(
|
|
4312
4379
|
"/sync/push-global-procedures",
|
|
4313
4380
|
rows,
|
|
4314
|
-
"
|
|
4381
|
+
"last_company_procedures_push_version",
|
|
4315
4382
|
config
|
|
4316
4383
|
);
|
|
4317
4384
|
return ok;
|
|
@@ -4324,7 +4391,7 @@ async function cloudPullGlobalProcedures(config) {
|
|
|
4324
4391
|
if (!remoteProcs || remoteProcs.length === 0) return { pulled: 0 };
|
|
4325
4392
|
const client = getClient();
|
|
4326
4393
|
const stmts = remoteProcs.map((p) => ({
|
|
4327
|
-
sql: `INSERT INTO
|
|
4394
|
+
sql: `INSERT INTO company_procedures
|
|
4328
4395
|
(id, title, content, priority, domain, active, created_at, updated_at)
|
|
4329
4396
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
|
4330
4397
|
ON CONFLICT(id) DO UPDATE SET
|
|
@@ -4334,7 +4401,7 @@ async function cloudPullGlobalProcedures(config) {
|
|
|
4334
4401
|
domain = excluded.domain,
|
|
4335
4402
|
active = excluded.active,
|
|
4336
4403
|
updated_at = excluded.updated_at
|
|
4337
|
-
WHERE excluded.updated_at >
|
|
4404
|
+
WHERE excluded.updated_at > company_procedures.updated_at`,
|
|
4338
4405
|
args: [
|
|
4339
4406
|
sqlSafe(p.id),
|
|
4340
4407
|
sqlSafe(p.title),
|
|
@@ -1257,6 +1257,39 @@ var init_preferences = __esm({
|
|
|
1257
1257
|
}
|
|
1258
1258
|
});
|
|
1259
1259
|
|
|
1260
|
+
// src/adapters/runtime-hook-manifest.ts
|
|
1261
|
+
function commandHasAnyMarker(command, markers) {
|
|
1262
|
+
return markers.some((marker) => command.includes(marker));
|
|
1263
|
+
}
|
|
1264
|
+
function isLegacySplitPostToolCommand(command) {
|
|
1265
|
+
return commandHasAnyMarker(command, LEGACY_SPLIT_POST_TOOL_HOOK_MARKERS);
|
|
1266
|
+
}
|
|
1267
|
+
var EXE_HOOKS, LEGACY_SPLIT_POST_TOOL_HOOK_MARKERS;
|
|
1268
|
+
var init_runtime_hook_manifest = __esm({
|
|
1269
|
+
"src/adapters/runtime-hook-manifest.ts"() {
|
|
1270
|
+
"use strict";
|
|
1271
|
+
EXE_HOOKS = {
|
|
1272
|
+
postToolCombined: "dist/hooks/post-tool-combined.js",
|
|
1273
|
+
sessionStart: "dist/hooks/session-start.js",
|
|
1274
|
+
promptSubmit: "dist/hooks/prompt-submit.js",
|
|
1275
|
+
heartbeat: "dist/hooks/exe-heartbeat-hook.js",
|
|
1276
|
+
stop: "dist/hooks/stop.js",
|
|
1277
|
+
preToolUse: "dist/hooks/pre-tool-use.js",
|
|
1278
|
+
subagentStop: "dist/hooks/subagent-stop.js",
|
|
1279
|
+
preCompact: "dist/hooks/pre-compact.js",
|
|
1280
|
+
postCompact: "dist/hooks/post-compact.js",
|
|
1281
|
+
sessionEnd: "dist/hooks/session-end.js",
|
|
1282
|
+
notification: "dist/hooks/notification.js",
|
|
1283
|
+
instructionsLoaded: "dist/hooks/instructions-loaded.js"
|
|
1284
|
+
};
|
|
1285
|
+
LEGACY_SPLIT_POST_TOOL_HOOK_MARKERS = [
|
|
1286
|
+
"dist/hooks/ingest.js",
|
|
1287
|
+
"dist/hooks/error-recall.js",
|
|
1288
|
+
"dist/hooks/ingest-worker.js"
|
|
1289
|
+
];
|
|
1290
|
+
}
|
|
1291
|
+
});
|
|
1292
|
+
|
|
1260
1293
|
// src/adapters/claude/installer.ts
|
|
1261
1294
|
var installer_exports = {};
|
|
1262
1295
|
__export(installer_exports, {
|
|
@@ -1579,7 +1612,7 @@ async function mergeHooks(packageRoot, homeDir = os7.homedir()) {
|
|
|
1579
1612
|
}
|
|
1580
1613
|
]
|
|
1581
1614
|
},
|
|
1582
|
-
marker:
|
|
1615
|
+
marker: EXE_HOOKS.postToolCombined
|
|
1583
1616
|
},
|
|
1584
1617
|
{
|
|
1585
1618
|
event: "SessionStart",
|
|
@@ -1592,7 +1625,7 @@ async function mergeHooks(packageRoot, homeDir = os7.homedir()) {
|
|
|
1592
1625
|
}
|
|
1593
1626
|
]
|
|
1594
1627
|
},
|
|
1595
|
-
marker:
|
|
1628
|
+
marker: EXE_HOOKS.sessionStart
|
|
1596
1629
|
},
|
|
1597
1630
|
{
|
|
1598
1631
|
event: "UserPromptSubmit",
|
|
@@ -1604,7 +1637,7 @@ async function mergeHooks(packageRoot, homeDir = os7.homedir()) {
|
|
|
1604
1637
|
}
|
|
1605
1638
|
]
|
|
1606
1639
|
},
|
|
1607
|
-
marker:
|
|
1640
|
+
marker: EXE_HOOKS.promptSubmit
|
|
1608
1641
|
},
|
|
1609
1642
|
{
|
|
1610
1643
|
event: "UserPromptSubmit",
|
|
@@ -1617,7 +1650,7 @@ async function mergeHooks(packageRoot, homeDir = os7.homedir()) {
|
|
|
1617
1650
|
}
|
|
1618
1651
|
]
|
|
1619
1652
|
},
|
|
1620
|
-
marker:
|
|
1653
|
+
marker: EXE_HOOKS.heartbeat
|
|
1621
1654
|
},
|
|
1622
1655
|
{
|
|
1623
1656
|
event: "Stop",
|
|
@@ -1629,7 +1662,7 @@ async function mergeHooks(packageRoot, homeDir = os7.homedir()) {
|
|
|
1629
1662
|
}
|
|
1630
1663
|
]
|
|
1631
1664
|
},
|
|
1632
|
-
marker:
|
|
1665
|
+
marker: EXE_HOOKS.stop
|
|
1633
1666
|
},
|
|
1634
1667
|
{
|
|
1635
1668
|
event: "PreToolUse",
|
|
@@ -1642,7 +1675,7 @@ async function mergeHooks(packageRoot, homeDir = os7.homedir()) {
|
|
|
1642
1675
|
}
|
|
1643
1676
|
]
|
|
1644
1677
|
},
|
|
1645
|
-
marker:
|
|
1678
|
+
marker: EXE_HOOKS.preToolUse
|
|
1646
1679
|
},
|
|
1647
1680
|
{
|
|
1648
1681
|
event: "SubagentStop",
|
|
@@ -1654,7 +1687,7 @@ async function mergeHooks(packageRoot, homeDir = os7.homedir()) {
|
|
|
1654
1687
|
}
|
|
1655
1688
|
]
|
|
1656
1689
|
},
|
|
1657
|
-
marker:
|
|
1690
|
+
marker: EXE_HOOKS.subagentStop
|
|
1658
1691
|
},
|
|
1659
1692
|
{
|
|
1660
1693
|
event: "PreCompact",
|
|
@@ -1667,7 +1700,7 @@ async function mergeHooks(packageRoot, homeDir = os7.homedir()) {
|
|
|
1667
1700
|
}
|
|
1668
1701
|
]
|
|
1669
1702
|
},
|
|
1670
|
-
marker:
|
|
1703
|
+
marker: EXE_HOOKS.preCompact
|
|
1671
1704
|
},
|
|
1672
1705
|
{
|
|
1673
1706
|
event: "SessionEnd",
|
|
@@ -1679,7 +1712,7 @@ async function mergeHooks(packageRoot, homeDir = os7.homedir()) {
|
|
|
1679
1712
|
}
|
|
1680
1713
|
]
|
|
1681
1714
|
},
|
|
1682
|
-
marker:
|
|
1715
|
+
marker: EXE_HOOKS.sessionEnd
|
|
1683
1716
|
},
|
|
1684
1717
|
{
|
|
1685
1718
|
event: "Notification",
|
|
@@ -1691,7 +1724,7 @@ async function mergeHooks(packageRoot, homeDir = os7.homedir()) {
|
|
|
1691
1724
|
}
|
|
1692
1725
|
]
|
|
1693
1726
|
},
|
|
1694
|
-
marker:
|
|
1727
|
+
marker: EXE_HOOKS.notification
|
|
1695
1728
|
},
|
|
1696
1729
|
{
|
|
1697
1730
|
event: "PostCompact",
|
|
@@ -1704,7 +1737,7 @@ async function mergeHooks(packageRoot, homeDir = os7.homedir()) {
|
|
|
1704
1737
|
}
|
|
1705
1738
|
]
|
|
1706
1739
|
},
|
|
1707
|
-
marker:
|
|
1740
|
+
marker: EXE_HOOKS.postCompact
|
|
1708
1741
|
},
|
|
1709
1742
|
{
|
|
1710
1743
|
event: "InstructionsLoaded",
|
|
@@ -1716,21 +1749,16 @@ async function mergeHooks(packageRoot, homeDir = os7.homedir()) {
|
|
|
1716
1749
|
}
|
|
1717
1750
|
]
|
|
1718
1751
|
},
|
|
1719
|
-
marker:
|
|
1752
|
+
marker: EXE_HOOKS.instructionsLoaded
|
|
1720
1753
|
}
|
|
1721
1754
|
];
|
|
1722
1755
|
let added = 0;
|
|
1723
1756
|
let skipped = 0;
|
|
1724
|
-
const legacyPostToolMarkers = [
|
|
1725
|
-
"dist/hooks/ingest.js",
|
|
1726
|
-
"dist/hooks/error-recall.js",
|
|
1727
|
-
"dist/hooks/ingest-worker.js"
|
|
1728
|
-
];
|
|
1729
1757
|
const postToolGroups = settings.hooks["PostToolUse"];
|
|
1730
1758
|
if (Array.isArray(postToolGroups)) {
|
|
1731
1759
|
settings.hooks["PostToolUse"] = postToolGroups.map((g) => ({
|
|
1732
1760
|
...g,
|
|
1733
|
-
hooks: g.hooks.filter((h) => !
|
|
1761
|
+
hooks: g.hooks.filter((h) => !isLegacySplitPostToolCommand(h.command))
|
|
1734
1762
|
})).filter((g) => g.hooks.length > 0);
|
|
1735
1763
|
}
|
|
1736
1764
|
for (const { event, group, marker } of hooksToRegister) {
|
|
@@ -2207,6 +2235,7 @@ var init_installer = __esm({
|
|
|
2207
2235
|
init_agent_symlinks();
|
|
2208
2236
|
init_mcp_prefix();
|
|
2209
2237
|
init_preferences();
|
|
2238
|
+
init_runtime_hook_manifest();
|
|
2210
2239
|
EXE_SECTION_START = "<!-- exe-os:orchestration-start -->";
|
|
2211
2240
|
EXE_SECTION_END = "<!-- exe-os:orchestration-end -->";
|
|
2212
2241
|
ORCHESTRATION_RULES = `${EXE_SECTION_START}
|
|
@@ -2536,7 +2565,7 @@ var PLATFORM_PROCEDURES = [
|
|
|
2536
2565
|
title: "MCP tools \u2014 advanced (triggers, skills, orchestration)",
|
|
2537
2566
|
domain: "tool-use",
|
|
2538
2567
|
priority: "p1",
|
|
2539
|
-
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.
|
|
2568
|
+
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."
|
|
2540
2569
|
}
|
|
2541
2570
|
];
|
|
2542
2571
|
var PLATFORM_PROCEDURE_TITLES = new Set(
|
|
@@ -2514,7 +2514,7 @@ async function ensureSchema() {
|
|
|
2514
2514
|
ON session_kills(agent_id);
|
|
2515
2515
|
`);
|
|
2516
2516
|
await client.execute(`
|
|
2517
|
-
CREATE TABLE IF NOT EXISTS
|
|
2517
|
+
CREATE TABLE IF NOT EXISTS company_procedures (
|
|
2518
2518
|
id TEXT PRIMARY KEY,
|
|
2519
2519
|
title TEXT NOT NULL,
|
|
2520
2520
|
content TEXT NOT NULL,
|
|
@@ -2525,6 +2525,73 @@ async function ensureSchema() {
|
|
|
2525
2525
|
updated_at TEXT NOT NULL
|
|
2526
2526
|
)
|
|
2527
2527
|
`);
|
|
2528
|
+
const legacyProcedureObject = await client.execute({
|
|
2529
|
+
sql: "SELECT type FROM sqlite_master WHERE name = 'global_procedures'",
|
|
2530
|
+
args: []
|
|
2531
|
+
});
|
|
2532
|
+
const legacyProcedureType = legacyProcedureObject.rows[0]?.type == null ? null : String(legacyProcedureObject.rows[0].type);
|
|
2533
|
+
if (legacyProcedureType === "table") {
|
|
2534
|
+
await client.execute(`
|
|
2535
|
+
INSERT OR IGNORE INTO company_procedures
|
|
2536
|
+
(id, title, content, priority, domain, active, created_at, updated_at)
|
|
2537
|
+
SELECT id, title, content, priority, domain, active, created_at, updated_at
|
|
2538
|
+
FROM global_procedures
|
|
2539
|
+
`);
|
|
2540
|
+
await client.executeMultiple(`
|
|
2541
|
+
CREATE TRIGGER IF NOT EXISTS global_procedures_mirror_insert
|
|
2542
|
+
AFTER INSERT ON global_procedures
|
|
2543
|
+
BEGIN
|
|
2544
|
+
INSERT OR IGNORE INTO company_procedures
|
|
2545
|
+
(id, title, content, priority, domain, active, created_at, updated_at)
|
|
2546
|
+
VALUES
|
|
2547
|
+
(NEW.id, NEW.title, NEW.content, NEW.priority, NEW.domain, NEW.active, NEW.created_at, NEW.updated_at);
|
|
2548
|
+
END;
|
|
2549
|
+
|
|
2550
|
+
CREATE TRIGGER IF NOT EXISTS global_procedures_mirror_update
|
|
2551
|
+
AFTER UPDATE ON global_procedures
|
|
2552
|
+
BEGIN
|
|
2553
|
+
UPDATE company_procedures
|
|
2554
|
+
SET title = NEW.title,
|
|
2555
|
+
content = NEW.content,
|
|
2556
|
+
priority = NEW.priority,
|
|
2557
|
+
domain = NEW.domain,
|
|
2558
|
+
active = NEW.active,
|
|
2559
|
+
created_at = NEW.created_at,
|
|
2560
|
+
updated_at = NEW.updated_at
|
|
2561
|
+
WHERE id = OLD.id;
|
|
2562
|
+
END;
|
|
2563
|
+
`);
|
|
2564
|
+
} else {
|
|
2565
|
+
await client.execute(`
|
|
2566
|
+
CREATE VIEW IF NOT EXISTS global_procedures AS
|
|
2567
|
+
SELECT id, title, content, priority, domain, active, created_at, updated_at
|
|
2568
|
+
FROM company_procedures
|
|
2569
|
+
`);
|
|
2570
|
+
await client.executeMultiple(`
|
|
2571
|
+
CREATE TRIGGER IF NOT EXISTS global_procedures_insert
|
|
2572
|
+
INSTEAD OF INSERT ON global_procedures
|
|
2573
|
+
BEGIN
|
|
2574
|
+
INSERT INTO company_procedures
|
|
2575
|
+
(id, title, content, priority, domain, active, created_at, updated_at)
|
|
2576
|
+
VALUES
|
|
2577
|
+
(NEW.id, NEW.title, NEW.content, NEW.priority, NEW.domain, NEW.active, NEW.created_at, NEW.updated_at);
|
|
2578
|
+
END;
|
|
2579
|
+
|
|
2580
|
+
CREATE TRIGGER IF NOT EXISTS global_procedures_update
|
|
2581
|
+
INSTEAD OF UPDATE ON global_procedures
|
|
2582
|
+
BEGIN
|
|
2583
|
+
UPDATE company_procedures
|
|
2584
|
+
SET title = NEW.title,
|
|
2585
|
+
content = NEW.content,
|
|
2586
|
+
priority = NEW.priority,
|
|
2587
|
+
domain = NEW.domain,
|
|
2588
|
+
active = NEW.active,
|
|
2589
|
+
created_at = NEW.created_at,
|
|
2590
|
+
updated_at = NEW.updated_at
|
|
2591
|
+
WHERE id = OLD.id;
|
|
2592
|
+
END;
|
|
2593
|
+
`);
|
|
2594
|
+
}
|
|
2528
2595
|
await client.executeMultiple(`
|
|
2529
2596
|
CREATE TABLE IF NOT EXISTS conversations (
|
|
2530
2597
|
id TEXT PRIMARY KEY,
|
|
@@ -4300,7 +4367,7 @@ var init_platform_procedures = __esm({
|
|
|
4300
4367
|
title: "MCP tools \u2014 advanced (triggers, skills, orchestration)",
|
|
4301
4368
|
domain: "tool-use",
|
|
4302
4369
|
priority: "p1",
|
|
4303
|
-
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.
|
|
4370
|
+
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."
|
|
4304
4371
|
}
|
|
4305
4372
|
];
|
|
4306
4373
|
PLATFORM_PROCEDURE_TITLES = new Set(
|
|
@@ -4321,7 +4388,7 @@ import { randomUUID as randomUUID3 } from "crypto";
|
|
|
4321
4388
|
async function loadGlobalProcedures() {
|
|
4322
4389
|
const client = getClient();
|
|
4323
4390
|
const result = await client.execute({
|
|
4324
|
-
sql: "SELECT * FROM
|
|
4391
|
+
sql: "SELECT * FROM company_procedures WHERE active = 1 ORDER BY priority ASC, created_at ASC",
|
|
4325
4392
|
args: []
|
|
4326
4393
|
});
|
|
4327
4394
|
const allRows = result.rows;
|
|
@@ -4350,7 +4417,7 @@ async function storeGlobalProcedure(input) {
|
|
|
4350
4417
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
4351
4418
|
const client = getClient();
|
|
4352
4419
|
await client.execute({
|
|
4353
|
-
sql: `INSERT INTO
|
|
4420
|
+
sql: `INSERT INTO company_procedures (id, title, content, priority, domain, active, created_at, updated_at)
|
|
4354
4421
|
VALUES (?, ?, ?, ?, ?, 1, ?, ?)`,
|
|
4355
4422
|
args: [id, input.title, input.content, input.priority ?? "p0", input.domain ?? null, now, now]
|
|
4356
4423
|
});
|
|
@@ -4361,7 +4428,7 @@ async function deactivateGlobalProcedure(id) {
|
|
|
4361
4428
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
4362
4429
|
const client = getClient();
|
|
4363
4430
|
const result = await client.execute({
|
|
4364
|
-
sql: "UPDATE
|
|
4431
|
+
sql: "UPDATE company_procedures SET active = 0, updated_at = ? WHERE id = ?",
|
|
4365
4432
|
args: [now, id]
|
|
4366
4433
|
});
|
|
4367
4434
|
await loadGlobalProcedures();
|
|
@@ -2515,7 +2515,7 @@ async function ensureSchema() {
|
|
|
2515
2515
|
ON session_kills(agent_id);
|
|
2516
2516
|
`);
|
|
2517
2517
|
await client.execute(`
|
|
2518
|
-
CREATE TABLE IF NOT EXISTS
|
|
2518
|
+
CREATE TABLE IF NOT EXISTS company_procedures (
|
|
2519
2519
|
id TEXT PRIMARY KEY,
|
|
2520
2520
|
title TEXT NOT NULL,
|
|
2521
2521
|
content TEXT NOT NULL,
|
|
@@ -2526,6 +2526,73 @@ async function ensureSchema() {
|
|
|
2526
2526
|
updated_at TEXT NOT NULL
|
|
2527
2527
|
)
|
|
2528
2528
|
`);
|
|
2529
|
+
const legacyProcedureObject = await client.execute({
|
|
2530
|
+
sql: "SELECT type FROM sqlite_master WHERE name = 'global_procedures'",
|
|
2531
|
+
args: []
|
|
2532
|
+
});
|
|
2533
|
+
const legacyProcedureType = legacyProcedureObject.rows[0]?.type == null ? null : String(legacyProcedureObject.rows[0].type);
|
|
2534
|
+
if (legacyProcedureType === "table") {
|
|
2535
|
+
await client.execute(`
|
|
2536
|
+
INSERT OR IGNORE INTO company_procedures
|
|
2537
|
+
(id, title, content, priority, domain, active, created_at, updated_at)
|
|
2538
|
+
SELECT id, title, content, priority, domain, active, created_at, updated_at
|
|
2539
|
+
FROM global_procedures
|
|
2540
|
+
`);
|
|
2541
|
+
await client.executeMultiple(`
|
|
2542
|
+
CREATE TRIGGER IF NOT EXISTS global_procedures_mirror_insert
|
|
2543
|
+
AFTER INSERT ON global_procedures
|
|
2544
|
+
BEGIN
|
|
2545
|
+
INSERT OR IGNORE INTO company_procedures
|
|
2546
|
+
(id, title, content, priority, domain, active, created_at, updated_at)
|
|
2547
|
+
VALUES
|
|
2548
|
+
(NEW.id, NEW.title, NEW.content, NEW.priority, NEW.domain, NEW.active, NEW.created_at, NEW.updated_at);
|
|
2549
|
+
END;
|
|
2550
|
+
|
|
2551
|
+
CREATE TRIGGER IF NOT EXISTS global_procedures_mirror_update
|
|
2552
|
+
AFTER UPDATE ON global_procedures
|
|
2553
|
+
BEGIN
|
|
2554
|
+
UPDATE company_procedures
|
|
2555
|
+
SET title = NEW.title,
|
|
2556
|
+
content = NEW.content,
|
|
2557
|
+
priority = NEW.priority,
|
|
2558
|
+
domain = NEW.domain,
|
|
2559
|
+
active = NEW.active,
|
|
2560
|
+
created_at = NEW.created_at,
|
|
2561
|
+
updated_at = NEW.updated_at
|
|
2562
|
+
WHERE id = OLD.id;
|
|
2563
|
+
END;
|
|
2564
|
+
`);
|
|
2565
|
+
} else {
|
|
2566
|
+
await client.execute(`
|
|
2567
|
+
CREATE VIEW IF NOT EXISTS global_procedures AS
|
|
2568
|
+
SELECT id, title, content, priority, domain, active, created_at, updated_at
|
|
2569
|
+
FROM company_procedures
|
|
2570
|
+
`);
|
|
2571
|
+
await client.executeMultiple(`
|
|
2572
|
+
CREATE TRIGGER IF NOT EXISTS global_procedures_insert
|
|
2573
|
+
INSTEAD OF INSERT ON global_procedures
|
|
2574
|
+
BEGIN
|
|
2575
|
+
INSERT INTO company_procedures
|
|
2576
|
+
(id, title, content, priority, domain, active, created_at, updated_at)
|
|
2577
|
+
VALUES
|
|
2578
|
+
(NEW.id, NEW.title, NEW.content, NEW.priority, NEW.domain, NEW.active, NEW.created_at, NEW.updated_at);
|
|
2579
|
+
END;
|
|
2580
|
+
|
|
2581
|
+
CREATE TRIGGER IF NOT EXISTS global_procedures_update
|
|
2582
|
+
INSTEAD OF UPDATE ON global_procedures
|
|
2583
|
+
BEGIN
|
|
2584
|
+
UPDATE company_procedures
|
|
2585
|
+
SET title = NEW.title,
|
|
2586
|
+
content = NEW.content,
|
|
2587
|
+
priority = NEW.priority,
|
|
2588
|
+
domain = NEW.domain,
|
|
2589
|
+
active = NEW.active,
|
|
2590
|
+
created_at = NEW.created_at,
|
|
2591
|
+
updated_at = NEW.updated_at
|
|
2592
|
+
WHERE id = OLD.id;
|
|
2593
|
+
END;
|
|
2594
|
+
`);
|
|
2595
|
+
}
|
|
2529
2596
|
await client.executeMultiple(`
|
|
2530
2597
|
CREATE TABLE IF NOT EXISTS conversations (
|
|
2531
2598
|
id TEXT PRIMARY KEY,
|
|
@@ -4366,7 +4433,7 @@ var init_platform_procedures = __esm({
|
|
|
4366
4433
|
title: "MCP tools \u2014 advanced (triggers, skills, orchestration)",
|
|
4367
4434
|
domain: "tool-use",
|
|
4368
4435
|
priority: "p1",
|
|
4369
|
-
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.
|
|
4436
|
+
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."
|
|
4370
4437
|
}
|
|
4371
4438
|
];
|
|
4372
4439
|
PLATFORM_PROCEDURE_TITLES = new Set(
|
|
@@ -4387,7 +4454,7 @@ import { randomUUID as randomUUID3 } from "crypto";
|
|
|
4387
4454
|
async function loadGlobalProcedures() {
|
|
4388
4455
|
const client = getClient();
|
|
4389
4456
|
const result = await client.execute({
|
|
4390
|
-
sql: "SELECT * FROM
|
|
4457
|
+
sql: "SELECT * FROM company_procedures WHERE active = 1 ORDER BY priority ASC, created_at ASC",
|
|
4391
4458
|
args: []
|
|
4392
4459
|
});
|
|
4393
4460
|
const allRows = result.rows;
|
|
@@ -4416,7 +4483,7 @@ async function storeGlobalProcedure(input) {
|
|
|
4416
4483
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
4417
4484
|
const client = getClient();
|
|
4418
4485
|
await client.execute({
|
|
4419
|
-
sql: `INSERT INTO
|
|
4486
|
+
sql: `INSERT INTO company_procedures (id, title, content, priority, domain, active, created_at, updated_at)
|
|
4420
4487
|
VALUES (?, ?, ?, ?, ?, 1, ?, ?)`,
|
|
4421
4488
|
args: [id, input.title, input.content, input.priority ?? "p0", input.domain ?? null, now, now]
|
|
4422
4489
|
});
|
|
@@ -4427,7 +4494,7 @@ async function deactivateGlobalProcedure(id) {
|
|
|
4427
4494
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
4428
4495
|
const client = getClient();
|
|
4429
4496
|
const result = await client.execute({
|
|
4430
|
-
sql: "UPDATE
|
|
4497
|
+
sql: "UPDATE company_procedures SET active = 0, updated_at = ? WHERE id = ?",
|
|
4431
4498
|
args: [now, id]
|
|
4432
4499
|
});
|
|
4433
4500
|
await loadGlobalProcedures();
|
|
@@ -2515,7 +2515,7 @@ async function ensureSchema() {
|
|
|
2515
2515
|
ON session_kills(agent_id);
|
|
2516
2516
|
`);
|
|
2517
2517
|
await client.execute(`
|
|
2518
|
-
CREATE TABLE IF NOT EXISTS
|
|
2518
|
+
CREATE TABLE IF NOT EXISTS company_procedures (
|
|
2519
2519
|
id TEXT PRIMARY KEY,
|
|
2520
2520
|
title TEXT NOT NULL,
|
|
2521
2521
|
content TEXT NOT NULL,
|
|
@@ -2526,6 +2526,73 @@ async function ensureSchema() {
|
|
|
2526
2526
|
updated_at TEXT NOT NULL
|
|
2527
2527
|
)
|
|
2528
2528
|
`);
|
|
2529
|
+
const legacyProcedureObject = await client.execute({
|
|
2530
|
+
sql: "SELECT type FROM sqlite_master WHERE name = 'global_procedures'",
|
|
2531
|
+
args: []
|
|
2532
|
+
});
|
|
2533
|
+
const legacyProcedureType = legacyProcedureObject.rows[0]?.type == null ? null : String(legacyProcedureObject.rows[0].type);
|
|
2534
|
+
if (legacyProcedureType === "table") {
|
|
2535
|
+
await client.execute(`
|
|
2536
|
+
INSERT OR IGNORE INTO company_procedures
|
|
2537
|
+
(id, title, content, priority, domain, active, created_at, updated_at)
|
|
2538
|
+
SELECT id, title, content, priority, domain, active, created_at, updated_at
|
|
2539
|
+
FROM global_procedures
|
|
2540
|
+
`);
|
|
2541
|
+
await client.executeMultiple(`
|
|
2542
|
+
CREATE TRIGGER IF NOT EXISTS global_procedures_mirror_insert
|
|
2543
|
+
AFTER INSERT ON global_procedures
|
|
2544
|
+
BEGIN
|
|
2545
|
+
INSERT OR IGNORE INTO company_procedures
|
|
2546
|
+
(id, title, content, priority, domain, active, created_at, updated_at)
|
|
2547
|
+
VALUES
|
|
2548
|
+
(NEW.id, NEW.title, NEW.content, NEW.priority, NEW.domain, NEW.active, NEW.created_at, NEW.updated_at);
|
|
2549
|
+
END;
|
|
2550
|
+
|
|
2551
|
+
CREATE TRIGGER IF NOT EXISTS global_procedures_mirror_update
|
|
2552
|
+
AFTER UPDATE ON global_procedures
|
|
2553
|
+
BEGIN
|
|
2554
|
+
UPDATE company_procedures
|
|
2555
|
+
SET title = NEW.title,
|
|
2556
|
+
content = NEW.content,
|
|
2557
|
+
priority = NEW.priority,
|
|
2558
|
+
domain = NEW.domain,
|
|
2559
|
+
active = NEW.active,
|
|
2560
|
+
created_at = NEW.created_at,
|
|
2561
|
+
updated_at = NEW.updated_at
|
|
2562
|
+
WHERE id = OLD.id;
|
|
2563
|
+
END;
|
|
2564
|
+
`);
|
|
2565
|
+
} else {
|
|
2566
|
+
await client.execute(`
|
|
2567
|
+
CREATE VIEW IF NOT EXISTS global_procedures AS
|
|
2568
|
+
SELECT id, title, content, priority, domain, active, created_at, updated_at
|
|
2569
|
+
FROM company_procedures
|
|
2570
|
+
`);
|
|
2571
|
+
await client.executeMultiple(`
|
|
2572
|
+
CREATE TRIGGER IF NOT EXISTS global_procedures_insert
|
|
2573
|
+
INSTEAD OF INSERT ON global_procedures
|
|
2574
|
+
BEGIN
|
|
2575
|
+
INSERT INTO company_procedures
|
|
2576
|
+
(id, title, content, priority, domain, active, created_at, updated_at)
|
|
2577
|
+
VALUES
|
|
2578
|
+
(NEW.id, NEW.title, NEW.content, NEW.priority, NEW.domain, NEW.active, NEW.created_at, NEW.updated_at);
|
|
2579
|
+
END;
|
|
2580
|
+
|
|
2581
|
+
CREATE TRIGGER IF NOT EXISTS global_procedures_update
|
|
2582
|
+
INSTEAD OF UPDATE ON global_procedures
|
|
2583
|
+
BEGIN
|
|
2584
|
+
UPDATE company_procedures
|
|
2585
|
+
SET title = NEW.title,
|
|
2586
|
+
content = NEW.content,
|
|
2587
|
+
priority = NEW.priority,
|
|
2588
|
+
domain = NEW.domain,
|
|
2589
|
+
active = NEW.active,
|
|
2590
|
+
created_at = NEW.created_at,
|
|
2591
|
+
updated_at = NEW.updated_at
|
|
2592
|
+
WHERE id = OLD.id;
|
|
2593
|
+
END;
|
|
2594
|
+
`);
|
|
2595
|
+
}
|
|
2529
2596
|
await client.executeMultiple(`
|
|
2530
2597
|
CREATE TABLE IF NOT EXISTS conversations (
|
|
2531
2598
|
id TEXT PRIMARY KEY,
|
|
@@ -4405,7 +4472,7 @@ var init_platform_procedures = __esm({
|
|
|
4405
4472
|
title: "MCP tools \u2014 advanced (triggers, skills, orchestration)",
|
|
4406
4473
|
domain: "tool-use",
|
|
4407
4474
|
priority: "p1",
|
|
4408
|
-
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.
|
|
4475
|
+
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."
|
|
4409
4476
|
}
|
|
4410
4477
|
];
|
|
4411
4478
|
PLATFORM_PROCEDURE_TITLES = new Set(
|
|
@@ -4426,7 +4493,7 @@ import { randomUUID as randomUUID3 } from "crypto";
|
|
|
4426
4493
|
async function loadGlobalProcedures() {
|
|
4427
4494
|
const client = getClient();
|
|
4428
4495
|
const result = await client.execute({
|
|
4429
|
-
sql: "SELECT * FROM
|
|
4496
|
+
sql: "SELECT * FROM company_procedures WHERE active = 1 ORDER BY priority ASC, created_at ASC",
|
|
4430
4497
|
args: []
|
|
4431
4498
|
});
|
|
4432
4499
|
const allRows = result.rows;
|
|
@@ -4455,7 +4522,7 @@ async function storeGlobalProcedure(input) {
|
|
|
4455
4522
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
4456
4523
|
const client = getClient();
|
|
4457
4524
|
await client.execute({
|
|
4458
|
-
sql: `INSERT INTO
|
|
4525
|
+
sql: `INSERT INTO company_procedures (id, title, content, priority, domain, active, created_at, updated_at)
|
|
4459
4526
|
VALUES (?, ?, ?, ?, ?, 1, ?, ?)`,
|
|
4460
4527
|
args: [id, input.title, input.content, input.priority ?? "p0", input.domain ?? null, now, now]
|
|
4461
4528
|
});
|
|
@@ -4466,7 +4533,7 @@ async function deactivateGlobalProcedure(id) {
|
|
|
4466
4533
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
4467
4534
|
const client = getClient();
|
|
4468
4535
|
const result = await client.execute({
|
|
4469
|
-
sql: "UPDATE
|
|
4536
|
+
sql: "UPDATE company_procedures SET active = 0, updated_at = ? WHERE id = ?",
|
|
4470
4537
|
args: [now, id]
|
|
4471
4538
|
});
|
|
4472
4539
|
await loadGlobalProcedures();
|