ccgx-workflow 2.0.0 → 2.1.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.
package/dist/cli.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import cac from 'cac';
3
3
  import ansis from 'ansis';
4
- import { d as diagnoseMcpConfig, i as isWindows, r as readClaudeCodeConfig, f as fixWindowsMcpConfig, w as writeClaudeCodeConfig, a as readCcgConfig, b as initI18n, c as i18n, s as showMainMenu, e as init, g as configMcp, v as version } from './shared/ccgx-workflow.Bd3sZyxW.mjs';
4
+ import { d as diagnoseMcpConfig, i as isWindows, r as readClaudeCodeConfig, f as fixWindowsMcpConfig, w as writeClaudeCodeConfig, a as readCcgConfig, b as initI18n, c as i18n, s as showMainMenu, e as init, g as configMcp, v as version } from './shared/ccgx-workflow.DVsx1kL4.mjs';
5
5
  import { execSync } from 'node:child_process';
6
6
  import 'inquirer';
7
7
  import 'ora';
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { h as collectSkills, j as resolvePluginBashCommand } from './shared/ccgx-workflow.Bd3sZyxW.mjs';
2
- export { k as changeLanguage, G as checkForUpdates, I as collectInvocableSkills, H as compareVersions, m as createDefaultConfig, n as createDefaultRouting, J as generateCommandContent, o as getCcgDir, p as getConfigPath, E as getCurrentVersion, F as getLatestVersion, t as getWorkflowById, q as getWorkflowConfigs, c as i18n, e as init, b as initI18n, y as installAceTool, z as installAceToolRs, K as installSkillCommands, x as installWorkflows, C as migrateToV1_4_0, D as needsMigration, L as parseFrontmatter, a as readCcgConfig, s as showMainMenu, B as uninstallAceTool, A as uninstallWorkflows, u as update, l as writeCcgConfig } from './shared/ccgx-workflow.Bd3sZyxW.mjs';
1
+ import { h as collectSkills, j as resolvePluginBashCommand } from './shared/ccgx-workflow.DVsx1kL4.mjs';
2
+ export { k as changeLanguage, G as checkForUpdates, I as collectInvocableSkills, H as compareVersions, m as createDefaultConfig, n as createDefaultRouting, J as generateCommandContent, o as getCcgDir, p as getConfigPath, E as getCurrentVersion, F as getLatestVersion, t as getWorkflowById, q as getWorkflowConfigs, c as i18n, e as init, b as initI18n, y as installAceTool, z as installAceToolRs, K as installSkillCommands, x as installWorkflows, C as migrateToV1_4_0, D as needsMigration, L as parseFrontmatter, a as readCcgConfig, s as showMainMenu, B as uninstallAceTool, A as uninstallWorkflows, u as update, l as writeCcgConfig } from './shared/ccgx-workflow.DVsx1kL4.mjs';
3
3
  import { existsSync, readFileSync, mkdirSync, writeFileSync, statSync, readdirSync } from 'node:fs';
4
4
  import { join, dirname } from 'node:path';
5
5
  import { homedir } from 'node:os';
@@ -13,7 +13,7 @@ import { join as join$2 } from 'node:path/posix';
13
13
  import { join as join$1 } from 'node:path';
14
14
  import i18next from 'i18next';
15
15
 
16
- const version = "2.0.0";
16
+ const version = "2.1.0";
17
17
 
