@bike4mind/cli 0.2.20-github-label-crud-operation.18035 → 0.2.20-github-label-crud-operation.18051
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.
|
@@ -40,7 +40,8 @@ var CliConfigSchema = z.object({
|
|
|
40
40
|
autoSave: z.boolean(),
|
|
41
41
|
theme: z.enum(["light", "dark"]),
|
|
42
42
|
exportFormat: z.enum(["markdown", "json"]),
|
|
43
|
-
maxIterations: z.number().nullable().default(10)
|
|
43
|
+
maxIterations: z.number().nullable().default(10),
|
|
44
|
+
enableSkillTool: z.boolean().optional().default(true)
|
|
44
45
|
}),
|
|
45
46
|
tools: z.object({
|
|
46
47
|
enabled: z.array(z.string()),
|
|
@@ -70,7 +71,8 @@ var ProjectConfigSchema = z.object({
|
|
|
70
71
|
temperature: z.number().optional(),
|
|
71
72
|
autoSave: z.boolean().optional(),
|
|
72
73
|
theme: z.enum(["light", "dark"]).optional(),
|
|
73
|
-
exportFormat: z.enum(["markdown", "json"]).optional()
|
|
74
|
+
exportFormat: z.enum(["markdown", "json"]).optional(),
|
|
75
|
+
enableSkillTool: z.boolean().optional()
|
|
74
76
|
}).optional()
|
|
75
77
|
});
|
|
76
78
|
var ProjectLocalConfigSchema = z.object({
|
|
@@ -84,7 +86,8 @@ var ProjectLocalConfigSchema = z.object({
|
|
|
84
86
|
temperature: z.number().optional(),
|
|
85
87
|
autoSave: z.boolean().optional(),
|
|
86
88
|
theme: z.enum(["light", "dark"]).optional(),
|
|
87
|
-
exportFormat: z.enum(["markdown", "json"]).optional()
|
|
89
|
+
exportFormat: z.enum(["markdown", "json"]).optional(),
|
|
90
|
+
enableSkillTool: z.boolean().optional()
|
|
88
91
|
}).optional(),
|
|
89
92
|
mcpServers: z.array(
|
|
90
93
|
z.object({
|
|
@@ -111,7 +114,8 @@ var DEFAULT_CONFIG = {
|
|
|
111
114
|
autoSave: true,
|
|
112
115
|
theme: "dark",
|
|
113
116
|
exportFormat: "markdown",
|
|
114
|
-
maxIterations: 10
|
|
117
|
+
maxIterations: 10,
|
|
118
|
+
enableSkillTool: true
|
|
115
119
|
},
|
|
116
120
|
tools: {
|
|
117
121
|
enabled: [],
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from "./chunk-XIHEQATE.js";
|
|
8
8
|
import {
|
|
9
9
|
ConfigStore
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-VFQF2JIT.js";
|
|
11
11
|
import "./chunk-CBMYZAO4.js";
|
|
12
12
|
import "./chunk-KJRFGN2F.js";
|
|
13
13
|
import {
|
|
@@ -2495,9 +2495,37 @@ import os from "os";
|
|
|
2495
2495
|
// src/utils/commandParser.ts
|
|
2496
2496
|
import matter from "gray-matter";
|
|
2497
2497
|
import { z } from "zod";
|
|
2498
|
+
var flexibleString = z.union([z.string(), z.array(z.string())]).transform((val) => Array.isArray(val) ? val.join(" ") : val).optional();
|
|
2499
|
+
function needsQuoting(value) {
|
|
2500
|
+
const firstChar = value.charAt(0);
|
|
2501
|
+
const isAlreadyQuoted = firstChar === '"' || firstChar === "'";
|
|
2502
|
+
const isStructured = firstChar === "[" || firstChar === "{";
|
|
2503
|
+
const containsColon = value.includes(":");
|
|
2504
|
+
return containsColon && !isAlreadyQuoted && !isStructured;
|
|
2505
|
+
}
|
|
2506
|
+
function preprocessFrontmatter(content) {
|
|
2507
|
+
const frontmatterMatch = content.match(/^---\r?\n([\s\S]*?)\r?\n---/);
|
|
2508
|
+
if (!frontmatterMatch) return content;
|
|
2509
|
+
const frontmatter = frontmatterMatch[1];
|
|
2510
|
+
const processedLines = frontmatter.split("\n").map((line) => {
|
|
2511
|
+
const trimmedLine = line.trim();
|
|
2512
|
+
if (!trimmedLine || trimmedLine.startsWith("#")) return line;
|
|
2513
|
+
const match = line.match(/^(\s*)([a-zA-Z-_]+):\s*(.+)$/);
|
|
2514
|
+
if (!match) return line;
|
|
2515
|
+
const [, indent, key, value] = match;
|
|
2516
|
+
const trimmedValue = value.trim();
|
|
2517
|
+
if (!needsQuoting(trimmedValue)) return line;
|
|
2518
|
+
const escapedValue = trimmedValue.replace(/"/g, '\\"');
|
|
2519
|
+
return `${indent}${key}: "${escapedValue}"`;
|
|
2520
|
+
});
|
|
2521
|
+
const processedFrontmatter = processedLines.join("\n");
|
|
2522
|
+
return content.replace(/^---\r?\n[\s\S]*?\r?\n---/, `---
|
|
2523
|
+
${processedFrontmatter}
|
|
2524
|
+
---`);
|
|
2525
|
+
}
|
|
2498
2526
|
var FrontmatterSchema = z.object({
|
|
2499
|
-
description:
|
|
2500
|
-
"argument-hint":
|
|
2527
|
+
description: flexibleString,
|
|
2528
|
+
"argument-hint": flexibleString,
|
|
2501
2529
|
model: z.string().optional(),
|
|
2502
2530
|
// Agent integration fields
|
|
2503
2531
|
agent: z.string().optional(),
|
|
@@ -2521,7 +2549,8 @@ function extractDescriptionFromBody(body) {
|
|
|
2521
2549
|
}
|
|
2522
2550
|
function parseCommandFile(fileContent, filePath, commandName, source) {
|
|
2523
2551
|
try {
|
|
2524
|
-
const
|
|
2552
|
+
const processedContent = preprocessFrontmatter(fileContent);
|
|
2553
|
+
const { data: frontmatter, content: body } = matter(processedContent);
|
|
2525
2554
|
const validationResult = FrontmatterSchema.safeParse(frontmatter);
|
|
2526
2555
|
if (!validationResult.success) {
|
|
2527
2556
|
console.warn(
|
|
@@ -2571,17 +2600,32 @@ function extractCommandName(filename) {
|
|
|
2571
2600
|
var CustomCommandStore = class {
|
|
2572
2601
|
constructor(projectRoot) {
|
|
2573
2602
|
this.commands = /* @__PURE__ */ new Map();
|
|
2574
|
-
|
|
2575
|
-
|
|
2603
|
+
const home = os.homedir();
|
|
2604
|
+
const root = projectRoot || process.cwd();
|
|
2605
|
+
this.globalCommandsDirs = [
|
|
2606
|
+
path5.join(home, ".bike4mind", "commands"),
|
|
2607
|
+
path5.join(home, ".claude", "commands"),
|
|
2608
|
+
path5.join(home, ".claude", "skills")
|
|
2609
|
+
];
|
|
2610
|
+
this.projectCommandsDirs = [
|
|
2611
|
+
path5.join(root, ".bike4mind", "commands"),
|
|
2612
|
+
path5.join(root, ".claude", "commands"),
|
|
2613
|
+
path5.join(root, ".claude", "skills")
|
|
2614
|
+
];
|
|
2576
2615
|
}
|
|
2577
2616
|
/**
|
|
2578
2617
|
* Loads all custom commands from both global and project directories
|
|
2579
2618
|
* Project commands override global commands with the same name
|
|
2619
|
+
* Later directories in each category override earlier ones with same name
|
|
2580
2620
|
*/
|
|
2581
2621
|
async loadCommands() {
|
|
2582
2622
|
this.commands.clear();
|
|
2583
|
-
|
|
2584
|
-
|
|
2623
|
+
for (const dir of this.globalCommandsDirs) {
|
|
2624
|
+
await this.loadCommandsFromDirectory(dir, "global");
|
|
2625
|
+
}
|
|
2626
|
+
for (const dir of this.projectCommandsDirs) {
|
|
2627
|
+
await this.loadCommandsFromDirectory(dir, "project");
|
|
2628
|
+
}
|
|
2585
2629
|
}
|
|
2586
2630
|
/**
|
|
2587
2631
|
* Recursively scans a directory for .md files and loads them as commands
|
|
@@ -2647,19 +2691,27 @@ var CustomCommandStore = class {
|
|
|
2647
2691
|
*/
|
|
2648
2692
|
async loadCommandFile(filePath, source) {
|
|
2649
2693
|
const filename = path5.basename(filePath);
|
|
2650
|
-
const
|
|
2694
|
+
const isSkillFile = filename.toLowerCase() === "skill.md";
|
|
2695
|
+
const commandName = isSkillFile ? this.extractSkillName(filePath) : extractCommandName(filename);
|
|
2651
2696
|
if (!commandName) {
|
|
2652
2697
|
console.warn(`Invalid command filename: ${filename} (must end with .md and have valid name)`);
|
|
2653
2698
|
return;
|
|
2654
2699
|
}
|
|
2655
2700
|
const fileContent = await fs5.readFile(filePath, "utf-8");
|
|
2656
2701
|
const command = parseCommandFile(fileContent, filePath, commandName, source);
|
|
2657
|
-
const existing = this.commands.get(commandName);
|
|
2658
|
-
if (existing && existing.source === "project" && source === "global") {
|
|
2659
|
-
return;
|
|
2660
|
-
}
|
|
2661
2702
|
this.commands.set(commandName, command);
|
|
2662
2703
|
}
|
|
2704
|
+
/**
|
|
2705
|
+
* Extracts skill name from a SKILL.md file path
|
|
2706
|
+
* Uses the parent directory name as the skill name
|
|
2707
|
+
*
|
|
2708
|
+
* @param filePath - Full path to the SKILL.md file
|
|
2709
|
+
* @returns Skill name or null if invalid
|
|
2710
|
+
*/
|
|
2711
|
+
extractSkillName(filePath) {
|
|
2712
|
+
const parentDir = path5.basename(path5.dirname(filePath));
|
|
2713
|
+
return parentDir && parentDir !== "skills" ? parentDir : null;
|
|
2714
|
+
}
|
|
2663
2715
|
/**
|
|
2664
2716
|
* Gets a command by name
|
|
2665
2717
|
*
|
|
@@ -2718,15 +2770,14 @@ var CustomCommandStore = class {
|
|
|
2718
2770
|
* @returns Path to the created file
|
|
2719
2771
|
*/
|
|
2720
2772
|
async createCommandFile(name, isGlobal = false) {
|
|
2721
|
-
const targetDir = isGlobal ? this.
|
|
2773
|
+
const targetDir = isGlobal ? this.globalCommandsDirs[0] : this.projectCommandsDirs[0];
|
|
2722
2774
|
const filePath = path5.join(targetDir, `${name}.md`);
|
|
2723
|
-
|
|
2724
|
-
|
|
2775
|
+
const fileExists = await fs5.access(filePath).then(
|
|
2776
|
+
() => true,
|
|
2777
|
+
() => false
|
|
2778
|
+
);
|
|
2779
|
+
if (fileExists) {
|
|
2725
2780
|
throw new Error(`Command file already exists: ${filePath}`);
|
|
2726
|
-
} catch (error) {
|
|
2727
|
-
if (error.code !== "ENOENT") {
|
|
2728
|
-
throw error;
|
|
2729
|
-
}
|
|
2730
2781
|
}
|
|
2731
2782
|
await fs5.mkdir(targetDir, { recursive: true });
|
|
2732
2783
|
const template = `---
|
|
@@ -5421,7 +5472,7 @@ var imageGenerationTool = {
|
|
|
5421
5472
|
},
|
|
5422
5473
|
toolSchema: {
|
|
5423
5474
|
name: "image_generation",
|
|
5424
|
-
description: "
|
|
5475
|
+
description: '\u{1F3A8} IMAGE GENERATION TOOL: Use this tool when user wants to create, generate, draw, paint, or make an image/picture/illustration/artwork. ALWAYS use this for phrases like "generate an image", "create a picture", "draw me", "make an image of", "illustrate", "show me a picture of". This tool creates AI-generated images from text descriptions. DO NOT use blog_draft or other tools for image generation requests.',
|
|
5425
5476
|
parameters: {
|
|
5426
5477
|
type: "object",
|
|
5427
5478
|
properties: {
|
|
@@ -11922,7 +11973,7 @@ import { isAxiosError as isAxiosError2 } from "axios";
|
|
|
11922
11973
|
// package.json
|
|
11923
11974
|
var package_default = {
|
|
11924
11975
|
name: "@bike4mind/cli",
|
|
11925
|
-
version: "0.2.20-github-label-crud-operation.
|
|
11976
|
+
version: "0.2.20-github-label-crud-operation.18051+a15de3c31",
|
|
11926
11977
|
type: "module",
|
|
11927
11978
|
description: "Interactive CLI tool for Bike4Mind with ReAct agents",
|
|
11928
11979
|
license: "UNLICENSED",
|
|
@@ -12029,10 +12080,10 @@ var package_default = {
|
|
|
12029
12080
|
},
|
|
12030
12081
|
devDependencies: {
|
|
12031
12082
|
"@bike4mind/agents": "0.1.0",
|
|
12032
|
-
"@bike4mind/common": "2.44.1-github-label-crud-operation.
|
|
12033
|
-
"@bike4mind/mcp": "1.24.1-github-label-crud-operation.
|
|
12034
|
-
"@bike4mind/services": "2.42.1-github-label-crud-operation.
|
|
12035
|
-
"@bike4mind/utils": "2.2.2-github-label-crud-operation.
|
|
12083
|
+
"@bike4mind/common": "2.44.1-github-label-crud-operation.18051+a15de3c31",
|
|
12084
|
+
"@bike4mind/mcp": "1.24.1-github-label-crud-operation.18051+a15de3c31",
|
|
12085
|
+
"@bike4mind/services": "2.42.1-github-label-crud-operation.18051+a15de3c31",
|
|
12086
|
+
"@bike4mind/utils": "2.2.2-github-label-crud-operation.18051+a15de3c31",
|
|
12036
12087
|
"@types/better-sqlite3": "^7.6.13",
|
|
12037
12088
|
"@types/diff": "^5.0.9",
|
|
12038
12089
|
"@types/jsonwebtoken": "^9.0.4",
|
|
@@ -12049,7 +12100,7 @@ var package_default = {
|
|
|
12049
12100
|
optionalDependencies: {
|
|
12050
12101
|
"@vscode/ripgrep": "^1.17.0"
|
|
12051
12102
|
},
|
|
12052
|
-
gitHead: "
|
|
12103
|
+
gitHead: "a15de3c31aa09b4a09d64f83c96b9a407d0c0eab"
|
|
12053
12104
|
};
|
|
12054
12105
|
|
|
12055
12106
|
// src/config/constants.ts
|
|
@@ -12715,6 +12766,134 @@ function createTodoStore(onUpdate) {
|
|
|
12715
12766
|
};
|
|
12716
12767
|
}
|
|
12717
12768
|
|
|
12769
|
+
// src/tools/skillTool.ts
|
|
12770
|
+
function parseArguments(argsString) {
|
|
12771
|
+
const args = [];
|
|
12772
|
+
let current = "";
|
|
12773
|
+
let inQuotes = false;
|
|
12774
|
+
let quoteChar = "";
|
|
12775
|
+
for (let i = 0; i < argsString.length; i++) {
|
|
12776
|
+
const char = argsString[i];
|
|
12777
|
+
if (!inQuotes && (char === '"' || char === "'")) {
|
|
12778
|
+
inQuotes = true;
|
|
12779
|
+
quoteChar = char;
|
|
12780
|
+
} else if (inQuotes && char === quoteChar) {
|
|
12781
|
+
inQuotes = false;
|
|
12782
|
+
quoteChar = "";
|
|
12783
|
+
} else if (!inQuotes && char === " ") {
|
|
12784
|
+
if (current.length > 0) {
|
|
12785
|
+
args.push(current);
|
|
12786
|
+
current = "";
|
|
12787
|
+
}
|
|
12788
|
+
} else {
|
|
12789
|
+
current += char;
|
|
12790
|
+
}
|
|
12791
|
+
}
|
|
12792
|
+
if (current.length > 0) {
|
|
12793
|
+
args.push(current);
|
|
12794
|
+
}
|
|
12795
|
+
return args;
|
|
12796
|
+
}
|
|
12797
|
+
function createSkillTool(customCommandStore) {
|
|
12798
|
+
return {
|
|
12799
|
+
toolFn: async (args) => {
|
|
12800
|
+
const params = args;
|
|
12801
|
+
if (!params.skill || typeof params.skill !== "string") {
|
|
12802
|
+
throw new Error("skill: skill parameter is required");
|
|
12803
|
+
}
|
|
12804
|
+
const skillName = params.skill.replace(/^\//, "");
|
|
12805
|
+
const command = customCommandStore.getCommand(skillName);
|
|
12806
|
+
if (!command) {
|
|
12807
|
+
const available = customCommandStore.getAllCommands().map((c) => c.name).join(", ");
|
|
12808
|
+
throw new Error(`skill: "${skillName}" not found. Available skills: ${available || "none"}`);
|
|
12809
|
+
}
|
|
12810
|
+
const argsArray = params.args ? parseArguments(params.args) : [];
|
|
12811
|
+
let expandedBody = substituteArguments(command.body, argsArray);
|
|
12812
|
+
const processed = await processFileReferences(expandedBody);
|
|
12813
|
+
expandedBody = processed.content;
|
|
12814
|
+
if (processed.errors.length > 0) {
|
|
12815
|
+
expandedBody += `
|
|
12816
|
+
|
|
12817
|
+
**File reference errors:**
|
|
12818
|
+
${processed.errors.map((e) => `- ${e}`).join("\n")}`;
|
|
12819
|
+
}
|
|
12820
|
+
return `## Skill Loaded: /${skillName}
|
|
12821
|
+
|
|
12822
|
+
${expandedBody}
|
|
12823
|
+
|
|
12824
|
+
---
|
|
12825
|
+
*Follow the instructions above. This skill was invoked programmatically.*`;
|
|
12826
|
+
},
|
|
12827
|
+
toolSchema: {
|
|
12828
|
+
name: "skill",
|
|
12829
|
+
description: `Execute a skill (custom slash command) within the conversation.
|
|
12830
|
+
|
|
12831
|
+
**When to use this tool:**
|
|
12832
|
+
- When a user asks you to use a skill by name (e.g., "use the review-pr skill")
|
|
12833
|
+
- When a skill would help accomplish the user's request
|
|
12834
|
+
- When you see /<skill-name> syntax in user messages
|
|
12835
|
+
|
|
12836
|
+
**How it works:**
|
|
12837
|
+
1. Skills are loaded from markdown files in .bike4mind/commands/
|
|
12838
|
+
2. The skill template is expanded with argument substitution ($1, $2, $ARGUMENTS)
|
|
12839
|
+
3. File references (@filename) are resolved and content is injected
|
|
12840
|
+
4. The expanded template is returned for you to follow
|
|
12841
|
+
|
|
12842
|
+
**Example invocations:**
|
|
12843
|
+
- skill({ skill: "commit" }) - invoke commit skill
|
|
12844
|
+
- skill({ skill: "review-pr", args: "123" }) - review PR #123
|
|
12845
|
+
- skill({ skill: "feature-code-map", args: "authentication" }) - generate code map
|
|
12846
|
+
|
|
12847
|
+
**Important:**
|
|
12848
|
+
- Skill names can be with or without leading slash: "commit" or "/commit"
|
|
12849
|
+
- Arguments are space-separated; use quotes for arguments with spaces
|
|
12850
|
+
- The tool returns instructions to follow, not a final answer`,
|
|
12851
|
+
parameters: {
|
|
12852
|
+
type: "object",
|
|
12853
|
+
properties: {
|
|
12854
|
+
skill: {
|
|
12855
|
+
type: "string",
|
|
12856
|
+
description: 'Name of the skill to invoke (e.g., "commit", "review-pr")'
|
|
12857
|
+
},
|
|
12858
|
+
args: {
|
|
12859
|
+
type: "string",
|
|
12860
|
+
description: `Optional arguments as space-separated string. Use quotes for arguments containing spaces (e.g., '123 "bug fix"').`
|
|
12861
|
+
}
|
|
12862
|
+
},
|
|
12863
|
+
required: ["skill"]
|
|
12864
|
+
}
|
|
12865
|
+
}
|
|
12866
|
+
};
|
|
12867
|
+
}
|
|
12868
|
+
|
|
12869
|
+
// src/core/skillsPrompt.ts
|
|
12870
|
+
function formatSkillEntry(cmd) {
|
|
12871
|
+
const argHint = cmd.argumentHint ? ` ${cmd.argumentHint}` : "";
|
|
12872
|
+
return `- **${cmd.name}**${argHint}: ${cmd.description}
|
|
12873
|
+
`;
|
|
12874
|
+
}
|
|
12875
|
+
function formatSkillGroup(heading, commands) {
|
|
12876
|
+
if (commands.length === 0) {
|
|
12877
|
+
return "";
|
|
12878
|
+
}
|
|
12879
|
+
return `
|
|
12880
|
+
### ${heading}
|
|
12881
|
+
${commands.map(formatSkillEntry).join("")}`;
|
|
12882
|
+
}
|
|
12883
|
+
function buildSkillsPromptSection(commands) {
|
|
12884
|
+
if (commands.length === 0) {
|
|
12885
|
+
return "";
|
|
12886
|
+
}
|
|
12887
|
+
const projectSkills = commands.filter((c) => c.source === "project");
|
|
12888
|
+
const globalSkills = commands.filter((c) => c.source === "global");
|
|
12889
|
+
return `
|
|
12890
|
+
|
|
12891
|
+
## Available Skills
|
|
12892
|
+
|
|
12893
|
+
Use the \`skill\` tool to invoke these. Example: skill({ skill: "commit" })
|
|
12894
|
+
` + formatSkillGroup("Project Skills", projectSkills) + formatSkillGroup("Global Skills", globalSkills);
|
|
12895
|
+
}
|
|
12896
|
+
|
|
12718
12897
|
// src/index.tsx
|
|
12719
12898
|
process.removeAllListeners("warning");
|
|
12720
12899
|
process.on("warning", (warning) => {
|
|
@@ -13000,9 +13179,23 @@ function CliApp() {
|
|
|
13000
13179
|
const agentDelegateTool = createAgentDelegateTool(orchestrator, agentStore, newSession.id);
|
|
13001
13180
|
const todoStore = createTodoStore();
|
|
13002
13181
|
const writeTodosTool = createWriteTodosTool(todoStore);
|
|
13003
|
-
const
|
|
13182
|
+
const enableSkillTool = config.preferences.enableSkillTool !== false;
|
|
13183
|
+
const skillTool = enableSkillTool ? createSkillTool(state.customCommandStore) : null;
|
|
13184
|
+
const cliTools = [agentDelegateTool, writeTodosTool];
|
|
13185
|
+
if (skillTool) {
|
|
13186
|
+
cliTools.push(skillTool);
|
|
13187
|
+
}
|
|
13188
|
+
const allTools = [...b4mTools, ...mcpTools, ...cliTools];
|
|
13189
|
+
console.log(`\u{1F4C2} Working directory: ${process.cwd()}`);
|
|
13190
|
+
console.log(`\u{1F916} Subagent delegation enabled (explore, plan, review)`);
|
|
13191
|
+
if (skillTool) {
|
|
13192
|
+
const skillCount = state.customCommandStore.getCommandCount();
|
|
13193
|
+
if (skillCount > 0) {
|
|
13194
|
+
console.log(`\u{1F6E0}\uFE0F Skill tool enabled (${skillCount} skills available)`);
|
|
13195
|
+
}
|
|
13196
|
+
}
|
|
13004
13197
|
logger.debug(
|
|
13005
|
-
`Total tools available to agent: ${allTools.length} (${b4mTools.length} B4M + ${mcpTools.length} MCP +
|
|
13198
|
+
`Total tools available to agent: ${allTools.length} (${b4mTools.length} B4M + ${mcpTools.length} MCP + ${cliTools.length} CLI)`
|
|
13006
13199
|
);
|
|
13007
13200
|
const projectDir = state.configStore.getProjectConfigDir();
|
|
13008
13201
|
const contextResult = await loadContextFiles(projectDir);
|
|
@@ -13015,13 +13208,17 @@ function CliApp() {
|
|
|
13015
13208
|
for (const error of contextResult.errors) {
|
|
13016
13209
|
console.log(`\u26A0\uFE0F Context file error: ${error}`);
|
|
13017
13210
|
}
|
|
13018
|
-
|
|
13211
|
+
let contextSection = contextResult.mergedContent ? `
|
|
13019
13212
|
|
|
13020
13213
|
## Project Context
|
|
13021
13214
|
|
|
13022
13215
|
Follow these project-specific instructions:
|
|
13023
13216
|
|
|
13024
13217
|
${contextResult.mergedContent}` : "";
|
|
13218
|
+
if (enableSkillTool) {
|
|
13219
|
+
const commands = state.customCommandStore.getAllCommands();
|
|
13220
|
+
contextSection += buildSkillsPromptSection(commands);
|
|
13221
|
+
}
|
|
13025
13222
|
const cliSystemPrompt = buildCoreSystemPrompt(contextSection);
|
|
13026
13223
|
const maxIterations = config.preferences.maxIterations === null ? 999999 : config.preferences.maxIterations;
|
|
13027
13224
|
const agent = new ReActAgent({
|
|
@@ -14130,11 +14327,19 @@ No usage data available for the last ${USAGE_DAYS} days.`);
|
|
|
14130
14327
|
console.log(" \u{1F3E0} Global: ~/.bike4mind/commands/ (available in all projects)");
|
|
14131
14328
|
console.log(" \u{1F4C1} Project: .bike4mind/commands/ (team-shared, committed to git)");
|
|
14132
14329
|
} else {
|
|
14330
|
+
const termWidth = process.stdout.columns || 80;
|
|
14331
|
+
const truncateDescription = (desc, prefixLen) => {
|
|
14332
|
+
const maxDescLen = termWidth - prefixLen - 5;
|
|
14333
|
+
if (maxDescLen < 20) return desc;
|
|
14334
|
+
return desc.length > maxDescLen ? desc.slice(0, maxDescLen) + "..." : desc;
|
|
14335
|
+
};
|
|
14133
14336
|
if (globalCommands.length > 0) {
|
|
14134
14337
|
console.log("\u{1F3E0} Global Commands (~/.bike4mind/commands/):");
|
|
14135
14338
|
globalCommands.forEach((cmd) => {
|
|
14136
14339
|
const argHint = cmd.argumentHint ? ` ${cmd.argumentHint}` : "";
|
|
14137
|
-
|
|
14340
|
+
const prefix = ` /${cmd.name}${argHint}`;
|
|
14341
|
+
const desc = truncateDescription(cmd.description, prefix.length);
|
|
14342
|
+
console.log(`${prefix} - ${desc}`);
|
|
14138
14343
|
});
|
|
14139
14344
|
console.log("");
|
|
14140
14345
|
}
|
|
@@ -14142,7 +14347,9 @@ No usage data available for the last ${USAGE_DAYS} days.`);
|
|
|
14142
14347
|
console.log("\u{1F4C1} Project Commands (.bike4mind/commands/):");
|
|
14143
14348
|
projectCommands.forEach((cmd) => {
|
|
14144
14349
|
const argHint = cmd.argumentHint ? ` ${cmd.argumentHint}` : "";
|
|
14145
|
-
|
|
14350
|
+
const prefix = ` /${cmd.name}${argHint}`;
|
|
14351
|
+
const desc = truncateDescription(cmd.description, prefix.length);
|
|
14352
|
+
console.log(`${prefix} - ${desc}`);
|
|
14146
14353
|
});
|
|
14147
14354
|
console.log("");
|
|
14148
14355
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bike4mind/cli",
|
|
3
|
-
"version": "0.2.20-github-label-crud-operation.
|
|
3
|
+
"version": "0.2.20-github-label-crud-operation.18051+a15de3c31",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Interactive CLI tool for Bike4Mind with ReAct agents",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -107,10 +107,10 @@
|
|
|
107
107
|
},
|
|
108
108
|
"devDependencies": {
|
|
109
109
|
"@bike4mind/agents": "0.1.0",
|
|
110
|
-
"@bike4mind/common": "2.44.1-github-label-crud-operation.
|
|
111
|
-
"@bike4mind/mcp": "1.24.1-github-label-crud-operation.
|
|
112
|
-
"@bike4mind/services": "2.42.1-github-label-crud-operation.
|
|
113
|
-
"@bike4mind/utils": "2.2.2-github-label-crud-operation.
|
|
110
|
+
"@bike4mind/common": "2.44.1-github-label-crud-operation.18051+a15de3c31",
|
|
111
|
+
"@bike4mind/mcp": "1.24.1-github-label-crud-operation.18051+a15de3c31",
|
|
112
|
+
"@bike4mind/services": "2.42.1-github-label-crud-operation.18051+a15de3c31",
|
|
113
|
+
"@bike4mind/utils": "2.2.2-github-label-crud-operation.18051+a15de3c31",
|
|
114
114
|
"@types/better-sqlite3": "^7.6.13",
|
|
115
115
|
"@types/diff": "^5.0.9",
|
|
116
116
|
"@types/jsonwebtoken": "^9.0.4",
|
|
@@ -127,5 +127,5 @@
|
|
|
127
127
|
"optionalDependencies": {
|
|
128
128
|
"@vscode/ripgrep": "^1.17.0"
|
|
129
129
|
},
|
|
130
|
-
"gitHead": "
|
|
130
|
+
"gitHead": "a15de3c31aa09b4a09d64f83c96b9a407d0c0eab"
|
|
131
131
|
}
|