@proletariat/cli 0.3.25 → 0.3.27
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/commands/action/index.js +2 -2
- package/dist/commands/action/show.js +7 -1
- package/dist/commands/agent/auth.js +1 -1
- package/dist/commands/agent/cleanup.js +6 -6
- package/dist/commands/agent/discover.js +1 -1
- package/dist/commands/agent/remove.js +4 -4
- package/dist/commands/autocomplete/setup.d.ts +2 -2
- package/dist/commands/autocomplete/setup.js +5 -5
- package/dist/commands/branch/create.js +31 -30
- package/dist/commands/branch/list.js +14 -11
- package/dist/commands/branch/validate.js +10 -1
- package/dist/commands/category/create.js +4 -5
- package/dist/commands/category/delete.js +2 -3
- package/dist/commands/category/rename.js +2 -3
- package/dist/commands/claude.d.ts +2 -8
- package/dist/commands/claude.js +26 -26
- package/dist/commands/commit.d.ts +2 -8
- package/dist/commands/commit.js +4 -26
- package/dist/commands/config/index.d.ts +2 -10
- package/dist/commands/config/index.js +8 -34
- package/dist/commands/docker/clean.js +7 -9
- package/dist/commands/docker/index.d.ts +2 -2
- package/dist/commands/docker/index.js +13 -12
- package/dist/commands/docker/list.d.ts +1 -0
- package/dist/commands/docker/list.js +31 -17
- package/dist/commands/docker/status.d.ts +3 -1
- package/dist/commands/docker/status.js +28 -2
- package/dist/commands/docker/sync.js +7 -6
- package/dist/commands/epic/delete.js +4 -5
- package/dist/commands/epic/list.js +17 -2
- package/dist/commands/execution/list.js +25 -17
- package/dist/commands/feedback/submit.d.ts +2 -2
- package/dist/commands/feedback/submit.js +9 -9
- package/dist/commands/link/index.js +2 -2
- package/dist/commands/pmo/init.d.ts +2 -2
- package/dist/commands/pmo/init.js +29 -10
- package/dist/commands/project/spec.js +6 -6
- package/dist/commands/repo/list.js +14 -8
- package/dist/commands/repo/view.js +2 -1
- package/dist/commands/roadmap/list.js +16 -1
- package/dist/commands/session/health.d.ts +29 -0
- package/dist/commands/session/health.js +496 -0
- package/dist/commands/session/index.js +4 -0
- package/dist/commands/session/list.js +15 -8
- package/dist/commands/spec/edit.js +2 -3
- package/dist/commands/staff/add.d.ts +2 -2
- package/dist/commands/staff/add.js +15 -14
- package/dist/commands/staff/index.js +2 -2
- package/dist/commands/staff/list.d.ts +3 -1
- package/dist/commands/staff/list.js +15 -1
- package/dist/commands/staff/remove.js +4 -4
- package/dist/commands/status/index.js +6 -7
- package/dist/commands/template/apply.js +10 -11
- package/dist/commands/template/create.js +18 -17
- package/dist/commands/template/index.d.ts +2 -2
- package/dist/commands/template/index.js +6 -6
- package/dist/commands/template/save.js +8 -7
- package/dist/commands/template/update.js +6 -7
- package/dist/commands/terminal/title.d.ts +2 -26
- package/dist/commands/terminal/title.js +4 -33
- package/dist/commands/theme/index.d.ts +2 -2
- package/dist/commands/theme/index.js +19 -18
- package/dist/commands/theme/list.d.ts +3 -0
- package/dist/commands/theme/list.js +25 -0
- package/dist/commands/theme/set.d.ts +2 -2
- package/dist/commands/theme/set.js +5 -5
- package/dist/commands/ticket/complete.js +4 -1
- package/dist/commands/ticket/create.d.ts +1 -0
- package/dist/commands/ticket/create.js +64 -16
- package/dist/commands/ticket/delete.js +18 -16
- package/dist/commands/ticket/edit.js +22 -14
- package/dist/commands/ticket/epic.js +12 -10
- package/dist/commands/ticket/list.js +24 -5
- package/dist/commands/ticket/move.js +4 -1
- package/dist/commands/ticket/project.js +11 -9
- package/dist/commands/ticket/reassign.js +23 -19
- package/dist/commands/ticket/spec.js +7 -5
- package/dist/commands/ticket/update.js +55 -53
- package/dist/commands/ticket/view.js +4 -2
- package/dist/commands/whoami.d.ts +3 -0
- package/dist/commands/whoami.js +22 -4
- package/dist/commands/work/complete.js +2 -2
- package/dist/commands/work/ready.js +9 -9
- package/dist/commands/work/revise.js +15 -13
- package/dist/commands/work/spawn.js +154 -57
- package/dist/commands/work/start.d.ts +1 -0
- package/dist/commands/work/start.js +299 -177
- package/dist/commands/workspace/prune.d.ts +3 -2
- package/dist/commands/workspace/prune.js +70 -10
- package/dist/hooks/init.js +4 -0
- package/dist/lib/agents/commands.js +4 -0
- package/dist/lib/agents/index.js +12 -0
- package/dist/lib/execution/devcontainer.d.ts +4 -0
- package/dist/lib/execution/devcontainer.js +63 -0
- package/dist/lib/mcp/helpers.d.ts +15 -0
- package/dist/lib/mcp/helpers.js +15 -0
- package/dist/lib/mcp/tools/action.js +5 -5
- package/dist/lib/mcp/tools/board.js +7 -7
- package/dist/lib/mcp/tools/category.js +5 -5
- package/dist/lib/mcp/tools/cli-passthrough.js +30 -30
- package/dist/lib/mcp/tools/epic.js +8 -8
- package/dist/lib/mcp/tools/phase.js +7 -7
- package/dist/lib/mcp/tools/project.js +10 -10
- package/dist/lib/mcp/tools/roadmap.js +7 -7
- package/dist/lib/mcp/tools/spec.js +9 -9
- package/dist/lib/mcp/tools/status.js +6 -6
- package/dist/lib/mcp/tools/template.js +6 -6
- package/dist/lib/mcp/tools/ticket.js +19 -19
- package/dist/lib/mcp/tools/view.js +4 -4
- package/dist/lib/mcp/tools/work.js +6 -6
- package/dist/lib/mcp/tools/workflow.js +5 -5
- package/dist/lib/pmo/index.js +4 -0
- package/dist/lib/pmo/storage/base.js +49 -0
- package/dist/lib/pr/index.d.ts +9 -0
- package/dist/lib/pr/index.js +101 -14
- package/dist/lib/prompt-command.d.ts +3 -0
- package/dist/lib/prompt-json.d.ts +72 -1
- package/dist/lib/prompt-json.js +46 -0
- package/dist/lib/repos/index.js +4 -0
- package/dist/lib/string-utils.d.ts +10 -0
- package/dist/lib/string-utils.js +16 -0
- package/oclif.manifest.json +594 -449
- package/package.json +3 -2
|
@@ -150,10 +150,49 @@ export interface DryRunJsonOutput {
|
|
|
150
150
|
/** Command metadata */
|
|
151
151
|
metadata: OutputMetadata;
|
|
152
152
|
}
|
|
153
|
+
/**
|
|
154
|
+
* JSON output for confirmation needed (two-step execute protocol)
|
|
155
|
+
* Used when all required flags are provided but --yes is not set.
|
|
156
|
+
* Agent should review the plan and re-run with --yes to execute.
|
|
157
|
+
*/
|
|
158
|
+
export interface ConfirmationNeededJsonOutput {
|
|
159
|
+
/** Output type discriminator */
|
|
160
|
+
type: 'confirmation_needed';
|
|
161
|
+
/** Plan of what will happen if confirmed */
|
|
162
|
+
plan: Record<string, unknown>;
|
|
163
|
+
/** The full command to run to confirm and execute */
|
|
164
|
+
confirm_command: string;
|
|
165
|
+
/** Human-readable message */
|
|
166
|
+
message: string;
|
|
167
|
+
/** Command metadata */
|
|
168
|
+
metadata: OutputMetadata;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* JSON output for execution result (after successful spawn/start)
|
|
172
|
+
*/
|
|
173
|
+
export interface ExecutionResultJsonOutput {
|
|
174
|
+
/** Output type discriminator */
|
|
175
|
+
type: 'execution_result';
|
|
176
|
+
/** Execution results */
|
|
177
|
+
result: {
|
|
178
|
+
executions: Array<{
|
|
179
|
+
workId: string;
|
|
180
|
+
ticketId: string;
|
|
181
|
+
agent: string;
|
|
182
|
+
sessionId?: string;
|
|
183
|
+
containerId?: string;
|
|
184
|
+
status: string;
|
|
185
|
+
}>;
|
|
186
|
+
successCount: number;
|
|
187
|
+
failCount: number;
|
|
188
|
+
};
|
|
189
|
+
/** Command metadata */
|
|
190
|
+
metadata: OutputMetadata;
|
|
191
|
+
}
|
|
153
192
|
/**
|
|
154
193
|
* Union type for all JSON output types
|
|
155
194
|
*/
|
|
156
|
-
export type JsonOutput = PromptJsonOutput | SuccessJsonOutput | ErrorJsonOutput | DryRunJsonOutput;
|
|
195
|
+
export type JsonOutput = PromptJsonOutput | SuccessJsonOutput | ErrorJsonOutput | DryRunJsonOutput | ConfirmationNeededJsonOutput | ExecutionResultJsonOutput;
|
|
157
196
|
/**
|
|
158
197
|
* Flags interface for JSON mode detection
|
|
159
198
|
*/
|
|
@@ -304,3 +343,35 @@ export declare function outputDryRunErrorsAsJson(errors: Array<{
|
|
|
304
343
|
field: string;
|
|
305
344
|
error: string;
|
|
306
345
|
}>, metadata: OutputMetadata): never;
|
|
346
|
+
/**
|
|
347
|
+
* Output a confirmation needed response as JSON and exit
|
|
348
|
+
*
|
|
349
|
+
* Use this in non-TTY mode when all required flags are provided but --yes is not set.
|
|
350
|
+
* This allows agents to preview what will happen before confirming execution.
|
|
351
|
+
*
|
|
352
|
+
* @param plan - Details of what will happen if confirmed
|
|
353
|
+
* @param confirmCommand - The full command to run with --yes to execute
|
|
354
|
+
* @param message - Human-readable message explaining the confirmation
|
|
355
|
+
* @param metadata - Command metadata
|
|
356
|
+
*/
|
|
357
|
+
export declare function outputConfirmationNeededAsJson(plan: Record<string, unknown>, confirmCommand: string, message: string, metadata: OutputMetadata): never;
|
|
358
|
+
/**
|
|
359
|
+
* Output execution result as JSON (non-exiting version)
|
|
360
|
+
*
|
|
361
|
+
* Use this after execution completes in non-TTY mode to provide structured
|
|
362
|
+
* results. Unlike other output functions, this does NOT exit - caller should
|
|
363
|
+
* handle cleanup and exit.
|
|
364
|
+
*
|
|
365
|
+
* @param executions - Array of execution results
|
|
366
|
+
* @param successCount - Number of successful executions
|
|
367
|
+
* @param failCount - Number of failed executions
|
|
368
|
+
* @param metadata - Command metadata
|
|
369
|
+
*/
|
|
370
|
+
export declare function outputExecutionResultAsJson(executions: Array<{
|
|
371
|
+
workId: string;
|
|
372
|
+
ticketId: string;
|
|
373
|
+
agent: string;
|
|
374
|
+
sessionId?: string;
|
|
375
|
+
containerId?: string;
|
|
376
|
+
status: string;
|
|
377
|
+
}>, successCount: number, failCount: number, metadata: OutputMetadata): void;
|
package/dist/lib/prompt-json.js
CHANGED
|
@@ -280,3 +280,49 @@ export function outputDryRunErrorsAsJson(errors, metadata) {
|
|
|
280
280
|
console.log(JSON.stringify(output, null, 2));
|
|
281
281
|
process.exit(EXIT_ERROR);
|
|
282
282
|
}
|
|
283
|
+
/**
|
|
284
|
+
* Output a confirmation needed response as JSON and exit
|
|
285
|
+
*
|
|
286
|
+
* Use this in non-TTY mode when all required flags are provided but --yes is not set.
|
|
287
|
+
* This allows agents to preview what will happen before confirming execution.
|
|
288
|
+
*
|
|
289
|
+
* @param plan - Details of what will happen if confirmed
|
|
290
|
+
* @param confirmCommand - The full command to run with --yes to execute
|
|
291
|
+
* @param message - Human-readable message explaining the confirmation
|
|
292
|
+
* @param metadata - Command metadata
|
|
293
|
+
*/
|
|
294
|
+
export function outputConfirmationNeededAsJson(plan, confirmCommand, message, metadata) {
|
|
295
|
+
const output = {
|
|
296
|
+
type: 'confirmation_needed',
|
|
297
|
+
plan,
|
|
298
|
+
confirm_command: confirmCommand,
|
|
299
|
+
message,
|
|
300
|
+
metadata,
|
|
301
|
+
};
|
|
302
|
+
console.log(JSON.stringify(output, null, 2));
|
|
303
|
+
process.exit(EXIT_NEEDS_INPUT);
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Output execution result as JSON (non-exiting version)
|
|
307
|
+
*
|
|
308
|
+
* Use this after execution completes in non-TTY mode to provide structured
|
|
309
|
+
* results. Unlike other output functions, this does NOT exit - caller should
|
|
310
|
+
* handle cleanup and exit.
|
|
311
|
+
*
|
|
312
|
+
* @param executions - Array of execution results
|
|
313
|
+
* @param successCount - Number of successful executions
|
|
314
|
+
* @param failCount - Number of failed executions
|
|
315
|
+
* @param metadata - Command metadata
|
|
316
|
+
*/
|
|
317
|
+
export function outputExecutionResultAsJson(executions, successCount, failCount, metadata) {
|
|
318
|
+
const output = {
|
|
319
|
+
type: 'execution_result',
|
|
320
|
+
result: {
|
|
321
|
+
executions,
|
|
322
|
+
successCount,
|
|
323
|
+
failCount,
|
|
324
|
+
},
|
|
325
|
+
metadata,
|
|
326
|
+
};
|
|
327
|
+
console.log(JSON.stringify(output, null, 2));
|
|
328
|
+
}
|
package/dist/lib/repos/index.js
CHANGED
|
@@ -7,6 +7,7 @@ import { styles } from '../styles.js';
|
|
|
7
7
|
import { colors } from '../colors.js';
|
|
8
8
|
import { openWorkspaceDatabase, addRepositoriesToDatabase, getWorkspaceRepositories } from '../database/index.js';
|
|
9
9
|
import { createDevcontainerConfig } from '../execution/devcontainer.js';
|
|
10
|
+
import { getGitIdentity } from '../pr/index.js';
|
|
10
11
|
import { findHQRoot } from '../workspace.js';
|
|
11
12
|
/**
|
|
12
13
|
* Check if we're currently in a git repository
|
|
@@ -452,10 +453,13 @@ export async function addRepository(hqPath, repoPath, action) {
|
|
|
452
453
|
await createWorktreesForRepo(hqPath, repoName, targetPath);
|
|
453
454
|
// Create devcontainer config for sandboxed execution in the central repo
|
|
454
455
|
console.log(styles.muted(`Creating devcontainer config for ${repoName}...`));
|
|
456
|
+
const gitIdentity = getGitIdentity();
|
|
455
457
|
createDevcontainerConfig({
|
|
456
458
|
agentName: repoName, // Use repo name as identifier
|
|
457
459
|
agentDir: targetPath,
|
|
458
460
|
repoWorktrees: [], // No nested worktrees - this is the repo itself
|
|
461
|
+
gitUserName: gitIdentity.name || undefined,
|
|
462
|
+
gitUserEmail: gitIdentity.email || undefined,
|
|
459
463
|
});
|
|
460
464
|
return { success: true, name: repoName };
|
|
461
465
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* String utilities for CLI table formatting.
|
|
3
|
+
*
|
|
4
|
+
* Handles emoji and wide characters that occupy more than one terminal column.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Pad a string to the given visual width, accounting for emoji and wide characters.
|
|
8
|
+
* Unlike String.padEnd(), this measures visual column width rather than character count.
|
|
9
|
+
*/
|
|
10
|
+
export declare function visualPadEnd(str: string, width: number): string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* String utilities for CLI table formatting.
|
|
3
|
+
*
|
|
4
|
+
* Handles emoji and wide characters that occupy more than one terminal column.
|
|
5
|
+
*/
|
|
6
|
+
import stringWidth from 'string-width';
|
|
7
|
+
/**
|
|
8
|
+
* Pad a string to the given visual width, accounting for emoji and wide characters.
|
|
9
|
+
* Unlike String.padEnd(), this measures visual column width rather than character count.
|
|
10
|
+
*/
|
|
11
|
+
export function visualPadEnd(str, width) {
|
|
12
|
+
const visWidth = stringWidth(str);
|
|
13
|
+
if (visWidth >= width)
|
|
14
|
+
return str;
|
|
15
|
+
return str + ' '.repeat(width - visWidth);
|
|
16
|
+
}
|