@minion-stack/db 0.8.0 → 0.9.4
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/pg/schema/channels.d.ts +559 -0
- package/dist/pg/schema/channels.d.ts.map +1 -1
- package/dist/pg/schema/channels.js +87 -1
- package/dist/pg/schema/channels.js.map +1 -1
- package/dist/pg/schema/index.d.ts +1 -1
- package/dist/pg/schema/index.d.ts.map +1 -1
- package/dist/pg/schema/index.js +1 -1
- package/dist/pg/schema/index.js.map +1 -1
- package/dist/pg/schema/marketplace.d.ts +17 -0
- package/dist/pg/schema/marketplace.d.ts.map +1 -1
- package/dist/pg/schema/marketplace.js +3 -0
- package/dist/pg/schema/marketplace.js.map +1 -1
- package/dist/schema/bugs.d.ts.map +1 -1
- package/dist/schema/bugs.js +7 -1
- package/dist/schema/bugs.js.map +1 -1
- package/dist/schema/connection-events.js +5 -4
- package/dist/schema/connection-events.js.map +1 -1
- package/dist/schema/index.d.ts +0 -1
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/index.js +0 -1
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/marketplace-agents.d.ts +19 -0
- package/dist/schema/marketplace-agents.d.ts.map +1 -1
- package/dist/schema/marketplace-agents.js +1 -0
- package/dist/schema/marketplace-agents.js.map +1 -1
- package/dist/schema/reliability-events.d.ts.map +1 -1
- package/dist/schema/reliability-events.js +6 -6
- package/dist/schema/reliability-events.js.map +1 -1
- package/dist/schema/unified-events.d.ts.map +1 -1
- package/dist/schema/unified-events.js +3 -0
- package/dist/schema/unified-events.js.map +1 -1
- package/package.json +1 -1
- package/src/pg/schema/channels.ts +117 -1
- package/src/pg/schema/index.ts +7 -1
- package/src/pg/schema/marketplace.ts +3 -0
- package/src/schema/bugs.ts +7 -1
- package/src/schema/connection-events.ts +4 -4
- package/src/schema/index.ts +0 -1
- package/src/schema/marketplace-agents.ts +1 -0
- package/src/schema/reliability-events.ts +5 -6
- package/src/schema/unified-events.ts +3 -0
- package/dist/schema/flows.d.ts +0 -192
- package/dist/schema/flows.d.ts.map +0 -1
- package/dist/schema/flows.js +0 -14
- package/dist/schema/flows.js.map +0 -1
- package/src/schema/flows.ts +0 -14
package/src/pg/schema/index.ts
CHANGED
|
@@ -34,7 +34,13 @@ export {
|
|
|
34
34
|
agentBuiltSkills,
|
|
35
35
|
builtTools,
|
|
36
36
|
} from './builder.js';
|
|
37
|
-
export {
|
|
37
|
+
export {
|
|
38
|
+
channels,
|
|
39
|
+
channelAssignments,
|
|
40
|
+
channelIdentities,
|
|
41
|
+
channelBindings,
|
|
42
|
+
channelPairingRequests,
|
|
43
|
+
} from './channels.js';
|
|
38
44
|
export { sessions, sessionTasks } from './sessions.js';
|
|
39
45
|
export { missions, tasks } from './missions.js';
|
|
40
46
|
export { chatMessages } from './chat-messages.js';
|
|
@@ -12,6 +12,9 @@ export const marketplaceAgents = pgTable('marketplace_agents', {
|
|
|
12
12
|
catchphrase: text('catchphrase'),
|
|
13
13
|
version: text('version').notNull(),
|
|
14
14
|
model: text('model'),
|
|
15
|
+
// 'autonomous' | 'copilot' — drives the catalog avatar style. Nullable: legacy
|
|
16
|
+
// rows + agents whose agent.json omits it fall back to the copilot baseline.
|
|
17
|
+
archetype: text('archetype'),
|
|
15
18
|
avatarSeed: text('avatar_seed').notNull(),
|
|
16
19
|
githubPath: text('github_path').notNull(),
|
|
17
20
|
soulMd: text('soul_md'),
|
package/src/schema/bugs.ts
CHANGED
|
@@ -26,5 +26,11 @@ export const bugs = sqliteTable(
|
|
|
26
26
|
createdAt: integer('created_at').notNull(),
|
|
27
27
|
updatedAt: integer('updated_at').notNull(),
|
|
28
28
|
},
|
|
29
|
-
(t) => [
|
|
29
|
+
(t) => [
|
|
30
|
+
index('idx_bugs_tenant').on(t.tenantId),
|
|
31
|
+
index('idx_bugs_server').on(t.serverId),
|
|
32
|
+
// Covers the tenant-scoped bug list (bug.service.ts listBugs): tenant_id,
|
|
33
|
+
// ordered by created_at desc.
|
|
34
|
+
index('idx_bugs_tenant_created').on(t.tenantId, t.createdAt),
|
|
35
|
+
],
|
|
30
36
|
);
|
|
@@ -19,8 +19,8 @@ export const connectionEvents = sqliteTable(
|
|
|
19
19
|
reason: text('reason'),
|
|
20
20
|
occurredAt: integer('occurred_at').notNull(),
|
|
21
21
|
},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
],
|
|
22
|
+
// No service reads or writes this table. The server index was pure write-tax for
|
|
23
|
+
// a query pattern that never runs — dropped. The tenant index is retained so the
|
|
24
|
+
// organization onDelete: cascade stays cheap.
|
|
25
|
+
(t) => [index('idx_conn_events_tenant').on(t.tenantId)],
|
|
26
26
|
);
|
package/src/schema/index.ts
CHANGED
|
@@ -33,7 +33,6 @@ export { marketplaceAgents } from './marketplace-agents.js';
|
|
|
33
33
|
export { marketplaceInstalls } from './marketplace-installs.js';
|
|
34
34
|
export { workshopSaves } from './workshop-saves.js';
|
|
35
35
|
export { deviceIdentities } from './device-identities.js';
|
|
36
|
-
export { flows } from './flows.js';
|
|
37
36
|
export { userServers } from './user-servers.js';
|
|
38
37
|
export { userAgents } from './user-agents.js';
|
|
39
38
|
export { channels } from './channels.js';
|
|
@@ -10,6 +10,7 @@ export const marketplaceAgents = sqliteTable('marketplace_agents', {
|
|
|
10
10
|
catchphrase: text('catchphrase'),
|
|
11
11
|
version: text('version').notNull(),
|
|
12
12
|
model: text('model'),
|
|
13
|
+
archetype: text('archetype'), // 'autonomous' | 'copilot' — catalog avatar style
|
|
13
14
|
avatarSeed: text('avatar_seed').notNull(),
|
|
14
15
|
githubPath: text('github_path').notNull(),
|
|
15
16
|
soulMd: text('soul_md'),
|
|
@@ -23,10 +23,9 @@ export const reliabilityEvents = sqliteTable(
|
|
|
23
23
|
occurredAt: integer('occurred_at').notNull(),
|
|
24
24
|
createdAt: integer('created_at').notNull(),
|
|
25
25
|
},
|
|
26
|
-
(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
],
|
|
26
|
+
// No service reads or writes this table (the reliability dashboard streams live
|
|
27
|
+
// data over WS from the gateway, not from the DB). The three server_* composite
|
|
28
|
+
// indexes were pure write-tax for query patterns that never run — dropped. The
|
|
29
|
+
// tenant index is retained so the organization onDelete: cascade stays cheap.
|
|
30
|
+
(t) => [index('idx_rel_events_tenant').on(t.tenantId)],
|
|
32
31
|
);
|
|
@@ -27,6 +27,9 @@ export const unifiedEvents = sqliteTable(
|
|
|
27
27
|
index('idx_unified_events_tenant').on(t.tenantId),
|
|
28
28
|
index('idx_unified_events_server_cat_time').on(t.serverId, t.category, t.occurredAt),
|
|
29
29
|
index('idx_unified_events_server_time').on(t.serverId, t.occurredAt),
|
|
30
|
+
// Covers the severity-filtered event list (events.service.ts listEvents):
|
|
31
|
+
// server_id + severity, ordered by occurred_at desc.
|
|
32
|
+
index('idx_unified_events_server_sev_time').on(t.serverId, t.severity, t.occurredAt),
|
|
30
33
|
index('idx_unified_events_correlation').on(t.correlationId),
|
|
31
34
|
uniqueIndex('idx_unified_events_dedup').on(t.tenantId, t.serverId, t.localEventId),
|
|
32
35
|
],
|
package/dist/schema/flows.d.ts
DELETED
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
export declare const flows: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
2
|
-
name: "flows";
|
|
3
|
-
schema: undefined;
|
|
4
|
-
columns: {
|
|
5
|
-
id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
6
|
-
name: "id";
|
|
7
|
-
tableName: "flows";
|
|
8
|
-
dataType: "string";
|
|
9
|
-
columnType: "SQLiteText";
|
|
10
|
-
data: string;
|
|
11
|
-
driverParam: string;
|
|
12
|
-
notNull: true;
|
|
13
|
-
hasDefault: false;
|
|
14
|
-
isPrimaryKey: true;
|
|
15
|
-
isAutoincrement: false;
|
|
16
|
-
hasRuntimeDefault: false;
|
|
17
|
-
enumValues: [string, ...string[]];
|
|
18
|
-
baseColumn: never;
|
|
19
|
-
identity: undefined;
|
|
20
|
-
generated: undefined;
|
|
21
|
-
}, {}, {
|
|
22
|
-
length: number | undefined;
|
|
23
|
-
}>;
|
|
24
|
-
name: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
25
|
-
name: "name";
|
|
26
|
-
tableName: "flows";
|
|
27
|
-
dataType: "string";
|
|
28
|
-
columnType: "SQLiteText";
|
|
29
|
-
data: string;
|
|
30
|
-
driverParam: string;
|
|
31
|
-
notNull: true;
|
|
32
|
-
hasDefault: false;
|
|
33
|
-
isPrimaryKey: false;
|
|
34
|
-
isAutoincrement: false;
|
|
35
|
-
hasRuntimeDefault: false;
|
|
36
|
-
enumValues: [string, ...string[]];
|
|
37
|
-
baseColumn: never;
|
|
38
|
-
identity: undefined;
|
|
39
|
-
generated: undefined;
|
|
40
|
-
}, {}, {
|
|
41
|
-
length: number | undefined;
|
|
42
|
-
}>;
|
|
43
|
-
nodes: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
44
|
-
name: "nodes";
|
|
45
|
-
tableName: "flows";
|
|
46
|
-
dataType: "string";
|
|
47
|
-
columnType: "SQLiteText";
|
|
48
|
-
data: string;
|
|
49
|
-
driverParam: string;
|
|
50
|
-
notNull: true;
|
|
51
|
-
hasDefault: true;
|
|
52
|
-
isPrimaryKey: false;
|
|
53
|
-
isAutoincrement: false;
|
|
54
|
-
hasRuntimeDefault: false;
|
|
55
|
-
enumValues: [string, ...string[]];
|
|
56
|
-
baseColumn: never;
|
|
57
|
-
identity: undefined;
|
|
58
|
-
generated: undefined;
|
|
59
|
-
}, {}, {
|
|
60
|
-
length: number | undefined;
|
|
61
|
-
}>;
|
|
62
|
-
edges: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
63
|
-
name: "edges";
|
|
64
|
-
tableName: "flows";
|
|
65
|
-
dataType: "string";
|
|
66
|
-
columnType: "SQLiteText";
|
|
67
|
-
data: string;
|
|
68
|
-
driverParam: string;
|
|
69
|
-
notNull: true;
|
|
70
|
-
hasDefault: true;
|
|
71
|
-
isPrimaryKey: false;
|
|
72
|
-
isAutoincrement: false;
|
|
73
|
-
hasRuntimeDefault: false;
|
|
74
|
-
enumValues: [string, ...string[]];
|
|
75
|
-
baseColumn: never;
|
|
76
|
-
identity: undefined;
|
|
77
|
-
generated: undefined;
|
|
78
|
-
}, {}, {
|
|
79
|
-
length: number | undefined;
|
|
80
|
-
}>;
|
|
81
|
-
userId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
82
|
-
name: "user_id";
|
|
83
|
-
tableName: "flows";
|
|
84
|
-
dataType: "string";
|
|
85
|
-
columnType: "SQLiteText";
|
|
86
|
-
data: string;
|
|
87
|
-
driverParam: string;
|
|
88
|
-
notNull: false;
|
|
89
|
-
hasDefault: false;
|
|
90
|
-
isPrimaryKey: false;
|
|
91
|
-
isAutoincrement: false;
|
|
92
|
-
hasRuntimeDefault: false;
|
|
93
|
-
enumValues: [string, ...string[]];
|
|
94
|
-
baseColumn: never;
|
|
95
|
-
identity: undefined;
|
|
96
|
-
generated: undefined;
|
|
97
|
-
}, {}, {
|
|
98
|
-
length: number | undefined;
|
|
99
|
-
}>;
|
|
100
|
-
tenantId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
101
|
-
name: "tenant_id";
|
|
102
|
-
tableName: "flows";
|
|
103
|
-
dataType: "string";
|
|
104
|
-
columnType: "SQLiteText";
|
|
105
|
-
data: string;
|
|
106
|
-
driverParam: string;
|
|
107
|
-
notNull: false;
|
|
108
|
-
hasDefault: false;
|
|
109
|
-
isPrimaryKey: false;
|
|
110
|
-
isAutoincrement: false;
|
|
111
|
-
hasRuntimeDefault: false;
|
|
112
|
-
enumValues: [string, ...string[]];
|
|
113
|
-
baseColumn: never;
|
|
114
|
-
identity: undefined;
|
|
115
|
-
generated: undefined;
|
|
116
|
-
}, {}, {
|
|
117
|
-
length: number | undefined;
|
|
118
|
-
}>;
|
|
119
|
-
createdAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
120
|
-
name: "created_at";
|
|
121
|
-
tableName: "flows";
|
|
122
|
-
dataType: "number";
|
|
123
|
-
columnType: "SQLiteInteger";
|
|
124
|
-
data: number;
|
|
125
|
-
driverParam: number;
|
|
126
|
-
notNull: true;
|
|
127
|
-
hasDefault: false;
|
|
128
|
-
isPrimaryKey: false;
|
|
129
|
-
isAutoincrement: false;
|
|
130
|
-
hasRuntimeDefault: false;
|
|
131
|
-
enumValues: undefined;
|
|
132
|
-
baseColumn: never;
|
|
133
|
-
identity: undefined;
|
|
134
|
-
generated: undefined;
|
|
135
|
-
}, {}, {}>;
|
|
136
|
-
updatedAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
137
|
-
name: "updated_at";
|
|
138
|
-
tableName: "flows";
|
|
139
|
-
dataType: "number";
|
|
140
|
-
columnType: "SQLiteInteger";
|
|
141
|
-
data: number;
|
|
142
|
-
driverParam: number;
|
|
143
|
-
notNull: true;
|
|
144
|
-
hasDefault: false;
|
|
145
|
-
isPrimaryKey: false;
|
|
146
|
-
isAutoincrement: false;
|
|
147
|
-
hasRuntimeDefault: false;
|
|
148
|
-
enumValues: undefined;
|
|
149
|
-
baseColumn: never;
|
|
150
|
-
identity: undefined;
|
|
151
|
-
generated: undefined;
|
|
152
|
-
}, {}, {}>;
|
|
153
|
-
active: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
154
|
-
name: "active";
|
|
155
|
-
tableName: "flows";
|
|
156
|
-
dataType: "boolean";
|
|
157
|
-
columnType: "SQLiteBoolean";
|
|
158
|
-
data: boolean;
|
|
159
|
-
driverParam: number;
|
|
160
|
-
notNull: true;
|
|
161
|
-
hasDefault: true;
|
|
162
|
-
isPrimaryKey: false;
|
|
163
|
-
isAutoincrement: false;
|
|
164
|
-
hasRuntimeDefault: false;
|
|
165
|
-
enumValues: undefined;
|
|
166
|
-
baseColumn: never;
|
|
167
|
-
identity: undefined;
|
|
168
|
-
generated: undefined;
|
|
169
|
-
}, {}, {}>;
|
|
170
|
-
config: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
171
|
-
name: "config";
|
|
172
|
-
tableName: "flows";
|
|
173
|
-
dataType: "string";
|
|
174
|
-
columnType: "SQLiteText";
|
|
175
|
-
data: string;
|
|
176
|
-
driverParam: string;
|
|
177
|
-
notNull: true;
|
|
178
|
-
hasDefault: true;
|
|
179
|
-
isPrimaryKey: false;
|
|
180
|
-
isAutoincrement: false;
|
|
181
|
-
hasRuntimeDefault: false;
|
|
182
|
-
enumValues: [string, ...string[]];
|
|
183
|
-
baseColumn: never;
|
|
184
|
-
identity: undefined;
|
|
185
|
-
generated: undefined;
|
|
186
|
-
}, {}, {
|
|
187
|
-
length: number | undefined;
|
|
188
|
-
}>;
|
|
189
|
-
};
|
|
190
|
-
dialect: "sqlite";
|
|
191
|
-
}>;
|
|
192
|
-
//# sourceMappingURL=flows.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"flows.d.ts","sourceRoot":"","sources":["../../src/schema/flows.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWhB,CAAC"}
|
package/dist/schema/flows.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { sqliteTable, text, integer } from 'drizzle-orm/sqlite-core';
|
|
2
|
-
export const flows = sqliteTable('flows', {
|
|
3
|
-
id: text('id').primaryKey(),
|
|
4
|
-
name: text('name').notNull(),
|
|
5
|
-
nodes: text('nodes').notNull().default('[]'), // JSON string of FlowNode[]
|
|
6
|
-
edges: text('edges').notNull().default('[]'), // JSON string of FlowEdge[]
|
|
7
|
-
userId: text('user_id'), // owner — null for pre-migration rows (treated as shared)
|
|
8
|
-
tenantId: text('tenant_id'), // tenant scope — null for pre-migration rows
|
|
9
|
-
createdAt: integer('created_at').notNull(),
|
|
10
|
-
updatedAt: integer('updated_at').notNull(),
|
|
11
|
-
active: integer('active', { mode: 'boolean' }).notNull().default(false),
|
|
12
|
-
config: text('config').notNull().default('{}'),
|
|
13
|
-
});
|
|
14
|
-
//# sourceMappingURL=flows.js.map
|
package/dist/schema/flows.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"flows.js","sourceRoot":"","sources":["../../src/schema/flows.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAErE,MAAM,CAAC,MAAM,KAAK,GAAG,WAAW,CAAC,OAAO,EAAE;IACxC,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE;IAC3B,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE;IAC5B,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,4BAA4B;IAC1E,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,4BAA4B;IAC1E,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,0DAA0D;IACnF,QAAQ,EAAE,IAAI,CAAC,WAAW,CAAC,EAAE,6CAA6C;IAC1E,SAAS,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE;IAC1C,SAAS,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE;IAC1C,MAAM,EAAE,OAAO,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IACvE,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;CAC/C,CAAC,CAAC"}
|
package/src/schema/flows.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { sqliteTable, text, integer } from 'drizzle-orm/sqlite-core';
|
|
2
|
-
|
|
3
|
-
export const flows = sqliteTable('flows', {
|
|
4
|
-
id: text('id').primaryKey(),
|
|
5
|
-
name: text('name').notNull(),
|
|
6
|
-
nodes: text('nodes').notNull().default('[]'), // JSON string of FlowNode[]
|
|
7
|
-
edges: text('edges').notNull().default('[]'), // JSON string of FlowEdge[]
|
|
8
|
-
userId: text('user_id'), // owner — null for pre-migration rows (treated as shared)
|
|
9
|
-
tenantId: text('tenant_id'), // tenant scope — null for pre-migration rows
|
|
10
|
-
createdAt: integer('created_at').notNull(),
|
|
11
|
-
updatedAt: integer('updated_at').notNull(),
|
|
12
|
-
active: integer('active', { mode: 'boolean' }).notNull().default(false),
|
|
13
|
-
config: text('config').notNull().default('{}'),
|
|
14
|
-
});
|