@gonovus-ai/spec-flow-cli 0.5.0 → 0.6.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.
Files changed (38) hide show
  1. package/README.md +57 -28
  2. package/dist/bin.js +6 -50
  3. package/dist/bin.js.map +1 -1
  4. package/dist/cli.d.ts +3 -0
  5. package/dist/cli.js +103 -397
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/work-item-output.d.ts +390 -0
  8. package/dist/commands/work-item-output.js +36 -0
  9. package/dist/commands/work-item-output.js.map +1 -0
  10. package/dist/http-origin.js +3 -0
  11. package/dist/http-origin.js.map +1 -1
  12. package/dist/index.js +50 -28
  13. package/dist/index.js.map +1 -1
  14. package/dist/input/text-source.d.ts +9 -0
  15. package/dist/input/text-source.js +74 -0
  16. package/dist/input/text-source.js.map +1 -0
  17. package/dist/program.d.ts +3 -0
  18. package/dist/program.js +19 -0
  19. package/dist/program.js.map +1 -0
  20. package/dist/runtime/errors.d.ts +28 -0
  21. package/dist/runtime/errors.js +133 -0
  22. package/dist/runtime/errors.js.map +1 -0
  23. package/dist/runtime/execute.d.ts +23 -0
  24. package/dist/runtime/execute.js +25 -0
  25. package/dist/runtime/execute.js.map +1 -0
  26. package/dist/runtime/identity.d.ts +183 -0
  27. package/dist/runtime/identity.js +17 -0
  28. package/dist/runtime/identity.js.map +1 -0
  29. package/dist/runtime/output.d.ts +3 -0
  30. package/dist/runtime/output.js +13 -0
  31. package/dist/runtime/output.js.map +1 -0
  32. package/dist/runtime/session.d.ts +16 -0
  33. package/dist/runtime/session.js +123 -0
  34. package/dist/runtime/session.js.map +1 -0
  35. package/package.json +1 -1
  36. package/dist/work-item-time-entry-input.d.ts +0 -4
  37. package/dist/work-item-time-entry-input.js +0 -27
  38. package/dist/work-item-time-entry-input.js.map +0 -1
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.5.0**, coordinated with the official Skill's exact
25
+ The current CLI contract is **0.6.0**, 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.5.0
39
+ npm install --global @gonovus-ai/spec-flow-cli@0.6.0
40
40
  specflow auth login
41
41
  specflow auth status
42
42
  specflow auth logout
@@ -673,33 +673,12 @@ whether to resubmit. Project Read Tokens may read comments and activity under
673
673
  `WorkItemRead`, and cannot mutate comments. Activities are produced by the
674
674
  server's actual task operations; there is no activity creation command.
675
675
 
676
- ### Task time recording
676
+ ### Time recording removal (0.6.0)
677
677
 
678
- List entries oldest first with an opaque `nextCursor`, or retrieve one entry:
679
-
680
- ```bash
681
- specflow work-item time-entry list --project-id PAY --work-item-id PAY-7 --limit 20
682
- specflow work-item time-entry get --project-id PAY --work-item-id PAY-7 --entry-id <uuid>
683
- specflow work-item time-entry create --project-id PAY --work-item-id PAY-7 \
684
- --start-time '2026-07-01T10:00:00+08:00' --end-time '2026-07-01T11:00:00+08:00' \
685
- --description 'Reviewed rollout' --idempotency-key <uuid>
686
- specflow work-item time-entry update --project-id PAY --work-item-id PAY-7 \
687
- --entry-id <uuid> --start-time '2026-07-01T10:00:00+08:00' \
688
- --end-time '2026-07-01T11:30:00+08:00' --expected-version '"1"' --idempotency-key <uuid>
689
- ```
690
-
691
- Timestamps require an ISO 8601 offset. Omit `--end-time` on creation to record an
692
- unfinished entry; on update, omission preserves the existing end time. Omitted
693
- descriptions are preserved on update. The server computes whole duration seconds;
694
- unfinished entries have no duration and are excluded from `closedDurationSeconds`.
695
- The list returns that exact cumulative value as a decimal string plus `runningCount`.
696
-
697
- Writes require a CLI Session, current task update permission and a UUID command
698
- key. Only the author may update an entry, including when another Member is an
699
- Admin. Reuse the same key and inputs after an interrupted response. Updates require
700
- the read result's opaque `version`; a conflict requires a deliberate reread.
701
- Project Read Tokens can list and retrieve entries but cannot write. Archived
702
- Projects are read-only. There is no time-entry deletion command.
678
+ Version 0.6.0 removes the deprecated `work-item time-entry` command hierarchy
679
+ and its API operations. Scripts using those commands must stop invoking them;
680
+ there is no transition command. The official Skill did not use these commands
681
+ and now pins CLI 0.6.0. Historical activity and notifications remain readable.
703
682
 
