makea-cli 0.2.16__tar.gz → 0.2.18__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. {makea_cli-0.2.16 → makea_cli-0.2.18}/CHANGELOG.md +36 -0
  2. {makea_cli-0.2.16 → makea_cli-0.2.18}/PKG-INFO +12 -1
  3. {makea_cli-0.2.16 → makea_cli-0.2.18}/README.md +11 -0
  4. makea_cli-0.2.18/makea_cli/__init__.py +1 -0
  5. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea_cli/api_client.py +108 -0
  6. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea_cli/commands/__init__.py +2 -0
  7. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea_cli/commands/playbook/cmd.py +65 -0
  8. makea_cli-0.2.18/makea_cli/commands/shipping/__init__.py +0 -0
  9. makea_cli-0.2.18/makea_cli/commands/shipping/cmd.py +422 -0
  10. {makea_cli-0.2.16 → makea_cli-0.2.18}/pyproject.toml +1 -1
  11. {makea_cli-0.2.16 → makea_cli-0.2.18}/tests/golden_manifest.json +827 -15
  12. {makea_cli-0.2.16 → makea_cli-0.2.18}/tests/test_persona_commands.py +29 -0
  13. {makea_cli-0.2.16 → makea_cli-0.2.18}/uv.lock +1 -1
  14. makea_cli-0.2.16/makea_cli/__init__.py +0 -1
  15. {makea_cli-0.2.16 → makea_cli-0.2.18}/.claude/skills/create-supplier-profile/SKILL.md +0 -0
  16. {makea_cli-0.2.16 → makea_cli-0.2.18}/.claude/skills/lark-cli-setup/SKILL.md +0 -0
  17. {makea_cli-0.2.16 → makea_cli-0.2.18}/.claude/skills/link-supplier-user/SKILL.md +0 -0
  18. {makea_cli-0.2.16 → makea_cli-0.2.18}/.claude/skills/makea-cli-setup/SKILL.md +0 -0
  19. {makea_cli-0.2.16 → makea_cli-0.2.18}/.claude/skills/payment-revenue-report/SKILL.md +0 -0
  20. {makea_cli-0.2.16 → makea_cli-0.2.18}/.claude/skills/supplier-user-id-migration/SKILL.md +0 -0
  21. {makea_cli-0.2.16 → makea_cli-0.2.18}/.gitignore +0 -0
  22. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea-collection-upload/SKILL.md +0 -0
  23. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea-collection-upload/scripts/create_products.py +0 -0
  24. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea_cli/__main__.py +0 -0
  25. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea_cli/auth_pkce.py +0 -0
  26. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea_cli/broker.py +0 -0
  27. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea_cli/commands/_util.py +0 -0
  28. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea_cli/commands/analytics/__init__.py +0 -0
  29. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea_cli/commands/analytics/cmd.py +0 -0
  30. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea_cli/commands/auth/__init__.py +0 -0
  31. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea_cli/commands/auth/cmd.py +0 -0
  32. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea_cli/commands/brand/__init__.py +0 -0
  33. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea_cli/commands/brand/cmd.py +0 -0
  34. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea_cli/commands/designer/__init__.py +0 -0
  35. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea_cli/commands/designer/cmd.py +0 -0
  36. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea_cli/commands/directory/__init__.py +0 -0
  37. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea_cli/commands/directory/cmd.py +0 -0
  38. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea_cli/commands/document/__init__.py +0 -0
  39. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea_cli/commands/document/cmd.py +0 -0
  40. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea_cli/commands/email/__init__.py +0 -0
  41. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea_cli/commands/email/cmd.py +0 -0
  42. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea_cli/commands/factory/__init__.py +0 -0
  43. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea_cli/commands/factory/cmd.py +0 -0
  44. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea_cli/commands/library/__init__.py +0 -0
  45. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea_cli/commands/library/cmd.py +0 -0
  46. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea_cli/commands/metrics/__init__.py +0 -0
  47. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea_cli/commands/metrics/cmd.py +0 -0
  48. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea_cli/commands/orders/__init__.py +0 -0
  49. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea_cli/commands/orders/cmd.py +0 -0
  50. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea_cli/commands/playbook/__init__.py +0 -0
  51. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea_cli/commands/product/__init__.py +0 -0
  52. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea_cli/commands/product/cmd.py +0 -0
  53. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea_cli/commands/production/__init__.py +0 -0
  54. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea_cli/commands/production/cmd.py +0 -0
  55. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea_cli/commands/production/pricing_spec.py +0 -0
  56. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea_cli/commands/supplier/__init__.py +0 -0
  57. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea_cli/commands/supplier/cmd.py +0 -0
  58. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea_cli/config.py +0 -0
  59. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea_cli/errors.py +0 -0
  60. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea_cli/identity.py +0 -0
  61. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea_cli/main.py +0 -0
  62. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea_cli/output.py +0 -0
  63. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea_cli/posthog_client.py +0 -0
  64. {makea_cli-0.2.16 → makea_cli-0.2.18}/makea_cli/registry.py +0 -0
  65. {makea_cli-0.2.16 → makea_cli-0.2.18}/npm/makea-cli/README.md +0 -0
  66. {makea_cli-0.2.16 → makea_cli-0.2.18}/npm/makea-cli/makea-cli.mjs +0 -0
  67. {makea_cli-0.2.16 → makea_cli-0.2.18}/npm/makea-cli/package.json +0 -0
  68. {makea_cli-0.2.16 → makea_cli-0.2.18}/tests/test_broker.py +0 -0
  69. {makea_cli-0.2.16 → makea_cli-0.2.18}/tests/test_currency_conversion.py +0 -0
  70. {makea_cli-0.2.16 → makea_cli-0.2.18}/tests/test_output_contract.py +0 -0
  71. {makea_cli-0.2.16 → makea_cli-0.2.18}/tests/test_pm_reads.py +0 -0
  72. {makea_cli-0.2.16 → makea_cli-0.2.18}/tests/test_registry.py +0 -0
  73. {makea_cli-0.2.16 → makea_cli-0.2.18}/tests/test_supplier_scorecard.py +0 -0
