@tdsoft-tech/aikit 0.1.4 → 0.1.5
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/CHANGELOG.md +5 -0
- package/dist/cli.js +64 -16
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +10 -2
- package/dist/index.js +55 -8
- package/dist/index.js.map +1 -1
- package/dist/mcp-server.js +3 -6
- package/dist/mcp-server.js.map +1 -1
- package/package.json +1 -2
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,11 @@
|
|
|
9
9
|
- Tự động extract tất cả design tokens
|
|
10
10
|
- Tự động lưu vào memory/research/figma-analysis.md
|
|
11
11
|
|
|
12
|
+
### Fixed
|
|
13
|
+
- 🐛 Fix `aikit init` không tạo directory `.beads` khi install từ npm
|
|
14
|
+
- Thêm method `initLocal()` để tạo `.beads` directory ngay cả khi beads CLI không được cài global
|
|
15
|
+
- Tự động tạo README.md trong `.beads` directory hướng dẫn sử dụng
|
|
16
|
+
|
|
12
17
|
### Improved
|
|
13
18
|
- 🔄 Cải thiện OpenCode integration - tự động generate commands từ skills và commands
|
|
14
19
|
- 📚 Thêm documentation chi tiết:
|
package/dist/cli.js
CHANGED
|
@@ -179,10 +179,8 @@ var init_figma_mcp = __esm({
|
|
|
179
179
|
init_logger();
|
|
180
180
|
FigmaMcpClient = class {
|
|
181
181
|
apiKey;
|
|
182
|
-
|
|
183
|
-
constructor(apiKey, configManager) {
|
|
182
|
+
constructor(apiKey, _configManager) {
|
|
184
183
|
this.apiKey = apiKey;
|
|
185
|
-
this.configManager = configManager;
|
|
186
184
|
}
|
|
187
185
|
/**
|
|
188
186
|
* Fetch helper with simple retry/backoff for 429/5xx
|
|
@@ -328,7 +326,6 @@ ${text}`);
|
|
|
328
326
|
if (fill.type === "SOLID" && fill.color) {
|
|
329
327
|
const { r, g, b, a } = fill.color;
|
|
330
328
|
const hex = this.rgbaToHex(r, g, b, a);
|
|
331
|
-
const name = node.name || "Color";
|
|
332
329
|
if (!colorMap.has(hex)) {
|
|
333
330
|
colorMap.set(hex, hex);
|
|
334
331
|
}
|
|
@@ -800,8 +797,8 @@ var init_memory = __esm({
|
|
|
800
797
|
const subDir = type === "observation" ? "observations" : type === "handoff" ? "handoffs" : type === "research" ? "research" : "";
|
|
801
798
|
filePath = join7(memoryPath, subDir, `${key}.md`);
|
|
802
799
|
}
|
|
803
|
-
const { dirname
|
|
804
|
-
await mkdir4(
|
|
800
|
+
const { dirname } = await import("path");
|
|
801
|
+
await mkdir4(dirname(filePath), { recursive: true });
|
|
805
802
|
if (options?.append) {
|
|
806
803
|
try {
|
|
807
804
|
const existing = await readFile5(filePath, "utf-8");
|
|
@@ -3764,7 +3761,19 @@ var BeadsIntegration = class {
|
|
|
3764
3761
|
}
|
|
3765
3762
|
}
|
|
3766
3763
|
/**
|
|
3767
|
-
*
|
|
3764
|
+
* Install Beads CLI globally
|
|
3765
|
+
*/
|
|
3766
|
+
async install() {
|
|
3767
|
+
try {
|
|
3768
|
+
await execAsync("npm install -g beads");
|
|
3769
|
+
return true;
|
|
3770
|
+
} catch (error) {
|
|
3771
|
+
logger.error("Failed to install Beads CLI:", error);
|
|
3772
|
+
return false;
|
|
3773
|
+
}
|
|
3774
|
+
}
|
|
3775
|
+
/**
|
|
3776
|
+
* Initialize Beads in project using bd CLI
|
|
3768
3777
|
*/
|
|
3769
3778
|
async init() {
|
|
3770
3779
|
try {
|
|
@@ -3776,6 +3785,44 @@ var BeadsIntegration = class {
|
|
|
3776
3785
|
return false;
|
|
3777
3786
|
}
|
|
3778
3787
|
}
|
|
3788
|
+
/**
|
|
3789
|
+
* Initialize local .beads directory (works without global beads CLI)
|
|
3790
|
+
*/
|
|
3791
|
+
async initLocal() {
|
|
3792
|
+
try {
|
|
3793
|
+
const beadsDir = paths.beadsDir(this.projectPath);
|
|
3794
|
+
await mkdir7(beadsDir, { recursive: true });
|
|
3795
|
+
const readmeContent = `# Beads - Task Tracking
|
|
3796
|
+
|
|
3797
|
+
This directory contains task beads for tracking work items.
|
|
3798
|
+
|
|
3799
|
+
## How it works
|
|
3800
|
+
- Each file is a task bead (bead-001.md, bead-002.md, etc.)
|
|
3801
|
+
- Status: todo, in-progress, completed, blocked
|
|
3802
|
+
- Use \`/create\` command to create new tasks
|
|
3803
|
+
- Use \`/finish\` command to complete tasks with quality gates
|
|
3804
|
+
|
|
3805
|
+
## Beads CLI
|
|
3806
|
+
For full functionality, install beads globally:
|
|
3807
|
+
\`\`\`bash
|
|
3808
|
+
npm install -g beads
|
|
3809
|
+
bd init
|
|
3810
|
+
\`\`\`
|
|
3811
|
+
|
|
3812
|
+
## Available Commands
|
|
3813
|
+
- \`bd ready\` - Show available work
|
|
3814
|
+
- \`bd show <id>\` - View task details
|
|
3815
|
+
- \`bd update <id> --status in_progress\` - Update task status
|
|
3816
|
+
- \`bd close <id>\` - Complete task
|
|
3817
|
+
- \`bd sync\` - Sync with git
|
|
3818
|
+
`;
|
|
3819
|
+
await writeFile7(join10(beadsDir, "README.md"), readmeContent);
|
|
3820
|
+
return true;
|
|
3821
|
+
} catch (error) {
|
|
3822
|
+
logger.error("Failed to initialize .beads directory:", error);
|
|
3823
|
+
return false;
|
|
3824
|
+
}
|
|
3825
|
+
}
|
|
3779
3826
|
/**
|
|
3780
3827
|
* Get current status
|
|
3781
3828
|
*/
|
|
@@ -4020,7 +4067,7 @@ init_logger();
|
|
|
4020
4067
|
// src/index.ts
|
|
4021
4068
|
init_logger();
|
|
4022
4069
|
init_paths();
|
|
4023
|
-
var VERSION = "0.1.
|
|
4070
|
+
var VERSION = "0.1.0";
|
|
4024
4071
|
|
|
4025
4072
|
// src/cli.ts
|
|
4026
4073
|
init_memory();
|
|
@@ -4044,12 +4091,13 @@ program.command("init").description("Initialize AIKit configuration").option("-g
|
|
|
4044
4091
|
}
|
|
4045
4092
|
const beads = new BeadsIntegration();
|
|
4046
4093
|
const beadsStatus = await beads.getStatus();
|
|
4047
|
-
if (!beadsStatus.
|
|
4048
|
-
logger.
|
|
4049
|
-
|
|
4050
|
-
logger.
|
|
4051
|
-
|
|
4052
|
-
|
|
4094
|
+
if (!beadsStatus.initialized) {
|
|
4095
|
+
logger.info("Initializing .beads directory...");
|
|
4096
|
+
await beads.initLocal();
|
|
4097
|
+
logger.success("\u2713 .beads directory created");
|
|
4098
|
+
if (!beadsStatus.installed) {
|
|
4099
|
+
logger.info("Tip: Install Beads CLI globally for full functionality: npm install -g beads");
|
|
4100
|
+
}
|
|
4053
4101
|
} else {
|
|
4054
4102
|
logger.info("Beads already initialized");
|
|
4055
4103
|
}
|
|
@@ -4463,9 +4511,9 @@ async function configureMcpServer(projectPath) {
|
|
|
4463
4511
|
const { existsSync: existsSync4 } = await import("fs");
|
|
4464
4512
|
const { homedir: homedir2 } = await import("os");
|
|
4465
4513
|
const { fileURLToPath: fileURLToPath2 } = await import("url");
|
|
4466
|
-
const { dirname
|
|
4514
|
+
const { dirname } = await import("path");
|
|
4467
4515
|
const currentFile = fileURLToPath2(import.meta.url);
|
|
4468
|
-
const currentDir =
|
|
4516
|
+
const currentDir = dirname(currentFile);
|
|
4469
4517
|
const aikitPath = join12(currentDir, "..");
|
|
4470
4518
|
const mcpServerPath = join12(aikitPath, "dist", "mcp-server.js");
|
|
4471
4519
|
const configLocations = [
|