@softdesignbrasil/productdock-cli 0.13.0 → 0.14.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
@@ -956,10 +956,8 @@ The general table above holds; this is how each condition maps to it:
956
956
 
957
957
  ### `productdock artifact` — writing SDLC phase artifacts
958
958
 
959
- Two write operations over the phase artifacts of a work item. `submit` records a
960
- version **on the platform**; `commit` versions the same body **in Git**. They are
961
- different operations on different stores — the usual sequence is one after the
962
- other — and each has its own subsection below.
959
+ One write operation over the phase artifacts of a work item: `submit` records a
960
+ version **on the platform**. It has its own subsection below.
963
961
 
964
962
  #### `productdock artifact submit`
965
963
 
@@ -1066,102 +1064,6 @@ The general table above holds; this is how each condition maps to it:
1066
1064
  | `1` | Missing `--ref`, `--phase` or `--type`; no body in `--mode full`; file and `--content` together; unreadable file; `--mode` outside `full\|patch`; `--mode patch` without `--patch`, or with malformed `--patch`; `--patch` without `--mode patch`; `--repository-id` and `--repository-name` together; directory not linked and no `--project-id`; **invalid envelope (`400`) — the response names the offending field, and nothing was written**; no permission to edit work items (`403`); work item not found **or not visible to you** (`404` — the two are deliberately indistinguishable); any other API failure |
1067
1065
  | `2` | The API rejected the token (`401`) — run `productdock login` again |
1068
1066
 
1069
- #### `productdock artifact commit`
1070
-
1071
- Served by the `/cli/artifacts/commit` endpoint of the ProductDock API. It is the
1072
- same operation the MCP server exposes as the `commit_artifact` tool, and it
1073
- returns the same body — the path derivation, the branch creation, the
1074
- add-vs-edit decision and the Azure DevOps push are one implementation on the
1075
- server, not two.
1076
-
1077
- **The destination is not yours to choose.** The path in the repository is
1078
- derived server-side from the work item — `.productdock/{N}-{slug}/{type}.md`,
1079
- with `plan` written as `plan.md` and `qa-report` as `qa-run.md` — so there is no
1080
- path flag to pass, and the name of the file on your disk is irrelevant. The
1081
- `path` in the response is read, never proposed.
1082
-
1083
- **The repository target is mandatory and explicit.** This is the strictest scope
1084
- contract of the CLI: a call without a project **or** without a repository is
1085
- refused rather than completed with a default. Committing to the wrong repository
1086
- writes a version nobody is reading.
1087
-
1088
- The Azure DevOps credential is resolved server-side from your ProductDock
1089
- session — there is nothing to configure locally, and no token to pass.
1090
-
1091
- ```bash
1092
- # The body comes from a file — the normal case
1093
- productdock artifact commit .productdock/work-items/PROD-168/spec.md \
1094
- --ref PROD-168 --phase specify --type spec
1095
-
1096
- # Inline, for a short artifact
1097
- productdock artifact commit --ref PROD-168 --phase implement --type plan \
1098
- --content '# Plano
1099
-
1100
- Passo 1.'
1101
-
1102
- # On a branch of its own — created from the default branch if it does not exist
1103
- productdock artifact commit qa-report.md --ref PROD-168 \
1104
- --phase qa-run --type qa-report --branch specs/PROD-168-substituir-mcp
1105
-
1106
- # Machine-readable, saved to a file
1107
- productdock artifact commit spec.md --ref PROD-168 --phase specify --type spec \
1108
- --json --out committed.json
1109
- ```
1110
-
1111
- The subcommand also accepts `--json`, `--project-id` and `--repository-id`,
1112
- documented once at the top of this section.
1113
-
1114
- ##### Parameters
1115
-
1116
- | Subcommand | Argument | Options |
1117
- | --------------- | -------- | ----------------------------------------------------------------------------------------- |
1118
- | `commit [file]` | `[file]` | `--ref` · `--phase` · `--type` · `--content` · `--branch` · `--repository-name` · `--out` |
1119
-
1120
- | Parameter | Description |
1121
- | -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1122
- | `[file]` | Path to the artifact body on disk, read as UTF-8 and sent verbatim — not trimmed, not re-encoded, not truncated. Optional: replaced by `--content`. Passing both the file and `--content` is refused (exit `1`), not silently resolved one way. **It has no bearing on where the file lands in the repository** |
1123
- | `--ref <ref>` | **Required.** Work item the artifact belongs to, in any of the four accepted formats: `PREFIX-N`, item number, UUID, or title |
1124
- | `--phase <phase>` | **Required.** SDLC phase of the artifact — e.g. `specify`, `design`, `tasks`, `qa-run`. The CLI keeps no list of its own: whatever the server accepts, the command sends |
1125
- | `--type <type>` | **Required.** Artifact type — e.g. `spec`, `design`, `tasks`, `plan`, `qa-report`. It decides the filename: `plan` → `plan.md`, `qa-report` → `qa-run.md`, anything else → `{type}.md` |
1126
- | `--content <text>` | The artifact body inline, as an alternative to the file |
1127
- | `--branch <branch>` | Branch of the commit. Defaults to the repository's default branch; a branch that does not exist yet is created from the default one, server-side |
1128
- | `--repository-name <name>` | Repository by name, resolved server-side. It **replaces** the repository of the linked directory for this call — `repository_id` is not sent alongside it, or the server would ignore the name. Passing it together with `--repository-id` is refused (exit `1`) |
1129
- | `--out <file>` | Writes the response document to this file as well. The file gets the exact text `stdout` gets, written atomically |
1130
-
1131
- ##### Response format
1132
-
1133
- Under `--json`, `stdout` carries one document with the API response untouched
1134
- under `data`:
1135
-
1136
- ```jsonc
1137
- {
1138
- "ok": true,
1139
- "operation": "commit_artifact",
1140
- "data": {
1141
- /* the body below */
1142
- },
1143
- }
1144
- ```
1145
-
1146
- Without `--json`, `stdout` stays empty and a two-line summary goes to `stderr`.
1147
-
1148
- | Field | Meaning |
1149
- | ----------- | ------------------------------------------------------------------------------ |
1150
- | `success` | Always `true` on a `0` exit — the push was applied |
1151
- | `path` | Path the artifact was written to, **derived server-side** from the work item |
1152
- | `branch` | Branch the commit landed on — the one you asked for, or the repository default |
1153
- | `commit_id` | SHA of the commit, or `null` when Azure DevOps returned no commit for the push |
1154
-
1155
- ##### Exit codes
1156
-
1157
- The general table above holds; this is how each condition maps to it:
1158
-
1159
- | Code | When |
1160
- | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1161
- | `0` | The commit was pushed |
1162
- | `1` | Missing `--ref`, `--phase` or `--type`; no body (no file and no `--content`); file and `--content` together; unreadable file; `--repository-id` and `--repository-name` together; directory not linked and no `--project-id`; **linked directory with no repository, and no `--repository-name`** — the target is mandatory; missing required scope (`400`); work item outside the project in scope (`400`); repository not found in the project (`400`); **your Microsoft connection needs to be re-established (`409` `azure_reconnect_required`) — reconnect the account in ProductDock and run the command again**; no permission to edit work items (`403`); no access to the project (`403`); any other API failure |
1163
- | `2` | The API rejected the token (`401`) — run `productdock login` again |
1164
-
1165
1067
  ### `productdock prd-review` — the PRD critical review
