@postonus/cli 0.1.56 → 0.1.57

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
@@ -12764,17 +12764,13 @@ function formatTable(headers, rows, isTty = process.stdout.isTTY) {
12764
12764
  }
12765
12765
 
12766
12766
  // src/version.ts
12767
- var CLI_VERSION = "0.1.56";
12767
+ var CLI_VERSION = "0.1.57";
12768
12768
 
12769
12769
  // src/client.ts
12770
12770
  var DEVICE_CODE_GRANT_TYPE = "urn:ietf:params:oauth:grant-type:device_code";
12771
12771
  async function requestToken(apiUrl, body) {
12772
12772
  const response = await fetch(`${apiUrl}/api/auth/oauth2/token`, {
12773
12773
  method: "POST",
12774
- // Form-encoded, not JSON. The token endpoint answers a JSON body with
12775
- // `UNSUPPORTED_MEDIA_TYPE` — RFC 6749 §4.1.3 specifies form encoding here, and
12776
- // better-auth enforces it. `/device/code` and `/oauth2/register` do take JSON,
12777
- // so the three calls in this flow are deliberately not all encoded the same way.
12778
12774
  headers: { "content-type": "application/x-www-form-urlencoded" },
12779
12775
  body: new URLSearchParams(body).toString()
12780
12776
  });
@@ -12793,8 +12789,6 @@ async function refreshAccessToken(apiUrl, clientId, refreshToken) {
12793
12789
  if (!result.ok || !result.tokens.access_token) return null;
12794
12790
  return {
12795
12791
  accessToken: result.tokens.access_token,
12796
- // Rotation is the default, but fall back to the token that just worked if
12797
- // the server ever omits it rather than treating that as a hard failure.
12798
12792
  refreshToken: result.tokens.refresh_token ?? refreshToken,
12799
12793
  expiresAt: Date.now() + result.tokens.expires_in * 1e3
12800
12794
  };
@@ -13053,8 +13047,6 @@ async function registerClient(apiUrl) {
13053
13047
  application_type: "native",
13054
13048
  grant_types: [DEVICE_CODE_GRANT_TYPE, "refresh_token"],
13055
13049
  scope: CLI_OAUTH_SCOPE,
13056
- // Self-registered clients default to the MCP resource; the CLI talks to
13057
- // `/api/v1` as well, so it must ask for that audience explicitly here.
13058
13050
  resources: cliAudiences(apiUrl)
13059
13051
  })
13060
13052
  });
@@ -13532,8 +13524,6 @@ async function mcpServe() {
13532
13524
  const headersFor = (currentAuth) => {
13533
13525
  const headers = new Headers({
13534
13526
  "content-type": "application/json",
13535
- // Both, because the endpoint may answer either way and refuses a request
13536
- // that accepts only one.
13537
13527
  accept: "application/json, text/event-stream",
13538
13528
  [CLI_VERSION_HEADER]: CLI_VERSION
13539
13529
  });
@@ -14047,7 +14037,6 @@ async function listQueue(options) {
14047
14037
  limit,
14048
14038
  direction: "forward",
14049
14039
  platforms: platforms.length > 0 ? platforms : void 0,
14050
- // The same default as MCP's `list_queue`: work the user can still act on.
14051
14040
  statuses: statuses.length > 0 ? statuses : ["DRAFT", "SCHEDULED", "FAILED"]
14052
14041
  });
14053
14042
  schedules = result.schedules;