byterover-cli 3.12.0 → 3.13.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/.env.production +2 -1
- package/dist/oclif/commands/curate/index.js +6 -0
- package/dist/oclif/commands/providers/connect.d.ts +26 -1
- package/dist/oclif/commands/providers/connect.js +95 -17
- package/dist/oclif/commands/providers/list.d.ts +10 -1
- package/dist/oclif/commands/providers/list.js +35 -3
- package/dist/oclif/commands/query.js +6 -0
- package/dist/oclif/commands/status.js +4 -0
- package/dist/oclif/lib/billing-line.d.ts +8 -0
- package/dist/oclif/lib/billing-line.js +45 -0
- package/dist/oclif/lib/format-billing-line.d.ts +2 -0
- package/dist/oclif/lib/format-billing-line.js +19 -0
- package/dist/oclif/lib/insufficient-credits.d.ts +11 -0
- package/dist/oclif/lib/insufficient-credits.js +36 -0
- package/dist/server/config/environment.d.ts +1 -0
- package/dist/server/config/environment.js +3 -0
- package/dist/server/core/domain/transport/schemas.d.ts +17 -0
- package/dist/server/core/domain/transport/schemas.js +3 -0
- package/dist/server/core/interfaces/services/i-billing-service.d.ts +26 -0
- package/dist/server/core/interfaces/services/i-billing-service.js +1 -0
- package/dist/server/core/interfaces/storage/i-billing-config-store.d.ts +4 -0
- package/dist/server/core/interfaces/storage/i-billing-config-store.js +1 -0
- package/dist/server/infra/billing/billing-state-endpoint.d.ts +4 -0
- package/dist/server/infra/billing/billing-state-endpoint.js +7 -0
- package/dist/server/infra/billing/build-status-billing.d.ts +9 -0
- package/dist/server/infra/billing/build-status-billing.js +36 -0
- package/dist/server/infra/billing/http-billing-service.d.ts +19 -0
- package/dist/server/infra/billing/http-billing-service.js +57 -0
- package/dist/server/infra/billing/paid-organizations-endpoint.d.ts +8 -0
- package/dist/server/infra/billing/paid-organizations-endpoint.js +18 -0
- package/dist/server/infra/billing/resolve-billing-source.d.ts +13 -0
- package/dist/server/infra/billing/resolve-billing-source.js +36 -0
- package/dist/server/infra/billing/resolve-billing-team.d.ts +5 -0
- package/dist/server/infra/billing/resolve-billing-team.js +8 -0
- package/dist/server/infra/connectors/rules/rules-connector.js +7 -2
- package/dist/server/infra/connectors/shared/constants.d.ts +9 -0
- package/dist/server/infra/connectors/shared/constants.js +31 -5
- package/dist/server/infra/daemon/agent-process.js +10 -8
- package/dist/server/infra/daemon/brv-server.js +5 -0
- package/dist/server/infra/http/provider-model-fetchers.js +10 -4
- package/dist/server/infra/process/feature-handlers.d.ts +3 -1
- package/dist/server/infra/process/feature-handlers.js +26 -2
- package/dist/server/infra/storage/file-billing-config-store.d.ts +13 -0
- package/dist/server/infra/storage/file-billing-config-store.js +55 -0
- package/dist/server/infra/transport/handlers/auth-handler.d.ts +4 -0
- package/dist/server/infra/transport/handlers/auth-handler.js +20 -2
- package/dist/server/infra/transport/handlers/billing-handler.d.ts +30 -0
- package/dist/server/infra/transport/handlers/billing-handler.js +132 -0
- package/dist/server/infra/transport/handlers/index.d.ts +4 -0
- package/dist/server/infra/transport/handlers/index.js +2 -0
- package/dist/server/infra/transport/handlers/init-handler.js +2 -0
- package/dist/server/infra/transport/handlers/status-handler.d.ts +14 -0
- package/dist/server/infra/transport/handlers/status-handler.js +16 -0
- package/dist/server/infra/transport/handlers/team-handler.d.ts +19 -0
- package/dist/server/infra/transport/handlers/team-handler.js +40 -0
- package/dist/shared/transport/events/auth-events.d.ts +3 -0
- package/dist/shared/transport/events/billing-events.d.ts +48 -0
- package/dist/shared/transport/events/billing-events.js +8 -0
- package/dist/shared/transport/events/index.d.ts +11 -0
- package/dist/shared/transport/events/index.js +6 -0
- package/dist/shared/transport/events/team-events.d.ts +8 -0
- package/dist/shared/transport/events/team-events.js +3 -0
- package/dist/shared/transport/types/dto.d.ts +80 -0
- package/dist/webui/assets/index-B9JmEFOK.js +130 -0
- package/dist/webui/assets/index-CMIKsBMr.css +1 -0
- package/dist/webui/index.html +2 -2
- package/dist/webui/sw.js +1 -1
- package/oclif.manifest.json +1280 -1272
- package/package.json +1 -1
- package/dist/webui/assets/index-DyVvFoM6.css +0 -1
- package/dist/webui/assets/index-lr0byHh9.js +0 -130
|
@@ -25,10 +25,12 @@ export interface BrvConfigDTO {
|
|
|
25
25
|
version: string;
|
|
26
26
|
}
|
|
27
27
|
export interface TeamDTO {
|
|
28
|
+
avatarUrl: string;
|
|
28
29
|
displayName: string;
|
|
29
30
|
id: string;
|
|
30
31
|
isDefault: boolean;
|
|
31
32
|
name: string;
|
|
33
|
+
slug: string;
|
|
32
34
|
}
|
|
33
35
|
export interface SpaceDTO {
|
|
34
36
|
id: string;
|
|
@@ -49,6 +51,66 @@ export interface ConnectorDTO {
|
|
|
49
51
|
defaultType: ConnectorType;
|
|
50
52
|
supportedTypes: ConnectorType[];
|
|
51
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* Mirror of the upstream ByteRover billing API
|
|
56
|
+
* (`GET /api/v1/billing/usage/{organizationId}/by-projects`).
|
|
57
|
+
*
|
|
58
|
+
* Field shape is preserved so the daemon can pass through without remapping.
|
|
59
|
+
*/
|
|
60
|
+
export type BillingTier = 'FREE' | 'PRO' | 'TEAM';
|
|
61
|
+
export interface BillingOrganizationTierDTO {
|
|
62
|
+
/** True while the org is in a trial window for `tier`. */
|
|
63
|
+
isTrialing: boolean;
|
|
64
|
+
organizationId: string;
|
|
65
|
+
tier: BillingTier;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Per-organization billing usage. Joins `/billing/usages` org entries with
|
|
69
|
+
* `/billing/organizations/tiers` so consumers see one DTO per org.
|
|
70
|
+
*/
|
|
71
|
+
export interface BillingUsageDTO {
|
|
72
|
+
/** Add-on credits remaining beyond the base `limit`. */
|
|
73
|
+
addOnRemaining: number;
|
|
74
|
+
/** True while the org is in a trial window for `tier`. */
|
|
75
|
+
isTrialing: boolean;
|
|
76
|
+
/** Base compute-unit limit for the current billing period. */
|
|
77
|
+
limit: number;
|
|
78
|
+
/** True when the organization has consumed >= `totalLimit`. */
|
|
79
|
+
limitExceeded: boolean;
|
|
80
|
+
organizationId: string;
|
|
81
|
+
/** Display name from the billing service (typically matches the team display name). */
|
|
82
|
+
organizationName: string;
|
|
83
|
+
/** Free-form status string from the billing service (e.g. 'ACTIVE', 'SUSPENDED'). */
|
|
84
|
+
organizationStatus: string;
|
|
85
|
+
/** Percentage of `totalLimit` consumed (0–100). */
|
|
86
|
+
percentUsed: number;
|
|
87
|
+
/** Compute units still available this period (counting add-ons). */
|
|
88
|
+
remaining: number;
|
|
89
|
+
/** Defaults to `FREE` when the tiers endpoint omits the org. */
|
|
90
|
+
tier: BillingTier;
|
|
91
|
+
/** `limit + addOnRemaining` — total credits available this period. */
|
|
92
|
+
totalLimit: number;
|
|
93
|
+
/** Compute units consumed so far this period. */
|
|
94
|
+
used: number;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Free-tier limit for users without a paid organization. Daily and monthly
|
|
98
|
+
* caps are reported separately so the UI can surface whichever is closer to
|
|
99
|
+
* exhaustion.
|
|
100
|
+
*/
|
|
101
|
+
export interface BillingFreeUserLimitWindowDTO {
|
|
102
|
+
limit: number;
|
|
103
|
+
limitExceeded: boolean;
|
|
104
|
+
percentUsed: number;
|
|
105
|
+
remaining: number;
|
|
106
|
+
used: number;
|
|
107
|
+
}
|
|
108
|
+
export interface BillingFreeUserLimitDTO {
|
|
109
|
+
daily: BillingFreeUserLimitWindowDTO;
|
|
110
|
+
/** True when either window is exhausted. Mirrors the upstream top-level field. */
|
|
111
|
+
limitExceeded: boolean;
|
|
112
|
+
monthly: BillingFreeUserLimitWindowDTO;
|
|
113
|
+
}
|
|
52
114
|
export interface ProviderDTO {
|
|
53
115
|
/** Currently selected model for this provider, if any. Absent means connected but model not yet picked. */
|
|
54
116
|
activeModel?: string;
|
|
@@ -122,6 +184,22 @@ export interface ProjectLocationDTO {
|
|
|
122
184
|
isInitialized: boolean;
|
|
123
185
|
projectPath: string;
|
|
124
186
|
}
|
|
187
|
+
export type StatusBillingSource = 'free' | 'other-provider' | 'paid';
|
|
188
|
+
export type StatusBillingDTO = {
|
|
189
|
+
activeProvider?: string;
|
|
190
|
+
source: 'other-provider';
|
|
191
|
+
} | {
|
|
192
|
+
organizationId: string;
|
|
193
|
+
organizationName?: string;
|
|
194
|
+
remaining?: number;
|
|
195
|
+
source: 'paid';
|
|
196
|
+
tier?: BillingTier;
|
|
197
|
+
total?: number;
|
|
198
|
+
} | {
|
|
199
|
+
remaining?: number;
|
|
200
|
+
source: 'free';
|
|
201
|
+
total?: number;
|
|
202
|
+
};
|
|
125
203
|
export interface StatusDTO {
|
|
126
204
|
/** Current state of the background abstract generation queue, if active */
|
|
127
205
|
abstractQueue?: {
|
|
@@ -131,6 +209,8 @@ export interface StatusDTO {
|
|
|
131
209
|
processing: boolean;
|
|
132
210
|
};
|
|
133
211
|
authStatus: 'expired' | 'logged_in' | 'not_logged_in' | 'unknown';
|
|
212
|
+
/** Resolved billing source for the byterover provider (omitted on transport/billing failure). */
|
|
213
|
+
billing?: StatusBillingDTO;
|
|
134
214
|
contextTreeChanges?: ContextTreeChanges;
|
|
135
215
|
/** Absolute path to the context tree directory (e.g., '/Users/foo/project/.brv/context-tree') */
|
|
136
216
|
contextTreeDir?: string;
|