@carrierllc/mcp 0.4.0 → 0.5.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.js
CHANGED
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
verifyStorefront,
|
|
40
40
|
walletScreen,
|
|
41
41
|
which
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-QZBALDKD.js";
|
|
43
43
|
import {
|
|
44
44
|
copyTree,
|
|
45
45
|
exists,
|
|
@@ -2938,6 +2938,65 @@ program.command("whoami").description("Show the account, org and scopes the curr
|
|
|
2938
2938
|
p3.note(r.text, "environment_info");
|
|
2939
2939
|
p3.outro("");
|
|
2940
2940
|
});
|
|
2941
|
+
var connectCmd = program.command("connect").description("Stripe Connect onboarding and status.");
|
|
2942
|
+
connectCmd.command("status").description("Show the authenticated operator's Stripe Connect status.").option("--json", "Print raw JSON").action(async (opts) => {
|
|
2943
|
+
if (!opts.json) header();
|
|
2944
|
+
const r = await callMcpTool("stripe_connect_status", {}, {
|
|
2945
|
+
errorHints: ["Sign in first: carrier login", "Start onboarding: carrier connect begin"]
|
|
2946
|
+
});
|
|
2947
|
+
if (!r.ok) {
|
|
2948
|
+
if (opts.json) console.error(r.text);
|
|
2949
|
+
else p3.log.error(r.text);
|
|
2950
|
+
process.exitCode = 1;
|
|
2951
|
+
return;
|
|
2952
|
+
}
|
|
2953
|
+
if (opts.json) process.stdout.write(`${r.text}
|
|
2954
|
+
`);
|
|
2955
|
+
else {
|
|
2956
|
+
p3.note(r.text, "Stripe Connect");
|
|
2957
|
+
p3.outro("");
|
|
2958
|
+
}
|
|
2959
|
+
});
|
|
2960
|
+
connectCmd.command("begin").description("Start or resume Stripe Connect onboarding and open the secure Stripe flow.").option("--type <type>", "Connected account type: express or standard", "express").option("--no-open", "Print the onboarding URL instead of opening it").action(async (opts) => {
|
|
2961
|
+
header();
|
|
2962
|
+
if (!["express", "standard"].includes(opts.type)) {
|
|
2963
|
+
p3.log.error("--type must be express or standard");
|
|
2964
|
+
process.exitCode = 2;
|
|
2965
|
+
return;
|
|
2966
|
+
}
|
|
2967
|
+
const r = await callMcpTool("stripe_connect_begin", { account_type: opts.type }, {
|
|
2968
|
+
errorHints: ["Sign in first: carrier login", "Check status: carrier connect status"]
|
|
2969
|
+
});
|
|
2970
|
+
if (!r.ok) {
|
|
2971
|
+
p3.log.error(r.text);
|
|
2972
|
+
process.exitCode = 1;
|
|
2973
|
+
return;
|
|
2974
|
+
}
|
|
2975
|
+
let data = {};
|
|
2976
|
+
try {
|
|
2977
|
+
data = JSON.parse(r.text);
|
|
2978
|
+
} catch {
|
|
2979
|
+
}
|
|
2980
|
+
if (!data.onboarding_url) {
|
|
2981
|
+
p3.log.error(r.text);
|
|
2982
|
+
process.exitCode = 1;
|
|
2983
|
+
return;
|
|
2984
|
+
}
|
|
2985
|
+
if (opts.open) {
|
|
2986
|
+
const opened = await openUrl(data.onboarding_url);
|
|
2987
|
+
if (opened.ok) ok(opened.hint);
|
|
2988
|
+
else p3.note(data.onboarding_url, "Open this secure Stripe URL");
|
|
2989
|
+
} else {
|
|
2990
|
+
process.stdout.write(`${data.onboarding_url}
|
|
2991
|
+
`);
|
|
2992
|
+
}
|
|
2993
|
+
p3.note([
|
|
2994
|
+
`Account: ${data.account_id ?? "created by Stripe"}`,
|
|
2995
|
+
data.account_created ? "A new connected account was created." : "Resuming the existing account.",
|
|
2996
|
+
"After Stripe: carrier connect status"
|
|
2997
|
+
].join("\n"), "Onboarding");
|
|
2998
|
+
p3.outro("");
|
|
2999
|
+
});
|
|
2941
3000
|
var openCmd = program.command("open").description("Open Carrier account / product URLs in your browser.");
|
|
2942
3001
|
for (const [name, url, desc] of [
|
|
2943
3002
|
["signup", SIGN_UP_URL, "Create a Carrier account (Clerk sign-up)"],
|