@proletariat/cli 0.3.31 → 0.3.33
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/diet.d.ts +20 -0
- package/dist/commands/diet.js +181 -0
- package/dist/commands/mcp-server.js +2 -1
- package/dist/commands/priority/add.d.ts +15 -0
- package/dist/commands/priority/add.js +70 -0
- package/dist/commands/priority/list.d.ts +10 -0
- package/dist/commands/priority/list.js +34 -0
- package/dist/commands/priority/remove.d.ts +13 -0
- package/dist/commands/priority/remove.js +54 -0
- package/dist/commands/priority/set.d.ts +14 -0
- package/dist/commands/priority/set.js +60 -0
- package/dist/commands/pull.d.ts +23 -0
- package/dist/commands/pull.js +219 -0
- package/dist/commands/roadmap/generate.js +10 -5
- package/dist/commands/template/apply.js +5 -4
- package/dist/commands/template/create.js +9 -5
- package/dist/commands/ticket/create.js +6 -5
- package/dist/commands/ticket/edit.js +9 -9
- package/dist/commands/ticket/list.d.ts +2 -0
- package/dist/commands/ticket/list.js +20 -13
- package/dist/commands/ticket/update.js +8 -5
- package/dist/commands/work/spawn.d.ts +13 -0
- package/dist/commands/work/spawn.js +397 -6
- package/dist/commands/work/start.d.ts +1 -0
- package/dist/commands/work/start.js +5 -0
- package/dist/lib/execution/runners.js +4 -0
- package/dist/lib/execution/types.d.ts +1 -0
- package/dist/lib/mcp/tools/diet.d.ts +6 -0
- package/dist/lib/mcp/tools/diet.js +261 -0
- package/dist/lib/mcp/tools/index.d.ts +1 -0
- package/dist/lib/mcp/tools/index.js +1 -0
- package/dist/lib/mcp/tools/template.js +1 -1
- package/dist/lib/mcp/tools/ticket.js +48 -3
- package/dist/lib/pmo/diet.d.ts +102 -0
- package/dist/lib/pmo/diet.js +127 -0
- package/dist/lib/pmo/storage/base.d.ts +5 -0
- package/dist/lib/pmo/storage/base.js +16 -0
- package/dist/lib/pmo/types.d.ts +12 -6
- package/dist/lib/pmo/types.js +6 -2
- package/dist/lib/pmo/utils.d.ts +40 -0
- package/dist/lib/pmo/utils.js +76 -0
- package/oclif.manifest.json +2783 -2438
- package/package.json +1 -1
package/dist/lib/pmo/types.js
CHANGED
|
@@ -12,11 +12,15 @@
|
|
|
12
12
|
* - Subtask - Smallest actionable piece
|
|
13
13
|
*/
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* Default priority values as a const array.
|
|
16
|
+
* @deprecated Use getWorkspacePriorities() from utils.ts instead for runtime priority resolution.
|
|
17
|
+
* This constant is kept for backwards compatibility and as the default when no workspace scale is set.
|
|
16
18
|
*/
|
|
17
19
|
export const PRIORITIES = ['P0', 'P1', 'P2', 'P3'];
|
|
18
20
|
/**
|
|
19
|
-
*
|
|
21
|
+
* Default priority display names for UI presentation.
|
|
22
|
+
* @deprecated Priority labels are derived from the workspace priority scale.
|
|
23
|
+
* For user-defined priorities, the label IS the priority value.
|
|
20
24
|
*/
|
|
21
25
|
export const PRIORITY_LABELS = {
|
|
22
26
|
P0: 'P0 - Critical',
|
package/dist/lib/pmo/utils.d.ts
CHANGED
|
@@ -123,4 +123,44 @@ export declare function findColumnByName(columnNames: string[], targetColumn: st
|
|
|
123
123
|
* Check if two arrays have the same elements (order-independent)
|
|
124
124
|
*/
|
|
125
125
|
export declare function arraysEqual<T>(a: T[], b: T[]): boolean;
|
|
126
|
+
/**
|
|
127
|
+
* Default priority scale (backwards compatible with hardcoded P0-P3).
|
|
128
|
+
*/
|
|
129
|
+
export declare const DEFAULT_PRIORITIES: readonly ["P0", "P1", "P2", "P3"];
|
|
130
|
+
/**
|
|
131
|
+
* Get the workspace priority scale from pmo_settings.
|
|
132
|
+
* Returns the user-defined priority scale, or DEFAULT_PRIORITIES if not set.
|
|
133
|
+
*
|
|
134
|
+
* Priority values are ordered strings - position in array determines sort order.
|
|
135
|
+
* Index 0 is highest priority.
|
|
136
|
+
*
|
|
137
|
+
* @param db - Database instance
|
|
138
|
+
* @returns Array of priority strings ordered from highest to lowest
|
|
139
|
+
*/
|
|
140
|
+
export declare function getWorkspacePriorities(db: DatabaseLike): string[];
|
|
141
|
+
/**
|
|
142
|
+
* Set the workspace priority scale in pmo_settings.
|
|
143
|
+
*
|
|
144
|
+
* @param db - Database instance
|
|
145
|
+
* @param priorities - Array of priority strings ordered from highest to lowest
|
|
146
|
+
*/
|
|
147
|
+
export declare function setWorkspacePriorities(db: DatabaseLike, priorities: string[]): void;
|
|
148
|
+
/**
|
|
149
|
+
* Check if a value is a valid priority for the workspace.
|
|
150
|
+
*
|
|
151
|
+
* @param db - Database instance
|
|
152
|
+
* @param value - Value to check
|
|
153
|
+
* @returns true if the value is in the workspace priority scale
|
|
154
|
+
*/
|
|
155
|
+
export declare function isValidWorkspacePriority(db: DatabaseLike, value: string): boolean;
|
|
156
|
+
/**
|
|
157
|
+
* Get the sort index for a priority value.
|
|
158
|
+
* Returns the position in the priority array (0 = highest priority).
|
|
159
|
+
* Returns Infinity for unknown priorities (sorts last).
|
|
160
|
+
*
|
|
161
|
+
* @param db - Database instance
|
|
162
|
+
* @param value - Priority value
|
|
163
|
+
* @returns Sort index (lower = higher priority)
|
|
164
|
+
*/
|
|
165
|
+
export declare function getPrioritySortIndex(db: DatabaseLike, value: string | undefined | null): number;
|
|
126
166
|
export {};
|
package/dist/lib/pmo/utils.js
CHANGED
|
@@ -195,3 +195,79 @@ export function arraysEqual(a, b) {
|
|
|
195
195
|
const sortedB = [...b].sort();
|
|
196
196
|
return sortedA.every((val, idx) => val === sortedB[idx]);
|
|
197
197
|
}
|
|
198
|
+
// =============================================================================
|
|
199
|
+
// Workspace Priority Settings
|
|
200
|
+
// =============================================================================
|
|
201
|
+
/**
|
|
202
|
+
* Default priority scale (backwards compatible with hardcoded P0-P3).
|
|
203
|
+
*/
|
|
204
|
+
export const DEFAULT_PRIORITIES = ['P0', 'P1', 'P2', 'P3'];
|
|
205
|
+
/**
|
|
206
|
+
* Settings key for storing workspace priorities.
|
|
207
|
+
*/
|
|
208
|
+
const PRIORITIES_SETTING_KEY = 'priorities';
|
|
209
|
+
/**
|
|
210
|
+
* Get the workspace priority scale from pmo_settings.
|
|
211
|
+
* Returns the user-defined priority scale, or DEFAULT_PRIORITIES if not set.
|
|
212
|
+
*
|
|
213
|
+
* Priority values are ordered strings - position in array determines sort order.
|
|
214
|
+
* Index 0 is highest priority.
|
|
215
|
+
*
|
|
216
|
+
* @param db - Database instance
|
|
217
|
+
* @returns Array of priority strings ordered from highest to lowest
|
|
218
|
+
*/
|
|
219
|
+
export function getWorkspacePriorities(db) {
|
|
220
|
+
const row = db.prepare(`SELECT value FROM pmo_settings WHERE key = ?`).get(PRIORITIES_SETTING_KEY);
|
|
221
|
+
if (!row)
|
|
222
|
+
return [...DEFAULT_PRIORITIES];
|
|
223
|
+
try {
|
|
224
|
+
const parsed = JSON.parse(row.value);
|
|
225
|
+
if (Array.isArray(parsed) && parsed.length > 0 && parsed.every((p) => typeof p === 'string')) {
|
|
226
|
+
return parsed;
|
|
227
|
+
}
|
|
228
|
+
return [...DEFAULT_PRIORITIES];
|
|
229
|
+
}
|
|
230
|
+
catch {
|
|
231
|
+
return [...DEFAULT_PRIORITIES];
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Set the workspace priority scale in pmo_settings.
|
|
236
|
+
*
|
|
237
|
+
* @param db - Database instance
|
|
238
|
+
* @param priorities - Array of priority strings ordered from highest to lowest
|
|
239
|
+
*/
|
|
240
|
+
export function setWorkspacePriorities(db, priorities) {
|
|
241
|
+
const value = JSON.stringify(priorities);
|
|
242
|
+
db.prepare(`
|
|
243
|
+
INSERT INTO pmo_settings (key, value) VALUES (?, ?)
|
|
244
|
+
ON CONFLICT(key) DO UPDATE SET value = ?
|
|
245
|
+
`).run(PRIORITIES_SETTING_KEY, value, value);
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Check if a value is a valid priority for the workspace.
|
|
249
|
+
*
|
|
250
|
+
* @param db - Database instance
|
|
251
|
+
* @param value - Value to check
|
|
252
|
+
* @returns true if the value is in the workspace priority scale
|
|
253
|
+
*/
|
|
254
|
+
export function isValidWorkspacePriority(db, value) {
|
|
255
|
+
const priorities = getWorkspacePriorities(db);
|
|
256
|
+
return priorities.includes(value);
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Get the sort index for a priority value.
|
|
260
|
+
* Returns the position in the priority array (0 = highest priority).
|
|
261
|
+
* Returns Infinity for unknown priorities (sorts last).
|
|
262
|
+
*
|
|
263
|
+
* @param db - Database instance
|
|
264
|
+
* @param value - Priority value
|
|
265
|
+
* @returns Sort index (lower = higher priority)
|
|
266
|
+
*/
|
|
267
|
+
export function getPrioritySortIndex(db, value) {
|
|
268
|
+
if (!value)
|
|
269
|
+
return Infinity;
|
|
270
|
+
const priorities = getWorkspacePriorities(db);
|
|
271
|
+
const index = priorities.indexOf(value);
|
|
272
|
+
return index >= 0 ? index : Infinity;
|
|
273
|
+
}
|