@mercuryo-ai/magicpay-cli 0.1.3 → 0.1.5
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/README.md +86 -46
- package/package.json +14 -6
package/README.md
CHANGED
|
@@ -1,56 +1,96 @@
|
|
|
1
1
|
# @mercuryo-ai/magicpay-cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Protected-form CLI for prepared browser pages.
|
|
4
4
|
|
|
5
|
-
|
|
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.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
8
|
+
Use it when you need to:
|
|
9
|
+
|
|
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.
|
|
15
|
+
|
|
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.
|
|
11
19
|
|
|
12
20
|
## Install
|
|
13
21
|
|
|
14
22
|
```bash
|
|
15
|
-
npm i -g @mercuryo-ai/magicpay-cli
|
|
16
|
-
|
|
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
|
|
33
|
+
magicpay init <magicpay-api-key>
|
|
34
|
+
magicpay status
|
|
35
|
+
```
|
|
36
|
+
|
|
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
|
|
42
|
+
|
|
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
|
|
53
|
+
|
|
54
|
+
Example:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
magicpay attach <cdp-url>
|
|
58
|
+
magicpay start-session "Checkout"
|
|
59
|
+
magicpay find-form
|
|
60
|
+
magicpay request-secret <fillRef> <storedSecretRef> --merchant-name "Example Store"
|
|
61
|
+
magicpay poll-secret <requestId>
|
|
62
|
+
magicpay fill-secret <fillRef> <requestId>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
If `find-form` does not return the right candidates, refresh the catalog and
|
|
66
|
+
retry:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
magicpay get-secrets-catalog
|
|
70
|
+
magicpay find-form
|
|
17
71
|
```
|
|
18
72
|
|
|
19
|
-
##
|
|
20
|
-
|
|
21
|
-
-
|
|
22
|
-
- `status`
|
|
23
|
-
- `
|
|
24
|
-
- `
|
|
25
|
-
|
|
26
|
-
- `
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
- `
|
|
32
|
-
- `
|
|
33
|
-
- `
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
`magicpay status` stays quiet about CLI updates by default. When a newer npm
|
|
45
|
-
release is available, it includes a short English notice and the suggested
|
|
46
|
-
update command.
|
|
47
|
-
|
|
48
|
-
## Architecture boundary
|
|
49
|
-
|
|
50
|
-
- `magicpay` is the operator CLI for workflow sessions, approvals, protected
|
|
51
|
-
secret handling, and narrow form completion on the current page.
|
|
52
|
-
- `@mercuryo-ai/agentbrowse` owns browser primitives and the reusable browser
|
|
53
|
-
session store API.
|
|
54
|
-
- `@mercuryo-ai/magicpay-sdk` owns reusable MagicPay API and flow helpers.
|
|
55
|
-
- `@mercuryo-ai/magicpay-cli` owns branded payment CLI orchestration and the
|
|
56
|
-
payment-safe command UX on top of the shared `~/.magicpay` home.
|
|
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.
|
|
82
|
+
|
|
83
|
+
## Command Groups
|
|
84
|
+
|
|
85
|
+
- Setup and diagnostics: `init`, `status`, `doctor`
|
|
86
|
+
- Session control: `attach`, `start-session`, `end-session`
|
|
87
|
+
- Protected form flow: `find-form`, `get-secrets-catalog`, `request-secret`,
|
|
88
|
+
`poll-secret`, `fill-secret`, `submit-form`
|
|
89
|
+
- Development-only helpers: `mock-approve-secret`, `mock-deny-secret`
|
|
90
|
+
|
|
91
|
+
## Companion Tools
|
|
92
|
+
|
|
93
|
+
- You only need browser navigation, observation, or extraction:
|
|
94
|
+
use `@mercuryo-ai/agentbrowse-cli`
|
|
95
|
+
- You want one CLI for both browser work and protected fills:
|
|
96
|
+
use `@mercuryo-ai/magicpay-agent-cli`
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mercuryo-ai/magicpay-cli",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.5",
|
|
4
|
+
"description": "Protected-form CLI for prepared browser pages",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"bin": {
|
|
@@ -23,16 +23,24 @@
|
|
|
23
23
|
"publishConfig": {
|
|
24
24
|
"access": "public"
|
|
25
25
|
},
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "git+https://github.com/MercuryoAI/skills.git"
|
|
29
|
+
},
|
|
30
|
+
"homepage": "https://agents.mercuryo.io/docs/agents",
|
|
31
|
+
"bugs": {
|
|
32
|
+
"url": "https://github.com/MercuryoAI/skills/issues"
|
|
33
|
+
},
|
|
26
34
|
"engines": {
|
|
27
35
|
"node": ">=18.0.0"
|
|
28
36
|
},
|
|
29
37
|
"dependencies": {
|
|
30
38
|
"@browserbasehq/stagehand": "^3.0.0",
|
|
31
39
|
"dotenv": "^16.4.0",
|
|
32
|
-
"@mercuryo-ai/
|
|
33
|
-
"@mercuryo-ai/magicpay-
|
|
34
|
-
"@mercuryo-ai/
|
|
35
|
-
"@mercuryo-ai/
|
|
40
|
+
"@mercuryo-ai/magicpay-sdk": "0.1.0-test.6",
|
|
41
|
+
"@mercuryo-ai/magicpay-home": "0.1.6",
|
|
42
|
+
"@mercuryo-ai/agentbrowse": "0.2.53",
|
|
43
|
+
"@mercuryo-ai/captcha-solver": "0.1.1"
|
|
36
44
|
},
|
|
37
45
|
"devDependencies": {
|
|
38
46
|
"@types/node": "^22.0.0",
|