bopodev-db 0.1.11 → 0.1.13
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/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-typecheck.log +1 -1
- package/dist/repositories.d.ts +203 -4
- package/dist/schema.d.ts +2536 -698
- package/package.json +1 -1
- package/src/bootstrap.ts +109 -0
- package/src/repositories.ts +434 -3
- package/src/schema.ts +94 -0
package/src/schema.ts
CHANGED
|
@@ -116,6 +116,26 @@ export const issueComments = pgTable("issue_comments", {
|
|
|
116
116
|
createdAt: timestamp("created_at", { mode: "date" }).defaultNow().notNull()
|
|
117
117
|
});
|
|
118
118
|
|
|
119
|
+
export const issueAttachments = pgTable("issue_attachments", {
|
|
120
|
+
id: text("id").primaryKey(),
|
|
121
|
+
companyId: text("company_id")
|
|
122
|
+
.notNull()
|
|
123
|
+
.references(() => companies.id, { onDelete: "cascade" }),
|
|
124
|
+
issueId: text("issue_id")
|
|
125
|
+
.notNull()
|
|
126
|
+
.references(() => issues.id, { onDelete: "cascade" }),
|
|
127
|
+
projectId: text("project_id")
|
|
128
|
+
.notNull()
|
|
129
|
+
.references(() => projects.id, { onDelete: "cascade" }),
|
|
130
|
+
fileName: text("file_name").notNull(),
|
|
131
|
+
mimeType: text("mime_type"),
|
|
132
|
+
fileSizeBytes: integer("file_size_bytes").notNull(),
|
|
133
|
+
relativePath: text("relative_path").notNull(),
|
|
134
|
+
uploadedByActorType: text("uploaded_by_actor_type").notNull().default("human"),
|
|
135
|
+
uploadedByActorId: text("uploaded_by_actor_id"),
|
|
136
|
+
createdAt: timestamp("created_at", { mode: "date" }).defaultNow().notNull()
|
|
137
|
+
});
|
|
138
|
+
|
|
119
139
|
export const activityLogs = pgTable("activity_logs", {
|
|
120
140
|
id: text("id").primaryKey(),
|
|
121
141
|
companyId: text("company_id")
|
|
@@ -143,6 +163,25 @@ export const heartbeatRuns = pgTable("heartbeat_runs", {
|
|
|
143
163
|
message: text("message")
|
|
144
164
|
});
|
|
145
165
|
|
|
166
|
+
export const heartbeatRunMessages = pgTable("heartbeat_run_messages", {
|
|
167
|
+
id: text("id").primaryKey(),
|
|
168
|
+
companyId: text("company_id")
|
|
169
|
+
.notNull()
|
|
170
|
+
.references(() => companies.id, { onDelete: "cascade" }),
|
|
171
|
+
runId: text("run_id")
|
|
172
|
+
.notNull()
|
|
173
|
+
.references(() => heartbeatRuns.id, { onDelete: "cascade" }),
|
|
174
|
+
sequence: integer("sequence").notNull(),
|
|
175
|
+
kind: text("kind").notNull(),
|
|
176
|
+
label: text("label"),
|
|
177
|
+
text: text("text"),
|
|
178
|
+
payloadJson: text("payload_json"),
|
|
179
|
+
signalLevel: text("signal_level"),
|
|
180
|
+
groupKey: text("group_key"),
|
|
181
|
+
source: text("source"),
|
|
182
|
+
createdAt: timestamp("created_at", { mode: "date" }).defaultNow().notNull()
|
|
183
|
+
});
|
|
184
|
+
|
|
146
185
|
export const approvalRequests = pgTable("approval_requests", {
|
|
147
186
|
id: text("id").primaryKey(),
|
|
148
187
|
companyId: text("company_id")
|
|
@@ -204,6 +243,56 @@ export const auditEvents = pgTable("audit_events", {
|
|
|
204
243
|
createdAt: timestamp("created_at", { mode: "date" }).defaultNow().notNull()
|
|
205
244
|
});
|
|
206
245
|
|
|
246
|
+
export const plugins = pgTable("plugins", {
|
|
247
|
+
id: text("id").primaryKey(),
|
|
248
|
+
name: text("name").notNull(),
|
|
249
|
+
version: text("version").notNull(),
|
|
250
|
+
kind: text("kind").notNull(),
|
|
251
|
+
runtimeType: text("runtime_type").notNull(),
|
|
252
|
+
runtimeEntrypoint: text("runtime_entrypoint").notNull(),
|
|
253
|
+
hooksJson: text("hooks_json").notNull().default("[]"),
|
|
254
|
+
capabilitiesJson: text("capabilities_json").notNull().default("[]"),
|
|
255
|
+
manifestJson: text("manifest_json").notNull().default("{}"),
|
|
256
|
+
createdAt: timestamp("created_at", { mode: "date" }).defaultNow().notNull(),
|
|
257
|
+
updatedAt: timestamp("updated_at", { mode: "date" }).defaultNow().notNull()
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
export const pluginConfigs = pgTable(
|
|
261
|
+
"plugin_configs",
|
|
262
|
+
{
|
|
263
|
+
companyId: text("company_id")
|
|
264
|
+
.notNull()
|
|
265
|
+
.references(() => companies.id, { onDelete: "cascade" }),
|
|
266
|
+
pluginId: text("plugin_id")
|
|
267
|
+
.notNull()
|
|
268
|
+
.references(() => plugins.id, { onDelete: "cascade" }),
|
|
269
|
+
enabled: boolean("enabled").notNull().default(false),
|
|
270
|
+
priority: integer("priority").notNull().default(100),
|
|
271
|
+
configJson: text("config_json").notNull().default("{}"),
|
|
272
|
+
grantedCapabilitiesJson: text("granted_capabilities_json").notNull().default("[]"),
|
|
273
|
+
createdAt: timestamp("created_at", { mode: "date" }).defaultNow().notNull(),
|
|
274
|
+
updatedAt: timestamp("updated_at", { mode: "date" }).defaultNow().notNull()
|
|
275
|
+
},
|
|
276
|
+
(table) => [primaryKey({ columns: [table.companyId, table.pluginId] })]
|
|
277
|
+
);
|
|
278
|
+
|
|
279
|
+
export const pluginRuns = pgTable("plugin_runs", {
|
|
280
|
+
id: text("id").primaryKey(),
|
|
281
|
+
companyId: text("company_id")
|
|
282
|
+
.notNull()
|
|
283
|
+
.references(() => companies.id, { onDelete: "cascade" }),
|
|
284
|
+
runId: text("run_id").references(() => heartbeatRuns.id, { onDelete: "cascade" }),
|
|
285
|
+
pluginId: text("plugin_id")
|
|
286
|
+
.notNull()
|
|
287
|
+
.references(() => plugins.id, { onDelete: "cascade" }),
|
|
288
|
+
hook: text("hook").notNull(),
|
|
289
|
+
status: text("status").notNull(),
|
|
290
|
+
durationMs: integer("duration_ms").notNull().default(0),
|
|
291
|
+
error: text("error"),
|
|
292
|
+
diagnosticsJson: text("diagnostics_json").notNull().default("{}"),
|
|
293
|
+
createdAt: timestamp("created_at", { mode: "date" }).defaultNow().notNull()
|
|
294
|
+
});
|
|
295
|
+
|
|
207
296
|
export const agentIssueLabels = pgTable(
|
|
208
297
|
"agent_issue_labels",
|
|
209
298
|
{
|
|
@@ -225,12 +314,17 @@ export const schema = {
|
|
|
225
314
|
agents,
|
|
226
315
|
issues,
|
|
227
316
|
issueComments,
|
|
317
|
+
issueAttachments,
|
|
228
318
|
activityLogs,
|
|
229
319
|
heartbeatRuns,
|
|
320
|
+
heartbeatRunMessages,
|
|
230
321
|
approvalRequests,
|
|
231
322
|
approvalInboxStates,
|
|
232
323
|
costLedger,
|
|
233
324
|
auditEvents,
|
|
325
|
+
plugins,
|
|
326
|
+
pluginConfigs,
|
|
327
|
+
pluginRuns,
|
|
234
328
|
agentIssueLabels
|
|
235
329
|
};
|
|
236
330
|
|