@agenticmail/cli 0.9.36 → 0.9.37
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 +76 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -4927,6 +4927,75 @@ var NON_INTERACTIVE = false;
|
|
|
4927
4927
|
function nonInteractiveDefault(value) {
|
|
4928
4928
|
return NON_INTERACTIVE ? value : null;
|
|
4929
4929
|
}
|
|
4930
|
+
async function cmdSetupRelay() {
|
|
4931
|
+
const args = process.argv.slice(3);
|
|
4932
|
+
if (args.some((a) => a === "--help" || a === "-h" || a === "help")) {
|
|
4933
|
+
log2("");
|
|
4934
|
+
log2(` ${c2.pinkBg(" \u{1F380} agenticmail setup-relay ")}`);
|
|
4935
|
+
log2("");
|
|
4936
|
+
log2(` ${c2.bold("Usage:")} agenticmail setup-relay`);
|
|
4937
|
+
log2("");
|
|
4938
|
+
log2(` Adds (or updates) the Gmail / Outlook / custom relay AgenticMail uses`);
|
|
4939
|
+
log2(` to send mail to the public internet. Run this YOURSELF \u2014 never paste`);
|
|
4940
|
+
log2(` the Gmail app password into an agent's chat (it would end up in the`);
|
|
4941
|
+
log2(` LLM's context / logs / conversation history).`);
|
|
4942
|
+
log2("");
|
|
4943
|
+
log2(` Password input is hidden (raw-mode stdin). The agent never sees it.`);
|
|
4944
|
+
log2("");
|
|
4945
|
+
log2(` Prereq: AgenticMail already bootstrapped (run \`agenticmail setup\` first).`);
|
|
4946
|
+
log2("");
|
|
4947
|
+
return;
|
|
4948
|
+
}
|
|
4949
|
+
const configPath = join(homedir(), ".agenticmail", "config.json");
|
|
4950
|
+
if (!existsSync2(configPath)) {
|
|
4951
|
+
log2("");
|
|
4952
|
+
fail2(`AgenticMail isn't set up yet \u2014 no config at ${c2.dim(configPath)}`);
|
|
4953
|
+
log2(` Run ${c2.cyan("agenticmail setup")} first, then come back to add the relay.`);
|
|
4954
|
+
log2("");
|
|
4955
|
+
process.exit(1);
|
|
4956
|
+
}
|
|
4957
|
+
let config;
|
|
4958
|
+
try {
|
|
4959
|
+
config = JSON.parse(readFileSync2(configPath, "utf-8"));
|
|
4960
|
+
} catch (err) {
|
|
4961
|
+
log2("");
|
|
4962
|
+
fail2(`Could not read ${configPath}: ${err.message}`);
|
|
4963
|
+
log2("");
|
|
4964
|
+
process.exit(1);
|
|
4965
|
+
}
|
|
4966
|
+
log2("");
|
|
4967
|
+
log2(` ${c2.bold("\u{1F380} AgenticMail \u2014 set up Gmail relay")} `);
|
|
4968
|
+
log2("");
|
|
4969
|
+
log2(` ${c2.dim("This command runs entirely in your terminal. The password")}`);
|
|
4970
|
+
log2(` ${c2.dim("input is hidden and never leaves this process \u2014 your agent")}`);
|
|
4971
|
+
log2(` ${c2.dim("doesn't see it.")}`);
|
|
4972
|
+
log2("");
|
|
4973
|
+
try {
|
|
4974
|
+
const result = await setupRelay(config);
|
|
4975
|
+
if (!result.success) {
|
|
4976
|
+
log2("");
|
|
4977
|
+
fail2("Relay setup did not complete \u2014 see messages above.");
|
|
4978
|
+
process.exit(1);
|
|
4979
|
+
}
|
|
4980
|
+
log2("");
|
|
4981
|
+
ok2("Gmail relay configured.");
|
|
4982
|
+
log2("");
|
|
4983
|
+
log2(` ${c2.bold("Next:")} point bridge-escalation alerts at your personal email:`);
|
|
4984
|
+
log2("");
|
|
4985
|
+
log2(` ${c2.cyan("Option A")} \u2014 tell your host agent: "set my operator notification email to <you@gmail.com>"`);
|
|
4986
|
+
log2(` ${c2.cyan("Option B")} \u2014 open the web UI \u2192 click your avatar \u2192 ${c2.bold("Alert email")} \u2192 type, Save`);
|
|
4987
|
+
log2("");
|
|
4988
|
+
log2(` ${c2.dim("Either path writes ~/.agenticmail/operator-prefs.json \u2014 the dispatcher")}`);
|
|
4989
|
+
log2(` ${c2.dim("forwards a digest there when sub-agents mail your bridge and the")}`);
|
|
4990
|
+
log2(` ${c2.dim("dispatcher can't resume your host session.")}`);
|
|
4991
|
+
log2("");
|
|
4992
|
+
} catch (err) {
|
|
4993
|
+
log2("");
|
|
4994
|
+
fail2(`Setup-relay failed: ${err.message}`);
|
|
4995
|
+
log2("");
|
|
4996
|
+
process.exit(1);
|
|
4997
|
+
}
|
|
4998
|
+
}
|
|
4930
4999
|
async function cmdSetup() {
|
|
4931
5000
|
const setupArgs = process.argv.slice(3);
|
|
4932
5001
|
if (setupArgs.some((a) => a === "--help" || a === "-h" || a === "help")) {
|
|
@@ -7392,6 +7461,13 @@ switch (command) {
|
|
|
7392
7461
|
process.exit(1);
|
|
7393
7462
|
});
|
|
7394
7463
|
break;
|
|
7464
|
+
case "setup-relay":
|
|
7465
|
+
case "relay":
|
|
7466
|
+
cmdSetupRelay().catch((err) => {
|
|
7467
|
+
console.error(err);
|
|
7468
|
+
process.exit(1);
|
|
7469
|
+
});
|
|
7470
|
+
break;
|
|
7395
7471
|
case "start":
|
|
7396
7472
|
cmdStart().catch((err) => {
|
|
7397
7473
|
console.error(err);
|
package/package.json
CHANGED