@a2a-exposed/control-core 0.8.15 → 0.8.17

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.
Files changed (2) hide show
  1. package/dist/index.js +9 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -3010,6 +3010,12 @@ var oidc_txns_default = "-- Short-lived OpenID Connect sign-in (authorization co
3010
3010
  // sql-raw:/home/runner/work/a2a-exposed/a2a-exposed/worker/migrations/0009_outbound_seen.sql
3011
3011
  var outbound_seen_default = "-- A reply pushed onto an outbound task stays in the inbox until that list is read.\nALTER TABLE outbound ADD COLUMN updates_seen INTEGER NOT NULL DEFAULT 0;\n";
3012
3012
 
3013
+ // sql-raw:/home/runner/work/a2a-exposed/a2a-exposed/worker/migrations/0010_conversation_peer.sql
3014
+ var conversation_peer_default = "-- A wake is one peer's conversation. Two peers can use the same context id without sharing a row.\nCREATE TABLE wakes_peer (\n context_id TEXT NOT NULL,\n peer TEXT NOT NULL DEFAULT '',\n last_sent_ms INTEGER NOT NULL DEFAULT 0,\n pending_json TEXT,\n pending_since_ms INTEGER,\n PRIMARY KEY (context_id, peer)\n);\nINSERT INTO wakes_peer (context_id, peer, last_sent_ms, pending_json, pending_since_ms)\nSELECT\n w.context_id,\n COALESCE(\n NULLIF(json_extract(w.pending_json, '$.from'), ''),\n (SELECT t.peer FROM tasks t WHERE t.context_id = w.context_id AND t.peer IS NOT NULL AND t.peer != '' ORDER BY t.created_at, t.id LIMIT 1),\n (SELECT h.peer FROM history h WHERE h.context_id = w.context_id AND h.peer IS NOT NULL AND h.peer != '' ORDER BY h.seq LIMIT 1),\n ''\n ),\n w.last_sent_ms,\n w.pending_json,\n w.pending_since_ms\nFROM wakes w;\nDROP TABLE wakes;\nALTER TABLE wakes_peer RENAME TO wakes;\nCREATE INDEX IF NOT EXISTS history_peer_ctx ON history(peer, context_id, seq);\n";
3015
+
3016
+ // sql-raw:/home/runner/work/a2a-exposed/a2a-exposed/worker/migrations/0011_conversation_owner.sql
3017
+ var conversation_owner_default = "-- One owner per context id. The first peer to insert the row keeps it (ON CONFLICT DO NOTHING).\nCREATE TABLE conversation_owners (\n context_id TEXT NOT NULL PRIMARY KEY,\n peer TEXT NOT NULL,\n created_at TEXT NOT NULL\n);\nINSERT INTO conversation_owners (context_id, peer, created_at)\nSELECT t.context_id, t.peer, t.created_at\nFROM tasks t\nWHERE t.peer IS NOT NULL AND t.peer != ''\n AND NOT EXISTS (\n SELECT 1 FROM tasks t2\n WHERE t2.context_id = t.context_id AND t2.peer IS NOT NULL AND t2.peer != ''\n AND (t2.created_at < t.created_at OR (t2.created_at = t.created_at AND t2.id < t.id))\n );\nINSERT INTO conversation_owners (context_id, peer, created_at)\nSELECT h.context_id, h.peer, h.ts\nFROM history h\nWHERE h.peer IS NOT NULL AND h.peer != ''\n AND NOT EXISTS (SELECT 1 FROM conversation_owners o WHERE o.context_id = h.context_id)\n AND NOT EXISTS (\n SELECT 1 FROM history h2\n WHERE h2.context_id = h.context_id AND h2.peer IS NOT NULL AND h2.peer != '' AND h2.seq < h.seq\n );\nINSERT INTO conversation_owners (context_id, peer, created_at)\nSELECT o.context_id, o.peer, o.sent_at\nFROM outbound o\nWHERE o.peer IS NOT NULL AND o.peer != ''\n AND NOT EXISTS (SELECT 1 FROM conversation_owners c WHERE c.context_id = o.context_id)\n AND NOT EXISTS (\n SELECT 1 FROM outbound o2\n WHERE o2.context_id = o.context_id AND o2.peer IS NOT NULL AND o2.peer != ''\n AND (o2.sent_at < o.sent_at OR (o2.sent_at = o.sent_at AND o2.task_id < o.task_id))\n );\n";
3018
+
3013
3019
  // src/provision/inbox-migrations.ts
3014
3020
  var INBOX_MIGRATIONS = [
3015
3021
  { name: "0001_init.sql", sql: init_default },
@@ -3020,7 +3026,9 @@ var INBOX_MIGRATIONS = [
3020
3026
  { name: "0006_mcp.sql", sql: mcp_default },
3021
3027
  { name: "0007_cimd.sql", sql: cimd_default },
3022
3028
  { name: "0008_oidc_txns.sql", sql: oidc_txns_default },
3023
- { name: "0009_outbound_seen.sql", sql: outbound_seen_default }
3029
+ { name: "0009_outbound_seen.sql", sql: outbound_seen_default },
3030
+ { name: "0010_conversation_peer.sql", sql: conversation_peer_default },
3031
+ { name: "0011_conversation_owner.sql", sql: conversation_owner_default }
3024
3032
  ];
3025
3033
 
3026
3034
  // sql-raw:/home/runner/work/a2a-exposed/a2a-exposed/control/migrations/0001_auth.sql
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@a2a-exposed/control-core",
3
- "version": "0.8.15",
3
+ "version": "0.8.17",
4
4
  "description": "A2A endpoint provisioning, routing, and D1 migrations for a2a-exposed.",
5
5
  "type": "module",
6
6
  "scripts": {