@mercuryo-ai/magicpay-cli 0.1.4 → 0.1.6

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 (2) hide show
  1. package/README.md +53 -33
  2. package/package.json +6 -6
package/README.md CHANGED
@@ -1,38 +1,55 @@
1
1
  # @mercuryo-ai/magicpay-cli
2
2
 
3
- Protected-form CLI for MagicPay sessions, approvals, and one-time secret fills.
3
+ Protected-form CLI for prepared browser pages.
4
4
 
5
- Choose this package when the browser is already at the correct login, identity,
6
- or payment form and you want MagicPay to handle the protected part of the flow.
7
- If you still need browser navigation and page interaction, pair it with
8
- `@mercuryo-ai/agentbrowse-cli` or use `@mercuryo-ai/magicpay-agent-cli`.
5
+ MagicPay CLI is for the part of a workflow that handles approved stored values
6
+ on a login, identity, or payment form that is already open in the browser.
9
7
 
10
- ## Before You Start
8
+ Use it when you need to:
11
9
 
12
- - Node.js 18 or newer
13
- - A MagicPay account. Create it at `https://agents.mercuryo.io/signup`, then
14
- create an API key in the dashboard.
15
- - A browser page that is already at the protected step you want to complete
10
+ - attach to an already prepared browser page;
11
+ - bind the page to a workflow session;
12
+ - discover the supported protected form;
13
+ - request approval for stored values;
14
+ - fill the approved values through the guarded protected-form flow.
16
15
 
17
- ## Install And Initialize
16
+ MagicPay is focused on the protected step itself. Reach the target page first
17
+ with another browsing tool or an existing browser session, then hand the form
18
+ over to MagicPay.
19
+
20
+ ## Install
18
21
 
19
22
  ```bash
20
23
  npm i -g @mercuryo-ai/magicpay-cli@latest
24
+ ```
25
+
26
+ ## API Setup
27
+
28
+ Configure the API key once:
29
+
30
+ Get an account and API key at `https://agents.mercuryo.io/signup`.
31
+
32
+ ```bash
21
33
  magicpay init <magicpay-api-key>
22
- magicpay --version
23
34
  magicpay status
24
35
  ```
25
36
 
26
- ## Typical Flow
37
+ `magicpay status` is the normal readiness check before a protected-form task.
38
+ Use `magicpay doctor` only when `init` or `status` still fail and you need to
39
+ inspect the local config.
40
+
41
+ ## Core Flow
27
42
 
28
- 1. Attach to the already running browser page.
29
- 2. Start a workflow session.
30
- 3. Find the protected form.
31
- 4. Refresh the secrets catalog only if candidates are missing or stale.
32
- 5. Request approval for one secret.
33
- 6. Poll until the request is fulfilled or terminal.
34
- 7. Run `fill-secret`.
35
- 8. Use `submit-form` only as manual recovery if the normal flow still needs it.
43
+ 1. `magicpay attach <cdp-url>`
44
+ 2. `magicpay start-session [name]`
45
+ 3. `magicpay find-form`
46
+ 4. `magicpay get-secrets-catalog` only if candidates are missing or stale
47
+ 5. `magicpay request-secret <fillRef> <storedSecretRef> --merchant-name <name>`
48
+ 6. `magicpay poll-secret <requestId>`
49
+ 7. `magicpay fill-secret <fillRef> <requestId>`
50
+ 8. `magicpay submit-form <fillRef>` only if the guarded fill flow explicitly
51
+ leaves submission unfinished
52
+ 9. `magicpay end-session` when the protected step is complete
36
53
 
37
54
  Example:
38
55
 
@@ -40,35 +57,38 @@ Example:
40
57
  magicpay attach <cdp-url>
41
58
  magicpay start-session "Checkout"
42
59
  magicpay find-form
43
- magicpay get-secrets-catalog
44
60
  magicpay request-secret <fillRef> <storedSecretRef> --merchant-name "Example Store"
45
61
  magicpay poll-secret <requestId>
46
62
  magicpay fill-secret <fillRef> <requestId>
47
63
  ```
48
64
 
49
- ## Verify And Troubleshoot
50
-
51
- Use these checks first:
65
+ If `find-form` does not return the right candidates, refresh the catalog and
66
+ retry:
52
67
 
53
68
  ```bash
54
- magicpay --version
55
- magicpay status
69
+ magicpay get-secrets-catalog
70
+ magicpay find-form
56
71
  ```
57
72
 
58
- Use `magicpay doctor` only when `init` or `status` still fail and you need to
59
- inspect the local MagicPay config. `mock-approve-secret` and
60
- `mock-deny-secret` are development-only helpers, not production approval flows.
73
+ ## Operating Rules
74
+
75
+ - Start from a prepared page, not from generic browser navigation.
76
+ - Use `magicpay status` before a new protected-form task.
77
+ - Re-run `magicpay find-form` after meaningful page changes.
78
+ - Treat `magicpay submit-form` as manual recovery, not as the default happy
79
+ path.
80
+ - `mock-approve-secret` and `mock-deny-secret` are development-only helpers,
81
+ not production approval flows.
61
82
 
62
83
  ## Command Groups
63
84
 
64
85
  - Setup and diagnostics: `init`, `status`, `doctor`
65
86
  - Session control: `attach`, `start-session`, `end-session`
66
87
  - Protected form flow: `find-form`, `get-secrets-catalog`, `request-secret`,
67
- `poll-secret`, `fill-secret`
88
+ `poll-secret`, `fill-secret`, `submit-form`
68
89
  - Development-only helpers: `mock-approve-secret`, `mock-deny-secret`
69
- - Manual recovery: `submit-form`
70
90
 
71
- ## Choose Another Package When
91
+ ## Companion Tools
72
92
 
73
93
  - You only need browser navigation, observation, or extraction:
74
94
  use `@mercuryo-ai/agentbrowse-cli`
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mercuryo-ai/magicpay-cli",
3
- "version": "0.1.4",
4
- "description": "MagicPay CLI payment/session/secrets shell with narrow protected-form completion",
3
+ "version": "0.1.6",
4
+ "description": "Protected-form CLI for prepared browser pages",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "bin": {
@@ -37,10 +37,10 @@
37
37
  "dependencies": {
38
38
  "@browserbasehq/stagehand": "^3.0.0",
39
39
  "dotenv": "^16.4.0",
40
- "@mercuryo-ai/magicpay-sdk": "0.1.0-test.5",
41
- "@mercuryo-ai/magicpay-home": "0.1.6",
42
- "@mercuryo-ai/agentbrowse": "0.2.53",
43
- "@mercuryo-ai/captcha-solver": "0.1.1"
40
+ "@mercuryo-ai/magicpay-sdk": "0.1.0-test.7",
41
+ "@mercuryo-ai/magicpay-home": "0.1.7",
42
+ "@mercuryo-ai/agentbrowse": "0.2.54",
43
+ "@mercuryo-ai/captcha-solver": "0.1.2"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/node": "^22.0.0",