codebuff 1.0.290 → 1.0.291

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.
Files changed (46) hide show
  1. package/dist/cli-handlers/checkpoint.d.ts +1 -1
  2. package/dist/cli.d.ts +1 -1
  3. package/dist/cli.js +1 -1
  4. package/dist/client.d.ts +4 -4
  5. package/dist/common/actions.d.ts +144 -144
  6. package/dist/common/db/schema.d.ts +1 -1
  7. package/dist/common/types/agent-state.d.ts +8 -8
  8. package/dist/common/types/message.d.ts +6 -6
  9. package/dist/common/types/organization.d.ts +102 -0
  10. package/dist/common/types/organization.js +3 -0
  11. package/dist/common/types/organization.js.map +1 -0
  12. package/dist/common/types/usage.d.ts +2 -2
  13. package/dist/common/util/credentials.d.ts +2 -2
  14. package/dist/common/websockets/websocket-schema.d.ts +256 -256
  15. package/dist/index.js +9 -3
  16. package/dist/organization-context.d.ts +33 -0
  17. package/dist/organization-context.js +112 -0
  18. package/dist/organization-context.js.map +1 -0
  19. package/dist/slash-commands.d.ts +7 -0
  20. package/dist/slash-commands.js +21 -0
  21. package/dist/slash-commands.js.map +1 -0
  22. package/dist/utils/spinner.js +1 -1
  23. package/package.json +1 -1
  24. package/dist/common/__tests__/project-file-tree.test.d.ts +0 -1
  25. package/dist/common/__tests__/project-file-tree.test.js +0 -251
  26. package/dist/common/__tests__/project-file-tree.test.js.map +0 -1
  27. package/dist/common/json-config/__tests__/__snapshots__/stringify-schema.test.js.snap +0 -119
  28. package/dist/common/util/process-stream.d.ts +0 -7
  29. package/dist/common/util/process-stream.js +0 -162
  30. package/dist/common/util/process-stream.js.map +0 -1
  31. package/dist/readline.d.ts +0 -22
  32. package/dist/readline.js +0 -180
  33. package/dist/readline.js.map +0 -1
  34. package/dist/utils/__tests__/__snapshots__/background-process-manager.test.js.snap +0 -137
  35. package/dist/utils/__tests__/file-paths.test.d.ts +0 -1
  36. package/dist/utils/__tests__/file-paths.test.js +0 -37
  37. package/dist/utils/__tests__/file-paths.test.js.map +0 -1
  38. package/dist/utils/__tests__/path.test.d.ts +0 -1
  39. package/dist/utils/__tests__/path.test.js +0 -37
  40. package/dist/utils/__tests__/path.test.js.map +0 -1
  41. package/dist/utils/file-paths.d.ts +0 -9
  42. package/dist/utils/file-paths.js +0 -24
  43. package/dist/utils/file-paths.js.map +0 -1
  44. package/dist/utils/path.d.ts +0 -9
  45. package/dist/utils/path.js +0 -27
  46. package/dist/utils/path.js.map +0 -1
@@ -1385,7 +1385,7 @@ export declare const encryptedApiKeys: import("drizzle-orm/pg-core").PgTableWith
1385
1385
  tableName: "encrypted_api_keys";
1386
1386
  dataType: "string";
1387
1387
  columnType: "PgEnumColumn";
1388
- data: "anthropic" | "gemini" | "openai";
1388
+ data: "gemini" | "anthropic" | "openai";
1389
1389
  driverParam: string;
1390
1390
  notNull: true;
1391
1391
  hasDefault: false;
@@ -6,12 +6,12 @@ export declare const ToolCallSchema: z.ZodObject<{
6
6
  id: z.ZodString;
7
7
  }, "strip", z.ZodTypeAny, {
8
8
  name: string;
9
- parameters: Record<string, string>;
10
9
  id: string;
10
+ parameters: Record<string, string>;
11
11
  }, {
12
12
  name: string;
13
- parameters: Record<string, string>;
14
13
  id: string;
14
+ parameters: Record<string, string>;
15
15
  }>;
16
16
  export type ToolCall = z.infer<typeof ToolCallSchema>;
