@gonovus-ai/spec-flow-cli 1.3.0 → 1.4.0

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.3.0
42
+ npm install --global @gonovus-ai/spec-flow-cli@1.4.0
43
43
  specflow auth login
44
44
  specflow auth status
45
45
  specflow auth logout
@@ -61,6 +61,20 @@ default, provide `SPEC_FLOW_DEFAULT_API_URL` to the CLI build command. The packe
61
61
  installation smoke uses an isolated `.invalid` test origin when no build value is
62
62
  provided; it never substitutes a deployment URL into source.
63
63
 
64
+ ## Discussion Board
65
+
66
+ CLI 1.4.0 adds Workspace-level human+Agent Discussion Board commands (`specflow guide discuss`):
67
+
68
+ ```bash
69
+ specflow discuss channels --workspace-id <workspace-id>
70
+ specflow discuss threads --workspace-id <workspace-id> --channel general --scope all
71
+ specflow discuss read --workspace-id <workspace-id> --thread-id <thread-id>
72
+ specflow discuss post --workspace-id <workspace-id> --channel general --title "API design" --body "Please review" --mention @codex-mac
73
+ specflow discuss reply --workspace-id <workspace-id> --thread-id <thread-id> --body "Looks good"
74
+ specflow discuss dm create --workspace-id <workspace-id> --target-agent codex-mac --body "Quick private question"
75
+ specflow discuss wait --workspace-id <workspace-id> --thread-id <thread-id> --wait 20
76
+ ```
77
+
64
78
  ## Context Documents and boards
65
79
 
66
80
  CLI 1.1.0 reads and drafts Context Documents (engineering specifications with
@@ -85,10 +99,10 @@ review in the Web application, and publishing waits until then (`REVIEW_PENDING`
85
99
  ## Compatibility and upgrades
86
100
 
87
101
  ```bash
88
- specflow version --json --skill-version 0.8.0 --compatible-cli "^1.2.0"
102
+ specflow version --json --skill-version 0.10.0 --compatible-cli "^1.4.0"
89
103
  specflow upgrade
90
104
  specflow upgrade --yes
91
- specflow upgrade --to 1.3.0
105
+ specflow upgrade --to 1.4.0
92
106
  ```
93
107
 
94
108
  `version` shows the installed CLI and public advice from the selected origin.
package/dist/cli.js CHANGED
@@ -8,13 +8,15 @@ import { registerClientCompatibilityCommands } from "./commands/client-compatibi
8
8
  import { itemOutput, itemListOutput, relationListOutput, relationReceiptOutput, } from "./commands/work-item-output.js";
9
9
  import { registerContextDocumentCommands } from "./context-document-commands.js";
10
10
  import { registerCustomFieldColorCommands, parseOptionColors, } from "./custom-field-color-commands.js";
11
+ import { registerDiscussCommands } from "./discuss-commands.js";
11
12
  import { registerGitHubAccountCommands } from "./github-account-commands.js";
12
13
  import { readDescription, singleDescriptionSource } from "./input/text-source.js";
14
+ import { formatMemberResolutionDiagnostic, needsMemberResolution, resolveMemberReferences, splitMemberReferences, substituteMemberReferences, } from "./member-references.js";
13
15
  import { registerProductMapCommands } from "./product-map-commands.js";
14
16
  import { createProgram } from "./program.js";
15
17
  import { registerProjectAdministrationCommands } from "./project-administration-commands.js";
16
18
  import { observeCompatibility } from "./runtime/client-compatibility.js";
17
- import { writeSkillError, skillErrorExitCode } from "./runtime/errors.js";
19
+ import { mapHttpFailure, writeSkillError, skillErrorExitCode, } from "./runtime/errors.js";
18
20
  import { execute, } from "./runtime/execute.js";
19
21
  import { readIdentity } from "./runtime/identity.js";
20
22
  import { writeResult } from "./runtime/output.js";
@@ -189,7 +191,28 @@ export async function runCli(arguments_, originalDependencies) {
189
191
  }
190
192
  me = identity.data.user.id;
191
193
  }
192
- const result = await execute((client) => request(client, me, selected.credentialKind), selected.client, options);
194
+ let members = new Map();
195
+ const references = splitMemberReferences(options.memberReferences?.values ?? []);
196
+ if (options.memberReferences !== undefined && references.some(needsMemberResolution)) {
197
+ const { projectId } = options.memberReferences;
198
+ const listed = await selected.client.GET("/v1/projects/{projectId}/work-item-assignees", {
199
+ params: { path: { projectId } },
200
+ });
201
+ if (listed.data === undefined) {
202
+ const error = mapHttpFailure(listed.response, listed.error);
203
+ writeSkillError(dependencies, error);
204
+ return skillErrorExitCode(error);
205
+ }
206
+ const resolution = resolveMemberReferences(references, listed.data.assignees, projectId);
207
+ if (!resolution.ok) {
208
+ writeSkillError(dependencies, resolution.error);
209
+ return skillErrorExitCode(resolution.error);
210
+ }
211
+ for (const { reference, member } of resolution.resolved)
212
+ dependencies.stderr(formatMemberResolutionDiagnostic(reference, member));
213
+ members = resolution.ids;
214
+ }
215
+ const result = await execute((client) => request(client, me, selected.credentialKind, members), selected.client, options);
193
216
  if (!result.ok) {
194
217
  writeSkillError(dependencies, result.error);
195
218
  return skillErrorExitCode(result.error);
@@ -429,6 +452,33 @@ export async function runCli(arguments_, originalDependencies) {
429
452
  retryTransportOnce: true,
430
453
  });
431
454
  });
