cc-mirror 1.1.2 → 1.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/dist/cc-mirror.mjs +294 -233
- package/dist/skills/orchestration/SKILL.md +619 -0
- package/dist/skills/{multi-agent-orchestrator → orchestration}/references/tools.md +143 -58
- package/dist/tui.mjs +533 -401
- package/package.json +1 -1
- package/dist/skills/multi-agent-orchestrator/SKILL.md +0 -391
- package/dist/skills/multi-agent-orchestrator/references/code-review.md +0 -266
- package/dist/skills/multi-agent-orchestrator/references/data-analysis.md +0 -315
- package/dist/skills/multi-agent-orchestrator/references/devops.md +0 -309
- package/dist/skills/multi-agent-orchestrator/references/documentation.md +0 -310
- package/dist/skills/multi-agent-orchestrator/references/project-management.md +0 -345
- package/dist/skills/multi-agent-orchestrator/references/research.md +0 -285
- package/dist/skills/multi-agent-orchestrator/references/software-development.md +0 -242
- package/dist/skills/multi-agent-orchestrator/references/testing.md +0 -282
- /package/dist/skills/{multi-agent-orchestrator → orchestration}/references/domains/code-review.md +0 -0
- /package/dist/skills/{multi-agent-orchestrator → orchestration}/references/domains/data-analysis.md +0 -0
- /package/dist/skills/{multi-agent-orchestrator → orchestration}/references/domains/devops.md +0 -0
- /package/dist/skills/{multi-agent-orchestrator → orchestration}/references/domains/documentation.md +0 -0
- /package/dist/skills/{multi-agent-orchestrator → orchestration}/references/domains/project-management.md +0 -0
- /package/dist/skills/{multi-agent-orchestrator → orchestration}/references/domains/research.md +0 -0
- /package/dist/skills/{multi-agent-orchestrator → orchestration}/references/domains/software-development.md +0 -0
- /package/dist/skills/{multi-agent-orchestrator → orchestration}/references/domains/testing.md +0 -0
- /package/dist/skills/{multi-agent-orchestrator → orchestration}/references/examples.md +0 -0
- /package/dist/skills/{multi-agent-orchestrator → orchestration}/references/guide.md +0 -0
- /package/dist/skills/{multi-agent-orchestrator → orchestration}/references/patterns.md +0 -0
package/dist/tui.mjs
CHANGED
|
@@ -9,9 +9,9 @@ import { render } from "ink";
|
|
|
9
9
|
|
|
10
10
|
// src/tui/app.tsx
|
|
11
11
|
import { useCallback, useEffect as useEffect8, useMemo as useMemo3, useState as useState13 } from "react";
|
|
12
|
-
import { Box as
|
|
12
|
+
import { Box as Box26, Text as Text24, useApp, useInput as useInput13 } from "ink";
|
|
13
13
|
import SelectInput from "ink-select-input";
|
|
14
|
-
import
|
|
14
|
+
import path25 from "node:path";
|
|
15
15
|
|
|
16
16
|
// src/brands/index.ts
|
|
17
17
|
var brands_exports = {};
|
|
@@ -524,6 +524,15 @@ var getUserLabel = () => {
|
|
|
524
524
|
var formatUserMessage = (label) => ` [${label}] {} `;
|
|
525
525
|
|
|
526
526
|
// src/brands/zai.ts
|
|
527
|
+
var ZAI_BLOCKED_TOOLS = [
|
|
528
|
+
// Server-injected MCP tools (Z.ai injects these, we block them)
|
|
529
|
+
"mcp__4_5v_mcp__analyze_image",
|
|
530
|
+
"mcp__milk_tea_server__claim_milk_tea_coupon",
|
|
531
|
+
"mcp__web_reader__webReader",
|
|
532
|
+
// Builtin tools that should use zai-cli instead
|
|
533
|
+
"WebSearch",
|
|
534
|
+
"WebFetch"
|
|
535
|
+
];
|
|
527
536
|
var clamp = (value) => Math.max(0, Math.min(255, Math.round(value)));
|
|
528
537
|
var hexToRgb = (hex) => {
|
|
529
538
|
const normalized = hex.replace("#", "").trim();
|
|
@@ -705,7 +714,8 @@ var buildZaiTweakccConfig = () => ({
|
|
|
705
714
|
toolsets: [
|
|
706
715
|
{
|
|
707
716
|
name: "zai",
|
|
708
|
-
allowedTools: "*"
|
|
717
|
+
allowedTools: "*",
|
|
718
|
+
blockedTools: ZAI_BLOCKED_TOOLS
|
|
709
719
|
}
|
|
710
720
|
],
|
|
711
721
|
defaultToolset: "zai",
|
|
@@ -714,6 +724,10 @@ var buildZaiTweakccConfig = () => ({
|
|
|
714
724
|
});
|
|
715
725
|
|
|
716
726
|
// src/brands/minimax.ts
|
|
727
|
+
var MINIMAX_BLOCKED_TOOLS = [
|
|
728
|
+
// WebSearch should use mcp__MiniMax__web_search instead
|
|
729
|
+
"WebSearch"
|
|
730
|
+
];
|
|
717
731
|
var clamp2 = (value) => Math.max(0, Math.min(255, Math.round(value)));
|
|
718
732
|
var hexToRgb2 = (hex) => {
|
|
719
733
|
const normalized = hex.replace("#", "").trim();
|
|
@@ -894,7 +908,8 @@ var buildMinimaxTweakccConfig = () => ({
|
|
|
894
908
|
toolsets: [
|
|
895
909
|
{
|
|
896
910
|
name: "minimax",
|
|
897
|
-
allowedTools: "*"
|
|
911
|
+
allowedTools: "*",
|
|
912
|
+
blockedTools: MINIMAX_BLOCKED_TOOLS
|
|
898
913
|
}
|
|
899
914
|
],
|
|
900
915
|
defaultToolset: "minimax",
|
|
@@ -1552,8 +1567,8 @@ __export(core_exports, {
|
|
|
1552
1567
|
updateVariant: () => updateVariant,
|
|
1553
1568
|
updateVariantAsync: () => updateVariantAsync
|
|
1554
1569
|
});
|
|
1555
|
-
import
|
|
1556
|
-
import
|
|
1570
|
+
import fs13 from "node:fs";
|
|
1571
|
+
import path22 from "node:path";
|
|
1557
1572
|
|
|
1558
1573
|
// src/core/constants.ts
|
|
1559
1574
|
import os2 from "node:os";
|
|
@@ -1820,7 +1835,7 @@ var listVariants = (rootDir) => {
|
|
|
1820
1835
|
};
|
|
1821
1836
|
|
|
1822
1837
|
// src/core/variant-builder/VariantBuilder.ts
|
|
1823
|
-
import
|
|
1838
|
+
import path16 from "node:path";
|
|
1824
1839
|
|
|
1825
1840
|
// src/providers/index.ts
|
|
1826
1841
|
var providers_exports = {};
|
|
@@ -2159,8 +2174,8 @@ var InstallNpmStep = class {
|
|
|
2159
2174
|
};
|
|
2160
2175
|
|
|
2161
2176
|
// src/core/variant-builder/steps/TeamModeStep.ts
|
|
2162
|
-
import
|
|
2163
|
-
import
|
|
2177
|
+
import fs7 from "node:fs";
|
|
2178
|
+
import path8 from "node:path";
|
|
2164
2179
|
|
|
2165
2180
|
// src/core/skills.ts
|
|
2166
2181
|
import fs5 from "node:fs";
|
|
@@ -2253,7 +2268,7 @@ var ensureDevBrowserSkill = (opts) => {
|
|
|
2253
2268
|
fs5.rmSync(tmpDir, { recursive: true, force: true });
|
|
2254
2269
|
}
|
|
2255
2270
|
};
|
|
2256
|
-
var ORCHESTRATOR_SKILL_NAME = "
|
|
2271
|
+
var ORCHESTRATOR_SKILL_NAME = "orchestration";
|
|
2257
2272
|
var findBundledSkillDir = () => {
|
|
2258
2273
|
const thisFile = fileURLToPath(import.meta.url);
|
|
2259
2274
|
const thisDir = path6.dirname(thisFile);
|
|
@@ -2384,6 +2399,69 @@ var ensureDevBrowserSkillAsync = async (opts) => {
|
|
|
2384
2399
|
}
|
|
2385
2400
|
};
|
|
2386
2401
|
|
|
2402
|
+
// src/team-pack/index.ts
|
|
2403
|
+
import fs6 from "node:fs";
|
|
2404
|
+
import path7 from "node:path";
|
|
2405
|
+
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
2406
|
+
var __dirname = path7.dirname(fileURLToPath2(import.meta.url));
|
|
2407
|
+
var TEAM_PACK_FILES = [
|
|
2408
|
+
{ source: "tasklist.md", target: "tool-description-tasklist.md" },
|
|
2409
|
+
{ source: "taskupdate.md", target: "tool-description-taskupdate.md" },
|
|
2410
|
+
{ source: "task-extra-notes.md", target: "agent-prompt-task-tool-extra-notes.md" },
|
|
2411
|
+
{ source: "task-management-note.md", target: "system-prompt-task-management-note.md" },
|
|
2412
|
+
{ source: "orchestration-skill.md", target: "system-prompt-orchestration-skill.md" },
|
|
2413
|
+
{ source: "skill-tool-override.md", target: "tool-description-skill.md" }
|
|
2414
|
+
];
|
|
2415
|
+
var copyTeamPackPrompts = (systemPromptsDir) => {
|
|
2416
|
+
const copied = [];
|
|
2417
|
+
if (!fs6.existsSync(systemPromptsDir)) {
|
|
2418
|
+
fs6.mkdirSync(systemPromptsDir, { recursive: true });
|
|
2419
|
+
}
|
|
2420
|
+
for (const file of TEAM_PACK_FILES) {
|
|
2421
|
+
const sourcePath = path7.join(__dirname, file.source);
|
|
2422
|
+
const targetPath = path7.join(systemPromptsDir, file.target);
|
|
2423
|
+
if (fs6.existsSync(sourcePath)) {
|
|
2424
|
+
fs6.copyFileSync(sourcePath, targetPath);
|
|
2425
|
+
copied.push(file.target);
|
|
2426
|
+
}
|
|
2427
|
+
}
|
|
2428
|
+
return copied;
|
|
2429
|
+
};
|
|
2430
|
+
var configureTeamToolset = (configPath) => {
|
|
2431
|
+
if (!fs6.existsSync(configPath)) {
|
|
2432
|
+
return false;
|
|
2433
|
+
}
|
|
2434
|
+
try {
|
|
2435
|
+
const config = JSON.parse(fs6.readFileSync(configPath, "utf8"));
|
|
2436
|
+
config.settings = config.settings || {};
|
|
2437
|
+
const toolsets = Array.isArray(config.settings.toolsets) ? config.settings.toolsets : [];
|
|
2438
|
+
const defaultToolsetName = config.settings.defaultToolset;
|
|
2439
|
+
const existingDefaultToolset = toolsets.find(
|
|
2440
|
+
(t) => t.name === defaultToolsetName
|
|
2441
|
+
);
|
|
2442
|
+
const existingBlockedTools = existingDefaultToolset?.blockedTools || [];
|
|
2443
|
+
const mergedBlockedTools = [.../* @__PURE__ */ new Set([...existingBlockedTools, "TodoWrite"])];
|
|
2444
|
+
const teamToolset = {
|
|
2445
|
+
name: "team",
|
|
2446
|
+
allowedTools: "*",
|
|
2447
|
+
blockedTools: mergedBlockedTools
|
|
2448
|
+
};
|
|
2449
|
+
const existingTeamIndex = toolsets.findIndex((t) => t.name === "team");
|
|
2450
|
+
if (existingTeamIndex >= 0) {
|
|
2451
|
+
toolsets[existingTeamIndex] = teamToolset;
|
|
2452
|
+
} else {
|
|
2453
|
+
toolsets.push(teamToolset);
|
|
2454
|
+
}
|
|
2455
|
+
config.settings.toolsets = toolsets;
|
|
2456
|
+
config.settings.defaultToolset = "team";
|
|
2457
|
+
config.settings.planModeToolset = "team";
|
|
2458
|
+
fs6.writeFileSync(configPath, JSON.stringify(config, null, 2));
|
|
2459
|
+
return true;
|
|
2460
|
+
} catch {
|
|
2461
|
+
return false;
|
|
2462
|
+
}
|
|
2463
|
+
};
|
|
2464
|
+
|
|
2387
2465
|
// src/core/variant-builder/steps/TeamModeStep.ts
|
|
2388
2466
|
var TEAM_MODE_DISABLED = "function sU(){return!1}";
|
|
2389
2467
|
var TEAM_MODE_ENABLED = "function sU(){return!0}";
|
|
@@ -2404,16 +2482,16 @@ var TeamModeStep = class {
|
|
|
2404
2482
|
}
|
|
2405
2483
|
patchCli(ctx) {
|
|
2406
2484
|
const { state, params, paths } = ctx;
|
|
2407
|
-
const cliPath =
|
|
2485
|
+
const cliPath = path8.join(paths.npmDir, "node_modules", "@anthropic-ai", "claude-code", "cli.js");
|
|
2408
2486
|
const backupPath = `${cliPath}.backup`;
|
|
2409
|
-
if (!
|
|
2487
|
+
if (!fs7.existsSync(cliPath)) {
|
|
2410
2488
|
state.notes.push("Warning: cli.js not found, skipping team mode patch");
|
|
2411
2489
|
return;
|
|
2412
2490
|
}
|
|
2413
|
-
if (!
|
|
2414
|
-
|
|
2491
|
+
if (!fs7.existsSync(backupPath)) {
|
|
2492
|
+
fs7.copyFileSync(cliPath, backupPath);
|
|
2415
2493
|
}
|
|
2416
|
-
let content =
|
|
2494
|
+
let content = fs7.readFileSync(cliPath, "utf8");
|
|
2417
2495
|
if (content.includes(TEAM_MODE_ENABLED)) {
|
|
2418
2496
|
state.notes.push("Team mode already enabled");
|
|
2419
2497
|
return;
|
|
@@ -2423,16 +2501,16 @@ var TeamModeStep = class {
|
|
|
2423
2501
|
return;
|
|
2424
2502
|
}
|
|
2425
2503
|
content = content.replace(TEAM_MODE_DISABLED, TEAM_MODE_ENABLED);
|
|
2426
|
-
|
|
2427
|
-
const verifyContent =
|
|
2504
|
+
fs7.writeFileSync(cliPath, content);
|
|
2505
|
+
const verifyContent = fs7.readFileSync(cliPath, "utf8");
|
|
2428
2506
|
if (!verifyContent.includes(TEAM_MODE_ENABLED)) {
|
|
2429
2507
|
state.notes.push("Warning: Team mode patch verification failed");
|
|
2430
2508
|
return;
|
|
2431
2509
|
}
|
|
2432
|
-
const settingsPath =
|
|
2433
|
-
if (
|
|
2510
|
+
const settingsPath = path8.join(paths.configDir, "settings.json");
|
|
2511
|
+
if (fs7.existsSync(settingsPath)) {
|
|
2434
2512
|
try {
|
|
2435
|
-
const settings = JSON.parse(
|
|
2513
|
+
const settings = JSON.parse(fs7.readFileSync(settingsPath, "utf8"));
|
|
2436
2514
|
settings.env = settings.env || {};
|
|
2437
2515
|
if (!settings.env.CLAUDE_CODE_TEAM_NAME) {
|
|
2438
2516
|
settings.env.CLAUDE_CODE_TEAM_NAME = params.name;
|
|
@@ -2440,7 +2518,12 @@ var TeamModeStep = class {
|
|
|
2440
2518
|
if (!settings.env.CLAUDE_CODE_AGENT_TYPE) {
|
|
2441
2519
|
settings.env.CLAUDE_CODE_AGENT_TYPE = "team-lead";
|
|
2442
2520
|
}
|
|
2443
|
-
|
|
2521
|
+
settings.permissions = settings.permissions || {};
|
|
2522
|
+
settings.permissions.allow = settings.permissions.allow || [];
|
|
2523
|
+
if (!settings.permissions.allow.includes("Skill(orchestration)")) {
|
|
2524
|
+
settings.permissions.allow.push("Skill(orchestration)");
|
|
2525
|
+
}
|
|
2526
|
+
fs7.writeFileSync(settingsPath, JSON.stringify(settings, null, 2));
|
|
2444
2527
|
} catch {
|
|
2445
2528
|
state.notes.push("Warning: Could not update settings.json with team env vars");
|
|
2446
2529
|
}
|
|
@@ -2452,15 +2535,24 @@ var TeamModeStep = class {
|
|
|
2452
2535
|
} else if (skillResult.status === "failed") {
|
|
2453
2536
|
state.notes.push(`Warning: orchestrator skill install failed: ${skillResult.message}`);
|
|
2454
2537
|
}
|
|
2538
|
+
const systemPromptsDir = path8.join(paths.tweakDir, "system-prompts");
|
|
2539
|
+
const copiedFiles = copyTeamPackPrompts(systemPromptsDir);
|
|
2540
|
+
if (copiedFiles.length > 0) {
|
|
2541
|
+
state.notes.push(`Team pack prompts installed (${copiedFiles.join(", ")})`);
|
|
2542
|
+
}
|
|
2543
|
+
const tweakccConfigPath = path8.join(paths.tweakDir, "config.json");
|
|
2544
|
+
if (configureTeamToolset(tweakccConfigPath)) {
|
|
2545
|
+
state.notes.push("Team toolset configured (TodoWrite blocked)");
|
|
2546
|
+
}
|
|
2455
2547
|
}
|
|
2456
2548
|
};
|
|
2457
2549
|
|
|
2458
2550
|
// src/core/variant-builder/steps/WriteConfigStep.ts
|
|
2459
|
-
import
|
|
2551
|
+
import path10 from "node:path";
|
|
2460
2552
|
|
|
2461
2553
|
// src/core/claude-config.ts
|
|
2462
|
-
import
|
|
2463
|
-
import
|
|
2554
|
+
import fs8 from "node:fs";
|
|
2555
|
+
import path9 from "node:path";
|
|
2464
2556
|
var SETTINGS_FILE = "settings.json";
|
|
2465
2557
|
var CLAUDE_CONFIG_FILE = ".claude.json";
|
|
2466
2558
|
var PLACEHOLDER_KEY = "<API_KEY>";
|
|
@@ -2471,7 +2563,7 @@ var toStringOrNull = (value) => {
|
|
|
2471
2563
|
return trimmed;
|
|
2472
2564
|
};
|
|
2473
2565
|
var readSettingsApiKey = (configDir) => {
|
|
2474
|
-
const settingsPath =
|
|
2566
|
+
const settingsPath = path9.join(configDir, SETTINGS_FILE);
|
|
2475
2567
|
const settings = readJson(settingsPath);
|
|
2476
2568
|
if (!settings?.env) return null;
|
|
2477
2569
|
const env = settings.env;
|
|
@@ -2483,7 +2575,7 @@ var ZAI_DENY_TOOLS = [
|
|
|
2483
2575
|
"mcp__web_reader__webReader"
|
|
2484
2576
|
];
|
|
2485
2577
|
var ensureZaiMcpDeny = (configDir) => {
|
|
2486
|
-
const settingsPath =
|
|
2578
|
+
const settingsPath = path9.join(configDir, SETTINGS_FILE);
|
|
2487
2579
|
const existing = readJson(settingsPath) || {};
|
|
2488
2580
|
const permissions = existing.permissions || {};
|
|
2489
2581
|
const deny = Array.isArray(permissions.deny) ? [...permissions.deny] : [];
|
|
@@ -2506,7 +2598,7 @@ var ensureZaiMcpDeny = (configDir) => {
|
|
|
2506
2598
|
return true;
|
|
2507
2599
|
};
|
|
2508
2600
|
var ensureSettingsEnvDefaults = (configDir, defaults) => {
|
|
2509
|
-
const settingsPath =
|
|
2601
|
+
const settingsPath = path9.join(configDir, SETTINGS_FILE);
|
|
2510
2602
|
const existing = readJson(settingsPath) || {};
|
|
2511
2603
|
const env = { ...existing.env ?? {} };
|
|
2512
2604
|
let changed = false;
|
|
@@ -2521,7 +2613,7 @@ var ensureSettingsEnvDefaults = (configDir, defaults) => {
|
|
|
2521
2613
|
return true;
|
|
2522
2614
|
};
|
|
2523
2615
|
var ensureSettingsEnvOverrides = (configDir, overrides) => {
|
|
2524
|
-
const settingsPath =
|
|
2616
|
+
const settingsPath = path9.join(configDir, SETTINGS_FILE);
|
|
2525
2617
|
const existing = readJson(settingsPath) || {};
|
|
2526
2618
|
const env = { ...existing.env ?? {} };
|
|
2527
2619
|
let changed = false;
|
|
@@ -2540,8 +2632,8 @@ var ensureApiKeyApproval = (configDir, apiKey) => {
|
|
|
2540
2632
|
const resolvedKey = toStringOrNull(apiKey) || readSettingsApiKey(configDir);
|
|
2541
2633
|
if (!resolvedKey) return false;
|
|
2542
2634
|
const approvedToken = resolvedKey.slice(-20);
|
|
2543
|
-
const configPath =
|
|
2544
|
-
const exists =
|
|
2635
|
+
const configPath = path9.join(configDir, CLAUDE_CONFIG_FILE);
|
|
2636
|
+
const exists = fs8.existsSync(configPath);
|
|
2545
2637
|
let config = null;
|
|
2546
2638
|
if (exists) {
|
|
2547
2639
|
config = readJson(configPath);
|
|
@@ -2565,8 +2657,8 @@ var ensureApiKeyApproval = (configDir, apiKey) => {
|
|
|
2565
2657
|
return true;
|
|
2566
2658
|
};
|
|
2567
2659
|
var ensureOnboardingState = (configDir, opts = {}) => {
|
|
2568
|
-
const configPath =
|
|
2569
|
-
const exists =
|
|
2660
|
+
const configPath = path9.join(configDir, CLAUDE_CONFIG_FILE);
|
|
2661
|
+
const exists = fs8.existsSync(configPath);
|
|
2570
2662
|
let config = null;
|
|
2571
2663
|
if (exists) {
|
|
2572
2664
|
config = readJson(configPath);
|
|
@@ -2600,8 +2692,8 @@ var ensureOnboardingState = (configDir, opts = {}) => {
|
|
|
2600
2692
|
};
|
|
2601
2693
|
var ensureMinimaxMcpServer = (configDir, apiKey) => {
|
|
2602
2694
|
const resolvedKey = toStringOrNull(apiKey) || readSettingsApiKey(configDir);
|
|
2603
|
-
const configPath =
|
|
2604
|
-
const exists =
|
|
2695
|
+
const configPath = path9.join(configDir, CLAUDE_CONFIG_FILE);
|
|
2696
|
+
const exists = fs8.existsSync(configPath);
|
|
2605
2697
|
let config = null;
|
|
2606
2698
|
if (exists) {
|
|
2607
2699
|
config = readJson(configPath);
|
|
@@ -2658,7 +2750,7 @@ var WriteConfigStep = class {
|
|
|
2658
2750
|
env.ANTHROPIC_API_KEY = "<API_KEY>";
|
|
2659
2751
|
}
|
|
2660
2752
|
const config = { env };
|
|
2661
|
-
writeJson(
|
|
2753
|
+
writeJson(path10.join(paths.configDir, "settings.json"), config);
|
|
2662
2754
|
state.env = env;
|
|
2663
2755
|
state.resolvedApiKey = typeof env.ANTHROPIC_API_KEY === "string" ? env.ANTHROPIC_API_KEY : void 0;
|
|
2664
2756
|
ensureApiKeyApproval(paths.configDir, state.resolvedApiKey);
|
|
@@ -2724,14 +2816,14 @@ var BrandThemeStep = class {
|
|
|
2724
2816
|
}
|
|
2725
2817
|
}
|
|
2726
2818
|
if (params.noTweak && prefs.promptPackPreference) {
|
|
2727
|
-
state.notes.push(
|
|
2819
|
+
state.notes.push("Prompt pack skipped (tweakcc disabled).");
|
|
2728
2820
|
}
|
|
2729
2821
|
}
|
|
2730
2822
|
};
|
|
2731
2823
|
|
|
2732
2824
|
// src/core/prompt-pack.ts
|
|
2733
|
-
import
|
|
2734
|
-
import
|
|
2825
|
+
import fs9 from "node:fs";
|
|
2826
|
+
import path11 from "node:path";
|
|
2735
2827
|
|
|
2736
2828
|
// src/core/prompt-pack/sanitize.ts
|
|
2737
2829
|
var BACKTICK_REGEX = /`/g;
|
|
@@ -2753,12 +2845,11 @@ var verbositySpec = `
|
|
|
2753
2845
|
What changed, Where, How to verify, Risks, Next steps, Open questions.
|
|
2754
2846
|
</output_verbosity_spec>
|
|
2755
2847
|
`.trim();
|
|
2756
|
-
var operatingSpec = (
|
|
2848
|
+
var operatingSpec = () => `
|
|
2757
2849
|
<system_reminder>
|
|
2758
2850
|
- Operate like an ambitious, senior engineer: proactive, high-ownership, and precise.
|
|
2759
2851
|
- Prefer concrete outputs: commands, file paths, diffs, and validation steps.
|
|
2760
2852
|
- Respect permissions and confirm before destructive actions.
|
|
2761
|
-
${mode === "maximal" ? "- Parallelize independent work with Task/subagents when useful." : ""}
|
|
2762
2853
|
</system_reminder>
|
|
2763
2854
|
`.trim();
|
|
2764
2855
|
var subjectiveWorkSpec = `
|
|
@@ -2769,6 +2860,13 @@ var subjectiveWorkSpec = `
|
|
|
2769
2860
|
- When you catch yourself making assumptions about subjective quality, pause and ask instead.
|
|
2770
2861
|
</subjective_work_guardrails>
|
|
2771
2862
|
`.trim();
|
|
2863
|
+
var skillClarificationSpec = `
|
|
2864
|
+
<skill_clarification>
|
|
2865
|
+
The examples in the Skill tool description (commit, review-pr, pdf) are illustrative only.
|
|
2866
|
+
IMPORTANT: Only skills listed in <available_skills> are actually installed in this variant.
|
|
2867
|
+
If a user asks for a skill not in <available_skills>, inform them it's not installed.
|
|
2868
|
+
</skill_clarification>
|
|
2869
|
+
`.trim();
|
|
2772
2870
|
|
|
2773
2871
|
// src/core/prompt-pack/providers/zai.ts
|
|
2774
2872
|
var ZAI_BLOCKED_MCP_TOOLS = [
|
|
@@ -2792,7 +2890,7 @@ Quick start examples:
|
|
|
2792
2890
|
- npx zai-cli repo search facebook/react "server components"
|
|
2793
2891
|
- npx zai-cli repo --help
|
|
2794
2892
|
`.trim();
|
|
2795
|
-
var buildZaiContract = (
|
|
2893
|
+
var buildZaiContract = () => `
|
|
2796
2894
|
<explicit_guidance>
|
|
2797
2895
|
Provider: z.ai (GLM)
|
|
2798
2896
|
|
|
@@ -2837,7 +2935,7 @@ Blocked tools:
|
|
|
2837
2935
|
${ZAI_BLOCKED_MCP_TOOLS.map((tool) => `- ${tool}`).join("\n")}
|
|
2838
2936
|
</warning>
|
|
2839
2937
|
|
|
2840
|
-
${operatingSpec(
|
|
2938
|
+
${operatingSpec()}
|
|
2841
2939
|
|
|
2842
2940
|
${subjectiveWorkSpec}
|
|
2843
2941
|
|
|
@@ -2855,8 +2953,8 @@ ${ZAI_BLOCKED_MCP_TOOLS.map((tool) => `- ${tool}`).join("\n")}
|
|
|
2855
2953
|
|
|
2856
2954
|
${subjectiveWorkSpec}
|
|
2857
2955
|
`.trim();
|
|
2858
|
-
var buildZaiOverlays = (
|
|
2859
|
-
main: buildZaiContract(
|
|
2956
|
+
var buildZaiOverlays = () => ({
|
|
2957
|
+
main: buildZaiContract(),
|
|
2860
2958
|
mcpCli: `
|
|
2861
2959
|
${buildZaiExcerpt()}
|
|
2862
2960
|
|
|
@@ -2917,13 +3015,14 @@ ${ZAI_BLOCKED_MCP_TOOLS.map((tool) => `- ${tool}`).join("\n")}
|
|
|
2917
3015
|
<explicit_guidance>
|
|
2918
3016
|
Prefer zai-cli via Bash for web/search/vision. Only use other MCP tools if the user explicitly configured them and they are clearly relevant.
|
|
2919
3017
|
</explicit_guidance>
|
|
2920
|
-
`.trim()
|
|
3018
|
+
`.trim(),
|
|
3019
|
+
skill: skillClarificationSpec
|
|
2921
3020
|
});
|
|
2922
3021
|
|
|
2923
3022
|
// src/core/prompt-pack/providers/minimax.ts
|
|
2924
3023
|
var MINIMAX_WEB_SEARCH = "mcp__MiniMax__web_search";
|
|
2925
3024
|
var MINIMAX_UNDERSTAND_IMAGE = "mcp__MiniMax__understand_image";
|
|
2926
|
-
var buildMinimaxContract = (
|
|
3025
|
+
var buildMinimaxContract = () => `
|
|
2927
3026
|
<explicit_guidance>
|
|
2928
3027
|
<tool_routing priority="critical">
|
|
2929
3028
|
MiniMax MCP tools available (and ONLY these for web + vision):
|
|
@@ -2955,7 +3054,7 @@ Single-page URL retrieval:
|
|
|
2955
3054
|
- Do NOT misuse web_search to fetch full page content.
|
|
2956
3055
|
</tool_routing>
|
|
2957
3056
|
|
|
2958
|
-
${operatingSpec(
|
|
3057
|
+
${operatingSpec()}
|
|
2959
3058
|
|
|
2960
3059
|
${subjectiveWorkSpec}
|
|
2961
3060
|
|
|
@@ -2973,8 +3072,8 @@ MiniMax tool routing:
|
|
|
2973
3072
|
|
|
2974
3073
|
${subjectiveWorkSpec}
|
|
2975
3074
|
`.trim();
|
|
2976
|
-
var buildMinimaxOverlays = (
|
|
2977
|
-
main: buildMinimaxContract(
|
|
3075
|
+
var buildMinimaxOverlays = () => ({
|
|
3076
|
+
main: buildMinimaxContract(),
|
|
2978
3077
|
mcpCli: `
|
|
2979
3078
|
${buildMinimaxExcerpt()}
|
|
2980
3079
|
|
|
@@ -3012,83 +3111,18 @@ MiniMax MCP tools:
|
|
|
3012
3111
|
You MUST load the tool first:
|
|
3013
3112
|
- MCPSearch query: select:${MINIMAX_WEB_SEARCH} or select:${MINIMAX_UNDERSTAND_IMAGE}
|
|
3014
3113
|
</explicit_guidance>
|
|
3015
|
-
`.trim()
|
|
3114
|
+
`.trim(),
|
|
3115
|
+
skill: skillClarificationSpec
|
|
3016
3116
|
});
|
|
3017
3117
|
|
|
3018
3118
|
// src/core/prompt-pack/overlays.ts
|
|
3019
|
-
var
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
});
|
|
3023
|
-
var buildProviderExcerpt = (provider) => provider === "zai" ? buildZaiExcerpt() : buildMinimaxExcerpt();
|
|
3024
|
-
var buildMaximalOverlays = (provider) => ({
|
|
3025
|
-
explore: `
|
|
3026
|
-
<system_reminder>
|
|
3027
|
-
- You are in Explore mode: go wide before deep.
|
|
3028
|
-
- Use tools early to validate assumptions and reduce guesswork.
|
|
3029
|
-
- Output: Findings (bullets), Risks/unknowns, Next steps.
|
|
3030
|
-
</system_reminder>
|
|
3031
|
-
|
|
3032
|
-
${buildProviderExcerpt(provider)}
|
|
3033
|
-
`.trim(),
|
|
3034
|
-
planEnhanced: `
|
|
3035
|
-
<system_reminder>
|
|
3036
|
-
- Provide 2-3 viable options with tradeoffs.
|
|
3037
|
-
- Include risks, unknowns, and a validation checklist.
|
|
3038
|
-
- Output structure: Overview, Options, Recommendation, Steps, Verification, Risks.
|
|
3039
|
-
</system_reminder>
|
|
3040
|
-
|
|
3041
|
-
${buildProviderExcerpt(provider)}
|
|
3042
|
-
`.trim(),
|
|
3043
|
-
planReminder: `
|
|
3044
|
-
<system_reminder>
|
|
3045
|
-
- In Plan Mode: surface options, tradeoffs, risks, and validation steps explicitly.
|
|
3046
|
-
</system_reminder>
|
|
3047
|
-
`.trim(),
|
|
3048
|
-
planReminderSub: `
|
|
3049
|
-
<system_reminder>
|
|
3050
|
-
- In Plan Mode (subagents): surface options, tradeoffs, risks, and validation steps explicitly.
|
|
3051
|
-
</system_reminder>
|
|
3052
|
-
`.trim(),
|
|
3053
|
-
taskTool: `
|
|
3054
|
-
Maximal mode: use Task to parallelize independent research/debugging and to keep the main thread focused.
|
|
3055
|
-
`.trim(),
|
|
3056
|
-
enterPlan: `
|
|
3057
|
-
Maximal mode: enter Plan Mode early for ambiguous, multi-step, or high-risk tasks.
|
|
3058
|
-
`.trim(),
|
|
3059
|
-
exitPlan: `
|
|
3060
|
-
Maximal mode: return a crisp plan with options, checkpoints, verification, and rollback considerations.
|
|
3061
|
-
`.trim(),
|
|
3062
|
-
skill: `
|
|
3063
|
-
Maximal mode: use Skills when they provide sharper domain knowledge or integrations; otherwise proceed normally.
|
|
3064
|
-
`.trim(),
|
|
3065
|
-
conversationSummary: `
|
|
3066
|
-
<system_reminder>
|
|
3067
|
-
- Capture decisions, constraints, open questions, and next steps.
|
|
3068
|
-
- Preserve critical commands, configs, and file paths.
|
|
3069
|
-
</system_reminder>
|
|
3070
|
-
`.trim(),
|
|
3071
|
-
conversationSummaryExtended: `
|
|
3072
|
-
<system_reminder>
|
|
3073
|
-
- Capture decisions, constraints, open questions, and next steps.
|
|
3074
|
-
- Preserve critical commands, configs, and file paths.
|
|
3075
|
-
</system_reminder>
|
|
3076
|
-
`.trim(),
|
|
3077
|
-
webfetchSummary: `
|
|
3078
|
-
<system_reminder>
|
|
3079
|
-
- Extract key facts, titles, and constraints.
|
|
3080
|
-
- Preserve URLs and important context verbatim.
|
|
3081
|
-
</system_reminder>
|
|
3082
|
-
`.trim()
|
|
3083
|
-
});
|
|
3084
|
-
var buildProviderOverlays = (provider, mode) => {
|
|
3085
|
-
if (provider === "zai") return buildZaiOverlays(mode);
|
|
3086
|
-
return buildMinimaxOverlays(mode);
|
|
3119
|
+
var buildProviderOverlays = (provider) => {
|
|
3120
|
+
if (provider === "zai") return buildZaiOverlays();
|
|
3121
|
+
return buildMinimaxOverlays();
|
|
3087
3122
|
};
|
|
3088
|
-
var resolveOverlays = (provider
|
|
3089
|
-
const base = buildProviderOverlays(provider
|
|
3090
|
-
|
|
3091
|
-
return sanitizeOverlayMap(overlays);
|
|
3123
|
+
var resolveOverlays = (provider) => {
|
|
3124
|
+
const base = buildProviderOverlays(provider);
|
|
3125
|
+
return sanitizeOverlayMap(base);
|
|
3092
3126
|
};
|
|
3093
3127
|
|
|
3094
3128
|
// src/core/prompt-pack/targets.ts
|
|
@@ -3146,17 +3180,17 @@ ${block}
|
|
|
3146
3180
|
};
|
|
3147
3181
|
var updatePromptFile = (filePath, overlay) => {
|
|
3148
3182
|
if (!overlay) return false;
|
|
3149
|
-
if (!
|
|
3150
|
-
const content =
|
|
3183
|
+
if (!fs9.existsSync(filePath)) return false;
|
|
3184
|
+
const content = fs9.readFileSync(filePath, "utf8");
|
|
3151
3185
|
const updated = insertOverlay(content, overlay);
|
|
3152
3186
|
if (updated === content) return false;
|
|
3153
|
-
|
|
3187
|
+
fs9.writeFileSync(filePath, updated);
|
|
3154
3188
|
return true;
|
|
3155
3189
|
};
|
|
3156
3190
|
var applyOverlays = (systemPromptsDir, overlays) => {
|
|
3157
3191
|
const updated = [];
|
|
3158
3192
|
for (const target of PROMPT_PACK_TARGETS) {
|
|
3159
|
-
const filePath =
|
|
3193
|
+
const filePath = path11.join(systemPromptsDir, target.filename);
|
|
3160
3194
|
const overlay = overlays[target.key];
|
|
3161
3195
|
if (updatePromptFile(filePath, overlay)) {
|
|
3162
3196
|
updated.push(target.filename);
|
|
@@ -3164,14 +3198,14 @@ var applyOverlays = (systemPromptsDir, overlays) => {
|
|
|
3164
3198
|
}
|
|
3165
3199
|
return updated;
|
|
3166
3200
|
};
|
|
3167
|
-
var applyPromptPack = (tweakDir, providerKey
|
|
3201
|
+
var applyPromptPack = (tweakDir, providerKey) => {
|
|
3168
3202
|
if (!isPromptPackKey(providerKey)) {
|
|
3169
|
-
return { changed: false, updated: []
|
|
3203
|
+
return { changed: false, updated: [] };
|
|
3170
3204
|
}
|
|
3171
|
-
const overlays = resolveOverlays(providerKey
|
|
3172
|
-
const systemPromptsDir =
|
|
3205
|
+
const overlays = resolveOverlays(providerKey);
|
|
3206
|
+
const systemPromptsDir = path11.join(tweakDir, "system-prompts");
|
|
3173
3207
|
const updated = applyOverlays(systemPromptsDir, overlays);
|
|
3174
|
-
return { changed: updated.length > 0, updated
|
|
3208
|
+
return { changed: updated.length > 0, updated };
|
|
3175
3209
|
};
|
|
3176
3210
|
|
|
3177
3211
|
// src/core/variant-builder/steps/TweakccStep.ts
|
|
@@ -3190,10 +3224,10 @@ ${state.tweakResult.stdout ?? ""}`.trim();
|
|
|
3190
3224
|
throw new Error(formatTweakccFailure(output));
|
|
3191
3225
|
}
|
|
3192
3226
|
if (prefs.promptPackEnabled) {
|
|
3193
|
-
ctx.report(
|
|
3194
|
-
const packResult = applyPromptPack(paths.tweakDir, params.providerKey
|
|
3227
|
+
ctx.report("Applying prompt pack...");
|
|
3228
|
+
const packResult = applyPromptPack(paths.tweakDir, params.providerKey);
|
|
3195
3229
|
if (packResult.changed) {
|
|
3196
|
-
state.notes.push(`Prompt pack applied (${packResult.
|
|
3230
|
+
state.notes.push(`Prompt pack applied (${packResult.updated.join(", ")})`);
|
|
3197
3231
|
ctx.report("Re-applying tweakcc...");
|
|
3198
3232
|
const reapply = runTweakcc(paths.tweakDir, state.binaryPath, prefs.commandStdio);
|
|
3199
3233
|
state.tweakResult = reapply;
|
|
@@ -3218,10 +3252,10 @@ ${state.tweakResult.stdout ?? ""}`.trim();
|
|
|
3218
3252
|
throw new Error(formatTweakccFailure(output));
|
|
3219
3253
|
}
|
|
3220
3254
|
if (prefs.promptPackEnabled) {
|
|
3221
|
-
await ctx.report(
|
|
3222
|
-
const packResult = applyPromptPack(paths.tweakDir, params.providerKey
|
|
3255
|
+
await ctx.report("Applying prompt pack...");
|
|
3256
|
+
const packResult = applyPromptPack(paths.tweakDir, params.providerKey);
|
|
3223
3257
|
if (packResult.changed) {
|
|
3224
|
-
state.notes.push(`Prompt pack applied (${packResult.
|
|
3258
|
+
state.notes.push(`Prompt pack applied (${packResult.updated.join(", ")})`);
|
|
3225
3259
|
await ctx.report("Re-applying tweakcc...");
|
|
3226
3260
|
const reapply = await runTweakccAsync(paths.tweakDir, state.binaryPath, prefs.commandStdio);
|
|
3227
3261
|
state.tweakResult = reapply;
|
|
@@ -3236,10 +3270,10 @@ ${reapply.stdout ?? ""}`.trim();
|
|
|
3236
3270
|
};
|
|
3237
3271
|
|
|
3238
3272
|
// src/core/wrapper.ts
|
|
3239
|
-
import
|
|
3240
|
-
import
|
|
3273
|
+
import fs10 from "node:fs";
|
|
3274
|
+
import path12 from "node:path";
|
|
3241
3275
|
var writeWrapper = (wrapperPath, configDir, binaryPath, runtime = "node") => {
|
|
3242
|
-
const tweakDir =
|
|
3276
|
+
const tweakDir = path12.join(path12.dirname(configDir), "tweakcc");
|
|
3243
3277
|
const execLine = runtime === "node" ? `exec node "${binaryPath}" "$@"` : `exec "${binaryPath}" "$@"`;
|
|
3244
3278
|
const envLoader = [
|
|
3245
3279
|
"if command -v node >/dev/null 2>&1; then",
|
|
@@ -3454,7 +3488,7 @@ var writeWrapper = (wrapperPath, configDir, binaryPath, runtime = "node") => {
|
|
|
3454
3488
|
execLine,
|
|
3455
3489
|
""
|
|
3456
3490
|
].join("\n");
|
|
3457
|
-
|
|
3491
|
+
fs10.writeFileSync(wrapperPath, content, { mode: 493 });
|
|
3458
3492
|
};
|
|
3459
3493
|
|
|
3460
3494
|
// src/core/variant-builder/steps/WrapperStep.ts
|
|
@@ -3471,9 +3505,9 @@ var WrapperStep = class {
|
|
|
3471
3505
|
};
|
|
3472
3506
|
|
|
3473
3507
|
// src/core/shell-env.ts
|
|
3474
|
-
import
|
|
3508
|
+
import fs11 from "node:fs";
|
|
3475
3509
|
import os5 from "node:os";
|
|
3476
|
-
import
|
|
3510
|
+
import path13 from "node:path";
|
|
3477
3511
|
var SETTINGS_FILE2 = "settings.json";
|
|
3478
3512
|
var BLOCK_START = "# cc-mirror: Z.ai env start";
|
|
3479
3513
|
var BLOCK_END = "# cc-mirror: Z.ai env end";
|
|
@@ -3487,20 +3521,20 @@ var normalizeApiKey = (value) => {
|
|
|
3487
3521
|
var resolveShellProfile = () => {
|
|
3488
3522
|
const home = os5.homedir();
|
|
3489
3523
|
const shell = process.env.SHELL || "";
|
|
3490
|
-
const name =
|
|
3524
|
+
const name = path13.basename(shell);
|
|
3491
3525
|
if (name === "zsh") {
|
|
3492
|
-
return
|
|
3526
|
+
return path13.join(home, ".zshrc");
|
|
3493
3527
|
}
|
|
3494
3528
|
if (name === "bash") {
|
|
3495
|
-
const bashrc =
|
|
3496
|
-
if (
|
|
3497
|
-
return
|
|
3529
|
+
const bashrc = path13.join(home, ".bashrc");
|
|
3530
|
+
if (fs11.existsSync(bashrc)) return bashrc;
|
|
3531
|
+
return path13.join(home, ".bash_profile");
|
|
3498
3532
|
}
|
|
3499
3533
|
return null;
|
|
3500
3534
|
};
|
|
3501
3535
|
var readSettingsApiKey2 = (configDir) => {
|
|
3502
|
-
const settingsPath =
|
|
3503
|
-
if (!
|
|
3536
|
+
const settingsPath = path13.join(configDir, SETTINGS_FILE2);
|
|
3537
|
+
if (!fs11.existsSync(settingsPath)) return null;
|
|
3504
3538
|
const settings = readJson(settingsPath);
|
|
3505
3539
|
const key = settings?.env?.ANTHROPIC_API_KEY;
|
|
3506
3540
|
if (typeof key !== "string") return null;
|
|
@@ -3555,7 +3589,7 @@ var ensureZaiShellEnv = (opts) => {
|
|
|
3555
3589
|
if (!profile) {
|
|
3556
3590
|
return { status: "failed", message: "Unsupported shell; set Z_AI_API_KEY manually" };
|
|
3557
3591
|
}
|
|
3558
|
-
const existing =
|
|
3592
|
+
const existing = fs11.existsSync(profile) ? fs11.readFileSync(profile, "utf8") : "";
|
|
3559
3593
|
if (hasZaiKeyInProfile(existing)) {
|
|
3560
3594
|
return { status: "skipped", message: "Z_AI_API_KEY already set in shell profile", path: profile };
|
|
3561
3595
|
}
|
|
@@ -3563,7 +3597,7 @@ var ensureZaiShellEnv = (opts) => {
|
|
|
3563
3597
|
if (next === existing) {
|
|
3564
3598
|
return { status: "skipped", message: "Shell profile already up to date", path: profile };
|
|
3565
3599
|
}
|
|
3566
|
-
|
|
3600
|
+
fs11.writeFileSync(profile, next);
|
|
3567
3601
|
return { status: "updated", path: profile, message: `Run: source ${profile}` };
|
|
3568
3602
|
};
|
|
3569
3603
|
|
|
@@ -3602,7 +3636,7 @@ var ShellEnvStep = class {
|
|
|
3602
3636
|
};
|
|
3603
3637
|
|
|
3604
3638
|
// src/core/variant-builder/steps/SkillInstallStep.ts
|
|
3605
|
-
import
|
|
3639
|
+
import path14 from "node:path";
|
|
3606
3640
|
var SkillInstallStep = class {
|
|
3607
3641
|
name = "SkillInstall";
|
|
3608
3642
|
execute(ctx) {
|
|
@@ -3614,7 +3648,7 @@ var SkillInstallStep = class {
|
|
|
3614
3648
|
const skillResult = ensureDevBrowserSkill({
|
|
3615
3649
|
install: true,
|
|
3616
3650
|
update: prefs.skillUpdateEnabled,
|
|
3617
|
-
targetDir:
|
|
3651
|
+
targetDir: path14.join(paths.configDir, "skills")
|
|
3618
3652
|
});
|
|
3619
3653
|
if (skillResult.status === "failed") {
|
|
3620
3654
|
state.notes.push(`dev-browser skill install failed: ${skillResult.message || "unknown error"}`);
|
|
@@ -3631,7 +3665,7 @@ var SkillInstallStep = class {
|
|
|
3631
3665
|
const skillResult = await ensureDevBrowserSkillAsync({
|
|
3632
3666
|
install: true,
|
|
3633
3667
|
update: prefs.skillUpdateEnabled,
|
|
3634
|
-
targetDir:
|
|
3668
|
+
targetDir: path14.join(paths.configDir, "skills")
|
|
3635
3669
|
});
|
|
3636
3670
|
if (skillResult.status === "failed") {
|
|
3637
3671
|
state.notes.push(`dev-browser skill install failed: ${skillResult.message || "unknown error"}`);
|
|
@@ -3642,7 +3676,7 @@ var SkillInstallStep = class {
|
|
|
3642
3676
|
};
|
|
3643
3677
|
|
|
3644
3678
|
// src/core/variant-builder/steps/FinalizeStep.ts
|
|
3645
|
-
import
|
|
3679
|
+
import path15 from "node:path";
|
|
3646
3680
|
var FinalizeStep = class {
|
|
3647
3681
|
name = "Finalize";
|
|
3648
3682
|
execute(ctx) {
|
|
@@ -3667,7 +3701,6 @@ var FinalizeStep = class {
|
|
|
3667
3701
|
tweakDir: paths.tweakDir,
|
|
3668
3702
|
brand: prefs.brandKey ?? void 0,
|
|
3669
3703
|
promptPack: prefs.promptPackPreference,
|
|
3670
|
-
promptPackMode: prefs.promptPackModePreference,
|
|
3671
3704
|
skillInstall: prefs.skillInstallEnabled,
|
|
3672
3705
|
shellEnv: prefs.shellEnvEnabled,
|
|
3673
3706
|
binDir: paths.resolvedBin,
|
|
@@ -3677,7 +3710,7 @@ var FinalizeStep = class {
|
|
|
3677
3710
|
npmVersion: prefs.resolvedNpmVersion,
|
|
3678
3711
|
teamModeEnabled
|
|
3679
3712
|
};
|
|
3680
|
-
writeJson(
|
|
3713
|
+
writeJson(path15.join(paths.variantDir, "variant.json"), meta);
|
|
3681
3714
|
state.meta = meta;
|
|
3682
3715
|
}
|
|
3683
3716
|
};
|
|
@@ -3689,7 +3722,6 @@ var shouldEnablePromptPack = (providerKey, provider) => {
|
|
|
3689
3722
|
if (provider?.noPromptPack) return false;
|
|
3690
3723
|
return providerKey === "zai" || providerKey === "minimax";
|
|
3691
3724
|
};
|
|
3692
|
-
var defaultPromptPackMode = (providerKey) => providerKey === "zai" || providerKey === "minimax" ? "maximal" : "minimal";
|
|
3693
3725
|
var shouldInstallSkills = (providerKey) => providerKey === "zai" || providerKey === "minimax";
|
|
3694
3726
|
var shouldEnableShellEnv = (providerKey) => providerKey === "zai";
|
|
3695
3727
|
var yieldToEventLoop = () => new Promise((resolve) => setImmediate(resolve));
|
|
@@ -3699,10 +3731,11 @@ var VariantBuilder = class {
|
|
|
3699
3731
|
this.steps = [
|
|
3700
3732
|
new PrepareDirectoriesStep(),
|
|
3701
3733
|
new InstallNpmStep(),
|
|
3702
|
-
new TeamModeStep(),
|
|
3703
|
-
// Patches cli.js for team mode (if enabled)
|
|
3704
3734
|
new WriteConfigStep(),
|
|
3705
3735
|
new BrandThemeStep(),
|
|
3736
|
+
// Creates tweakcc/config.json
|
|
3737
|
+
new TeamModeStep(),
|
|
3738
|
+
// Patches cli.js and configures team toolset (needs config.json)
|
|
3706
3739
|
new TweakccStep(),
|
|
3707
3740
|
new WrapperStep(),
|
|
3708
3741
|
new ShellEnvStep(),
|
|
@@ -3722,11 +3755,11 @@ var VariantBuilder = class {
|
|
|
3722
3755
|
const binDir = params.binDir ?? DEFAULT_BIN_DIR;
|
|
3723
3756
|
const resolvedRoot = expandTilde(rootDir) ?? rootDir;
|
|
3724
3757
|
const resolvedBin = expandTilde(binDir) ?? binDir;
|
|
3725
|
-
const variantDir =
|
|
3726
|
-
const configDir =
|
|
3727
|
-
const tweakDir =
|
|
3728
|
-
const wrapperPath =
|
|
3729
|
-
const npmDir =
|
|
3758
|
+
const variantDir = path16.join(resolvedRoot, params.name);
|
|
3759
|
+
const configDir = path16.join(variantDir, "config");
|
|
3760
|
+
const tweakDir = path16.join(variantDir, "tweakcc");
|
|
3761
|
+
const wrapperPath = path16.join(resolvedBin, params.name);
|
|
3762
|
+
const npmDir = path16.join(variantDir, "npm");
|
|
3730
3763
|
const paths = {
|
|
3731
3764
|
resolvedRoot,
|
|
3732
3765
|
resolvedBin,
|
|
@@ -3739,7 +3772,6 @@ var VariantBuilder = class {
|
|
|
3739
3772
|
const resolvedNpmPackage = normalizeNpmPackage(params.npmPackage);
|
|
3740
3773
|
const resolvedNpmVersion = normalizeNpmVersion();
|
|
3741
3774
|
const promptPackPreference = params.promptPack ?? shouldEnablePromptPack(params.providerKey, provider);
|
|
3742
|
-
const promptPackModePreference = params.promptPackMode ?? defaultPromptPackMode(params.providerKey);
|
|
3743
3775
|
const promptPackEnabled = !params.noTweak && promptPackPreference;
|
|
3744
3776
|
const skillInstallEnabled = params.skillInstall ?? shouldInstallSkills(params.providerKey);
|
|
3745
3777
|
const shellEnvEnabled = params.shellEnv ?? shouldEnableShellEnv(params.providerKey);
|
|
@@ -3749,7 +3781,6 @@ var VariantBuilder = class {
|
|
|
3749
3781
|
resolvedNpmPackage,
|
|
3750
3782
|
resolvedNpmVersion,
|
|
3751
3783
|
promptPackPreference,
|
|
3752
|
-
promptPackModePreference,
|
|
3753
3784
|
promptPackEnabled,
|
|
3754
3785
|
skillInstallEnabled,
|
|
3755
3786
|
shellEnvEnabled,
|
|
@@ -3823,7 +3854,7 @@ var VariantBuilder = class {
|
|
|
3823
3854
|
};
|
|
3824
3855
|
|
|
3825
3856
|
// src/core/variant-builder/VariantUpdater.ts
|
|
3826
|
-
import
|
|
3857
|
+
import path21 from "node:path";
|
|
3827
3858
|
|
|
3828
3859
|
// src/core/variant-builder/update-steps/InstallNpmUpdateStep.ts
|
|
3829
3860
|
var InstallNpmUpdateStep = class {
|
|
@@ -3858,8 +3889,8 @@ var InstallNpmUpdateStep = class {
|
|
|
3858
3889
|
};
|
|
3859
3890
|
|
|
3860
3891
|
// src/core/variant-builder/update-steps/TeamModeUpdateStep.ts
|
|
3861
|
-
import
|
|
3862
|
-
import
|
|
3892
|
+
import fs12 from "node:fs";
|
|
3893
|
+
import path17 from "node:path";
|
|
3863
3894
|
var TEAM_MODE_DISABLED2 = "function sU(){return!1}";
|
|
3864
3895
|
var TEAM_MODE_ENABLED2 = "function sU(){return!0}";
|
|
3865
3896
|
var TeamModeUpdateStep = class {
|
|
@@ -3892,31 +3923,39 @@ var TeamModeUpdateStep = class {
|
|
|
3892
3923
|
this.patchCli(ctx);
|
|
3893
3924
|
}
|
|
3894
3925
|
unpatchCli(ctx) {
|
|
3895
|
-
const { state, meta } = ctx;
|
|
3896
|
-
const cliPath =
|
|
3897
|
-
if (!
|
|
3926
|
+
const { state, meta, paths } = ctx;
|
|
3927
|
+
const cliPath = path17.join(paths.npmDir, "node_modules", "@anthropic-ai", "claude-code", "cli.js");
|
|
3928
|
+
if (!fs12.existsSync(cliPath)) {
|
|
3898
3929
|
state.notes.push("Warning: cli.js not found, skipping team mode unpatch");
|
|
3930
|
+
this.removeSkill(ctx);
|
|
3899
3931
|
return;
|
|
3900
3932
|
}
|
|
3901
|
-
let content =
|
|
3933
|
+
let content = fs12.readFileSync(cliPath, "utf8");
|
|
3902
3934
|
if (content.includes(TEAM_MODE_DISABLED2)) {
|
|
3903
3935
|
state.notes.push("Team mode already disabled");
|
|
3904
3936
|
meta.teamModeEnabled = false;
|
|
3937
|
+
this.removeSkill(ctx);
|
|
3905
3938
|
return;
|
|
3906
3939
|
}
|
|
3907
3940
|
if (!content.includes(TEAM_MODE_ENABLED2)) {
|
|
3908
3941
|
state.notes.push("Warning: Team mode function not found in cli.js");
|
|
3942
|
+
this.removeSkill(ctx);
|
|
3909
3943
|
return;
|
|
3910
3944
|
}
|
|
3911
3945
|
content = content.replace(TEAM_MODE_ENABLED2, TEAM_MODE_DISABLED2);
|
|
3912
|
-
|
|
3913
|
-
const verifyContent =
|
|
3946
|
+
fs12.writeFileSync(cliPath, content);
|
|
3947
|
+
const verifyContent = fs12.readFileSync(cliPath, "utf8");
|
|
3914
3948
|
if (!verifyContent.includes(TEAM_MODE_DISABLED2)) {
|
|
3915
3949
|
state.notes.push("Warning: Team mode unpatch verification failed");
|
|
3950
|
+
this.removeSkill(ctx);
|
|
3916
3951
|
return;
|
|
3917
3952
|
}
|
|
3918
3953
|
meta.teamModeEnabled = false;
|
|
3919
3954
|
state.notes.push("Team mode disabled successfully");
|
|
3955
|
+
this.removeSkill(ctx);
|
|
3956
|
+
}
|
|
3957
|
+
removeSkill(ctx) {
|
|
3958
|
+
const { state, meta } = ctx;
|
|
3920
3959
|
const skillResult = removeOrchestratorSkill(meta.configDir);
|
|
3921
3960
|
if (skillResult.status === "removed") {
|
|
3922
3961
|
state.notes.push("Multi-agent orchestrator skill removed");
|
|
@@ -3925,17 +3964,17 @@ var TeamModeUpdateStep = class {
|
|
|
3925
3964
|
}
|
|
3926
3965
|
}
|
|
3927
3966
|
patchCli(ctx) {
|
|
3928
|
-
const { state, meta, name } = ctx;
|
|
3929
|
-
const cliPath =
|
|
3967
|
+
const { state, meta, name, paths } = ctx;
|
|
3968
|
+
const cliPath = path17.join(paths.npmDir, "node_modules", "@anthropic-ai", "claude-code", "cli.js");
|
|
3930
3969
|
const backupPath = `${cliPath}.backup`;
|
|
3931
|
-
if (!
|
|
3970
|
+
if (!fs12.existsSync(cliPath)) {
|
|
3932
3971
|
state.notes.push("Warning: cli.js not found, skipping team mode patch");
|
|
3933
3972
|
return;
|
|
3934
3973
|
}
|
|
3935
|
-
if (!
|
|
3936
|
-
|
|
3974
|
+
if (!fs12.existsSync(backupPath)) {
|
|
3975
|
+
fs12.copyFileSync(cliPath, backupPath);
|
|
3937
3976
|
}
|
|
3938
|
-
let content =
|
|
3977
|
+
let content = fs12.readFileSync(cliPath, "utf8");
|
|
3939
3978
|
if (content.includes(TEAM_MODE_ENABLED2)) {
|
|
3940
3979
|
state.notes.push("Team mode already enabled");
|
|
3941
3980
|
meta.teamModeEnabled = true;
|
|
@@ -3946,16 +3985,16 @@ var TeamModeUpdateStep = class {
|
|
|
3946
3985
|
return;
|
|
3947
3986
|
}
|
|
3948
3987
|
content = content.replace(TEAM_MODE_DISABLED2, TEAM_MODE_ENABLED2);
|
|
3949
|
-
|
|
3950
|
-
const verifyContent =
|
|
3988
|
+
fs12.writeFileSync(cliPath, content);
|
|
3989
|
+
const verifyContent = fs12.readFileSync(cliPath, "utf8");
|
|
3951
3990
|
if (!verifyContent.includes(TEAM_MODE_ENABLED2)) {
|
|
3952
3991
|
state.notes.push("Warning: Team mode patch verification failed");
|
|
3953
3992
|
return;
|
|
3954
3993
|
}
|
|
3955
|
-
const settingsPath =
|
|
3956
|
-
if (
|
|
3994
|
+
const settingsPath = path17.join(meta.configDir, "settings.json");
|
|
3995
|
+
if (fs12.existsSync(settingsPath)) {
|
|
3957
3996
|
try {
|
|
3958
|
-
const settings = JSON.parse(
|
|
3997
|
+
const settings = JSON.parse(fs12.readFileSync(settingsPath, "utf8"));
|
|
3959
3998
|
settings.env = settings.env || {};
|
|
3960
3999
|
if (!settings.env.CLAUDE_CODE_TEAM_NAME) {
|
|
3961
4000
|
settings.env.CLAUDE_CODE_TEAM_NAME = name;
|
|
@@ -3963,7 +4002,12 @@ var TeamModeUpdateStep = class {
|
|
|
3963
4002
|
if (!settings.env.CLAUDE_CODE_AGENT_TYPE) {
|
|
3964
4003
|
settings.env.CLAUDE_CODE_AGENT_TYPE = "team-lead";
|
|
3965
4004
|
}
|
|
3966
|
-
|
|
4005
|
+
settings.permissions = settings.permissions || {};
|
|
4006
|
+
settings.permissions.allow = settings.permissions.allow || [];
|
|
4007
|
+
if (!settings.permissions.allow.includes("Skill(orchestration)")) {
|
|
4008
|
+
settings.permissions.allow.push("Skill(orchestration)");
|
|
4009
|
+
}
|
|
4010
|
+
fs12.writeFileSync(settingsPath, JSON.stringify(settings, null, 2));
|
|
3967
4011
|
} catch {
|
|
3968
4012
|
state.notes.push("Warning: Could not update settings.json with team env vars");
|
|
3969
4013
|
}
|
|
@@ -3976,6 +4020,15 @@ var TeamModeUpdateStep = class {
|
|
|
3976
4020
|
} else if (skillResult.status === "failed") {
|
|
3977
4021
|
state.notes.push(`Warning: orchestrator skill install failed: ${skillResult.message}`);
|
|
3978
4022
|
}
|
|
4023
|
+
const systemPromptsDir = path17.join(meta.tweakDir, "system-prompts");
|
|
4024
|
+
const copiedFiles = copyTeamPackPrompts(systemPromptsDir);
|
|
4025
|
+
if (copiedFiles.length > 0) {
|
|
4026
|
+
state.notes.push(`Team pack prompts installed (${copiedFiles.join(", ")})`);
|
|
4027
|
+
}
|
|
4028
|
+
const tweakccConfigPath = path17.join(meta.tweakDir, "config.json");
|
|
4029
|
+
if (configureTeamToolset(tweakccConfigPath)) {
|
|
4030
|
+
state.notes.push("Team toolset configured (TodoWrite blocked)");
|
|
4031
|
+
}
|
|
3979
4032
|
}
|
|
3980
4033
|
};
|
|
3981
4034
|
|
|
@@ -4037,13 +4090,13 @@ ${tweakResult.stdout ?? ""}`.trim();
|
|
|
4037
4090
|
}
|
|
4038
4091
|
if (prefs.promptPackEnabled) {
|
|
4039
4092
|
if (isAsync) {
|
|
4040
|
-
await ctx.report(
|
|
4093
|
+
await ctx.report("Applying prompt pack...");
|
|
4041
4094
|
} else {
|
|
4042
|
-
ctx.report(
|
|
4095
|
+
ctx.report("Applying prompt pack...");
|
|
4043
4096
|
}
|
|
4044
|
-
const packResult = applyPromptPack(meta.tweakDir, meta.provider
|
|
4097
|
+
const packResult = applyPromptPack(meta.tweakDir, meta.provider);
|
|
4045
4098
|
if (packResult.changed) {
|
|
4046
|
-
state.notes.push(`Prompt pack applied (${packResult.
|
|
4099
|
+
state.notes.push(`Prompt pack applied (${packResult.updated.join(", ")})`);
|
|
4047
4100
|
if (isAsync) {
|
|
4048
4101
|
await ctx.report("Re-applying tweakcc...");
|
|
4049
4102
|
} else {
|
|
@@ -4062,7 +4115,7 @@ ${reapply.stdout ?? ""}`.trim();
|
|
|
4062
4115
|
};
|
|
4063
4116
|
|
|
4064
4117
|
// src/core/variant-builder/update-steps/WrapperUpdateStep.ts
|
|
4065
|
-
import
|
|
4118
|
+
import path18 from "node:path";
|
|
4066
4119
|
var WrapperUpdateStep = class {
|
|
4067
4120
|
name = "Wrapper";
|
|
4068
4121
|
execute(ctx) {
|
|
@@ -4080,7 +4133,7 @@ var WrapperUpdateStep = class {
|
|
|
4080
4133
|
const resolvedBin = opts.binDir ? expandTilde(opts.binDir) ?? opts.binDir : meta.binDir;
|
|
4081
4134
|
if (resolvedBin) {
|
|
4082
4135
|
ensureDir(resolvedBin);
|
|
4083
|
-
const wrapperPath =
|
|
4136
|
+
const wrapperPath = path18.join(resolvedBin, name);
|
|
4084
4137
|
writeWrapper(wrapperPath, meta.configDir, meta.binaryPath, "node");
|
|
4085
4138
|
meta.binDir = resolvedBin;
|
|
4086
4139
|
}
|
|
@@ -4172,7 +4225,7 @@ var ShellEnvUpdateStep = class {
|
|
|
4172
4225
|
};
|
|
4173
4226
|
|
|
4174
4227
|
// src/core/variant-builder/update-steps/SkillInstallUpdateStep.ts
|
|
4175
|
-
import
|
|
4228
|
+
import path19 from "node:path";
|
|
4176
4229
|
var SkillInstallUpdateStep = class {
|
|
4177
4230
|
name = "SkillInstall";
|
|
4178
4231
|
execute(ctx) {
|
|
@@ -4192,7 +4245,7 @@ var SkillInstallUpdateStep = class {
|
|
|
4192
4245
|
const skillOpts = {
|
|
4193
4246
|
install: true,
|
|
4194
4247
|
update: prefs.skillUpdateEnabled,
|
|
4195
|
-
targetDir:
|
|
4248
|
+
targetDir: path19.join(meta.configDir, "skills")
|
|
4196
4249
|
};
|
|
4197
4250
|
const skillResult = isAsync ? await ensureDevBrowserSkillAsync(skillOpts) : ensureDevBrowserSkill(skillOpts);
|
|
4198
4251
|
if (skillResult.status === "failed") {
|
|
@@ -4204,7 +4257,7 @@ var SkillInstallUpdateStep = class {
|
|
|
4204
4257
|
};
|
|
4205
4258
|
|
|
4206
4259
|
// src/core/variant-builder/update-steps/FinalizeUpdateStep.ts
|
|
4207
|
-
import
|
|
4260
|
+
import path20 from "node:path";
|
|
4208
4261
|
var FinalizeUpdateStep = class {
|
|
4209
4262
|
name = "Finalize";
|
|
4210
4263
|
execute(ctx) {
|
|
@@ -4219,10 +4272,10 @@ var FinalizeUpdateStep = class {
|
|
|
4219
4272
|
const { meta, paths, prefs } = ctx;
|
|
4220
4273
|
meta.updatedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
4221
4274
|
meta.promptPack = prefs.promptPackPreference;
|
|
4222
|
-
meta.promptPackMode = prefs.promptPackModePreference;
|
|
4223
4275
|
meta.skillInstall = prefs.skillInstallEnabled;
|
|
4224
4276
|
meta.shellEnv = prefs.shellEnvEnabled;
|
|
4225
|
-
|
|
4277
|
+
delete meta.promptPackMode;
|
|
4278
|
+
writeJson(path20.join(paths.variantDir, "variant.json"), meta);
|
|
4226
4279
|
}
|
|
4227
4280
|
};
|
|
4228
4281
|
|
|
@@ -4234,7 +4287,6 @@ var shouldEnablePromptPack2 = (providerKey) => {
|
|
|
4234
4287
|
if (provider?.noPromptPack) return false;
|
|
4235
4288
|
return providerKey === "zai" || providerKey === "minimax";
|
|
4236
4289
|
};
|
|
4237
|
-
var defaultPromptPackMode2 = (providerKey) => providerKey === "zai" || providerKey === "minimax" ? "maximal" : "minimal";
|
|
4238
4290
|
var shouldInstallSkills2 = (providerKey) => providerKey === "zai" || providerKey === "minimax";
|
|
4239
4291
|
var shouldEnableShellEnv2 = (providerKey) => providerKey === "zai";
|
|
4240
4292
|
var yieldToEventLoop2 = () => new Promise((resolve) => setImmediate(resolve));
|
|
@@ -4260,13 +4312,12 @@ var VariantUpdater = class {
|
|
|
4260
4312
|
*/
|
|
4261
4313
|
initContext(rootDir, name, opts) {
|
|
4262
4314
|
const resolvedRoot = expandTilde(rootDir || DEFAULT_ROOT) ?? rootDir;
|
|
4263
|
-
const variantDir =
|
|
4315
|
+
const variantDir = path21.join(resolvedRoot, name);
|
|
4264
4316
|
const meta = loadVariantMeta(variantDir);
|
|
4265
4317
|
if (!meta) throw new Error(`Variant not found: ${name}`);
|
|
4266
4318
|
const resolvedNpmPackage = normalizeNpmPackage2(opts.npmPackage ?? meta.npmPackage);
|
|
4267
4319
|
const resolvedNpmVersion = normalizeNpmVersion2();
|
|
4268
4320
|
const promptPackPreference = opts.promptPack ?? meta.promptPack ?? shouldEnablePromptPack2(meta.provider);
|
|
4269
|
-
const promptPackModePreference = opts.promptPackMode ?? meta.promptPackMode ?? defaultPromptPackMode2(meta.provider);
|
|
4270
4321
|
const promptPackEnabled = !opts.noTweak && promptPackPreference;
|
|
4271
4322
|
const skillInstallEnabled = opts.skillInstall ?? meta.skillInstall ?? shouldInstallSkills2(meta.provider);
|
|
4272
4323
|
const shellEnvEnabled = opts.shellEnv ?? meta.shellEnv ?? shouldEnableShellEnv2(meta.provider);
|
|
@@ -4276,13 +4327,12 @@ var VariantUpdater = class {
|
|
|
4276
4327
|
resolvedRoot,
|
|
4277
4328
|
resolvedBin: opts.binDir ? expandTilde(opts.binDir) ?? opts.binDir : meta.binDir,
|
|
4278
4329
|
variantDir,
|
|
4279
|
-
npmDir: meta.npmDir ||
|
|
4330
|
+
npmDir: meta.npmDir || path21.join(variantDir, "npm")
|
|
4280
4331
|
};
|
|
4281
4332
|
const prefs = {
|
|
4282
4333
|
resolvedNpmPackage,
|
|
4283
4334
|
resolvedNpmVersion,
|
|
4284
4335
|
promptPackPreference,
|
|
4285
|
-
promptPackModePreference,
|
|
4286
4336
|
promptPackEnabled,
|
|
4287
4337
|
skillInstallEnabled,
|
|
4288
4338
|
shellEnvEnabled,
|
|
@@ -4364,17 +4414,17 @@ var updateVariant = (rootDir, name, opts = {}) => {
|
|
|
4364
4414
|
};
|
|
4365
4415
|
var removeVariant = (rootDir, name) => {
|
|
4366
4416
|
const resolvedRoot = expandTilde(rootDir || DEFAULT_ROOT) ?? rootDir;
|
|
4367
|
-
const variantDir =
|
|
4368
|
-
if (!
|
|
4369
|
-
|
|
4417
|
+
const variantDir = path22.join(resolvedRoot, name);
|
|
4418
|
+
if (!fs13.existsSync(variantDir)) throw new Error(`Variant not found: ${name}`);
|
|
4419
|
+
fs13.rmSync(variantDir, { recursive: true, force: true });
|
|
4370
4420
|
};
|
|
4371
4421
|
var doctor = (rootDir, binDir) => {
|
|
4372
4422
|
const resolvedRoot = expandTilde(rootDir || DEFAULT_ROOT) ?? rootDir;
|
|
4373
4423
|
const resolvedBin = expandTilde(binDir || DEFAULT_BIN_DIR) ?? binDir;
|
|
4374
4424
|
const variants = listVariants(resolvedRoot);
|
|
4375
4425
|
return variants.map(({ name, meta }) => {
|
|
4376
|
-
const wrapperPath =
|
|
4377
|
-
const ok = Boolean(meta &&
|
|
4426
|
+
const wrapperPath = path22.join(resolvedBin, name);
|
|
4427
|
+
const ok = Boolean(meta && fs13.existsSync(meta.binaryPath) && fs13.existsSync(wrapperPath));
|
|
4378
4428
|
return {
|
|
4379
4429
|
name,
|
|
4380
4430
|
ok,
|
|
@@ -4386,7 +4436,7 @@ var doctor = (rootDir, binDir) => {
|
|
|
4386
4436
|
var listVariants2 = (rootDir) => listVariants(rootDir);
|
|
4387
4437
|
var tweakVariant = (rootDir, name) => {
|
|
4388
4438
|
const resolvedRoot = expandTilde(rootDir || DEFAULT_ROOT) ?? rootDir;
|
|
4389
|
-
const variantDir =
|
|
4439
|
+
const variantDir = path22.join(resolvedRoot, name);
|
|
4390
4440
|
const meta = loadVariantMeta(variantDir);
|
|
4391
4441
|
if (!meta) throw new Error(`Variant not found: ${name}`);
|
|
4392
4442
|
ensureDir(meta.tweakDir);
|
|
@@ -4401,26 +4451,37 @@ ${result.stdout ?? ""}`.trim();
|
|
|
4401
4451
|
};
|
|
4402
4452
|
|
|
4403
4453
|
// src/tui/hooks/useVariantCreate.ts
|
|
4404
|
-
import { useEffect } from "react";
|
|
4405
|
-
import
|
|
4454
|
+
import { useEffect, useRef } from "react";
|
|
4455
|
+
import path23 from "node:path";
|
|
4406
4456
|
function buildCreateSummary(params) {
|
|
4407
4457
|
const {
|
|
4408
4458
|
providerLabel,
|
|
4409
4459
|
npmPackage,
|
|
4410
4460
|
npmVersion,
|
|
4411
4461
|
usePromptPack,
|
|
4412
|
-
promptPackMode,
|
|
4413
4462
|
installSkill,
|
|
4463
|
+
enableTeamMode,
|
|
4414
4464
|
modelOverrides,
|
|
4415
4465
|
providerKey,
|
|
4416
4466
|
shellEnv,
|
|
4417
4467
|
notes
|
|
4418
4468
|
} = params;
|
|
4469
|
+
const getPromptPackDescription = () => {
|
|
4470
|
+
if (!usePromptPack) return "off";
|
|
4471
|
+
if (providerKey === "zai") return "on (zai-cli routing)";
|
|
4472
|
+
if (providerKey === "minimax") return "on (MCP routing)";
|
|
4473
|
+
return "on";
|
|
4474
|
+
};
|
|
4475
|
+
const getTeamModeDescription = () => {
|
|
4476
|
+
if (!enableTeamMode) return "off";
|
|
4477
|
+
return "on (orchestrator skill, TodoWrite blocked)";
|
|
4478
|
+
};
|
|
4419
4479
|
return [
|
|
4420
4480
|
`Provider: ${providerLabel}`,
|
|
4421
4481
|
`Install: npm ${npmPackage}@${npmVersion}`,
|
|
4422
|
-
`Prompt pack: ${
|
|
4482
|
+
`Prompt pack: ${getPromptPackDescription()}`,
|
|
4423
4483
|
`dev-browser skill: ${installSkill ? "on" : "off"}`,
|
|
4484
|
+
`Team mode: ${getTeamModeDescription()}`,
|
|
4424
4485
|
...modelOverrides.sonnet || modelOverrides.opus || modelOverrides.haiku ? [
|
|
4425
4486
|
`Models: sonnet=${modelOverrides.sonnet || "-"}, opus=${modelOverrides.opus || "-"}, haiku=${modelOverrides.haiku || "-"}`
|
|
4426
4487
|
] : [],
|
|
@@ -4433,7 +4494,7 @@ function buildCreateNextSteps(name, rootDir) {
|
|
|
4433
4494
|
`Run: ${name}`,
|
|
4434
4495
|
`Update: cc-mirror update ${name}`,
|
|
4435
4496
|
`Tweak: cc-mirror tweak ${name}`,
|
|
4436
|
-
`Config: ${
|
|
4497
|
+
`Config: ${path23.join(rootDir, name, "config", "settings.json")}`
|
|
4437
4498
|
];
|
|
4438
4499
|
}
|
|
4439
4500
|
function buildHelpLines() {
|
|
@@ -4441,8 +4502,11 @@ function buildHelpLines() {
|
|
|
4441
4502
|
}
|
|
4442
4503
|
function useVariantCreate(options) {
|
|
4443
4504
|
const { screen, params, core, setProgressLines, setScreen, onComplete } = options;
|
|
4505
|
+
const isRunningRef = useRef(false);
|
|
4444
4506
|
useEffect(() => {
|
|
4445
4507
|
if (screen !== "create-running") return;
|
|
4508
|
+
if (isRunningRef.current) return;
|
|
4509
|
+
isRunningRef.current = true;
|
|
4446
4510
|
let cancelled = false;
|
|
4447
4511
|
const runCreate = async () => {
|
|
4448
4512
|
try {
|
|
@@ -4461,10 +4525,10 @@ function useVariantCreate(options) {
|
|
|
4461
4525
|
noTweak: false,
|
|
4462
4526
|
// Always apply tweakcc patches
|
|
4463
4527
|
promptPack: params.usePromptPack,
|
|
4464
|
-
promptPackMode: params.promptPackMode,
|
|
4465
4528
|
skillInstall: params.installSkill,
|
|
4466
4529
|
shellEnv: params.shellEnv,
|
|
4467
4530
|
skillUpdate: params.skillUpdate,
|
|
4531
|
+
enableTeamMode: params.enableTeamMode,
|
|
4468
4532
|
tweakccStdio: "pipe",
|
|
4469
4533
|
onProgress: (step) => setProgressLines((prev) => [...prev, step])
|
|
4470
4534
|
};
|
|
@@ -4476,8 +4540,8 @@ function useVariantCreate(options) {
|
|
|
4476
4540
|
npmPackage: params.npmPackage,
|
|
4477
4541
|
npmVersion: params.npmVersion,
|
|
4478
4542
|
usePromptPack: params.usePromptPack,
|
|
4479
|
-
promptPackMode: params.promptPackMode,
|
|
4480
4543
|
installSkill: params.installSkill,
|
|
4544
|
+
enableTeamMode: params.enableTeamMode,
|
|
4481
4545
|
modelOverrides: params.modelOverrides,
|
|
4482
4546
|
providerKey: params.providerKey,
|
|
4483
4547
|
shellEnv: params.shellEnv,
|
|
@@ -4487,7 +4551,7 @@ function useVariantCreate(options) {
|
|
|
4487
4551
|
doneLines: [
|
|
4488
4552
|
`Variant created: ${params.name}`,
|
|
4489
4553
|
`Wrapper: ${result.wrapperPath}`,
|
|
4490
|
-
`Config: ${
|
|
4554
|
+
`Config: ${path23.join(params.rootDir, params.name, "config")}`
|
|
4491
4555
|
],
|
|
4492
4556
|
summary,
|
|
4493
4557
|
nextSteps: buildCreateNextSteps(params.name, params.rootDir),
|
|
@@ -4504,23 +4568,38 @@ function useVariantCreate(options) {
|
|
|
4504
4568
|
help: []
|
|
4505
4569
|
});
|
|
4506
4570
|
}
|
|
4507
|
-
if (!cancelled)
|
|
4571
|
+
if (!cancelled) {
|
|
4572
|
+
isRunningRef.current = false;
|
|
4573
|
+
setScreen("create-done");
|
|
4574
|
+
}
|
|
4508
4575
|
};
|
|
4509
4576
|
runCreate();
|
|
4510
4577
|
return () => {
|
|
4511
4578
|
cancelled = true;
|
|
4579
|
+
isRunningRef.current = false;
|
|
4512
4580
|
};
|
|
4513
4581
|
}, [screen, params, core, setProgressLines, setScreen, onComplete]);
|
|
4514
4582
|
}
|
|
4515
4583
|
|
|
4516
4584
|
// src/tui/hooks/useVariantUpdate.ts
|
|
4517
|
-
import { useEffect as useEffect2 } from "react";
|
|
4518
|
-
import
|
|
4585
|
+
import { useEffect as useEffect2, useRef as useRef2 } from "react";
|
|
4586
|
+
import path24 from "node:path";
|
|
4519
4587
|
function buildUpdateSummary(meta, notes) {
|
|
4588
|
+
const getPromptPackDescription = () => {
|
|
4589
|
+
if (!meta.promptPack) return "off";
|
|
4590
|
+
if (meta.provider === "zai") return "on (zai-cli routing)";
|
|
4591
|
+
if (meta.provider === "minimax") return "on (MCP routing)";
|
|
4592
|
+
return "on";
|
|
4593
|
+
};
|
|
4594
|
+
const getTeamModeDescription = () => {
|
|
4595
|
+
if (!meta.teamModeEnabled) return "off";
|
|
4596
|
+
return "on (orchestrator skill, TodoWrite blocked)";
|
|
4597
|
+
};
|
|
4520
4598
|
return [
|
|
4521
4599
|
`Provider: ${meta.provider}`,
|
|
4522
|
-
`Prompt pack: ${
|
|
4600
|
+
`Prompt pack: ${getPromptPackDescription()}`,
|
|
4523
4601
|
`dev-browser skill: ${meta.skillInstall ? "on" : "off"}`,
|
|
4602
|
+
`Team mode: ${getTeamModeDescription()}`,
|
|
4524
4603
|
...meta.provider === "zai" ? [`Shell env: ${meta.shellEnv ? "write Z_AI_API_KEY" : "manual"}`] : [],
|
|
4525
4604
|
...notes || []
|
|
4526
4605
|
];
|
|
@@ -4529,14 +4608,17 @@ function buildUpdateNextSteps(name, rootDir) {
|
|
|
4529
4608
|
return [
|
|
4530
4609
|
`Run: ${name}`,
|
|
4531
4610
|
`Tweak: cc-mirror tweak ${name}`,
|
|
4532
|
-
`Config: ${
|
|
4611
|
+
`Config: ${path24.join(rootDir, name, "config", "settings.json")}`
|
|
4533
4612
|
];
|
|
4534
4613
|
}
|
|
4535
4614
|
function useVariantUpdate(options) {
|
|
4536
4615
|
const { screen, selectedVariant, rootDir, binDir, core, setProgressLines, setScreen, onComplete } = options;
|
|
4616
|
+
const isRunningRef = useRef2(false);
|
|
4537
4617
|
useEffect2(() => {
|
|
4538
4618
|
if (screen !== "manage-update") return;
|
|
4539
4619
|
if (!selectedVariant) return;
|
|
4620
|
+
if (isRunningRef.current) return;
|
|
4621
|
+
isRunningRef.current = true;
|
|
4540
4622
|
let cancelled = false;
|
|
4541
4623
|
const runUpdate = async () => {
|
|
4542
4624
|
try {
|
|
@@ -4565,21 +4647,28 @@ function useVariantUpdate(options) {
|
|
|
4565
4647
|
help: []
|
|
4566
4648
|
});
|
|
4567
4649
|
}
|
|
4568
|
-
if (!cancelled)
|
|
4650
|
+
if (!cancelled) {
|
|
4651
|
+
isRunningRef.current = false;
|
|
4652
|
+
setScreen("manage-update-done");
|
|
4653
|
+
}
|
|
4569
4654
|
};
|
|
4570
4655
|
runUpdate();
|
|
4571
4656
|
return () => {
|
|
4572
4657
|
cancelled = true;
|
|
4658
|
+
isRunningRef.current = false;
|
|
4573
4659
|
};
|
|
4574
4660
|
}, [screen, selectedVariant, rootDir, binDir, core, setProgressLines, setScreen, onComplete]);
|
|
4575
4661
|
}
|
|
4576
4662
|
|
|
4577
4663
|
// src/tui/hooks/useUpdateAll.ts
|
|
4578
|
-
import { useEffect as useEffect3 } from "react";
|
|
4664
|
+
import { useEffect as useEffect3, useRef as useRef3 } from "react";
|
|
4579
4665
|
function useUpdateAll(options) {
|
|
4580
4666
|
const { screen, rootDir, binDir, core, setProgressLines, setScreen, onComplete } = options;
|
|
4667
|
+
const isRunningRef = useRef3(false);
|
|
4581
4668
|
useEffect3(() => {
|
|
4582
4669
|
if (screen !== "updateAll") return;
|
|
4670
|
+
if (isRunningRef.current) return;
|
|
4671
|
+
isRunningRef.current = true;
|
|
4583
4672
|
let cancelled = false;
|
|
4584
4673
|
const runUpdateAll = async () => {
|
|
4585
4674
|
const entries = core.listVariants(rootDir);
|
|
@@ -4627,17 +4716,21 @@ function useUpdateAll(options) {
|
|
|
4627
4716
|
help: []
|
|
4628
4717
|
});
|
|
4629
4718
|
}
|
|
4630
|
-
if (!cancelled)
|
|
4719
|
+
if (!cancelled) {
|
|
4720
|
+
isRunningRef.current = false;
|
|
4721
|
+
setScreen("updateAll-done");
|
|
4722
|
+
}
|
|
4631
4723
|
};
|
|
4632
4724
|
runUpdateAll();
|
|
4633
4725
|
return () => {
|
|
4634
4726
|
cancelled = true;
|
|
4727
|
+
isRunningRef.current = false;
|
|
4635
4728
|
};
|
|
4636
4729
|
}, [screen, rootDir, binDir, core, setProgressLines, setScreen, onComplete]);
|
|
4637
4730
|
}
|
|
4638
4731
|
|
|
4639
4732
|
// src/tui/hooks/useModelConfig.ts
|
|
4640
|
-
import { useEffect as useEffect4 } from "react";
|
|
4733
|
+
import { useEffect as useEffect4, useRef as useRef4 } from "react";
|
|
4641
4734
|
function useModelConfig(options) {
|
|
4642
4735
|
const {
|
|
4643
4736
|
screen,
|
|
@@ -4652,9 +4745,12 @@ function useModelConfig(options) {
|
|
|
4652
4745
|
setScreen,
|
|
4653
4746
|
onComplete
|
|
4654
4747
|
} = options;
|
|
4748
|
+
const isRunningRef = useRef4(false);
|
|
4655
4749
|
useEffect4(() => {
|
|
4656
4750
|
if (screen !== "manage-models-saving") return;
|
|
4657
4751
|
if (!selectedVariant) return;
|
|
4752
|
+
if (isRunningRef.current) return;
|
|
4753
|
+
isRunningRef.current = true;
|
|
4658
4754
|
let cancelled = false;
|
|
4659
4755
|
const saveModels = async () => {
|
|
4660
4756
|
try {
|
|
@@ -4700,11 +4796,15 @@ function useModelConfig(options) {
|
|
|
4700
4796
|
help: []
|
|
4701
4797
|
});
|
|
4702
4798
|
}
|
|
4703
|
-
if (!cancelled)
|
|
4799
|
+
if (!cancelled) {
|
|
4800
|
+
isRunningRef.current = false;
|
|
4801
|
+
setScreen("manage-models-done");
|
|
4802
|
+
}
|
|
4704
4803
|
};
|
|
4705
4804
|
saveModels();
|
|
4706
4805
|
return () => {
|
|
4707
4806
|
cancelled = true;
|
|
4807
|
+
isRunningRef.current = false;
|
|
4708
4808
|
};
|
|
4709
4809
|
}, [
|
|
4710
4810
|
screen,
|
|
@@ -4722,12 +4822,15 @@ function useModelConfig(options) {
|
|
|
4722
4822
|
}
|
|
4723
4823
|
|
|
4724
4824
|
// src/tui/hooks/useTeamModeToggle.ts
|
|
4725
|
-
import { useEffect as useEffect5 } from "react";
|
|
4825
|
+
import { useEffect as useEffect5, useRef as useRef5 } from "react";
|
|
4726
4826
|
function useTeamModeToggle(options) {
|
|
4727
4827
|
const { screen, selectedVariant, rootDir, binDir, core, setProgressLines, setScreen, onComplete, refreshVariants } = options;
|
|
4828
|
+
const isRunningRef = useRef5(false);
|
|
4728
4829
|
useEffect5(() => {
|
|
4729
4830
|
if (screen !== "manage-team-mode") return;
|
|
4730
4831
|
if (!selectedVariant) return;
|
|
4832
|
+
if (isRunningRef.current) return;
|
|
4833
|
+
isRunningRef.current = true;
|
|
4731
4834
|
let cancelled = false;
|
|
4732
4835
|
const runToggle = async () => {
|
|
4733
4836
|
try {
|
|
@@ -4765,17 +4868,21 @@ function useTeamModeToggle(options) {
|
|
|
4765
4868
|
help: []
|
|
4766
4869
|
});
|
|
4767
4870
|
}
|
|
4768
|
-
if (!cancelled)
|
|
4871
|
+
if (!cancelled) {
|
|
4872
|
+
isRunningRef.current = false;
|
|
4873
|
+
setScreen("manage-team-mode-done");
|
|
4874
|
+
}
|
|
4769
4875
|
};
|
|
4770
4876
|
runToggle();
|
|
4771
4877
|
return () => {
|
|
4772
4878
|
cancelled = true;
|
|
4879
|
+
isRunningRef.current = false;
|
|
4773
4880
|
};
|
|
4774
|
-
}, [screen, selectedVariant, rootDir, binDir, core, setProgressLines, setScreen, onComplete
|
|
4881
|
+
}, [screen, selectedVariant, rootDir, binDir, core, setProgressLines, setScreen, onComplete]);
|
|
4775
4882
|
}
|
|
4776
4883
|
|
|
4777
4884
|
// src/tui/screens/HomeScreen.tsx
|
|
4778
|
-
import { useState, useRef } from "react";
|
|
4885
|
+
import { useState, useRef as useRef6 } from "react";
|
|
4779
4886
|
import { Box as Box5, Text as Text5, useInput as useInput2 } from "ink";
|
|
4780
4887
|
|
|
4781
4888
|
// src/tui/components/ui/Layout.tsx
|
|
@@ -4960,7 +5067,7 @@ var ProviderCard = ({ provider, selected, disabled = false, docsUrl }) => /* @__
|
|
|
4960
5067
|
provider.baseUrl && !disabled && /* @__PURE__ */ jsx2(Box2, { marginLeft: 3, children: /* @__PURE__ */ jsx2(Text2, { color: colors.primaryBright, dimColor: true, children: provider.baseUrl }) }),
|
|
4961
5068
|
!provider.baseUrl && docsUrl && !disabled && /* @__PURE__ */ jsx2(Box2, { marginLeft: 3, children: /* @__PURE__ */ jsx2(Text2, { color: colors.primaryBright, dimColor: true, children: docsUrl }) })
|
|
4962
5069
|
] });
|
|
4963
|
-
var VariantCard = ({ name, provider, path:
|
|
5070
|
+
var VariantCard = ({ name, provider, path: path26, selected }) => /* @__PURE__ */ jsxs2(Box2, { flexDirection: "column", marginBottom: 1, children: [
|
|
4964
5071
|
/* @__PURE__ */ jsxs2(Box2, { children: [
|
|
4965
5072
|
/* @__PURE__ */ jsxs2(Text2, { color: selected ? colors.gold : colors.textMuted, children: [
|
|
4966
5073
|
selected ? icons.pointer : icons.pointerEmpty,
|
|
@@ -4973,7 +5080,7 @@ var VariantCard = ({ name, provider, path: path25, selected }) => /* @__PURE__ *
|
|
|
4973
5080
|
")"
|
|
4974
5081
|
] })
|
|
4975
5082
|
] }),
|
|
4976
|
-
/* @__PURE__ */ jsx2(Box2, { marginLeft: 3, children: /* @__PURE__ */ jsx2(Text2, { color: colors.primaryBright, dimColor: true, children:
|
|
5083
|
+
/* @__PURE__ */ jsx2(Box2, { marginLeft: 3, children: /* @__PURE__ */ jsx2(Text2, { color: colors.primaryBright, dimColor: true, children: path26 || `~/.local/bin/${name}` }) })
|
|
4977
5084
|
] });
|
|
4978
5085
|
|
|
4979
5086
|
// src/tui/components/ui/Logo.tsx
|
|
@@ -5076,7 +5183,7 @@ var HomeScreen = ({ onSelect }) => {
|
|
|
5076
5183
|
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
5077
5184
|
const [konamiProgress, setKonamiProgress] = useState(0);
|
|
5078
5185
|
const [showEasterEgg, setShowEasterEgg] = useState(false);
|
|
5079
|
-
const greetingRef =
|
|
5186
|
+
const greetingRef = useRef6(getTimeBasedGreeting());
|
|
5080
5187
|
useInput2((input, key) => {
|
|
5081
5188
|
if (showEasterEgg) return;
|
|
5082
5189
|
let keyName = null;
|
|
@@ -5170,9 +5277,9 @@ var PROVIDER_EDUCATION = {
|
|
|
5170
5277
|
features: [
|
|
5171
5278
|
"GLM-4.7 for Sonnet/Opus tasks",
|
|
5172
5279
|
"GLM-4.5-Air for Haiku (fast) tasks",
|
|
5173
|
-
"
|
|
5280
|
+
"Prompt pack with zai-cli routing",
|
|
5174
5281
|
"Gold-themed interface",
|
|
5175
|
-
"
|
|
5282
|
+
"Optional team mode for multi-agent work"
|
|
5176
5283
|
],
|
|
5177
5284
|
bestFor: "Heavy coding with GLM's reasoning capabilities",
|
|
5178
5285
|
models: {
|
|
@@ -5194,9 +5301,10 @@ var PROVIDER_EDUCATION = {
|
|
|
5194
5301
|
tagline: "Coral pulses, unified model",
|
|
5195
5302
|
features: [
|
|
5196
5303
|
"Single model for all tiers",
|
|
5197
|
-
"
|
|
5198
|
-
"MCP tools for web & vision",
|
|
5199
|
-
"Coral-themed interface"
|
|
5304
|
+
"Prompt pack with MCP tool routing",
|
|
5305
|
+
"MCP tools for web search & vision",
|
|
5306
|
+
"Coral-themed interface",
|
|
5307
|
+
"Optional team mode for multi-agent work"
|
|
5200
5308
|
],
|
|
5201
5309
|
bestFor: "Streamlined experience with one powerful model",
|
|
5202
5310
|
models: {
|
|
@@ -5417,7 +5525,7 @@ var ProviderIntroScreen = ({
|
|
|
5417
5525
|
steps2.push("Optional: dev-browser skill");
|
|
5418
5526
|
}
|
|
5419
5527
|
steps2.push("Name your variant");
|
|
5420
|
-
steps2.push("Create
|
|
5528
|
+
steps2.push("Create with team mode enabled");
|
|
5421
5529
|
steps2.push("Authenticate via Claude Code (OAuth or API key)");
|
|
5422
5530
|
return steps2;
|
|
5423
5531
|
}
|
|
@@ -5428,9 +5536,10 @@ var ProviderIntroScreen = ({
|
|
|
5428
5536
|
if (!isQuickSetup) {
|
|
5429
5537
|
steps2.push("Choose a visual theme");
|
|
5430
5538
|
if (education?.hasPromptPack) {
|
|
5431
|
-
steps2.push("
|
|
5539
|
+
steps2.push("Enable/disable prompt pack");
|
|
5432
5540
|
}
|
|
5433
5541
|
steps2.push("Optional: dev-browser skill");
|
|
5542
|
+
steps2.push("Optional: team mode (multi-agent collaboration)");
|
|
5434
5543
|
steps2.push("Optional: custom env vars");
|
|
5435
5544
|
}
|
|
5436
5545
|
steps2.push("Create your variant");
|
|
@@ -5724,10 +5833,22 @@ var SummaryScreen = ({ data, onConfirm, onBack, onCancel }) => {
|
|
|
5724
5833
|
/* @__PURE__ */ jsxs13(Section, { title: "Installation", children: [
|
|
5725
5834
|
/* @__PURE__ */ jsx13(SummaryRow, { label: "Package", value: data.npmPackage }),
|
|
5726
5835
|
/* @__PURE__ */ jsx13(SummaryRow, { label: "Version", value: data.npmVersion }),
|
|
5727
|
-
/* @__PURE__ */ jsx13(
|
|
5728
|
-
|
|
5729
|
-
|
|
5730
|
-
|
|
5836
|
+
/* @__PURE__ */ jsx13(
|
|
5837
|
+
SummaryRow,
|
|
5838
|
+
{
|
|
5839
|
+
label: "Prompt pack",
|
|
5840
|
+
value: data.usePromptPack ? data.providerKey === "zai" ? "on (zai-cli routing)" : data.providerKey === "minimax" ? "on (MCP routing)" : "on" : "off"
|
|
5841
|
+
}
|
|
5842
|
+
),
|
|
5843
|
+
/* @__PURE__ */ jsx13(SummaryRow, { label: "dev-browser skill", value: data.installSkill ? "on" : "off" }),
|
|
5844
|
+
/* @__PURE__ */ jsx13(
|
|
5845
|
+
SummaryRow,
|
|
5846
|
+
{
|
|
5847
|
+
label: "Team mode",
|
|
5848
|
+
value: data.enableTeamMode ? "on (orchestrator skill, TodoWrite blocked)" : "off"
|
|
5849
|
+
}
|
|
5850
|
+
),
|
|
5851
|
+
data.providerKey === "zai" && /* @__PURE__ */ jsx13(SummaryRow, { label: "Shell env", value: data.shellEnv ? "write Z_AI_API_KEY" : "manual" })
|
|
5731
5852
|
] }),
|
|
5732
5853
|
/* @__PURE__ */ jsxs13(Section, { title: "Paths", children: [
|
|
5733
5854
|
/* @__PURE__ */ jsx13(SummaryRow, { label: "Root", value: data.rootDir }),
|
|
@@ -5885,7 +6006,7 @@ var ProgressScreen = ({ title, lines, variantName }) => {
|
|
|
5885
6006
|
};
|
|
5886
6007
|
|
|
5887
6008
|
// src/tui/screens/CompletionScreen.tsx
|
|
5888
|
-
import { useMemo as useMemo2, useState as useState6, useRef as
|
|
6009
|
+
import { useMemo as useMemo2, useState as useState6, useRef as useRef7 } from "react";
|
|
5889
6010
|
import { Box as Box16, Text as Text15, useStdout as useStdout2 } from "ink";
|
|
5890
6011
|
|
|
5891
6012
|
// src/tui/content/haikus.ts
|
|
@@ -5934,7 +6055,7 @@ var CompletionScreen = ({
|
|
|
5934
6055
|
}) => {
|
|
5935
6056
|
const [selectedIndex, setSelectedIndex] = useState6(0);
|
|
5936
6057
|
const { stdout } = useStdout2();
|
|
5937
|
-
const haikuRef =
|
|
6058
|
+
const haikuRef = useRef7(getRandomHaiku(providerKey));
|
|
5938
6059
|
const milestoneMessage = variantCount ? getMilestoneMessage(variantCount) : null;
|
|
5939
6060
|
const lateNightActive = isLateNight();
|
|
5940
6061
|
const wrapText = (text, width) => {
|
|
@@ -6253,9 +6374,6 @@ var ModelConfigScreen = ({
|
|
|
6253
6374
|
setInputBuffer((prev) => prev + input);
|
|
6254
6375
|
}
|
|
6255
6376
|
});
|
|
6256
|
-
React10.useEffect(() => {
|
|
6257
|
-
setters[activeField](inputBuffer);
|
|
6258
|
-
}, [inputBuffer, activeField]);
|
|
6259
6377
|
const allFilled = values.every((v) => v.trim());
|
|
6260
6378
|
return /* @__PURE__ */ jsxs20(
|
|
6261
6379
|
ScreenLayout,
|
|
@@ -6574,6 +6692,9 @@ var FeedbackScreen = ({ onBack }) => {
|
|
|
6574
6692
|
] });
|
|
6575
6693
|
};
|
|
6576
6694
|
|
|
6695
|
+
// src/tui/screens/TeamModeScreen.tsx
|
|
6696
|
+
import { Box as Box25, Text as Text23 } from "ink";
|
|
6697
|
+
|
|
6577
6698
|
// src/tui/components/ui/YesNoSelect.tsx
|
|
6578
6699
|
import { useState as useState12 } from "react";
|
|
6579
6700
|
import { Box as Box24, Text as Text22, useInput as useInput12 } from "ink";
|
|
@@ -6613,8 +6734,29 @@ var YesNoSelect = ({
|
|
|
6613
6734
|
] });
|
|
6614
6735
|
};
|
|
6615
6736
|
|
|
6616
|
-
// src/tui/
|
|
6737
|
+
// src/tui/screens/TeamModeScreen.tsx
|
|
6617
6738
|
import { jsx as jsx25, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
6739
|
+
var TeamModeScreen = ({ onSelect }) => {
|
|
6740
|
+
return /* @__PURE__ */ jsxs25(
|
|
6741
|
+
ScreenLayout,
|
|
6742
|
+
{
|
|
6743
|
+
title: "Team Mode",
|
|
6744
|
+
subtitle: "Multi-agent coordination tools",
|
|
6745
|
+
hints: ["\u2191\u2193 Navigate", "Enter Select", "Esc Back"],
|
|
6746
|
+
children: [
|
|
6747
|
+
/* @__PURE__ */ jsxs25(Box25, { flexDirection: "column", marginBottom: 1, children: [
|
|
6748
|
+
/* @__PURE__ */ jsx25(Text23, { color: colors.textMuted, children: "Team mode adds TaskCreate, TaskGet, TaskUpdate, TaskList tools" }),
|
|
6749
|
+
/* @__PURE__ */ jsx25(Text23, { color: colors.textMuted, children: "for multi-agent coordination and task management." })
|
|
6750
|
+
] }),
|
|
6751
|
+
/* @__PURE__ */ jsx25(Box25, { flexDirection: "column", marginBottom: 1, children: /* @__PURE__ */ jsx25(Text23, { color: colors.primaryBright, children: "Installs: orchestration skill" }) }),
|
|
6752
|
+
/* @__PURE__ */ jsx25(YesNoSelect, { title: "Enable team mode?", onSelect })
|
|
6753
|
+
]
|
|
6754
|
+
}
|
|
6755
|
+
);
|
|
6756
|
+
};
|
|
6757
|
+
|
|
6758
|
+
// src/tui/app.tsx
|
|
6759
|
+
import { jsx as jsx26, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
6618
6760
|
var App = ({
|
|
6619
6761
|
core = core_exports,
|
|
6620
6762
|
providers = providers_exports,
|
|
@@ -6637,10 +6779,11 @@ var App = ({
|
|
|
6637
6779
|
const [npmPackage, setNpmPackage] = useState13(core.DEFAULT_NPM_PACKAGE || "@anthropic-ai/claude-code");
|
|
6638
6780
|
const npmVersion = core.DEFAULT_NPM_VERSION || "2.0.76";
|
|
6639
6781
|
const [usePromptPack, setUsePromptPack] = useState13(true);
|
|
6640
|
-
const
|
|
6782
|
+
const promptPackMode = "minimal";
|
|
6641
6783
|
const [installSkill, setInstallSkill] = useState13(true);
|
|
6642
6784
|
const [shellEnv, setShellEnv] = useState13(true);
|
|
6643
6785
|
const [skillUpdate, setSkillUpdate] = useState13(false);
|
|
6786
|
+
const [enableTeamMode, setEnableTeamMode] = useState13(true);
|
|
6644
6787
|
const [extraEnv, setExtraEnv] = useState13([]);
|
|
6645
6788
|
const [progressLines, setProgressLines] = useState13([]);
|
|
6646
6789
|
const [doneLines, setDoneLines] = useState13([]);
|
|
@@ -6665,7 +6808,6 @@ var App = ({
|
|
|
6665
6808
|
);
|
|
6666
6809
|
const providerDefaults = (key) => ({
|
|
6667
6810
|
promptPack: key === "zai" || key === "minimax",
|
|
6668
|
-
promptPackMode: key === "zai" || key === "minimax" ? "maximal" : "minimal",
|
|
6669
6811
|
skillInstall: key === "zai" || key === "minimax",
|
|
6670
6812
|
shellEnv: key === "zai"
|
|
6671
6813
|
});
|
|
@@ -6722,6 +6864,9 @@ var App = ({
|
|
|
6722
6864
|
case "create-models":
|
|
6723
6865
|
setScreen("create-api-key");
|
|
6724
6866
|
break;
|
|
6867
|
+
case "create-team-mode":
|
|
6868
|
+
setScreen("create-skill-install");
|
|
6869
|
+
break;
|
|
6725
6870
|
// Model configuration screens - back through flow
|
|
6726
6871
|
case "manage-models":
|
|
6727
6872
|
setScreen("manage-actions");
|
|
@@ -6769,6 +6914,9 @@ var App = ({
|
|
|
6769
6914
|
setCompletionNextSteps(result.nextSteps);
|
|
6770
6915
|
setCompletionHelp(result.help);
|
|
6771
6916
|
}, []);
|
|
6917
|
+
const refreshVariants = useCallback(() => {
|
|
6918
|
+
setVariants(core.listVariants(rootDir));
|
|
6919
|
+
}, [core, rootDir]);
|
|
6772
6920
|
const createParams = useMemo3(
|
|
6773
6921
|
() => ({
|
|
6774
6922
|
name,
|
|
@@ -6787,7 +6935,8 @@ var App = ({
|
|
|
6787
6935
|
promptPackMode,
|
|
6788
6936
|
installSkill,
|
|
6789
6937
|
shellEnv,
|
|
6790
|
-
skillUpdate
|
|
6938
|
+
skillUpdate,
|
|
6939
|
+
enableTeamMode
|
|
6791
6940
|
}),
|
|
6792
6941
|
[
|
|
6793
6942
|
name,
|
|
@@ -6806,7 +6955,8 @@ var App = ({
|
|
|
6806
6955
|
promptPackMode,
|
|
6807
6956
|
installSkill,
|
|
6808
6957
|
shellEnv,
|
|
6809
|
-
skillUpdate
|
|
6958
|
+
skillUpdate,
|
|
6959
|
+
enableTeamMode
|
|
6810
6960
|
]
|
|
6811
6961
|
);
|
|
6812
6962
|
useVariantCreate({
|
|
@@ -6858,7 +7008,7 @@ var App = ({
|
|
|
6858
7008
|
setProgressLines,
|
|
6859
7009
|
setScreen,
|
|
6860
7010
|
onComplete: handleOperationComplete,
|
|
6861
|
-
refreshVariants
|
|
7011
|
+
refreshVariants
|
|
6862
7012
|
});
|
|
6863
7013
|
useUpdateAll({
|
|
6864
7014
|
screen,
|
|
@@ -6882,10 +7032,10 @@ var App = ({
|
|
|
6882
7032
|
setNpmPackage(core.DEFAULT_NPM_PACKAGE || "@anthropic-ai/claude-code");
|
|
6883
7033
|
setExtraEnv([]);
|
|
6884
7034
|
setUsePromptPack(true);
|
|
6885
|
-
setPromptPackMode("maximal");
|
|
6886
7035
|
setInstallSkill(true);
|
|
6887
7036
|
setShellEnv(true);
|
|
6888
7037
|
setSkillUpdate(false);
|
|
7038
|
+
setEnableTeamMode(true);
|
|
6889
7039
|
setCompletionSummary([]);
|
|
6890
7040
|
setCompletionNextSteps([]);
|
|
6891
7041
|
setCompletionHelp([]);
|
|
@@ -6897,10 +7047,10 @@ var App = ({
|
|
|
6897
7047
|
}
|
|
6898
7048
|
}, [screen, exit]);
|
|
6899
7049
|
if (screen === "exit") {
|
|
6900
|
-
return /* @__PURE__ */
|
|
7050
|
+
return /* @__PURE__ */ jsx26(Frame, { children: /* @__PURE__ */ jsx26(Header, { title: "CC-MIRROR", subtitle: "Goodbye. Happy coding!" }) });
|
|
6901
7051
|
}
|
|
6902
7052
|
if (screen === "home") {
|
|
6903
|
-
return /* @__PURE__ */
|
|
7053
|
+
return /* @__PURE__ */ jsx26(
|
|
6904
7054
|
HomeScreen,
|
|
6905
7055
|
{
|
|
6906
7056
|
onSelect: (value) => {
|
|
@@ -6923,7 +7073,7 @@ var App = ({
|
|
|
6923
7073
|
);
|
|
6924
7074
|
}
|
|
6925
7075
|
if (screen === "quick-provider") {
|
|
6926
|
-
return /* @__PURE__ */
|
|
7076
|
+
return /* @__PURE__ */ jsx26(
|
|
6927
7077
|
ProviderSelectScreen,
|
|
6928
7078
|
{
|
|
6929
7079
|
providers: providerList,
|
|
@@ -6942,7 +7092,6 @@ var App = ({
|
|
|
6942
7092
|
setExtraEnv([]);
|
|
6943
7093
|
setBrandKey("auto");
|
|
6944
7094
|
setUsePromptPack(defaults.promptPack);
|
|
6945
|
-
setPromptPackMode(defaults.promptPackMode);
|
|
6946
7095
|
setInstallSkill(defaults.skillInstall);
|
|
6947
7096
|
setShellEnv(keyDefaults.detectedFrom === "Z_AI_API_KEY" ? false : defaults.shellEnv);
|
|
6948
7097
|
setScreen("quick-intro");
|
|
@@ -6954,7 +7103,7 @@ var App = ({
|
|
|
6954
7103
|
const keyDefaults = providerKey === "zai" ? resolveZaiApiKey() : { skipPrompt: false };
|
|
6955
7104
|
const requiresModels = Boolean(provider?.requiresModelMapping);
|
|
6956
7105
|
const skipApiKey = keyDefaults.skipPrompt || provider?.credentialOptional;
|
|
6957
|
-
return /* @__PURE__ */
|
|
7106
|
+
return /* @__PURE__ */ jsx26(
|
|
6958
7107
|
ProviderIntroScreen,
|
|
6959
7108
|
{
|
|
6960
7109
|
providerKey: providerKey || "zai",
|
|
@@ -6974,7 +7123,7 @@ var App = ({
|
|
|
6974
7123
|
);
|
|
6975
7124
|
}
|
|
6976
7125
|
if (screen === "quick-api-key") {
|
|
6977
|
-
return /* @__PURE__ */
|
|
7126
|
+
return /* @__PURE__ */ jsx26(
|
|
6978
7127
|
ApiKeyScreen,
|
|
6979
7128
|
{
|
|
6980
7129
|
providerLabel: provider?.label || "Provider",
|
|
@@ -6988,7 +7137,7 @@ var App = ({
|
|
|
6988
7137
|
);
|
|
6989
7138
|
}
|
|
6990
7139
|
if (screen === "quick-models") {
|
|
6991
|
-
return /* @__PURE__ */
|
|
7140
|
+
return /* @__PURE__ */ jsx26(
|
|
6992
7141
|
ModelConfigScreen,
|
|
6993
7142
|
{
|
|
6994
7143
|
title: "Model Configuration",
|
|
@@ -7006,7 +7155,7 @@ var App = ({
|
|
|
7006
7155
|
);
|
|
7007
7156
|
}
|
|
7008
7157
|
if (screen === "quick-ccrouter-url") {
|
|
7009
|
-
return /* @__PURE__ */
|
|
7158
|
+
return /* @__PURE__ */ jsx26(
|
|
7010
7159
|
RouterUrlScreen,
|
|
7011
7160
|
{
|
|
7012
7161
|
value: baseUrl || provider?.baseUrl || "http://127.0.0.1:3456",
|
|
@@ -7017,15 +7166,15 @@ var App = ({
|
|
|
7017
7166
|
);
|
|
7018
7167
|
}
|
|
7019
7168
|
if (screen === "quick-name") {
|
|
7020
|
-
return /* @__PURE__ */
|
|
7021
|
-
/* @__PURE__ */
|
|
7022
|
-
/* @__PURE__ */
|
|
7023
|
-
apiKeyDetectedFrom && /* @__PURE__ */
|
|
7169
|
+
return /* @__PURE__ */ jsxs26(Frame, { children: [
|
|
7170
|
+
/* @__PURE__ */ jsx26(Header, { title: "Variant Name", subtitle: "This becomes the CLI command name" }),
|
|
7171
|
+
/* @__PURE__ */ jsx26(Divider, {}),
|
|
7172
|
+
apiKeyDetectedFrom && /* @__PURE__ */ jsx26(Box26, { marginTop: 1, children: /* @__PURE__ */ jsxs26(Text24, { color: colors.success, children: [
|
|
7024
7173
|
"Detected API key from ",
|
|
7025
7174
|
apiKeyDetectedFrom,
|
|
7026
7175
|
"."
|
|
7027
7176
|
] }) }),
|
|
7028
|
-
/* @__PURE__ */
|
|
7177
|
+
/* @__PURE__ */ jsx26(Box26, { marginY: 1, children: /* @__PURE__ */ jsx26(
|
|
7029
7178
|
TextField,
|
|
7030
7179
|
{
|
|
7031
7180
|
label: "Command name",
|
|
@@ -7039,12 +7188,12 @@ var App = ({
|
|
|
7039
7188
|
hint: "Press Enter to continue"
|
|
7040
7189
|
}
|
|
7041
7190
|
) }),
|
|
7042
|
-
/* @__PURE__ */
|
|
7043
|
-
/* @__PURE__ */
|
|
7191
|
+
/* @__PURE__ */ jsx26(Divider, {}),
|
|
7192
|
+
/* @__PURE__ */ jsx26(HintBar, {})
|
|
7044
7193
|
] });
|
|
7045
7194
|
}
|
|
7046
7195
|
if (screen === "create-provider") {
|
|
7047
|
-
return /* @__PURE__ */
|
|
7196
|
+
return /* @__PURE__ */ jsx26(
|
|
7048
7197
|
ProviderSelectScreen,
|
|
7049
7198
|
{
|
|
7050
7199
|
providers: providerList,
|
|
@@ -7063,7 +7212,6 @@ var App = ({
|
|
|
7063
7212
|
setExtraEnv([]);
|
|
7064
7213
|
setBrandKey("auto");
|
|
7065
7214
|
setUsePromptPack(defaults.promptPack);
|
|
7066
|
-
setPromptPackMode(defaults.promptPackMode);
|
|
7067
7215
|
setInstallSkill(defaults.skillInstall);
|
|
7068
7216
|
setShellEnv(keyDefaults.detectedFrom === "Z_AI_API_KEY" ? false : defaults.shellEnv);
|
|
7069
7217
|
setScreen("create-intro");
|
|
@@ -7072,7 +7220,7 @@ var App = ({
|
|
|
7072
7220
|
);
|
|
7073
7221
|
}
|
|
7074
7222
|
if (screen === "create-intro") {
|
|
7075
|
-
return /* @__PURE__ */
|
|
7223
|
+
return /* @__PURE__ */ jsx26(
|
|
7076
7224
|
ProviderIntroScreen,
|
|
7077
7225
|
{
|
|
7078
7226
|
providerKey: providerKey || "zai",
|
|
@@ -7092,10 +7240,10 @@ var App = ({
|
|
|
7092
7240
|
value: brand.key
|
|
7093
7241
|
}))
|
|
7094
7242
|
];
|
|
7095
|
-
return /* @__PURE__ */
|
|
7096
|
-
/* @__PURE__ */
|
|
7097
|
-
/* @__PURE__ */
|
|
7098
|
-
/* @__PURE__ */
|
|
7243
|
+
return /* @__PURE__ */ jsxs26(Frame, { children: [
|
|
7244
|
+
/* @__PURE__ */ jsx26(Header, { title: "Choose Theme", subtitle: "Optional: re-skin the UI with tweakcc presets" }),
|
|
7245
|
+
/* @__PURE__ */ jsx26(Divider, {}),
|
|
7246
|
+
/* @__PURE__ */ jsx26(Box26, { flexDirection: "column", marginY: 1, children: /* @__PURE__ */ jsx26(
|
|
7099
7247
|
SelectInput,
|
|
7100
7248
|
{
|
|
7101
7249
|
items,
|
|
@@ -7105,8 +7253,8 @@ var App = ({
|
|
|
7105
7253
|
}
|
|
7106
7254
|
}
|
|
7107
7255
|
) }),
|
|
7108
|
-
/* @__PURE__ */
|
|
7109
|
-
/* @__PURE__ */
|
|
7256
|
+
/* @__PURE__ */ jsx26(Divider, {}),
|
|
7257
|
+
/* @__PURE__ */ jsx26(HintBar, { hints: ["Pick a style preset or press Esc to go back"] })
|
|
7110
7258
|
] });
|
|
7111
7259
|
}
|
|
7112
7260
|
if (screen === "create-name") {
|
|
@@ -7116,10 +7264,10 @@ var App = ({
|
|
|
7116
7264
|
return "create-base-url";
|
|
7117
7265
|
};
|
|
7118
7266
|
const nextScreen = getNextScreen();
|
|
7119
|
-
return /* @__PURE__ */
|
|
7120
|
-
/* @__PURE__ */
|
|
7121
|
-
/* @__PURE__ */
|
|
7122
|
-
/* @__PURE__ */
|
|
7267
|
+
return /* @__PURE__ */ jsxs26(Frame, { children: [
|
|
7268
|
+
/* @__PURE__ */ jsx26(Header, { title: "Variant Name", subtitle: "This becomes the CLI command name" }),
|
|
7269
|
+
/* @__PURE__ */ jsx26(Divider, {}),
|
|
7270
|
+
/* @__PURE__ */ jsx26(Box26, { marginY: 1, children: /* @__PURE__ */ jsx26(
|
|
7123
7271
|
TextField,
|
|
7124
7272
|
{
|
|
7125
7273
|
label: "Command name",
|
|
@@ -7130,12 +7278,12 @@ var App = ({
|
|
|
7130
7278
|
hint: "Press Enter to continue"
|
|
7131
7279
|
}
|
|
7132
7280
|
) }),
|
|
7133
|
-
/* @__PURE__ */
|
|
7134
|
-
/* @__PURE__ */
|
|
7281
|
+
/* @__PURE__ */ jsx26(Divider, {}),
|
|
7282
|
+
/* @__PURE__ */ jsx26(HintBar, {})
|
|
7135
7283
|
] });
|
|
7136
7284
|
}
|
|
7137
7285
|
if (screen === "create-ccrouter-url") {
|
|
7138
|
-
return /* @__PURE__ */
|
|
7286
|
+
return /* @__PURE__ */ jsx26(
|
|
7139
7287
|
RouterUrlScreen,
|
|
7140
7288
|
{
|
|
7141
7289
|
value: baseUrl || provider?.baseUrl || "http://127.0.0.1:3456",
|
|
@@ -7147,12 +7295,11 @@ var App = ({
|
|
|
7147
7295
|
}
|
|
7148
7296
|
if (screen === "create-base-url") {
|
|
7149
7297
|
const skipApiKey = providerKey === "zai" && apiKeyDetectedFrom === "Z_AI_API_KEY" || provider?.credentialOptional;
|
|
7150
|
-
const
|
|
7151
|
-
|
|
7152
|
-
|
|
7153
|
-
/* @__PURE__ */
|
|
7154
|
-
/* @__PURE__ */
|
|
7155
|
-
/* @__PURE__ */ jsx25(Box25, { marginY: 1, children: /* @__PURE__ */ jsx25(
|
|
7298
|
+
const nextScreen = "create-skill-install";
|
|
7299
|
+
return /* @__PURE__ */ jsxs26(Frame, { children: [
|
|
7300
|
+
/* @__PURE__ */ jsx26(Header, { title: "Base URL", subtitle: "Custom API endpoint (optional)" }),
|
|
7301
|
+
/* @__PURE__ */ jsx26(Divider, {}),
|
|
7302
|
+
/* @__PURE__ */ jsx26(Box26, { marginY: 1, children: /* @__PURE__ */ jsx26(
|
|
7156
7303
|
TextField,
|
|
7157
7304
|
{
|
|
7158
7305
|
label: "ANTHROPIC_BASE_URL",
|
|
@@ -7163,14 +7310,13 @@ var App = ({
|
|
|
7163
7310
|
hint: "Leave blank to keep provider defaults"
|
|
7164
7311
|
}
|
|
7165
7312
|
) }),
|
|
7166
|
-
/* @__PURE__ */
|
|
7167
|
-
/* @__PURE__ */
|
|
7313
|
+
/* @__PURE__ */ jsx26(Divider, {}),
|
|
7314
|
+
/* @__PURE__ */ jsx26(HintBar, {})
|
|
7168
7315
|
] });
|
|
7169
7316
|
}
|
|
7170
7317
|
if (screen === "create-api-key") {
|
|
7171
|
-
const
|
|
7172
|
-
|
|
7173
|
-
return /* @__PURE__ */ jsx25(
|
|
7318
|
+
const nextScreen = "create-skill-install";
|
|
7319
|
+
return /* @__PURE__ */ jsx26(
|
|
7174
7320
|
ApiKeyScreen,
|
|
7175
7321
|
{
|
|
7176
7322
|
providerLabel: provider?.label || "Provider",
|
|
@@ -7184,9 +7330,8 @@ var App = ({
|
|
|
7184
7330
|
);
|
|
7185
7331
|
}
|
|
7186
7332
|
if (screen === "create-models") {
|
|
7187
|
-
const
|
|
7188
|
-
|
|
7189
|
-
return /* @__PURE__ */ jsx25(
|
|
7333
|
+
const nextScreen = "create-skill-install";
|
|
7334
|
+
return /* @__PURE__ */ jsx26(
|
|
7190
7335
|
ModelConfigScreen,
|
|
7191
7336
|
{
|
|
7192
7337
|
title: "Model Configuration",
|
|
@@ -7204,86 +7349,71 @@ var App = ({
|
|
|
7204
7349
|
);
|
|
7205
7350
|
}
|
|
7206
7351
|
if (screen === "create-prompt-pack") {
|
|
7207
|
-
return /* @__PURE__ */
|
|
7208
|
-
/* @__PURE__ */
|
|
7209
|
-
/* @__PURE__ */
|
|
7210
|
-
/* @__PURE__ */
|
|
7352
|
+
return /* @__PURE__ */ jsxs26(Frame, { children: [
|
|
7353
|
+
/* @__PURE__ */ jsx26(Header, { title: "Prompt Pack", subtitle: "Provider hints for tools and behavior" }),
|
|
7354
|
+
/* @__PURE__ */ jsx26(Divider, {}),
|
|
7355
|
+
/* @__PURE__ */ jsx26(
|
|
7211
7356
|
YesNoSelect,
|
|
7212
7357
|
{
|
|
7213
7358
|
title: "Apply provider prompt pack?",
|
|
7214
7359
|
onSelect: (value) => {
|
|
7215
7360
|
setUsePromptPack(value);
|
|
7216
|
-
if (value) {
|
|
7217
|
-
setScreen("create-prompt-pack-mode");
|
|
7218
|
-
} else {
|
|
7219
|
-
setScreen("create-skill-install");
|
|
7220
|
-
}
|
|
7221
|
-
}
|
|
7222
|
-
}
|
|
7223
|
-
),
|
|
7224
|
-
/* @__PURE__ */ jsx25(Divider, {}),
|
|
7225
|
-
/* @__PURE__ */ jsx25(HintBar, {})
|
|
7226
|
-
] });
|
|
7227
|
-
}
|
|
7228
|
-
if (screen === "create-prompt-pack-mode") {
|
|
7229
|
-
const items = [
|
|
7230
|
-
{ label: "Minimal", value: "minimal" },
|
|
7231
|
-
{ label: "Maximal (recommended)", value: "maximal" }
|
|
7232
|
-
];
|
|
7233
|
-
return /* @__PURE__ */ jsxs25(Frame, { children: [
|
|
7234
|
-
/* @__PURE__ */ jsx25(Header, { title: "Prompt Pack Mode", subtitle: "Minimal keeps it light, maximal enables expert mode" }),
|
|
7235
|
-
/* @__PURE__ */ jsx25(Divider, {}),
|
|
7236
|
-
/* @__PURE__ */ jsx25(Box25, { flexDirection: "column", marginY: 1, children: /* @__PURE__ */ jsx25(
|
|
7237
|
-
SelectInput,
|
|
7238
|
-
{
|
|
7239
|
-
items,
|
|
7240
|
-
initialIndex: promptPackMode === "minimal" ? 0 : 1,
|
|
7241
|
-
onSelect: (item) => {
|
|
7242
|
-
setPromptPackMode(item.value);
|
|
7243
7361
|
setScreen("create-skill-install");
|
|
7244
7362
|
}
|
|
7245
7363
|
}
|
|
7246
|
-
)
|
|
7247
|
-
/* @__PURE__ */
|
|
7248
|
-
/* @__PURE__ */
|
|
7364
|
+
),
|
|
7365
|
+
/* @__PURE__ */ jsx26(Divider, {}),
|
|
7366
|
+
/* @__PURE__ */ jsx26(HintBar, {})
|
|
7249
7367
|
] });
|
|
7250
7368
|
}
|
|
7251
7369
|
if (screen === "create-skill-install") {
|
|
7252
|
-
return /* @__PURE__ */
|
|
7253
|
-
/* @__PURE__ */
|
|
7254
|
-
/* @__PURE__ */
|
|
7255
|
-
/* @__PURE__ */
|
|
7256
|
-
/* @__PURE__ */
|
|
7257
|
-
/* @__PURE__ */
|
|
7370
|
+
return /* @__PURE__ */ jsxs26(Frame, { children: [
|
|
7371
|
+
/* @__PURE__ */ jsx26(Header, { title: "Browser Automation", subtitle: "Navigate, fill forms, screenshot, scrape" }),
|
|
7372
|
+
/* @__PURE__ */ jsx26(Divider, {}),
|
|
7373
|
+
/* @__PURE__ */ jsxs26(Box26, { marginY: 1, flexDirection: "column", children: [
|
|
7374
|
+
/* @__PURE__ */ jsx26(Text24, { color: colors.textMuted, children: "The dev-browser skill adds browser automation to your variant." }),
|
|
7375
|
+
/* @__PURE__ */ jsx26(Text24, { color: colors.primaryBright, children: "https://github.com/SawyerHood/dev-browser" })
|
|
7258
7376
|
] }),
|
|
7259
|
-
/* @__PURE__ */
|
|
7377
|
+
/* @__PURE__ */ jsx26(
|
|
7260
7378
|
YesNoSelect,
|
|
7261
7379
|
{
|
|
7262
7380
|
title: "Install dev-browser skill?",
|
|
7263
7381
|
onSelect: (value) => {
|
|
7264
7382
|
setInstallSkill(value);
|
|
7265
|
-
|
|
7266
|
-
if (apiKeyDetectedFrom === "Z_AI_API_KEY") {
|
|
7267
|
-
setShellEnv(false);
|
|
7268
|
-
setScreen("create-env-confirm");
|
|
7269
|
-
} else {
|
|
7270
|
-
setScreen("create-shell-env");
|
|
7271
|
-
}
|
|
7272
|
-
} else {
|
|
7273
|
-
setScreen("create-env-confirm");
|
|
7274
|
-
}
|
|
7383
|
+
setScreen("create-team-mode");
|
|
7275
7384
|
}
|
|
7276
7385
|
}
|
|
7277
7386
|
),
|
|
7278
|
-
/* @__PURE__ */
|
|
7279
|
-
/* @__PURE__ */
|
|
7387
|
+
/* @__PURE__ */ jsx26(Divider, {}),
|
|
7388
|
+
/* @__PURE__ */ jsx26(HintBar, {})
|
|
7280
7389
|
] });
|
|
7281
7390
|
}
|
|
7391
|
+
if (screen === "create-team-mode") {
|
|
7392
|
+
return /* @__PURE__ */ jsx26(
|
|
7393
|
+
TeamModeScreen,
|
|
7394
|
+
{
|
|
7395
|
+
onSelect: (value) => {
|
|
7396
|
+
setEnableTeamMode(value);
|
|
7397
|
+
if (providerKey === "zai") {
|
|
7398
|
+
if (apiKeyDetectedFrom === "Z_AI_API_KEY") {
|
|
7399
|
+
setShellEnv(false);
|
|
7400
|
+
setScreen("create-env-confirm");
|
|
7401
|
+
} else {
|
|
7402
|
+
setScreen("create-shell-env");
|
|
7403
|
+
}
|
|
7404
|
+
} else {
|
|
7405
|
+
setScreen("create-env-confirm");
|
|
7406
|
+
}
|
|
7407
|
+
},
|
|
7408
|
+
onBack: () => setScreen("create-skill-install")
|
|
7409
|
+
}
|
|
7410
|
+
);
|
|
7411
|
+
}
|
|
7282
7412
|
if (screen === "create-shell-env") {
|
|
7283
|
-
return /* @__PURE__ */
|
|
7284
|
-
/* @__PURE__ */
|
|
7285
|
-
/* @__PURE__ */
|
|
7286
|
-
/* @__PURE__ */
|
|
7413
|
+
return /* @__PURE__ */ jsxs26(Frame, { children: [
|
|
7414
|
+
/* @__PURE__ */ jsx26(Header, { title: "Shell Environment", subtitle: "Write API key to your shell profile" }),
|
|
7415
|
+
/* @__PURE__ */ jsx26(Divider, {}),
|
|
7416
|
+
/* @__PURE__ */ jsx26(
|
|
7287
7417
|
YesNoSelect,
|
|
7288
7418
|
{
|
|
7289
7419
|
title: "Write Z_AI_API_KEY to your shell profile?",
|
|
@@ -7293,15 +7423,15 @@ var App = ({
|
|
|
7293
7423
|
}
|
|
7294
7424
|
}
|
|
7295
7425
|
),
|
|
7296
|
-
/* @__PURE__ */
|
|
7297
|
-
/* @__PURE__ */
|
|
7426
|
+
/* @__PURE__ */ jsx26(Divider, {}),
|
|
7427
|
+
/* @__PURE__ */ jsx26(HintBar, {})
|
|
7298
7428
|
] });
|
|
7299
7429
|
}
|
|
7300
7430
|
if (screen === "create-env-confirm") {
|
|
7301
|
-
return /* @__PURE__ */
|
|
7302
|
-
/* @__PURE__ */
|
|
7303
|
-
/* @__PURE__ */
|
|
7304
|
-
/* @__PURE__ */
|
|
7431
|
+
return /* @__PURE__ */ jsxs26(Frame, { children: [
|
|
7432
|
+
/* @__PURE__ */ jsx26(Header, { title: "Custom Environment", subtitle: "Optional extras beyond the template" }),
|
|
7433
|
+
/* @__PURE__ */ jsx26(Divider, {}),
|
|
7434
|
+
/* @__PURE__ */ jsx26(
|
|
7305
7435
|
YesNoSelect,
|
|
7306
7436
|
{
|
|
7307
7437
|
title: "Add custom env entries?",
|
|
@@ -7315,12 +7445,12 @@ var App = ({
|
|
|
7315
7445
|
}
|
|
7316
7446
|
}
|
|
7317
7447
|
),
|
|
7318
|
-
/* @__PURE__ */
|
|
7319
|
-
/* @__PURE__ */
|
|
7448
|
+
/* @__PURE__ */ jsx26(Divider, {}),
|
|
7449
|
+
/* @__PURE__ */ jsx26(HintBar, {})
|
|
7320
7450
|
] });
|
|
7321
7451
|
}
|
|
7322
7452
|
if (screen === "create-env-add") {
|
|
7323
|
-
return /* @__PURE__ */
|
|
7453
|
+
return /* @__PURE__ */ jsx26(
|
|
7324
7454
|
EnvEditorScreen,
|
|
7325
7455
|
{
|
|
7326
7456
|
envEntries: extraEnv,
|
|
@@ -7333,12 +7463,13 @@ var App = ({
|
|
|
7333
7463
|
const providerLabel = provider?.label || providerKey || "";
|
|
7334
7464
|
const brandPreset = brandList.find((item) => item.key === brandKey);
|
|
7335
7465
|
const brandLabel = brandKey === "auto" ? "Auto (match provider)" : brandKey === "none" ? "None" : brandPreset?.label || brandKey;
|
|
7336
|
-
return /* @__PURE__ */
|
|
7466
|
+
return /* @__PURE__ */ jsx26(
|
|
7337
7467
|
SummaryScreen,
|
|
7338
7468
|
{
|
|
7339
7469
|
data: {
|
|
7340
7470
|
name,
|
|
7341
7471
|
providerLabel,
|
|
7472
|
+
providerKey: providerKey || void 0,
|
|
7342
7473
|
brandLabel,
|
|
7343
7474
|
baseUrl: effectiveBaseUrl,
|
|
7344
7475
|
apiKey,
|
|
@@ -7353,6 +7484,7 @@ var App = ({
|
|
|
7353
7484
|
usePromptPack,
|
|
7354
7485
|
promptPackMode,
|
|
7355
7486
|
installSkill,
|
|
7487
|
+
enableTeamMode,
|
|
7356
7488
|
shellEnv
|
|
7357
7489
|
},
|
|
7358
7490
|
onConfirm: () => {
|
|
@@ -7365,10 +7497,10 @@ var App = ({
|
|
|
7365
7497
|
);
|
|
7366
7498
|
}
|
|
7367
7499
|
if (screen === "create-running") {
|
|
7368
|
-
return /* @__PURE__ */
|
|
7500
|
+
return /* @__PURE__ */ jsx26(ProgressScreen, { title: "Creating variant", lines: progressLines, variantName: name });
|
|
7369
7501
|
}
|
|
7370
7502
|
if (screen === "create-done") {
|
|
7371
|
-
return /* @__PURE__ */
|
|
7503
|
+
return /* @__PURE__ */ jsx26(
|
|
7372
7504
|
CompletionScreen,
|
|
7373
7505
|
{
|
|
7374
7506
|
title: "Create variant",
|
|
@@ -7388,18 +7520,18 @@ var App = ({
|
|
|
7388
7520
|
);
|
|
7389
7521
|
}
|
|
7390
7522
|
if (screen === "manage") {
|
|
7391
|
-
return /* @__PURE__ */
|
|
7523
|
+
return /* @__PURE__ */ jsx26(
|
|
7392
7524
|
VariantListScreen,
|
|
7393
7525
|
{
|
|
7394
7526
|
variants: variants.map((v) => ({
|
|
7395
7527
|
name: v.name,
|
|
7396
7528
|
provider: v.meta?.provider,
|
|
7397
|
-
wrapperPath:
|
|
7529
|
+
wrapperPath: path25.join(binDir, v.name)
|
|
7398
7530
|
})),
|
|
7399
7531
|
onSelect: (variantName) => {
|
|
7400
7532
|
const entry = variants.find((item) => item.name === variantName);
|
|
7401
7533
|
if (!entry || !entry.meta) return;
|
|
7402
|
-
setSelectedVariant({ ...entry.meta, wrapperPath:
|
|
7534
|
+
setSelectedVariant({ ...entry.meta, wrapperPath: path25.join(binDir, entry.name) });
|
|
7403
7535
|
setScreen("manage-actions");
|
|
7404
7536
|
},
|
|
7405
7537
|
onBack: () => setScreen("home")
|
|
@@ -7407,7 +7539,7 @@ var App = ({
|
|
|
7407
7539
|
);
|
|
7408
7540
|
}
|
|
7409
7541
|
if (screen === "manage-actions" && selectedVariant) {
|
|
7410
|
-
return /* @__PURE__ */
|
|
7542
|
+
return /* @__PURE__ */ jsx26(
|
|
7411
7543
|
VariantActionsScreen,
|
|
7412
7544
|
{
|
|
7413
7545
|
meta: selectedVariant,
|
|
@@ -7426,10 +7558,10 @@ var App = ({
|
|
|
7426
7558
|
);
|
|
7427
7559
|
}
|
|
7428
7560
|
if (screen === "manage-update" && selectedVariant) {
|
|
7429
|
-
return /* @__PURE__ */
|
|
7561
|
+
return /* @__PURE__ */ jsx26(ProgressScreen, { title: "Updating variant", lines: progressLines });
|
|
7430
7562
|
}
|
|
7431
7563
|
if (screen === "manage-update-done") {
|
|
7432
|
-
return /* @__PURE__ */
|
|
7564
|
+
return /* @__PURE__ */ jsx26(
|
|
7433
7565
|
CompletionScreen,
|
|
7434
7566
|
{
|
|
7435
7567
|
title: "Update variant",
|
|
@@ -7446,10 +7578,10 @@ var App = ({
|
|
|
7446
7578
|
}
|
|
7447
7579
|
if (screen === "manage-team-mode" && selectedVariant) {
|
|
7448
7580
|
const action = selectedVariant.teamModeEnabled ? "Disabling" : "Enabling";
|
|
7449
|
-
return /* @__PURE__ */
|
|
7581
|
+
return /* @__PURE__ */ jsx26(ProgressScreen, { title: `${action} team mode`, lines: progressLines });
|
|
7450
7582
|
}
|
|
7451
7583
|
if (screen === "manage-team-mode-done") {
|
|
7452
|
-
return /* @__PURE__ */
|
|
7584
|
+
return /* @__PURE__ */ jsx26(
|
|
7453
7585
|
CompletionScreen,
|
|
7454
7586
|
{
|
|
7455
7587
|
title: "Team Mode",
|
|
@@ -7465,10 +7597,10 @@ var App = ({
|
|
|
7465
7597
|
);
|
|
7466
7598
|
}
|
|
7467
7599
|
if (screen === "manage-tweak" && selectedVariant) {
|
|
7468
|
-
return /* @__PURE__ */
|
|
7600
|
+
return /* @__PURE__ */ jsx26(ProgressScreen, { title: "Launching tweakcc", lines: progressLines });
|
|
7469
7601
|
}
|
|
7470
7602
|
if (screen === "manage-tweak-done") {
|
|
7471
|
-
return /* @__PURE__ */
|
|
7603
|
+
return /* @__PURE__ */ jsx26(
|
|
7472
7604
|
CompletionScreen,
|
|
7473
7605
|
{
|
|
7474
7606
|
title: "tweakcc session",
|
|
@@ -7484,7 +7616,7 @@ var App = ({
|
|
|
7484
7616
|
);
|
|
7485
7617
|
}
|
|
7486
7618
|
if (screen === "manage-models" && selectedVariant) {
|
|
7487
|
-
return /* @__PURE__ */
|
|
7619
|
+
return /* @__PURE__ */ jsx26(
|
|
7488
7620
|
ModelConfigScreen,
|
|
7489
7621
|
{
|
|
7490
7622
|
title: "Configure Models",
|
|
@@ -7502,10 +7634,10 @@ var App = ({
|
|
|
7502
7634
|
);
|
|
7503
7635
|
}
|
|
7504
7636
|
if (screen === "manage-models-saving" && selectedVariant) {
|
|
7505
|
-
return /* @__PURE__ */
|
|
7637
|
+
return /* @__PURE__ */ jsx26(ProgressScreen, { title: "Saving model configuration", lines: progressLines });
|
|
7506
7638
|
}
|
|
7507
7639
|
if (screen === "manage-models-done") {
|
|
7508
|
-
return /* @__PURE__ */
|
|
7640
|
+
return /* @__PURE__ */ jsx26(
|
|
7509
7641
|
CompletionScreen,
|
|
7510
7642
|
{
|
|
7511
7643
|
title: "Models Updated",
|
|
@@ -7521,10 +7653,10 @@ var App = ({
|
|
|
7521
7653
|
);
|
|
7522
7654
|
}
|
|
7523
7655
|
if (screen === "manage-remove" && selectedVariant) {
|
|
7524
|
-
return /* @__PURE__ */
|
|
7525
|
-
/* @__PURE__ */
|
|
7526
|
-
/* @__PURE__ */
|
|
7527
|
-
/* @__PURE__ */
|
|
7656
|
+
return /* @__PURE__ */ jsxs26(Frame, { borderColor: colors.warning, children: [
|
|
7657
|
+
/* @__PURE__ */ jsx26(Header, { title: "Remove Variant", subtitle: `This will delete ${selectedVariant.name} from ${rootDir}` }),
|
|
7658
|
+
/* @__PURE__ */ jsx26(Divider, {}),
|
|
7659
|
+
/* @__PURE__ */ jsx26(Box26, { flexDirection: "column", marginY: 1, children: /* @__PURE__ */ jsx26(
|
|
7528
7660
|
SelectInput,
|
|
7529
7661
|
{
|
|
7530
7662
|
items: [
|
|
@@ -7556,12 +7688,12 @@ var App = ({
|
|
|
7556
7688
|
}
|
|
7557
7689
|
}
|
|
7558
7690
|
) }),
|
|
7559
|
-
/* @__PURE__ */
|
|
7560
|
-
/* @__PURE__ */
|
|
7691
|
+
/* @__PURE__ */ jsx26(Divider, {}),
|
|
7692
|
+
/* @__PURE__ */ jsx26(HintBar, { hints: ["Confirm removal or press Cancel"] })
|
|
7561
7693
|
] });
|
|
7562
7694
|
}
|
|
7563
7695
|
if (screen === "manage-remove-done") {
|
|
7564
|
-
return /* @__PURE__ */
|
|
7696
|
+
return /* @__PURE__ */ jsx26(
|
|
7565
7697
|
CompletionScreen,
|
|
7566
7698
|
{
|
|
7567
7699
|
title: "Remove variant",
|
|
@@ -7577,10 +7709,10 @@ var App = ({
|
|
|
7577
7709
|
);
|
|
7578
7710
|
}
|
|
7579
7711
|
if (screen === "updateAll") {
|
|
7580
|
-
return /* @__PURE__ */
|
|
7712
|
+
return /* @__PURE__ */ jsx26(ProgressScreen, { title: "Updating all variants", lines: progressLines });
|
|
7581
7713
|
}
|
|
7582
7714
|
if (screen === "updateAll-done") {
|
|
7583
|
-
return /* @__PURE__ */
|
|
7715
|
+
return /* @__PURE__ */ jsx26(
|
|
7584
7716
|
CompletionScreen,
|
|
7585
7717
|
{
|
|
7586
7718
|
title: "Update all",
|
|
@@ -7596,17 +7728,17 @@ var App = ({
|
|
|
7596
7728
|
);
|
|
7597
7729
|
}
|
|
7598
7730
|
if (screen === "doctor") {
|
|
7599
|
-
return /* @__PURE__ */
|
|
7731
|
+
return /* @__PURE__ */ jsx26(DiagnosticsScreen, { report: doctorReport, onDone: () => setScreen("home") });
|
|
7600
7732
|
}
|
|
7601
7733
|
if (screen === "about") {
|
|
7602
|
-
return /* @__PURE__ */
|
|
7734
|
+
return /* @__PURE__ */ jsx26(AboutScreen, { onBack: () => setScreen("home") });
|
|
7603
7735
|
}
|
|
7604
7736
|
if (screen === "feedback") {
|
|
7605
|
-
return /* @__PURE__ */
|
|
7737
|
+
return /* @__PURE__ */ jsx26(FeedbackScreen, { onBack: () => setScreen("home") });
|
|
7606
7738
|
}
|
|
7607
|
-
return /* @__PURE__ */
|
|
7739
|
+
return /* @__PURE__ */ jsx26(Frame, { children: /* @__PURE__ */ jsx26(Header, { title: "CC-MIRROR", subtitle: "Unknown state" }) });
|
|
7608
7740
|
};
|
|
7609
7741
|
|
|
7610
7742
|
// src/tui/index.tsx
|
|
7611
|
-
import { jsx as
|
|
7612
|
-
render(/* @__PURE__ */
|
|
7743
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
7744
|
+
render(/* @__PURE__ */ jsx27(App, {}));
|