ccjk 9.11.0 → 9.12.0

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.
@@ -0,0 +1,137 @@
1
+ import { existsSync, readFileSync } from 'node:fs';
2
+ import ansis from 'ansis';
3
+ import { SETTINGS_FILE } from './constants.mjs';
4
+ import { ensureI18nInitialized, i18n } from './index.mjs';
5
+ import { writeJsonConfig } from './json-config.mjs';
6
+ import 'node:os';
7
+ import 'pathe';
8
+ import 'node:process';
9
+ import 'node:url';
10
+ import 'i18next';
11
+ import 'i18next-fs-backend';
12
+ import 'dayjs';
13
+ import './fs-operations.mjs';
14
+ import 'node:crypto';
15
+ import 'node:fs/promises';
16
+
17
+ const ENV_KEY = "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS";
18
+ function readSettings() {
19
+ if (!existsSync(SETTINGS_FILE)) return {};
20
+ try {
21
+ return JSON.parse(readFileSync(SETTINGS_FILE, "utf-8"));
22
+ } catch {
23
+ return {};
24
+ }
25
+ }
26
+ function isAgentTeamsEnabled() {
27
+ const settings = readSettings();
28
+ return settings?.env?.[ENV_KEY] === "1";
29
+ }
30
+ function setAgentTeams(enabled) {
31
+ const settings = readSettings();
32
+ if (!settings.env) settings.env = {};
33
+ if (enabled) {
34
+ settings.env[ENV_KEY] = "1";
35
+ } else {
36
+ delete settings.env[ENV_KEY];
37
+ }
38
+ writeJsonConfig(SETTINGS_FILE, settings);
39
+ }
40
+ function getTeammateMode() {
41
+ const settings = readSettings();
42
+ return settings?.teammateMode || "auto";
43
+ }
44
+ function setTeammateMode(mode) {
45
+ const settings = readSettings();
46
+ settings.teammateMode = mode;
47
+ writeJsonConfig(SETTINGS_FILE, settings);
48
+ }
49
+ async function agentTeamsCommand(options) {
50
+ ensureI18nInitialized();
51
+ const isZh = i18n.language === "zh-CN";
52
+ if (options.status) {
53
+ printStatus(isZh);
54
+ return;
55
+ }
56
+ if (options.on !== void 0 || options.off !== void 0) {
57
+ const enable = options.on === true;
58
+ setAgentTeams(enable);
59
+ const label = enable ? isZh ? "\u2705 Agent Teams \u5DF2\u542F\u7528" : "\u2705 Agent Teams enabled" : isZh ? "\u2B1C Agent Teams \u5DF2\u7981\u7528" : "\u2B1C Agent Teams disabled";
60
+ console.log(ansis.green(label));
61
+ return;
62
+ }
63
+ if (options.mode) {
64
+ const valid = ["auto", "in-process", "tmux"];
65
+ if (!valid.includes(options.mode)) {
66
+ console.log(ansis.red(`Invalid mode. Use: ${valid.join(", ")}`));
67
+ return;
68
+ }
69
+ setTeammateMode(options.mode);
70
+ console.log(ansis.green(`Teammate mode set to: ${options.mode}`));
71
+ return;
72
+ }
73
+ const current = isAgentTeamsEnabled();
74
+ const { default: inquirer } = await import('inquirer');
75
+ const { action } = await inquirer.prompt([{
76
+ type: "list",
77
+ name: "action",
78
+ message: isZh ? "Agent Teams \u8BBE\u7F6E" : "Agent Teams Settings",
79
+ choices: [
80
+ {
81
+ name: current ? isZh ? "\u{1F534} \u5173\u95ED Agent Teams" : "\u{1F534} Disable Agent Teams" : isZh ? "\u{1F7E2} \u542F\u7528 Agent Teams" : "\u{1F7E2} Enable Agent Teams",
82
+ value: "toggle"
83
+ },
84
+ {
85
+ name: isZh ? "\u{1F5A5}\uFE0F \u8BBE\u7F6E Teammate \u663E\u793A\u6A21\u5F0F" : "\u{1F5A5}\uFE0F Set teammate display mode",
86
+ value: "mode"
87
+ },
88
+ {
89
+ name: isZh ? "\u{1F4CA} \u67E5\u770B\u72B6\u6001" : "\u{1F4CA} View status",
90
+ value: "status"
91
+ },
92
+ {
93
+ name: isZh ? "\u21A9\uFE0F \u8FD4\u56DE" : "\u21A9\uFE0F Back",
94
+ value: "back"
95
+ }
96
+ ]
97
+ }]);
98
+ if (action === "toggle") {
99
+ setAgentTeams(!current);
100
+ const label = !current ? isZh ? "\u2705 Agent Teams \u5DF2\u542F\u7528" : "\u2705 Agent Teams enabled" : isZh ? "\u2B1C Agent Teams \u5DF2\u7981\u7528" : "\u2B1C Agent Teams disabled";
101
+ console.log(ansis.green(label));
102
+ } else if (action === "mode") {
103
+ const currentMode = getTeammateMode();
104
+ const { mode } = await inquirer.prompt([{
105
+ type: "list",
106
+ name: "mode",
107
+ message: isZh ? "\u9009\u62E9 Teammate \u663E\u793A\u6A21\u5F0F" : "Select teammate display mode",
108
+ choices: [
109
+ { name: `auto ${currentMode === "auto" ? "(current)" : ""}`, value: "auto" },
110
+ { name: `in-process ${currentMode === "in-process" ? "(current)" : ""}`, value: "in-process" },
111
+ { name: `tmux ${currentMode === "tmux" ? "(current)" : ""}`, value: "tmux" }
112
+ ]
113
+ }]);
114
+ setTeammateMode(mode);
115
+ console.log(ansis.green(`Teammate mode: ${mode}`));
116
+ } else if (action === "status") {
117
+ printStatus(isZh);
118
+ }
119
+ }
120
+ function printStatus(isZh) {
121
+ const enabled = isAgentTeamsEnabled();
122
+ const mode = getTeammateMode();
123
+ console.log();
124
+ console.log(ansis.bold(isZh ? "\u{1F916} Agent Teams \u72B6\u6001" : "\u{1F916} Agent Teams Status"));
125
+ console.log(ansis.gray("\u2500".repeat(40)));
126
+ console.log(` ${isZh ? "\u72B6\u6001" : "Status"}: ${enabled ? ansis.green("\u2705 Enabled") : ansis.dim("\u2B1C Disabled")}`);
127
+ console.log(` ${isZh ? "\u6A21\u5F0F" : "Mode"}: ${ansis.cyan(mode)}`);
128
+ console.log();
129
+ if (!enabled) {
130
+ console.log(ansis.dim(isZh ? " \u542F\u7528: ccjk agent-teams --on" : " Enable: ccjk agent-teams --on"));
131
+ } else {
132
+ console.log(ansis.dim(isZh ? ' \u4F7F\u7528: \u5728 Claude Code \u4E2D\u8BF4 "Create an agent team to..."' : ' Usage: Tell Claude "Create an agent team to..."'));
133
+ }
134
+ console.log();
135
+ }
136
+
137
+ export { agentTeamsCommand, getTeammateMode, isAgentTeamsEnabled, setAgentTeams, setTeammateMode };
@@ -1,4 +1,4 @@
1
- const version = "9.11.0";
1
+ const version = "9.12.0";
2
2
  const homepage = "https://github.com/miounet11/ccjk";
