@kosuke-ai/cli 0.0.10 → 0.0.12
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/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +51 -0
- package/dist/index.js.map +1 -1
- package/dist/kosuke/commands/analyse.d.ts.map +1 -1
- package/dist/kosuke/commands/analyse.js +15 -85
- package/dist/kosuke/commands/analyse.js.map +1 -1
- package/dist/kosuke/commands/getcode.d.ts +29 -0
- package/dist/kosuke/commands/getcode.d.ts.map +1 -0
- package/dist/kosuke/commands/getcode.js +204 -0
- package/dist/kosuke/commands/getcode.js.map +1 -0
- package/dist/kosuke/commands/lint.d.ts +9 -4
- package/dist/kosuke/commands/lint.d.ts.map +1 -1
- package/dist/kosuke/commands/lint.js +190 -104
- package/dist/kosuke/commands/lint.js.map +1 -1
- package/dist/kosuke/commands/requirements.d.ts.map +1 -1
- package/dist/kosuke/commands/requirements.js +1 -18
- package/dist/kosuke/commands/requirements.js.map +1 -1
- package/dist/kosuke/commands/sync-rules.d.ts.map +1 -1
- package/dist/kosuke/commands/sync-rules.js +30 -48
- package/dist/kosuke/commands/sync-rules.js.map +1 -1
- package/dist/kosuke/commands/tickets.d.ts +24 -0
- package/dist/kosuke/commands/tickets.d.ts.map +1 -0
- package/dist/kosuke/commands/tickets.js +298 -0
- package/dist/kosuke/commands/tickets.js.map +1 -0
- package/dist/kosuke/types.d.ts +50 -0
- package/dist/kosuke/types.d.ts.map +1 -1
- package/dist/kosuke/utils/claude-agent.d.ts +57 -0
- package/dist/kosuke/utils/claude-agent.d.ts.map +1 -0
- package/dist/kosuke/utils/claude-agent.js +177 -0
- package/dist/kosuke/utils/claude-agent.js.map +1 -0
- package/dist/kosuke/utils/repository-manager.d.ts +13 -0
- package/dist/kosuke/utils/repository-manager.d.ts.map +1 -0
- package/dist/kosuke/utils/repository-manager.js +94 -0
- package/dist/kosuke/utils/repository-manager.js.map +1 -0
- package/dist/kosuke/utils/repository-resolver.d.ts +12 -0
- package/dist/kosuke/utils/repository-resolver.d.ts.map +1 -0
- package/dist/kosuke/utils/repository-resolver.js +186 -0
- package/dist/kosuke/utils/repository-resolver.js.map +1 -0
- package/dist/kosuke/utils/validator.d.ts +19 -7
- package/dist/kosuke/utils/validator.d.ts.map +1 -1
- package/dist/kosuke/utils/validator.js +102 -24
- package/dist/kosuke/utils/validator.js.map +1 -1
- package/dist/lib.d.ts +26 -5
- package/dist/lib.d.ts.map +1 -1
- package/dist/lib.js +23 -4
- package/dist/lib.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,15 +1,64 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Code validation utilities (lint, typecheck)
|
|
2
|
+
* Code validation utilities (lint, typecheck, format)
|
|
3
3
|
*/
|
|
4
4
|
import { execSync } from 'child_process';
|
|
5
|
+
import { existsSync, readFileSync } from 'fs';
|
|
6
|
+
import { join } from 'path';
|
|
5
7
|
/**
|
|
6
|
-
*
|
|
8
|
+
* Detect package manager based on lock files
|
|
7
9
|
*/
|
|
8
|
-
export
|
|
10
|
+
export function detectPackageManager(cwd = process.cwd()) {
|
|
11
|
+
if (existsSync(join(cwd, 'bun.lockb')))
|
|
12
|
+
return 'bun';
|
|
13
|
+
if (existsSync(join(cwd, 'pnpm-lock.yaml')))
|
|
14
|
+
return 'pnpm';
|
|
15
|
+
if (existsSync(join(cwd, 'yarn.lock')))
|
|
16
|
+
return 'yarn';
|
|
17
|
+
if (existsSync(join(cwd, 'package-lock.json')))
|
|
18
|
+
return 'npm';
|
|
19
|
+
// Default to npm if no lock file found
|
|
20
|
+
return 'npm';
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Read package.json and extract scripts
|
|
24
|
+
*/
|
|
25
|
+
export function readPackageJsonScripts(cwd = process.cwd()) {
|
|
26
|
+
const packageJsonPath = join(cwd, 'package.json');
|
|
27
|
+
if (!existsSync(packageJsonPath)) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
try {
|
|
31
|
+
const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8'));
|
|
32
|
+
return packageJson.scripts || null;
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
console.warn(`⚠️ Failed to parse package.json: ${error}`);
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Run formatting using detected package manager and scripts
|
|
41
|
+
*/
|
|
42
|
+
export async function runFormat() {
|
|
43
|
+
const cwd = process.cwd();
|
|
44
|
+
const scripts = readPackageJsonScripts(cwd);
|
|
45
|
+
if (!scripts) {
|
|
46
|
+
return {
|
|
47
|
+
success: false,
|
|
48
|
+
error: 'package.json not found or has no scripts section',
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
if (!scripts.format) {
|
|
52
|
+
return {
|
|
53
|
+
success: true,
|
|
54
|
+
warning: `⚠️ No 'format' script found in package.json. Skipping formatting.\n💡 Hint: kosuke-template uses: "format": "prettier --write ."`,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
const packageManager = detectPackageManager(cwd);
|
|
58
|
+
const command = `${packageManager} run format`;
|
|
9
59
|
try {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
cwd: process.cwd(),
|
|
60
|
+
const output = execSync(command, {
|
|
61
|
+
cwd,
|
|
13
62
|
encoding: 'utf-8',
|
|
14
63
|
stdio: 'pipe',
|
|
15
64
|
});
|
|
@@ -18,26 +67,37 @@ export async function runLint() {
|
|
|
18
67
|
catch (error) {
|
|
19
68
|
const err = error;
|
|
20
69
|
const errorMessage = err.stdout || err.stderr || err.message || '';
|
|
21
|
-
// Check if this is just an eslint command not found issue
|
|
22
|
-
if (errorMessage.includes('eslint: command not found')) {
|
|
23
|
-
return {
|
|
24
|
-
success: false,
|
|
25
|
-
error: `$ bun run lint -- --fix\n\n${errorMessage}\n\n⚠️ Hint: Your project's lint script should use 'npx eslint' instead of just 'eslint'.\nExample: "lint": "npx eslint . --ext .js,.jsx,.ts,.tsx --max-warnings 0"`,
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
70
|
return {
|
|
29
71
|
success: false,
|
|
30
|
-
error: errorMessage
|
|
72
|
+
error: `$ ${command}\n\n${errorMessage}`,
|
|
31
73
|
};
|
|
32
74
|
}
|
|
33
75
|
}
|
|
34
76
|
/**
|
|
35
|
-
* Run
|
|
77
|
+
* Run linting using detected package manager and scripts
|
|
36
78
|
*/
|
|
37
|
-
export async function
|
|
79
|
+
export async function runLint() {
|
|
80
|
+
const cwd = process.cwd();
|
|
81
|
+
const scripts = readPackageJsonScripts(cwd);
|
|
82
|
+
if (!scripts) {
|
|
83
|
+
return {
|
|
84
|
+
success: false,
|
|
85
|
+
error: 'package.json not found or has no scripts section',
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
if (!scripts.lint) {
|
|
89
|
+
return {
|
|
90
|
+
success: true,
|
|
91
|
+
warning: `⚠️ No 'lint' script found in package.json. Skipping linting.\n💡 Hint: kosuke-template uses: "lint": "eslint . --ext .js,.jsx,.ts,.tsx --max-warnings 0"`,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
const packageManager = detectPackageManager(cwd);
|
|
95
|
+
// Try to append --fix flag for auto-fixing
|
|
96
|
+
// Note: This works with most linters (eslint, biome, etc.)
|
|
97
|
+
const command = `${packageManager} run lint -- --fix`;
|
|
38
98
|
try {
|
|
39
|
-
const output = execSync(
|
|
40
|
-
cwd
|
|
99
|
+
const output = execSync(command, {
|
|
100
|
+
cwd,
|
|
41
101
|
encoding: 'utf-8',
|
|
42
102
|
stdio: 'pipe',
|
|
43
103
|
});
|
|
@@ -45,19 +105,36 @@ export async function runTypecheck() {
|
|
|
45
105
|
}
|
|
46
106
|
catch (error) {
|
|
47
107
|
const err = error;
|
|
108
|
+
const errorMessage = err.stdout || err.stderr || err.message || '';
|
|
48
109
|
return {
|
|
49
110
|
success: false,
|
|
50
|
-
error:
|
|
111
|
+
error: `$ ${command}\n\n${errorMessage}`,
|
|
51
112
|
};
|
|
52
113
|
}
|
|
53
114
|
}
|
|
54
115
|
/**
|
|
55
|
-
* Run
|
|
116
|
+
* Run TypeScript type checking using detected package manager
|
|
56
117
|
*/
|
|
57
|
-
export async function
|
|
118
|
+
export async function runTypecheck() {
|
|
119
|
+
const cwd = process.cwd();
|
|
120
|
+
const scripts = readPackageJsonScripts(cwd);
|
|
121
|
+
if (!scripts) {
|
|
122
|
+
return {
|
|
123
|
+
success: false,
|
|
124
|
+
error: 'package.json not found or has no scripts section',
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
if (!scripts.typecheck) {
|
|
128
|
+
return {
|
|
129
|
+
success: true,
|
|
130
|
+
warning: `⚠️ No 'typecheck' script found in package.json. Skipping type checking.\n💡 Hint: kosuke-template uses: "typecheck": "tsc --noEmit"`,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
const packageManager = detectPackageManager(cwd);
|
|
134
|
+
const command = `${packageManager} run typecheck`;
|
|
58
135
|
try {
|
|
59
|
-
const output = execSync(
|
|
60
|
-
cwd
|
|
136
|
+
const output = execSync(command, {
|
|
137
|
+
cwd,
|
|
61
138
|
encoding: 'utf-8',
|
|
62
139
|
stdio: 'pipe',
|
|
63
140
|
});
|
|
@@ -65,9 +142,10 @@ export async function runFormat() {
|
|
|
65
142
|
}
|
|
66
143
|
catch (error) {
|
|
67
144
|
const err = error;
|
|
145
|
+
const errorMessage = err.stdout || err.stderr || err.message || '';
|
|
68
146
|
return {
|
|
69
147
|
success: false,
|
|
70
|
-
error:
|
|
148
|
+
error: `$ ${command}\n\n${errorMessage}`,
|
|
71
149
|
};
|
|
72
150
|
}
|
|
73
151
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validator.js","sourceRoot":"","sources":["../../../kosuke/utils/validator.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,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AAO,CAAC,SAAS,EAAE,CAAC;QACvB,OAAO;YACL,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,sIAAsI;SAChJ,CAAC;IACJ,CAAC;IAED,MAAM,cAAc,GAAG,oBAAoB,CAAC,GAAG,CAAC,CAAC;IACjD,MAAM,OAAO,GAAG,GAAG,cAAc,gBAAgB,CAAC;IAElD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,EAAE;YAC/B,GAAG;YACH,QAAQ,EAAE,OAAO;YACjB,KAAK,EAAE,MAAM;SACd,CAAC,CAAC;QACH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IACnC,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,MAAM,GAAG,GAAG,KAA+D,CAAC;QAC5E,MAAM,YAAY,GAAG,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC;QAEnE,OAAO;YACL,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,KAAK,OAAO,OAAO,YAAY,EAAE;SACzC,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/dist/lib.d.ts
CHANGED
|
@@ -6,21 +6,42 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* ```typescript
|
|
9
|
-
* import {
|
|
9
|
+
* import {
|
|
10
|
+
* analyseCommand,
|
|
11
|
+
* getCodeCore,
|
|
12
|
+
* discoverFiles,
|
|
13
|
+
* runLint,
|
|
14
|
+
* type ValidationResult
|
|
15
|
+
* } from '@kosuke-ai/cli';
|
|
10
16
|
*
|
|
11
17
|
* // Run analysis programmatically
|
|
12
18
|
* await analyseCommand({ scope: 'src', pr: false });
|
|
13
19
|
*
|
|
14
|
-
* //
|
|
20
|
+
* // Explore code from a repository
|
|
21
|
+
* const result = await getCodeCore({
|
|
22
|
+
* repo: 'owner/repo',
|
|
23
|
+
* query: 'How does authentication work?'
|
|
24
|
+
* });
|
|
25
|
+
*
|
|
26
|
+
* // Use validation utilities
|
|
27
|
+
* const lintResult: ValidationResult = await runLint();
|
|
28
|
+
*
|
|
29
|
+
* // Discover files
|
|
15
30
|
* const files = await discoverFiles({ types: ['ts', 'tsx'] });
|
|
16
31
|
* ```
|
|
17
32
|
*/
|
|
18
33
|
export { analyseCommand } from './kosuke/commands/analyse.js';
|
|
19
|
-
export { lintCommand } from './kosuke/commands/lint.js';
|
|
34
|
+
export { lintCommand, fixCodeQualityErrors, fixLintErrors } from './kosuke/commands/lint.js';
|
|
20
35
|
export { syncRulesCommand } from './kosuke/commands/sync-rules.js';
|
|
21
36
|
export { requirementsCommand } from './kosuke/commands/requirements.js';
|
|
37
|
+
export { getCodeCore } from './kosuke/commands/getcode.js';
|
|
38
|
+
export { ticketsCore } from './kosuke/commands/tickets.js';
|
|
22
39
|
export { discoverFiles } from './kosuke/utils/file-discovery.js';
|
|
23
40
|
export { createBatches } from './kosuke/utils/batch-creator.js';
|
|
24
|
-
export { runLint, runTypecheck, runFormat } from './kosuke/utils/validator.js';
|
|
25
|
-
export
|
|
41
|
+
export { runLint, runTypecheck, runFormat, detectPackageManager, readPackageJsonScripts, } from './kosuke/utils/validator.js';
|
|
42
|
+
export { getRepoLocalPath } from './kosuke/utils/repository-manager.js';
|
|
43
|
+
export { validateRepoAccess } from './kosuke/utils/repository-resolver.js';
|
|
44
|
+
export type { Batch, Fix, AnalyseOptions, LintOptions, SyncRulesOptions, RulesAdaptation, GitInfo, GetCodeOptions, CodeExplorationResult, TicketsOptions, TicketsResult, } from './kosuke/types.js';
|
|
45
|
+
export type { ValidationResult } from './kosuke/utils/validator.js';
|
|
46
|
+
export type { AgentVerbosity, AgentConfig, AgentResult } from './kosuke/utils/claude-agent.js';
|
|
26
47
|
//# sourceMappingURL=lib.d.ts.map
|
package/dist/lib.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../lib.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../lib.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC7F,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAG3D,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EACL,OAAO,EACP,YAAY,EACZ,SAAS,EACT,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAG3E,YAAY,EACV,KAAK,EACL,GAAG,EACH,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,OAAO,EACP,cAAc,EACd,qBAAqB,EACrB,cAAc,EACd,aAAa,GACd,MAAM,mBAAmB,CAAC;AAE3B,YAAY,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC"}
|
package/dist/lib.js
CHANGED
|
@@ -6,22 +6,41 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* ```typescript
|
|
9
|
-
* import {
|
|
9
|
+
* import {
|
|
10
|
+
* analyseCommand,
|
|
11
|
+
* getCodeCore,
|
|
12
|
+
* discoverFiles,
|
|
13
|
+
* runLint,
|
|
14
|
+
* type ValidationResult
|
|
15
|
+
* } from '@kosuke-ai/cli';
|
|
10
16
|
*
|
|
11
17
|
* // Run analysis programmatically
|
|
12
18
|
* await analyseCommand({ scope: 'src', pr: false });
|
|
13
19
|
*
|
|
14
|
-
* //
|
|
20
|
+
* // Explore code from a repository
|
|
21
|
+
* const result = await getCodeCore({
|
|
22
|
+
* repo: 'owner/repo',
|
|
23
|
+
* query: 'How does authentication work?'
|
|
24
|
+
* });
|
|
25
|
+
*
|
|
26
|
+
* // Use validation utilities
|
|
27
|
+
* const lintResult: ValidationResult = await runLint();
|
|
28
|
+
*
|
|
29
|
+
* // Discover files
|
|
15
30
|
* const files = await discoverFiles({ types: ['ts', 'tsx'] });
|
|
16
31
|
* ```
|
|
17
32
|
*/
|
|
18
33
|
// Re-export commands
|
|
19
34
|
export { analyseCommand } from './kosuke/commands/analyse.js';
|
|
20
|
-
export { lintCommand } from './kosuke/commands/lint.js';
|
|
35
|
+
export { lintCommand, fixCodeQualityErrors, fixLintErrors } from './kosuke/commands/lint.js';
|
|
21
36
|
export { syncRulesCommand } from './kosuke/commands/sync-rules.js';
|
|
22
37
|
export { requirementsCommand } from './kosuke/commands/requirements.js';
|
|
38
|
+
export { getCodeCore } from './kosuke/commands/getcode.js';
|
|
39
|
+
export { ticketsCore } from './kosuke/commands/tickets.js';
|
|
23
40
|
// Re-export utilities
|
|
24
41
|
export { discoverFiles } from './kosuke/utils/file-discovery.js';
|
|
25
42
|
export { createBatches } from './kosuke/utils/batch-creator.js';
|
|
26
|
-
export { runLint, runTypecheck, runFormat } from './kosuke/utils/validator.js';
|
|
43
|
+
export { runLint, runTypecheck, runFormat, detectPackageManager, readPackageJsonScripts, } from './kosuke/utils/validator.js';
|
|
44
|
+
export { getRepoLocalPath } from './kosuke/utils/repository-manager.js';
|
|
45
|
+
export { validateRepoAccess } from './kosuke/utils/repository-resolver.js';
|
|
27
46
|
//# sourceMappingURL=lib.js.map
|
package/dist/lib.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../lib.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../lib.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,qBAAqB;AACrB,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC7F,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,sBAAsB;AACtB,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EACL,OAAO,EACP,YAAY,EACZ,SAAS,EACT,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC"}
|