@postonus/cli 0.1.8 → 0.1.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/dist/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11983,7 +11983,7 @@ function formatTable(headers, rows) {
|
|
|
11983
11983
|
}
|
|
11984
11984
|
|
|
11985
11985
|
// src/version.ts
|
|
11986
|
-
var CLI_VERSION = "0.1.
|
|
11986
|
+
var CLI_VERSION = "0.1.10";
|
|
11987
11987
|
|
|
11988
11988
|
// src/client.ts
|
|
11989
11989
|
var DEVICE_CODE_GRANT_TYPE = "urn:ietf:params:oauth:grant-type:device_code";
|
|
@@ -12567,6 +12567,8 @@ function parseIncoming(message) {
|
|
|
12567
12567
|
return {};
|
|
12568
12568
|
}
|
|
12569
12569
|
}
|
|
12570
|
+
var write = (message) => process.stdout.write(`${message}
|
|
12571
|
+
`);
|
|
12570
12572
|
async function mcpServe() {
|
|
12571
12573
|
const { apiUrl, auth } = await getApi();
|
|
12572
12574
|
const endpoint = `${apiUrl}/api/mcp`;
|
|
@@ -12577,8 +12579,6 @@ async function mcpServe() {
|
|
|
12577
12579
|
const send = oauth ? createOAuthFetch(apiUrl, oauth, persistRefreshedTokens(apiUrl, oauth)) : (request, init) => fetch(request, init);
|
|
12578
12580
|
let protocolVersion;
|
|
12579
12581
|
let sessionId;
|
|
12580
|
-
const write = (message) => process.stdout.write(`${message}
|
|
12581
|
-
`);
|
|
12582
12582
|
const headersFor = (currentAuth) => new Headers({
|
|
12583
12583
|
"content-type": "application/json",
|
|
12584
12584
|
// Both, because the endpoint may answer either way and refuses a request
|
|
@@ -12639,7 +12639,7 @@ function contentTypeFor(path) {
|
|
|
12639
12639
|
if (extensions.includes(extension)) return mime;
|
|
12640
12640
|
}
|
|
12641
12641
|
const supported = Object.values(FILE_TYPE_EXTENSIONS).flat().join(", ");
|
|
12642
|
-
fail(`Unsupported file type "${extension || basename(path)}". Supported: ${supported}`);
|
|
12642
|
+
return fail(`Unsupported file type "${extension || basename(path)}". Supported: ${supported}`);
|
|
12643
12643
|
}
|
|
12644
12644
|
function mediaTypeFor(contentType) {
|
|
12645
12645
|
if (contentType === "image/gif") return "GIF";
|
|
@@ -12756,7 +12756,7 @@ import { join as join2 } from "path";
|
|
|
12756
12756
|
async function resolveContent(text, options) {
|
|
12757
12757
|
if (options.file) {
|
|
12758
12758
|
const content = await readFile2(options.file, "utf8").catch(() => {
|
|
12759
|
-
fail(`Could not read ${options.file}`);
|
|
12759
|
+
return fail(`Could not read ${options.file}`);
|
|
12760
12760
|
});
|
|
12761
12761
|
return content.trim();
|
|
12762
12762
|
}
|
|
@@ -12771,7 +12771,7 @@ async function resolveContent(text, options) {
|
|
|
12771
12771
|
const piped = Buffer.concat(chunks).toString("utf8").trim();
|
|
12772
12772
|
if (piped) return piped;
|
|
12773
12773
|
}
|
|
12774
|
-
failUsage("No content. Pass text, --file <path>, --editor, or pipe it in.");
|
|
12774
|
+
return failUsage("No content. Pass text, --file <path>, --editor, or pipe it in.");
|
|
12775
12775
|
}
|
|
12776
12776
|
async function openEditor(initial) {
|
|
12777
12777
|
const editor = process.env.VISUAL || process.env.EDITOR;
|
|
@@ -12806,13 +12806,13 @@ function resolveSchedule(options) {
|
|
|
12806
12806
|
if (options.at) {
|
|
12807
12807
|
const when = new Date(options.at);
|
|
12808
12808
|
if (Number.isNaN(when.getTime())) {
|
|
12809
|
-
failUsage(`Could not read "${options.at}" as a date. Use an ISO timestamp, e.g. 2026-08-01T09:30:00Z.`);
|
|
12809
|
+
return failUsage(`Could not read "${options.at}" as a date. Use an ISO timestamp, e.g. 2026-08-01T09:30:00Z.`);
|
|
12810
12810
|
}
|
|
12811
|
-
if (when.getTime() <= Date.now()) failUsage("That time is in the past.");
|
|
12811
|
+
if (when.getTime() <= Date.now()) return failUsage("That time is in the past.");
|
|
12812
12812
|
return { postAction: "SCHEDULED_TIME", scheduledAt: when };
|
|
12813
12813
|
}
|
|
12814
12814
|
if (options.optimal) return { postAction: "NEXT_WINDOW" };
|
|
12815
|
-
failUsage("Say when to post: --at <ISO time>, --optimal, or --draft.");
|
|
12815
|
+
return failUsage("Say when to post: --at <ISO time>, --optimal, or --draft.");
|
|
12816
12816
|
}
|
|
12817
12817
|
async function post(text, options) {
|
|
12818
12818
|
if (options.at && options.optimal) failUsage("Use either --at or --optimal, not both.");
|