@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/hooks/stop.js
CHANGED
|
@@ -2827,7 +2827,7 @@ async function ensureSchema() {
|
|
|
2827
2827
|
ON session_kills(agent_id);
|
|
2828
2828
|
`);
|
|
2829
2829
|
await client.execute(`
|
|
2830
|
-
CREATE TABLE IF NOT EXISTS
|
|
2830
|
+
CREATE TABLE IF NOT EXISTS company_procedures (
|
|
2831
2831
|
id TEXT PRIMARY KEY,
|
|
2832
2832
|
title TEXT NOT NULL,
|
|
2833
2833
|
content TEXT NOT NULL,
|
|
@@ -2838,6 +2838,73 @@ async function ensureSchema() {
|
|
|
2838
2838
|
updated_at TEXT NOT NULL
|
|
2839
2839
|
)
|
|
2840
2840
|
`);
|
|
2841
|
+
const legacyProcedureObject = await client.execute({
|
|
2842
|
+
sql: "SELECT type FROM sqlite_master WHERE name = 'global_procedures'",
|
|
2843
|
+
args: []
|
|
2844
|
+
});
|
|
2845
|
+
const legacyProcedureType = legacyProcedureObject.rows[0]?.type == null ? null : String(legacyProcedureObject.rows[0].type);
|
|
2846
|
+
if (legacyProcedureType === "table") {
|
|
2847
|
+
await client.execute(`
|
|
2848
|
+
INSERT OR IGNORE INTO company_procedures
|
|
2849
|
+
(id, title, content, priority, domain, active, created_at, updated_at)
|
|
2850
|
+
SELECT id, title, content, priority, domain, active, created_at, updated_at
|
|
2851
|
+
FROM global_procedures
|
|
2852
|
+
`);
|
|
2853
|
+
await client.executeMultiple(`
|
|
2854
|
+
CREATE TRIGGER IF NOT EXISTS global_procedures_mirror_insert
|
|
2855
|
+
AFTER INSERT ON global_procedures
|
|
2856
|
+
BEGIN
|
|
2857
|
+
INSERT OR IGNORE INTO company_procedures
|
|
2858
|
+
(id, title, content, priority, domain, active, created_at, updated_at)
|
|
2859
|
+
VALUES
|
|
2860
|
+
(NEW.id, NEW.title, NEW.content, NEW.priority, NEW.domain, NEW.active, NEW.created_at, NEW.updated_at);
|
|
2861
|
+
END;
|
|
2862
|
+
|
|
2863
|
+
CREATE TRIGGER IF NOT EXISTS global_procedures_mirror_update
|
|
2864
|
+
AFTER UPDATE ON global_procedures
|
|
2865
|
+
BEGIN
|
|
2866
|
+
UPDATE company_procedures
|
|
2867
|
+
SET title = NEW.title,
|
|
2868
|
+
content = NEW.content,
|
|
2869
|
+
priority = NEW.priority,
|
|
2870
|
+
domain = NEW.domain,
|
|
2871
|
+
active = NEW.active,
|
|
2872
|
+
created_at = NEW.created_at,
|
|
2873
|
+
updated_at = NEW.updated_at
|
|
2874
|
+
WHERE id = OLD.id;
|
|
2875
|
+
END;
|
|
2876
|
+
`);
|
|
2877
|
+
} else {
|
|
2878
|
+
await client.execute(`
|
|
2879
|
+
CREATE VIEW IF NOT EXISTS global_procedures AS
|
|
2880
|
+
SELECT id, title, content, priority, domain, active, created_at, updated_at
|
|
2881
|
+
FROM company_procedures
|
|
2882
|
+
`);
|
|
2883
|
+
await client.executeMultiple(`
|
|
2884
|
+
CREATE TRIGGER IF NOT EXISTS global_procedures_insert
|
|
2885
|
+
INSTEAD OF INSERT ON global_procedures
|
|
2886
|
+
BEGIN
|
|
2887
|
+
INSERT INTO company_procedures
|
|
2888
|
+
(id, title, content, priority, domain, active, created_at, updated_at)
|
|
2889
|
+
VALUES
|
|
2890
|
+
(NEW.id, NEW.title, NEW.content, NEW.priority, NEW.domain, NEW.active, NEW.created_at, NEW.updated_at);
|
|
2891
|
+
END;
|
|
2892
|
+
|
|
2893
|
+
CREATE TRIGGER IF NOT EXISTS global_procedures_update
|
|
2894
|
+
INSTEAD OF UPDATE ON global_procedures
|
|
2895
|
+
BEGIN
|
|
2896
|
+
UPDATE company_procedures
|
|
2897
|
+
SET title = NEW.title,
|
|
2898
|
+
content = NEW.content,
|
|
2899
|
+
priority = NEW.priority,
|
|
2900
|
+
domain = NEW.domain,
|
|
2901
|
+
active = NEW.active,
|
|
2902
|
+
created_at = NEW.created_at,
|
|
2903
|
+
updated_at = NEW.updated_at
|
|
2904
|
+
WHERE id = OLD.id;
|
|
2905
|
+
END;
|
|
2906
|
+
`);
|
|
2907
|
+
}
|
|
2841
2908
|
await client.executeMultiple(`
|
|
2842
2909
|
CREATE TABLE IF NOT EXISTS conversations (
|
|
2843
2910
|
id TEXT PRIMARY KEY,
|
|
@@ -4329,7 +4396,7 @@ var init_platform_procedures = __esm({
|
|
|
4329
4396
|
title: "MCP tools \u2014 advanced (triggers, skills, orchestration)",
|
|
4330
4397
|
domain: "tool-use",
|
|
4331
4398
|
priority: "p1",
|
|
4332
|
-
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.
|
|
4399
|
+
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."
|
|
4333
4400
|
}
|
|
4334
4401
|
];
|
|
4335
4402
|
PLATFORM_PROCEDURE_TITLES = new Set(
|
|
@@ -4350,7 +4417,7 @@ import { randomUUID as randomUUID3 } from "crypto";
|
|
|
4350
4417
|
async function loadGlobalProcedures() {
|
|
4351
4418
|
const client = getClient();
|
|
4352
4419
|
const result = await client.execute({
|
|
4353
|
-
sql: "SELECT * FROM
|
|
4420
|
+
sql: "SELECT * FROM company_procedures WHERE active = 1 ORDER BY priority ASC, created_at ASC",
|
|
4354
4421
|
args: []
|
|
4355
4422
|
});
|
|
4356
4423
|
const allRows = result.rows;
|
|
@@ -4379,7 +4446,7 @@ async function storeGlobalProcedure(input2) {
|
|
|
4379
4446
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
4380
4447
|
const client = getClient();
|
|
4381
4448
|
await client.execute({
|
|
4382
|
-
sql: `INSERT INTO
|
|
4449
|
+
sql: `INSERT INTO company_procedures (id, title, content, priority, domain, active, created_at, updated_at)
|
|
4383
4450
|
VALUES (?, ?, ?, ?, ?, 1, ?, ?)`,
|
|
4384
4451
|
args: [id, input2.title, input2.content, input2.priority ?? "p0", input2.domain ?? null, now, now]
|
|
4385
4452
|
});
|
|
@@ -4390,7 +4457,7 @@ async function deactivateGlobalProcedure(id) {
|
|
|
4390
4457
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
4391
4458
|
const client = getClient();
|
|
4392
4459
|
const result = await client.execute({
|
|
4393
|
-
sql: "UPDATE
|
|
4460
|
+
sql: "UPDATE company_procedures SET active = 0, updated_at = ? WHERE id = ?",
|
|
4394
4461
|
args: [now, id]
|
|
4395
4462
|
});
|
|
4396
4463
|
await loadGlobalProcedures();
|
|
@@ -2808,7 +2808,7 @@ async function ensureSchema() {
|
|
|
2808
2808
|
ON session_kills(agent_id);
|
|
2809
2809
|
`);
|
|
2810
2810
|
await client.execute(`
|
|
2811
|
-
CREATE TABLE IF NOT EXISTS
|
|
2811
|
+
CREATE TABLE IF NOT EXISTS company_procedures (
|
|
2812
2812
|
id TEXT PRIMARY KEY,
|
|
2813
2813
|
title TEXT NOT NULL,
|
|
2814
2814
|
content TEXT NOT NULL,
|
|
@@ -2819,6 +2819,73 @@ async function ensureSchema() {
|
|
|
2819
2819
|
updated_at TEXT NOT NULL
|
|
2820
2820
|
)
|
|
2821
2821
|
`);
|
|
2822
|
+
const legacyProcedureObject = await client.execute({
|
|
2823
|
+
sql: "SELECT type FROM sqlite_master WHERE name = 'global_procedures'",
|
|
2824
|
+
args: []
|
|
2825
|
+
});
|
|
2826
|
+
const legacyProcedureType = legacyProcedureObject.rows[0]?.type == null ? null : String(legacyProcedureObject.rows[0].type);
|
|
2827
|
+
if (legacyProcedureType === "table") {
|
|
2828
|
+
await client.execute(`
|
|
2829
|
+
INSERT OR IGNORE INTO company_procedures
|
|
2830
|
+
(id, title, content, priority, domain, active, created_at, updated_at)
|
|
2831
|
+
SELECT id, title, content, priority, domain, active, created_at, updated_at
|
|
2832
|
+
FROM global_procedures
|
|
2833
|
+
`);
|
|
2834
|
+
await client.executeMultiple(`
|
|
2835
|
+
CREATE TRIGGER IF NOT EXISTS global_procedures_mirror_insert
|
|
2836
|
+
AFTER INSERT ON global_procedures
|
|
2837
|
+
BEGIN
|
|
2838
|
+
INSERT OR IGNORE INTO company_procedures
|
|
2839
|
+
(id, title, content, priority, domain, active, created_at, updated_at)
|
|
2840
|
+
VALUES
|
|
2841
|
+
(NEW.id, NEW.title, NEW.content, NEW.priority, NEW.domain, NEW.active, NEW.created_at, NEW.updated_at);
|
|
2842
|
+
END;
|
|
2843
|
+
|
|
2844
|
+
CREATE TRIGGER IF NOT EXISTS global_procedures_mirror_update
|
|
2845
|
+
AFTER UPDATE ON global_procedures
|
|
2846
|
+
BEGIN
|
|
2847
|
+
UPDATE company_procedures
|
|
2848
|
+
SET title = NEW.title,
|
|
2849
|
+
content = NEW.content,
|
|
2850
|
+
priority = NEW.priority,
|
|
2851
|
+
domain = NEW.domain,
|
|
2852
|
+
active = NEW.active,
|
|
2853
|
+
created_at = NEW.created_at,
|
|
2854
|
+
updated_at = NEW.updated_at
|
|
2855
|
+
WHERE id = OLD.id;
|
|
2856
|
+
END;
|
|
2857
|
+
`);
|
|
2858
|
+
} else {
|
|
2859
|
+
await client.execute(`
|
|
2860
|
+
CREATE VIEW IF NOT EXISTS global_procedures AS
|
|
2861
|
+
SELECT id, title, content, priority, domain, active, created_at, updated_at
|
|
2862
|
+
FROM company_procedures
|
|
2863
|
+
`);
|
|
2864
|
+
await client.executeMultiple(`
|
|
2865
|
+
CREATE TRIGGER IF NOT EXISTS global_procedures_insert
|
|
2866
|
+
INSTEAD OF INSERT ON global_procedures
|
|
2867
|
+
BEGIN
|
|
2868
|
+
INSERT INTO company_procedures
|
|
2869
|
+
(id, title, content, priority, domain, active, created_at, updated_at)
|
|
2870
|
+
VALUES
|
|
2871
|
+
(NEW.id, NEW.title, NEW.content, NEW.priority, NEW.domain, NEW.active, NEW.created_at, NEW.updated_at);
|
|
2872
|
+
END;
|
|
2873
|
+
|
|
2874
|
+
CREATE TRIGGER IF NOT EXISTS global_procedures_update
|
|
2875
|
+
INSTEAD OF UPDATE ON global_procedures
|
|
2876
|
+
BEGIN
|
|
2877
|
+
UPDATE company_procedures
|
|
2878
|
+
SET title = NEW.title,
|
|
2879
|
+
content = NEW.content,
|
|
2880
|
+
priority = NEW.priority,
|
|
2881
|
+
domain = NEW.domain,
|
|
2882
|
+
active = NEW.active,
|
|
2883
|
+
created_at = NEW.created_at,
|
|
2884
|
+
updated_at = NEW.updated_at
|
|
2885
|
+
WHERE id = OLD.id;
|
|
2886
|
+
END;
|
|
2887
|
+
`);
|
|
2888
|
+
}
|
|
2822
2889
|
await client.executeMultiple(`
|
|
2823
2890
|
CREATE TABLE IF NOT EXISTS conversations (
|
|
2824
2891
|
id TEXT PRIMARY KEY,
|
|
@@ -4310,7 +4377,7 @@ var init_platform_procedures = __esm({
|
|
|
4310
4377
|
title: "MCP tools \u2014 advanced (triggers, skills, orchestration)",
|
|
4311
4378
|
domain: "tool-use",
|
|
4312
4379
|
priority: "p1",
|
|
4313
|
-
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.
|
|
4380
|
+
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."
|
|
4314
4381
|
}
|
|
4315
4382
|
];
|
|
4316
4383
|
PLATFORM_PROCEDURE_TITLES = new Set(
|
|
@@ -4331,7 +4398,7 @@ import { randomUUID as randomUUID3 } from "crypto";
|
|
|
4331
4398
|
async function loadGlobalProcedures() {
|
|
4332
4399
|
const client = getClient();
|
|
4333
4400
|
const result = await client.execute({
|
|
4334
|
-
sql: "SELECT * FROM
|
|
4401
|
+
sql: "SELECT * FROM company_procedures WHERE active = 1 ORDER BY priority ASC, created_at ASC",
|
|
4335
4402
|
args: []
|
|
4336
4403
|
});
|
|
4337
4404
|
const allRows = result.rows;
|
|
@@ -4360,7 +4427,7 @@ async function storeGlobalProcedure(input2) {
|
|
|
4360
4427
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
4361
4428
|
const client = getClient();
|
|
4362
4429
|
await client.execute({
|
|
4363
|
-
sql: `INSERT INTO
|
|
4430
|
+
sql: `INSERT INTO company_procedures (id, title, content, priority, domain, active, created_at, updated_at)
|
|
4364
4431
|
VALUES (?, ?, ?, ?, ?, 1, ?, ?)`,
|
|
4365
4432
|
args: [id, input2.title, input2.content, input2.priority ?? "p0", input2.domain ?? null, now, now]
|
|
4366
4433
|
});
|
|
@@ -4371,7 +4438,7 @@ async function deactivateGlobalProcedure(id) {
|
|
|
4371
4438
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
4372
4439
|
const client = getClient();
|
|
4373
4440
|
const result = await client.execute({
|
|
4374
|
-
sql: "UPDATE
|
|
4441
|
+
sql: "UPDATE company_procedures SET active = 0, updated_at = ? WHERE id = ?",
|
|
4375
4442
|
args: [now, id]
|
|
4376
4443
|
});
|
|
4377
4444
|
await loadGlobalProcedures();
|
|
@@ -2565,7 +2565,7 @@ async function ensureSchema() {
|
|
|
2565
2565
|
ON session_kills(agent_id);
|
|
2566
2566
|
`);
|
|
2567
2567
|
await client.execute(`
|
|
2568
|
-
CREATE TABLE IF NOT EXISTS
|
|
2568
|
+
CREATE TABLE IF NOT EXISTS company_procedures (
|
|
2569
2569
|
id TEXT PRIMARY KEY,
|
|
2570
2570
|
title TEXT NOT NULL,
|
|
2571
2571
|
content TEXT NOT NULL,
|
|
@@ -2576,6 +2576,73 @@ async function ensureSchema() {
|
|
|
2576
2576
|
updated_at TEXT NOT NULL
|
|
2577
2577
|
)
|
|
2578
2578
|
`);
|
|
2579
|
+
const legacyProcedureObject = await client.execute({
|
|
2580
|
+
sql: "SELECT type FROM sqlite_master WHERE name = 'global_procedures'",
|
|
2581
|
+
args: []
|
|
2582
|
+
});
|
|
2583
|
+
const legacyProcedureType = legacyProcedureObject.rows[0]?.type == null ? null : String(legacyProcedureObject.rows[0].type);
|
|
2584
|
+
if (legacyProcedureType === "table") {
|
|
2585
|
+
await client.execute(`
|
|
2586
|
+
INSERT OR IGNORE INTO company_procedures
|
|
2587
|
+
(id, title, content, priority, domain, active, created_at, updated_at)
|
|
2588
|
+
SELECT id, title, content, priority, domain, active, created_at, updated_at
|
|
2589
|
+
FROM global_procedures
|
|
2590
|
+
`);
|
|
2591
|
+
await client.executeMultiple(`
|
|
2592
|
+
CREATE TRIGGER IF NOT EXISTS global_procedures_mirror_insert
|
|
2593
|
+
AFTER INSERT ON global_procedures
|
|
2594
|
+
BEGIN
|
|
2595
|
+
INSERT OR IGNORE INTO company_procedures
|
|
2596
|
+
(id, title, content, priority, domain, active, created_at, updated_at)
|
|
2597
|
+
VALUES
|
|
2598
|
+
(NEW.id, NEW.title, NEW.content, NEW.priority, NEW.domain, NEW.active, NEW.created_at, NEW.updated_at);
|
|
2599
|
+
END;
|
|
2600
|
+
|
|
2601
|
+
CREATE TRIGGER IF NOT EXISTS global_procedures_mirror_update
|
|
2602
|
+
AFTER UPDATE ON global_procedures
|
|
2603
|
+
BEGIN
|
|
2604
|
+
UPDATE company_procedures
|
|
2605
|
+
SET title = NEW.title,
|
|
2606
|
+
content = NEW.content,
|
|
2607
|
+
priority = NEW.priority,
|
|
2608
|
+
domain = NEW.domain,
|
|
2609
|
+
active = NEW.active,
|
|
2610
|
+
created_at = NEW.created_at,
|
|
2611
|
+
updated_at = NEW.updated_at
|
|
2612
|
+
WHERE id = OLD.id;
|
|
2613
|
+
END;
|
|
2614
|
+
`);
|
|
2615
|
+
} else {
|
|
2616
|
+
await client.execute(`
|
|
2617
|
+
CREATE VIEW IF NOT EXISTS global_procedures AS
|
|
2618
|
+
SELECT id, title, content, priority, domain, active, created_at, updated_at
|
|
2619
|
+
FROM company_procedures
|
|
2620
|
+
`);
|
|
2621
|
+
await client.executeMultiple(`
|
|
2622
|
+
CREATE TRIGGER IF NOT EXISTS global_procedures_insert
|
|
2623
|
+
INSTEAD OF INSERT ON global_procedures
|
|
2624
|
+
BEGIN
|
|
2625
|
+
INSERT INTO company_procedures
|
|
2626
|
+
(id, title, content, priority, domain, active, created_at, updated_at)
|
|
2627
|
+
VALUES
|
|
2628
|
+
(NEW.id, NEW.title, NEW.content, NEW.priority, NEW.domain, NEW.active, NEW.created_at, NEW.updated_at);
|
|
2629
|
+
END;
|
|
2630
|
+
|
|
2631
|
+
CREATE TRIGGER IF NOT EXISTS global_procedures_update
|
|
2632
|
+
INSTEAD OF UPDATE ON global_procedures
|
|
2633
|
+
BEGIN
|
|
2634
|
+
UPDATE company_procedures
|
|
2635
|
+
SET title = NEW.title,
|
|
2636
|
+
content = NEW.content,
|
|
2637
|
+
priority = NEW.priority,
|
|
2638
|
+
domain = NEW.domain,
|
|
2639
|
+
active = NEW.active,
|
|
2640
|
+
created_at = NEW.created_at,
|
|
2641
|
+
updated_at = NEW.updated_at
|
|
2642
|
+
WHERE id = OLD.id;
|
|
2643
|
+
END;
|
|
2644
|
+
`);
|
|
2645
|
+
}
|
|
2579
2646
|
await client.executeMultiple(`
|
|
2580
2647
|
CREATE TABLE IF NOT EXISTS conversations (
|
|
2581
2648
|
id TEXT PRIMARY KEY,
|
|
@@ -3828,7 +3895,7 @@ var init_platform_procedures = __esm({
|
|
|
3828
3895
|
title: "MCP tools \u2014 advanced (triggers, skills, orchestration)",
|
|
3829
3896
|
domain: "tool-use",
|
|
3830
3897
|
priority: "p1",
|
|
3831
|
-
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.
|
|
3898
|
+
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."
|
|
3832
3899
|
}
|
|
3833
3900
|
];
|
|
3834
3901
|
PLATFORM_PROCEDURE_TITLES = new Set(
|
|
@@ -3849,7 +3916,7 @@ import { randomUUID as randomUUID2 } from "crypto";
|
|
|
3849
3916
|
async function loadGlobalProcedures() {
|
|
3850
3917
|
const client = getClient();
|
|
3851
3918
|
const result = await client.execute({
|
|
3852
|
-
sql: "SELECT * FROM
|
|
3919
|
+
sql: "SELECT * FROM company_procedures WHERE active = 1 ORDER BY priority ASC, created_at ASC",
|
|
3853
3920
|
args: []
|
|
3854
3921
|
});
|
|
3855
3922
|
const allRows = result.rows;
|
|
@@ -3878,7 +3945,7 @@ async function storeGlobalProcedure(input) {
|
|
|
3878
3945
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
3879
3946
|
const client = getClient();
|
|
3880
3947
|
await client.execute({
|
|
3881
|
-
sql: `INSERT INTO
|
|
3948
|
+
sql: `INSERT INTO company_procedures (id, title, content, priority, domain, active, created_at, updated_at)
|
|
3882
3949
|
VALUES (?, ?, ?, ?, ?, 1, ?, ?)`,
|
|
3883
3950
|
args: [id, input.title, input.content, input.priority ?? "p0", input.domain ?? null, now, now]
|
|
3884
3951
|
});
|
|
@@ -3889,7 +3956,7 @@ async function deactivateGlobalProcedure(id) {
|
|
|
3889
3956
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
3890
3957
|
const client = getClient();
|
|
3891
3958
|
const result = await client.execute({
|
|
3892
|
-
sql: "UPDATE
|
|
3959
|
+
sql: "UPDATE company_procedures SET active = 0, updated_at = ? WHERE id = ?",
|
|
3893
3960
|
args: [now, id]
|
|
3894
3961
|
});
|
|
3895
3962
|
await loadGlobalProcedures();
|
|
@@ -5950,12 +6017,12 @@ async function cloudSync(config) {
|
|
|
5950
6017
|
try {
|
|
5951
6018
|
await cloudPushGlobalProcedures(config);
|
|
5952
6019
|
} catch (err) {
|
|
5953
|
-
logError(`[cloud-sync]
|
|
6020
|
+
logError(`[cloud-sync] Company procedures push: ${err instanceof Error ? err.message : String(err)}`);
|
|
5954
6021
|
}
|
|
5955
6022
|
try {
|
|
5956
6023
|
await cloudPullGlobalProcedures(config);
|
|
5957
6024
|
} catch (err) {
|
|
5958
|
-
logError(`[cloud-sync]
|
|
6025
|
+
logError(`[cloud-sync] Company procedures pull: ${err instanceof Error ? err.message : String(err)}`);
|
|
5959
6026
|
}
|
|
5960
6027
|
const countRows = async (sql) => {
|
|
5961
6028
|
try {
|
|
@@ -6364,12 +6431,12 @@ async function cloudPullBlob(route, config) {
|
|
|
6364
6431
|
}
|
|
6365
6432
|
async function cloudPushGlobalProcedures(config) {
|
|
6366
6433
|
const client = getClient();
|
|
6367
|
-
const result = await client.execute("SELECT * FROM
|
|
6434
|
+
const result = await client.execute("SELECT * FROM company_procedures LIMIT 1000");
|
|
6368
6435
|
const rows = result.rows;
|
|
6369
6436
|
const { ok } = await cloudPushBlob(
|
|
6370
6437
|
"/sync/push-global-procedures",
|
|
6371
6438
|
rows,
|
|
6372
|
-
"
|
|
6439
|
+
"last_company_procedures_push_version",
|
|
6373
6440
|
config
|
|
6374
6441
|
);
|
|
6375
6442
|
return ok;
|
|
@@ -6382,7 +6449,7 @@ async function cloudPullGlobalProcedures(config) {
|
|
|
6382
6449
|
if (!remoteProcs || remoteProcs.length === 0) return { pulled: 0 };
|
|
6383
6450
|
const client = getClient();
|
|
6384
6451
|
const stmts = remoteProcs.map((p) => ({
|
|
6385
|
-
sql: `INSERT INTO
|
|
6452
|
+
sql: `INSERT INTO company_procedures
|
|
6386
6453
|
(id, title, content, priority, domain, active, created_at, updated_at)
|
|
6387
6454
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
|
6388
6455
|
ON CONFLICT(id) DO UPDATE SET
|
|
@@ -6392,7 +6459,7 @@ async function cloudPullGlobalProcedures(config) {
|
|
|
6392
6459
|
domain = excluded.domain,
|
|
6393
6460
|
active = excluded.active,
|
|
6394
6461
|
updated_at = excluded.updated_at
|
|
6395
|
-
WHERE excluded.updated_at >
|
|
6462
|
+
WHERE excluded.updated_at > company_procedures.updated_at`,
|
|
6396
6463
|
args: [
|
|
6397
6464
|
sqlSafe(p.id),
|
|
6398
6465
|
sqlSafe(p.title),
|
package/dist/index.js
CHANGED
|
@@ -3303,7 +3303,7 @@ async function ensureSchema() {
|
|
|
3303
3303
|
ON session_kills(agent_id);
|
|
3304
3304
|
`);
|
|
3305
3305
|
await client.execute(`
|
|
3306
|
-
CREATE TABLE IF NOT EXISTS
|
|
3306
|
+
CREATE TABLE IF NOT EXISTS company_procedures (
|
|
3307
3307
|
id TEXT PRIMARY KEY,
|
|
3308
3308
|
title TEXT NOT NULL,
|
|
3309
3309
|
content TEXT NOT NULL,
|
|
@@ -3314,6 +3314,73 @@ async function ensureSchema() {
|
|
|
3314
3314
|
updated_at TEXT NOT NULL
|
|
3315
3315
|
)
|
|
3316
3316
|
`);
|
|
3317
|
+
const legacyProcedureObject = await client.execute({
|
|
3318
|
+
sql: "SELECT type FROM sqlite_master WHERE name = 'global_procedures'",
|
|
3319
|
+
args: []
|
|
3320
|
+
});
|
|
3321
|
+
const legacyProcedureType = legacyProcedureObject.rows[0]?.type == null ? null : String(legacyProcedureObject.rows[0].type);
|
|
3322
|
+
if (legacyProcedureType === "table") {
|
|
3323
|
+
await client.execute(`
|
|
3324
|
+
INSERT OR IGNORE INTO company_procedures
|
|
3325
|
+
(id, title, content, priority, domain, active, created_at, updated_at)
|
|
3326
|
+
SELECT id, title, content, priority, domain, active, created_at, updated_at
|
|
3327
|
+
FROM global_procedures
|
|
3328
|
+
`);
|
|
3329
|
+
await client.executeMultiple(`
|
|
3330
|
+
CREATE TRIGGER IF NOT EXISTS global_procedures_mirror_insert
|
|
3331
|
+
AFTER INSERT ON global_procedures
|
|
3332
|
+
BEGIN
|
|
3333
|
+
INSERT OR IGNORE INTO company_procedures
|
|
3334
|
+
(id, title, content, priority, domain, active, created_at, updated_at)
|
|
3335
|
+
VALUES
|
|
3336
|
+
(NEW.id, NEW.title, NEW.content, NEW.priority, NEW.domain, NEW.active, NEW.created_at, NEW.updated_at);
|
|
3337
|
+
END;
|
|
3338
|
+
|
|
3339
|
+
CREATE TRIGGER IF NOT EXISTS global_procedures_mirror_update
|
|
3340
|
+
AFTER UPDATE ON global_procedures
|
|
3341
|
+
BEGIN
|
|
3342
|
+
UPDATE company_procedures
|
|
3343
|
+
SET title = NEW.title,
|
|
3344
|
+
content = NEW.content,
|
|
3345
|
+
priority = NEW.priority,
|
|
3346
|
+
domain = NEW.domain,
|
|
3347
|
+
active = NEW.active,
|
|
3348
|
+
created_at = NEW.created_at,
|
|
3349
|
+
updated_at = NEW.updated_at
|
|
3350
|
+
WHERE id = OLD.id;
|
|
3351
|
+
END;
|
|
3352
|
+
`);
|
|
3353
|
+
} else {
|
|
3354
|
+
await client.execute(`
|
|
3355
|
+
CREATE VIEW IF NOT EXISTS global_procedures AS
|
|
3356
|
+
SELECT id, title, content, priority, domain, active, created_at, updated_at
|
|
3357
|
+
FROM company_procedures
|
|
3358
|
+
`);
|
|
3359
|
+
await client.executeMultiple(`
|
|
3360
|
+
CREATE TRIGGER IF NOT EXISTS global_procedures_insert
|
|
3361
|
+
INSTEAD OF INSERT ON global_procedures
|
|
3362
|
+
BEGIN
|
|
3363
|
+
INSERT INTO company_procedures
|
|
3364
|
+
(id, title, content, priority, domain, active, created_at, updated_at)
|
|
3365
|
+
VALUES
|
|
3366
|
+
(NEW.id, NEW.title, NEW.content, NEW.priority, NEW.domain, NEW.active, NEW.created_at, NEW.updated_at);
|
|
3367
|
+
END;
|
|
3368
|
+
|
|
3369
|
+
CREATE TRIGGER IF NOT EXISTS global_procedures_update
|
|
3370
|
+
INSTEAD OF UPDATE ON global_procedures
|
|
3371
|
+
BEGIN
|
|
3372
|
+
UPDATE company_procedures
|
|
3373
|
+
SET title = NEW.title,
|
|
3374
|
+
content = NEW.content,
|
|
3375
|
+
priority = NEW.priority,
|
|
3376
|
+
domain = NEW.domain,
|
|
3377
|
+
active = NEW.active,
|
|
3378
|
+
created_at = NEW.created_at,
|
|
3379
|
+
updated_at = NEW.updated_at
|
|
3380
|
+
WHERE id = OLD.id;
|
|
3381
|
+
END;
|
|
3382
|
+
`);
|
|
3383
|
+
}
|
|
3317
3384
|
await client.executeMultiple(`
|
|
3318
3385
|
CREATE TABLE IF NOT EXISTS conversations (
|
|
3319
3386
|
id TEXT PRIMARY KEY,
|
|
@@ -7916,7 +7983,7 @@ var init_platform_procedures = __esm({
|
|
|
7916
7983
|
title: "MCP tools \u2014 advanced (triggers, skills, orchestration)",
|
|
7917
7984
|
domain: "tool-use",
|
|
7918
7985
|
priority: "p1",
|
|
7919
|
-
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.
|
|
7986
|
+
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."
|
|
7920
7987
|
}
|
|
7921
7988
|
];
|
|
7922
7989
|
PLATFORM_PROCEDURE_TITLES = new Set(
|
|
@@ -7937,7 +8004,7 @@ import { randomUUID as randomUUID4 } from "crypto";
|
|
|
7937
8004
|
async function loadGlobalProcedures() {
|
|
7938
8005
|
const client = getClient();
|
|
7939
8006
|
const result = await client.execute({
|
|
7940
|
-
sql: "SELECT * FROM
|
|
8007
|
+
sql: "SELECT * FROM company_procedures WHERE active = 1 ORDER BY priority ASC, created_at ASC",
|
|
7941
8008
|
args: []
|
|
7942
8009
|
});
|
|
7943
8010
|
const allRows = result.rows;
|
|
@@ -7966,7 +8033,7 @@ async function storeGlobalProcedure(input) {
|
|
|
7966
8033
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
7967
8034
|
const client = getClient();
|
|
7968
8035
|
await client.execute({
|
|
7969
|
-
sql: `INSERT INTO
|
|
8036
|
+
sql: `INSERT INTO company_procedures (id, title, content, priority, domain, active, created_at, updated_at)
|
|
7970
8037
|
VALUES (?, ?, ?, ?, ?, 1, ?, ?)`,
|
|
7971
8038
|
args: [id, input.title, input.content, input.priority ?? "p0", input.domain ?? null, now, now]
|
|
7972
8039
|
});
|
|
@@ -7977,7 +8044,7 @@ async function deactivateGlobalProcedure(id) {
|
|
|
7977
8044
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
7978
8045
|
const client = getClient();
|
|
7979
8046
|
const result = await client.execute({
|
|
7980
|
-
sql: "UPDATE
|
|
8047
|
+
sql: "UPDATE company_procedures SET active = 0, updated_at = ? WHERE id = ?",
|
|
7981
8048
|
args: [now, id]
|
|
7982
8049
|
});
|
|
7983
8050
|
await loadGlobalProcedures();
|
|
@@ -14187,12 +14254,12 @@ Rules:
|
|
|
14187
14254
|
};
|
|
14188
14255
|
}
|
|
14189
14256
|
|
|
14190
|
-
// src/
|
|
14257
|
+
// src/lib/providers/anthropic.ts
|
|
14191
14258
|
import Anthropic2 from "@anthropic-ai/sdk";
|
|
14192
14259
|
var AnthropicProvider = class {
|
|
14193
14260
|
name;
|
|
14194
|
-
client;
|
|
14195
14261
|
defaultModel;
|
|
14262
|
+
client;
|
|
14196
14263
|
constructor(name, config2) {
|
|
14197
14264
|
this.name = name;
|
|
14198
14265
|
this.defaultModel = config2.defaultModel ?? "claude-sonnet-4-20250514";
|
|
@@ -14283,13 +14350,13 @@ var AnthropicProvider = class {
|
|
|
14283
14350
|
}
|
|
14284
14351
|
};
|
|
14285
14352
|
|
|
14286
|
-
// src/
|
|
14353
|
+
// src/lib/providers/openai-compat.ts
|
|
14287
14354
|
import OpenAI from "openai";
|
|
14288
14355
|
import { randomUUID as randomUUID7 } from "crypto";
|
|
14289
14356
|
var OpenAICompatProvider = class {
|
|
14290
14357
|
name;
|
|
14291
|
-
client;
|
|
14292
14358
|
defaultModel;
|
|
14359
|
+
client;
|
|
14293
14360
|
constructor(name, config2) {
|
|
14294
14361
|
this.name = name;
|
|
14295
14362
|
this.defaultModel = config2.defaultModel ?? "gpt-4o";
|
|
@@ -14419,12 +14486,12 @@ var OpenAICompatProvider = class {
|
|
|
14419
14486
|
}
|
|
14420
14487
|
};
|
|
14421
14488
|
|
|
14422
|
-
// src/
|
|
14489
|
+
// src/lib/providers/ollama.ts
|
|
14423
14490
|
import { randomUUID as randomUUID8 } from "crypto";
|
|
14424
14491
|
var OllamaProvider = class {
|
|
14425
14492
|
name;
|
|
14426
|
-
host;
|
|
14427
14493
|
defaultModel;
|
|
14494
|
+
host;
|
|
14428
14495
|
constructor(name, config2 = {}) {
|
|
14429
14496
|
this.name = name;
|
|
14430
14497
|
this.host = (config2.host ?? "http://localhost:11434").replace(/\/+$/, "");
|