bopodev-db 0.1.12 → 0.1.14

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.
@@ -1,5 +1,5 @@
1
1
 
2
2
  
3
- > bopodev-db@0.1.12 build /Users/danielkrusenstrahle/Documents/Projects/Monorepo/bopohq/packages/db
3
+ > bopodev-db@0.1.14 build /Users/danielkrusenstrahle/Documents/Projects/Monorepo/bopohq/packages/db
4
4
  > tsc -p tsconfig.json --emitDeclarationOnly
5
5
 
@@ -1,4 +1,4 @@
1
1
 
2
- > bopodev-db@0.1.10 typecheck /Users/danielkrusenstrahle/Documents/Projects/Monorepo/bopohq/packages/db
2
+ > bopodev-db@0.1.12 typecheck /Users/danielkrusenstrahle/Documents/Projects/Monorepo/bopohq/packages/db
3
3
  > tsc -p tsconfig.json --noEmit
4
4
 
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2026 BopoDev contributors
3
+ Copyright (c) 2026 Bopo
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,4 +1,5 @@
1
1
  import type { BopoDb } from "./client";
2
+ import { heartbeatRunMessages } from "./schema";
2
3
  export declare class RepositoryValidationError extends Error {
3
4
  constructor(message: string);
4
5
  }
@@ -39,6 +40,7 @@ export declare function listProjects(db: BopoDb, companyId: string): Promise<{
39
40
  createdAt: Date;
40
41
  }[]>;
