@limitry/cli 1.0.0-rc.10 → 1.0.0-rc.12

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/limitry.mjs CHANGED
@@ -31,7 +31,7 @@ var brand_default = {
31
31
  devDomain: "limitry.dev",
32
32
  labs: ["lab"],
33
33
  discordInvite: "https://discord.gg/Nb6QFd6ER4",
34
- summary: "Limitry is the limits, credits and budgets layer for your software: give each of your users, teams, tenants, API keys or agents an allowance, and before any costly action one call tells your code whether it may happen.",
34
+ summary: "Limitry is the limits, credits and budgets layer for the software you build: give each of your users, teams, tenants, API keys or agents an allowance, and before any costly action one call tells your code whether it may happen.",
35
35
  expectedAssets: [
36
36
  "logo.svg",
37
37
  "logo-dark.svg",
@@ -42,25 +42,45 @@ var brand_default = {
42
42
  "apple-touch-icon.png"
43
43
  ],
44
44
  colors: {
45
- brand: "#15202B",
46
- brandForeground: "#F5F6F3",
47
- brandDark: "#E8A33D",
48
- brandDarkForeground: "#15202B",
49
- ink: "#15202B",
50
- signal: "#E8A33D",
51
- paper: "#F5F6F3",
52
- graduation: "#C9CEC6",
53
- held: "#7C93AB",
54
- refused: "#B5412E"
45
+ brand: "#1E4D8C",
46
+ brandForeground: "#FFFFFF",
47
+ brandDark: "#7FB2FF",
48
+ brandDarkForeground: "#0B1F3A",
49
+ paper: "#F6F8FB",
50
+ paperDark: "#07121F",
51
+ surface: "#FFFFFF",
52
+ surfaceDark: "#0D1D31",
53
+ mist: "#DCEBFF",
54
+ mistDark: "#0F2645",
55
+ text: "#0B1F3A",
56
+ textDark: "#EAF1FB",
57
+ muted: "#4A5B73",
58
+ mutedDark: "#A3B6CE",
59
+ line: "#DCE4EE",
60
+ lineDark: "#1C3352",
61
+ sky: "#7FB2FF",
62
+ cobalt: "#1E4D8C",
63
+ cobaltDark: "#7FB2FF",
64
+ cobaltHover: "#173E73",
65
+ cobaltHoverDark: "#A8CBFF",
66
+ deep: "#0B1F3A",
67
+ deepDark: "#0F2645",
68
+ focus: "#4F86D6",
69
+ held: "#E8A33D",
70
+ refused: "#CE2C31",
71
+ refusedDark: "#FF6369"
55
72
  },
56
73
  fonts: {
57
- display: "Archivo Variable",
58
- body: "IBM Plex Sans"
74
+ display: "Manrope Variable",
75
+ body: "Manrope Variable",
76
+ code: "JetBrains Mono Variable"
59
77
  },
60
78
  layout: {
61
- radius: "3px",
79
+ radius: "10px",
80
+ radiusControl: "8px",
81
+ logoHeight: "29px",
62
82
  gutter: "1.5rem",
63
- contentWidth: "64rem",
83
+ contentWidth: "72rem",
64
84
  readableWidth: "42rem",
65
85
  sectionGap: "2rem",
66
86
  navGap: "1.5rem",
@@ -72,12 +92,14 @@ var brand_default = {
72
92
  name: "test",
73
93
  keyPrefix: "lim_test_",
74
94
  readOnlyWorkspace: true,
75
- description: "Use test to build and try things: test keys only touch test data, and test checks aren't billed."
95
+ agentLabel: "Practice data your developers use",
96
+ description: "Use test to build and try things. Test checks aren't billed."
76
97
  },
77
98
  {
78
99
  name: "live",
79
100
  keyPrefix: "lim_live_",
80
- description: "Use live in production: live checks count toward your plan."
101
+ agentLabel: "Your real customers",
102
+ description: "Use live in production. Live checks count toward your plan."
81
103
  }
82
104
  ],
83
105
  environmentsDocs: "/docs/test-and-live/",
@@ -86,7 +108,10 @@ var brand_default = {
86
108
  providerOrder: ["github", "google"],
87
109
  emailSignUp: "button"
88
110
  },
89
- devPortOffset: 100
111
+ devPortOffset: 100,
112
+ social: {
113
+ background: "#F6F8FB"
114
+ }
90
115
  };
91
116
 
92
117
  // src/brand/index.ts
@@ -163,11 +188,11 @@ function resolveProductFeatures(features) {
163
188
  guests: teams && on("guests"),
164
189
  /** The public `/v1` API: its router, the OpenAPI spec and reference, SDK and CLI publishing. */
165
190
  publicApi,
166
- /** Workspace API keys: Settings → API Keys, `/internal/workspace/api-keys`, `sk_` authentication on `/v1`. */
191
+ /** Workspace API keys: Settings → Developers, `/internal/workspace/api-keys`, `sk_` authentication on `/v1`. */
167
192
  apiKeys: publicApi && on("apiKeys"),
168
193
  /** Personal access tokens: Account → API tokens, `/internal/account/pats`, `/v1/user/*`, `pat_` authentication, the CLI's sign-in. */
169
194
  personalTokens: publicApi && on("personalTokens"),
170
- /** Outgoing webhooks: Settings → Webhooks, `/internal/workspace/webhooks`, the admin tab, queued deliveries. */
195
+ /** Outgoing webhooks: Settings → Developers, `/internal/workspace/webhooks`, the admin tab, queued deliveries. */
171
196
  webhooks: on("webhooks"),
172
197
  /** Billing: Settings → Billing, the Stripe plugin, the admin Billing surfaces, the site's pricing page; a free product. */
173
198
  billing: on("billing"),
@@ -185,7 +210,8 @@ function resolveProductEnvironments(environments, defaultEnvironment, docs) {
185
210
  name: env.name,
186
211
  keyPrefix: env.keyPrefix,
187
212
  readOnlyWorkspace: env.readOnlyWorkspace ?? false,
188
- description: env.description ?? ""
213
+ description: env.description ?? "",
214
+ agentLabel: env.agentLabel ?? env.description ?? ""
189
215
  }));
190
216
  const names = new Set(list.map((env) => env.name));
191
217
  const prefixes = new Set(list.map((env) => env.keyPrefix));
@@ -735,7 +761,7 @@ __export(product_exports, {
735
761
  Unavailable: () => Unavailable,
736
762
  createLimits: () => createLimits,
737
763
  productMethods: () => productMethods,
738
- productRetry: () => productRetry
764
+ productRetry: () => productRetry2
739
765
  });
740
766
 
741
767
  // node_modules/@limitry/sdk/dist/retry.js
@@ -745,7 +771,7 @@ var DEFAULT_MAX_RETRIES = 2;
745
771
  var MAX_WAIT_MS = 2e4;
746
772
  var MAX_BASE_KEY = 200;
747
773
  var PRODUCT_RETRY_HEADER = "x-sdk-product-retry";
748
- var productRetry2 = () => "productRetry" in product_exports ? productRetry ?? null : null;
774
+ var productRetry = () => "productRetry" in product_exports ? Reflect.get(product_exports, "productRetry") ?? null : null;
749
775
  var wait = (ms) => new Promise((done) => setTimeout(done, ms));