18
18
  function cmd(id, order, category, name, nameEn, description, descriptionEn, cmdOverride) {
19
19
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccgx-workflow",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "Multi-model orchestration for Claude Code. Codex + Gemini parallel collaboration with fresh-context subagent protocols, OS-level process isolation, and Plan-Critic-Verify quality tiers. Successor to ccg-workflow.",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@10.17.1",
@@ -73,6 +73,27 @@ const VENDOR_KEYS = {
73
73
  gemini: ['gemini@gemini-ccgx', 'gemini@google-gemini'],
74
74
  }
75
75
 
76
+ // ---------------------------------------------------------------------------
77
+ // Vendor → preferred entry script (relative to <installPath>/scripts/).
78
+ //
79
+ // gemini: prefer `gemini-batch.mjs` (CCG-only, bypasses ACP broker entirely
80
+ // — direct gemini-cli batch mode via stdin + --output-format json). Falls
81
+ // back to the legacy `gemini-companion.mjs task` (ACP path) only if the
82
+ // batch entry isn't shipped.
83
+ //
84
+ // Why bypass ACP: gemini-cli 0.40+'s session/new RPC runs MCP setup + auth
85
+ // refresh + chat startup synchronously inside the agent. On Windows the
86
+ // gemini-plugin-cc ACP broker + named-pipe transport reliably hangs trivial
87
+ // trips for 5+ minutes even when the direct CLI returns in 10-30s. Batch
88
+ // mode side-steps the entire transport stack (no broker, no detached
89
+ // process, no orphan MCP children).
90
+ // ---------------------------------------------------------------------------
91
+
92
+ const VENDOR_ENTRY_SCRIPTS = {
93
+ codex: ['codex-companion.mjs'],
94
+ gemini: ['gemini-batch.mjs', 'gemini-companion.mjs'],
95
+ }
96
+
76
97
  // ---------------------------------------------------------------------------
77
98
  // Argument parsing — minimal, KISS, no external CLI lib.
78
99
  // ---------------------------------------------------------------------------
@@ -84,6 +105,13 @@ function parseArgs(argv) {
84
105
  json: true,
85
106
  timeoutMs: 600000,
86
107
  maxBudgetUsd: 50,
108
+ // 1.0.5 regression fix: pre-1.0.5 callers always passed --write directly
109
+ // to codex-companion. Default true preserves BC; --no-write opt-out for
110
+ // read-only review flows.
111
+ write: true,
112
+ model: null,
113
+ effort: null,
114
+ cwd: null,
87
115
  }
88
116
 
89
117
  const positional = []
@@ -100,6 +128,11 @@ function parseArgs(argv) {
100
128
  case '--no-json': opts.json = false; break
101
129
  case '--timeout-ms': opts.timeoutMs = Number.parseInt(next(), 10); break
102
130
  case '--max-budget-usd': opts.maxBudgetUsd = Number.parseFloat(next()); break
131
+ case '--write': opts.write = true; break
132
+ case '--no-write': opts.write = false; break
133
+ case '--model': opts.model = next(); break
134
+ case '--effort': opts.effort = next(); break
135
+ case '--cwd': opts.cwd = next(); break
103
136
  case '--help':
104
137
  case '-h':
105
138
  printHelp()
@@ -135,6 +168,11 @@ Optional:
135
168
  --no-json Disable --json (text output)
136
169
  --timeout-ms <N> Kill companion after N ms (default: 600000)
137
170
  --max-budget-usd <N> Per-call cost cap (default: 50)
171
+ --write Enable workspace-write sandbox (default: true; codex needs this to spawn read commands too under default approval policy)
172
+ --no-write Force read-only sandbox (companion approval-policy will decline most commands)
173
+ --model <name> Override model (codex only; gemini ignores)
174
+ --effort <level> Reasoning effort: none|minimal|low|medium|high|xhigh (codex only)
175
+ --cwd <path> Override working directory for the companion call. codex sandbox is cwd-bound; set this when auditing a repo other than the caller's cwd.
138
176
 
139
177
  Outputs JSON to stdout: {status, vendor, version, durationMs, exitCode, stdout, stderr, error?}
140
178
  `)
@@ -180,9 +218,19 @@ function discoverCompanion(vendor, homeDir = homedir()) {
180
218
  return { error: `plugin ${matchedKey} has no installPath in installed_plugins.json` }
181
219
  }
182
220
 
183
- const companionPath = join(installPath, 'scripts', `${vendor}-companion.mjs`)
184
- if (!existsSync(companionPath)) {
185
- return { error: `companion script missing: ${companionPath}` }
221
+ // Walk the preferred entry-script list. First existing file wins.
222
+ // BC: vendors with only the legacy companion still resolve correctly.
223
+ const entryCandidates = VENDOR_ENTRY_SCRIPTS[vendor] ?? [`${vendor}-companion.mjs`]
224
+ let companionPath = null
225
+ for (const name of entryCandidates) {
226
+ const candidate = join(installPath, 'scripts', name)
227
+ if (existsSync(candidate)) {
228
+ companionPath = candidate
229
+ break
230
+ }
231
+ }
232
+ if (!companionPath) {
233
+ return { error: `no entry script found for ${vendor} (tried: ${entryCandidates.join(', ')}) in ${join(installPath, 'scripts')}` }
186
234
  }
187
235
 
188
236
  return {
@@ -252,6 +300,15 @@ async function main(argv) {
252
300
  promptBody,
253
301
  ]
254
302
  if (opts.json) companionArgs.push('--json')
303
+ // codex-companion flag pass-through (1.0.5 regression fix). gemini-companion
304
+ // ignores unknown flags safely; both vendors accept this surface.
305
+ if (opts.write) companionArgs.push('--write')
306
+ if (opts.model) companionArgs.push('--model', opts.model)
307
+ if (opts.effort) companionArgs.push('--effort', opts.effort)
308
+ // --cwd pass-through: codex sandbox is cwd-bound. For cross-repo audits
309
+ // the caller must set this to the repo being audited (codex-companion
310
+ // does not expose --add-dir; multi-workspace requires deeper changes).
311
+ if (opts.cwd) companionArgs.push('--cwd', opts.cwd)
255
312
 
256
313
  const startedAt = Date.now()
257
314