@reconcrap/boss-recommend-mcp 1.3.29 → 1.3.30
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 +1 -0
- package/package.json +1 -1
- package/src/cli.js +87 -0
package/README.md
CHANGED
|
@@ -68,6 +68,7 @@ MCP 工具:
|
|
|
68
68
|
- 在真正开始 search/screen 前,会进行最后一轮全参数总确认(岗位 + 全部筛选参数 + criteria + target_count + post_action + max_greet_count)
|
|
69
69
|
- npm 全局安装后会自动执行 install:生成 skill、导出 MCP 模板,并自动尝试写入已检测到的外部 agent MCP 配置(含 Trae / trae-cn / Cursor / Claude / OpenClaw)
|
|
70
70
|
- npm / npx 安装后会自动初始化 `screening-config.json` 模板(优先写入 workspace 的 `config/`,不可写时回退到用户目录)
|
|
71
|
+
- npm 安装流程会预创建运行目录(跨平台):`~/.boss-recommend-mcp`、`~/.boss-recommend-mcp/runs`、`<workspace>/.boss-chat` 及其 `logs/runs/profiles/reports/artifacts`
|
|
71
72
|
- `post_action` 必须在每次完整运行开始时确认一次
|
|
72
73
|
- `target_count` 会在每次运行开始时询问一次(可留空,不设上限)
|
|
73
74
|
- 当 `post_action=greet` 时,必须在运行开始时确认 `max_greet_count`
|
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -742,6 +742,70 @@ function ensureUserConfig(options = {}) {
|
|
|
742
742
|
throw lastError || new Error("No writable target for screening-config.json");
|
|
743
743
|
}
|
|
744
744
|
|
|
745
|
+
function getBossChatDataDir(workspaceRoot) {
|
|
746
|
+
return path.join(path.resolve(String(workspaceRoot || process.cwd())), ".boss-chat");
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
function collectRuntimeDirectories(options = {}) {
|
|
750
|
+
const workspaceRoot = getWorkspaceRoot(options);
|
|
751
|
+
const stateHome = getStateHome();
|
|
752
|
+
const bossChatRoot = getBossChatDataDir(workspaceRoot);
|
|
753
|
+
const recommendRuntimeDirs = [
|
|
754
|
+
stateHome,
|
|
755
|
+
path.join(stateHome, "runs")
|
|
756
|
+
];
|
|
757
|
+
const bossChatRuntimeDirs = [
|
|
758
|
+
bossChatRoot,
|
|
759
|
+
path.join(bossChatRoot, "logs"),
|
|
760
|
+
path.join(bossChatRoot, "runs"),
|
|
761
|
+
path.join(bossChatRoot, "profiles"),
|
|
762
|
+
path.join(bossChatRoot, "reports"),
|
|
763
|
+
path.join(bossChatRoot, "artifacts")
|
|
764
|
+
];
|
|
765
|
+
return {
|
|
766
|
+
workspaceRoot,
|
|
767
|
+
stateHome,
|
|
768
|
+
bossChatRoot,
|
|
769
|
+
directories: dedupePaths([
|
|
770
|
+
...recommendRuntimeDirs,
|
|
771
|
+
...bossChatRuntimeDirs
|
|
772
|
+
]).filter(Boolean)
|
|
773
|
+
};
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
function ensureRuntimeDirectories(options = {}) {
|
|
777
|
+
const { workspaceRoot, stateHome, bossChatRoot, directories } = collectRuntimeDirectories(options);
|
|
778
|
+
const created = [];
|
|
779
|
+
const existed = [];
|
|
780
|
+
const failed = [];
|
|
781
|
+
|
|
782
|
+
for (const directory of directories) {
|
|
783
|
+
try {
|
|
784
|
+
const existedBefore = fs.existsSync(directory);
|
|
785
|
+
ensureDir(directory);
|
|
786
|
+
if (existedBefore) {
|
|
787
|
+
existed.push(directory);
|
|
788
|
+
} else {
|
|
789
|
+
created.push(directory);
|
|
790
|
+
}
|
|
791
|
+
} catch (error) {
|
|
792
|
+
failed.push({
|
|
793
|
+
path: directory,
|
|
794
|
+
message: error?.message || String(error)
|
|
795
|
+
});
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
return {
|
|
800
|
+
workspaceRoot,
|
|
801
|
+
stateHome,
|
|
802
|
+
bossChatRoot,
|
|
803
|
+
created,
|
|
804
|
+
existed,
|
|
805
|
+
failed
|
|
806
|
+
};
|
|
807
|
+
}
|
|
808
|
+
|
|
745
809
|
function readJsonObjectFile(filePath) {
|
|
746
810
|
const raw = fs.readFileSync(filePath, "utf8");
|
|
747
811
|
const parsed = JSON.parse(raw);
|
|
@@ -1333,11 +1397,22 @@ function printMcpConfig(options = {}) {
|
|
|
1333
1397
|
}
|
|
1334
1398
|
|
|
1335
1399
|
function installAll(options = {}) {
|
|
1400
|
+
const runtimeDirsResult = ensureRuntimeDirectories(options);
|
|
1336
1401
|
const skillResults = installSkill();
|
|
1337
1402
|
const configResult = ensureUserConfig(options);
|
|
1338
1403
|
const mcpTemplateResult = writeMcpConfigFiles({ client: "all" });
|
|
1339
1404
|
const externalMcpResult = installExternalMcpConfigs(options);
|
|
1340
1405
|
const externalSkillResult = mirrorSkillToExternalDirs(options);
|
|
1406
|
+
console.log(
|
|
1407
|
+
`Runtime directories prepared: created=${runtimeDirsResult.created.length}, existing=${runtimeDirsResult.existed.length}, failed=${runtimeDirsResult.failed.length}`
|
|
1408
|
+
);
|
|
1409
|
+
console.log(`- recommend runtime: ${runtimeDirsResult.stateHome}`);
|
|
1410
|
+
console.log(`- boss-chat runtime: ${runtimeDirsResult.bossChatRoot}`);
|
|
1411
|
+
if (runtimeDirsResult.failed.length > 0) {
|
|
1412
|
+
for (const item of runtimeDirsResult.failed) {
|
|
1413
|
+
console.warn(`Runtime dir warning: ${item.path} -> ${item.message}`);
|
|
1414
|
+
}
|
|
1415
|
+
}
|
|
1341
1416
|
console.log(`Bundled skills installed: ${skillResults.length}`);
|
|
1342
1417
|
for (const item of skillResults) {
|
|
1343
1418
|
console.log(`- ${item.skill}: ${item.targetDir}`);
|
|
@@ -1546,7 +1621,18 @@ export async function runCli(argv = process.argv) {
|
|
|
1546
1621
|
}
|
|
1547
1622
|
break;
|
|
1548
1623
|
case "init-config": {
|
|
1624
|
+
const runtimeDirsResult = ensureRuntimeDirectories(options);
|
|
1549
1625
|
const result = ensureUserConfig(options);
|
|
1626
|
+
console.log(
|
|
1627
|
+
`Runtime directories prepared: created=${runtimeDirsResult.created.length}, existing=${runtimeDirsResult.existed.length}, failed=${runtimeDirsResult.failed.length}`
|
|
1628
|
+
);
|
|
1629
|
+
console.log(`- recommend runtime: ${runtimeDirsResult.stateHome}`);
|
|
1630
|
+
console.log(`- boss-chat runtime: ${runtimeDirsResult.bossChatRoot}`);
|
|
1631
|
+
if (runtimeDirsResult.failed.length > 0) {
|
|
1632
|
+
for (const item of runtimeDirsResult.failed) {
|
|
1633
|
+
console.warn(`Runtime dir warning: ${item.path} -> ${item.message}`);
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1550
1636
|
console.log(result.created ? `Config template created at: ${result.path}` : `Config already exists at: ${result.path}`);
|
|
1551
1637
|
if (Array.isArray(result.patched_keys) && result.patched_keys.length > 0) {
|
|
1552
1638
|
console.log(`Config patched missing defaults: ${result.patched_keys.join(", ")}`);
|
|
@@ -1635,6 +1721,7 @@ export const __testables = {
|
|
|
1635
1721
|
getRunFollowUp,
|
|
1636
1722
|
installSkill,
|
|
1637
1723
|
isInstalledPackageRoot,
|
|
1724
|
+
ensureRuntimeDirectories,
|
|
1638
1725
|
runBossChatCliCommand,
|
|
1639
1726
|
runPipelineOnce
|
|
1640
1727
|
};
|