41
42
  export declare function createProject(db: BopoDb, input: {
43
+ id?: string;
42
44
  companyId: string;
43
45
  name: string;
44
46
  description?: string | null;
@@ -47,6 +49,7 @@ export declare function createProject(db: BopoDb, input: {
47
49
  workspaceLocalPath?: string | null;
48
50
  workspaceGithubRepo?: string | null;
49
51
  }): Promise<{
52
+ id: string;
50
53
  companyId: string;
51
54
  name: string;
52
55
  description?: string | null;
@@ -54,7 +57,6 @@ export declare function createProject(db: BopoDb, input: {
54
57
  plannedStartAt?: Date | null;
55
58
  workspaceLocalPath?: string | null;
56
59
  workspaceGithubRepo?: string | null;
57
- id: string;
58
60
  }>;
59
61
  export declare function updateProject(db: BopoDb, input: {
60
62
  companyId: string;
@@ -152,6 +154,68 @@ export declare function updateIssue(db: BopoDb, input: {
152
154
  updatedAt: Date;
153
155
  } | null>;
154
156
  export declare function deleteIssue(db: BopoDb, companyId: string, id: string): Promise<boolean>;
157
+ export declare function addIssueAttachment(db: BopoDb, input: {
158
+ id?: string;
159
+ companyId: string;
160
+ issueId: string;
161
+ projectId: string;
162
+ fileName: string;
163
+ mimeType?: string | null;
164
+ fileSizeBytes: number;
165
+ relativePath: string;
166
+ uploadedByActorType?: "human" | "agent" | "system";
167
+ uploadedByActorId?: string | null;
168
+ }): Promise<{
169
+ id: string;
170
+ companyId: string;
171
+ issueId: string;
172
+ projectId: string;
173
+ fileName: string;
174
+ mimeType?: string | null;
175
+ fileSizeBytes: number;
176
+ relativePath: string;
177
+ uploadedByActorType?: "human" | "agent" | "system";
178
+ uploadedByActorId?: string | null;
179
+ }>;
180
+ export declare function listIssueAttachments(db: BopoDb, companyId: string, issueId: string): Promise<{
181
+ id: string;
182
+ companyId: string;
183
+ issueId: string;
184
+ projectId: string;
185
+ fileName: string;
186
+ mimeType: string | null;
187
+ fileSizeBytes: number;
188
+ relativePath: string;
189
+ uploadedByActorType: string;
190
+ uploadedByActorId: string | null;
191
+ createdAt: Date;
192
+ }[]>;
193
+ export declare function getIssueAttachment(db: BopoDb, companyId: string, issueId: string, attachmentId: string): Promise<{
194
+ id: string;
195
+ companyId: string;
196
+ issueId: string;
197
+ projectId: string;
198
+ fileName: string;
199
+ mimeType: string | null;
200
+ fileSizeBytes: number;
201
+ relativePath: string;
202
+ uploadedByActorType: string;
203
+ uploadedByActorId: string | null;
204
+ createdAt: Date;
205
+ } | null>;
206
+ export declare function deleteIssueAttachment(db: BopoDb, companyId: string, issueId: string, attachmentId: string): Promise<{
207
+ id: string;
208
+ createdAt: Date;
209
+ companyId: string;
210
+ projectId: string;
211
+ issueId: string;
212
+ fileName: string;
213
+ mimeType: string | null;
214
+ fileSizeBytes: number;
215
+ relativePath: string;
216
+ uploadedByActorType: string;
217
+ uploadedByActorId: string | null;
218
+ } | null>;
155
219
  export declare function addIssueComment(db: BopoDb, input: {
156
220
  companyId: string;
157
221
  issueId: string;
@@ -255,7 +319,7 @@ export declare function createAgent(db: BopoDb, input: {
255
319
  managerAgentId?: string | null;
256
320
  role: string;
257
321
  name: string;
258
- providerType: "claude_code" | "codex" | "cursor" | "opencode" | "http" | "shell";
322
+ providerType: "claude_code" | "codex" | "cursor" | "opencode" | "gemini_cli" | "openai_api" | "anthropic_api" | "http" | "shell";
259
323
  heartbeatCron: string;
260
324
  monthlyBudgetUsd: string;
261
325
  canHireAgents?: boolean;
@@ -277,7 +341,7 @@ export declare function createAgent(db: BopoDb, input: {
277
341
  managerAgentId?: string | null;
278
342
  role: string;
279
343
  name: string;
280
- providerType: "claude_code" | "codex" | "cursor" | "opencode" | "http" | "shell";
344
+ providerType: "claude_code" | "codex" | "cursor" | "opencode" | "gemini_cli" | "openai_api" | "anthropic_api" | "http" | "shell";
281
345
  heartbeatCron: string;
282
346
  monthlyBudgetUsd: string;
283
347
  canHireAgents?: boolean;
@@ -328,7 +392,7 @@ export declare function updateAgent(db: BopoDb, input: {
328
392
  managerAgentId?: string | null;
329
393
  role?: string;
330
394
  name?: string;
331
- providerType?: "claude_code" | "codex" | "cursor" | "opencode" | "http" | "shell";
395
+ providerType?: "claude_code" | "codex" | "cursor" | "opencode" | "gemini_cli" | "openai_api" | "anthropic_api" | "http" | "shell";
332
396
  status?: string;
333
397
  heartbeatCron?: string;
334
398
  monthlyBudgetUsd?: string;
@@ -450,6 +514,10 @@ export declare function clearApprovalInboxDismissed(db: BopoDb, input: {
450
514
  export declare function appendCost(db: BopoDb, input: {
451
515
  companyId: string;
452
516
  providerType: string;
517
+ runtimeModelId?: string | null;
518
+ pricingProviderType?: string | null;
519
+ pricingModelId?: string | null;
520
+ pricingSource?: "exact" | "missing" | null;
453
521
  tokenInput: number;
454
522
  tokenOutput: number;
455
523
  usdCost: string;
@@ -464,6 +532,10 @@ export declare function listCostEntries(db: BopoDb, companyId: string, limit?: n
464
532
  issueId: string | null;
465
533
  agentId: string | null;
466
534
  providerType: string;
535
+ runtimeModelId: string | null;
536
+ pricingProviderType: string | null;
537
+ pricingModelId: string | null;
538
+ pricingSource: string | null;
467
539
  tokenInput: number;
468
540
  tokenOutput: number;
469
541
  usdCost: string;
@@ -478,6 +550,61 @@ export declare function listHeartbeatRuns(db: BopoDb, companyId: string, limit?:
478
550
  finishedAt: Date | null;
479
551
  message: string | null;
480
552
  }[]>;
553
+ export declare function getHeartbeatRun(db: BopoDb, companyId: string, runId: string): Promise<{
554
+ id: string;
555
+ companyId: string;
556
+ agentId: string;
557
+ status: string;
558
+ startedAt: Date;
559
+ finishedAt: Date | null;
560
+ message: string | null;
561
+ } | null>;
562
+ export declare function appendHeartbeatRunMessages(db: BopoDb, input: {
563
+ companyId: string;
564
+ runId: string;
565
+ messages: Array<{
566
+ id?: string;
567
+ sequence: number;
568
+ kind: string;
569
+ label?: string | null;
570
+ text?: string | null;
571
+ payloadJson?: string | null;
572
+ signalLevel?: "high" | "medium" | "low" | "noise" | null;
573
+ groupKey?: string | null;
574
+ source?: "stdout" | "stderr" | "trace_fallback" | null;
575
+ createdAt?: Date;
576
+ }>;
577
+ }): Promise<string[]>;
578
+ export declare function listHeartbeatRunMessages(db: BopoDb, input: {
579
+ companyId: string;
580
+ runId: string;
581
+ afterSequence?: number;
582
+ limit?: number;
583
+ }): Promise<{
584
+ items: {
585
+ id: string;
586
+ companyId: string;
587
+ runId: string;
588
+ sequence: number;
589
+ kind: string;
590
+ label: string | null;
591
+ text: string | null;
592
+ payloadJson: string | null;
593
+ signalLevel: string | null;
594
+ groupKey: string | null;
595
+ source: string | null;
596
+ createdAt: Date;
597
+ }[];
598
+ nextCursor: string | null;
599
+ }>;
600
+ export declare function listHeartbeatRunMessagesForRuns(db: BopoDb, input: {
601
+ companyId: string;
602
+ runIds: string[];
603
+ perRunLimit?: number;
604
+ }): Promise<Map<string, {
605
+ items: Array<(typeof heartbeatRunMessages.$inferSelect)>;
606
+ nextCursor: string | null;
607
+ }>>;
481
608
  export declare function appendActivity(db: BopoDb, input: {
482
609
  companyId: string;
483
610
  issueId?: string | null;
@@ -486,3 +613,119 @@ export declare function appendActivity(db: BopoDb, input: {
486
613
  eventType: string;
487
614
  payload: Record<string, unknown>;
488
615
  }): Promise<string>;
616
+ export declare function upsertPlugin(db: BopoDb, input: {
617
+ id: string;
618
+ name: string;
619
+ version: string;
620
+ kind: string;
621
+ runtimeType: string;
622
+ runtimeEntrypoint: string;
623
+ hooksJson?: string;
624
+ capabilitiesJson?: string;
625
+ manifestJson?: string;
626
+ }): Promise<string>;
627
+ export declare function listPlugins(db: BopoDb): Promise<{
628
+ id: string;
629
+ name: string;
630
+ version: string;
631
+ kind: string;
632
+ runtimeType: string;
633
+ runtimeEntrypoint: string;
634
+ hooksJson: string;
635
+ capabilitiesJson: string;
636
+ manifestJson: string;
637
+ createdAt: Date;
638
+ updatedAt: Date;
639
+ }[]>;
640
+ export declare function updatePluginConfig(db: BopoDb, input: {
641
+ companyId: string;
642
+ pluginId: string;
643
+ enabled?: boolean;
644
+ priority?: number;
645
+ configJson?: string;
646
+ grantedCapabilitiesJson?: string;
647
+ }): Promise<void>;
648
+ export declare function deletePluginConfig(db: BopoDb, input: {
649
+ companyId: string;
650
+ pluginId: string;
651
+ }): Promise<void>;
652
+ export declare function deletePluginById(db: BopoDb, pluginId: string): Promise<void>;
653
+ export declare function listCompanyPluginConfigs(db: BopoDb, companyId: string): Promise<{
654
+ companyId: string;
655
+ pluginId: string;
656
+ enabled: boolean;
657
+ priority: number;
658
+ configJson: string;
659
+ grantedCapabilitiesJson: string;
660
+ pluginName: string;
661
+ pluginVersion: string;
662
+ pluginKind: string;
663
+ runtimeType: string;
664
+ runtimeEntrypoint: string;
665
+ hooksJson: string;
666
+ capabilitiesJson: string;
667
+ manifestJson: string;
668
+ }[]>;
669
+ export declare function appendPluginRun(db: BopoDb, input: {
670
+ companyId: string;
671
+ runId?: string | null;
672
+ pluginId: string;
673
+ hook: string;
674
+ status: string;
675
+ durationMs: number;
676
+ error?: string | null;
677
+ diagnosticsJson?: string;
678
+ }): Promise<string>;
679
+ export declare function listPluginRuns(db: BopoDb, input: {
680
+ companyId: string;
681
+ pluginId?: string;
682
+ runId?: string;
683
+ limit?: number;
684
+ }): Promise<{
685
+ id: string;
686
+ companyId: string;
687
+ runId: string | null;
688
+ pluginId: string;
689
+ hook: string;
690
+ status: string;
691
+ durationMs: number;
692
+ error: string | null;
693
+ diagnosticsJson: string;
694
+ createdAt: Date;
695
+ }[]>;
696
+ export declare function listModelPricing(db: BopoDb, companyId: string): Promise<{
697
+ companyId: string;
698
+ providerType: string;
699
+ modelId: string;
700
+ displayName: string | null;
701
+ inputUsdPer1M: string;
702
+ outputUsdPer1M: string;
703
+ currency: string;
704
+ updatedAt: Date;
705
+ updatedBy: string | null;
706
+ }[]>;
707
+ export declare function getModelPricing(db: BopoDb, input: {
708
+ companyId: string;
709
+ providerType: string;
710
+ modelId: string;
711
+ }): Promise<{
712
+ companyId: string;
713
+ providerType: string;
714
+ modelId: string;
715
+ displayName: string | null;
716
+ inputUsdPer1M: string;
717
+ outputUsdPer1M: string;
718
+ currency: string;
719
+ updatedAt: Date;
720
+ updatedBy: string | null;
721
+ } | null>;
722
+ export declare function upsertModelPricing(db: BopoDb, input: {
723
+ companyId: string;
724
+ providerType: string;
725
+ modelId: string;
726
+ displayName?: string | null;
727
+ inputUsdPer1M?: string | null;
728
+ outputUsdPer1M?: string | null;
729
+ currency?: string | null;
730
+ updatedBy?: string | null;
731
+ }): Promise<void>;