@proletariat/cli 0.3.25 → 0.3.26
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/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/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/index.d.ts +2 -2
- package/dist/commands/docker/index.js +8 -8
- package/dist/commands/epic/delete.js +4 -5
- 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 +7 -7
- package/dist/commands/project/spec.js +6 -6
- package/dist/commands/session/health.d.ts +29 -0
- package/dist/commands/session/health.js +495 -0
- package/dist/commands/session/index.js +4 -0
- 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/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/set.d.ts +2 -2
- package/dist/commands/theme/set.js +5 -5
- package/dist/commands/ticket/create.js +34 -16
- package/dist/commands/ticket/delete.js +15 -13
- package/dist/commands/ticket/edit.js +20 -12
- package/dist/commands/ticket/epic.js +12 -10
- 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/whoami.js +1 -0
- package/dist/commands/work/ready.js +7 -7
- package/dist/commands/work/revise.js +13 -11
- package/dist/commands/work/spawn.js +154 -57
- package/dist/commands/work/start.d.ts +1 -0
- package/dist/commands/work/start.js +295 -173
- package/dist/hooks/init.js +4 -0
- package/dist/lib/pr/index.d.ts +4 -0
- package/dist/lib/pr/index.js +32 -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/oclif.manifest.json +1184 -1116
- package/package.json +1 -1
package/dist/hooks/init.js
CHANGED
|
@@ -13,6 +13,10 @@ const hook = async function ({ id, config }) {
|
|
|
13
13
|
if (id === 'init') {
|
|
14
14
|
return;
|
|
15
15
|
}
|
|
16
|
+
// Skip when --help flag is present - help should always be available
|
|
17
|
+
if (process.argv.includes('--help') || process.argv.includes('-h')) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
16
20
|
// Skip for help-related commands/flags
|
|
17
21
|
// When user runs just `prlt` with no args, id is undefined
|
|
18
22
|
if (!id || id === 'help') {
|
package/dist/lib/pr/index.d.ts
CHANGED
|
@@ -51,6 +51,8 @@ export declare function isGHTokenInEnv(): boolean;
|
|
|
51
51
|
export declare function getGitHubRepo(cwd?: string): string | null;
|
|
52
52
|
/**
|
|
53
53
|
* Get the default base branch (main or master).
|
|
54
|
+
* Prefers origin/main over local main to avoid stale local branches
|
|
55
|
+
* in agent worktrees where local main is never updated.
|
|
54
56
|
*/
|
|
55
57
|
export declare function getDefaultBaseBranch(cwd?: string): string;
|
|
56
58
|
/**
|
|
@@ -71,6 +73,8 @@ export declare function pushBranch(branch: string, cwd?: string): boolean;
|
|
|
71
73
|
export declare function hasUnpushedCommits(branch: string, cwd?: string): boolean;
|
|
72
74
|
/**
|
|
73
75
|
* Get the commit log between base and head.
|
|
76
|
+
* Prefers origin/${base} over local ${base} to avoid stale local branches
|
|
77
|
+
* in agent worktrees where local main/master is never updated.
|
|
74
78
|
*/
|
|
75
79
|
export declare function getCommitLog(base: string, cwd?: string): string[];
|
|
76
80
|
/**
|
package/dist/lib/pr/index.js
CHANGED
|
@@ -85,29 +85,31 @@ export function getGitHubRepo(cwd) {
|
|
|
85
85
|
}
|
|
86
86
|
/**
|
|
87
87
|
* Get the default base branch (main or master).
|
|
88
|
+
* Prefers origin/main over local main to avoid stale local branches
|
|
89
|
+
* in agent worktrees where local main is never updated.
|
|
88
90
|
*/
|
|
89
91
|
export function getDefaultBaseBranch(cwd) {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
// Fall back to 'master'
|
|
92
|
+
// Check origin/main first (most reliable in worktree environments)
|
|
93
|
+
// then local main, then origin/master, then local master
|
|
94
|
+
const candidates = [
|
|
95
|
+
{ ref: 'origin/main', name: 'main' },
|
|
96
|
+
{ ref: 'main', name: 'main' },
|
|
97
|
+
{ ref: 'origin/master', name: 'master' },
|
|
98
|
+
{ ref: 'master', name: 'master' },
|
|
99
|
+
];
|
|
100
|
+
for (const { ref, name } of candidates) {
|
|
100
101
|
try {
|
|
101
|
-
execSync(
|
|
102
|
+
execSync(`git rev-parse --verify ${ref}`, {
|
|
102
103
|
cwd,
|
|
103
104
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
104
105
|
});
|
|
105
|
-
return
|
|
106
|
+
return name;
|
|
106
107
|
}
|
|
107
108
|
catch {
|
|
108
|
-
|
|
109
|
+
// Try next candidate
|
|
109
110
|
}
|
|
110
111
|
}
|
|
112
|
+
return 'main'; // Default to main even if not found
|
|
111
113
|
}
|
|
112
114
|
/**
|
|
113
115
|
* Get the current branch name.
|
|
@@ -173,10 +175,26 @@ export function hasUnpushedCommits(branch, cwd) {
|
|
|
173
175
|
}
|
|
174
176
|
/**
|
|
175
177
|
* Get the commit log between base and head.
|
|
178
|
+
* Prefers origin/${base} over local ${base} to avoid stale local branches
|
|
179
|
+
* in agent worktrees where local main/master is never updated.
|
|
176
180
|
*/
|
|
177
181
|
export function getCommitLog(base, cwd) {
|
|
182
|
+
// Prefer origin/${base} for accurate comparison (local branch may be stale)
|
|
183
|
+
let ref = base;
|
|
184
|
+
if (!base.startsWith('origin/')) {
|
|
185
|
+
try {
|
|
186
|
+
execSync(`git rev-parse --verify origin/${base}`, {
|
|
187
|
+
cwd,
|
|
188
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
189
|
+
});
|
|
190
|
+
ref = `origin/${base}`;
|
|
191
|
+
}
|
|
192
|
+
catch {
|
|
193
|
+
// Fall back to local ref
|
|
194
|
+
}
|
|
195
|
+
}
|
|
178
196
|
try {
|
|
179
|
-
const output = execSync(`git log ${
|
|
197
|
+
const output = execSync(`git log ${ref}..HEAD --oneline`, {
|
|
180
198
|
cwd,
|
|
181
199
|
encoding: 'utf-8',
|
|
182
200
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
@@ -83,6 +83,9 @@ export declare abstract class PromptCommand extends Command {
|
|
|
83
83
|
default?: unknown;
|
|
84
84
|
validate?: (input: unknown) => boolean | string;
|
|
85
85
|
when?: boolean | ((answers: Record<string, unknown>) => boolean);
|
|
86
|
+
filter?: (input: unknown) => unknown;
|
|
87
|
+
pageSize?: number;
|
|
88
|
+
[key: string]: unknown;
|
|
86
89
|
}>, jsonModeConfig?: {
|
|
87
90
|
flags: JsonFlags & Record<string, unknown>;
|
|
88
91
|
commandName: string;
|
|
@@ -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
|
+
}
|