ai-devkit 0.18.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/agent.d.ts.map +1 -1
- package/dist/commands/agent.js +13 -1
- package/dist/commands/agent.js.map +1 -1
- package/dist/templates/commands/review-design.md +4 -1
- package/dist/templates/commands/review-requirements.md +4 -1
- package/dist/templates/templates/commands/review-design.md +4 -1
- package/dist/templates/templates/commands/review-requirements.md +4 -1
- package/package.json +2 -2
- package/templates/commands/review-design.md +4 -1
- package/templates/commands/review-requirements.md +4 -1
- package/dist/util/file.d.ts +0 -52
- package/dist/util/file.d.ts.map +0 -1
- package/dist/util/file.js +0 -135
- package/dist/util/file.js.map +0 -1
- package/dist/util/process.d.ts +0 -61
- package/dist/util/process.d.ts.map +0 -1
- package/dist/util/process.js +0 -166
- package/dist/util/process.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/commands/agent.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/commands/agent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkEpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAwM3D"}
|
package/dist/commands/agent.js
CHANGED
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.registerAgentCommand = registerAgentCommand;
|
|
7
|
+
const os_1 = __importDefault(require("os"));
|
|
7
8
|
const chalk_1 = __importDefault(require("chalk"));
|
|
8
9
|
const inquirer_1 = __importDefault(require("inquirer"));
|
|
9
10
|
const agent_manager_1 = require("@ai-devkit/agent-manager");
|
|
@@ -40,6 +41,15 @@ const TYPE_LABELS = {
|
|
|
40
41
|
function formatType(type) {
|
|
41
42
|
return TYPE_LABELS[type] ?? type;
|
|
42
43
|
}
|
|
44
|
+
function formatCwd(projectPath) {
|
|
45
|
+
if (!projectPath)
|
|
46
|
+
return '';
|
|
47
|
+
const home = os_1.default.homedir();
|
|
48
|
+
if (projectPath.startsWith(home)) {
|
|
49
|
+
return '~' + projectPath.slice(home.length);
|
|
50
|
+
}
|
|
51
|
+
return projectPath;
|
|
52
|
+
}
|
|
43
53
|
function formatWorkOn(summary) {
|
|
44
54
|
const firstLine = (summary ?? '').split(/\r?\n/, 1)[0] || '';
|
|
45
55
|
return firstLine || 'No active task';
|
|
@@ -71,17 +81,19 @@ function registerAgentCommand(program) {
|
|
|
71
81
|
terminal_ui_1.ui.text('Running Agents:', { breakline: true });
|
|
72
82
|
const rows = agents.map(agent => [
|
|
73
83
|
agent.name,
|
|
84
|
+
formatCwd(agent.projectPath),
|
|
74
85
|
formatType(agent.type),
|
|
75
86
|
formatStatus(agent.status),
|
|
76
87
|
formatWorkOn(agent.summary),
|
|
77
88
|
formatRelativeTime(agent.lastActive)
|
|
78
89
|
]);
|
|
79
90
|
terminal_ui_1.ui.table({
|
|
80
|
-
headers: ['Agent', 'Type', 'Status', 'Working On', 'Active'],
|
|
91
|
+
headers: ['Agent', 'CWD', 'Type', 'Status', 'Working On', 'Active'],
|
|
81
92
|
rows: rows,
|
|
82
93
|
columnStyles: [
|
|
83
94
|
(text) => chalk_1.default.cyan(text),
|
|
84
95
|
(text) => chalk_1.default.dim(text),
|
|
96
|
+
(text) => chalk_1.default.dim(text),
|
|
85
97
|
(text) => {
|
|
86
98
|
if (text.includes(STATUS_DISPLAY[agent_manager_1.AgentStatus.RUNNING].label))
|
|
87
99
|
return chalk_1.default.green(text);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../../src/commands/agent.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"agent.js","sourceRoot":"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D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;IACL,CAAC,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -13,6 +13,9 @@ Review the design documentation in `{{docsDir}}/design/feature-{name}.md` (and t
|
|
|
13
13
|
- API/interface contracts (inputs, outputs, auth)
|
|
14
14
|
- Major design decisions and trade-offs
|
|
15
15
|
- Non-functional requirements that must be preserved
|
|
16
|
-
3.
|
|
16
|
+
3. **Clarify and explore (loop until converged)**:
|
|
17
|
+
- **Ask clarification questions** for every gap, inconsistency, or misalignment between requirements and design. Do not just list issues — actively ask specific questions to resolve them.
|
|
18
|
+
- **Brainstorm and explore options** — For key architecture decisions, trade-offs, or areas with multiple viable approaches, proactively brainstorm alternatives. Present options with pros/cons and trade-offs. Challenge assumptions and surface creative alternatives.
|
|
19
|
+
- **Repeat** — Continue looping until the user is satisfied with the chosen approach and no open questions remain.
|
|
17
20
|
4. **Store Reusable Knowledge** — Persist approved design patterns/constraints with `npx ai-devkit@latest memory store ...` when they will help future work.
|
|
18
21
|
5. **Next Command Guidance** — If requirements gaps are found, return to `/review-requirements`; if design is sound, continue to `/execute-plan`.
|
|
@@ -11,6 +11,9 @@ Review `{{docsDir}}/requirements/feature-{name}.md` and the project-level templa
|
|
|
11
11
|
- Primary user stories & critical flows
|
|
12
12
|
- Constraints, assumptions, open questions
|
|
13
13
|
- Any missing sections or deviations from the template
|
|
14
|
-
3.
|
|
14
|
+
3. **Clarify and explore (loop until converged)**:
|
|
15
|
+
- **Ask clarification questions** for every gap, contradiction, or ambiguity. Do not just list issues — actively ask specific questions to resolve them.
|
|
16
|
+
- **Brainstorm and explore options** — For key decisions, trade-offs, or areas with multiple viable approaches, proactively brainstorm alternatives. Present options with pros/cons and trade-offs. Challenge assumptions and surface creative alternatives.
|
|
17
|
+
- **Repeat** — Continue looping until the user is satisfied with the chosen approach and no open questions remain.
|
|
15
18
|
4. **Store Reusable Knowledge** — If new reusable requirement conventions are agreed, store them with `npx ai-devkit@latest memory store ...`.
|
|
16
19
|
5. **Next Command Guidance** — If fundamentals are missing, go back to `/new-requirement`; otherwise continue to `/review-design`.
|
|
@@ -13,6 +13,9 @@ Review the design documentation in `{{docsDir}}/design/feature-{name}.md` (and t
|
|
|
13
13
|
- API/interface contracts (inputs, outputs, auth)
|
|
14
14
|
- Major design decisions and trade-offs
|
|
15
15
|
- Non-functional requirements that must be preserved
|
|
16
|
-
3.
|
|
16
|
+
3. **Clarify and explore (loop until converged)**:
|
|
17
|
+
- **Ask clarification questions** for every gap, inconsistency, or misalignment between requirements and design. Do not just list issues — actively ask specific questions to resolve them.
|
|
18
|
+
- **Brainstorm and explore options** — For key architecture decisions, trade-offs, or areas with multiple viable approaches, proactively brainstorm alternatives. Present options with pros/cons and trade-offs. Challenge assumptions and surface creative alternatives.
|
|
19
|
+
- **Repeat** — Continue looping until the user is satisfied with the chosen approach and no open questions remain.
|
|
17
20
|
4. **Store Reusable Knowledge** — Persist approved design patterns/constraints with `npx ai-devkit@latest memory store ...` when they will help future work.
|
|
18
21
|
5. **Next Command Guidance** — If requirements gaps are found, return to `/review-requirements`; if design is sound, continue to `/execute-plan`.
|
|
@@ -11,6 +11,9 @@ Review `{{docsDir}}/requirements/feature-{name}.md` and the project-level templa
|
|
|
11
11
|
- Primary user stories & critical flows
|
|
12
12
|
- Constraints, assumptions, open questions
|
|
13
13
|
- Any missing sections or deviations from the template
|
|
14
|
-
3.
|
|
14
|
+
3. **Clarify and explore (loop until converged)**:
|
|
15
|
+
- **Ask clarification questions** for every gap, contradiction, or ambiguity. Do not just list issues — actively ask specific questions to resolve them.
|
|
16
|
+
- **Brainstorm and explore options** — For key decisions, trade-offs, or areas with multiple viable approaches, proactively brainstorm alternatives. Present options with pros/cons and trade-offs. Challenge assumptions and surface creative alternatives.
|
|
17
|
+
- **Repeat** — Continue looping until the user is satisfied with the chosen approach and no open questions remain.
|
|
15
18
|
4. **Store Reusable Knowledge** — If new reusable requirement conventions are agreed, store them with `npx ai-devkit@latest memory store ...`.
|
|
16
19
|
5. **Next Command Guidance** — If fundamentals are missing, go back to `/new-requirement`; otherwise continue to `/review-design`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai-devkit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
4
4
|
"description": "A CLI toolkit for AI-assisted software development with phase templates and environment setup",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"author": "",
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@ai-devkit/agent-manager": "0.
|
|
30
|
+
"@ai-devkit/agent-manager": "0.5.0",
|
|
31
31
|
"@ai-devkit/memory": "0.7.0",
|
|
32
32
|
"chalk": "^4.1.2",
|
|
33
33
|
"commander": "^11.1.0",
|
|
@@ -13,6 +13,9 @@ Review the design documentation in `{{docsDir}}/design/feature-{name}.md` (and t
|
|
|
13
13
|
- API/interface contracts (inputs, outputs, auth)
|
|
14
14
|
- Major design decisions and trade-offs
|
|
15
15
|
- Non-functional requirements that must be preserved
|
|
16
|
-
3.
|
|
16
|
+
3. **Clarify and explore (loop until converged)**:
|
|
17
|
+
- **Ask clarification questions** for every gap, inconsistency, or misalignment between requirements and design. Do not just list issues — actively ask specific questions to resolve them.
|
|
18
|
+
- **Brainstorm and explore options** — For key architecture decisions, trade-offs, or areas with multiple viable approaches, proactively brainstorm alternatives. Present options with pros/cons and trade-offs. Challenge assumptions and surface creative alternatives.
|
|
19
|
+
- **Repeat** — Continue looping until the user is satisfied with the chosen approach and no open questions remain.
|
|
17
20
|
4. **Store Reusable Knowledge** — Persist approved design patterns/constraints with `npx ai-devkit@latest memory store ...` when they will help future work.
|
|
18
21
|
5. **Next Command Guidance** — If requirements gaps are found, return to `/review-requirements`; if design is sound, continue to `/execute-plan`.
|
|
@@ -11,6 +11,9 @@ Review `{{docsDir}}/requirements/feature-{name}.md` and the project-level templa
|
|
|
11
11
|
- Primary user stories & critical flows
|
|
12
12
|
- Constraints, assumptions, open questions
|
|
13
13
|
- Any missing sections or deviations from the template
|
|
14
|
-
3.
|
|
14
|
+
3. **Clarify and explore (loop until converged)**:
|
|
15
|
+
- **Ask clarification questions** for every gap, contradiction, or ambiguity. Do not just list issues — actively ask specific questions to resolve them.
|
|
16
|
+
- **Brainstorm and explore options** — For key decisions, trade-offs, or areas with multiple viable approaches, proactively brainstorm alternatives. Present options with pros/cons and trade-offs. Challenge assumptions and surface creative alternatives.
|
|
17
|
+
- **Repeat** — Continue looping until the user is satisfied with the chosen approach and no open questions remain.
|
|
15
18
|
4. **Store Reusable Knowledge** — If new reusable requirement conventions are agreed, store them with `npx ai-devkit@latest memory store ...`.
|
|
16
19
|
5. **Next Command Guidance** — If fundamentals are missing, go back to `/new-requirement`; otherwise continue to `/review-design`.
|
package/dist/util/file.d.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* File Utilities
|
|
3
|
-
*
|
|
4
|
-
* Helper functions for reading files efficiently
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Read last N lines from a file efficiently
|
|
8
|
-
*
|
|
9
|
-
* @param filePath Path to the file
|
|
10
|
-
* @param lineCount Number of lines to read from the end (default: 100)
|
|
11
|
-
* @returns Array of lines
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* ```typescript
|
|
15
|
-
* const lastLines = readLastLines('/path/to/log.txt', 50);
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
export declare function readLastLines(filePath: string, lineCount?: number): string[];
|
|
19
|
-
/**
|
|
20
|
-
* Read a JSONL (JSON Lines) file and parse each line
|
|
21
|
-
*
|
|
22
|
-
* @param filePath Path to the JSONL file
|
|
23
|
-
* @param maxLines Maximum number of lines to read from end (default: 1000)
|
|
24
|
-
* @returns Array of parsed objects
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* ```typescript
|
|
28
|
-
* const entries = readJsonLines<MyType>('/path/to/data.jsonl');
|
|
29
|
-
* const recent = readJsonLines<MyType>('/path/to/data.jsonl', 100);
|
|
30
|
-
* ```
|
|
31
|
-
*/
|
|
32
|
-
export declare function readJsonLines<T = any>(filePath: string, maxLines?: number): T[];
|
|
33
|
-
/**
|
|
34
|
-
* Check if a file exists
|
|
35
|
-
*
|
|
36
|
-
* @param filePath Path to check
|
|
37
|
-
* @returns True if file exists
|
|
38
|
-
*/
|
|
39
|
-
export declare function fileExists(filePath: string): boolean;
|
|
40
|
-
/**
|
|
41
|
-
* Read a JSON file safely
|
|
42
|
-
*
|
|
43
|
-
* @param filePath Path to JSON file
|
|
44
|
-
* @returns Parsed JSON object or null if error
|
|
45
|
-
*
|
|
46
|
-
* @example
|
|
47
|
-
* ```typescript
|
|
48
|
-
* const config = readJson<ConfigType>('/path/to/config.json');
|
|
49
|
-
* ```
|
|
50
|
-
*/
|
|
51
|
-
export declare function readJson<T = any>(filePath: string): T | null;
|
|
52
|
-
//# sourceMappingURL=file.d.ts.map
|
package/dist/util/file.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/util/file.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,GAAE,MAAY,GAAG,MAAM,EAAE,CAejF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,CAAC,GAAG,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAa,GAAG,CAAC,EAAE,CAUrF;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAMpD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAC,CAAC,GAAG,GAAG,EAAE,QAAQ,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI,CAY5D"}
|
package/dist/util/file.js
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* File Utilities
|
|
4
|
-
*
|
|
5
|
-
* Helper functions for reading files efficiently
|
|
6
|
-
*/
|
|
7
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
8
|
-
if (k2 === undefined) k2 = k;
|
|
9
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
10
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
11
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
12
|
-
}
|
|
13
|
-
Object.defineProperty(o, k2, desc);
|
|
14
|
-
}) : (function(o, m, k, k2) {
|
|
15
|
-
if (k2 === undefined) k2 = k;
|
|
16
|
-
o[k2] = m[k];
|
|
17
|
-
}));
|
|
18
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
19
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
20
|
-
}) : function(o, v) {
|
|
21
|
-
o["default"] = v;
|
|
22
|
-
});
|
|
23
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
24
|
-
var ownKeys = function(o) {
|
|
25
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
26
|
-
var ar = [];
|
|
27
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
28
|
-
return ar;
|
|
29
|
-
};
|
|
30
|
-
return ownKeys(o);
|
|
31
|
-
};
|
|
32
|
-
return function (mod) {
|
|
33
|
-
if (mod && mod.__esModule) return mod;
|
|
34
|
-
var result = {};
|
|
35
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
36
|
-
__setModuleDefault(result, mod);
|
|
37
|
-
return result;
|
|
38
|
-
};
|
|
39
|
-
})();
|
|
40
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
-
exports.readLastLines = readLastLines;
|
|
42
|
-
exports.readJsonLines = readJsonLines;
|
|
43
|
-
exports.fileExists = fileExists;
|
|
44
|
-
exports.readJson = readJson;
|
|
45
|
-
const fs = __importStar(require("fs"));
|
|
46
|
-
/**
|
|
47
|
-
* Read last N lines from a file efficiently
|
|
48
|
-
*
|
|
49
|
-
* @param filePath Path to the file
|
|
50
|
-
* @param lineCount Number of lines to read from the end (default: 100)
|
|
51
|
-
* @returns Array of lines
|
|
52
|
-
*
|
|
53
|
-
* @example
|
|
54
|
-
* ```typescript
|
|
55
|
-
* const lastLines = readLastLines('/path/to/log.txt', 50);
|
|
56
|
-
* ```
|
|
57
|
-
*/
|
|
58
|
-
function readLastLines(filePath, lineCount = 100) {
|
|
59
|
-
if (!fs.existsSync(filePath)) {
|
|
60
|
-
return [];
|
|
61
|
-
}
|
|
62
|
-
try {
|
|
63
|
-
const content = fs.readFileSync(filePath, 'utf-8');
|
|
64
|
-
const allLines = content.trim().split('\n');
|
|
65
|
-
// Return last N lines (or all if file has fewer lines)
|
|
66
|
-
return allLines.slice(-lineCount);
|
|
67
|
-
}
|
|
68
|
-
catch (error) {
|
|
69
|
-
console.error(`Failed to read ${filePath}:`, error);
|
|
70
|
-
return [];
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Read a JSONL (JSON Lines) file and parse each line
|
|
75
|
-
*
|
|
76
|
-
* @param filePath Path to the JSONL file
|
|
77
|
-
* @param maxLines Maximum number of lines to read from end (default: 1000)
|
|
78
|
-
* @returns Array of parsed objects
|
|
79
|
-
*
|
|
80
|
-
* @example
|
|
81
|
-
* ```typescript
|
|
82
|
-
* const entries = readJsonLines<MyType>('/path/to/data.jsonl');
|
|
83
|
-
* const recent = readJsonLines<MyType>('/path/to/data.jsonl', 100);
|
|
84
|
-
* ```
|
|
85
|
-
*/
|
|
86
|
-
function readJsonLines(filePath, maxLines = 1000) {
|
|
87
|
-
const lines = readLastLines(filePath, maxLines);
|
|
88
|
-
return lines.map(line => {
|
|
89
|
-
try {
|
|
90
|
-
return JSON.parse(line);
|
|
91
|
-
}
|
|
92
|
-
catch {
|
|
93
|
-
return null;
|
|
94
|
-
}
|
|
95
|
-
}).filter((entry) => entry !== null);
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Check if a file exists
|
|
99
|
-
*
|
|
100
|
-
* @param filePath Path to check
|
|
101
|
-
* @returns True if file exists
|
|
102
|
-
*/
|
|
103
|
-
function fileExists(filePath) {
|
|
104
|
-
try {
|
|
105
|
-
return fs.existsSync(filePath);
|
|
106
|
-
}
|
|
107
|
-
catch {
|
|
108
|
-
return false;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Read a JSON file safely
|
|
113
|
-
*
|
|
114
|
-
* @param filePath Path to JSON file
|
|
115
|
-
* @returns Parsed JSON object or null if error
|
|
116
|
-
*
|
|
117
|
-
* @example
|
|
118
|
-
* ```typescript
|
|
119
|
-
* const config = readJson<ConfigType>('/path/to/config.json');
|
|
120
|
-
* ```
|
|
121
|
-
*/
|
|
122
|
-
function readJson(filePath) {
|
|
123
|
-
if (!fs.existsSync(filePath)) {
|
|
124
|
-
return null;
|
|
125
|
-
}
|
|
126
|
-
try {
|
|
127
|
-
const content = fs.readFileSync(filePath, 'utf-8');
|
|
128
|
-
return JSON.parse(content);
|
|
129
|
-
}
|
|
130
|
-
catch (error) {
|
|
131
|
-
console.error(`Failed to parse JSON from ${filePath}:`, error);
|
|
132
|
-
return null;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
//# sourceMappingURL=file.js.map
|
package/dist/util/file.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file.js","sourceRoot":"","sources":["../../src/util/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gB;IACvC,IAAI,CAAC;QACD,OAAO,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IACnC,CAAC;IAAC,MAAM,CAAC;QACL,OAAO,KAAK,CAAC;IACjB,CAAC;AACL,CAAC;AAED;;;;;;;;;;GAUG;AACH,SAAgB,QAAQ,CAAU,QAAgB;IAC9C,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC3B,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,IAAI,CAAC;QACD,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACnD,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAM,CAAC;IACpC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,6BAA6B,QAAQ,GAAG,EAAE,KAAK,CAAC,CAAC;QAC/D,OAAO,IAAI,CAAC;IAChB,CAAC;AACL,CAAC"}
|
package/dist/util/process.d.ts
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Process Detection Utilities
|
|
3
|
-
*
|
|
4
|
-
* Utilities for detecting and inspecting running processes on the system.
|
|
5
|
-
* Primarily focused on macOS/Unix-like systems using the `ps` command.
|
|
6
|
-
*/
|
|
7
|
-
import type { ProcessInfo } from '@ai-devkit/agent-manager';
|
|
8
|
-
/**
|
|
9
|
-
* Options for listing processes
|
|
10
|
-
*/
|
|
11
|
-
export interface ListProcessesOptions {
|
|
12
|
-
/** Filter processes by name pattern (case-insensitive) */
|
|
13
|
-
namePattern?: string;
|
|
14
|
-
/** Include only processes matching these PIDs */
|
|
15
|
-
pids?: number[];
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* List running processes on the system
|
|
19
|
-
*
|
|
20
|
-
* @param options Filtering options
|
|
21
|
-
* @returns Array of process information
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* ```typescript
|
|
25
|
-
* // List all Claude Code processes
|
|
26
|
-
* const processes = listProcesses({ namePattern: 'claude' });
|
|
27
|
-
*
|
|
28
|
-
* // Get specific process info
|
|
29
|
-
* const process = listProcesses({ pids: [12345] });
|
|
30
|
-
* ```
|
|
31
|
-
*/
|
|
32
|
-
export declare function listProcesses(options?: ListProcessesOptions): ProcessInfo[];
|
|
33
|
-
/**
|
|
34
|
-
* Get the current working directory for a specific process
|
|
35
|
-
*
|
|
36
|
-
* @param pid Process ID
|
|
37
|
-
* @returns Working directory path, or empty string if unavailable
|
|
38
|
-
*/
|
|
39
|
-
export declare function getProcessCwd(pid: number): string;
|
|
40
|
-
/**
|
|
41
|
-
* Get the TTY device for a specific process
|
|
42
|
-
*
|
|
43
|
-
* @param pid Process ID
|
|
44
|
-
* @returns TTY device name (e.g., "ttys030"), or "?" if unavailable
|
|
45
|
-
*/
|
|
46
|
-
export declare function getProcessTty(pid: number): string;
|
|
47
|
-
/**
|
|
48
|
-
* Check if a process with the given PID is running
|
|
49
|
-
*
|
|
50
|
-
* @param pid Process ID
|
|
51
|
-
* @returns True if process is running
|
|
52
|
-
*/
|
|
53
|
-
export declare function isProcessRunning(pid: number): boolean;
|
|
54
|
-
/**
|
|
55
|
-
* Get detailed information for a specific process
|
|
56
|
-
*
|
|
57
|
-
* @param pid Process ID
|
|
58
|
-
* @returns Process information, or null if process not found
|
|
59
|
-
*/
|
|
60
|
-
export declare function getProcessInfo(pid: number): ProcessInfo | null;
|
|
61
|
-
//# sourceMappingURL=process.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"process.d.ts","sourceRoot":"","sources":["../../src/util/process.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACjC,0DAA0D;IAC1D,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,iDAAiD;IACjD,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAAC,OAAO,GAAE,oBAAyB,GAAG,WAAW,EAAE,CA2D/E;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAgCjD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAYjD;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CASrD;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAG9D"}
|
package/dist/util/process.js
DELETED
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Process Detection Utilities
|
|
4
|
-
*
|
|
5
|
-
* Utilities for detecting and inspecting running processes on the system.
|
|
6
|
-
* Primarily focused on macOS/Unix-like systems using the `ps` command.
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.listProcesses = listProcesses;
|
|
10
|
-
exports.getProcessCwd = getProcessCwd;
|
|
11
|
-
exports.getProcessTty = getProcessTty;
|
|
12
|
-
exports.isProcessRunning = isProcessRunning;
|
|
13
|
-
exports.getProcessInfo = getProcessInfo;
|
|
14
|
-
const child_process_1 = require("child_process");
|
|
15
|
-
/**
|
|
16
|
-
* List running processes on the system
|
|
17
|
-
*
|
|
18
|
-
* @param options Filtering options
|
|
19
|
-
* @returns Array of process information
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* ```typescript
|
|
23
|
-
* // List all Claude Code processes
|
|
24
|
-
* const processes = listProcesses({ namePattern: 'claude' });
|
|
25
|
-
*
|
|
26
|
-
* // Get specific process info
|
|
27
|
-
* const process = listProcesses({ pids: [12345] });
|
|
28
|
-
* ```
|
|
29
|
-
*/
|
|
30
|
-
function listProcesses(options = {}) {
|
|
31
|
-
try {
|
|
32
|
-
// Get all processes with full details
|
|
33
|
-
// Format: user pid command
|
|
34
|
-
const psOutput = (0, child_process_1.execSync)('ps aux', { encoding: 'utf-8' });
|
|
35
|
-
const lines = psOutput.trim().split('\n');
|
|
36
|
-
// Skip header line
|
|
37
|
-
const processLines = lines.slice(1);
|
|
38
|
-
const processes = [];
|
|
39
|
-
for (const line of processLines) {
|
|
40
|
-
// Parse ps aux output
|
|
41
|
-
// Format: USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
|
|
42
|
-
const parts = line.trim().split(/\s+/);
|
|
43
|
-
if (parts.length < 11)
|
|
44
|
-
continue;
|
|
45
|
-
const pid = parseInt(parts[1], 10);
|
|
46
|
-
if (isNaN(pid))
|
|
47
|
-
continue;
|
|
48
|
-
const tty = parts[6];
|
|
49
|
-
const command = parts.slice(10).join(' ');
|
|
50
|
-
// Apply PID filter
|
|
51
|
-
if (options.pids && !options.pids.includes(pid)) {
|
|
52
|
-
continue;
|
|
53
|
-
}
|
|
54
|
-
// Apply name pattern filter (case-insensitive)
|
|
55
|
-
if (options.namePattern) {
|
|
56
|
-
const pattern = options.namePattern.toLowerCase();
|
|
57
|
-
const commandLower = command.toLowerCase();
|
|
58
|
-
if (!commandLower.includes(pattern)) {
|
|
59
|
-
continue;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
// Get working directory for this process
|
|
63
|
-
const cwd = getProcessCwd(pid);
|
|
64
|
-
// Get TTY in short format (remove /dev/ prefix if present)
|
|
65
|
-
const ttyShort = tty.startsWith('/dev/') ? tty.slice(5) : tty;
|
|
66
|
-
processes.push({
|
|
67
|
-
pid,
|
|
68
|
-
command,
|
|
69
|
-
cwd,
|
|
70
|
-
tty: ttyShort,
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
return processes;
|
|
74
|
-
}
|
|
75
|
-
catch (error) {
|
|
76
|
-
// If ps command fails, return empty array
|
|
77
|
-
console.error('Failed to list processes:', error);
|
|
78
|
-
return [];
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Get the current working directory for a specific process
|
|
83
|
-
*
|
|
84
|
-
* @param pid Process ID
|
|
85
|
-
* @returns Working directory path, or empty string if unavailable
|
|
86
|
-
*/
|
|
87
|
-
function getProcessCwd(pid) {
|
|
88
|
-
try {
|
|
89
|
-
// Use lsof to get the current working directory
|
|
90
|
-
// -a: AND the selections, -d cwd: get cwd only, -Fn: output format (file names only)
|
|
91
|
-
const output = (0, child_process_1.execSync)(`lsof -a -p ${pid} -d cwd -Fn 2>/dev/null`, {
|
|
92
|
-
encoding: 'utf-8',
|
|
93
|
-
});
|
|
94
|
-
// Parse lsof output
|
|
95
|
-
// Format: p{PID}\nn{path}
|
|
96
|
-
const lines = output.trim().split('\n');
|
|
97
|
-
for (const line of lines) {
|
|
98
|
-
if (line.startsWith('n')) {
|
|
99
|
-
return line.slice(1); // Remove 'n' prefix
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
return '';
|
|
103
|
-
}
|
|
104
|
-
catch (error) {
|
|
105
|
-
// If lsof fails, try alternative method using pwdx (Linux)
|
|
106
|
-
try {
|
|
107
|
-
const output = (0, child_process_1.execSync)(`pwdx ${pid} 2>/dev/null`, {
|
|
108
|
-
encoding: 'utf-8',
|
|
109
|
-
});
|
|
110
|
-
// Format: {PID}: {path}
|
|
111
|
-
const match = output.match(/^\d+:\s*(.+)$/);
|
|
112
|
-
return match ? match[1].trim() : '';
|
|
113
|
-
}
|
|
114
|
-
catch {
|
|
115
|
-
// Both methods failed
|
|
116
|
-
return '';
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Get the TTY device for a specific process
|
|
122
|
-
*
|
|
123
|
-
* @param pid Process ID
|
|
124
|
-
* @returns TTY device name (e.g., "ttys030"), or "?" if unavailable
|
|
125
|
-
*/
|
|
126
|
-
function getProcessTty(pid) {
|
|
127
|
-
try {
|
|
128
|
-
const output = (0, child_process_1.execSync)(`ps -p ${pid} -o tty=`, {
|
|
129
|
-
encoding: 'utf-8',
|
|
130
|
-
});
|
|
131
|
-
const tty = output.trim();
|
|
132
|
-
// Remove /dev/ prefix if present
|
|
133
|
-
return tty.startsWith('/dev/') ? tty.slice(5) : tty;
|
|
134
|
-
}
|
|
135
|
-
catch (error) {
|
|
136
|
-
return '?';
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* Check if a process with the given PID is running
|
|
141
|
-
*
|
|
142
|
-
* @param pid Process ID
|
|
143
|
-
* @returns True if process is running
|
|
144
|
-
*/
|
|
145
|
-
function isProcessRunning(pid) {
|
|
146
|
-
try {
|
|
147
|
-
// Send signal 0 to check if process exists
|
|
148
|
-
// This doesn't actually send a signal, just checks if we can
|
|
149
|
-
(0, child_process_1.execSync)(`kill -0 ${pid} 2>/dev/null`);
|
|
150
|
-
return true;
|
|
151
|
-
}
|
|
152
|
-
catch {
|
|
153
|
-
return false;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Get detailed information for a specific process
|
|
158
|
-
*
|
|
159
|
-
* @param pid Process ID
|
|
160
|
-
* @returns Process information, or null if process not found
|
|
161
|
-
*/
|
|
162
|
-
function getProcessInfo(pid) {
|
|
163
|
-
const processes = listProcesses({ pids: [pid] });
|
|
164
|
-
return processes.length > 0 ? processes[0] : null;
|
|
165
|
-
}
|
|
166
|
-
//# sourceMappingURL=process.js.map
|
package/dist/util/process.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"process.js","sourceRoot":"","sources":["../../src/util/process.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AA+BH,sCA2DC;AAQD,sCAgCC;AAQD,sCAYC;AAQD,4CASC;AAQD,wCAGC;AAhLD,iDAAyC;AAczC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