@postonus/cli 0.1.56 → 0.1.58

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
@@ -7494,6 +7494,13 @@ var ExportAnalyticsInputSchema = object({
7494
7494
  period: AnalyticsPeriodSchema.optional(),
7495
7495
  format: AnalyticsExportFormatSchema.optional()
7496
7496
  });
7497
+ var TrackEventInputSchema = object({
7498
+ name: string2(),
7499
+ properties: record(string2(), JsonValueSchema).optional()
7500
+ });
7501
+ var TrackEventOutputSchema = object({
7502
+ success: boolean2()
7503
+ });
7497
7504
  var publicTagged = base.route({ tags: ["Analytics"] });
7498
7505
  var internal3 = publicTagged.meta({ internal: true });
7499
7506
  var analyticsTakeawayErrors = {
@@ -7510,7 +7517,8 @@ var analyticsTakeawayErrors = {
7510
7517
  var analyticsContract = {
7511
7518
  getSummary: publicTagged.route({ method: "GET", path: "/analytics/summary", summary: "Get workspace analytics summary" }).errors(orgErrors).input(GetAnalyticsSummaryInputSchema).output(AnalyticsSummarySchema),
7512
7519
  generateTakeaways: internal3.route({ method: "POST", path: "/analytics/takeaways", summary: "Generate AI analytics takeaways" }).errors(analyticsTakeawayErrors).input(GenerateAnalyticsTakeawaysInputSchema).output(AnalyticsTakeawaysSchema),
7513
- exportData: publicTagged.route({ method: "GET", path: "/analytics/export", summary: "Export workspace analytics data" }).errors(orgErrors).input(ExportAnalyticsInputSchema).output(AnalyticsExportSchema)
7520
+ exportData: publicTagged.route({ method: "GET", path: "/analytics/export", summary: "Export workspace analytics data" }).errors(orgErrors).input(ExportAnalyticsInputSchema).output(AnalyticsExportSchema),
7521
+ track: publicTagged.route({ method: "POST", path: "/analytics/track", summary: "Track a client or extension telemetry event" }).errors(orgErrors).input(TrackEventInputSchema).output(TrackEventOutputSchema)
7514
7522
  };
7515
7523
 
7516
7524
  // ../../packages/api-contract/src/api-keys.ts
@@ -12764,17 +12772,13 @@ function formatTable(headers, rows, isTty = process.stdout.isTTY) {
12764
12772
  }
12765
12773
 
12766
12774
  // src/version.ts
12767
- var CLI_VERSION = "0.1.56";
12775
+ var CLI_VERSION = "0.1.58";
12768
12776
 
12769
12777
  // src/client.ts
12770
12778
  var DEVICE_CODE_GRANT_TYPE = "urn:ietf:params:oauth:grant-type:device_code";
12771
12779
  async function requestToken(apiUrl, body) {
12772
12780
  const response = await fetch(`${apiUrl}/api/auth/oauth2/token`, {
12773
12781
  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
12782
  headers: { "content-type": "application/x-www-form-urlencoded" },
12779
12783
  body: new URLSearchParams(body).toString()
12780
12784
  });
@@ -12793,8 +12797,6 @@ async function refreshAccessToken(apiUrl, clientId, refreshToken) {
12793
12797
  if (!result.ok || !result.tokens.access_token) return null;
12794
12798
  return {
12795
12799
  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
12800
  refreshToken: result.tokens.refresh_token ?? refreshToken,
12799
12801
  expiresAt: Date.now() + result.tokens.expires_in * 1e3
12800
12802
  };
@@ -13053,8 +13055,6 @@ async function registerClient(apiUrl) {
13053
13055
  application_type: "native",
13054
13056
  grant_types: [DEVICE_CODE_GRANT_TYPE, "refresh_token"],
13055
13057
  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
13058
  resources: cliAudiences(apiUrl)
13059
13059
  })
13060
13060
  });
@@ -13532,8 +13532,6 @@ async function mcpServe() {
13532
13532
  const headersFor = (currentAuth) => {
13533
13533
  const headers = new Headers({
13534
13534
  "content-type": "application/json",
13535
- // Both, because the endpoint may answer either way and refuses a request
13536
- // that accepts only one.
13537
13535
  accept: "application/json, text/event-stream",
13538
13536
  [CLI_VERSION_HEADER]: CLI_VERSION
13539
13537
  });
@@ -14047,7 +14045,6 @@ async function listQueue(options) {
14047
14045
  limit,
14048
14046
  direction: "forward",
14049
14047
  platforms: platforms.length > 0 ? platforms : void 0,
14050
- // The same default as MCP's `list_queue`: work the user can still act on.
14051
14048
  statuses: statuses.length > 0 ? statuses : ["DRAFT", "SCHEDULED", "FAILED"]
14052
14049
  });
14053
14050
  schedules = result.schedules;