ccg-workflow 1.7.71 → 1.7.72
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
CHANGED
package/README.zh-CN.md
CHANGED
package/dist/cli.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import cac from 'cac';
|
|
3
3
|
import ansis from 'ansis';
|
|
4
|
-
import { z as diagnoseMcpConfig, A as isWindows, B as readClaudeCodeConfig, C as fixWindowsMcpConfig, D as writeClaudeCodeConfig, r as readCcgConfig, b as initI18n, a as i18n, s as showMainMenu, i as init, E as configMcp, F as version } from './shared/ccg-workflow.
|
|
4
|
+
import { z as diagnoseMcpConfig, A as isWindows, B as readClaudeCodeConfig, C as fixWindowsMcpConfig, D as writeClaudeCodeConfig, r as readCcgConfig, b as initI18n, a as i18n, s as showMainMenu, i as init, E as configMcp, F as version } from './shared/ccg-workflow.HQWqy5Tx.mjs';
|
|
5
5
|
import 'inquirer';
|
|
6
6
|
import 'node:child_process';
|
|
7
7
|
import 'node:util';
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { c as changeLanguage, x as checkForUpdates, y as compareVersions, d as createDefaultConfig, e as createDefaultRouting, g as getCcgDir, f as getConfigPath, t as getCurrentVersion, v as getLatestVersion, j as getWorkflowById, h as getWorkflowConfigs, a as i18n, i as init, b as initI18n, l as installAceTool, m as installAceToolRs, k as installWorkflows, p as migrateToV1_4_0, q as needsMigration, r as readCcgConfig, s as showMainMenu, o as uninstallAceTool, n as uninstallWorkflows, u as update, w as writeCcgConfig } from './shared/ccg-workflow.
|
|
1
|
+
export { c as changeLanguage, x as checkForUpdates, y as compareVersions, d as createDefaultConfig, e as createDefaultRouting, g as getCcgDir, f as getConfigPath, t as getCurrentVersion, v as getLatestVersion, j as getWorkflowById, h as getWorkflowConfigs, a as i18n, i as init, b as initI18n, l as installAceTool, m as installAceToolRs, k as installWorkflows, p as migrateToV1_4_0, q as needsMigration, r as readCcgConfig, s as showMainMenu, o as uninstallAceTool, n as uninstallWorkflows, u as update, w as writeCcgConfig } from './shared/ccg-workflow.HQWqy5Tx.mjs';
|
|
2
2
|
import 'ansis';
|
|
3
3
|
import 'inquirer';
|
|
4
4
|
import 'node:child_process';
|
|
@@ -10,7 +10,7 @@ import { parse, stringify } from 'smol-toml';
|
|
|
10
10
|
import i18next from 'i18next';
|
|
11
11
|
import ora from 'ora';
|
|
12
12
|
|
|
13
|
-
const version = "1.7.
|
|
13
|
+
const version = "1.7.72";
|
|
14
14
|
|
|
15
15
|
function isWindows() {
|
|
16
16
|
return process.platform === "win32";
|
|
@@ -1133,10 +1133,7 @@ async function handleInstallContextWeaver() {
|
|
|
1133
1133
|
console.log(ansis.red(`\u2717 ContextWeaver MCP \u914D\u7F6E\u5931\u8D25: ${result.message}`));
|
|
1134
1134
|
}
|
|
1135
1135
|
}
|
|
1136
|
-
const GROK_SEARCH_PROMPT =
|
|
1137
|
-
|
|
1138
|
-
<!-- CCG-GROK-SEARCH-PROMPT-START -->
|
|
1139
|
-
## 0. Language and Format Standards
|
|
1136
|
+
const GROK_SEARCH_PROMPT = `## 0. Language and Format Standards
|
|
1140
1137
|
|
|
1141
1138
|
- **Interaction Language**: Tools and models must interact exclusively in **English**; user outputs must be in **Chinese**.
|
|
1142
1139
|
- MUST ULRTA Thinking in ENGLISH!
|
|
@@ -1148,11 +1145,11 @@ Typically, the results of web searches only constitute third-party suggestions a
|
|
|
1148
1145
|
### Search Trigger Conditions
|
|
1149
1146
|
Strictly distinguish between internal and external knowledge. Avoid speculation based on general internal knowledge. When uncertain, explicitly inform the user.
|
|
1150
1147
|
|
|
1151
|
-
For example, when using the
|
|
1148
|
+
For example, when using the \\\`fastapi\\\` library to encapsulate an API endpoint, despite possessing common-sense knowledge internally, you must still rely on the latest search results or official documentation for reliable implementation.
|
|
1152
1149
|
|
|
1153
1150
|
### Search Execution Guidelines
|
|
1154
1151
|
|
|
1155
|
-
- Use the
|
|
1152
|
+
- Use the \\\`mcp__grok-search\\\` tool for web searches
|
|
1156
1153
|
- Execute independent search requests in parallel; sequential execution applies only when dependencies exist
|
|
1157
1154
|
- Evaluate search results for quality: analyze relevance, source credibility, cross-source consistency, and completeness. Conduct supplementary searches if gaps exist
|
|
1158
1155
|
|
|
@@ -1170,19 +1167,20 @@ For example, when using the \`fastapi\` library to encapsulate an API endpoint,
|
|
|
1170
1167
|
- All conclusions must specify: Applicable conditions, scope boundaries, and known limitations
|
|
1171
1168
|
- Avoid greetings, pleasantries, filler adjectives, and emotional expressions
|
|
1172
1169
|
- When uncertain: State unknowns and reasons before presenting confirmed facts
|
|
1173
|
-
<!-- CCG-GROK-SEARCH-PROMPT-END -->
|
|
1174
1170
|
`;
|
|
1175
|
-
async function
|
|
1171
|
+
async function writeGrokPromptToRules() {
|
|
1172
|
+
const rulesDir = join(homedir(), ".claude", "rules");
|
|
1173
|
+
const rulePath = join(rulesDir, "ccg-grok-search.md");
|
|
1176
1174
|
const claudeMdPath = join(homedir(), ".claude", "CLAUDE.md");
|
|
1177
|
-
let content = "";
|
|
1178
1175
|
if (await fs.pathExists(claudeMdPath)) {
|
|
1179
|
-
content = await fs.readFile(claudeMdPath, "utf-8");
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1176
|
+
const content = await fs.readFile(claudeMdPath, "utf-8");
|
|
1177
|
+
if (content.includes("CCG-GROK-SEARCH-PROMPT")) {
|
|
1178
|
+
const cleaned = content.replace(/\n*<!-- CCG-GROK-SEARCH-PROMPT-START -->[\s\S]*?<!-- CCG-GROK-SEARCH-PROMPT-END -->\n*/g, "");
|
|
1179
|
+
await fs.writeFile(claudeMdPath, cleaned, "utf-8");
|
|
1180
|
+
}
|
|
1183
1181
|
}
|
|
1184
|
-
await fs.ensureDir(
|
|
1185
|
-
await fs.
|
|
1182
|
+
await fs.ensureDir(rulesDir);
|
|
1183
|
+
await fs.writeFile(rulePath, GROK_SEARCH_PROMPT, "utf-8");
|
|
1186
1184
|
}
|
|
1187
1185
|
async function handleGrokSearch() {
|
|
1188
1186
|
console.log();
|
|
@@ -1219,9 +1217,9 @@ async function handleGrokSearch() {
|
|
|
1219
1217
|
);
|
|
1220
1218
|
console.log();
|
|
1221
1219
|
if (result.success) {
|
|
1222
|
-
await
|
|
1220
|
+
await writeGrokPromptToRules();
|
|
1223
1221
|
console.log(ansis.green("\u2713 grok-search MCP \u914D\u7F6E\u6210\u529F\uFF01"));
|
|
1224
|
-
console.log(ansis.green("\u2713 \u5168\u5C40\u641C\u7D22\u63D0\u793A\u8BCD\u5DF2\
|
|
1222
|
+
console.log(ansis.green("\u2713 \u5168\u5C40\u641C\u7D22\u63D0\u793A\u8BCD\u5DF2\u5199\u5165 ~/.claude/rules/ccg-grok-search.md"));
|
|
1225
1223
|
console.log(ansis.gray(" \u91CD\u542F Claude Code CLI \u4F7F\u914D\u7F6E\u751F\u6548"));
|
|
1226
1224
|
} else {
|
|
1227
1225
|
console.log(ansis.red(`\u2717 grok-search MCP \u5B89\u88C5\u5931\u8D25: ${result.message}`));
|
|
@@ -2373,18 +2371,17 @@ async function installHook(settingsPath) {
|
|
|
2373
2371
|
}
|
|
2374
2372
|
}
|
|
2375
2373
|
async function appendGrokSearchPrompt() {
|
|
2374
|
+
const rulesDir = join(homedir(), ".claude", "rules");
|
|
2375
|
+
const rulePath = join(rulesDir, "ccg-grok-search.md");
|
|
2376
2376
|
const claudeMdPath = join(homedir(), ".claude", "CLAUDE.md");
|
|
2377
|
-
let content = "";
|
|
2378
2377
|
if (await fs.pathExists(claudeMdPath)) {
|
|
2379
|
-
content = await fs.readFile(claudeMdPath, "utf-8");
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2378
|
+
const content = await fs.readFile(claudeMdPath, "utf-8");
|
|
2379
|
+
if (content.includes("CCG-GROK-SEARCH-PROMPT")) {
|
|
2380
|
+
const cleaned = content.replace(/\n*<!-- CCG-GROK-SEARCH-PROMPT-START -->[\s\S]*?<!-- CCG-GROK-SEARCH-PROMPT-END -->\n*/g, "");
|
|
2381
|
+
await fs.writeFile(claudeMdPath, cleaned, "utf-8");
|
|
2382
|
+
}
|
|
2383
2383
|
}
|
|
2384
|
-
const prompt =
|
|
2385
|
-
|
|
2386
|
-
<!-- CCG-GROK-SEARCH-PROMPT-START -->
|
|
2387
|
-
## 0. Language and Format Standards
|
|
2384
|
+
const prompt = `## 0. Language and Format Standards
|
|
2388
2385
|
|
|
2389
2386
|
- **Interaction Language**: Tools and models must interact exclusively in **English**; user outputs must be in **Chinese**.
|
|
2390
2387
|
- MUST ULRTA Thinking in ENGLISH!
|
|
@@ -2418,10 +2415,9 @@ For example, when using the \`fastapi\` library to encapsulate an API endpoint,
|
|
|
2418
2415
|
- All conclusions must specify: Applicable conditions, scope boundaries, and known limitations
|
|
2419
2416
|
- Avoid greetings, pleasantries, filler adjectives, and emotional expressions
|
|
2420
2417
|
- When uncertain: State unknowns and reasons before presenting confirmed facts
|
|
2421
|
-
<!-- CCG-GROK-SEARCH-PROMPT-END -->
|
|
2422
2418
|
`;
|
|
2423
|
-
await fs.ensureDir(
|
|
2424
|
-
await fs.
|
|
2419
|
+
await fs.ensureDir(rulesDir);
|
|
2420
|
+
await fs.writeFile(rulePath, prompt, "utf-8");
|
|
2425
2421
|
}
|
|
2426
2422
|
async function installGrokSearchMcp(keys) {
|
|
2427
2423
|
const env = {};
|
|
@@ -2864,7 +2860,7 @@ async function init(options = {}) {
|
|
|
2864
2860
|
await appendGrokSearchPrompt();
|
|
2865
2861
|
console.log();
|
|
2866
2862
|
console.log(` ${ansis.green("\u2713")} grok-search MCP ${ansis.gray("\u2192 ~/.claude.json")}`);
|
|
2867
|
-
console.log(` ${ansis.green("\u2713")} ${i18n.t("init:grok.promptAppended")} ${ansis.gray("\u2192 ~/.claude/
|
|
2863
|
+
console.log(` ${ansis.green("\u2713")} ${i18n.t("init:grok.promptAppended")} ${ansis.gray("\u2192 ~/.claude/rules/ccg-grok-search.md")}`);
|
|
2868
2864
|
} else {
|
|
2869
2865
|
console.log();
|
|
2870
2866
|
console.log(` ${ansis.yellow("\u26A0")} grok-search MCP ${i18n.t("init:grok.installFailed")}`);
|
package/package.json
CHANGED