704
683
  ### Personal notifications
705
684
 
@@ -957,3 +936,53 @@ specflow search-global --query 'payment' --limit 20 --cursor '<nextCursor>'
957
936
  The JSON response preserves object kind, ID, owning Workspace/Project, totalCount
958
937
  and nextCursor. Continue with the same query until nextCursor is null. The server
959
938
  has no type filter. `specflow spec search` retains its published-Spec semantics.
939
+
940
+ ## Work Item automation (ZTA-911, CLI 0.6.0)
941
+
942
+ Existing commands keep full JSON by default. Use `--output summary` for Work Item
943
+ create/read/update/assign/list and relation create/list to omit descriptions while
944
+ retaining IDs, versions, permissions, cursors and replay receipts. Grouped pages
945
+ are summarized too. Summary does not fetch further pages. `relation: null` remains
946
+ null. Unsupported summary commands reject before sending a mutation.
947
+
948
+ Work Item `url` is the server-authorized SpecFlow page URL; `githubIssue.url` remains
949
+ the external GitHub URL. Do not construct links from the API origin. An older server
950
+ that omits `url` still yields a successful business result with one stderr warning.
951
+
952
+ ```sh
953
+ specflow auth whoami
954
+ specflow work-item create --project-id PROJECT --title 'Prepare release' --assignee me --description-file ./release.md --output summary
955
+ cat ./release.md | specflow work-item update --project-id PROJECT --work-item-id GON-78 --expected-version '"3"' --description-file - --output summary
956
+ specflow work-item subtask link --project-id PROJECT --parent GON-78 --child GON-79 --child-project-id OTHER_PROJECT --idempotency-key KEY
957
+ ```
958
+
959
+ `auth whoami` returns `{ user: { id }, credentialKind }` for the selected Session or
960
+ User API Key (`session` or `api-key`). `--assignee me` on create/assign resolves that
961
+ same credential once, without printing the intermediate identity. Read-only Tokens
962
+ cannot resolve `me`; filters and bulk assignment accept User IDs only. Explicit
963
+ credential failure never falls back to another credential. Older servers without
964
+ the identity route require an upgrade or an explicit User ID.
965
+
966
+ Descriptions accept exactly one of inline `--description`, `--description-file`
967
+ (regular UTF-8 file, or `-` for explicit piped stdin), and update's
968
+ `--clear-description` (null). Omission leaves update unchanged and preserves create's
969
+ default. No shell expansion or Markdown parsing occurs. Empty/whitespace content,
970
+ invalid UTF-8, nonregular files and input above 80,000 bytes are rejected locally;
971
+ text must contain 1–20,000 UTF-16 code units after trimming. Interactive stdin is
972
+ rejected: pipe the text or select a file.
973
+
974
+ Subtask source is always parent and target is child. `subtask link` defaults to
975
+ summary; `--project-id` owns the parent and `--child-project-id` defaults to it.
976
+ The existing `relation create --type subtask` remains available:
977
+
978
+ ```sh
979
+ specflow work-item relation create --project-id PROJECT --work-item-id GON-78 --target-project-id PROJECT --target-work-item-id GON-79 --type subtask --idempotency-key KEY
980
+ ```
981
+
982
+ Retain the same relation key and body after an uncertain response; full/summary
983
+ never change server intent. Create retains its automatically generated key within
984
+ one invocation. Transport retries reuse that key and body once; version conflicts
985
+ never fetch a newer version and overwrite automatically. Honor `retryAfter` on 429.
986
+ `LOCAL_OUTPUT_FAILED` means local formatting/output failed after possible server
987
+ success: read the resource before deliberately retrying. It never permits a blind
988
+ write retry. Diagnostics stay on stderr and stdout remains business JSON.
package/dist/bin.js CHANGED
@@ -1,52 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import openBrowser from "open";
3
- import { formatResourceDiagnostic, runCli } from "./cli.js";
4
- import { createCredentialStore, } from "./credential-store.js";
5
- import { readServerFlag, unresolvedSpecFlowApiOrigin, } from "./http-origin.js";
6
- import { assertSupportedNodeVersion } from "./node-version.js";
7
- const arguments_ = process.argv.slice(2);
8
- const usesAuthenticationCli = arguments_.includes("auth") ||
9
- arguments_.includes("--version") ||
10
- arguments_.includes("-V");
11
- if (usesAuthenticationCli) {
12
- const { runSpecFlowCli } = await import("./index.js");
13
- process.exitCode = await runSpecFlowCli(process.argv);
14
- }
15
- else {
16
- try {
17
- assertSupportedNodeVersion(process.versions.node);
18
- const credentialStores = new Map();
19
- const getCredentialStore = (apiKeyId) => {
20
- const slot = apiKeyId ?? "session";
21
- const existing = credentialStores.get(slot);
22
- if (existing !== undefined)
23
- return existing;
24
- const credentialStore = createCredentialStore({
25
- ...(apiKeyId === undefined ? {} : { apiKeyId }),
26
- allowFileFallback: arguments_.includes("--allow-file-fallback"),
27
- serverOrigin: new URL(unresolvedSpecFlowApiOrigin(readServerFlag(arguments_), process.env.SPEC_FLOW_API_URL)).origin,
28
- warning: (value) => process.stderr.write(formatResourceDiagnostic(value)),
29
- });
30
- credentialStores.set(slot, credentialStore);
31
- return credentialStore;
32
- };
33
- process.exitCode = await runCli(arguments_, {
34
- credentialStore: {
35
- read: async () => (await getCredentialStore()).get(),
36
- readApiKey: async (id) => (await getCredentialStore(id)).get(),
37
- writeApiKey: async (id, credential) => (await getCredentialStore(id)).set(credential),
38
- deleteApiKey: async (id) => (await getCredentialStore(id)).delete(),
39
- },
40
- environment: process.env,
41
- fetch: globalThis.fetch,
42
- open: openBrowser,
43
- stderr: (value) => process.stderr.write(value),
44
- stdout: (value) => process.stdout.write(value),
45
- });
46
- }
47
- catch (error) {
48
- process.stderr.write(`${error instanceof Error ? error.message : "SpecFlow CLI failed."}\n`);
49
- process.exitCode = 1;
50
- }
51
- }
2
+ import { runSpecFlowCli } from "./index.js";
3
+ process.stdout.on("error", () => {
4
+ process.exitCode = 4;
5
+ process.stderr.write(`${JSON.stringify({ error: { code: "LOCAL_OUTPUT_FAILED", message: "The output pipe failed; the server operation may have completed. Read the resource before retrying", reason: "Temporary Failure", retryable: false } })}\n`);
6
+ });
7
+ process.exitCode = await runSpecFlowCli(process.argv);
52
8
  //# sourceMappingURL=b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E,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC;YAC9C,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC;SAC/C,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,sBAAsB,IAAI,CACvE,CAAC;QACF,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;IAC9B,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACrB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,qBAAqB,EAAE,OAAO,EAAE,oGAAoG,EAAE,MAAM,EAAE,mBAAmB,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;AACxP,CAAC,CAAC,CAAC;AACH,OAAO,CAAC,QAAQ,GAAG,MAAM,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
package/dist/cli.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import type { Command } from "commander";
2
+ import type { AuthenticationCommandTopology } from "./authentication-command-topology.js";
1
3
  export interface ResourceCredentialStore {
2
4
  readonly read: () => Promise<string | null>;
3
5
  readonly readApiKey?: (apiKeyId: string) => Promise<string | null>;
@@ -5,6 +7,7 @@ export interface ResourceCredentialStore {
5
7
  readonly deleteApiKey?: (apiKeyId: string) => Promise<void>;
6
8
  }
7
9
  export interface CliDependencies {
10
+ readonly registerAuthentication?: (program: Command, authentication: AuthenticationCommandTopology) => void;
8
11
  readonly open?: (url: string) => Promise<unknown>;
9
12
  readonly credentialStore: ResourceCredentialStore;
10
13
  readonly environment: Readonly<Record<string, string | undefined>>;