@wix/himalaya-cli 0.1527.0 → 0.1528.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +3580 -3226
- package/guides/himi-json-output.md +45 -0
- package/guides/himi-mcp.md +41 -0
- package/guides/iap-products.md +88 -23
- package/package.json +2 -2
|
@@ -399,3 +399,48 @@ generated files for entities no longer declared. They are never deleted.
|
|
|
399
399
|
- Migrate failure envelopes in subcommands other than `push`, keeping this contract.
|
|
400
400
|
- Review/reword human messages separately; no message rewrite is part of this change.
|
|
401
401
|
- Review exit-code conventions separately; no exit code changes are part of this change.
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
## IAP setup and mapping controls
|
|
405
|
+
|
|
406
|
+
`himi store iap check --json` (also local MCP `himi_iap_status`) returns one read-only
|
|
407
|
+
report. Its top-level `code` is `ok` or `setup_incomplete`; exit status is 0 or 1. The report
|
|
408
|
+
contains `checks` and per-product `items[].checks`. Each check has an `id`, `state`
|
|
409
|
+
(`ok`, `missing`, `blocked`), stable `code`, and human-readable `fix`.
|
|
410
|
+
|
|
411
|
+
The setup checker uses the stable code vocabulary below. Consumers branch on
|
|
412
|
+
codes, never the fix text. Codes include:
|
|
413
|
+
|
|
414
|
+
- Registration/key: `purchases_app_missing`, `purchases_app_mismatch`, `iap_key_missing`.
|
|
415
|
+
- Provider/access: `provider_check_unavailable`, `provider_not_connected`, `apple_access_blocked`,
|
|
416
|
+
`apple_app_mismatch`, `setup_read_failed`.
|
|
417
|
+
- Mappings: `mapping_missing`, `mapping_inactive`, `mapping_type_mismatch`, `mapping_conflict`,
|
|
418
|
+
`mapping_visibility_unverified`, `mapping_not_visible`.
|
|
419
|
+
- Apple readiness: `apple_product_missing`, `apple_product_not_ready`, `review_screenshot_missing`,
|
|
420
|
+
`apple_readiness_blocked`.
|
|
421
|
+
- Vertical: `sale_disabled`, `item_unsupported`, `vertical_check_unavailable`.
|
|
422
|
+
- Binding: `config_binding_missing`, `config_binding_conflict`, `build_binding_unverified`,
|
|
423
|
+
`build_binding_conflict`.
|
|
424
|
+
- Notifications: `notification_check_unavailable`, `notification_url_mismatch`.
|
|
425
|
+
|
|
426
|
+
`ok: false` with `setup_incomplete` can contain successful findings too; a failed read does not
|
|
427
|
+
suppress the remaining checks. Unavailable provider/notification reads are blocked evidence,
|
|
428
|
+
not evidence of an absent configuration.
|
|
429
|
+
|
|
430
|
+
`himi store iap mappings` lists without writes. Changes require both `--product` (Catalog mapping
|
|
431
|
+
id) and `--active true|false`, plus confirmation. Missing confirmation is
|
|
432
|
+
`confirmation_required`; malformed inputs are `invalid_usage`. Catalog errors preserve the
|
|
433
|
+
existing managed failure codes. `--profile` remains the explicit legacy Apple mode for the
|
|
434
|
+
provisioning commands; `--managed` is optional when no profile is supplied. `--no-submit` on
|
|
435
|
+
managed apply still uploads the review screenshot but skips submit-for-review.
|
|
436
|
+
|
|
437
|
+
A managed-only manifest used with explicit legacy `--profile` mode returns
|
|
438
|
+
`credentials_unavailable` before reading any profile or key, with guidance to add
|
|
439
|
+
`target.profile` and `target.teamId` or continue through Catalog. Apple products whose setup
|
|
440
|
+
is complete remain configured while their review submission progresses; an ok setup finding
|
|
441
|
+
is not App Store approval.
|
|
442
|
+
|
|
443
|
+
Apple provisioning commands (`draft`, `plan`, `apply`, `status`, `screenshots`) reject explicit
|
|
444
|
+
legacy `--profile` combined with Catalog registration/route selectors as `invalid_usage`,
|
|
445
|
+
before reading inputs or credentials. `connect` retains its intentional legacy profile plus
|
|
446
|
+
Catalog mapping route and registration check.
|
package/guides/himi-mcp.md
CHANGED
|
@@ -4,6 +4,47 @@
|
|
|
4
4
|
Claude Code, Cursor, Codex, VS Code — calls them as tools instead of remembering commands. Every
|
|
5
5
|
tool runs the same `himi` command you would type, on the app folder already on your disk.
|
|
6
6
|
|
|
7
|
+
## Apple in-app purchases
|
|
8
|
+
|
|
9
|
+
The local server exposes typed tools using the same IAP command implementations through
|
|
10
|
+
Catalog, with the site's owner authentication and server-held Apple keys. No tool accepts a
|
|
11
|
+
local Apple profile, key path, or private key. Supply the assigned `catalogRoute`; the Apple
|
|
12
|
+
provisioning tools also require the registered `purchasesApp` id.
|
|
13
|
+
|
|
14
|
+
| Tool | Operation | Confirmation |
|
|
15
|
+
| --- | --- | --- |
|
|
16
|
+
| `himi_iap_status` | Combined setup check: coded `ok`, `missing`, or `blocked` findings and fixes. Optional `dir`, built `plist`, and `visitorClient` provide binding and app-visibility evidence. | Read-only |
|
|
17
|
+
| `himi_iap_draft` | Read Wix items and Apple pricing; write a draft manifest. | No server writes |
|
|
18
|
+
| `himi_iap_plan` | Read Apple state; write a sealed plan for review. | No server writes |
|
|
19
|
+
| `himi_iap_apply` | Create/update products, have Catalog generate review screenshots, and by default submit for review. `noSubmit: true` skips submission. | `confirm: true` after user approval |
|
|
20
|
+
| `himi_iap_connect` | Preview registration, provider connection, mappings and optional config binding. Apply the reviewed setup with `confirm: true`. | Dry run by default |
|
|
21
|
+
| `himi_iap_mappings` | List mappings; supply `product` and `active` to turn one on/off. | Updates require `confirm: true` |
|
|
22
|
+
|
|
23
|
+
Draft/plan write local artifacts, so their MCP `readOnlyHint` is false. Mapping tools also
|
|
24
|
+
use false because they can update a mapping. Every tool that can replace files or external
|
|
25
|
+
state advertises `destructiveHint: true`, including mixed tools whose default is a list or dry
|
|
26
|
+
run. The host must obtain its own user consent; a model-supplied `confirm` is not proof of it.
|
|
27
|
+
|
|
28
|
+
Catalog generates review screenshots on the server; MCP has no local screenshot capture tool.
|
|
29
|
+
Managed plan/apply never read or upload local images.
|
|
30
|
+
|
|
31
|
+
IAP paths, including references inside a manifest/plan, always stay inside the
|
|
32
|
+
trusted workspace root. `HIMI_WORKSPACE` takes precedence; otherwise the host's workspace root
|
|
33
|
+
(or the server's working directory) is the boundary. Absolute paths, parent traversal and
|
|
34
|
+
symlinks that leave that boundary are refused before invoking the command. The hosted connector does
|
|
35
|
+
not gain these local tools.
|
|
36
|
+
|
|
37
|
+
Status never treats an unverified provider or Apple notification destination as ready. The
|
|
38
|
+
current provider contract lacks a read-only readiness method, and notification-destination
|
|
39
|
+
verification is not yet wired into the checker, so it reports `provider_check_unavailable` and
|
|
40
|
+
`notification_check_unavailable`. Managed connect can reuse a purchase key stored on the server;
|
|
41
|
+
if it is missing, it reports the onboarding blocker instead of opening a local key. See
|
|
42
|
+
[IAP products](iap-products.md#one-setup-check-and-mapping-controls).
|
|
43
|
+
|
|
44
|
+
Owner Wix authentication is separate from the publishing token minted by
|
|
45
|
+
`himi_login`. IAP uses the owner's Wix CLI session (`wix login`); that prerequisite is not
|
|
46
|
+
satisfied by signing in for draft publishing alone.
|
|
47
|
+
|
|
7
48
|
## Set it up
|
|
8
49
|
|
|
9
50
|
**Nothing to do for a new app.** `himi init` (and `himi agent-init` in an existing app) writes the
|
package/guides/iap-products.md
CHANGED
|
@@ -6,8 +6,8 @@ initial price and explicit territories. It then exports a Wix→Apple mapping fo
|
|
|
6
6
|
backend import.
|
|
7
7
|
|
|
8
8
|
It is an administration workflow, not a build: it never builds, signs or bumps a version,
|
|
9
|
-
and it runs anywhere `himi` is installed.
|
|
10
|
-
|
|
9
|
+
and it runs anywhere `himi` is installed. Catalog provisioning with the site's existing
|
|
10
|
+
Branded Apple connection is the default. `--profile` explicitly selects legacy local-key mode. It does not run during an app build or
|
|
11
11
|
a customer checkout.
|
|
12
12
|
|
|
13
13
|
It registers one-time **non-consumables**, and **consumable price tiers** for large
|
|
@@ -17,10 +17,10 @@ catalogs. Subscriptions are refused before anything reaches Apple.
|
|
|
17
17
|
|
|
18
18
|
- **The Apple app record already exists.** This command never creates apps or accounts,
|
|
19
19
|
and never accepts agreements.
|
|
20
|
-
- **
|
|
20
|
+
- **For explicit legacy mode, an App Store Connect API key for the account that owns the app.** Managing
|
|
21
21
|
in-app purchases needs the **Admin** or **App Manager** role (or Account Holder). A
|
|
22
22
|
user's role in the web UI does not grant it to a key.
|
|
23
|
-
- **
|
|
23
|
+
- **For explicit legacy mode, a credential profile for that key** at
|
|
24
24
|
`~/.himalaya/store-credentials/<name>.json`. It holds identifiers plus a path to the
|
|
25
25
|
`.p8`, never the key itself:
|
|
26
26
|
|
|
@@ -35,16 +35,27 @@ These key and profile prerequisites apply to direct Apple mode. There is **no am
|
|
|
35
35
|
|
|
36
36
|
## Managed provisioning through Catalog
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
Provisioning commands use managed mode when `--profile` is absent; `--managed`
|
|
39
|
+
remains an optional explicit spelling. `draft`, `plan`, `apply`, and `status`
|
|
40
|
+
read Apple through Catalog with `--purchases-app <registration-id>`. Wix catalog reads,
|
|
41
|
+
registration, provider connection, and mapping writes keep their existing owner-scoped services.
|
|
39
42
|
They use the manifest's Wix site and the site's existing Branded Apple connection. No local
|
|
40
43
|
credential profile or `.p8` is opened. `--profile` and `--managed` cannot be combined, and a
|
|
41
|
-
Catalog refusal never falls back to direct Apple mode.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
Catalog refusal never falls back to direct Apple mode. For `draft`, `plan`, `apply`, `status`
|
|
45
|
+
and `screenshots`, `--profile` also cannot be combined with explicit `--purchases-app` or
|
|
46
|
+
`--catalog-route` selectors: choose one mode. Legacy `connect` intentionally accepts a Catalog
|
|
47
|
+
route for its Wix mappings and an optional registration id to verify. Existing manifests retain their
|
|
48
|
+
`target.profile` and `target.teamId` fields for compatibility; new managed drafts omit them.
|
|
49
|
+
Those fields do not select managed credentials or identify a managed plan. Legacy mode still
|
|
50
|
+
requires both fields to match its explicit profile. A managed-only target returns
|
|
51
|
+
`credentials_unavailable` with instructions to use Catalog or add the matching legacy identity
|
|
52
|
+
before any profile or key is read.
|
|
44
53
|
|
|
45
54
|
Supply the assigned Catalog gateway prefix, including its
|
|
46
55
|
version segment, through `--catalog-route <assigned-prefix>` or `HIMI_IAP_CATALOG_ROUTE`.
|
|
47
|
-
|
|
56
|
+
Managed Catalog and purchases setup calls require the owner’s Wix user session. Standalone
|
|
57
|
+
Wix catalog reads and explicit legacy profile mode retain account API-key authentication.
|
|
58
|
+
There is no default route. During rollout some gateway nodes can return an empty 404. The CLI
|
|
48
59
|
does not retry it automatically; the owner reruns. Reads are safe to rerun, and writes
|
|
49
60
|
read state before creating resources.
|
|
50
61
|
|
|
@@ -61,12 +72,18 @@ send the requested amount, currency, territory and `EXACT`/`AT_LEAST` rule, neve
|
|
|
61
72
|
price-point id. Catalog reports `APPLIED` or `ALREADY_APPLIED`. Existing product locks,
|
|
62
73
|
read-before-write checks, plan review, confirmation and local apply locking still apply.
|
|
63
74
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
75
|
+
For the setup check, an Apple product whose metadata is complete remains configured while its
|
|
76
|
+
submission is waiting for review, in review, or waiting on an app version. This reports completed
|
|
77
|
+
setup, not Apple approval; Catalog readiness blockers still prevent an ok finding.
|
|
78
|
+
|
|
79
|
+
Managed apply finishes each configured item by asking Catalog to generate its App Review screenshot and, by
|
|
80
|
+
default, calling Catalog's Product `submit-for-review`. Pass `--no-submit` to provision and generate
|
|
81
|
+
the screenshot on the server without submitting for review. Catalog generates the image from the first
|
|
82
|
+
localization's display name. Managed plan and apply ignore local `reviewScreenshot` paths:
|
|
83
|
+
no image is read, rendered, or uploaded from the agent's machine. An already complete
|
|
84
|
+
screenshot is reused without replacement. Local capture is available only through the
|
|
85
|
+
explicit legacy `screenshots --profile` workflow. Older managed plans that sealed a local
|
|
86
|
+
image are refused before requests; generate and review a new plan for server generation.
|
|
70
87
|
|
|
71
88
|
Before any managed apply writes for an item, Catalog must have one active mapping for its
|
|
72
89
|
expected Wix item, SKU and type. Conflicts use the existing connect codes (`sku_in_use`,
|
|
@@ -88,6 +105,52 @@ mapping reports `catalog_mapping_missing`; create/reconcile mappings with `conne
|
|
|
88
105
|
managed submission. Other per-item failures include `catalog_screenshot_upload_failed` and
|
|
89
106
|
`catalog_submit_blocked` (see [JSON codes](himi-json-output.md)).
|
|
90
107
|
|
|
108
|
+
## One setup check and mapping controls
|
|
109
|
+
|
|
110
|
+
`check` combines the registration, stored purchase key, Catalog mappings, Apple product and
|
|
111
|
+
screenshot readiness, vertical sales rules, app visibility, and source/build binding in one
|
|
112
|
+
read-only report. Unlike `connect --dry-run`, it never reports the payment provider as planned
|
|
113
|
+
and counts that as readiness. Every finding carries `state: "ok" | "missing" | "blocked"`, a
|
|
114
|
+
stable `code`, and a `fix`; overall `code` is `ok` or `setup_incomplete` (exit 0 or 1).
|
|
115
|
+
|
|
116
|
+
```sh
|
|
117
|
+
himi store iap check --manifest ./iap-products.json --catalog-route <assigned-prefix> \
|
|
118
|
+
--content . --plist /path/to/Built.app/Info.plist --visitor-client <headless-client-id> --json
|
|
119
|
+
himi store iap mappings --site <msid> --purchases-app <registration-id> --catalog-route <assigned-prefix> --json
|
|
120
|
+
himi store iap mappings --site <msid> --purchases-app <registration-id> --catalog-route <assigned-prefix> \
|
|
121
|
+
--product <catalog-mapping-id> --active false --yes --json
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
`check` discovers the registration for the manifest's bundle on its site. An optional
|
|
125
|
+
`--purchases-app` must agree. `--content` inspects the authored config without executing it;
|
|
126
|
+
`--plist` checks the built Apple binding using macOS `plutil`; `--visitor-client` checks Serve
|
|
127
|
+
mapping visibility with a fresh anonymous visitor, not the owner's token. Missing evidence
|
|
128
|
+
stays blocked. A visitor check does not prove a particular signed-in member's checkout.
|
|
129
|
+
|
|
130
|
+
The current wix-iap contract exposes provider connection but no read-only provider-readiness
|
|
131
|
+
method, so `provider_check_unavailable` asks for verification in payment settings. Apple exposes notification URL attributes on its App resource, but this checker does not yet
|
|
132
|
+
compare them with a verified purchases-service destination. `notification_check_unavailable`
|
|
133
|
+
therefore asks for App Store Connect verification. These blockers prevent an unproven all-ready verdict. The checker is
|
|
134
|
+
shared with local MCP; it does not add a Serve GET route for these unavailable reads.
|
|
135
|
+
|
|
136
|
+
Mapping lists make no writes. On/off updates require confirmation and send only `active`
|
|
137
|
+
with Catalog's current revision, preserving the SKU, item identity, and metadata.
|
|
138
|
+
|
|
139
|
+
Managed `connect` never opens an Apple key on the Mac. It reuses an In-App Purchase key
|
|
140
|
+
already stored by purchases. If there is none, it reports `apple_key_missing`; an App Store
|
|
141
|
+
Connect API key is a different credential and cannot replace it. The purchases contract
|
|
142
|
+
supports encrypted key writes but not reading a key back, and Branded does not currently
|
|
143
|
+
provide a dedicated In-App Purchase key bridge. Provisioning that missing server key remains
|
|
144
|
+
a backend prerequisite. Explicit legacy `--profile` plus `--iap-key` remains available for
|
|
145
|
+
owner-driven onboarding. Supplying local key flags in managed mode is refused.
|
|
146
|
+
|
|
147
|
+
For a managed draft, pass the Catalog registration and route:
|
|
148
|
+
|
|
149
|
+
```sh
|
|
150
|
+
himi store iap draft --site <msid> --purchases-app <registration-id> --catalog-route <assigned-prefix> \
|
|
151
|
+
--apple-app <apple-id> --bundle <bundle-id> --base-territory USA --out ./iap-products.json
|
|
152
|
+
```
|
|
153
|
+
|
|
91
154
|
## Drafting the manifest from your Wix catalog
|
|
92
155
|
|
|
93
156
|
You don't have to write the manifest by hand. `draft` reads the site's whole catalog —
|
|
@@ -95,7 +158,7 @@ every page of Wix Stores (Catalog V3 or V1), Online Programs and Pricing Plans
|
|
|
95
158
|
a manifest of everything that can be sold:
|
|
96
159
|
|
|
97
160
|
```bash
|
|
98
|
-
himi store iap draft --site <msid> --
|
|
161
|
+
himi store iap draft --site <msid> --purchases-app <registration-id> --catalog-route <assigned-prefix> --apple-app 6450000001 \
|
|
99
162
|
--bundle com.example.fitclub --base-territory USA --territories USA,CAN --out ./iap-products.json
|
|
100
163
|
```
|
|
101
164
|
|
|
@@ -210,7 +273,9 @@ Rules, all checked locally before any request:
|
|
|
210
273
|
used twice, including a Wix entity mapped both directly and through a tier.
|
|
211
274
|
- **Unknown keys are refused, at every level.** So is any string that looks like a key or a token.
|
|
212
275
|
|
|
213
|
-
##
|
|
276
|
+
## Legacy workflow with a local profile
|
|
277
|
+
|
|
278
|
+
These examples explicitly select local-key mode. The managed examples above need no local Apple key.
|
|
214
279
|
|
|
215
280
|
```bash
|
|
216
281
|
himi store iap draft --site <msid> --profile fit-club-owner --apple-app 6450000001 --bundle com.example.fitclub --base-territory USA --out ./iap-products.json
|
|
@@ -294,9 +359,9 @@ hosts only ever get the file's bytes, never the API key's token.
|
|
|
294
359
|
the result. A refused image (`FAILED`) fails the step with Apple's reason. An image still
|
|
295
360
|
processing (`UPLOAD_COMPLETE`) counts as uploaded.
|
|
296
361
|
|
|
297
|
-
###
|
|
362
|
+
### Legacy local review screenshots: `screenshots --profile`
|
|
298
363
|
|
|
299
|
-
`himi store iap screenshots --manifest <file> --content <app dir>
|
|
364
|
+
`himi store iap screenshots --manifest <file> --content <app dir> --profile <name>` makes each
|
|
300
365
|
product's review screenshot from the app's own purchase screen, so nobody has to take them on a phone:
|
|
301
366
|
|
|
302
367
|
**One-time setup.** The screenshots are taken in a headless Chromium on your machine, so no phone,
|
|
@@ -327,12 +392,11 @@ before rendering anything and says so (`browser_unavailable`). A `--dry-run` doe
|
|
|
327
392
|
(the largest-iPhone App Store size). It then sets each item's `reviewScreenshot` to that file,
|
|
328
393
|
leaving the rest of the manifest as it was.
|
|
329
394
|
|
|
330
|
-
**Apple's price**
|
|
331
|
-
the manifest's `exact` amount. An `atLeast` item that Apple has no price for yet is skipped: run `apply`
|
|
395
|
+
**Apple's price** is read directly from App Store Connect with the explicit legacy `--profile`. If Apple has no observed price, the manifest's `exact` amount can be used. An `atLeast` item that Apple has no price for yet is skipped: run `apply`
|
|
332
396
|
first. A price tier has no single purchase screen and is skipped too.
|
|
333
397
|
|
|
334
398
|
**Other options:**
|
|
335
|
-
-
|
|
399
|
+
- A product that is live or in review keeps its screenshot: changing it there is a
|
|
336
400
|
conflict anyway.
|
|
337
401
|
- An item that already names a screenshot is kept unless you pass `--force`.
|
|
338
402
|
- `--only <productId,…>` limits the run; an id the manifest doesn't have is reported.
|
|
@@ -418,7 +482,8 @@ In order:
|
|
|
418
482
|
app platform-wide: if another app holds it (another site's, or another account's), that is a
|
|
419
483
|
`bundle_registered_elsewhere` conflict. Only that registration's owner can remove it; `connect`
|
|
420
484
|
never does.
|
|
421
|
-
2. **The In-App Purchase key.**
|
|
485
|
+
2. **The In-App Purchase key.** Managed mode reuses the server key, or reports `apple_key_missing`.
|
|
486
|
+
Legacy `--profile` mode stores `--iap-key` / `--iap-key-id` once, server-side. This is
|
|
422
487
|
an App Store Connect **In-App Purchase** key (Users and Access → Integrations → In-App
|
|
423
488
|
Purchase), not the App Store Connect API key `--profile` names; the service rejects that kind.
|
|
424
489
|
The issuer comes from the profile. Skipped when a key is already stored.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/himalaya-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1528.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "himi — the Himalaya authoring CLI. Build a Tier-5 content package on your own machine, push it to the production serve as a draft, preview it on web + Himi Player, and read worker logs back — the remote dev loop. Wraps @himalaya/serve-cli for transport.",
|
|
6
6
|
"keywords": [
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"artifactId": "himalaya-cli"
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
|
-
"falconPackageHash": "
|
|
74
|
+
"falconPackageHash": "977ce0e45046b28615366bb368c7ceb90d7a1f9404024a58bee20404"
|
|
75
75
|
}
|