agent-relay-server 0.119.2 → 0.119.3

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/docs/openapi.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "openapi": "3.1.0",
3
3
  "info": {
4
4
  "title": "Agent Relay API",
5
- "version": "0.119.2",
5
+ "version": "0.119.3",
6
6
  "description": "Real-time message bus for inter-agent communication. Agent-first: this spec is designed for machine consumption — agents can self-discover the full API surface via GET /api/spec.",
7
7
  "license": {
8
8
  "name": "MIT",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-relay-server",
3
- "version": "0.119.2",
3
+ "version": "0.119.3",
4
4
  "description": "Lightweight HTTP message relay for inter-agent communication across machines",
5
5
  "module": "src/index.ts",
6
6
  "type": "module",
@@ -37,7 +37,7 @@
37
37
  "CONTRIBUTING.md"
38
38
  ],
39
39
  "dependencies": {
40
- "agent-relay-channels-host": "0.119.2",
40
+ "agent-relay-channels-host": "0.119.3",
41
41
  "agent-relay-providers": "0.104.2",
42
42
  "agent-relay-sdk": "0.2.104",
43
43
  "ajv": "^8.20.0"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "agent-relay-runner",
3
3
  "description": "Thin Agent Relay runner bridge for Claude Code",
4
- "version": "0.119.2",
4
+ "version": "0.119.3",
5
5
  "agentRelayContracts": {
6
6
  "providerPluginProtocol": 1
7
7
  }
@@ -201,7 +201,7 @@ export function applyMigrations(): void {
201
201
  getDb().run("ALTER TABLE activity_events ADD COLUMN issue_action TEXT");
202
202
  }
203
203
  getDb().run("CREATE INDEX IF NOT EXISTS idx_activity_issue ON activity_events(issue_ref_id, created_at)");
204
- getDb().run("CREATE INDEX IF NOT EXISTS idx_activity_agent_issue ON activity_events(agent_id, issue_ref_id, created_at)");
204
+ getDb().run("CREATE INDEX IF NOT EXISTS idx_activity_agent_issue ON activity_events(agent_id, issue_ref_id, created_at)"); getDb().run("CREATE INDEX IF NOT EXISTS idx_activity_policy_created ON activity_events(json_extract(metadata, '$.policyName'), created_at DESC, id DESC)");
205
205
 
206
206
  getDb().run(`
207
207
  CREATE TABLE IF NOT EXISTS workspace_merge_pauses (
@@ -352,7 +352,7 @@ export function applyMigrations(): void {
352
352
  created_at INTEGER NOT NULL
353
353
  )
354
354
  `);
355
- getDb().run("CREATE INDEX IF NOT EXISTS idx_mda_message ON message_delivery_attempts(message_id, created_at DESC)");
355
+ getDb().run("CREATE INDEX IF NOT EXISTS idx_mda_message ON message_delivery_attempts(message_id, created_at DESC)"); getDb().run("CREATE INDEX IF NOT EXISTS idx_mda_agent_created ON message_delivery_attempts(agent_id, created_at DESC)");
356
356
 
357
357
  const channelBindingsSql = getDb().query("SELECT sql FROM sqlite_master WHERE type = 'table' AND name = 'channel_bindings'").get() as { sql?: string } | undefined;
358
358
  if (channelBindingsSql?.sql?.includes("UNIQUE(channel_id, conversation_key)")) {
@@ -398,7 +398,7 @@ export function applyMigrations(): void {
398
398
  getDb().run("ALTER TABLE messages ADD COLUMN payload TEXT NOT NULL DEFAULT '{}'");
399
399
  }
400
400
  getDb().run("CREATE INDEX IF NOT EXISTS idx_msg_kind ON messages(kind)");
401
- getDb().run("CREATE INDEX IF NOT EXISTS idx_msg_from_kind_id ON messages(from_agent, kind, id)");
401
+ getDb().run("CREATE INDEX IF NOT EXISTS idx_msg_from_kind_id ON messages(from_agent, kind, id)"); getDb().run("CREATE INDEX IF NOT EXISTS idx_msg_analytics_created ON messages(created_at, kind, from_agent, claimable, reply_to)"); getDb().run("CREATE INDEX IF NOT EXISTS idx_msg_session_analytics ON messages(kind, created_at, json_extract(payload, '$.session.type'), json_extract(payload, '$.session.label'), json_extract(payload, '$.session.turnId'))");
402
402
  // (from_agent, idempotency_key) powers findMessageByIdempotencyKey — the retry-dedup lookup
403
403
  // AND the session-step in-place upsert (Codex tool running→completed / streamed reasoning),
404
404
  // which runs per persisted session step. Added here (not the base schema) because the column
@@ -1186,6 +1186,6 @@ export function applyMigrations(): void {
1186
1186
  .query("SELECT 1 FROM sqlite_master WHERE type='index' AND name='idx_msg_to'")
1187
1187
  .get();
1188
1188
  getDb().run("DROP INDEX IF EXISTS idx_msg_to");
1189
- getDb().run("DROP INDEX IF EXISTS idx_msg_resolved_to_agent");
1189
+ getDb().run("DROP INDEX IF EXISTS idx_msg_resolved_to_agent"); getDb().run("CREATE INDEX IF NOT EXISTS idx_commands_target_updated ON commands(target, updated_at DESC, created_at DESC)");
1190
1190
  if (hasOldToIdx) getDb().run("ANALYZE messages");
1191
1191
  }
package/src/db/schema.ts CHANGED
@@ -509,7 +509,7 @@ export function initDb(path: string = "agent-relay.db"): Database {
509
509
  poison_reason TEXT,
510
510
  created_at INTEGER NOT NULL
511
511
  );
512
- CREATE INDEX IF NOT EXISTS idx_mda_message ON message_delivery_attempts(message_id, created_at DESC);
512
+ CREATE INDEX IF NOT EXISTS idx_mda_message ON message_delivery_attempts(message_id, created_at DESC); CREATE INDEX IF NOT EXISTS idx_mda_agent_created ON message_delivery_attempts(agent_id, created_at DESC);
513
513
 
514
514
  CREATE TABLE IF NOT EXISTS config (
515
515
  namespace TEXT NOT NULL,
@@ -864,7 +864,7 @@ export function initDb(path: string = "agent-relay.db"): Database {
864
864
  );
865
865
  CREATE INDEX IF NOT EXISTS idx_activity_operator ON activity_events(operator_id, created_at);
866
866
  CREATE INDEX IF NOT EXISTS idx_activity_created ON activity_events(created_at);
867
- CREATE INDEX IF NOT EXISTS idx_activity_agent ON activity_events(agent_id, created_at);
867
+ CREATE INDEX IF NOT EXISTS idx_activity_agent ON activity_events(agent_id, created_at); CREATE INDEX IF NOT EXISTS idx_activity_policy_created ON activity_events(json_extract(metadata, '$.policyName'), created_at DESC, id DESC);
868
868
  -- issue_ref_id/issue_action indexes are created in applyMigrations() AFTER the ALTER — never inline here (#483: inline index over a not-yet-migrated column crashes initDb on existing DBs).
869
869
 
870
870
  CREATE TABLE IF NOT EXISTS channels (
@@ -938,7 +938,7 @@ export function initDb(path: string = "agent-relay.db"): Database {
938
938
  updated_at INTEGER NOT NULL,
939
939
  expires_at INTEGER
940
940
  );
941
- CREATE INDEX IF NOT EXISTS idx_commands_target ON commands(target);
941
+ CREATE INDEX IF NOT EXISTS idx_commands_target ON commands(target); CREATE INDEX IF NOT EXISTS idx_commands_target_updated ON commands(target, updated_at DESC, created_at DESC);
942
942
  CREATE INDEX IF NOT EXISTS idx_commands_status ON commands(status);
943
943
  CREATE INDEX IF NOT EXISTS idx_commands_created ON commands(created_at);
944
944
  CREATE INDEX IF NOT EXISTS idx_commands_correlation ON commands(correlation_id);