@@ -1,5 +1,41 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.18
4
+
5
+ New: see why a playbook rule did not reach Beeboo, and what a rule said
6
+ before. Both need the backend's playbook trace and revisions (ca0469d1).
7
+
8
+ - `admin get playbook-preview -u <user> [--product <id>] [--surface …]`: the
9
+ block one AI surface would get, and in `excluded[]` every rule read that
10
+ stays out with its reason (waiting for the brand, paused, only for other
11
+ product types, narrowed to another factory, over budget…). `--rule <id>`
12
+ answers for one rule only; `--supplier` previews a factory's playbook.
13
+ - `admin get rule-history <rule_id>`: every revision of one rule, with who
14
+ changed it and why, and `superseded_chain` to the rule that replaced it.
15
+
16
+ ## 0.2.17
17
+
18
+ New: an admin can make and run shipping orders from the CLI. `create
19
+ shipping-order` needs the backend's new `POST /admin/shipping_orders/create`;
20
+ the other commands use endpoints the admin web page already calls.
21
+
22
+ - `admin create shipping-order -p <production_order_id> [-s <sampling_order_id>] …`:
23
+ a shipment owned by the orders' brand (it shows on their Ship page, and the
24
+ fulfilment fee follows their plan); you are recorded as created_by.
25
+ Optional `--mode`, `--status` (default SUBMITTED), `--address`. Orders
26
+ already on a live shipment are refused, and one shipment carries one
27
+ supplier's goods.
28
+ - `admin get shipping-order <id>`: the shipment with its orders, quotes, fees,
29
+ tracking and address.
30
+ - `admin update shipping-order <id>`: any of `--status`, tracking
31
+ (`--tracking-number`, `--tracking-url`, `--shipping-method`, `--carrier-id`),
32
+ `--address`, `--cartons` / `--gross-weight-kg`.
33
+ - `admin create|delete shipping-option`: add or withdraw a freight quote.
34
+ - `admin create|delete shipping-fee`: add or remove a fee on the shipment.
35
+ - `admin delete shipping-order-item <id> -p|-s <order_id>`: take one order off
36
+ a shipment (an emptied shipment is deleted).
37
+ - `admin delete shipping-order <id>`: delete the shipment and free its orders.
38
+
3
39
  ## 0.2.16
4
40
 
5
41
  New: an admin can read, add, edit and remove the AI playbook rules of one
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: makea-cli
3
- Version: 0.2.16
3
+ Version: 0.2.18
4
4
  Summary: Makea admin CLI (browser login + Makea admin HTTP API)
5
5
  Requires-Python: >=3.10
6
6
  Requires-Dist: click<9,>=8.1
