@postonus/cli 0.1.13 → 0.1.14
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 +15 -15
- 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.14";
|
|
11987
11987
|
|
|
11988
11988
|
// src/client.ts
|
|
11989
11989
|
var DEVICE_CODE_GRANT_TYPE = "urn:ietf:params:oauth:grant-type:device_code";
|
|
@@ -12087,23 +12087,23 @@ async function getApi() {
|
|
|
12087
12087
|
const auth = { kind: "oauth", accessToken, refreshToken, clientId };
|
|
12088
12088
|
return { api: buildClient(apiUrl, auth), apiUrl, auth, config: config2 };
|
|
12089
12089
|
}
|
|
12090
|
-
function describeError(
|
|
12091
|
-
if (
|
|
12092
|
-
if (
|
|
12093
|
-
return
|
|
12090
|
+
function describeError(cause) {
|
|
12091
|
+
if (cause instanceof ORPCError3) {
|
|
12092
|
+
if (cause.code === "UNAUTHORIZED") {
|
|
12093
|
+
return cause.message || "Sign-in expired or not valid. Run `postonus login` again.";
|
|
12094
12094
|
}
|
|
12095
|
-
if (
|
|
12096
|
-
return `Rate limit reached. ${
|
|
12095
|
+
if (cause.code === "RATE_LIMITED") {
|
|
12096
|
+
return `Rate limit reached. ${cause.message}`;
|
|
12097
12097
|
}
|
|
12098
|
-
return
|
|
12098
|
+
return cause.message;
|
|
12099
12099
|
}
|
|
12100
|
-
if (
|
|
12101
|
-
if (
|
|
12100
|
+
if (cause instanceof Error) {
|
|
12101
|
+
if (cause.message === "fetch failed") {
|
|
12102
12102
|
return "Could not reach Postonus. Check your connection, or POSTONUS_API_URL if you set it.";
|
|
12103
12103
|
}
|
|
12104
|
-
return
|
|
12104
|
+
return cause.message;
|
|
12105
12105
|
}
|
|
12106
|
-
return String(
|
|
12106
|
+
return String(cause);
|
|
12107
12107
|
}
|
|
12108
12108
|
|
|
12109
12109
|
// src/ui.tsx
|
|
@@ -12292,7 +12292,7 @@ function LoginPrompt({ device, run }) {
|
|
|
12292
12292
|
React2.useEffect(() => {
|
|
12293
12293
|
run().then(
|
|
12294
12294
|
() => exit(),
|
|
12295
|
-
(
|
|
12295
|
+
(cause) => exit(cause instanceof Error ? cause : new Error(String(cause)))
|
|
12296
12296
|
);
|
|
12297
12297
|
}, []);
|
|
12298
12298
|
return /* @__PURE__ */ jsxs2(Box2, { flexDirection: "column", gap: 1, paddingY: 1, children: [
|
|
@@ -12623,9 +12623,9 @@ async function mcpServe() {
|
|
|
12623
12623
|
for await (const line of lines) {
|
|
12624
12624
|
if (line.trim().length === 0) continue;
|
|
12625
12625
|
const incoming = parseIncoming(line);
|
|
12626
|
-
const pending = forward(line).catch((
|
|
12626
|
+
const pending = forward(line).catch((cause) => {
|
|
12627
12627
|
const id = incoming.id ?? null;
|
|
12628
|
-
const detail =
|
|
12628
|
+
const detail = cause instanceof Error ? cause.message : String(cause);
|
|
12629
12629
|
if (id === null) {
|
|
12630
12630
|
process.stderr.write(`postonus mcp: ${detail}
|
|
12631
12631
|
`);
|