750
776
  function backoff(attempt) {
751
777
  const base = Math.min(500 * 2 ** attempt, 8e3);
@@ -787,7 +813,7 @@ function withoutProductRetryHeader(fetch2) {
787
813
  function withRetries(fetch2, options = {}) {
788
814
  const maxRetries = options.maxRetries ?? DEFAULT_MAX_RETRIES;
789
815
  const sleep = options.sleep ?? wait;
790
- const later = options.product === void 0 ? productRetry2() : options.product;
816
+ const later = options.product === void 0 ? productRetry() : options.product;
791
817
  return async (request) => {
792
818
  let returnLater;
793
819
  [request, returnLater] = takeProductRetryHeader(request);
@@ -936,7 +962,18 @@ function createLimits(client, options = {}, internals = {}) {
936
962
  const remembered = /* @__PURE__ */ new Map();
937
963
  const key = (s, action) => `${s.kind}\0${s.id}\0${action}`;
938
964
  const failMode = (s, action) => options.failMode ?? remembered.get(key(s, action)) ?? "open";
965
+ const concurrentAmounts = /* @__PURE__ */ new Map();
966
+ const running = /* @__PURE__ */ new Map();
939
967
  const remember = (s, action, decision) => {
968
+ const amounts = decision.limits.filter((r) => r.window === "concurrent" && typeof r.amount === "number").map((r) => r.amount);
969
+ if (amounts.length > 0) {
970
+ concurrentAmounts.set(key(s, action), Math.min(...amounts));
971
+ if (concurrentAmounts.size > 1e4) {
972
+ concurrentAmounts.delete(concurrentAmounts.keys().next().value);
973
+ }
974
+ } else {
975
+ concurrentAmounts.delete(key(s, action));
976
+ }
940
977
  if (options.failMode)
941
978
  return;
942
979
  const closed = decision.limits.some((r) => r.failMode === "closed");
@@ -1113,57 +1150,74 @@ function createLimits(client, options = {}, internals = {}) {
1113
1150
  ttlSeconds: request.ttlSeconds
1114
1151
  };
1115
1152
  const idempotencyKey = crypto.randomUUID();
1116
- const decision = await check(body, idempotencyKey);
1117
- const unmetered = {
1118
- // Checked even unmetered: the mistake shows whether or not
1119
- // Limitry answered.
1120
- cost: (units) => void checkedCost(units),
1121
- extend: async () => {
1122
- }
1123
- };
1124
- if (decision === UNREACHABLE || decision === TIMED_OUT) {
1125
- const unheard = () => decision === TIMED_OUT ? releaseUnheard(body, idempotencyKey) : Promise.resolve();
1126
- if (failMode(request.subject, request.action) === "closed") {
1127
- await unheard();
1128
- throw new Unavailable();
1129
- }
1130
- try {
1131
- return await fn(unmetered);
1132
- } finally {
1133
- await unheard();
1134
- }
1153
+ const slot = key(request.subject, request.action);
1154
+ const before = running.get(slot) ?? 0;
1155
+ running.set(slot, before + 1);
1156
+ try {
1157
+ return await reserveOnce(request, fn, body, idempotencyKey, before);
1158
+ } finally {
1159
+ const left2 = (running.get(slot) ?? 1) - 1;
1160
+ if (left2 > 0)
1161
+ running.set(slot, left2);
1162
+ else
1163
+ running.delete(slot);
1135
1164
  }
1136
- remember(request.subject, request.action, decision);
1137
- if (!decision.allowed || !decision.reservation) {
1138
- throw new LimitReached(decision);
1165
+ }
1166
+ };
1167
+ async function reserveOnce(request, fn, body, idempotencyKey, before) {
1168
+ const reserved = request.cost ?? 1;
1169
+ const decision = await check(body, idempotencyKey);
1170
+ const uncounted = {
1171
+ // Checked even uncounted: the mistake shows whether or not
1172
+ // Limitry answered.
1173
+ cost: (units) => void checkedCost(units),
1174
+ extend: async () => {
1175
+ }
1176
+ };
1177
+ if (decision === UNREACHABLE || decision === TIMED_OUT) {
1178
+ const unheard = () => decision === TIMED_OUT ? releaseUnheard(body, idempotencyKey) : Promise.resolve();
1179
+ const amount = concurrentAmounts.get(key(request.subject, request.action));
1180
+ if (failMode(request.subject, request.action) === "closed" || // Open, but never past a concurrent limit's amount here.
1181
+ amount !== void 0 && before >= amount) {
1182
+ await unheard();
1183
+ throw new Unavailable();
1139
1184
  }
1140
- const id = decision.reservation.id;
1141
- let used = reserved;
1142
- const reservation = {
1143
- cost(units) {
1144
- used = checkedCost(units);
1145
- },
1146
- async extend(ttlSeconds) {
1147
- const { error, response } = await client.POST("/reservations/{reservationId}/extend", {
1148
- params: { path: { reservationId: id } },
1149
- body: ttlSeconds === void 0 ? {} : { ttlSeconds },
1150
- signal: AbortSignal.timeout(timeoutMs)
1151
- });
1152
- if (error !== void 0)
1153
- throw apiErrorFrom(error, response);
1154
- }
1155
- };
1156
- let result;
1157
1185
  try {
1158
- result = await fn(reservation);
1159
- } catch (error) {
1160
- await settle(id, "release");
1161
- throw error;
1186
+ return await fn(uncounted);
1187
+ } finally {
1188
+ await unheard();
1162
1189
  }
1163
- await settle(id, "commit", used);
1164
- return result;
1165
1190
  }
1166
- };
1191
+ remember(request.subject, request.action, decision);
1192
+ if (!decision.allowed || !decision.reservation) {
1193
+ throw new LimitReached(decision);
1194
+ }
1195
+ const id = decision.reservation.id;
1196
+ let used = reserved;
1197
+ const reservation = {
1198
+ cost(units) {
1199
+ used = checkedCost(units);
1200
+ },
1201
+ async extend(ttlSeconds) {
1202
+ const { error, response } = await client.POST("/reservations/{reservationId}/extend", {
1203
+ params: { path: { reservationId: id } },
1204
+ body: ttlSeconds === void 0 ? {} : { ttlSeconds },
1205
+ signal: AbortSignal.timeout(timeoutMs)
1206
+ });
1207
+ if (error !== void 0)
1208
+ throw apiErrorFrom(error, response);
1209
+ }
1210
+ };
1211
+ let result;
1212
+ try {
1213
+ result = await fn(reservation);
1214
+ } catch (error) {
1215
+ await settle(id, "release");
1216
+ throw error;
1217
+ }
1218
+ await settle(id, "commit", used);
1219
+ return result;
1220
+ }
1167
1221
  }
1168
1222
  function isRetryLater(response, error) {
1169
1223
  const code2 = error?.error?.code;
@@ -1179,7 +1233,7 @@ var productMethods = (client) => {
1179
1233
  standing: limits.standing
1180
1234
  };
1181
1235
  };
1182
- var productRetry = movingRetry();
1236
+ var productRetry2 = movingRetry();
1183
1237
 
1184
1238
  // node_modules/@limitry/sdk/dist/resources.js
1185
1239
  async function call(client, op, pathParams, input, options = {}, content) {
@@ -1487,10 +1541,11 @@ async function verifyWebhook(body, headers, secret, options = {}) {
1487
1541
 
1488
1542
  // node_modules/@limitry/sdk/dist/index.js
1489
1543
  var API_KEY_ENV = `${brand2.identifier.toUpperCase()}_API_KEY`;
1544
+ var TOKEN_ENV = `${brand2.identifier.toUpperCase()}_TOKEN`;
1490
1545
  var DEFAULT_API = `https://api.${brand2.domain}`;
1491
1546
  function createClient2(options = {}) {
1492
1547
  const client = createBaseClient(options);
1493
- const extend = productMethods;
1548
+ const extend = Reflect.get(product_exports, "productMethods");
1494
1549
  if (!extend)
1495
1550
  return client;
1496
1551
  const methods = extend(client);
@@ -1502,9 +1557,12 @@ function createClient2(options = {}) {
1502
1557
  return Object.assign(client, methods);
1503
1558
  }
1504
1559
  function createBaseClient(options) {
1505
- const token = options.token ?? keyFromEnvironment();
1560
+ if (options.apiKey && options.token) {
1561
+ throw new Error(`${brand2.productName}: pass apiKey or token, not both.`);
1562
+ }
1563
+ const token = options.apiKey || options.token || credentialFromEnvironment();
1506
1564
  if (!token) {
1507
- throw new Error(`${brand2.productName}: no API key. Pass { token } or set ${API_KEY_ENV}.`);
1565
+ throw new Error(`${brand2.productName}: no API key. Pass { apiKey } or set ${API_KEY_ENV}.`);
1508
1566
  }
1509
1567
  const origin = withoutTrailingSlashes(options.api ?? DEFAULT_API);
1510
1568
  const send = options.fetch ?? ((request) => fetch(request));
@@ -1528,9 +1586,10 @@ function createBaseClient(options) {
1528
1586
  webhooks: { verify: verifyWebhook }
1529
1587
  });
1530
1588
  }
1531
- function keyFromEnvironment() {
1589
+ function credentialFromEnvironment() {
1532
1590
  const runtime = globalThis;
1533
- return runtime.process?.env?.[API_KEY_ENV] || void 0;
1591
+ const env = runtime.process?.env;
1592
+ return env?.[API_KEY_ENV] || env?.[TOKEN_ENV] || void 0;
1534
1593
  }
1535
1594
  function unwrap(result) {
1536
1595
  if (result.error !== void 0 || !result.response.ok) {
@@ -4985,14 +5044,14 @@ function browserLogin(options) {
4985
5044
  send(
4986
5045
  200,
4987
5046
  "You are signed in",
4988
- "Return to your terminal \u2014 you can close this tab."
5047
+ "Return to your terminal. You can close this tab."
4989
5048
  );
4990
5049
  finish(() => resolve2(token));
4991
5050
  });
4992
5051
  const timer = setTimeout(
4993
5052
  () => finish(
4994
5053
  () => reject(
4995
- new Error("timed out waiting for the browser \u2014 run login again")
5054
+ new Error("timed out waiting for the browser. Run login again.")
4996
5055
  )
4997
5056
  ),
4998
5057
  options.timeoutMs ?? 5 * 60 * 1e3
@@ -5046,7 +5105,7 @@ function readConfig(homeDir) {
5046
5105
  try {
5047
5106
  return JSON.parse(readFileSync(path2, "utf8"));
5048
5107
  } catch {
5049
- throw new Error(`${path2} is not valid JSON \u2014 fix or delete it`);
5108
+ throw new Error(`${path2} is not valid JSON. Fix or delete it.`);
5050
5109
  }
5051
5110
  }
5052
5111
  function writeConfig(homeDir, config2) {
@@ -5125,7 +5184,9 @@ function writeEnvVar(path2, name, value) {
5125
5184
  }
5126
5185
  var approvals = (program2, ctx) => {
5127
5186
  const workspace2 = program2.commands.find((c) => c.name() === "workspace") ?? program2.command("workspace");
5128
- const group = workspace2.command("approval-requests").description("approval-requests commands");
5187
+ const group = workspace2.command("approval-requests").description(
5188
+ "Ask a person to approve an action, and collect what it creates"
5189
+ );
5129
5190
  group.command("redeem <request-id>").description(
5130
5191
  "Collect an approved secret once, into an env file (never printed)"
5131
5192
  ).requiredOption(
@@ -5156,7 +5217,7 @@ var approvals = (program2, ctx) => {
5156
5217
  }
5157
5218
  if (request.status !== "approved") {
5158
5219
  throw new Error(
5159
- request.status === "pending" ? `Not approved yet \u2014 ask a person to approve it: ${request.approveUrl}` : `This request is ${request.status}; nothing to collect.`
5220
+ request.status === "pending" ? `Not approved yet. Ask a person to approve it: ${request.approveUrl}` : `This request is ${request.status}; nothing to collect.`
5160
5221
  );
5161
5222
  }
5162
5223
  const redeemed = await call3(
@@ -5198,7 +5259,7 @@ async function saveToken(ctx, token, api2) {
5198
5259
  writeConfig(ctx.io.homeDir, previous);
5199
5260
  const reason = error instanceof Error ? error.message : String(error);
5200
5261
  throw new Error(
5201
- `could not verify the token (${reason}) \u2014 nothing was saved`,
5262
+ `could not verify the token (${reason}). Nothing was saved.`,
5202
5263
  { cause: error }
5203
5264
  );
5204
5265
  }
@@ -5206,7 +5267,7 @@ async function saveToken(ctx, token, api2) {
5206
5267
  `Logged in. Token stored in ${configPath(ctx.io.homeDir)} (0600).`
5207
5268
  );
5208
5269
  ctx.io.stdout(
5209
- `Hello ${user.name} <${user.email}> \u2014 ${user.workspaces.length} workspace(s).`
5270
+ `Hello ${user.name} <${user.email}>. You have ${user.workspaces.length} workspace(s).`
5210
5271
  );
5211
5272
  if (!config2.workspace && user.workspaces.length === 1) {
5212
5273
  config2.workspace = user.workspaces[0].slug;
@@ -5218,7 +5279,7 @@ async function saveToken(ctx, token, api2) {
5218
5279
  }
5219
5280
  var login = (program2, ctx) => {
5220
5281
  program2.command("login").description(
5221
- "Sign in through the browser (or store a personal access token with --token)"
5282
+ "Sign in through the browser, or store a personal access token with --token"
5222
5283
  ).option("--token <pat>", "a personal access token (CI, servers)").option("--api <origin>", `API origin (default ${DEFAULT_API})`).option("--web <origin>", "web app origin for the browser sign-in").action(async (options) => {
5223
5284
  if (!productFeatures.personalTokens) {
5224
5285
  throw new Error(
@@ -5240,7 +5301,7 @@ var login = (program2, ctx) => {
5240
5301
  const webOrigin = options.web ?? webOriginFor(api2);
5241
5302
  if (!webOrigin) {
5242
5303
  throw new Error(
5243
- `cannot tell the web app's address from ${api2} \u2014 pass --web <origin>`
5304
+ `cannot tell the web app's address from ${api2}. Pass --web <origin>.`
5244
5305
  );
5245
5306
  }
5246
5307
  const token = await browserLogin({
@@ -5267,13 +5328,13 @@ var logout = (program2, ctx) => {
5267
5328
  ).catch(() => null);
5268
5329
  if (revoked && !revoked.ok && revoked.status !== 401) {
5269
5330
  ctx.io.stderr(
5270
- `Could not revoke the token (HTTP ${revoked.status}) \u2014 revoke it under Account \u2192 Personal access tokens.`
5331
+ `Could not revoke the token (HTTP ${revoked.status}). Revoke it under Account \u2192 Personal access tokens.`
5271
5332
  );
5272
5333
  }
5273
5334
  }
5274
5335
  delete config2.token;
5275
5336
  writeConfig(ctx.io.homeDir, config2);
5276
- ctx.io.stdout("Logged out \u2014 the token is revoked and forgotten.");
5337
+ ctx.io.stdout("Logged out. The token is revoked and forgotten.");
5277
5338
  });
5278
5339
  };
5279
5340
  async function printWorkspaces(ctx, asJson) {
@@ -5296,13 +5357,13 @@ async function printWorkspaces(ctx, asJson) {
5296
5357
  );
5297
5358
  }
5298
5359
  var whoami = (program2, ctx) => {
5299
- program2.command("whoami").description("Who the token acts as, and their workspaces").option("--json", "machine-readable output").action(
5360
+ program2.command("whoami").description("Show who the token acts as and which workspaces it can use").option("--json", "machine-readable output").action(
5300
5361
  (options) => printWorkspaces(ctx, options.json === true)
5301
5362
  );
5302
5363
  };
5303
5364
  var workspace = (program2, ctx) => {
5304
5365
  const group = program2.command("workspace").description(
5305
- "Your workspaces (list, use), and the current one's members, webhooks, approvals, usage \u2026"
5366
+ "Work with your workspaces and the current one's members, webhooks, approvals and usage"
5306
5367
  );
5307
5368
  group.command("list", { isDefault: true }).description("List the workspaces the token can act in").option("--json", "machine-readable output").action(
5308
5369
  (options) => printWorkspaces(ctx, options.json === true)
@@ -5319,7 +5380,7 @@ var workspace = (program2, ctx) => {
5319
5380
  });
5320
5381
  };
5321
5382
  var environment = (program2, ctx) => {
5322
- const group = program2.command("environment").description("The environment commands act in (list, use, unset)");
5383
+ const group = program2.command("environment").description("Choose the environment commands act in");
5323
5384
  group.command("list", { isDefault: true }).description("Show the environment commands act in").action(() => {
5324
5385
  const { environment: current, environmentSource } = ctx.settings();
5325
5386
  const from = environmentSource ? `(from ${{ flag: "--environment", env: environmentEnvVar(), config: "config" }[environmentSource]})` : null;
@@ -5333,14 +5394,14 @@ var environment = (program2, ctx) => {
5333
5394
  return;
5334
5395
  }
5335
5396
  ctx.io.stdout(
5336
- current ? `${current} ${from}` : "None set \u2014 the API acts in the workspace's default."
5397
+ current ? `${current} ${from}` : "None set. The API acts in the workspace's default."
5337
5398
  );
5338
5399
  });
5339
5400
  group.command("use <name>").description("Make <name> the default environment for commands").action((name) => {
5340
5401
  const declared = productEnvironments.list.map((env) => env.name);
5341
5402
  if (declared.length > 0 && !declared.includes(name)) {
5342
5403
  throw new Error(
5343
- `unknown environment '${name}' \u2014 ${brand.productName}'s are ${declared.join(", ")}`
5404
+ `unknown environment '${name}'. ${brand.productName}'s environments are ${declared.join(", ")}.`
5344
5405
  );
5345
5406
  }
5346
5407
  const config2 = readConfig(ctx.io.homeDir);
@@ -5349,7 +5410,7 @@ var environment = (program2, ctx) => {
5349
5410
  ctx.io.stdout(`Default environment: ${name}`);
5350
5411
  });
5351
5412
  group.command("unset").description(
5352
- "Forget the default environment (the product's default applies)"
5413
+ "Forget the default environment and go back to the product's default"
5353
5414
  ).action(() => {
5354
5415
  const config2 = readConfig(ctx.io.homeDir);
5355
5416
  delete config2.environment;
@@ -5358,7 +5419,7 @@ var environment = (program2, ctx) => {
5358
5419
  });
5359
5420
  };
5360
5421
  var api = (program2, ctx) => {
5361
- program2.command("api <method> <path>").description("Call any endpoint as the selected workspace (escape hatch)").option("--data <json>", "JSON request body").option("--workspace <slug>", "act in this workspace for one call").action(
5422
+ program2.command("api <method> <path>").description("Call any API endpoint directly, in the selected workspace").option("--data <json>", "JSON request body").option("--workspace <slug>", "act in this workspace for one call").action(
5362
5423
  async (method, path2, options) => {
5363
5424
  if (!path2.startsWith("/")) {
5364
5425
  throw new Error("usage: api <method> </v1/...> [--data '<json>']");
@@ -5378,7 +5439,7 @@ var api = (program2, ctx) => {
5378
5439
  );
5379
5440
  };
5380
5441
  var config = (program2, ctx) => {
5381
- program2.command("config").description("Show the effective settings (token masked)").action(() => {
5442
+ program2.command("config").description("Show the settings in effect, with the token hidden").action(() => {
5382
5443
  const settings = ctx.settings();
5383
5444
  ctx.io.stdout(
5384
5445
  json({
@@ -5459,14 +5520,14 @@ var OPERATIONS = [
5459
5520
  "idempotentHint": false
5460
5521
  }
5461
5522
  },
5462
- "description": "Asks whether `subject` may do `action` at `cost`, given every enabled limit that applies, and \u2014 in `consume` mode \u2014 uses it. Always 200 for a decision, allowed or refused: read `allowed`; `limits` shows what is left on each limit and `retryAfterSeconds` when to try again. An `Idempotency-Key` header makes a retried check return the same decision without using twice. Its API-key check is cached briefly for speed: a revoked key can keep working here for up to 60 seconds.",
5523
+ "description": "Asks whether `subject` may do `action` at `cost`, given every enabled limit that applies. In `consume` mode, it also counts the use. Every decision returns 200, whether it's allowed or refused, so read `allowed`. `limits` shows what's left on each limit, and `retryAfterSeconds` says when to try again. With an `Idempotency-Key` header, a retried check gets the same decision for an hour and counts only once. We cache its API key check briefly for speed. A revoked key can keep working here for up to 60 seconds.",
5463
5524
  "fields": [
5464
5525
  {
5465
5526
  "name": "subject",
5466
5527
  "in": "body",
5467
5528
  "type": "json",
5468
5529
  "required": true,
5469
- "description": 'Who is acting, as `{"kind": "user", "id": "usr_123"}`.',
5530
+ "description": 'Who is acting, such as `{"kind": "user", "id": "usr_123"}`.',
5470
5531
  "example": {
5471
5532
  "kind": "user",
5472
5533
  "id": "usr_123"
@@ -5478,20 +5539,20 @@ var OPERATIONS = [
5478
5539
  "type": "string",
5479
5540
  "minLength": 1,
5480
5541
  "maxLength": 100,
5481
- "description": "Your own label for who is acting: user, apikey, agent \u2026"
5542
+ "description": "Your own label for who is acting, such as user, apikey or agent."
5482
5543
  },
5483
5544
  "id": {
5484
5545
  "type": "string",
5485
5546
  "minLength": 1,
5486
5547
  "maxLength": 200,
5487
- "description": "Who exactly, in your product."
5548
+ "description": "The subject's ID in your product."
5488
5549
  }
5489
5550
  },
5490
5551
  "required": [
5491
5552
  "kind",
5492
5553
  "id"
5493
5554
  ],
5494
- "description": 'Who is acting, as `{"kind": "user", "id": "usr_123"}`.'
5555
+ "description": 'Who is acting, such as `{"kind": "user", "id": "usr_123"}`.'
5495
5556
  }
5496
5557
  },
5497
5558
  {
@@ -5499,13 +5560,7 @@ var OPERATIONS = [
5499
5560
  "in": "body",
5500
5561
  "type": "json",
5501
5562
  "required": false,
5502
- "description": "Shared subjects it also draws from \u2014 a team's, org's or project's pool (at most 4). Every limit on every subject must fit; all are charged, or none.",
5503
- "example": [
5504
- {
5505
- "kind": "team",
5506
- "id": "team_42"
5507
- }
5508
- ],
5563
+ "description": "Shared subjects the check also draws from, such as a team's, an organization's or a project's pool. Send at most 4. Every limit on every subject must fit, and Limitry charges either all of them or none.",
5509
5564
  "schema": {
5510
5565
  "type": "array",
5511
5566
  "items": {
@@ -5528,7 +5583,7 @@ var OPERATIONS = [
5528
5583
  ]
5529
5584
  },
5530
5585
  "maxItems": 4,
5531
- "description": "Shared subjects it also draws from \u2014 a team's, org's or project's pool (at most 4). Every limit on every subject must fit; all are charged, or none."
5586
+ "description": "Shared subjects the check also draws from, such as a team's, an organization's or a project's pool. Send at most 4. Every limit on every subject must fit, and Limitry charges either all of them or none."
5532
5587
  }
5533
5588
  },
5534
5589
  {
@@ -5550,13 +5605,13 @@ var OPERATIONS = [
5550
5605
  "in": "body",
5551
5606
  "type": "number",
5552
5607
  "required": false,
5553
- "description": "Units it would use. Default 1.",
5608
+ "description": "The units the action would use. Default: 1.",
5554
5609
  "example": 5,
5555
5610
  "schema": {
5556
5611
  "type": "integer",
5557
5612
  "minimum": 1,
5558
5613
  "maximum": 1e9,
5559
- "description": "Units it would use. Default 1."
5614
+ "description": "The units the action would use. Default: 1."
5560
5615
  }
5561
5616
  },
5562
5617
  {
@@ -5564,8 +5619,7 @@ var OPERATIONS = [
5564
5619
  "in": "body",
5565
5620
  "type": "string",
5566
5621
  "required": false,
5567
- "description": "`consume` (default) decides and uses; `preview` decides without using; `reserve` decides and reserves `cost` (what it will probably use) until you commit the actual amount or release it \u2014 see `reservation` in the answer. Only a reservation takes a slot of a `concurrent` limit.",
5568
- "example": "consume",
5622
+ "description": "How the check counts. `consume` decides and counts, and is the default. `preview` decides without counting anything. `reserve` decides and holds `cost`, your estimate, until you commit the actual amount or release it. The response's `reservation` names what it holds. Only a reservation takes a slot of a `concurrent` limit.",
5569
5623
  "schema": {
5570
5624
  "type": "string",
5571
5625
  "enum": [
@@ -5573,7 +5627,7 @@ var OPERATIONS = [
5573
5627
  "preview",
5574
5628
  "reserve"
5575
5629
  ],
5576
- "description": "`consume` (default) decides and uses; `preview` decides without using; `reserve` decides and reserves `cost` (what it will probably use) until you commit the actual amount or release it \u2014 see `reservation` in the answer. Only a reservation takes a slot of a `concurrent` limit."
5630
+ "description": "How the check counts. `consume` decides and counts, and is the default. `preview` decides without counting anything. `reserve` decides and holds `cost`, your estimate, until you commit the actual amount or release it. The response's `reservation` names what it holds. Only a reservation takes a slot of a `concurrent` limit."
5577
5631
  }
5578
5632
  },
5579
5633
  {
@@ -5581,18 +5635,18 @@ var OPERATIONS = [
5581
5635
  "in": "body",
5582
5636
  "type": "number",
5583
5637
  "required": false,
5584
- "description": "With `reserve`: how long the reservation lasts before it releases itself. Default 300, at most 3600.",
5585
- "example": 300,
5638
+ "description": "With `reserve`, how many seconds the reservation lasts before it releases itself. Default: 300. At most 3600.",
5586
5639
  "schema": {
5587
5640
  "type": "integer",
5588
5641
  "minimum": 1,
5589
5642
  "maximum": 3600,
5590
- "description": "With `reserve`: how long the reservation lasts before it releases itself. Default 300, at most 3600."
5643
+ "description": "With `reserve`, how many seconds the reservation lasts before it releases itself. Default: 300. At most 3600."
5591
5644
  }
5592
5645
  }
5593
5646
  ],
5594
5647
  "hasBody": true,
5595
5648
  "workspace": true,
5649
+ "acceptsApiKey": true,
5596
5650
  "scope": "checks:write"
5597
5651
  },
5598
5652
  {
@@ -5616,21 +5670,24 @@ var OPERATIONS = [
5616
5670
  "idempotentHint": false
5617
5671
  }
5618
5672
  },
5619
- "description": "Stops a limit: checks stop enforcing it at once, and it leaves the list. It is archived, not erased \u2014 its usage history and credits stay, and `POST /v1/limits/{limitId}/restore` brings it back. Owners and admins only, for a person's token.",
5673
+ "description": "Archives a limit, so checks stop enforcing it at once and it leaves the list. Archiving erases nothing. Limitry keeps the limit's usage history and credits, and `POST /v1/limits/{limitId}/restore` brings it back. With a personal access token, only owners and admins can call this. A workspace API key with this scope can.",
5620
5674
  "fields": [
5621
5675
  {
5622
5676
  "name": "limitId",
5623
5677
  "in": "path",
5624
5678
  "type": "string",
5625
5679
  "required": true,
5626
- "example": "lmt_3f0c\u2026",
5680
+ "description": "The limit's ID.",
5681
+ "example": "lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34",
5627
5682
  "schema": {
5628
- "type": "string"
5683
+ "type": "string",
5684
+ "description": "The limit's ID."
5629
5685
  }
5630
5686
  }
5631
5687
  ],
5632
5688
  "hasBody": false,
5633
5689
  "workspace": true,
5690
+ "acceptsApiKey": true,
5634
5691
  "scope": "limits:write"
5635
5692
  },
5636
5693
  {
@@ -5652,20 +5709,20 @@ var OPERATIONS = [
5652
5709
  "idempotentHint": false
5653
5710
  }
5654
5711
  },
5655
- "description": "Limits how much a subject may use per window \u2014 for example 200 cents a month for every `user`. Only `subject.kind`, `amount` and `window` are needed: `action` defaults to every action (`*`), `unit` to units, and `name` to the sentence the limit reads as. Checks enforce it from then on. What it counts (subject, action, unit, window, every, start, rolling) is fixed once created. Owners and admins only, for a person's token.",
5712
+ "description": "Creates a limit on how much a subject may use per window, such as 200 cents a month for every `user`. You only need to send `subject.kind`, `amount` and `window`. `action` defaults to every action (`*`), `unit` to units, and `name` to the sentence the limit reads as. The next check enforces the new limit. You can't change a limit's subject, action, unit, window, every, start or rolling after you create it. With a personal access token, only owners and admins can call this. A workspace API key with this scope can.",
5656
5713
  "fields": [
5657
5714
  {
5658
5715
  "name": "name",
5659
5716
  "in": "body",
5660
5717
  "type": "string",
5661
5718
  "required": false,
5662
- "description": `A name, unique among the environment's active limits. Default: the sentence the limit reads as, such as "200 cents per user per month". If a limit already has that name, the answer is 409: give this one a name.`,
5719
+ "description": `The limit's name, unique among the environment's active limits. By default, it's the sentence the limit reads as, such as "200 cents per user per month". If another limit already has that name, you get a 409, so send a name of your own.`,
5663
5720
  "example": "AI budget",
5664
5721
  "schema": {
5665
5722
  "type": "string",
5666
5723
  "minLength": 1,
5667
5724
  "maxLength": 100,
5668
- "description": `A name, unique among the environment's active limits. Default: the sentence the limit reads as, such as "200 cents per user per month". If a limit already has that name, the answer is 409: give this one a name.`
5725
+ "description": `The limit's name, unique among the environment's active limits. By default, it's the sentence the limit reads as, such as "200 cents per user per month". If another limit already has that name, you get a 409, so send a name of your own.`
5669
5726
  }
5670
5727
  },
5671
5728
  {
@@ -5673,7 +5730,7 @@ var OPERATIONS = [
5673
5730
  "in": "body",
5674
5731
  "type": "json",
5675
5732
  "required": true,
5676
- "description": 'Who it applies to: `{"kind": "user"}` for every user, `{"kind": "user", "id": "usr_123"}` for one.',
5733
+ "description": 'Who the limit applies to. `{"kind": "user"}` covers every user, and `{"kind": "user", "id": "usr_123"}` covers one.',
5677
5734
  "example": {
5678
5735
  "kind": "user"
5679
5736
  },
@@ -5684,7 +5741,7 @@ var OPERATIONS = [
5684
5741
  "type": "string",
5685
5742
  "minLength": 1,
5686
5743
  "maxLength": 100,
5687
- "description": "Your own label for who is checked: user, team, apikey \u2026"
5744
+ "description": "Your own label for who the limit applies to, such as user, team or apikey."
5688
5745
  },
5689
5746
  "id": {
5690
5747
  "type": [
@@ -5693,13 +5750,13 @@ var OPERATIONS = [
5693
5750
  ],
5694
5751
  "minLength": 1,
5695
5752
  "maxLength": 100,
5696
- "description": "One subject; omit or null for every subject of the kind. A subject's own limit replaces the kind's limits with the same action and window."
5753
+ "description": "One subject's ID. Leave it out, or send null, to cover every subject of the kind. A limit for one subject replaces the kind's limits that have the same action and window."
5697
5754
  }
5698
5755
  },
5699
5756
  "required": [
5700
5757
  "kind"
5701
5758
  ],
5702
- "description": 'Who it applies to: `{"kind": "user"}` for every user, `{"kind": "user", "id": "usr_123"}` for one.'
5759
+ "description": 'Who the limit applies to. `{"kind": "user"}` covers every user, and `{"kind": "user", "id": "usr_123"}` covers one.'
5703
5760
  }
5704
5761
  },
5705
5762
  {
@@ -5749,7 +5806,7 @@ var OPERATIONS = [
5749
5806
  "in": "body",
5750
5807
  "type": "string",
5751
5808
  "required": true,
5752
- "description": "`minute`, `hour`, `day`, `week`, `month` or `year`: a period of `every` of them, reset where `start` says (or rolling: see `rolling`). `total`: a balance that never resets, raised by credits. `concurrent`: at most `amount` open reservations at once.",
5809
+ "description": "The kind of period. `minute`, `hour`, `day`, `week`, `month` and `year` count a period of `every` windows, which resets where `start` says, or rolls when `rolling` is true. `total` is a balance that never resets, and credits raise it. `concurrent` allows at most `amount` open reservations at once.",
5753
5810
  "example": "month",
5754
5811
  "schema": {
5755
5812
  "type": "string",
@@ -5763,7 +5820,7 @@ var OPERATIONS = [
5763
5820
  "total",
5764
5821
  "concurrent"
5765
5822
  ],
5766
- "description": "`minute`, `hour`, `day`, `week`, `month` or `year`: a period of `every` of them, reset where `start` says (or rolling: see `rolling`). `total`: a balance that never resets, raised by credits. `concurrent`: at most `amount` open reservations at once."
5823
+ "description": "The kind of period. `minute`, `hour`, `day`, `week`, `month` and `year` count a period of `every` windows, which resets where `start` says, or rolls when `rolling` is true. `total` is a balance that never resets, and credits raise it. `concurrent` allows at most `amount` open reservations at once."
5767
5824
  }
5768
5825
  },
5769
5826
  {
@@ -5771,13 +5828,13 @@ var OPERATIONS = [
5771
5828
  "in": "body",
5772
5829
  "type": "number",
5773
5830
  "required": false,
5774
- "description": 'How many `window` units a period lasts: `window: "month", every: 3` is a quarter, `window: "hour", every: 5` five hours. Default: 1.',
5831
+ "description": 'How many `window` units one period lasts. For example, `window: "month", every: 3` is a quarter, and `window: "hour", every: 5` is five hours. Default: 1.',
5775
5832
  "example": 1,
5776
5833
  "schema": {
5777
5834
  "type": "integer",
5778
5835
  "minimum": 1,
5779
5836
  "maximum": 1e3,
5780
- "description": 'How many `window` units a period lasts: `window: "month", every: 3` is a quarter, `window: "hour", every: 5` five hours. Default: 1.'
5837
+ "description": 'How many `window` units one period lasts. For example, `window: "month", every: 3` is a quarter, and `window: "hour", every: 5` is five hours. Default: 1.'
5781
5838
  }
5782
5839
  },
5783
5840
  {
@@ -5785,7 +5842,7 @@ var OPERATIONS = [
5785
5842
  "in": "body",
5786
5843
  "type": "string",
5787
5844
  "required": false,
5788
- "description": "Where a period begins. `calendar`: UTC boundaries (midnight, Monday, the 1st, 1 January). `billing_date`: from the subject's billing date, set with `subjects.update` (its first check until then), so an annual plan can reset monthly from its start day. `first_use`: at the first check after the previous period ended. Default: calendar.",
5845
+ "description": "Where each period begins. `calendar` uses UTC boundaries: midnight, Monday, the 1st or 1 January. `billing_date` counts from the subject's billing date. You set it with `subjects.update`. An annual plan can then still reset monthly. Until a subject has a billing date, its first check stands in for it. `first_use` starts a period at the first check after the previous one ended. Default: calendar.",
5789
5846
  "example": "calendar",
5790
5847
  "schema": {
5791
5848
  "type": "string",
@@ -5794,7 +5851,7 @@ var OPERATIONS = [
5794
5851
  "billing_date",
5795
5852
  "first_use"
5796
5853
  ],
5797
- "description": "Where a period begins. `calendar`: UTC boundaries (midnight, Monday, the 1st, 1 January). `billing_date`: from the subject's billing date, set with `subjects.update` (its first check until then), so an annual plan can reset monthly from its start day. `first_use`: at the first check after the previous period ended. Default: calendar."
5854
+ "description": "Where each period begins. `calendar` uses UTC boundaries: midnight, Monday, the 1st or 1 January. `billing_date` counts from the subject's billing date. You set it with `subjects.update`. An annual plan can then still reset monthly. Until a subject has a billing date, its first check stands in for it. `first_use` starts a period at the first check after the previous one ended. Default: calendar."
5798
5855
  }
5799
5856
  },
5800
5857
  {
@@ -5802,10 +5859,10 @@ var OPERATIONS = [
5802
5859
  "in": "body",
5803
5860
  "type": "boolean",
5804
5861
  "required": false,
5805
- "description": "Count the last window instead of the calendar one (minute, hour or day only). Default: false.",
5862
+ "description": "Whether to count the last `every` windows up to the moment of each check, rather than fixed periods. Only `minute`, `hour` and `day` limits can roll. Default: false.",
5806
5863
  "schema": {
5807
5864
  "type": "boolean",
5808
- "description": "Count the last window instead of the calendar one (minute, hour or day only). Default: false."
5865
+ "description": "Whether to count the last `every` windows up to the moment of each check, rather than fixed periods. Only `minute`, `hour` and `day` limits can roll. Default: false."
5809
5866
  }
5810
5867
  },
5811
5868
  {
@@ -5813,10 +5870,10 @@ var OPERATIONS = [
5813
5870
  "in": "body",
5814
5871
  "type": "boolean",
5815
5872
  "required": false,
5816
- "description": "Whether checks enforce it. Default: true.",
5873
+ "description": "Whether checks enforce the limit. Default: true.",
5817
5874
  "schema": {
5818
5875
  "type": "boolean",
5819
- "description": "Whether checks enforce it. Default: true."
5876
+ "description": "Whether checks enforce the limit. Default: true."
5820
5877
  }
5821
5878
  },
5822
5879
  {
@@ -5824,19 +5881,20 @@ var OPERATIONS = [
5824
5881
  "in": "body",
5825
5882
  "type": "string",
5826
5883
  "required": false,
5827
- "description": "What your code should do when Limitry can't be reached: `open` (allow) or `closed` (deny). Default: open.",
5884
+ "description": "What your code should do when it can't reach Limitry. `open` allows and `closed` refuses. Default: open.",
5828
5885
  "schema": {
5829
5886
  "type": "string",
5830
5887
  "enum": [
5831
5888
  "open",
5832
5889
  "closed"
5833
5890
  ],
5834
- "description": "What your code should do when Limitry can't be reached: `open` (allow) or `closed` (deny). Default: open."
5891
+ "description": "What your code should do when it can't reach Limitry. `open` allows and `closed` refuses. Default: open."
5835
5892
  }
5836
5893
  }
5837
5894
  ],
5838
5895
  "hasBody": true,
5839
5896
  "workspace": true,
5897
+ "acceptsApiKey": true,
5840
5898
  "scope": "limits:write"
5841
5899
  },
5842
5900
  {
@@ -5855,16 +5913,18 @@ var OPERATIONS = [
5855
5913
  "exposed": false,
5856
5914
  "reason": "Adding credits gives value away; an agent asks a person (limit.credit approval)"
5857
5915
  },
5858
- "description": "Adds `amount` credits to one subject's balance \u2014 a limit whose window is `total`. A negative `amount` takes credits back (a refund, a chargeback) and needs a `note` saying why; the balance may go below zero, and checks are refused until more credits are added. Owners and admins, or a workspace API key; an agent asks a person (the `limit.credit` approval).",
5916
+ "description": "Adds `amount` credits to one subject's balance, on a limit whose window is `total`. A negative `amount` takes credits back, such as after a refund or a chargeback, and needs a `note` saying why. The balance can go below zero, and Limitry then refuses checks until you add more credits. Owners, admins and workspace API keys can add credits. An agent asks a person instead, through the `limit.credit` approval. Limitry keeps a credit's `Idempotency-Key` forever, so never reuse one for a new credit.",
5859
5917
  "fields": [
5860
5918
  {
5861
5919
  "name": "limitId",
5862
5920
  "in": "path",
5863
5921
  "type": "string",
5864
5922
  "required": true,
5865
- "example": "lmt_3f0c\u2026",
5923
+ "description": "The limit's ID.",
5924
+ "example": "lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34",
5866
5925
  "schema": {
5867
- "type": "string"
5926
+ "type": "string",
5927
+ "description": "The limit's ID."
5868
5928
  }
5869
5929
  },
5870
5930
  {
@@ -5872,7 +5932,7 @@ var OPERATIONS = [
5872
5932
  "in": "body",
5873
5933
  "type": "json",
5874
5934
  "required": true,
5875
- "description": 'Who gets the credits, as `{"kind": "team", "id": "team_42"}`.',
5935
+ "description": 'Who gets the credits, such as `{"kind": "team", "id": "team_42"}`.',
5876
5936
  "example": {
5877
5937
  "kind": "team",
5878
5938
  "id": "team_42"
@@ -5895,7 +5955,7 @@ var OPERATIONS = [
5895
5955
  "kind",
5896
5956
  "id"
5897
5957
  ],
5898
- "description": 'Who gets the credits, as `{"kind": "team", "id": "team_42"}`.'
5958
+ "description": 'Who gets the credits, such as `{"kind": "team", "id": "team_42"}`.'
5899
5959
  }
5900
5960
  },
5901
5961
  {
@@ -5903,11 +5963,11 @@ var OPERATIONS = [
5903
5963
  "in": "body",
5904
5964
  "type": "number",
5905
5965
  "required": true,
5906
- "description": "Credits to add; negative to take them back. Not 0.",
5966
+ "description": "The credits to add, or a negative number to take them back. It can't be 0.",
5907
5967
  "example": 5e3,
5908
5968
  "schema": {
5909
5969
  "type": "integer",
5910
- "description": "Credits to add; negative to take them back. Not 0."
5970
+ "description": "The credits to add, or a negative number to take them back. It can't be 0."
5911
5971
  }
5912
5972
  },
5913
5973
  {
@@ -5915,17 +5975,18 @@ var OPERATIONS = [
5915
5975
  "in": "body",
5916
5976
  "type": "string",
5917
5977
  "required": false,
5918
- "description": "Required when `amount` is negative.",
5978
+ "description": "Why the balance changed. It's required when `amount` is negative.",
5919
5979
  "example": "October credits",
5920
5980
  "schema": {
5921
5981
  "type": "string",
5922
5982
  "maxLength": 200,
5923
- "description": "Required when `amount` is negative."
5983
+ "description": "Why the balance changed. It's required when `amount` is negative."
5924
5984
  }
5925
5985
  }
5926
5986
  ],
5927
5987
  "hasBody": true,
5928
5988
  "workspace": true,
5989
+ "acceptsApiKey": true,
5929
5990
  "scope": "limits:write"
5930
5991
  },
5931
5992
  {
@@ -5949,21 +6010,24 @@ var OPERATIONS = [
5949
6010
  "idempotentHint": true
5950
6011
  }
5951
6012
  },
5952
- "description": "Credits added to (or taken back from) subjects' balances for this limit, newest first.",
6013
+ "description": "Lists the credits added to subjects' balances on this limit, including any taken back. It returns the newest 200, newest first.",
5953
6014
  "fields": [
5954
6015
  {
5955
6016
  "name": "limitId",
5956
6017
  "in": "path",
5957
6018
  "type": "string",
5958
6019
  "required": true,
5959
- "example": "lmt_3f0c\u2026",
6020
+ "description": "The limit's ID.",
6021
+ "example": "lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34",
5960
6022
  "schema": {
5961
- "type": "string"
6023
+ "type": "string",
6024
+ "description": "The limit's ID."
5962
6025
  }
5963
6026
  }
5964
6027
  ],
5965
6028
  "hasBody": false,
5966
6029
  "workspace": true,
6030
+ "acceptsApiKey": true,
5967
6031
  "scope": "limits:read"
5968
6032
  },
5969
6033
  {
@@ -5987,21 +6051,24 @@ var OPERATIONS = [
5987
6051
  "idempotentHint": true
5988
6052
  }
5989
6053
  },
5990
- "description": "One limit: who it applies to, the action, amount and window.",
6054
+ "description": "Returns one limit, with who it applies to, its action, its amount and its window.",
5991
6055
  "fields": [
5992
6056
  {
5993
6057
  "name": "limitId",
5994
6058
  "in": "path",
5995
6059
  "type": "string",
5996
6060
  "required": true,
5997
- "example": "lmt_3f0c\u2026",
6061
+ "description": "The limit's ID.",
6062
+ "example": "lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34",
5998
6063
  "schema": {
5999
- "type": "string"
6064
+ "type": "string",
6065
+ "description": "The limit's ID."
6000
6066
  }
6001
6067
  }
6002
6068
  ],
6003
6069
  "hasBody": false,
6004
6070
  "workspace": true,
6071
+ "acceptsApiKey": true,
6005
6072
  "scope": "limits:read"
6006
6073
  },
6007
6074
  {
@@ -6023,7 +6090,7 @@ var OPERATIONS = [
6023
6090
  "idempotentHint": true
6024
6091
  }
6025
6092
  },
6026
- "description": "The workspace's active limits, newest first (`archived=true`: the archived ones). Filter by `subjectKind` and `action`; paginate with the opaque `nextCursor` token.",
6093
+ "description": "Lists this environment's active limits, newest first. With `archived=true`, it lists the archived ones instead. Filter by `subjectKind` and `action`, and page through the results with the opaque `nextCursor` token.",
6027
6094
  "fields": [
6028
6095
  {
6029
6096
  "name": "limit",
@@ -6056,12 +6123,12 @@ var OPERATIONS = [
6056
6123
  "in": "query",
6057
6124
  "type": "string",
6058
6125
  "required": false,
6059
- "description": "Only this kind.",
6126
+ "description": "Only limits for this subject kind.",
6060
6127
  "schema": {
6061
6128
  "type": "string",
6062
6129
  "minLength": 1,
6063
6130
  "maxLength": 100,
6064
- "description": "Only this kind."
6131
+ "description": "Only limits for this subject kind."
6065
6132
  }
6066
6133
  },
6067
6134
  {
@@ -6069,12 +6136,12 @@ var OPERATIONS = [
6069
6136
  "in": "query",
6070
6137
  "type": "string",
6071
6138
  "required": false,
6072
- "description": "Only this action.",
6139
+ "description": "Only limits for this action.",
6073
6140
  "schema": {
6074
6141
  "type": "string",
6075
6142
  "minLength": 1,
6076
6143
  "maxLength": 100,
6077
- "description": "Only this action."
6144
+ "description": "Only limits for this action."
6078
6145
  }
6079
6146
  },
6080
6147
  {
@@ -6082,19 +6149,20 @@ var OPERATIONS = [
6082
6149
  "in": "query",
6083
6150
  "type": "string",
6084
6151
  "required": false,
6085
- "description": "`true`: the archived limits instead.",
6152
+ "description": "Send `true` to list the archived limits instead.",
6086
6153
  "schema": {
6087
6154
  "type": "string",
6088
6155
  "enum": [
6089
6156
  "true",
6090
6157
  "false"
6091
6158
  ],
6092
- "description": "`true`: the archived limits instead."
6159
+ "description": "Send `true` to list the archived limits instead."
6093
6160
  }
6094
6161
  }
6095
6162
  ],
6096
6163
  "hasBody": false,
6097
6164
  "workspace": true,
6165
+ "acceptsApiKey": true,
6098
6166
  "scope": "limits:read"
6099
6167
  },
6100
6168
  {
@@ -6118,21 +6186,24 @@ var OPERATIONS = [
6118
6186
  "idempotentHint": false
6119
6187
  }
6120
6188
  },
6121
- "description": "Brings an archived limit back into force \u2014 refused while an active limit has its name. Owners and admins only, for a person's token.",
6189
+ "description": "Brings an archived limit back. Checks enforce it again if it's enabled. The API refuses it while an active limit has the same name. With a personal access token, only owners and admins can call this. A workspace API key with this scope can.",
6122
6190
  "fields": [
6123
6191
  {
6124
6192
  "name": "limitId",
6125
6193
  "in": "path",
6126
6194
  "type": "string",
6127
6195
  "required": true,
6128
- "example": "lmt_3f0c\u2026",
6196
+ "description": "The limit's ID.",
6197
+ "example": "lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34",
6129
6198
  "schema": {
6130
- "type": "string"
6199
+ "type": "string",
6200
+ "description": "The limit's ID."
6131
6201
  }
6132
6202
  }
6133
6203
  ],
6134
6204
  "hasBody": false,
6135
6205
  "workspace": true,
6206
+ "acceptsApiKey": true,
6136
6207
  "scope": "limits:write"
6137
6208
  },
6138
6209
  {
@@ -6155,14 +6226,14 @@ var OPERATIONS = [
6155
6226
  "idempotentHint": false
6156
6227
  }
6157
6228
  },
6158
- "description": "Makes the environment's limits match `limits`, by name: creates the missing, changes those that differ (an omitted field means its default) and, with `archiveMissing`, archives active limits the list doesn't name. Running it twice changes nothing the second time. Limitry checks the whole list first, and a problem anywhere changes nothing (400, each problem in `details`); then it writes every change at once. What a limit counts is fixed: a different subject, action, unit or window under an existing name is refused until the entry is renamed. `preview` answers what it would do without writing. For keeping limits in a file in your repository (`limitry sync`). Owners and admins only, for a person's token.",
6229
+ "description": "Makes the environment's limits match the list in `limits`, pairing them up by name. It creates the limits that are missing and changes the ones that differ, where an omitted field means its default. With `archiveMissing`, it also archives the active limits the list doesn't name. Running it twice changes nothing the second time. Limitry checks the whole list before writing anything. If any entry has a problem, nothing changes, and the 400 lists each problem in `details`. Otherwise Limitry writes every change at once. You can't change a limit's subject, action, unit, window, every, start or rolling under the same name, so rename the entry to do that. With `preview`, it returns what it would do without writing anything. This is the call behind `limitry sync`, for keeping your limits in a file in your repository. With a personal access token, only owners and admins can call this. A workspace API key with this scope can.",
6159
6230
  "fields": [
6160
6231
  {
6161
6232
  "name": "limits",
6162
6233
  "in": "body",
6163
6234
  "type": "json",
6164
6235
  "required": true,
6165
- "description": "Every limit you want, each described whole: an omitted field is its default, as on create. Names are the key and must be unique in the list. What a limit counts (subject, action, unit, window, every, start, rolling) is fixed: to change it, rename the entry, which creates a new limit. At most 200.",
6236
+ "description": "Every limit you want, each described in full. An omitted field takes its default, as on create. A sync matches limits by name, so each name must be unique in the list. You can't change a limit's subject, action, unit, window, every, start or rolling under the same name. To change one of them, rename the entry, which creates a new limit. The list holds at most 200 limits.",
6166
6237
  "example": [
6167
6238
  {
6168
6239
  "name": "AI budget",
@@ -6190,7 +6261,7 @@ var OPERATIONS = [
6190
6261
  "minLength": 1,
6191
6262
  "maxLength": 100,
6192
6263
  "example": "AI budget",
6193
- "description": "The limit's name: the key a sync matches on, unique in the list."
6264
+ "description": "The limit's name. A sync matches limits by name, so each name appears once in the list."
6194
6265
  }
6195
6266
  },
6196
6267
  "required": [
@@ -6200,7 +6271,7 @@ var OPERATIONS = [
6200
6271
  ]
6201
6272
  },
6202
6273
  "maxItems": 200,
6203
- "description": "Every limit you want, each described whole: an omitted field is its default, as on create. Names are the key and must be unique in the list. What a limit counts (subject, action, unit, window, every, start, rolling) is fixed: to change it, rename the entry, which creates a new limit. At most 200."
6274
+ "description": "Every limit you want, each described in full. An omitted field takes its default, as on create. A sync matches limits by name, so each name must be unique in the list. You can't change a limit's subject, action, unit, window, every, start or rolling under the same name. To change one of them, rename the entry, which creates a new limit. The list holds at most 200 limits."
6204
6275
  }
6205
6276
  },
6206
6277
  {
@@ -6208,10 +6279,10 @@ var OPERATIONS = [
6208
6279
  "in": "body",
6209
6280
  "type": "boolean",
6210
6281
  "required": false,
6211
- "description": "Archive the environment's active limits whose names aren't in `limits` (restorable). Default: false, which leaves them alone.",
6282
+ "description": "Whether to archive the environment's active limits whose names aren't in `limits`. You can restore them later. Default: false, which leaves them alone.",
6212
6283
  "schema": {
6213
6284
  "type": "boolean",
6214
- "description": "Archive the environment's active limits whose names aren't in `limits` (restorable). Default: false, which leaves them alone."
6285
+ "description": "Whether to archive the environment's active limits whose names aren't in `limits`. You can restore them later. Default: false, which leaves them alone."
6215
6286
  }
6216
6287
  },
6217
6288
  {
@@ -6219,15 +6290,16 @@ var OPERATIONS = [
6219
6290
  "in": "body",
6220
6291
  "type": "boolean",
6221
6292
  "required": false,
6222
- "description": "Answer what the sync would do and change nothing. Default: false.",
6293
+ "description": "Whether to report what the sync would do without changing anything. Default: false.",
6223
6294
  "schema": {
6224
6295
  "type": "boolean",
6225
- "description": "Answer what the sync would do and change nothing. Default: false."
6296
+ "description": "Whether to report what the sync would do without changing anything. Default: false."
6226
6297
  }
6227
6298
  }
6228
6299
  ],
6229
6300
  "hasBody": true,
6230
6301
  "workspace": true,
6302
+ "acceptsApiKey": true,
6231
6303
  "scope": "limits:write"
6232
6304
  },
6233
6305
  {
@@ -6251,16 +6323,18 @@ var OPERATIONS = [
6251
6323
  "idempotentHint": false
6252
6324
  }
6253
6325
  },
6254
- "description": "Changes a limit's name, amount, fail mode or whether it is enabled; checks use the new rule at once. What a limit counts (subject, action, unit, window, every, start, rolling) is fixed: a different value is refused (400) \u2014 create a new limit and archive this one. Owners and admins only, for a person's token.",
6326
+ "description": "Changes a limit's name, amount, fail mode or whether it's enabled. Checks use the new rule at once. You can't change a limit's subject, action, unit, window, every, start or rolling, and a request that tries gets a 400. To count something different, create a new limit and archive this one. With a personal access token, only owners and admins can call this. A workspace API key with this scope can.",
6255
6327
  "fields": [
6256
6328
  {
6257
6329
  "name": "limitId",
6258
6330
  "in": "path",
6259
6331
  "type": "string",
6260
6332
  "required": true,
6261
- "example": "lmt_3f0c\u2026",
6333
+ "description": "The limit's ID.",
6334
+ "example": "lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34",
6262
6335
  "schema": {
6263
- "type": "string"
6336
+ "type": "string",
6337
+ "description": "The limit's ID."
6264
6338
  }
6265
6339
  },
6266
6340
  {
@@ -6296,10 +6370,10 @@ var OPERATIONS = [
6296
6370
  "in": "body",
6297
6371
  "type": "boolean",
6298
6372
  "required": false,
6299
- "description": "Whether checks enforce it.",
6373
+ "description": "Whether checks enforce the limit.",
6300
6374
  "schema": {
6301
6375
  "type": "boolean",
6302
- "description": "Whether checks enforce it."
6376
+ "description": "Whether checks enforce the limit."
6303
6377
  }
6304
6378
  },
6305
6379
  {
@@ -6307,14 +6381,14 @@ var OPERATIONS = [
6307
6381
  "in": "body",
6308
6382
  "type": "string",
6309
6383
  "required": false,
6310
- "description": "What your code should do when Limitry can't be reached: `open` (allow) or `closed` (deny).",
6384
+ "description": "What your code should do when it can't reach Limitry. `open` allows and `closed` refuses.",
6311
6385
  "schema": {
6312
6386
  "type": "string",
6313
6387
  "enum": [
6314
6388
  "open",
6315
6389
  "closed"
6316
6390
  ],
6317
- "description": "What your code should do when Limitry can't be reached: `open` (allow) or `closed` (deny)."
6391
+ "description": "What your code should do when it can't reach Limitry. `open` allows and `closed` refuses."
6318
6392
  }
6319
6393
  },
6320
6394
  {
@@ -6322,7 +6396,7 @@ var OPERATIONS = [
6322
6396
  "in": "body",
6323
6397
  "type": "json",
6324
6398
  "required": false,
6325
- "description": "Who it applies to. Fixed once the limit is created: to change it, create a new limit and archive this one.",
6399
+ "description": "Who the limit applies to. You set it when you create the limit. To change it later, create a new limit and archive this one.",
6326
6400
  "example": {
6327
6401
  "kind": "user"
6328
6402
  },
@@ -6333,7 +6407,7 @@ var OPERATIONS = [
6333
6407
  "type": "string",
6334
6408
  "minLength": 1,
6335
6409
  "maxLength": 100,
6336
- "description": "Your own label for who is checked: user, team, apikey \u2026"
6410
+ "description": "Your own label for who the limit applies to, such as user, team or apikey."
6337
6411
  },
6338
6412
  "id": {
6339
6413
  "type": [
@@ -6342,10 +6416,10 @@ var OPERATIONS = [
6342
6416
  ],
6343
6417
  "minLength": 1,
6344
6418
  "maxLength": 100,
6345
- "description": "One subject; omit or null for every subject of the kind. A subject's own limit replaces the kind's limits with the same action and window."
6419
+ "description": "One subject's ID. Leave it out, or send null, to cover every subject of the kind. A limit for one subject replaces the kind's limits that have the same action and window."
6346
6420
  }
6347
6421
  },
6348
- "description": "Who it applies to. Fixed once the limit is created: to change it, create a new limit and archive this one."
6422
+ "description": "Who the limit applies to. You set it when you create the limit. To change it later, create a new limit and archive this one."
6349
6423
  }
6350
6424
  },
6351
6425
  {
@@ -6353,12 +6427,12 @@ var OPERATIONS = [
6353
6427
  "in": "body",
6354
6428
  "type": "string",
6355
6429
  "required": false,
6356
- "description": "The action. Fixed once the limit is created: to change it, create a new limit and archive this one.",
6430
+ "description": "The action the limit applies to. You set it when you create the limit. To change it later, create a new limit and archive this one.",
6357
6431
  "schema": {
6358
6432
  "type": "string",
6359
6433
  "minLength": 1,
6360
6434
  "maxLength": 100,
6361
- "description": "The action. Fixed once the limit is created: to change it, create a new limit and archive this one."
6435
+ "description": "The action the limit applies to. You set it when you create the limit. To change it later, create a new limit and archive this one."
6362
6436
  }
6363
6437
  },
6364
6438
  {
@@ -6366,12 +6440,12 @@ var OPERATIONS = [
6366
6440
  "in": "body",
6367
6441
  "type": "string",
6368
6442
  "required": false,
6369
- "description": "What the amount counts. Fixed once the limit is created: to change it, create a new limit and archive this one.",
6443
+ "description": "What the amount counts. You set it when you create the limit. To change it later, create a new limit and archive this one.",
6370
6444
  "schema": {
6371
6445
  "type": "string",
6372
6446
  "minLength": 1,
6373
6447
  "maxLength": 40,
6374
- "description": "What the amount counts. Fixed once the limit is created: to change it, create a new limit and archive this one."
6448
+ "description": "What the amount counts. You set it when you create the limit. To change it later, create a new limit and archive this one."
6375
6449
  }
6376
6450
  },
6377
6451
  {
@@ -6379,7 +6453,7 @@ var OPERATIONS = [
6379
6453
  "in": "body",
6380
6454
  "type": "string",
6381
6455
  "required": false,
6382
- "description": "The window. Fixed once the limit is created: to change it, create a new limit and archive this one.",
6456
+ "description": "The kind of period. You set it when you create the limit. To change it later, create a new limit and archive this one.",
6383
6457
  "schema": {
6384
6458
  "type": "string",
6385
6459
  "enum": [
@@ -6392,7 +6466,7 @@ var OPERATIONS = [
6392
6466
  "total",
6393
6467
  "concurrent"
6394
6468
  ],
6395
- "description": "The window. Fixed once the limit is created: to change it, create a new limit and archive this one."
6469
+ "description": "The kind of period. You set it when you create the limit. To change it later, create a new limit and archive this one."
6396
6470
  }
6397
6471
  },
6398
6472
  {
@@ -6400,12 +6474,12 @@ var OPERATIONS = [
6400
6474
  "in": "body",
6401
6475
  "type": "number",
6402
6476
  "required": false,
6403
- "description": "How many windows a period lasts. Fixed once the limit is created: to change it, create a new limit and archive this one.",
6477
+ "description": "How many windows one period lasts. You set it when you create the limit. To change it later, create a new limit and archive this one.",
6404
6478
  "schema": {
6405
6479
  "type": "integer",
6406
6480
  "minimum": 1,
6407
6481
  "maximum": 1e3,
6408
- "description": "How many windows a period lasts. Fixed once the limit is created: to change it, create a new limit and archive this one."
6482
+ "description": "How many windows one period lasts. You set it when you create the limit. To change it later, create a new limit and archive this one."
6409
6483
  }
6410
6484
  },
6411
6485
  {
@@ -6413,7 +6487,7 @@ var OPERATIONS = [
6413
6487
  "in": "body",
6414
6488
  "type": "string",
6415
6489
  "required": false,
6416
- "description": "Where a period begins. Fixed once the limit is created: to change it, create a new limit and archive this one.",
6490
+ "description": "Where each period begins. You set it when you create the limit. To change it later, create a new limit and archive this one.",
6417
6491
  "schema": {
6418
6492
  "type": "string",
6419
6493
  "enum": [
@@ -6421,7 +6495,7 @@ var OPERATIONS = [
6421
6495
  "billing_date",
6422
6496
  "first_use"
6423
6497
  ],
6424
- "description": "Where a period begins. Fixed once the limit is created: to change it, create a new limit and archive this one."
6498
+ "description": "Where each period begins. You set it when you create the limit. To change it later, create a new limit and archive this one."
6425
6499
  }
6426
6500
  },
6427
6501
  {
@@ -6429,15 +6503,16 @@ var OPERATIONS = [
6429
6503
  "in": "body",
6430
6504
  "type": "boolean",
6431
6505
  "required": false,
6432
- "description": "Whether it counts the last window. Fixed once the limit is created: to change it, create a new limit and archive this one.",
6506
+ "description": "Whether the limit counts the last windows up to each check. You set it when you create the limit. To change it later, create a new limit and archive this one.",
6433
6507
  "schema": {
6434
6508
  "type": "boolean",
6435
- "description": "Whether it counts the last window. Fixed once the limit is created: to change it, create a new limit and archive this one."
6509
+ "description": "Whether the limit counts the last windows up to each check. You set it when you create the limit. To change it later, create a new limit and archive this one."
6436
6510
  }
6437
6511
  }
6438
6512
  ],
6439
6513
  "hasBody": true,
6440
6514
  "workspace": true,
6515
+ "acceptsApiKey": true,
6441
6516
  "scope": "limits:write"
6442
6517
  },
6443
6518
  {
@@ -6461,15 +6536,17 @@ var OPERATIONS = [
6461
6536
  "idempotentHint": false
6462
6537
  }
6463
6538
  },
6464
- "description": "Commits a reservation with the ACTUAL amount used (`cost`): less than reserved gives the rest back at once; more is charged in full \u2014 the work happened. A commit after the reservation expired still charges `cost`. Repeating a commit answers the same. Its API-key check is cached briefly for speed: a revoked key can keep working here for up to 60 seconds.",
6539
+ "description": "Commits a reservation with the amount actually used (`cost`). If `cost` is less than the amount reserved, the rest goes back at once. If it's more, Limitry charges the whole `cost`, since the work happened. A commit up to 24 hours after the reservation expired still charges `cost`. Repeating a commit with the same `cost` returns the same result, and a different `cost` gets a 400. We cache its API key check briefly for speed. A revoked key can keep working here for up to 60 seconds.",
6465
6540
  "fields": [
6466
6541
  {
6467
6542
  "name": "reservationId",
6468
6543
  "in": "path",
6469
6544
  "type": "string",
6470
6545
  "required": true,
6546
+ "description": "The reservation's ID.",
6471
6547
  "schema": {
6472
- "type": "string"
6548
+ "type": "string",
6549
+ "description": "The reservation's ID."
6473
6550
  }
6474
6551
  },
6475
6552
  {
@@ -6488,6 +6565,7 @@ var OPERATIONS = [
6488
6565
  ],
6489
6566
  "hasBody": true,
6490
6567
  "workspace": true,
6568
+ "acceptsApiKey": true,
6491
6569
  "scope": "checks:write"
6492
6570
  },
6493
6571
  {
@@ -6511,15 +6589,17 @@ var OPERATIONS = [
6511
6589
  "idempotentHint": false
6512
6590
  }
6513
6591
  },
6514
- "description": "Keeps a reservation for longer work: it now expires `ttlSeconds` from now (default 300, at most 3600) \u2014 call it again as a heartbeat. Only an open reservation can be extended. Its API-key check is cached briefly for speed: a revoked key can keep working here for up to 60 seconds.",
6592
+ "description": "Keeps a reservation open for longer work, so it expires `ttlSeconds` from now. Call it again as a heartbeat while the work runs. You can only extend a reservation that's still held. We cache its API key check briefly for speed. A revoked key can keep working here for up to 60 seconds.",
6515
6593
  "fields": [
6516
6594
  {
6517
6595
  "name": "reservationId",
6518
6596
  "in": "path",
6519
6597
  "type": "string",
6520
6598
  "required": true,
6599
+ "description": "The reservation's ID.",
6521
6600
  "schema": {
6522
- "type": "string"
6601
+ "type": "string",
6602
+ "description": "The reservation's ID."
6523
6603
  }
6524
6604
  },
6525
6605
  {
@@ -6527,18 +6607,19 @@ var OPERATIONS = [
6527
6607
  "in": "body",
6528
6608
  "type": "number",
6529
6609
  "required": false,
6530
- "description": "Seconds from now. Default 300.",
6610
+ "description": "Seconds from now until the reservation expires. Default: 300. At most 3600.",
6531
6611
  "example": 600,
6532
6612
  "schema": {
6533
6613
  "type": "integer",
6534
6614
  "minimum": 1,
6535
6615
  "maximum": 3600,
6536
- "description": "Seconds from now. Default 300."
6616
+ "description": "Seconds from now until the reservation expires. Default: 300. At most 3600."
6537
6617
  }
6538
6618
  }
6539
6619
  ],
6540
6620
  "hasBody": true,
6541
6621
  "workspace": true,
6622
+ "acceptsApiKey": true,
6542
6623
  "scope": "checks:write"
6543
6624
  },
6544
6625
  {
@@ -6562,20 +6643,23 @@ var OPERATIONS = [
6562
6643
  "idempotentHint": false
6563
6644
  }
6564
6645
  },
6565
- "description": "Gives the whole reservation back \u2014 the work did not happen. Repeating a release answers the same; releasing a committed reservation is refused. Its API-key check is cached briefly for speed: a revoked key can keep working here for up to 60 seconds.",
6646
+ "description": "Gives the whole reservation back, because the work didn't happen. Repeating a release within 24 hours returns the same result. You can't release a reservation you've already committed. We cache its API key check briefly for speed. A revoked key can keep working here for up to 60 seconds.",
6566
6647
  "fields": [
6567
6648
  {
6568
6649
  "name": "reservationId",
6569
6650
  "in": "path",
6570
6651
  "type": "string",
6571
6652
  "required": true,
6653
+ "description": "The reservation's ID.",
6572
6654
  "schema": {
6573
- "type": "string"
6655
+ "type": "string",
6656
+ "description": "The reservation's ID."
6574
6657
  }
6575
6658
  }
6576
6659
  ],
6577
6660
  "hasBody": false,
6578
6661
  "workspace": true,
6662
+ "acceptsApiKey": true,
6579
6663
  "scope": "checks:write"
6580
6664
  },
6581
6665
  {
@@ -6600,18 +6684,20 @@ var OPERATIONS = [
6600
6684
  "idempotentHint": true
6601
6685
  }
6602
6686
  },
6603
- "description": "A subject's billing date: when its `billing_date` limits' periods start from. A subject is yours (a user, a team, an agent) and exists once a check names it.",
6687
+ "description": "Returns a subject's billing date, the day its `billing_date` limits start each new period. A subject is one of yours, such as a user, a team or an agent. It exists once a check names it.",
6604
6688
  "fields": [
6605
6689
  {
6606
6690
  "name": "subjectKind",
6607
6691
  "in": "path",
6608
6692
  "type": "string",
6609
6693
  "required": true,
6694
+ "description": "The subject kind's ID.",
6610
6695
  "example": "team",
6611
6696
  "schema": {
6612
6697
  "type": "string",
6613
6698
  "minLength": 1,
6614
- "maxLength": 100
6699
+ "maxLength": 100,
6700
+ "description": "The subject kind's ID."
6615
6701
  }
6616
6702
  },
6617
6703
  {
@@ -6619,16 +6705,19 @@ var OPERATIONS = [
6619
6705
  "in": "path",
6620
6706
  "type": "string",
6621
6707
  "required": true,
6708
+ "description": "The subject's ID.",
6622
6709
  "example": "team_42",
6623
6710
  "schema": {
6624
6711
  "type": "string",
6625
6712
  "minLength": 1,
6626
- "maxLength": 200
6713
+ "maxLength": 200,
6714
+ "description": "The subject's ID."
6627
6715
  }
6628
6716
  }
6629
6717
  ],
6630
6718
  "hasBody": false,
6631
6719
  "workspace": true,
6720
+ "acceptsApiKey": true,
6632
6721
  "scope": "limits:read"
6633
6722
  },
6634
6723
  {
@@ -6653,18 +6742,20 @@ var OPERATIONS = [
6653
6742
  "idempotentHint": false
6654
6743
  }
6655
6744
  },
6656
- "description": "Resets one limit on a subject (`limitId`), or every limit on it (`{}`), at once: for goodwill, a promotion or support. The schedule doesn't move: the next reset is still the usual one. A balance goes back to its amount; a concurrent limit is skipped. Send an Idempotency-Key and a repeat resets once. Owners and admins only, for a person's token.",
6745
+ "description": "Resets one limit on a subject now, or every limit on it. Send `limitId` for one limit, or `{}` for all of them. Use it for goodwill, a promotion or support. The schedule doesn't move, so the next reset still happens when it normally would. A balance goes back to its amount, and the reset skips concurrent limits. With an Idempotency-Key, a repeated request resets only once. With a personal access token, only owners and admins can call this. A workspace API key with this scope can.",
6657
6746
  "fields": [
6658
6747
  {
6659
6748
  "name": "subjectKind",
6660
6749
  "in": "path",
6661
6750
  "type": "string",
6662
6751
  "required": true,
6752
+ "description": "The subject kind's ID.",
6663
6753
  "example": "team",
6664
6754
  "schema": {
6665
6755
  "type": "string",
6666
6756
  "minLength": 1,
6667
- "maxLength": 100
6757
+ "maxLength": 100,
6758
+ "description": "The subject kind's ID."
6668
6759
  }
6669
6760
  },
6670
6761
  {
@@ -6672,11 +6763,13 @@ var OPERATIONS = [
6672
6763
  "in": "path",
6673
6764
  "type": "string",
6674
6765
  "required": true,
6766
+ "description": "The subject's ID.",
6675
6767
  "example": "team_42",
6676
6768
  "schema": {
6677
6769
  "type": "string",
6678
6770
  "minLength": 1,
6679
- "maxLength": 200
6771
+ "maxLength": 200,
6772
+ "description": "The subject's ID."
6680
6773
  }
6681
6774
  },
6682
6775
  {
@@ -6684,16 +6777,17 @@ var OPERATIONS = [
6684
6777
  "in": "body",
6685
6778
  "type": "string",
6686
6779
  "required": false,
6687
- "description": "Just this limit. Default: every limit on the subject.",
6688
- "example": "lmt_3f0c\u2026",
6780
+ "description": "The one limit to reset. Default: every limit on the subject.",
6781
+ "example": "lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34",
6689
6782
  "schema": {
6690
6783
  "type": "string",
6691
- "description": "Just this limit. Default: every limit on the subject."
6784
+ "description": "The one limit to reset. Default: every limit on the subject."
6692
6785
  }
6693
6786
  }
6694
6787
  ],
6695
6788
  "hasBody": true,
6696
6789
  "workspace": true,
6790
+ "acceptsApiKey": true,
6697
6791
  "scope": "limits:write"
6698
6792
  },
6699
6793
  {
@@ -6718,18 +6812,20 @@ var OPERATIONS = [
6718
6812
  "idempotentHint": false
6719
6813
  }
6720
6814
  },
6721
- "description": "Sets when a subject's `billing_date` limits' periods start from: typically its subscription's start date, from your billing system's webhook, so its allowance resets on its own billing day (monthly for an annual plan, too). Owners and admins only, for a person's token.",
6815
+ "description": "Sets the date a subject's `billing_date` limits count their periods from. Usually this is the subscription's start date, set from your billing system's webhook. The subject's allowance then resets on its own billing day, and a monthly limit still resets monthly on an annual plan. With a personal access token, only owners and admins can call this. A workspace API key with this scope can.",
6722
6816
  "fields": [
6723
6817
  {
6724
6818
  "name": "subjectKind",
6725
6819
  "in": "path",
6726
6820
  "type": "string",
6727
6821
  "required": true,
6822
+ "description": "The subject kind's ID.",
6728
6823
  "example": "team",
6729
6824
  "schema": {
6730
6825
  "type": "string",
6731
6826
  "minLength": 1,
6732
- "maxLength": 100
6827
+ "maxLength": 100,
6828
+ "description": "The subject kind's ID."
6733
6829
  }
6734
6830
  },
6735
6831
  {
@@ -6737,11 +6833,13 @@ var OPERATIONS = [
6737
6833
  "in": "path",
6738
6834
  "type": "string",
6739
6835
  "required": true,
6836
+ "description": "The subject's ID.",
6740
6837
  "example": "team_42",
6741
6838
  "schema": {
6742
6839
  "type": "string",
6743
6840
  "minLength": 1,
6744
- "maxLength": 200
6841
+ "maxLength": 200,
6842
+ "description": "The subject's ID."
6745
6843
  }
6746
6844
  },
6747
6845
  {
@@ -6749,17 +6847,18 @@ var OPERATIONS = [
6749
6847
  "in": "body",
6750
6848
  "type": "string",
6751
6849
  "required": true,
6752
- "description": "The date and time its periods start from (ISO 8601), such as a subscription's start.",
6850
+ "description": "The date and time the subject's periods start from, in ISO 8601, such as a subscription's start.",
6753
6851
  "example": "2026-03-17T14:30:00Z",
6754
6852
  "schema": {
6755
6853
  "type": "string",
6756
6854
  "format": "date-time",
6757
- "description": "The date and time its periods start from (ISO 8601), such as a subscription's start."
6855
+ "description": "The date and time the subject's periods start from, in ISO 8601, such as a subscription's start."
6758
6856
  }
6759
6857
  }
6760
6858
  ],
6761
6859
  "hasBody": true,
6762
6860
  "workspace": true,
6861
+ "acceptsApiKey": true,
6763
6862
  "scope": "limits:write"
6764
6863
  },
6765
6864
  {
@@ -6781,18 +6880,18 @@ var OPERATIONS = [
6781
6880
  "idempotentHint": true
6782
6881
  }
6783
6882
  },
6784
- "description": "Units used, checks allowed and refused for one limit \u2014 across all subjects, or one (`subject`, as `kind:id`) \u2014 per hour or per day (UTC), every bucket in the range included. Up to about a minute behind live checks. Default: the last 30 days, by day.",
6883
+ "description": "Returns one limit's usage over time: the units used, and the checks allowed and refused. It covers every subject, or one subject named in `subject` as `kind:id`. Usage comes in hourly or daily buckets in UTC, and the response includes every bucket in the range. It can be up to about a minute behind live checks. By default, it covers the last 30 days, by day. A request returns at most 2,000 buckets. Usage older than your plan's history isn't returned.",
6785
6884
  "fields": [
6786
6885
  {
6787
6886
  "name": "limitId",
6788
6887
  "in": "query",
6789
6888
  "type": "string",
6790
6889
  "required": true,
6791
- "description": "The limit.",
6792
- "example": "lmt_3f0c\u2026",
6890
+ "description": "The limit's ID.",
6891
+ "example": "lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34",
6793
6892
  "schema": {
6794
6893
  "type": "string",
6795
- "description": "The limit."
6894
+ "description": "The limit's ID."
6796
6895
  }
6797
6896
  },
6798
6897
  {
@@ -6800,13 +6899,13 @@ var OPERATIONS = [
6800
6899
  "in": "query",
6801
6900
  "type": "string",
6802
6901
  "required": false,
6803
- "description": "One subject's usage, not every subject's, as `kind:id`.",
6902
+ "description": "One subject, as `kind:id`, to see its usage instead of every subject's.",
6804
6903
  "example": "user:usr_123",
6805
6904
  "schema": {
6806
6905
  "type": "string",
6807
6906
  "minLength": 3,
6808
6907
  "maxLength": 301,
6809
- "description": "One subject's usage, not every subject's, as `kind:id`."
6908
+ "description": "One subject, as `kind:id`, to see its usage instead of every subject's."
6810
6909
  }
6811
6910
  },
6812
6911
  {
@@ -6814,12 +6913,12 @@ var OPERATIONS = [
6814
6913
  "in": "query",
6815
6914
  "type": "string",
6816
6915
  "required": false,
6817
- "description": "Start of the range (ISO 8601). Default: 30 days before `to`.",
6916
+ "description": "The start of the range, in ISO 8601. Default: 30 days before `to`.",
6818
6917
  "example": "2026-10-01T00:00:00Z",
6819
6918
  "schema": {
6820
6919
  "type": "string",
6821
6920
  "format": "date-time",
6822
- "description": "Start of the range (ISO 8601). Default: 30 days before `to`."
6921
+ "description": "The start of the range, in ISO 8601. Default: 30 days before `to`."
6823
6922
  }
6824
6923
  },
6825
6924
  {
@@ -6827,12 +6926,12 @@ var OPERATIONS = [
6827
6926
  "in": "query",
6828
6927
  "type": "string",
6829
6928
  "required": false,
6830
- "description": "End of the range (ISO 8601). Default: now.",
6929
+ "description": "The end of the range, in ISO 8601. Default: now.",
6831
6930
  "example": "2026-10-31T00:00:00Z",
6832
6931
  "schema": {
6833
6932
  "type": "string",
6834
6933
  "format": "date-time",
6835
- "description": "End of the range (ISO 8601). Default: now."
6934
+ "description": "The end of the range, in ISO 8601. Default: now."
6836
6935
  }
6837
6936
  },
6838
6937
  {
@@ -6840,7 +6939,7 @@ var OPERATIONS = [
6840
6939
  "in": "query",
6841
6940
  "type": "string",
6842
6941
  "required": false,
6843
- "description": "One bucket per `hour` or per `day` (UTC). Default: day.",
6942
+ "description": "Whether each bucket is an `hour` or a `day`, in UTC. Default: day.",
6844
6943
  "schema": {
6845
6944
  "type": "string",
6846
6945
  "enum": [
@@ -6848,12 +6947,13 @@ var OPERATIONS = [
6848
6947
  "day"
6849
6948
  ],
6850
6949
  "default": "day",
6851
- "description": "One bucket per `hour` or per `day` (UTC). Default: day."
6950
+ "description": "Whether each bucket is an `hour` or a `day`, in UTC. Default: day."
6852
6951
  }
6853
6952
  }
6854
6953
  ],
6855
6954
  "hasBody": false,
6856
6955
  "workspace": true,
6956
+ "acceptsApiKey": true,
6857
6957
  "scope": "limits:read"
6858
6958
  },
6859
6959
  {
@@ -6875,20 +6975,20 @@ var OPERATIONS = [
6875
6975
  "idempotentHint": true
6876
6976
  }
6877
6977
  },
6878
- "description": "Every enabled limit on one subject (`subject`, as `kind:id`, such as `user:usr_123`) \u2014 and on its shared subjects (`shared`, comma-separated `kind:id`, such as `team:team_42`) \u2014 with what is used, what is left and when it resets, exact as of now. For showing an end user where they stand: call it from your server with your key, never from a browser. Not a check: nothing is counted. A subject with no limit here answers an empty `limits` list.",
6978
+ "description": "Returns where one subject stands on every enabled limit, exact as of now. It covers the subject's own limits and the limits on its shared subjects. Name the subject as `kind:id`, such as `user:usr_123`, and list its shared subjects in `shared`, such as `team:team_42`. Each limit shows what's used, what's left and when it resets. Use it to show your users where they stand. Call it from your server with your key, never from a browser. It isn't a check, so it counts nothing. A subject with no limits returns an empty `limits` list.",
6879
6979
  "fields": [
6880
6980
  {
6881
6981
  "name": "subject",
6882
6982
  "in": "query",
6883
6983
  "type": "string",
6884
6984
  "required": true,
6885
- "description": "The subject, as `kind:id`: its kind and id as your checks send them.",
6985
+ "description": "The subject, written as `kind:id` exactly as your checks send it.",
6886
6986
  "example": "user:usr_123",
6887
6987
  "schema": {
6888
6988
  "type": "string",
6889
6989
  "minLength": 3,
6890
6990
  "maxLength": 301,
6891
- "description": "The subject, as `kind:id`: its kind and id as your checks send them."
6991
+ "description": "The subject, written as `kind:id` exactly as your checks send it."
6892
6992
  }
6893
6993
  },
6894
6994
  {
@@ -6896,16 +6996,17 @@ var OPERATIONS = [
6896
6996
  "in": "query",
6897
6997
  "type": "string",
6898
6998
  "required": false,
6899
- "description": "Shared subjects to include, comma-separated `kind:id` (up to 4).",
6999
+ "description": "Shared subjects to include, as comma-separated `kind:id` pairs. Send up to 4.",
6900
7000
  "example": "team:team_42",
6901
7001
  "schema": {
6902
7002
  "type": "string",
6903
- "description": "Shared subjects to include, comma-separated `kind:id` (up to 4)."
7003
+ "description": "Shared subjects to include, as comma-separated `kind:id` pairs. Send up to 4."
6904
7004
  }
6905
7005
  }
6906
7006
  ],
6907
7007
  "hasBody": false,
6908
7008
  "workspace": true,
7009
+ "acceptsApiKey": true,
6909
7010
  "scope": "limits:read"
6910
7011
  },
6911
7012
  {
@@ -6927,18 +7028,18 @@ var OPERATIONS = [
6927
7028
  "idempotentHint": true
6928
7029
  }
6929
7030
  },
6930
- "description": "A limit's subjects in its CURRENT window, most used first: units used, what is left, and how many checks it refused. Up to about a minute behind live checks.",
7031
+ "description": "Lists a limit's subjects in its current window, most used first. Each one shows the units used, what's left and how many checks the limit refused. The amounts are exact, but a subject first checked in the last minute may not appear yet. For a `concurrent` limit, it lists the slots each subject holds now, among the subjects checked in the last hour.",
6931
7032
  "fields": [
6932
7033
  {
6933
7034
  "name": "limitId",
6934
7035
  "in": "query",
6935
7036
  "type": "string",
6936
7037
  "required": true,
6937
- "description": "The limit.",
6938
- "example": "lmt_3f0c\u2026",
7038
+ "description": "The limit's ID.",
7039
+ "example": "lmt_6f1c2a9e-4b7d-4e3a-9c5f-8d2b1a0e7c34",
6939
7040
  "schema": {
6940
7041
  "type": "string",
6941
- "description": "The limit."
7042
+ "description": "The limit's ID."
6942
7043
  }
6943
7044
  },
6944
7045
  {
@@ -6946,18 +7047,19 @@ var OPERATIONS = [
6946
7047
  "in": "query",
6947
7048
  "type": "number",
6948
7049
  "required": false,
6949
- "description": "How many subjects, most used first: 1\u2013200. Default 50.",
7050
+ "description": "How many subjects to list. Default: 50. The response holds at most 50, or 25 for a `concurrent` limit, even if you ask for more.",
6950
7051
  "schema": {
6951
7052
  "type": "integer",
6952
7053
  "minimum": 1,
6953
7054
  "maximum": 200,
6954
7055
  "default": 50,
6955
- "description": "How many subjects, most used first: 1\u2013200. Default 50."
7056
+ "description": "How many subjects to list. Default: 50. The response holds at most 50, or 25 for a `concurrent` limit, even if you ask for more."
6956
7057
  }
6957
7058
  }
6958
7059
  ],
6959
7060
  "hasBody": false,
6960
7061
  "workspace": true,
7062
+ "acceptsApiKey": true,
6961
7063
  "scope": "limits:read"
6962
7064
  },
6963
7065
  {
@@ -6972,12 +7074,13 @@ var OPERATIONS = [
6972
7074
  },
6973
7075
  "mcp": {
6974
7076
  "exposed": false,
6975
- "reason": "Personal access tokens only; an agent's connection acts in one workspace (workspace_get)."
7077
+ "reason": "Only a personal access token can call this. An agent's connection acts in one workspace, which workspace_get returns."
6976
7078
  },
6977
- "description": 'Returns the user the personal access token belongs to, with their workspace memberships. Useful as an integration smoke test ("who am I?").',
7079
+ "description": 'Returns the user the personal access token belongs to, and their workspace memberships. Use it as a smoke test for an integration ("who am I?").',
6978
7080
  "fields": [],
6979
7081
  "hasBody": false,
6980
- "workspace": false
7082
+ "workspace": false,
7083
+ "acceptsApiKey": false
6981
7084
  },
6982
7085
  {
6983
7086
  "operationId": "user.revokeToken",
@@ -6991,12 +7094,13 @@ var OPERATIONS = [
6991
7094
  },
6992
7095
  "mcp": {
6993
7096
  "exposed": false,
6994
- "reason": "Revokes a person's own credential; agents connect through OAuth, not personal tokens."
7097
+ "reason": "Revokes a person's own credential. Agents connect through OAuth and never use personal tokens."
6995
7098
  },
6996
- "description": "Revokes the personal access token used to call it \u2014 signing out from a script or the CLI (`logout`). The token stops working immediately; other tokens are untouched.",
7099
+ "description": "Revokes the personal access token that makes the request. Use it to sign out from a script or the CLI (`logout`). The token stops working immediately. Your other tokens keep working.",
6997
7100
  "fields": [],
6998
7101
  "hasBody": false,
6999
- "workspace": false
7102
+ "workspace": false,
7103
+ "acceptsApiKey": false
7000
7104
  },
7001
7105
  {
7002
7106
  "operationId": "workspace.approvalActions.list",
@@ -7017,10 +7121,11 @@ var OPERATIONS = [
7017
7121
  "idempotentHint": true
7018
7122
  }
7019
7123
  },
7020
- "description": "Actions a credential may not take itself but may ASK a person to approve: each one's input (JSON Schema), who can approve it, and whether it creates a secret.",
7124
+ "description": "Lists the actions a credential can't take itself but can ask a person to approve. Each action comes with its input as a JSON Schema, who can approve it and whether it creates a secret.",
7021
7125
  "fields": [],
7022
7126
  "hasBody": false,
7023
7127
  "workspace": true,
7128
+ "acceptsApiKey": true,
7024
7129
  "scope": "workspace.approvals:read"
7025
7130
  },
7026
7131
  {
@@ -7042,7 +7147,7 @@ var OPERATIONS = [
7042
7147
  "idempotentHint": false
7043
7148
  }
7044
7149
  },
7045
- "description": "Files a request for an action you may not take yourself (see approval-actions) and notifies everyone who can approve it. Show the person `approveUrl` and why you need it; then check the request until it is decided (it expires after 24 hours). A personal access token or an app a person connected may ask \u2014 not a workspace API key.",
7150
+ "description": "Creates a request for an action you can't take yourself and notifies everyone who can approve it. The actions you can ask for are in approval-actions. Show the person `approveUrl` and why you need the action. Then check the request until a person decides. A request expires after 24 hours. A personal access token or an app a person connected can ask. A workspace API key can't.",
7046
7151
  "fields": [
7047
7152
  {
7048
7153
  "name": "action",
@@ -7061,7 +7166,7 @@ var OPERATIONS = [
7061
7166
  "in": "body",
7062
7167
  "type": "json",
7063
7168
  "required": true,
7064
- "description": "The action's input, per its JSON Schema.",
7169
+ "description": "The action's input. It must match the action's JSON Schema.",
7065
7170
  "example": {
7066
7171
  "name": "acme-web",
7067
7172
  "scopes": [
@@ -7071,7 +7176,7 @@ var OPERATIONS = [
7071
7176
  "schema": {
7072
7177
  "type": "object",
7073
7178
  "additionalProperties": {},
7074
- "description": "The action's input, per its JSON Schema."
7179
+ "description": "The action's input. It must match the action's JSON Schema."
7075
7180
  }
7076
7181
  },
7077
7182
  {
@@ -7079,17 +7184,19 @@ var OPERATIONS = [
7079
7184
  "in": "body",
7080
7185
  "type": "string",
7081
7186
  "required": true,
7082
- "description": "Why \u2014 the person reads it before deciding.",
7187
+ "description": "Why you need the action. The person reads it before deciding.",
7188
+ "example": "A key for the deploy pipeline.",
7083
7189
  "schema": {
7084
7190
  "type": "string",
7085
7191
  "minLength": 1,
7086
7192
  "maxLength": 500,
7087
- "description": "Why \u2014 the person reads it before deciding."
7193
+ "description": "Why you need the action. The person reads it before deciding."
7088
7194
  }
7089
7195
  }
7090
7196
  ],
7091
7197
  "hasBody": true,
7092
7198
  "workspace": true,
7199
+ "acceptsApiKey": false,
7093
7200
  "scope": "workspace.approvals:write"
7094
7201
  },
7095
7202
  {
@@ -7113,7 +7220,7 @@ var OPERATIONS = [
7113
7220
  "idempotentHint": true
7114
7221
  }
7115
7222
  },
7116
- "description": "The request you filed: pending, denied, completed (the action ran \u2014 see `result`), approved (waiting for the CLI to redeem it), failed or expired.",
7223
+ "description": "Returns an approval request you created, with its status. A `pending` request is waiting for a person to decide. A `completed` request's action ran, and `result` holds the outcome. An `approved` request is waiting for the CLI to redeem it. A request can also be `denied`, `failed` or `expired`.",
7117
7224
  "fields": [
7118
7225
  {
7119
7226
  "name": "requestId",
@@ -7121,6 +7228,7 @@ var OPERATIONS = [
7121
7228
  "type": "string",
7122
7229
  "required": true,
7123
7230
  "description": "The request's id.",
7231
+ "example": "apr_7c2e\u2026",
7124
7232
  "schema": {
7125
7233
  "type": "string",
7126
7234
  "description": "The request's id."
@@ -7129,6 +7237,7 @@ var OPERATIONS = [
7129
7237
  ],
7130
7238
  "hasBody": false,
7131
7239
  "workspace": true,
7240
+ "acceptsApiKey": true,
7132
7241
  "scope": "workspace.approvals:read"
7133
7242
  },
7134
7243
  {
@@ -7145,9 +7254,9 @@ var OPERATIONS = [
7145
7254
  },
7146
7255
  "mcp": {
7147
7256
  "exposed": false,
7148
- "reason": "Returns a secret; secrets never enter an agent's conversation \u2014 the CLI writes them to a file."
7257
+ "reason": "Returns a secret. Secrets never enter an agent's conversation. The CLI writes them to a file instead."
7149
7258
  },
7150
- "description": "Runs an approved, secret-producing action ONCE and returns its secret \u2014 to the personal access token that asked, only. The CLI writes it to a file without printing it.",
7259
+ "description": "Runs an approved action that creates a secret, and returns the secret. The action runs only once. Only the personal access token that asked can redeem it. The CLI writes the secret to a file without printing it.",
7151
7260
  "fields": [
7152
7261
  {
7153
7262
  "name": "requestId",
@@ -7155,6 +7264,7 @@ var OPERATIONS = [
7155
7264
  "type": "string",
7156
7265
  "required": true,
7157
7266
  "description": "The request's id.",
7267
+ "example": "apr_7c2e\u2026",
7158
7268
  "schema": {
7159
7269
  "type": "string",
7160
7270
  "description": "The request's id."
@@ -7163,6 +7273,7 @@ var OPERATIONS = [
7163
7273
  ],
7164
7274
  "hasBody": false,
7165
7275
  "workspace": true,
7276
+ "acceptsApiKey": false,
7166
7277
  "scope": "workspace.approvals:write"
7167
7278
  },
7168
7279
  {
@@ -7184,7 +7295,7 @@ var OPERATIONS = [
7184
7295
  "idempotentHint": true
7185
7296
  }
7186
7297
  },
7187
- "description": "The workspace's audit trail, newest first. Paginate with the opaque `nextCursor` token; `limit` is clamped to 1\u2013100 (default 25). Owner-only for personal access tokens, like the audit page in the application; a Workspace API key is its workspace and always passes.",
7298
+ "description": "Lists the workspace's audit events, newest first. Paginate with the opaque `nextCursor` token. `limit` takes 1 to 100 and defaults to 25. With a personal access token, only workspace owners can call this, as with the audit page in the app. A workspace API key always can, because it acts as the workspace itself.",
7188
7299
  "fields": [
7189
7300
  {
7190
7301
  "name": "limit",
@@ -7215,6 +7326,7 @@ var OPERATIONS = [
7215
7326
  ],
7216
7327
  "hasBody": false,
7217
7328
  "workspace": true,
7329
+ "acceptsApiKey": true,
7218
7330
  "scope": "workspace.audit:read"
7219
7331
  },
7220
7332
  {
@@ -7236,10 +7348,11 @@ var OPERATIONS = [
7236
7348
  "idempotentHint": true
7237
7349
  }
7238
7350
  },
7239
- "description": "Every workspace event a webhook endpoint can subscribe to, with what it means. Pass some as `eventTypes` when adding an endpoint; an endpoint without a list receives them all.",
7351
+ "description": "Lists every workspace event a webhook endpoint can subscribe to, and what each one means. Pass some as `eventTypes` when you add an endpoint. An endpoint without a list receives every event.",
7240
7352
  "fields": [],
7241
7353
  "hasBody": false,
7242
7354
  "workspace": true,
7355
+ "acceptsApiKey": true,
7243
7356
  "scope": "workspace.webhooks:read"
7244
7357
  },
7245
7358
  {
@@ -7261,10 +7374,11 @@ var OPERATIONS = [
7261
7374
  "idempotentHint": true
7262
7375
  }
7263
7376
  },
7264
- "description": `Returns the Workspace the credential acts in \u2014 the API key's own, or the one named by X-Workspace for a personal access token. Useful as an integration smoke test ("who am I?").`,
7377
+ "description": 'Returns the workspace the credential acts in. For an API key, that is the key\'s own workspace. For a personal access token, it is the one named in `X-Workspace`. Use it as a smoke test for an integration ("who am I?").',
7265
7378
  "fields": [],
7266
7379
  "hasBody": false,
7267
7380
  "workspace": true,
7381
+ "acceptsApiKey": true,
7268
7382
  "scope": "workspace:read"
7269
7383
  },
7270
7384
  {
@@ -7286,7 +7400,7 @@ var OPERATIONS = [
7286
7400
  "idempotentHint": true
7287
7401
  }
7288
7402
  },
7289
- "description": "Invitations sent and not yet accepted, declined or expired, newest first. Owners and admins only for a personal credential, as in the app. Paginate with the opaque `nextCursor`.",
7403
+ "description": "Lists the invitations that are not yet accepted, declined or expired, newest first. With a personal credential, only owners and admins can call this, as in the app. A workspace API key always can. Paginate with the opaque `nextCursor`.",
7290
7404
  "fields": [
7291
7405
  {
7292
7406
  "name": "limit",
@@ -7317,6 +7431,7 @@ var OPERATIONS = [
7317
7431
  ],
7318
7432
  "hasBody": false,
7319
7433
  "workspace": true,
7434
+ "acceptsApiKey": true,
7320
7435
  "scope": "workspace.members:read"
7321
7436
  },
7322
7437
  {
@@ -7338,7 +7453,7 @@ var OPERATIONS = [
7338
7453
  "idempotentHint": true
7339
7454
  }
7340
7455
  },
7341
- "description": "The workspace's members with their roles, newest first. Paginate with the opaque `nextCursor`; `limit` is clamped to 1\u2013100 (default 25). Members are invited, removed and given roles in the app.",
7456
+ "description": "Lists the workspace's members and their roles, newest first. Paginate with the opaque `nextCursor`. `limit` takes 1 to 100 and defaults to 25. Invite members, remove them and give them roles in the app.",
7342
7457
  "fields": [
7343
7458
  {
7344
7459
  "name": "limit",
@@ -7369,6 +7484,7 @@ var OPERATIONS = [
7369
7484
  ],
7370
7485
  "hasBody": false,
7371
7486
  "workspace": true,
7487
+ "acceptsApiKey": true,
7372
7488
  "scope": "workspace.members:read"
7373
7489
  },
7374
7490
  {
@@ -7390,7 +7506,7 @@ var OPERATIONS = [
7390
7506
  "idempotentHint": true
7391
7507
  }
7392
7508
  },
7393
- "description": "The workspace's teams with their members' user ids, newest first. Paginate with the opaque `nextCursor`; `limit` is clamped to 1\u2013100 (default 25). Teams are created and staffed in the app.",
7509
+ "description": "Lists the workspace's teams and their members' user ids, newest first. Paginate with the opaque `nextCursor`. `limit` takes 1 to 100 and defaults to 25. Create teams and add members to them in the app.",
7394
7510
  "fields": [
7395
7511
  {
7396
7512
  "name": "limit",
@@ -7421,6 +7537,7 @@ var OPERATIONS = [
7421
7537
  ],
7422
7538
  "hasBody": false,
7423
7539
  "workspace": true,
7540
+ "acceptsApiKey": true,
7424
7541
  "scope": "workspace.teams:read"
7425
7542
  },
7426
7543
  {
@@ -7442,10 +7559,11 @@ var OPERATIONS = [
7442
7559
  "idempotentHint": true
7443
7560
  }
7444
7561
  },
7445
- "description": "How much of each meter the workspace used this period, with the plan's limit for it (null = unlimited). A period is a month from the workspace's billing date: its subscription's (an annual plan's counts reset monthly from its start), else the day the workspace was created.",
7562
+ "description": "Returns what the workspace used this period, with one entry for each thing its plan counts. Each entry has the plan's limit, or null when there is no limit. A period is one month from the workspace's billing date. That date comes from its subscription or, without one, from the day you created the workspace. On an annual plan, the counts still reset every month from the subscription's start.",
7446
7563
  "fields": [],
7447
7564
  "hasBody": false,
7448
7565
  "workspace": true,
7566
+ "acceptsApiKey": true,
7449
7567
  "scope": "workspace:read"
7450
7568
  },
7451
7569
  {
@@ -7469,16 +7587,18 @@ var OPERATIONS = [
7469
7587
  "idempotentHint": true
7470
7588
  }
7471
7589
  },
7472
- "description": "Delivery history for one endpoint, newest first: each event's status, attempts and last HTTP status (payloads are not returned). Kept for 30 days. Paginate with the opaque `nextCursor`.",
7590
+ "description": "Lists one endpoint's delivery history, newest first. Each entry shows the event's status, attempts and last HTTP status. Payloads aren't included. We keep the history for 30 days. Paginate with the opaque `nextCursor`. With a personal access token, only workspace owners can call this. A workspace API key with this scope can.",
7473
7591
  "fields": [
7474
7592
  {
7475
7593
  "name": "endpointId",
7476
7594
  "in": "path",
7477
7595
  "type": "string",
7478
7596
  "required": true,
7597
+ "description": "The endpoint's ID.",
7479
7598
  "example": "we_3f0c\u2026",
7480
7599
  "schema": {
7481
- "type": "string"
7600
+ "type": "string",
7601
+ "description": "The endpoint's ID."
7482
7602
  }
7483
7603
  },
7484
7604
  {
@@ -7510,6 +7630,7 @@ var OPERATIONS = [
7510
7630
  ],
7511
7631
  "hasBody": false,
7512
7632
  "workspace": true,
7633
+ "acceptsApiKey": true,
7513
7634
  "scope": "workspace.webhooks:read"
7514
7635
  },
7515
7636
  {
@@ -7534,16 +7655,18 @@ var OPERATIONS = [
7534
7655
  "idempotentHint": false
7535
7656
  }
7536
7657
  },
7537
- "description": "Sends a recorded delivery's event again, as a new delivery with its own history entry; the event id is unchanged, so receivers can deduplicate. The endpoint must be enabled.",
7658
+ "description": "Sends a recorded delivery's event again, as a new delivery. The new delivery gets its own history entry. The event id stays the same, so receivers can deduplicate. Redelivery only works on an enabled endpoint. With a personal access token, only workspace owners can call this. A workspace API key with this scope can.",
7538
7659
  "fields": [
7539
7660
  {
7540
7661
  "name": "endpointId",
7541
7662
  "in": "path",
7542
7663
  "type": "string",
7543
7664
  "required": true,
7665
+ "description": "The endpoint's ID.",
7544
7666
  "example": "we_3f0c\u2026",
7545
7667
  "schema": {
7546
- "type": "string"
7668
+ "type": "string",
7669
+ "description": "The endpoint's ID."
7547
7670
  }
7548
7671
  },
7549
7672
  {
@@ -7551,14 +7674,17 @@ var OPERATIONS = [
7551
7674
  "in": "path",
7552
7675
  "type": "string",
7553
7676
  "required": true,
7677
+ "description": "The delivery's ID.",
7554
7678
  "example": "del_8a1b\u2026",
7555
7679
  "schema": {
7556
- "type": "string"
7680
+ "type": "string",
7681
+ "description": "The delivery's ID."
7557
7682
  }
7558
7683
  }
7559
7684
  ],
7560
7685
  "hasBody": false,
7561
7686
  "workspace": true,
7687
+ "acceptsApiKey": true,
7562
7688
  "scope": "workspace.webhooks:write"
7563
7689
  },
7564
7690
  {
@@ -7573,22 +7699,22 @@ var OPERATIONS = [
7573
7699
  },
7574
7700
  "mcp": {
7575
7701
  "exposed": false,
7576
- "reason": "Changes where workspace data is sent. A person configures webhook endpoints (Settings \u2192 Webhooks in the app)."
7702
+ "reason": "Changes where workspace data is sent. A person configures webhook endpoints (Settings \u2192 Developers in the app)."
7577
7703
  },
7578
- "description": "Registers an https URL to receive the workspace's events, signed Svix-compatibly. The response carries the endpoint's signing secret (`whsec_\u2026`) \u2014 shown ONCE, store it to verify deliveries. Private and non-https hosts are refused; at most 10 per workspace.",
7704
+ "description": "Registers an HTTPS URL to receive the workspace's events. Deliveries use the same signature format as Svix. The response includes the endpoint's signing secret (`whsec_\u2026`). You see it only once, so store it to verify deliveries. The API refuses private hosts and hosts without HTTPS. A workspace can have at most 10 endpoints. With a personal access token, only workspace owners can call this. A workspace API key with this scope can.",
7579
7705
  "fields": [
7580
7706
  {
7581
7707
  "name": "url",
7582
7708
  "in": "body",
7583
7709
  "type": "string",
7584
7710
  "required": true,
7585
- "description": "The https URL that receives the events.",
7711
+ "description": "The HTTPS URL that receives the events.",
7586
7712
  "example": "https://example.com/hooks",
7587
7713
  "schema": {
7588
7714
  "type": "string",
7589
7715
  "minLength": 1,
7590
7716
  "maxLength": 2048,
7591
- "description": "The https URL that receives the events."
7717
+ "description": "The HTTPS URL that receives the events."
7592
7718
  }
7593
7719
  },
7594
7720
  {
@@ -7608,7 +7734,7 @@ var OPERATIONS = [
7608
7734
  "in": "body",
7609
7735
  "type": "json",
7610
7736
  "required": false,
7611
- "description": "Only these event types (see event-types); omit for every event.",
7737
+ "description": "Send only these event types, from event-types. Leave it out for every event.",
7612
7738
  "example": [
7613
7739
  "workspace.member.joined"
7614
7740
  ],
@@ -7618,12 +7744,13 @@ var OPERATIONS = [
7618
7744
  "type": "string"
7619
7745
  },
7620
7746
  "maxItems": 100,
7621
- "description": "Only these event types (see event-types); omit for every event."
7747
+ "description": "Send only these event types, from event-types. Leave it out for every event."
7622
7748
  }
7623
7749
  }
7624
7750
  ],
7625
7751
  "hasBody": true,
7626
7752
  "workspace": true,
7753
+ "acceptsApiKey": true,
7627
7754
  "scope": "workspace.webhooks:write"
7628
7755
  },
7629
7756
  {
@@ -7640,23 +7767,26 @@ var OPERATIONS = [
7640
7767
  },
7641
7768
  "mcp": {
7642
7769
  "exposed": false,
7643
- "reason": "Changes where workspace data is sent. A person configures webhook endpoints (Settings \u2192 Webhooks in the app)."
7770
+ "reason": "Changes where workspace data is sent. A person configures webhook endpoints (Settings \u2192 Developers in the app)."
7644
7771
  },
7645
- "description": "Stops all deliveries to the endpoint and deletes it with its secret. Its delivery history goes with it.",
7772
+ "description": "Deletes the endpoint and its signing secret. All deliveries to the endpoint stop. Its delivery history goes with it. With a personal access token, only workspace owners can call this. A workspace API key with this scope can.",
7646
7773
  "fields": [
7647
7774
  {
7648
7775
  "name": "endpointId",
7649
7776
  "in": "path",
7650
7777
  "type": "string",
7651
7778
  "required": true,
7779
+ "description": "The endpoint's ID.",
7652
7780
  "example": "we_3f0c\u2026",
7653
7781
  "schema": {
7654
- "type": "string"
7782
+ "type": "string",
7783
+ "description": "The endpoint's ID."
7655
7784
  }
7656
7785
  }
7657
7786
  ],
7658
7787
  "hasBody": false,
7659
7788
  "workspace": true,
7789
+ "acceptsApiKey": true,
7660
7790
  "scope": "workspace.webhooks:write"
7661
7791
  },
7662
7792
  {
@@ -7673,23 +7803,26 @@ var OPERATIONS = [
7673
7803
  },
7674
7804
  "mcp": {
7675
7805
  "exposed": false,
7676
- "reason": "Changes where workspace data is sent. A person configures webhook endpoints (Settings \u2192 Webhooks in the app)."
7806
+ "reason": "Changes where workspace data is sent. A person configures webhook endpoints (Settings \u2192 Developers in the app)."
7677
7807
  },
7678
- "description": "Resumes deliveries to an endpoint that was disabled after repeated failures, keeping its signing secret; the failure count resets.",
7808
+ "description": "Resumes deliveries to an endpoint that stopped after repeated failures. The endpoint keeps its signing secret. Its failure count resets. With a personal access token, only workspace owners can call this. A workspace API key with this scope can.",
7679
7809
  "fields": [
7680
7810
  {
7681
7811
  "name": "endpointId",
7682
7812
  "in": "path",
7683
7813
  "type": "string",
7684
7814
  "required": true,
7815
+ "description": "The endpoint's ID.",
7685
7816
  "example": "we_3f0c\u2026",
7686
7817
  "schema": {
7687
- "type": "string"
7818
+ "type": "string",
7819
+ "description": "The endpoint's ID."
7688
7820
  }
7689
7821
  }
7690
7822
  ],
7691
7823
  "hasBody": false,
7692
7824
  "workspace": true,
7825
+ "acceptsApiKey": true,
7693
7826
  "scope": "workspace.webhooks:write"
7694
7827
  },
7695
7828
  {
@@ -7713,21 +7846,24 @@ var OPERATIONS = [
7713
7846
  "idempotentHint": true
7714
7847
  }
7715
7848
  },
7716
- "description": "One endpoint, without its signing secret: whether it is enabled, its consecutive failures and its last delivery status.",
7849
+ "description": "Returns one endpoint without its signing secret. It shows whether the endpoint is on, its consecutive failures and its last delivery status. With a personal access token, only workspace owners can call this. A workspace API key with this scope can.",
7717
7850
  "fields": [
7718
7851
  {
7719
7852
  "name": "endpointId",
7720
7853
  "in": "path",
7721
7854
  "type": "string",
7722
7855
  "required": true,
7856
+ "description": "The endpoint's ID.",
7723
7857
  "example": "we_3f0c\u2026",
7724
7858
  "schema": {
7725
- "type": "string"
7859
+ "type": "string",
7860
+ "description": "The endpoint's ID."
7726
7861
  }
7727
7862
  }
7728
7863
  ],
7729
7864
  "hasBody": false,
7730
7865
  "workspace": true,
7866
+ "acceptsApiKey": true,
7731
7867
  "scope": "workspace.webhooks:read"
7732
7868
  },
7733
7869
  {
@@ -7749,10 +7885,11 @@ var OPERATIONS = [
7749
7885
  "idempotentHint": true
7750
7886
  }
7751
7887
  },
7752
- "description": "The workspace's outgoing webhook endpoints, newest first, without their signing secrets. A workspace has at most 10, so the list is a single page (`nextCursor` is null).",
7888
+ "description": "Lists the workspace's outgoing webhook endpoints, newest first. The list leaves out their signing secrets. A workspace has at most 10 endpoints, so the list is a single page. Its `nextCursor` is null. With a personal access token, only workspace owners can call this. A workspace API key with this scope can.",
7753
7889
  "fields": [],
7754
7890
  "hasBody": false,
7755
7891
  "workspace": true,
7892
+ "acceptsApiKey": true,
7756
7893
  "scope": "workspace.webhooks:read"
7757
7894
  },
7758
7895
  {
@@ -7776,21 +7913,24 @@ var OPERATIONS = [
7776
7913
  "idempotentHint": false
7777
7914
  }
7778
7915
  },
7779
- "description": "Sends a `ping` event to the endpoint, signed like every delivery \u2014 the way to check an integration verifies and accepts deliveries.",
7916
+ "description": "Sends a `ping` event to the endpoint, signed like every delivery. Use it to check that an integration verifies and accepts deliveries. With a personal access token, only workspace owners can call this. A workspace API key with this scope can.",
7780
7917
  "fields": [
7781
7918
  {
7782
7919
  "name": "endpointId",
7783
7920
  "in": "path",
7784
7921
  "type": "string",
7785
7922
  "required": true,
7923
+ "description": "The endpoint's ID.",
7786
7924
  "example": "we_3f0c\u2026",
7787
7925
  "schema": {
7788
- "type": "string"
7926
+ "type": "string",
7927
+ "description": "The endpoint's ID."
7789
7928
  }
7790
7929
  }
7791
7930
  ],
7792
7931
  "hasBody": false,
7793
7932
  "workspace": true,
7933
+ "acceptsApiKey": true,
7794
7934
  "scope": "workspace.webhooks:write"
7795
7935
  },
7796
7936
  {
@@ -7807,18 +7947,20 @@ var OPERATIONS = [
7807
7947
  },
7808
7948
  "mcp": {
7809
7949
  "exposed": false,
7810
- "reason": "Changes where workspace data is sent. A person configures webhook endpoints (Settings \u2192 Webhooks in the app)."
7950
+ "reason": "Changes where workspace data is sent. A person configures webhook endpoints (Settings \u2192 Developers in the app)."
7811
7951
  },
7812
- "description": "Changes an endpoint's URL, description or event types in place; only the fields sent change. The endpoint keeps its signing secret, so receivers keep verifying deliveries. A new URL passes the same checks as on create: https only, no private hosts.",
7952
+ "description": "Changes an endpoint's URL, description or event types in place. Only the fields you send change. The endpoint keeps its signing secret, so receivers keep verifying deliveries. A new URL must pass the same checks as on create. It must use HTTPS and can't be a private host. With a personal access token, only workspace owners can call this. A workspace API key with this scope can.",
7813
7953
  "fields": [
7814
7954
  {
7815
7955
  "name": "endpointId",
7816
7956
  "in": "path",
7817
7957
  "type": "string",
7818
7958
  "required": true,
7959
+ "description": "The endpoint's ID.",
7819
7960
  "example": "we_3f0c\u2026",
7820
7961
  "schema": {
7821
- "type": "string"
7962
+ "type": "string",
7963
+ "description": "The endpoint's ID."
7822
7964
  }
7823
7965
  },
7824
7966
  {
@@ -7826,13 +7968,13 @@ var OPERATIONS = [
7826
7968
  "in": "body",
7827
7969
  "type": "string",
7828
7970
  "required": false,
7829
- "description": "The https URL that receives the events.",
7971
+ "description": "The HTTPS URL that receives the events.",
7830
7972
  "example": "https://example.com/hooks",
7831
7973
  "schema": {
7832
7974
  "type": "string",
7833
7975
  "minLength": 1,
7834
7976
  "maxLength": 2048,
7835
- "description": "The https URL that receives the events."
7977
+ "description": "The HTTPS URL that receives the events."
7836
7978
  }
7837
7979
  },
7838
7980
  {
@@ -7840,14 +7982,14 @@ var OPERATIONS = [
7840
7982
  "in": "body",
7841
7983
  "type": "string",
7842
7984
  "required": false,
7843
- "description": "A note for people managing the endpoint; null clears it.",
7985
+ "description": "A note for people managing the endpoint. Null clears it.",
7844
7986
  "schema": {
7845
7987
  "type": [
7846
7988
  "string",
7847
7989
  "null"
7848
7990
  ],
7849
7991
  "maxLength": 200,
7850
- "description": "A note for people managing the endpoint; null clears it."
7992
+ "description": "A note for people managing the endpoint. Null clears it."
7851
7993
  }
7852
7994
  },
7853
7995
  {
@@ -7855,7 +7997,7 @@ var OPERATIONS = [
7855
7997
  "in": "body",
7856
7998
  "type": "json",
7857
7999
  "required": false,
7858
- "description": "Only these event types (see event-types); null or an empty list for every event.",
8000
+ "description": "Send only these event types, from event-types. Null or an empty list means every event.",
7859
8001
  "example": [
7860
8002
  "workspace.member.joined"
7861
8003
  ],
@@ -7868,12 +8010,13 @@ var OPERATIONS = [
7868
8010
  "type": "string"
7869
8011
  },
7870
8012
  "maxItems": 100,
7871
- "description": "Only these event types (see event-types); null or an empty list for every event."
8013
+ "description": "Send only these event types, from event-types. Null or an empty list means every event."
7872
8014
  }
7873
8015
  }
7874
8016
  ],
7875
8017
  "hasBody": true,
7876
8018
  "workspace": true,
8019
+ "acceptsApiKey": true,
7877
8020
  "scope": "workspace.webhooks:write"
7878
8021
  }
7879
8022
  ];
@@ -7958,14 +8101,15 @@ ${op.description}`);
7958
8101
  if (op.workspace) {
7959
8102
  command.option("--workspace <slug>", "act in this workspace for one call");
7960
8103
  }
7961
- if (op.cli.confirm) command.option("--yes", "confirm \u2014 it cannot be undone");
8104
+ if (op.cli.confirm)
8105
+ command.option("--yes", "confirm an operation that cannot be undone");
7962
8106
  command.option("--json", "machine-readable output");
7963
8107
  command.action(async (...input) => {
7964
8108
  const values = input.slice(0, op.cli.args.length);
7965
8109
  const options = input[op.cli.args.length];
7966
8110
  if (op.cli.confirm && !options.yes) {
7967
8111
  throw new Error(
7968
- `${op.summary} cannot be undone \u2014 re-run with --yes to confirm`
8112
+ `${op.summary} cannot be undone. Run it again with --yes to confirm.`
7969
8113
  );
7970
8114
  }
7971
8115
  const args = Object.fromEntries(
@@ -8168,6 +8312,9 @@ Shortcut: \`${brand.name} sync\`, the same command.`
8168
8312
  };
8169
8313
  function syncCommand(command, ctx, description, more) {
8170
8314
  command.description(description).argument("[file]", "the file to read", "limitry.json").option("--preview", "show what would change, and change nothing").option("--limits <json>", "the limits as a JSON array, instead of a file").option(
8315
+ "--data <json>",
8316
+ "the whole JSON body, as every command takes, instead of a file"
8317
+ ).option(
8171
8318
  "--archive-missing",
8172
8319
  "archive active limits the file doesn't name (restorable)"
8173
8320
  ).option("--workspace <slug>", "act in this workspace for one call").option("--json", "machine-readable output").addHelpText(
@@ -8175,12 +8322,13 @@ function syncCommand(command, ctx, description, more) {
8175
8322
  '\nThe file: { "limits": [ { "name": "AI budget", "subject": { "kind": "user" }, "action": "ai-call", "amount": 200, "unit": "cents", "window": "month" } ] }\nEach limit is described whole: a field left out is its default, as on `limits create`. Names are the key.\nWhat a limit counts (subject, action, unit, window, every, start, rolling) is fixed: to change it, give the entry a new name.' + more
8176
8323
  ).action(
8177
8324
  async (file, options) => {
8178
- const limits = options.limits === void 0 ? readLimitsFile(file) : parseLimits(options.limits, "--limits");
8325
+ const data = options.data === void 0 ? {} : parseData(options.data);
8326
+ const limits = options.limits !== void 0 ? parseLimits(options.limits, "--limits") : data.limits !== void 0 ? limitsIn(data.limits) : readLimitsFile(file);
8179
8327
  const result = await ctx.client({ workspace: options.workspace }).limits.sync(
8180
8328
  {
8181
8329
  limits,
8182
- archiveMissing: options.archiveMissing ?? false,
8183
- preview: options.preview ?? false
8330
+ archiveMissing: options.archiveMissing ?? data.archiveMissing === true,
8331
+ preview: options.preview ?? data.preview === true
8184
8332
  },
8185
8333
  { idempotencyKey: crypto.randomUUID() }
8186
8334
  );
@@ -8228,6 +8376,24 @@ function parseLimits(text, flag2) {
8228
8376
  }
8229
8377
  return parsed;
8230
8378
  }
8379
+ function parseData(text) {
8380
+ let parsed;
8381
+ try {
8382
+ parsed = JSON.parse(text);
8383
+ } catch (error) {
8384
+ throw new Error("--data must be a JSON object", { cause: error });
8385
+ }
8386
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
8387
+ throw new Error("--data must be a JSON object");
8388
+ }
8389
+ return parsed;
8390
+ }
8391
+ function limitsIn(value) {
8392
+ if (!Array.isArray(value)) {
8393
+ throw new Error("--data's limits must be a JSON array of limits");
8394
+ }
8395
+ return value;
8396
+ }
8231
8397
  var show = (value) => typeof value === "string" ? value : JSON.stringify(value);
8232
8398
  function summary(result) {
8233
8399
  const dry = result.preview;
@@ -8271,7 +8437,7 @@ function tokenEnvVar() {
8271
8437
  function build(io) {
8272
8438
  let actedIn = null;
8273
8439
  let sending;
8274
- const program2 = new Command().name(brand.name).description(`${brand.productName} command line`).version("1.0.0-rc.10").addHelpText(
8440
+ const program2 = new Command().name(brand.name).description(`The ${brand.productName} CLI`).version("1.0.0-rc.12").addHelpText(
8275
8441
  "after",
8276
8442
  `
8277
8443
  Token: \`${brand.name} login\` stores it in ~/.config/${brand.name}/; ${tokenEnvVar()} overrides.
@@ -8295,7 +8461,7 @@ Environment: --environment, else ${environmentEnvVar()}, else \`${brand.name} en
8295
8461
  const settings = ctx.settings();
8296
8462
  if (!settings.token) {
8297
8463
  throw new Error(
8298
- `not logged in \u2014 run \`${brand.name} login\` or set ${tokenEnvVar()}`
8464
+ `not logged in. Run \`${brand.name} login\` or set ${tokenEnvVar()}.`
8299
8465
  );
8300
8466
  }
8301
8467
  if (!settings.token.startsWith("pat_")) {
@@ -8314,7 +8480,7 @@ Environment: --environment, else ${environmentEnvVar()}, else \`${brand.name} en
8314
8480
  const workspace2 = options.workspace === false ? void 0 : options.workspace ?? settings.workspace;
8315
8481
  if (options.workspace !== false && !workspace2) {
8316
8482
  throw new Error(
8317
- `no workspace selected \u2014 \`${brand.name} workspace use <slug>\` or pass --workspace <slug>`
8483
+ `no workspace selected. Run \`${brand.name} workspace use <slug>\` or pass --workspace <slug>.`
8318
8484
  );
8319
8485
  }
8320
8486
  return {