@relaycast/engine 6.3.1 → 7.0.0
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/adapters/node/index.d.ts.map +1 -1
- package/dist/adapters/node/index.js +2 -0
- package/dist/adapters/node/index.js.map +1 -1
- package/dist/db/migrations/0033_dm_conversation_reservations.sql +114 -0
- package/dist/db/migrations/0034_node_load_reporting.sql +23 -0
- package/dist/db/schema.d.ts +134 -0
- package/dist/db/schema.d.ts.map +1 -1
- package/dist/db/schema.js +20 -1
- package/dist/db/schema.js.map +1 -1
- package/dist/engine/action.d.ts +1 -0
- package/dist/engine/action.d.ts.map +1 -1
- package/dist/engine/action.js +178 -28
- package/dist/engine/action.js.map +1 -1
- package/dist/engine/agent.d.ts +69 -1
- package/dist/engine/agent.d.ts.map +1 -1
- package/dist/engine/agent.js +186 -58
- package/dist/engine/agent.js.map +1 -1
- package/dist/engine/dm.d.ts +32 -0
- package/dist/engine/dm.d.ts.map +1 -1
- package/dist/engine/dm.js +146 -52
- package/dist/engine/dm.js.map +1 -1
- package/dist/engine/node.d.ts +10 -6
- package/dist/engine/node.d.ts.map +1 -1
- package/dist/engine/node.js +50 -5
- package/dist/engine/node.js.map +1 -1
- package/dist/engine/nodeProvider.d.ts +2 -1
- package/dist/engine/nodeProvider.d.ts.map +1 -1
- package/dist/engine/nodeProvider.js +30 -6
- package/dist/engine/nodeProvider.js.map +1 -1
- package/dist/engine/placement.d.ts.map +1 -1
- package/dist/engine/placement.js +15 -4
- package/dist/engine/placement.js.map +1 -1
- package/dist/engine/presence.d.ts.map +1 -1
- package/dist/engine/presence.js +5 -2
- package/dist/engine/presence.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/routes/agent.js +4 -1
- package/dist/routes/agent.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/node/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAI9D,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,KAAK,wBAAwB,EAAE,MAAM,eAAe,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,KAAK,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AACzG,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/node/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAI9D,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;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6D;IAC7D,QAAQ,CAAC,EAAE,wBAAwB,CAAC;IACpC,+EAA+E;IAC/E,UAAU,CAAC,EAAE,wBAAwB,CAAC;CACvC;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,yFAAyF;IACzF,YAAY,EAAE,iBAAiB,CAAC;IAChC,mFAAmF;IACnF,WAAW,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;IACrD,MAAM,EAAE,cAAc,CAAC;IACvB,gDAAgD;IAChD,KAAK,IAAI,IAAI,CAAC;CACf;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,kBAAkB,GAAG,WAAW,CA0G1E"}
|
|
@@ -10,6 +10,7 @@ import { InProcessKeyValueStore } from './kv.js';
|
|
|
10
10
|
import { DurableEventQueue, InProcessEventQueue } from './event-queue.js';
|
|
11
11
|
import { LocalFileStorage, createFileRouteHandler, FILE_ROUTE_PREFIX } from './files.js';
|
|
12
12
|
import { sweepOfflineNodes } from '../../engine/node.js';
|
|
13
|
+
import { sweepStaleAgents } from '../../engine/agent.js';
|
|
13
14
|
import { sweepTimedOutInvocations } from '../../engine/action.js';
|
|
14
15
|
import { sendNodePresenceContext } from '../../engine/nodeContext.js';
|
|
15
16
|
import { createDeliveryMaintenanceRunner } from './delivery-maintenance.js';
|
|
@@ -87,6 +88,7 @@ export function createNodeRuntime(options) {
|
|
|
87
88
|
realtime.setNodeCompletionDeps(deps);
|
|
88
89
|
const runDeliveryMaintenance = createDeliveryMaintenanceRunner(deps);
|
|
89
90
|
const sweepTimer = setInterval(() => {
|
|
91
|
+
void sweepStaleAgents(db).catch(() => { });
|
|
90
92
|
void sweepOfflineNodes(db, realtime, deps).catch(() => { });
|
|
91
93
|
void sweepTimedOutInvocations(db, realtime, { completionDeps: deps }).catch(() => { });
|
|
92
94
|
void runDeliveryMaintenance();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adapters/node/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAK1C,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AACpF,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAuB,MAAM,eAAe,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAiC,MAAM,eAAe,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAiC,MAAM,kBAAkB,CAAC;AACzG,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,+BAA+B,EAAE,MAAM,2BAA2B,CAAC;AAE5E,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EACtB,iBAAiB,EACjB,WAAW,EACX,aAAa,GACd,CAAC;AAiDF;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAA2B;IAC3D,MAAM,MAAM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,CAAC;YACxB,CAAC;YAAC,MAAM,CAAC;gBACP,iBAAiB;YACnB,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
-- Bind every deterministic 1:1 DM id to the workspace and sorted participant
|
|
2
|
+
-- pair that derived it. The primary key is the atomic reservation seam: a
|
|
3
|
+
-- conflicting digest can never overwrite or alias another pair's conversation.
|
|
4
|
+
CREATE TABLE dm_conversation_reservations (
|
|
5
|
+
conversation_id TEXT PRIMARY KEY,
|
|
6
|
+
workspace_id TEXT NOT NULL REFERENCES workspaces(id) ON DELETE CASCADE,
|
|
7
|
+
participant_one_id TEXT NOT NULL,
|
|
8
|
+
participant_two_id TEXT NOT NULL,
|
|
9
|
+
created_at INTEGER NOT NULL DEFAULT (unixepoch()),
|
|
10
|
+
CONSTRAINT dm_conversation_reservations_sorted_pair_check
|
|
11
|
+
CHECK (participant_one_id <= participant_two_id)
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
CREATE UNIQUE INDEX dm_conversation_reservations_pair_unique
|
|
15
|
+
ON dm_conversation_reservations (workspace_id, participant_one_id, participant_two_id);
|
|
16
|
+
|
|
17
|
+
-- PRE-FLIGHT AUDIT — run BEFORE applying this migration.
|
|
18
|
+
--
|
|
19
|
+
-- The single command to trust is the script in (b); it runs both checks. The SQL
|
|
20
|
+
-- in (a) is here so the cheap check can be run by hand without Node.
|
|
21
|
+
--
|
|
22
|
+
-- (a) DUPLICATE PAIRS among the conversations that will be reserved. Two
|
|
23
|
+
-- distinct 1:1 conversations in one workspace resolving to the same sorted
|
|
24
|
+
-- pair can only yield one reservation; the second violates
|
|
25
|
+
-- dm_conversation_reservations_pair_unique and ABORTS this migration.
|
|
26
|
+
--
|
|
27
|
+
-- SELECT workspace_id, participant_one_id, participant_two_id,
|
|
28
|
+
-- COUNT(*) AS conversations
|
|
29
|
+
-- FROM (
|
|
30
|
+
-- SELECT dc.workspace_id,
|
|
31
|
+
-- MIN(dp.agent_id) AS participant_one_id,
|
|
32
|
+
-- MAX(dp.agent_id) AS participant_two_id
|
|
33
|
+
-- FROM dm_conversations dc
|
|
34
|
+
-- JOIN dm_participants dp ON dp.conversation_id = dc.id
|
|
35
|
+
-- WHERE dc.dm_type = '1:1'
|
|
36
|
+
-- GROUP BY dc.id, dc.workspace_id
|
|
37
|
+
-- HAVING COUNT(DISTINCT dp.agent_id) = 2
|
|
38
|
+
-- )
|
|
39
|
+
-- GROUP BY workspace_id, participant_one_id, participant_two_id
|
|
40
|
+
-- HAVING conversations > 1;
|
|
41
|
+
--
|
|
42
|
+
-- The `= 2` must match the backfill below. An earlier revision of this
|
|
43
|
+
-- comment carried `BETWEEN 1 AND 2`, left over from when the backfill also
|
|
44
|
+
-- reserved one-row rosters; run by hand it reports phantom blockers, because
|
|
45
|
+
-- one-row rosters are no longer reserved and cannot collide.
|
|
46
|
+
--
|
|
47
|
+
-- (b) IDS THAT DO NOT MATCH THE CURRENT DERIVATION. This cannot be expressed in
|
|
48
|
+
-- SQL — it needs SHA-256, which SQLite does not have — and it is the check
|
|
49
|
+
-- that matters most, because it is the only failure that is INVISIBLE AT
|
|
50
|
+
-- MIGRATION TIME. (a) aborts loudly. (b) lets the migration succeed, and then
|
|
51
|
+
-- every subsequent DM between that pair returns 409 forever, because the pair
|
|
52
|
+
-- was reserved under an id the send path will never re-derive.
|
|
53
|
+
--
|
|
54
|
+
-- Run: node scripts/audit-dm-reservations.mjs --sqlite <path>
|
|
55
|
+
-- D1: wrangler d1 execute <DB> --json --command "<see script header>" \
|
|
56
|
+
-- | node scripts/audit-dm-reservations.mjs --stdin
|
|
57
|
+
--
|
|
58
|
+
-- The script runs (a) as well, and additionally reports the skipped one-row
|
|
59
|
+
-- rosters split into genuine self-DMs and orphaned two-party conversations.
|
|
60
|
+
--
|
|
61
|
+
-- Clean means this migration applies AND no existing pair starts failing
|
|
62
|
+
-- afterwards. Remediate anything either check returns — for (a) that means
|
|
63
|
+
-- deciding which conversation survives, since a pair can hold only one
|
|
64
|
+
-- reservation; for (b) it means re-keying the conversation to the derived id, or
|
|
65
|
+
-- seeding its reservation under the derived id, before deploying.
|
|
66
|
+
|
|
67
|
+
-- Backfill ONLY conversations with exactly two distinct participants.
|
|
68
|
+
--
|
|
69
|
+
-- A one-row roster is ambiguous and MUST NOT be reserved. It looks like a
|
|
70
|
+
-- self-DM, but `dm_participants.agent_id` cascades on agent deletion, so a
|
|
71
|
+
-- perfectly ordinary two-party 1:1 collapses to a single row the moment one
|
|
72
|
+
-- participant's agent is deleted - while its id still encodes the ORIGINAL pair.
|
|
73
|
+
--
|
|
74
|
+
-- Reading those as (X, X) is wrong twice over. Several orphans belonging to the
|
|
75
|
+
-- same surviving agent all collapse to the same (workspace, X, X) tuple and
|
|
76
|
+
-- collide on the pair-uniqueness index, aborting the migration; and any that
|
|
77
|
+
-- survived would reserve a self-DM tuple against an id no derivation produces,
|
|
78
|
+
-- so that agent's next self-DM would 409 forever.
|
|
79
|
+
--
|
|
80
|
+
-- This is not hypothetical. An earlier version of this backfill used
|
|
81
|
+
-- MIN/MAX over 1-2 participants; audited against production it produced 4
|
|
82
|
+
-- colliding pair groups and 30 mismatched ids, all of them orphaned two-party
|
|
83
|
+
-- conversations, and would have failed the deployment. Restricted to exactly two
|
|
84
|
+
-- participants the same data yields zero findings across 3425 conversations.
|
|
85
|
+
--
|
|
86
|
+
-- Skipping is safe rather than merely convenient. An unreserved conversation is
|
|
87
|
+
-- in exactly the state every conversation was in before this migration: the
|
|
88
|
+
-- first send through the reservation path claims it, and because a genuine
|
|
89
|
+
-- self-DM's id already equals its derivation, that claim adopts the existing
|
|
90
|
+
-- conversation instead of creating a second one. Orphaned two-party rows are
|
|
91
|
+
-- simply never re-derived, so they stay readable and inert.
|
|
92
|
+
--
|
|
93
|
+
-- Malformed rosters (zero, or more than two) are skipped for the same reason.
|
|
94
|
+
-- The earlier version aborted the whole migration on them; skipping avoids
|
|
95
|
+
-- inventing a tuple just as effectively without blocking a deployment, and any
|
|
96
|
+
-- future send still goes through the reservation path.
|
|
97
|
+
INSERT INTO dm_conversation_reservations (
|
|
98
|
+
conversation_id,
|
|
99
|
+
workspace_id,
|
|
100
|
+
participant_one_id,
|
|
101
|
+
participant_two_id,
|
|
102
|
+
created_at
|
|
103
|
+
)
|
|
104
|
+
SELECT
|
|
105
|
+
dc.id,
|
|
106
|
+
dc.workspace_id,
|
|
107
|
+
MIN(dp.agent_id),
|
|
108
|
+
MAX(dp.agent_id),
|
|
109
|
+
dc.created_at
|
|
110
|
+
FROM dm_conversations dc
|
|
111
|
+
JOIN dm_participants dp ON dp.conversation_id = dc.id
|
|
112
|
+
WHERE dc.dm_type = '1:1'
|
|
113
|
+
GROUP BY dc.id, dc.workspace_id, dc.created_at
|
|
114
|
+
HAVING COUNT(DISTINCT dp.agent_id) = 2;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
-- A numeric zero must mean measured idle, never "no measurement available".
|
|
2
|
+
-- Keep the existing numeric columns for SQLite/D1 compatibility and carry
|
|
3
|
+
-- measurement presence explicitly alongside them.
|
|
4
|
+
ALTER TABLE nodes ADD COLUMN load_reported INTEGER NOT NULL DEFAULT 0;
|
|
5
|
+
ALTER TABLE node_providers ADD COLUMN load_reported INTEGER NOT NULL DEFAULT 0;
|
|
6
|
+
|
|
7
|
+
-- Do not backfill load_reported. Every released provider implementation sent a
|
|
8
|
+
-- placeholder load value, including finite-capacity providers, so no historic
|
|
9
|
+
-- numeric value is known to be a measurement.
|
|
10
|
+
|
|
11
|
+
-- Provider capacity uses the same sentinel: any unbounded provider makes its
|
|
12
|
+
-- aggregate broker node unbounded. Correct aggregates written by the prior
|
|
13
|
+
-- additive-zero behavior before deciding whether their load was measured.
|
|
14
|
+
UPDATE nodes
|
|
15
|
+
SET max_agents = 0
|
|
16
|
+
WHERE role = 'broker'
|
|
17
|
+
AND EXISTS (
|
|
18
|
+
SELECT 1
|
|
19
|
+
FROM node_providers
|
|
20
|
+
WHERE node_providers.workspace_id = nodes.workspace_id
|
|
21
|
+
AND node_providers.node_id = nodes.id
|
|
22
|
+
AND node_providers.max_agents = 0
|
|
23
|
+
);
|
package/dist/db/schema.d.ts
CHANGED
|
@@ -900,6 +900,23 @@ export declare const nodes: import("drizzle-orm/sqlite-core").SQLiteTableWithCol
|
|
|
900
900
|
identity: undefined;
|
|
901
901
|
generated: undefined;
|
|
902
902
|
}, {}, {}>;
|
|
903
|
+
loadReported: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
904
|
+
name: "load_reported";
|
|
905
|
+
tableName: "nodes";
|
|
906
|
+
dataType: "boolean";
|
|
907
|
+
columnType: "SQLiteBoolean";
|
|
908
|
+
data: boolean;
|
|
909
|
+
driverParam: number;
|
|
910
|
+
notNull: true;
|
|
911
|
+
hasDefault: true;
|
|
912
|
+
isPrimaryKey: false;
|
|
913
|
+
isAutoincrement: false;
|
|
914
|
+
hasRuntimeDefault: false;
|
|
915
|
+
enumValues: undefined;
|
|
916
|
+
baseColumn: never;
|
|
917
|
+
identity: undefined;
|
|
918
|
+
generated: undefined;
|
|
919
|
+
}, {}, {}>;
|
|
903
920
|
lastHeartbeatAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
904
921
|
name: "last_heartbeat_at";
|
|
905
922
|
tableName: "nodes";
|
|
@@ -1126,6 +1143,23 @@ export declare const nodeProviders: import("drizzle-orm/sqlite-core").SQLiteTabl
|
|
|
1126
1143
|
identity: undefined;
|
|
1127
1144
|
generated: undefined;
|
|
1128
1145
|
}, {}, {}>;
|
|
1146
|
+
loadReported: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
1147
|
+
name: "load_reported";
|
|
1148
|
+
tableName: "node_providers";
|
|
1149
|
+
dataType: "boolean";
|
|
1150
|
+
columnType: "SQLiteBoolean";
|
|
1151
|
+
data: boolean;
|
|
1152
|
+
driverParam: number;
|
|
1153
|
+
notNull: true;
|
|
1154
|
+
hasDefault: true;
|
|
1155
|
+
isPrimaryKey: false;
|
|
1156
|
+
isAutoincrement: false;
|
|
1157
|
+
hasRuntimeDefault: false;
|
|
1158
|
+
enumValues: undefined;
|
|
1159
|
+
baseColumn: never;
|
|
1160
|
+
identity: undefined;
|
|
1161
|
+
generated: undefined;
|
|
1162
|
+
}, {}, {}>;
|
|
1129
1163
|
handlersLive: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
1130
1164
|
name: "handlers_live";
|
|
1131
1165
|
tableName: "node_providers";
|
|
@@ -4148,6 +4182,106 @@ export declare const dmConversations: import("drizzle-orm/sqlite-core").SQLiteTa
|
|
|
4148
4182
|
};
|
|
4149
4183
|
dialect: "sqlite";
|
|
4150
4184
|
}>;
|
|
4185
|
+
export declare const dmConversationReservations: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
4186
|
+
name: "dm_conversation_reservations";
|
|
4187
|
+
schema: undefined;
|
|
4188
|
+
columns: {
|
|
4189
|
+
conversationId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
4190
|
+
name: "conversation_id";
|
|
4191
|
+
tableName: "dm_conversation_reservations";
|
|
4192
|
+
dataType: "string";
|
|
4193
|
+
columnType: "SQLiteText";
|
|
4194
|
+
data: string;
|
|
4195
|
+
driverParam: string;
|
|
4196
|
+
notNull: true;
|
|
4197
|
+
hasDefault: false;
|
|
4198
|
+
isPrimaryKey: true;
|
|
4199
|
+
isAutoincrement: false;
|
|
4200
|
+
hasRuntimeDefault: false;
|
|
4201
|
+
enumValues: [string, ...string[]];
|
|
4202
|
+
baseColumn: never;
|
|
4203
|
+
identity: undefined;
|
|
4204
|
+
generated: undefined;
|
|
4205
|
+
}, {}, {
|
|
4206
|
+
length: number | undefined;
|
|
4207
|
+
}>;
|
|
4208
|
+
workspaceId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
4209
|
+
name: "workspace_id";
|
|
4210
|
+
tableName: "dm_conversation_reservations";
|
|
4211
|
+
dataType: "string";
|
|
4212
|
+
columnType: "SQLiteText";
|
|
4213
|
+
data: string;
|
|
4214
|
+
driverParam: string;
|
|
4215
|
+
notNull: true;
|
|
4216
|
+
hasDefault: false;
|
|
4217
|
+
isPrimaryKey: false;
|
|
4218
|
+
isAutoincrement: false;
|
|
4219
|
+
hasRuntimeDefault: false;
|
|
4220
|
+
enumValues: [string, ...string[]];
|
|
4221
|
+
baseColumn: never;
|
|
4222
|
+
identity: undefined;
|
|
4223
|
+
generated: undefined;
|
|
4224
|
+
}, {}, {
|
|
4225
|
+
length: number | undefined;
|
|
4226
|
+
}>;
|
|
4227
|
+
participantOneId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
4228
|
+
name: "participant_one_id";
|
|
4229
|
+
tableName: "dm_conversation_reservations";
|
|
4230
|
+
dataType: "string";
|
|
4231
|
+
columnType: "SQLiteText";
|
|
4232
|
+
data: string;
|
|
4233
|
+
driverParam: string;
|
|
4234
|
+
notNull: true;
|
|
4235
|
+
hasDefault: false;
|
|
4236
|
+
isPrimaryKey: false;
|
|
4237
|
+
isAutoincrement: false;
|
|
4238
|
+
hasRuntimeDefault: false;
|
|
4239
|
+
enumValues: [string, ...string[]];
|
|
4240
|
+
baseColumn: never;
|
|
4241
|
+
identity: undefined;
|
|
4242
|
+
generated: undefined;
|
|
4243
|
+
}, {}, {
|
|
4244
|
+
length: number | undefined;
|
|
4245
|
+
}>;
|
|
4246
|
+
participantTwoId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
4247
|
+
name: "participant_two_id";
|
|
4248
|
+
tableName: "dm_conversation_reservations";
|
|
4249
|
+
dataType: "string";
|
|
4250
|
+
columnType: "SQLiteText";
|
|
4251
|
+
data: string;
|
|
4252
|
+
driverParam: string;
|
|
4253
|
+
notNull: true;
|
|
4254
|
+
hasDefault: false;
|
|
4255
|
+
isPrimaryKey: false;
|
|
4256
|
+
isAutoincrement: false;
|
|
4257
|
+
hasRuntimeDefault: false;
|
|
4258
|
+
enumValues: [string, ...string[]];
|
|
4259
|
+
baseColumn: never;
|
|
4260
|
+
identity: undefined;
|
|
4261
|
+
generated: undefined;
|
|
4262
|
+
}, {}, {
|
|
4263
|
+
length: number | undefined;
|
|
4264
|
+
}>;
|
|
4265
|
+
createdAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
4266
|
+
name: "created_at";
|
|
4267
|
+
tableName: "dm_conversation_reservations";
|
|
4268
|
+
dataType: "date";
|
|
4269
|
+
columnType: "SQLiteTimestamp";
|
|
4270
|
+
data: Date;
|
|
4271
|
+
driverParam: number;
|
|
4272
|
+
notNull: true;
|
|
4273
|
+
hasDefault: true;
|
|
4274
|
+
isPrimaryKey: false;
|
|
4275
|
+
isAutoincrement: false;
|
|
4276
|
+
hasRuntimeDefault: false;
|
|
4277
|
+
enumValues: undefined;
|
|
4278
|
+
baseColumn: never;
|
|
4279
|
+
identity: undefined;
|
|
4280
|
+
generated: undefined;
|
|
4281
|
+
}, {}, {}>;
|
|
4282
|
+
};
|
|
4283
|
+
dialect: "sqlite";
|
|
4284
|
+
}>;
|
|
4151
4285
|
export declare const dmParticipants: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
4152
4286
|
name: "dm_participants";
|
|
4153
4287
|
schema: undefined;
|
package/dist/db/schema.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/db/schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/db/schema.ts"],"names":[],"mappings":"AAkBA;;;;GAIG;AACH,MAAM,WAAW,0BAA0B;IACzC,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,wBAAwB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1C;AAED,MAAM,WAAW,oBAAoB;IACnC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAc3B,CAAC"}
|
package/dist/db/schema.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { sqliteTable, text, integer, real, index, uniqueIndex, primaryKey, foreignKey, } from 'drizzle-orm/sqlite-core';
|
|
1
|
+
import { sqliteTable, text, integer, real, index, uniqueIndex, primaryKey, foreignKey, check, } from 'drizzle-orm/sqlite-core';
|
|
2
2
|
import { sql } from 'drizzle-orm';
|
|
3
3
|
export const workspaces = sqliteTable('workspaces', {
|
|
4
4
|
id: text('id').primaryKey(),
|
|
@@ -65,6 +65,7 @@ export const nodes = sqliteTable('nodes', {
|
|
|
65
65
|
deliveryAdapter: text('delivery_adapter').notNull().default('ws.node.v1'),
|
|
66
66
|
deliveryConfig: text('delivery_config', { mode: 'json' }).$type(),
|
|
67
67
|
capabilities: text('capabilities', { mode: 'json' }).$type().notNull().default([]),
|
|
68
|
+
// Zero is the fleet-wide sentinel for unlimited capacity.
|
|
68
69
|
maxAgents: integer('max_agents').notNull().default(0),
|
|
69
70
|
activeAgents: integer('active_agents').notNull().default(0),
|
|
70
71
|
reservedAgents: integer('reserved_agents').notNull().default(0),
|
|
@@ -73,6 +74,7 @@ export const nodes = sqliteTable('nodes', {
|
|
|
73
74
|
status: text('status').notNull().default('offline'),
|
|
74
75
|
handlersLive: integer('handlers_live', { mode: 'boolean' }).notNull().default(false),
|
|
75
76
|
load: real('load').notNull().default(0),
|
|
77
|
+
loadReported: integer('load_reported', { mode: 'boolean' }).notNull().default(false),
|
|
76
78
|
lastHeartbeatAt: integer('last_heartbeat_at', { mode: 'timestamp' }),
|
|
77
79
|
createdAt: integer('created_at', { mode: 'timestamp' }).notNull().default(sql `(unixepoch())`),
|
|
78
80
|
}, (table) => [
|
|
@@ -104,9 +106,11 @@ export const nodeProviders = sqliteTable('node_providers', {
|
|
|
104
106
|
name: text('name').notNull(),
|
|
105
107
|
instanceId: text('instance_id').notNull(),
|
|
106
108
|
capabilities: text('capabilities', { mode: 'json' }).$type().notNull().default([]),
|
|
109
|
+
// Zero is the fleet-wide sentinel for unlimited provider capacity.
|
|
107
110
|
maxAgents: integer('max_agents').notNull().default(0),
|
|
108
111
|
activeAgents: integer('active_agents').notNull().default(0),
|
|
109
112
|
load: real('load').notNull().default(0),
|
|
113
|
+
loadReported: integer('load_reported', { mode: 'boolean' }).notNull().default(false),
|
|
110
114
|
handlersLive: integer('handlers_live', { mode: 'boolean' }).notNull().default(false),
|
|
111
115
|
status: text('status').notNull().default('offline'),
|
|
112
116
|
version: text('version').notNull().default('unknown'),
|
|
@@ -471,6 +475,21 @@ export const dmConversations = sqliteTable('dm_conversations', {
|
|
|
471
475
|
index('idx_dm_conversations_workspace').on(table.workspaceId),
|
|
472
476
|
]);
|
|
473
477
|
// ============================================
|
|
478
|
+
// 1:1 DM Conversation Reservations
|
|
479
|
+
// ============================================
|
|
480
|
+
export const dmConversationReservations = sqliteTable('dm_conversation_reservations', {
|
|
481
|
+
conversationId: text('conversation_id').primaryKey(),
|
|
482
|
+
workspaceId: text('workspace_id')
|
|
483
|
+
.notNull()
|
|
484
|
+
.references(() => workspaces.id, { onDelete: 'cascade' }),
|
|
485
|
+
participantOneId: text('participant_one_id').notNull(),
|
|
486
|
+
participantTwoId: text('participant_two_id').notNull(),
|
|
487
|
+
createdAt: integer('created_at', { mode: 'timestamp' }).notNull().default(sql `(unixepoch())`),
|
|
488
|
+
}, (table) => [
|
|
489
|
+
check('dm_conversation_reservations_sorted_pair_check', sql `${table.participantOneId} <= ${table.participantTwoId}`),
|
|
490
|
+
uniqueIndex('dm_conversation_reservations_pair_unique').on(table.workspaceId, table.participantOneId, table.participantTwoId),
|
|
491
|
+
]);
|
|
492
|
+
// ============================================
|
|
474
493
|
// DM Participants
|
|
475
494
|
// ============================================
|
|
476
495
|
export const dmParticipants = sqliteTable('dm_participants', {
|