@gonovus-ai/spec-flow-cli 0.6.0 → 0.6.3

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
@@ -22,7 +22,7 @@ accepts signed S3 and Azure BlockBlob reservations, including reservations from
22
22
  its URL out of logs. Uploading bytes alone does not attach an asset; complete the
23
23
  matching task or Screen finalization command separately.
24
24
 
25
- The current CLI contract is **0.6.0**, coordinated with the official Skill's exact
25
+ The current CLI contract is **0.6.2**, coordinated with the official Skill's exact
26
26
  pin. It breaks 0.2.0 callers: Spec, Capability, Glossary, Proposal and
27
27
  authoring-history commands address shared knowledge with `--workspace-id` instead of
28
28
  `--project-id`, `project directory` is replaced by `spec list`, Session grants
@@ -36,7 +36,7 @@ seven-day Better Auth CLI Session. It supports the Node.js 24 runtime line;
36
36
  Node.js 22 and unverified future major versions are intentionally unsupported.
37
37
 
38
38
  ```bash
39
- npm install --global @gonovus-ai/spec-flow-cli@0.6.0
39
+ npm install --global @gonovus-ai/spec-flow-cli@0.6.2
40
40
  specflow auth login
41
41
  specflow auth status
42
42
  specflow auth logout
@@ -97,7 +97,9 @@ exit-status categories.
97
97
  Use `work-item resource-link list --project-id PAY --work-item-id PAY-7` to read
98
98
  current authorized references. Add a stable Spec with `add --kind spec --spec-id
