Skip to content

Commit d09d418

Browse files
authored
feat(mcp): Prefab UI parity for the 3 remaining mutations (#46)
Brings add_order_comment, update_order_due_date, and bulk_update_order_status into the find/view/decide/mutate Prefab UI cluster from #20. Each gets: - Typed Pydantic preview schema (CommentPreview / DueDateChangePreview / BulkStatusChangePreview) replacing the ad-hoc dict[str, Any] previews - Typed Pydantic result schema with confirmed: bool to accurately represent the user-declined elicitation path - Prefab UI builder rendering the find/view/decide/mutate card shape consistent with update_order_status - Markdown templates (preview + result) for non-Prefab clients Bug fix included: all four result schemas (StatusChangeResult plus the three new ones) had `confirmed: Literal[True]` that contradicted their use on the user-declined path. Now `confirmed: bool` with declined-path constructors passing False explicitly. Test added pinning the contract. Closes #39.
1 parent 0b67bdd commit d09d418

11 files changed

Lines changed: 774 additions & 59 deletions

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Preview: bulk status change ({order_count} orders)
2+
3+
**Target status:** {target_status_name} ({target_status_code})
4+
5+
**Order IDs:** {ids_preview}
6+
7+
{comment_block}
8+
9+
Emails: {recipients}
10+
11+
Rerun with `confirm=true` to bulk-update all {order_count} orders.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Bulk status change ({order_count} orders)
2+
3+
- **Target status:** {target_status_code}
4+
- **Result:** {outcome}
5+
- **HTTP:** {http_status}{note_line}{message_line}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Preview: comment on order {order_id}
2+
3+
**Order:** {order_label}
4+
5+
**Comment** ({visibility}): {comment}
6+
7+
Rerun with `confirm=true` to add the comment.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Comment on order {order_id}
2+
3+
- **Result:** {outcome}
4+
- **HTTP:** {http_status}{message_line}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Preview: due date for order {order_id}
2+
3+
**Order:** {order_label}
4+
5+
**Current:** {current_due_date}{current_range}
6+
**Proposed:** {new_due_date}{new_range}
7+
8+
Rerun with `confirm=true` to apply the due date change.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Due date change for order {order_id}
2+
3+
- **New due date:** {new_due_date}{new_range}
4+
- **Result:** {outcome}
5+
- **HTTP:** {http_status}{message_line}

0 commit comments

Comments
 (0)