17
17
  export declare const ToolResultSchema: z.ZodObject<{
@@ -206,15 +206,15 @@ export declare const AgentStateSchema: z.ZodObject<{
206
206
  type: "ephemeral";
207
207
  }>>;
208
208
  }, "strip", z.ZodTypeAny, {
209
- content: string;
210
209
  type: "tool_result";
210
+ content: string;
211
211
  tool_use_id: string;
212
212
  cache_control?: {
213
213
  type: "ephemeral";
214
214
  } | undefined;
215
215
  }, {
216
- content: string;
217
216
  type: "tool_result";
217
+ content: string;
218
218
  tool_use_id: string;
219
219
  cache_control?: {
220
220
  type: "ephemeral";
@@ -278,8 +278,8 @@ export declare const AgentStateSchema: z.ZodObject<{
278
278
  type: "ephemeral";
279
279
  } | undefined;
280
280
  } | {
281
- content: string;
282
281
  type: "tool_result";
282
+ content: string;
283
283
  tool_use_id: string;
284
284
  cache_control?: {
285
285
  type: "ephemeral";
@@ -312,8 +312,8 @@ export declare const AgentStateSchema: z.ZodObject<{
312
312
  type: "ephemeral";
313
313
  } | undefined;
314
314
  } | {
315
- content: string;
316
315
  type: "tool_result";
316
+ content: string;
317
317
  tool_use_id: string;
318
318
  cache_control?: {
319
319
  type: "ephemeral";
@@ -378,8 +378,8 @@ export declare const AgentStateSchema: z.ZodObject<{
378
378
  type: "ephemeral";
379
379
  } | undefined;
380
380
  } | {
381
- content: string;
382
381
  type: "tool_result";
382
+ content: string;
383
383
  tool_use_id: string;
384
384
  cache_control?: {
385
385
  type: "ephemeral";
@@ -444,8 +444,8 @@ export declare const AgentStateSchema: z.ZodObject<{
444
444
  type: "ephemeral";
445
445
  } | undefined;
446
446
  } | {
447
- content: string;
448
447
  type: "tool_result";
448
+ content: string;
449
449
  tool_use_id: string;
450
450
  cache_control?: {
451
451
  type: "ephemeral";
@@ -61,15 +61,15 @@ declare const MessageContentObjectSchema: z.ZodUnion<[z.ZodObject<{
61
61
  type: "ephemeral";
62
62
  }>>;
63
63
  }, "strip", z.ZodTypeAny, {
64
- content: string;
65
64
  type: "tool_result";
65
+ content: string;
66
66
  tool_use_id: string;
67
67
  cache_control?: {
68
68
  type: "ephemeral";
69
69
  } | undefined;
70
70
  }, {
71
- content: string;
72
71
  type: "tool_result";
72
+ content: string;
73
73
  tool_use_id: string;
74
74
  cache_control?: {
75
75
  type: "ephemeral";
@@ -181,15 +181,15 @@ export declare const MessageSchema: z.ZodObject<{
181
181
  type: "ephemeral";
182
182
  }>>;
183
183
  }, "strip", z.ZodTypeAny, {
184
- content: string;
185
184
  type: "tool_result";
185
+ content: string;
186
186
  tool_use_id: string;
187
187
  cache_control?: {
188
188
  type: "ephemeral";
189
189
  } | undefined;
190
190
  }, {
191
- content: string;
192
191
  type: "tool_result";
192
+ content: string;
193
193
  tool_use_id: string;
194
194
  cache_control?: {
195
195
  type: "ephemeral";
@@ -253,8 +253,8 @@ export declare const MessageSchema: z.ZodObject<{
253
253
  type: "ephemeral";
254
254
  } | undefined;
255
255
  } | {
256
- content: string;
257
256
  type: "tool_result";
257
+ content: string;
258
258
  tool_use_id: string;
259
259
  cache_control?: {
260
260
  type: "ephemeral";
@@ -287,8 +287,8 @@ export declare const MessageSchema: z.ZodObject<{
287
287
  type: "ephemeral";
288
288
  } | undefined;
289
289
  } | {
290
- content: string;
291
290
  type: "tool_result";
291
+ content: string;
292
292
  tool_use_id: string;
293
293
  cache_control?: {
294
294
  type: "ephemeral";
@@ -0,0 +1,102 @@
1
+ export type OrganizationRole = 'owner' | 'admin' | 'member';
2
+ export interface OrganizationMember {
3
+ organization_id: string;
4
+ user_id: string;
5
+ role: OrganizationRole;
6
+ joined_at: Date;
7
+ }
8
+ export interface Organization {
9
+ id: string;
10
+ name: string;
11
+ slug: string;
12
+ description?: string;
13
+ owner_id: string;
14
+ stripe_customer_id?: string;
15
+ created_at: Date;
16
+ updated_at: Date;
17
+ }
18
+ export interface OrganizationRepository {
19
+ id: string;
20
+ organization_id: string;
21
+ repository_url: string;
22
+ repository_name: string;
23
+ approved_by: string;
24
+ approved_at: Date;
25
+ is_active: boolean;
26
+ }
27
+ export interface OrganizationUsage {
28
+ id: string;
29
+ organization_id: string;
30
+ user_id: string;
31
+ repository_url: string;
32
+ credits_used: number;
33
+ message_id?: string;
34
+ created_at: Date;
35
+ }
36
+ export interface CreateOrganizationRequest {
37
+ name: string;
38
+ slug?: string;
39
+ description?: string;
40
+ }
41
+ export interface ListOrganizationsResponse {
42
+ organizations: Array<{
43
+ id: string;
44
+ name: string;
45
+ slug: string;
46
+ role: OrganizationRole;
47
+ memberCount: number;
48
+ repositoryCount: number;
49
+ }>;
50
+ }
51
+ export interface OrganizationDetailsResponse {
52
+ id: string;
53
+ name: string;
54
+ slug: string;
55
+ description?: string;
56
+ owner_id: string;
57
+ created_at: string;
58
+ userRole: OrganizationRole;
59
+ memberCount: number;
60
+ repositoryCount: number;
61
+ creditBalance?: number;
62
+ }
63
+ export interface InviteMemberRequest {
64
+ email: string;
65
+ role: 'admin' | 'member';
66
+ }
67
+ export interface UpdateMemberRoleRequest {
68
+ role: 'admin' | 'member';
69
+ }
70
+ export interface AddRepositoryRequest {
71
+ repository_url: string;
72
+ repository_name: string;
73
+ }
74
+ export interface OrganizationUsageResponse {
75
+ currentBalance: number;
76
+ usageThisCycle: number;
77
+ topUsers: Array<{
78
+ user_id: string;
79
+ user_name: string;
80
+ credits_used: number;
81
+ }>;
82
+ recentUsage: Array<{
83
+ date: string;
84
+ credits_used: number;
85
+ repository_url: string;
86
+ user_name: string;
87
+ }>;
88
+ }
89
+ export interface CreditDelegationResult {
90
+ useOrganization: boolean;
91
+ organizationId?: string;
92
+ requiresOverride: boolean;
93
+ organizationBalance?: number;
94
+ userBalance?: number;
95
+ }
96
+ export interface CreditConsumptionWithDelegationResult {
97
+ success: boolean;
98
+ consumed: number;
99
+ fromOrganization: boolean;
100
+ organizationId?: string;
101
+ error?: string;
102
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=organization.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"organization.js","sourceRoot":"","sources":["../../src/types/organization.ts"],"names":[],"mappings":""}
@@ -19,22 +19,22 @@ export declare const usageDataSchema: z.ZodObject<{
19
19
  }>;
20
20
  nextQuotaReset: z.ZodNullable<z.ZodDate>;
21
21
  }, "strip", z.ZodTypeAny, {
22
- usageThisCycle: number;
23
22
  balance: {
24
23
  totalRemaining: number;
25
24
  totalDebt: number;
26
25
  netBalance: number;
27
26
  breakdown: Partial<Record<"free" | "referral" | "purchase" | "admin", number>>;
28
27
  };
28
+ usageThisCycle: number;
29
29
  nextQuotaReset: Date | null;
30
30
  }, {
31
- usageThisCycle: number;
32
31
  balance: {
33
32
  totalRemaining: number;
34
33
  totalDebt: number;
35
34
  netBalance: number;
36
35
  breakdown: Partial<Record<"free" | "referral" | "purchase" | "admin", number>>;
37
36
  };
37
+ usageThisCycle: number;
38
38
  nextQuotaReset: Date | null;
39
39
  }>;
40
40
  export type UsageData = z.infer<typeof usageDataSchema>;
@@ -7,15 +7,15 @@ export declare const userSchema: z.ZodObject<{
7
7
  fingerprintId: z.ZodString;
8
8
  fingerprintHash: z.ZodString;
9
9
  }, "strip", z.ZodTypeAny, {
10
- email: string;
11
10
  name: string | null;
11
+ email: string;
12
12
  id: string;
13
13
  fingerprintId: string;
14
14
  authToken: string;
15
15
  fingerprintHash: string;
16
16
  }, {
17
- email: string;
18
17
  name: string | null;
18
+ email: string;
19
19
  id: string;
20
20
  fingerprintId: string;
21
21
  authToken: string;