@gonovus-ai/spec-flow-cli 2.2.0 → 2.3.1

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.
@@ -0,0 +1,163 @@
1
+ /**
2
+ * SPF-198: when a parent Work Item moves into a completed or canceled status,
3
+ * the person may move its unfinished descendants along. This module owns the
4
+ * client-side half shared by the Web application and the CLI: walking
5
+ * `subtask` relations to any depth, deciding which descendants are open and
6
+ * movable, and mapping the parent's destination onto each descendant's own
7
+ * Project workflow. It has no dependencies; callers inject the relation and
8
+ * workflow reads and send the resulting moves as one atomic bulk
9
+ * `updateStatus` with per-item statuses.
10
+ */
11
+ export type SubtaskCascadeWorkflowCategory = "backlog" | "unstarted" | "started" | "completed" | "canceled";
12
+ /** The categories whose moves offer to bring open descendants along. */
13
+ export type SubtaskCascadeCategory = "completed" | "canceled";
14
+ export interface SubtaskCascadeColumn {
15
+ readonly slug: string;
16
+ readonly name: string;
17
+ readonly category?: SubtaskCascadeWorkflowCategory | null | undefined;
18
+ /** Columns read before categories existed fall back to this flag. */
19
+ readonly isFinal?: boolean | undefined;
20
+ readonly icon?: string | null | undefined;
21
+ readonly position?: number | undefined;
22
+ }
23
+ export interface SubtaskCascadeWorkItem {
24
+ /** Workspace-numbered public id, such as `SPF-176`. */
25
+ readonly id: string;
26
+ /** The owning Project's public id. */
27
+ readonly projectId: string;
28
+ readonly title: string;
29
+ readonly status: string;
30
+ /** The opaque `"N"` version a bulk target must carry. */
31
+ readonly version: string;
32
+ /** Archiving keeps the status; an archived subtask is never a candidate. */
33
+ readonly archivedAt?: string | null | undefined;
34
+ }
35
+ export interface SubtaskCascadeNode {
36
+ readonly id: string;
37
+ readonly projectId: string;
38
+ }
39
+ /** A moving Work Item, optionally with its own destination column. */
40
+ export interface SubtaskCascadeRoot extends SubtaskCascadeNode {
41
+ /**
42
+ * This root's destination in its own Project's workflow. Defaults to the
43
+ * input's `target`; a root whose destination is not completed or canceled
44
+ * is not walked but still never appears as a descendant.
45
+ */
46
+ readonly target?: SubtaskCascadeColumn | undefined;
47
+ }
48
+ /** What one `listWorkItemRelations` read says about a node. */
49
+ export interface SubtaskCascadeRelations {
50
+ /** `canCreateRelation`: the reader may update Work Items in the node's Project. */
51
+ readonly canUpdate: boolean;
52
+ /** The node's direct subtasks. */
53
+ readonly children: readonly SubtaskCascadeWorkItem[];
54
+ }
55
+ /** The minimal relation shape `listWorkItemRelations` returns. */
56
+ export interface SubtaskCascadeRelation {
57
+ readonly relationType: string;
58
+ readonly sourceWorkItem: SubtaskCascadeWorkItem;
59
+ readonly targetWorkItem: SubtaskCascadeWorkItem;
60
+ }
61
+ export type SubtaskCascadeBlockedReason = "no-permission" | "no-matching-status";
62
+ export interface SubtaskCascadeDescendant {
63
+ readonly workItem: SubtaskCascadeWorkItem;
64
+ /** The root it descends from. */
65
+ readonly rootId: string;
66
+ /** 1 for a direct subtask, 2 for its subtask, and so on. */
67
+ readonly depth: number;
68
+ /** The descendant's current column in its own Project, for its status mark. */
69
+ readonly currentColumn: SubtaskCascadeColumn | null;
70
+ /** Its Project's current workflow, for a status mark that depends on siblings. */
71
+ readonly columns: readonly SubtaskCascadeColumn[];
72
+ /** The column it moves to, or null when it stays where it is. */
73
+ readonly targetColumn: SubtaskCascadeColumn | null;
74
+ readonly blockedReason: SubtaskCascadeBlockedReason | null;
75
+ }
76
+ export interface SubtaskCascadePlan {
77
+ /** The walked roots' destination category, or "mixed" when they differ. */
78
+ readonly category: SubtaskCascadeCategory | "mixed";
79
+ /** Every open descendant, depth-first so nested rows follow their parent. */
80
+ readonly descendants: readonly SubtaskCascadeDescendant[];
81
+ readonly movable: readonly SubtaskCascadeDescendant[];
82
+ readonly blocked: readonly SubtaskCascadeDescendant[];
83
+ /** The walk stopped at its bound; more descendants may exist. */
84
+ readonly truncated: boolean;
85
+ /** Descendants visited, finished ones included: the bound the truncation note names. */
86
+ readonly visited: number;
87
+ /**
88
+ * A root's relations or a Project's workflow could not be read (null), so
89
+ * the plan may miss or misjudge descendants. Callers must not present it as
90
+ * complete: the CLI fails and the Web moves only the roots.
91
+ */
92
+ readonly incomplete: boolean;
93
+ }
94
+ /** One target of the atomic bulk move. */
95
+ export interface SubtaskCascadeMove {
96
+ readonly id: string;
97
+ readonly projectId: string;
98
+ readonly version: string;
99
+ readonly status: string;
100
+ /** The status it had before, for undo. */
101
+ readonly previousStatus: string;
102
+ }
103
+ /** Descendants visited before the walk stops; it also bounds cycles. */
104
+ export declare const subtaskCascadeWalkLimit = 200;
105
+ /** One bulk command names at most this many Work Items (`workItemBulkMaximumCount`). */
106
+ export declare const subtaskCascadeBatchLimit = 100;
107
+ /** A column's lifecycle category; pre-category columns fall back to isFinal. */
108
+ export declare function subtaskCascadeColumnCategory(column: SubtaskCascadeColumn): SubtaskCascadeWorkflowCategory;
109
+ /** The cascade category a destination column triggers, or null when it never prompts. */
110
+ export declare function subtaskCascadeCategory(column: SubtaskCascadeColumn | null | undefined): SubtaskCascadeCategory | null;
111
+ /**
112
+ * Whether a status is unfinished in its Project's workflow. A status without
113
+ * a workflow column (such as the archived bucket) is not a candidate: the
114
+ * cascade only moves items that sit in an open column.
115
+ */
116
+ export declare function isOpenSubtaskStatus(columns: readonly SubtaskCascadeColumn[], status: string): boolean;
117
+ /**
118
+ * The column a descendant in another Project moves to: the same slug when
119
+ * that column has the same category, else one with the parent target's icon
120
+ * in that category, else that category's first column by position. Null when
121
+ * the Project has no column of the category.
122
+ */
123
+ export declare function resolveSubtaskCascadeColumn(columns: readonly SubtaskCascadeColumn[], target: SubtaskCascadeColumn): SubtaskCascadeColumn | null;
124
+ /**
125
+ * A node's direct subtasks from its relation list: it is the subtask
126
+ * relation's source. Public Work Item ids are Workspace-unique, so the match
127
+ * never depends on how the caller spelled the Project.
128
+ */
129
+ export declare function subtaskChildren(relations: readonly SubtaskCascadeRelation[], node: SubtaskCascadeNode): readonly SubtaskCascadeWorkItem[];
130
+ export interface DiscoverSubtaskCascadeInput {
131
+ /** The Work Items being moved: one parent, or a whole bulk selection. */
132
+ readonly roots: readonly SubtaskCascadeRoot[];
133
+ /** The roots' default destination column, read from the primary Project's workflow. */
134
+ readonly target: SubtaskCascadeColumn;
135
+ /**
136
+ * Reads one node's relations; null when the reader may not read them (a
137
+ * denied or missing read, 403/404). A descendant is then not movable and
138
+ * its children are unknown; a root makes the plan incomplete. Any other
139
+ * failure (transport, 5xx, 429) must reject, which rejects the discovery.
140
+ */
141
+ readonly readRelations: (node: SubtaskCascadeNode) => Promise<SubtaskCascadeRelations | null>;
142
+ /** Reads a Project's workflow columns; null when unavailable. */
143
+ readonly readColumns: (projectId: string) => Promise<readonly SubtaskCascadeColumn[] | null>;
144
+ /** Defaults to {@link subtaskCascadeWalkLimit}. */
145
+ readonly limit?: number | undefined;
146
+ }
147
+ /**
148
+ * Walks every root's `subtask` descendants to any depth and plans the
149
+ * cascade. Roots and anything already visited are skipped, which dedupes a
150
+ * bulk selection's shared descendants and guards against cycles even though
151
+ * subtask relations are acyclic (ADR 0163). Each root's descendants map
152
+ * from that root's own destination. Answers null when no root's destination
153
+ * triggers a cascade (none is completed or canceled).
154
+ * Reads run level by level, in parallel within a level.
155
+ */
156
+ export declare function discoverSubtaskCascade(input: DiscoverSubtaskCascadeInput): Promise<SubtaskCascadePlan | null>;
157
+ /**
158
+ * What a confirmed cascade would send for its descendants, as one comparable
159
+ * string: a change means the list the person confirmed is no longer current.
160
+ */
161
+ export declare function subtaskCascadeSignature(plan: SubtaskCascadePlan): string;
162
+ /** The descendant moves a confirmed cascade sends alongside the roots. */
163
+ export declare function subtaskCascadeMoves(plan: SubtaskCascadePlan): readonly SubtaskCascadeMove[];
@@ -0,0 +1,204 @@
1
+ // Generated by scripts/generate-cli-subtask-cascade.ts from packages/work-item-subtask-cascade/src/index.ts. Do not edit.
2
+ /**
3
+ * SPF-198: when a parent Work Item moves into a completed or canceled status,
4
+ * the person may move its unfinished descendants along. This module owns the
5
+ * client-side half shared by the Web application and the CLI: walking
6
+ * `subtask` relations to any depth, deciding which descendants are open and
7
+ * movable, and mapping the parent's destination onto each descendant's own
8
+ * Project workflow. It has no dependencies; callers inject the relation and
9
+ * workflow reads and send the resulting moves as one atomic bulk
10
+ * `updateStatus` with per-item statuses.
11
+ */
12
+ /** Descendants visited before the walk stops; it also bounds cycles. */
13
+ export const subtaskCascadeWalkLimit = 200;
14
+ /** One bulk command names at most this many Work Items (`workItemBulkMaximumCount`). */
15
+ export const subtaskCascadeBatchLimit = 100;
16
+ /** A column's lifecycle category; pre-category columns fall back to isFinal. */
17
+ export function subtaskCascadeColumnCategory(column) {
18
+ return column.category ?? (column.isFinal === true ? "completed" : "started");
19
+ }
20
+ /** The cascade category a destination column triggers, or null when it never prompts. */
21
+ export function subtaskCascadeCategory(column) {
22
+ if (column === null || column === undefined)
23
+ return null;
24
+ const category = subtaskCascadeColumnCategory(column);
25
+ return category === "completed" || category === "canceled" ? category : null;
26
+ }
27
+ /**
28
+ * Whether a status is unfinished in its Project's workflow. A status without
29
+ * a workflow column (such as the archived bucket) is not a candidate: the
30
+ * cascade only moves items that sit in an open column.
31
+ */
32
+ export function isOpenSubtaskStatus(columns, status) {
33
+ const column = columns.find((candidate) => candidate.slug === status);
34
+ return column !== undefined && subtaskCascadeCategory(column) === null;
35
+ }
36
+ /**
37
+ * The column a descendant in another Project moves to: the same slug when
38
+ * that column has the same category, else one with the parent target's icon
39
+ * in that category, else that category's first column by position. Null when
40
+ * the Project has no column of the category.
41
+ */
42
+ export function resolveSubtaskCascadeColumn(columns, target) {
43
+ const category = subtaskCascadeColumnCategory(target);
44
+ const candidates = columns
45
+ .map((column, index) => ({ column, index }))
46
+ .filter(({ column }) => subtaskCascadeColumnCategory(column) === category)
47
+ .sort((left, right) => (left.column.position ?? left.index) - (right.column.position ?? right.index) ||
48
+ left.index - right.index)
49
+ .map(({ column }) => column);
50
+ const bySlug = candidates.find((column) => column.slug === target.slug);
51
+ if (bySlug !== undefined)
52
+ return bySlug;
53
+ const icon = target.icon ?? null;
54
+ const byIcon = icon === null ? undefined : candidates.find((column) => (column.icon ?? null) === icon);
55
+ return byIcon ?? candidates[0] ?? null;
56
+ }
57
+ /**
58
+ * A node's direct subtasks from its relation list: it is the subtask
59
+ * relation's source. Public Work Item ids are Workspace-unique, so the match
60
+ * never depends on how the caller spelled the Project.
61
+ */
62
+ export function subtaskChildren(relations, node) {
63
+ return relations
64
+ .filter((relation) => relation.relationType === "subtask" && relation.sourceWorkItem.id === node.id)
65
+ .map((relation) => relation.targetWorkItem);
66
+ }
67
+ /**
68
+ * Walks every root's `subtask` descendants to any depth and plans the
69
+ * cascade. Roots and anything already visited are skipped, which dedupes a
70
+ * bulk selection's shared descendants and guards against cycles even though
71
+ * subtask relations are acyclic (ADR 0163). Each root's descendants map
72
+ * from that root's own destination. Answers null when no root's destination
73
+ * triggers a cascade (none is completed or canceled).
74
+ * Reads run level by level, in parallel within a level.
75
+ */
76
+ export async function discoverSubtaskCascade(input) {
77
+ const walked = input.roots.flatMap((root) => {
78
+ const target = root.target ?? input.target;
79
+ const category = subtaskCascadeCategory(target);
80
+ return category === null ? [] : [{ node: root, root: { id: root.id, target }, category }];
81
+ });
82
+ const first = walked[0];
83
+ if (first === undefined)
84
+ return null;
85
+ const category = walked.every((entry) => entry.category === first.category)
86
+ ? first.category
87
+ : "mixed";
88
+ let incomplete = false;
89
+ const limit = input.limit ?? subtaskCascadeWalkLimit;
90
+ // Every walked root is a start; a selected item that is not walked (its own move
91
+ // does not close it) is still walked through when another root reaches it, so
92
+ // its open subtasks are found, but it never becomes a row (SPF-198).
93
+ const selected = new Set(input.roots.map((root) => root.id));
94
+ const seen = new Set(walked.map(({ node }) => node.id));
95
+ const columnReads = new Map();
96
+ const columnsOf = (projectId) => {
97
+ let read = columnReads.get(projectId);
98
+ if (read === undefined) {
99
+ read = input.readColumns(projectId).then((columns) => {
100
+ if (columns === null)
101
+ incomplete = true;
102
+ return columns;
103
+ });
104
+ columnReads.set(projectId, read);
105
+ }
106
+ return read;
107
+ };
108
+ const topLevel = [];
109
+ let truncated = false;
110
+ let visited = 0;
111
+ let frontier = walked.map(({ node, root }) => ({ node, root, parent: null, depth: 0 }));
112
+ while (frontier.length > 0) {
113
+ const reads = await Promise.all(frontier.map(async (entry) => ({ entry, relations: await input.readRelations(entry.node) })));
114
+ const next = [];
115
+ for (const { entry, relations } of reads) {
116
+ if (relations === null && entry.parent === null)
117
+ incomplete = true;
118
+ if (entry.parent !== null)
119
+ entry.parent.canUpdate = relations?.canUpdate ?? false;
120
+ for (const child of relations?.children ?? []) {
121
+ if (seen.has(child.id))
122
+ continue;
123
+ if (visited >= limit) {
124
+ truncated = true;
125
+ break;
126
+ }
127
+ seen.add(child.id);
128
+ visited += 1;
129
+ const node = {
130
+ workItem: child,
131
+ selected: selected.has(child.id),
132
+ depth: entry.depth + 1,
133
+ root: entry.root,
134
+ children: [],
135
+ canUpdate: false,
136
+ };
137
+ const siblings = entry.parent?.children ?? topLevel;
138
+ siblings.push(node);
139
+ next.push({ node: child, root: entry.root, parent: node, depth: entry.depth + 1 });
140
+ }
141
+ }
142
+ frontier = next;
143
+ }
144
+ const descendants = [];
145
+ const plan = async (nodes) => {
146
+ for (const node of nodes) {
147
+ const columns = (await columnsOf(node.workItem.projectId)) ?? [];
148
+ const archived = node.workItem.archivedAt !== null && node.workItem.archivedAt !== undefined;
149
+ if (!node.selected && !archived && isOpenSubtaskStatus(columns, node.workItem.status)) {
150
+ const currentColumn = columns.find((column) => column.slug === node.workItem.status) ?? null;
151
+ const targetColumn = resolveSubtaskCascadeColumn(columns, node.root.target);
152
+ const blockedReason = !node.canUpdate
153
+ ? "no-permission"
154
+ : targetColumn === null
155
+ ? "no-matching-status"
156
+ : null;
157
+ descendants.push({
158
+ workItem: node.workItem,
159
+ rootId: node.root.id,
160
+ depth: node.depth,
161
+ currentColumn,
162
+ columns,
163
+ targetColumn: blockedReason === null ? targetColumn : null,
164
+ blockedReason,
165
+ });
166
+ }
167
+ await plan(node.children);
168
+ }
169
+ };
170
+ await plan(topLevel);
171
+ return {
172
+ category,
173
+ descendants,
174
+ movable: descendants.filter((descendant) => descendant.blockedReason === null),
175
+ blocked: descendants.filter((descendant) => descendant.blockedReason !== null),
176
+ truncated,
177
+ visited,
178
+ incomplete,
179
+ };
180
+ }
181
+ /**
182
+ * What a confirmed cascade would send for its descendants, as one comparable
183
+ * string: a change means the list the person confirmed is no longer current.
184
+ */
185
+ export function subtaskCascadeSignature(plan) {
186
+ return JSON.stringify(subtaskCascadeMoves(plan)
187
+ .map((move) => [move.id, move.version, move.status])
188
+ .sort(([left = ""], [right = ""]) => left.localeCompare(right)));
189
+ }
190
+ /** The descendant moves a confirmed cascade sends alongside the roots. */
191
+ export function subtaskCascadeMoves(plan) {
192
+ return plan.movable.flatMap((descendant) => descendant.targetColumn === null
193
+ ? []
194
+ : [
195
+ {
196
+ id: descendant.workItem.id,
197
+ projectId: descendant.workItem.projectId,
198
+ version: descendant.workItem.version,
199
+ status: descendant.targetColumn.slug,
200
+ previousStatus: descendant.workItem.status,
201
+ },
202
+ ]);
203
+ }
204
+ //# sourceMappingURL=work-item-subtask-cascade.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"work-item-subtask-cascade.js","sourceRoot":"","sources":["../../src/generated/work-item-subtask-cascade.ts"],"names":[],"mappings":"AAAA,0HAA0H;AAC1H;;;;;;;;;GASG;AA2GH,wEAAwE;AACxE,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAC3C,wFAAwF;AACxF,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAC;AAE5C,gFAAgF;AAChF,MAAM,UAAU,4BAA4B,CAC1C,MAA4B;IAE5B,OAAO,MAAM,CAAC,QAAQ,IAAI,CAAC,MAAM,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;AAChF,CAAC;AAED,yFAAyF;AACzF,MAAM,UAAU,sBAAsB,CACpC,MAA+C;IAE/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AAU,CAAC,aAAa,KAAK,IAAI,CAAC;QAC9E,SAAS;QACT,OAAO;QACP,UAAU;KACX,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,IAAwB;IAC9D,OAAO,IAAI,CAAC,SAAS,CACnB,mBAAmB,CAAC,IAAI,CAAC;SACtB,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;SACnD,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC,EAAE,CAAC,KAAK,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAClE,CAAC;AACJ,CAAC;AAED,0EAA0E;AAC1E,MAAM,UAAU,mBAAmB,CAAC,IAAwB;IAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE,CACzC,UAAU,CAAC,YAAY,KAAK,IAAI;QAC9B,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC;YACE;gBACE,EAAE,EAAE,UAAU,CAAC,QAAQ,CAAC,EAAE;gBAC1B,SAAS,EAAE,UAAU,CAAC,QAAQ,CAAC,SAAS;gBACxC,OAAO,EAAE,UAAU,CAAC,QAAQ,CAAC,OAAO;gBACpC,MAAM,EAAE,UAAU,CAAC,YAAY,CAAC,IAAI;gBACpC,cAAc,EAAE,UAAU,CAAC,QAAQ,CAAC,MAAM;aAC3C;SACF,CACN,CAAC;AACJ,CAAC"}
@@ -0,0 +1,54 @@
1
+ import type createClient from "openapi-fetch";
2
+ import type { paths } from "@spec-flow/api-client";
3
+ import { type SubtaskCascadeColumn, type SubtaskCascadePlan } from "./generated/work-item-subtask-cascade.js";
4
+ import type { ApiResult } from "./runtime/execute.js";
5
+ type SpecFlowClient = ReturnType<typeof createClient<paths>>;
6
+ type WorkflowColumnsResponse = paths["/v1/projects/{projectId}/workflow-columns"]["get"]["responses"][200]["content"]["application/json"];
7
+ type MoveResponse = paths["/v1/projects/{projectId}/work-items/{workItemId}/move"]["post"]["responses"][200]["content"]["application/json"];
8
+ export interface SubtaskCascadeSummary {
9
+ readonly moved: readonly {
10
+ readonly id: string;
11
+ readonly projectId: string;
12
+ readonly status: string;
13
+ readonly previousStatus: string;
14
+ }[];
15
+ readonly skipped: readonly {
16
+ readonly id: string;
17
+ readonly projectId: string;
18
+ readonly status: string;
19
+ readonly reason: "no-permission" | "no-matching-status";
20
+ }[];
21
+ readonly truncated: boolean;
22
+ }
23
+ export type CascadeMoveData = MoveResponse & {
24
+ readonly subtasks: SubtaskCascadeSummary;
25
+ };
26
+ /** Plans the open descendants of one Work Item moving into `target` (SPF-198). */
27
+ export declare function planCliSubtaskCascade(client: SpecFlowClient, root: {
28
+ readonly projectId: string;
29
+ readonly workItemId: string;
30
+ }, target: SubtaskCascadeColumn): Promise<SubtaskCascadePlan | null>;
31
+ /**
32
+ * `work-item move --with-subtasks`: moves the Work Item and, when the
33
+ * destination is completed or canceled, every open descendant the caller may
34
+ * update, in one atomic bulk command. Other destinations move only the item.
35
+ */
36
+ export declare function moveWithSubtasks(client: SpecFlowClient, input: {
37
+ readonly projectId: string;
38
+ readonly workItemId: string;
39
+ readonly expectedVersion: string;
40
+ readonly status: string;
41
+ readonly idempotencyKey: string;
42
+ }): Promise<ApiResult<CascadeMoveData>>;
43
+ /**
44
+ * After a plain move into a completed or canceled status, the one-line hint
45
+ * naming open descendants that stayed put. Best effort: a failed read never
46
+ * changes the move's outcome, so it answers null.
47
+ */
48
+ export declare function subtaskCascadeHint(client: SpecFlowClient, input: {
49
+ readonly projectId: string;
50
+ readonly workItemId: string;
51
+ readonly status: string;
52
+ readonly columns?: WorkflowColumnsResponse["workflowColumns"] | undefined;
53
+ }): Promise<string | null>;
54
+ export {};
@@ -0,0 +1,234 @@
1
+ import { discoverSubtaskCascade, subtaskCascadeBatchLimit, subtaskCascadeCategory, subtaskCascadeMoves, subtaskChildren, } from "./generated/work-item-subtask-cascade.js";
2
+ /** Plans the open descendants of one Work Item moving into `target` (SPF-198). */
3
+ export async function planCliSubtaskCascade(client, root, target) {
4
+ return await discoverSubtaskCascade({
5
+ roots: [{ id: root.workItemId, projectId: root.projectId }],
6
+ target,
7
+ readRelations: async (node) => {
8
+ const listed = await client.GET("/v1/projects/{projectId}/work-items/{workItemId}/relations", {
9
+ params: { path: { projectId: node.projectId, workItemId: node.id } },
10
+ });
11
+ if (listed.data === undefined) {
12
+ // A denied or missing read leaves that subtask in place; anything else
13
+ // (transport, 5xx, 429) aborts the plan rather than move a partial one.
14
+ if (listed.response.status === 403 || listed.response.status === 404)
15
+ return null;
16
+ throw new Error(`Reading the relations of ${node.id} failed (${String(listed.response.status)})`);
17
+ }
18
+ return {
19
+ canUpdate: listed.data.canCreateRelation,
20
+ children: subtaskChildren(listed.data.relations, node),
21
+ };
22
+ },
23
+ readColumns: async (projectId) => {
24
+ const listed = await client.GET("/v1/projects/{projectId}/workflow-columns", {
25
+ params: { path: { projectId } },
26
+ });
27
+ return listed.data?.workflowColumns ?? null;
28
+ },
29
+ });
30
+ }
31
+ function summarize(plan) {
32
+ return {
33
+ moved: plan === null
34
+ ? []
35
+ : subtaskCascadeMoves(plan).map(({ id, projectId, status, previousStatus }) => ({
36
+ id,
37
+ projectId,
38
+ status,
39
+ previousStatus,
40
+ })),
41
+ skipped: (plan?.blocked ?? []).map((descendant) => ({
42
+ id: descendant.workItem.id,
43
+ projectId: descendant.workItem.projectId,
44
+ status: descendant.workItem.status,
45
+ reason: descendant.blockedReason ?? "no-permission",
46
+ })),
47
+ truncated: plan?.truncated ?? false,
48
+ };
49
+ }
50
+ /**
51
+ * `work-item move --with-subtasks`: moves the Work Item and, when the
52
+ * destination is completed or canceled, every open descendant the caller may
53
+ * update, in one atomic bulk command. Other destinations move only the item.
54
+ */
55
+ export async function moveWithSubtasks(client, input) {
56
+ const columns = await client.GET("/v1/projects/{projectId}/workflow-columns", {
57
+ params: { path: { projectId: input.projectId } },
58
+ });
59
+ if (columns.data === undefined)
60
+ return columns;
61
+ const target = columns.data.workflowColumns.find((column) => column.slug === input.status);
62
+ let plan = null;
63
+ if (target !== undefined && subtaskCascadeCategory(target) !== null) {
64
+ // A partial walk could close the parent while leaving subtasks it never saw.
65
+ const planned = await planCliSubtaskCascade(client, input, target).catch(() => null);
66
+ if (planned === null || planned.incomplete) {
67
+ return {
68
+ error: {
69
+ code: "SUBTASK_CASCADE_UNREADABLE",
70
+ message: `Could not read every subtask of ${input.workItemId} or its workflow; nothing was moved. Retry, or move without --with-subtasks to move only ${input.workItemId}`,
71
+ },
72
+ response: new Response(null, { status: 503 }),
73
+ };
74
+ }
75
+ if (planned.truncated) {
76
+ // A bounded walk may have missed subtasks; closing only some of them is never silent.
77
+ return {
78
+ error: {
79
+ code: "SUBTASK_CASCADE_TRUNCATED",
80
+ message: `${input.workItemId} has more than ${String(planned.visited)} subtasks to check; nothing was moved. Close them in smaller groups with work-item bulk, or move without --with-subtasks to move only ${input.workItemId}`,
81
+ },
82
+ response: new Response(null, { status: 422 }),
83
+ };
84
+ }
85
+ plan = planned;
86
+ }
87
+ const moves = plan === null ? [] : subtaskCascadeMoves(plan);
88
+ if (moves.length + 1 > subtaskCascadeBatchLimit) {
89
+ return {
90
+ error: {
91
+ code: "SUBTASK_CASCADE_TOO_LARGE",
92
+ message: `${String(moves.length)} open subtasks exceed one batch of ${String(subtaskCascadeBatchLimit)}; move them in smaller groups with work-item bulk`,
93
+ },
94
+ response: new Response(null, { status: 422 }),
95
+ };
96
+ }
97
+ if (moves.length === 0) {
98
+ const moved = await moveOne(client, input);
99
+ return moved.data === undefined
100
+ ? moved
101
+ : { ...moved, data: { ...moved.data, subtasks: summarize(plan) } };
102
+ }
103
+ const bulk = await client.POST("/v1/projects/{projectId}/work-items/bulk", {
104
+ body: {
105
+ action: "updateStatus",
106
+ status: input.status,
107
+ workItems: [
108
+ { id: input.workItemId, version: input.expectedVersion },
109
+ ...moves.map((move) => ({
110
+ id: move.id,
111
+ projectId: move.projectId,
112
+ status: move.status,
113
+ version: move.version,
114
+ })),
115
+ ],
116
+ },
117
+ params: {
118
+ header: { "idempotency-key": input.idempotencyKey },
119
+ path: { projectId: input.projectId },
120
+ },
121
+ });
122
+ if (bulk.data === undefined)
123
+ return bulk;
124
+ const parent = bulk.data.workItems.find((item) => item.id === input.workItemId);
125
+ if (parent === undefined) {
126
+ // A replay omits items edited after the stored outcome; read the current item.
127
+ const read = await client.GET("/v1/projects/{projectId}/work-items/{workItemId}", {
128
+ params: { path: { projectId: input.projectId, workItemId: input.workItemId } },
129
+ });
130
+ if (read.data === undefined)
131
+ return read;
132
+ return {
133
+ data: {
134
+ permissions: bulk.data.permissions,
135
+ workItem: read.data.workItem,
136
+ subtasks: summarize(plan),
137
+ },
138
+ response: bulk.response,
139
+ };
140
+ }
141
+ return {
142
+ data: {
143
+ permissions: bulk.data.permissions,
144
+ workItem: parent,
145
+ subtasks: summarize(plan),
146
+ },
147
+ response: bulk.response,
148
+ };
149
+ }
150
+ async function moveOne(client, input) {
151
+ return await client.POST("/v1/projects/{projectId}/work-items/{workItemId}/move", {
152
+ body: { status: input.status },
153
+ params: {
154
+ header: { "idempotency-key": input.idempotencyKey, "if-match": input.expectedVersion },
155
+ path: { projectId: input.projectId, workItemId: input.workItemId },
156
+ },
157
+ });
158
+ }
159
+ /**
160
+ * After a plain move into a completed or canceled status, the one-line hint
161
+ * naming open descendants that stayed put. Best effort: a failed read never
162
+ * changes the move's outcome, so it answers null.
163
+ */
164
+ export async function subtaskCascadeHint(client, input) {
165
+ let target;
166
+ try {
167
+ const columns = input.columns ??
168
+ (await client.GET("/v1/projects/{projectId}/workflow-columns", {
169
+ params: { path: { projectId: input.projectId } },
170
+ })).data?.workflowColumns;
171
+ target = columns?.find((column) => column.slug === input.status);
172
+ }
173
+ catch {
174
+ return null;
175
+ }
176
+ if (target === undefined || subtaskCascadeCategory(target) === null)
177
+ return null;
178
+ // The item is closed by now; an unread tree is said out loud, never left silent.
179
+ const unreadable = `Could not read every subtask of ${input.workItemId}; list them with work-item relation list and tell the User which are still open.`;
180
+ try {
181
+ const plan = await planCliSubtaskCascade(client, input, target);
182
+ if (plan === null || plan.incomplete)
183
+ return unreadable;
184
+ if (plan.descendants.length === 0)
185
+ return null;
186
+ return describeOpenSubtasks(input.workItemId, plan);
187
+ }
188
+ catch {
189
+ return unreadable;
190
+ }
191
+ }
192
+ const namedSubtaskLimit = 10;
193
+ function nameSubtasks(ids) {
194
+ const named = ids.slice(0, namedSubtaskLimit).join(", ");
195
+ return ids.length > namedSubtaskLimit
196
+ ? `${named} and ${String(ids.length - namedSubtaskLimit)} more`
197
+ : named;
198
+ }
199
+ const blockedReasonText = {
200
+ "no-matching-status": "its Project has no matching status",
201
+ "no-permission": "you cannot update it",
202
+ };
203
+ /**
204
+ * Names every unfinished subtask a plain move left open, so an agent can pass
205
+ * them on: which could close with the item on a rerun with --with-subtasks,
206
+ * and which stay open and why (SPF-198).
207
+ */
208
+ function describeOpenSubtasks(workItemId, plan) {
209
+ const total = `${String(plan.descendants.length)}${plan.truncated ? "+" : ""}`;
210
+ const parts = [`${workItemId} still has ${total} unfinished subtask(s).`];
211
+ const movable = subtaskCascadeMoves(plan).map((move) => move.id);
212
+ if (movable.length > 0) {
213
+ const verb = plan.category === "canceled" ? "cancel" : "complete";
214
+ // One flagged rerun refuses a truncated walk or more than one batch.
215
+ const rerun = plan.truncated || movable.length + 1 > subtaskCascadeBatchLimit
216
+ ? "close them in groups with work-item bulk"
217
+ : "run the same command again with --with-subtasks and the new --expected-version";
218
+ parts.push(`Can ${verb} with it: ${nameSubtasks(movable)}; if the User wants them ${verb === "cancel" ? "canceled" : "completed"} too, ${rerun}.`);
219
+ }
220
+ for (const reason of ["no-matching-status", "no-permission"]) {
221
+ const ids = plan.blocked
222
+ .filter((descendant) => (descendant.blockedReason ?? "no-permission") === reason)
223
+ .map((descendant) => descendant.workItem.id);
224
+ if (ids.length > 0)
225
+ parts.push(`Stay open (${blockedReasonText[reason]}): ${nameSubtasks(ids)}.`);
226
+ }
227
+ if (plan.truncated)
228
+ parts.push("More subtasks exist than were checked.");
229
+ if (plan.truncated || plan.descendants.length > namedSubtaskLimit)
230
+ parts.push("List them all with work-item relation list.");
231
+ parts.push("Tell the User which subtasks are still open.");
232
+ return parts.join(" ");
233
+ }
234
+ //# sourceMappingURL=work-item-subtask-cascade.js.map