Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions cli/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@
ZEROSHOT_PR_BASE: options.prBase || '',
ZEROSHOT_MERGE_QUEUE: mergeQueueEnv,
ZEROSHOT_CLOSE_ISSUE: options.closeIssue || '',
ZEROSHOT_OUTPUT_FILE: process.env.ZEROSHOT_OUTPUT_FILE || '',
ZEROSHOT_CWD: targetCwd,
};
}
Expand Down Expand Up @@ -2314,6 +2315,7 @@
.option('--mount <spec...>', 'Add Docker mount (host:container[:ro]). Repeatable.')
.option('--no-mounts', 'Disable all Docker credential mounts')
.option('--skip-quality-gate', 'Skip quality gate checks (tests/lint) before review')
.option('-o, --output <file>', 'Output filename for reports and documents')
.option(
'--container-home <path>',
'Container home directory for $HOME expansion (default: /root)'
Expand Down Expand Up @@ -2345,11 +2347,19 @@
Force provider flags: -G (GitHub), -L (GitLab), -J (Jira), -D (DevOps)
`
)
.action(async (inputArg, options) => {

Check warning on line 2350 in cli/index.js

View workflow job for this annotation

GitHub Actions / check

Refactor this function to reduce its Cognitive Complexity from 30 to the 15 allowed
try {
// Normalize options (--ship → --pr → --worktree flags)
normalizeRunOptions(options);

// Resolve --output to absolute path before daemon spawn (daemon changes CWD)
if (options.output) {
let outputPath = options.output;
if (!path.extname(outputPath)) outputPath += '.md';
if (!path.isAbsolute(outputPath)) outputPath = path.resolve(process.cwd(), outputPath);
process.env.ZEROSHOT_OUTPUT_FILE = outputPath;
}

// Determine force provider from CLI flags
let forceProvider = null;
if (options.github) forceProvider = 'github';
Expand Down Expand Up @@ -2750,7 +2760,7 @@
.command('kill-all')
.description('Kill all running tasks and clusters')
.option('-y, --yes', 'Skip confirmation')
.action(async (options) => {

Check warning on line 2763 in cli/index.js

View workflow job for this annotation

GitHub Actions / check

Refactor this function to reduce its Cognitive Complexity from 26 to the 15 allowed
try {
// Get counts first
const orchestrator = await getOrchestrator();
Expand Down Expand Up @@ -2975,7 +2985,7 @@
.command('resume <id> [prompt]')
.description('Resume a failed task or cluster')
.option('-d, --detach', 'Resume in background (daemon mode)')
.action(async (id, prompt, options) => {

Check warning on line 2988 in cli/index.js

View workflow job for this annotation

GitHub Actions / check

Refactor this function to reduce its Cognitive Complexity from 19 to the 15 allowed
try {
// Try cluster first, then task (both use same ID format: "adjective-noun-number")
const OrchestratorModule = require('../src/orchestrator');
Expand Down Expand Up @@ -4145,7 +4155,7 @@
}
});

function outputAgent(agent, options) {

Check warning on line 4158 in cli/index.js

View workflow job for this annotation

GitHub Actions / check

Refactor this function to reduce its Cognitive Complexity from 19 to the 15 allowed
if (options.json) {
console.log(JSON.stringify(agent, null, 2));
return;
Expand Down Expand Up @@ -4313,7 +4323,7 @@
}

// Format tool result for display
function formatToolResult(content, isError, toolName, toolInput) {

Check warning on line 4326 in cli/index.js

View workflow job for this annotation

GitHub Actions / check

Refactor this function to reduce its Cognitive Complexity from 17 to the 15 allowed
if (!content) return isError ? 'error' : 'done';

// For errors, show full message
Expand Down Expand Up @@ -4914,7 +4924,7 @@

// Accumulate text and print complete lines only
// Word wrap long lines, aligning continuation with message column
function accumulateText(prefix, sender, text) {

Check warning on line 4927 in cli/index.js

View workflow job for this annotation

GitHub Actions / check

Refactor this function to reduce its Cognitive Complexity from 17 to the 15 allowed
if (!text) return;
const buf = getLineBuffer(sender);

Expand Down Expand Up @@ -4977,7 +4987,7 @@
}

// Stream thinking text immediately with word wrapping
function accumulateThinking(prefix, sender, text) {

Check warning on line 4990 in cli/index.js

View workflow job for this annotation

GitHub Actions / check

Refactor this function to reduce its Cognitive Complexity from 25 to the 15 allowed
if (!text) return;
const buf = getLineBuffer(sender);

Expand Down Expand Up @@ -5036,7 +5046,7 @@
}

// Flush pending content - just add newline if we have pending text
function flushLineBuffer(prefix, sender) {

Check warning on line 5049 in cli/index.js

View workflow job for this annotation

GitHub Actions / check

Refactor this function to reduce its Cognitive Complexity from 18 to the 15 allowed
const buf = lineBuffers.get(sender);
if (!buf) return;

Expand Down
Loading
Loading