@damper/cli 0.9.3 → 0.9.4
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.
|
@@ -105,6 +105,17 @@ export declare class DamperApi {
|
|
|
105
105
|
quarter?: string;
|
|
106
106
|
sort?: 'importance' | 'newest' | 'votes';
|
|
107
107
|
limit?: number;
|
|
108
|
+
offset?: number;
|
|
109
|
+
}): Promise<{
|
|
110
|
+
project: string;
|
|
111
|
+
tasks: Task[];
|
|
112
|
+
total: number;
|
|
113
|
+
}>;
|
|
114
|
+
listAllTasks(filters?: {
|
|
115
|
+
status?: 'planned' | 'in_progress' | 'done' | 'all';
|
|
116
|
+
type?: 'bug' | 'feature' | 'improvement' | 'task';
|
|
117
|
+
quarter?: string;
|
|
118
|
+
sort?: 'importance' | 'newest' | 'votes';
|
|
108
119
|
}): Promise<{
|
|
109
120
|
project: string;
|
|
110
121
|
tasks: Task[];
|
|
@@ -40,9 +40,23 @@ export class DamperApi {
|
|
|
40
40
|
params.set('sort', filters.sort);
|
|
41
41
|
if (filters?.limit)
|
|
42
42
|
params.set('limit', String(filters.limit));
|
|
43
|
+
if (filters?.offset)
|
|
44
|
+
params.set('offset', String(filters.offset));
|
|
43
45
|
const query = params.toString();
|
|
44
46
|
const data = await this.request('GET', `/api/agent/tasks${query ? `?${query}` : ''}`);
|
|
45
|
-
return { project: data.project.name, tasks: data.tasks };
|
|
47
|
+
return { project: data.project.name, tasks: data.tasks, total: data.total };
|
|
48
|
+
}
|
|
49
|
+
async listAllTasks(filters) {
|
|
50
|
+
const pageSize = 100;
|
|
51
|
+
const first = await this.listTasks({ ...filters, limit: pageSize });
|
|
52
|
+
const allTasks = [...first.tasks];
|
|
53
|
+
while (allTasks.length < first.total) {
|
|
54
|
+
const page = await this.listTasks({ ...filters, limit: pageSize, offset: allTasks.length });
|
|
55
|
+
allTasks.push(...page.tasks);
|
|
56
|
+
if (page.tasks.length === 0)
|
|
57
|
+
break; // safety: avoid infinite loop
|
|
58
|
+
}
|
|
59
|
+
return { project: first.project, tasks: allTasks };
|
|
46
60
|
}
|
|
47
61
|
async getTask(taskId) {
|
|
48
62
|
return this.request('GET', `/api/agent/tasks/${taskId}`);
|
package/dist/ui/task-picker.js
CHANGED
|
@@ -118,12 +118,11 @@ function formatTaskChoice(choice, titleWidth, layout) {
|
|
|
118
118
|
}
|
|
119
119
|
export async function pickTask(options) {
|
|
120
120
|
const { api, worktrees, typeFilter, statusFilter } = options;
|
|
121
|
-
// Fetch tasks from Damper
|
|
122
|
-
const { tasks, project } = await api.
|
|
121
|
+
// Fetch all tasks from Damper (paginated)
|
|
122
|
+
const { tasks, project } = await api.listAllTasks({
|
|
123
123
|
status: statusFilter || 'all',
|
|
124
124
|
type: typeFilter,
|
|
125
125
|
sort: 'importance',
|
|
126
|
-
limit: 100,
|
|
127
126
|
});
|
|
128
127
|
// Filter out completed tasks unless specifically requested
|
|
129
128
|
const availableTasks = tasks.filter(t => statusFilter === 'done' || statusFilter === 'all' ||
|