455
+ const workspaceMemberAlias = workspaceMember
456
+ .command("alias")
457
+ .description("Administer Member Aliases: set, change or clear; scripts should keep using User IDs");
458
+ workspaceMemberAlias
459
+ .command("set")
460
+ .description("Set or change a Member Alias; pass --alias '' to clear it")
461
+ .requiredOption("--workspace-id <workspaceId>")
462
+ .requiredOption("--user-id <userId>", "Member User ID from `workspace member list`")
463
+ .requiredOption("--alias <alias>", "2–12 characters without @, unique in the Workspace and different from other Members' names; empty clears")
464
+ .option("--idempotency-key <key>", "Reuse the same key and inputs when retrying")
465
+ .action(async (options) => {
466
+ if (hasWorkspaceReadToken(dependencies.environment)) {
467
+ exitCode = rejectTokenWrite(dependencies);
468
+ return;
469
+ }
470
+ const idempotencyKey = options.idempotencyKey ?? randomUUID();
471
+ exitCode = await run((client) => client.PUT("/v1/workspaces/{workspaceId}/members/{userId}/alias", {
472
+ body: { alias: options.alias },
473
+ params: {
474
+ header: { "idempotency-key": idempotencyKey },
475
+ path: { userId: options.userId, workspaceId: options.workspaceId },
476
+ },
477
+ }), {
478
+ ambiguousOutcomeMessage: "Member Alias outcome is unknown; read `workspace member list` before retrying",
479
+ retryTransportOnce: true,
480
+ });
481
+ });
432
482
  workspaceMember
433
483
  .command("remove")
434
484
  .requiredOption("--workspace-id <workspaceId>")
@@ -1665,14 +1715,16 @@ export async function runCli(arguments_, originalDependencies) {
1665
1715
  const value = program.getOptionValue(name);
1666
1716
  return typeof value === "string" ? value : undefined;
1667
1717
  };
1668
- registerAgentCommands(program, {
1718
+ const agentRuntime = {
1669
1719
  ...resourceRuntime,
1670
1720
  dependencies,
1671
1721
  getServerFlag: () => readRootStringFlag("server"),
1672
1722
  getApiKeyIdFlag: () => readRootStringFlag("apiKeyId"),
1673
1723
  getAgentFlag: () => readRootStringFlag("agent"),
1674
1724
  parseProjectId,
1675
- });
1725
+ };
1726
+ registerAgentCommands(program, agentRuntime);
1727
+ registerDiscussCommands(program, agentRuntime);
1676
1728
  const contextRuntime = {
1677
1729
  dependencies,
1678
1730
  run,
@@ -2020,18 +2072,21 @@ export async function runCli(arguments_, originalDependencies) {
2020
2072
  throw invalidArgument("Work Items can only be grouped by status");
2021
2073
  })