99
99
  PAY-S8 --workspace-id <workspace-id>` in the Task’s owning Workspace. Add a document or other locator with
100
- `add --kind document|other --title <name> --url <http-or-https-url>`. Every add requires
100
+ `add --kind document|other --title <name> --url <http-or-https-url>`. GitHub pull requests
101
+ must use `work-item github-link-pr`; they cannot be added as ordinary resource links.
102
+ Every add requires
101
103
  `--idempotency-key <uuid>` and the owning Project/Task flags. Retain that key for an
102
104
  ambiguous retry of the same input.
103
105
 
@@ -595,7 +597,7 @@ Import accepts a JSON file with a `tasks` array, at most 1000 tasks and 1 MiB.
595
597
  File Project metadata is descriptive; `--project-id` always selects the target.
596
598
  The server applies ordinary creation and assignment authorization, membership,
597
599
  workflow, default Custom Field, and identity rules. Unknown statuses become
598
- `planned`; unknown priorities become `no-priority`; absent or empty priority
600
+ the Project's real Backlog column; unknown priorities become `no-priority`; absent or empty priority
599
601
  becomes `low`. Labels are exported but not imported, matching pinned Kaneo;
600
602
  nonempty imported labels produce an explicit warning.
601
603
 
@@ -885,7 +887,12 @@ specflow work-item view list --project-id PROJECT
885
887
  specflow work-item view save --project-id PROJECT --input '{"id":"UUID","name":"Mine","layout":"list","groupedByStatus":false,"filters":{"assignees":[],"customFields":{},"dueDates":[],"labels":[],"priorities":[],"search":"","sortBy":"number","sortOrder":"asc","statuses":[]}}'
886
888
  specflow work-item view save --project-id PROJECT --input '<complete view JSON without version>' --expected-version '"1"'
887
889
  specflow work-item statistics --project-id PROJECT --query '{"view":"list","assignee":"USER_ID","priority":"high,urgent"}'
888
- specflow workspace my-work-items --workspace-id WORKSPACE --limit 50 [--cursor CURSOR]
890
+ specflow workspace my-work-items --workspace-id WORKSPACE --limit 50 [--cursor CURSOR] [--query '{"scope":"created","project":"PAY,CHK","status":["In review","Backlog"],"completed":"pastWeek"}']
891
+ specflow workspace my-work-items-statistics --workspace-id WORKSPACE [--query '<same selection>']
892
+ specflow workspace my-work-items-filter-options --workspace-id WORKSPACE
893
+ specflow workspace my-work-items-view list --workspace-id WORKSPACE
894
+ specflow workspace my-work-items-view save --workspace-id WORKSPACE --view-id UUID --input '{"name":"Mine","layout":"board","position":0,"filters":{"scope":"assigned","projects":[],"assignees":[],"customFields":{},"dueDates":[],"labels":[],"priorities":[],"search":"","sortBy":"dueDate","sortOrder":"asc","statuses":[]},"display":null}' [--expected-version 1]
895
+ specflow workspace my-work-items-view delete --workspace-id WORKSPACE --view-id UUID --expected-version 2
889
896
  specflow work-item-custom-field create --project-id PROJECT --name Risk --type dropdown --option High --option Low --option-colors '["danger",null]'
890
897
  specflow work-item-custom-field option-colors --project-id PROJECT --field-id FIELD --colors '["warning",null]' --expected-version '"1"' --idempotency-key UUID
891
898
  specflow work-item-custom-field option-colors --project-id PROJECT --field-id FIELD --clear --expected-version '"2"' --idempotency-key UUID
@@ -900,8 +907,14 @@ there is no client page counting. Query accepts existing server selection keys:
900
907
  `view`, `repositoryConnectionId`, `assignee`, `customFields`, `due`, `dueAfter`,
901
908
  `dueBefore`, `label`, `priority`, `search`, `sortBy`, `sortOrder`, `startAfter`,
902
909
  `startBefore`, `status`. CSV and customFields JSON strings retain server semantics.
903
- Personal tasks returns `total`, Project `groups` and `nextCursor` from the current
904
- User's authorized unfinished tasks in Active Projects; retain the server cursor.
910
+ My Work Items reads the current User's work in every readable Active Project as one
911
+ `workItems` page in a global order, with `nextCursor` and `hiddenCompleted`; retain the
912
+ server cursor. `scope` is `assigned` (default) or `created`; `completed` defaults to
913
+ `none` (unfinished work). Statuses are merged names (same-named columns across
914
+ Projects are one status) and `customFields` keys are `type:name`. Statistics and
915
+ filter options use the same selection. Personal views belong to the caller alone;
916
+ `--view-id` is a new UUID or a built-in id (`assigned`, `created`, `due-this-week`)
917
+ whose saved row overrides that built-in view.
905
918
  Colors align one-to-one with dropdown options; null entries clear individual colors,
906
919
  `--clear` clears all. The server validates color values, lengths and field type.
907
920
  Assistant can discover views, statistics/trends, option colors and my unfinished
@@ -986,3 +999,26 @@ never fetch a newer version and overwrite automatically. Honor `retryAfter` on 4
986
999
  `LOCAL_OUTPUT_FAILED` means local formatting/output failed after possible server
987
1000
  success: read the resource before deliberately retrying. It never permits a blind
988
1001
  write retry. Diagnostics stay on stderr and stdout remains business JSON.
1002
+
1003
+
1004
+ ### Workflow lifecycle and archive commands
1005
+
1006
+ Workflow Columns persist category (`backlog`, `unstarted`, `started`, `completed`,
1007
+ `canceled`) independently of icon (`backlog`, `todo`, `in-progress`, `in-review`,
1008
+ `done`, `canceled`, `duplicate`). Read-only `isFinal` means completed category.
1009
+ Use `workflow-column create/update --category ... --icon ...`; `--clear-icon`
1010
+ resets the icon to its category default. The former `--final`/`--not-final` write
1011
+ flags are replaced by `--category`. New Projects seed seven stable default slugs;
1012
+ creation without status goes to Backlog. Archive is a separate command:
1013
+
1014
+ ```sh
1015
+ specflow work-item archive --project-id PROJECT --work-item-id APP-1 --expected-version '"3"'
1016
+ specflow work-item unarchive --project-id PROJECT --work-item-id APP-1 --expected-version '"4"'
1017
+ ```
1018
+
1019
+ Both commands reuse the generated key on the bounded transport retry; they never
1020
+ reread and overwrite a newer version. Unarchive restores the retained column
1021
+ identity or falls back to the first unstarted column. If no such column exists,
1022
+ read the workflow and fix it before retrying. Numeric status keys belong to the
1023
+ frontend and bind stable default slugs, not column order. Personal status queries
1024
+ use the column name `Backlog`; only archive retains the virtual filter syntax.
package/dist/cli.js CHANGED
@@ -18,12 +18,14 @@ import { registerSpecDiscussionCommands } from "./spec-discussion-commands.js";
18
18
  import { registerSpecOwnerCommands } from "./spec-owner-commands.js";
19
19
  import { registerUserApiKeyCommands } from "./user-api-key-commands.js";
20
20
  import { registerWorkItemAssetCommands } from "./work-item-asset-commands.js";
21
+ import { registerWorkItemDeliveryCommands } from "./work-item-delivery-commands.js";
21
22
  import { readWorkItemImportFile } from "./work-item-exchange-file.js";
22
23
  import { registerWorkItemQueryCommands } from "./work-item-query-commands.js";
23
24
  import { registerWorkItemResourceLinkCommands } from "./work-item-resource-link-commands.js";
24
25
  export function formatResourceDiagnostic(message) {
25
26
  return `${JSON.stringify({ diagnostic: { level: "warning", message } })}\n`;
26
27
  }
28
+ const workItemCompletedFilters = ["all", "pastDay", "pastWeek", "pastMonth", "none"];
27
29
  const workItemBulkActions = [
28
30
  "updateStatus",
29
31
  "updatePriority",
@@ -1323,6 +1325,7 @@ export async function runCli(arguments_, dependencies) {
1323
1325
  }), { rejectWorkspaceReadToken: true }));
1324
1326
  });
1325
1327
  registerWorkItemQueryCommands(workItem, workspace, resourceRuntime);
1328
+ registerWorkItemDeliveryCommands(workItem, project, resourceRuntime);
1326
1329
  registerProductMapCommands(program, { dependencies, run, setExitCode: value => { exitCode = value; }, canWrite: () => !hasWorkspaceReadToken(dependencies.environment), rejectWrite: () => rejectTokenWrite(dependencies), parseOpaqueVersion });
1327
1330
  registerWorkItemResourceLinkCommands(workItem, spec, { run, setExitCode: (value) => { exitCode = value; }, canWrite: () => !hasWorkspaceReadToken(dependencies.environment), rejectWrite: () => rejectTokenWrite(dependencies), parseOpaqueVersion, parseLimit: parseSearchLimit });
1328
1331
  const workItemComment = workItem.command("comment").description("Read and manage authored task comments");
@@ -1463,7 +1466,7 @@ export async function runCli(arguments_, dependencies) {
1463
1466
  query: { peerProjectId: options.peerProjectId }, header: { "idempotency-key": options.idempotencyKey, "if-match": options.expectedVersion } },
1464
1467
  }), { retryTransportOnce: true, ambiguousOutcomeMessage: "Relation removal outcome is unknown; retry with the same inputs and command key" });
1465
1468
  });
1466
- workItemSelectionFlags(workItem.command("list"))
1469
+ workItemCompletedFlag(workItemSelectionFlags(workItem.command("list")))
1467
1470
  .requiredOption("--project-id <projectId>")
1468
1471
  .option("--limit <limit>", "Maximum results", parseSearchLimit, 20)
1469
1472
  .option("--cursor <cursor>")
@@ -1479,6 +1482,7 @@ export async function runCli(arguments_, dependencies) {
1479
1482
  path: { projectId: options.projectId },
1480
1483
  query: {
1481
1484
  ...workItemSelectionQuery(options),
1485
+ ...(options.completed === undefined ? {} : { completed: options.completed }),
1482
1486
  ...(options.cursor === undefined
1483
1487
  ? {}
1484
1488
  : { cursor: options.cursor }),
@@ -1711,13 +1715,13 @@ export async function runCli(arguments_, dependencies) {
1711
1715
  retryTransportOnce: true,
1712
1716
  });
1713
1717
  });
1714
- workItemSelectionFlags(workItem.command("board"))
1718
+ workItemCompletedFlag(workItemSelectionFlags(workItem.command("board")))
1715
1719
  .requiredOption("--project-id <projectId>")
1716
1720
  .action(async (options) => {
1717
1721
  exitCode = await run((client) => client.GET("/v1/projects/{projectId}/work-item-board", {
1718
1722
  params: {
1719
1723
  path: { projectId: options.projectId },
1720
- query: workItemSelectionQuery(options),
1724
+ query: { ...workItemSelectionQuery(options), ...(options.completed === undefined ? {} : { completed: options.completed }) },
1721
1725
  },
1722
1726
  }));
1723
1727
  });
@@ -1919,6 +1923,23 @@ export async function runCli(arguments_, dependencies) {
1919
1923
  retryTransportOnce: true,
1920
1924
  });
1921
1925
  });
1926
+ for (const action of ["archive", "unarchive"]) {
1927
+ workItem.command(action)
1928
+ .requiredOption("--project-id <projectId>")
1929
+ .requiredOption("--work-item-id <workItemId>")
1930
+ .requiredOption("--expected-version <expectedVersion>", "Opaque version returned by SpecFlow", parseOpaqueVersion)
1931
+ .action(async (options) => {
1932
+ if (hasWorkspaceReadToken(dependencies.environment)) {
1933
+ exitCode = rejectTokenWrite(dependencies);
1934
+ return;
1935
+ }
1936
+ const idempotencyKey = randomUUID();
1937
+ exitCode = await run((client) => client.POST(action === "archive" ? "/v1/projects/{projectId}/work-items/{workItemId}/archive" : "/v1/projects/{projectId}/work-items/{workItemId}/unarchive", {
1938
+ params: { path: { projectId: options.projectId, workItemId: options.workItemId },
1939
+ header: { "if-match": options.expectedVersion, "idempotency-key": idempotencyKey } },
1940
+ }), { retryTransportOnce: true, ambiguousOutcomeMessage: "Work Item archive outcome is unknown; read the Work Item before retrying" });
1941
+ });
1942
+ }
1922
1943
  workItem
1923
1944
  .command("complete")
1924
1945
  .requiredOption("--project-id <projectId>")
@@ -1936,7 +1957,7 @@ export async function runCli(arguments_, dependencies) {
1936
1957
  if (!board.response.ok) {
1937
1958
  return board;
1938
1959
  }
1939
- const finalColumn = board.data?.workflowColumns.find((column) => column.isFinal);
1960
+ const finalColumn = board.data?.workflowColumns.find((column) => column.category === "completed");
1940
1961
  if (finalColumn === undefined) {
1941
1962
  return {
1942
1963
  error: {
@@ -2336,9 +2357,9 @@ export async function runCli(arguments_, dependencies) {
2336
2357
  .command("create")
2337
2358
  .requiredOption("--project-id <projectId>")
2338
2359
  .requiredOption("--name <name>")
2339
- .option("--icon <icon>", "Column icon name")
2360
+ .option("--icon <icon>", "Workflow icon", parseWorkflowIcon)
2340
2361
  .option("--color <color>", "Column color")
2341
- .option("--final", "Mark the column as an explicit completion lane")
2362
+ .option("--category <category>", "Lifecycle category", parseWorkflowCategory)
2342
2363
  .action(async (options) => {
2343
2364
  if (hasWorkspaceReadToken(dependencies.environment)) {
2344
2365
  exitCode = rejectTokenWrite(dependencies);
@@ -2350,9 +2371,9 @@ export async function runCli(arguments_, dependencies) {
2350
2371
  ...(options.color === undefined
2351
2372
  ? {}
2352
2373
  : { color: options.color }),
2353
- ...(options.final === undefined
2374
+ ...(options.category === undefined
2354
2375
  ? {}
2355
- : { isFinal: options.final }),
2376
+ : { category: options.category }),
2356
2377
  ...(options.icon === undefined ? {} : { icon: options.icon }),
2357
2378
  name: options.name,
2358
2379
  },
@@ -2371,12 +2392,11 @@ export async function runCli(arguments_, dependencies) {
2371
2392
  .requiredOption("--column-slug <columnSlug>")
2372
2393
  .requiredOption("--expected-version <expectedVersion>", "Opaque version returned by SpecFlow", parseOpaqueVersion)
2373
2394
  .option("--name <name>")
2374
- .option("--icon <icon>", "Column icon name")
2395
+ .option("--icon <icon>", "Workflow icon", parseWorkflowIcon)
2375
2396
  .option("--color <color>", "Column color")
2376
2397
  .option("--clear-icon", "Remove the column icon")
2377
2398
  .option("--clear-color", "Remove the column color")
2378
- .option("--final", "Mark the column as an explicit completion lane")
2379
- .option("--not-final", "Remove the column's completion marker")
2399
+ .option("--category <category>", "Lifecycle category", parseWorkflowCategory)
2380
2400
  .action(async (options) => {
2381
2401
  if (hasWorkspaceReadToken(dependencies.environment)) {
2382
2402
  exitCode = rejectTokenWrite(dependencies);
@@ -2387,8 +2407,7 @@ export async function runCli(arguments_, dependencies) {
2387
2407
  options.clearIcon !== true &&
2388
2408
  options.color === undefined &&
2389
2409
  options.clearColor !== true &&
2390
- options.final !== true &&
2391
- options.notFinal !== true) {
2410
+ options.category === undefined) {
2392
2411
  throw invalidArgument("Workflow Column update requires a field change");
2393
2412
  }
2394
2413
  if (options.clearIcon === true && options.icon !== undefined) {
@@ -2397,9 +2416,6 @@ export async function runCli(arguments_, dependencies) {
2397
2416
  if (options.clearColor === true && options.color !== undefined) {
2398
2417
  throw invalidArgument("Workflow Column update cannot set and clear the color together");
2399
2418
  }
2400
- if (options.final === true && options.notFinal === true) {
2401
- throw invalidArgument("Workflow Column update cannot set and clear the final marker together");
2402
- }
2403
2419
  const idempotencyKey = randomUUID();
2404
2420
  exitCode = await run((client) => client.PATCH("/v1/projects/{projectId}/workflow-columns/{columnSlug}", {
2405
2421
  body: {
@@ -2413,11 +2429,7 @@ export async function runCli(arguments_, dependencies) {
2413
2429
  : options.icon === undefined
2414
2430
  ? {}
2415
2431
  : { icon: options.icon }),
2416
- ...(options.final === true
2417
- ? { isFinal: true }
2418
- : options.notFinal === true
2419
- ? { isFinal: false }
2420
- : {}),
2432
+ ...(options.category === undefined ? {} : { category: options.category }),
2421
2433
  ...(options.name === undefined
2422
2434
  ? {}
2423
2435
  : { name: options.name }),
@@ -2617,6 +2629,18 @@ function parseWorkItemId(value) {
2617
2629
  }
2618
2630
  throw invalidArgument("Work Item ID must be a Project ID followed by a positive number");
2619
2631
  }
2632
+ const workflowCategories = ["backlog", "unstarted", "started", "completed", "canceled"];
2633
+ const workflowIcons = ["backlog", "todo", "in-progress", "in-review", "done", "canceled", "duplicate"];
2634
+ function parseWorkflowCategory(value) {
2635
+ if (workflowCategories.includes(value))
2636
+ return value;
2637
+ throw invalidArgument("Workflow category must be backlog, unstarted, started, completed or canceled");
2638
+ }
2639
+ function parseWorkflowIcon(value) {
2640
+ if (workflowIcons.includes(value))
2641
+ return value;
2642
+ throw invalidArgument("Workflow icon must be backlog, todo, in-progress, in-review, done, canceled or duplicate");
2643
+ }
2620
2644
  const workItemPriorities = [
2621
2645
  "no-priority",
2622
2646
  "low",
@@ -2712,6 +2736,14 @@ function workItemSelectionQuery(options) {
2712
2736
  : { status: options.status.join(",") }),
2713
2737
  };
2714
2738
  }
2739
+ /** List and board only: which completed Work Items to keep. */
2740
+ function workItemCompletedFlag(command) {
2741
+ return command.option("--completed <filter>", "Completed Work Items to keep: all (default), pastDay, pastWeek, pastMonth, or none", (value) => {
2742
+ if (workItemCompletedFilters.includes(value))
2743
+ return value;
2744
+ throw invalidArgument(`Completed filter must be ${workItemCompletedFilters.join(", ")}`);
2745
+ });
2746
+ }
2715
2747
  /**
2716
2748
  * The selection options `work-item list` and `work-item board` share.
2717
2749
  * Attach with `workItemSelectionFlags(command)`.