@postonus/cli 0.1.12 → 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 CHANGED
@@ -8139,7 +8139,7 @@ var PublicScheduleStatusSchema = _enum(["SCHEDULED", "DRAFT", "FAILED"]);
8139
8139
  var CalendarTokenPathParam = object({ token: string2().min(1) });
8140
8140
  var CalendarReadInputSchema = CalendarTokenPathParam.extend({ accessKey: string2().optional() });
8141
8141
  var CalendarScheduleReadInputSchema = CalendarReadInputSchema.extend({ postScheduleId: Uuid });
8142
- var ReviewerIdentityShape = {
8142
+ var ReviewerIdentityFields = {
8143
8143
  reviewerName: string2().trim().min(1).max(100),
8144
8144
  // Not optional. A decision with no email identifies nobody, so it can be
8145
8145
  // neither deduplicated nor attributed.
@@ -8205,7 +8205,7 @@ var PublicCalendarSchema = object({
8205
8205
  schedules: array(PublicScheduleSchema)
8206
8206
  });
8207
8207
  var SubmitDecisionInputSchema = CalendarScheduleReadInputSchema.extend({
8208
- ...ReviewerIdentityShape,
8208
+ ...ReviewerIdentityFields,
8209
8209
  decision: PostReviewDecisionSchema,
8210
8210
  comment: string2().trim().max(2e3).optional().nullable()
8211
8211
  });
@@ -8214,7 +8214,7 @@ var SubmitDecisionOutputSchema = object({
8214
8214
  approvalStatus: PostApprovalStatusSchema
8215
8215
  });
8216
8216
  var AddCommentInputSchema = CalendarScheduleReadInputSchema.extend({
8217
- ...ReviewerIdentityShape,
8217
+ ...ReviewerIdentityFields,
8218
8218
  content: string2().trim().min(1).max(2e3)
8219
8219
  });
8220
8220
  var AddCommentOutputSchema = object({
@@ -11983,7 +11983,7 @@ function formatTable(headers, rows) {
11983
11983
  }
11984
11984
 
11985
11985
  // src/version.ts
11986
- var CLI_VERSION = "0.1.12";
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(error2) {
12091
- if (error2 instanceof ORPCError3) {
12092
- if (error2.code === "UNAUTHORIZED") {
12093
- return error2.message || "Sign-in expired or not valid. Run `postonus login` again.";
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 (error2.code === "RATE_LIMITED") {
12096
- return `Rate limit reached. ${error2.message}`;
12095
+ if (cause.code === "RATE_LIMITED") {
12096
+ return `Rate limit reached. ${cause.message}`;
12097
12097
  }
12098
- return error2.message;
12098
+ return cause.message;
12099
12099
  }
12100
- if (error2 instanceof Error) {
12101
- if (error2.message === "fetch failed") {
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 error2.message;
12104
+ return cause.message;
12105
12105
  }
12106
- return String(error2);
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
- (error2) => exit(error2 instanceof Error ? error2 : new Error(String(error2)))
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((error2) => {
12626
+ const pending = forward(line).catch((cause) => {
12627
12627
  const id = incoming.id ?? null;
12628
- const detail = error2 instanceof Error ? error2.message : String(error2);
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
  `);