@ancha-labs/cli 0.4.23 → 0.4.24
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/lib/ancha.mjs +6000 -3516
- package/lib/assets/docs/cloud.md +13 -0
- package/lib/assets/docs/scenes.md +75 -1
- package/lib/assets/harbor/companion.mjs +4191 -2271
- package/lib/assets/harbor/suiteql-worker.mjs +32 -3
- package/lib/assets/ui/app.js +7 -7
- package/lib/mcp-entry.mjs +158 -27
- package/lib/suiteql-worker.mjs +32 -3
- package/lib/worker.mjs +4564 -2520
- package/lib/world-server.mjs +4151 -2231
- package/package.json +1 -1
package/lib/assets/docs/cloud.md
CHANGED
|
@@ -195,3 +195,16 @@ ancha runs show '#412' --json
|
|
|
195
195
|
The JSON keeps the full run id alongside `runNumber`. A retry with the same idempotency key and a repeated upload keep the run's number. Historical runs keep their short ids.
|
|
196
196
|
|
|
197
197
|
**Started by** shows the signed-in person's email for console submissions, or the API key owner's email with **CLI**. In GitHub Actions, the CLI records **GitHub Actions**, the repository and a link to the workflow run from `GITHUB_ACTIONS`, `GITHUB_REPOSITORY`, `GITHUB_RUN_ID` and `GITHUB_SERVER_URL`.
|
|
198
|
+
|
|
199
|
+
## Edit a test in the console
|
|
200
|
+
|
|
201
|
+
On a test's page, **Edit** opens its YAML from the selected cloud run. **Save and run x5** validates the test and starts five attempts with that edit and the same agent bundle. The edit belongs to the new run. Its Details show **Edited in console** and a YAML download.
|
|
202
|
+
|
|
203
|
+
Bring the edited file into your project:
|
|
204
|
+
|
|
205
|
+
```sh
|
|
206
|
+
ancha test pull <run-id> --json
|
|
207
|
+
ancha test pull <run-id> --test <name> --json
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
The command writes the test to its original project path. If your local file changed since the bundle was uploaded, keep your changes or add `--force` to replace it. Run `ancha test validate <path> --json` to check the saved file with the project's world data. Console edits accept up to 64 KiB of UTF-8 YAML and keep the test's `id`.
|
|
@@ -94,6 +94,80 @@ All supplied filters match the same record. Choose `count_eq` for an exact count
|
|
|
94
94
|
|
|
95
95
|
Jira issues accept `issue`, `project`, `type`, `summary_contains`, `description_contains`, `labels`, `assignee`, `status` and `parent` (an epic for standard issues). Use `assignee: null` for unassigned issues and `parent: null` for no parent. Comments accept `issue`, `author` and `text_contains`; transitions accept `issue`, `from`, `to` and `author`. Text containment accepts a string or an all-required list and ignores case. Issue refs (`$issue.ops_slow`) and user refs (`$user.rachel`) belong to `seed.jira`; native issue keys and account ids also work.
|
|
96
96
|
|
|
97
|
-
PayPal orders accept `id`, `status`, `intent`, `payer_email`, `description_contains`, `invoice_id`, `currency`, `total`, `tax` and `items`. Invoice checks accept `id`, `status`, `recipient`, `currency`, `total`, `tax`, `sent` and `items`. Items have an exact `name` and optional `quantity` and `unit_amount`; invoice items
|
|
97
|
+
PayPal orders accept `id`, `status`, `intent`, `payer_email`, `description_contains`, `invoice_id`, `currency`, `total`, `tax` and `items`. Invoice checks accept `id`, `status`, `recipient`, `currency`, `total`, `tax`, `sent` and `items`. Items have an exact `name` and optional `quantity` and `unit_amount`; order items accept per-unit `tax`, and invoice items accept `tax_percent` and computed line `tax`. Quote amounts and quantities as decimal strings. Each requested item matches a distinct item; extra items are allowed. Payment checks accept `id`, `order`, `status`, `payer_email`, `invoice_id`, `currency`, `amount` and `refunded`. Order `id` and payment `order` can name a seed order as `$order.ref`.
|
|
98
98
|
|
|
99
99
|
Invoice item tax is computed on quantity × unit amount after item discount, rounded to cents. For 1.5 units at $120.00, a 10% item discount and 50% tax, the item tax is $81.00. Invoice responses include each item's computed `tax.amount`, and captured checks compare it directly. `ancha explain --json` shows expected filters and actual records with their amounts and statuses.
|
|
100
|
+
|
|
101
|
+
PayPal order responses retain each item's `tax` (Money), `description`, `url`, `image_url` and `upc` on create, GET and capture. Item tax uses the purchase unit's currency. When any item specifies `tax`, `amount.breakdown.tax_total` is required and equals the sum of item tax × quantity; PayPal returns `TAX_TOTAL_REQUIRED` or `TAX_TOTAL_MISMATCH` with status 422 when this rule is violated. Order state checks compare each item's per-unit tax as a decimal string, for example `items: [{ name: Review, quantity: "2", tax: "1.23" }]`.
|
|
102
|
+
|
|
103
|
+
## Stripe state checks
|
|
104
|
+
|
|
105
|
+
Customer cards accept `fingerprint` to identify the same card across customer records. Customer `cash_balance` seeds set `available` amounts by currency and a `reconciliation_mode`. Optional `credit_notes` seed paid-invoice credits by `invoice`, `amount` and `created`; optional `disputes` seed card inquiries by `payment` and `created`, with `warning_needs_response`, `warning_under_review` or `warning_closed` status. Credit notes add customer balance transactions, and API changes appear in `/v1/events`.
|
|
106
|
+
|
|
107
|
+
Stripe worlds default to a live account (`livemode: true`) with a stored card for each seeded customer. Payments using that card share its payment method ID and fingerprint. Supply `customers[].card` to choose the brand, last four digits, expiration and decline behavior. Set `seed.stripe.livemode: false` for a test account with Stripe test tokens such as `pm_card_visa`.
|
|
108
|
+
|
|
109
|
+
```yaml
|
|
110
|
+
checks:
|
|
111
|
+
- id: duplicate_refunded
|
|
112
|
+
state: { stripe.refunds: { charge: $summit_duplicate, count: 1, amount: 120000 } }
|
|
113
|
+
- id: deposit_preserved
|
|
114
|
+
state: { stripe.refunds: { payment_intent: $pinecrest_deposit, count: 0, amount: 0 } }
|
|
115
|
+
- id: customer_balance
|
|
116
|
+
state: { stripe.balance: { customer: $pinecrest, balance: 0 } }
|
|
117
|
+
- id: subscription_preserved
|
|
118
|
+
state: { stripe.unchanged: { objects: [{ type: subscription, id: $pinecrest_seats }] } }
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
`stripe.refunds` selects exactly one `charge` or `payment_intent` and compares successful refunds against an exact `count`, summed `amount`, or both. Amounts are integer minor units: `120000` is $1,200.00 USD. Seeded history is included; `after_start: true` selects refunds created at or after the attempt's start time. A missing payment fails even when the expected count is zero.
|
|
122
|
+
|
|
123
|
+
`stripe.balance` compares the named customer's balance: negative for credit, positive for debt. `stripe.unchanged` compares every native field of each named object with its state after seeding. Objects must exist both at seeding and evaluation; deletion fails. This checks final state, so restoring all original field values passes. Types are `customer`, `payment_method`, `product`, `price`, `subscription`, `invoice`, `invoiceitem`, `payment_intent`, `charge` and `refund`.
|
|
124
|
+
|
|
125
|
+
Use a native Stripe ID or a tool-local `$ref` (also `$type.ref`). Payment and paid-invoice refs identify their charge or PaymentIntent; customer refs identify customers or their stored payment methods. Other refs identify their seeded object type; invoice items use native IDs. `ancha twins seed stripe --json` prints validated examples. `ancha explain --json` reports the expected and actual state for each check.
|
|
126
|
+
|
|
127
|
+
## Zendesk ticket checks
|
|
128
|
+
|
|
129
|
+
Use `zendesk.ticket` to check one ticket by numeric `id` or exact `subject`. All supplied conditions apply to that ticket. A subject identifies exactly one ticket; use its `id` when subjects repeat.
|
|
130
|
+
|
|
131
|
+
```yaml
|
|
132
|
+
checks:
|
|
133
|
+
- id: export_resolved
|
|
134
|
+
state:
|
|
135
|
+
zendesk.ticket:
|
|
136
|
+
subject: CSV export times out for large files
|
|
137
|
+
status: solved
|
|
138
|
+
tags: { has: [export_fixed], lacks: [legal_hold] }
|
|
139
|
+
assignee: mike@acme.example
|
|
140
|
+
priority: high
|
|
141
|
+
group: Support
|
|
142
|
+
public_comment: { contains: Try the export again }
|
|
143
|
+
- id: hold_preserved
|
|
144
|
+
state:
|
|
145
|
+
zendesk.ticket:
|
|
146
|
+
subject: Audit log export for Q2
|
|
147
|
+
status_not_in: [solved, closed]
|
|
148
|
+
- id: other_customer_kept
|
|
149
|
+
state:
|
|
150
|
+
zendesk.unchanged:
|
|
151
|
+
tickets: [{ subject: Invoice copy request }]
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Choose `status` for one value, `status_in` for any listed value, or `status_not_in` to exclude listed values. `tags.has` requires every listed tag; `tags.lacks` excludes every listed tag. `assignee` accepts an email, numeric user id or `null`; `group` accepts a name, numeric group id or `null`; `priority: null` checks an unset priority.
|
|
155
|
+
|
|
156
|
+
`public_comment: true` requires a public comment added during the attempt. `public_comment: { contains: "text" }` also requires that exact, case-sensitive text in the new comment. Seeded comments are starting history, including those at `start_time`.
|
|
157
|
+
|
|
158
|
+
`zendesk.unchanged` requires each named ticket to exist and keep its state throughout the attempt. It checks committed audits and deletion, so a change followed by a reversal still fails. Subjects identify the original tickets even if the agent renames them. Failed requests and updates that change no fields leave this check passing.
|
|
159
|
+
|
|
160
|
+
`ancha twins seed zendesk --json` includes both check examples. Organization seeds accept `externalId`; `brands` accepts `name`, `subdomain`, `default`, `active` and `created`, with exactly one active default brand. When `brands` is omitted, the world's account supplies its default brand. Organization search matches an exact name or external id; autocomplete returns up to ten name-prefix matches. Ticket search accepts `organization_id`, `requester_id`, `assignee_id` and `group_id`, and `order_by:updated_at` orders results by update time.
|
|
161
|
+
|
|
162
|
+
## Edit a test in the console
|
|
163
|
+
|
|
164
|
+
On a test's page, **Edit** opens its YAML from the selected cloud run. **Save and run x5** validates the test and starts five attempts with that edit and the same agent bundle. The edit belongs to the new run. Its Details show **Edited in console** and a YAML download.
|
|
165
|
+
|
|
166
|
+
Bring the edited file into your project:
|
|
167
|
+
|
|
168
|
+
```sh
|
|
169
|
+
ancha test pull <run-id> --json
|
|
170
|
+
ancha test pull <run-id> --test <name> --json
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
The command writes the test to its original project path. If your local file changed since the bundle was uploaded, keep your changes or add `--force` to replace it. Run `ancha test validate <path> --json` to check the saved file with the project's world data. Console edits accept up to 64 KiB of UTF-8 YAML and keep the test's `id`.
|