1166
1068
 
1167
1069
  Two operations over the inline review threads of a PRD (the PRD Tech Review),
@@ -2180,7 +2082,7 @@ bun test test/output.test.ts
2180
2082
  | `lib/work-items.ts` | The `wi` command group — `list`, `prd`, `spec-context`, `bugs`, `prototypes` and `attachments` (with `--download`) over `/cli/work-items/*` |
2181
2083
  | `lib/work-item-attachments.ts` | The `wi` writes — `comment` over `/cli/work-items/comments` and `evidence` (multipart) over `/cli/work-items/qa-evidence` |
2182
2084
  | `lib/code.ts` | The `code` command group — `map` and `search` over `/cli/code/*` |
2183
- | `lib/phase-artifacts.ts` | The `artifact` command group — `submit` over `/cli/artifacts` and `commit` over `/cli/artifacts/commit`, body from a file |
2085
+ | `lib/phase-artifacts.ts` | The `artifact` command group — `submit` over `/cli/artifacts`, body from a file |
2184
2086
  | `lib/prd-review.ts` | The `prd-review` command group — `get` (mandatory read-back) and `submit` over `/cli/prd-review`, and `claim`/`release` of the interactive Tech Review request |
2185
2087
  | `lib/evaluations.ts` | The `eval` command group — `submit` over `/cli/evaluations` (envelope from a file), `latest` over `/cli/evaluations/report` and `list` over `/cli/evaluations/repositories`, project-level |
2186
2088
  | `lib/test-reports.ts` | The `test-report` command group — `submit` over `/cli/test-reports` (report from a file), project-level |