ccjk 9.11.0 → 9.12.1

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 t(key, opts) {
19
+ return i18n.t(`agent-teams:${key}`, opts);
20
+ }
21
+ function readSettings() {
22
+ if (!existsSync(SETTINGS_FILE)) return {};
23
+ try {
24
+ return JSON.parse(readFileSync(SETTINGS_FILE, "utf-8"));
25
+ } catch {
26
+ return {};
27
+ }
28
+ }
29
+ function isAgentTeamsEnabled() {
30
+ const settings = readSettings();
31
+ return settings?.env?.[ENV_KEY] === "1";
32
+ }
33
+ function setAgentTeams(enabled) {
34
+ const settings = readSettings();
35
+ if (!settings.env) settings.env = {};
36
+ if (enabled) {
37
+ settings.env[ENV_KEY] = "1";
38
+ } else {
39
+ delete settings.env[ENV_KEY];
40
+ }
41
+ writeJsonConfig(SETTINGS_FILE, settings);
42
+ }
43
+ function getTeammateMode() {
44
+ const settings = readSettings();
45
+ return settings?.teammateMode || "auto";
46
+ }
47
+ function setTeammateMode(mode) {
48
+ const settings = readSettings();
49
+ settings.teammateMode = mode;
50
+ writeJsonConfig(SETTINGS_FILE, settings);
51
+ }
52
+ async function agentTeamsCommand(options) {
53
+ ensureI18nInitialized();
54
+ if (options.status) {
55
+ printStatus();
56
+ return;
57
+ }
58
+ if (options.on !== void 0 || options.off !== void 0) {
59
+ const enable = options.on === true;
60
+ setAgentTeams(enable);
61
+ console.log(ansis.green(t(enable ? "enabled" : "disabled")));
62
+ return;
63
+ }
64
+ if (options.mode) {
65
+ const valid = ["auto", "in-process", "tmux"];
66
+ if (!valid.includes(options.mode)) {
67
+ console.log(ansis.red(t("invalidMode")));
68
+ return;
69
+ }
70
+ setTeammateMode(options.mode);
71
+ console.log(ansis.green(t("modeSet", { mode: options.mode })));
72
+ return;
73
+ }
74
+ const current = isAgentTeamsEnabled();
75
+ const { default: inquirer } = await import('inquirer');
76
+ const { action } = await inquirer.prompt([{
77
+ type: "list",
78
+ name: "action",
79
+ message: t("settings"),
80
+ choices: [
81
+ {
82
+ name: current ? t("toggleDisable") : t("toggleEnable"),
83
+ value: "toggle"
84
+ },
85
+ {
86
+ name: t("setMode"),
87
+ value: "mode"
88
+ },
89
+ {
90
+ name: t("viewStatus"),
91
+ value: "status"
92
+ },
93
+ {
94
+ name: t("back"),
95
+ value: "back"
96
+ }
97
+ ]
98
+ }]);
99
+ if (action === "toggle") {
100
+ setAgentTeams(!current);
101
+ console.log(ansis.green(t(!current ? "enabled" : "disabled")));
102
+ } else if (action === "mode") {
103
+ const currentMode = getTeammateMode();
104
+ const { mode } = await inquirer.prompt([{
105
+ type: "list",
106
+ name: "mode",
107
+ message: t("selectMode"),
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(t("modeSet", { mode })));
116
+ } else if (action === "status") {
117
+ printStatus();
118
+ }
119
+ }
120
+ function printStatus() {
121
+ const enabled = isAgentTeamsEnabled();
122
+ const mode = getTeammateMode();
123
+ console.log();
124
+ console.log(ansis.bold(t("statusTitle")));
125
+ console.log(ansis.gray("\u2500".repeat(40)));
126
+ console.log(` ${t("statusLabel")}: ${enabled ? ansis.green("\u2705 Enabled") : ansis.dim("\u2B1C Disabled")}`);
127
+ console.log(` ${t("modeLabel")}: ${ansis.cyan(mode)}`);
128
+ console.log();
129
+ if (!enabled) {
130
+ console.log(ansis.dim(` ${t("enableHint")}`));
131
+ } else {
132
+ console.log(ansis.dim(` ${t("usageHint")}`));
133
+ }
134
+ console.log();
135
+ }
136
+
137
+ export { agentTeamsCommand, getTeammateMode, isAgentTeamsEnabled, setAgentTeams, setTeammateMode };
@@ -7,6 +7,8 @@ import { dirname, join } from 'pathe';
7
7
 
8
8
  const i18n = i18next.createInstance();
9
9
  const NAMESPACES = [
10
+ "agent-teams",
11
+ // Agent Teams quick-enable
10
12
  "agentBrowser",
11
13
  // Agent Browser - AI browser automation
12
14
  "common",
@@ -1,4 +1,4 @@
1
- const version = "9.11.0";
1
+ const version = "9.12.1";
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)",
@@ -0,0 +1,18 @@
1
+ {
2
+ "settings": "Agent Teams Settings",
3
+ "enabled": "✅ Agent Teams enabled",
4
+ "disabled": "⬜ Agent Teams disabled",
5
+ "invalidMode": "Invalid mode. Use: auto, in-process, tmux",
6
+ "modeSet": "Teammate mode set to: {{mode}}",
7
+ "toggleEnable": "🟢 Enable Agent Teams",
8
+ "toggleDisable": "🔴 Disable Agent Teams",
9
+ "setMode": "🖥️ Set teammate display mode",
10
+ "viewStatus": "📊 View status",
11
+ "back": "↩️ Back",
12
+ "selectMode": "Select teammate display mode",
13
+ "statusTitle": "🤖 Agent Teams Status",
14
+ "statusLabel": "Status",
15
+ "modeLabel": "Mode",
16
+ "enableHint": "Enable: ccjk agent-teams --on",
17
+ "usageHint": "Usage: Tell Claude \"Create an agent team to...\""
18
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "settings": "Agent Teams 设置",
3
+ "enabled": "✅ Agent Teams 已启用",
4
+ "disabled": "⬜ Agent Teams 已禁用",
5
+ "invalidMode": "无效模式,可选:auto, in-process, tmux",
6
+ "modeSet": "Teammate 显示模式已设为:{{mode}}",
7
+ "toggleEnable": "🟢 启用 Agent Teams",
8
+ "toggleDisable": "🔴 关闭 Agent Teams",
9
+ "setMode": "🖥️ 设置 Teammate 显示模式",
10
+ "viewStatus": "📊 查看状态",
11
+ "back": "↩️ 返回",
12
+ "selectMode": "选择 Teammate 显示模式",
13
+ "statusTitle": "🤖 Agent Teams 状态",
14
+ "statusLabel": "状态",
15
+ "modeLabel": "模式",
16
+ "enableHint": "启用:ccjk agent-teams --on",
17
+ "usageHint": "使用:在 Claude Code 中说 \"Create an agent team to...\""
18
+ }
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.1",
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": {