@@ -93,10 +93,17 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
93
93
  | `makea-cli admin create library-element` | write(auto) | `POST /admin/designer/{user_id}/library_components` | save a reusable component under a designer. Provide --section and --values (see admin get library-schema). | `library-create` |
94
94
  | `makea-cli admin create quote-request` | write(ask) | `POST /admin/supplier/create_quote_request` | create/send a quote request to a supplier for a product (admin). | `create-quote-request` |
95
95
  | `makea-cli admin create rule` | write(ask) | `POST /admin/playbook/users/{user}/rules` | add a rule to one person's AI playbook (user_id or email); admin-authored, active unless --status. Refuses a repeat or a conflict unless --force. --reason required. | — |
96
+ | `makea-cli admin create shipping-fee` | write(ask) | `POST /admin/shipping_orders/{shipping_order_id}/fees/add` | add a fee (fixed amount or percentage) on top of the freight. | — |
97
+ | `makea-cli admin create shipping-option` | write(ask) | `POST /admin/shipping_orders/{shipping_order_id}/shipping-options` | add one freight quote (provider, speed, price, currency). | — |
98
+ | `makea-cli admin create shipping-order` | write(ask) | `POST /admin/shipping_orders/create` | make a shipment for a brand's production and/or sampling orders. The shipment belongs to the orders' owner; you are r… | — |
96
99
  | `makea-cli admin create supplier` | write(ask) | `POST /admin/supplier/add_supplier` | create supplier from JSON file (admin). Run `makea-cli get-supplier-profile-schema` FIRST to get the field taxonomy (… | `add-supplier` |
97
100
  | `makea-cli admin create user` | write(never) | `POST /admin/users/create` | register a user and confirm the Cognito account in one step (no verification email). Allowed --user-type values: "Fas… | `create-user` |
98
101
  | `makea-cli admin delete library-element` | write(never) | `DELETE /admin/designer/{user_id}/library_components/{component_id}` | remove a component from the designer's org library. | `library-delete` |
99
102
  | `makea-cli admin delete rule` | write(ask) | `DELETE /admin/playbook/users/{user}/rules/{rule_id}` | remove a rule: archived, with who and why kept on it (`update rule --status active` restores it). --reason required. | — |
103
+ | `makea-cli admin delete shipping-fee` | write(ask) | `DELETE /admin/shipping_orders/{shipping_order_id}/fees/{fee_id}/remove` | remove one fee. | — |
104
+ | `makea-cli admin delete shipping-option` | write(ask) | `DELETE /admin/shipping_orders/{shipping_order_id}/shipping-options/{shipping_option_id}/remove` | withdraw one freight quote. | — |
105
+ | `makea-cli admin delete shipping-order` | write(never) | `DELETE /admin/shipping_orders/{shipping_order_id}/delete` | remove a shipment and free its orders. Graded `never`: the backend does not check status, so it removes a paid or in-transit shipment too. | — |
106
+ | `makea-cli admin delete shipping-order-item` | write(ask) | `POST /admin/production_orders/{id}/unlink_from_shipping_order/{shipping_order_id}` | take one production or sampling order off a shipment. A shipment left empty is deleted. | — |
100
107
  | `makea-cli admin download document` | read | `GET /admin/document/download` | save a document file (document id + designer user_id). | `download-document` |
101
108
  | `makea-cli admin download product-document` | read | `GET /admin/document/download` | Resolve product via admin list product-order payload, then GET /admin/document/download. | `download-product-document` |
102
109
  | `makea-cli admin generate pricing-groups` | write(ask) | `POST /admin/production_orders/{id}/details/update` | Lay a production order's variants into pricing groups along one axis (--by style \| colour \| variant \| all) with th… | `production-groups-generate` |
@@ -105,10 +112,13 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
105
112
  | `makea-cli admin get currency-conversion` | read | `GET /admin/fx/rates` | the platform's own exchange rates and rounding (rate table for several --from; one --from with --amount converts it). | `convert-currency` |
106
113
  | `makea-cli admin get feature-usage` | read | `POST /admin/analytics/query` | How many distinct users used a feature recently, plus event volume. Matches $pageview path and feature_time_spent eve… | `analytics-feature-usage` |
107
114
  | `makea-cli admin get library-schema` | read | `GET /admin/library_components/schema` | the tech-pack library taxonomy: sections and their library-role field keys (run this before create/update). | `library-schema` |
115
+ | `makea-cli admin get playbook-preview` | read | `GET /admin/playbook/preview` | the playbook block one AI surface would get for a person or factory, and every rule left out with its reason; --product previews a conversation about one product, --rule answers for one rule. | — |
108
116
  | `makea-cli admin get production-pricing` | read | `GET /admin/production_orders/{id}/details` | show a production order's price tiers, MOQ, sizes/colours, pricing groups and cart coverage. | `production-pricing-show` |
109
117
  | `makea-cli admin get quote-request` | read | `GET /admin/quote_requests/{quote_request_id}` | one quote request in full. | — |
110
118
  | `makea-cli admin get revenue-metrics` | read | `GET /admin/business-metrics/cumulative-payment-and-platform-revenue` | platform-wide payment received and platform revenue (service fee + transaction fee) bucketed over a date range. | `get-cumulative-payment-and-platform-revenue` |
111
119
  | `makea-cli admin get rule` | read | `GET /admin/playbook/users/{user}/rules/{rule_id}` | one rule in full, with its evidence: where it came from, who changed it and why. | — |
120
+ | `makea-cli admin get rule-history` | read | `GET /admin/playbook/rules/{rule_id}/history` | every revision of one rule: its words, who changed it and why, and the rule that replaced it. | — |
121
+ | `makea-cli admin get shipping-order` | read | `GET /admin/shipping_orders/{shipping_order_id}/details` | one shipment with its production and sampling orders, freight quotes, fees, tracking and address. | — |
112
122
  | `makea-cli admin get supplier-profile-schema` | read | `GET /admin/supplier/profile/schema` | supplier profile v2 schema (section/field taxonomy: sections, fields, options, required rules). | `get-supplier-profile-schema` |
113
123
  | `makea-cli admin get tech-spec-extraction` | read | `GET /admin/products/{id}/extract-tech-specifications` | AI-generate specs (not saved). | `extract-ai-tech-spec` |
114
124
  | `makea-cli admin get top-clicks` | read | `POST /admin/analytics/query` | which buttons/elements get clicked most. | `analytics-top-clicks` |
@@ -134,6 +144,7 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
134
144
  | `makea-cli admin update quote` | write(ask) | `POST /admin/product/edit_supplier_link_override_info` | admin updates an existing quote (supplier link) in place. Only the options you pass are sent, and the backend leaves … | `update-supplier-quote` |
135
145
  | `makea-cli admin update quote-request` | write(ask) | `PATCH /admin/quote_requests/{quote_request_id}/update` | set a quote request's stage, status and/or due date. Only what you pass is changed. This is the door that unblocks a … | `update-quote-request` |
136
146
  | `makea-cli admin update rule` | write(ask) | `PATCH /admin/playbook/users/{user}/rules/{rule_id}` | change a rule's text, status, applies_to, when or mode. --reason required; the rule keeps what it was before. | — |
147
+ | `makea-cli admin update shipping-order` | write(ask) | `PUT /admin/shipping_orders/{shipping_order_id}/status` | Change a shipment: --status (PUT .../status), tracking flags (POST .../tracking), --address (PUT .../shipping-address… | — |
137
148
  | `makea-cli admin update supplier` | write(ask) | `PUT /admin/supplier/update_supplier` | update an existing supplier from a JSON file (admin). Run `makea-cli get-supplier-profile-schema` FIRST to get the fi… | `update-supplier` |
138
149
  | `makea-cli admin update tech-spec` | write(ask) | `POST /admin/products/{id}/technical-specifications` | persist specs from a JSON file. | `save-product-tech-spec` |
139
150
  | `makea-cli admin update tracking-status` | write(ask) | `POST /admin/tracking/carrier_status` | apply a carrier status looked up by hand (tracking-sweep skill) to one order: status, fan-out, delivered emails (--silent: state only). | — |
@@ -81,10 +81,17 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
81
81
  | `makea-cli admin create library-element` | write(auto) | `POST /admin/designer/{user_id}/library_components` | save a reusable component under a designer. Provide --section and --values (see admin get library-schema). | `library-create` |
82
82
  | `makea-cli admin create quote-request` | write(ask) | `POST /admin/supplier/create_quote_request` | create/send a quote request to a supplier for a product (admin). | `create-quote-request` |
83
83
  | `makea-cli admin create rule` | write(ask) | `POST /admin/playbook/users/{user}/rules` | add a rule to one person's AI playbook (user_id or email); admin-authored, active unless --status. Refuses a repeat or a conflict unless --force. --reason required. | — |
84
+ | `makea-cli admin create shipping-fee` | write(ask) | `POST /admin/shipping_orders/{shipping_order_id}/fees/add` | add a fee (fixed amount or percentage) on top of the freight. | — |
85
+ | `makea-cli admin create shipping-option` | write(ask) | `POST /admin/shipping_orders/{shipping_order_id}/shipping-options` | add one freight quote (provider, speed, price, currency). | — |
86
+ | `makea-cli admin create shipping-order` | write(ask) | `POST /admin/shipping_orders/create` | make a shipment for a brand's production and/or sampling orders. The shipment belongs to the orders' owner; you are r… | — |
84
87
  | `makea-cli admin create supplier` | write(ask) | `POST /admin/supplier/add_supplier` | create supplier from JSON file (admin). Run `makea-cli get-supplier-profile-schema` FIRST to get the field taxonomy (… | `add-supplier` |
85
88
  | `makea-cli admin create user` | write(never) | `POST /admin/users/create` | register a user and confirm the Cognito account in one step (no verification email). Allowed --user-type values: "Fas… | `create-user` |
86
89
  | `makea-cli admin delete library-element` | write(never) | `DELETE /admin/designer/{user_id}/library_components/{component_id}` | remove a component from the designer's org library. | `library-delete` |
87
90
  | `makea-cli admin delete rule` | write(ask) | `DELETE /admin/playbook/users/{user}/rules/{rule_id}` | remove a rule: archived, with who and why kept on it (`update rule --status active` restores it). --reason required. | — |
91
+ | `makea-cli admin delete shipping-fee` | write(ask) | `DELETE /admin/shipping_orders/{shipping_order_id}/fees/{fee_id}/remove` | remove one fee. | — |
92
+ | `makea-cli admin delete shipping-option` | write(ask) | `DELETE /admin/shipping_orders/{shipping_order_id}/shipping-options/{shipping_option_id}/remove` | withdraw one freight quote. | — |
93
+ | `makea-cli admin delete shipping-order` | write(never) | `DELETE /admin/shipping_orders/{shipping_order_id}/delete` | remove a shipment and free its orders. Graded `never`: the backend does not check status, so it removes a paid or in-transit shipment too. | — |
94
+ | `makea-cli admin delete shipping-order-item` | write(ask) | `POST /admin/production_orders/{id}/unlink_from_shipping_order/{shipping_order_id}` | take one production or sampling order off a shipment. A shipment left empty is deleted. | — |
88
95
  | `makea-cli admin download document` | read | `GET /admin/document/download` | save a document file (document id + designer user_id). | `download-document` |
89
96
  | `makea-cli admin download product-document` | read | `GET /admin/document/download` | Resolve product via admin list product-order payload, then GET /admin/document/download. | `download-product-document` |
90
97
  | `makea-cli admin generate pricing-groups` | write(ask) | `POST /admin/production_orders/{id}/details/update` | Lay a production order's variants into pricing groups along one axis (--by style \| colour \| variant \| all) with th… | `production-groups-generate` |
@@ -93,10 +100,13 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
93
100
  | `makea-cli admin get currency-conversion` | read | `GET /admin/fx/rates` | the platform's own exchange rates and rounding (rate table for several --from; one --from with --amount converts it). | `convert-currency` |
94
101
  | `makea-cli admin get feature-usage` | read | `POST /admin/analytics/query` | How many distinct users used a feature recently, plus event volume. Matches $pageview path and feature_time_spent eve… | `analytics-feature-usage` |
95
102
  | `makea-cli admin get library-schema` | read | `GET /admin/library_components/schema` | the tech-pack library taxonomy: sections and their library-role field keys (run this before create/update). | `library-schema` |
103
+ | `makea-cli admin get playbook-preview` | read | `GET /admin/playbook/preview` | the playbook block one AI surface would get for a person or factory, and every rule left out with its reason; --product previews a conversation about one product, --rule answers for one rule. | — |
96
104
  | `makea-cli admin get production-pricing` | read | `GET /admin/production_orders/{id}/details` | show a production order's price tiers, MOQ, sizes/colours, pricing groups and cart coverage. | `production-pricing-show` |
97
105
  | `makea-cli admin get quote-request` | read | `GET /admin/quote_requests/{quote_request_id}` | one quote request in full. | — |
98
106
  | `makea-cli admin get revenue-metrics` | read | `GET /admin/business-metrics/cumulative-payment-and-platform-revenue` | platform-wide payment received and platform revenue (service fee + transaction fee) bucketed over a date range. | `get-cumulative-payment-and-platform-revenue` |
99
107
  | `makea-cli admin get rule` | read | `GET /admin/playbook/users/{user}/rules/{rule_id}` | one rule in full, with its evidence: where it came from, who changed it and why. | — |
108
+ | `makea-cli admin get rule-history` | read | `GET /admin/playbook/rules/{rule_id}/history` | every revision of one rule: its words, who changed it and why, and the rule that replaced it. | — |
109
+ | `makea-cli admin get shipping-order` | read | `GET /admin/shipping_orders/{shipping_order_id}/details` | one shipment with its production and sampling orders, freight quotes, fees, tracking and address. | — |
100
110
  | `makea-cli admin get supplier-profile-schema` | read | `GET /admin/supplier/profile/schema` | supplier profile v2 schema (section/field taxonomy: sections, fields, options, required rules). | `get-supplier-profile-schema` |
101
111
  | `makea-cli admin get tech-spec-extraction` | read | `GET /admin/products/{id}/extract-tech-specifications` | AI-generate specs (not saved). | `extract-ai-tech-spec` |
102
112
  | `makea-cli admin get top-clicks` | read | `POST /admin/analytics/query` | which buttons/elements get clicked most. | `analytics-top-clicks` |
@@ -122,6 +132,7 @@ exit code:`0` 成功 · `2` 用法错 · `3` 未登录或身份与 persona 不
122
132
  | `makea-cli admin update quote` | write(ask) | `POST /admin/product/edit_supplier_link_override_info` | admin updates an existing quote (supplier link) in place. Only the options you pass are sent, and the backend leaves … | `update-supplier-quote` |
123
133
  | `makea-cli admin update quote-request` | write(ask) | `PATCH /admin/quote_requests/{quote_request_id}/update` | set a quote request's stage, status and/or due date. Only what you pass is changed. This is the door that unblocks a … | `update-quote-request` |
124
134
  | `makea-cli admin update rule` | write(ask) | `PATCH /admin/playbook/users/{user}/rules/{rule_id}` | change a rule's text, status, applies_to, when or mode. --reason required; the rule keeps what it was before. | — |
135
+ | `makea-cli admin update shipping-order` | write(ask) | `PUT /admin/shipping_orders/{shipping_order_id}/status` | Change a shipment: --status (PUT .../status), tracking flags (POST .../tracking), --address (PUT .../shipping-address… | — |
125
136
  | `makea-cli admin update supplier` | write(ask) | `PUT /admin/supplier/update_supplier` | update an existing supplier from a JSON file (admin). Run `makea-cli get-supplier-profile-schema` FIRST to get the fi… | `update-supplier` |
126
137
  | `makea-cli admin update tech-spec` | write(ask) | `POST /admin/products/{id}/technical-specifications` | persist specs from a JSON file. | `save-product-tech-spec` |
127
138
  | `makea-cli admin update tracking-status` | write(ask) | `POST /admin/tracking/carrier_status` | apply a carrier status looked up by hand (tracking-sweep skill) to one order: status, fan-out, delivered emails (--silent: state only). | — |
@@ -0,0 +1 @@
1
+ __version__ = "0.2.18"
@@ -766,6 +766,89 @@ def get_all_shipping_orders(
766
766
  return get_json("/admin/shipping_orders", params=params)
767
767
 
768
768
 
769
+ def admin_create_shipping_order(body: dict[str, Any]) -> Any:
770
+ """POST /admin/shipping_orders/create — a shipment for a brand's production/sampling orders."""
771
+ return post_json("/admin/shipping_orders/create", body)
772
+
773
+
774
+ def admin_get_shipping_order(shipping_order_id: str) -> Any:
775
+ """GET /admin/shipping_orders/{id}/details — the shipment with its orders filled in."""
776
+ return get_json(f"/admin/shipping_orders/{shipping_order_id}/details")
777
+
778
+
779
+ def admin_update_shipping_order_status(shipping_order_id: str, status: str) -> Any:
780
+ """PUT /admin/shipping_orders/{id}/status"""
781
+ return put_json(f"/admin/shipping_orders/{shipping_order_id}/status", {"status": status})
782
+
783
+
784
+ def admin_update_shipping_order_tracking(
785
+ shipping_order_id: str, tracking_info: dict[str, Any]
786
+ ) -> Any:
787
+ """POST /admin/shipping_orders/{id}/tracking"""
788
+ return post_json(
789
+ f"/admin/shipping_orders/{shipping_order_id}/tracking", {"tracking_info": tracking_info}
790
+ )
791
+
792
+
793
+ def admin_update_shipping_order_address(
794
+ shipping_order_id: str, shipping_address: dict[str, Any]
795
+ ) -> Any:
796
+ """PUT /admin/shipping_orders/{id}/shipping-address"""
797
+ return put_json(
798
+ f"/admin/shipping_orders/{shipping_order_id}/shipping-address",
799
+ {"shipping_address": shipping_address},
800
+ )
801
+
802
+
803
+ def admin_update_shipping_order_cargo(shipping_order_id: str, cargo: dict[str, Any]) -> Any:
804
+ """PUT /admin/shipping_orders/{id}/cargo — cartons and/or gross_weight_kg."""
805
+ return put_json(f"/admin/shipping_orders/{shipping_order_id}/cargo", cargo)
806
+
807
+
808
+ def admin_delete_shipping_order(shipping_order_id: str) -> Any:
809
+ """DELETE /admin/shipping_orders/{id}/delete — soft delete; unlinks its orders."""
810
+ return delete_json(f"/admin/shipping_orders/{shipping_order_id}/delete")
811
+
812
+
813
+ def admin_add_shipping_option(shipping_order_id: str, option: dict[str, Any]) -> Any:
814
+ """POST /admin/shipping_orders/{id}/shipping-options — one freight quote."""
815
+ return post_json(
816
+ f"/admin/shipping_orders/{shipping_order_id}/shipping-options",
817
+ {"shipping_option": option},
818
+ )
819
+
820
+
821
+ def admin_remove_shipping_option(shipping_order_id: str, shipping_option_id: str) -> Any:
822
+ """DELETE /admin/shipping_orders/{id}/shipping-options/{option_id}/remove"""
823
+ return delete_json(
824
+ f"/admin/shipping_orders/{shipping_order_id}/shipping-options/{shipping_option_id}/remove"
825
+ )
826
+
827
+
828
+ def admin_add_shipping_order_fee(shipping_order_id: str, fee: dict[str, Any]) -> Any:
829
+ """POST /admin/shipping_orders/{id}/fees/add"""
830
+ return post_json(f"/admin/shipping_orders/{shipping_order_id}/fees/add", fee)
831
+
832
+
833
+ def admin_remove_shipping_order_fee(shipping_order_id: str, fee_id: str) -> Any:
834
+ """DELETE /admin/shipping_orders/{id}/fees/{fee_id}/remove"""
835
+ return delete_json(f"/admin/shipping_orders/{shipping_order_id}/fees/{fee_id}/remove")
836
+
837
+
838
+ def admin_unlink_from_shipping_order(
839
+ shipping_order_id: str,
840
+ *,
841
+ production_order_id: str | None = None,
842
+ sampling_order_id: str | None = None,
843
+ ) -> Any:
844
+ """POST /admin/{production|sampling}_orders/{id}/unlink_from_shipping_order/{shipping_order_id}"""
845
+ if production_order_id:
846
+ path = f"/admin/production_orders/{production_order_id}"
847
+ else:
848
+ path = f"/admin/sampling_orders/{sampling_order_id}"
849
+ return post_json(f"{path}/unlink_from_shipping_order/{shipping_order_id}", {})
850
+
851
+
769
852
  def get_misc_payments_by_product(product_id: str) -> Any:
770
853
  """GET /admin/products/{product_id}/misc-payments — misc payments for one product."""
771
854
  return get_json(f"/admin/products/{product_id}/misc-payments")
@@ -1098,6 +1181,31 @@ def admin_delete_user_rule(user: str, rule_id: str, reason: str) -> Any:
1098
1181
  return delete_json(_user_rules_path(user, rule_id), body={"reason": reason})
1099
1182
 
1100
1183
 
1184
+ def admin_get_rule_history(rule_id: str) -> Any:
1185
+ """GET /admin/playbook/rules/{rule_id}/history — every revision of one rule
1186
+ (words, who, why), what replaced it and what it replaced."""
1187
+ return get_json(f"/admin/playbook/rules/{quote(rule_id, safe='')}/history")
1188
+
1189
+
1190
+ def admin_playbook_preview(
1191
+ surface: str,
1192
+ *,
1193
+ user_id: str | None = None,
1194
+ supplier_id: str | None = None,
1195
+ product_id: str | None = None,
1196
+ ) -> Any:
1197
+ """GET /admin/playbook/preview — the block a surface would inject, plus every
1198
+ rule left out and why (``excluded``)."""
1199
+ params: dict[str, Any] = {"surface": surface}
1200
+ if user_id:
1201
+ params["user_id"] = user_id
1202
+ if supplier_id:
1203
+ params["supplier_id"] = supplier_id
1204
+ if product_id:
1205
+ params["product_id"] = product_id
1206
+ return get_json("/admin/playbook/preview", params=params)
1207
+
1208
+
1101
1209
  # --- supplier persona: a factory acting on its own RFQs, quotes and orders --------
1102
1210
 
1103
1211
 
@@ -16,6 +16,7 @@ from makea_cli.commands.orders.cmd import register as register_orders
16
16
  from makea_cli.commands.playbook.cmd import register as register_playbook
17
17
  from makea_cli.commands.product.cmd import register as register_product
18
18
  from makea_cli.commands.production.cmd import register as register_production
19
+ from makea_cli.commands.shipping.cmd import register as register_shipping
19
20
  from makea_cli.commands.supplier.cmd import register as register_supplier
20
21
 
21
22
 
@@ -27,6 +28,7 @@ def register_all(app: typer.Typer) -> None:
27
28
  register_orders(app)
28
29
  register_product(app)
29
30
  register_production(app)
31
+ register_shipping(app)
30
32
  register_designer(app)
31
33
  register_metrics(app)
32
34
  register_analytics(app)
@@ -172,6 +172,71 @@ def register(app: typer.Typer) -> None:
172
172
  """Show one playbook rule with its evidence."""
173
173
  print_json_or_exit(console, lambda: api_client.admin_get_user_rule(user, rule_id))
174
174
 
175
+ @command(
176
+ app,
177
+ "admin",
178
+ "get",
179
+ "rule-history",
180
+ api="GET /admin/playbook/rules/{rule_id}/history",
181
+ help=(
182
+ "GET /admin/playbook/rules/{rule_id}/history — every revision of one rule: "
183
+ "its words, who changed it and why; superseded_chain leads to the rule "
184
+ "that holds now when this one was replaced."
185
+ ),
186
+ )
187
+ def get_rule_history(
188
+ rule_id: str = typer.Argument(..., help="Rule id (rul_…)."),
189
+ ) -> None:
190
+ """Show what a playbook rule said at each point, and what replaced it."""
191
+ print_json_or_exit(console, lambda: api_client.admin_get_rule_history(rule_id))
192
+
193
+ @command(
194
+ app,
195
+ "admin",
196
+ "get",
197
+ "playbook-preview",
198
+ api="GET /admin/playbook/preview",
199
+ help=(
200
+ "GET /admin/playbook/preview — the playbook block one AI surface would get "
201
+ "for a person (or a factory), and in excluded[] every rule read that stays "
202
+ "out with its reason (waiting for confirmation, paused, only for knitwear, "
203
+ "over budget…). --product previews a conversation about one product."
204
+ ),
205
+ )
206
+ def playbook_preview(
207
+ user: str | None = typer.Option(None, "--user", "-u", help="Brand user_id."),
208
+ supplier: str | None = typer.Option(None, "--supplier", help="Supplier id."),
209
+ surface: str = typer.Option(
210
+ "chat_default", "--surface", help="AI surface, e.g. chat_default."
211
+ ),
212
+ product: str | None = typer.Option(None, "--product", "-p", help="Product id."),
213
+ rule: str | None = typer.Option(
214
+ None, "--rule", help="Only say whether this rule is in, and if not why."
215
+ ),
216
+ ) -> None:
217
+ """Preview a playbook block and why the other rules stay out."""
218
+ if not user and not supplier:
219
+ raise typer.BadParameter("pass --user or --supplier")
220
+
221
+ def fetch() -> Any:
222
+ out = api_client.admin_playbook_preview(
223
+ surface, user_id=user, supplier_id=supplier, product_id=product
224
+ )
225
+ if not rule:
226
+ return out
227
+ if rule in (out.get("rule_ids") or []):
228
+ return {"rule_id": rule, "in_prompt": True}
229
+ for ex in out.get("excluded") or []:
230
+ if ex.get("rule_id") == rule:
231
+ return {"rule_id": rule, "in_prompt": False, **ex}
232
+ return {
233
+ "rule_id": rule,
234
+ "in_prompt": False,
235
+ "reason": "not read: archived, or not on a scope this surface reads",
236
+ }
237
+
238
+ print_json_or_exit(console, fetch)
239
+
175
240
  @command(
176
241
  app,
177
242
  "admin",