2022
2074
  .action(async (options) => {
2023
- exitCode = await run((client) => client.GET("/v1/projects/{projectId}/work-items", {
2075
+ exitCode = await run((client, _me, _credentialKind, members) => client.GET("/v1/projects/{projectId}/work-items", {
2024
2076
  params: {
2025
2077
  path: { projectId: options.projectId },
2026
2078
  query: {
2027
- ...workItemSelectionQuery(options),
2079
+ ...workItemSelectionQuery(withResolvedMembers(options, members)),
2028
2080
  ...(options.completed === undefined ? {} : { completed: options.completed }),
2029
2081
  ...(options.cursor === undefined ? {} : { cursor: options.cursor }),
2030
2082
  ...(options.groupBy === undefined ? {} : { groupBy: options.groupBy }),
2031
2083
  limit: options.limit,
2032
2084
  },
2033
2085
  },
2034
- }), { project: (data) => itemListOutput(data, outputMode, warnMissingUrl) });
2086
+ }), {
2087
+ memberReferences: selectionMemberReferences(options),
2088
+ project: (data) => itemListOutput(data, outputMode, warnMissingUrl),
2089
+ });
2035
2090
  });
2036
2091
  workItem
2037
2092
  .command("read")
@@ -2066,7 +2121,7 @@ export async function runCli(arguments_, originalDependencies) {
2066
2121
  .option("--description <description>", "Inline description text", singleDescriptionSource)
2067
2122
  .option("--description-file <path>", "Read description from a UTF-8 regular file, or - for piped stdin", singleDescriptionSource)
2068
2123
  .option("--label <labelId>", "Workspace label definition ID; repeat for several labels", collectOption, [])
2069
- .option("--assignee <assignee>", "Workspace member User ID, or me for the selected credential")
2124
+ .option("--assignee <assignee>", "Workspace member User ID, me for the selected credential, or an exact Member Alias or name")
2070
2125
  .option("--assigned-agent <agentId>", "Eligible Workspace Agent ID to assign for execution")
2071
2126
  .option("--custom-field <fieldId=value>", "Custom Field value as fieldId=value; repeat for several fields", collectOption, [])
2072
2127
  .option("--priority <priority>", "Work Item priority", parseWorkItemPriority)
@@ -2116,9 +2171,11 @@ export async function runCli(arguments_, originalDependencies) {
2116
2171
  };
2117
2172
  const customFields = options.customField.map(parseCustomFieldAssignment);
2118
2173
  const idempotencyKey = randomUUID();
2119
- exitCode = await run((client, me) => client.POST("/v1/projects/{projectId}/work-items", {
2174
+ exitCode = await run((client, me, _credentialKind, members) => client.POST("/v1/projects/{projectId}/work-items", {
2120
2175
  body: {
2121
- ...(options.assignee === undefined ? {} : { assigneeId: me ?? options.assignee }),
2176
+ ...(options.assignee === undefined
2177
+ ? {}
2178
+ : { assigneeId: me ?? members?.get(options.assignee) ?? options.assignee }),
2122
2179
  ...(options.assignedAgent === undefined
2123
2180
  ? {}
2124
2181
  : { assignedAgentId: options.assignedAgent }),
@@ -2145,6 +2202,11 @@ export async function runCli(arguments_, originalDependencies) {
2145
2202
  },
2146
2203
  }), {
2147
2204
  resolveMe: options.assignee === "me",
2205
+ ...(options.assignee === undefined
2206
+ ? {}
2207
+ : {
2208
+ memberReferences: { projectId: options.projectId, values: [options.assignee] },
2209
+ }),
2148
2210
  project: (data) => itemOutput(data, outputMode, warnMissingUrl),
2149
2211
  ambiguousOutcomeMessage: "Work Item creation outcome is unknown; list Work Items before retrying",
2150
2212
  retryTransportOnce: true,
@@ -2228,7 +2290,7 @@ export async function runCli(arguments_, originalDependencies) {
2228
2290
  .requiredOption("--project-id <projectId>")
2229
2291
  .requiredOption("--work-item-id <workItemId>")
2230
2292
  .requiredOption("--expected-version <expectedVersion>", "Opaque version returned by SpecFlow", parseOpaqueVersion)
2231
- .option("--assignee <assignee>", "Workspace member User ID, or me for the selected credential")
2293
+ .option("--assignee <assignee>", "Workspace member User ID, me for the selected credential, or an exact Member Alias or name")
2232
2294
  .option("--unassign", "Remove the Work Item assignee")
2233
2295
  .action(async (options) => {
2234
2296
  if (hasWorkspaceReadToken(dependencies.environment)) {
@@ -2242,9 +2304,14 @@ export async function runCli(arguments_, originalDependencies) {
2242
2304
  throw invalidArgument("Work Item assign cannot set and clear the assignee together");
2243
2305
  }
2244
2306
  const idempotencyKey = randomUUID();
2245
- exitCode = await run((client, me) => client.PUT("/v1/projects/{projectId}/work-items/{workItemId}/assignee", {
2307
+ exitCode = await run((client, me, _credentialKind, members) => client.PUT("/v1/projects/{projectId}/work-items/{workItemId}/assignee", {
2246
2308
  body: {
2247
- assigneeId: options.unassign === true ? null : (me ?? options.assignee ?? null),
2309
+ assigneeId: options.unassign === true
2310
+ ? null
2311
+ : (me ??
2312
+ (options.assignee === undefined
2313
+ ? null
2314
+ : (members?.get(options.assignee) ?? options.assignee))),
2248
2315
  },
2249
2316
  params: {
2250
2317
  header: {
@@ -2258,6 +2325,11 @@ export async function runCli(arguments_, originalDependencies) {
2258
2325
  },
2259
2326
  }), {
2260
2327
  resolveMe: options.assignee === "me",
2328
+ ...(options.assignee === undefined || options.unassign === true
2329
+ ? {}
2330
+ : {
2331
+ memberReferences: { projectId: options.projectId, values: [options.assignee] },
2332
+ }),
2261
2333
  project: (data) => itemOutput(data, outputMode, warnMissingUrl),
2262
2334
  ambiguousOutcomeMessage: "Work Item assignment outcome is unknown; read the Work Item before retrying",
2263
2335
  retryTransportOnce: true,
@@ -2333,15 +2405,15 @@ export async function runCli(arguments_, originalDependencies) {
2333
2405
  workItemCompletedFlag(workItemSelectionFlags(workItem.command("board")))
2334
2406
  .requiredOption("--project-id <projectId>")
2335
2407
  .action(async (options) => {
2336
- exitCode = await run((client) => client.GET("/v1/projects/{projectId}/work-item-board", {
2408
+ exitCode = await run((client, _me, _credentialKind, members) => client.GET("/v1/projects/{projectId}/work-item-board", {
2337
2409
  params: {
2338
2410
  path: { projectId: options.projectId },
2339
2411
  query: {
2340
- ...workItemSelectionQuery(options),
2412
+ ...workItemSelectionQuery(withResolvedMembers(options, members)),
2341
2413
  ...(options.completed === undefined ? {} : { completed: options.completed }),
2342
2414
  },
2343
2415
  },
2344
- }));
2416
+ }), { memberReferences: selectionMemberReferences(options) });
2345
2417
  });
2346
2418
  workItem
2347
2419
  .command("bulk")
@@ -2495,12 +2567,12 @@ export async function runCli(arguments_, originalDependencies) {
2495
2567
  .description("Export selected readable Project tasks as JSON on stdout")
2496
2568
  .requiredOption("--project-id <projectId>")
2497
2569
  .action(async (options) => {
2498
- exitCode = await run((client) => client.GET("/v1/projects/{projectId}/work-items/export", {
2570
+ exitCode = await run((client, _me, _credentialKind, members) => client.GET("/v1/projects/{projectId}/work-items/export", {
2499
2571
  params: {
2500
2572
  path: { projectId: options.projectId },
2501
- query: workItemSelectionQuery(options),
2573
+ query: workItemSelectionQuery(withResolvedMembers(options, members)),
2502
2574
  },
2503
- }));
2575
+ }), { memberReferences: selectionMemberReferences(options) });
2504
2576
  });
2505
2577
  workItem
2506
2578
  .command("transfer")
@@ -3343,6 +3415,25 @@ function parseWorkItemSortOrder(value) {
3343
3415
  }
3344
3416
  throw invalidArgument("Work Item sort order must be asc or desc");
3345
3417
  }
3418
+ /** The member-filter values of a selection that may name Members by Alias or name. */
3419
+ function selectionMemberReferences(options) {
3420
+ return {
3421
+ projectId: options.projectId,
3422
+ values: [...options.assignee, ...(options.creator ?? []), ...options.watcher],
3423
+ };
3424
+ }
3425
+ function withResolvedMembers(options, members) {
3426
+ if (members === undefined || members.size === 0)
3427
+ return options;
3428
+ return {
3429
+ ...options,
3430
+ assignee: substituteMemberReferences(options.assignee, members),
3431
+ ...(options.creator === undefined
3432
+ ? {}
3433
+ : { creator: substituteMemberReferences(options.creator, members) }),
3434
+ watcher: substituteMemberReferences(options.watcher, members),
3435
+ };
3436
+ }
3346
3437
  /**
3347
3438
  * Builds the wire selection query shared by `work-item list` and
3348
3439
  * `work-item board`: repeatable flags become the API's CSV fields and
@@ -3397,16 +3488,16 @@ function workItemCompletedFlag(command) {
3397
3488
  */
3398
3489
  function workItemSelectionFlags(command) {
3399
3490
  return command
3400
- .option("--creator <id>", "Creator User ID or me; repeat for several", collectOption, [])
3491
+ .option("--creator <id>", "Creator User ID, me, or an exact Member Alias or name; repeat for several", collectOption, [])
3401
3492
  .option("--operators <json>", "Category -> include|exclude; custom fields use customField:<id>")
3402
3493
  .option("--created <filter>", "today|pastWeek|past2Weeks|pastMonth|past3Months or YYYY-MM-DD (UTC inclusive)")
3403
3494
  .option("--updated <filter>", "Same time choices as --created")
3404
3495
  .option("--relations <csv>", "blocked,blocking,hasParent,hasChildren,related")
3405
3496
  .option("--specs <csv>", "Linked Spec IDs, or none")
3406
3497
  .option("--pull-requests <csv>", "none,draft,open,merged,closed; synchronized state only")
3407
- .option("--assignee <assignee>", "Filter by assignee User ID, me, or unassigned; repeat for several", collectOption, [])
3498
+ .option("--assignee <assignee>", "Filter by assignee User ID, me, unassigned, or an exact Member Alias or name; repeat for several", collectOption, [])
3408
3499
  .option("--assigned-agent <agentId>", "Filter by executing Agent ID or unassigned; repeat for several", collectOption, [])
3409
- .option("--watcher <userId>", "Filter by watcher User ID or me; repeat for several", collectOption, [])
3500
+ .option("--watcher <userId>", "Filter by watcher User ID, me, or an exact Member Alias or name; repeat for several", collectOption, [])
3410
3501
  .option("--custom-field <fieldId=value>", "Filter by Custom Field value; repeat to OR values or combine fields", collectOption, [])
3411
3502
  .option("--due <filter>", "Filter by due bucket: dueThisWeek, dueNextWeek, or noDueDate; repeat for several", (value, previous) => [
3412
3503
  ...previous,