pi-jar 0.1.4 → 0.1.6
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/README.md +35 -19
- package/docs/INTEGRATIONS.md +2 -2
- package/docs/WORKFLOWS.md +34 -10
- package/extensions/index.ts +87 -15
- package/package.json +1 -1
- package/src/activity-view.ts +23 -7
- package/src/ask-tool.ts +12 -7
- package/src/compact-tools.ts +66 -28
- package/src/delegate-worktree.ts +360 -0
- package/src/delegate.ts +934 -130
- package/src/democracy.ts +214 -0
- package/src/discussion.ts +189 -0
- package/src/footer.ts +4 -3
- package/src/goal-loop.ts +11 -16
- package/src/model-roles.ts +58 -29
- package/src/plan.ts +4 -10
- package/src/roles-ui.ts +18 -10
- package/src/settings-ui.ts +41 -15
- package/src/settings.ts +9 -1
- package/src/status.ts +2 -1
- package/src/task-tool.ts +33 -18
- package/src/tasks.ts +7 -7
package/src/tasks.ts
CHANGED
|
@@ -11,7 +11,7 @@ export type TodoStatus = (typeof TODO_STATUSES)[number];
|
|
|
11
11
|
export interface Todo { id: string; title: string; done: boolean; status: TodoStatus; activeForm?: string; details?: string; parentId?: string }
|
|
12
12
|
/** A parent's own `status` is ignored when it has subtasks. */
|
|
13
13
|
export interface TodoInput { id?: string; title: string; status: TodoStatus; activeForm?: string; details?: string; subtasks?: readonly TodoInput[] }
|
|
14
|
-
export type
|
|
14
|
+
export type TodoUpdate = Partial<Omit<TodoInput, "id">>;
|
|
15
15
|
/** Bounds the whole list: parents plus subtasks. */
|
|
16
16
|
export const MAX_TODOS = 50;
|
|
17
17
|
|
|
@@ -312,12 +312,12 @@ export class TodoStore {
|
|
|
312
312
|
} else next.push(...inputs);
|
|
313
313
|
return this.write(next);
|
|
314
314
|
}
|
|
315
|
-
/**
|
|
316
|
-
|
|
317
|
-
if (!this.items.has(id)) return "
|
|
318
|
-
if (!replacement || typeof replacement !== "object" || Array.isArray(replacement)) return "
|
|
319
|
-
if ("id" in replacement && replacement.id !== id) return "
|
|
320
|
-
if (!Object.keys(replacement).some((key) => ["title", "status", "activeForm", "subtasks"].includes(key))) return "
|
|
315
|
+
/** Update only the addressed task. Omitted fields and subtasks are preserved. */
|
|
316
|
+
update(id: string, replacement: TodoUpdate): string | undefined {
|
|
317
|
+
if (!this.items.has(id)) return "update needs a valid existing task id.";
|
|
318
|
+
if (!replacement || typeof replacement !== "object" || Array.isArray(replacement)) return "update needs task fields.";
|
|
319
|
+
if ("id" in replacement && replacement.id !== id) return "Update id must match the addressed task.";
|
|
320
|
+
if (!Object.keys(replacement).some((key) => ["title", "status", "activeForm", "subtasks"].includes(key))) return "update needs at least one task field.";
|
|
321
321
|
const next = this.snapshot();
|
|
322
322
|
const target = next.flatMap((item) => [item, ...(item.subtasks ?? [])]).find((item) => item.id === id)!;
|
|
323
323
|
if (this.items.get(id)?.parentId && replacement.subtasks?.length) return "Subtasks cannot have their own subtasks; nest only one level.";
|