@mytegroupinc/myte-core 0.0.46 → 0.0.47
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 +57 -37
- package/cli.js +223 -131
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,7 +21,10 @@ This package exists so the public wrapper can stay small and versioned cleanly.
|
|
|
21
21
|
## Behavior Summary
|
|
22
22
|
|
|
23
23
|
- Snapshot-style commands such as `bootstrap`, `sync-qaqc`, `feedback-sync`, and `suggestions sync` write local `MyteCommandCenter` data.
|
|
24
|
-
- `feedback status|edit|assign|archive` writes reviewable local YAML artifacts
|
|
24
|
+
- `feedback status|edit|assign|archive|refine` writes reviewable local YAML artifacts.
|
|
25
|
+
- `feedback submit|revise|comment` are live writes that require `--confirm-write --approval-artifact <path>`.
|
|
26
|
+
- `feedback review|move|undo|apply` are governed writes with backend permission checks but no approval artifact flags.
|
|
27
|
+
- `feedback-sync|get|history|reviews|prd-versions|prd-diff|validate` are read/sync/validation commands with no approval artifact flags.
|
|
25
28
|
- `feedback move|comment|undo|prd-versions|prd-diff|history` calls the project-key Feedback API while leaving lifecycle rules and permissions server-side. `feedback move --feedback-ids` sends one batch move request.
|
|
26
29
|
- `feedback validate|apply` remains available for validation and owner-direct apply paths; live authorization, stale checks, and history stay server-side.
|
|
27
30
|
- `query --with-diff` requires project repos to be configured for diff collection and fails fast when no matching local project repo can be resolved.
|
|
@@ -41,15 +44,29 @@ This package exists so the public wrapper can stay small and versioned cleanly.
|
|
|
41
44
|
|
|
42
45
|
## Live Write Approval
|
|
43
46
|
|
|
44
|
-
|
|
47
|
+
Only selected project-key writes require a server-validated approval envelope. The CLI adds `write_approval` metadata only for those commands after the caller supplies `--confirm-write --approval-artifact <path>`.
|
|
45
48
|
|
|
46
|
-
|
|
49
|
+
| Category | Commands | Artifact |
|
|
50
|
+
| --- | --- | --- |
|
|
51
|
+
| Required | `create-prd`, `update-team`, `update-owner`, `update-client`, `feedback submit`, `feedback revise`, `feedback comment`, `suggestions create`, `suggestions revise` | Yes |
|
|
52
|
+
| Not required | `run-qaqc`, `mission status`, `mission archive`, `suggestions review`, `feedback review`, `feedback move`, `feedback undo`, `feedback apply` | No |
|
|
53
|
+
| Never required | `config`, `query`, `bootstrap`, `sync-qaqc`, `feedback-sync`, `suggestions sync`, `feedback get/history/reviews/prd-versions/prd-diff/validate`, local feedback draft commands | No |
|
|
54
|
+
|
|
55
|
+
- The approval artifact must be a local `.md`, `.markdown`, `.yml`, `.yaml`, or `.json` file shown to and approved by the user.
|
|
47
56
|
- The artifact must list the exact operation, proposed change, and every target id or PRD item.
|
|
48
|
-
- Batch
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
|
|
52
|
-
|
|
57
|
+
- Batch artifacts for required actions must enumerate every item and the CLI sends the matching batch count to the API.
|
|
58
|
+
- For required actions, the API validates the payload hash after stripping transport metadata, so direct HTTP writes with only the API key do not bypass approval.
|
|
59
|
+
- For actions marked `Not required`, the backend still enforces project-key authentication, idempotency, owner/delegate capability rules, stale-state guards, validation, rate limits, and audit history.
|
|
60
|
+
- In plain language, the artifact is the human-reviewed record of the exact write the agent is about to send. It is not a permission grant and it does not bypass project owner/delegate checks, idempotency, stale-state guards, validation, or audit.
|
|
61
|
+
- Minimum artifact contents are the exact command, every target id or PRD item, a complete proposed-change summary, a reason, and `batch_count` when one command sends multiple items.
|
|
62
|
+
- Mission edit/create batches use `suggestions create` or `suggestions revise`; list every item, including `change_type`, `mission_id` for updates, proposed title/description for creates, and `suggestion_id` plus expected revision for revisions.
|
|
63
|
+
- PRD batches use one `create-prd fileA.md fileB.md ...`; list each PRD file/title/client ref and make `batch_count` match the number of PRDs.
|
|
64
|
+
- Feedback submit/revise/comment artifacts are usually the same YAML or markdown file being submitted. For inline text or stdin, use a separate approval memo with the feedback id or request id and exact content.
|
|
65
|
+
- Team, owner, and client update artifacts should name the audience and include the exact message body or a complete summary. Client updates should include target contact ids when used.
|
|
66
|
+
- `feedback review --request-ids`, `feedback move --feedback-ids`, `mission status --mission-ids`, `mission archive --mission-ids`, and `run-qaqc --mission-ids` are batched governed writes, but they are marked `Not required` and should not receive approval artifact flags.
|
|
67
|
+
- The package does not bundle the large MyteCody engine binary or the async
|
|
68
|
+
Responses bridge implementation. See `THIRD_PARTY_NOTICES.md` and
|
|
69
|
+
`TRADEMARKS.md` for Codex lineage and Myte brand notices.
|
|
53
70
|
|
|
54
71
|
## Agent Usage Contract
|
|
55
72
|
|
|
@@ -57,20 +74,20 @@ Coding agents should treat `MYTE_API_KEY` as a project-scoped Project Assistant
|
|
|
57
74
|
|
|
58
75
|
- Load it from the workspace `.env` or environment. `MYTE_PROJECT_API_KEY` is accepted as a compatibility fallback.
|
|
59
76
|
- Call `myte config --json` first when project identity or local repo detection is uncertain.
|
|
60
|
-
- Hydrate mission context with `bootstrap` first instead of scraping the web UI. `bootstrap` writes mission cards
|
|
77
|
+
- Hydrate mission context with `bootstrap` first instead of scraping the web UI. `bootstrap` writes mission cards, mission suggestion thread state, and `MyteCommandCenter/AgentsMyteAPI.md`.
|
|
61
78
|
- Use `suggestions sync` only when you need to refresh mission review-thread state without refreshing the full board.
|
|
62
79
|
- Use `query --with-diff` for project-scoped code review, planning, and implementation questions.
|
|
63
|
-
- Use `create-prd` only with reviewed markdown files
|
|
64
|
-
- Use `feedback status|edit|assign|archive` for reviewable local artifacts
|
|
80
|
+
- Use `create-prd` only with reviewed markdown files and `--confirm-write --approval-artifact <path>`. The markdown file body is the PRD document; `description` is only the short board/card summary.
|
|
81
|
+
- Use `feedback status|edit|assign|archive|refine` for reviewable local artifacts. `feedback submit` and `feedback revise` require an approval artifact; `feedback review` does not because the backend owner/delegate decision is the approval control.
|
|
65
82
|
- Use `feedback review --request-ids` for batch owner/delegate decisions; it sends one grouped backend batch, not one request per item.
|
|
66
|
-
- Use `suggestions create` for both existing-mission edits and new-mission proposals
|
|
67
|
-
- Use `suggestions revise` only against an existing `suggestion_id
|
|
68
|
-
- Use `suggestions review` for owner/elevated mission-review decisions: `approve`, `request_changes`, or `reject`.
|
|
83
|
+
- Use `suggestions create` for both existing-mission edits and new-mission proposals, with `--confirm-write --approval-artifact <path>`. The only valid `change_type` values are `update` and `create`.
|
|
84
|
+
- Use `suggestions revise` only against an existing `suggestion_id`, with `--confirm-write --approval-artifact <path>`; do not send `change_type` on revisions because the backend keeps the thread's original type.
|
|
85
|
+
- Use `suggestions review` for owner/elevated mission-review decisions: `approve`, `request_changes`, or `reject`. No approval artifact is required for review decisions.
|
|
69
86
|
- Use `mission archive` for project-key lifecycle archival. Do not send `Archived` through `mission status`; restore archived missions from the web archived-board view.
|
|
70
87
|
- Use `feedback move` only when a direct audited state move is intended and include a concrete `--reason`. Use `--feedback-ids` for batch active-state moves or authorized batch archive.
|
|
71
|
-
- Use `feedback comment --feedback-id <id> --body-file ./comment.md` for text-only feedback-specific implementation notes. Attachments remain web UI only for this project-key endpoint.
|
|
88
|
+
- Use `feedback comment --feedback-id <id> --body-file ./comment.md --confirm-write --approval-artifact ./comment.md` for text-only feedback-specific implementation notes. Attachments remain web UI only for this project-key endpoint.
|
|
72
89
|
- Do not use the project-key API/CLI to unarchive Feedback. Normal `feedback-sync` excludes archived Feedback; unarchive from the web archived Feedback view.
|
|
73
|
-
- Use `update-team
|
|
90
|
+
- Use `update-team --confirm-write --approval-artifact <path>` when an agent needs to leave a project-level implementation note or verification comment.
|
|
74
91
|
|
|
75
92
|
Do not use `MYTE_API_KEY` against account/JWT web endpoints. The direct project-key surface is `/api/project-assistant/*`.
|
|
76
93
|
|
|
@@ -91,7 +108,7 @@ Feedback comment support:
|
|
|
91
108
|
|
|
92
109
|
- `feedback-sync` includes existing feedback comment turns in local context.
|
|
93
110
|
- Feedback-specific comment creation exists in the web backend at `/api/feedbacks/<feedback_id>/comments`, protected by JWT/project assignment.
|
|
94
|
-
- Project-key comment creation is available through `myte feedback comment --feedback-id <id> --body "..."` or `--body-file ./comment.md`.
|
|
111
|
+
- Project-key comment creation is available through `myte feedback comment --feedback-id <id> --body "..." --confirm-write --approval-artifact ./comment.md` or `--body-file ./comment.md --confirm-write --approval-artifact ./comment.md`.
|
|
95
112
|
- The project-key feedback comment endpoint is text-only in this slice and caps content at 500,000 characters. Use the web UI when comment attachments are required.
|
|
96
113
|
|
|
97
114
|
## Mission Action Map
|
|
@@ -100,12 +117,12 @@ Feedback comment support:
|
|
|
100
117
|
| --- | --- | --- |
|
|
101
118
|
| Sync mission cards and review threads | `myte bootstrap --json` | Refreshes `MyteCommandCenter/data/missions/*.yml`, project structure, and `MyteCommandCenter/data/mission-ops.yml`. |
|
|
102
119
|
| Sync only mission review threads | `myte suggestions sync --json` | Refreshes `MyteCommandCenter/data/mission-ops.yml` while preserving local workspace drafts. |
|
|
103
|
-
| Suggest edit to existing mission | `myte suggestions create` with `change_type: update` and `mission_id` | Creates or appends to an active review thread; live mission is unchanged until approval. |
|
|
104
|
-
| Suggest new mission | `myte suggestions create` with `change_type: create` | Requires `change_set.title` and `change_set.description`; creates a review thread only; the mission card is created only after approval. |
|
|
105
|
-
| Revise a suggestion | `myte suggestions revise` with `suggestion_id` | Adds another revision to the same thread. Do not include `change_type`. |
|
|
106
|
-
| Review a suggestion | `myte suggestions review` with `review_action: approve|request_changes|reject` | Project Owner or elevated mission-review delegate required. Approval mutates/creates the mission once; reject archives the thread only; request_changes keeps it actionable. |
|
|
107
|
-
| Update mission status | `myte mission status --mission-ids "M001" --status todo|in_progress|done` | Project-key surface updates canonical mission status for active cards
|
|
108
|
-
| Archive mission | `myte mission archive --mission-ids "M001[,M002]" --reason "..."` | Project Owner or elevated delegate required. Sets `Archived`, removes cards from normal bootstrap/board state, writes mission activity, and refreshes local bootstrap + mission-ops by default. |
|
|
120
|
+
| Suggest edit to existing mission | `myte suggestions create --file ./create.yml --confirm-write --approval-artifact ./create.yml` with `change_type: update` and `mission_id` | Creates or appends to an active review thread; live mission is unchanged until approval. |
|
|
121
|
+
| Suggest new mission | `myte suggestions create --file ./create.yml --confirm-write --approval-artifact ./create.yml` with `change_type: create` | Requires `change_set.title` and `change_set.description`; creates a review thread only; the mission card is created only after approval. |
|
|
122
|
+
| Revise a suggestion | `myte suggestions revise --file ./revise.yml --confirm-write --approval-artifact ./revise.yml` with `suggestion_id` | Adds another revision to the same thread. Do not include `change_type`. |
|
|
123
|
+
| Review a suggestion | `myte suggestions review` with `review_action: approve|request_changes|reject` | Project Owner or elevated mission-review delegate required; no approval artifact required. Approval mutates/creates the mission once; reject archives the thread only; request_changes keeps it actionable. |
|
|
124
|
+
| Update mission status | `myte mission status --mission-ids "M001" --status todo|in_progress|done` | Project-key surface updates canonical mission status for active cards; no approval artifact required; refreshes local bootstrap + mission-ops by default. |
|
|
125
|
+
| Archive mission | `myte mission archive --mission-ids "M001[,M002]" --reason "..."` | Project Owner or elevated delegate required; no approval artifact required. Sets `Archived`, removes cards from normal bootstrap/board state, writes mission activity, and refreshes local bootstrap + mission-ops by default. |
|
|
109
126
|
|
|
110
127
|
Create payloads:
|
|
111
128
|
|
|
@@ -171,18 +188,18 @@ Agent rule: never guess `suggestion_id`. If `mission-ops.yml` is missing or stal
|
|
|
171
188
|
| `feedback edit` / `feedback refine` | Creates a local YAML proposal for title, description/body, priority, due date, tags, or notes. | Content changes go through owner-review membrane. |
|
|
172
189
|
| `feedback assign` | Creates a local YAML proposal to change assignee. | Goes through review unless applied through owner-direct path. |
|
|
173
190
|
| `feedback archive` | Creates a local YAML proposal to archive. | Archive is governed by backend owner/delegate capability. |
|
|
174
|
-
| `feedback submit` | Sends a local proposal artifact to the backend as a review request. |
|
|
175
|
-
| `feedback revise` | Resubmits the original submitter's request after `request_changes`. |
|
|
191
|
+
| `feedback submit` | Sends a local proposal artifact to the backend as a review request. | Requires `--confirm-write --approval-artifact <path>`; does not mutate live feedback before approval. |
|
|
192
|
+
| `feedback revise` | Resubmits the original submitter's request after `request_changes`. | Requires `--confirm-write --approval-artifact <path>`; only valid for the original submitter and `needs_changes` requests. |
|
|
176
193
|
| `feedback reviews` | Lists review requests or fetches one request by `--request-id`. | Read-only; response includes backend permissions. |
|
|
177
|
-
| `feedback review` | Approves, rejects, requests changes, or cancels one review request, or a batch with `--request-ids`. |
|
|
178
|
-
| `feedback move` | Moves a card or batch of cards across allowed board states directly with an audit event. | `--feedback-ids` sends one batch request. Blocked with `pending_feedback_review` while an active linked review request exists; governed states such as archive/reject/deploy/freeze remain backend-authorized. Project-key unarchive is not supported. |
|
|
179
|
-
| `feedback comment` | Creates a text-only comment on one Feedback item. |
|
|
180
|
-
| `feedback undo` | Reverses an audited board event when there is no conflict. |
|
|
194
|
+
| `feedback review` | Approves, rejects, requests changes, or cancels one review request, or a batch with `--request-ids`. | No approval artifact required; backend restricts approval/review decisions to Project Owner or elevated delegate for Feedback scope; batch review uses one grouped notification path. |
|
|
195
|
+
| `feedback move` | Moves a card or batch of cards across allowed board states directly with an audit event. | No approval artifact required. `--feedback-ids` sends one batch request. Blocked with `pending_feedback_review` while an active linked review request exists; governed states such as archive/reject/deploy/freeze remain backend-authorized. Project-key unarchive is not supported. |
|
|
196
|
+
| `feedback comment` | Creates a text-only comment on one Feedback item. | Requires `--confirm-write --approval-artifact <path>`; backend checks project-key access, owner/assigned permission, idempotency, and the 500,000-character content cap. Attachments remain web UI only. |
|
|
197
|
+
| `feedback undo` | Reverses an audited board event when there is no conflict. | No approval artifact required; backend validates event ownership/project scope and conflict state. |
|
|
181
198
|
| `feedback prd-versions` | Lists retained PRD baselines/revisions for a feedback item. | Read-only; old S3 objects are retained by reference. |
|
|
182
199
|
| `feedback prd-diff` | Fetches backend-generated text diff for PRD versions. | Read-only; backend controls version access. |
|
|
183
200
|
| `feedback history` | Lists audited feedback board/refinement events. | Read-only; backend checks project access. |
|
|
184
201
|
| `feedback validate` | Sends an artifact to backend validation without mutation. | Useful before submit or owner-direct apply. |
|
|
185
|
-
| `feedback apply` | Applies an artifact through the owner-direct/emergency path. |
|
|
202
|
+
| `feedback apply` | Applies an artifact through the owner-direct/emergency path. | No approval artifact required; not the normal collaborator flow; normal flow is `submit` -> `review`. |
|
|
186
203
|
|
|
187
204
|
Canonical feedback lifecycle states are `frozen`, `todo`, `in_progress`, `in_review`, `completed`, `deployed`, `rejected`, and `archived`.
|
|
188
205
|
|
|
@@ -194,13 +211,16 @@ node ./scripts/feedback-live-full-harness.js --confirm-live --base-url https://a
|
|
|
194
211
|
|
|
195
212
|
The harness creates five disposable `TEST` feedback items from markdown, verifies batch review and batch board movement, batch archives the disposable items, verifies normal `feedback-sync` excludes archived items, and verifies the project-key surface does not expose Feedback unarchive/restore.
|
|
196
213
|
|
|
197
|
-
## Direct Project API Surface
|
|
198
|
-
|
|
199
|
-
All routes use `Authorization: Bearer <MYTE_API_KEY>`. The CLI adds idempotency and client-session headers on mutation routes.
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
214
|
+
## Direct Project API Surface
|
|
215
|
+
|
|
216
|
+
All routes use `Authorization: Bearer <MYTE_API_KEY>`. The CLI adds idempotency and client-session headers on mutation routes.
|
|
217
|
+
|
|
218
|
+
`myte ai` is separate from this project-scoped surface. It uses `MYTEAI_API_KEY` and calls `POST https://api.myte.ai/v1/chat/completions`, or `${MYTEAI_API_BASE}/v1/chat/completions` when that base is configured.
|
|
219
|
+
|
|
220
|
+
Read/sync routes:
|
|
221
|
+
|
|
222
|
+
- `GET /api/project-assistant/query/<job_id>`
|
|
223
|
+
- `GET /api/project-assistant/config`
|
|
204
224
|
- `GET /api/project-assistant/bootstrap`
|
|
205
225
|
- `GET /api/project-assistant/qaqc-sync`
|
|
206
226
|
- `GET /api/project-assistant/feedback-sync`
|
package/cli.js
CHANGED
|
@@ -26,9 +26,9 @@ const DEFAULT_DIFF_LIMIT_CHARS = 500_000;
|
|
|
26
26
|
const REMOVED_COMMAND_MESSAGES = {
|
|
27
27
|
ask: "The `ask` alias has been removed. Use `myte query \"...\"`.",
|
|
28
28
|
chat: "The `chat` command has been removed. Use repeated `myte query` calls instead.",
|
|
29
|
-
"create-prds": "The `create-prds` alias has been removed. Use `myte create-prd <file.md> [more.md ...]
|
|
30
|
-
"add-prd": "The `add-prd` alias has been removed. Use `myte create-prd <file.md> [more.md ...]
|
|
31
|
-
prd: "The `prd` alias has been removed. Use `myte create-prd <file.md> [more.md ...]
|
|
29
|
+
"create-prds": "The `create-prds` alias has been removed. Use `myte create-prd <file.md> [more.md ...] --confirm-write --approval-artifact <path>`.",
|
|
30
|
+
"add-prd": "The `add-prd` alias has been removed. Use `myte create-prd <file.md> [more.md ...] --confirm-write --approval-artifact <path>`.",
|
|
31
|
+
prd: "The `prd` alias has been removed. Use `myte create-prd <file.md> [more.md ...] --confirm-write --approval-artifact <path>`.",
|
|
32
32
|
"qaqc-status-update": "The `qaqc-status-update` command has been removed. Use `myte mission status --mission-ids \"M001,M002\" --status todo|in_progress|done`.",
|
|
33
33
|
"mission-restore": "The project-key `myte mission restore` command has been removed. Restore archived missions from the Myte web archived missions board.",
|
|
34
34
|
};
|
|
@@ -190,12 +190,12 @@ function printHelp() {
|
|
|
190
190
|
" myte mission archive --mission-ids \"M001[,M002...]\" [--reason \"...\"] [--no-sync] [--json]",
|
|
191
191
|
" myte sync-qaqc [--output-dir ./MyteCommandCenter] [--json]",
|
|
192
192
|
" myte suggestions sync [--output-dir ./MyteCommandCenter] [--json]",
|
|
193
|
-
" myte suggestions create [--file ./payload.yml] [--no-sync] [--json]",
|
|
194
|
-
" myte suggestions revise [--file ./payload.yml] [--no-sync] [--json]",
|
|
195
|
-
" myte suggestions review [--file ./payload.yml] [--no-sync] [--json]",
|
|
196
|
-
" myte update-team \"<content>\" [--json]",
|
|
197
|
-
" myte update-owner --subject \"<text>\" [--body-markdown \"...\"] [--body-file ./update.md] [--json]",
|
|
198
|
-
" myte update-client --subject \"<text>\" [--body-markdown \"...\"] [--body-file ./update.md] [--target-contact-ids <id1,id2>] [--json]",
|
|
193
|
+
" myte suggestions create [--file ./payload.yml] --confirm-write --approval-artifact <path> [--no-sync] [--json]",
|
|
194
|
+
" myte suggestions revise [--file ./payload.yml] --confirm-write --approval-artifact <path> [--no-sync] [--json]",
|
|
195
|
+
" myte suggestions review [--file ./payload.yml] [--no-sync] [--json]",
|
|
196
|
+
" myte update-team \"<content>\" --confirm-write --approval-artifact <path> [--json]",
|
|
197
|
+
" myte update-owner --subject \"<text>\" [--body-markdown \"...\"] [--body-file ./update.md] --confirm-write --approval-artifact <path> [--json]",
|
|
198
|
+
" myte update-client --subject \"<text>\" [--body-markdown \"...\"] [--body-file ./update.md] [--target-contact-ids <id1,id2>] --confirm-write --approval-artifact <path> [--json]",
|
|
199
199
|
" myte feedback-sync [--status <value>] [--source <value>] [--with-prd-text|--no-with-prd-text] [--output-dir ./MyteCommandCenter] [--json]",
|
|
200
200
|
" myte feedback get --feedback-id <id> [--json]",
|
|
201
201
|
" myte feedback history --feedback-id <id> [--limit 50] [--json]",
|
|
@@ -203,23 +203,23 @@ function printHelp() {
|
|
|
203
203
|
" myte feedback edit --feedback-id <id> [--title \"...\"] [--feedback-text \"...\"] [--priority High] [--reason \"...\"]",
|
|
204
204
|
" myte feedback assign --feedback-id <id> --user-id <id> [--reason \"...\"]",
|
|
205
205
|
" myte feedback archive --feedback-id <id> --reason \"...\"",
|
|
206
|
-
" myte feedback submit --file ./MyteCommandCenter/reviews/feedback/<id>-edit.yml [--json]",
|
|
207
|
-
" myte feedback revise --request-id <id> --file ./MyteCommandCenter/reviews/feedback/<id>-edit.yml [--json]",
|
|
206
|
+
" myte feedback submit --file ./MyteCommandCenter/reviews/feedback/<id>-edit.yml --confirm-write --approval-artifact <path> [--json]",
|
|
207
|
+
" myte feedback revise --request-id <id> --file ./MyteCommandCenter/reviews/feedback/<id>-edit.yml --confirm-write --approval-artifact <path> [--json]",
|
|
208
208
|
" myte feedback reviews [--status open|terminal|all] [--request-id <id>] [--json]",
|
|
209
209
|
" myte feedback review --request-id <id> --action approve|reject|request_changes|cancel [--reason \"...\"] [--json]",
|
|
210
210
|
" myte feedback review --request-ids \"<id1,id2>\" --action approve|reject|request_changes|cancel [--reason \"...\"] [--json]",
|
|
211
211
|
" myte feedback move --feedback-id <id> --to-state in_progress --from-state todo --reason \"...\" [--json]",
|
|
212
212
|
" myte feedback move --feedback-ids \"<id1,id2>\" --to-state in_progress --reason \"...\" [--json]",
|
|
213
|
-
" myte feedback comment --feedback-id <id> --body \"...\" [--body-file ./comment.md] [--json]",
|
|
213
|
+
" myte feedback comment --feedback-id <id> --body \"...\" [--body-file ./comment.md] --confirm-write --approval-artifact <path> [--json]",
|
|
214
214
|
" myte feedback undo --feedback-id <id> --event-id <id> --reason \"...\" [--json]",
|
|
215
215
|
" myte feedback prd-versions --feedback-id <id> [--json]",
|
|
216
216
|
" myte feedback prd-diff --feedback-id <id> --version-id <id> [--compare-to <id>] [--json]",
|
|
217
217
|
" myte feedback validate --file ./MyteCommandCenter/reviews/feedback/<id>-status.yml [--json]",
|
|
218
218
|
" myte feedback apply --file ./MyteCommandCenter/reviews/feedback/<id>-status.yml [--json]",
|
|
219
|
-
" myte create-prd <file.md> [more.md ...] [--json] [--title \"...\"] [--description \"...\"]",
|
|
220
|
-
" cat file.md | myte create-prd --stdin [--title \"...\"] [--description \"...\"]",
|
|
221
|
-
" cat update.md | myte update-owner --stdin --subject \"Owner update\"",
|
|
222
|
-
" cat update.md | myte update-client --stdin --subject \"Weekly client update\"",
|
|
219
|
+
" myte create-prd <file.md> [more.md ...] --confirm-write --approval-artifact <path> [--json] [--title \"...\"] [--description \"...\"]",
|
|
220
|
+
" cat file.md | myte create-prd --stdin --confirm-write --approval-artifact <path> [--title \"...\"] [--description \"...\"]",
|
|
221
|
+
" cat update.md | myte update-owner --stdin --subject \"Owner update\" --confirm-write --approval-artifact ./update.md",
|
|
222
|
+
" cat update.md | myte update-client --stdin --subject \"Weekly client update\" --confirm-write --approval-artifact ./update.md",
|
|
223
223
|
"",
|
|
224
224
|
"Run forms:",
|
|
225
225
|
" npm install myte then npx myte query \"...\" --with-diff",
|
|
@@ -328,11 +328,23 @@ function printHelp() {
|
|
|
328
328
|
" - project-key API/CLI cannot unarchive archived Feedback; use the web archived Feedback view",
|
|
329
329
|
" - get/history read current feedback snapshots and audited event history through the project-key API",
|
|
330
330
|
" - prd-versions/prd-diff expose retained PRD versions and backend-generated text diffs",
|
|
331
|
-
" - validate/apply send artifacts to /api/project-assistant/feedback/<id>/refinement/* for validation or owner-direct apply",
|
|
332
|
-
" - The backend owns authorization, stale snapshot checks, allowed field/transition rules, and history",
|
|
333
|
-
" - apply is idempotent and does not rewrite local feedback.yml; run feedback-sync after apply to refresh local state",
|
|
334
|
-
"",
|
|
335
|
-
"
|
|
331
|
+
" - validate/apply send artifacts to /api/project-assistant/feedback/<id>/refinement/* for validation or owner-direct apply",
|
|
332
|
+
" - The backend owns authorization, stale snapshot checks, allowed field/transition rules, and history",
|
|
333
|
+
" - apply is idempotent and does not rewrite local feedback.yml; run feedback-sync after apply to refresh local state",
|
|
334
|
+
"",
|
|
335
|
+
"approval artifact requirements:",
|
|
336
|
+
" - Required: create-prd, update-team, update-owner, update-client, feedback submit/revise/comment, suggestions create/revise",
|
|
337
|
+
" - Not required: run-qaqc, mission status/archive, suggestions review, feedback review/move/undo/apply",
|
|
338
|
+
" - Never required: read/sync/query/validate commands, --print-context, --dry-run, and feedback local draft commands",
|
|
339
|
+
" - For required actions, prepare a .md/.markdown/.yml/.yaml/.json artifact, show it to the user, then rerun with --confirm-write --approval-artifact <path>",
|
|
340
|
+
" - In plain language, the artifact is the human-reviewed record of the exact write the agent is about to send; it is not a permission grant and does not bypass owner/delegate checks, idempotency, stale-state guards, validation, or audit",
|
|
341
|
+
" - Minimum artifact contents: exact command; every target id or PRD item; complete proposed-change summary; reason/approval note; batch_count when one command sends multiple items",
|
|
342
|
+
" - Mission edit/create batches use suggestions create/revise and must enumerate each item: update items include change_type: update, mission_id, and changed fields; create items include change_type: create, title, description, and acceptance details; revisions include suggestion_id and expected_revision",
|
|
343
|
+
" - PRD batches use one create-prd fileA.md fileB.md ...; list each PRD file/title/client_ref and make batch_count match the number of PRDs",
|
|
344
|
+
" - Feedback submit/revise/comment artifacts are usually the same YAML/markdown file being submitted; for inline text or stdin, use an approval memo with feedback_id/request_id and exact content",
|
|
345
|
+
" - Team, owner, and client update artifacts should name the audience and include the exact message body or complete summary; client updates should include target contact ids when used",
|
|
346
|
+
"",
|
|
347
|
+
"feedback action map:",
|
|
336
348
|
" - feedback-sync: pull board/PRD context into MyteCommandCenter for IDE work",
|
|
337
349
|
" - get: read one feedback item's current server snapshot and snapshot_hash",
|
|
338
350
|
" - status/edit/assign/archive/refine: create reviewable local YAML artifacts; no live mutation",
|
|
@@ -392,8 +404,10 @@ function printHelp() {
|
|
|
392
404
|
" --no-with-prd-text Skip PRD text download and write only feedback metadata/comment turns",
|
|
393
405
|
" --mission-ids <ids> Comma-separated mission business ids for run-qaqc, mission status, or mission archive (quote multi-id values on PowerShell)",
|
|
394
406
|
" --reason <text> Optional reason for governed mission archive or feedback changes",
|
|
395
|
-
" --actor-scope <id> Actor workspace key inside mission-ops.yml (defaults to machine-cwd slug)",
|
|
396
|
-
" --
|
|
407
|
+
" --actor-scope <id> Actor workspace key inside mission-ops.yml (defaults to machine-cwd slug)",
|
|
408
|
+
" --confirm-write Attach approval metadata for commands that require an approval artifact",
|
|
409
|
+
" --approval-artifact Local .md/.markdown/.yml/.yaml/.json approval artifact for gated write commands",
|
|
410
|
+
" --wait Poll batch status until terminal completion for run-qaqc",
|
|
397
411
|
" --sync After run-qaqc completes, refresh local QAQC file",
|
|
398
412
|
" --force Allow run-qaqc to bypass stale-state protection when supported",
|
|
399
413
|
" --no-sync Skip automatic post-mutation sync for suggestions, missions, and feedback mutations",
|
|
@@ -406,33 +420,33 @@ function printHelp() {
|
|
|
406
420
|
" myte ai \"Return a JSON object with risks and next_steps\" --json-response",
|
|
407
421
|
" myte bootstrap",
|
|
408
422
|
" myte suggestions sync",
|
|
409
|
-
" myte suggestions create",
|
|
410
|
-
" myte suggestions revise --no-sync",
|
|
423
|
+
" myte suggestions create --file ./suggestions/create.yml --confirm-write --approval-artifact ./suggestions/create.yml",
|
|
424
|
+
" myte suggestions revise --file ./suggestions/revise.yml --confirm-write --approval-artifact ./suggestions/revise.yml --no-sync",
|
|
411
425
|
" myte suggestions review --file ./review.yml",
|
|
412
426
|
" myte run-qaqc --mission-ids \"M001,M002\" --wait --sync",
|
|
413
427
|
" myte mission status --mission-ids \"M001,M002\" --status done",
|
|
414
428
|
" myte mission archive --mission-ids \"M001\" --reason \"Duplicate disposable test mission\"",
|
|
415
429
|
" myte bootstrap --output-dir ./MyteCommandCenter",
|
|
416
430
|
" myte sync-qaqc",
|
|
417
|
-
" myte update-team \"Backend deploy completed; QAQC rerun queued.\"",
|
|
418
|
-
" myte update-owner --subject \"QAQC progress\" --body-file ./updates/owner.md",
|
|
419
|
-
" myte update-client --subject \"Weekly client update\" --body-file ./updates/week-12.md",
|
|
431
|
+
" myte update-team \"Backend deploy completed; QAQC rerun queued.\" --confirm-write --approval-artifact ./updates/team.md",
|
|
432
|
+
" myte update-owner --subject \"QAQC progress\" --body-file ./updates/owner.md --confirm-write --approval-artifact ./updates/owner.md",
|
|
433
|
+
" myte update-client --subject \"Weekly client update\" --body-file ./updates/week-12.md --confirm-write --approval-artifact ./updates/week-12.md",
|
|
420
434
|
" myte feedback-sync --json",
|
|
421
435
|
" myte feedback status --feedback-id 507f1f77bcf86cd799439011 --status in_review --reason \"Ready for owner review\"",
|
|
422
|
-
" myte feedback submit --file ./MyteCommandCenter/reviews/feedback/507f1f77bcf86cd799439011-edit.yml --json",
|
|
436
|
+
" myte feedback submit --file ./MyteCommandCenter/reviews/feedback/507f1f77bcf86cd799439011-edit.yml --confirm-write --approval-artifact ./MyteCommandCenter/reviews/feedback/507f1f77bcf86cd799439011-edit.yml --json",
|
|
423
437
|
" myte feedback reviews --status open --json",
|
|
424
438
|
" myte feedback review --request-id 507f1f77bcf86cd799439022 --action approve --reason \"Looks correct\" --json",
|
|
425
439
|
" myte feedback move --feedback-id 507f1f77bcf86cd799439011 --to-state in_progress --reason \"Started\" --json",
|
|
426
|
-
" myte feedback comment --feedback-id 507f1f77bcf86cd799439011 --body
|
|
440
|
+
" myte feedback comment --feedback-id 507f1f77bcf86cd799439011 --body-file ./comments/implementation.md --confirm-write --approval-artifact ./comments/implementation.md --json",
|
|
427
441
|
" myte feedback validate --file ./MyteCommandCenter/reviews/feedback/507f1f77bcf86cd799439011-status.yml --json",
|
|
428
442
|
" myte feedback apply --file ./MyteCommandCenter/reviews/feedback/507f1f77bcf86cd799439011-status.yml --json",
|
|
429
|
-
" myte suggestions create --file ./suggestions/create.yml",
|
|
430
|
-
" myte suggestions revise",
|
|
443
|
+
" myte suggestions create --file ./suggestions/create.yml --confirm-write --approval-artifact ./suggestions/create.yml",
|
|
444
|
+
" myte suggestions revise --file ./suggestions/revise.yml --confirm-write --approval-artifact ./suggestions/revise.yml",
|
|
431
445
|
" myte suggestions review",
|
|
432
|
-
" myte update-client --subject \"Weekly client update\" --body-markdown \"## Progress\\n- Login complete\" --target-contact-ids 507f1f77bcf86cd799439011,507f1f77bcf86cd799439012",
|
|
433
|
-
" myte create-prd ./drafts/auth-prd.md --description \"Short card summary\"",
|
|
434
|
-
" myte create-prd ./drafts/auth-prd.md ./drafts/billing-prd.md",
|
|
435
|
-
" cat ./drafts/auth-prd.md | myte create-prd --stdin",
|
|
446
|
+
" myte update-client --subject \"Weekly client update\" --body-markdown \"## Progress\\n- Login complete\" --target-contact-ids 507f1f77bcf86cd799439011,507f1f77bcf86cd799439012 --confirm-write --approval-artifact ./updates/week-12.md",
|
|
447
|
+
" myte create-prd ./drafts/auth-prd.md --description \"Short card summary\" --confirm-write --approval-artifact ./drafts/auth-prd.md",
|
|
448
|
+
" myte create-prd ./drafts/auth-prd.md ./drafts/billing-prd.md --confirm-write --approval-artifact ./drafts/prd-batch.md",
|
|
449
|
+
" cat ./drafts/auth-prd.md | myte create-prd --stdin --confirm-write --approval-artifact ./drafts/auth-prd.md",
|
|
436
450
|
" myte config",
|
|
437
451
|
].join("\n");
|
|
438
452
|
console.log(text);
|
|
@@ -2355,11 +2369,6 @@ async function runRunQaqc(args) {
|
|
|
2355
2369
|
};
|
|
2356
2370
|
const clientSessionId = firstNonEmptyString(args["client-session-id"], args.clientSessionId, args.client_session_id);
|
|
2357
2371
|
if (clientSessionId) payload.client_session_id = clientSessionId;
|
|
2358
|
-
payload = withWriteApproval(args, payload, {
|
|
2359
|
-
artifactKind: "yaml",
|
|
2360
|
-
targets: missionIds,
|
|
2361
|
-
batchCount: missionIds.length > 1 ? missionIds.length : null,
|
|
2362
|
-
});
|
|
2363
2372
|
const idempotencyKey = resolveProjectMutationIdempotencyKey({
|
|
2364
2373
|
args,
|
|
2365
2374
|
operation: "run-qaqc",
|
|
@@ -2515,11 +2524,6 @@ async function runMissionStatus(args) {
|
|
|
2515
2524
|
};
|
|
2516
2525
|
const clientSessionId = firstNonEmptyString(args["client-session-id"], args.clientSessionId, args.client_session_id);
|
|
2517
2526
|
if (clientSessionId) payload.client_session_id = clientSessionId;
|
|
2518
|
-
payload = withWriteApproval(args, payload, {
|
|
2519
|
-
artifactKind: "yaml",
|
|
2520
|
-
targets: missionIds,
|
|
2521
|
-
batchCount: missionIds.length > 1 ? missionIds.length : null,
|
|
2522
|
-
});
|
|
2523
2527
|
const idempotencyKey = resolveProjectMutationIdempotencyKey({
|
|
2524
2528
|
args,
|
|
2525
2529
|
operation: "mission-status-update",
|
|
@@ -2624,15 +2628,9 @@ async function runMissionArchiveCommand(args) {
|
|
|
2624
2628
|
if (reason) payload.reason = reason;
|
|
2625
2629
|
const clientSessionId = firstNonEmptyString(args["client-session-id"], args.clientSessionId, args.client_session_id);
|
|
2626
2630
|
if (clientSessionId) payload.client_session_id = clientSessionId;
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
batchCount: missionIds.length > 1 ? missionIds.length : null,
|
|
2631
|
-
});
|
|
2632
|
-
|
|
2633
|
-
const operation = "mission-archive";
|
|
2634
|
-
const idempotencyKey = resolveProjectMutationIdempotencyKey({
|
|
2635
|
-
args,
|
|
2631
|
+
const operation = "mission-archive";
|
|
2632
|
+
const idempotencyKey = resolveProjectMutationIdempotencyKey({
|
|
2633
|
+
args,
|
|
2636
2634
|
operation,
|
|
2637
2635
|
payload,
|
|
2638
2636
|
});
|
|
@@ -3099,7 +3097,7 @@ function resolveWriteApprovalArtifact(args) {
|
|
|
3099
3097
|
}
|
|
3100
3098
|
const ext = path.extname(absPath).toLowerCase();
|
|
3101
3099
|
if (![".md", ".markdown", ".yml", ".yaml", ".json"].includes(ext)) {
|
|
3102
|
-
console.error("Approval artifact must be a local .md, .yml, .yaml, or .json file.");
|
|
3100
|
+
console.error("Approval artifact must be a local .md, .markdown, .yml, .yaml, or .json file.");
|
|
3103
3101
|
process.exit(1);
|
|
3104
3102
|
}
|
|
3105
3103
|
return { displayPath: String(artifactPath), absPath };
|
|
@@ -3109,8 +3107,20 @@ function approvalTargets(values) {
|
|
|
3109
3107
|
return uniqueNormalizedStrings(Array.isArray(values) ? values : [values]);
|
|
3110
3108
|
}
|
|
3111
3109
|
|
|
3112
|
-
function
|
|
3110
|
+
function hasWriteApprovalArtifactArg(args) {
|
|
3111
|
+
return Boolean(firstNonEmptyString(
|
|
3112
|
+
args["approval-artifact"],
|
|
3113
|
+
args.approvalArtifact,
|
|
3114
|
+
args.approval_artifact
|
|
3115
|
+
));
|
|
3116
|
+
}
|
|
3117
|
+
|
|
3118
|
+
function withWriteApproval(args, payload, { artifactKind = "yaml", targets = [], batchCount = null, required = true } = {}) {
|
|
3113
3119
|
const confirmed = Boolean(args["confirm-write"] || args.confirmWrite || args.confirm_write);
|
|
3120
|
+
if (required && (!confirmed || !hasWriteApprovalArtifactArg(args))) {
|
|
3121
|
+
console.error("Missing --confirm-write --approval-artifact <path> for this live Myte write.");
|
|
3122
|
+
process.exit(1);
|
|
3123
|
+
}
|
|
3114
3124
|
if (!confirmed) return payload;
|
|
3115
3125
|
const { displayPath } = resolveWriteApprovalArtifact(args);
|
|
3116
3126
|
const nextPayload = { ...(payload || {}) };
|
|
@@ -3416,19 +3426,123 @@ function resolvePortableWorkspace(repoNames) {
|
|
|
3416
3426
|
};
|
|
3417
3427
|
}
|
|
3418
3428
|
|
|
3419
|
-
function resolveCommandCenterRoots(wrapperRoot, outputDir) {
|
|
3420
|
-
const targetRoot = outputDir
|
|
3421
|
-
? path.resolve(process.cwd(), String(outputDir))
|
|
3422
|
-
: path.join(wrapperRoot, "MyteCommandCenter");
|
|
3423
|
-
return {
|
|
3424
|
-
targetRoot,
|
|
3425
|
-
dataRoot: path.join(targetRoot, "data"),
|
|
3426
|
-
};
|
|
3427
|
-
}
|
|
3428
|
-
|
|
3429
|
-
function
|
|
3430
|
-
|
|
3431
|
-
|
|
3429
|
+
function resolveCommandCenterRoots(wrapperRoot, outputDir) {
|
|
3430
|
+
const targetRoot = outputDir
|
|
3431
|
+
? path.resolve(process.cwd(), String(outputDir))
|
|
3432
|
+
: path.join(wrapperRoot, "MyteCommandCenter");
|
|
3433
|
+
return {
|
|
3434
|
+
targetRoot,
|
|
3435
|
+
dataRoot: path.join(targetRoot, "data"),
|
|
3436
|
+
};
|
|
3437
|
+
}
|
|
3438
|
+
|
|
3439
|
+
function buildAgentsMyteApiMarkdown() {
|
|
3440
|
+
return ensureTrailingNewline([
|
|
3441
|
+
"# AgentsMyteAPI",
|
|
3442
|
+
"",
|
|
3443
|
+
"This file is generated by `myte bootstrap` as contextual guidance for coding agents using a project-scoped Myte API key.",
|
|
3444
|
+
"It does not grant permission, approve a write, or replace project authorization. Prefer the `myte` CLI over direct HTTP.",
|
|
3445
|
+
"",
|
|
3446
|
+
"## Auth And Discovery",
|
|
3447
|
+
"",
|
|
3448
|
+
"- Use `MYTE_API_KEY` or `MYTE_PROJECT_API_KEY` for `/api/project-assistant/*`.",
|
|
3449
|
+
"- Default API base: `https://api.myte.dev/api`.",
|
|
3450
|
+
"- Start with `myte config --json`, then `myte bootstrap --json`.",
|
|
3451
|
+
"- Use local IDs from `MyteCommandCenter/data/missions/*.yml`, `data/mission-ops.yml`, and `data/feedback.yml`.",
|
|
3452
|
+
"- `myte ai` is intentionally outside this project-scoped table. It uses `MYTEAI_API_KEY` and the Myte AI gateway, not `/api/project-assistant/*`.",
|
|
3453
|
+
"",
|
|
3454
|
+
"## Approval Artifact Rule",
|
|
3455
|
+
"",
|
|
3456
|
+
"Only the commands marked `required` below need `--confirm-write --approval-artifact <path>`.",
|
|
3457
|
+
"Approval artifacts are local `.md`, `.markdown`, `.yml`, `.yaml`, or `.json` files that list the operation, exact target IDs, proposed change, and batch count when relevant.",
|
|
3458
|
+
"The artifact is the human-reviewed record of the intended mutation. It does not grant permission, bypass owner/delegate checks, or replace idempotency; it gives the API enough evidence that a human approved this exact write payload.",
|
|
3459
|
+
"",
|
|
3460
|
+
"Minimum artifact contents for required actions:",
|
|
3461
|
+
"",
|
|
3462
|
+
"- `command`: the exact CLI command you plan to run.",
|
|
3463
|
+
"- `targets`: every affected project, feedback, request, suggestion, mission, PRD file, client ref, or contact id.",
|
|
3464
|
+
"- `proposed_change`: a complete summary of the text/status/content being sent.",
|
|
3465
|
+
"- `batch_count`: required when the command sends more than one item in one API call.",
|
|
3466
|
+
"- `reason` or `approval_note`: why the write is being sent now.",
|
|
3467
|
+
"",
|
|
3468
|
+
"Batch guidance:",
|
|
3469
|
+
"",
|
|
3470
|
+
"- Mission edit/create batches use `myte suggestions create` or `myte suggestions revise`; the artifact must list each item. For mission edits include `change_type: update`, the existing `mission_id`, and the changed fields. For new missions include `change_type: create`, the proposed title, description, and acceptance details. For revisions include each `suggestion_id` and expected revision.",
|
|
3471
|
+
"- PRD batches use one `myte create-prd fileA.md fileB.md ...`; the artifact must list each PRD file/title/client ref. `batch_count` must match the number of PRD items.",
|
|
3472
|
+
"- Feedback submit/revise/comment artifacts are usually the same YAML or markdown file being submitted. If the command uses inline text or stdin, create a separate approval memo that includes the feedback id or request id and the exact content.",
|
|
3473
|
+
"- Team, owner, and client update artifacts should name the audience and include the exact message body or a complete summary; client updates should include target contact ids when used.",
|
|
3474
|
+
"- `feedback review --request-ids`, `feedback move --feedback-ids`, `mission status --mission-ids`, `mission archive --mission-ids`, and `run-qaqc --mission-ids` are batched governed writes, but they are marked `no` below and should not receive approval artifact flags.",
|
|
3475
|
+
"",
|
|
3476
|
+
"Example approval artifact:",
|
|
3477
|
+
"",
|
|
3478
|
+
"```yaml",
|
|
3479
|
+
"command: myte suggestions create --file ./mission-suggestions.yml --confirm-write --approval-artifact ./mission-suggestions-approval.yml",
|
|
3480
|
+
"reason: Human approved this mission review batch after inspecting the proposed changes.",
|
|
3481
|
+
"batch_count: 2",
|
|
3482
|
+
"targets:",
|
|
3483
|
+
" - mission_id: M093",
|
|
3484
|
+
" change_type: update",
|
|
3485
|
+
" proposed_change: Mark acceptance criteria complete and clarify final QA note.",
|
|
3486
|
+
" - new_mission: Add deployment verification",
|
|
3487
|
+
" change_type: create",
|
|
3488
|
+
" proposed_change: Create a mission to verify deploy logs, smoke test, and rollback note.",
|
|
3489
|
+
"```",
|
|
3490
|
+
"",
|
|
3491
|
+
"| Action | CLI shape | API route | Class | Artifact approval |",
|
|
3492
|
+
"|---|---|---|---|---|",
|
|
3493
|
+
"| Config | `myte config --json` | `GET /project-assistant/config` | read | no |",
|
|
3494
|
+
"| Query | `myte query \"...\" --with-diff` | `POST /project-assistant/query`; polls `GET /project-assistant/query/<job_id>` when queued; `--with-diff` also reads `GET /project-assistant/config` | query job | no |",
|
|
3495
|
+
"| Bootstrap | `myte bootstrap --json` | `GET /project-assistant/bootstrap` and `GET /project-assistant/suggestions` | local sync | no |",
|
|
3496
|
+
"| QAQC sync | `myte sync-qaqc --json` | `GET /project-assistant/qaqc-sync` | local sync | no |",
|
|
3497
|
+
"| Run QAQC | `myte run-qaqc --mission-ids \"M001,M002\" --wait --sync --json` | `POST /project-assistant/run-qaqc`; `--wait` polls `GET /project-assistant/run-qaqc/<batch_id>`; `--sync` reads `GET /project-assistant/qaqc-sync` | governed write | no |",
|
|
3498
|
+
"| Mission status | `myte mission status --mission-ids \"M001\" --status done --json` | `POST /project-assistant/mission-status-update` | governed write | no |",
|
|
3499
|
+
"| Mission archive | `myte mission archive --mission-ids \"M001\" --reason \"...\" --json` | `POST /project-assistant/mission-archive` | governed write | no |",
|
|
3500
|
+
"| Suggestions sync | `myte suggestions sync --json` | `GET /project-assistant/suggestions` | local sync | no |",
|
|
3501
|
+
"| Suggestions create | `myte suggestions create --file ./create.yml --confirm-write --approval-artifact ./create.yml --json` | `POST /project-assistant/suggestions` | review-thread write | required |",
|
|
3502
|
+
"| Suggestions revise | `myte suggestions revise --file ./revise.yml --confirm-write --approval-artifact ./revise.yml --json` | `POST /project-assistant/suggestions/revise` | review-thread write | required |",
|
|
3503
|
+
"| Suggestions review | `myte suggestions review --file ./review.yml --json` | `POST /project-assistant/suggestions/review` | governed review write | no |",
|
|
3504
|
+
"| Feedback sync | `myte feedback-sync --json` | `GET /project-assistant/feedback-sync` | local sync | no |",
|
|
3505
|
+
"| Feedback get | `myte feedback get --feedback-id <id> --json` | `GET /project-assistant/feedback/<id>` | read | no |",
|
|
3506
|
+
"| Feedback history | `myte feedback history --feedback-id <id> --json` | `GET /project-assistant/feedback/<id>/events` | read | no |",
|
|
3507
|
+
"| Feedback local drafts | `myte feedback status/edit/assign/archive/refine ...` | none | local artifact only | no |",
|
|
3508
|
+
"| Feedback validate | `myte feedback validate --file ./review.yml --json` | `POST /project-assistant/feedback/<id>/refinement/validate` | validation | no |",
|
|
3509
|
+
"| Feedback submit | `myte feedback submit --file ./review.yml --confirm-write --approval-artifact ./review.yml --json` | `POST /project-assistant/feedback/<id>/refinement/requests` | review-request write | required |",
|
|
3510
|
+
"| Feedback revise | `myte feedback revise --request-id <id> --file ./review.yml --confirm-write --approval-artifact ./review.yml --json` | `POST /project-assistant/feedback-review-requests/<id>/revise` | review-request write | required |",
|
|
3511
|
+
"| Feedback reviews | `myte feedback reviews [--status open/terminal/all] [--request-id <id>] --json` (`requests` alias) | `GET /project-assistant/feedback-review-requests` or `GET /project-assistant/feedback-review-requests/<id>` | read | no |",
|
|
3512
|
+
"| Feedback review | `myte feedback review --request-id <id> --action approve/reject/request_changes/cancel [--reason \"...\"] --json` | `POST /project-assistant/feedback-review-requests/<id>/review`, `/request-changes`, or `/cancel` | governed review write | no |",
|
|
3513
|
+
"| Feedback batch review | `myte feedback review --request-ids \"<id1,id2>\" --action approve/reject/request_changes/cancel --json` | `POST /project-assistant/feedback-review-requests/batch-review` | governed review write | no |",
|
|
3514
|
+
"| Feedback move | `myte feedback move --feedback-id <id> --to-state in_progress --reason \"...\" --json` | `POST /project-assistant/feedback/<id>/board-move` | governed write | no |",
|
|
3515
|
+
"| Feedback batch move | `myte feedback move --feedback-ids \"<id1,id2>\" --to-state in_progress --json` | `POST /project-assistant/feedback/batch-board-move` | governed write | no |",
|
|
3516
|
+
"| Feedback comment | `myte feedback comment --feedback-id <id> --body-file ./comment.md --confirm-write --approval-artifact ./comment.md --json` | `POST /project-assistant/feedback/<id>/comments` | comment write | required |",
|
|
3517
|
+
"| Feedback undo | `myte feedback undo --feedback-id <id> --event-id <id> --reason \"...\" --json` | `POST /project-assistant/feedback/<id>/events/<event_id>/undo` | governed write | no |",
|
|
3518
|
+
"| Feedback PRD versions | `myte feedback prd-versions --feedback-id <id> --json` | `GET /project-assistant/feedback/<id>/prd/versions` | read | no |",
|
|
3519
|
+
"| Feedback PRD diff | `myte feedback prd-diff --feedback-id <id> --version-id <id>` | `GET /project-assistant/feedback/<id>/prd/versions/<version_id>/diff` | read | no |",
|
|
3520
|
+
"| Feedback apply | `myte feedback apply --file ./review.yml --json` | `POST /project-assistant/feedback/<id>/refinement/apply` | governed write | no |",
|
|
3521
|
+
"| Create PRD | `myte create-prd ./prd.md --confirm-write --approval-artifact ./prd.md --json` | `POST /project-assistant/create-prd` | PRD write | required |",
|
|
3522
|
+
"| Batch create PRDs | `myte create-prd ./a.md ./b.md --confirm-write --approval-artifact ./approval.md --json` | `POST /project-assistant/create-prds` | PRD write | required |",
|
|
3523
|
+
"| Team update | `myte update-team \"...\" --confirm-write --approval-artifact ./team.md --json` | `POST /project-assistant/project-comment` | project comment | required |",
|
|
3524
|
+
"| Owner update | `myte update-owner --subject \"...\" --body-file ./owner.md --confirm-write --approval-artifact ./owner.md --json` | `POST /project-assistant/update-owner` | owner email | required |",
|
|
3525
|
+
"| Client update | `myte update-client --subject \"...\" --body-file ./client.md --confirm-write --approval-artifact ./client.md --json` | `POST /project-assistant/client-update-drafts` | client draft | required |",
|
|
3526
|
+
"",
|
|
3527
|
+
"## Agent Rules",
|
|
3528
|
+
"",
|
|
3529
|
+
"- For `required` actions, draft the artifact, show it to the user, get explicit approval, then rerun with the approval flags.",
|
|
3530
|
+
"- For `no` actions, do not add approval flags. The API still enforces key binding, project permissions, idempotency, stale-state checks, and route validation.",
|
|
3531
|
+
"- For local draft actions, inspect the generated YAML before submitting or applying it.",
|
|
3532
|
+
"- Use `--print-context` or `--dry-run` where available to inspect payloads without sending a write.",
|
|
3533
|
+
].join("\n"));
|
|
3534
|
+
}
|
|
3535
|
+
|
|
3536
|
+
function writeAgentsMyteApiGuide({ wrapperRoot, outputDir }) {
|
|
3537
|
+
const { targetRoot } = resolveCommandCenterRoots(wrapperRoot, outputDir);
|
|
3538
|
+
const guidePath = path.join(targetRoot, "AgentsMyteAPI.md");
|
|
3539
|
+
writeTextFile(guidePath, buildAgentsMyteApiMarkdown());
|
|
3540
|
+
return guidePath;
|
|
3541
|
+
}
|
|
3542
|
+
|
|
3543
|
+
function pruneLegacyCommandCenterArtifacts(dataRoot, options = {}) {
|
|
3544
|
+
const {
|
|
3545
|
+
bootstrap = false,
|
|
3432
3546
|
qaqc = false,
|
|
3433
3547
|
feedback = false,
|
|
3434
3548
|
missionOps = false,
|
|
@@ -3506,11 +3620,12 @@ function writeBootstrapSnapshot({ snapshot, wrapperRoot, outputDir }) {
|
|
|
3506
3620
|
writeYamlFile(path.join(missionsDir, `${missionPathId}.yml`), mission);
|
|
3507
3621
|
});
|
|
3508
3622
|
|
|
3509
|
-
if (snapshot.project && typeof snapshot.project === "object") {
|
|
3510
|
-
writeYamlFile(path.join(dataRoot, "project.yml"), scrubBootstrapValue(snapshot.project));
|
|
3511
|
-
}
|
|
3512
|
-
|
|
3513
|
-
|
|
3623
|
+
if (snapshot.project && typeof snapshot.project === "object") {
|
|
3624
|
+
writeYamlFile(path.join(dataRoot, "project.yml"), scrubBootstrapValue(snapshot.project));
|
|
3625
|
+
}
|
|
3626
|
+
const agentsMyteApiPath = writeAgentsMyteApiGuide({ wrapperRoot, outputDir });
|
|
3627
|
+
|
|
3628
|
+
const manifest = {
|
|
3514
3629
|
schema_version: snapshot.schema_version || 1,
|
|
3515
3630
|
generated_at: snapshot.generated_at || null,
|
|
3516
3631
|
snapshot_hash: snapshot.snapshot_hash || null,
|
|
@@ -3523,12 +3638,13 @@ function writeBootstrapSnapshot({ snapshot, wrapperRoot, outputDir }) {
|
|
|
3523
3638
|
missions: missions.length,
|
|
3524
3639
|
},
|
|
3525
3640
|
};
|
|
3526
|
-
return {
|
|
3527
|
-
targetRoot,
|
|
3528
|
-
dataRoot,
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
}
|
|
3641
|
+
return {
|
|
3642
|
+
targetRoot,
|
|
3643
|
+
dataRoot,
|
|
3644
|
+
agentsMyteApiPath,
|
|
3645
|
+
manifest,
|
|
3646
|
+
};
|
|
3647
|
+
}
|
|
3532
3648
|
|
|
3533
3649
|
function writeQaqcSnapshot({ snapshot, wrapperRoot, outputDir }) {
|
|
3534
3650
|
const { targetRoot, dataRoot } = resolveCommandCenterRoots(wrapperRoot, outputDir);
|
|
@@ -4821,10 +4937,11 @@ async function runBootstrap(args) {
|
|
|
4821
4937
|
return;
|
|
4822
4938
|
}
|
|
4823
4939
|
|
|
4824
|
-
const writeResult = writeBootstrapSnapshot({ snapshot, wrapperRoot, outputDir });
|
|
4825
|
-
summary.data_root = writeResult.dataRoot;
|
|
4826
|
-
|
|
4827
|
-
|
|
4940
|
+
const writeResult = writeBootstrapSnapshot({ snapshot, wrapperRoot, outputDir });
|
|
4941
|
+
summary.data_root = writeResult.dataRoot;
|
|
4942
|
+
summary.agents_myte_api_path = writeResult.agentsMyteApiPath;
|
|
4943
|
+
|
|
4944
|
+
if (includeSuggestions) {
|
|
4828
4945
|
let missionOpsSnapshot;
|
|
4829
4946
|
try {
|
|
4830
4947
|
missionOpsSnapshot = await fetchSuggestionsSyncSnapshot({ apiBase, key, timeoutMs, actorScope });
|
|
@@ -4855,9 +4972,10 @@ async function runBootstrap(args) {
|
|
|
4855
4972
|
console.log(`Output root: ${summary.output_root}`);
|
|
4856
4973
|
console.log(`Configured repos: ${summary.repo_names.join(", ") || "(none)"}`);
|
|
4857
4974
|
console.log(`Found locally: ${summary.local.found.join(", ") || "(none)"}`);
|
|
4858
|
-
if (summary.local.missing.length) console.log(`Missing locally: ${summary.local.missing.join(", ")}`);
|
|
4859
|
-
console.log(`Wrote: phases=${summary.counts.phases}, epics=${summary.counts.epics}, stories=${summary.counts.stories}, missions=${summary.counts.missions}`);
|
|
4860
|
-
if (summary.
|
|
4975
|
+
if (summary.local.missing.length) console.log(`Missing locally: ${summary.local.missing.join(", ")}`);
|
|
4976
|
+
console.log(`Wrote: phases=${summary.counts.phases}, epics=${summary.counts.epics}, stories=${summary.counts.stories}, missions=${summary.counts.missions}`);
|
|
4977
|
+
if (summary.agents_myte_api_path) console.log(`Wrote AgentsMyteAPI: ${summary.agents_myte_api_path}`);
|
|
4978
|
+
if (summary.mission_ops?.included) {
|
|
4861
4979
|
console.log(`Wrote mission ops: total_threads=${summary.mission_ops.total_threads}, actionable_threads=${summary.mission_ops.actionable_threads}`);
|
|
4862
4980
|
} else {
|
|
4863
4981
|
console.log("Skipped mission ops sync.");
|
|
@@ -5210,15 +5328,9 @@ async function runFeedbackValidateOrApply(args, mode) {
|
|
|
5210
5328
|
args.client_session_id,
|
|
5211
5329
|
payload.client_session_id
|
|
5212
5330
|
);
|
|
5213
|
-
if (mode === "apply") {
|
|
5214
|
-
payload = withWriteApproval(args, payload, {
|
|
5215
|
-
artifactKind: "yaml",
|
|
5216
|
-
targets: [feedbackId],
|
|
5217
|
-
});
|
|
5218
|
-
}
|
|
5219
5331
|
const idempotencyKey = mode === "apply"
|
|
5220
|
-
? resolveProjectMutationIdempotencyKey({
|
|
5221
|
-
args,
|
|
5332
|
+
? resolveProjectMutationIdempotencyKey({
|
|
5333
|
+
args,
|
|
5222
5334
|
operation: `feedback_refinement_apply:${feedbackId}`,
|
|
5223
5335
|
payload,
|
|
5224
5336
|
})
|
|
@@ -5576,13 +5688,8 @@ async function runFeedbackReviewDecision(args) {
|
|
|
5576
5688
|
action,
|
|
5577
5689
|
reason: reason || undefined,
|
|
5578
5690
|
};
|
|
5579
|
-
payload = withWriteApproval(args, payload, {
|
|
5580
|
-
artifactKind: "yaml",
|
|
5581
|
-
targets: items.map((item) => item.request_id || item.id).filter(Boolean),
|
|
5582
|
-
batchCount: items.length,
|
|
5583
|
-
});
|
|
5584
5691
|
const timeoutMs = resolveTimeoutMs(args);
|
|
5585
|
-
const apiBase = resolveApiBase(args);
|
|
5692
|
+
const apiBase = resolveApiBase(args);
|
|
5586
5693
|
const clientSessionId = firstNonEmptyString(args["client-session-id"], args.clientSessionId, args.client_session_id, payload.client_session_id);
|
|
5587
5694
|
const idempotencyKey = resolveProjectMutationIdempotencyKey({
|
|
5588
5695
|
args,
|
|
@@ -5639,12 +5746,8 @@ async function runFeedbackReviewDecision(args) {
|
|
|
5639
5746
|
process.exit(1);
|
|
5640
5747
|
}
|
|
5641
5748
|
const endpointAction = action === "request_changes" ? "request-changes" : action === "cancel" ? "cancel" : "review";
|
|
5642
|
-
payload = withWriteApproval(args, payload, {
|
|
5643
|
-
artifactKind: "yaml",
|
|
5644
|
-
targets: [requestId],
|
|
5645
|
-
});
|
|
5646
5749
|
const timeoutMs = resolveTimeoutMs(args);
|
|
5647
|
-
const apiBase = resolveApiBase(args);
|
|
5750
|
+
const apiBase = resolveApiBase(args);
|
|
5648
5751
|
const clientSessionId = firstNonEmptyString(args["client-session-id"], args.clientSessionId, args.client_session_id, payload.client_session_id);
|
|
5649
5752
|
const operationAction = action === "request_changes" ? "request_changes" : action;
|
|
5650
5753
|
const idempotencyKey = resolveProjectMutationIdempotencyKey({
|
|
@@ -5717,14 +5820,9 @@ async function runFeedbackMove(args) {
|
|
|
5717
5820
|
}
|
|
5718
5821
|
const batchId = firstNonEmptyString(args["batch-id"], args.batchId, args.batch_id);
|
|
5719
5822
|
if (batchId) payload.batch_id = batchId;
|
|
5720
|
-
payload = withWriteApproval(args, payload, {
|
|
5721
|
-
artifactKind: "yaml",
|
|
5722
|
-
targets: feedbackIds,
|
|
5723
|
-
batchCount: feedbackIds.length,
|
|
5724
|
-
});
|
|
5725
5823
|
const idempotencyKey = resolveProjectMutationIdempotencyKey({
|
|
5726
|
-
args,
|
|
5727
|
-
operation: `feedback_board_batch_move:${toState}:${feedbackIds.join(",")}`,
|
|
5824
|
+
args,
|
|
5825
|
+
operation: `feedback_board_batch_move:${toState}:${feedbackIds.join(",")}`,
|
|
5728
5826
|
payload,
|
|
5729
5827
|
});
|
|
5730
5828
|
let data;
|
|
@@ -5758,13 +5856,9 @@ async function runFeedbackMove(args) {
|
|
|
5758
5856
|
}
|
|
5759
5857
|
|
|
5760
5858
|
payload.from_state = fromState;
|
|
5761
|
-
payload = withWriteApproval(args, payload, {
|
|
5762
|
-
artifactKind: "yaml",
|
|
5763
|
-
targets: [feedbackId],
|
|
5764
|
-
});
|
|
5765
5859
|
const idempotencyKey = resolveProjectMutationIdempotencyKey({
|
|
5766
|
-
args,
|
|
5767
|
-
operation: `feedback_board_move:${feedbackId}`,
|
|
5860
|
+
args,
|
|
5861
|
+
operation: `feedback_board_move:${feedbackId}`,
|
|
5768
5862
|
payload,
|
|
5769
5863
|
});
|
|
5770
5864
|
|
|
@@ -5901,13 +5995,9 @@ async function runFeedbackUndo(args) {
|
|
|
5901
5995
|
const timeoutMs = resolveTimeoutMs(args);
|
|
5902
5996
|
const apiBase = resolveApiBase(args);
|
|
5903
5997
|
const clientSessionId = firstNonEmptyString(args["client-session-id"], args.clientSessionId, args.client_session_id);
|
|
5904
|
-
payload = withWriteApproval(args, payload, {
|
|
5905
|
-
artifactKind: "yaml",
|
|
5906
|
-
targets: [feedbackId, eventId],
|
|
5907
|
-
});
|
|
5908
5998
|
const idempotencyKey = resolveProjectMutationIdempotencyKey({
|
|
5909
|
-
args,
|
|
5910
|
-
operation: `feedback_event_undo:${feedbackId}:${eventId}`,
|
|
5999
|
+
args,
|
|
6000
|
+
operation: `feedback_event_undo:${feedbackId}:${eventId}`,
|
|
5911
6001
|
payload,
|
|
5912
6002
|
});
|
|
5913
6003
|
|
|
@@ -6213,11 +6303,13 @@ async function buildSuggestionsMutationContext(args, mode) {
|
|
|
6213
6303
|
validateSuggestionsRevisePayload(payload);
|
|
6214
6304
|
}
|
|
6215
6305
|
const items = Array.isArray(payload?.items) ? payload.items : [];
|
|
6216
|
-
|
|
6217
|
-
|
|
6218
|
-
|
|
6219
|
-
|
|
6220
|
-
|
|
6306
|
+
if (mode === "create" || mode === "revise") {
|
|
6307
|
+
payload = withWriteApproval(args, payload, {
|
|
6308
|
+
artifactKind: "yaml",
|
|
6309
|
+
targets: suggestionWriteTargets(items),
|
|
6310
|
+
batchCount: items.length > 1 ? items.length : null,
|
|
6311
|
+
});
|
|
6312
|
+
}
|
|
6221
6313
|
const idempotencyKey = resolveSuggestionsIdempotencyKey({
|
|
6222
6314
|
args,
|
|
6223
6315
|
mode,
|