codebuff 1.0.294 → 1.0.296
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/background-process-manager.d.ts +50 -0
- package/dist/background-process-manager.js +3 -3
- package/dist/browser-runner.d.ts +35 -0
- package/dist/browser-runner.js +4 -4
- package/dist/chat-storage.d.ts +2 -0
- package/dist/chat-storage.js +2 -2
- package/dist/chat-storage.js.map +1 -1
- package/dist/checkpoints/checkpoint-manager.d.ts +94 -0
- package/dist/checkpoints/checkpoint-manager.js +1 -1
- package/dist/checkpoints/file-manager.d.ts +72 -0
- package/dist/checkpoints/file-manager.js +294 -0
- package/dist/checkpoints/file-manager.js.map +1 -0
- package/dist/cli-definitions.d.ts +9 -0
- package/dist/cli-definitions.js +54 -0
- package/dist/cli-definitions.js.map +1 -0
- package/dist/cli-handlers/api-key.d.ts +25 -0
- package/dist/cli-handlers/api-key.js +1 -1
- package/dist/cli-handlers/checkpoint.d.ts +18 -0
- package/dist/cli-handlers/diff.d.ts +2 -0
- package/dist/cli-handlers/diff.js +31 -0
- package/dist/cli-handlers/diff.js.map +1 -0
- package/dist/cli-handlers/easter-egg.d.ts +1 -0
- package/dist/cli-handlers/easter-egg.js +126 -0
- package/dist/cli-handlers/easter-egg.js.map +1 -0
- package/dist/cli-handlers/inititalization-flow.d.ts +1 -0
- package/dist/cli-handlers/inititalization-flow.js +1 -1
- package/dist/cli.d.ts +66 -0
- package/dist/cli.js +87 -30
- package/dist/cli.js.map +1 -1
- package/dist/client.d.ts +10 -7
- package/dist/client.js +71 -12
- package/dist/client.js.map +1 -1
- package/dist/code-map/tsconfig.tsbuildinfo +1 -1
- package/dist/common/actions.d.ts +3 -0
- package/dist/common/actions.js +1 -0
- package/dist/common/actions.js.map +1 -1
- package/dist/common/analytics.d.ts +1 -0
- package/dist/common/analytics.js +7 -0
- package/dist/common/analytics.js.map +1 -1
- package/dist/common/browser-actions.d.ts +234 -234
- package/dist/common/credit-delegation.d.ts +19 -0
- package/dist/common/credit-delegation.js +97 -0
- package/dist/common/credit-delegation.js.map +1 -0
- package/dist/common/types/organization.d.ts +102 -0
- package/dist/common/types/organization.js +3 -0
- package/dist/common/types/organization.js.map +1 -0
- package/dist/common/util/changes.d.ts +1 -0
- package/dist/common/util/changes.js +13 -4
- package/dist/common/util/changes.js.map +1 -1
- package/dist/common/websockets/websocket-schema.d.ts +10 -0
- package/dist/config.d.ts +4 -0
- package/dist/config.js +12 -0
- package/dist/config.js.map +1 -0
- package/dist/create-template-project.d.ts +1 -0
- package/dist/create-template-project.js +107 -0
- package/dist/create-template-project.js.map +1 -0
- package/dist/credentials.d.ts +4 -0
- package/dist/credentials.js +2 -2
- package/dist/dev-process-manager.d.ts +10 -0
- package/dist/dev-process-manager.js +1 -1
- package/dist/display.d.ts +11 -0
- package/dist/display.js +85 -0
- package/dist/display.js.map +1 -0
- package/dist/fingerprint.d.ts +1 -0
- package/dist/fingerprint.js +48 -0
- package/dist/fingerprint.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -2
- package/dist/menu.d.ts +14 -0
- package/dist/menu.js +319 -0
- package/dist/menu.js.map +1 -0
- package/dist/organization-context.d.ts +47 -0
- package/dist/organization-context.js +170 -0
- package/dist/organization-context.js.map +1 -0
- package/dist/project-files.d.ts +4 -3
- package/dist/project-files.js +17 -8
- package/dist/project-files.js.map +1 -1
- package/dist/slash-commands.d.ts +7 -0
- package/dist/slash-commands.js +21 -0
- package/dist/slash-commands.js.map +1 -0
- package/dist/startup-process-handler.d.ts +2 -0
- package/dist/tool-handlers.d.ts +2 -2
- package/dist/tool-handlers.js +9 -6
- package/dist/tool-handlers.js.map +1 -1
- package/dist/types.d.ts +15 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/update-codebuff.d.ts +1 -0
- package/dist/update-codebuff.js +7 -4
- package/dist/update-codebuff.js.map +1 -1
- package/dist/utils/__tests__/background-process-manager.test.d.ts +1 -0
- package/dist/utils/__tests__/background-process-manager.test.js +327 -0
- package/dist/utils/__tests__/background-process-manager.test.js.map +1 -0
- package/dist/utils/__tests__/tool-renderers.test.d.ts +1 -0
- package/dist/utils/__tests__/tool-renderers.test.js +2 -2
- package/dist/utils/__tests__/xml-stream-parser.test.d.ts +1 -0
- package/dist/utils/__tests__/xml-stream-parser.test.js +1 -1
- package/dist/utils/analytics.d.ts +7 -0
- package/dist/utils/analytics.js +8 -0
- package/dist/utils/analytics.js.map +1 -1
- package/dist/utils/detect-shell.d.ts +1 -0
- package/dist/utils/detect-shell.js +60 -0
- package/dist/utils/detect-shell.js.map +1 -0
- package/dist/utils/git.d.ts +10 -0
- package/dist/utils/git.js +112 -0
- package/dist/utils/git.js.map +1 -0
- package/dist/utils/image.d.ts +4 -0
- package/dist/utils/image.js +67 -0
- package/dist/utils/image.js.map +1 -0
- package/dist/utils/logger.d.ts +21 -0
- package/dist/utils/logger.js +14 -7
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/spinner.d.ts +12 -0
- package/dist/utils/spinner.js +94 -0
- package/dist/utils/spinner.js.map +1 -0
- package/dist/utils/system-info.d.ts +8 -0
- package/dist/utils/system-info.js +22 -0
- package/dist/utils/system-info.js.map +1 -0
- package/dist/utils/terminal.d.ts +44 -0
- package/dist/utils/terminal.js +11 -7
- package/dist/utils/terminal.js.map +1 -1
- package/dist/utils/tool-renderers.d.ts +16 -0
- package/dist/utils/tool-renderers.js +2 -2
- package/dist/utils/xml-stream-parser.d.ts +1 -1
- package/dist/utils/xml-stream-parser.js +2 -2
- package/dist/web-scraper.d.ts +3 -0
- package/dist/web-scraper.js +1 -1
- package/dist/workers/checkpoint-worker.d.ts +1 -0
- package/dist/workers/checkpoint-worker.js +48 -0
- package/dist/workers/checkpoint-worker.js.map +1 -0
- package/dist/workers/project-context.d.ts +1 -0
- package/dist/workers/project-context.js +1 -1
- package/package.json +5 -4
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface OrganizationLookupResult {
|
|
2
|
+
found: boolean;
|
|
3
|
+
organizationId?: string;
|
|
4
|
+
organizationName?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface CreditDelegationResult {
|
|
7
|
+
useOrganization: boolean;
|
|
8
|
+
organizationId?: string;
|
|
9
|
+
organizationName?: string;
|
|
10
|
+
fallbackToPersonal: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Finds the organization associated with a repository for a given user
|
|
14
|
+
*/
|
|
15
|
+
export declare function findOrganizationForRepository(userId: string, repositoryUrl: string): Promise<OrganizationLookupResult>;
|
|
16
|
+
/**
|
|
17
|
+
* Determines credit delegation for a user and repository
|
|
18
|
+
*/
|
|
19
|
+
export declare function consumeCreditsWithDelegation(userId: string, repositoryUrl: string, creditsToConsume: number): Promise<CreditDelegationResult>;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.findOrganizationForRepository = findOrganizationForRepository;
|
|
30
|
+
exports.consumeCreditsWithDelegation = consumeCreditsWithDelegation;
|
|
31
|
+
const db_1 = __importDefault(require("./db"));
|
|
32
|
+
const schema = __importStar(require("./db/schema"));
|
|
33
|
+
const drizzle_orm_1 = require("drizzle-orm");
|
|
34
|
+
/**
|
|
35
|
+
* Finds the organization associated with a repository for a given user
|
|
36
|
+
*/
|
|
37
|
+
async function findOrganizationForRepository(userId, repositoryUrl) {
|
|
38
|
+
try {
|
|
39
|
+
// Normalize repository URL (remove trailing slash, convert to lowercase)
|
|
40
|
+
const normalizedUrl = repositoryUrl.toLowerCase().replace(/\/$/, '');
|
|
41
|
+
// Find the repository in org_repo table
|
|
42
|
+
const orgRepo = await db_1.default.query.orgRepo.findFirst({
|
|
43
|
+
where: (0, drizzle_orm_1.and)((0, drizzle_orm_1.eq)(schema.orgRepo.repo_url, normalizedUrl), (0, drizzle_orm_1.eq)(schema.orgRepo.is_active, true)),
|
|
44
|
+
with: {
|
|
45
|
+
org: {
|
|
46
|
+
columns: {
|
|
47
|
+
id: true,
|
|
48
|
+
name: true,
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
if (!orgRepo) {
|
|
54
|
+
return { found: false };
|
|
55
|
+
}
|
|
56
|
+
// Explicitly check if org relation was loaded
|
|
57
|
+
if (!orgRepo.org) {
|
|
58
|
+
console.error(`Organization details not loaded for org_id: ${orgRepo.org_id}`);
|
|
59
|
+
return { found: false };
|
|
60
|
+
}
|
|
61
|
+
// Check if the user is a member of this organization
|
|
62
|
+
const membership = await db_1.default.query.orgMember.findFirst({
|
|
63
|
+
where: (0, drizzle_orm_1.and)((0, drizzle_orm_1.eq)(schema.orgMember.org_id, orgRepo.org_id), (0, drizzle_orm_1.eq)(schema.orgMember.user_id, userId))
|
|
64
|
+
});
|
|
65
|
+
if (!membership) {
|
|
66
|
+
return { found: false };
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
found: true,
|
|
70
|
+
organizationId: orgRepo.org_id,
|
|
71
|
+
organizationName: orgRepo.org.name
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
catch (error) {
|
|
75
|
+
console.error('Error finding organization for repository:', error);
|
|
76
|
+
return { found: false };
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Determines credit delegation for a user and repository
|
|
81
|
+
*/
|
|
82
|
+
async function consumeCreditsWithDelegation(userId, repositoryUrl, creditsToConsume) {
|
|
83
|
+
const orgLookup = await findOrganizationForRepository(userId, repositoryUrl);
|
|
84
|
+
if (orgLookup.found) {
|
|
85
|
+
return {
|
|
86
|
+
useOrganization: true,
|
|
87
|
+
organizationId: orgLookup.organizationId,
|
|
88
|
+
organizationName: orgLookup.organizationName,
|
|
89
|
+
fallbackToPersonal: false
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
return {
|
|
93
|
+
useOrganization: false,
|
|
94
|
+
fallbackToPersonal: true
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=credit-delegation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credit-delegation.js","sourceRoot":"","sources":["../src/credit-delegation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,sEAuDC;AAKD,oEAoBC;AA5GD,8CAAqB;AACrB,oDAAqC;AACrC,6CAAqC;AAuBrC;;GAEG;AACI,KAAK,UAAU,6BAA6B,CACjD,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K,EAAE,CAAA;QACzB,CAAC;QAED,OAAO;YACL,KAAK,EAAE,IAAI;YACX,cAAc,EAAE,OAAO,CAAC,MAAM;YAC9B,gBAAgB,EAAE,OAAO,CAAC,GAAG,CAAC,IAAI;SACnC,CAAA;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,4CAA4C,EAAE,KAAK,CAAC,CAAA;QAClE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;AACH,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,4BAA4B,CAChD,MAAc,EACd,aAAqB,EACrB,gBAAwB;IAExB,MAAM,SAAS,GAAG,MAAM,6BAA6B,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;IAE5E,IAAI,SAAS,CAAC,KAAK,EAAE,CAAC;QACpB,OAAO;YACL,eAAe,EAAE,IAAI;YACrB,cAAc,EAAE,SAAS,CAAC,cAAc;YACxC,gBAAgB,EAAE,SAAS,CAAC,gBAAgB;YAC5C,kBAAkB,EAAE,KAAK;SAC1B,CAAA;IACH,CAAC;IAED,OAAO;QACL,eAAe,EAAE,KAAK;QACtB,kBAAkB,EAAE,IAAI;KACzB,CAAA;AACH,CAAC"}
|
|
@@ -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 @@
|
|
|
1
|
+
{"version":3,"file":"organization.js","sourceRoot":"","sources":["../../src/types/organization.ts"],"names":[],"mappings":""}
|
|
@@ -3,5 +3,6 @@ export declare function applyChanges(projectRoot: string, changes: FileChanges):
|
|
|
3
3
|
created: string[];
|
|
4
4
|
modified: string[];
|
|
5
5
|
ignored: string[];
|
|
6
|
+
invalid: string[];
|
|
6
7
|
};
|
|
7
8
|
export declare function applyAndRevertChanges(projectRoot: string, changes: FileChanges, onApply: () => Promise<void>): Promise<void>;
|
|
@@ -13,14 +13,22 @@ function applyChanges(projectRoot, changes) {
|
|
|
13
13
|
const created = [];
|
|
14
14
|
const modified = [];
|
|
15
15
|
const ignored = [];
|
|
16
|
+
const invalid = [];
|
|
16
17
|
for (const change of changes) {
|
|
17
18
|
const { path: filePath, content, type } = change;
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
try {
|
|
20
|
+
if ((0, project_file_tree_1.isFileIgnored)(filePath, projectRoot)) {
|
|
21
|
+
ignored.push(filePath);
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
// File path caused an error.
|
|
27
|
+
invalid.push(filePath);
|
|
20
28
|
continue;
|
|
21
29
|
}
|
|
22
|
-
const fullPath = path_1.default.join(projectRoot, filePath);
|
|
23
30
|
try {
|
|
31
|
+
const fullPath = path_1.default.join(projectRoot, filePath);
|
|
24
32
|
const fileExists = fs_1.default.existsSync(fullPath);
|
|
25
33
|
if (!fileExists) {
|
|
26
34
|
// Create directories in the path if they don't exist
|
|
@@ -44,9 +52,10 @@ function applyChanges(projectRoot, changes) {
|
|
|
44
52
|
}
|
|
45
53
|
catch (error) {
|
|
46
54
|
console.error(`Failed to apply patch to ${filePath}:`, error, content);
|
|
55
|
+
invalid.push(filePath);
|
|
47
56
|
}
|
|
48
57
|
}
|
|
49
|
-
return { created, modified, ignored };
|
|
58
|
+
return { created, modified, ignored, invalid };
|
|
50
59
|
}
|
|
51
60
|
async function applyAndRevertChanges(projectRoot, changes, onApply) {
|
|
52
61
|
const filesChanged = changes.map((change) => change.path);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changes.js","sourceRoot":"","sources":["../../src/util/changes.ts"],"names":[],"mappings":";;;;;AAOA,
|
|
1
|
+
{"version":3,"file":"changes.js","sourceRoot":"","sources":["../../src/util/changes.ts"],"names":[],"mappings":";;;;;AAOA,oCA8CC;AAED,sDA8BC;AArFD,4CAAmB;AACnB,gDAAuB;AAGvB,4DAAoD;AACpD,mCAAoC;AAEpC,SAAgB,YAAY,CAAC,WAAmB,EAAE,OAAoB;IACpE,MAAM,OAAO,GAAa,EAAE,CAAA;IAC5B,MAAM,QAAQ,GAAa,EAAE,CAAA;IAC7B,MAAM,OAAO,GAAa,EAAE,CAAA;IAC5B,MAAM,OAAO,GAAa,EAAE,CAAA;IAE5B,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EA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AAI,YAAE,CAAC,UAAU,CAAC,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,EAAE,CAAC;gBACpD,YAAE,CAAC,UAAU,CAAC,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAA;YACjD,CAAC;QACH,CAAC;aAAM,CAAC;YACN,YAAE,CAAC,aAAa,CAAC,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,EAAE,UAAU,CAAC,CAAA;QAChE,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -511,6 +511,7 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
|
|
|
511
511
|
}>, "many">;
|
|
512
512
|
model: z.ZodOptional<z.ZodString>;
|
|
513
513
|
cwd: z.ZodOptional<z.ZodString>;
|
|
514
|
+
repoName: z.ZodOptional<z.ZodString>;
|
|
514
515
|
}, "strip", z.ZodTypeAny, {
|
|
515
516
|
type: "prompt";
|
|
516
517
|
promptId: string;
|
|
@@ -592,6 +593,7 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
|
|
|
592
593
|
authToken?: string | undefined;
|
|
593
594
|
model?: string | undefined;
|
|
594
595
|
cwd?: string | undefined;
|
|
596
|
+
repoName?: string | undefined;
|
|
595
597
|
}, {
|
|
596
598
|
type: "prompt";
|
|
597
599
|
promptId: string;
|
|
@@ -673,6 +675,7 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
|
|
|
673
675
|
costMode?: "lite" | "normal" | "max" | "experimental" | undefined;
|
|
674
676
|
model?: string | undefined;
|
|
675
677
|
cwd?: string | undefined;
|
|
678
|
+
repoName?: string | undefined;
|
|
676
679
|
}>, z.ZodObject<{
|
|
677
680
|
type: z.ZodLiteral<"read-files-response">;
|
|
678
681
|
files: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNull]>>;
|
|
@@ -964,6 +967,7 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
|
|
|
964
967
|
authToken?: string | undefined;
|
|
965
968
|
model?: string | undefined;
|
|
966
969
|
cwd?: string | undefined;
|
|
970
|
+
repoName?: string | undefined;
|
|
967
971
|
} | {
|
|
968
972
|
type: "read-files-response";
|
|
969
973
|
files: Record<string, string | null>;
|
|
@@ -1090,6 +1094,7 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
|
|
|
1090
1094
|
costMode?: "lite" | "normal" | "max" | "experimental" | undefined;
|
|
1091
1095
|
model?: string | undefined;
|
|
1092
1096
|
cwd?: string | undefined;
|
|
1097
|
+
repoName?: string | undefined;
|
|
1093
1098
|
} | {
|
|
1094
1099
|
type: "read-files-response";
|
|
1095
1100
|
files: Record<string, string | null>;
|
|
@@ -1642,6 +1647,7 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
|
|
|
1642
1647
|
}>, "many">;
|
|
1643
1648
|
model: z.ZodOptional<z.ZodString>;
|
|
1644
1649
|
cwd: z.ZodOptional<z.ZodString>;
|
|
1650
|
+
repoName: z.ZodOptional<z.ZodString>;
|
|
1645
1651
|
}, "strip", z.ZodTypeAny, {
|
|
1646
1652
|
type: "prompt";
|
|
1647
1653
|
promptId: string;
|
|
@@ -1723,6 +1729,7 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
|
|
|
1723
1729
|
authToken?: string | undefined;
|
|
1724
1730
|
model?: string | undefined;
|
|
1725
1731
|
cwd?: string | undefined;
|
|
1732
|
+
repoName?: string | undefined;
|
|
1726
1733
|
}, {
|
|
1727
1734
|
type: "prompt";
|
|
1728
1735
|
promptId: string;
|
|
@@ -1804,6 +1811,7 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
|
|
|
1804
1811
|
costMode?: "lite" | "normal" | "max" | "experimental" | undefined;
|
|
1805
1812
|
model?: string | undefined;
|
|
1806
1813
|
cwd?: string | undefined;
|
|
1814
|
+
repoName?: string | undefined;
|
|
1807
1815
|
}>, z.ZodObject<{
|
|
1808
1816
|
type: z.ZodLiteral<"read-files-response">;
|
|
1809
1817
|
files: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNull]>>;
|
|
@@ -2095,6 +2103,7 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
|
|
|
2095
2103
|
authToken?: string | undefined;
|
|
2096
2104
|
model?: string | undefined;
|
|
2097
2105
|
cwd?: string | undefined;
|
|
2106
|
+
repoName?: string | undefined;
|
|
2098
2107
|
} | {
|
|
2099
2108
|
type: "read-files-response";
|
|
2100
2109
|
files: Record<string, string | null>;
|
|
@@ -2221,6 +2230,7 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
|
|
|
2221
2230
|
costMode?: "lite" | "normal" | "max" | "experimental" | undefined;
|
|
2222
2231
|
model?: string | undefined;
|
|
2223
2232
|
cwd?: string | undefined;
|
|
2233
|
+
repoName?: string | undefined;
|
|
2224
2234
|
} | {
|
|
2225
2235
|
type: "read-files-response";
|
|
2226
2236
|
files: Record<string, string | null>;
|
package/dist/config.d.ts
ADDED
package/dist/config.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.backendUrl = exports.websiteUrl = exports.websocketUrl = exports.isProduction = void 0;
|
|
4
|
+
exports.isProduction = process.env.NEXT_PUBLIC_CB_ENVIRONMENT === 'production';
|
|
5
|
+
exports.websocketUrl = exports.isProduction
|
|
6
|
+
? `wss://${process.env.NEXT_PUBLIC_BACKEND_URL}/ws`
|
|
7
|
+
: `ws://${process.env.NEXT_PUBLIC_BACKEND_URL}/ws`;
|
|
8
|
+
exports.websiteUrl = process.env.NEXT_PUBLIC_APP_URL;
|
|
9
|
+
exports.backendUrl = exports.isProduction
|
|
10
|
+
? `https://${process.env.NEXT_PUBLIC_BACKEND_URL}`
|
|
11
|
+
: `http://${process.env.NEXT_PUBLIC_BACKEND_URL}`;
|
|
12
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;;AAAa,QAAA,YAAY,GACvB,OAAO,CAAC,GAAG,CAAC,0BAA0B,KAAK,YAAY,CAAA;AAE5C,QAAA,YAAY,GAAG,oBAAY;IACtC,CAAC,CAAC,SAAS,OAAO,CAAC,GAAG,CAAC,uBAAuB,KAAK;IACnD,CAAC,CAAC,QAAQ,OAAO,CAAC,GAAG,CAAC,uBAAuB,KAAK,CAAA;AAEvC,QAAA,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAA;AAC5C,QAAA,UAAU,GAAG,oBAAY;IACpC,CAAC,CAAC,WAAW,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE;IAClD,CAAC,CAAC,UAAU,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createTemplateProject(template: string, projectDir: string, projectName?: string): Promise<void>;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.createTemplateProject = createTemplateProject;
|
|
27
|
+
const child_process_1 = require("child_process");
|
|
28
|
+
const path_1 = require("path");
|
|
29
|
+
const fs = __importStar(require("fs"));
|
|
30
|
+
const os = __importStar(require("os"));
|
|
31
|
+
const picocolors_1 = require("picocolors");
|
|
32
|
+
async function createTemplateProject(template, projectDir, projectName = template) {
|
|
33
|
+
console.log(`Creating project from ${template} template in ${projectDir}/${projectName}`);
|
|
34
|
+
// Validate template name contains only alphanumeric chars, dash and underscore
|
|
35
|
+
if (!/^[a-zA-Z0-9-_]+$/.test(template)) {
|
|
36
|
+
console.error('Template name can only contain letters, numbers, dash and underscore');
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
39
|
+
// Validate project name
|
|
40
|
+
if (!/^[a-zA-Z0-9-_]+$/.test(projectName)) {
|
|
41
|
+
console.error('Project name can only contain letters, numbers, dash and underscore');
|
|
42
|
+
process.exit(1);
|
|
43
|
+
}
|
|
44
|
+
const projectPath = (0, path_1.join)(projectDir, projectName);
|
|
45
|
+
// Check if directory already exists
|
|
46
|
+
if (fs.existsSync(projectPath)) {
|
|
47
|
+
console.error(`Directory ${projectPath} already exists`);
|
|
48
|
+
process.exit(1);
|
|
49
|
+
}
|
|
50
|
+
try {
|
|
51
|
+
console.log('\nDownloading template...');
|
|
52
|
+
// Clone the community repo to a temp directory
|
|
53
|
+
const tempDir = fs.mkdtempSync((0, path_1.join)(os.tmpdir(), 'codebuff-starter-'));
|
|
54
|
+
(0, child_process_1.execSync)('git clone --depth 1 https://github.com/CodebuffAI/codebuff-community.git .', {
|
|
55
|
+
cwd: tempDir,
|
|
56
|
+
stdio: 'pipe',
|
|
57
|
+
});
|
|
58
|
+
// Check if template exists in starter-templates or showcase directory
|
|
59
|
+
const starterTemplateDir = (0, path_1.join)(tempDir, 'starter-templates', template);
|
|
60
|
+
const showcaseDir = (0, path_1.join)(tempDir, 'showcase', template);
|
|
61
|
+
let templateDir;
|
|
62
|
+
if (fs.existsSync(starterTemplateDir)) {
|
|
63
|
+
templateDir = starterTemplateDir;
|
|
64
|
+
}
|
|
65
|
+
else if (fs.existsSync(showcaseDir)) {
|
|
66
|
+
templateDir = showcaseDir;
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
console.error(`Template ${template} not found in starter-templates/ or showcase/`);
|
|
70
|
+
fs.rmSync(tempDir, { recursive: true, force: true });
|
|
71
|
+
process.exit(1);
|
|
72
|
+
}
|
|
73
|
+
// Create parent directory if it doesn't exist
|
|
74
|
+
if (projectDir) {
|
|
75
|
+
fs.mkdirSync(projectDir, { recursive: true });
|
|
76
|
+
}
|
|
77
|
+
// Copy template to new directory
|
|
78
|
+
fs.mkdirSync(projectPath);
|
|
79
|
+
fs.cpSync(templateDir, projectPath, { recursive: true });
|
|
80
|
+
// Remove .git directory if it exists
|
|
81
|
+
const gitDir = (0, path_1.join)(projectPath, '.git');
|
|
82
|
+
if (fs.existsSync(gitDir)) {
|
|
83
|
+
fs.rmSync(gitDir, { recursive: true, force: true });
|
|
84
|
+
}
|
|
85
|
+
// Initialize new git repo
|
|
86
|
+
console.log('\nInitializing git repo...');
|
|
87
|
+
(0, child_process_1.execSync)('git init', { cwd: projectPath, stdio: 'pipe' });
|
|
88
|
+
// Clean up temp directory
|
|
89
|
+
fs.rmSync(tempDir, { recursive: true, force: true });
|
|
90
|
+
// Install dependencies
|
|
91
|
+
if (fs.existsSync((0, path_1.join)(projectPath, 'package-lock.json'))) {
|
|
92
|
+
console.log('\nInstalling dependencies...');
|
|
93
|
+
(0, child_process_1.execSync)('npm install', { cwd: projectPath, stdio: 'inherit' });
|
|
94
|
+
}
|
|
95
|
+
console.log((0, picocolors_1.green)(`\nSuccessfully created new project in ${projectPath}\n`));
|
|
96
|
+
// Change into the new project directory and run codebuff
|
|
97
|
+
process.chdir(projectPath);
|
|
98
|
+
console.log('Starting Codebuff in the new project...\n');
|
|
99
|
+
console.log('--------------------------------\n');
|
|
100
|
+
(0, child_process_1.execSync)('codebuff', { stdio: 'inherit' });
|
|
101
|
+
}
|
|
102
|
+
catch (error) {
|
|
103
|
+
console.error('Failed to initialize project:', error);
|
|
104
|
+
process.exit(1);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=create-template-project.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-template-project.js","sourceRoot":"","sources":["../src/create-template-project.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAMA,sDAqGC;AA3GD,iDAAwC;AACxC,+BAA2B;AAC3B,uCAAwB;AACxB,uCAAwB;AACxB,2CAAkC;AAE3B,KAAK,UAAU,qBAAqB,CACzC,QAAgB,EAChB,UAAkB,EAClB,cAAsB,QAAQ;IAE9B,OAAO,CAAC,GAAG,CACT,yBAAyB,QAAQ,gBAAgB,UAAU,IAAI,WAAW,EAAE,CAC7E,CAAA;IAED,+EAA+E;IAC/E,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;QACvC,OAAO,CAAC,KAAK,CACX,sEAAsE,CACvE,CAAA;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;IAED,wBAAwB;IACxB,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;QAC1C,OAAO,CA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C,CAAA;QACjE,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,IAAA,kBAAK,EAAC,yCAAyC,WAAW,IAAI,CAAC,CAAC,CAAA;QAE5E,yDAAyD;QACzD,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA;QAC1B,OAAO,CAAC,GAAG,CAAC,2CAA2C,CAAC,CAAA;QACxD,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAA;QACjD,IAAA,wBAAQ,EAAC,UAAU,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAA;IAC5C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,+BAA+B,EAAE,KAAK,CAAC,CAAA;QACrD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;AACH,CAAC"}
|
package/dist/credentials.js
CHANGED
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.CREDENTIALS_PATH = exports.CONFIG_DIR = exports.userFromJson = void 0;
|
|
7
|
-
const credentials_1 = require("common/util/credentials");
|
|
7
|
+
const credentials_1 = require("./common/util/credentials");
|
|
8
8
|
const zod_1 = require("zod");
|
|
9
9
|
const os_1 = __importDefault(require("os"));
|
|
10
10
|
const node_path_1 = __importDefault(require("node:path"));
|
|
@@ -25,7 +25,7 @@ const userFromJson = (json, profileName = 'default') => {
|
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
27
|
exports.userFromJson = userFromJson;
|
|
28
|
-
const file_1 = require("common/util/file");
|
|
28
|
+
const file_1 = require("./common/util/file");
|
|
29
29
|
exports.CONFIG_DIR = node_path_1.default.join(os_1.default.homedir(), '.config', 'manicode' +
|
|
30
30
|
// on a development stack?
|
|
31
31
|
(process.env.NEXT_PUBLIC_CB_ENVIRONMENT &&
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { StartupProcess } from './common/json-config/constants';
|
|
2
|
+
/**
|
|
3
|
+
* Starts background development processes defined in the config file.
|
|
4
|
+
* Processes are started asynchronously and their output is tracked.
|
|
5
|
+
* Only enabled processes are started.
|
|
6
|
+
*
|
|
7
|
+
* @param processes - Array of startup process configurations
|
|
8
|
+
* @param projectPath - Base path of the project
|
|
9
|
+
*/
|
|
10
|
+
export declare function startDevProcesses(processes: StartupProcess[], projectPath: string): void;
|
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.startDevProcesses = startDevProcesses;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
|
-
const string_1 = require("common/util/string");
|
|
8
|
+
const string_1 = require("./common/util/string");
|
|
9
9
|
const picocolors_1 = require("picocolors");
|
|
10
10
|
const terminal_1 = require("./utils/terminal");
|
|
11
11
|
/**
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Overwrites writing multiple (more than 2) newlines for all functions.
|
|
3
|
+
*
|
|
4
|
+
* Only replaces raw '\n\n\n' strings. i.e. '\n\n' + green('\n\n'), still
|
|
5
|
+
* renders as four newline characters. Because there is an ANSI escape
|
|
6
|
+
* character between the first two and the last two newline characters.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getPrevious(): string;
|
|
9
|
+
export declare function setPrevious(str: string): void;
|
|
10
|
+
export declare function enableSquashNewlines(): void;
|
|
11
|
+
export declare function disableSquashNewlines(): void;
|