@virsanghavi/axis-server 1.9.0 → 1.9.1

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.
@@ -827,7 +827,7 @@ var NerveCenter = class _NerveCenter {
827
827
  delete this.state.locks[filePath];
828
828
  await this.saveState();
829
829
  }
830
- this.logLockEvent("FORCE_UNLOCKED", filePath, "admin", void 0, reason);
830
+ await this.logLockEvent("FORCE_UNLOCKED", filePath, "admin", void 0, reason);
831
831
  await this.appendToNotepad(`
832
832
  - [FORCE UNLOCK] ${filePath} unlocked by admin. Reason: ${reason}`);
833
833
  return `File ${filePath} has been forcibly unlocked.`;
@@ -854,6 +854,7 @@ ${notepad}`;
854
854
  async logLockEvent(eventType, filePath, requestingAgent, blockingAgent, intent) {
855
855
  try {
856
856
  if (this.contextManager.apiUrl) {
857
+ logger.info(`[logLockEvent] Logging ${eventType} event via API for ${filePath} (agent: ${requestingAgent}, blocker: ${blockingAgent || "none"})`);
857
858
  await this.callCoordination("lock-events", "POST", {
858
859
  eventType,
859
860
  filePath,
@@ -861,7 +862,9 @@ ${notepad}`;
861
862
  blockingAgent: blockingAgent || null,
862
863
  intent: intent || null
863
864
  });
865
+ logger.info(`[logLockEvent] Successfully logged ${eventType} event`);
864
866
  } else if (this.useSupabase && this.supabase && this._projectId) {
867
+ logger.info(`[logLockEvent] Logging ${eventType} event via Supabase for ${filePath}`);
865
868
  await this.supabase.from("lock_events").insert({
866
869
  project_id: this._projectId,
867
870
  event_type: eventType,
@@ -870,9 +873,12 @@ ${notepad}`;
870
873
  blocking_agent: blockingAgent || null,
871
874
  intent: intent || null
872
875
  });
876
+ logger.info(`[logLockEvent] Successfully logged ${eventType} event`);
877
+ } else {
878
+ logger.warn(`[logLockEvent] No persistence backend available \u2014 ${eventType} event for ${filePath} will not be recorded`);
873
879
  }
874
880
  } catch (e) {
875
- logger.warn(`[logLockEvent] Failed to log ${eventType} event: ${e.message}`);
881
+ logger.error(`[logLockEvent] Failed to log ${eventType} event for ${filePath}: ${e.message}`);
876
882
  }
877
883
  }
878
884
  // --- Decision & Orchestration ---
@@ -972,7 +978,7 @@ ${notepad}`;
972
978
  });
973
979
  if (result.status === "DENIED") {
974
980
  logger.info(`[proposeFileAccess] DENIED by server: ${result.message}`);
975
- this.logLockEvent("BLOCKED", normalizedPath, agentId, result.current_lock?.agent_id, intent);
981
+ await this.logLockEvent("BLOCKED", normalizedPath, agentId, result.current_lock?.agent_id, intent);
976
982
  return {
977
983
  status: "REQUIRES_ORCHESTRATION",
978
984
  message: result.message || `File '${normalizedPath}' is locked by another agent`,
@@ -984,7 +990,7 @@ ${notepad}`;
984
990
  return { status: "REJECTED", message: result.message };
985
991
  }
986
992
  logger.info(`[proposeFileAccess] GRANTED by server`);
987
- this.logLockEvent("GRANTED", normalizedPath, agentId, void 0, intent);
993
+ await this.logLockEvent("GRANTED", normalizedPath, agentId, void 0, intent);
988
994
  await this.appendToNotepad(`
989
995
  - [LOCK] ${agentId} locked ${normalizedPath}
990
996
  Intent: ${intent}`);
@@ -1001,7 +1007,7 @@ ${notepad}`;
1001
1007
  }
1002
1008
  } catch {
1003
1009
  }
1004
- this.logLockEvent("BLOCKED", normalizedPath, agentId, blockingAgent, intent);
1010
+ await this.logLockEvent("BLOCKED", normalizedPath, agentId, blockingAgent, intent);
1005
1011
  return {
1006
1012
  status: "REQUIRES_ORCHESTRATION",
1007
1013
  message: `File '${normalizedPath}' is locked by another agent`
@@ -1024,7 +1030,7 @@ ${notepad}`;
1024
1030
  if (error) throw error;
1025
1031
  const row = Array.isArray(data) ? data[0] : data;
1026
1032
  if (row && row.status === "DENIED") {
1027
- this.logLockEvent("BLOCKED", normalizedPath, agentId, row.owner_id, intent);
1033
+ await this.logLockEvent("BLOCKED", normalizedPath, agentId, row.owner_id, intent);
1028
1034
  return {
1029
1035
  status: "REQUIRES_ORCHESTRATION",
1030
1036
  message: `Conflict: File '${normalizedPath}' is locked by '${row.owner_id}'`,
@@ -1036,7 +1042,7 @@ ${notepad}`;
1036
1042
  }
1037
1043
  };
1038
1044
  }
1039
- this.logLockEvent("GRANTED", normalizedPath, agentId, void 0, intent);
1045
+ await this.logLockEvent("GRANTED", normalizedPath, agentId, void 0, intent);
1040
1046
  await this.appendToNotepad(`
1041
1047
  - [LOCK] ${agentId} locked ${normalizedPath}
1042
1048
  Intent: ${intent}`);
@@ -1048,7 +1054,7 @@ ${notepad}`;
1048
1054
  const allLocks = Object.values(this.state.locks);
1049
1055
  const conflict = this.findExactConflict(filePath, agentId, allLocks);
1050
1056
  if (conflict) {
1051
- this.logLockEvent("BLOCKED", normalizedPath, agentId, conflict.agentId, intent);
1057
+ await this.logLockEvent("BLOCKED", normalizedPath, agentId, conflict.agentId, intent);
1052
1058
  return {
1053
1059
  status: "REQUIRES_ORCHESTRATION",
1054
1060
  message: `Conflict: File '${normalizedPath}' is locked by '${conflict.agentId}'`,
@@ -1057,7 +1063,7 @@ ${notepad}`;
1057
1063
  }
1058
1064
  this.state.locks[normalizedPath] = { agentId, filePath: normalizedPath, intent, userPrompt, timestamp: Date.now() };
1059
1065
  await this.saveState();
1060
- this.logLockEvent("GRANTED", normalizedPath, agentId, void 0, intent);
1066
+ await this.logLockEvent("GRANTED", normalizedPath, agentId, void 0, intent);
1061
1067
  await this.appendToNotepad(`
1062
1068
  - [LOCK] ${agentId} locked ${normalizedPath}
1063
1069
  Intent: ${intent}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@virsanghavi/axis-server",
3
- "version": "1.9.0",
3
+ "version": "1.9.1",
4
4
  "description": "Axis MCP Server CLI",
5
5
  "main": "dist/index.js",
6
6
  "bin": {