3
3
 
4
4
  export { homepage, version };
@@ -589,6 +589,8 @@ const KNOWN_COMMANDS = /* @__PURE__ */ new Set([
589
589
  "team",
590
590
  "thinking",
591
591
  "think",
592
+ "agent-teams",
593
+ "teams",
592
594
  "postmortem",
593
595
  "pm",
594
596
  "claude",
package/dist/cli.mjs CHANGED
@@ -715,6 +715,24 @@ const COMMANDS = [
715
715
  }
716
716
  },
717
717
  // ==================== Thinking Mode Commands ====================
718
+ {
719
+ name: "agent-teams",
720
+ description: "Toggle Claude Code Agent Teams (experimental)",
721
+ aliases: ["teams"],
722
+ tier: "extended",
723
+ options: [
724
+ { flags: "--on", description: "Enable Agent Teams" },
725
+ { flags: "--off", description: "Disable Agent Teams" },
726
+ { flags: "--status", description: "Show current status" },
727
+ { flags: "--mode <mode>", description: "Set teammate mode (auto/in-process/tmux)" }
728
+ ],
729
+ loader: async () => {
730
+ const { agentTeamsCommand } = await import('./chunks/agent-teams.mjs');
731
+ return async (options) => {
732
+ await agentTeamsCommand(options);
733
+ };
734
+ }
735
+ },
718
736
  {
719
737
  name: "thinking [action] [...args]",
720
738
  description: "Thinking Mode (Opus 4.5+ extended reasoning)",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ccjk",
3
3
  "type": "module",
4
- "version": "9.11.0",
4
+ "version": "9.12.0",
5
5
  "packageManager": "pnpm@10.17.1",
6
6
  "description": "CCJK v9.0.0 - Revolutionary AI Development Platform with Enterprise Security, Streaming Cloud Sync, CRDT Conflict Resolution, and Unified V3 Architecture",
7
7
  "author": {