@gonovus-ai/spec-flow-cli 1.4.1 → 1.5.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.
package/README.md CHANGED
@@ -39,7 +39,7 @@ seven-day Better Auth CLI Session. It supports the Node.js 24 runtime line;
39
39
  Node.js 22 and unverified future major versions are intentionally unsupported.
40
40
 
41
41
  ```bash
42
- npm install --global @gonovus-ai/spec-flow-cli@1.4.1
42
+ npm install --global @gonovus-ai/spec-flow-cli@1.5.1
43
43
  specflow auth login
44
44
  specflow auth status
45
45
  specflow auth logout
@@ -96,13 +96,25 @@ byte-identical; `--check` exits 1 with a diff when it is stale. Changes written
96
96
  the CLI are Agent changes: Guardrails and proposed placement wait for a person's
97
97
  review in the Web application, and publishing waits until then (`REVIEW_PENDING`).
98
98
 
99
+ ## Versions
100
+
101
+ CLI 1.5.1 plans deliveries as Workspace Versions (ADR 0177). `specflow version` alone
102
+ still checks compatibility; its subcommands manage Versions (`specflow guide versions`):
103
+
104
+ ```bash
105
+ specflow version list --workspace-id <workspace-id>
106
+ specflow version scope add --workspace-id <workspace-id> --version-id v2.4 --expected-version 7 --work-item PAY-123
107
+ specflow version seal --workspace-id <workspace-id> --version-id v2.4 --preview
108
+ specflow spec labels set --workspace-id <workspace-id> --spec-id PAY-S12 --label-id <label-id>
109
+ ```
110
+
99
111
  ## Compatibility and upgrades
100
112
 
101
113
  ```bash
102
- specflow version --json --skill-version 0.10.1 --compatible-cli "^1.4.1"
114
+ specflow version --json --skill-version 0.11.2 --compatible-cli "^1.5.1"
103
115
  specflow upgrade
104
116
  specflow upgrade --yes
