@gonovus-ai/spec-flow-cli 0.7.0 → 1.0.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.
@@ -0,0 +1,195 @@
1
+ # work-items
2
+
3
+ Task links, watchers, automation, views, filters, and comments.
4
+
5
+ - When the User asks to associate a Task with supporting resources, use
6
+ `work-item resource-link list|add|remove` with explicit Project and Task identities.
7
+ For GitHub PR URLs, use `work-item github-link-pr` and verify the result with
8
+ `work-item github-links`. Choose `--role references` for supporting evidence or
9
+ `--role closes` for completion work. Ordinary resource links reject PR URLs.
10
+ A `spec` target uses its stable `--spec-id` and required `--workspace-id`;
11
+ `document` and `other` targets use a User-authored name and HTTP/HTTPS locator.
12
+ Adds and removals take an explicit UUID command key; retain it after an ambiguous
13
+ outcome. Removal also takes the association's opaque expected version. Read
14
+ reverse Task references through `spec work-items`, following its cursor when
15
+ present. Both endpoints require current access in the same Workspace and current User authority. A link records reference metadata and leaves Task completion, Spec
16
+ publication, and external content authorization independent.
17
+
18
+ - Task creation automatically watches as creator and initial assignee. Use
19
+ `work-item create --initial-watcher-ids '["USER_ID"]'` to select initial watchers;
20
+ an explicit array omitting yourself (including `[]`) records your unwatch tombstone.
21
+ Commenting and new mentions enroll participants without clearing tombstones;
22
+ explicit watching or a fresh assignment restores watching. Progress notifications
23
+ exclude the actor and follow current effective watchers and personal preferences.
24
+ - Manage Task watchers with `work-item watchers`, `work-item watcher-candidates`,
25
+ `work-item watch`, and `work-item unwatch`. Read effective watchers with
26
+ `work-item watchers --project-id <id> --work-item-id <taskId>`. In an Active
27
+ Project, watching or unwatching yourself (`--idempotency-key <uuid>`, omitting
28
+ `--user-id` or passing `me`) requires `workItem:read` on an interactive CLI
29
+ Session; listing candidates (`work-item watcher-candidates --project-id <id>`) or
30
+ adding/removing another enabled Workspace member (`--user-id <userId>`) requires
31
+ `workItem:update`. Retain `--idempotency-key` after an uncertain response. Watcher
32
+ changes do not take `--expected-version` or advance Task version.
33
+
34
+ ## Shared task views, statistics, colors and personal tasks (ZTA-875/876/878)
35
+
36
+ ```sh
37
+ specflow work-item view list --project-id PROJECT
38
+ 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":[]}}'
39
+ specflow work-item view save --project-id PROJECT --input '<complete view JSON without version>' --expected-version '"1"'
40
+ specflow work-item statistics --project-id PROJECT --query '{"view":"list","assignee":"USER_ID","priority":"high,urgent"}'
41
+ specflow workspace my-work-items --workspace-id WORKSPACE --limit 50 [--cursor CURSOR] [--query '{"scope":"created","project":"PAY,CHK","status":["In review",{"virtual":"planned"}],"completed":"pastWeek"}']
42
+ specflow workspace my-work-items-statistics --workspace-id WORKSPACE [--query '<same selection>']
43
+ specflow workspace my-work-items-filter-options --workspace-id WORKSPACE
44
+ specflow workspace my-work-items-view list --workspace-id WORKSPACE
45
+ 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]
46
+ specflow workspace my-work-items-view delete --workspace-id WORKSPACE --view-id UUID --expected-version 2
47
+ specflow work-item-custom-field create --project-id PROJECT --name Risk --type dropdown --option High --option Low --option-colors '["danger",null]'
48
+ specflow work-item-custom-field option-colors --project-id PROJECT --field-id FIELD --colors '["warning",null]' --expected-version '"1"' --idempotency-key UUID
49
+ specflow work-item-custom-field option-colors --project-id PROJECT --field-id FIELD --clear --expected-version '"2"' --idempotency-key UUID
50
+ ```
51
+
52
+ Views retain the existing board/list layout and complete filters, including optional
53
+ `repositoryConnectionId`, plus an optional `display` object (null keeps defaults):
54
+ `grouping` and `subgrouping` (`status`, `assignee`, `priority`, `label`, `dueDate`,
55
+ `spec`, `none`), `completed` (`all`, `pastDay`, `pastWeek`, `pastMonth`, `none`),
56
+ `showSubtasks`, `subtaskNesting` (`expanded`, `collapsed`), `showEmptyGroups`,
57
+ `showCounts`, optional `orderCompletedByRecency` and `properties`. Save the complete
58
+ display read from the view.
59
+ `work-item list` and `work-item board` accept `--completed FILTER`; the default
60
+ `all` keeps completed Work Items, and `hiddenCompleted` reports per final status
61
+ how many the filter hid. List and board items carry `completedAt`. Save omits the expected version only for a new ID.
62
+ Identical immediate retries use the same ID, content and observed version; the
63
+ server owns replay and stale-version behavior. No view Idempotency-Key is invented.
64
+ Statistics returns the server aggregate, including trends at `overview.timeline`;
65
+ there is no client page counting. Query accepts existing server selection keys:
66
+ `view`, `repositoryConnectionId`, `assignee`, `watcher`, `customFields`, `due`, `dueAfter`,
67
+ `dueBefore`, `label`, `priority`, `search`, `sortBy`, `sortOrder`, `startAfter`,
68
+ `startBefore`, `status`. CSV and customFields JSON strings retain server semantics.
69
+ My Work Items reads the current User's work in every readable Active Project as one
70
+ `workItems` page in a global order, with `nextCursor` and `hiddenCompleted`; retain the
71
+ server cursor. `scope` is `assigned` (default), `created`, or `watched`; `completed` defaults to
72
+ `none` (unfinished work). Statuses are merged names (same-named columns across
73
+ Projects are one status) and `customFields` keys are `type:name`. `watcher` accepts
74
+ User ids or `me`; set `operators.watchers` to `include` or `exclude`. Statistics and
75
+ filter options use the same selection. Personal views belong to the caller alone;
76
+ `--view-id` is a new UUID or a built-in id (`assigned`, `created`, `watched`, `due-this-week`)
77
+ whose saved row overrides that built-in view.
78
+ Colors align one-to-one with dropdown options; null entries clear individual colors,
79
+ `--clear` clears all. The server validates color values, lengths and field type.
80
+ Assistant can discover views, statistics/trends, option colors and my unfinished
81
+ Work Items. View and color writes wait for approval and retain version preconditions.
82
+
83
+ Connector also exposes My Work Items queries, personal views and display overrides.
84
+ Supply the explicit Workspace path parameter for personal operations; they act as
85
+ the connected User. Use call_read for reads, call_write for saves and display PUT,
86
+ and delete_resource for view deletion and display clearing. Versioned view mutations
87
+ use at-most-once admission; inspect current state after an uncertain outcome.
88
+ Display replacement and clearing are naturally idempotent.
89
+
90
+ ## Work Item automation (ZTA-911, CLI 0.6.0)
91
+
92
+ Existing commands keep full JSON by default. Use `--output summary` for Work Item
93
+ create/read/update/assign/list and relation create/list to omit descriptions while
94
+ retaining IDs, versions, permissions, cursors and replay receipts. Grouped pages
95
+ are summarized too. Summary does not fetch further pages. `relation: null` remains
96
+ null. Unsupported summary commands reject before sending a mutation.
97
+
98
+ Work Item `url` is the server-authorized SpecFlow page URL; `githubIssue.url` remains
99
+ the external GitHub URL. Do not construct links from the API origin. An older server
100
+ that omits `url` still yields a successful business result with one stderr warning.
101
+
102
+ ```sh
103
+ specflow auth whoami
104
+ specflow work-item create --project-id PROJECT --title 'Prepare release' --assignee me --description-file ./release.md --output summary
105
+ cat ./release.md | specflow work-item update --project-id PROJECT --work-item-id GON-78 --expected-version '"3"' --description-file - --output summary
106
+ specflow work-item subtask link --project-id PROJECT --parent GON-78 --child GON-79 --child-project-id OTHER_PROJECT --idempotency-key KEY
107
+ ```
108
+
109
+ `auth whoami` returns `{ user: { id }, credentialKind }` for the selected Session or
110
+ User API Key (`session` or `api-key`). `--assignee me` on create/assign resolves that
111
+ same credential once, without printing the intermediate identity. Read-only Tokens
112
+ cannot resolve `me`; filters and bulk assignment accept User IDs only. Explicit
113
+ credential failure never falls back to another credential. Older servers without
114
+ the identity route require an upgrade or an explicit User ID.
115
+
116
+ Descriptions accept exactly one of inline `--description`, `--description-file`
117
+ (regular UTF-8 file, or `-` for explicit piped stdin), and update's
118
+ `--clear-description` (null). Omission leaves update unchanged and preserves create's
119
+ default. No shell expansion or Markdown parsing occurs. Empty/whitespace content,
120
+ invalid UTF-8, nonregular files and input above 80,000 bytes are rejected locally;
121
+ text must contain 1–20,000 UTF-16 code units after trimming. Interactive stdin is
122
+ rejected: pipe the text or select a file.
123
+
124
+ Subtask source is always parent and target is child. `subtask link` defaults to
125
+ summary; `--project-id` owns the parent and `--child-project-id` defaults to it.
126
+ The existing `relation create --type subtask` remains available:
127
+
128
+ ```sh
129
+ 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
130
+ ```
131
+
132
+ Retain the same relation key and body after an uncertain response; full/summary
133
+ never change server intent. Create retains its automatically generated key within
134
+ one invocation. Transport retries reuse that key and body once; version conflicts
135
+ never fetch a newer version and overwrite automatically. Honor `retryAfter` on 429.
136
+ `LOCAL_OUTPUT_FAILED` means local formatting/output failed after possible server
137
+ success: read the resource before deliberately retrying. It never permits a blind
138
+ write retry. Diagnostics stay on stderr and stdout remains business JSON.
139
+
140
+ ### Work Item selection and view settings
141
+
142
+ `work-item list`, `board` and `export` share these additional flags:
143
+ `--creator USER_ID` (repeatable), `--operators JSON`, `--created FILTER`,
144
+ `--updated FILTER`, `--relations CSV`, `--specs CSV`, and `--pull-requests CSV`.
145
+ Both `--assignee me` and `--creator me` resolve the current credential's User.
146
+ Saved views retain `me` as a symbolic current-viewer token.
147
+
148
+ Operators are a JSON object mapping `created`, `updated`, `statuses`, `assignees`, `creators`,
149
+ `priorities`, `labels`, `projects` (My Work Items), `dueDates`, `relations`, `specs`,
150
+ `pullRequests`, or `customField:<fieldId>` to `include` or `exclude`. Omitted means
151
+ include. Values match any within a category; categories AND together; exclude
152
+ means none of the selected values. There are no condition groups.
153
+
154
+ Created/updated filters are `today`, `pastWeek`, `past2Weeks`, `pastMonth`,
155
+ `past3Months`, or `YYYY-MM-DD` (on/after inclusive UTC midnight). Relations are
156
+ `blocked`, `blocking`, `hasParent`, `hasChildren`, `related`. Specs use linked Spec
157
+ IDs or `none`. PR states are `none`, `draft`, `open`, `merged`, `closed`, evaluated
158
+ from synchronized active associations without a GitHub request. Added sort keys
159
+ are `status`, `startDate`, `updatedAt`, `assignee`; existing sorts remain supported.
160
+ Statistics and My Work Items `--query` accept the same camelCase wire parameters
161
+ (`operators` is a JSON-encoded string, array categories are CSV strings).
162
+
163
+ Saved filters use `operators`, `created`, `updated`, `relations`, `specs`, and
164
+ `pullRequests` directly, with array categories as JSON arrays. Display grouping
165
+ adds `creator`, `startDate`, `parent` and `customField:<fieldId>`; only dropdown and
166
+ multi-select fields have option groups. A `multi-select` field value is a JSON
167
+ string array of declared options. Personal views use merged `type:name` keys.
168
+
169
+ A Project view's optional `visibility` is `project` (default) or `private`.
170
+ Readers can create private views, only the creator can read/change/delete them,
171
+ and shared writes require task update permission. Copy by saving a fresh UUID
172
+ without an expected version. Delete a non-built-in view with
173
+ `work-item view delete --project-id ID --view-id UUID --expected-version VERSION`.
174
+
175
+ `work-item view display read|save|clear --project-id ID --view-id UUID` manages
176
+ only the caller's display override. Save takes `--input '<display JSON>'`.
177
+ `workspace my-work-items-view display read|save|clear --workspace-id ID --view-id ID`
178
+ does the same for personal views, including built-ins. Clear restores the view
179
+ settings; saving the view itself changes its default. Filters are never stored in
180
+ the display override. Reauthorize every operation; a view grants no task access.
181
+
182
+ ### Work Item comment thread read projections
183
+
184
+ `work-item thread list|show` returns the API JSON unchanged, including `generation`,
185
+ `anchorState`, `anchorStart` and `anchorEnd`. Attached description threads carry
186
+ opaque endpoint tokens that only the Web editor resolves; never decode or rewrite
187
+ them. Describe a thread's passage with `quote` and `anchorState`, and treat a
188
+ `generation` other than the current description generation as historical.
189
+ Detached/general threads return null endpoints. Discussion state
190
+ activities expose an optional explicit `threadId`; historical events without it
191
+ have no thread target. Imported GitHub flat comments also expose their thread ID.
192
+
193
+ Related guides: public Task sharing is in workspace-admin; uploading Task asset
194
+ bytes with `work-item asset put` is in map-and-screens; Spec links target shared
195
+ Specs described in authoring.
@@ -0,0 +1,130 @@
1
+ # workspace-admin
2
+
3
+ Authentication, Workspace and Project administration, credentials, and integrations.
4
+
5
+ Installing the Skill or CLI never starts authentication. Device Authorization remains
6
+ a separate, explicit User operation when SpecFlow access is actually needed.
7
+
8
+ The CLI uses its built-in public origin. Pass `--server <origin>` only when the User
9
+ names a different SpecFlow origin, and use that same flag on authentication and every
10
+ resource command:
11
+
12
+ ```bash
13
+ specflow auth login
14
+ specflow project list
15
+ ```
16
+
17
+ Tell the User to click Approve in the browser.
18
+
19
+ The resulting independently revocable CLI Session belongs to the User and uses
20
+ all of that User's current SpecFlow permissions. No Workspace, Project, resource,
21
+ or action selection is required. New Workspaces and Projects are available without
22
+ another login. Membership, Role, lifecycle, User eligibility and Session revocation
23
+ are checked by the server on every operation; login does not save a permission
24
+ snapshot or bypass those checks. Do not register an Agent identity or request an Agent grant.
25
+
26
+ A legacy explicitly restricted Session retains its original scope. When the User
27
+ requests normal User access, log in again without `--grants`; do not repeatedly
28
+ request new target grants as Workspaces or Projects are created. Account identity
29
+ security and management of other Sessions remain outside this CLI surface.
30
+
31
+ User API Keys accept WorkspaceKnowledge/ProjectTasks arrays without UserAccount
32
+ or Session-only administration. A Key’s ProjectTasks.project admits only read. Use
33
+ `api-key create --name <name> --grants <json>
34
+ --expires-at <UTC timestamp|never> --idempotency-key <uuid>`. Use `api-key list` and
35
+ `api-key revoke --key-id <uuid> --expected-version <quoted version>
36
+ --idempotency-key <uuid>` to manage them. Creation stores the one-time secret in the
37
+ origin-scoped credential store; stdout contains metadata only. Replayed issuance
38
+ never returns a secret. Select a stored key with `--api-key-id`, or supply
39
+ `SPEC_FLOW_API_KEY`. Never combine credentials or fall back to a Session after a
40
+ key or Token fails.
41
+
42
+ Workspace administrators issue read-only credentials with `token issue
43
+ --workspace-id <id> --name <name> [--expires-at <UTC timestamp>]`; `token list` and
44
+ `token revoke --workspace-id <id> --token-id <id>` manage them. The issue secret is
45
+ shown once; metadata and audit retain the credential identity. Inject it through
46
+ `SPEC_FLOW_WORKSPACE_READ_TOKEN` for `spec current`, `spec revision`, and
47
+ `workspace glossary revision`, each with `--workspace-id` and the explicit resource/version
48
+ IDs. Current reads require a published Ready Spec; explicit revisions are immutable
49
+ published content. Drafts, Findings, Members, Project tasks and every mutation are
50
+ excluded. Tokens have optional expiry and can be revoked. They never enter the
51
+ Session credential store. The old Project Token and its environment variable are
52
+ retired.
53
+
54
+ Personal GitHub authorization and notification commands act as the same current
55
+ User. GitHub OAuth remains a separate normal browser authorization. API Keys and
56
+ Workspace read-only Tokens do not gain personal account capabilities.
57
+
58
+ - Manage public Task sharing only when the User requests it. Read the independent
59
+ sharing version with `specflow project sharing read --project-id <id>`; use
60
+ `specflow project sharing set --project-id <id> --public true|false
61
+ --expected-version <version> --idempotency-key <uuid>` with an authorized CLI
62
+ Session. Retain the same key and intent after an uncertain response. A replay
63
+ reports the current switch and cannot reopen a Project another command closed.
64
+ Public sharing exposes Task fields and current description assets, and grants
65
+ no Workspace membership, Spec/Glossary, task-resource or comment-asset access.
66
+ Archive and Trash close sharing; Restore keeps it private until explicitly
67
+ enabled again. Workspace read-only Tokens cannot manage sharing.
68
+
69
+ - Read the current User's notification inbox with `notification list`. A target
70
+ never grants access: use the fresh target returned by `notification read
71
+ --notification-id <uuid> --idempotency-key <uuid>` before navigating. `notification
72
+ read-all` and `notification clear` require an explicit UUID command key and a
73
+ current User authority; clear only when the
74
+ User requests it. Retain the key
75
+ after an ambiguous outcome so retrying cannot change newer entries. Read category
76
+ preferences with `notification preferences get`; update only requested fields
77
+ through `notification preferences update --expected-version <version> --preferences <json> --idempotency-key
78
+ <uuid>`. Project-scoped Sessions can read admitted targets, while Workspace read-only Tokens cannot access personal notifications. Do not claim scheduled reminders,
79
+ external delivery, or live Gateway push from this durable inbox.
80
+
81
+ - Use `specflow project list` before choosing a Project; never infer a hidden current
82
+ Project. Every newly created Project belongs to exactly one owning Workspace, and
83
+ Workspace Membership is the only source of Project permissions.
84
+ - Discover Workspaces with `specflow workspace list` and create one with `specflow workspace create --name <name> --prefix <prefix>` when the User asks for a new container. Select one
85
+ Workspace's Projects with `specflow project list --workspace-id <workspaceId>` —
86
+ an explicit, stateless filter combinable with `--status`; an unknown or
87
+ inaccessible Workspace returns an empty list, and discovery reflects the current User membership and Role.
88
+ - Administer Workspace membership and Roles only when the User asks. `specflow workspace member list|search|add|set-role|remove` governs who holds access —
89
+ `search` reads the identity directory and `add` provisions the selected User
90
+ by exact issuer+subject identity, including before first login; there is no
91
+ invitation path. `specflow workspace role list|create|update|delete` manages
92
+ statement sets: pass `--statements` as a JSON resource-to-actions object, a
93
+ Role never exceeds the caller's own grants, `Owner` is immutable, and a Role
94
+ still assigned cannot be deleted. Member writes and Role writes take the
95
+ resource's opaque `version` as `--expected-version`; reread deliberately
96
+ after `Resource Changed`.
97
+ - Workspace Creation requires an immutable, globally unique prefix of 2-10 letters.
98
+ Specs use PAY-S123, Scenarios PAY-S123-4, and Work Items PAY-123 across its Projects.
99
+ - Project Creation requires an owning Workspace. Run `specflow project create --name <name> --workspace-id <workspaceId>`. Spec language belongs to the Workspace.
100
+ The server generates the Project ID; discover and pass that ID without deriving it from a task number.
101
+
102
+ - Archive, Trash, or Restore only when the User's task requires that lifecycle
103
+ change. Pass the opaque version returned by Project discovery or context, and
104
+ reread deliberately after `Resource Changed` or an ambiguous transport outcome.
105
+ A Trashed Project surfaces only to an Admin through `project list --status
106
+ Trashed`, and Restore always lands it on Archived — never directly on Active.
107
+
108
+ Connect 1–50 repositories atomically with one idempotency key:
109
+
110
+ ```bash
111
+ specflow github connection connect-batch --project-id PROJECT_ID \
112
+ --repository owner/tasks:10:20 --repository owner/mobile:10:21 \
113
+ --outbound-repository-id 20 --idempotency-key UUID
114
+ ```
115
+
116
+ Repeat `--repository owner/name:installationId:repositoryId` for each repository.
117
+ Use `--no-outbound` to explicitly select none. Without either option, only the
118
+ first repository of the Project's first batch becomes outbound; later batches
119
+ only create from GitHub. A Project with an outbound repository cannot nominate
120
+ another during connection. Workspace binding conflicts reject the whole batch.
121
+ A real Web/CLI Session with current Workspace settings permission and personal
122
+ GitHub administrator access to every repository is required. The single-repository
123
+ `github connection connect` command remains available.
124
+
125
+ Use `project rename --project-id ID --name NAME --expected-version VERSION
126
+ --idempotency-key UUID` for an explicit rename request. It preserves identity and
127
+ respects lifecycle restrictions.
128
+
129
+ Related guides: Workspace Spec language (`--spec-language`, `workspace settings`)
130
+ is in authoring; `specflow auth whoami` is described in work-items.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gonovus-ai/spec-flow-cli",
3
- "version": "0.7.0",
3
+ "version": "1.0.0",
4
4
  "description": "SpecFlow supported command-line client",
5
5
  "repository": {
6
6
  "type": "git",
@@ -22,7 +22,8 @@
22
22
  }
23
23
  },
24
24
  "files": [
25
- "dist"
25
+ "dist",
26
+ "guides"
26
27
  ],
27
28
  "engines": {
28
29
  "node": ">=24.0.0 <25.0.0"
@@ -47,10 +48,14 @@
47
48
  "commander": "15.0.0",
48
49
  "open": "11.0.0",
49
50
  "openapi-fetch": "^0.17.0",
51
+ "proper-lockfile": "4.1.2",
52
+ "semver": "7.8.5",
50
53
  "zod": "4.4.3"
51
54
  },
52
55
  "devDependencies": {
53
56
  "@spec-flow/api-client": "workspace:*",
54
- "@types/node": "24.13.3"
57
+ "@types/node": "24.13.3",
58
+ "@types/proper-lockfile": "4.1.4",
59
+ "@types/semver": "7.8.0"
55
60
  }
56
61
  }