@askexenow/exe-os 0.8.47 → 0.8.49

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.
@@ -5404,6 +5404,7 @@ __export(cloud_sync_exports, {
5404
5404
  cloudPullBlob: () => cloudPullBlob,
5405
5405
  cloudPullConversations: () => cloudPullConversations,
5406
5406
  cloudPullDocuments: () => cloudPullDocuments,
5407
+ cloudPullGlobalProcedures: () => cloudPullGlobalProcedures,
5407
5408
  cloudPullGraphRAG: () => cloudPullGraphRAG,
5408
5409
  cloudPullRoster: () => cloudPullRoster,
5409
5410
  cloudPullTasks: () => cloudPullTasks,
@@ -5412,6 +5413,7 @@ __export(cloud_sync_exports, {
5412
5413
  cloudPushBlob: () => cloudPushBlob,
5413
5414
  cloudPushConversations: () => cloudPushConversations,
5414
5415
  cloudPushDocuments: () => cloudPushDocuments,
5416
+ cloudPushGlobalProcedures: () => cloudPushGlobalProcedures,
5415
5417
  cloudPushGraphRAG: () => cloudPushGraphRAG,
5416
5418
  cloudPushRoster: () => cloudPushRoster,
5417
5419
  cloudPushTasks: () => cloudPushTasks,
@@ -5671,6 +5673,16 @@ async function cloudSync(config) {
5671
5673
  } catch (err) {
5672
5674
  logError(`[cloud-sync] Roster pull: ${err instanceof Error ? err.message : String(err)}`);
5673
5675
  }
5676
+ try {
5677
+ await cloudPushGlobalProcedures(config);
5678
+ } catch (err) {
5679
+ logError(`[cloud-sync] Global procedures push: ${err instanceof Error ? err.message : String(err)}`);
5680
+ }
5681
+ try {
5682
+ await cloudPullGlobalProcedures(config);
5683
+ } catch (err) {
5684
+ logError(`[cloud-sync] Global procedures pull: ${err instanceof Error ? err.message : String(err)}`);
5685
+ }
5674
5686
  let behaviorsResult = { pushed: false, pulled: 0 };
5675
5687
  try {
5676
5688
  behaviorsResult.pushed = await cloudPushBehaviors(config);
@@ -5984,6 +5996,43 @@ async function cloudPullBlob(route, config) {
5984
5996
  return null;
5985
5997
  }
5986
5998
  }
5999
+ async function cloudPushGlobalProcedures(config) {
6000
+ const client = getClient();
6001
+ const result = await client.execute("SELECT * FROM global_procedures LIMIT 1000");
6002
+ const rows = result.rows;
6003
+ const { ok } = await cloudPushBlob(
6004
+ "/sync/push-global-procedures",
6005
+ rows,
6006
+ "last_global_procedures_push_version",
6007
+ config
6008
+ );
6009
+ return ok;
6010
+ }
6011
+ async function cloudPullGlobalProcedures(config) {
6012
+ const remoteProcs = await cloudPullBlob(
6013
+ "/sync/pull-global-procedures",
6014
+ config
6015
+ );
6016
+ if (!remoteProcs || remoteProcs.length === 0) return { pulled: 0 };
6017
+ const client = getClient();
6018
+ const stmts = remoteProcs.map((p) => ({
6019
+ sql: `INSERT OR IGNORE INTO global_procedures
6020
+ (id, title, content, priority, domain, active, created_at, updated_at)
6021
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?)`,
6022
+ args: [
6023
+ p.id ?? null,
6024
+ p.title ?? null,
6025
+ p.content ?? null,
6026
+ p.priority ?? "p0",
6027
+ p.domain ?? null,
6028
+ p.active ?? 1,
6029
+ p.created_at ?? null,
6030
+ p.updated_at ?? null
6031
+ ]
6032
+ }));
6033
+ await client.batch(stmts, "write");
6034
+ return { pulled: remoteProcs.length };
6035
+ }
5987
6036
  async function cloudPushBehaviors(config) {
5988
6037
  const client = getClient();
5989
6038
  const result = await client.execute("SELECT * FROM behaviors LIMIT 10000");
@@ -482,6 +482,7 @@ __export(cloud_sync_exports, {
482
482
  cloudPullBlob: () => cloudPullBlob,
483
483
  cloudPullConversations: () => cloudPullConversations,
484
484
  cloudPullDocuments: () => cloudPullDocuments,
485
+ cloudPullGlobalProcedures: () => cloudPullGlobalProcedures,
485
486
  cloudPullGraphRAG: () => cloudPullGraphRAG,
486
487
  cloudPullRoster: () => cloudPullRoster,
487
488
  cloudPullTasks: () => cloudPullTasks,
@@ -490,6 +491,7 @@ __export(cloud_sync_exports, {
490
491
  cloudPushBlob: () => cloudPushBlob,
491
492
  cloudPushConversations: () => cloudPushConversations,
492
493
  cloudPushDocuments: () => cloudPushDocuments,
494
+ cloudPushGlobalProcedures: () => cloudPushGlobalProcedures,
493
495
  cloudPushGraphRAG: () => cloudPushGraphRAG,
494
496
  cloudPushRoster: () => cloudPushRoster,
495
497
  cloudPushTasks: () => cloudPushTasks,
@@ -749,6 +751,16 @@ async function cloudSync(config) {
749
751
  } catch (err) {
750
752
  logError(`[cloud-sync] Roster pull: ${err instanceof Error ? err.message : String(err)}`);
751
753
  }
754
+ try {
755
+ await cloudPushGlobalProcedures(config);
756
+ } catch (err) {
757
+ logError(`[cloud-sync] Global procedures push: ${err instanceof Error ? err.message : String(err)}`);
758
+ }
759
+ try {
760
+ await cloudPullGlobalProcedures(config);
761
+ } catch (err) {
762
+ logError(`[cloud-sync] Global procedures pull: ${err instanceof Error ? err.message : String(err)}`);
763
+ }
752
764
  let behaviorsResult = { pushed: false, pulled: 0 };
753
765
  try {
754
766
  behaviorsResult.pushed = await cloudPushBehaviors(config);
@@ -1062,6 +1074,43 @@ async function cloudPullBlob(route, config) {
1062
1074
  return null;
1063
1075
  }
1064
1076
  }
1077
+ async function cloudPushGlobalProcedures(config) {
1078
+ const client = getClient();
1079
+ const result = await client.execute("SELECT * FROM global_procedures LIMIT 1000");
1080
+ const rows = result.rows;
1081
+ const { ok } = await cloudPushBlob(
1082
+ "/sync/push-global-procedures",
1083
+ rows,
1084
+ "last_global_procedures_push_version",
1085
+ config
1086
+ );
1087
+ return ok;
1088
+ }
1089
+ async function cloudPullGlobalProcedures(config) {
1090
+ const remoteProcs = await cloudPullBlob(
1091
+ "/sync/pull-global-procedures",
1092
+ config
1093
+ );
1094
+ if (!remoteProcs || remoteProcs.length === 0) return { pulled: 0 };
1095
+ const client = getClient();
1096
+ const stmts = remoteProcs.map((p) => ({
1097
+ sql: `INSERT OR IGNORE INTO global_procedures
1098
+ (id, title, content, priority, domain, active, created_at, updated_at)
1099
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?)`,
1100
+ args: [
1101
+ p.id ?? null,
1102
+ p.title ?? null,
1103
+ p.content ?? null,
1104
+ p.priority ?? "p0",
1105
+ p.domain ?? null,
1106
+ p.active ?? 1,
1107
+ p.created_at ?? null,
1108
+ p.updated_at ?? null
1109
+ ]
1110
+ }));
1111
+ await client.batch(stmts, "write");
1112
+ return { pulled: remoteProcs.length };
1113
+ }
1065
1114
  async function cloudPushBehaviors(config) {
1066
1115
  const client = getClient();
1067
1116
  const result = await client.execute("SELECT * FROM behaviors LIMIT 10000");
@@ -672,6 +672,25 @@ function summarizeSymlinkResults(results) {
672
672
  }
673
673
 
674
674
  // src/bin/install.ts
675
+ import { existsSync as existsSync5, readFileSync as readFileSync4, unlinkSync } from "fs";
676
+ import path5 from "path";
677
+ import { homedir } from "os";
678
+ function killStaleDaemon() {
679
+ try {
680
+ const pidPath = path5.join(homedir(), ".exe-os", "exed.pid");
681
+ if (!existsSync5(pidPath)) return;
682
+ const pid = parseInt(readFileSync4(pidPath, "utf8").trim(), 10);
683
+ if (isNaN(pid)) return;
684
+ process.kill(pid, "SIGTERM");
685
+ try {
686
+ unlinkSync(pidPath);
687
+ } catch {
688
+ }
689
+ process.stderr.write(`exe-os: restarted daemon (PID ${pid}) for new version
690
+ `);
691
+ } catch {
692
+ }
693
+ }
675
694
  var args = process.argv.slice(2);
676
695
  if (args.includes("--commands-only")) {
677
696
  try {
@@ -688,6 +707,7 @@ if (args.includes("--commands-only")) {
688
707
  } else if (args.includes("--global")) {
689
708
  try {
690
709
  await runInstaller();
710
+ killStaleDaemon();
691
711
  } catch (err) {
692
712
  console.error(
693
713
  "Installation failed:",
@@ -2546,6 +2546,7 @@ __export(cloud_sync_exports, {
2546
2546
  cloudPullBlob: () => cloudPullBlob,
2547
2547
  cloudPullConversations: () => cloudPullConversations,
2548
2548
  cloudPullDocuments: () => cloudPullDocuments,
2549
+ cloudPullGlobalProcedures: () => cloudPullGlobalProcedures,
2549
2550
  cloudPullGraphRAG: () => cloudPullGraphRAG,
2550
2551
  cloudPullRoster: () => cloudPullRoster,
2551
2552
  cloudPullTasks: () => cloudPullTasks,
@@ -2554,6 +2555,7 @@ __export(cloud_sync_exports, {
2554
2555
  cloudPushBlob: () => cloudPushBlob,
2555
2556
  cloudPushConversations: () => cloudPushConversations,
2556
2557
  cloudPushDocuments: () => cloudPushDocuments,
2558
+ cloudPushGlobalProcedures: () => cloudPushGlobalProcedures,
2557
2559
  cloudPushGraphRAG: () => cloudPushGraphRAG,
2558
2560
  cloudPushRoster: () => cloudPushRoster,
2559
2561
  cloudPushTasks: () => cloudPushTasks,
@@ -2813,6 +2815,16 @@ async function cloudSync(config) {
2813
2815
  } catch (err) {
2814
2816
  logError(`[cloud-sync] Roster pull: ${err instanceof Error ? err.message : String(err)}`);
2815
2817
  }
2818
+ try {
2819
+ await cloudPushGlobalProcedures(config);
2820
+ } catch (err) {
2821
+ logError(`[cloud-sync] Global procedures push: ${err instanceof Error ? err.message : String(err)}`);
2822
+ }
2823
+ try {
2824
+ await cloudPullGlobalProcedures(config);
2825
+ } catch (err) {
2826
+ logError(`[cloud-sync] Global procedures pull: ${err instanceof Error ? err.message : String(err)}`);
2827
+ }
2816
2828
  let behaviorsResult = { pushed: false, pulled: 0 };
2817
2829
  try {
2818
2830
  behaviorsResult.pushed = await cloudPushBehaviors(config);
@@ -3126,6 +3138,43 @@ async function cloudPullBlob(route, config) {
3126
3138
  return null;
3127
3139
  }
3128
3140
  }
3141
+ async function cloudPushGlobalProcedures(config) {
3142
+ const client = getClient();
3143
+ const result = await client.execute("SELECT * FROM global_procedures LIMIT 1000");
3144
+ const rows = result.rows;
3145
+ const { ok } = await cloudPushBlob(
3146
+ "/sync/push-global-procedures",
3147
+ rows,
3148
+ "last_global_procedures_push_version",
3149
+ config
3150
+ );
3151
+ return ok;
3152
+ }
3153
+ async function cloudPullGlobalProcedures(config) {
3154
+ const remoteProcs = await cloudPullBlob(
3155
+ "/sync/pull-global-procedures",
3156
+ config
3157
+ );
3158
+ if (!remoteProcs || remoteProcs.length === 0) return { pulled: 0 };
3159
+ const client = getClient();
3160
+ const stmts = remoteProcs.map((p) => ({
3161
+ sql: `INSERT OR IGNORE INTO global_procedures
3162
+ (id, title, content, priority, domain, active, created_at, updated_at)
3163
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?)`,
3164
+ args: [
3165
+ p.id ?? null,
3166
+ p.title ?? null,
3167
+ p.content ?? null,
3168
+ p.priority ?? "p0",
3169
+ p.domain ?? null,
3170
+ p.active ?? 1,
3171
+ p.created_at ?? null,
3172
+ p.updated_at ?? null
3173
+ ]
3174
+ }));
3175
+ await client.batch(stmts, "write");
3176
+ return { pulled: remoteProcs.length };
3177
+ }
3129
3178
  async function cloudPushBehaviors(config) {
3130
3179
  const client = getClient();
3131
3180
  const result = await client.execute("SELECT * FROM behaviors LIMIT 10000");
@@ -501,6 +501,16 @@ async function cloudSync(config) {
501
501
  } catch (err) {
502
502
  logError(`[cloud-sync] Roster pull: ${err instanceof Error ? err.message : String(err)}`);
503
503
  }
504
+ try {
505
+ await cloudPushGlobalProcedures(config);
506
+ } catch (err) {
507
+ logError(`[cloud-sync] Global procedures push: ${err instanceof Error ? err.message : String(err)}`);
508
+ }
509
+ try {
510
+ await cloudPullGlobalProcedures(config);
511
+ } catch (err) {
512
+ logError(`[cloud-sync] Global procedures pull: ${err instanceof Error ? err.message : String(err)}`);
513
+ }
504
514
  let behaviorsResult = { pushed: false, pulled: 0 };
505
515
  try {
506
516
  behaviorsResult.pushed = await cloudPushBehaviors(config);
@@ -815,6 +825,43 @@ async function cloudPullBlob(route, config) {
815
825
  return null;
816
826
  }
817
827
  }
828
+ async function cloudPushGlobalProcedures(config) {
829
+ const client = getClient();
830
+ const result = await client.execute("SELECT * FROM global_procedures LIMIT 1000");
831
+ const rows = result.rows;
832
+ const { ok } = await cloudPushBlob(
833
+ "/sync/push-global-procedures",
834
+ rows,
835
+ "last_global_procedures_push_version",
836
+ config
837
+ );
838
+ return ok;
839
+ }
840
+ async function cloudPullGlobalProcedures(config) {
841
+ const remoteProcs = await cloudPullBlob(
842
+ "/sync/pull-global-procedures",
843
+ config
844
+ );
845
+ if (!remoteProcs || remoteProcs.length === 0) return { pulled: 0 };
846
+ const client = getClient();
847
+ const stmts = remoteProcs.map((p) => ({
848
+ sql: `INSERT OR IGNORE INTO global_procedures
849
+ (id, title, content, priority, domain, active, created_at, updated_at)
850
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?)`,
851
+ args: [
852
+ p.id ?? null,
853
+ p.title ?? null,
854
+ p.content ?? null,
855
+ p.priority ?? "p0",
856
+ p.domain ?? null,
857
+ p.active ?? 1,
858
+ p.created_at ?? null,
859
+ p.updated_at ?? null
860
+ ]
861
+ }));
862
+ await client.batch(stmts, "write");
863
+ return { pulled: remoteProcs.length };
864
+ }
818
865
  async function cloudPushBehaviors(config) {
819
866
  const client = getClient();
820
867
  const result = await client.execute("SELECT * FROM behaviors LIMIT 10000");
@@ -1131,6 +1178,7 @@ export {
1131
1178
  cloudPullBlob,
1132
1179
  cloudPullConversations,
1133
1180
  cloudPullDocuments,
1181
+ cloudPullGlobalProcedures,
1134
1182
  cloudPullGraphRAG,
1135
1183
  cloudPullRoster,
1136
1184
  cloudPullTasks,
@@ -1139,6 +1187,7 @@ export {
1139
1187
  cloudPushBlob,
1140
1188
  cloudPushConversations,
1141
1189
  cloudPushDocuments,
1190
+ cloudPushGlobalProcedures,
1142
1191
  cloudPushGraphRAG,
1143
1192
  cloudPushRoster,
1144
1193
  cloudPushTasks,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@askexenow/exe-os",
3
- "version": "0.8.47",
3
+ "version": "0.8.49",
4
4
  "description": "AI employee operating system — persistent memory, task management, and multi-agent coordination for Claude Code.",
5
5
  "license": "CC-BY-NC-4.0",
6
6
  "type": "module",