105
- specflow upgrade --to 1.4.1
117
+ specflow upgrade --to 1.5.1
106
118
  ```
107
119
 
108
120
  `version` shows the installed CLI and public advice from the selected origin.
package/dist/cli.js CHANGED
@@ -24,6 +24,7 @@ import { selectSession, hasWorkspaceReadToken, rejectWorkspaceReadTokenOperation
24
24
  import { registerSpecDiscussionCommands } from "./spec-discussion-commands.js";
25
25
  import { registerSpecOwnerCommands } from "./spec-owner-commands.js";
26
26
  import { registerUserApiKeyCommands } from "./user-api-key-commands.js";
27
+ import { registerSpecLabelCommands, registerVersionCommands, resolveProjectVersion, } from "./version-commands.js";
27
28
  import { registerWorkItemAssetCommands } from "./work-item-asset-commands.js";
28
29
  import { registerWorkItemDeliveryCommands } from "./work-item-delivery-commands.js";
29
30
  import { readWorkItemImportFile } from "./work-item-exchange-file.js";
@@ -173,7 +174,7 @@ export async function runCli(arguments_, originalDependencies) {
173
174
  dependencies.stderr(formatResourceDiagnostic("This server version does not support Work Item URLs; upgrade the server. The business operation succeeded."));
174
175
  };
175
176
  const program = createProgram(dependencies);
176
- registerClientCompatibilityCommands(program, dependencies, (code) => {
177
+ const versionCommand = registerClientCompatibilityCommands(program, dependencies, (code) => {
177
178
  exitCode = code;
178
179
  });
179
180
  const run = async (request, options = {}) => {
@@ -1737,6 +1738,8 @@ export async function runCli(arguments_, originalDependencies) {
1737
1738
  };
1738
1739
  registerContextDocumentCommands(program, contextRuntime);
1739
1740
  registerBoardCommands(program, contextRuntime);
1741
+ registerVersionCommands(versionCommand, contextRuntime);
1742
+ registerSpecLabelCommands(spec, contextRuntime);
1740
1743
  const workItemComment = workItem
1741
1744
  .command("comment")
1742
1745
  .description("Read and manage authored task comments");
@@ -2140,6 +2143,7 @@ export async function runCli(arguments_, originalDependencies) {
2140
2143
  .option("--relation-target-work-item-id <workItemId>", "Public identity of the related task", parseWorkItemId)
2141
2144
  .option("--replace-parent", "Replace an existing parent when creating a subtask relation")
2142
2145
  .option("--initial-watcher-ids <json>", "Initial watcher User IDs as a JSON array; [] explicitly mutes the creator", (value) => parseStringArray(value, "initial-watcher-ids"))
2146
+ .option("--version-id <versionId>", "Plan the Work Item in this unsealed Version: its id or name, such as v2.4", parseVersionId)
2143
2147
  .action(async (options) => {
2144
2148
  const description = (await readDescription(options)) ?? undefined;
2145
2149
  if (hasWorkspaceReadToken(dependencies.environment)) {
@@ -2171,36 +2175,44 @@ export async function runCli(arguments_, originalDependencies) {
2171
2175
  };
2172
2176
  const customFields = options.customField.map(parseCustomFieldAssignment);
2173
2177
  const idempotencyKey = randomUUID();
2174
- exitCode = await run((client, me, _credentialKind, members) => client.POST("/v1/projects/{projectId}/work-items", {
2175
- body: {
2176
- ...(options.assignee === undefined
2177
- ? {}
2178
- : { assigneeId: me ?? members?.get(options.assignee) ?? options.assignee }),
2179
- ...(options.assignedAgent === undefined
2180
- ? {}
2181
- : { assignedAgentId: options.assignedAgent }),
2182
- ...(options.customField.length === 0
2183
- ? {}
2184
- : {
2185
- customFields,
2186
- }),
2187
- ...(description === undefined ? {} : { description }),
2188
- ...(options.label.length === 0 ? {} : { labelIds: [...new Set(options.label)] }),
2189
- ...(options.initialWatcherIds === undefined
2190
- ? {}
2191
- : { initialWatcherIds: options.initialWatcherIds }),
2192
- ...(options.dueDate === undefined ? {} : { dueDate: options.dueDate }),
2193
- ...(options.priority === undefined ? {} : { priority: options.priority }),
2194
- ...(options.startDate === undefined ? {} : { startDate: options.startDate }),
2195
- ...(options.status === undefined ? {} : { status: options.status }),
2196
- ...(relation === undefined ? {} : { relation }),
2197
- title: options.title,
2198
- },
2199
- params: {
2200
- header: { "idempotency-key": idempotencyKey },
2201
- path: { projectId: options.projectId },
2202
- },
2203
- }), {
2178
+ exitCode = await run(async (client, me, _credentialKind, members) => {
2179
+ const plannedVersion = options.versionId === undefined
2180
+ ? undefined
2181
+ : await resolveProjectVersion(client, options.projectId, options.versionId);
2182
+ if (plannedVersion !== undefined && "failure" in plannedVersion)
2183
+ return plannedVersion.failure;
2184
+ return await client.POST("/v1/projects/{projectId}/work-items", {
2185
+ body: {
2186
+ ...(options.assignee === undefined
2187
+ ? {}
2188
+ : { assigneeId: me ?? members?.get(options.assignee) ?? options.assignee }),
2189
+ ...(options.assignedAgent === undefined
2190
+ ? {}
2191
+ : { assignedAgentId: options.assignedAgent }),
2192
+ ...(options.customField.length === 0
2193
+ ? {}
2194
+ : {
2195
+ customFields,
2196
+ }),
2197
+ ...(description === undefined ? {} : { description }),
2198
+ ...(options.label.length === 0 ? {} : { labelIds: [...new Set(options.label)] }),
2199
+ ...(options.initialWatcherIds === undefined
2200
+ ? {}
2201
+ : { initialWatcherIds: options.initialWatcherIds }),
2202
+ ...(options.dueDate === undefined ? {} : { dueDate: options.dueDate }),
2203
+ ...(options.priority === undefined ? {} : { priority: options.priority }),
2204
+ ...(options.startDate === undefined ? {} : { startDate: options.startDate }),
2205
+ ...(options.status === undefined ? {} : { status: options.status }),
2206
+ ...(relation === undefined ? {} : { relation }),
2207
+ title: options.title,
2208
+ ...(plannedVersion === undefined ? {} : { versionId: plannedVersion.id }),
2209
+ },
2210
+ params: {
2211
+ header: { "idempotency-key": idempotencyKey },
2212
+ path: { projectId: options.projectId },
2213
+ },
2214
+ });
2215
+ }, {
2204
2216
  resolveMe: options.assignee === "me",
2205
2217
  ...(options.assignee === undefined
2206
2218
  ? {}
@@ -2226,6 +2238,8 @@ export async function runCli(arguments_, originalDependencies) {
2226
2238
  .option("--due-date <dueDate>", "ISO 8601 date", parseWorkItemDate)
2227
2239
  .option("--clear-start-date", "Remove the Work Item start date")
2228
2240
  .option("--clear-due-date", "Remove the Work Item due date")
2241
+ .option("--version-id <versionId>", "Move the Work Item into this unsealed Version: its id or name, such as v2.4", parseVersionId)
2242
+ .option("--clear-version", "Take the Work Item out of its Version")
2229
2243
  .action(async (options) => {
2230
2244
  const description = (await readDescription(options)) ?? undefined;
2231
2245
  if (hasWorkspaceReadToken(dependencies.environment)) {
@@ -2239,9 +2253,14 @@ export async function runCli(arguments_, originalDependencies) {
2239
2253
  options.startDate === undefined &&
2240
2254
  options.dueDate === undefined &&
2241
2255
  options.clearStartDate !== true &&
2242
- options.clearDueDate !== true) {
2256
+ options.clearDueDate !== true &&
2257
+ options.versionId === undefined &&
2258
+ options.clearVersion !== true) {
2243
2259
  throw invalidArgument("Work Item update requires a field change");
2244
2260
  }
2261
+ if (options.clearVersion === true && options.versionId !== undefined) {
2262
+ throw invalidArgument("Work Item update cannot set and clear the Version together");
2263
+ }
2245
2264
  if (options.clearStartDate === true && options.startDate !== undefined) {
2246
2265
  throw invalidArgument("Work Item update cannot set and clear the start date together");
2247
2266
  }
@@ -2249,37 +2268,49 @@ export async function runCli(arguments_, originalDependencies) {
2249
2268
  throw invalidArgument("Work Item update cannot set and clear the due date together");
2250
2269
  }
2251
2270
  const idempotencyKey = randomUUID();
2252
- exitCode = await run((client) => client.PATCH("/v1/projects/{projectId}/work-items/{workItemId}", {
2253
- body: {
2254
- ...(options.clearDescription === true
2255
- ? { description: null }
2256
- : description === undefined
2257
- ? {}
2258
- : { description }),
2259
- ...(options.clearDueDate === true
2260
- ? { dueDate: null }
2261
- : options.dueDate === undefined
2262
- ? {}
2263
- : { dueDate: options.dueDate }),
2264
- ...(options.clearStartDate === true
2265
- ? { startDate: null }
2266
- : options.startDate === undefined
2267
- ? {}
2268
- : { startDate: options.startDate }),
2269
- ...(options.priority === undefined ? {} : { priority: options.priority }),
2270
- ...(options.title === undefined ? {} : { title: options.title }),
2271
- },
2272
- params: {
2273
- header: {
2274
- "idempotency-key": idempotencyKey,
2275
- "if-match": options.expectedVersion,
2271
+ exitCode = await run(async (client) => {
2272
+ const plannedVersion = options.versionId === undefined
2273
+ ? undefined
2274
+ : await resolveProjectVersion(client, options.projectId, options.versionId);
2275
+ if (plannedVersion !== undefined && "failure" in plannedVersion)
2276
+ return plannedVersion.failure;
2277
+ return await client.PATCH("/v1/projects/{projectId}/work-items/{workItemId}", {
2278
+ body: {
2279
+ ...(options.clearDescription === true
2280
+ ? { description: null }
2281
+ : description === undefined
2282
+ ? {}
2283
+ : { description }),
2284
+ ...(options.clearDueDate === true
2285
+ ? { dueDate: null }
2286
+ : options.dueDate === undefined
2287
+ ? {}
2288
+ : { dueDate: options.dueDate }),
2289
+ ...(options.clearStartDate === true
2290
+ ? { startDate: null }
2291
+ : options.startDate === undefined
2292
+ ? {}
2293
+ : { startDate: options.startDate }),
2294
+ ...(options.priority === undefined ? {} : { priority: options.priority }),
2295
+ ...(options.title === undefined ? {} : { title: options.title }),
2296
+ ...(options.clearVersion === true
2297
+ ? { versionId: null }
2298
+ : plannedVersion === undefined
2299
+ ? {}
2300
+ : { versionId: plannedVersion.id }),
2276
2301
  },
2277
- path: {
2278
- projectId: options.projectId,
2279
- workItemId: options.workItemId,
2302
+ params: {
2303
+ header: {
2304
+ "idempotency-key": idempotencyKey,
2305
+ "if-match": options.expectedVersion,
2306
+ },
2307
+ path: {
2308
+ projectId: options.projectId,
2309
+ workItemId: options.workItemId,
2310
+ },
2280
2311
  },
2281
- },
2282
- }), {
2312
+ });
2313
+ }, {
2283
2314
  project: (data) => itemOutput(data, outputMode, warnMissingUrl),
2284
2315
  ambiguousOutcomeMessage: "Work Item update outcome is unknown; read the Work Item before retrying",
2285
2316
  retryTransportOnce: true,
@@ -3342,6 +3373,12 @@ function parseSpecId(value) {
3342
3373
  }
3343
3374
  throw invalidArgument("Spec ID must have the Workspace prefix, S marker and positive number");
3344
3375
  }
3376
+ function parseVersionId(value) {
3377
+ const normalized = value.trim();
3378
+ if (normalized.length > 0 && normalized.length <= 200)
3379
+ return normalized;
3380
+ throw invalidArgument("--version-id takes a Version id or name, such as v2.4");
3381
+ }
3345
3382
  function parseWorkItemId(value) {
3346
3383
  const normalized = value.trim().toUpperCase();
3347
3384
  if (/^[A-Z]{2,10}-[1-9]\d*$/u.test(normalized)) {