@idea1/cli 1.0.1 → 1.0.2
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/README.md +105 -15
- package/dist/commands/create-worktree.d.ts +3 -0
- package/dist/commands/create-worktree.d.ts.map +1 -0
- package/dist/commands/create-worktree.js +74 -0
- package/dist/commands/create-worktree.js.map +1 -0
- package/dist/commands/help.d.ts.map +1 -1
- package/dist/commands/help.js +22 -3
- package/dist/commands/help.js.map +1 -1
- package/dist/commands/index.d.ts +4 -1
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +7 -1
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/push.d.ts +3 -0
- package/dist/commands/push.d.ts.map +1 -0
- package/dist/commands/push.js +125 -0
- package/dist/commands/push.js.map +1 -0
- package/dist/commands/start-project-item.d.ts.map +1 -1
- package/dist/commands/start-project-item.js +9 -59
- package/dist/commands/start-project-item.js.map +1 -1
- package/dist/commands/update-docs.d.ts +3 -0
- package/dist/commands/update-docs.d.ts.map +1 -0
- package/dist/commands/update-docs.js +21 -0
- package/dist/commands/update-docs.js.map +1 -0
- package/dist/lib/settings.d.ts +12 -0
- package/dist/lib/settings.d.ts.map +1 -1
- package/dist/lib/settings.js +21 -0
- package/dist/lib/settings.js.map +1 -1
- package/dist/services/config.d.ts +8 -0
- package/dist/services/config.d.ts.map +1 -1
- package/dist/services/config.js +13 -0
- package/dist/services/config.js.map +1 -1
- package/dist/services/context.d.ts +26 -0
- package/dist/services/context.d.ts.map +1 -0
- package/dist/services/context.js +304 -0
- package/dist/services/context.js.map +1 -0
- package/dist/services/test.d.ts +11 -0
- package/dist/services/test.d.ts.map +1 -0
- package/dist/services/test.js +52 -0
- package/dist/services/test.js.map +1 -0
- package/dist/services/worktree.d.ts +32 -0
- package/dist/services/worktree.d.ts.map +1 -0
- package/dist/services/worktree.js +136 -0
- package/dist/services/worktree.js.map +1 -0
- package/dist/types/index.d.ts +23 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +3 -2
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { logger } from '../lib/logger.js';
|
|
2
|
-
import { execWithOutput } from '../lib/shell.js';
|
|
3
|
-
import { getSetupWorktreeHook } from '../lib/settings.js';
|
|
4
2
|
import * as git from '../services/git.js';
|
|
5
3
|
import * as claude from '../services/claude.js';
|
|
4
|
+
import * as worktree from '../services/worktree.js';
|
|
6
5
|
import { configService } from '../services/config.js';
|
|
7
6
|
import inquirer from 'inquirer';
|
|
8
7
|
/**
|
|
@@ -105,48 +104,6 @@ async function promptBaseBranch() {
|
|
|
105
104
|
}
|
|
106
105
|
return choice;
|
|
107
106
|
}
|
|
108
|
-
/**
|
|
109
|
-
* Run the setup-worktree hook if defined
|
|
110
|
-
*/
|
|
111
|
-
async function runSetupWorktreeHook(repoRoot) {
|
|
112
|
-
const hookCommand = await getSetupWorktreeHook(repoRoot);
|
|
113
|
-
if (!hookCommand) {
|
|
114
|
-
logger.dim('No setup-worktree hook defined');
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
logger.step(`Running setup-worktree hook: ${hookCommand}`);
|
|
118
|
-
const exitCode = await execWithOutput('bash', [hookCommand], { cwd: repoRoot });
|
|
119
|
-
if (exitCode !== 0) {
|
|
120
|
-
logger.warning('Setup-worktree hook failed, continuing anyway');
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Setup worktree isolation mode
|
|
125
|
-
*/
|
|
126
|
-
async function setupWorktreeIsolation(fullBranchName, shortBranchName, projectItemUrl, baseBranchName) {
|
|
127
|
-
logger.step('Setting up worktree isolation...');
|
|
128
|
-
// Create git worktree
|
|
129
|
-
const worktreePath = await git.createWorktree(fullBranchName, shortBranchName);
|
|
130
|
-
// Enter worktree and set up upstream
|
|
131
|
-
await git.enterWorktreeAndSetup(worktreePath, fullBranchName);
|
|
132
|
-
// Store project item URL and base branch in git config
|
|
133
|
-
await git.storeProjectItemUrl(projectItemUrl, fullBranchName);
|
|
134
|
-
await git.storeBaseBranch(baseBranchName, fullBranchName);
|
|
135
|
-
// Run repo-specific setup hook if defined
|
|
136
|
-
await runSetupWorktreeHook(worktreePath);
|
|
137
|
-
// Run claude command
|
|
138
|
-
if (projectItemUrl) {
|
|
139
|
-
const prompt = claude.getImplementationPrompt(projectItemUrl);
|
|
140
|
-
await claude.runInteractive(prompt, worktreePath);
|
|
141
|
-
}
|
|
142
|
-
else {
|
|
143
|
-
await claude.runInteractive(undefined, worktreePath);
|
|
144
|
-
}
|
|
145
|
-
// Output the final directory path for the user
|
|
146
|
-
logger.newline();
|
|
147
|
-
logger.info('To continue working in this directory, run:');
|
|
148
|
-
logger.plain(`cd ${worktreePath}`);
|
|
149
|
-
}
|
|
150
107
|
/**
|
|
151
108
|
* Setup container isolation mode (not yet implemented)
|
|
152
109
|
*/
|
|
@@ -188,26 +145,19 @@ export const startProjectItemCommand = {
|
|
|
188
145
|
if (!shortBranchName) {
|
|
189
146
|
throw new Error('Failed to generate a branch name');
|
|
190
147
|
}
|
|
191
|
-
//
|
|
192
|
-
await
|
|
193
|
-
//
|
|
194
|
-
const
|
|
195
|
-
if (!baseBranchExists) {
|
|
196
|
-
throw new Error(`Base branch '${options.baseBranch}' does not exist locally or on origin`);
|
|
197
|
-
}
|
|
198
|
-
// Fetch latest, checkout base branch, create new branch
|
|
199
|
-
await git.fetchLatest();
|
|
200
|
-
await git.checkoutAndPullBranch(options.baseBranch);
|
|
201
|
-
const fullBranchName = `working/agent/${shortBranchName}`;
|
|
202
|
-
await git.createAndPushBranch(fullBranchName, options.baseBranch);
|
|
203
|
-
await git.prepareRepoForWorktree(fullBranchName, options.baseBranch);
|
|
204
|
-
logger.dim('Note: PR will be created later when changes are pushed');
|
|
148
|
+
// Resolve branch prefix using config hierarchy
|
|
149
|
+
const branchPrefix = await worktree.resolveBranchPrefix();
|
|
150
|
+
// Prepare branch for worktree (validates, fetches, creates branch)
|
|
151
|
+
const fullBranchName = await worktree.prepareBranchForWorktree(shortBranchName, options.baseBranch, branchPrefix);
|
|
205
152
|
// Setup isolation
|
|
206
153
|
if (options.isolationMode === 'container') {
|
|
207
154
|
await setupContainerIsolation(fullBranchName, shortBranchName, projectItemUrl, options);
|
|
208
155
|
}
|
|
209
156
|
else {
|
|
210
|
-
await setupWorktreeIsolation(fullBranchName, shortBranchName,
|
|
157
|
+
await worktree.setupWorktreeIsolation(fullBranchName, shortBranchName, options.baseBranch, {
|
|
158
|
+
projectItemUrl,
|
|
159
|
+
launchClaude: true
|
|
160
|
+
});
|
|
211
161
|
}
|
|
212
162
|
}
|
|
213
163
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start-project-item.js","sourceRoot":"","sources":["../../src/commands/start-project-item.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,
|
|
1
|
+
{"version":3,"file":"start-project-item.js","sourceRoot":"","sources":["../../src/commands/start-project-item.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,KAAK,GAAG,MAAM,oBAAoB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC;;GAEG;AACH,SAAS,SAAS,CAAC,IAAc;IAC/B,MAAM,OAAO,GAA4B;QACvC,aAAa,EAAE,aAAa,CAAC,uBAAuB,EAAE;QACtD,UAAU,EAAE,aAAa,CAAC,oBAAoB,EAAE;QAChD,UAAU,EAAE,KAAK;QACjB,eAAe,EAAE,KAAK;KACvB,CAAC;IAEF,IAAI,cAAc,GAAG,EAAE,CAAC;IACxB,IAAI,eAAmC,CAAC;IACxC,IAAI,CAAC,GAAG,CAAC,C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;QAChD,MAAM,MAAM,CAAC,iBAAiB,CAAC,cAAc,EAAE,sBAAsB,CAAC,CAAC;QAEvE,uCAAuC;QACvC,IAAI,eAAe,GAAG,kBAAkB,CAAC;QACzC,IAAI,CAAC,eAAe,EAAE,CAAC;YACrB,eAAe,GAAG,MAAM,MAAM,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAAC;QACpE,CAAC;QAED,MAAM,CAAC,IAAI,CAAC,sBAAsB,eAAe,EAAE,CAAC,CAAC;QAErD,IAAI,CAAC,eAAe,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;QACtD,CAAC;QAED,+CAA+C;QAC/C,MAAM,YAAY,GAAG,MAAM,QAAQ,CAAC,mBAAmB,EAAE,CAAC;QAE1D,mEAAmE;QACnE,MAAM,cAAc,GAAG,MAAM,QAAQ,CAAC,wBAAwB,CAC5D,eAAe,EACf,OAAO,CAAC,UAAU,EAClB,YAAY,CACb,CAAC;QAEF,kBAAkB;QAClB,IAAI,OAAO,CAAC,aAAa,KAAK,WAAW,EAAE,CAAC;YAC1C,MAAM,uBAAuB,CAAC,cAAc,EAAE,eAAe,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;QAC1F,CAAC;aAAM,CAAC;YACN,MAAM,QAAQ,CAAC,sBAAsB,CACnC,cAAc,EACd,eAAe,EACf,OAAO,CAAC,UAAU,EAClB;gBACE,cAAc;gBACd,YAAY,EAAE,IAAI;aACnB,CACF,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-docs.d.ts","sourceRoot":"","sources":["../../src/commands/update-docs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAIjD,eAAO,MAAM,iBAAiB,EAAE,OAkB/B,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { logger } from '../lib/logger.js';
|
|
2
|
+
import * as context from '../services/context.js';
|
|
3
|
+
export const updateDocsCommand = {
|
|
4
|
+
name: 'update-docs',
|
|
5
|
+
aliases: ['docs', 'readme'],
|
|
6
|
+
description: 'Update README.md files for folders with code changes',
|
|
7
|
+
async execute(_args) {
|
|
8
|
+
logger.info('Updating documentation for changed folders...');
|
|
9
|
+
const { success, failed } = await context.updateContextFiles();
|
|
10
|
+
if (success === 0 && failed === 0) {
|
|
11
|
+
logger.dim('No documentation updates needed.');
|
|
12
|
+
}
|
|
13
|
+
else if (failed > 0) {
|
|
14
|
+
logger.warning(`Completed with ${failed} failure(s).`);
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
logger.success('All documentation updated successfully.');
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=update-docs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-docs.js","sourceRoot":"","sources":["../../src/commands/update-docs.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAC;AAElD,MAAM,CAAC,MAAM,iBAAiB,GAAY;IACxC,IAAI,EAAE,aAAa;IACnB,OAAO,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC;IAC3B,WAAW,EAAE,sDAAsD;IAEnE,KAAK,CAAC,OAAO,CAAC,KAAe;QAC3B,MAAM,CAAC,IAAI,CAAC,+CAA+C,CAAC,CAAC;QAE7D,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,OAAO,CAAC,kBAAkB,EAAE,CAAC;QAE/D,IAAI,OAAO,KAAK,CAAC,IAAI,MAAM,KAAK,CAAC,EAAE,CAAC;YAClC,MAAM,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;QACjD,CAAC;aAAM,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;YACtB,MAAM,CAAC,OAAO,CAAC,kBAAkB,MAAM,cAAc,CAAC,CAAC;QACzD,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,OAAO,CAAC,yCAAyC,CAAC,CAAC;QAC5D,CAAC;IACH,CAAC;CACF,CAAC"}
|
package/dist/lib/settings.d.ts
CHANGED
|
@@ -7,4 +7,16 @@ export declare function readSettings(repoRoot: string): Promise<Idea1Settings |
|
|
|
7
7
|
* Get the setup-worktree hook command if defined
|
|
8
8
|
*/
|
|
9
9
|
export declare function getSetupWorktreeHook(repoRoot: string): Promise<string | null>;
|
|
10
|
+
/**
|
|
11
|
+
* Get the default branch prefix from settings
|
|
12
|
+
*/
|
|
13
|
+
export declare function getBranchPrefix(repoRoot: string): Promise<string | null>;
|
|
14
|
+
/**
|
|
15
|
+
* Get the default base branch from settings
|
|
16
|
+
*/
|
|
17
|
+
export declare function getBaseBranch(repoRoot: string): Promise<string | null>;
|
|
18
|
+
/**
|
|
19
|
+
* Get the test command from settings
|
|
20
|
+
*/
|
|
21
|
+
export declare function getTestCommand(repoRoot: string): Promise<string | null>;
|
|
10
22
|
//# sourceMappingURL=settings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/lib/settings.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD;;GAEG;AACH,wBAAsB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAalF;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAGnF"}
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/lib/settings.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD;;GAEG;AACH,wBAAsB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAalF;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAGnF;AAED;;GAEG;AACH,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAG9E;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAG5E;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAG7E"}
|
package/dist/lib/settings.js
CHANGED
|
@@ -24,4 +24,25 @@ export async function getSetupWorktreeHook(repoRoot) {
|
|
|
24
24
|
const settings = await readSettings(repoRoot);
|
|
25
25
|
return settings?.hooks?.['setup-worktree'] ?? null;
|
|
26
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Get the default branch prefix from settings
|
|
29
|
+
*/
|
|
30
|
+
export async function getBranchPrefix(repoRoot) {
|
|
31
|
+
const settings = await readSettings(repoRoot);
|
|
32
|
+
return settings?.defaults?.branchPrefix ?? null;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Get the default base branch from settings
|
|
36
|
+
*/
|
|
37
|
+
export async function getBaseBranch(repoRoot) {
|
|
38
|
+
const settings = await readSettings(repoRoot);
|
|
39
|
+
return settings?.defaults?.baseBranch ?? null;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Get the test command from settings
|
|
43
|
+
*/
|
|
44
|
+
export async function getTestCommand(repoRoot) {
|
|
45
|
+
const settings = await readSettings(repoRoot);
|
|
46
|
+
return settings?.defaults?.testCommand ?? null;
|
|
47
|
+
}
|
|
27
48
|
//# sourceMappingURL=settings.js.map
|
package/dist/lib/settings.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../src/lib/settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAG5B;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,QAAgB;IACjD,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,EAAE,QAAQ,EAAE,eAAe,CAAC,CAAC;IAE/D,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;QACtD,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAkB,CAAC;IAC9C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,QAAgB;IACzD,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC9C,OAAO,QAAQ,EAAE,KAAK,EAAE,CAAC,gBAAgB,CAAC,IAAI,IAAI,CAAC;AACrD,CAAC"}
|
|
1
|
+
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../src/lib/settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAG5B;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,QA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 export declare const configService: {
|
|
|
7
7
|
* Set the default base branch
|
|
8
8
|
*/
|
|
9
9
|
setDefaultBaseBranch(branch: string): void;
|
|
10
|
+
/**
|
|
11
|
+
* Get the default branch prefix
|
|
12
|
+
*/
|
|
13
|
+
getDefaultBranchPrefix(): string;
|
|
14
|
+
/**
|
|
15
|
+
* Set the default branch prefix
|
|
16
|
+
*/
|
|
17
|
+
setDefaultBranchPrefix(prefix: string): void;
|
|
10
18
|
/**
|
|
11
19
|
* Get the default isolation mode
|
|
12
20
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/services/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/services/config.ts"],"names":[],"mappings":"AAsBA,eAAO,MAAM,aAAa;IACxB;;OAEG;4BACqB,MAAM;IAI9B;;OAEG;iCAC0B,MAAM,GAAG,IAAI;IAI1C;;OAEG;8BACuB,MAAM;IAIhC;;OAEG;mCAC4B,MAAM,GAAG,IAAI;IAI5C;;OAEG;+BACwB,UAAU,GAAG,WAAW;IAInD;;OAEG;kCAC2B,UAAU,GAAG,WAAW,GAAG,IAAI;IAI7D;;OAEG;iCAC0B,MAAM,GAAG,SAAS;IAI/C;;OAEG;mCAC4B,MAAM,GAAG,IAAI;IAI5C;;OAEG;qBACc,MAAM;IAIvB;;OAEG;aACM,IAAI;CAGd,CAAC"}
|
package/dist/services/config.js
CHANGED
|
@@ -7,6 +7,7 @@ const config = new Conf({
|
|
|
7
7
|
projectName: 'idea1-cli',
|
|
8
8
|
defaults: {
|
|
9
9
|
defaultBaseBranch: 'working/release',
|
|
10
|
+
defaultBranchPrefix: 'working/agent',
|
|
10
11
|
defaultIsolationMode: 'worktree'
|
|
11
12
|
}
|
|
12
13
|
});
|
|
@@ -23,6 +24,18 @@ export const configService = {
|
|
|
23
24
|
setDefaultBaseBranch(branch) {
|
|
24
25
|
config.set('defaultBaseBranch', branch);
|
|
25
26
|
},
|
|
27
|
+
/**
|
|
28
|
+
* Get the default branch prefix
|
|
29
|
+
*/
|
|
30
|
+
getDefaultBranchPrefix() {
|
|
31
|
+
return config.get('defaultBranchPrefix');
|
|
32
|
+
},
|
|
33
|
+
/**
|
|
34
|
+
* Set the default branch prefix
|
|
35
|
+
*/
|
|
36
|
+
setDefaultBranchPrefix(prefix) {
|
|
37
|
+
config.set('defaultBranchPrefix', prefix);
|
|
38
|
+
},
|
|
26
39
|
/**
|
|
27
40
|
* Get the default isolation mode
|
|
28
41
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/services/config.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/services/config.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AASxB;;;GAGG;AACH,MAAM,MAAM,GAAG,IAAI,IAAI,CAAe;IACpC,WAAW,EAAE,WAAW;IACxB,QAAQ,EAAE;QACR,iBAAiB,EAAE,iBAAiB;QACpC,mBAAmB,EAAE,eAAe;QACpC,oBAAoB,EAAE,UAAU;KACjC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B;;OAEG;IACH,oBAAoB;QAClB,OAAO,MAAM,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;IACzC,CAAC;IAED;;OAEG;IACH,oBAAoB,CAAC,MAAc;QACjC,MAAM,CAAC,GAAG,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;IAC1C,CAAC;IAED;;OAEG;IACH,sBAAsB;QACpB,OAAO,MAAM,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;IAC3C,CAAC;IAED;;OAEG;IACH,sBAAsB,CAAC,MAAc;QACnC,MAAM,CAAC,GAAG,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;IAC5C,CAAC;IAED;;OAEG;IACH,uBAAuB;QACrB,OAAO,MAAM,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;IAC5C,CAAC;IAED;;OAEG;IACH,uBAAuB,CAAC,IAA8B;QACpD,MAAM,CAAC,GAAG,CAAC,sBAAsB,EAAE,IAAI,CAAC,CAAC;IAC3C,CAAC;IAED;;OAEG;IACH,yBAAyB;QACvB,OAAO,MAAM,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;IAC9C,CAAC;IAED;;OAEG;IACH,yBAAyB,CAAC,GAAW;QACnC,MAAM,CAAC,GAAG,CAAC,wBAAwB,EAAE,GAAG,CAAC,CAAC;IAC5C,CAAC;IAED;;OAEG;IACH,aAAa;QACX,OAAO,MAAM,CAAC,IAAI,CAAC;IACrB,CAAC;IAED;;OAEG;IACH,KAAK;QACH,MAAM,CAAC,KAAK,EAAE,CAAC;IACjB,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check if a folder should be skipped based on .contextignore patterns
|
|
3
|
+
*/
|
|
4
|
+
export declare function shouldSkipFolder(folderPath: string, repoRoot: string): Promise<boolean>;
|
|
5
|
+
/**
|
|
6
|
+
* Get list of folders that have changed files
|
|
7
|
+
* Returns folders sorted by depth (deepest first)
|
|
8
|
+
*/
|
|
9
|
+
export declare function getChangedFolders(repoRoot: string): Promise<string[]>;
|
|
10
|
+
/**
|
|
11
|
+
* Classify the scope of changes in a folder
|
|
12
|
+
* Returns 'small' or 'large'
|
|
13
|
+
*/
|
|
14
|
+
export declare function classifyChanges(folderPath: string, repoRoot: string): Promise<'small' | 'large'>;
|
|
15
|
+
/**
|
|
16
|
+
* Update README.md for a single folder using Claude
|
|
17
|
+
*/
|
|
18
|
+
export declare function updateFolderReadme(folderPath: string, repoRoot: string): Promise<boolean>;
|
|
19
|
+
/**
|
|
20
|
+
* Update context files (READMEs) for all folders with changes
|
|
21
|
+
*/
|
|
22
|
+
export declare function updateContextFiles(): Promise<{
|
|
23
|
+
success: number;
|
|
24
|
+
failed: number;
|
|
25
|
+
}>;
|
|
26
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/services/context.ts"],"names":[],"mappings":"AA6BA;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAyB7F;AAuDD;;;GAGG;AACH,wBAAsB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAgC3E;AAED;;;GAGG;AACH,wBAAsB,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,CAwCtG;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAyG/F;AAED;;GAEG;AACH,wBAAsB,kBAAkB,IAAI,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAuCvF"}
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
import { exec, execWithOutput } from '../lib/shell.js';
|
|
2
|
+
import { logger } from '../lib/logger.js';
|
|
3
|
+
import * as git from './git.js';
|
|
4
|
+
import { readFile } from 'fs/promises';
|
|
5
|
+
import { existsSync } from 'fs';
|
|
6
|
+
import { join, dirname, relative } from 'path';
|
|
7
|
+
/**
|
|
8
|
+
* Read .contextignore patterns from repository
|
|
9
|
+
*/
|
|
10
|
+
async function readContextIgnore(repoRoot) {
|
|
11
|
+
const contextignorePath = join(repoRoot, '.contextignore');
|
|
12
|
+
if (!existsSync(contextignorePath)) {
|
|
13
|
+
return [];
|
|
14
|
+
}
|
|
15
|
+
try {
|
|
16
|
+
const content = await readFile(contextignorePath, 'utf-8');
|
|
17
|
+
return content
|
|
18
|
+
.split('\n')
|
|
19
|
+
.map(line => line.trim())
|
|
20
|
+
.filter(line => line && !line.startsWith('#'));
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
return [];
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Check if a folder should be skipped based on .contextignore patterns
|
|
28
|
+
*/
|
|
29
|
+
export async function shouldSkipFolder(folderPath, repoRoot) {
|
|
30
|
+
const patterns = await readContextIgnore(repoRoot);
|
|
31
|
+
if (patterns.length === 0) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
for (const pattern of patterns) {
|
|
35
|
+
// Remove trailing slash if present
|
|
36
|
+
const cleanPattern = pattern.endsWith('/') ? pattern.slice(0, -1) : pattern;
|
|
37
|
+
const fullPattern = join(repoRoot, cleanPattern);
|
|
38
|
+
// Check if folder matches pattern
|
|
39
|
+
if (folderPath.startsWith(fullPattern) ||
|
|
40
|
+
folderPath.includes(`/${cleanPattern}/`) ||
|
|
41
|
+
folderPath.endsWith(`/${cleanPattern}`) ||
|
|
42
|
+
folderPath === fullPattern) {
|
|
43
|
+
logger.dim(`Skipping folder (matches .contextignore pattern '${pattern}'): ${folderPath}`);
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Get list of changed files from git (staged, unstaged, and in open PR)
|
|
51
|
+
*/
|
|
52
|
+
async function getChangedFiles(repoRoot) {
|
|
53
|
+
const allFiles = new Set();
|
|
54
|
+
// Get staged and unstaged changes
|
|
55
|
+
const diffResult = await exec('git', ['diff', '--name-only', 'HEAD'], { cwd: repoRoot });
|
|
56
|
+
if (diffResult.exitCode === 0 && diffResult.stdout.trim()) {
|
|
57
|
+
diffResult.stdout.trim().split('\n').forEach(f => allFiles.add(f));
|
|
58
|
+
}
|
|
59
|
+
// Get staged files
|
|
60
|
+
const cachedResult = await exec('git', ['diff', '--cached', '--name-only'], { cwd: repoRoot });
|
|
61
|
+
if (cachedResult.exitCode === 0 && cachedResult.stdout.trim()) {
|
|
62
|
+
cachedResult.stdout.trim().split('\n').forEach(f => allFiles.add(f));
|
|
63
|
+
}
|
|
64
|
+
// Get files from open PR (if exists)
|
|
65
|
+
try {
|
|
66
|
+
const branchResult = await exec('git', ['branch', '--show-current'], { cwd: repoRoot });
|
|
67
|
+
if (branchResult.exitCode === 0 && branchResult.stdout.trim()) {
|
|
68
|
+
const currentBranch = branchResult.stdout.trim();
|
|
69
|
+
// Check for open PR
|
|
70
|
+
const prResult = await exec('gh', [
|
|
71
|
+
'pr', 'status',
|
|
72
|
+
'--json', 'number,state,headRefName',
|
|
73
|
+
'--jq', '.currentBranch | select(.state == "OPEN") | .number'
|
|
74
|
+
], { cwd: repoRoot });
|
|
75
|
+
if (prResult.exitCode === 0 && prResult.stdout.trim() && prResult.stdout.trim() !== 'null') {
|
|
76
|
+
const prNumber = prResult.stdout.trim();
|
|
77
|
+
// Get files changed in PR
|
|
78
|
+
const prFilesResult = await exec('gh', [
|
|
79
|
+
'pr', 'view', prNumber,
|
|
80
|
+
'--json', 'files',
|
|
81
|
+
'--jq', '.files[].path'
|
|
82
|
+
], { cwd: repoRoot });
|
|
83
|
+
if (prFilesResult.exitCode === 0 && prFilesResult.stdout.trim()) {
|
|
84
|
+
prFilesResult.stdout.trim().split('\n').forEach(f => allFiles.add(f));
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
90
|
+
// GitHub CLI not available or not in a PR context
|
|
91
|
+
}
|
|
92
|
+
return Array.from(allFiles).filter(f => f);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Get list of folders that have changed files
|
|
96
|
+
* Returns folders sorted by depth (deepest first)
|
|
97
|
+
*/
|
|
98
|
+
export async function getChangedFolders(repoRoot) {
|
|
99
|
+
const changedFiles = await getChangedFiles(repoRoot);
|
|
100
|
+
if (changedFiles.length === 0) {
|
|
101
|
+
return [];
|
|
102
|
+
}
|
|
103
|
+
// Extract unique directories
|
|
104
|
+
const folders = new Set();
|
|
105
|
+
for (const file of changedFiles) {
|
|
106
|
+
const dir = dirname(file);
|
|
107
|
+
const absDir = dir === '.' ? repoRoot : join(repoRoot, dir);
|
|
108
|
+
folders.add(absDir);
|
|
109
|
+
}
|
|
110
|
+
// Filter out folders that should be skipped
|
|
111
|
+
const filteredFolders = [];
|
|
112
|
+
for (const folder of folders) {
|
|
113
|
+
if (!(await shouldSkipFolder(folder, repoRoot))) {
|
|
114
|
+
// Skip the repo root itself (manual updates only)
|
|
115
|
+
if (folder !== repoRoot) {
|
|
116
|
+
filteredFolders.push(folder);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
// Sort by depth (deepest first)
|
|
121
|
+
return filteredFolders.sort((a, b) => {
|
|
122
|
+
const depthA = a.split('/').length;
|
|
123
|
+
const depthB = b.split('/').length;
|
|
124
|
+
return depthB - depthA;
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Classify the scope of changes in a folder
|
|
129
|
+
* Returns 'small' or 'large'
|
|
130
|
+
*/
|
|
131
|
+
export async function classifyChanges(folderPath, repoRoot) {
|
|
132
|
+
const relativePath = relative(repoRoot, folderPath);
|
|
133
|
+
// Get changed files in this folder
|
|
134
|
+
const changedFiles = await getChangedFiles(repoRoot);
|
|
135
|
+
const folderFiles = changedFiles.filter(f => {
|
|
136
|
+
const dir = dirname(f);
|
|
137
|
+
return dir === relativePath || dir.startsWith(relativePath + '/');
|
|
138
|
+
});
|
|
139
|
+
const fileCount = folderFiles.length;
|
|
140
|
+
// If no changed files, classify as small
|
|
141
|
+
if (fileCount === 0) {
|
|
142
|
+
return 'small';
|
|
143
|
+
}
|
|
144
|
+
// Get diff stats
|
|
145
|
+
const statsResult = await exec('git', ['diff', '--numstat', 'HEAD', '--', relativePath], { cwd: repoRoot });
|
|
146
|
+
let totalLinesChanged = 0;
|
|
147
|
+
if (statsResult.exitCode === 0 && statsResult.stdout.trim()) {
|
|
148
|
+
for (const line of statsResult.stdout.trim().split('\n')) {
|
|
149
|
+
const parts = line.split('\t');
|
|
150
|
+
if (parts.length >= 2 && parts[0] !== '-') {
|
|
151
|
+
const added = parseInt(parts[0], 10) || 0;
|
|
152
|
+
const deleted = parseInt(parts[1], 10) || 0;
|
|
153
|
+
totalLinesChanged += added + deleted;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
// Classification heuristics:
|
|
158
|
+
// - Small: <= 3 files changed OR <= 100 lines changed
|
|
159
|
+
// - Large: > 3 files changed AND > 100 lines changed
|
|
160
|
+
if (fileCount <= 3 || totalLinesChanged <= 100) {
|
|
161
|
+
return 'small';
|
|
162
|
+
}
|
|
163
|
+
return 'large';
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Update README.md for a single folder using Claude
|
|
167
|
+
*/
|
|
168
|
+
export async function updateFolderReadme(folderPath, repoRoot) {
|
|
169
|
+
if (!existsSync(folderPath)) {
|
|
170
|
+
logger.warning(`Folder does not exist: ${folderPath}`);
|
|
171
|
+
return false;
|
|
172
|
+
}
|
|
173
|
+
// Skip root folder
|
|
174
|
+
if (folderPath === repoRoot) {
|
|
175
|
+
logger.dim('Skipping root README (manual updates only)');
|
|
176
|
+
return true;
|
|
177
|
+
}
|
|
178
|
+
const relativePath = relative(repoRoot, folderPath);
|
|
179
|
+
const readmePath = join(folderPath, 'README.md');
|
|
180
|
+
const readmeExists = existsSync(readmePath);
|
|
181
|
+
logger.step(`Updating README for folder: ${relativePath}`);
|
|
182
|
+
// Get changed files in this folder
|
|
183
|
+
const changedFiles = await getChangedFiles(repoRoot);
|
|
184
|
+
const folderChangedFiles = changedFiles.filter(f => {
|
|
185
|
+
const dir = dirname(f);
|
|
186
|
+
return dir === relativePath || dir.startsWith(relativePath + '/');
|
|
187
|
+
});
|
|
188
|
+
// Classify changes
|
|
189
|
+
const changeClassification = readmeExists ? await classifyChanges(folderPath, repoRoot) : 'large';
|
|
190
|
+
logger.dim(` Change classification: ${changeClassification}`);
|
|
191
|
+
// Build prompt based on update mode and classification
|
|
192
|
+
let prompt;
|
|
193
|
+
if (readmeExists) {
|
|
194
|
+
if (changeClassification === 'small') {
|
|
195
|
+
prompt = `Use the documentation-incremental agent to make minimal updates to the README.md for this folder.
|
|
196
|
+
|
|
197
|
+
FOLDER PATH: ${relativePath}
|
|
198
|
+
|
|
199
|
+
FILE TO UPDATE: ${relativePath}/README.md
|
|
200
|
+
|
|
201
|
+
RECENTLY CHANGED FILES:
|
|
202
|
+
${folderChangedFiles.join('\n')}
|
|
203
|
+
|
|
204
|
+
CHANGE CLASSIFICATION: Small changes detected
|
|
205
|
+
|
|
206
|
+
INSTRUCTIONS:
|
|
207
|
+
- Review the current README.md content
|
|
208
|
+
- Analyze the changed files to understand what was modified
|
|
209
|
+
- Make only minimal, necessary updates to keep the README accurate
|
|
210
|
+
- Preserve the existing structure, style, and content
|
|
211
|
+
- Only update sections that are affected by the changes
|
|
212
|
+
- If the README is already accurate, minimal or no changes may be needed`;
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
prompt = `Use the documentation agent to update the README.md for this folder.
|
|
216
|
+
|
|
217
|
+
FOLDER PATH: ${relativePath}
|
|
218
|
+
|
|
219
|
+
FILE TO UPDATE: ${relativePath}/README.md
|
|
220
|
+
|
|
221
|
+
RECENTLY CHANGED FILES:
|
|
222
|
+
${folderChangedFiles.join('\n')}
|
|
223
|
+
|
|
224
|
+
CHANGE CLASSIFICATION: Large changes detected
|
|
225
|
+
|
|
226
|
+
INSTRUCTIONS:
|
|
227
|
+
- Analyze the current README and the folder's actual contents
|
|
228
|
+
- Think deeply to analyze how this folder's code is used in the project
|
|
229
|
+
- Follow the documentation agent's guidelines for high-level, contextual documentation
|
|
230
|
+
- Update the README to accurately reflect the current state
|
|
231
|
+
- Preserve important context that remains relevant (architectural decisions, patterns, etc.)
|
|
232
|
+
- Remove outdated information (references to deleted files, old descriptions)`;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
else {
|
|
236
|
+
prompt = `Use the documentation agent to create a new README.md for this folder.
|
|
237
|
+
|
|
238
|
+
FOLDER PATH: ${relativePath}
|
|
239
|
+
|
|
240
|
+
FILE TO CREATE: ${relativePath}/README.md
|
|
241
|
+
|
|
242
|
+
INSTRUCTIONS:
|
|
243
|
+
- Analyze the folder's contents and structure
|
|
244
|
+
- Think deeply to analyze how this folder's code is used in the project
|
|
245
|
+
- Follow the documentation agent's guidelines for high-level, contextual documentation
|
|
246
|
+
- Keep it brief but useful for developers
|
|
247
|
+
- If the folder is simple with obvious purpose, keep the README minimal`;
|
|
248
|
+
}
|
|
249
|
+
// Call Claude CLI
|
|
250
|
+
try {
|
|
251
|
+
const exitCode = await execWithOutput('claude', ['--permission-mode', 'acceptEdits', '--print'], {
|
|
252
|
+
cwd: repoRoot,
|
|
253
|
+
input: prompt
|
|
254
|
+
});
|
|
255
|
+
if (exitCode !== 0) {
|
|
256
|
+
logger.warning(`Claude failed for ${relativePath} (exit code: ${exitCode})`);
|
|
257
|
+
return false;
|
|
258
|
+
}
|
|
259
|
+
logger.success(`Successfully ${readmeExists ? 'updated' : 'created'} ${readmePath}`);
|
|
260
|
+
return true;
|
|
261
|
+
}
|
|
262
|
+
catch (error) {
|
|
263
|
+
logger.warning(`Failed to update README for ${relativePath}: ${error}`);
|
|
264
|
+
return false;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Update context files (READMEs) for all folders with changes
|
|
269
|
+
*/
|
|
270
|
+
export async function updateContextFiles() {
|
|
271
|
+
logger.step('Starting context file automation...');
|
|
272
|
+
let repoRoot;
|
|
273
|
+
try {
|
|
274
|
+
repoRoot = await git.getRepoRoot();
|
|
275
|
+
}
|
|
276
|
+
catch {
|
|
277
|
+
logger.error('Not in a git repository');
|
|
278
|
+
return { success: 0, failed: 0 };
|
|
279
|
+
}
|
|
280
|
+
const changedFolders = await getChangedFolders(repoRoot);
|
|
281
|
+
if (changedFolders.length === 0) {
|
|
282
|
+
logger.info('No folders with changes detected. Skipping context automation.');
|
|
283
|
+
return { success: 0, failed: 0 };
|
|
284
|
+
}
|
|
285
|
+
logger.info(`Found ${changedFolders.length} folder(s) with changes`);
|
|
286
|
+
let success = 0;
|
|
287
|
+
let failed = 0;
|
|
288
|
+
// Process folders sequentially (to avoid Claude conflicts)
|
|
289
|
+
for (const folder of changedFolders) {
|
|
290
|
+
const result = await updateFolderReadme(folder, repoRoot);
|
|
291
|
+
if (result) {
|
|
292
|
+
success++;
|
|
293
|
+
}
|
|
294
|
+
else {
|
|
295
|
+
failed++;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
logger.newline();
|
|
299
|
+
logger.info(`Context file automation complete:`);
|
|
300
|
+
logger.info(` - Successfully updated: ${success} README(s)`);
|
|
301
|
+
logger.info(` - Failed: ${failed} README(s)`);
|
|
302
|
+
return { success, failed };
|
|
303
|
+
}
|
|
304
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/services/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,QAAQ,EAAQ,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAE/C;;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AAC;IAEf,2DAA2D;IAC3D,KAAK,MAAM,MAAM,IAAI,cAAc,EAAE,CAAC;QACpC,MAAM,MAAM,GAAG,MAAM,kBAAkB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAC1D,IAAI,MAAM,EAAE,CAAC;YACX,OAAO,EAAE,CAAC;QACZ,CAAC;aAAM,CAAC;YACN,MAAM,EAAE,CAAC;QACX,CAAC;IACH,CAAC;IAED,MAAM,CAAC,OAAO,EAAE,CAAC;IACjB,MAAM,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC;IACjD,MAAM,CAAC,IAAI,CAAC,6BAA6B,OAAO,YAAY,CAAC,CAAC;IAC9D,MAAM,CAAC,IAAI,CAAC,eAAe,MAAM,YAAY,CAAC,CAAC;IAE/C,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Run tests if configured in .idea1/settings.json
|
|
3
|
+
* Returns true if tests pass or no test command is configured
|
|
4
|
+
* Returns false if tests fail
|
|
5
|
+
*/
|
|
6
|
+
export declare function runTestsIfNeeded(): Promise<boolean>;
|
|
7
|
+
/**
|
|
8
|
+
* Check if tests are configured for this repository
|
|
9
|
+
*/
|
|
10
|
+
export declare function hasTestsConfigured(): Promise<boolean>;
|
|
11
|
+
//# sourceMappingURL=test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../src/services/test.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,OAAO,CAAC,CAgCzD;AAED;;GAEG;AACH,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,OAAO,CAAC,CAQ3D"}
|