sim 2.0.0-dev.6.1 → 2.0.0-preview.10.1

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.
Files changed (3) hide show
  1. package/README.md +13 -9
  2. package/dist/index.js +2155 -937
  3. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -353,16 +353,16 @@ var require_help = __commonJS((exports) => {
353
353
  padWidth(cmd, helper) {
354
354
  return Math.max(helper.longestOptionTermLength(cmd, helper), helper.longestGlobalOptionTermLength(cmd, helper), helper.longestSubcommandTermLength(cmd, helper), helper.longestArgumentTermLength(cmd, helper));
355
355
  }
356
- wrap(str, width, indent, minColumnWidth = 40) {
356
+ wrap(str2, width, indent, minColumnWidth = 40) {
357
357
  const indents = " \\f\\t\\v   -    \uFEFF";
358
358
  const manualIndent = new RegExp(`[\\n][${indents}]+`);
359
- if (str.match(manualIndent))
360
- return str;
359
+ if (str2.match(manualIndent))
360
+ return str2;
361
361
  const columnWidth = width - indent;
362
362
  if (columnWidth < minColumnWidth)
363
- return str;
364
- const leadingStr = str.slice(0, indent);
365
- const columnText = str.slice(indent).replace(`\r
363
+ return str2;
364
+ const leadingStr = str2.slice(0, indent);
365
+ const columnText = str2.slice(indent).replace(`\r
366
366
  `, `
367
367
  `);
368
368
  const indentString = " ".repeat(indent);
@@ -512,9 +512,9 @@ var require_option = __commonJS((exports) => {
512
512
  return option.negate === (negativeValue === value);
513
513
  }
514
514
  }
515
- function camelcase(str) {
516
- return str.split("-").reduce((str2, word) => {
517
- return str2 + word[0].toUpperCase() + word.slice(1);
515
+ function camelcase(str2) {
516
+ return str2.split("-").reduce((str3, word) => {
517
+ return str3 + word[0].toUpperCase() + word.slice(1);
518
518
  });
519
519
  }
520
520
  function splitOptionFlags(flags) {
@@ -656,11 +656,11 @@ var require_command = __commonJS((exports) => {
656
656
  this._showHelpAfterError = false;
657
657
  this._showSuggestionAfterError = true;
658
658
  this._outputConfiguration = {
659
- writeOut: (str) => process3.stdout.write(str),
660
- writeErr: (str) => process3.stderr.write(str),
659
+ writeOut: (str2) => process3.stdout.write(str2),
660
+ writeErr: (str2) => process3.stderr.write(str2),
661
661
  getOutHelpWidth: () => process3.stdout.isTTY ? process3.stdout.columns : undefined,
662
662
  getErrHelpWidth: () => process3.stderr.isTTY ? process3.stderr.columns : undefined,
663
- outputError: (str, write) => write(str)
663
+ outputError: (str2, write) => write(str2)
664
664
  };
665
665
  this._hidden = false;
666
666
  this._hasHelpOption = true;
@@ -1590,35 +1590,35 @@ Expecting one of '${allowedValues.join("', '")}'`);
1590
1590
  const message = `error: unknown command '${unknownName}'${suggestion}`;
1591
1591
  this.error(message, { code: "commander.unknownCommand" });
1592
1592
  }
1593
- version(str, flags, description) {
1594
- if (str === undefined)
1593
+ version(str2, flags, description) {
1594
+ if (str2 === undefined)
1595
1595
  return this._version;
1596
- this._version = str;
1596
+ this._version = str2;
1597
1597
  flags = flags || "-V, --version";
1598
1598
  description = description || "output the version number";
1599
1599
  const versionOption = this.createOption(flags, description);
1600
1600
  this._versionOptionName = versionOption.attributeName();
1601
1601
  this.options.push(versionOption);
1602
1602
  this.on("option:" + versionOption.name(), () => {
1603
- this._outputConfiguration.writeOut(`${str}
1603
+ this._outputConfiguration.writeOut(`${str2}
1604
1604
  `);
1605
- this._exit(0, "commander.version", str);
1605
+ this._exit(0, "commander.version", str2);
1606
1606
  });
1607
1607
  return this;
1608
1608
  }
1609
- description(str, argsDescription) {
1610
- if (str === undefined && argsDescription === undefined)
1609
+ description(str2, argsDescription) {
1610
+ if (str2 === undefined && argsDescription === undefined)
1611
1611
  return this._description;
1612
- this._description = str;
1612
+ this._description = str2;
1613
1613
  if (argsDescription) {
1614
1614
  this._argsDescription = argsDescription;
1615
1615
  }
1616
1616
  return this;
1617
1617
  }
1618
- summary(str) {
1619
- if (str === undefined)
1618
+ summary(str2) {
1619
+ if (str2 === undefined)
1620
1620
  return this._summary;
1621
- this._summary = str;
1621
+ this._summary = str2;
1622
1622
  return this;
1623
1623
  }
1624
1624
  alias(alias) {
@@ -1639,8 +1639,8 @@ Expecting one of '${allowedValues.join("', '")}'`);
1639
1639
  aliases.forEach((alias) => this.alias(alias));
1640
1640
  return this;
1641
1641
  }
1642
- usage(str) {
1643
- if (str === undefined) {
1642
+ usage(str2) {
1643
+ if (str2 === undefined) {
1644
1644
  if (this._usage)
1645
1645
  return this._usage;
1646
1646
  const args = this.registeredArguments.map((arg) => {
@@ -1648,13 +1648,13 @@ Expecting one of '${allowedValues.join("', '")}'`);
1648
1648
  });
1649
1649
  return [].concat(this.options.length || this._hasHelpOption ? "[options]" : [], this.commands.length ? "[command]" : [], this.registeredArguments.length ? args : []).join(" ");
1650
1650
  }
1651
- this._usage = str;
1651
+ this._usage = str2;
1652
1652
  return this;
1653
1653
  }
1654
- name(str) {
1655
- if (str === undefined)
1654
+ name(str2) {
1655
+ if (str2 === undefined)
1656
1656
  return this._name;
1657
- this._name = str;
1657
+ this._name = str2;
1658
1658
  return this;
1659
1659
  }
1660
1660
  nameFromFilename(filename) {
@@ -1730,7 +1730,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1730
1730
  }
1731
1731
  this._exit(exitCode, "commander.help", "(outputHelp)");
1732
1732
  }
1733
- addHelpText(position, text) {
1733
+ addHelpText(position, text2) {
1734
1734
  const allowedValues = ["beforeAll", "before", "after", "afterAll"];
1735
1735
  if (!allowedValues.includes(position)) {
1736
1736
  throw new Error(`Unexpected value for position to addHelpText.
@@ -1739,10 +1739,10 @@ Expecting one of '${allowedValues.join("', '")}'`);
1739
1739
  const helpEvent = `${position}Help`;
1740
1740
  this.on(helpEvent, (context) => {
1741
1741
  let helpStr;
1742
- if (typeof text === "function") {
1743
- helpStr = text({ error: context.error, command: context.command });
1742
+ if (typeof text2 === "function") {
1743
+ helpStr = text2({ error: context.error, command: context.command });
1744
1744
  } else {
1745
- helpStr = text;
1745
+ helpStr = text2;
1746
1746
  }
1747
1747
  if (helpStr) {
1748
1748
  context.write(`${helpStr}
@@ -1809,9 +1809,6 @@ var require_commander = __commonJS((exports, module) => {
1809
1809
  exports.InvalidOptionArgumentError = InvalidArgumentError;
1810
1810
  });
1811
1811
 
1812
- // src/index.ts
1813
- import { readFileSync as readFileSync3 } from "node:fs";
1814
-
1815
1812
  // ../../node_modules/chalk/source/vendor/ansi-styles/index.js
1816
1813
  var ANSI_BACKGROUND_OFFSET = 10;
1817
1814
  var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
@@ -2301,284 +2298,6 @@ var chalk = createChalk();
2301
2298
  var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
2302
2299
  var source_default = chalk;
2303
2300
 
2304
- // ../../node_modules/commander/esm.mjs
2305
- var import__ = __toESM(require_commander(), 1);
2306
- var {
2307
- program,
2308
- createCommand,
2309
- createArgument,
2310
- createOption,
2311
- CommanderError,
2312
- InvalidArgumentError,
2313
- InvalidOptionArgumentError,
2314
- Command,
2315
- Argument,
2316
- Option,
2317
- Help
2318
- } = import__.default;
2319
-
2320
- // src/commands/auth.ts
2321
- import { spawn } from "node:child_process";
2322
- import { createInterface } from "node:readline/promises";
2323
-
2324
- // src/auth/device-flow.ts
2325
- import { createHash, randomBytes, randomInt } from "node:crypto";
2326
-
2327
- // src/helpers.ts
2328
- function sleep(ms) {
2329
- return new Promise((resolve) => setTimeout(resolve, ms));
2330
- }
2331
-
2332
- // src/http/client.ts
2333
- class SimApiError extends Error {
2334
- status;
2335
- code;
2336
- details;
2337
- constructor(message, status, code = null, details) {
2338
- super(message);
2339
- this.status = status;
2340
- this.code = code;
2341
- this.details = details;
2342
- this.name = "SimApiError";
2343
- }
2344
- }
2345
- function buildUrl(endpoint, path, query) {
2346
- const url = new URL(`${endpoint}${path}`);
2347
- for (const [key, value] of Object.entries(query ?? {})) {
2348
- if (value === null || value === undefined || value === "")
2349
- continue;
2350
- url.searchParams.set(key, String(value));
2351
- }
2352
- return url.toString();
2353
- }
2354
- function toApiError(status, raw) {
2355
- let parsed;
2356
- try {
2357
- parsed = JSON.parse(raw);
2358
- } catch {
2359
- const text = raw.trim();
2360
- return new SimApiError(text ? truncate(text, 300) : `Request failed with status ${status}`, status);
2361
- }
2362
- const body = parsed;
2363
- if (body.error && typeof body.error === "object") {
2364
- const error = body.error;
2365
- return new SimApiError(typeof error.message === "string" ? error.message : `Request failed with status ${status}`, status, typeof error.code === "string" ? error.code : null, error.details);
2366
- }
2367
- if (typeof body.error === "string")
2368
- return new SimApiError(body.error, status);
2369
- if (typeof body.message === "string")
2370
- return new SimApiError(body.message, status);
2371
- return new SimApiError(`Request failed with status ${status}`, status);
2372
- }
2373
- function truncate(value, max) {
2374
- return value.length <= max ? value : `${value.slice(0, max)}…`;
2375
- }
2376
- function formatApiErrorDetails(details) {
2377
- const issues = new Set;
2378
- const visit = (value, parentPath = []) => {
2379
- if (Array.isArray(value)) {
2380
- value.forEach((item) => visit(item, parentPath));
2381
- return;
2382
- }
2383
- if (!value || typeof value !== "object")
2384
- return;
2385
- const issue = value;
2386
- const ownPath = Array.isArray(issue.path) ? issue.path.map(String) : [];
2387
- const path = [...parentPath, ...ownPath];
2388
- const nested = Array.isArray(issue.errors) ? issue.errors : [];
2389
- if (nested.length > 0) {
2390
- visit(nested, path);
2391
- return;
2392
- }
2393
- if (typeof issue.message !== "string" || issue.message === "Invalid input")
2394
- return;
2395
- issues.add(`${path.length > 0 ? path.join(".") : "request"}: ${issue.message}`);
2396
- };
2397
- visit(details);
2398
- if (issues.size === 0)
2399
- return [` details: ${truncate(JSON.stringify(details), 1000)}`];
2400
- const visible = [...issues].slice(0, 8);
2401
- const lines = [" details:", ...visible.map((issue) => ` ${issue}`)];
2402
- if (issues.size > visible.length)
2403
- lines.push(` … ${issues.size - visible.length} more issues`);
2404
- return lines;
2405
- }
2406
-
2407
- class SimClient {
2408
- profile;
2409
- constructor(profile) {
2410
- this.profile = profile;
2411
- }
2412
- resolveApiKey(auth = "required") {
2413
- if (!this.profile.apiKey) {
2414
- if (auth === "optional")
2415
- return;
2416
- throw new SimApiError(`Not logged in on profile "${this.profile.name}". Run: sim login --profile ${this.profile.name}`, 0);
2417
- }
2418
- return this.profile.apiKey;
2419
- }
2420
- requireWorkspace(explicit, options = {}) {
2421
- this.resolveApiKey(options.auth);
2422
- const workspaceId = explicit ?? this.profile.workspaceId;
2423
- if (!workspaceId) {
2424
- throw new SimApiError(`No workspace set for profile "${this.profile.name}". Pass --workspace, or run: sim configure --profile ${this.profile.name} --set-workspace <id>`, 0);
2425
- }
2426
- return workspaceId;
2427
- }
2428
- async requestRaw(path, options = {}) {
2429
- const apiKey = this.resolveApiKey(options.auth);
2430
- const url = buildUrl(this.profile.endpoint, path, options.query);
2431
- const hasBody = options.body !== undefined;
2432
- let response;
2433
- try {
2434
- response = await fetch(url, {
2435
- method: options.method ?? "GET",
2436
- headers: {
2437
- ...apiKey ? { "x-api-key": apiKey } : {},
2438
- accept: "application/json",
2439
- ...hasBody ? { "content-type": "application/json" } : {},
2440
- ...options.headers
2441
- },
2442
- body: hasBody ? JSON.stringify(options.body) : undefined,
2443
- signal: options.signal
2444
- });
2445
- } catch (cause) {
2446
- if (options.signal?.aborted) {
2447
- throw new SimApiError("Request cancelled.", 0);
2448
- }
2449
- throw new SimApiError(`Could not reach ${this.profile.endpoint}: ${cause.message}`, 0);
2450
- }
2451
- if (!response.ok) {
2452
- const raw = await response.text();
2453
- const error = toApiError(response.status, raw);
2454
- if (response.status === 401) {
2455
- error.message = `${error.message} — run: sim login --profile ${this.profile.name}`;
2456
- }
2457
- throw error;
2458
- }
2459
- return response;
2460
- }
2461
- async request(path, options = {}) {
2462
- const response = await this.requestRaw(path, options);
2463
- const raw = await response.text();
2464
- if (!raw)
2465
- return;
2466
- return JSON.parse(raw);
2467
- }
2468
- }
2469
- async function requestAllPages(client, path, options) {
2470
- const { query, pageSize, limit: requestedLimit, ...requestOptions } = options;
2471
- const limit = requestedLimit ?? Number.POSITIVE_INFINITY;
2472
- if (limit <= 0)
2473
- return [];
2474
- const items = [];
2475
- let cursor = null;
2476
- do {
2477
- const page = await client.request(path, {
2478
- ...requestOptions,
2479
- query: {
2480
- ...query,
2481
- limit: Math.min(pageSize, limit - items.length),
2482
- cursor
2483
- }
2484
- });
2485
- items.push(...page.data);
2486
- cursor = page.nextCursor;
2487
- } while (cursor && items.length < limit);
2488
- return items.slice(0, limit);
2489
- }
2490
- function resolvePath(template, params = {}) {
2491
- return template.replace(/\[([^\]]+)\]/g, (_match, key) => {
2492
- const value = params[key];
2493
- if (value === undefined) {
2494
- throw new SimApiError(`Missing path parameter "${key}" for ${template}`, 0);
2495
- }
2496
- return encodeURIComponent(value);
2497
- });
2498
- }
2499
-
2500
- // src/auth/device-flow.ts
2501
- var PAIRING_ALPHABET = "ABCDEFGHJKLMNPQRSTUVWXYZ23456789";
2502
- var POLL_INTERVAL_MS = 2000;
2503
- var POLL_TIMEOUT_MS = 15 * 60 * 1000;
2504
- var RETRYABLE_POLL_STATUSES = new Set([409, 429, 500, 502, 503, 504]);
2505
- function token() {
2506
- return randomBytes(32).toString("base64url");
2507
- }
2508
- function pairingCode() {
2509
- const draw = (count) => Array.from({ length: count }, () => PAIRING_ALPHABET[randomInt(PAIRING_ALPHABET.length)]).join("");
2510
- return `${draw(4)}-${draw(4)}`;
2511
- }
2512
- function createAuthRequest() {
2513
- const pollSecret = token();
2514
- return {
2515
- request: token(),
2516
- pollSecret,
2517
- challenge: createHash("sha256").update(pollSecret, "utf8").digest("base64url"),
2518
- pairing: pairingCode()
2519
- };
2520
- }
2521
- function buildApprovalUrl(endpoint, auth, scope, workspaceId) {
2522
- const url = new URL("/cli/auth", endpoint);
2523
- url.searchParams.set("request", auth.request);
2524
- url.searchParams.set("challenge", auth.challenge);
2525
- url.searchParams.set("pairing", auth.pairing);
2526
- url.searchParams.set("scope", scope);
2527
- if (workspaceId)
2528
- url.searchParams.set("workspace", workspaceId);
2529
- return url.toString();
2530
- }
2531
- async function pollForKey(endpoint, auth, signal) {
2532
- const deadline = Date.now() + POLL_TIMEOUT_MS;
2533
- while (Date.now() < deadline) {
2534
- if (signal?.aborted)
2535
- throw new SimApiError("Login cancelled.", 0);
2536
- let response = null;
2537
- try {
2538
- response = await fetch(new URL("/api/cli/auth/poll", endpoint), {
2539
- method: "POST",
2540
- headers: { "content-type": "application/json", accept: "application/json" },
2541
- body: JSON.stringify({ request: auth.request, verifier: auth.pollSecret }),
2542
- signal
2543
- });
2544
- } catch {
2545
- response = null;
2546
- }
2547
- if (response) {
2548
- const raw = await response.text();
2549
- if (!response.ok) {
2550
- if (!RETRYABLE_POLL_STATUSES.has(response.status)) {
2551
- let message = `Login failed with status ${response.status}`;
2552
- try {
2553
- const body = JSON.parse(raw);
2554
- if (typeof body.error === "string")
2555
- message = body.error;
2556
- else if (body.error && typeof body.error === "object") {
2557
- const detail = body.error.message;
2558
- if (typeof detail === "string")
2559
- message = detail;
2560
- }
2561
- } catch {}
2562
- throw new SimApiError(message, response.status);
2563
- }
2564
- } else {
2565
- const body = JSON.parse(raw);
2566
- if (body.status === "complete" && body.key) {
2567
- return {
2568
- id: body.key.id,
2569
- apiKey: body.key.apiKey,
2570
- scope: body.scope ?? "copilot",
2571
- workspaceId: body.workspaceId ?? null,
2572
- workspaceBound: body.workspaceBound === true
2573
- };
2574
- }
2575
- }
2576
- }
2577
- await sleep(POLL_INTERVAL_MS);
2578
- }
2579
- throw new SimApiError("Timed out waiting for browser approval.", 0);
2580
- }
2581
-
2582
2301
  // src/config/paths.ts
2583
2302
  import { homedir } from "node:os";
2584
2303
  import { join } from "node:path";
@@ -2750,72 +2469,221 @@ function deleteProfile(profile) {
2750
2469
  function normalizeEndpoint(endpoint) {
2751
2470
  return endpoint.replace(/\/+$/, "");
2752
2471
  }
2753
- function resolve(candidates, fallback, fallbackSource) {
2754
- for (const [source, value] of candidates) {
2755
- if (value !== null && value !== undefined && value !== "")
2756
- return { value, source };
2472
+ function resolve(candidates, fallback, fallbackSource) {
2473
+ for (const [source, value] of candidates) {
2474
+ if (value !== null && value !== undefined && value !== "")
2475
+ return { value, source };
2476
+ }
2477
+ return { value: fallback, source: fallbackSource };
2478
+ }
2479
+ function resolveProfile(overrides = {}) {
2480
+ const name = overrides.profile || process.env.SIM_PROFILE || DEFAULT_PROFILE;
2481
+ const config = readConfigProfile(name);
2482
+ const credentials = readCredentialsProfile(name);
2483
+ const endpoint = resolve([
2484
+ ["flag", overrides.endpoint],
2485
+ ["env", process.env.SIM_ENDPOINT],
2486
+ ["config", config.endpoint]
2487
+ ], DEFAULT_ENDPOINT, "default");
2488
+ const apiKey = resolve([
2489
+ ["flag", overrides.apiKey],
2490
+ ["env", process.env.SIM_API_KEY],
2491
+ ["credentials", credentials.api_key]
2492
+ ], null, "unset");
2493
+ const workspaceId = resolve([
2494
+ ["flag", overrides.workspaceId],
2495
+ ["env", process.env.SIM_WORKSPACE],
2496
+ ["config", config.workspace]
2497
+ ], null, "unset");
2498
+ const output = resolve([
2499
+ ["flag", overrides.output],
2500
+ ["env", process.env.SIM_OUTPUT],
2501
+ ["config", config.output]
2502
+ ], "table", "default");
2503
+ if (!OUTPUT_FORMATS.includes(output.value)) {
2504
+ throw new ProfileConfigError(`Unknown output format "${output.value}" from ${output.source}. Use one of: ${OUTPUT_FORMATS.join(", ")}`);
2505
+ }
2506
+ return {
2507
+ name,
2508
+ endpoint: normalizeEndpoint(endpoint.value),
2509
+ apiKey: apiKey.value,
2510
+ workspaceId: workspaceId.value,
2511
+ output: output.value,
2512
+ sources: {
2513
+ endpoint: endpoint.source,
2514
+ apiKey: apiKey.source,
2515
+ workspaceId: workspaceId.source,
2516
+ output: output.source
2517
+ }
2518
+ };
2519
+ }
2520
+ // src/http/client.ts
2521
+ class SimApiError extends Error {
2522
+ status;
2523
+ code;
2524
+ details;
2525
+ constructor(message, status, code = null, details) {
2526
+ super(message);
2527
+ this.status = status;
2528
+ this.code = code;
2529
+ this.details = details;
2530
+ this.name = "SimApiError";
2531
+ }
2532
+ }
2533
+ function buildUrl(endpoint, path, query) {
2534
+ const url = new URL(`${endpoint}${path}`);
2535
+ for (const [key, value] of Object.entries(query ?? {})) {
2536
+ if (value === null || value === undefined || value === "")
2537
+ continue;
2538
+ url.searchParams.set(key, String(value));
2539
+ }
2540
+ return url.toString();
2541
+ }
2542
+ function toApiError(status, raw) {
2543
+ let parsed;
2544
+ try {
2545
+ parsed = JSON.parse(raw);
2546
+ } catch {
2547
+ const text = raw.trim();
2548
+ return new SimApiError(text ? truncate(text, 300) : `Request failed with status ${status}`, status);
2549
+ }
2550
+ const body = parsed;
2551
+ if (body.error && typeof body.error === "object") {
2552
+ const error = body.error;
2553
+ return new SimApiError(typeof error.message === "string" ? error.message : `Request failed with status ${status}`, status, typeof error.code === "string" ? error.code : null, error.details);
2554
+ }
2555
+ if (typeof body.error === "string")
2556
+ return new SimApiError(body.error, status);
2557
+ if (typeof body.message === "string")
2558
+ return new SimApiError(body.message, status);
2559
+ return new SimApiError(`Request failed with status ${status}`, status);
2560
+ }
2561
+ function truncate(value, max) {
2562
+ return value.length <= max ? value : `${value.slice(0, max)}…`;
2563
+ }
2564
+ function formatApiErrorDetails(details) {
2565
+ const issues = new Set;
2566
+ const visit = (value, parentPath = []) => {
2567
+ if (Array.isArray(value)) {
2568
+ value.forEach((item) => visit(item, parentPath));
2569
+ return;
2570
+ }
2571
+ if (!value || typeof value !== "object")
2572
+ return;
2573
+ const issue = value;
2574
+ const ownPath = Array.isArray(issue.path) ? issue.path.map(String) : [];
2575
+ const path = [...parentPath, ...ownPath];
2576
+ const nested = Array.isArray(issue.errors) ? issue.errors : [];
2577
+ if (nested.length > 0) {
2578
+ visit(nested, path);
2579
+ return;
2580
+ }
2581
+ if (typeof issue.message !== "string" || issue.message === "Invalid input")
2582
+ return;
2583
+ issues.add(`${path.length > 0 ? path.join(".") : "request"}: ${issue.message}`);
2584
+ };
2585
+ visit(details);
2586
+ if (issues.size === 0)
2587
+ return [` details: ${truncate(JSON.stringify(details), 1000)}`];
2588
+ const visible = [...issues].slice(0, 8);
2589
+ const lines = [" details:", ...visible.map((issue) => ` ${issue}`)];
2590
+ if (issues.size > visible.length)
2591
+ lines.push(` … ${issues.size - visible.length} more issues`);
2592
+ return lines;
2593
+ }
2594
+
2595
+ class SimClient {
2596
+ profile;
2597
+ constructor(profile) {
2598
+ this.profile = profile;
2757
2599
  }
2758
- return { value: fallback, source: fallbackSource };
2759
- }
2760
- function resolveProfile(overrides = {}) {
2761
- const name = overrides.profile || process.env.SIM_PROFILE || DEFAULT_PROFILE;
2762
- const config = readConfigProfile(name);
2763
- const credentials = readCredentialsProfile(name);
2764
- const endpoint = resolve([
2765
- ["flag", overrides.endpoint],
2766
- ["env", process.env.SIM_ENDPOINT],
2767
- ["config", config.endpoint]
2768
- ], DEFAULT_ENDPOINT, "default");
2769
- const apiKey = resolve([
2770
- ["flag", overrides.apiKey],
2771
- ["env", process.env.SIM_API_KEY],
2772
- ["credentials", credentials.api_key]
2773
- ], null, "unset");
2774
- const workspaceId = resolve([
2775
- ["flag", overrides.workspaceId],
2776
- ["env", process.env.SIM_WORKSPACE],
2777
- ["config", config.workspace]
2778
- ], null, "unset");
2779
- const output = resolve([
2780
- ["flag", overrides.output],
2781
- ["env", process.env.SIM_OUTPUT],
2782
- ["config", config.output]
2783
- ], "table", "default");
2784
- if (!OUTPUT_FORMATS.includes(output.value)) {
2785
- throw new ProfileConfigError(`Unknown output format "${output.value}" from ${output.source}. Use one of: ${OUTPUT_FORMATS.join(", ")}`);
2600
+ resolveApiKey(auth = "required") {
2601
+ if (!this.profile.apiKey) {
2602
+ if (auth === "optional")
2603
+ return;
2604
+ throw new SimApiError(`Not logged in on profile "${this.profile.name}". Run: sim login --profile ${this.profile.name}`, 0);
2605
+ }
2606
+ return this.profile.apiKey;
2786
2607
  }
2787
- return {
2788
- name,
2789
- endpoint: normalizeEndpoint(endpoint.value),
2790
- apiKey: apiKey.value,
2791
- workspaceId: workspaceId.value,
2792
- output: output.value,
2793
- sources: {
2794
- endpoint: endpoint.source,
2795
- apiKey: apiKey.source,
2796
- workspaceId: workspaceId.source,
2797
- output: output.source
2608
+ requireWorkspace(explicit, options = {}) {
2609
+ this.resolveApiKey(options.auth);
2610
+ const workspaceId = explicit ?? this.profile.workspaceId;
2611
+ if (!workspaceId) {
2612
+ throw new SimApiError(`No workspace set for profile "${this.profile.name}". Pass --workspace, or run: sim configure --profile ${this.profile.name} --set-workspace <id>`, 0);
2798
2613
  }
2799
- };
2614
+ return workspaceId;
2615
+ }
2616
+ async requestRaw(path, options = {}) {
2617
+ const apiKey = this.resolveApiKey(options.auth);
2618
+ const url = buildUrl(this.profile.endpoint, path, options.query);
2619
+ const hasBody = options.body !== undefined;
2620
+ let response;
2621
+ try {
2622
+ response = await fetch(url, {
2623
+ method: options.method ?? "GET",
2624
+ headers: {
2625
+ ...apiKey ? { "x-api-key": apiKey } : {},
2626
+ accept: "application/json",
2627
+ ...hasBody ? { "content-type": "application/json" } : {},
2628
+ ...options.headers
2629
+ },
2630
+ body: hasBody ? JSON.stringify(options.body) : undefined,
2631
+ signal: options.signal
2632
+ });
2633
+ } catch (cause) {
2634
+ if (options.signal?.aborted) {
2635
+ throw new SimApiError("Request cancelled.", 0);
2636
+ }
2637
+ throw new SimApiError(`Could not reach ${this.profile.endpoint}: ${cause.message}`, 0);
2638
+ }
2639
+ if (!response.ok) {
2640
+ const raw = await response.text();
2641
+ const error = toApiError(response.status, raw);
2642
+ if (response.status === 401) {
2643
+ error.message = `${error.message} — run: sim login --profile ${this.profile.name}`;
2644
+ }
2645
+ throw error;
2646
+ }
2647
+ return response;
2648
+ }
2649
+ async request(path, options = {}) {
2650
+ const response = await this.requestRaw(path, options);
2651
+ const raw = await response.text();
2652
+ if (!raw)
2653
+ return;
2654
+ return JSON.parse(raw);
2655
+ }
2800
2656
  }
2801
- // src/context.ts
2802
- function globalsOf(command) {
2803
- return command.optsWithGlobals();
2657
+ async function requestAllPages(client, path, options) {
2658
+ const { query, pageSize, limit: requestedLimit, ...requestOptions } = options;
2659
+ const limit = requestedLimit ?? Number.POSITIVE_INFINITY;
2660
+ if (limit <= 0)
2661
+ return [];
2662
+ const items = [];
2663
+ let cursor = null;
2664
+ do {
2665
+ const page = await client.request(path, {
2666
+ ...requestOptions,
2667
+ query: {
2668
+ ...query,
2669
+ limit: Math.min(pageSize, limit - items.length),
2670
+ cursor
2671
+ }
2672
+ });
2673
+ items.push(...page.data);
2674
+ cursor = page.nextCursor;
2675
+ } while (cursor && items.length < limit);
2676
+ return items.slice(0, limit);
2804
2677
  }
2805
- function profileFrom(command, extra = {}) {
2806
- const globals = globalsOf(command);
2807
- return resolveProfile({
2808
- profile: globals.profile,
2809
- endpoint: globals.endpoint,
2810
- workspaceId: globals.workspace,
2811
- output: globals.output,
2812
- ...extra
2678
+ function resolvePath(template, params = {}) {
2679
+ return template.replace(/\[([^\]]+)\]/g, (_match, key) => {
2680
+ const value = params[key];
2681
+ if (value === undefined) {
2682
+ throw new SimApiError(`Missing path parameter "${key}" for ${template}`, 0);
2683
+ }
2684
+ return encodeURIComponent(value);
2813
2685
  });
2814
2686
  }
2815
- function clientFrom(command) {
2816
- const profile = profileFrom(command);
2817
- return { client: new SimClient(profile), profile };
2818
- }
2819
2687
 
2820
2688
  // node_modules/js-yaml/dist/js-yaml.mjs
2821
2689
  function getDefaultExportFromCjs(x) {
@@ -6063,47 +5931,179 @@ function renderTable(rows, columns) {
6063
5931
  return [header, ...body].join(`
6064
5932
  `);
6065
5933
  }
6066
- function renderMachine(format, raw) {
6067
- if (format === "json")
6068
- return JSON.stringify(raw, null, 2);
6069
- if (format === "yaml")
6070
- return dump(raw, { lineWidth: 0, noRefs: true }).trimEnd();
6071
- return null;
5934
+ function renderMachine(format, raw) {
5935
+ if (format === "json")
5936
+ return JSON.stringify(raw, null, 2);
5937
+ if (format === "yaml")
5938
+ return dump(raw, { lineWidth: 0, noRefs: true }).trimEnd();
5939
+ return null;
5940
+ }
5941
+ function printList(format, rows, columns, raw = rows) {
5942
+ const machine = renderMachine(format, raw);
5943
+ if (machine !== null) {
5944
+ console.log(machine);
5945
+ return;
5946
+ }
5947
+ if (format === "text") {
5948
+ for (const row of rows) {
5949
+ console.log(columns.map((column) => oneLine(stripAnsi(column.value(row)))).join("\t"));
5950
+ }
5951
+ return;
5952
+ }
5953
+ console.log(renderTable(rows, columns));
5954
+ }
5955
+ function printDocument(format, raw) {
5956
+ console.log(format === "yaml" ? renderMachine("yaml", raw) : JSON.stringify(raw, null, 2));
5957
+ }
5958
+ function printRecord(format, fields, raw) {
5959
+ const machine = renderMachine(format, raw);
5960
+ if (machine !== null) {
5961
+ console.log(machine);
5962
+ return;
5963
+ }
5964
+ const safeFields = fields.map(([label, value]) => [safeOneLine(label), value]);
5965
+ if (format === "text") {
5966
+ for (const [label, value] of safeFields) {
5967
+ console.log(`${label} ${oneLine(stripAnsi(value))}`);
5968
+ }
5969
+ return;
5970
+ }
5971
+ const width = Math.max(...safeFields.map(([label]) => visibleWidth(label)));
5972
+ for (const [label, value] of safeFields) {
5973
+ console.log(`${source_default.dim(pad(`${label}:`, width + 1))} ${oneLine(value)}`);
5974
+ }
5975
+ }
5976
+
5977
+ // src/program.ts
5978
+ import { readFileSync as readFileSync3 } from "node:fs";
5979
+
5980
+ // ../../node_modules/commander/esm.mjs
5981
+ var import__ = __toESM(require_commander(), 1);
5982
+ var {
5983
+ program,
5984
+ createCommand,
5985
+ createArgument,
5986
+ createOption,
5987
+ CommanderError,
5988
+ InvalidArgumentError,
5989
+ InvalidOptionArgumentError,
5990
+ Command,
5991
+ Argument,
5992
+ Option,
5993
+ Help
5994
+ } = import__.default;
5995
+
5996
+ // src/commands/auth.ts
5997
+ import { spawn } from "node:child_process";
5998
+ import { createInterface } from "node:readline/promises";
5999
+
6000
+ // src/auth/device-flow.ts
6001
+ import { createHash, randomBytes, randomInt } from "node:crypto";
6002
+
6003
+ // src/helpers.ts
6004
+ function sleep(ms) {
6005
+ return new Promise((resolve2) => setTimeout(resolve2, ms));
6006
+ }
6007
+
6008
+ // src/auth/device-flow.ts
6009
+ var PAIRING_ALPHABET = "ABCDEFGHJKLMNPQRSTUVWXYZ23456789";
6010
+ var POLL_INTERVAL_MS = 2000;
6011
+ var POLL_TIMEOUT_MS = 15 * 60 * 1000;
6012
+ var RETRYABLE_POLL_STATUSES = new Set([409, 429, 500, 502, 503, 504]);
6013
+ function token() {
6014
+ return randomBytes(32).toString("base64url");
6015
+ }
6016
+ function pairingCode() {
6017
+ const draw = (count) => Array.from({ length: count }, () => PAIRING_ALPHABET[randomInt(PAIRING_ALPHABET.length)]).join("");
6018
+ return `${draw(4)}-${draw(4)}`;
6019
+ }
6020
+ function createAuthRequest() {
6021
+ const pollSecret = token();
6022
+ return {
6023
+ request: token(),
6024
+ pollSecret,
6025
+ challenge: createHash("sha256").update(pollSecret, "utf8").digest("base64url"),
6026
+ pairing: pairingCode()
6027
+ };
6028
+ }
6029
+ function buildApprovalUrl(endpoint, auth, scope, workspaceId) {
6030
+ const url = new URL("/cli/auth", endpoint);
6031
+ url.searchParams.set("request", auth.request);
6032
+ url.searchParams.set("challenge", auth.challenge);
6033
+ url.searchParams.set("pairing", auth.pairing);
6034
+ url.searchParams.set("scope", scope);
6035
+ if (workspaceId)
6036
+ url.searchParams.set("workspace", workspaceId);
6037
+ return url.toString();
6072
6038
  }
6073
- function printList(format, rows, columns, raw = rows) {
6074
- const machine = renderMachine(format, raw);
6075
- if (machine !== null) {
6076
- console.log(machine);
6077
- return;
6078
- }
6079
- if (format === "text") {
6080
- for (const row of rows) {
6081
- console.log(columns.map((column) => oneLine(stripAnsi(column.value(row)))).join("\t"));
6039
+ async function pollForKey(endpoint, auth, signal) {
6040
+ const deadline = Date.now() + POLL_TIMEOUT_MS;
6041
+ while (Date.now() < deadline) {
6042
+ if (signal?.aborted)
6043
+ throw new SimApiError("Login cancelled.", 0);
6044
+ let response = null;
6045
+ try {
6046
+ response = await fetch(new URL("/api/cli/auth/poll", endpoint), {
6047
+ method: "POST",
6048
+ headers: { "content-type": "application/json", accept: "application/json" },
6049
+ body: JSON.stringify({ request: auth.request, verifier: auth.pollSecret }),
6050
+ signal
6051
+ });
6052
+ } catch {
6053
+ response = null;
6082
6054
  }
6083
- return;
6055
+ if (response) {
6056
+ const raw = await response.text();
6057
+ if (!response.ok) {
6058
+ if (!RETRYABLE_POLL_STATUSES.has(response.status)) {
6059
+ let message = `Login failed with status ${response.status}`;
6060
+ try {
6061
+ const body = JSON.parse(raw);
6062
+ if (typeof body.error === "string")
6063
+ message = body.error;
6064
+ else if (body.error && typeof body.error === "object") {
6065
+ const detail = body.error.message;
6066
+ if (typeof detail === "string")
6067
+ message = detail;
6068
+ }
6069
+ } catch {}
6070
+ throw new SimApiError(message, response.status);
6071
+ }
6072
+ } else {
6073
+ const body = JSON.parse(raw);
6074
+ if (body.status === "complete" && body.key) {
6075
+ return {
6076
+ id: body.key.id,
6077
+ apiKey: body.key.apiKey,
6078
+ scope: body.scope ?? "copilot",
6079
+ workspaceId: body.workspaceId ?? null,
6080
+ workspaceBound: body.workspaceBound === true
6081
+ };
6082
+ }
6083
+ }
6084
+ }
6085
+ await sleep(POLL_INTERVAL_MS);
6084
6086
  }
6085
- console.log(renderTable(rows, columns));
6087
+ throw new SimApiError("Timed out waiting for browser approval.", 0);
6086
6088
  }
6087
- function printDocument(format, raw) {
6088
- console.log(format === "yaml" ? renderMachine("yaml", raw) : JSON.stringify(raw, null, 2));
6089
+
6090
+ // src/context.ts
6091
+ function globalsOf(command) {
6092
+ return command.optsWithGlobals();
6089
6093
  }
6090
- function printRecord(format, fields, raw) {
6091
- const machine = renderMachine(format, raw);
6092
- if (machine !== null) {
6093
- console.log(machine);
6094
- return;
6095
- }
6096
- const safeFields = fields.map(([label, value]) => [safeOneLine(label), value]);
6097
- if (format === "text") {
6098
- for (const [label, value] of safeFields) {
6099
- console.log(`${label} ${oneLine(stripAnsi(value))}`);
6100
- }
6101
- return;
6102
- }
6103
- const width = Math.max(...safeFields.map(([label]) => visibleWidth(label)));
6104
- for (const [label, value] of safeFields) {
6105
- console.log(`${source_default.dim(pad(`${label}:`, width + 1))} ${oneLine(value)}`);
6106
- }
6094
+ function profileFrom(command, extra = {}) {
6095
+ const globals = globalsOf(command);
6096
+ return resolveProfile({
6097
+ profile: globals.profile,
6098
+ endpoint: globals.endpoint,
6099
+ workspaceId: globals.workspace,
6100
+ output: globals.output,
6101
+ ...extra
6102
+ });
6103
+ }
6104
+ function clientFrom(command) {
6105
+ const profile = profileFrom(command);
6106
+ return { client: new SimClient(profile), profile };
6107
6107
  }
6108
6108
 
6109
6109
  // src/commands/auth.ts
@@ -6299,44 +6299,71 @@ var V2_OPERATIONS = {
6299
6299
  method: "DELETE",
6300
6300
  path: "/api/v2/files/uploads/[uploadId]",
6301
6301
  pathParams: ["uploadId"],
6302
+ pathParamDocs: { uploadId: "Upload session identifier." },
6302
6303
  responseMode: "json",
6303
6304
  summary: "Abort File Upload",
6304
6305
  query: {
6305
- workspaceId: { kind: "string", required: true }
6306
+ workspaceId: {
6307
+ kind: "string",
6308
+ required: true,
6309
+ describe: "Workspace that owns the upload session."
6310
+ }
6306
6311
  }
6307
6312
  },
6308
6313
  abortKnowledgeDocumentUpload: {
6309
6314
  method: "DELETE",
6310
6315
  path: "/api/v2/knowledge/[id]/documents/uploads/[uploadId]",
6311
6316
  pathParams: ["id", "uploadId"],
6317
+ pathParamDocs: {
6318
+ id: "Unique knowledge base identifier.",
6319
+ uploadId: "Upload session identifier returned when the upload was created."
6320
+ },
6312
6321
  responseMode: "json",
6313
6322
  summary: "Abort Document Upload",
6314
6323
  query: {
6315
- workspaceId: { kind: "string", required: true }
6324
+ workspaceId: {
6325
+ kind: "string",
6326
+ required: true,
6327
+ describe: "Workspace that owns the knowledge base."
6328
+ }
6316
6329
  }
6317
6330
  },
6318
6331
  addTableColumn: {
6319
6332
  method: "POST",
6320
6333
  path: "/api/v2/tables/[tableId]/columns",
6321
6334
  pathParams: ["tableId"],
6335
+ pathParamDocs: { tableId: "Unique table identifier." },
6322
6336
  responseMode: "json",
6323
6337
  summary: "Add Column",
6324
6338
  body: {
6325
- workspaceId: { kind: "string", required: true },
6326
- column: { kind: "object", required: true }
6339
+ workspaceId: { kind: "string", required: true, describe: "Workspace that owns the table." },
6340
+ column: { kind: "object", required: true, describe: "Column definition to add." }
6327
6341
  }
6328
6342
  },
6329
6343
  addWorkflowGroup: {
6330
6344
  method: "POST",
6331
6345
  path: "/api/v2/tables/[tableId]/groups",
6332
6346
  pathParams: ["tableId"],
6347
+ pathParamDocs: { tableId: "Unique table identifier." },
6333
6348
  responseMode: "json",
6334
6349
  summary: "Add Workflow Group",
6335
6350
  body: {
6336
- workspaceId: { kind: "string", required: true },
6337
- group: { kind: "object", required: true },
6338
- outputColumns: { kind: "array", required: true },
6339
- autoRun: { kind: "boolean", default: false }
6351
+ workspaceId: { kind: "string", required: true, describe: "Unique workspace identifier." },
6352
+ group: {
6353
+ kind: "object",
6354
+ required: true,
6355
+ describe: "Workflow or enrichment producer definition."
6356
+ },
6357
+ outputColumns: {
6358
+ kind: "array",
6359
+ required: true,
6360
+ describe: "Columns created for producer outputs."
6361
+ },
6362
+ autoRun: {
6363
+ kind: "boolean",
6364
+ default: false,
6365
+ describe: "Whether to schedule existing rows after group creation."
6366
+ }
6340
6367
  }
6341
6368
  },
6342
6369
  bulkDeleteFiles: {
@@ -6346,62 +6373,99 @@ var V2_OPERATIONS = {
6346
6373
  responseMode: "json",
6347
6374
  summary: "Delete Files",
6348
6375
  body: {
6349
- workspaceId: { kind: "string", required: true },
6350
- fileIds: { kind: "array", required: true }
6376
+ workspaceId: { kind: "string", required: true, describe: "Workspace containing the files." },
6377
+ fileIds: { kind: "array", required: true, describe: "File identifiers to update." }
6351
6378
  }
6352
6379
  },
6353
6380
  bulkUpdateKnowledgeDocuments: {
6354
6381
  method: "PATCH",
6355
6382
  path: "/api/v2/knowledge/[id]/documents",
6356
6383
  pathParams: ["id"],
6384
+ pathParamDocs: { id: "Unique knowledge base identifier." },
6357
6385
  responseMode: "json",
6358
6386
  summary: "Bulk Enable or Disable Documents",
6359
6387
  body: {
6360
- workspaceId: { kind: "string", required: true },
6361
- operation: { kind: "enum", required: true, values: ["enable", "disable"] },
6362
- documentIds: { kind: "array" },
6363
- selectAll: { kind: "boolean" },
6364
- enabledFilter: { kind: "enum", values: ["all", "enabled", "disabled"] }
6388
+ workspaceId: {
6389
+ kind: "string",
6390
+ required: true,
6391
+ describe: "Workspace that owns the knowledge base."
6392
+ },
6393
+ operation: {
6394
+ kind: "enum",
6395
+ required: true,
6396
+ values: ["enable", "disable"],
6397
+ describe: "Whether the selected documents become enabled or disabled for search."
6398
+ },
6399
+ documentIds: { kind: "array", describe: "Documents to update, by identifier." },
6400
+ selectAll: {
6401
+ kind: "boolean",
6402
+ describe: "Update every document in the knowledge base instead of an explicit list, narrowed by `enabledFilter`."
6403
+ },
6404
+ enabledFilter: {
6405
+ kind: "enum",
6406
+ values: ["all", "enabled", "disabled"],
6407
+ describe: "With `selectAll`, restrict the update to documents in this state."
6408
+ }
6365
6409
  }
6366
6410
  },
6367
6411
  cancelTableExport: {
6368
6412
  method: "DELETE",
6369
6413
  path: "/api/v2/tables/exports/[exportId]",
6370
6414
  pathParams: ["exportId"],
6415
+ pathParamDocs: { exportId: "Unique table-export identifier." },
6371
6416
  responseMode: "json",
6372
6417
  summary: "Cancel Table Export",
6373
6418
  query: {
6374
- workspaceId: { kind: "string", required: true }
6419
+ workspaceId: {
6420
+ kind: "string",
6421
+ required: true,
6422
+ describe: "Workspace that owns the transfer resource."
6423
+ }
6375
6424
  }
6376
6425
  },
6377
6426
  cancelTableImport: {
6378
6427
  method: "DELETE",
6379
6428
  path: "/api/v2/tables/imports/[importId]",
6380
6429
  pathParams: ["importId"],
6430
+ pathParamDocs: { importId: "Unique table-import identifier." },
6381
6431
  responseMode: "json",
6382
6432
  summary: "Cancel Table Import",
6383
6433
  query: {
6384
- workspaceId: { kind: "string", required: true }
6434
+ workspaceId: {
6435
+ kind: "string",
6436
+ required: true,
6437
+ describe: "Workspace that owns the transfer resource."
6438
+ }
6385
6439
  }
6386
6440
  },
6387
6441
  cancelTableRuns: {
6388
6442
  method: "POST",
6389
6443
  path: "/api/v2/tables/[tableId]/cancel-runs",
6390
6444
  pathParams: ["tableId"],
6445
+ pathParamDocs: { tableId: "Unique table identifier." },
6391
6446
  responseMode: "json",
6392
6447
  summary: "Cancel Column Runs",
6393
6448
  body: {
6394
- workspaceId: { kind: "string", required: true },
6395
- scope: { kind: "enum", required: true, values: ["all", "row"] },
6396
- rowId: { kind: "string" },
6397
- filter: { kind: "unknown" },
6398
- excludeRowIds: { kind: "array" }
6449
+ workspaceId: { kind: "string", required: true, describe: "Unique workspace identifier." },
6450
+ scope: {
6451
+ kind: "enum",
6452
+ required: true,
6453
+ values: ["all", "row"],
6454
+ describe: "Whether to cancel across the table or one row."
6455
+ },
6456
+ rowId: { kind: "string", describe: "Row whose runs should be canceled for row scope." },
6457
+ filter: {
6458
+ kind: "unknown",
6459
+ describe: 'Recursive predicate tree. Each group node is exactly one non-empty `all` or `any` array whose members are further groups or `{ field, op, value }` conditions; the root must be a group, not a bare condition. At most 100 members per group, 10 levels of nesting, and 500 nodes in total. The negating operators include nulls: `ne`, `nin`, `ncontains`, `nlike`, and `nilike` match rows whose column is null or absent, so "not X" is not the complement of "X" over a nullable column. That holds for every column type, multi-select included. To exclude nulls, `all`-combine the negation with `isNotEmpty` (multi-select) or `isNotNull`. Comparison: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`. Membership: `in`, `nin` (array operand). Emptiness: `isEmpty`, `isNotEmpty`, `isNull`, `isNotNull` (no operand). Substring, always case-insensitive, operand matched literally: `contains`, `ncontains`, `startsWith`, `endsWith`. Pattern: `like`/`nlike` (case-sensitive), `ilike`/`nilike` (case-insensitive). **`*` is the only wildcard** and stands for any run of characters; `%`, `_`, and backslash match themselves. Use `like: "Hi*"`, not `like: "Hi%"`. A `select` column compares by option id and restricts its operators: single-select accepts `eq`, `ne`, `in`, `nin`; multi-select accepts `contains`, `ncontains`. Option names are accepted as operands and resolved to ids.'
6460
+ },
6461
+ excludeRowIds: { kind: "array", describe: "Rows excluded from an all-scope cancellation." }
6399
6462
  }
6400
6463
  },
6401
6464
  cancelWorkflowRun: {
6402
6465
  method: "POST",
6403
6466
  path: "/api/v2/workflows/[id]/runs/[runId]/cancel",
6404
6467
  pathParams: ["id", "runId"],
6468
+ pathParamDocs: { id: "Unique workflow identifier.", runId: "Unique workflow run identifier." },
6405
6469
  responseMode: "json",
6406
6470
  summary: "Cancel Workflow Run"
6407
6471
  },
@@ -6409,30 +6473,48 @@ var V2_OPERATIONS = {
6409
6473
  method: "POST",
6410
6474
  path: "/api/v2/files/uploads/[uploadId]/complete",
6411
6475
  pathParams: ["uploadId"],
6476
+ pathParamDocs: { uploadId: "Upload session identifier." },
6412
6477
  responseMode: "json",
6413
6478
  summary: "Complete File Upload",
6414
6479
  query: {
6415
- workspaceId: { kind: "string", required: true }
6480
+ workspaceId: {
6481
+ kind: "string",
6482
+ required: true,
6483
+ describe: "Workspace that owns the upload session."
6484
+ }
6416
6485
  }
6417
6486
  },
6418
6487
  completeKnowledgeDocumentUpload: {
6419
6488
  method: "POST",
6420
6489
  path: "/api/v2/knowledge/[id]/documents/uploads/[uploadId]/complete",
6421
6490
  pathParams: ["id", "uploadId"],
6491
+ pathParamDocs: {
6492
+ id: "Unique knowledge base identifier.",
6493
+ uploadId: "Upload session identifier returned when the upload was created."
6494
+ },
6422
6495
  responseMode: "json",
6423
6496
  summary: "Complete Document Upload",
6424
6497
  query: {
6425
- workspaceId: { kind: "string", required: true }
6498
+ workspaceId: {
6499
+ kind: "string",
6500
+ required: true,
6501
+ describe: "Workspace that owns the knowledge base."
6502
+ }
6426
6503
  }
6427
6504
  },
6428
6505
  completeTableImport: {
6429
6506
  method: "POST",
6430
6507
  path: "/api/v2/tables/imports/[importId]/complete",
6431
6508
  pathParams: ["importId"],
6509
+ pathParamDocs: { importId: "Unique table-import identifier." },
6432
6510
  responseMode: "json",
6433
6511
  summary: "Complete Table Import Upload",
6434
6512
  query: {
6435
- workspaceId: { kind: "string", required: true }
6513
+ workspaceId: {
6514
+ kind: "string",
6515
+ required: true,
6516
+ describe: "Workspace that owns the transfer resource."
6517
+ }
6436
6518
  }
6437
6519
  },
6438
6520
  createCredentialConnection: {
@@ -6442,7 +6524,11 @@ var V2_OPERATIONS = {
6442
6524
  responseMode: "json",
6443
6525
  summary: "Create Credential Connection",
6444
6526
  body: {
6445
- workspaceId: { kind: "string", required: true }
6527
+ workspaceId: {
6528
+ kind: "string",
6529
+ required: true,
6530
+ describe: "Workspace that will own the credential."
6531
+ }
6446
6532
  },
6447
6533
  opaqueBody: true
6448
6534
  },
@@ -6453,10 +6539,26 @@ var V2_OPERATIONS = {
6453
6539
  responseMode: "json",
6454
6540
  summary: "Create Custom Tool",
6455
6541
  body: {
6456
- workspaceId: { kind: "string", required: true },
6457
- title: { kind: "string", required: true },
6458
- schema: { kind: "object", required: true },
6459
- code: { kind: "string", required: true }
6542
+ workspaceId: {
6543
+ kind: "string",
6544
+ required: true,
6545
+ describe: "Workspace in which to create the custom tool."
6546
+ },
6547
+ title: {
6548
+ kind: "string",
6549
+ required: true,
6550
+ describe: "Display title, unique within the workspace."
6551
+ },
6552
+ schema: {
6553
+ kind: "object",
6554
+ required: true,
6555
+ describe: "OpenAI-style function declaration describing the callable tool surface."
6556
+ },
6557
+ code: {
6558
+ kind: "string",
6559
+ required: true,
6560
+ describe: "Tool implementation executed in the sandboxed function runtime."
6561
+ }
6460
6562
  }
6461
6563
  },
6462
6564
  createFile: {
@@ -6466,12 +6568,35 @@ var V2_OPERATIONS = {
6466
6568
  responseMode: "json",
6467
6569
  summary: "Create File",
6468
6570
  body: {
6469
- workspaceId: { kind: "string", required: true },
6470
- name: { kind: "string", required: true },
6471
- contentType: { kind: "string" },
6472
- folderPath: { kind: "string" },
6473
- content: { kind: "string", default: "" },
6474
- encoding: { kind: "enum", values: ["utf-8", "base64"], default: "utf-8" }
6571
+ workspaceId: {
6572
+ kind: "string",
6573
+ required: true,
6574
+ describe: "Workspace in which to create the file."
6575
+ },
6576
+ name: {
6577
+ kind: "string",
6578
+ required: true,
6579
+ describe: "File name, including its extension. Path separators and dot segments are rejected."
6580
+ },
6581
+ contentType: {
6582
+ kind: "string",
6583
+ describe: "MIME type. When omitted, it is inferred from the file extension."
6584
+ },
6585
+ folderPath: {
6586
+ kind: "string",
6587
+ describe: "Canonical containing-folder path. Omit for the workspace root."
6588
+ },
6589
+ content: {
6590
+ kind: "string",
6591
+ default: "",
6592
+ describe: "Initial file content. Omit or send an empty string for a zero-byte file. The 70,000,000-character bound guards the JSON envelope; the decoded bytes must be at most 50 MiB, and a longer base64 payload is rejected with `413`. Use an upload session for anything larger."
6593
+ },
6594
+ encoding: {
6595
+ kind: "enum",
6596
+ values: ["utf-8", "base64"],
6597
+ default: "utf-8",
6598
+ describe: "Encoding of the content field."
6599
+ }
6475
6600
  }
6476
6601
  },
6477
6602
  createFileFolder: {
@@ -6481,8 +6606,12 @@ var V2_OPERATIONS = {
6481
6606
  responseMode: "json",
6482
6607
  summary: "Create Folder",
6483
6608
  body: {
6484
- workspaceId: { kind: "string", required: true },
6485
- path: { kind: "string", required: true }
6609
+ workspaceId: {
6610
+ kind: "string",
6611
+ required: true,
6612
+ describe: "Workspace in which to create the folder."
6613
+ },
6614
+ path: { kind: "string", required: true, describe: "Path of the folder to create." }
6486
6615
  }
6487
6616
  },
6488
6617
  createFileUpload: {
@@ -6492,24 +6621,40 @@ var V2_OPERATIONS = {
6492
6621
  responseMode: "json",
6493
6622
  summary: "Create File Upload",
6494
6623
  body: {
6495
- workspaceId: { kind: "string", required: true },
6496
- name: { kind: "string", required: true },
6497
- contentType: { kind: "string", required: true },
6498
- size: { kind: "integer", required: true },
6499
- folderPath: { kind: "string" }
6624
+ workspaceId: {
6625
+ kind: "string",
6626
+ required: true,
6627
+ describe: "Workspace in which the file will be registered."
6628
+ },
6629
+ name: { kind: "string", required: true, describe: "File name, including its extension." },
6630
+ contentType: { kind: "string", required: true, describe: "MIME type of the uploaded file." },
6631
+ size: { kind: "integer", required: true, describe: "Exact file size in bytes." },
6632
+ folderPath: {
6633
+ kind: "string",
6634
+ describe: "Canonical destination folder path. Omit for the workspace root."
6635
+ }
6500
6636
  }
6501
6637
  },
6502
6638
  createFileUploadPartUrls: {
6503
6639
  method: "POST",
6504
6640
  path: "/api/v2/files/uploads/[uploadId]/parts",
6505
6641
  pathParams: ["uploadId"],
6642
+ pathParamDocs: { uploadId: "Upload session identifier." },
6506
6643
  responseMode: "json",
6507
6644
  summary: "Create File Upload Part URLs",
6508
6645
  query: {
6509
- workspaceId: { kind: "string", required: true }
6646
+ workspaceId: {
6647
+ kind: "string",
6648
+ required: true,
6649
+ describe: "Workspace that owns the upload session."
6650
+ }
6510
6651
  },
6511
6652
  body: {
6512
- partNumbers: { kind: "array", required: true }
6653
+ partNumbers: {
6654
+ kind: "array",
6655
+ required: true,
6656
+ describe: "Multipart part numbers for which signed URLs should be created."
6657
+ }
6513
6658
  }
6514
6659
  },
6515
6660
  createKnowledgeBase: {
@@ -6519,45 +6664,80 @@ var V2_OPERATIONS = {
6519
6664
  responseMode: "json",
6520
6665
  summary: "Create Knowledge Base",
6521
6666
  body: {
6522
- workspaceId: { kind: "string", required: true },
6523
- name: { kind: "string", required: true },
6524
- description: { kind: "string" },
6525
- chunkingConfig: { kind: "object" },
6526
- folderPath: { kind: "string" }
6667
+ workspaceId: {
6668
+ kind: "string",
6669
+ required: true,
6670
+ describe: "Workspace in which to create the knowledge base."
6671
+ },
6672
+ name: { kind: "string", required: true, describe: "Human-readable knowledge base name." },
6673
+ description: { kind: "string", describe: "Optional knowledge base description." },
6674
+ chunkingConfig: {
6675
+ kind: "object",
6676
+ describe: "Chunking configuration; defaults are applied when omitted."
6677
+ },
6678
+ folderPath: {
6679
+ kind: "string",
6680
+ describe: "Containing folder path; omission creates the knowledge base at the root."
6681
+ }
6527
6682
  }
6528
6683
  },
6529
6684
  createKnowledgeDocumentUpload: {
6530
6685
  method: "POST",
6531
6686
  path: "/api/v2/knowledge/[id]/documents/uploads",
6532
6687
  pathParams: ["id"],
6688
+ pathParamDocs: { id: "Unique knowledge base identifier." },
6533
6689
  responseMode: "json",
6534
6690
  summary: "Create Document Upload",
6535
6691
  body: {
6536
- workspaceId: { kind: "string", required: true },
6537
- name: { kind: "string", required: true },
6538
- contentType: { kind: "string", required: true },
6539
- size: { kind: "integer", required: true },
6540
- tag1: { kind: "string" },
6541
- tag2: { kind: "string" },
6542
- tag3: { kind: "string" },
6543
- tag4: { kind: "string" },
6544
- tag5: { kind: "string" },
6545
- tag6: { kind: "string" },
6546
- tag7: { kind: "string" },
6547
- processingOptions: { kind: "object" }
6692
+ workspaceId: {
6693
+ kind: "string",
6694
+ required: true,
6695
+ describe: "Workspace that owns the knowledge base."
6696
+ },
6697
+ name: {
6698
+ kind: "string",
6699
+ required: true,
6700
+ describe: "Filename recorded on the knowledge document."
6701
+ },
6702
+ contentType: {
6703
+ kind: "string",
6704
+ required: true,
6705
+ describe: "Supported MIME type for the document."
6706
+ },
6707
+ size: { kind: "integer", required: true, describe: "Exact file size in bytes." },
6708
+ tag1: { kind: "string", describe: "Value for tag slot 1." },
6709
+ tag2: { kind: "string", describe: "Value for tag slot 2." },
6710
+ tag3: { kind: "string", describe: "Value for tag slot 3." },
6711
+ tag4: { kind: "string", describe: "Value for tag slot 4." },
6712
+ tag5: { kind: "string", describe: "Value for tag slot 5." },
6713
+ tag6: { kind: "string", describe: "Value for tag slot 6." },
6714
+ tag7: { kind: "string", describe: "Value for tag slot 7." },
6715
+ processingOptions: { kind: "object", describe: "Optional processing recipe and language." }
6548
6716
  }
6549
6717
  },
6550
6718
  createKnowledgeDocumentUploadPartUrls: {
6551
6719
  method: "POST",
6552
6720
  path: "/api/v2/knowledge/[id]/documents/uploads/[uploadId]/parts",
6553
6721
  pathParams: ["id", "uploadId"],
6722
+ pathParamDocs: {
6723
+ id: "Unique knowledge base identifier.",
6724
+ uploadId: "Upload session identifier returned when the upload was created."
6725
+ },
6554
6726
  responseMode: "json",
6555
6727
  summary: "Create Document Upload Part URLs",
6556
6728
  query: {
6557
- workspaceId: { kind: "string", required: true }
6729
+ workspaceId: {
6730
+ kind: "string",
6731
+ required: true,
6732
+ describe: "Workspace that owns the knowledge base."
6733
+ }
6558
6734
  },
6559
6735
  body: {
6560
- partNumbers: { kind: "array", required: true }
6736
+ partNumbers: {
6737
+ kind: "array",
6738
+ required: true,
6739
+ describe: "Multipart part numbers for which signed URLs should be created."
6740
+ }
6561
6741
  }
6562
6742
  },
6563
6743
  createKnowledgeFolder: {
@@ -6567,8 +6747,12 @@ var V2_OPERATIONS = {
6567
6747
  responseMode: "json",
6568
6748
  summary: "Create Folder",
6569
6749
  body: {
6570
- workspaceId: { kind: "string", required: true },
6571
- path: { kind: "string", required: true }
6750
+ workspaceId: {
6751
+ kind: "string",
6752
+ required: true,
6753
+ describe: "Workspace in which to create the folder."
6754
+ },
6755
+ path: { kind: "string", required: true, describe: "Path of the folder to create." }
6572
6756
  }
6573
6757
  },
6574
6758
  createMcpServer: {
@@ -6578,18 +6762,56 @@ var V2_OPERATIONS = {
6578
6762
  responseMode: "json",
6579
6763
  summary: "Create MCP Server",
6580
6764
  body: {
6581
- workspaceId: { kind: "string", required: true },
6582
- name: { kind: "string", required: true },
6583
- description: { kind: "string" },
6584
- transport: { kind: "enum", values: ["streamable-http"], default: "streamable-http" },
6585
- url: { kind: "string", required: true },
6586
- authType: { kind: "enum", values: ["none", "headers", "oauth"] },
6587
- headers: { kind: "object" },
6588
- timeout: { kind: "integer", default: 30000 },
6589
- retries: { kind: "integer", default: 3 },
6590
- enabled: { kind: "boolean", default: true },
6591
- oauthClientId: { kind: "string" },
6592
- oauthClientSecret: { kind: "string" }
6765
+ workspaceId: {
6766
+ kind: "string",
6767
+ required: true,
6768
+ describe: "Workspace in which to register the server."
6769
+ },
6770
+ name: { kind: "string", required: true, describe: "Server display name." },
6771
+ description: { kind: "string", describe: "Optional server description." },
6772
+ transport: {
6773
+ kind: "enum",
6774
+ values: ["streamable-http"],
6775
+ default: "streamable-http",
6776
+ describe: "Transport used to communicate with the server. Applied server-side as `streamable-http` when omitted on create."
6777
+ },
6778
+ url: {
6779
+ kind: "string",
6780
+ required: true,
6781
+ describe: "Absolute HTTP or HTTPS endpoint URL without `{{ENV_VAR}}` references. It determines server identity and is immutable: delete and recreate the server to change endpoints."
6782
+ },
6783
+ authType: {
6784
+ kind: "enum",
6785
+ values: ["none", "headers", "oauth"],
6786
+ describe: "Authentication method. When omitted, and no `headers` are sent, registration probes the endpoint once to classify it, falling back to `headers` when the probe fails or the server does not advertise OAuth. A server publishing RFC 9728 metadata is therefore stored as `oauth`, and headers configured afterwards will not authenticate — send this field explicitly to pin the method."
6787
+ },
6788
+ headers: {
6789
+ kind: "object",
6790
+ describe: "Write-only request headers sent to the server. Replaced wholesale rather than merged on update: sending this field drops every stored header it does not repeat."
6791
+ },
6792
+ timeout: {
6793
+ kind: "integer",
6794
+ default: 30000,
6795
+ describe: "Per-request timeout in milliseconds. Applied server-side as 30000 when omitted on create."
6796
+ },
6797
+ retries: {
6798
+ kind: "integer",
6799
+ default: 3,
6800
+ describe: "Number of retries per request. Applied server-side as 3 when omitted on create."
6801
+ },
6802
+ enabled: {
6803
+ kind: "boolean",
6804
+ default: true,
6805
+ describe: "Whether the server tools are available to workflows. Applied server-side as true when omitted on create."
6806
+ },
6807
+ oauthClientId: {
6808
+ kind: "string",
6809
+ describe: "Pre-registered OAuth client identifier. Changing it on update revokes the stored OAuth grant and forces reauthorization."
6810
+ },
6811
+ oauthClientSecret: {
6812
+ kind: "string",
6813
+ describe: "Write-only pre-registered OAuth client secret. Sending it on update as null or a new value revokes the stored OAuth grant and forces reauthorization, as does switching away from OAuth authentication."
6814
+ }
6593
6815
  }
6594
6816
  },
6595
6817
  createServiceAccountCredential: {
@@ -6599,25 +6821,46 @@ var V2_OPERATIONS = {
6599
6821
  responseMode: "json",
6600
6822
  summary: "Create Service-Account Credential",
6601
6823
  body: {
6602
- workspaceId: { kind: "string", required: true },
6603
- type: { kind: "string", required: true },
6604
- providerId: { kind: "string", required: true },
6605
- displayName: { kind: "string" },
6606
- description: { kind: "string" },
6607
- id: { kind: "string" },
6608
- serviceAccountJson: { kind: "string" },
6609
- apiToken: { kind: "string" },
6610
- domain: { kind: "string" },
6611
- signingSecret: { kind: "string" },
6612
- botToken: { kind: "string" },
6613
- clientId: { kind: "string" },
6614
- clientSecret: { kind: "string" },
6615
- certificateId: { kind: "string" },
6616
- orgId: { kind: "string" },
6617
- dataCenter: { kind: "string" },
6618
- authMethod: { kind: "string" },
6619
- privateKey: { kind: "string" },
6620
- username: { kind: "string" }
6824
+ workspaceId: {
6825
+ kind: "string",
6826
+ required: true,
6827
+ describe: "Workspace that will own the credential."
6828
+ },
6829
+ type: {
6830
+ kind: "string",
6831
+ required: true,
6832
+ describe: "Service-account credential discriminator."
6833
+ },
6834
+ providerId: {
6835
+ kind: "string",
6836
+ required: true,
6837
+ describe: "Exact service-account provider ID returned by provider discovery."
6838
+ },
6839
+ displayName: {
6840
+ kind: "string",
6841
+ describe: "Optional name; providers may derive one from the verified account identity."
6842
+ },
6843
+ description: { kind: "string", describe: "Optional credential description." },
6844
+ id: {
6845
+ kind: "string",
6846
+ describe: "Required only when provider discovery requests a client-generated ID."
6847
+ },
6848
+ serviceAccountJson: {
6849
+ kind: "string",
6850
+ describe: "Write-only Google service-account JSON key."
6851
+ },
6852
+ apiToken: { kind: "string", describe: "Write-only provider API token." },
6853
+ domain: { kind: "string", describe: "Provider account domain." },
6854
+ signingSecret: { kind: "string", describe: "Write-only webhook signing secret." },
6855
+ botToken: { kind: "string", describe: "Write-only bot token." },
6856
+ clientId: { kind: "string", describe: "OAuth client identifier." },
6857
+ clientSecret: { kind: "string", describe: "Write-only OAuth client secret." },
6858
+ certificateId: { kind: "string", describe: "Provider certificate mapping identifier." },
6859
+ orgId: { kind: "string", describe: "Provider organization ID." },
6860
+ dataCenter: { kind: "string", describe: "Provider data center." },
6861
+ authMethod: { kind: "string", describe: "Provider authentication method." },
6862
+ privateKey: { kind: "string", describe: "Write-only PEM private key." },
6863
+ username: { kind: "string", describe: "Provider run-as username." }
6621
6864
  }
6622
6865
  },
6623
6866
  createSkill: {
@@ -6627,10 +6870,26 @@ var V2_OPERATIONS = {
6627
6870
  responseMode: "json",
6628
6871
  summary: "Create Skill",
6629
6872
  body: {
6630
- workspaceId: { kind: "string", required: true },
6631
- name: { kind: "string", required: true },
6632
- description: { kind: "string", required: true },
6633
- content: { kind: "string", required: true }
6873
+ workspaceId: {
6874
+ kind: "string",
6875
+ required: true,
6876
+ describe: "Workspace in which to create the skill."
6877
+ },
6878
+ name: {
6879
+ kind: "string",
6880
+ required: true,
6881
+ describe: "Kebab-case name, unique within the workspace and not reserved by a built-in skill."
6882
+ },
6883
+ description: {
6884
+ kind: "string",
6885
+ required: true,
6886
+ describe: "One-line summary of when the skill applies."
6887
+ },
6888
+ content: {
6889
+ kind: "string",
6890
+ required: true,
6891
+ describe: "Skill body containing the instructions given to the agent."
6892
+ }
6634
6893
  }
6635
6894
  },
6636
6895
  createTable: {
@@ -6640,22 +6899,28 @@ var V2_OPERATIONS = {
6640
6899
  responseMode: "json",
6641
6900
  summary: "Create Table",
6642
6901
  body: {
6643
- name: { kind: "string", required: true },
6644
- description: { kind: "string" },
6645
- workspaceId: { kind: "string", required: true },
6646
- schema: { kind: "object", required: true },
6647
- folderPath: { kind: "string" }
6902
+ name: { kind: "string", required: true, describe: "Table name." },
6903
+ description: { kind: "string", describe: "Optional table description." },
6904
+ workspaceId: { kind: "string", required: true, describe: "Unique workspace identifier." },
6905
+ schema: { kind: "object", required: true, describe: "Initial table column definitions." },
6906
+ folderPath: { kind: "string", describe: "Folder in which to create the table." }
6648
6907
  }
6649
6908
  },
6650
6909
  createTableExport: {
6651
6910
  method: "POST",
6652
6911
  path: "/api/v2/tables/[tableId]/exports",
6653
6912
  pathParams: ["tableId"],
6913
+ pathParamDocs: { tableId: "Unique table identifier." },
6654
6914
  responseMode: "json",
6655
6915
  summary: "Create Table Export",
6656
6916
  body: {
6657
- workspaceId: { kind: "string", required: true },
6658
- format: { kind: "enum", values: ["csv", "json"], default: "csv" }
6917
+ workspaceId: { kind: "string", required: true, describe: "Unique workspace identifier." },
6918
+ format: {
6919
+ kind: "enum",
6920
+ values: ["csv", "json"],
6921
+ default: "csv",
6922
+ describe: "Export file format."
6923
+ }
6659
6924
  }
6660
6925
  },
6661
6926
  createTableFolder: {
@@ -6665,8 +6930,12 @@ var V2_OPERATIONS = {
6665
6930
  responseMode: "json",
6666
6931
  summary: "Create Folder",
6667
6932
  body: {
6668
- workspaceId: { kind: "string", required: true },
6669
- path: { kind: "string", required: true }
6933
+ workspaceId: {
6934
+ kind: "string",
6935
+ required: true,
6936
+ describe: "Workspace in which to create the folder."
6937
+ },
6938
+ path: { kind: "string", required: true, describe: "Path of the folder to create." }
6670
6939
  }
6671
6940
  },
6672
6941
  createTableImport: {
@@ -6676,35 +6945,48 @@ var V2_OPERATIONS = {
6676
6945
  responseMode: "json",
6677
6946
  summary: "Create Table Import",
6678
6947
  body: {
6679
- workspaceId: { kind: "string", required: true },
6680
- source: { kind: "unknown", required: true },
6681
- target: { kind: "unknown", required: true },
6682
- mapping: { kind: "object" },
6683
- createColumns: { kind: "array" },
6684
- timezone: { kind: "string" }
6948
+ workspaceId: { kind: "string", required: true, describe: "Unique workspace identifier." },
6949
+ source: { kind: "unknown", required: true, describe: "CSV source for the import." },
6950
+ target: { kind: "unknown", required: true, describe: "New or existing table import target." },
6951
+ mapping: { kind: "object", describe: "CSV headers mapped to existing table columns." },
6952
+ createColumns: {
6953
+ kind: "array",
6954
+ describe: "CSV headers for which new columns should be created."
6955
+ },
6956
+ timezone: { kind: "string", describe: "IANA timezone used to interpret local date values." }
6685
6957
  }
6686
6958
  },
6687
6959
  createTableImportPartUrls: {
6688
6960
  method: "POST",
6689
6961
  path: "/api/v2/tables/imports/[importId]/parts",
6690
6962
  pathParams: ["importId"],
6963
+ pathParamDocs: { importId: "Unique table-import identifier." },
6691
6964
  responseMode: "json",
6692
6965
  summary: "Create Table Import Part URLs",
6693
6966
  query: {
6694
- workspaceId: { kind: "string", required: true }
6967
+ workspaceId: {
6968
+ kind: "string",
6969
+ required: true,
6970
+ describe: "Workspace that owns the transfer resource."
6971
+ }
6695
6972
  },
6696
6973
  body: {
6697
- partNumbers: { kind: "array", required: true }
6974
+ partNumbers: {
6975
+ kind: "array",
6976
+ required: true,
6977
+ describe: "Multipart part numbers for which signed URLs should be created."
6978
+ }
6698
6979
  }
6699
6980
  },
6700
6981
  createTableRows: {
6701
6982
  method: "POST",
6702
6983
  path: "/api/v2/tables/[tableId]/rows",
6703
6984
  pathParams: ["tableId"],
6985
+ pathParamDocs: { tableId: "Unique table identifier." },
6704
6986
  responseMode: "json",
6705
6987
  summary: "Create Rows",
6706
6988
  body: {
6707
- workspaceId: { kind: "string", required: true }
6989
+ workspaceId: { kind: "string", required: true, describe: "Unique workspace identifier." }
6708
6990
  },
6709
6991
  opaqueBody: true
6710
6992
  },
@@ -6712,12 +6994,17 @@ var V2_OPERATIONS = {
6712
6994
  method: "POST",
6713
6995
  path: "/api/v2/tables/[tableId]/views",
6714
6996
  pathParams: ["tableId"],
6997
+ pathParamDocs: { tableId: "Unique table identifier." },
6715
6998
  responseMode: "json",
6716
6999
  summary: "Create View",
6717
7000
  body: {
6718
- workspaceId: { kind: "string", required: true },
6719
- name: { kind: "string", required: true },
6720
- config: { kind: "object", required: true }
7001
+ workspaceId: { kind: "string", required: true, describe: "Workspace that owns the table." },
7002
+ name: { kind: "string", required: true, describe: "Saved-view display name." },
7003
+ config: {
7004
+ kind: "object",
7005
+ required: true,
7006
+ describe: "Saved filter, sort, and column-layout configuration."
7007
+ }
6721
7008
  }
6722
7009
  },
6723
7010
  createWorkflow: {
@@ -6727,10 +7014,17 @@ var V2_OPERATIONS = {
6727
7014
  responseMode: "json",
6728
7015
  summary: "Create Workflow",
6729
7016
  body: {
6730
- workspaceId: { kind: "string", required: true },
6731
- name: { kind: "string", required: true },
6732
- description: { kind: "string" },
6733
- folderPath: { kind: "string" }
7017
+ workspaceId: {
7018
+ kind: "string",
7019
+ required: true,
7020
+ describe: "Workspace in which to create the workflow."
7021
+ },
7022
+ name: { kind: "string", required: true, describe: "Workflow name." },
7023
+ description: { kind: "string", describe: "Optional workflow description." },
7024
+ folderPath: {
7025
+ kind: "string",
7026
+ describe: 'Folder path. A missing leading slash is normalized before validation. Segments are percent-encoded, so a folder shown as "New folder" is `/New%20folder`: everything outside `A-Z a-z 0-9 - _ . ~` is escaped as uppercase hex, and only that exact encoding is accepted. A trailing slash, an empty segment, and a literal `.` or `..` segment are rejected. At most 64 segments and 4096 encoded bytes.'
7027
+ }
6734
7028
  }
6735
7029
  },
6736
7030
  createWorkflowFolder: {
@@ -6740,38 +7034,53 @@ var V2_OPERATIONS = {
6740
7034
  responseMode: "json",
6741
7035
  summary: "Create Workflow Folder",
6742
7036
  body: {
6743
- workspaceId: { kind: "string", required: true },
6744
- path: { kind: "string", required: true }
7037
+ workspaceId: {
7038
+ kind: "string",
7039
+ required: true,
7040
+ describe: "Workspace in which to create the folder."
7041
+ },
7042
+ path: { kind: "string", required: true, describe: "Path of the folder to create." }
6745
7043
  }
6746
7044
  },
6747
7045
  deleteCredential: {
6748
7046
  method: "DELETE",
6749
7047
  path: "/api/v2/credentials/[credentialId]",
6750
7048
  pathParams: ["credentialId"],
7049
+ pathParamDocs: { credentialId: "Credential to disconnect." },
6751
7050
  responseMode: "json",
6752
7051
  summary: "Disconnect Credential",
6753
7052
  query: {
6754
- workspaceId: { kind: "string", required: true }
7053
+ workspaceId: {
7054
+ kind: "string",
7055
+ required: true,
7056
+ describe: "Workspace expected to own the credential."
7057
+ }
6755
7058
  }
6756
7059
  },
6757
7060
  deleteCustomTool: {
6758
7061
  method: "DELETE",
6759
7062
  path: "/api/v2/custom-tools/[id]",
6760
7063
  pathParams: ["id"],
7064
+ pathParamDocs: { id: "Unique custom tool identifier." },
6761
7065
  responseMode: "json",
6762
7066
  summary: "Delete Custom Tool",
6763
7067
  query: {
6764
- workspaceId: { kind: "string", required: true }
7068
+ workspaceId: {
7069
+ kind: "string",
7070
+ required: true,
7071
+ describe: "Workspace that owns the custom tool."
7072
+ }
6765
7073
  }
6766
7074
  },
6767
7075
  deleteFile: {
6768
7076
  method: "DELETE",
6769
7077
  path: "/api/v2/files/[fileId]",
6770
7078
  pathParams: ["fileId"],
7079
+ pathParamDocs: { fileId: "File identifier." },
6771
7080
  responseMode: "json",
6772
7081
  summary: "Delete File",
6773
7082
  query: {
6774
- workspaceId: { kind: "string", required: true }
7083
+ workspaceId: { kind: "string", required: true, describe: "Workspace that owns the file." }
6775
7084
  }
6776
7085
  },
6777
7086
  deleteFileFolder: {
@@ -6781,8 +7090,8 @@ var V2_OPERATIONS = {
6781
7090
  responseMode: "json",
6782
7091
  summary: "Delete Folder",
6783
7092
  query: {
6784
- workspaceId: { kind: "string", required: true },
6785
- path: { kind: "string", required: true },
7093
+ workspaceId: { kind: "string", required: true, describe: "Workspace containing the folder." },
7094
+ path: { kind: "string", required: true, describe: "Path of the folder to delete." },
6786
7095
  recursive: {
6787
7096
  kind: "enum",
6788
7097
  values: [
@@ -6799,7 +7108,8 @@ var V2_OPERATIONS = {
6799
7108
  "n",
6800
7109
  "disabled"
6801
7110
  ],
6802
- default: "false"
7111
+ default: "false",
7112
+ describe: "Delete the folder's nested files and folders too. An empty folder deletes either way; a non-empty one needs this. The listed spellings are the whole accepted vocabulary and are case-sensitive; any other value is rejected."
6803
7113
  }
6804
7114
  }
6805
7115
  },
@@ -6807,20 +7117,33 @@ var V2_OPERATIONS = {
6807
7117
  method: "DELETE",
6808
7118
  path: "/api/v2/knowledge/[id]",
6809
7119
  pathParams: ["id"],
7120
+ pathParamDocs: { id: "Unique knowledge base identifier." },
6810
7121
  responseMode: "json",
6811
7122
  summary: "Delete Knowledge Base",
6812
7123
  query: {
6813
- workspaceId: { kind: "string", required: true }
7124
+ workspaceId: {
7125
+ kind: "string",
7126
+ required: true,
7127
+ describe: "Workspace that owns the knowledge base."
7128
+ }
6814
7129
  }
6815
7130
  },
6816
7131
  deleteKnowledgeDocument: {
6817
7132
  method: "DELETE",
6818
7133
  path: "/api/v2/knowledge/[id]/documents/[documentId]",
6819
7134
  pathParams: ["id", "documentId"],
7135
+ pathParamDocs: {
7136
+ id: "Unique knowledge base identifier.",
7137
+ documentId: "Unique knowledge document identifier."
7138
+ },
6820
7139
  responseMode: "json",
6821
7140
  summary: "Delete Document",
6822
7141
  query: {
6823
- workspaceId: { kind: "string", required: true }
7142
+ workspaceId: {
7143
+ kind: "string",
7144
+ required: true,
7145
+ describe: "Workspace that owns the knowledge base."
7146
+ }
6824
7147
  }
6825
7148
  },
6826
7149
  deleteKnowledgeFolder: {
@@ -6830,8 +7153,8 @@ var V2_OPERATIONS = {
6830
7153
  responseMode: "json",
6831
7154
  summary: "Delete Folder",
6832
7155
  query: {
6833
- workspaceId: { kind: "string", required: true },
6834
- path: { kind: "string", required: true },
7156
+ workspaceId: { kind: "string", required: true, describe: "Workspace containing the folder." },
7157
+ path: { kind: "string", required: true, describe: "Path of the folder to delete." },
6835
7158
  recursive: {
6836
7159
  kind: "enum",
6837
7160
  values: [
@@ -6848,7 +7171,8 @@ var V2_OPERATIONS = {
6848
7171
  "n",
6849
7172
  "disabled"
6850
7173
  ],
6851
- default: "false"
7174
+ default: "false",
7175
+ describe: "Delete the folder's nested files and folders too. An empty folder deletes either way; a non-empty one needs this. The listed spellings are the whole accepted vocabulary and are case-sensitive; any other value is rejected."
6852
7176
  }
6853
7177
  }
6854
7178
  },
@@ -6856,52 +7180,72 @@ var V2_OPERATIONS = {
6856
7180
  method: "DELETE",
6857
7181
  path: "/api/v2/mcp-servers/[id]",
6858
7182
  pathParams: ["id"],
7183
+ pathParamDocs: { id: "Unique MCP server identifier." },
6859
7184
  responseMode: "json",
6860
7185
  summary: "Delete MCP Server",
6861
7186
  query: {
6862
- workspaceId: { kind: "string", required: true }
7187
+ workspaceId: {
7188
+ kind: "string",
7189
+ required: true,
7190
+ describe: "Workspace that owns the MCP server."
7191
+ }
6863
7192
  }
6864
7193
  },
6865
7194
  deleteSecret: {
6866
7195
  method: "DELETE",
6867
7196
  path: "/api/v2/secrets/[name]",
6868
7197
  pathParams: ["name"],
7198
+ pathParamDocs: { name: "Secret to create, replace, or delete." },
6869
7199
  responseMode: "json",
6870
7200
  summary: "Delete Secret",
6871
7201
  query: {
6872
- workspaceId: { kind: "string", required: true },
6873
- scope: { kind: "enum", required: true, values: ["workspace", "personal"] }
7202
+ workspaceId: {
7203
+ kind: "string",
7204
+ required: true,
7205
+ describe: "Workspace the request is authorized against. A workspace secret is deleted from it; a personal secret is deleted for the caller in all of their workspaces."
7206
+ },
7207
+ scope: {
7208
+ kind: "enum",
7209
+ required: true,
7210
+ values: ["workspace", "personal"],
7211
+ describe: "Whether the secret belongs to the workspace or to the caller. A personal secret belongs to the caller across every workspace, not to one workspace."
7212
+ }
6874
7213
  }
6875
7214
  },
6876
7215
  deleteSkill: {
6877
7216
  method: "DELETE",
6878
7217
  path: "/api/v2/skills/[id]",
6879
7218
  pathParams: ["id"],
7219
+ pathParamDocs: {
7220
+ id: "Unique skill identifier. A built-in skill is `builtin-` followed by its name, for example `builtin-research`."
7221
+ },
6880
7222
  responseMode: "json",
6881
7223
  summary: "Delete Skill",
6882
7224
  query: {
6883
- workspaceId: { kind: "string", required: true }
7225
+ workspaceId: { kind: "string", required: true, describe: "Workspace that owns the skill." }
6884
7226
  }
6885
7227
  },
6886
7228
  deleteTable: {
6887
7229
  method: "DELETE",
6888
7230
  path: "/api/v2/tables/[tableId]",
6889
7231
  pathParams: ["tableId"],
7232
+ pathParamDocs: { tableId: "Unique table identifier." },
6890
7233
  responseMode: "json",
6891
7234
  summary: "Delete Table",
6892
7235
  query: {
6893
- workspaceId: { kind: "string", required: true }
7236
+ workspaceId: { kind: "string", required: true, describe: "Workspace that owns the table." }
6894
7237
  }
6895
7238
  },
6896
7239
  deleteTableColumn: {
6897
7240
  method: "DELETE",
6898
7241
  path: "/api/v2/tables/[tableId]/columns",
6899
7242
  pathParams: ["tableId"],
7243
+ pathParamDocs: { tableId: "Unique table identifier." },
6900
7244
  responseMode: "json",
6901
7245
  summary: "Delete Column",
6902
7246
  body: {
6903
- workspaceId: { kind: "string", required: true },
6904
- columnName: { kind: "string", required: true }
7247
+ workspaceId: { kind: "string", required: true, describe: "Unique workspace identifier." },
7248
+ columnName: { kind: "string", required: true, describe: "Name of the column to delete." }
6905
7249
  }
6906
7250
  },
6907
7251
  deleteTableFolder: {
@@ -6911,8 +7255,8 @@ var V2_OPERATIONS = {
6911
7255
  responseMode: "json",
6912
7256
  summary: "Delete Folder",
6913
7257
  query: {
6914
- workspaceId: { kind: "string", required: true },
6915
- path: { kind: "string", required: true },
7258
+ workspaceId: { kind: "string", required: true, describe: "Workspace containing the folder." },
7259
+ path: { kind: "string", required: true, describe: "Path of the folder to delete." },
6916
7260
  recursive: {
6917
7261
  kind: "enum",
6918
7262
  values: [
@@ -6929,7 +7273,8 @@ var V2_OPERATIONS = {
6929
7273
  "n",
6930
7274
  "disabled"
6931
7275
  ],
6932
- default: "false"
7276
+ default: "false",
7277
+ describe: "Delete the folder's nested files and folders too. An empty folder deletes either way; a non-empty one needs this. The listed spellings are the whole accepted vocabulary and are case-sensitive; any other value is rejected."
6933
7278
  }
6934
7279
  }
6935
7280
  },
@@ -6937,39 +7282,46 @@ var V2_OPERATIONS = {
6937
7282
  method: "DELETE",
6938
7283
  path: "/api/v2/tables/[tableId]/rows/[rowId]",
6939
7284
  pathParams: ["tableId", "rowId"],
7285
+ pathParamDocs: { tableId: "Unique table identifier.", rowId: "Unique table row identifier." },
6940
7286
  responseMode: "json",
6941
7287
  summary: "Delete Row",
6942
7288
  query: {
6943
- workspaceId: { kind: "string", required: true }
7289
+ workspaceId: { kind: "string", required: true, describe: "Workspace that owns the table." }
6944
7290
  }
6945
7291
  },
6946
7292
  deleteTableRows: {
6947
7293
  method: "DELETE",
6948
7294
  path: "/api/v2/tables/[tableId]/rows",
6949
7295
  pathParams: ["tableId"],
7296
+ pathParamDocs: { tableId: "Unique table identifier." },
6950
7297
  responseMode: "json",
6951
7298
  summary: "Delete Rows",
6952
7299
  body: {
6953
- workspaceId: { kind: "string", required: true },
6954
- filter: { kind: "unknown" },
6955
- limit: { kind: "integer" },
6956
- rowIds: { kind: "array" }
7300
+ workspaceId: { kind: "string", required: true, describe: "Unique workspace identifier." },
7301
+ filter: {
7302
+ kind: "unknown",
7303
+ describe: 'Recursive predicate tree. Each group node is exactly one non-empty `all` or `any` array whose members are further groups or `{ field, op, value }` conditions; the root must be a group, not a bare condition. At most 100 members per group, 10 levels of nesting, and 500 nodes in total. The negating operators include nulls: `ne`, `nin`, `ncontains`, `nlike`, and `nilike` match rows whose column is null or absent, so "not X" is not the complement of "X" over a nullable column. That holds for every column type, multi-select included. To exclude nulls, `all`-combine the negation with `isNotEmpty` (multi-select) or `isNotNull`. Comparison: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`. Membership: `in`, `nin` (array operand). Emptiness: `isEmpty`, `isNotEmpty`, `isNull`, `isNotNull` (no operand). Substring, always case-insensitive, operand matched literally: `contains`, `ncontains`, `startsWith`, `endsWith`. Pattern: `like`/`nlike` (case-sensitive), `ilike`/`nilike` (case-insensitive). **`*` is the only wildcard** and stands for any run of characters; `%`, `_`, and backslash match themselves. Use `like: "Hi*"`, not `like: "Hi%"`. A `select` column compares by option id and restricts its operators: single-select accepts `eq`, `ne`, `in`, `nin`; multi-select accepts `contains`, `ncontains`. Option names are accepted as operands and resolved to ids.'
7304
+ },
7305
+ limit: { kind: "integer", describe: "Maximum matching rows to delete." },
7306
+ rowIds: { kind: "array", describe: "Explicit row identifiers to delete." }
6957
7307
  }
6958
7308
  },
6959
7309
  deleteTableView: {
6960
7310
  method: "DELETE",
6961
7311
  path: "/api/v2/tables/[tableId]/views/[viewId]",
6962
7312
  pathParams: ["tableId", "viewId"],
7313
+ pathParamDocs: { tableId: "Unique table identifier.", viewId: "Unique saved-view identifier." },
6963
7314
  responseMode: "json",
6964
7315
  summary: "Delete View",
6965
7316
  query: {
6966
- workspaceId: { kind: "string", required: true }
7317
+ workspaceId: { kind: "string", required: true, describe: "Workspace that owns the table." }
6967
7318
  }
6968
7319
  },
6969
7320
  deleteWorkflow: {
6970
7321
  method: "DELETE",
6971
7322
  path: "/api/v2/workflows/[id]",
6972
7323
  pathParams: ["id"],
7324
+ pathParamDocs: { id: "Unique workflow identifier." },
6973
7325
  responseMode: "json",
6974
7326
  summary: "Delete Workflow"
6975
7327
  },
@@ -6980,8 +7332,8 @@ var V2_OPERATIONS = {
6980
7332
  responseMode: "json",
6981
7333
  summary: "Delete Workflow Folder",
6982
7334
  query: {
6983
- workspaceId: { kind: "string", required: true },
6984
- path: { kind: "string", required: true },
7335
+ workspaceId: { kind: "string", required: true, describe: "Workspace containing the folder." },
7336
+ path: { kind: "string", required: true, describe: "Path of the folder to delete." },
6985
7337
  recursive: {
6986
7338
  kind: "enum",
6987
7339
  values: [
@@ -6998,7 +7350,8 @@ var V2_OPERATIONS = {
6998
7350
  "n",
6999
7351
  "disabled"
7000
7352
  ],
7001
- default: "false"
7353
+ default: "false",
7354
+ describe: "Delete the folder's nested files and folders too. An empty folder deletes either way; a non-empty one needs this. The listed spellings are the whole accepted vocabulary and are case-sensitive; any other value is rejected."
7002
7355
  }
7003
7356
  }
7004
7357
  },
@@ -7006,56 +7359,95 @@ var V2_OPERATIONS = {
7006
7359
  method: "DELETE",
7007
7360
  path: "/api/v2/tables/[tableId]/groups",
7008
7361
  pathParams: ["tableId"],
7362
+ pathParamDocs: { tableId: "Unique table identifier." },
7009
7363
  responseMode: "json",
7010
7364
  summary: "Delete Workflow Group",
7011
7365
  body: {
7012
- workspaceId: { kind: "string", required: true },
7013
- groupId: { kind: "string", required: true }
7366
+ workspaceId: { kind: "string", required: true, describe: "Unique workspace identifier." },
7367
+ groupId: { kind: "string", required: true, describe: "Workflow group to delete." }
7014
7368
  }
7015
7369
  },
7016
7370
  deployWorkflow: {
7017
7371
  method: "POST",
7018
7372
  path: "/api/v2/workflows/[id]/deploy",
7019
7373
  pathParams: ["id"],
7374
+ pathParamDocs: { id: "Unique workflow identifier." },
7020
7375
  responseMode: "json",
7021
7376
  summary: "Deploy Workflow",
7022
7377
  body: {
7023
- name: { kind: "string" },
7024
- description: { kind: "string" }
7378
+ name: { kind: "string", describe: "Optional label for the deployment version." },
7379
+ description: {
7380
+ kind: "string",
7381
+ describe: "Optional release note for the deployment version."
7382
+ }
7025
7383
  }
7026
7384
  },
7027
7385
  downloadFile: {
7028
7386
  method: "GET",
7029
7387
  path: "/api/v2/files/[fileId]",
7030
7388
  pathParams: ["fileId"],
7389
+ pathParamDocs: { fileId: "File identifier." },
7031
7390
  responseMode: "binary",
7032
7391
  summary: "Download File",
7033
7392
  query: {
7034
- workspaceId: { kind: "string", required: true }
7393
+ workspaceId: { kind: "string", required: true, describe: "Workspace that owns the file." }
7035
7394
  }
7036
7395
  },
7037
7396
  executeWorkflow: {
7038
7397
  method: "POST",
7039
7398
  path: "/api/v2/workflows/[id]/execute",
7040
7399
  pathParams: ["id"],
7400
+ pathParamDocs: { id: "Unique workflow identifier." },
7041
7401
  responseMode: "json",
7042
7402
  summary: "Execute Workflow",
7043
7403
  body: {
7044
- input: { kind: "object" },
7045
- async: { kind: "boolean", default: false },
7046
- executionTimeoutSeconds: { kind: "integer" },
7047
- stream: { kind: "boolean", default: false },
7048
- selectedOutputs: { kind: "array" },
7049
- includeThinking: { kind: "boolean", default: false },
7050
- includeToolCalls: { kind: "boolean", default: false },
7051
- includeFileBase64: { kind: "boolean" },
7052
- base64MaxBytes: { kind: "integer" }
7404
+ input: {
7405
+ kind: "object",
7406
+ describe: "Workflow input keyed by deployed trigger input-field name."
7407
+ },
7408
+ async: {
7409
+ kind: "boolean",
7410
+ default: false,
7411
+ describe: "Queue the run and return a 202 receipt when true. Requires an API key, cannot be combined with `stream`, and rejects all streaming and output-shaping options (`selectedOutputs`, `includeThinking`, `includeToolCalls`, `includeFileBase64`, `base64MaxBytes`)."
7412
+ },
7413
+ executionTimeoutSeconds: {
7414
+ kind: "integer",
7415
+ describe: "Requested server-side timeout for an asynchronous run, in seconds. An upper bound, not the effective timeout: the run uses the smaller of this value and the plan's execution timeout, so requesting more than the plan allows silently yields the plan timeout. Rejected with `400` unless `async` is true."
7416
+ },
7417
+ stream: {
7418
+ kind: "boolean",
7419
+ default: false,
7420
+ describe: "Return Server-Sent Events instead of JSON when true. Cannot be combined with `async`."
7421
+ },
7422
+ selectedOutputs: {
7423
+ kind: "array",
7424
+ describe: "Block output references to include in a streamed response. Rejected when `async` is true."
7425
+ },
7426
+ includeThinking: {
7427
+ kind: "boolean",
7428
+ default: false,
7429
+ describe: "Include model reasoning events in an agent-event stream. Requires `stream: true` and the `X-Sim-Stream-Protocol: agent-events-v1` request header, and is rejected when `async` is true."
7430
+ },
7431
+ includeToolCalls: {
7432
+ kind: "boolean",
7433
+ default: false,
7434
+ describe: "Include tool-call events in an agent-event stream. Requires `stream: true` and the `X-Sim-Stream-Protocol: agent-events-v1` request header, and is rejected when `async` is true."
7435
+ },
7436
+ includeFileBase64: {
7437
+ kind: "boolean",
7438
+ describe: "Inline eligible output files as base64 content. Rejected when `async` is true."
7439
+ },
7440
+ base64MaxBytes: {
7441
+ kind: "integer",
7442
+ describe: "Maximum total bytes of file content to inline as base64. Rejected when `async` is true."
7443
+ }
7053
7444
  }
7054
7445
  },
7055
7446
  exportWorkflow: {
7056
7447
  method: "GET",
7057
7448
  path: "/api/v2/workflows/[id]/export",
7058
7449
  pathParams: ["id"],
7450
+ pathParamDocs: { id: "Unique workflow identifier." },
7059
7451
  responseMode: "json",
7060
7452
  summary: "Export Workflow"
7061
7453
  },
@@ -7063,23 +7455,32 @@ var V2_OPERATIONS = {
7063
7455
  method: "POST",
7064
7456
  path: "/api/v2/tables/[tableId]/rows/find",
7065
7457
  pathParams: ["tableId"],
7458
+ pathParamDocs: { tableId: "Unique table identifier." },
7066
7459
  responseMode: "json",
7067
7460
  summary: "Find Rows",
7068
7461
  body: {
7069
- workspaceId: { kind: "string", required: true },
7070
- q: { kind: "string", required: true },
7071
- predicate: { kind: "unknown" },
7072
- sort: { kind: "array" }
7462
+ workspaceId: { kind: "string", required: true, describe: "Unique workspace identifier." },
7463
+ q: { kind: "string", required: true, describe: "Case-insensitive cell substring to find." },
7464
+ predicate: {
7465
+ kind: "unknown",
7466
+ describe: 'Recursive predicate tree. Each group node is exactly one non-empty `all` or `any` array whose members are further groups or `{ field, op, value }` conditions; the root must be a group, not a bare condition. At most 100 members per group, 10 levels of nesting, and 500 nodes in total. The negating operators include nulls: `ne`, `nin`, `ncontains`, `nlike`, and `nilike` match rows whose column is null or absent, so "not X" is not the complement of "X" over a nullable column. That holds for every column type, multi-select included. To exclude nulls, `all`-combine the negation with `isNotEmpty` (multi-select) or `isNotNull`. Comparison: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`. Membership: `in`, `nin` (array operand). Emptiness: `isEmpty`, `isNotEmpty`, `isNull`, `isNotNull` (no operand). Substring, always case-insensitive, operand matched literally: `contains`, `ncontains`, `startsWith`, `endsWith`. Pattern: `like`/`nlike` (case-sensitive), `ilike`/`nilike` (case-insensitive). **`*` is the only wildcard** and stands for any run of characters; `%`, `_`, and backslash match themselves. Use `like: "Hi*"`, not `like: "Hi%"`. A `select` column compares by option id and restricts its operators: single-select accepts `eq`, `ne`, `in`, `nin`; multi-select accepts `contains`, `ncontains`. Option names are accepted as operands and resolved to ids.'
7467
+ },
7468
+ sort: { kind: "array", describe: "Ordered table-row sort specification." }
7073
7469
  }
7074
7470
  },
7075
7471
  getAuditLog: {
7076
7472
  method: "GET",
7077
7473
  path: "/api/v2/audit-logs/[id]",
7078
7474
  pathParams: ["id"],
7475
+ pathParamDocs: { id: "Audit-log entry identifier." },
7079
7476
  responseMode: "json",
7080
7477
  summary: "Get Audit Log",
7081
7478
  query: {
7082
- organizationId: { kind: "string", required: true }
7479
+ organizationId: {
7480
+ kind: "string",
7481
+ required: true,
7482
+ describe: "Organization whose audit-log entry should be returned."
7483
+ }
7083
7484
  }
7084
7485
  },
7085
7486
  getBillingStatus: {
@@ -7089,64 +7490,93 @@ var V2_OPERATIONS = {
7089
7490
  responseMode: "json",
7090
7491
  summary: "Get Billing Status",
7091
7492
  query: {
7092
- workspaceId: { kind: "string" }
7493
+ workspaceId: {
7494
+ kind: "string",
7495
+ describe: "Workspace whose payer should be resolved. Workspace API keys are pinned to their own workspace."
7496
+ }
7093
7497
  }
7094
7498
  },
7095
7499
  getCustomTool: {
7096
7500
  method: "GET",
7097
7501
  path: "/api/v2/custom-tools/[id]",
7098
7502
  pathParams: ["id"],
7503
+ pathParamDocs: { id: "Unique custom tool identifier." },
7099
7504
  responseMode: "json",
7100
7505
  summary: "Get Custom Tool",
7101
7506
  query: {
7102
- workspaceId: { kind: "string", required: true }
7507
+ workspaceId: {
7508
+ kind: "string",
7509
+ required: true,
7510
+ describe: "Workspace that owns the custom tool."
7511
+ }
7103
7512
  }
7104
7513
  },
7105
7514
  getFile: {
7106
7515
  method: "GET",
7107
7516
  path: "/api/v2/files/[fileId]/metadata",
7108
7517
  pathParams: ["fileId"],
7518
+ pathParamDocs: { fileId: "File identifier." },
7109
7519
  responseMode: "json",
7110
7520
  summary: "Get File Metadata",
7111
7521
  query: {
7112
- workspaceId: { kind: "string", required: true },
7113
- scope: { kind: "enum", values: ["active", "archived"], default: "active" }
7522
+ workspaceId: { kind: "string", required: true, describe: "Workspace that owns the file." },
7523
+ scope: {
7524
+ kind: "enum",
7525
+ values: ["active", "archived"],
7526
+ default: "active",
7527
+ describe: "Which lifecycle set to read from: `active` (default) resolves live files only and returns `404` for a file a `DELETE` soft-deleted; `archived` also resolves soft-deleted files, so metadata stays readable before `POST /files/{fileId}/restore`. Authorization is identical for both."
7528
+ }
7114
7529
  }
7115
7530
  },
7116
7531
  getFileShare: {
7117
7532
  method: "GET",
7118
7533
  path: "/api/v2/files/[fileId]/share",
7119
7534
  pathParams: ["fileId"],
7535
+ pathParamDocs: { fileId: "File identifier." },
7120
7536
  responseMode: "json",
7121
7537
  summary: "Get File Share",
7122
7538
  query: {
7123
- workspaceId: { kind: "string", required: true }
7539
+ workspaceId: { kind: "string", required: true, describe: "Workspace that owns the file." }
7124
7540
  }
7125
7541
  },
7126
7542
  getKnowledgeBase: {
7127
7543
  method: "GET",
7128
7544
  path: "/api/v2/knowledge/[id]",
7129
7545
  pathParams: ["id"],
7546
+ pathParamDocs: { id: "Unique knowledge base identifier." },
7130
7547
  responseMode: "json",
7131
7548
  summary: "Get Knowledge Base",
7132
7549
  query: {
7133
- workspaceId: { kind: "string", required: true }
7550
+ workspaceId: {
7551
+ kind: "string",
7552
+ required: true,
7553
+ describe: "Workspace that owns the knowledge base."
7554
+ }
7134
7555
  }
7135
7556
  },
7136
7557
  getKnowledgeDocument: {
7137
7558
  method: "GET",
7138
7559
  path: "/api/v2/knowledge/[id]/documents/[documentId]",
7139
7560
  pathParams: ["id", "documentId"],
7561
+ pathParamDocs: {
7562
+ id: "Unique knowledge base identifier.",
7563
+ documentId: "Unique knowledge document identifier."
7564
+ },
7140
7565
  responseMode: "json",
7141
7566
  summary: "Get Document",
7142
7567
  query: {
7143
- workspaceId: { kind: "string", required: true }
7568
+ workspaceId: {
7569
+ kind: "string",
7570
+ required: true,
7571
+ describe: "Workspace that owns the knowledge base."
7572
+ }
7144
7573
  }
7145
7574
  },
7146
7575
  getLog: {
7147
7576
  method: "GET",
7148
7577
  path: "/api/v2/logs/[runId]",
7149
7578
  pathParams: ["runId"],
7579
+ pathParamDocs: { runId: "Unique workflow run identifier." },
7150
7580
  responseMode: "json",
7151
7581
  summary: "Get Log"
7152
7582
  },
@@ -7154,76 +7584,98 @@ var V2_OPERATIONS = {
7154
7584
  method: "GET",
7155
7585
  path: "/api/v2/mcp-servers/[id]",
7156
7586
  pathParams: ["id"],
7587
+ pathParamDocs: { id: "Unique MCP server identifier." },
7157
7588
  responseMode: "json",
7158
7589
  summary: "Get MCP Server",
7159
7590
  query: {
7160
- workspaceId: { kind: "string", required: true }
7591
+ workspaceId: {
7592
+ kind: "string",
7593
+ required: true,
7594
+ describe: "Workspace that owns the MCP server."
7595
+ }
7161
7596
  }
7162
7597
  },
7163
7598
  getSkill: {
7164
7599
  method: "GET",
7165
7600
  path: "/api/v2/skills/[id]",
7166
7601
  pathParams: ["id"],
7602
+ pathParamDocs: {
7603
+ id: "Unique skill identifier. A built-in skill is `builtin-` followed by its name, for example `builtin-research`."
7604
+ },
7167
7605
  responseMode: "json",
7168
7606
  summary: "Get Skill",
7169
7607
  query: {
7170
- workspaceId: { kind: "string", required: true }
7608
+ workspaceId: { kind: "string", required: true, describe: "Workspace that owns the skill." }
7171
7609
  }
7172
7610
  },
7173
7611
  getTable: {
7174
7612
  method: "GET",
7175
7613
  path: "/api/v2/tables/[tableId]",
7176
7614
  pathParams: ["tableId"],
7615
+ pathParamDocs: { tableId: "Unique table identifier." },
7177
7616
  responseMode: "json",
7178
7617
  summary: "Get Table",
7179
7618
  query: {
7180
- workspaceId: { kind: "string", required: true }
7619
+ workspaceId: { kind: "string", required: true, describe: "Workspace that owns the table." }
7181
7620
  }
7182
7621
  },
7183
7622
  getTableExport: {
7184
7623
  method: "GET",
7185
7624
  path: "/api/v2/tables/exports/[exportId]",
7186
7625
  pathParams: ["exportId"],
7626
+ pathParamDocs: { exportId: "Unique table-export identifier." },
7187
7627
  responseMode: "json",
7188
7628
  summary: "Get Table Export",
7189
7629
  query: {
7190
- workspaceId: { kind: "string", required: true }
7630
+ workspaceId: {
7631
+ kind: "string",
7632
+ required: true,
7633
+ describe: "Workspace that owns the transfer resource."
7634
+ }
7191
7635
  }
7192
7636
  },
7193
7637
  getTableImport: {
7194
7638
  method: "GET",
7195
7639
  path: "/api/v2/tables/imports/[importId]",
7196
7640
  pathParams: ["importId"],
7641
+ pathParamDocs: { importId: "Unique table-import identifier." },
7197
7642
  responseMode: "json",
7198
7643
  summary: "Get Table Import",
7199
7644
  query: {
7200
- workspaceId: { kind: "string", required: true }
7645
+ workspaceId: {
7646
+ kind: "string",
7647
+ required: true,
7648
+ describe: "Workspace that owns the transfer resource."
7649
+ }
7201
7650
  }
7202
7651
  },
7203
7652
  getTableRow: {
7204
7653
  method: "GET",
7205
7654
  path: "/api/v2/tables/[tableId]/rows/[rowId]",
7206
7655
  pathParams: ["tableId", "rowId"],
7656
+ pathParamDocs: { tableId: "Unique table identifier.", rowId: "Unique table row identifier." },
7207
7657
  responseMode: "json",
7208
7658
  summary: "Get Row",
7209
7659
  query: {
7210
- workspaceId: { kind: "string", required: true }
7660
+ workspaceId: { kind: "string", required: true, describe: "Workspace that owns the table." }
7211
7661
  }
7212
7662
  },
7213
7663
  getTableView: {
7214
7664
  method: "GET",
7215
7665
  path: "/api/v2/tables/[tableId]/views/[viewId]",
7216
7666
  pathParams: ["tableId", "viewId"],
7667
+ pathParamDocs: { tableId: "Unique table identifier.", viewId: "Unique saved-view identifier." },
7217
7668
  responseMode: "json",
7218
7669
  summary: "Get View",
7219
7670
  query: {
7220
- workspaceId: { kind: "string", required: true }
7671
+ workspaceId: { kind: "string", required: true, describe: "Workspace that owns the table." }
7221
7672
  }
7222
7673
  },
7223
7674
  getWorkflow: {
7224
7675
  method: "GET",
7225
7676
  path: "/api/v2/workflows/[id]",
7226
7677
  pathParams: ["id"],
7678
+ pathParamDocs: { id: "Unique workflow identifier." },
7227
7679
  responseMode: "json",
7228
7680
  summary: "Get Workflow"
7229
7681
  },
@@ -7231,6 +7683,7 @@ var V2_OPERATIONS = {
7231
7683
  method: "GET",
7232
7684
  path: "/api/v2/workflows/[id]/deployment",
7233
7685
  pathParams: ["id"],
7686
+ pathParamDocs: { id: "Unique workflow identifier." },
7234
7687
  responseMode: "json",
7235
7688
  summary: "Get Workflow Deployment"
7236
7689
  },
@@ -7238,17 +7691,25 @@ var V2_OPERATIONS = {
7238
7691
  method: "GET",
7239
7692
  path: "/api/v2/workflows/[id]/runs/[runId]",
7240
7693
  pathParams: ["id", "runId"],
7694
+ pathParamDocs: { id: "Unique workflow identifier.", runId: "Unique workflow run identifier." },
7241
7695
  responseMode: "json",
7242
7696
  summary: "Get Workflow Run",
7243
7697
  query: {
7244
- includeOutput: { kind: "boolean" },
7245
- selectedOutputs: { kind: "string" }
7698
+ includeOutput: {
7699
+ kind: "boolean",
7700
+ describe: "Include the final workflow output when true. It does not gate `blockOutputs`, which `selectedOutputs` selects on its own."
7701
+ },
7702
+ selectedOutputs: {
7703
+ kind: "string",
7704
+ describe: "Comma-separated block output references to include, as `blockId` or `blockId.path`. Block *names* are not resolved here — unlike the execute request, this resource reads a recorded run and matches ids only, so a name selects nothing and yields an empty `blockOutputs`."
7705
+ }
7246
7706
  }
7247
7707
  },
7248
7708
  getWorkflowVersion: {
7249
7709
  method: "GET",
7250
7710
  path: "/api/v2/workflows/[id]/versions/[version]",
7251
7711
  pathParams: ["id", "version"],
7712
+ pathParamDocs: { id: "Unique workflow identifier.", version: "Numeric deployment version." },
7252
7713
  responseMode: "json",
7253
7714
  summary: "Get Workflow Version"
7254
7715
  },
@@ -7256,6 +7717,7 @@ var V2_OPERATIONS = {
7256
7717
  method: "GET",
7257
7718
  path: "/api/v2/workspaces/[workspaceId]",
7258
7719
  pathParams: ["workspaceId"],
7720
+ pathParamDocs: { workspaceId: "Workspace to retrieve." },
7259
7721
  responseMode: "json",
7260
7722
  summary: "Get Workspace"
7261
7723
  },
@@ -7266,11 +7728,22 @@ var V2_OPERATIONS = {
7266
7728
  responseMode: "json",
7267
7729
  summary: "Import Workflow",
7268
7730
  body: {
7269
- workspaceId: { kind: "string", required: true },
7270
- workflow: { kind: "unknown", required: true },
7271
- folderPath: { kind: "string" },
7272
- name: { kind: "string" },
7273
- description: { kind: "string" }
7731
+ workspaceId: {
7732
+ kind: "string",
7733
+ required: true,
7734
+ describe: "Workspace in which to import the workflow."
7735
+ },
7736
+ workflow: {
7737
+ kind: "unknown",
7738
+ required: true,
7739
+ describe: "Workflow export object, bare workflow state, or JSON string containing either form."
7740
+ },
7741
+ folderPath: {
7742
+ kind: "string",
7743
+ describe: "Destination folder path; omit for the workspace root."
7744
+ },
7745
+ name: { kind: "string", describe: "Override for the imported workflow name." },
7746
+ description: { kind: "string", describe: "Override for the imported workflow description." }
7274
7747
  }
7275
7748
  },
7276
7749
  listAuditLogs: {
@@ -7280,17 +7753,40 @@ var V2_OPERATIONS = {
7280
7753
  responseMode: "json",
7281
7754
  summary: "List Audit Logs",
7282
7755
  query: {
7283
- action: { kind: "string" },
7284
- resourceType: { kind: "string" },
7285
- resourceId: { kind: "string" },
7286
- workspaceId: { kind: "string" },
7287
- startDate: { kind: "string" },
7288
- endDate: { kind: "string" },
7289
- includeDeparted: { kind: "boolean" },
7290
- limit: { kind: "integer", default: 50 },
7291
- cursor: { kind: "string" },
7292
- organizationId: { kind: "string", required: true },
7293
- actorEmail: { kind: "string" }
7756
+ action: { kind: "string", describe: "Filter by exact action name." },
7757
+ resourceType: {
7758
+ kind: "string",
7759
+ describe: "Filter by resource type. Accepts a comma-separated set; members are trimmed and deduplicated, and member order affects neither the result nor the cursor."
7760
+ },
7761
+ resourceId: { kind: "string", describe: "Filter by exact resource identifier." },
7762
+ workspaceId: { kind: "string", describe: "Filter to actions in one workspace." },
7763
+ startDate: {
7764
+ kind: "string",
7765
+ describe: "Only include runs started at or after this UTC ISO 8601 timestamp, e.g. `2026-08-06T00:00:00Z`. A date without a time, or a timestamp carrying a UTC offset instead of `Z`, is rejected, as is year `0000`, which names no storable instant."
7766
+ },
7767
+ endDate: {
7768
+ kind: "string",
7769
+ describe: "Only include runs started at or before this UTC ISO 8601 timestamp, e.g. `2026-08-06T00:00:00Z`. A date without a time, or a timestamp carrying a UTC offset instead of `Z`, is rejected, as is year `0000`, which names no storable instant."
7770
+ },
7771
+ includeDeparted: {
7772
+ kind: "boolean",
7773
+ describe: "Include actions by users who have left the organization."
7774
+ },
7775
+ limit: {
7776
+ kind: "integer",
7777
+ default: 50,
7778
+ describe: "Maximum audit entries to return per page. Must be a whole number from 1 to 100. Defaults to 50."
7779
+ },
7780
+ cursor: {
7781
+ kind: "string",
7782
+ describe: "Opaque cursor from the previous page. Send it back with the same sort and filters; only `limit` may change. Change anything else and pagination must restart without a cursor."
7783
+ },
7784
+ organizationId: {
7785
+ kind: "string",
7786
+ required: true,
7787
+ describe: "Organization whose audit trail should be queried."
7788
+ },
7789
+ actorEmail: { kind: "string", describe: "Filter by actor email address." }
7294
7790
  }
7295
7791
  },
7296
7792
  listBillingLogs: {
@@ -7312,18 +7808,36 @@ var V2_OPERATIONS = {
7312
7808
  "voice-input",
7313
7809
  "enrichment",
7314
7810
  "voice-output"
7315
- ]
7811
+ ],
7812
+ describe: "Restrict results to one usage source."
7813
+ },
7814
+ workspaceId: {
7815
+ kind: "string",
7816
+ describe: "Restrict results to one workspace whose payer the caller can inspect."
7316
7817
  },
7317
- workspaceId: { kind: "string" },
7318
7818
  period: {
7319
7819
  kind: "enum",
7320
7820
  values: ["1d", "7d", "30d", "all", "custom"],
7321
- default: "30d"
7821
+ default: "30d",
7822
+ describe: "Relative window, all history, or a custom date range. `startDate` and `endDate` are accepted only with `custom`; every other value computes its own window."
7322
7823
  },
7323
- startDate: { kind: "string" },
7324
- endDate: { kind: "string" },
7325
- limit: { kind: "integer", default: 50 },
7326
- cursor: { kind: "string" }
7824
+ startDate: {
7825
+ kind: "string",
7826
+ describe: "Only include usage events recorded at or after this UTC ISO 8601 timestamp, e.g. `2026-08-06T00:00:00Z`. Requires `period=custom`. A date without a time, or a timestamp carrying a UTC offset instead of `Z`, is rejected, as is year `0000`, which names no storable instant."
7827
+ },
7828
+ endDate: {
7829
+ kind: "string",
7830
+ describe: "Only include usage events recorded at or before this UTC ISO 8601 timestamp, e.g. `2026-08-06T00:00:00Z`. Requires `period=custom`, and defaults to now when omitted. A date without a time, or a timestamp carrying a UTC offset instead of `Z`, is rejected, as is year `0000`, which names no storable instant."
7831
+ },
7832
+ limit: {
7833
+ kind: "integer",
7834
+ default: 50,
7835
+ describe: "Maximum usage events per page. Must be a whole number from 1 to 100. Defaults to 50."
7836
+ },
7837
+ cursor: {
7838
+ kind: "string",
7839
+ describe: "Opaque cursor from the previous page. Send it back with the same sort and filters; only `limit` may change. Change anything else and pagination must restart without a cursor."
7840
+ }
7327
7841
  }
7328
7842
  },
7329
7843
  listCredentialProviders: {
@@ -7333,8 +7847,15 @@ var V2_OPERATIONS = {
7333
7847
  responseMode: "json",
7334
7848
  summary: "List Credential Providers",
7335
7849
  query: {
7336
- workspaceId: { kind: "string", required: true },
7337
- search: { kind: "string" }
7850
+ workspaceId: {
7851
+ kind: "string",
7852
+ required: true,
7853
+ describe: "Workspace used to evaluate credential-provider availability and integration policy."
7854
+ },
7855
+ search: {
7856
+ kind: "string",
7857
+ describe: "Case-insensitive substring match against the credential provider name."
7858
+ }
7338
7859
  }
7339
7860
  },
7340
7861
  listCredentials: {
@@ -7344,18 +7865,45 @@ var V2_OPERATIONS = {
7344
7865
  responseMode: "json",
7345
7866
  summary: "List Credentials",
7346
7867
  query: {
7347
- workspaceId: { kind: "string", required: true },
7348
- type: { kind: "enum", values: ["oauth", "service_account"] },
7349
- providerId: { kind: "string" },
7350
- search: { kind: "string" },
7868
+ workspaceId: {
7869
+ kind: "string",
7870
+ required: true,
7871
+ describe: "Workspace whose credentials should be listed."
7872
+ },
7873
+ type: {
7874
+ kind: "enum",
7875
+ values: ["oauth", "service_account"],
7876
+ describe: "Restrict results to this credential type."
7877
+ },
7878
+ providerId: {
7879
+ kind: "string",
7880
+ describe: "Restrict results to credentials for this integration provider."
7881
+ },
7882
+ search: {
7883
+ kind: "string",
7884
+ describe: "Case-insensitive substring match against the credential display name."
7885
+ },
7351
7886
  sortBy: {
7352
7887
  kind: "enum",
7353
7888
  values: ["displayName", "createdAt", "updatedAt"],
7354
- default: "createdAt"
7889
+ default: "createdAt",
7890
+ describe: "Field used to sort the result."
7891
+ },
7892
+ sortOrder: {
7893
+ kind: "enum",
7894
+ values: ["asc", "desc"],
7895
+ default: "desc",
7896
+ describe: "Sort direction."
7897
+ },
7898
+ limit: {
7899
+ kind: "integer",
7900
+ default: 50,
7901
+ describe: "Maximum credentials to return per page. Must be a whole number from 1 to 100. Defaults to 50."
7355
7902
  },
7356
- sortOrder: { kind: "enum", values: ["asc", "desc"], default: "desc" },
7357
- limit: { kind: "integer", default: 50 },
7358
- cursor: { kind: "string" }
7903
+ cursor: {
7904
+ kind: "string",
7905
+ describe: "Opaque cursor from the previous page. Send it back with the same sort and filters; only `limit` may change. Change anything else and pagination must restart without a cursor."
7906
+ }
7359
7907
  }
7360
7908
  },
7361
7909
  listCustomTools: {
@@ -7365,16 +7913,36 @@ var V2_OPERATIONS = {
7365
7913
  responseMode: "json",
7366
7914
  summary: "List Custom Tools",
7367
7915
  query: {
7368
- workspaceId: { kind: "string", required: true },
7369
- search: { kind: "string" },
7916
+ workspaceId: {
7917
+ kind: "string",
7918
+ required: true,
7919
+ describe: "Workspace that owns the custom tool."
7920
+ },
7921
+ search: {
7922
+ kind: "string",
7923
+ describe: "Case-insensitive substring match against the tool title."
7924
+ },
7370
7925
  sortBy: {
7371
7926
  kind: "enum",
7372
7927
  values: ["title", "createdAt", "updatedAt"],
7373
- default: "createdAt"
7928
+ default: "createdAt",
7929
+ describe: "Field used to sort the result."
7930
+ },
7931
+ sortOrder: {
7932
+ kind: "enum",
7933
+ values: ["asc", "desc"],
7934
+ default: "desc",
7935
+ describe: "Sort direction."
7936
+ },
7937
+ limit: {
7938
+ kind: "integer",
7939
+ default: 50,
7940
+ describe: "Maximum custom tools to return per page. Must be a whole number from 1 to 100. Defaults to 50."
7374
7941
  },
7375
- sortOrder: { kind: "enum", values: ["asc", "desc"], default: "desc" },
7376
- limit: { kind: "integer", default: 50 },
7377
- cursor: { kind: "string" }
7942
+ cursor: {
7943
+ kind: "string",
7944
+ describe: "Opaque cursor from the previous page. Send it back with the same sort and filters; only `limit` may change. Change anything else and pagination must restart without a cursor."
7945
+ }
7378
7946
  }
7379
7947
  },
7380
7948
  listFileFolders: {
@@ -7384,15 +7952,31 @@ var V2_OPERATIONS = {
7384
7952
  responseMode: "json",
7385
7953
  summary: "List Folders",
7386
7954
  query: {
7387
- workspaceId: { kind: "string", required: true },
7388
- parentPath: { kind: "string" },
7389
- search: { kind: "string" },
7955
+ workspaceId: {
7956
+ kind: "string",
7957
+ required: true,
7958
+ describe: "Workspace whose folders should be listed."
7959
+ },
7960
+ parentPath: {
7961
+ kind: "string",
7962
+ describe: "Restrict results to direct children of this parent path."
7963
+ },
7964
+ search: {
7965
+ kind: "string",
7966
+ describe: "Case-insensitive substring match against the folder name."
7967
+ },
7390
7968
  sortBy: {
7391
7969
  kind: "enum",
7392
7970
  values: ["name", "createdAt", "updatedAt"],
7393
- default: "name"
7971
+ default: "name",
7972
+ describe: "Field used to sort the result. Sorting by `name` is case-sensitive and follows the storage collation, so do not rely on a case-insensitive order."
7394
7973
  },
7395
- sortOrder: { kind: "enum", values: ["asc", "desc"], default: "asc" }
7974
+ sortOrder: {
7975
+ kind: "enum",
7976
+ values: ["asc", "desc"],
7977
+ default: "asc",
7978
+ describe: "Sort direction."
7979
+ }
7396
7980
  }
7397
7981
  },
7398
7982
  listFiles: {
@@ -7402,18 +7986,46 @@ var V2_OPERATIONS = {
7402
7986
  responseMode: "json",
7403
7987
  summary: "List Files",
7404
7988
  query: {
7405
- workspaceId: { kind: "string", required: true },
7406
- folderPath: { kind: "string" },
7407
- scope: { kind: "enum", values: ["active", "archived"], default: "active" },
7408
- search: { kind: "string" },
7989
+ workspaceId: {
7990
+ kind: "string",
7991
+ required: true,
7992
+ describe: "Workspace whose files should be listed."
7993
+ },
7994
+ folderPath: {
7995
+ kind: "string",
7996
+ describe: "Restrict results to files directly inside this folder. A path that names no folder narrows the result to nothing, so the response is an empty page rather than an error."
7997
+ },
7998
+ scope: {
7999
+ kind: "enum",
8000
+ values: ["active", "archived"],
8001
+ default: "active",
8002
+ describe: "Which lifecycle set to list: `active` (default) for live files, `archived` for files a `DELETE` soft-deleted. `folderPath` resolves against active folders only, so pairing it with `scope=archived` returns an empty page when the containing folder was archived too."
8003
+ },
8004
+ search: {
8005
+ kind: "string",
8006
+ describe: "Case-insensitive substring match against the file name."
8007
+ },
7409
8008
  sortBy: {
7410
8009
  kind: "enum",
7411
8010
  values: ["name", "size", "uploadedAt", "updatedAt"],
7412
- default: "uploadedAt"
8011
+ default: "uploadedAt",
8012
+ describe: "Field used to sort the result. Sorting by `name` is case-sensitive and follows the storage collation, so do not rely on a case-insensitive order."
8013
+ },
8014
+ sortOrder: {
8015
+ kind: "enum",
8016
+ values: ["asc", "desc"],
8017
+ default: "asc",
8018
+ describe: "Sort direction."
8019
+ },
8020
+ limit: {
8021
+ kind: "integer",
8022
+ default: 100,
8023
+ describe: "Maximum files per page. Values outside 1–1000 are truncated and clamped into that range rather than rejected. Defaults to 100."
7413
8024
  },
7414
- sortOrder: { kind: "enum", values: ["asc", "desc"], default: "asc" },
7415
- limit: { kind: "integer", default: 100 },
7416
- cursor: { kind: "string" }
8025
+ cursor: {
8026
+ kind: "string",
8027
+ describe: "Opaque cursor from the previous page. Send it back with the same sort and filters; only `limit` may change. Change anything else and pagination must restart without a cursor."
8028
+ }
7417
8029
  }
7418
8030
  },
7419
8031
  listKnowledgeBases: {
@@ -7423,33 +8035,69 @@ var V2_OPERATIONS = {
7423
8035
  responseMode: "json",
7424
8036
  summary: "List Knowledge Bases",
7425
8037
  query: {
7426
- workspaceId: { kind: "string", required: true },
7427
- folderPath: { kind: "string" },
7428
- search: { kind: "string" },
8038
+ workspaceId: {
8039
+ kind: "string",
8040
+ required: true,
8041
+ describe: "Workspace whose knowledge bases should be listed."
8042
+ },
8043
+ folderPath: {
8044
+ kind: "string",
8045
+ describe: "Restrict results to knowledge bases in this folder. A path that names no folder narrows the result to nothing, so the response is an empty page rather than an error."
8046
+ },
8047
+ search: {
8048
+ kind: "string",
8049
+ describe: "Case-insensitive substring match against the resource name."
8050
+ },
7429
8051
  sortBy: {
7430
8052
  kind: "enum",
7431
8053
  values: ["name", "createdAt", "updatedAt"],
7432
- default: "createdAt"
8054
+ default: "createdAt",
8055
+ describe: "Field used to sort the result. Sorting by `name` is case-sensitive and follows the storage collation, so do not rely on a case-insensitive order."
8056
+ },
8057
+ sortOrder: {
8058
+ kind: "enum",
8059
+ values: ["asc", "desc"],
8060
+ default: "asc",
8061
+ describe: "Sort direction."
7433
8062
  },
7434
- sortOrder: { kind: "enum", values: ["asc", "desc"], default: "asc" },
7435
- limit: { kind: "integer", default: 50 },
7436
- cursor: { kind: "string" }
8063
+ limit: {
8064
+ kind: "integer",
8065
+ default: 50,
8066
+ describe: "Maximum knowledge bases to return per page. Must be a whole number from 1 to 100. Defaults to 50."
8067
+ },
8068
+ cursor: {
8069
+ kind: "string",
8070
+ describe: "Opaque cursor from the previous page. Send it back with the same sort and filters; only `limit` may change. Change anything else and pagination must restart without a cursor."
8071
+ }
7437
8072
  }
7438
8073
  },
7439
8074
  listKnowledgeDocuments: {
7440
8075
  method: "GET",
7441
8076
  path: "/api/v2/knowledge/[id]/documents",
7442
8077
  pathParams: ["id"],
8078
+ pathParamDocs: { id: "Unique knowledge base identifier." },
7443
8079
  responseMode: "json",
7444
8080
  summary: "List Documents",
7445
8081
  query: {
7446
- workspaceId: { kind: "string", required: true },
7447
- limit: { kind: "integer", default: 50 },
7448
- search: { kind: "string" },
8082
+ workspaceId: {
8083
+ kind: "string",
8084
+ required: true,
8085
+ describe: "Workspace that owns the knowledge base."
8086
+ },
8087
+ limit: {
8088
+ kind: "integer",
8089
+ default: 50,
8090
+ describe: "Maximum documents to return per page. Must be a whole number from 1 to 100. Defaults to 50."
8091
+ },
8092
+ search: {
8093
+ kind: "string",
8094
+ describe: "Case-insensitive substring match against the document filename."
8095
+ },
7449
8096
  enabledFilter: {
7450
8097
  kind: "enum",
7451
8098
  values: ["all", "enabled", "disabled"],
7452
- default: "all"
8099
+ default: "all",
8100
+ describe: "Filter by whether documents are enabled for search."
7453
8101
  },
7454
8102
  sortBy: {
7455
8103
  kind: "enum",
@@ -7462,11 +8110,23 @@ var V2_OPERATIONS = {
7462
8110
  "processingStatus",
7463
8111
  "enabled"
7464
8112
  ],
7465
- default: "uploadedAt"
8113
+ default: "uploadedAt",
8114
+ describe: "Field used to sort the result. Sorting by `filename` is case-sensitive and follows the storage collation, so do not rely on a case-insensitive order."
8115
+ },
8116
+ sortOrder: {
8117
+ kind: "enum",
8118
+ values: ["asc", "desc"],
8119
+ default: "desc",
8120
+ describe: "Sort direction."
8121
+ },
8122
+ cursor: {
8123
+ kind: "string",
8124
+ describe: "Opaque cursor from the previous page. Send it back with the same sort and filters; only `limit` may change. Change anything else and pagination must restart without a cursor."
7466
8125
  },
7467
- sortOrder: { kind: "enum", values: ["asc", "desc"], default: "desc" },
7468
- cursor: { kind: "string" },
7469
- tagFilters: { kind: "string" }
8126
+ tagFilters: {
8127
+ kind: "string",
8128
+ describe: 'A JSON-encoded array of at most 10 tag filters, using the same display-name shape as knowledge search: `[{"tagName":"category","operator":"eq","value":"billing"}]`. Every filter must hold, including two that name the same tag. A name that is not defined in this knowledge base is rejected, never ignored.'
8129
+ }
7470
8130
  }
7471
8131
  },
7472
8132
  listKnowledgeFolders: {
@@ -7476,25 +8136,46 @@ var V2_OPERATIONS = {
7476
8136
  responseMode: "json",
7477
8137
  summary: "List Folders",
7478
8138
  query: {
7479
- workspaceId: { kind: "string", required: true },
7480
- parentPath: { kind: "string" },
7481
- search: { kind: "string" },
8139
+ workspaceId: {
8140
+ kind: "string",
8141
+ required: true,
8142
+ describe: "Workspace whose folders should be listed."
8143
+ },
8144
+ parentPath: {
8145
+ kind: "string",
8146
+ describe: "Restrict results to direct children of this parent path."
8147
+ },
8148
+ search: {
8149
+ kind: "string",
8150
+ describe: "Case-insensitive substring match against the folder name."
8151
+ },
7482
8152
  sortBy: {
7483
8153
  kind: "enum",
7484
8154
  values: ["name", "createdAt", "updatedAt"],
7485
- default: "name"
8155
+ default: "name",
8156
+ describe: "Field used to sort the result. Sorting by `name` is case-sensitive and follows the storage collation, so do not rely on a case-insensitive order."
7486
8157
  },
7487
- sortOrder: { kind: "enum", values: ["asc", "desc"], default: "asc" }
8158
+ sortOrder: {
8159
+ kind: "enum",
8160
+ values: ["asc", "desc"],
8161
+ default: "asc",
8162
+ describe: "Sort direction."
8163
+ }
7488
8164
  }
7489
8165
  },
7490
8166
  listKnowledgeTags: {
7491
8167
  method: "GET",
7492
8168
  path: "/api/v2/knowledge/[id]/tags",
7493
8169
  pathParams: ["id"],
8170
+ pathParamDocs: { id: "Unique knowledge base identifier." },
7494
8171
  responseMode: "json",
7495
8172
  summary: "List Tags",
7496
8173
  query: {
7497
- workspaceId: { kind: "string", required: true }
8174
+ workspaceId: {
8175
+ kind: "string",
8176
+ required: true,
8177
+ describe: "Workspace that owns the knowledge base."
8178
+ }
7498
8179
  }
7499
8180
  },
7500
8181
  listLogs: {
@@ -7504,25 +8185,83 @@ var V2_OPERATIONS = {
7504
8185
  responseMode: "json",
7505
8186
  summary: "List Logs",
7506
8187
  query: {
7507
- workspaceId: { kind: "string", required: true },
7508
- workflowIds: { kind: "string" },
7509
- triggers: { kind: "string" },
7510
- level: { kind: "enum", values: ["info", "error"] },
7511
- startDate: { kind: "string" },
7512
- endDate: { kind: "string" },
7513
- minDurationMs: { kind: "integer" },
7514
- maxDurationMs: { kind: "integer" },
7515
- minCost: { kind: "number" },
7516
- maxCost: { kind: "number" },
7517
- model: { kind: "string" },
7518
- details: { kind: "enum", values: ["basic", "full"], default: "basic" },
7519
- includeTraceSpans: { kind: "boolean" },
7520
- includeFinalOutput: { kind: "boolean" },
7521
- limit: { kind: "integer", default: 100 },
7522
- cursor: { kind: "string" },
7523
- order: { kind: "enum", values: ["asc", "desc"], default: "desc" },
7524
- runId: { kind: "string" },
7525
- folderPaths: { kind: "string" }
8188
+ workspaceId: {
8189
+ kind: "string",
8190
+ required: true,
8191
+ describe: "Workspace whose execution logs should be returned."
8192
+ },
8193
+ workflowIds: {
8194
+ kind: "string",
8195
+ describe: "Comma-separated workflow identifiers to include. An empty entry is rejected."
8196
+ },
8197
+ triggers: {
8198
+ kind: "string",
8199
+ describe: "Comma-separated trigger types to include. An empty entry is rejected. Values are matched exactly and are case-sensitive — every recorded trigger is lowercase, so `API` matches nothing while `api` matches. The vocabulary is open: it covers the core trigger types (`manual`, `api`, `schedule`, `chat`, `webhook`, `mcp`, `copilot`, `workflow`, `custom_block`) and the provider id of any webhook trigger (`slack`, `gmail`, `github`, …), so an unrecognized member is not rejected — it selects no runs. The literal value `all` is a sentinel that disables this filter entirely, so a list containing it returns runs of every trigger type; no real trigger type is named `all`."
8200
+ },
8201
+ level: {
8202
+ kind: "enum",
8203
+ values: ["info", "error"],
8204
+ describe: "Severity level to include."
8205
+ },
8206
+ startDate: {
8207
+ kind: "string",
8208
+ describe: "Only include runs started at or after this UTC ISO 8601 timestamp, e.g. `2026-08-06T00:00:00Z`. A date without a time, or a timestamp carrying a UTC offset instead of `Z`, is rejected, as is year `0000`, which names no storable instant."
8209
+ },
8210
+ endDate: {
8211
+ kind: "string",
8212
+ describe: "Only include runs started at or before this UTC ISO 8601 timestamp, e.g. `2026-08-06T00:00:00Z`. A date without a time, or a timestamp carrying a UTC offset instead of `Z`, is rejected, as is year `0000`, which names no storable instant."
8213
+ },
8214
+ minDurationMs: {
8215
+ kind: "integer",
8216
+ describe: "Minimum total execution duration in milliseconds. Whole milliseconds from 0 to 2147483647; the stored duration is a 32-bit integer, so a fractional or out-of-range bound is rejected."
8217
+ },
8218
+ maxDurationMs: {
8219
+ kind: "integer",
8220
+ describe: "Maximum total execution duration in milliseconds. Whole milliseconds from 0 to 2147483647; the stored duration is a 32-bit integer, so a fractional or out-of-range bound is rejected."
8221
+ },
8222
+ minCost: {
8223
+ kind: "number",
8224
+ describe: "Minimum execution cost in USD, from 0 to 1000000. A run is never charged a negative amount, so a negative bound is rejected rather than treated as a filter that matches every run."
8225
+ },
8226
+ maxCost: {
8227
+ kind: "number",
8228
+ describe: "Maximum execution cost in USD, from 0 to 1000000. A run is never charged a negative amount, so a negative bound is rejected rather than treated as a filter that matches every run."
8229
+ },
8230
+ model: { kind: "string", describe: "AI model used during execution." },
8231
+ details: {
8232
+ kind: "enum",
8233
+ values: ["basic", "full"],
8234
+ default: "basic",
8235
+ describe: "Response detail level. `full` adds the `workflow` summary to every item. `includeTraceSpans=true` and `includeFinalOutput=true` each imply `full`, so either one adds `workflow` even when `details=basic` is sent explicitly."
8236
+ },
8237
+ includeTraceSpans: {
8238
+ kind: "boolean",
8239
+ describe: "Whether to include block-level trace spans. Implies `details=full`. Spans are pruned on their own retention schedule, so a run whose spans have aged out returns `traceSpans: []` rather than an error."
8240
+ },
8241
+ includeFinalOutput: {
8242
+ kind: "boolean",
8243
+ describe: "Whether to include the final workflow output. Implies `details=full`, so the `workflow` summary is present regardless of what `details` is set to."
8244
+ },
8245
+ limit: {
8246
+ kind: "integer",
8247
+ default: 100,
8248
+ describe: "Maximum log entries per page. Values outside 1–1000 are truncated and clamped into that range rather than rejected. Defaults to 100."
8249
+ },
8250
+ cursor: {
8251
+ kind: "string",
8252
+ describe: "Opaque cursor from the previous page. Send it back with the same sort and filters; only `limit` may change. Change anything else and pagination must restart without a cursor."
8253
+ },
8254
+ order: {
8255
+ kind: "enum",
8256
+ values: ["asc", "desc"],
8257
+ default: "desc",
8258
+ describe: "Sort direction by execution start time. This list is sortable only by execution start time, so it takes `order` in place of `sortBy`/`sortOrder`, which it rejects."
8259
+ },
8260
+ runId: { kind: "string", describe: "Exact run identifier to match." },
8261
+ folderPaths: {
8262
+ kind: "string",
8263
+ describe: "Comma-separated workflow folder paths to include. A path that names no folder narrows the result to nothing, so the response is an empty page rather than an error."
8264
+ }
7526
8265
  }
7527
8266
  },
7528
8267
  listMcpServers: {
@@ -7532,27 +8271,55 @@ var V2_OPERATIONS = {
7532
8271
  responseMode: "json",
7533
8272
  summary: "List MCP Servers",
7534
8273
  query: {
7535
- workspaceId: { kind: "string", required: true },
7536
- search: { kind: "string" },
8274
+ workspaceId: {
8275
+ kind: "string",
8276
+ required: true,
8277
+ describe: "Workspace that owns the MCP server."
8278
+ },
8279
+ search: {
8280
+ kind: "string",
8281
+ describe: "Case-insensitive substring match against the server name."
8282
+ },
7537
8283
  sortBy: {
7538
8284
  kind: "enum",
7539
8285
  values: ["name", "createdAt", "updatedAt"],
7540
- default: "createdAt"
8286
+ default: "createdAt",
8287
+ describe: "Field used to sort the result. Sorting by `name` is case-sensitive and follows the storage collation, so do not rely on a case-insensitive order."
7541
8288
  },
7542
- sortOrder: { kind: "enum", values: ["asc", "desc"], default: "desc" },
7543
- limit: { kind: "integer", default: 50 },
7544
- cursor: { kind: "string" }
8289
+ sortOrder: {
8290
+ kind: "enum",
8291
+ values: ["asc", "desc"],
8292
+ default: "desc",
8293
+ describe: "Sort direction."
8294
+ },
8295
+ limit: {
8296
+ kind: "integer",
8297
+ default: 50,
8298
+ describe: "Maximum MCP servers to return per page. Must be a whole number from 1 to 100. Defaults to 50."
8299
+ },
8300
+ cursor: {
8301
+ kind: "string",
8302
+ describe: "Opaque cursor from the previous page. Send it back with the same sort and filters; only `limit` may change. Change anything else and pagination must restart without a cursor."
8303
+ }
7545
8304
  }
7546
8305
  },
7547
8306
  listMcpServerTools: {
7548
8307
  method: "GET",
7549
8308
  path: "/api/v2/mcp-servers/[id]/tools",
7550
8309
  pathParams: ["id"],
8310
+ pathParamDocs: { id: "Unique MCP server identifier." },
7551
8311
  responseMode: "json",
7552
8312
  summary: "List MCP Server Tools",
7553
8313
  query: {
7554
- workspaceId: { kind: "string", required: true },
7555
- refresh: { kind: "boolean" }
8314
+ workspaceId: {
8315
+ kind: "string",
8316
+ required: true,
8317
+ describe: "Workspace that owns the MCP server."
8318
+ },
8319
+ refresh: {
8320
+ kind: "boolean",
8321
+ describe: "Bypass the short-lived per-workspace tool cache and reconnect under your own credentials. A cached result reflects whichever workspace member last ran discovery, so this is the only way to pick up a tool added since then; it costs a live round trip."
8322
+ }
7556
8323
  }
7557
8324
  },
7558
8325
  listSecrets: {
@@ -7562,17 +8329,41 @@ var V2_OPERATIONS = {
7562
8329
  responseMode: "json",
7563
8330
  summary: "List Secrets",
7564
8331
  query: {
7565
- workspaceId: { kind: "string", required: true },
7566
- scope: { kind: "enum", values: ["workspace", "personal"] },
7567
- search: { kind: "string" },
8332
+ workspaceId: {
8333
+ kind: "string",
8334
+ required: true,
8335
+ describe: "Workspace whose secret metadata should be listed."
8336
+ },
8337
+ scope: {
8338
+ kind: "enum",
8339
+ values: ["workspace", "personal"],
8340
+ describe: "Restrict results to one ownership scope."
8341
+ },
8342
+ search: {
8343
+ kind: "string",
8344
+ describe: "Case-insensitive substring match against the secret name."
8345
+ },
7568
8346
  sortBy: {
7569
8347
  kind: "enum",
7570
8348
  values: ["name", "createdAt", "updatedAt"],
7571
- default: "name"
8349
+ default: "name",
8350
+ describe: "Field used to sort the result. Sorting by `name` is case-sensitive and follows the storage collation, so do not rely on a case-insensitive order."
8351
+ },
8352
+ sortOrder: {
8353
+ kind: "enum",
8354
+ values: ["asc", "desc"],
8355
+ default: "asc",
8356
+ describe: "Sort direction."
7572
8357
  },
7573
- sortOrder: { kind: "enum", values: ["asc", "desc"], default: "asc" },
7574
- limit: { kind: "integer", default: 50 },
7575
- cursor: { kind: "string" }
8358
+ limit: {
8359
+ kind: "integer",
8360
+ default: 50,
8361
+ describe: "Maximum secrets to return per page. Must be a whole number from 1 to 100. Defaults to 50."
8362
+ },
8363
+ cursor: {
8364
+ kind: "string",
8365
+ describe: "Opaque cursor from the previous page. Send it back with the same sort and filters; only `limit` may change. Change anything else and pagination must restart without a cursor."
8366
+ }
7576
8367
  }
7577
8368
  },
7578
8369
  listSkills: {
@@ -7582,16 +8373,32 @@ var V2_OPERATIONS = {
7582
8373
  responseMode: "json",
7583
8374
  summary: "List Skills",
7584
8375
  query: {
7585
- workspaceId: { kind: "string", required: true },
7586
- search: { kind: "string" },
8376
+ workspaceId: { kind: "string", required: true, describe: "Workspace that owns the skill." },
8377
+ search: {
8378
+ kind: "string",
8379
+ describe: "Case-insensitive substring match against the skill name."
8380
+ },
7587
8381
  sortBy: {
7588
8382
  kind: "enum",
7589
8383
  values: ["name", "createdAt", "updatedAt"],
7590
- default: "createdAt"
8384
+ default: "createdAt",
8385
+ describe: "Field used to sort the result. Sorting by `name` is case-sensitive and follows the storage collation, so do not rely on a case-insensitive order."
8386
+ },
8387
+ sortOrder: {
8388
+ kind: "enum",
8389
+ values: ["asc", "desc"],
8390
+ default: "desc",
8391
+ describe: "Sort direction."
8392
+ },
8393
+ limit: {
8394
+ kind: "integer",
8395
+ default: 50,
8396
+ describe: "Maximum skills to return per page. Must be a whole number from 1 to 100. Defaults to 50."
7591
8397
  },
7592
- sortOrder: { kind: "enum", values: ["asc", "desc"], default: "desc" },
7593
- limit: { kind: "integer", default: 50 },
7594
- cursor: { kind: "string" }
8398
+ cursor: {
8399
+ kind: "string",
8400
+ describe: "Opaque cursor from the previous page. Send it back with the same sort and filters; only `limit` may change. Change anything else and pagination must restart without a cursor."
8401
+ }
7595
8402
  }
7596
8403
  },
7597
8404
  listTableFolders: {
@@ -7601,27 +8408,51 @@ var V2_OPERATIONS = {
7601
8408
  responseMode: "json",
7602
8409
  summary: "List Folders",
7603
8410
  query: {
7604
- workspaceId: { kind: "string", required: true },
7605
- parentPath: { kind: "string" },
7606
- search: { kind: "string" },
8411
+ workspaceId: {
8412
+ kind: "string",
8413
+ required: true,
8414
+ describe: "Workspace whose folders should be listed."
8415
+ },
8416
+ parentPath: {
8417
+ kind: "string",
8418
+ describe: "Restrict results to direct children of this parent path."
8419
+ },
8420
+ search: {
8421
+ kind: "string",
8422
+ describe: "Case-insensitive substring match against the folder name."
8423
+ },
7607
8424
  sortBy: {
7608
8425
  kind: "enum",
7609
8426
  values: ["name", "createdAt", "updatedAt"],
7610
- default: "name"
8427
+ default: "name",
8428
+ describe: "Field used to sort the result. Sorting by `name` is case-sensitive and follows the storage collation, so do not rely on a case-insensitive order."
7611
8429
  },
7612
- sortOrder: { kind: "enum", values: ["asc", "desc"], default: "asc" }
8430
+ sortOrder: {
8431
+ kind: "enum",
8432
+ values: ["asc", "desc"],
8433
+ default: "asc",
8434
+ describe: "Sort direction."
8435
+ }
7613
8436
  }
7614
8437
  },
7615
8438
  listTableRows: {
7616
8439
  method: "GET",
7617
8440
  path: "/api/v2/tables/[tableId]/rows",
7618
8441
  pathParams: ["tableId"],
8442
+ pathParamDocs: { tableId: "Unique table identifier." },
7619
8443
  responseMode: "json",
7620
8444
  summary: "List Rows",
7621
8445
  query: {
7622
- workspaceId: { kind: "string", required: true },
7623
- limit: { kind: "integer", default: 100 },
7624
- cursor: { kind: "string" }
8446
+ workspaceId: { kind: "string", required: true, describe: "Workspace that owns the table." },
8447
+ limit: {
8448
+ kind: "integer",
8449
+ default: 100,
8450
+ describe: "Maximum rows to return per page. Must be a whole number from 1 to 1000. Defaults to 100."
8451
+ },
8452
+ cursor: {
8453
+ kind: "string",
8454
+ describe: "Opaque cursor from the previous page. Send it back with the same sort and filters; only `limit` may change. Change anything else and pagination must restart without a cursor."
8455
+ }
7625
8456
  }
7626
8457
  },
7627
8458
  listTables: {
@@ -7631,27 +8462,51 @@ var V2_OPERATIONS = {
7631
8462
  responseMode: "json",
7632
8463
  summary: "List Tables",
7633
8464
  query: {
7634
- workspaceId: { kind: "string", required: true },
7635
- folderPath: { kind: "string" },
7636
- search: { kind: "string" },
8465
+ workspaceId: {
8466
+ kind: "string",
8467
+ required: true,
8468
+ describe: "Workspace whose tables should be listed."
8469
+ },
8470
+ folderPath: {
8471
+ kind: "string",
8472
+ describe: "Restrict results to tables in this folder. A path that names no folder narrows the result to nothing, so the response is an empty page rather than an error."
8473
+ },
8474
+ search: {
8475
+ kind: "string",
8476
+ describe: "Case-insensitive substring match against the resource name."
8477
+ },
7637
8478
  sortBy: {
7638
8479
  kind: "enum",
7639
8480
  values: ["name", "createdAt", "updatedAt"],
7640
- default: "createdAt"
8481
+ default: "createdAt",
8482
+ describe: "Field used to sort the result. Sorting by `name` is case-sensitive and follows the storage collation, so do not rely on a case-insensitive order."
8483
+ },
8484
+ sortOrder: {
8485
+ kind: "enum",
8486
+ values: ["asc", "desc"],
8487
+ default: "asc",
8488
+ describe: "Sort direction."
8489
+ },
8490
+ limit: {
8491
+ kind: "integer",
8492
+ default: 100,
8493
+ describe: "Maximum tables to return per page. Values outside 1–1000 are truncated and clamped into that range rather than rejected. Defaults to 100."
7641
8494
  },
7642
- sortOrder: { kind: "enum", values: ["asc", "desc"], default: "asc" },
7643
- limit: { kind: "integer", default: 100 },
7644
- cursor: { kind: "string" }
8495
+ cursor: {
8496
+ kind: "string",
8497
+ describe: "Opaque cursor from the previous page. Send it back with the same sort and filters; only `limit` may change. Change anything else and pagination must restart without a cursor."
8498
+ }
7645
8499
  }
7646
8500
  },
7647
8501
  listTableViews: {
7648
8502
  method: "GET",
7649
8503
  path: "/api/v2/tables/[tableId]/views",
7650
8504
  pathParams: ["tableId"],
8505
+ pathParamDocs: { tableId: "Unique table identifier." },
7651
8506
  responseMode: "json",
7652
8507
  summary: "List Views",
7653
8508
  query: {
7654
- workspaceId: { kind: "string", required: true }
8509
+ workspaceId: { kind: "string", required: true, describe: "Workspace that owns the table." }
7655
8510
  }
7656
8511
  },
7657
8512
  listWorkflowFolders: {
@@ -7661,44 +8516,81 @@ var V2_OPERATIONS = {
7661
8516
  responseMode: "json",
7662
8517
  summary: "List Workflow Folders",
7663
8518
  query: {
7664
- workspaceId: { kind: "string", required: true },
7665
- parentPath: { kind: "string" },
7666
- search: { kind: "string" },
8519
+ workspaceId: {
8520
+ kind: "string",
8521
+ required: true,
8522
+ describe: "Workspace whose folders should be listed."
8523
+ },
8524
+ parentPath: {
8525
+ kind: "string",
8526
+ describe: "Restrict results to direct children of this parent path."
8527
+ },
8528
+ search: {
8529
+ kind: "string",
8530
+ describe: "Case-insensitive substring match against the folder name."
8531
+ },
7667
8532
  sortBy: {
7668
8533
  kind: "enum",
7669
8534
  values: ["name", "createdAt", "updatedAt"],
7670
- default: "name"
8535
+ default: "name",
8536
+ describe: "Field used to sort the result. Sorting by `name` is case-sensitive and follows the storage collation, so do not rely on a case-insensitive order."
7671
8537
  },
7672
- sortOrder: { kind: "enum", values: ["asc", "desc"], default: "asc" }
8538
+ sortOrder: {
8539
+ kind: "enum",
8540
+ values: ["asc", "desc"],
8541
+ default: "asc",
8542
+ describe: "Sort direction."
8543
+ }
7673
8544
  }
7674
8545
  },
7675
8546
  listWorkflowGroups: {
7676
8547
  method: "GET",
7677
8548
  path: "/api/v2/tables/[tableId]/groups",
7678
8549
  pathParams: ["tableId"],
8550
+ pathParamDocs: { tableId: "Unique table identifier." },
7679
8551
  responseMode: "json",
7680
8552
  summary: "List Workflow Groups",
7681
8553
  query: {
7682
- workspaceId: { kind: "string", required: true }
8554
+ workspaceId: { kind: "string", required: true, describe: "Workspace that owns the table." }
7683
8555
  }
7684
8556
  },
7685
8557
  listWorkflowRuns: {
7686
8558
  method: "GET",
7687
8559
  path: "/api/v2/workflows/[id]/runs",
7688
8560
  pathParams: ["id"],
8561
+ pathParamDocs: { id: "Unique workflow identifier." },
7689
8562
  responseMode: "json",
7690
8563
  summary: "List Workflow Runs",
7691
8564
  query: {
7692
8565
  status: {
7693
8566
  kind: "enum",
7694
- values: ["pending", "running", "completed", "failed", "cancelled", "paused"]
8567
+ values: ["pending", "running", "completed", "failed", "cancelled", "paused"],
8568
+ describe: "Filter by run status."
8569
+ },
8570
+ trigger: { kind: "string", describe: "Filter by trigger type." },
8571
+ startDate: {
8572
+ kind: "string",
8573
+ describe: "Only include runs started at or after this UTC ISO 8601 timestamp, e.g. `2026-08-06T00:00:00Z`. A date without a time, or a timestamp carrying a UTC offset instead of `Z`, is rejected, as is year `0000`, which names no storable instant."
8574
+ },
8575
+ endDate: {
8576
+ kind: "string",
8577
+ describe: "Only include runs started at or before this UTC ISO 8601 timestamp, e.g. `2026-08-06T00:00:00Z`. A date without a time, or a timestamp carrying a UTC offset instead of `Z`, is rejected, as is year `0000`, which names no storable instant."
7695
8578
  },
7696
- trigger: { kind: "string" },
7697
- startDate: { kind: "string" },
7698
- endDate: { kind: "string" },
7699
- limit: { kind: "integer", default: 50 },
7700
- cursor: { kind: "string" },
7701
- order: { kind: "enum", values: ["asc", "desc"], default: "desc" }
8579
+ limit: {
8580
+ kind: "integer",
8581
+ default: 50,
8582
+ describe: "Maximum workflow runs to return per page. Must be a whole number from 1 to 100. Defaults to 50."
8583
+ },
8584
+ cursor: {
8585
+ kind: "string",
8586
+ describe: "Opaque cursor from the previous page. Send it back with the same sort and filters; only `limit` may change. Change anything else and pagination must restart without a cursor."
8587
+ },
8588
+ order: {
8589
+ kind: "enum",
8590
+ values: ["asc", "desc"],
8591
+ default: "desc",
8592
+ describe: "Sort direction by run start time. This list is sortable only by run start time, so it takes `order` in place of `sortBy`/`sortOrder`, which it rejects."
8593
+ }
7702
8594
  }
7703
8595
  },
7704
8596
  listWorkflows: {
@@ -7708,40 +8600,82 @@ var V2_OPERATIONS = {
7708
8600
  responseMode: "json",
7709
8601
  summary: "List Workflows",
7710
8602
  query: {
7711
- workspaceId: { kind: "string", required: true },
7712
- folderPath: { kind: "string" },
7713
- deployedOnly: { kind: "boolean" },
7714
- limit: { kind: "integer", default: 50 },
7715
- cursor: { kind: "string" },
7716
- search: { kind: "string" },
8603
+ workspaceId: {
8604
+ kind: "string",
8605
+ required: true,
8606
+ describe: "Workspace whose workflows should be listed."
8607
+ },
8608
+ folderPath: {
8609
+ kind: "string",
8610
+ describe: "Restrict results to workflows in this folder path. A path that names no folder narrows the result to nothing, so the response is an empty page rather than an error."
8611
+ },
8612
+ deployedOnly: {
8613
+ kind: "boolean",
8614
+ describe: "Return only workflows with an active deployment when true."
8615
+ },
8616
+ limit: {
8617
+ kind: "integer",
8618
+ default: 50,
8619
+ describe: "Maximum workflows to return per page. Must be a whole number from 1 to 100. Defaults to 50."
8620
+ },
8621
+ cursor: {
8622
+ kind: "string",
8623
+ describe: "Opaque cursor from the previous page. Send it back with the same sort and filters; only `limit` may change. Change anything else and pagination must restart without a cursor."
8624
+ },
8625
+ search: {
8626
+ kind: "string",
8627
+ describe: "Case-insensitive substring match against the resource name."
8628
+ },
7717
8629
  sortBy: {
7718
8630
  kind: "enum",
7719
8631
  values: ["position", "name", "createdAt", "updatedAt", "runCount"],
7720
- default: "position"
8632
+ default: "position",
8633
+ describe: "Field used to sort the result. Sorting by `name` is case-sensitive and follows the storage collation, so do not rely on a case-insensitive order."
7721
8634
  },
7722
- sortOrder: { kind: "enum", values: ["asc", "desc"], default: "asc" }
8635
+ sortOrder: {
8636
+ kind: "enum",
8637
+ values: ["asc", "desc"],
8638
+ default: "asc",
8639
+ describe: "Sort direction."
8640
+ }
7723
8641
  }
7724
8642
  },
7725
8643
  listWorkflowVersions: {
7726
8644
  method: "GET",
7727
8645
  path: "/api/v2/workflows/[id]/versions",
7728
8646
  pathParams: ["id"],
8647
+ pathParamDocs: { id: "Unique workflow identifier." },
7729
8648
  responseMode: "json",
7730
8649
  summary: "List Workflow Versions",
7731
8650
  query: {
7732
- limit: { kind: "integer", default: 50 },
7733
- cursor: { kind: "string" }
8651
+ limit: {
8652
+ kind: "integer",
8653
+ default: 50,
8654
+ describe: "Maximum deployment versions to return per page. Must be a whole number from 1 to 100. Defaults to 50."
8655
+ },
8656
+ cursor: {
8657
+ kind: "string",
8658
+ describe: "Opaque cursor from the previous page. Send it back with the same sort and filters; only `limit` may change. Change anything else and pagination must restart without a cursor."
8659
+ }
7734
8660
  }
7735
8661
  },
7736
8662
  listWorkspaceMembers: {
7737
8663
  method: "GET",
7738
8664
  path: "/api/v2/workspaces/[workspaceId]/members",
7739
8665
  pathParams: ["workspaceId"],
8666
+ pathParamDocs: { workspaceId: "Workspace to retrieve." },
7740
8667
  responseMode: "json",
7741
8668
  summary: "List Workspace Members",
7742
8669
  query: {
7743
- limit: { kind: "integer", default: 50 },
7744
- cursor: { kind: "string" }
8670
+ limit: {
8671
+ kind: "integer",
8672
+ default: 50,
8673
+ describe: "Maximum members to return per page. Must be a whole number from 1 to 100. Defaults to 50."
8674
+ },
8675
+ cursor: {
8676
+ kind: "string",
8677
+ describe: "Opaque cursor from the previous page. Send it back with the same sort and filters; only `limit` may change. Change anything else and pagination must restart without a cursor."
8678
+ }
7745
8679
  }
7746
8680
  },
7747
8681
  moveFileItems: {
@@ -7751,34 +8685,48 @@ var V2_OPERATIONS = {
7751
8685
  responseMode: "json",
7752
8686
  summary: "Move Files",
7753
8687
  body: {
7754
- workspaceId: { kind: "string", required: true },
7755
- fileIds: { kind: "array", required: true },
7756
- targetFolderPath: { kind: "string" }
8688
+ workspaceId: { kind: "string", required: true, describe: "Workspace containing the files." },
8689
+ fileIds: { kind: "array", required: true, describe: "File identifiers to update." },
8690
+ targetFolderPath: {
8691
+ kind: "string",
8692
+ describe: "Destination folder path. Omit to move files to the workspace root."
8693
+ }
7757
8694
  }
7758
8695
  },
7759
8696
  queryRows: {
7760
8697
  method: "POST",
7761
8698
  path: "/api/v2/tables/[tableId]/query",
7762
8699
  pathParams: ["tableId"],
8700
+ pathParamDocs: { tableId: "Unique table identifier." },
7763
8701
  responseMode: "json",
7764
8702
  summary: "Query Rows",
7765
8703
  body: {
7766
- workspaceId: { kind: "string", required: true },
7767
- predicate: { kind: "unknown" },
7768
- sort: { kind: "array" },
7769
- limit: { kind: "integer" },
7770
- cursor: { kind: "string" }
8704
+ workspaceId: { kind: "string", required: true, describe: "Unique workspace identifier." },
8705
+ predicate: {
8706
+ kind: "unknown",
8707
+ describe: 'Recursive predicate tree. Each group node is exactly one non-empty `all` or `any` array whose members are further groups or `{ field, op, value }` conditions; the root must be a group, not a bare condition. At most 100 members per group, 10 levels of nesting, and 500 nodes in total. The negating operators include nulls: `ne`, `nin`, `ncontains`, `nlike`, and `nilike` match rows whose column is null or absent, so "not X" is not the complement of "X" over a nullable column. That holds for every column type, multi-select included. To exclude nulls, `all`-combine the negation with `isNotEmpty` (multi-select) or `isNotNull`. Comparison: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`. Membership: `in`, `nin` (array operand). Emptiness: `isEmpty`, `isNotEmpty`, `isNull`, `isNotNull` (no operand). Substring, always case-insensitive, operand matched literally: `contains`, `ncontains`, `startsWith`, `endsWith`. Pattern: `like`/`nlike` (case-sensitive), `ilike`/`nilike` (case-insensitive). **`*` is the only wildcard** and stands for any run of characters; `%`, `_`, and backslash match themselves. Use `like: "Hi*"`, not `like: "Hi%"`. A `select` column compares by option id and restricts its operators: single-select accepts `eq`, `ne`, `in`, `nin`; multi-select accepts `contains`, `ncontains`. Option names are accepted as operands and resolved to ids.'
8708
+ },
8709
+ sort: { kind: "array", describe: "Ordered table-row sort specification." },
8710
+ limit: {
8711
+ kind: "integer",
8712
+ describe: "Maximum rows to return; zero requests an unbounded result."
8713
+ },
8714
+ cursor: { kind: "string", describe: "Opaque cursor returned by the previous query page." }
7771
8715
  }
7772
8716
  },
7773
8717
  queryRowsCount: {
7774
8718
  method: "POST",
7775
8719
  path: "/api/v2/tables/[tableId]/query/count",
7776
8720
  pathParams: ["tableId"],
8721
+ pathParamDocs: { tableId: "Unique table identifier." },
7777
8722
  responseMode: "json",
7778
8723
  summary: "Count Rows",
7779
8724
  body: {
7780
- workspaceId: { kind: "string", required: true },
7781
- predicate: { kind: "unknown" }
8725
+ workspaceId: { kind: "string", required: true, describe: "Unique workspace identifier." },
8726
+ predicate: {
8727
+ kind: "unknown",
8728
+ describe: 'Recursive predicate tree. Each group node is exactly one non-empty `all` or `any` array whose members are further groups or `{ field, op, value }` conditions; the root must be a group, not a bare condition. At most 100 members per group, 10 levels of nesting, and 500 nodes in total. The negating operators include nulls: `ne`, `nin`, `ncontains`, `nlike`, and `nilike` match rows whose column is null or absent, so "not X" is not the complement of "X" over a nullable column. That holds for every column type, multi-select included. To exclude nulls, `all`-combine the negation with `isNotEmpty` (multi-select) or `isNotNull`. Comparison: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`. Membership: `in`, `nin` (array operand). Emptiness: `isEmpty`, `isNotEmpty`, `isNull`, `isNotNull` (no operand). Substring, always case-insensitive, operand matched literally: `contains`, `ncontains`, `startsWith`, `endsWith`. Pattern: `like`/`nlike` (case-sensitive), `ilike`/`nilike` (case-insensitive). **`*` is the only wildcard** and stands for any run of characters; `%`, `_`, and backslash match themselves. Use `like: "Hi*"`, not `like: "Hi%"`. A `select` column compares by option id and restricts its operators: single-select accepts `eq`, `ne`, `in`, `nin`; multi-select accepts `contains`, `ncontains`. Option names are accepted as operands and resolved to ids.'
8729
+ }
7782
8730
  }
7783
8731
  },
7784
8732
  relocateFileFolder: {
@@ -7788,9 +8736,13 @@ var V2_OPERATIONS = {
7788
8736
  responseMode: "json",
7789
8737
  summary: "Rename or Move Folder",
7790
8738
  body: {
7791
- workspaceId: { kind: "string", required: true },
7792
- path: { kind: "string", required: true },
7793
- destinationPath: { kind: "string", required: true }
8739
+ workspaceId: { kind: "string", required: true, describe: "Workspace containing the folder." },
8740
+ path: { kind: "string", required: true, describe: "Current folder path." },
8741
+ destinationPath: {
8742
+ kind: "string",
8743
+ required: true,
8744
+ describe: "New full path for the folder and its descendants."
8745
+ }
7794
8746
  }
7795
8747
  },
7796
8748
  relocateKnowledgeFolder: {
@@ -7800,9 +8752,13 @@ var V2_OPERATIONS = {
7800
8752
  responseMode: "json",
7801
8753
  summary: "Rename or Move Folder",
7802
8754
  body: {
7803
- workspaceId: { kind: "string", required: true },
7804
- path: { kind: "string", required: true },
7805
- destinationPath: { kind: "string", required: true }
8755
+ workspaceId: { kind: "string", required: true, describe: "Workspace containing the folder." },
8756
+ path: { kind: "string", required: true, describe: "Current folder path." },
8757
+ destinationPath: {
8758
+ kind: "string",
8759
+ required: true,
8760
+ describe: "New full path for the folder and its descendants."
8761
+ }
7806
8762
  }
7807
8763
  },
7808
8764
  relocateTableFolder: {
@@ -7812,9 +8768,13 @@ var V2_OPERATIONS = {
7812
8768
  responseMode: "json",
7813
8769
  summary: "Rename or Move Folder",
7814
8770
  body: {
7815
- workspaceId: { kind: "string", required: true },
7816
- path: { kind: "string", required: true },
7817
- destinationPath: { kind: "string", required: true }
8771
+ workspaceId: { kind: "string", required: true, describe: "Workspace containing the folder." },
8772
+ path: { kind: "string", required: true, describe: "Current folder path." },
8773
+ destinationPath: {
8774
+ kind: "string",
8775
+ required: true,
8776
+ describe: "New full path for the folder and its descendants."
8777
+ }
7818
8778
  }
7819
8779
  },
7820
8780
  relocateWorkflowFolder: {
@@ -7824,77 +8784,114 @@ var V2_OPERATIONS = {
7824
8784
  responseMode: "json",
7825
8785
  summary: "Rename or Move Workflow Folder",
7826
8786
  body: {
7827
- workspaceId: { kind: "string", required: true },
7828
- path: { kind: "string", required: true },
7829
- destinationPath: { kind: "string", required: true }
8787
+ workspaceId: { kind: "string", required: true, describe: "Workspace containing the folder." },
8788
+ path: { kind: "string", required: true, describe: "Current folder path." },
8789
+ destinationPath: {
8790
+ kind: "string",
8791
+ required: true,
8792
+ describe: "New full path for the folder and its descendants."
8793
+ }
7830
8794
  }
7831
8795
  },
7832
8796
  renameFile: {
7833
8797
  method: "PATCH",
7834
8798
  path: "/api/v2/files/[fileId]",
7835
8799
  pathParams: ["fileId"],
8800
+ pathParamDocs: { fileId: "File identifier." },
7836
8801
  responseMode: "json",
7837
8802
  summary: "Rename File",
7838
8803
  body: {
7839
- workspaceId: { kind: "string", required: true },
7840
- name: { kind: "string", required: true }
8804
+ workspaceId: { kind: "string", required: true, describe: "Workspace that owns the file." },
8805
+ name: { kind: "string", required: true, describe: "New file name, including its extension." }
7841
8806
  }
7842
8807
  },
7843
8808
  restoreFile: {
7844
8809
  method: "POST",
7845
8810
  path: "/api/v2/files/[fileId]/restore",
7846
8811
  pathParams: ["fileId"],
8812
+ pathParamDocs: { fileId: "File identifier." },
7847
8813
  responseMode: "json",
7848
8814
  summary: "Restore File",
7849
8815
  body: {
7850
- workspaceId: { kind: "string", required: true }
8816
+ workspaceId: {
8817
+ kind: "string",
8818
+ required: true,
8819
+ describe: "Workspace that owns the archived file."
8820
+ }
7851
8821
  }
7852
8822
  },
7853
8823
  resumeWorkflow: {
7854
8824
  method: "POST",
7855
8825
  path: "/api/v2/workflows/[id]/runs/[runId]/resume",
7856
8826
  pathParams: ["id", "runId"],
8827
+ pathParamDocs: { id: "Unique workflow identifier.", runId: "Unique workflow run identifier." },
7857
8828
  responseMode: "json",
7858
8829
  summary: "Resume Workflow Run",
7859
8830
  body: {
7860
- contextId: { kind: "string", required: true },
7861
- input: { kind: "unknown" }
8831
+ contextId: {
8832
+ kind: "string",
8833
+ required: true,
8834
+ describe: "Human-in-the-loop pause-context identifier."
8835
+ },
8836
+ input: { kind: "unknown", describe: "Input supplied to the paused workflow block." }
7862
8837
  }
7863
8838
  },
7864
8839
  rollbackWorkflow: {
7865
8840
  method: "POST",
7866
8841
  path: "/api/v2/workflows/[id]/rollback",
7867
8842
  pathParams: ["id"],
8843
+ pathParamDocs: { id: "Unique workflow identifier." },
7868
8844
  responseMode: "json",
7869
8845
  summary: "Rollback Workflow",
7870
8846
  body: {
7871
- version: { kind: "integer" }
8847
+ version: {
8848
+ kind: "integer",
8849
+ describe: "Deployment version to reactivate. Omit to select the previous active version."
8850
+ }
7872
8851
  }
7873
8852
  },
7874
8853
  runRowEnrichment: {
7875
8854
  method: "POST",
7876
8855
  path: "/api/v2/tables/[tableId]/rows/[rowId]/enrichment/[groupId]",
7877
8856
  pathParams: ["tableId", "rowId", "groupId"],
8857
+ pathParamDocs: {
8858
+ tableId: "Unique table identifier.",
8859
+ rowId: "Unique table row identifier.",
8860
+ groupId: "Workflow or enrichment group to run."
8861
+ },
7878
8862
  responseMode: "json",
7879
8863
  summary: "Run Enrichment For One Row",
7880
8864
  body: {
7881
- workspaceId: { kind: "string", required: true }
8865
+ workspaceId: { kind: "string", required: true, describe: "Unique workspace identifier." }
7882
8866
  }
7883
8867
  },
7884
8868
  runTableColumn: {
7885
8869
  method: "POST",
7886
8870
  path: "/api/v2/tables/[tableId]/columns/run",
7887
8871
  pathParams: ["tableId"],
8872
+ pathParamDocs: { tableId: "Unique table identifier." },
7888
8873
  responseMode: "json",
7889
8874
  summary: "Run Column Groups",
7890
8875
  body: {
7891
- workspaceId: { kind: "string", required: true },
7892
- groupIds: { kind: "array", required: true },
7893
- runMode: { kind: "enum", values: ["all", "incomplete"], default: "all" },
7894
- rowIds: { kind: "array" },
7895
- filter: { kind: "unknown" },
7896
- excludeRowIds: { kind: "array" },
7897
- limit: { kind: "object" }
8876
+ workspaceId: { kind: "string", required: true, describe: "Unique workspace identifier." },
8877
+ groupIds: {
8878
+ kind: "array",
8879
+ required: true,
8880
+ describe: "Workflow or enrichment groups to run."
8881
+ },
8882
+ runMode: {
8883
+ kind: "enum",
8884
+ values: ["all", "incomplete"],
8885
+ default: "all",
8886
+ describe: "Whether to run all or only incomplete cells."
8887
+ },
8888
+ rowIds: { kind: "array", describe: "Explicit row subset to run." },
8889
+ filter: {
8890
+ kind: "unknown",
8891
+ describe: 'Recursive predicate tree. Each group node is exactly one non-empty `all` or `any` array whose members are further groups or `{ field, op, value }` conditions; the root must be a group, not a bare condition. At most 100 members per group, 10 levels of nesting, and 500 nodes in total. The negating operators include nulls: `ne`, `nin`, `ncontains`, `nlike`, and `nilike` match rows whose column is null or absent, so "not X" is not the complement of "X" over a nullable column. That holds for every column type, multi-select included. To exclude nulls, `all`-combine the negation with `isNotEmpty` (multi-select) or `isNotNull`. Comparison: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`. Membership: `in`, `nin` (array operand). Emptiness: `isEmpty`, `isNotEmpty`, `isNull`, `isNotNull` (no operand). Substring, always case-insensitive, operand matched literally: `contains`, `ncontains`, `startsWith`, `endsWith`. Pattern: `like`/`nlike` (case-sensitive), `ilike`/`nilike` (case-insensitive). **`*` is the only wildcard** and stands for any run of characters; `%`, `_`, and backslash match themselves. Use `like: "Hi*"`, not `like: "Hi%"`. A `select` column compares by option id and restricts its operators: single-select accepts `eq`, `ne`, `in`, `nin`; multi-select accepts `contains`, `ncontains`. Option names are accepted as operands and resolved to ids.'
8892
+ },
8893
+ excludeRowIds: { kind: "array", describe: "Rows excluded from a select-all run scope." },
8894
+ limit: { kind: "object", describe: "Optional cap on eligible rows to run." }
7898
8895
  }
7899
8896
  },
7900
8897
  searchKnowledge: {
@@ -7904,47 +8901,96 @@ var V2_OPERATIONS = {
7904
8901
  responseMode: "json",
7905
8902
  summary: "Search Knowledge",
7906
8903
  body: {
7907
- workspaceId: { kind: "string", required: true },
7908
- knowledgeBaseIds: { kind: "unknown", required: true },
7909
- query: { kind: "string" },
7910
- topK: { kind: "number", default: 10 },
7911
- tagFilters: { kind: "array" },
7912
- searchMode: { kind: "enum", default: "vector" },
7913
- rerankerEnabled: { kind: "boolean" },
8904
+ workspaceId: {
8905
+ kind: "string",
8906
+ required: true,
8907
+ describe: "Workspace that owns the knowledge bases."
8908
+ },
8909
+ knowledgeBaseIds: {
8910
+ kind: "unknown",
8911
+ required: true,
8912
+ describe: "One knowledge base identifier or an array of up to 20 identifiers."
8913
+ },
8914
+ query: {
8915
+ kind: "string",
8916
+ describe: "Natural-language query; required when tag filters are omitted. At most 32768 characters — longer text exceeds the embedding model's per-input token ceiling and would be truncated before the billed search ran."
8917
+ },
8918
+ topK: {
8919
+ kind: "number",
8920
+ default: 10,
8921
+ describe: "Maximum number of search results to return. Must be a whole number between 1 and 100; the boundary schema only bounds the range, so a fractional value is admitted here and then rejected with 400 during search."
8922
+ },
8923
+ tagFilters: {
8924
+ kind: "array",
8925
+ describe: "Structured tag filters, at most 10 of them. Every filter must hold, including two that name the same tag: repeating one tag narrows the result rather than widening it, matching `GET /api/v2/knowledge/{id}/documents`. To match either of two values for one tag, issue a search per value. Each filtered tag must resolve to the same slot and field type in every knowledge base selected; one missing from any of them, or defined inconsistently across them, is rejected rather than ignored, and those knowledge bases must be searched separately. List the available names with `GET /api/v2/knowledge/{id}/tags`."
8926
+ },
8927
+ searchMode: {
8928
+ kind: "enum",
8929
+ default: "vector",
8930
+ describe: "Retrieval strategy: vector is semantic-only, while hybrid also runs full-text search."
8931
+ },
8932
+ rerankerEnabled: {
8933
+ kind: "boolean",
8934
+ describe: "Re-order retrieved chunks with a reranking model before truncating to `topK`. Ignored for a tag-only search, and billed as an additional search unit. Reranking is best-effort — a provider failure falls back to vector ordering, so check `rerankerStatus` on the response."
8935
+ },
7914
8936
  rerankerModel: {
7915
8937
  kind: "enum",
7916
8938
  values: ["rerank-v4.0-pro", "rerank-v4.0-fast", "rerank-v3.5"],
7917
- default: "rerank-v4.0-fast"
8939
+ default: "rerank-v4.0-fast",
8940
+ describe: "Reranking model to use when `rerankerEnabled` is true. Defaults to `rerank-v4.0-fast`."
7918
8941
  },
7919
- rerankerInputCount: { kind: "integer" }
8942
+ rerankerInputCount: {
8943
+ kind: "integer",
8944
+ describe: "How many candidate chunks to retrieve before reranking. Defaults to four times `topK`, capped at 100. A larger pool costs more retrieval work but gives the reranker more to choose from."
8945
+ }
7920
8946
  }
7921
8947
  },
7922
8948
  setSecret: {
7923
8949
  method: "PUT",
7924
8950
  path: "/api/v2/secrets/[name]",
7925
8951
  pathParams: ["name"],
8952
+ pathParamDocs: { name: "Secret to create, replace, or delete." },
7926
8953
  responseMode: "json",
7927
8954
  summary: "Set Secret",
7928
8955
  body: {
7929
- workspaceId: { kind: "string", required: true },
7930
- scope: { kind: "enum", required: true, values: ["workspace", "personal"] },
7931
- value: { kind: "string", required: true }
8956
+ workspaceId: {
8957
+ kind: "string",
8958
+ required: true,
8959
+ describe: "Workspace the request is authorized against. A workspace secret is written to it; a personal secret is written to the caller and is available in all of their workspaces."
8960
+ },
8961
+ scope: {
8962
+ kind: "enum",
8963
+ required: true,
8964
+ values: ["workspace", "personal"],
8965
+ describe: "Whether the secret belongs to the workspace or to the caller. A personal secret belongs to the caller across every workspace, not to one workspace."
8966
+ },
8967
+ value: {
8968
+ kind: "string",
8969
+ required: true,
8970
+ describe: "Write-only secret value. It is never returned."
8971
+ }
7932
8972
  }
7933
8973
  },
7934
8974
  tableExportDownload: {
7935
8975
  method: "GET",
7936
8976
  path: "/api/v2/tables/exports/[exportId]/download",
7937
8977
  pathParams: ["exportId"],
8978
+ pathParamDocs: { exportId: "Unique table-export identifier." },
7938
8979
  responseMode: "json",
7939
8980
  summary: "Download Table Export",
7940
8981
  query: {
7941
- workspaceId: { kind: "string", required: true }
8982
+ workspaceId: {
8983
+ kind: "string",
8984
+ required: true,
8985
+ describe: "Workspace that owns the transfer resource."
8986
+ }
7942
8987
  }
7943
8988
  },
7944
8989
  undeployWorkflow: {
7945
8990
  method: "DELETE",
7946
8991
  path: "/api/v2/workflows/[id]/deploy",
7947
8992
  pathParams: ["id"],
8993
+ pathParamDocs: { id: "Unique workflow identifier." },
7948
8994
  responseMode: "json",
7949
8995
  summary: "Undeploy Workflow"
7950
8996
  },
@@ -7952,235 +8998,384 @@ var V2_OPERATIONS = {
7952
8998
  method: "PATCH",
7953
8999
  path: "/api/v2/custom-tools/[id]",
7954
9000
  pathParams: ["id"],
9001
+ pathParamDocs: { id: "Unique custom tool identifier." },
7955
9002
  responseMode: "json",
7956
9003
  summary: "Update Custom Tool",
7957
9004
  body: {
7958
- workspaceId: { kind: "string", required: true },
7959
- title: { kind: "string" },
7960
- schema: { kind: "object" },
7961
- code: { kind: "string" }
9005
+ workspaceId: {
9006
+ kind: "string",
9007
+ required: true,
9008
+ describe: "Workspace that owns the custom tool."
9009
+ },
9010
+ title: { kind: "string", describe: "New display title for the tool." },
9011
+ schema: { kind: "object", describe: "Replacement function declaration." },
9012
+ code: { kind: "string", describe: "Replacement tool implementation." }
7962
9013
  }
7963
9014
  },
7964
9015
  updateFileContent: {
7965
9016
  method: "PUT",
7966
9017
  path: "/api/v2/files/[fileId]/content",
7967
9018
  pathParams: ["fileId"],
9019
+ pathParamDocs: { fileId: "File identifier." },
7968
9020
  responseMode: "json",
7969
9021
  summary: "Replace File Content",
7970
9022
  body: {
7971
- workspaceId: { kind: "string", required: true },
7972
- content: { kind: "string", required: true },
7973
- encoding: { kind: "enum", values: ["utf-8", "base64"], default: "utf-8" }
9023
+ workspaceId: { kind: "string", required: true, describe: "Workspace that owns the file." },
9024
+ content: {
9025
+ kind: "string",
9026
+ required: true,
9027
+ describe: "Complete replacement content for the file. The 70,000,000-character bound guards the JSON envelope; the decoded bytes must be at most 50 MiB, and a longer base64 payload is rejected with `413`."
9028
+ },
9029
+ encoding: {
9030
+ kind: "enum",
9031
+ values: ["utf-8", "base64"],
9032
+ default: "utf-8",
9033
+ describe: "Encoding of the content field."
9034
+ }
7974
9035
  }
7975
9036
  },
7976
9037
  updateKnowledgeBase: {
7977
9038
  method: "PATCH",
7978
9039
  path: "/api/v2/knowledge/[id]",
7979
9040
  pathParams: ["id"],
9041
+ pathParamDocs: { id: "Unique knowledge base identifier." },
7980
9042
  responseMode: "json",
7981
9043
  summary: "Update Knowledge Base",
7982
9044
  body: {
7983
- workspaceId: { kind: "string", required: true },
7984
- name: { kind: "string" },
7985
- description: { kind: "string" },
7986
- chunkingConfig: { kind: "object" },
7987
- folderPath: { kind: "string" }
9045
+ workspaceId: {
9046
+ kind: "string",
9047
+ required: true,
9048
+ describe: "Workspace that owns the knowledge base."
9049
+ },
9050
+ name: { kind: "string", describe: "New knowledge base name." },
9051
+ description: { kind: "string", describe: "New knowledge base description." },
9052
+ chunkingConfig: { kind: "object", describe: "New document chunking configuration." },
9053
+ folderPath: { kind: "string", describe: "New containing-folder path." }
7988
9054
  }
7989
9055
  },
7990
9056
  updateKnowledgeDocument: {
7991
9057
  method: "PATCH",
7992
9058
  path: "/api/v2/knowledge/[id]/documents/[documentId]",
7993
9059
  pathParams: ["id", "documentId"],
9060
+ pathParamDocs: {
9061
+ id: "Unique knowledge base identifier.",
9062
+ documentId: "Unique knowledge document identifier."
9063
+ },
7994
9064
  responseMode: "json",
7995
9065
  summary: "Update Document",
7996
9066
  body: {
7997
- workspaceId: { kind: "string", required: true },
7998
- filename: { kind: "string" },
7999
- enabled: { kind: "boolean" },
8000
- tag1: { kind: "string" },
8001
- tag2: { kind: "string" },
8002
- tag3: { kind: "string" },
8003
- tag4: { kind: "string" },
8004
- tag5: { kind: "string" },
8005
- tag6: { kind: "string" },
8006
- tag7: { kind: "string" },
8007
- number1: { kind: "number" },
8008
- number2: { kind: "number" },
8009
- number3: { kind: "number" },
8010
- number4: { kind: "number" },
8011
- number5: { kind: "number" },
8012
- date1: { kind: "string" },
8013
- date2: { kind: "string" },
8014
- boolean1: { kind: "boolean" },
8015
- boolean2: { kind: "boolean" },
8016
- boolean3: { kind: "boolean" },
8017
- retryProcessing: { kind: "boolean" }
9067
+ workspaceId: {
9068
+ kind: "string",
9069
+ required: true,
9070
+ describe: "Workspace that owns the knowledge base."
9071
+ },
9072
+ filename: { kind: "string", describe: "New filename for the document." },
9073
+ enabled: {
9074
+ kind: "boolean",
9075
+ describe: "Whether the document participates in search. Disabling keeps it indexed."
9076
+ },
9077
+ tag1: { kind: "string", describe: "New value for tag slot 1." },
9078
+ tag2: { kind: "string", describe: "New value for tag slot 2." },
9079
+ tag3: { kind: "string", describe: "New value for tag slot 3." },
9080
+ tag4: { kind: "string", describe: "New value for tag slot 4." },
9081
+ tag5: { kind: "string", describe: "New value for tag slot 5." },
9082
+ tag6: { kind: "string", describe: "New value for tag slot 6." },
9083
+ tag7: { kind: "string", describe: "New value for tag slot 7." },
9084
+ number1: { kind: "number", describe: "New value for number tag slot 1." },
9085
+ number2: { kind: "number", describe: "New value for number tag slot 2." },
9086
+ number3: { kind: "number", describe: "New value for number tag slot 3." },
9087
+ number4: { kind: "number", describe: "New value for number tag slot 4." },
9088
+ number5: { kind: "number", describe: "New value for number tag slot 5." },
9089
+ date1: { kind: "string", describe: "New value for date tag slot 1, formatted YYYY-MM-DD." },
9090
+ date2: { kind: "string", describe: "New value for date tag slot 2, formatted YYYY-MM-DD." },
9091
+ boolean1: { kind: "boolean", describe: "New value for boolean tag slot 1." },
9092
+ boolean2: { kind: "boolean", describe: "New value for boolean tag slot 2." },
9093
+ boolean3: { kind: "boolean", describe: "New value for boolean tag slot 3." },
9094
+ retryProcessing: {
9095
+ kind: "boolean",
9096
+ describe: "Requeue a failed or stuck document for processing. Send it alone — no other field may accompany it — and it answers with a queue acknowledgement rather than the document."
9097
+ }
8018
9098
  }
8019
9099
  },
8020
9100
  updateMcpServer: {
8021
9101
  method: "PATCH",
8022
9102
  path: "/api/v2/mcp-servers/[id]",
8023
9103
  pathParams: ["id"],
9104
+ pathParamDocs: { id: "Unique MCP server identifier." },
8024
9105
  responseMode: "json",
8025
9106
  summary: "Update MCP Server",
8026
9107
  body: {
8027
- workspaceId: { kind: "string", required: true },
8028
- name: { kind: "string" },
8029
- description: { kind: "string" },
8030
- transport: { kind: "enum", values: ["streamable-http"], default: "streamable-http" },
8031
- url: { kind: "string" },
8032
- authType: { kind: "enum", values: ["none", "headers", "oauth"] },
8033
- headers: { kind: "object" },
8034
- timeout: { kind: "integer", default: 30000 },
8035
- retries: { kind: "integer", default: 3 },
8036
- enabled: { kind: "boolean", default: true },
8037
- oauthClientId: { kind: "string" },
8038
- oauthClientSecret: { kind: "string" }
9108
+ workspaceId: {
9109
+ kind: "string",
9110
+ required: true,
9111
+ describe: "Workspace that owns the MCP server."
9112
+ },
9113
+ name: { kind: "string", describe: "Server display name." },
9114
+ description: { kind: "string", describe: "Optional server description." },
9115
+ transport: {
9116
+ kind: "enum",
9117
+ values: ["streamable-http"],
9118
+ default: "streamable-http",
9119
+ describe: "Transport used to communicate with the server. Applied server-side as `streamable-http` when omitted on create."
9120
+ },
9121
+ url: {
9122
+ kind: "string",
9123
+ describe: "Immutable server URL. When provided, it must equal the current URL; use delete and create to change endpoints."
9124
+ },
9125
+ authType: {
9126
+ kind: "enum",
9127
+ values: ["none", "headers", "oauth"],
9128
+ describe: "Authentication method. When omitted, and no `headers` are sent, registration probes the endpoint once to classify it, falling back to `headers` when the probe fails or the server does not advertise OAuth. A server publishing RFC 9728 metadata is therefore stored as `oauth`, and headers configured afterwards will not authenticate — send this field explicitly to pin the method."
9129
+ },
9130
+ headers: {
9131
+ kind: "object",
9132
+ describe: "Write-only request headers sent to the server. Replaced wholesale rather than merged on update: sending this field drops every stored header it does not repeat."
9133
+ },
9134
+ timeout: {
9135
+ kind: "integer",
9136
+ default: 30000,
9137
+ describe: "Per-request timeout in milliseconds. Applied server-side as 30000 when omitted on create."
9138
+ },
9139
+ retries: {
9140
+ kind: "integer",
9141
+ default: 3,
9142
+ describe: "Number of retries per request. Applied server-side as 3 when omitted on create."
9143
+ },
9144
+ enabled: {
9145
+ kind: "boolean",
9146
+ default: true,
9147
+ describe: "Whether the server tools are available to workflows. Applied server-side as true when omitted on create."
9148
+ },
9149
+ oauthClientId: {
9150
+ kind: "string",
9151
+ describe: "Pre-registered OAuth client identifier. Changing it on update revokes the stored OAuth grant and forces reauthorization."
9152
+ },
9153
+ oauthClientSecret: {
9154
+ kind: "string",
9155
+ describe: "Write-only pre-registered OAuth client secret. Sending it on update as null or a new value revokes the stored OAuth grant and forces reauthorization, as does switching away from OAuth authentication."
9156
+ }
8039
9157
  }
8040
9158
  },
8041
9159
  updateRowsByFilter: {
8042
9160
  method: "PATCH",
8043
9161
  path: "/api/v2/tables/[tableId]/rows",
8044
9162
  pathParams: ["tableId"],
9163
+ pathParamDocs: { tableId: "Unique table identifier." },
8045
9164
  responseMode: "json",
8046
9165
  summary: "Update Rows by Filter",
8047
9166
  body: {
8048
- workspaceId: { kind: "string", required: true },
8049
- filter: { kind: "unknown", required: true },
8050
- data: { kind: "object", required: true },
8051
- limit: { kind: "integer" }
9167
+ workspaceId: { kind: "string", required: true, describe: "Unique workspace identifier." },
9168
+ filter: {
9169
+ kind: "unknown",
9170
+ required: true,
9171
+ describe: 'Recursive predicate tree. Each group node is exactly one non-empty `all` or `any` array whose members are further groups or `{ field, op, value }` conditions; the root must be a group, not a bare condition. At most 100 members per group, 10 levels of nesting, and 500 nodes in total. The negating operators include nulls: `ne`, `nin`, `ncontains`, `nlike`, and `nilike` match rows whose column is null or absent, so "not X" is not the complement of "X" over a nullable column. That holds for every column type, multi-select included. To exclude nulls, `all`-combine the negation with `isNotEmpty` (multi-select) or `isNotNull`. Comparison: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`. Membership: `in`, `nin` (array operand). Emptiness: `isEmpty`, `isNotEmpty`, `isNull`, `isNotNull` (no operand). Substring, always case-insensitive, operand matched literally: `contains`, `ncontains`, `startsWith`, `endsWith`. Pattern: `like`/`nlike` (case-sensitive), `ilike`/`nilike` (case-insensitive). **`*` is the only wildcard** and stands for any run of characters; `%`, `_`, and backslash match themselves. Use `like: "Hi*"`, not `like: "Hi%"`. A `select` column compares by option id and restricts its operators: single-select accepts `eq`, `ne`, `in`, `nin`; multi-select accepts `contains`, `ncontains`. Option names are accepted as operands and resolved to ids.'
9172
+ },
9173
+ data: {
9174
+ kind: "object",
9175
+ required: true,
9176
+ describe: "Row-data patch applied to every matching row."
9177
+ },
9178
+ limit: { kind: "integer", describe: "Maximum matching rows to update." }
8052
9179
  }
8053
9180
  },
8054
9181
  updateSkill: {
8055
9182
  method: "PATCH",
8056
9183
  path: "/api/v2/skills/[id]",
8057
9184
  pathParams: ["id"],
9185
+ pathParamDocs: {
9186
+ id: "Unique skill identifier. A built-in skill is `builtin-` followed by its name, for example `builtin-research`."
9187
+ },
8058
9188
  responseMode: "json",
8059
9189
  summary: "Update Skill",
8060
9190
  body: {
8061
- workspaceId: { kind: "string", required: true },
8062
- name: { kind: "string" },
8063
- description: { kind: "string" },
8064
- content: { kind: "string" }
9191
+ workspaceId: { kind: "string", required: true, describe: "Workspace that owns the skill." },
9192
+ name: { kind: "string", describe: "New kebab-case skill name." },
9193
+ description: { kind: "string", describe: "New one-line summary of when the skill applies." },
9194
+ content: { kind: "string", describe: "Replacement skill body." }
8065
9195
  }
8066
9196
  },
8067
9197
  updateTable: {
8068
9198
  method: "PATCH",
8069
9199
  path: "/api/v2/tables/[tableId]",
8070
9200
  pathParams: ["tableId"],
9201
+ pathParamDocs: { tableId: "Unique table identifier." },
8071
9202
  responseMode: "json",
8072
9203
  summary: "Update Table",
8073
9204
  body: {
8074
- workspaceId: { kind: "string", required: true },
8075
- name: { kind: "string" },
8076
- description: { kind: "string" },
8077
- folderPath: { kind: "string" }
9205
+ workspaceId: { kind: "string", required: true, describe: "Unique workspace identifier." },
9206
+ name: { kind: "string", describe: "Replacement table name." },
9207
+ description: {
9208
+ kind: "string",
9209
+ describe: "Replacement table description, or null to clear it."
9210
+ },
9211
+ folderPath: {
9212
+ kind: "string",
9213
+ describe: 'Folder path. A missing leading slash is normalized before validation. Segments are percent-encoded, so a folder shown as "New folder" is `/New%20folder`: everything outside `A-Z a-z 0-9 - _ . ~` is escaped as uppercase hex, and only that exact encoding is accepted. A trailing slash, an empty segment, and a literal `.` or `..` segment are rejected. At most 64 segments and 4096 encoded bytes.'
9214
+ }
8078
9215
  }
8079
9216
  },
8080
9217
  updateTableColumn: {
8081
9218
  method: "PATCH",
8082
9219
  path: "/api/v2/tables/[tableId]/columns",
8083
9220
  pathParams: ["tableId"],
9221
+ pathParamDocs: { tableId: "Unique table identifier." },
8084
9222
  responseMode: "json",
8085
9223
  summary: "Update Column",
8086
9224
  body: {
8087
- workspaceId: { kind: "string", required: true },
8088
- columnName: { kind: "string", required: true },
8089
- updates: { kind: "object", required: true }
9225
+ workspaceId: { kind: "string", required: true, describe: "Workspace that owns the table." },
9226
+ columnName: {
9227
+ kind: "string",
9228
+ required: true,
9229
+ describe: "Current name of the column to update."
9230
+ },
9231
+ updates: { kind: "object", required: true, describe: "Mutable column fields." }
8090
9232
  }
8091
9233
  },
8092
9234
  updateTableRow: {
8093
9235
  method: "PATCH",
8094
9236
  path: "/api/v2/tables/[tableId]/rows/[rowId]",
8095
9237
  pathParams: ["tableId", "rowId"],
9238
+ pathParamDocs: { tableId: "Unique table identifier.", rowId: "Unique table row identifier." },
8096
9239
  responseMode: "json",
8097
9240
  summary: "Update Row",
8098
9241
  body: {
8099
- workspaceId: { kind: "string", required: true },
8100
- data: { kind: "object", required: true }
9242
+ workspaceId: { kind: "string", required: true, describe: "Unique workspace identifier." },
9243
+ data: {
9244
+ kind: "object",
9245
+ required: true,
9246
+ describe: "Partial row-data patch keyed by column name."
9247
+ }
8101
9248
  }
8102
9249
  },
8103
9250
  updateTableView: {
8104
9251
  method: "PATCH",
8105
9252
  path: "/api/v2/tables/[tableId]/views/[viewId]",
8106
9253
  pathParams: ["tableId", "viewId"],
9254
+ pathParamDocs: { tableId: "Unique table identifier.", viewId: "Unique saved-view identifier." },
8107
9255
  responseMode: "json",
8108
9256
  summary: "Update View",
8109
9257
  body: {
8110
- workspaceId: { kind: "string", required: true },
8111
- name: { kind: "string" },
8112
- config: { kind: "object" },
8113
- configPatch: { kind: "object" },
8114
- isDefault: { kind: "boolean" }
9258
+ workspaceId: { kind: "string", required: true, describe: "Workspace that owns the table." },
9259
+ name: { kind: "string", describe: "Replacement saved-view display name." },
9260
+ config: { kind: "object", describe: "Complete replacement saved-view configuration." },
9261
+ configPatch: {
9262
+ kind: "object",
9263
+ describe: "Saved-view configuration fields to shallow-merge."
9264
+ },
9265
+ isDefault: {
9266
+ kind: "boolean",
9267
+ describe: "Whether to promote this view to the table default."
9268
+ }
8115
9269
  }
8116
9270
  },
8117
9271
  updateWorkflow: {
8118
9272
  method: "PATCH",
8119
9273
  path: "/api/v2/workflows/[id]",
8120
9274
  pathParams: ["id"],
9275
+ pathParamDocs: { id: "Unique workflow identifier." },
8121
9276
  responseMode: "json",
8122
9277
  summary: "Update Workflow",
8123
9278
  body: {
8124
- name: { kind: "string" },
8125
- description: { kind: "string" },
8126
- folderPath: { kind: "string" }
9279
+ name: { kind: "string", describe: "Replacement workflow name." },
9280
+ description: {
9281
+ kind: "string",
9282
+ describe: "Replacement workflow description; null clears it."
9283
+ },
9284
+ folderPath: {
9285
+ kind: "string",
9286
+ describe: "Destination folder path; `/` moves the workflow to the workspace root."
9287
+ }
8127
9288
  }
8128
9289
  },
8129
9290
  updateWorkflowGroup: {
8130
9291
  method: "PATCH",
8131
9292
  path: "/api/v2/tables/[tableId]/groups",
8132
9293
  pathParams: ["tableId"],
9294
+ pathParamDocs: { tableId: "Unique table identifier." },
8133
9295
  responseMode: "json",
8134
9296
  summary: "Update Workflow Group",
8135
9297
  body: {
8136
- workspaceId: { kind: "string", required: true },
8137
- groupId: { kind: "string", required: true },
8138
- workflowId: { kind: "string" },
8139
- name: { kind: "string" },
8140
- dependencies: { kind: "object" },
8141
- outputs: { kind: "array" },
8142
- newOutputColumns: { kind: "array" },
8143
- mappingUpdates: { kind: "array" },
8144
- inputMappings: { kind: "array" },
8145
- deploymentMode: { kind: "enum", values: ["live", "deployed"] },
8146
- type: { kind: "enum", values: ["manual", "enrichment"] },
8147
- autoRun: { kind: "boolean" }
9298
+ workspaceId: { kind: "string", required: true, describe: "Unique workspace identifier." },
9299
+ groupId: { kind: "string", required: true, describe: "Workflow group to update." },
9300
+ workflowId: { kind: "string", describe: "Replacement backing workflow identifier." },
9301
+ name: { kind: "string", describe: "Replacement workflow-group display name." },
9302
+ dependencies: { kind: "object", describe: "Replacement input dependencies." },
9303
+ outputs: { kind: "array", describe: "Replacement producer outputs." },
9304
+ newOutputColumns: { kind: "array", describe: "Columns to add for new outputs." },
9305
+ mappingUpdates: { kind: "array", describe: "Existing output-column mapping changes." },
9306
+ inputMappings: { kind: "array", describe: "Replacement workflow input mappings." },
9307
+ deploymentMode: {
9308
+ kind: "enum",
9309
+ values: ["live", "deployed"],
9310
+ describe: "Replacement workflow execution mode."
9311
+ },
9312
+ type: {
9313
+ kind: "enum",
9314
+ values: ["manual", "enrichment"],
9315
+ describe: "Workflow-group producer type. Must match the group's stored type — a group's producer cannot be changed after creation."
9316
+ },
9317
+ autoRun: { kind: "boolean", describe: "Replacement automatic-run setting." }
8148
9318
  }
8149
9319
  },
8150
9320
  uploadKnowledgeDocument: {
8151
9321
  method: "POST",
8152
9322
  path: "/api/v2/knowledge/[id]/documents",
8153
9323
  pathParams: ["id"],
9324
+ pathParamDocs: { id: "Unique knowledge base identifier." },
8154
9325
  responseMode: "json",
8155
9326
  summary: "Upload Document",
8156
9327
  query: {
8157
- workspaceId: { kind: "string", required: true }
9328
+ workspaceId: {
9329
+ kind: "string",
9330
+ required: true,
9331
+ describe: "Workspace that owns the knowledge base."
9332
+ }
8158
9333
  }
8159
9334
  },
8160
9335
  upsertFileShare: {
8161
9336
  method: "PATCH",
8162
9337
  path: "/api/v2/files/[fileId]/share",
8163
9338
  pathParams: ["fileId"],
9339
+ pathParamDocs: { fileId: "File identifier." },
8164
9340
  responseMode: "json",
8165
9341
  summary: "Enable or Disable File Share",
8166
9342
  body: {
8167
- workspaceId: { kind: "string", required: true },
8168
- isActive: { kind: "boolean", required: true },
8169
- authType: { kind: "enum", values: ["public", "password", "email", "sso"] },
8170
- password: { kind: "string" },
8171
- allowedEmails: { kind: "array" }
9343
+ workspaceId: { kind: "string", required: true, describe: "Workspace that owns the file." },
9344
+ isActive: {
9345
+ kind: "boolean",
9346
+ required: true,
9347
+ describe: "Whether the share should resolve. Disabling preserves the token and the whole access configuration, so re-enabling restores the share as it was; enabling rewrites the credentials the resulting mode does not use."
9348
+ },
9349
+ authType: {
9350
+ kind: "enum",
9351
+ values: ["public", "password", "email", "sso"],
9352
+ describe: "How access to the share is gated. The stored mode is kept when omitted. Enabling `public` clears the stored password and empties `allowedEmails`; `password` empties `allowedEmails`; `email` and `sso` clear the stored password."
9353
+ },
9354
+ password: {
9355
+ kind: "string",
9356
+ describe: "Password for a password-gated share. Kept when omitted; enabling `password` with neither a supplied nor a stored password is a 400."
9357
+ },
9358
+ allowedEmails: {
9359
+ kind: "array",
9360
+ describe: "Allowed addresses or `@domain` patterns for email and SSO shares. Kept when omitted; enabling `email` or `sso` with an empty resulting list is a 400."
9361
+ }
8172
9362
  }
8173
9363
  },
8174
9364
  upsertTableRow: {
8175
9365
  method: "POST",
8176
9366
  path: "/api/v2/tables/[tableId]/rows/upsert",
8177
9367
  pathParams: ["tableId"],
9368
+ pathParamDocs: { tableId: "Unique table identifier." },
8178
9369
  responseMode: "json",
8179
9370
  summary: "Upsert Row",
8180
9371
  body: {
8181
- workspaceId: { kind: "string", required: true },
8182
- data: { kind: "object", required: true },
8183
- conflictTarget: { kind: "string" }
9372
+ workspaceId: { kind: "string", required: true, describe: "Unique workspace identifier." },
9373
+ data: {
9374
+ kind: "object",
9375
+ required: true,
9376
+ describe: "Complete set of row cells keyed by column name. On the update branch this REPLACES the matched row: any column not present here is cleared, unlike the merging `PATCH /api/v2/tables/{tableId}/rows/{rowId}`."
9377
+ },
9378
+ conflictTarget: { kind: "string", describe: "Unique column used to detect a conflict." }
8184
9379
  }
8185
9380
  }
8186
9381
  };
@@ -8282,6 +9477,15 @@ var CLI_CONTRACT = {
8282
9477
  },
8283
9478
  confirm: "This updates every matching row and cannot be undone."
8284
9479
  },
9480
+ bulkUpdateKnowledgeDocuments: {
9481
+ command: "knowledge documents batch-update",
9482
+ describe: "Enable or disable every matching document",
9483
+ pathArgumentNames: KNOWLEDGE_DOCUMENT_PATH_ARGUMENTS,
9484
+ flags: {
9485
+ documentIds: { name: "document", list: true },
9486
+ selectAll: { boolean: true, describe: "Apply to every document in the knowledge base" }
9487
+ }
9488
+ },
8285
9489
  undeployWorkflow: {
8286
9490
  command: "workflows undeploy",
8287
9491
  describe: "Take a workflow out of deployment"
@@ -9506,9 +10710,9 @@ function attachCredentialCommands(program2) {
9506
10710
  const credentials = program2.commands.find((command) => command.name() === "credentials");
9507
10711
  if (!credentials)
9508
10712
  throw new Error("The generated credentials command group is missing");
9509
- credentials.command("create <providerId>").description("Create a service-account credential using its discovered provider schema").requiredOption("--name <displayName>", "Name shown for the credential in Sim").requiredOption("--credentials <json|@file>", "Provider credentials as JSON (or @path / @- to read a file or stdin)").option("--description <description>", "Optional credential description").option("--id <credentialId>", "Client-generated credential ID when provider discovery requires it").action((providerId, options, command) => createServiceAccount(command, providerId, options));
9510
- credentials.command("connect <providerId>").description("Create a short-lived link for connecting an OAuth provider").requiredOption("--name <displayName>", "Name shown for the new credential in Sim").action(async (providerId, options, command) => createConnectionLink(command, { providerId, displayName: options.name }));
9511
- credentials.command("reconnect <credentialId>").description("Create a short-lived link for reconnecting an OAuth credential").action((credentialId, _options, command) => createConnectionLink(command, { credentialId }));
10713
+ credentials.command("create").argument("<providerId>", "Service-account provider to create a credential for").description("Create a service-account credential using its discovered provider schema").requiredOption("--name <displayName>", "Name shown for the credential in Sim").requiredOption("--credentials <json|@file>", "Provider credentials as JSON (or @path / @- to read a file or stdin)").option("--description <description>", "Optional credential description").option("--id <credentialId>", "Client-generated credential ID when provider discovery requires it").action((providerId, options, command) => createServiceAccount(command, providerId, options));
10714
+ credentials.command("connect").argument("<providerId>", "OAuth provider to connect").description("Create a short-lived link for connecting an OAuth provider").requiredOption("--name <displayName>", "Name shown for the new credential in Sim").action(async (providerId, options, command) => createConnectionLink(command, { providerId, displayName: options.name }));
10715
+ credentials.command("reconnect").argument("<credentialId>", "Existing OAuth credential to re-authorize").description("Create a short-lived link for reconnecting an OAuth credential").action((credentialId, _options, command) => createConnectionLink(command, { credentialId }));
9512
10716
  }
9513
10717
 
9514
10718
  // src/commands/protocol/files-get.ts
@@ -9640,7 +10844,7 @@ function isTerminalSafeContentType(contentType) {
9640
10844
  ].includes(mediaType);
9641
10845
  }
9642
10846
  function attachFileGet(files) {
9643
- files.command("get <fileId>").description("Get a file’s content").option("-o, --output-file <path>", "Write content to a file instead of stdout").option("--force", "Overwrite --output-file if it already exists").action(async (fileId, options, command) => {
10847
+ files.command("get").argument("<fileId>", "File whose content to read").description("Get a file’s content").option("-o, --output-file <path>", "Write content to a file instead of stdout").option("--force", "Overwrite --output-file if it already exists").action(async (fileId, options, command) => {
9644
10848
  const writesToStdout = options.outputFile === undefined || options.outputFile === "-";
9645
10849
  if (writesToStdout && options.force) {
9646
10850
  throw new SimApiError("--force requires --output-file <path>", 0);
@@ -9797,7 +11001,7 @@ async function finishUploadSession(client, workspaceId, session, path) {
9797
11001
 
9798
11002
  // src/commands/protocol/files-upload.ts
9799
11003
  function attachFileUpload(files) {
9800
- files.command("upload <path>").description("Upload a file to the workspace").option("--folder <path>", "Destination folder path (defaults to /)").option("--name <name>", "Store it under a different name").action(async (path, options, command) => {
11004
+ files.command("upload").argument("<path>", "Local file to upload").description("Upload a file to the workspace").option("--folder <path>", "Destination folder path (defaults to /)").option("--name <name>", "Store it under a different name").action(async (path, options, command) => {
9801
11005
  const { client, profile } = clientFrom(command);
9802
11006
  const workspaceId = client.requireWorkspace();
9803
11007
  const { name, size } = await localFile(path, options.name);
@@ -9843,7 +11047,7 @@ function uploadMetadata(options) {
9843
11047
  return metadata;
9844
11048
  }
9845
11049
  function attachKnowledgeDocumentUpload(documents) {
9846
- documents.command("upload <knowledgeBaseId> <path>").description("Upload a document to a knowledge base").option("--name <name>", "Store it under a different name").option("--tag <value...>", "Document tags, in tag1 through tag7 order").option("--recipe <name>", "Document processing recipe").option("--lang <code>", "Document language code").action(async (knowledgeBaseId, path, options, command) => {
11050
+ documents.command("upload").argument("<knowledgeBaseId>", "Knowledge base to upload into").argument("<path>", "Local file to upload").description("Upload a document to a knowledge base").option("--name <name>", "Store it under a different name").option("--tag <value...>", "Document tags, in tag1 through tag7 order").option("--recipe <name>", "Document processing recipe").option("--lang <code>", "Document language code").action(async (knowledgeBaseId, path, options, command) => {
9847
11051
  const { client, profile } = clientFrom(command);
9848
11052
  const workspaceId = client.requireWorkspace();
9849
11053
  const { name, size } = await localFile(path, options.name);
@@ -9879,6 +11083,9 @@ function attachKnowledgeDocumentUpload(documents) {
9879
11083
 
9880
11084
  // src/runtime/options.ts
9881
11085
  var DEFAULT_LIMIT = 100;
11086
+ function describeField(flag, descriptor, name, field) {
11087
+ return flag.describe ?? descriptor.describe ?? `Set ${name.replaceAll("-", " ") || field}`;
11088
+ }
9882
11089
  function addFieldOption(command, operation, field, descriptor) {
9883
11090
  if (field === PROFILE_INJECTED_FIELD || field === "cursor")
9884
11091
  return;
@@ -9891,21 +11098,22 @@ function addFieldOption(command, operation, field, descriptor) {
9891
11098
  command.option("--limit <n>", "Maximum items to return (0 for everything)", String(DEFAULT_LIMIT));
9892
11099
  return;
9893
11100
  }
11101
+ const documented = describeField(flag, descriptor, name, field);
9894
11102
  if (descriptor.kind === "boolean" || flag.boolean) {
9895
11103
  if (descriptor.required) {
9896
- command.addOption(new Option(`${short}--${name} <true|false>`, `${flag.describe ?? `Set ${field}`} (required)`).choices(["true", "false"]).makeOptionMandatory());
11104
+ command.addOption(new Option(`${short}--${name} <true|false>`, `${documented} (required)`).choices(["true", "false"]).makeOptionMandatory());
9897
11105
  return;
9898
11106
  }
9899
- command.option(`${short}--${name}`, flag.describe ?? `Set ${field}`);
11107
+ command.option(`${short}--${name}`, documented);
9900
11108
  if (!flag.boolean)
9901
- command.option(`--no-${name}`, `Set ${field} to false`);
11109
+ command.option(`--no-${name}`, `Send --${name} as false`);
9902
11110
  return;
9903
11111
  }
9904
11112
  const takesList = flag.list === true;
9905
11113
  const wantsJson = takesJson(descriptor, flag);
9906
11114
  const placeholder = takesList ? "<value...>" : wantsJson ? "<json|@file>" : "<value>";
9907
11115
  const choices = flag.choices ?? descriptor.values;
9908
- const describe = `${flag.describe ?? `Set ${name.replaceAll("-", " ")}`}${takesList ? " (space-separated, or @path / @- with one value per line)" : wantsJson ? " (JSON, or @path / @- to read a file or stdin)" : ""}${descriptor.required ? " (required)" : ""}`;
11116
+ const describe = `${documented}${takesList ? " (space-separated, or @path / @- with one value per line)" : wantsJson ? " (JSON, or @path / @- to read a file or stdin)" : ""}${descriptor.required ? " (required)" : ""}`;
9909
11117
  const option = new Option(`${short}--${name} ${placeholder}`, describe);
9910
11118
  if (choices && !takesList)
9911
11119
  option.choices([...choices]);
@@ -9923,7 +11131,7 @@ function addOperationOptions(command, operation, commandSpec, operationSpec) {
9923
11131
  continue;
9924
11132
  const name = pathFlagNameFor(commandSpec, param);
9925
11133
  const short = flag.short ? `-${flag.short}, ` : "";
9926
- command.addOption(new Option(`${short}--${name} <${flag.placeholder ?? "value"}>`, `${flag.describe ?? `Set ${name.replaceAll("-", " ")}`} (required)`).makeOptionMandatory());
11134
+ command.addOption(new Option(`${short}--${name} <${flag.placeholder ?? "value"}>`, `${flag.describe ?? operationSpec.pathParamDocs?.[param] ?? `Set ${name.replaceAll("-", " ")}`} (required)`).makeOptionMandatory());
9927
11135
  }
9928
11136
  for (const slot of ["query", "body"]) {
9929
11137
  for (const [field, descriptor] of Object.entries(operationSpec[slot] ?? {})) {
@@ -10004,7 +11212,7 @@ function entriesFor(config, folders, resources) {
10004
11212
  ].sort((left, right) => left.name.localeCompare(right.name) || left.kind.localeCompare(right.kind));
10005
11213
  }
10006
11214
  function attachResourceDirectoryCommands(group, config) {
10007
- group.command("ls [path]").allowExcessArguments(false).description(`List ${config.kind} resources and child folders together`).option("--search <text>", "Filter folders and resources by name").addOption(new Option("--limit <n>", "Maximum combined items to return (0 for everything)").default(String(DEFAULT_LIMIT))).action(async (path, options, command) => {
11215
+ group.command("ls").argument("[path]", "Folder path to list; defaults to the root folder").allowExcessArguments(false).description(`List ${config.kind} resources and child folders together`).option("--search <text>", "Filter folders and resources by name").addOption(new Option("--limit <n>", "Maximum combined items to return (0 for everything)").default(String(DEFAULT_LIMIT))).action(async (path, options, command) => {
10008
11216
  const rawLimit = Number(options.limit);
10009
11217
  if (!Number.isSafeInteger(rawLimit) || rawLimit < 0) {
10010
11218
  throw new SimApiError("--limit must be a non-negative integer", 0);
@@ -10020,7 +11228,7 @@ function attachResourceDirectoryCommands(group, config) {
10020
11228
  const entries = entriesFor(config, folders, resources);
10021
11229
  printList(profile.output, entries.slice(0, limit), COLUMNS);
10022
11230
  });
10023
- group.command("mkdir <path>").allowExcessArguments(false).description(`Create a ${config.kind} directory at a path`).action(async (path, _options, command) => {
11231
+ group.command("mkdir").argument("<path>", "Folder path to create; the leading / is optional").allowExcessArguments(false).description(`Create a ${config.kind} directory at a path`).action(async (path, _options, command) => {
10024
11232
  const { client, profile } = clientFrom(command);
10025
11233
  const operation = V2_OPERATIONS[config.createFolder];
10026
11234
  const result = await client.request(operation.path, {
@@ -10079,7 +11287,7 @@ function validateTargetOptions(options) {
10079
11287
  return intoExisting;
10080
11288
  }
10081
11289
  function attachTableImport(tables) {
10082
- tables.command("import [path]").description("Import a CSV, into a new table by default").option("--name <name>", "Identifier for the new table: letters, numbers, and underscores; defaults to the sanitized file name").option("--table-id <id>", "Import into this existing table instead of creating one").addOption(new Option("--mode <append|replace>", "How to write into --table-id (default: append)").choices(["append", "replace"])).option("--folder <path>", "Folder path for the new table").option("--file-id <id>", "Import a file already in the workspace instead of a local path").option("--mapping <json|@file>", "Column mapping (--table-id only)").option("--create-columns <json|@file>", "Columns to create (--table-id only)").option("--timezone <iana>", "Timezone for date parsing, e.g. America/New_York").option("--no-wait", "Return once the import is queued instead of watching it").action(async (path, options, command) => {
11290
+ tables.command("import").argument("[path]", "Local CSV file to import; omit when using --file-id").description("Import a CSV, into a new table by default").option("--name <name>", "Identifier for the new table: letters, numbers, and underscores; defaults to the sanitized file name").option("--table-id <id>", "Import into this existing table instead of creating one").addOption(new Option("--mode <append|replace>", "How to write into --table-id (default: append)").choices(["append", "replace"])).option("--folder <path>", "Folder path for the new table").option("--file-id <id>", "Import a file already in the workspace instead of a local path").option("--mapping <json|@file>", "Column mapping (--table-id only)").option("--create-columns <json|@file>", "Columns to create (--table-id only)").option("--timezone <iana>", "Timezone for date parsing, e.g. America/New_York").option("--no-wait", "Return once the import is queued instead of watching it").action(async (path, options, command) => {
10083
11291
  const { client, profile } = clientFrom(command);
10084
11292
  const workspaceId = client.requireWorkspace();
10085
11293
  if (Boolean(path) === Boolean(options.fileId)) {
@@ -10302,7 +11510,7 @@ function attachSecretCommands(program2) {
10302
11510
  const secrets = program2.commands.find((command) => command.name() === "secrets");
10303
11511
  if (!secrets)
10304
11512
  throw new Error("The generated secrets command group is missing");
10305
- secrets.command("set <name>").description("Create or replace a named secret").addOption(new Option("--scope <scope>", "Secret ownership scope").choices([...SECRET_SCOPES]).makeOptionMandatory()).option("--value <value>", "Secret value; visible to shell history when supplied directly").action((name, options, command) => setSecret(name, options, command));
11513
+ secrets.command("set").argument("<name>", "Secret name, as referenced in workflows").description("Create or replace a named secret").addOption(new Option("--scope <scope>", "Secret ownership scope").choices([...SECRET_SCOPES]).makeOptionMandatory()).option("--value <value>", "Secret value; visible to shell history when supplied directly").action((name, options, command) => setSecret(name, options, command));
10306
11514
  }
10307
11515
 
10308
11516
  // src/runtime/execute.ts
@@ -10446,7 +11654,7 @@ function configureOperation(command, operation, spec) {
10446
11654
  for (const param of operationSpec.pathParams) {
10447
11655
  if (spec.pathFlags?.[param] || isProfileWorkspacePath(spec, param))
10448
11656
  continue;
10449
- command.argument(`<${spec.pathArgumentNames?.[param] ?? param}>`);
11657
+ command.argument(`<${spec.pathArgumentNames?.[param] ?? param}>`, operationSpec.pathParamDocs?.[param]);
10450
11658
  }
10451
11659
  if (spec.allWorkspaces) {
10452
11660
  const workspace = operationSpec.query?.workspaceId ?? operationSpec.body?.workspaceId;
@@ -10461,7 +11669,7 @@ function configureOperation(command, operation, spec) {
10461
11669
  if (spec.requestFields && !spec.requestFields.includes(field)) {
10462
11670
  throw new Error(`${operation}.${field} is positional but not exposed`);
10463
11671
  }
10464
- command.argument(`<${flagNameFor(operation, field)}>`);
11672
+ command.argument(`<${flagNameFor(operation, field)}>`, flagSpecFor(operation, field).describe ?? descriptor.describe);
10465
11673
  }
10466
11674
  if (spec.requestFields) {
10467
11675
  for (const field of spec.requestFields) {
@@ -10560,28 +11768,9 @@ function buildGeneratedCommands() {
10560
11768
  return [...groups.values()].sort((a, b) => a.name().localeCompare(b.name()));
10561
11769
  }
10562
11770
 
10563
- // src/index.ts
10564
- var program2 = new Command;
10565
- function readPackageVersion() {
10566
- const metadata = JSON.parse(readFileSync3(new URL("../package.json", import.meta.url), "utf8"));
10567
- if (typeof metadata !== "object" || metadata === null || !("version" in metadata) || typeof metadata.version !== "string") {
10568
- throw new Error("CLI package metadata is missing a valid version");
10569
- }
10570
- return metadata.version;
10571
- }
10572
- program2.name("sim").description("Talk to the Sim API from your terminal").version(readPackageVersion()).option("-P, --profile <name>", "Profile to use (env: SIM_PROFILE)").option("--endpoint <url>", "Sim deployment to talk to (env: SIM_ENDPOINT)").option("-w, --workspace <id>", "Workspace to target (env: SIM_WORKSPACE)").addOption(new Option("--output <format>", "Output format for this command").choices([...OUTPUT_FORMATS]));
10573
- program2.addCommand(loginCommand());
10574
- program2.addCommand(logoutCommand());
10575
- program2.addCommand(whoamiCommand());
10576
- program2.addCommand(profilesCommand());
10577
- program2.addCommand(configureCommand());
10578
- for (const command of buildGeneratedCommands()) {
10579
- program2.addCommand(command);
10580
- }
10581
- attachCredentialCommands(program2);
10582
- attachProtocolCommands(program2);
10583
- attachSecretCommands(program2);
10584
- program2.addHelpText("after", `
11771
+ // src/program.ts
11772
+ var PROGRAM_DESCRIPTION = "Talk to the Sim API from your terminal";
11773
+ var HELP_EPILOGUE = `
10585
11774
  Profiles work like the AWS CLI: settings live in ~/.sim/config, keys in
10586
11775
  ~/.sim/credentials (0600). Select one with -P, --profile, or SIM_PROFILE.
10587
11776
 
@@ -10596,10 +11785,39 @@ Examples:
10596
11785
  $ sim workflows export wf_123 > wf.json JSON flags read files with @
10597
11786
  $ sim workflows import --workflow @wf.json
10598
11787
  $ sim whoami --profile dev
10599
- `);
11788
+ `;
11789
+ function readPackageVersion() {
11790
+ const metadata = JSON.parse(readFileSync3(new URL("../package.json", import.meta.url), "utf8"));
11791
+ if (typeof metadata !== "object" || metadata === null || !("version" in metadata) || typeof metadata.version !== "string") {
11792
+ throw new Error("CLI package metadata is missing a valid version");
11793
+ }
11794
+ return metadata.version;
11795
+ }
11796
+ function buildProgram(options = {}) {
11797
+ const program2 = new Command;
11798
+ program2.name("sim").description(PROGRAM_DESCRIPTION);
11799
+ if (options.version !== false)
11800
+ program2.version(readPackageVersion());
11801
+ program2.option("-P, --profile <name>", "Profile to use (env: SIM_PROFILE)").option("--endpoint <url>", "Sim deployment to talk to (env: SIM_ENDPOINT)").option("-w, --workspace <id>", "Workspace to target (env: SIM_WORKSPACE)").addOption(new Option("--output <format>", "Output format for this command").choices([...OUTPUT_FORMATS]));
11802
+ program2.addCommand(loginCommand());
11803
+ program2.addCommand(logoutCommand());
11804
+ program2.addCommand(whoamiCommand());
11805
+ program2.addCommand(profilesCommand());
11806
+ program2.addCommand(configureCommand());
11807
+ for (const command of buildGeneratedCommands()) {
11808
+ program2.addCommand(command);
11809
+ }
11810
+ attachCredentialCommands(program2);
11811
+ attachProtocolCommands(program2);
11812
+ attachSecretCommands(program2);
11813
+ program2.addHelpText("after", HELP_EPILOGUE);
11814
+ return program2;
11815
+ }
11816
+
11817
+ // src/index.ts
10600
11818
  async function main() {
10601
11819
  try {
10602
- await program2.parseAsync(process.argv);
11820
+ await buildProgram().parseAsync(process.argv);
10603
11821
  } catch (error) {
10604
11822
  if (error instanceof ProfileConfigError) {
10605
11823
  console.error(source_default.red(`Error: ${sanitize(error.message)}`));