@ghostpaw/email 0.5.8 → 0.5.10
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 +7 -3
- package/dist/cli.js +150 -117
- package/dist/mcp-server.js +2 -1
- package/dist/mcp.cjs +2 -1
- package/dist/mcp.d.cts +2 -0
- package/dist/mcp.d.ts +2 -0
- package/dist/mcp.js +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -102,7 +102,11 @@ These 33 paths map to the 5 aligned tools. Action verbs set the tool's action;
|
|
|
102
102
|
`draft` sets `save_draft`. Search accepts its query as a positional argument.
|
|
103
103
|
Other fields use kebab-case flags, such as `--folder INBOX --uids 1 --uids 2`
|
|
104
104
|
and `--input @message.json` for a compose payload. Arrays accept repeated
|
|
105
|
-
flags or JSON; objects accept JSON
|
|
105
|
+
flags or JSON; objects accept JSON. Values are literal, including a leading
|
|
106
|
+
`@`. Two flags read files: `--input` on the `mail` compose verbs and `--body`
|
|
107
|
+
on `compose send|reply|draft`. On those, `@path` reads the file, `@-` reads
|
|
108
|
+
stdin and `@@text` passes `@text`; help marks them `(@file, @- stdin, @@ literal @)`. An
|
|
109
|
+
empty or unreadable path exits 2. A single `-` reads stdin JSON;
|
|
106
110
|
explicit flags override stdin fields. `--` ends option parsing.
|
|
107
111
|
|
|
108
112
|
Global flags for the new commands: `--db <path>`, `--json`, `--quiet`,
|
|
@@ -195,7 +199,7 @@ irm https://raw.githubusercontent.com/GhostPawJS/email/main/install.ps1 | iex
|
|
|
195
199
|
Pinned to a release:
|
|
196
200
|
|
|
197
201
|
```sh
|
|
198
|
-
curl -fsSL https://raw.githubusercontent.com/GhostPawJS/email/main/install.sh | sh -s -- --target linux-x64 --version 0.5.
|
|
202
|
+
curl -fsSL https://raw.githubusercontent.com/GhostPawJS/email/main/install.sh | sh -s -- --target linux-x64 --version 0.5.10 && export PATH="$HOME/.local/bin:$PATH"
|
|
199
203
|
```
|
|
200
204
|
|
|
201
205
|
Also adding ~/.local/bin to ~/.profile (edits ~/.profile once; skipped if it already mentions ~/.local/bin; zsh login shells read ~/.zprofile instead, so use that file name there):
|
|
@@ -212,7 +216,7 @@ $env:GHOSTPAW_NO_MODIFY_PATH=1; irm https://raw.githubusercontent.com/GhostPawJS
|
|
|
212
216
|
|
|
213
217
|
```text
|
|
214
218
|
$ ghostpaw-email --version
|
|
215
|
-
email 0.5.
|
|
219
|
+
email 0.5.10 (binary, linux-x64)
|
|
216
220
|
```
|
|
217
221
|
|
|
218
222
|
Scripts that compare versions should use `--version --short` or `--version --json`.
|
package/dist/cli.js
CHANGED
|
@@ -808,7 +808,7 @@ var init_cli_version = __esm({
|
|
|
808
808
|
var emailVersion;
|
|
809
809
|
var init_version = __esm({
|
|
810
810
|
"src/version.ts"() {
|
|
811
|
-
emailVersion = "0.5.
|
|
811
|
+
emailVersion = "0.5.10";
|
|
812
812
|
}
|
|
813
813
|
});
|
|
814
814
|
function getConfigDir() {
|
|
@@ -1228,6 +1228,7 @@ var init_errors2 = __esm({
|
|
|
1228
1228
|
missing_required_flag: 1,
|
|
1229
1229
|
invalid_flag_value: 1,
|
|
1230
1230
|
body_required: 1,
|
|
1231
|
+
invalid_file_value: 2,
|
|
1231
1232
|
unknown_subaction: 1
|
|
1232
1233
|
};
|
|
1233
1234
|
CliError = class extends Error {
|
|
@@ -1242,6 +1243,120 @@ var init_errors2 = __esm({
|
|
|
1242
1243
|
};
|
|
1243
1244
|
}
|
|
1244
1245
|
});
|
|
1246
|
+
function readFileValue(raw2, name) {
|
|
1247
|
+
if (!raw2.startsWith("@")) return raw2;
|
|
1248
|
+
if (raw2.startsWith("@@")) return raw2.slice(1);
|
|
1249
|
+
const path = raw2.slice(1);
|
|
1250
|
+
if (!path) throw new CliUsageError(`Empty file path for ${name}; use @@ for a literal leading @`);
|
|
1251
|
+
try {
|
|
1252
|
+
return readFileSync(path === "-" ? 0 : path, "utf8");
|
|
1253
|
+
} catch {
|
|
1254
|
+
throw new CliUsageError(
|
|
1255
|
+
`Cannot read value file for ${name}: ${path} (use @@ for a literal leading @)`
|
|
1256
|
+
);
|
|
1257
|
+
}
|
|
1258
|
+
}
|
|
1259
|
+
function parseCliArgs(argv2, spec) {
|
|
1260
|
+
const values = {};
|
|
1261
|
+
const positions = [];
|
|
1262
|
+
const flags = spec.flags ?? [];
|
|
1263
|
+
const convert = (raw2, arg) => {
|
|
1264
|
+
const value = arg.file ? readFileValue(raw2, arg.name) : raw2;
|
|
1265
|
+
let result = value;
|
|
1266
|
+
if (arg.type === "number" || arg.type === "integer") {
|
|
1267
|
+
result = Number(value);
|
|
1268
|
+
if (!value.trim() || !Number.isFinite(result) || arg.type === "integer" && !Number.isInteger(result))
|
|
1269
|
+
throw new CliUsageError(`Expected ${arg.type} for ${arg.name}: ${value}`);
|
|
1270
|
+
} else if (arg.type === "boolean") {
|
|
1271
|
+
if (!["true", "false"].includes(value))
|
|
1272
|
+
throw new CliUsageError(`Expected boolean for ${arg.name}`);
|
|
1273
|
+
result = value === "true";
|
|
1274
|
+
} else if (arg.type === "json") {
|
|
1275
|
+
try {
|
|
1276
|
+
result = JSON.parse(value);
|
|
1277
|
+
} catch {
|
|
1278
|
+
throw new CliUsageError(`Invalid JSON for ${arg.name}`);
|
|
1279
|
+
}
|
|
1280
|
+
}
|
|
1281
|
+
if (arg.enum && !arg.enum.includes(result))
|
|
1282
|
+
throw new CliUsageError(`${arg.name} must be one of: ${arg.enum.join(", ")}`);
|
|
1283
|
+
return result;
|
|
1284
|
+
};
|
|
1285
|
+
let ended = false;
|
|
1286
|
+
for (let i2 = 0; i2 < argv2.length; i2++) {
|
|
1287
|
+
const token = argv2[i2];
|
|
1288
|
+
if (!ended && token === "--") {
|
|
1289
|
+
ended = true;
|
|
1290
|
+
continue;
|
|
1291
|
+
}
|
|
1292
|
+
if (ended || token === "-" || !token.startsWith("-")) {
|
|
1293
|
+
positions.push(token);
|
|
1294
|
+
continue;
|
|
1295
|
+
}
|
|
1296
|
+
const [flag, inline] = token.split(/=(.*)/s);
|
|
1297
|
+
const negative = flag?.startsWith("--no-");
|
|
1298
|
+
const name = flag?.replace(/^--?/, "").replace(/^no-/, "");
|
|
1299
|
+
const arg = flags.find(
|
|
1300
|
+
(entry) => entry.name === name || keyOf(entry.name) === name || entry.short === name
|
|
1301
|
+
);
|
|
1302
|
+
if (!arg) {
|
|
1303
|
+
const prefix = (name ?? "").slice(0, 3);
|
|
1304
|
+
const suggestion = prefix ? flags.find((entry) => entry.name.startsWith(prefix)) : void 0;
|
|
1305
|
+
throw new CliUsageError(
|
|
1306
|
+
`Unknown flag: ${flag}${suggestion ? `; did you mean --${suggestion.name}?` : ""}`
|
|
1307
|
+
);
|
|
1308
|
+
}
|
|
1309
|
+
if (negative && arg.type !== "boolean")
|
|
1310
|
+
throw new CliUsageError(`--no-${arg.name} requires a boolean flag`);
|
|
1311
|
+
let raw2 = inline;
|
|
1312
|
+
if (arg.type === "boolean" && raw2 === void 0) raw2 = negative ? "false" : "true";
|
|
1313
|
+
if (raw2 === void 0) {
|
|
1314
|
+
const next = argv2[i2 + 1];
|
|
1315
|
+
if (next === void 0 || /^--[a-z]/i.test(next))
|
|
1316
|
+
throw new CliUsageError(`Missing value: --${arg.name}`);
|
|
1317
|
+
raw2 = next;
|
|
1318
|
+
i2++;
|
|
1319
|
+
}
|
|
1320
|
+
const key = keyOf(arg.name);
|
|
1321
|
+
if (arg.type === "array") {
|
|
1322
|
+
const item = convert(raw2, { ...arg, type: arg.itemType ?? "string" });
|
|
1323
|
+
values[key] = [...values[key] ?? [], item];
|
|
1324
|
+
} else values[key] = convert(raw2, arg);
|
|
1325
|
+
}
|
|
1326
|
+
let index = 0;
|
|
1327
|
+
for (const arg of spec.positionals ?? []) {
|
|
1328
|
+
if (index >= positions.length) continue;
|
|
1329
|
+
values[keyOf(arg.name)] = arg.variadic ? positions.slice(index).map((value) => convert(value, { ...arg, type: arg.itemType ?? arg.type })) : convert(positions[index], arg);
|
|
1330
|
+
index = arg.variadic ? positions.length : index + 1;
|
|
1331
|
+
}
|
|
1332
|
+
if (index < positions.length)
|
|
1333
|
+
throw new CliUsageError(`Unexpected positional: ${positions[index]}`);
|
|
1334
|
+
for (const arg of [...flags, ...spec.positionals ?? []]) {
|
|
1335
|
+
if (arg.required && values[keyOf(arg.name)] === void 0)
|
|
1336
|
+
throw new CliUsageError(`Missing required argument: ${arg.name}`);
|
|
1337
|
+
}
|
|
1338
|
+
return values;
|
|
1339
|
+
}
|
|
1340
|
+
function renderCliHelp(spec) {
|
|
1341
|
+
const describe = (arg) => `${arg.type}${arg.enum ? ` (${arg.enum.join("|")})` : ""}${arg.required ? " required" : ""}${arg.file ? " (@file, @- stdin, @@ literal @)" : ""} ${arg.description ?? ""}`;
|
|
1342
|
+
return `Usage: ${spec.command} ${(spec.positionals ?? []).map((arg) => `<${arg.name}${arg.variadic ? "..." : ""}>`).join(" ")} [flags]
|
|
1343
|
+
${spec.description ?? ""}
|
|
1344
|
+
|
|
1345
|
+
Positionals:
|
|
1346
|
+
${(spec.positionals ?? []).map((arg) => ` ${arg.name} ${describe(arg)}`).join("\n")}
|
|
1347
|
+
Flags:
|
|
1348
|
+
${(spec.flags ?? []).map((arg) => ` --${arg.name}${arg.short ? `, -${arg.short}` : ""} ${describe(arg)}`).join("\n")}
|
|
1349
|
+
`;
|
|
1350
|
+
}
|
|
1351
|
+
var CliUsageError, keyOf;
|
|
1352
|
+
var init_cli_args = __esm({
|
|
1353
|
+
"src/surfaces/cli_args.ts"() {
|
|
1354
|
+
CliUsageError = class extends Error {
|
|
1355
|
+
exitCode = 2;
|
|
1356
|
+
};
|
|
1357
|
+
keyOf = (name) => name.replace(/-([a-z])/g, (_3, c3) => c3.toUpperCase());
|
|
1358
|
+
}
|
|
1359
|
+
});
|
|
1245
1360
|
|
|
1246
1361
|
// src/surfaces/schema_example.ts
|
|
1247
1362
|
function schemaExample(schema, seed = {}) {
|
|
@@ -7157,114 +7272,6 @@ var init_write = __esm({
|
|
|
7157
7272
|
init_store();
|
|
7158
7273
|
}
|
|
7159
7274
|
});
|
|
7160
|
-
function parseCliArgs(argv2, spec) {
|
|
7161
|
-
const values = {};
|
|
7162
|
-
const positions = [];
|
|
7163
|
-
const flags = spec.flags ?? [];
|
|
7164
|
-
const convert = (raw2, arg) => {
|
|
7165
|
-
let value = raw2;
|
|
7166
|
-
if (raw2.startsWith("@")) {
|
|
7167
|
-
try {
|
|
7168
|
-
value = readFileSync(raw2.slice(1), "utf8");
|
|
7169
|
-
} catch {
|
|
7170
|
-
throw new CliUsageError(`Cannot read value file: ${raw2.slice(1)}`);
|
|
7171
|
-
}
|
|
7172
|
-
}
|
|
7173
|
-
let result = value;
|
|
7174
|
-
if (arg.type === "number" || arg.type === "integer") {
|
|
7175
|
-
result = Number(value);
|
|
7176
|
-
if (!value.trim() || !Number.isFinite(result) || arg.type === "integer" && !Number.isInteger(result))
|
|
7177
|
-
throw new CliUsageError(`Expected ${arg.type} for ${arg.name}: ${value}`);
|
|
7178
|
-
} else if (arg.type === "boolean") {
|
|
7179
|
-
if (!["true", "false"].includes(value))
|
|
7180
|
-
throw new CliUsageError(`Expected boolean for ${arg.name}`);
|
|
7181
|
-
result = value === "true";
|
|
7182
|
-
} else if (arg.type === "json") {
|
|
7183
|
-
try {
|
|
7184
|
-
result = JSON.parse(value);
|
|
7185
|
-
} catch {
|
|
7186
|
-
throw new CliUsageError(`Invalid JSON for ${arg.name}`);
|
|
7187
|
-
}
|
|
7188
|
-
}
|
|
7189
|
-
if (arg.enum && !arg.enum.includes(result))
|
|
7190
|
-
throw new CliUsageError(`${arg.name} must be one of: ${arg.enum.join(", ")}`);
|
|
7191
|
-
return result;
|
|
7192
|
-
};
|
|
7193
|
-
let ended = false;
|
|
7194
|
-
for (let i2 = 0; i2 < argv2.length; i2++) {
|
|
7195
|
-
const token = argv2[i2];
|
|
7196
|
-
if (!ended && token === "--") {
|
|
7197
|
-
ended = true;
|
|
7198
|
-
continue;
|
|
7199
|
-
}
|
|
7200
|
-
if (ended || token === "-" || !token.startsWith("-")) {
|
|
7201
|
-
positions.push(token);
|
|
7202
|
-
continue;
|
|
7203
|
-
}
|
|
7204
|
-
const [flag, inline] = token.split(/=(.*)/s);
|
|
7205
|
-
const negative = flag?.startsWith("--no-");
|
|
7206
|
-
const name = flag?.replace(/^--?/, "").replace(/^no-/, "");
|
|
7207
|
-
const arg = flags.find(
|
|
7208
|
-
(entry) => entry.name === name || keyOf(entry.name) === name || entry.short === name
|
|
7209
|
-
);
|
|
7210
|
-
if (!arg) {
|
|
7211
|
-
const prefix = (name ?? "").slice(0, 3);
|
|
7212
|
-
const suggestion = prefix ? flags.find((entry) => entry.name.startsWith(prefix)) : void 0;
|
|
7213
|
-
throw new CliUsageError(
|
|
7214
|
-
`Unknown flag: ${flag}${suggestion ? `; did you mean --${suggestion.name}?` : ""}`
|
|
7215
|
-
);
|
|
7216
|
-
}
|
|
7217
|
-
if (negative && arg.type !== "boolean")
|
|
7218
|
-
throw new CliUsageError(`--no-${arg.name} requires a boolean flag`);
|
|
7219
|
-
let raw2 = inline;
|
|
7220
|
-
if (arg.type === "boolean" && raw2 === void 0) raw2 = negative ? "false" : "true";
|
|
7221
|
-
if (raw2 === void 0) {
|
|
7222
|
-
const next = argv2[i2 + 1];
|
|
7223
|
-
if (next === void 0 || /^--[a-z]/i.test(next))
|
|
7224
|
-
throw new CliUsageError(`Missing value: --${arg.name}`);
|
|
7225
|
-
raw2 = next;
|
|
7226
|
-
i2++;
|
|
7227
|
-
}
|
|
7228
|
-
const key = keyOf(arg.name);
|
|
7229
|
-
if (arg.type === "array") {
|
|
7230
|
-
const item = convert(raw2, { ...arg, type: arg.itemType ?? "string" });
|
|
7231
|
-
values[key] = [...values[key] ?? [], item];
|
|
7232
|
-
} else values[key] = convert(raw2, arg);
|
|
7233
|
-
}
|
|
7234
|
-
let index = 0;
|
|
7235
|
-
for (const arg of spec.positionals ?? []) {
|
|
7236
|
-
if (index >= positions.length) continue;
|
|
7237
|
-
values[keyOf(arg.name)] = arg.variadic ? positions.slice(index).map((value) => convert(value, { ...arg, type: arg.itemType ?? arg.type })) : convert(positions[index], arg);
|
|
7238
|
-
index = arg.variadic ? positions.length : index + 1;
|
|
7239
|
-
}
|
|
7240
|
-
if (index < positions.length)
|
|
7241
|
-
throw new CliUsageError(`Unexpected positional: ${positions[index]}`);
|
|
7242
|
-
for (const arg of [...flags, ...spec.positionals ?? []]) {
|
|
7243
|
-
if (arg.required && values[keyOf(arg.name)] === void 0)
|
|
7244
|
-
throw new CliUsageError(`Missing required argument: ${arg.name}`);
|
|
7245
|
-
}
|
|
7246
|
-
return values;
|
|
7247
|
-
}
|
|
7248
|
-
function renderCliHelp(spec) {
|
|
7249
|
-
const describe = (arg) => `${arg.type}${arg.enum ? ` (${arg.enum.join("|")})` : ""}${arg.required ? " required" : ""} ${arg.description ?? ""}`;
|
|
7250
|
-
return `Usage: ${spec.command} ${(spec.positionals ?? []).map((arg) => `<${arg.name}${arg.variadic ? "..." : ""}>`).join(" ")} [flags]
|
|
7251
|
-
${spec.description ?? ""}
|
|
7252
|
-
|
|
7253
|
-
Positionals:
|
|
7254
|
-
${(spec.positionals ?? []).map((arg) => ` ${arg.name} ${describe(arg)}`).join("\n")}
|
|
7255
|
-
Flags:
|
|
7256
|
-
${(spec.flags ?? []).map((arg) => ` --${arg.name}${arg.short ? `, -${arg.short}` : ""} ${describe(arg)}`).join("\n")}
|
|
7257
|
-
`;
|
|
7258
|
-
}
|
|
7259
|
-
var CliUsageError, keyOf;
|
|
7260
|
-
var init_cli_args = __esm({
|
|
7261
|
-
"src/surfaces/cli_args.ts"() {
|
|
7262
|
-
CliUsageError = class extends Error {
|
|
7263
|
-
exitCode = 2;
|
|
7264
|
-
};
|
|
7265
|
-
keyOf = (name) => name.replace(/-([a-z])/g, (_3, c3) => c3.toUpperCase());
|
|
7266
|
-
}
|
|
7267
|
-
});
|
|
7268
7275
|
|
|
7269
7276
|
// src/surfaces/cli_commands.ts
|
|
7270
7277
|
function cliCommands(tools) {
|
|
@@ -7353,6 +7360,9 @@ async function runCliCommand(argv2, options) {
|
|
|
7353
7360
|
type: schema.type === "object" || !schema.type ? "json" : schema.type,
|
|
7354
7361
|
description: schema.description,
|
|
7355
7362
|
enum: schema.enum,
|
|
7363
|
+
...command.tool.cli?.fileArgs?.includes(
|
|
7364
|
+
name.replace(/-([a-z])/g, (_3, c3) => c3.toUpperCase())
|
|
7365
|
+
) ? { file: true } : {},
|
|
7356
7366
|
...schema.items?.type ? { itemType: schema.items.type } : {}
|
|
7357
7367
|
});
|
|
7358
7368
|
const properties = command.tool.inputSchema.properties ?? {};
|
|
@@ -8388,8 +8398,10 @@ var init_email_skill_short = __esm({
|
|
|
8388
8398
|
emailSkillShort = `# ghostpaw-email cheat sheet
|
|
8389
8399
|
Version: ${emailVersion}
|
|
8390
8400
|
|
|
8391
|
-
Install (
|
|
8392
|
-
|
|
8401
|
+
Install the release binary (checks SHA256SUMS; Linux/macOS installs to ~/.local/bin):
|
|
8402
|
+
curl -fsSL https://raw.githubusercontent.com/GhostPawJS/email/main/install.sh | sh
|
|
8403
|
+
Windows: irm https://raw.githubusercontent.com/GhostPawJS/email/main/install.ps1 | iex
|
|
8404
|
+
Node 24+: npm install -g @ghostpaw/email
|
|
8393
8405
|
Check version:
|
|
8394
8406
|
ghostpaw-email --version
|
|
8395
8407
|
|
|
@@ -8500,6 +8512,7 @@ var init_email_surface_tools = __esm({
|
|
|
8500
8512
|
noun: "mail",
|
|
8501
8513
|
verb: tool.name.slice(5),
|
|
8502
8514
|
...tool.name === "mail_search" ? { positionals: ["query"] } : {},
|
|
8515
|
+
...tool.name === "mail_compose" ? { fileArgs: ["input"] } : {},
|
|
8503
8516
|
...tool.inputSchema.properties?.action?.enum ? {
|
|
8504
8517
|
action: {
|
|
8505
8518
|
property: "action",
|
|
@@ -10753,6 +10766,9 @@ function redactAuth(auth) {
|
|
|
10753
10766
|
return { type: "sasl", mechanism: auth.mechanism, credentials: "[redacted]" };
|
|
10754
10767
|
}
|
|
10755
10768
|
|
|
10769
|
+
// src/cli/commands/compose.ts
|
|
10770
|
+
init_cli_args();
|
|
10771
|
+
|
|
10756
10772
|
// src/tools/index.ts
|
|
10757
10773
|
init_aligned();
|
|
10758
10774
|
|
|
@@ -11007,7 +11023,10 @@ var composeCommand = defineCommand({
|
|
|
11007
11023
|
...sharedArgs,
|
|
11008
11024
|
to: { type: "string", description: "Recipient(s), comma-separated", required: true },
|
|
11009
11025
|
subject: { type: "string", description: "Email subject", required: true },
|
|
11010
|
-
body: {
|
|
11026
|
+
body: {
|
|
11027
|
+
type: "string",
|
|
11028
|
+
description: "Email body text (or pipe via stdin) (@file, @- stdin, @@ literal @)"
|
|
11029
|
+
},
|
|
11011
11030
|
html: { type: "boolean", description: "Treat body as HTML", default: false },
|
|
11012
11031
|
cc: { type: "string", description: "CC recipient(s), comma-separated" },
|
|
11013
11032
|
bcc: { type: "string", description: "BCC recipient(s), comma-separated" },
|
|
@@ -11047,7 +11066,10 @@ var composeCommand = defineCommand({
|
|
|
11047
11066
|
...sharedArgs,
|
|
11048
11067
|
folder: { type: "string", description: "Source folder", required: true },
|
|
11049
11068
|
uid: { type: "string", description: "Source message UID", required: true },
|
|
11050
|
-
body: {
|
|
11069
|
+
body: {
|
|
11070
|
+
type: "string",
|
|
11071
|
+
description: "Reply body (or pipe via stdin) (@file, @- stdin, @@ literal @)"
|
|
11072
|
+
},
|
|
11051
11073
|
html: { type: "boolean", description: "Treat body as HTML", default: false },
|
|
11052
11074
|
to: { type: "string", description: "Override recipient(s)" },
|
|
11053
11075
|
cc: { type: "string", description: "CC recipient(s)" },
|
|
@@ -11103,7 +11125,7 @@ var composeCommand = defineCommand({
|
|
|
11103
11125
|
const args = _args;
|
|
11104
11126
|
await safeRun(_args, async () => {
|
|
11105
11127
|
const uid = parseUid(args.uid);
|
|
11106
|
-
const body = await resolveBody(args.body, false);
|
|
11128
|
+
const body = await resolveBody(args.body, false, false);
|
|
11107
11129
|
const mode = args.mode;
|
|
11108
11130
|
if (mode !== void 0 && mode !== "inline" && mode !== "attachment") {
|
|
11109
11131
|
throw new CliError("invalid_flag_value", '--mode must be "inline" or "attachment".');
|
|
@@ -11136,7 +11158,10 @@ var composeCommand = defineCommand({
|
|
|
11136
11158
|
"update-draft": { type: "string", description: "UID of draft to update" },
|
|
11137
11159
|
to: { type: "string", description: "Recipient(s), comma-separated" },
|
|
11138
11160
|
subject: { type: "string", description: "Email subject" },
|
|
11139
|
-
body: {
|
|
11161
|
+
body: {
|
|
11162
|
+
type: "string",
|
|
11163
|
+
description: "Draft body (or pipe via stdin) (@file, @- stdin, @@ literal @)"
|
|
11164
|
+
},
|
|
11140
11165
|
html: { type: "boolean", description: "Treat body as HTML", default: false },
|
|
11141
11166
|
cc: { type: "string", description: "CC recipient(s)" },
|
|
11142
11167
|
from: { type: "string", description: "From address" }
|
|
@@ -11192,8 +11217,16 @@ var composeCommand = defineCommand({
|
|
|
11192
11217
|
})
|
|
11193
11218
|
}
|
|
11194
11219
|
});
|
|
11195
|
-
|
|
11196
|
-
|
|
11220
|
+
function bodyValue(raw2) {
|
|
11221
|
+
try {
|
|
11222
|
+
return readFileValue(raw2, "body");
|
|
11223
|
+
} catch (error) {
|
|
11224
|
+
if (error instanceof CliUsageError) throw new CliError("invalid_file_value", error.message);
|
|
11225
|
+
throw error;
|
|
11226
|
+
}
|
|
11227
|
+
}
|
|
11228
|
+
async function resolveBody(flagValue, required = true, fileCapable = true) {
|
|
11229
|
+
if (flagValue !== void 0) return fileCapable ? bodyValue(flagValue) : flagValue;
|
|
11197
11230
|
if (isStdinPiped()) return readStdin();
|
|
11198
11231
|
if (required) {
|
|
11199
11232
|
throw new CliError(
|
package/dist/mcp-server.js
CHANGED
|
@@ -316,7 +316,7 @@ var init_mcp_stdio = __esm({
|
|
|
316
316
|
var emailVersion;
|
|
317
317
|
var init_version = __esm({
|
|
318
318
|
"src/version.ts"() {
|
|
319
|
-
emailVersion = "0.5.
|
|
319
|
+
emailVersion = "0.5.10";
|
|
320
320
|
}
|
|
321
321
|
});
|
|
322
322
|
|
|
@@ -2285,6 +2285,7 @@ var init_errors2 = __esm({
|
|
|
2285
2285
|
missing_required_flag: 1,
|
|
2286
2286
|
invalid_flag_value: 1,
|
|
2287
2287
|
body_required: 1,
|
|
2288
|
+
invalid_file_value: 2,
|
|
2288
2289
|
unknown_subaction: 1
|
|
2289
2290
|
};
|
|
2290
2291
|
CliError = class extends Error {
|
package/dist/mcp.cjs
CHANGED
|
@@ -1038,6 +1038,7 @@ var init_errors2 = __esm({
|
|
|
1038
1038
|
missing_required_flag: 1,
|
|
1039
1039
|
invalid_flag_value: 1,
|
|
1040
1040
|
body_required: 1,
|
|
1041
|
+
invalid_file_value: 2,
|
|
1041
1042
|
unknown_subaction: 1
|
|
1042
1043
|
};
|
|
1043
1044
|
CliError = class extends Error {
|
|
@@ -5007,7 +5008,7 @@ var init_network = __esm({
|
|
|
5007
5008
|
});
|
|
5008
5009
|
|
|
5009
5010
|
// src/version.ts
|
|
5010
|
-
var emailVersion = "0.5.
|
|
5011
|
+
var emailVersion = "0.5.10";
|
|
5011
5012
|
|
|
5012
5013
|
// src/surface/email_mcp_instructions.ts
|
|
5013
5014
|
var emailMcpInstructions = "Read and search cached email offline. Configure live accounts with email account add before network operations. Inspect messages before replying or changing folders. Confirm recipients and content before sending; trash and folder deletion can remove mail. Credentials use the existing email CLI account configuration or EMAIL_* environment variables.";
|
package/dist/mcp.d.cts
CHANGED
|
@@ -23,6 +23,8 @@ interface SurfaceTool<TCtx> {
|
|
|
23
23
|
noun?: string;
|
|
24
24
|
verb: string;
|
|
25
25
|
positionals?: string[];
|
|
26
|
+
/** Input properties whose CLI value may be `@path`, `@-` or `@@text`; every other value is literal. */
|
|
27
|
+
fileArgs?: readonly string[];
|
|
26
28
|
action?: {
|
|
27
29
|
property: string;
|
|
28
30
|
verbs?: Record<string, string>;
|
package/dist/mcp.d.ts
CHANGED
|
@@ -23,6 +23,8 @@ interface SurfaceTool<TCtx> {
|
|
|
23
23
|
noun?: string;
|
|
24
24
|
verb: string;
|
|
25
25
|
positionals?: string[];
|
|
26
|
+
/** Input properties whose CLI value may be `@path`, `@-` or `@@text`; every other value is literal. */
|
|
27
|
+
fileArgs?: readonly string[];
|
|
26
28
|
action?: {
|
|
27
29
|
property: string;
|
|
28
30
|
verbs?: Record<string, string>;
|
package/dist/mcp.js
CHANGED
|
@@ -1014,6 +1014,7 @@ var init_errors2 = __esm({
|
|
|
1014
1014
|
missing_required_flag: 1,
|
|
1015
1015
|
invalid_flag_value: 1,
|
|
1016
1016
|
body_required: 1,
|
|
1017
|
+
invalid_file_value: 2,
|
|
1017
1018
|
unknown_subaction: 1
|
|
1018
1019
|
};
|
|
1019
1020
|
CliError = class extends Error {
|
|
@@ -4983,7 +4984,7 @@ var init_network = __esm({
|
|
|
4983
4984
|
});
|
|
4984
4985
|
|
|
4985
4986
|
// src/version.ts
|
|
4986
|
-
var emailVersion = "0.5.
|
|
4987
|
+
var emailVersion = "0.5.10";
|
|
4987
4988
|
|
|
4988
4989
|
// src/surface/email_mcp_instructions.ts
|
|
4989
4990
|
var emailMcpInstructions = "Read and search cached email offline. Configure live accounts with email account add before network operations. Inspect messages before replying or changing folders. Confirm recipients and content before sending; trash and folder deletion can remove mail. Credentials use the existing email CLI account configuration or EMAIL_* environment variables.";
|
package/package.json
CHANGED