sim 2.1.0 → 2.1.1-preview.40.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 +16 -7
  2. package/dist/index.js +2536 -265
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2432,6 +2432,33 @@ function readConfigProfile(profile) {
2432
2432
  function readCredentialsProfile(profile) {
2433
2433
  return getSection(readIni(credentialsPath()), profile) ?? {};
2434
2434
  }
2435
+ function resolveAuthenticationProfileName(profile) {
2436
+ const config = readConfigProfile(profile);
2437
+ if (!Object.hasOwn(config, "auth_profile"))
2438
+ return profile;
2439
+ const authProfile = config.auth_profile.trim();
2440
+ if (!authProfile) {
2441
+ throw new ProfileConfigError(`Profile "${profile}" has an empty auth_profile.`);
2442
+ }
2443
+ if (authProfile === profile) {
2444
+ throw new ProfileConfigError(`Profile "${profile}" cannot use itself as auth_profile. Remove the auth_profile setting instead.`);
2445
+ }
2446
+ if (Object.hasOwn(config, "endpoint")) {
2447
+ throw new ProfileConfigError(`Profile "${profile}" cannot set both auth_profile and endpoint. Set the endpoint on authentication profile "${authProfile}".`);
2448
+ }
2449
+ if (readCredentialsProfile(profile).api_key) {
2450
+ throw new ProfileConfigError(`Profile "${profile}" cannot set both auth_profile and its own API key. Remove one of them.`);
2451
+ }
2452
+ const authConfig = readConfigProfile(authProfile);
2453
+ const credentials = readCredentialsProfile(authProfile);
2454
+ if (Object.keys(authConfig).length === 0 && Object.keys(credentials).length === 0) {
2455
+ throw new ProfileConfigError(`Profile "${profile}" references missing auth_profile "${authProfile}".`);
2456
+ }
2457
+ if (Object.hasOwn(authConfig, "auth_profile")) {
2458
+ throw new ProfileConfigError(`Profile "${profile}" references auth_profile "${authProfile}", which also has auth_profile set. Authentication profile references cannot be chained.`);
2459
+ }
2460
+ return authProfile;
2461
+ }
2435
2462
  function listProfiles() {
2436
2463
  const names = new Set;
2437
2464
  for (const section of listSections(readIni(configPath()))) {
@@ -2445,6 +2472,9 @@ function listProfiles() {
2445
2472
  }
2446
2473
  return [...names].sort();
2447
2474
  }
2475
+ function listAuthenticationDependents(authProfile) {
2476
+ return listProfiles().filter((profile) => profile !== authProfile && readConfigProfile(profile).auth_profile?.trim() === authProfile);
2477
+ }
2448
2478
  function writeConfigProfile(profile, values) {
2449
2479
  const doc = readIni(configPath());
2450
2480
  setSectionValues(doc, configSectionName(profile), values);
@@ -2489,11 +2519,13 @@ function resolve(candidates, fallback, fallbackSource) {
2489
2519
  function resolveProfile(overrides = {}) {
2490
2520
  const name = overrides.profile || process.env.SIM_PROFILE || DEFAULT_PROFILE;
2491
2521
  const config = readConfigProfile(name);
2492
- const credentials = readCredentialsProfile(name);
2522
+ const authProfile = resolveAuthenticationProfileName(name);
2523
+ const authConfig = authProfile === name ? config : readConfigProfile(authProfile);
2524
+ const credentials = readCredentialsProfile(authProfile);
2493
2525
  const endpoint = resolve([
2494
2526
  ["flag", overrides.endpoint],
2495
2527
  ["env", process.env.SIM_ENDPOINT],
2496
- ["config", config.endpoint]
2528
+ ["config", authConfig.endpoint]
2497
2529
  ], DEFAULT_ENDPOINT, "default");
2498
2530
  const apiKey = resolve([
2499
2531
  ["flag", overrides.apiKey],
@@ -6390,10 +6422,10 @@ var V2_OPERATIONS = {
6390
6422
  },
6391
6423
  abortKnowledgeDocumentUpload: {
6392
6424
  method: "DELETE",
6393
- path: "/api/v2/knowledge/[id]/documents/uploads/[uploadId]",
6394
- pathParams: ["id", "uploadId"],
6425
+ path: "/api/v2/knowledge/[knowledgeBaseId]/documents/uploads/[uploadId]",
6426
+ pathParams: ["knowledgeBaseId", "uploadId"],
6395
6427
  pathParamDocs: {
6396
- id: "Unique knowledge base identifier.",
6428
+ knowledgeBaseId: "Unique knowledge base identifier.",
6397
6429
  uploadId: "Upload session identifier returned when the upload was created."
6398
6430
  },
6399
6431
  responseMode: "json",
@@ -6406,6 +6438,17 @@ var V2_OPERATIONS = {
6406
6438
  }
6407
6439
  }
6408
6440
  },
6441
+ activateWorkflowVersion: {
6442
+ method: "POST",
6443
+ path: "/api/v2/workflows/[workflowId]/versions/[version]/activate",
6444
+ pathParams: ["workflowId", "version"],
6445
+ pathParamDocs: {
6446
+ workflowId: "Unique workflow identifier.",
6447
+ version: "Numeric deployment version."
6448
+ },
6449
+ responseMode: "json",
6450
+ summary: "Activate Workflow Version"
6451
+ },
6409
6452
  addTableColumn: {
6410
6453
  method: "POST",
6411
6454
  path: "/api/v2/tables/[tableId]/columns",
@@ -6444,6 +6487,73 @@ var V2_OPERATIONS = {
6444
6487
  }
6445
6488
  }
6446
6489
  },
6490
+ addWorkspaceFilesToKnowledgeBase: {
6491
+ method: "POST",
6492
+ path: "/api/v2/knowledge/[knowledgeBaseId]/documents/from-workspace-files",
6493
+ pathParams: ["knowledgeBaseId"],
6494
+ pathParamDocs: { knowledgeBaseId: "Unique knowledge base identifier." },
6495
+ responseMode: "json",
6496
+ summary: "Index Workspace Files",
6497
+ body: {
6498
+ workspaceId: {
6499
+ kind: "string",
6500
+ required: true,
6501
+ describe: "Workspace that owns both the files and the base."
6502
+ },
6503
+ fileReferences: {
6504
+ kind: "array",
6505
+ required: true,
6506
+ describe: "Workspace file identifiers or storage keys to index. Duplicates resolving to the same file are indexed once."
6507
+ }
6508
+ }
6509
+ },
6510
+ applyWorkflowOperations: {
6511
+ method: "POST",
6512
+ path: "/api/v2/workflows/[workflowId]/operations",
6513
+ pathParams: ["workflowId"],
6514
+ pathParamDocs: { workflowId: "Unique workflow identifier." },
6515
+ responseMode: "json",
6516
+ summary: "Apply Workflow Operations",
6517
+ query: {
6518
+ dryRun: {
6519
+ kind: "boolean",
6520
+ describe: "Validate and lint without persisting. The response is identical to the committed write of the same body, so a caller can inspect `lint` and then re-send the request for real. Nothing is written, no audit entry is recorded, and collaborators are not notified."
6521
+ }
6522
+ },
6523
+ body: {
6524
+ operations: { kind: "array", required: true, describe: "Edits to apply, in a single batch." },
6525
+ atomic: {
6526
+ kind: "boolean",
6527
+ default: false,
6528
+ describe: "Fail the whole batch when any operation is declined or any block input would be dropped. The default applies what it can and reports the rest in `skipped` and `inputValidationErrors`; `true` writes nothing and answers `409` instead."
6529
+ },
6530
+ layout: {
6531
+ kind: "enum",
6532
+ values: ["targeted", "none"],
6533
+ default: "targeted",
6534
+ describe: "Whether to reposition blocks the batch touched. `targeted` (default) nudges only the affected subgraph; `none` leaves every position exactly as supplied."
6535
+ },
6536
+ setBlockEnabled: {
6537
+ kind: "array",
6538
+ describe: "Blocks to enable or disable, applied after `operations`. Disabling a loop or parallel cascades to its unlocked descendants; enabling a block whose container is disabled is declined."
6539
+ }
6540
+ }
6541
+ },
6542
+ applyWorkflowVariables: {
6543
+ method: "PATCH",
6544
+ path: "/api/v2/workflows/[workflowId]/variables",
6545
+ pathParams: ["workflowId"],
6546
+ pathParamDocs: { workflowId: "Unique workflow identifier." },
6547
+ responseMode: "json",
6548
+ summary: "Update Workflow Variables",
6549
+ body: {
6550
+ operations: {
6551
+ kind: "array",
6552
+ required: true,
6553
+ describe: "Variable changes to apply, in order."
6554
+ }
6555
+ }
6556
+ },
6447
6557
  bulkDeleteFiles: {
6448
6558
  method: "POST",
6449
6559
  path: "/api/v2/files/bulk-delete",
@@ -6455,11 +6565,101 @@ var V2_OPERATIONS = {
6455
6565
  fileIds: { kind: "array", required: true, describe: "File identifiers to update." }
6456
6566
  }
6457
6567
  },
6568
+ bulkDeleteTables: {
6569
+ method: "POST",
6570
+ path: "/api/v2/tables/bulk-delete",
6571
+ pathParams: [],
6572
+ responseMode: "json",
6573
+ summary: "Bulk Delete Tables and Folders",
6574
+ body: {
6575
+ workspaceId: {
6576
+ kind: "string",
6577
+ required: true,
6578
+ describe: "Workspace that owns every selected item."
6579
+ },
6580
+ tableIds: { kind: "array", default: [], describe: "Tables to archive, by identifier." },
6581
+ folderPaths: {
6582
+ kind: "array",
6583
+ describe: "Table folders to delete, by canonical path. Each cascades to everything inside it."
6584
+ }
6585
+ }
6586
+ },
6587
+ bulkDownloadFiles: {
6588
+ method: "GET",
6589
+ path: "/api/v2/files/bulk-download",
6590
+ pathParams: [],
6591
+ responseMode: "binary",
6592
+ summary: "Bulk Download Files",
6593
+ query: {
6594
+ workspaceId: {
6595
+ kind: "string",
6596
+ required: true,
6597
+ describe: "Workspace containing the selection."
6598
+ },
6599
+ fileIds: {
6600
+ kind: "string",
6601
+ describe: "File identifiers to include, comma-separated. At most 100 entries."
6602
+ },
6603
+ folderPaths: {
6604
+ kind: "string",
6605
+ describe: "Folder paths to include with all their descendants, comma-separated. At most 100 entries, and the files they resolve to count against the same 100-file download ceiling. A path that matches no folder is rejected rather than ignored."
6606
+ }
6607
+ }
6608
+ },
6609
+ bulkSaveKnowledgeTagDefinitions: {
6610
+ method: "PUT",
6611
+ path: "/api/v2/knowledge/[knowledgeBaseId]/tags",
6612
+ pathParams: ["knowledgeBaseId"],
6613
+ pathParamDocs: { knowledgeBaseId: "Unique knowledge base identifier." },
6614
+ responseMode: "json",
6615
+ summary: "Bulk Save Tag Definitions",
6616
+ body: {
6617
+ workspaceId: {
6618
+ kind: "string",
6619
+ required: true,
6620
+ describe: "Workspace that owns the knowledge base."
6621
+ },
6622
+ definitions: {
6623
+ kind: "array",
6624
+ required: true,
6625
+ describe: "Tag definitions to create or update on the knowledge base."
6626
+ }
6627
+ }
6628
+ },
6629
+ bulkUpdateKnowledgeChunks: {
6630
+ method: "PATCH",
6631
+ path: "/api/v2/knowledge/[knowledgeBaseId]/documents/[documentId]/chunks",
6632
+ pathParams: ["knowledgeBaseId", "documentId"],
6633
+ pathParamDocs: {
6634
+ knowledgeBaseId: "Unique knowledge base identifier.",
6635
+ documentId: "Unique knowledge document identifier."
6636
+ },
6637
+ responseMode: "json",
6638
+ summary: "Bulk Update Chunks",
6639
+ body: {
6640
+ workspaceId: {
6641
+ kind: "string",
6642
+ required: true,
6643
+ describe: "Workspace that owns the knowledge base."
6644
+ },
6645
+ operation: {
6646
+ kind: "enum",
6647
+ required: true,
6648
+ values: ["enable", "disable", "delete"],
6649
+ describe: "What to do with the selected chunks."
6650
+ },
6651
+ chunkIds: {
6652
+ kind: "array",
6653
+ required: true,
6654
+ describe: "Chunks to operate on, by identifier. Ids outside the document are ignored."
6655
+ }
6656
+ }
6657
+ },
6458
6658
  bulkUpdateKnowledgeDocuments: {
6459
6659
  method: "PATCH",
6460
- path: "/api/v2/knowledge/[id]/documents",
6461
- pathParams: ["id"],
6462
- pathParamDocs: { id: "Unique knowledge base identifier." },
6660
+ path: "/api/v2/knowledge/[knowledgeBaseId]/documents",
6661
+ pathParams: ["knowledgeBaseId"],
6662
+ pathParamDocs: { knowledgeBaseId: "Unique knowledge base identifier." },
6463
6663
  responseMode: "json",
6464
6664
  summary: "Bulk Enable or Disable Documents",
6465
6665
  body: {
@@ -6486,11 +6686,48 @@ var V2_OPERATIONS = {
6486
6686
  }
6487
6687
  }
6488
6688
  },
6689
+ bulkUpdateTableRows: {
6690
+ method: "POST",
6691
+ path: "/api/v2/tables/[tableId]/rows/bulk-update",
6692
+ pathParams: ["tableId"],
6693
+ pathParamDocs: { tableId: "Unique table identifier." },
6694
+ responseMode: "json",
6695
+ summary: "Bulk Update Rows",
6696
+ body: {
6697
+ workspaceId: { kind: "string", required: true, describe: "Workspace that owns the table." },
6698
+ updates: {
6699
+ kind: "array",
6700
+ required: true,
6701
+ describe: "One merge patch per row. Each row identifier may appear at most once."
6702
+ }
6703
+ }
6704
+ },
6705
+ cancelTableDispatch: {
6706
+ method: "DELETE",
6707
+ path: "/api/v2/tables/[tableId]/dispatches/[dispatchId]",
6708
+ pathParams: ["tableId", "dispatchId"],
6709
+ pathParamDocs: {
6710
+ tableId: "Unique table identifier.",
6711
+ dispatchId: "Unique table run-dispatch identifier."
6712
+ },
6713
+ responseMode: "json",
6714
+ summary: "Cancel Run Dispatch",
6715
+ query: {
6716
+ workspaceId: {
6717
+ kind: "string",
6718
+ required: true,
6719
+ describe: "Workspace that owns the transfer resource."
6720
+ }
6721
+ }
6722
+ },
6489
6723
  cancelTableExport: {
6490
6724
  method: "DELETE",
6491
- path: "/api/v2/tables/exports/[exportId]",
6492
- pathParams: ["exportId"],
6493
- pathParamDocs: { exportId: "Unique table-export identifier." },
6725
+ path: "/api/v2/tables/[tableId]/exports/[exportId]",
6726
+ pathParams: ["tableId", "exportId"],
6727
+ pathParamDocs: {
6728
+ tableId: "Unique table identifier.",
6729
+ exportId: "Unique table-export identifier."
6730
+ },
6494
6731
  responseMode: "json",
6495
6732
  summary: "Cancel Table Export",
6496
6733
  query: {
@@ -6541,12 +6778,33 @@ var V2_OPERATIONS = {
6541
6778
  },
6542
6779
  cancelWorkflowRun: {
6543
6780
  method: "POST",
6544
- path: "/api/v2/workflows/[id]/runs/[runId]/cancel",
6545
- pathParams: ["id", "runId"],
6546
- pathParamDocs: { id: "Unique workflow identifier.", runId: "Unique workflow run identifier." },
6781
+ path: "/api/v2/workflows/[workflowId]/runs/[runId]/cancel",
6782
+ pathParams: ["workflowId", "runId"],
6783
+ pathParamDocs: {
6784
+ workflowId: "Unique workflow identifier.",
6785
+ runId: "Unique workflow run identifier."
6786
+ },
6547
6787
  responseMode: "json",
6548
6788
  summary: "Cancel Workflow Run"
6549
6789
  },
6790
+ chat: {
6791
+ method: "POST",
6792
+ path: "/api/v2/chat",
6793
+ pathParams: [],
6794
+ responseMode: "json",
6795
+ body: {
6796
+ workspaceId: {
6797
+ kind: "string",
6798
+ required: true,
6799
+ describe: "Workspace the conversation runs in."
6800
+ },
6801
+ message: { kind: "string", required: true, describe: "The message to send to Sim." },
6802
+ conversationId: {
6803
+ kind: "string",
6804
+ describe: "Conversation to continue; a new one starts when omitted."
6805
+ }
6806
+ }
6807
+ },
6550
6808
  completeFileUpload: {
6551
6809
  method: "POST",
6552
6810
  path: "/api/v2/files/uploads/[uploadId]/complete",
@@ -6564,10 +6822,10 @@ var V2_OPERATIONS = {
6564
6822
  },
6565
6823
  completeKnowledgeDocumentUpload: {
6566
6824
  method: "POST",
6567
- path: "/api/v2/knowledge/[id]/documents/uploads/[uploadId]/complete",
6568
- pathParams: ["id", "uploadId"],
6825
+ path: "/api/v2/knowledge/[knowledgeBaseId]/documents/uploads/[uploadId]/complete",
6826
+ pathParams: ["knowledgeBaseId", "uploadId"],
6569
6827
  pathParamDocs: {
6570
- id: "Unique knowledge base identifier.",
6828
+ knowledgeBaseId: "Unique knowledge base identifier.",
6571
6829
  uploadId: "Upload session identifier returned when the upload was created."
6572
6830
  },
6573
6831
  responseMode: "json",
@@ -6759,11 +7017,73 @@ var V2_OPERATIONS = {
6759
7017
  }
6760
7018
  }
6761
7019
  },
7020
+ createKnowledgeChunk: {
7021
+ method: "POST",
7022
+ path: "/api/v2/knowledge/[knowledgeBaseId]/documents/[documentId]/chunks",
7023
+ pathParams: ["knowledgeBaseId", "documentId"],
7024
+ pathParamDocs: {
7025
+ knowledgeBaseId: "Unique knowledge base identifier.",
7026
+ documentId: "Unique knowledge document identifier."
7027
+ },
7028
+ responseMode: "json",
7029
+ summary: "Create Chunk",
7030
+ body: {
7031
+ workspaceId: {
7032
+ kind: "string",
7033
+ required: true,
7034
+ describe: "Workspace that owns the knowledge base."
7035
+ },
7036
+ content: {
7037
+ kind: "string",
7038
+ required: true,
7039
+ describe: "Text to embed. It is embedded on write, so the chunk is searchable immediately."
7040
+ },
7041
+ enabled: {
7042
+ kind: "boolean",
7043
+ default: true,
7044
+ describe: "Whether the new chunk participates in search."
7045
+ }
7046
+ }
7047
+ },
7048
+ createKnowledgeConnector: {
7049
+ method: "POST",
7050
+ path: "/api/v2/knowledge/[knowledgeBaseId]/connectors",
7051
+ pathParams: ["knowledgeBaseId"],
7052
+ pathParamDocs: { knowledgeBaseId: "Unique knowledge base identifier." },
7053
+ responseMode: "json",
7054
+ summary: "Create Knowledge Connector",
7055
+ body: {
7056
+ workspaceId: {
7057
+ kind: "string",
7058
+ required: true,
7059
+ describe: "Workspace that owns the knowledge base."
7060
+ },
7061
+ connectorType: { kind: "string", required: true, describe: "Registered connector type." },
7062
+ credentialId: {
7063
+ kind: "string",
7064
+ describe: "OAuth credential identifier for connectors that require OAuth."
7065
+ },
7066
+ apiKey: {
7067
+ kind: "string",
7068
+ describe: "Write-only API key for connectors that use API-key authentication."
7069
+ },
7070
+ sourceConfig: {
7071
+ kind: "object",
7072
+ required: true,
7073
+ describe: "Connector-specific source selection and filtering configuration."
7074
+ },
7075
+ syncIntervalMinutes: {
7076
+ kind: "integer",
7077
+ default: 1440,
7078
+ describe: "Scheduled synchronization interval in minutes; zero disables scheduling."
7079
+ }
7080
+ }
7081
+ },
6762
7082
  createKnowledgeDocumentUpload: {
6763
7083
  method: "POST",
6764
- path: "/api/v2/knowledge/[id]/documents/uploads",
6765
- pathParams: ["id"],
6766
- pathParamDocs: { id: "Unique knowledge base identifier." },
7084
+ path: "/api/v2/knowledge/[knowledgeBaseId]/documents/uploads",
7085
+ pathParams: ["knowledgeBaseId"],
7086
+ pathParamDocs: { knowledgeBaseId: "Unique knowledge base identifier." },
6767
7087
  responseMode: "json",
6768
7088
  summary: "Create Document Upload",
6769
7089
  body: {
@@ -6795,10 +7115,10 @@ var V2_OPERATIONS = {
6795
7115
  },
6796
7116
  createKnowledgeDocumentUploadPartUrls: {
6797
7117
  method: "POST",
6798
- path: "/api/v2/knowledge/[id]/documents/uploads/[uploadId]/parts",
6799
- pathParams: ["id", "uploadId"],
7118
+ path: "/api/v2/knowledge/[knowledgeBaseId]/documents/uploads/[uploadId]/parts",
7119
+ pathParams: ["knowledgeBaseId", "uploadId"],
6800
7120
  pathParamDocs: {
6801
- id: "Unique knowledge base identifier.",
7121
+ knowledgeBaseId: "Unique knowledge base identifier.",
6802
7122
  uploadId: "Upload session identifier returned when the upload was created."
6803
7123
  },
6804
7124
  responseMode: "json",
@@ -6833,6 +7153,55 @@ var V2_OPERATIONS = {
6833
7153
  path: { kind: "string", required: true, describe: "Path of the folder to create." }
6834
7154
  }
6835
7155
  },
7156
+ createKnowledgeTag: {
7157
+ method: "POST",
7158
+ path: "/api/v2/knowledge/[knowledgeBaseId]/tags",
7159
+ pathParams: ["knowledgeBaseId"],
7160
+ pathParamDocs: { knowledgeBaseId: "Unique knowledge base identifier." },
7161
+ responseMode: "json",
7162
+ summary: "Create Tag",
7163
+ body: {
7164
+ workspaceId: {
7165
+ kind: "string",
7166
+ required: true,
7167
+ describe: "Workspace that owns the knowledge base."
7168
+ },
7169
+ displayName: {
7170
+ kind: "string",
7171
+ required: true,
7172
+ describe: "Name tag filters and document reads use for this tag."
7173
+ },
7174
+ fieldType: {
7175
+ kind: "enum",
7176
+ values: ["text", "number", "date", "boolean"],
7177
+ default: "text",
7178
+ describe: "Value type stored in the slot; it decides which slots are usable and which filter operators apply. Slot capacity per type: text 7, number 5, date 2, boolean 3."
7179
+ },
7180
+ tagSlot: {
7181
+ kind: "enum",
7182
+ values: [
7183
+ "tag1",
7184
+ "tag2",
7185
+ "tag3",
7186
+ "tag4",
7187
+ "tag5",
7188
+ "tag6",
7189
+ "tag7",
7190
+ "number1",
7191
+ "number2",
7192
+ "number3",
7193
+ "number4",
7194
+ "number5",
7195
+ "date1",
7196
+ "date2",
7197
+ "boolean1",
7198
+ "boolean2",
7199
+ "boolean3"
7200
+ ],
7201
+ describe: "Slot to store the tag in. Omit to take the next free slot for the field type; a slot that does not belong to the field type, or one already in use, is rejected."
7202
+ }
7203
+ }
7204
+ },
6836
7205
  createMcpServer: {
6837
7206
  method: "POST",
6838
7207
  path: "/api/v2/mcp-servers",
@@ -6923,22 +7292,11 @@ var V2_OPERATIONS = {
6923
7292
  kind: "string",
6924
7293
  describe: "Required only when provider discovery requests a client-generated ID."
6925
7294
  },
6926
- serviceAccountJson: {
7295
+ credentials: {
6927
7296
  kind: "string",
6928
- describe: "Write-only Google service-account JSON key."
6929
- },
6930
- apiToken: { kind: "string", describe: "Write-only provider API token." },
6931
- domain: { kind: "string", describe: "Provider account domain." },
6932
- signingSecret: { kind: "string", describe: "Write-only webhook signing secret." },
6933
- botToken: { kind: "string", describe: "Write-only bot token." },
6934
- clientId: { kind: "string", describe: "OAuth client identifier." },
6935
- clientSecret: { kind: "string", describe: "Write-only OAuth client secret." },
6936
- certificateId: { kind: "string", describe: "Provider certificate mapping identifier." },
6937
- orgId: { kind: "string", describe: "Provider organization ID." },
6938
- dataCenter: { kind: "string", describe: "Provider data center." },
6939
- authMethod: { kind: "string", describe: "Provider authentication method." },
6940
- privateKey: { kind: "string", describe: "Write-only PEM private key." },
6941
- username: { kind: "string", describe: "Provider run-as username." }
7297
+ required: true,
7298
+ describe: "Write-only JSON object string containing the fields declared by credential-provider discovery."
7299
+ }
6942
7300
  }
6943
7301
  },
6944
7302
  createSkill: {
@@ -6984,6 +7342,35 @@ var V2_OPERATIONS = {
6984
7342
  folderPath: { kind: "string", describe: "Folder in which to create the table." }
6985
7343
  }
6986
7344
  },
7345
+ createTableDispatch: {
7346
+ method: "POST",
7347
+ path: "/api/v2/tables/[tableId]/dispatches",
7348
+ pathParams: ["tableId"],
7349
+ pathParamDocs: { tableId: "Unique table identifier." },
7350
+ responseMode: "json",
7351
+ summary: "Create Run Dispatch",
7352
+ body: {
7353
+ workspaceId: { kind: "string", required: true, describe: "Unique workspace identifier." },
7354
+ groupIds: {
7355
+ kind: "array",
7356
+ required: true,
7357
+ describe: "Workflow or enrichment groups to run."
7358
+ },
7359
+ runMode: {
7360
+ kind: "enum",
7361
+ values: ["all", "incomplete"],
7362
+ default: "all",
7363
+ describe: "Whether to run all or only incomplete cells."
7364
+ },
7365
+ rowIds: { kind: "array", describe: "Explicit row subset to run." },
7366
+ filter: {
7367
+ kind: "unknown",
7368
+ 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.'
7369
+ },
7370
+ excludeRowIds: { kind: "array", describe: "Rows excluded from a select-all run scope." },
7371
+ limit: { kind: "object", describe: "Optional cap on eligible rows to run." }
7372
+ }
7373
+ },
6987
7374
  createTableExport: {
6988
7375
  method: "POST",
6989
7376
  path: "/api/v2/tables/[tableId]/exports",
@@ -7120,11 +7507,40 @@ var V2_OPERATIONS = {
7120
7507
  path: { kind: "string", required: true, describe: "Path of the folder to create." }
7121
7508
  }
7122
7509
  },
7123
- deleteCredential: {
7124
- method: "DELETE",
7510
+ createWorkflowMcpServer: {
7511
+ method: "POST",
7512
+ path: "/api/v2/workflow-mcp-servers",
7513
+ pathParams: [],
7514
+ responseMode: "json",
7515
+ summary: "Create Workflow MCP Server",
7516
+ body: {
7517
+ workspaceId: {
7518
+ kind: "string",
7519
+ required: true,
7520
+ describe: "Workspace in which to publish the server."
7521
+ },
7522
+ name: {
7523
+ kind: "string",
7524
+ required: true,
7525
+ describe: "Server display name, shown to connecting MCP clients."
7526
+ },
7527
+ description: { kind: "string", describe: "Optional server description." },
7528
+ isPublic: {
7529
+ kind: "boolean",
7530
+ default: false,
7531
+ describe: "Whether the server answers MCP clients without a Sim API key. Defaults to false — a public server executes the workflows it publishes for anyone holding its URL."
7532
+ },
7533
+ workflowIds: {
7534
+ kind: "array",
7535
+ describe: "Deployed workflows to publish as tools on the new server."
7536
+ }
7537
+ }
7538
+ },
7539
+ deleteCredential: {
7540
+ method: "DELETE",
7125
7541
  path: "/api/v2/credentials/[credentialId]",
7126
7542
  pathParams: ["credentialId"],
7127
- pathParamDocs: { credentialId: "Credential to disconnect." },
7543
+ pathParamDocs: { credentialId: "Credential to update or disconnect." },
7128
7544
  responseMode: "json",
7129
7545
  summary: "Disconnect Credential",
7130
7546
  query: {
@@ -7137,9 +7553,9 @@ var V2_OPERATIONS = {
7137
7553
  },
7138
7554
  deleteCustomTool: {
7139
7555
  method: "DELETE",
7140
- path: "/api/v2/custom-tools/[id]",
7141
- pathParams: ["id"],
7142
- pathParamDocs: { id: "Unique custom tool identifier." },
7556
+ path: "/api/v2/custom-tools/[customToolId]",
7557
+ pathParams: ["customToolId"],
7558
+ pathParamDocs: { customToolId: "Unique custom tool identifier." },
7143
7559
  responseMode: "json",
7144
7560
  summary: "Delete Custom Tool",
7145
7561
  query: {
@@ -7193,9 +7609,9 @@ var V2_OPERATIONS = {
7193
7609
  },
7194
7610
  deleteKnowledgeBase: {
7195
7611
  method: "DELETE",
7196
- path: "/api/v2/knowledge/[id]",
7197
- pathParams: ["id"],
7198
- pathParamDocs: { id: "Unique knowledge base identifier." },
7612
+ path: "/api/v2/knowledge/[knowledgeBaseId]",
7613
+ pathParams: ["knowledgeBaseId"],
7614
+ pathParamDocs: { knowledgeBaseId: "Unique knowledge base identifier." },
7199
7615
  responseMode: "json",
7200
7616
  summary: "Delete Knowledge Base",
7201
7617
  query: {
@@ -7206,12 +7622,53 @@ var V2_OPERATIONS = {
7206
7622
  }
7207
7623
  }
7208
7624
  },
7625
+ deleteKnowledgeChunk: {
7626
+ method: "DELETE",
7627
+ path: "/api/v2/knowledge/[knowledgeBaseId]/documents/[documentId]/chunks/[chunkId]",
7628
+ pathParams: ["knowledgeBaseId", "documentId", "chunkId"],
7629
+ pathParamDocs: {
7630
+ knowledgeBaseId: "Unique knowledge base identifier.",
7631
+ documentId: "Unique knowledge document identifier.",
7632
+ chunkId: "Unique chunk identifier."
7633
+ },
7634
+ responseMode: "json",
7635
+ summary: "Delete Chunk",
7636
+ query: {
7637
+ workspaceId: {
7638
+ kind: "string",
7639
+ required: true,
7640
+ describe: "Workspace that owns the knowledge base."
7641
+ }
7642
+ }
7643
+ },
7644
+ deleteKnowledgeConnector: {
7645
+ method: "DELETE",
7646
+ path: "/api/v2/knowledge/[knowledgeBaseId]/connectors/[connectorId]",
7647
+ pathParams: ["knowledgeBaseId", "connectorId"],
7648
+ pathParamDocs: {
7649
+ knowledgeBaseId: "Knowledge base that owns the connector.",
7650
+ connectorId: "Connector selected for the operation."
7651
+ },
7652
+ responseMode: "json",
7653
+ summary: "Delete Knowledge Connector",
7654
+ query: {
7655
+ workspaceId: {
7656
+ kind: "string",
7657
+ required: true,
7658
+ describe: "Workspace that owns the knowledge base."
7659
+ },
7660
+ deleteDocuments: {
7661
+ kind: "boolean",
7662
+ describe: "Also permanently delete documents produced by this connector."
7663
+ }
7664
+ }
7665
+ },
7209
7666
  deleteKnowledgeDocument: {
7210
7667
  method: "DELETE",
7211
- path: "/api/v2/knowledge/[id]/documents/[documentId]",
7212
- pathParams: ["id", "documentId"],
7668
+ path: "/api/v2/knowledge/[knowledgeBaseId]/documents/[documentId]",
7669
+ pathParams: ["knowledgeBaseId", "documentId"],
7213
7670
  pathParamDocs: {
7214
- id: "Unique knowledge base identifier.",
7671
+ knowledgeBaseId: "Unique knowledge base identifier.",
7215
7672
  documentId: "Unique knowledge document identifier."
7216
7673
  },
7217
7674
  responseMode: "json",
@@ -7254,11 +7711,48 @@ var V2_OPERATIONS = {
7254
7711
  }
7255
7712
  }
7256
7713
  },
7714
+ deleteKnowledgeTag: {
7715
+ method: "DELETE",
7716
+ path: "/api/v2/knowledge/[knowledgeBaseId]/tags/[tagId]",
7717
+ pathParams: ["knowledgeBaseId", "tagId"],
7718
+ pathParamDocs: {
7719
+ knowledgeBaseId: "Unique knowledge base identifier.",
7720
+ tagId: "Unique tag definition identifier."
7721
+ },
7722
+ responseMode: "json",
7723
+ summary: "Delete Tag",
7724
+ query: {
7725
+ workspaceId: {
7726
+ kind: "string",
7727
+ required: true,
7728
+ describe: "Workspace that owns the knowledge base."
7729
+ }
7730
+ }
7731
+ },
7732
+ deleteKnowledgeTagDefinitions: {
7733
+ method: "DELETE",
7734
+ path: "/api/v2/knowledge/[knowledgeBaseId]/tags",
7735
+ pathParams: ["knowledgeBaseId"],
7736
+ pathParamDocs: { knowledgeBaseId: "Unique knowledge base identifier." },
7737
+ responseMode: "json",
7738
+ summary: "Delete Tag Definitions",
7739
+ query: {
7740
+ workspaceId: {
7741
+ kind: "string",
7742
+ required: true,
7743
+ describe: "Workspace that owns the knowledge base."
7744
+ },
7745
+ unused: {
7746
+ kind: "boolean",
7747
+ describe: "Whether to remove only the tag definitions no document in the knowledge base still carries a value for. Defaults to true. Pass `unused=false` to delete every definition on the knowledge base, which also clears its slot on every document and chunk and is not recoverable."
7748
+ }
7749
+ }
7750
+ },
7257
7751
  deleteMcpServer: {
7258
7752
  method: "DELETE",
7259
- path: "/api/v2/mcp-servers/[id]",
7260
- pathParams: ["id"],
7261
- pathParamDocs: { id: "Unique MCP server identifier." },
7753
+ path: "/api/v2/mcp-servers/[mcpServerId]",
7754
+ pathParams: ["mcpServerId"],
7755
+ pathParamDocs: { mcpServerId: "Unique MCP server identifier." },
7262
7756
  responseMode: "json",
7263
7757
  summary: "Delete MCP Server",
7264
7758
  query: {
@@ -7292,10 +7786,10 @@ var V2_OPERATIONS = {
7292
7786
  },
7293
7787
  deleteSkill: {
7294
7788
  method: "DELETE",
7295
- path: "/api/v2/skills/[id]",
7296
- pathParams: ["id"],
7789
+ path: "/api/v2/skills/[skillId]",
7790
+ pathParams: ["skillId"],
7297
7791
  pathParamDocs: {
7298
- id: "Unique skill identifier. A built-in skill is `builtin-` followed by its name, for example `builtin-research`."
7792
+ skillId: "Unique skill identifier. A built-in skill is `builtin-` followed by its name, for example `builtin-research`."
7299
7793
  },
7300
7794
  responseMode: "json",
7301
7795
  summary: "Delete Skill",
@@ -7397,12 +7891,20 @@ var V2_OPERATIONS = {
7397
7891
  },
7398
7892
  deleteWorkflow: {
7399
7893
  method: "DELETE",
7400
- path: "/api/v2/workflows/[id]",
7401
- pathParams: ["id"],
7402
- pathParamDocs: { id: "Unique workflow identifier." },
7894
+ path: "/api/v2/workflows/[workflowId]",
7895
+ pathParams: ["workflowId"],
7896
+ pathParamDocs: { workflowId: "Unique workflow identifier." },
7403
7897
  responseMode: "json",
7404
7898
  summary: "Delete Workflow"
7405
7899
  },
7900
+ deleteWorkflowChatDeployment: {
7901
+ method: "DELETE",
7902
+ path: "/api/v2/workflows/[workflowId]/deployments/chat",
7903
+ pathParams: ["workflowId"],
7904
+ pathParamDocs: { workflowId: "Unique workflow identifier." },
7905
+ responseMode: "json",
7906
+ summary: "Delete Workflow Chat Deployment"
7907
+ },
7406
7908
  deleteWorkflowFolder: {
7407
7909
  method: "DELETE",
7408
7910
  path: "/api/v2/workflows/folders",
@@ -7445,11 +7947,19 @@ var V2_OPERATIONS = {
7445
7947
  groupId: { kind: "string", required: true, describe: "Workflow group to delete." }
7446
7948
  }
7447
7949
  },
7950
+ deleteWorkflowMcpServer: {
7951
+ method: "DELETE",
7952
+ path: "/api/v2/workflow-mcp-servers/[serverId]",
7953
+ pathParams: ["serverId"],
7954
+ pathParamDocs: { serverId: "Unique workflow-MCP server identifier." },
7955
+ responseMode: "json",
7956
+ summary: "Delete Workflow MCP Server"
7957
+ },
7448
7958
  deployWorkflow: {
7449
7959
  method: "POST",
7450
- path: "/api/v2/workflows/[id]/deploy",
7451
- pathParams: ["id"],
7452
- pathParamDocs: { id: "Unique workflow identifier." },
7960
+ path: "/api/v2/workflows/[workflowId]/deploy",
7961
+ pathParams: ["workflowId"],
7962
+ pathParamDocs: { workflowId: "Unique workflow identifier." },
7453
7963
  responseMode: "json",
7454
7964
  summary: "Deploy Workflow",
7455
7965
  body: {
@@ -7460,6 +7970,33 @@ var V2_OPERATIONS = {
7460
7970
  }
7461
7971
  }
7462
7972
  },
7973
+ deployWorkflowMcpTool: {
7974
+ method: "POST",
7975
+ path: "/api/v2/workflow-mcp-servers/[serverId]/tools",
7976
+ pathParams: ["serverId"],
7977
+ pathParamDocs: { serverId: "Unique workflow-MCP server identifier." },
7978
+ responseMode: "json",
7979
+ summary: "Publish Workflow As MCP Tool",
7980
+ body: {
7981
+ workflowId: {
7982
+ kind: "string",
7983
+ required: true,
7984
+ describe: "Deployed workflow to publish. The workflow must already be deployed."
7985
+ },
7986
+ toolName: {
7987
+ kind: "string",
7988
+ describe: "Name MCP clients call. Normalized to the MCP tool-name grammar, and derived from the workflow name when omitted."
7989
+ },
7990
+ toolDescription: {
7991
+ kind: "string",
7992
+ describe: "Description shown to MCP clients. Derived from the workflow name when omitted."
7993
+ },
7994
+ parameterDescriptions: {
7995
+ kind: "array",
7996
+ describe: "Per-field description overrides applied to the schema generated from the deployed workflow inputs. A name matching no input field is ignored."
7997
+ }
7998
+ }
7999
+ },
7463
8000
  downloadFile: {
7464
8001
  method: "GET",
7465
8002
  path: "/api/v2/files/[fileId]",
@@ -7471,17 +8008,51 @@ var V2_OPERATIONS = {
7471
8008
  workspaceId: { kind: "string", required: true, describe: "Workspace that owns the file." }
7472
8009
  }
7473
8010
  },
8011
+ downloadRunFile: {
8012
+ method: "GET",
8013
+ path: "/api/v2/workflows/[workflowId]/runs/[runId]/files/[fileId]",
8014
+ pathParams: ["workflowId", "runId", "fileId"],
8015
+ pathParamDocs: {
8016
+ workflowId: "Unique workflow identifier.",
8017
+ runId: "Unique workflow run identifier.",
8018
+ fileId: "Identifier of a file the run produced, as reported by the run resource."
8019
+ },
8020
+ responseMode: "binary",
8021
+ summary: "Download Workflow Run File"
8022
+ },
8023
+ duplicateWorkflow: {
8024
+ method: "POST",
8025
+ path: "/api/v2/workflows/[workflowId]/duplicate",
8026
+ pathParams: ["workflowId"],
8027
+ pathParamDocs: { workflowId: "Unique workflow identifier." },
8028
+ responseMode: "json",
8029
+ summary: "Duplicate Workflow",
8030
+ body: {
8031
+ name: {
8032
+ kind: "string",
8033
+ describe: "Name for the copy. Defaults to the source name, deduplicated within the folder."
8034
+ },
8035
+ folderPath: {
8036
+ kind: "string",
8037
+ describe: "Destination folder path. Defaults to the source workflow's folder."
8038
+ }
8039
+ }
8040
+ },
7474
8041
  executeWorkflow: {
7475
8042
  method: "POST",
7476
- path: "/api/v2/workflows/[id]/execute",
7477
- pathParams: ["id"],
7478
- pathParamDocs: { id: "Unique workflow identifier." },
8043
+ path: "/api/v2/workflows/[workflowId]/execute",
8044
+ pathParams: ["workflowId"],
8045
+ pathParamDocs: { workflowId: "Unique workflow identifier." },
7479
8046
  responseMode: "json",
7480
8047
  summary: "Execute Workflow",
7481
8048
  body: {
7482
8049
  input: {
7483
8050
  kind: "object",
7484
- describe: "Workflow input keyed by deployed trigger input-field name."
8051
+ describe: "Workflow input keyed by the selected trigger input-field name."
8052
+ },
8053
+ run: {
8054
+ kind: "unknown",
8055
+ describe: "Workflow state and entry point to execute. Omit for the active deployment. Manual execution requires a personal API key with write access and supports synchronous or streamed runs only."
7485
8056
  },
7486
8057
  async: {
7487
8058
  kind: "boolean",
@@ -7517,40 +8088,23 @@ var V2_OPERATIONS = {
7517
8088
  },
7518
8089
  base64MaxBytes: {
7519
8090
  kind: "integer",
7520
- describe: "Maximum total bytes of file content to inline as base64. Rejected when `async` is true."
8091
+ describe: "Maximum total bytes of file content to inline as base64, lowering but never raising the server limit of 16 MiB. Rejected when `async` is true."
7521
8092
  }
7522
8093
  }
7523
8094
  },
7524
8095
  exportWorkflow: {
7525
8096
  method: "GET",
7526
- path: "/api/v2/workflows/[id]/export",
7527
- pathParams: ["id"],
7528
- pathParamDocs: { id: "Unique workflow identifier." },
8097
+ path: "/api/v2/workflows/[workflowId]/export",
8098
+ pathParams: ["workflowId"],
8099
+ pathParamDocs: { workflowId: "Unique workflow identifier." },
7529
8100
  responseMode: "json",
7530
8101
  summary: "Export Workflow"
7531
8102
  },
7532
- findTableRows: {
7533
- method: "POST",
7534
- path: "/api/v2/tables/[tableId]/rows/find",
7535
- pathParams: ["tableId"],
7536
- pathParamDocs: { tableId: "Unique table identifier." },
7537
- responseMode: "json",
7538
- summary: "Find Rows",
7539
- body: {
7540
- workspaceId: { kind: "string", required: true, describe: "Unique workspace identifier." },
7541
- q: { kind: "string", required: true, describe: "Case-insensitive cell substring to find." },
7542
- predicate: {
7543
- kind: "unknown",
7544
- 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.'
7545
- },
7546
- sort: { kind: "array", describe: "Ordered table-row sort specification." }
7547
- }
7548
- },
7549
8103
  getAuditLog: {
7550
8104
  method: "GET",
7551
- path: "/api/v2/audit-logs/[id]",
7552
- pathParams: ["id"],
7553
- pathParamDocs: { id: "Audit-log entry identifier." },
8105
+ path: "/api/v2/audit-logs/[auditLogId]",
8106
+ pathParams: ["auditLogId"],
8107
+ pathParamDocs: { auditLogId: "Audit-log entry identifier." },
7554
8108
  responseMode: "json",
7555
8109
  summary: "Get Audit Log",
7556
8110
  query: {
@@ -7570,15 +8124,32 @@ var V2_OPERATIONS = {
7570
8124
  query: {
7571
8125
  workspaceId: {
7572
8126
  kind: "string",
7573
- describe: "Workspace whose payer should be resolved. Workspace API keys are pinned to their own workspace."
8127
+ describe: "Workspace whose payer should be resolved. A workspace API key is pinned to its own workspace: any other id answers `404 Workspace not found`, which is also what an id that does not exist answers."
8128
+ }
8129
+ }
8130
+ },
8131
+ getBlock: {
8132
+ method: "GET",
8133
+ path: "/api/v2/blocks/[blockId]",
8134
+ pathParams: ["blockId"],
8135
+ pathParamDocs: {
8136
+ blockId: "Block type identifier. An unversioned base type resolves to the newest version, and the response echoes the resolved id."
8137
+ },
8138
+ responseMode: "json",
8139
+ summary: "Get Block",
8140
+ query: {
8141
+ workspaceId: {
8142
+ kind: "string",
8143
+ required: true,
8144
+ describe: "Workspace whose integration allowlist, revealed preview blocks, and deployed custom blocks decide what this catalog contains."
7574
8145
  }
7575
8146
  }
7576
8147
  },
7577
8148
  getCustomTool: {
7578
8149
  method: "GET",
7579
- path: "/api/v2/custom-tools/[id]",
7580
- pathParams: ["id"],
7581
- pathParamDocs: { id: "Unique custom tool identifier." },
8150
+ path: "/api/v2/custom-tools/[customToolId]",
8151
+ pathParams: ["customToolId"],
8152
+ pathParamDocs: { customToolId: "Unique custom tool identifier." },
7582
8153
  responseMode: "json",
7583
8154
  summary: "Get Custom Tool",
7584
8155
  query: {
@@ -7617,11 +8188,26 @@ var V2_OPERATIONS = {
7617
8188
  workspaceId: { kind: "string", required: true, describe: "Workspace that owns the file." }
7618
8189
  }
7619
8190
  },
8191
+ getFileUpload: {
8192
+ method: "GET",
8193
+ path: "/api/v2/files/uploads/[uploadId]",
8194
+ pathParams: ["uploadId"],
8195
+ pathParamDocs: { uploadId: "Upload session identifier." },
8196
+ responseMode: "json",
8197
+ summary: "Get File Upload",
8198
+ query: {
8199
+ workspaceId: {
8200
+ kind: "string",
8201
+ required: true,
8202
+ describe: "Workspace that owns the upload session."
8203
+ }
8204
+ }
8205
+ },
7620
8206
  getKnowledgeBase: {
7621
8207
  method: "GET",
7622
- path: "/api/v2/knowledge/[id]",
7623
- pathParams: ["id"],
7624
- pathParamDocs: { id: "Unique knowledge base identifier." },
8208
+ path: "/api/v2/knowledge/[knowledgeBaseId]",
8209
+ pathParams: ["knowledgeBaseId"],
8210
+ pathParamDocs: { knowledgeBaseId: "Unique knowledge base identifier." },
7625
8211
  responseMode: "json",
7626
8212
  summary: "Get Knowledge Base",
7627
8213
  query: {
@@ -7632,12 +8218,49 @@ var V2_OPERATIONS = {
7632
8218
  }
7633
8219
  }
7634
8220
  },
8221
+ getKnowledgeChunk: {
8222
+ method: "GET",
8223
+ path: "/api/v2/knowledge/[knowledgeBaseId]/documents/[documentId]/chunks/[chunkId]",
8224
+ pathParams: ["knowledgeBaseId", "documentId", "chunkId"],
8225
+ pathParamDocs: {
8226
+ knowledgeBaseId: "Unique knowledge base identifier.",
8227
+ documentId: "Unique knowledge document identifier.",
8228
+ chunkId: "Unique chunk identifier."
8229
+ },
8230
+ responseMode: "json",
8231
+ summary: "Get Chunk",
8232
+ query: {
8233
+ workspaceId: {
8234
+ kind: "string",
8235
+ required: true,
8236
+ describe: "Workspace that owns the knowledge base."
8237
+ }
8238
+ }
8239
+ },
8240
+ getKnowledgeConnector: {
8241
+ method: "GET",
8242
+ path: "/api/v2/knowledge/[knowledgeBaseId]/connectors/[connectorId]",
8243
+ pathParams: ["knowledgeBaseId", "connectorId"],
8244
+ pathParamDocs: {
8245
+ knowledgeBaseId: "Knowledge base that owns the connector.",
8246
+ connectorId: "Connector selected for the operation."
8247
+ },
8248
+ responseMode: "json",
8249
+ summary: "Get Knowledge Connector",
8250
+ query: {
8251
+ workspaceId: {
8252
+ kind: "string",
8253
+ required: true,
8254
+ describe: "Workspace that owns the knowledge base."
8255
+ }
8256
+ }
8257
+ },
7635
8258
  getKnowledgeDocument: {
7636
8259
  method: "GET",
7637
- path: "/api/v2/knowledge/[id]/documents/[documentId]",
7638
- pathParams: ["id", "documentId"],
8260
+ path: "/api/v2/knowledge/[knowledgeBaseId]/documents/[documentId]",
8261
+ pathParams: ["knowledgeBaseId", "documentId"],
7639
8262
  pathParamDocs: {
7640
- id: "Unique knowledge base identifier.",
8263
+ knowledgeBaseId: "Unique knowledge base identifier.",
7641
8264
  documentId: "Unique knowledge document identifier."
7642
8265
  },
7643
8266
  responseMode: "json",
@@ -7658,11 +8281,55 @@ var V2_OPERATIONS = {
7658
8281
  responseMode: "json",
7659
8282
  summary: "Get Log"
7660
8283
  },
8284
+ getLogStats: {
8285
+ method: "GET",
8286
+ path: "/api/v2/logs/stats",
8287
+ pathParams: [],
8288
+ responseMode: "json",
8289
+ summary: "Get Log Statistics",
8290
+ query: {
8291
+ workspaceId: {
8292
+ kind: "string",
8293
+ required: true,
8294
+ describe: "Workspace whose execution statistics to summarize."
8295
+ },
8296
+ workflowIds: {
8297
+ kind: "string",
8298
+ describe: "Comma-separated workflow identifiers to include. At most 200 entries. An empty entry is rejected."
8299
+ },
8300
+ folderPaths: {
8301
+ kind: "string",
8302
+ describe: "Comma-separated workflow folder paths to include. At most 100 entries. A path covers its whole subtree. A path that names no folder narrows the result to nothing, so the response is an empty page rather than an error."
8303
+ },
8304
+ triggers: {
8305
+ kind: "string",
8306
+ describe: "Comma-separated trigger types to include. An empty entry is rejected. The vocabulary is open, so an unrecognized member selects no runs; the literal `all` disables this filter."
8307
+ },
8308
+ level: {
8309
+ kind: "enum",
8310
+ values: ["info", "error"],
8311
+ describe: "Severity level to include."
8312
+ },
8313
+ startDate: {
8314
+ kind: "string",
8315
+ 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."
8316
+ },
8317
+ endDate: {
8318
+ kind: "string",
8319
+ 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."
8320
+ },
8321
+ segmentCount: {
8322
+ kind: "integer",
8323
+ default: 72,
8324
+ describe: "Number of equal time buckets to divide the window into, from 1 to 500. Exactly this many buckets are always returned. Buckets are never narrower than one minute, so on a short window the series extends past the end of the window rather than being compressed, and the trailing buckets are empty."
8325
+ }
8326
+ }
8327
+ },
7661
8328
  getMcpServer: {
7662
8329
  method: "GET",
7663
- path: "/api/v2/mcp-servers/[id]",
7664
- pathParams: ["id"],
7665
- pathParamDocs: { id: "Unique MCP server identifier." },
8330
+ path: "/api/v2/mcp-servers/[mcpServerId]",
8331
+ pathParams: ["mcpServerId"],
8332
+ pathParamDocs: { mcpServerId: "Unique MCP server identifier." },
7666
8333
  responseMode: "json",
7667
8334
  summary: "Get MCP Server",
7668
8335
  query: {
@@ -7673,12 +8340,55 @@ var V2_OPERATIONS = {
7673
8340
  }
7674
8341
  }
7675
8342
  },
8343
+ getMeta: {
8344
+ method: "GET",
8345
+ path: "/api/v2/meta",
8346
+ pathParams: [],
8347
+ responseMode: "json",
8348
+ summary: "Get API Capabilities"
8349
+ },
8350
+ getNextKnowledgeTagSlot: {
8351
+ method: "GET",
8352
+ path: "/api/v2/knowledge/[knowledgeBaseId]/tags/next-slot",
8353
+ pathParams: ["knowledgeBaseId"],
8354
+ pathParamDocs: { knowledgeBaseId: "Unique knowledge base identifier." },
8355
+ responseMode: "json",
8356
+ summary: "Get Next Tag Slot",
8357
+ query: {
8358
+ workspaceId: {
8359
+ kind: "string",
8360
+ required: true,
8361
+ describe: "Workspace that owns the knowledge base."
8362
+ },
8363
+ fieldType: {
8364
+ kind: "enum",
8365
+ required: true,
8366
+ values: ["text", "number", "date", "boolean"],
8367
+ describe: "Value type stored in the slot; it decides which slots are usable and which filter operators apply. Slot capacity per type: text 7, number 5, date 2, boolean 3."
8368
+ }
8369
+ }
8370
+ },
8371
+ getRowEnrichment: {
8372
+ method: "GET",
8373
+ path: "/api/v2/tables/[tableId]/rows/[rowId]/enrichment/[groupId]",
8374
+ pathParams: ["tableId", "rowId", "groupId"],
8375
+ pathParamDocs: {
8376
+ tableId: "Unique table identifier.",
8377
+ rowId: "Unique table row identifier.",
8378
+ groupId: "Workflow or enrichment group to run."
8379
+ },
8380
+ responseMode: "json",
8381
+ summary: "Get Enrichment Run Detail",
8382
+ query: {
8383
+ workspaceId: { kind: "string", required: true, describe: "Workspace that owns the table." }
8384
+ }
8385
+ },
7676
8386
  getSkill: {
7677
8387
  method: "GET",
7678
- path: "/api/v2/skills/[id]",
7679
- pathParams: ["id"],
8388
+ path: "/api/v2/skills/[skillId]",
8389
+ pathParams: ["skillId"],
7680
8390
  pathParamDocs: {
7681
- id: "Unique skill identifier. A built-in skill is `builtin-` followed by its name, for example `builtin-research`."
8391
+ skillId: "Unique skill identifier. A built-in skill is `builtin-` followed by its name, for example `builtin-research`."
7682
8392
  },
7683
8393
  responseMode: "json",
7684
8394
  summary: "Get Skill",
@@ -7697,11 +8407,32 @@ var V2_OPERATIONS = {
7697
8407
  workspaceId: { kind: "string", required: true, describe: "Workspace that owns the table." }
7698
8408
  }
7699
8409
  },
8410
+ getTableDispatch: {
8411
+ method: "GET",
8412
+ path: "/api/v2/tables/[tableId]/dispatches/[dispatchId]",
8413
+ pathParams: ["tableId", "dispatchId"],
8414
+ pathParamDocs: {
8415
+ tableId: "Unique table identifier.",
8416
+ dispatchId: "Unique table run-dispatch identifier."
8417
+ },
8418
+ responseMode: "json",
8419
+ summary: "Get Run Dispatch",
8420
+ query: {
8421
+ workspaceId: {
8422
+ kind: "string",
8423
+ required: true,
8424
+ describe: "Workspace that owns the transfer resource."
8425
+ }
8426
+ }
8427
+ },
7700
8428
  getTableExport: {
7701
8429
  method: "GET",
7702
- path: "/api/v2/tables/exports/[exportId]",
7703
- pathParams: ["exportId"],
7704
- pathParamDocs: { exportId: "Unique table-export identifier." },
8430
+ path: "/api/v2/tables/[tableId]/exports/[exportId]",
8431
+ pathParams: ["tableId", "exportId"],
8432
+ pathParamDocs: {
8433
+ tableId: "Unique table identifier.",
8434
+ exportId: "Unique table-export identifier."
8435
+ },
7705
8436
  responseMode: "json",
7706
8437
  summary: "Get Table Export",
7707
8438
  query: {
@@ -7735,9 +8466,13 @@ var V2_OPERATIONS = {
7735
8466
  responseMode: "json",
7736
8467
  summary: "Get Row",
7737
8468
  query: {
7738
- workspaceId: { kind: "string", required: true, describe: "Workspace that owns the table." }
7739
- }
7740
- },
8469
+ workspaceId: { kind: "string", required: true, describe: "Workspace that owns the table." },
8470
+ includeRunState: {
8471
+ kind: "boolean",
8472
+ describe: "Include per-workflow-group run state on the returned row. Off by default."
8473
+ }
8474
+ }
8475
+ },
7741
8476
  getTableView: {
7742
8477
  method: "GET",
7743
8478
  path: "/api/v2/tables/[tableId]/views/[viewId]",
@@ -7749,27 +8484,63 @@ var V2_OPERATIONS = {
7749
8484
  workspaceId: { kind: "string", required: true, describe: "Workspace that owns the table." }
7750
8485
  }
7751
8486
  },
8487
+ getTool: {
8488
+ method: "GET",
8489
+ path: "/api/v2/tools/[toolId]",
8490
+ pathParams: ["toolId"],
8491
+ pathParamDocs: {
8492
+ toolId: "Tool identifier. An unversioned name resolves to the newest version, and the response echoes the resolved id."
8493
+ },
8494
+ responseMode: "json",
8495
+ summary: "Get Tool",
8496
+ query: {
8497
+ workspaceId: {
8498
+ kind: "string",
8499
+ required: true,
8500
+ describe: "Workspace whose integration allowlist, revealed preview blocks, and deployed custom blocks decide what this catalog contains."
8501
+ }
8502
+ }
8503
+ },
7752
8504
  getWorkflow: {
7753
8505
  method: "GET",
7754
- path: "/api/v2/workflows/[id]",
7755
- pathParams: ["id"],
7756
- pathParamDocs: { id: "Unique workflow identifier." },
8506
+ path: "/api/v2/workflows/[workflowId]",
8507
+ pathParams: ["workflowId"],
8508
+ pathParamDocs: { workflowId: "Unique workflow identifier." },
7757
8509
  responseMode: "json",
7758
8510
  summary: "Get Workflow"
7759
8511
  },
8512
+ getWorkflowChatDeployment: {
8513
+ method: "GET",
8514
+ path: "/api/v2/workflows/[workflowId]/deployments/chat",
8515
+ pathParams: ["workflowId"],
8516
+ pathParamDocs: { workflowId: "Unique workflow identifier." },
8517
+ responseMode: "json",
8518
+ summary: "Get Workflow Chat Deployment"
8519
+ },
7760
8520
  getWorkflowDeployment: {
7761
8521
  method: "GET",
7762
- path: "/api/v2/workflows/[id]/deployment",
7763
- pathParams: ["id"],
7764
- pathParamDocs: { id: "Unique workflow identifier." },
8522
+ path: "/api/v2/workflows/[workflowId]/deployment",
8523
+ pathParams: ["workflowId"],
8524
+ pathParamDocs: { workflowId: "Unique workflow identifier." },
7765
8525
  responseMode: "json",
7766
8526
  summary: "Get Workflow Deployment"
7767
8527
  },
8528
+ getWorkflowMcpServer: {
8529
+ method: "GET",
8530
+ path: "/api/v2/workflow-mcp-servers/[serverId]",
8531
+ pathParams: ["serverId"],
8532
+ pathParamDocs: { serverId: "Unique workflow-MCP server identifier." },
8533
+ responseMode: "json",
8534
+ summary: "Get Workflow MCP Server"
8535
+ },
7768
8536
  getWorkflowRun: {
7769
8537
  method: "GET",
7770
- path: "/api/v2/workflows/[id]/runs/[runId]",
7771
- pathParams: ["id", "runId"],
7772
- pathParamDocs: { id: "Unique workflow identifier.", runId: "Unique workflow run identifier." },
8538
+ path: "/api/v2/workflows/[workflowId]/runs/[runId]",
8539
+ pathParams: ["workflowId", "runId"],
8540
+ pathParamDocs: {
8541
+ workflowId: "Unique workflow identifier.",
8542
+ runId: "Unique workflow run identifier."
8543
+ },
7773
8544
  responseMode: "json",
7774
8545
  summary: "Get Workflow Run",
7775
8546
  query: {
@@ -7780,14 +8551,33 @@ var V2_OPERATIONS = {
7780
8551
  selectedOutputs: {
7781
8552
  kind: "string",
7782
8553
  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`."
8554
+ },
8555
+ includeFileBase64: {
8556
+ kind: "boolean",
8557
+ describe: "Inline each produced file's bytes as base64. Requires `includeOutput`. A file above the inline ceiling answers `413` naming its download path; fetch large files from `downloadPath` instead."
8558
+ },
8559
+ base64MaxBytes: {
8560
+ kind: "integer",
8561
+ describe: "Per-file inline ceiling, lowering but never raising the server limit of 16 MiB."
7783
8562
  }
7784
8563
  }
7785
8564
  },
8565
+ getWorkflowState: {
8566
+ method: "GET",
8567
+ path: "/api/v2/workflows/[workflowId]/state",
8568
+ pathParams: ["workflowId"],
8569
+ pathParamDocs: { workflowId: "Unique workflow identifier." },
8570
+ responseMode: "json",
8571
+ summary: "Get Workflow State"
8572
+ },
7786
8573
  getWorkflowVersion: {
7787
8574
  method: "GET",
7788
- path: "/api/v2/workflows/[id]/versions/[version]",
7789
- pathParams: ["id", "version"],
7790
- pathParamDocs: { id: "Unique workflow identifier.", version: "Numeric deployment version." },
8575
+ path: "/api/v2/workflows/[workflowId]/versions/[version]",
8576
+ pathParams: ["workflowId", "version"],
8577
+ pathParamDocs: {
8578
+ workflowId: "Unique workflow identifier.",
8579
+ version: "Numeric deployment version."
8580
+ },
7791
8581
  responseMode: "json",
7792
8582
  summary: "Get Workflow Version"
7793
8583
  },
@@ -7799,6 +8589,24 @@ var V2_OPERATIONS = {
7799
8589
  responseMode: "json",
7800
8590
  summary: "Get Workspace"
7801
8591
  },
8592
+ grantSkillEditor: {
8593
+ method: "POST",
8594
+ path: "/api/v2/skills/[skillId]/editors",
8595
+ pathParams: ["skillId"],
8596
+ pathParamDocs: {
8597
+ skillId: "Unique skill identifier. A built-in skill is `builtin-` followed by its name, for example `builtin-research`."
8598
+ },
8599
+ responseMode: "json",
8600
+ summary: "Grant Skill Editor",
8601
+ body: {
8602
+ workspaceId: { kind: "string", required: true, describe: "Workspace that owns the skill." },
8603
+ email: {
8604
+ kind: "string",
8605
+ required: true,
8606
+ describe: "Email address of a current workspace member."
8607
+ }
8608
+ }
8609
+ },
7802
8610
  importWorkflow: {
7803
8611
  method: "POST",
7804
8612
  path: "/api/v2/workflows/import",
@@ -7918,6 +8726,115 @@ var V2_OPERATIONS = {
7918
8726
  }
7919
8727
  }
7920
8728
  },
8729
+ listBlocks: {
8730
+ method: "GET",
8731
+ path: "/api/v2/blocks",
8732
+ pathParams: [],
8733
+ responseMode: "json",
8734
+ summary: "List Blocks",
8735
+ query: {
8736
+ workspaceId: {
8737
+ kind: "string",
8738
+ required: true,
8739
+ describe: "Workspace whose integration allowlist, revealed preview blocks, and deployed custom blocks decide what this catalog contains."
8740
+ },
8741
+ search: {
8742
+ kind: "string",
8743
+ describe: "Case-insensitive substring match against the block id, name, and description."
8744
+ },
8745
+ category: {
8746
+ kind: "enum",
8747
+ values: ["blocks", "tools", "triggers"],
8748
+ describe: "Restrict to one toolbar category."
8749
+ },
8750
+ capability: {
8751
+ kind: "enum",
8752
+ values: ["trigger"],
8753
+ describe: "Restrict to blocks that can start a workflow — the `triggers` category, blocks declaring `triggerAllowed`, and blocks with trigger-mode fields."
8754
+ },
8755
+ source: {
8756
+ kind: "enum",
8757
+ values: ["builtin", "custom"],
8758
+ describe: "Restrict to shipped blocks or to this workspace’s deployed custom blocks."
8759
+ },
8760
+ sortBy: {
8761
+ kind: "enum",
8762
+ values: ["id", "name", "category"],
8763
+ default: "id",
8764
+ 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."
8765
+ },
8766
+ sortOrder: {
8767
+ kind: "enum",
8768
+ values: ["asc", "desc"],
8769
+ default: "asc",
8770
+ describe: "Sort direction."
8771
+ },
8772
+ limit: {
8773
+ kind: "integer",
8774
+ default: 50,
8775
+ describe: "Maximum blocks to return per page. Must be a whole number from 1 to 100. Defaults to 50."
8776
+ },
8777
+ cursor: {
8778
+ kind: "string",
8779
+ 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."
8780
+ }
8781
+ }
8782
+ },
8783
+ listChatDeployments: {
8784
+ method: "GET",
8785
+ path: "/api/v2/chat-deployments",
8786
+ pathParams: [],
8787
+ responseMode: "json",
8788
+ summary: "List Chat Deployments",
8789
+ query: {
8790
+ workspaceId: {
8791
+ kind: "string",
8792
+ required: true,
8793
+ describe: "Workspace whose chat deployments to list."
8794
+ },
8795
+ workflowId: { kind: "string", describe: "Restrict to deployments of one workflow." },
8796
+ isActive: { kind: "boolean", describe: "Restrict to active or inactive deployments." },
8797
+ sortBy: {
8798
+ kind: "enum",
8799
+ values: ["identifier", "createdAt", "updatedAt"],
8800
+ default: "createdAt",
8801
+ describe: "Field used to sort the result."
8802
+ },
8803
+ sortOrder: {
8804
+ kind: "enum",
8805
+ values: ["asc", "desc"],
8806
+ default: "desc",
8807
+ describe: "Sort direction."
8808
+ },
8809
+ limit: {
8810
+ kind: "integer",
8811
+ default: 50,
8812
+ describe: "Maximum chat deployments to return per page. Must be a whole number from 1 to 100. Defaults to 50."
8813
+ },
8814
+ cursor: {
8815
+ kind: "string",
8816
+ 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."
8817
+ }
8818
+ }
8819
+ },
8820
+ listConnectorTypes: {
8821
+ method: "GET",
8822
+ path: "/api/v2/connector-types",
8823
+ pathParams: [],
8824
+ responseMode: "json",
8825
+ summary: "List Connector Types",
8826
+ query: {
8827
+ workspaceId: {
8828
+ kind: "string",
8829
+ required: true,
8830
+ describe: "Workspace whose integration allowlist, revealed preview blocks, and deployed custom blocks decide what this catalog contains."
8831
+ },
8832
+ search: {
8833
+ kind: "string",
8834
+ describe: "Case-insensitive substring match against the connector name."
8835
+ }
8836
+ }
8837
+ },
7921
8838
  listCredentialProviders: {
7922
8839
  method: "GET",
7923
8840
  path: "/api/v2/credentials/providers",
@@ -8054,6 +8971,12 @@ var V2_OPERATIONS = {
8054
8971
  values: ["asc", "desc"],
8055
8972
  default: "asc",
8056
8973
  describe: "Sort direction."
8974
+ },
8975
+ scope: {
8976
+ kind: "enum",
8977
+ values: ["active", "archived"],
8978
+ default: "active",
8979
+ describe: "Which lifecycle set to list: `active` (default) returns live folders only; `archived` returns folders a recursive `DELETE` soft-deleted, which is how a caller finds a path to hand to `POST /api/v2/files/folders/restore`. Authorization is identical for both."
8057
8980
  }
8058
8981
  }
8059
8982
  },
@@ -8071,7 +8994,25 @@ var V2_OPERATIONS = {
8071
8994
  },
8072
8995
  folderPath: {
8073
8996
  kind: "string",
8074
- 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."
8997
+ describe: "Restrict results to files inside this folder — its direct children, or its whole subtree when `recursive` is true. A path that names no folder narrows the result to nothing, so the response is an empty page rather than an error."
8998
+ },
8999
+ recursive: {
9000
+ kind: "enum",
9001
+ values: [
9002
+ "true",
9003
+ "1",
9004
+ "yes",
9005
+ "on",
9006
+ "y",
9007
+ "enabled",
9008
+ "false",
9009
+ "0",
9010
+ "no",
9011
+ "off",
9012
+ "n",
9013
+ "disabled"
9014
+ ],
9015
+ describe: "Whether the folder filter includes files in subfolders. Defaults to true when a search is set, false otherwise, so listing a folder shows that folder while searching one looks through everything in it. Ignored when no folder filter is set, which already spans the workspace. The listed spellings are the whole accepted vocabulary and are case-sensitive; any other value is rejected."
8075
9016
  },
8076
9017
  scope: {
8077
9018
  kind: "enum",
@@ -8118,6 +9059,12 @@ var V2_OPERATIONS = {
8118
9059
  required: true,
8119
9060
  describe: "Workspace whose knowledge bases should be listed."
8120
9061
  },
9062
+ scope: {
9063
+ kind: "enum",
9064
+ values: ["active", "archived"],
9065
+ default: "active",
9066
+ describe: "Which lifecycle set to list: `active` (default) for live knowledge bases, `archived` for knowledge bases a `DELETE` archived and `POST /knowledge/{knowledgeBaseId}/restore` can bring back. `folderPath` resolves against active folders only, so pairing it with `scope=archived` returns an empty page when the containing folder was archived too."
9067
+ },
8121
9068
  folderPath: {
8122
9069
  kind: "string",
8123
9070
  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."
@@ -8149,11 +9096,127 @@ var V2_OPERATIONS = {
8149
9096
  }
8150
9097
  }
8151
9098
  },
9099
+ listKnowledgeChunks: {
9100
+ method: "GET",
9101
+ path: "/api/v2/knowledge/[knowledgeBaseId]/documents/[documentId]/chunks",
9102
+ pathParams: ["knowledgeBaseId", "documentId"],
9103
+ pathParamDocs: {
9104
+ knowledgeBaseId: "Unique knowledge base identifier.",
9105
+ documentId: "Unique knowledge document identifier."
9106
+ },
9107
+ responseMode: "json",
9108
+ summary: "List Chunks",
9109
+ query: {
9110
+ workspaceId: {
9111
+ kind: "string",
9112
+ required: true,
9113
+ describe: "Workspace that owns the knowledge base."
9114
+ },
9115
+ search: {
9116
+ kind: "string",
9117
+ describe: "Case-insensitive substring match against chunk content."
9118
+ },
9119
+ enabled: {
9120
+ kind: "enum",
9121
+ values: ["true", "false", "all"],
9122
+ default: "all",
9123
+ describe: "Restrict to enabled or disabled chunks. `all` returns both."
9124
+ },
9125
+ sortBy: {
9126
+ kind: "enum",
9127
+ values: ["chunkIndex", "tokenCount", "enabled"],
9128
+ default: "chunkIndex",
9129
+ describe: "Field used to sort the result."
9130
+ },
9131
+ sortOrder: {
9132
+ kind: "enum",
9133
+ values: ["asc", "desc"],
9134
+ default: "asc",
9135
+ describe: "Sort direction."
9136
+ },
9137
+ limit: {
9138
+ kind: "integer",
9139
+ default: 50,
9140
+ describe: "Maximum chunks to return per page. Must be a whole number from 1 to 100. Defaults to 50."
9141
+ },
9142
+ cursor: {
9143
+ kind: "string",
9144
+ 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."
9145
+ }
9146
+ }
9147
+ },
9148
+ listKnowledgeConnectorDocuments: {
9149
+ method: "GET",
9150
+ path: "/api/v2/knowledge/[knowledgeBaseId]/connectors/[connectorId]/documents",
9151
+ pathParams: ["knowledgeBaseId", "connectorId"],
9152
+ pathParamDocs: {
9153
+ knowledgeBaseId: "Knowledge base that owns the connector.",
9154
+ connectorId: "Connector selected for the operation."
9155
+ },
9156
+ responseMode: "json",
9157
+ summary: "List Knowledge Connector Documents",
9158
+ query: {
9159
+ workspaceId: {
9160
+ kind: "string",
9161
+ required: true,
9162
+ describe: "Workspace that owns the knowledge base."
9163
+ },
9164
+ includeExcluded: {
9165
+ kind: "boolean",
9166
+ describe: "Include documents explicitly excluded by a user."
9167
+ },
9168
+ limit: {
9169
+ kind: "integer",
9170
+ default: 50,
9171
+ describe: "Maximum connector documents to return per page. Must be a whole number from 1 to 100. Defaults to 50."
9172
+ },
9173
+ cursor: {
9174
+ kind: "string",
9175
+ 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."
9176
+ }
9177
+ }
9178
+ },
9179
+ listKnowledgeConnectors: {
9180
+ method: "GET",
9181
+ path: "/api/v2/knowledge/[knowledgeBaseId]/connectors",
9182
+ pathParams: ["knowledgeBaseId"],
9183
+ pathParamDocs: { knowledgeBaseId: "Unique knowledge base identifier." },
9184
+ responseMode: "json",
9185
+ summary: "List Knowledge Connectors",
9186
+ query: {
9187
+ workspaceId: {
9188
+ kind: "string",
9189
+ required: true,
9190
+ describe: "Workspace that owns the knowledge base."
9191
+ },
9192
+ sortBy: {
9193
+ kind: "enum",
9194
+ values: ["connectorType", "createdAt", "updatedAt"],
9195
+ default: "createdAt",
9196
+ describe: "Field used to sort the result."
9197
+ },
9198
+ sortOrder: {
9199
+ kind: "enum",
9200
+ values: ["asc", "desc"],
9201
+ default: "desc",
9202
+ describe: "Sort direction."
9203
+ },
9204
+ limit: {
9205
+ kind: "integer",
9206
+ default: 50,
9207
+ describe: "Maximum connectors to return per page. Must be a whole number from 1 to 100. Defaults to 50."
9208
+ },
9209
+ cursor: {
9210
+ kind: "string",
9211
+ 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."
9212
+ }
9213
+ }
9214
+ },
8152
9215
  listKnowledgeDocuments: {
8153
9216
  method: "GET",
8154
- path: "/api/v2/knowledge/[id]/documents",
8155
- pathParams: ["id"],
8156
- pathParamDocs: { id: "Unique knowledge base identifier." },
9217
+ path: "/api/v2/knowledge/[knowledgeBaseId]/documents",
9218
+ pathParams: ["knowledgeBaseId"],
9219
+ pathParamDocs: { knowledgeBaseId: "Unique knowledge base identifier." },
8157
9220
  responseMode: "json",
8158
9221
  summary: "List Documents",
8159
9222
  query: {
@@ -8243,9 +9306,9 @@ var V2_OPERATIONS = {
8243
9306
  },
8244
9307
  listKnowledgeTags: {
8245
9308
  method: "GET",
8246
- path: "/api/v2/knowledge/[id]/tags",
8247
- pathParams: ["id"],
8248
- pathParamDocs: { id: "Unique knowledge base identifier." },
9309
+ path: "/api/v2/knowledge/[knowledgeBaseId]/tags",
9310
+ pathParams: ["knowledgeBaseId"],
9311
+ pathParamDocs: { knowledgeBaseId: "Unique knowledge base identifier." },
8249
9312
  responseMode: "json",
8250
9313
  summary: "List Tags",
8251
9314
  query: {
@@ -8256,6 +9319,21 @@ var V2_OPERATIONS = {
8256
9319
  }
8257
9320
  }
8258
9321
  },
9322
+ listKnowledgeTagUsage: {
9323
+ method: "GET",
9324
+ path: "/api/v2/knowledge/[knowledgeBaseId]/tags/usage",
9325
+ pathParams: ["knowledgeBaseId"],
9326
+ pathParamDocs: { knowledgeBaseId: "Unique knowledge base identifier." },
9327
+ responseMode: "json",
9328
+ summary: "List Tag Usage",
9329
+ query: {
9330
+ workspaceId: {
9331
+ kind: "string",
9332
+ required: true,
9333
+ describe: "Workspace that owns the knowledge base."
9334
+ }
9335
+ }
9336
+ },
8259
9337
  listLogs: {
8260
9338
  method: "GET",
8261
9339
  path: "/api/v2/logs",
@@ -8270,11 +9348,11 @@ var V2_OPERATIONS = {
8270
9348
  },
8271
9349
  workflowIds: {
8272
9350
  kind: "string",
8273
- describe: "Comma-separated workflow identifiers to include. An empty entry is rejected."
9351
+ describe: "Comma-separated workflow identifiers to include. An empty entry is rejected. At most 200 entries."
8274
9352
  },
8275
9353
  triggers: {
8276
9354
  kind: "string",
8277
- 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`."
9355
+ 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`. At most 100 entries."
8278
9356
  },
8279
9357
  level: {
8280
9358
  kind: "enum",
@@ -8310,7 +9388,7 @@ var V2_OPERATIONS = {
8310
9388
  kind: "enum",
8311
9389
  values: ["basic", "full"],
8312
9390
  default: "basic",
8313
- 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."
9391
+ describe: "Response detail level. `full` adds the `workflow` summary to every workflow run; a job run never carries one, whatever this is set to. `includeTraceSpans=true` and `includeFinalOutput=true` each imply `full`, so either one adds `workflow` even when `details=basic` is sent explicitly."
8314
9392
  },
8315
9393
  includeTraceSpans: {
8316
9394
  kind: "boolean",
@@ -8329,16 +9407,34 @@ var V2_OPERATIONS = {
8329
9407
  kind: "string",
8330
9408
  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."
8331
9409
  },
8332
- order: {
8333
- kind: "enum",
8334
- values: ["asc", "desc"],
8335
- default: "desc",
8336
- 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."
9410
+ status: {
9411
+ kind: "string",
9412
+ describe: "Comma-separated execution statuses to include, from `pending` | `running` | `paused` | `redacting` | `completed` | `failed` | `cancelled`. An empty entry is rejected. ANDed with `level`, which reports severity rather than lifecycle."
9413
+ },
9414
+ workflowName: {
9415
+ kind: "string",
9416
+ describe: "Case-insensitive substring match against the run's workflow name. Runs whose workflow has been deleted match nothing, because the name is no longer joinable."
9417
+ },
9418
+ includeJobRuns: {
9419
+ kind: "boolean",
9420
+ describe: 'Whether Chat and Sim-agent job runs join the sequence alongside workflow runs. Job runs report `kind: "job"`, carry no `workflow` summary, and never carry a cost ledger. They are dropped entirely — not partially matched — whenever a filter they cannot answer is set (`workflowIds`, `workflowName`, `folderPaths`, `model`, or `status`), so a filter never means two different things across the union. Accepted only under `sortBy=startedAt`: job runs record cost as a document and no comparable status, so they cannot participate in the other orderings.'
8337
9421
  },
8338
9422
  runId: { kind: "string", describe: "Exact run identifier to match." },
9423
+ sortBy: {
9424
+ kind: "enum",
9425
+ values: ["startedAt", "durationMs", "cost", "status"],
9426
+ default: "startedAt",
9427
+ describe: "Field used to sort the result. `durationMs` and `cost` are null until a run settles; those runs order as though the value were below every recorded one, so they trail an ascending page and lead a descending one. Only `startedAt` can order Chat and Sim-agent job runs, so any other value is rejected together with `includeJobRuns=true`."
9428
+ },
9429
+ sortOrder: {
9430
+ kind: "enum",
9431
+ values: ["asc", "desc"],
9432
+ default: "desc",
9433
+ describe: "Sort direction."
9434
+ },
8339
9435
  folderPaths: {
8340
9436
  kind: "string",
8341
- 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."
9437
+ describe: "Comma-separated workflow folder paths to include. At most 100 entries. A path covers its whole subtree, so `/prod` also selects runs in `/prod/nested`. A path that names no folder narrows the result to nothing, so the response is an empty page rather than an error."
8342
9438
  }
8343
9439
  }
8344
9440
  },
@@ -8383,9 +9479,9 @@ var V2_OPERATIONS = {
8383
9479
  },
8384
9480
  listMcpServerTools: {
8385
9481
  method: "GET",
8386
- path: "/api/v2/mcp-servers/[id]/tools",
8387
- pathParams: ["id"],
8388
- pathParamDocs: { id: "Unique MCP server identifier." },
9482
+ path: "/api/v2/mcp-servers/[mcpServerId]/tools",
9483
+ pathParams: ["mcpServerId"],
9484
+ pathParamDocs: { mcpServerId: "Unique MCP server identifier." },
8389
9485
  responseMode: "json",
8390
9486
  summary: "List MCP Server Tools",
8391
9487
  query: {
@@ -8444,6 +9540,40 @@ var V2_OPERATIONS = {
8444
9540
  }
8445
9541
  }
8446
9542
  },
9543
+ listSkillEditors: {
9544
+ method: "GET",
9545
+ path: "/api/v2/skills/[skillId]/editors",
9546
+ pathParams: ["skillId"],
9547
+ pathParamDocs: {
9548
+ skillId: "Unique skill identifier. A built-in skill is `builtin-` followed by its name, for example `builtin-research`."
9549
+ },
9550
+ responseMode: "json",
9551
+ summary: "List Skill Editors",
9552
+ query: {
9553
+ workspaceId: { kind: "string", required: true, describe: "Workspace that owns the skill." },
9554
+ sortBy: {
9555
+ kind: "enum",
9556
+ values: ["email", "name"],
9557
+ default: "email",
9558
+ 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."
9559
+ },
9560
+ sortOrder: {
9561
+ kind: "enum",
9562
+ values: ["asc", "desc"],
9563
+ default: "asc",
9564
+ describe: "Sort direction."
9565
+ },
9566
+ limit: {
9567
+ kind: "integer",
9568
+ default: 50,
9569
+ describe: "Maximum skill editors to return per page. Must be a whole number from 1 to 100. Defaults to 50."
9570
+ },
9571
+ cursor: {
9572
+ kind: "string",
9573
+ 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."
9574
+ }
9575
+ }
9576
+ },
8447
9577
  listSkills: {
8448
9578
  method: "GET",
8449
9579
  path: "/api/v2/skills",
@@ -8479,6 +9609,17 @@ var V2_OPERATIONS = {
8479
9609
  }
8480
9610
  }
8481
9611
  },
9612
+ listTableDispatches: {
9613
+ method: "GET",
9614
+ path: "/api/v2/tables/[tableId]/dispatches",
9615
+ pathParams: ["tableId"],
9616
+ pathParamDocs: { tableId: "Unique table identifier." },
9617
+ responseMode: "json",
9618
+ summary: "List Active Run Dispatches",
9619
+ query: {
9620
+ workspaceId: { kind: "string", required: true, describe: "Workspace that owns the table." }
9621
+ }
9622
+ },
8482
9623
  listTableFolders: {
8483
9624
  method: "GET",
8484
9625
  path: "/api/v2/tables/folders",
@@ -8530,6 +9671,10 @@ var V2_OPERATIONS = {
8530
9671
  cursor: {
8531
9672
  kind: "string",
8532
9673
  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."
9674
+ },
9675
+ includeRunState: {
9676
+ kind: "boolean",
9677
+ describe: "Include per-workflow-group run state on every returned row. Off by default: run state is a separate sidecar read and its `blockErrors` are unbounded, so a full page carries it only when asked. Caps `limit` at 200."
8533
9678
  }
8534
9679
  }
8535
9680
  },
@@ -8545,6 +9690,12 @@ var V2_OPERATIONS = {
8545
9690
  required: true,
8546
9691
  describe: "Workspace whose tables should be listed."
8547
9692
  },
9693
+ scope: {
9694
+ kind: "enum",
9695
+ values: ["active", "archived"],
9696
+ default: "active",
9697
+ describe: "Which lifecycle set to list: `active` (default) for live tables, `archived` for tables a `DELETE` archived and `POST /tables/{tableId}/restore` can bring back. `folderPath` resolves against active folders only, so pairing it with `scope=archived` returns an empty page when the containing folder was archived too."
9698
+ },
8548
9699
  folderPath: {
8549
9700
  kind: "string",
8550
9701
  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."
@@ -8587,6 +9738,54 @@ var V2_OPERATIONS = {
8587
9738
  workspaceId: { kind: "string", required: true, describe: "Workspace that owns the table." }
8588
9739
  }
8589
9740
  },
9741
+ listTools: {
9742
+ method: "GET",
9743
+ path: "/api/v2/tools",
9744
+ pathParams: [],
9745
+ responseMode: "json",
9746
+ summary: "List Tools",
9747
+ query: {
9748
+ workspaceId: {
9749
+ kind: "string",
9750
+ required: true,
9751
+ describe: "Workspace whose integration allowlist, revealed preview blocks, and deployed custom blocks decide what this catalog contains."
9752
+ },
9753
+ search: {
9754
+ kind: "string",
9755
+ describe: "Case-insensitive substring match against the tool id, name, and description."
9756
+ },
9757
+ hostedApiKey: {
9758
+ kind: "enum",
9759
+ values: ["always", "conditional", "none"],
9760
+ describe: "Restrict to tools by how their API key is supplied."
9761
+ },
9762
+ oauthProvider: {
9763
+ kind: "string",
9764
+ describe: "Restrict to tools that authenticate against this OAuth service."
9765
+ },
9766
+ sortBy: {
9767
+ kind: "enum",
9768
+ values: ["id", "name"],
9769
+ default: "id",
9770
+ 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."
9771
+ },
9772
+ sortOrder: {
9773
+ kind: "enum",
9774
+ values: ["asc", "desc"],
9775
+ default: "asc",
9776
+ describe: "Sort direction."
9777
+ },
9778
+ limit: {
9779
+ kind: "integer",
9780
+ default: 50,
9781
+ describe: "Maximum tools to return per page. Must be a whole number from 1 to 100. Defaults to 50."
9782
+ },
9783
+ cursor: {
9784
+ kind: "string",
9785
+ 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."
9786
+ }
9787
+ }
9788
+ },
8590
9789
  listWorkflowFolders: {
8591
9790
  method: "GET",
8592
9791
  path: "/api/v2/workflows/folders",
@@ -8632,11 +9831,54 @@ var V2_OPERATIONS = {
8632
9831
  workspaceId: { kind: "string", required: true, describe: "Workspace that owns the table." }
8633
9832
  }
8634
9833
  },
9834
+ listWorkflowMcpServers: {
9835
+ method: "GET",
9836
+ path: "/api/v2/workflow-mcp-servers",
9837
+ pathParams: [],
9838
+ responseMode: "json",
9839
+ summary: "List Workflow MCP Servers",
9840
+ query: {
9841
+ workspaceId: {
9842
+ kind: "string",
9843
+ required: true,
9844
+ describe: "Workspace whose published MCP servers to list."
9845
+ },
9846
+ sortBy: {
9847
+ kind: "enum",
9848
+ values: ["name", "createdAt", "updatedAt"],
9849
+ default: "createdAt",
9850
+ 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."
9851
+ },
9852
+ sortOrder: {
9853
+ kind: "enum",
9854
+ values: ["asc", "desc"],
9855
+ default: "desc",
9856
+ describe: "Sort direction."
9857
+ },
9858
+ limit: {
9859
+ kind: "integer",
9860
+ default: 50,
9861
+ describe: "Maximum workflow-MCP servers to return per page. Must be a whole number from 1 to 100. Defaults to 50."
9862
+ },
9863
+ cursor: {
9864
+ kind: "string",
9865
+ 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."
9866
+ }
9867
+ }
9868
+ },
9869
+ listWorkflowMcpTools: {
9870
+ method: "GET",
9871
+ path: "/api/v2/workflow-mcp-servers/[serverId]/tools",
9872
+ pathParams: ["serverId"],
9873
+ pathParamDocs: { serverId: "Unique workflow-MCP server identifier." },
9874
+ responseMode: "json",
9875
+ summary: "List Workflow MCP Tools"
9876
+ },
8635
9877
  listWorkflowRuns: {
8636
9878
  method: "GET",
8637
- path: "/api/v2/workflows/[id]/runs",
8638
- pathParams: ["id"],
8639
- pathParamDocs: { id: "Unique workflow identifier." },
9879
+ path: "/api/v2/workflows/[workflowId]/runs",
9880
+ pathParams: ["workflowId"],
9881
+ pathParamDocs: { workflowId: "Unique workflow identifier." },
8640
9882
  responseMode: "json",
8641
9883
  summary: "List Workflow Runs",
8642
9884
  query: {
@@ -8683,6 +9925,12 @@ var V2_OPERATIONS = {
8683
9925
  required: true,
8684
9926
  describe: "Workspace whose workflows should be listed."
8685
9927
  },
9928
+ scope: {
9929
+ kind: "enum",
9930
+ values: ["active", "archived"],
9931
+ default: "active",
9932
+ describe: "Which lifecycle set to list: `active` (default) for live workflows, `archived` for workflows a `DELETE` archived. `folderPath` resolves against active folders only, so pairing it with `scope=archived` returns an empty page when the containing folder was archived too."
9933
+ },
8686
9934
  folderPath: {
8687
9935
  kind: "string",
8688
9936
  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."
@@ -8720,9 +9968,9 @@ var V2_OPERATIONS = {
8720
9968
  },
8721
9969
  listWorkflowVersions: {
8722
9970
  method: "GET",
8723
- path: "/api/v2/workflows/[id]/versions",
8724
- pathParams: ["id"],
8725
- pathParamDocs: { id: "Unique workflow identifier." },
9971
+ path: "/api/v2/workflows/[workflowId]/versions",
9972
+ pathParams: ["workflowId"],
9973
+ pathParamDocs: { workflowId: "Unique workflow identifier." },
8726
9974
  responseMode: "json",
8727
9975
  summary: "List Workflow Versions",
8728
9976
  query: {
@@ -8756,6 +10004,36 @@ var V2_OPERATIONS = {
8756
10004
  }
8757
10005
  }
8758
10006
  },
10007
+ listWorkspaces: {
10008
+ method: "GET",
10009
+ path: "/api/v2/workspaces",
10010
+ pathParams: [],
10011
+ responseMode: "json",
10012
+ summary: "List Workspaces",
10013
+ query: {
10014
+ sortBy: {
10015
+ kind: "enum",
10016
+ values: ["name", "createdAt", "updatedAt"],
10017
+ default: "createdAt",
10018
+ 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."
10019
+ },
10020
+ sortOrder: {
10021
+ kind: "enum",
10022
+ values: ["asc", "desc"],
10023
+ default: "desc",
10024
+ describe: "Sort direction."
10025
+ },
10026
+ limit: {
10027
+ kind: "integer",
10028
+ default: 50,
10029
+ describe: "Maximum workspaces to return per page. Must be a whole number from 1 to 100. Defaults to 50."
10030
+ },
10031
+ cursor: {
10032
+ kind: "string",
10033
+ 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."
10034
+ }
10035
+ }
10036
+ },
8759
10037
  moveFileItems: {
8760
10038
  method: "POST",
8761
10039
  path: "/api/v2/files/move",
@@ -8771,6 +10049,50 @@ var V2_OPERATIONS = {
8771
10049
  }
8772
10050
  }
8773
10051
  },
10052
+ moveTables: {
10053
+ method: "POST",
10054
+ path: "/api/v2/tables/move",
10055
+ pathParams: [],
10056
+ responseMode: "json",
10057
+ summary: "Move Tables and Folders",
10058
+ body: {
10059
+ workspaceId: {
10060
+ kind: "string",
10061
+ required: true,
10062
+ describe: "Workspace that owns every selected item."
10063
+ },
10064
+ tableIds: { kind: "array", default: [], describe: "Tables to move, by identifier." },
10065
+ folderPaths: { kind: "array", describe: "Table folders to re-parent, by canonical path." },
10066
+ targetFolderPath: {
10067
+ kind: "string",
10068
+ describe: "Destination folder path. Omit to move the selection to the workspace root."
10069
+ }
10070
+ }
10071
+ },
10072
+ moveWorkflows: {
10073
+ method: "POST",
10074
+ path: "/api/v2/workflows/move",
10075
+ pathParams: [],
10076
+ responseMode: "json",
10077
+ summary: "Move Workflows",
10078
+ body: {
10079
+ workspaceId: {
10080
+ kind: "string",
10081
+ required: true,
10082
+ describe: "Workspace holding every workflow in the batch."
10083
+ },
10084
+ workflowIds: {
10085
+ kind: "array",
10086
+ required: true,
10087
+ describe: "Workflows to move. Duplicates are collapsed."
10088
+ },
10089
+ folderPath: {
10090
+ kind: "string",
10091
+ required: true,
10092
+ describe: "Destination folder path; `/` moves the workflows to the workspace root."
10093
+ }
10094
+ }
10095
+ },
8774
10096
  queryRows: {
8775
10097
  method: "POST",
8776
10098
  path: "/api/v2/tables/[tableId]/query",
@@ -8782,14 +10104,19 @@ var V2_OPERATIONS = {
8782
10104
  workspaceId: { kind: "string", required: true, describe: "Unique workspace identifier." },
8783
10105
  predicate: {
8784
10106
  kind: "unknown",
8785
- 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.'
10107
+ describe: 'A single `{ field, op, value }` condition or a recursive `all`/`any` group; either form is normalized to a grouped predicate after validation. 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.'
8786
10108
  },
8787
10109
  sort: { kind: "array", describe: "Ordered table-row sort specification." },
8788
10110
  limit: {
8789
10111
  kind: "integer",
8790
10112
  describe: "Maximum rows to return; zero requests an unbounded result."
8791
10113
  },
8792
- cursor: { kind: "string", describe: "Opaque cursor returned by the previous query page." }
10114
+ cursor: { kind: "string", describe: "Opaque cursor returned by the previous query page." },
10115
+ includeRunState: {
10116
+ kind: "boolean",
10117
+ default: false,
10118
+ describe: "Include per-workflow-group run state on every returned row. Off by default: run state is a separate sidecar read and its `blockErrors` are unbounded, so a full page carries it only when asked. Incompatible with `limit: 0`, and caps `limit` at 200."
10119
+ }
8793
10120
  }
8794
10121
  },
8795
10122
  queryRowsCount: {
@@ -8803,7 +10130,22 @@ var V2_OPERATIONS = {
8803
10130
  workspaceId: { kind: "string", required: true, describe: "Unique workspace identifier." },
8804
10131
  predicate: {
8805
10132
  kind: "unknown",
8806
- 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.'
10133
+ describe: 'A single `{ field, op, value }` condition or a recursive `all`/`any` group; either form is normalized to a grouped predicate after validation. 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.'
10134
+ }
10135
+ }
10136
+ },
10137
+ readFileText: {
10138
+ method: "GET",
10139
+ path: "/api/v2/files/[fileId]/text",
10140
+ pathParams: ["fileId"],
10141
+ pathParamDocs: { fileId: "File identifier." },
10142
+ responseMode: "json",
10143
+ summary: "Read File Text",
10144
+ query: {
10145
+ workspaceId: { kind: "string", required: true, describe: "Workspace that owns the file." },
10146
+ maxBytes: {
10147
+ kind: "integer",
10148
+ describe: "Optional ceiling on the source bytes fed to the parser, lowering but never raising the server limit."
8807
10149
  }
8808
10150
  }
8809
10151
  },
@@ -8883,6 +10225,88 @@ var V2_OPERATIONS = {
8883
10225
  name: { kind: "string", required: true, describe: "New file name, including its extension." }
8884
10226
  }
8885
10227
  },
10228
+ replaceWorkflowChatDeployment: {
10229
+ method: "PUT",
10230
+ path: "/api/v2/workflows/[workflowId]/deployments/chat",
10231
+ pathParams: ["workflowId"],
10232
+ pathParamDocs: { workflowId: "Unique workflow identifier." },
10233
+ responseMode: "json",
10234
+ summary: "Create or Replace Workflow Chat Deployment",
10235
+ body: {
10236
+ identifier: {
10237
+ kind: "string",
10238
+ required: true,
10239
+ describe: "URL slug the deployed chat answers on. Must be free across live deployments."
10240
+ },
10241
+ title: { kind: "string", required: true, describe: "Title shown to visitors." },
10242
+ description: {
10243
+ kind: "string",
10244
+ describe: "Description shown to visitors. Omitted clears it."
10245
+ },
10246
+ customizations: {
10247
+ kind: "object",
10248
+ describe: "Presentation overrides. Omitted fields take platform defaults."
10249
+ },
10250
+ authType: {
10251
+ kind: "enum",
10252
+ values: ["public", "password", "email", "sso"],
10253
+ default: "public",
10254
+ describe: "How visitors are gated. `public` leaves the chat open to anyone holding the URL."
10255
+ },
10256
+ password: {
10257
+ kind: "string",
10258
+ describe: "Write-only password. Required whenever `authType` is `password`, and rejected otherwise. Never readable back."
10259
+ },
10260
+ allowedEmails: {
10261
+ kind: "array",
10262
+ describe: "Email addresses or domains admitted under `email` and `sso` gating. At least one is required for those modes."
10263
+ },
10264
+ outputConfigs: {
10265
+ kind: "array",
10266
+ describe: "Block outputs to surface to visitors. Omitted surfaces none."
10267
+ },
10268
+ includeThinking: {
10269
+ kind: "boolean",
10270
+ default: false,
10271
+ describe: "Allow visitors to receive provider thinking events."
10272
+ },
10273
+ includeToolCalls: {
10274
+ kind: "boolean",
10275
+ default: false,
10276
+ describe: "Allow visitors to receive tool lifecycle events."
10277
+ }
10278
+ }
10279
+ },
10280
+ replaceWorkflowState: {
10281
+ method: "PUT",
10282
+ path: "/api/v2/workflows/[workflowId]/state",
10283
+ pathParams: ["workflowId"],
10284
+ pathParamDocs: { workflowId: "Unique workflow identifier." },
10285
+ responseMode: "json",
10286
+ summary: "Replace Workflow State",
10287
+ query: {
10288
+ dryRun: {
10289
+ kind: "boolean",
10290
+ describe: "Validate and lint without persisting. The response is identical to the committed write of the same body, so a caller can inspect `lint` and then re-send the request for real. Nothing is written, no audit entry is recorded, and collaborators are not notified."
10291
+ }
10292
+ },
10293
+ body: {
10294
+ blocks: { kind: "object", required: true, describe: "Blocks keyed by block id." },
10295
+ edges: { kind: "array", required: true, describe: "Directed connections between blocks." },
10296
+ loops: {
10297
+ kind: "object",
10298
+ describe: "Ignored on write: loop containers are recomputed from `blocks`."
10299
+ },
10300
+ parallels: {
10301
+ kind: "object",
10302
+ describe: "Ignored on write: parallel containers are recomputed from `blocks`."
10303
+ },
10304
+ variables: {
10305
+ kind: "object",
10306
+ describe: "Replacement variable set. Omit to leave the stored variables untouched."
10307
+ }
10308
+ }
10309
+ },
8886
10310
  restoreFile: {
8887
10311
  method: "POST",
8888
10312
  path: "/api/v2/files/[fileId]/restore",
@@ -8898,11 +10322,86 @@ var V2_OPERATIONS = {
8898
10322
  }
8899
10323
  }
8900
10324
  },
10325
+ restoreFileFolder: {
10326
+ method: "POST",
10327
+ path: "/api/v2/files/folders/restore",
10328
+ pathParams: [],
10329
+ responseMode: "json",
10330
+ summary: "Restore Folder",
10331
+ body: {
10332
+ workspaceId: {
10333
+ kind: "string",
10334
+ required: true,
10335
+ describe: "Workspace that owns the archived folder."
10336
+ },
10337
+ path: {
10338
+ kind: "string",
10339
+ required: true,
10340
+ describe: "Path of the archived folder to restore, as reported by `GET /api/v2/files/folders?scope=archived`."
10341
+ }
10342
+ }
10343
+ },
10344
+ restoreKnowledgeBase: {
10345
+ method: "POST",
10346
+ path: "/api/v2/knowledge/[knowledgeBaseId]/restore",
10347
+ pathParams: ["knowledgeBaseId"],
10348
+ pathParamDocs: { knowledgeBaseId: "Unique knowledge base identifier." },
10349
+ responseMode: "json",
10350
+ summary: "Restore Knowledge Base",
10351
+ body: {
10352
+ workspaceId: {
10353
+ kind: "string",
10354
+ required: true,
10355
+ describe: "Workspace that owns the knowledge base."
10356
+ }
10357
+ }
10358
+ },
10359
+ restoreTable: {
10360
+ method: "POST",
10361
+ path: "/api/v2/tables/[tableId]/restore",
10362
+ pathParams: ["tableId"],
10363
+ pathParamDocs: { tableId: "Unique table identifier." },
10364
+ responseMode: "json",
10365
+ summary: "Restore Table",
10366
+ body: {
10367
+ workspaceId: { kind: "string", required: true, describe: "Unique workspace identifier." }
10368
+ }
10369
+ },
10370
+ restoreTableFolder: {
10371
+ method: "POST",
10372
+ path: "/api/v2/tables/folders/restore",
10373
+ pathParams: [],
10374
+ responseMode: "json",
10375
+ summary: "Restore Folder",
10376
+ body: {
10377
+ workspaceId: {
10378
+ kind: "string",
10379
+ required: true,
10380
+ describe: "Workspace that owns the archived folder."
10381
+ },
10382
+ path: {
10383
+ kind: "string",
10384
+ required: true,
10385
+ describe: "Path the folder held when `DELETE /api/v2/tables/folders` archived it."
10386
+ }
10387
+ }
10388
+ },
10389
+ restoreWorkflow: {
10390
+ method: "POST",
10391
+ path: "/api/v2/workflows/[workflowId]/restore",
10392
+ pathParams: ["workflowId"],
10393
+ pathParamDocs: { workflowId: "Unique workflow identifier." },
10394
+ responseMode: "json",
10395
+ summary: "Restore Workflow"
10396
+ },
8901
10397
  resumeWorkflow: {
8902
10398
  method: "POST",
8903
- path: "/api/v2/workflows/[id]/runs/[runId]/resume",
8904
- pathParams: ["id", "runId"],
8905
- pathParamDocs: { id: "Unique workflow identifier.", runId: "Unique workflow run identifier." },
10399
+ path: "/api/v2/workflows/[workflowId]/runs/[runId]/resume",
10400
+ pathParams: ["workflowId", "runId"],
10401
+ pathParamDocs: {
10402
+ workflowId: "Unique workflow identifier.",
10403
+ runId: "Unique workflow run identifier."
10404
+ },
8906
10405
  responseMode: "json",
8907
10406
  summary: "Resume Workflow Run",
8908
10407
  body: {
@@ -8914,11 +10413,40 @@ var V2_OPERATIONS = {
8914
10413
  input: { kind: "unknown", describe: "Input supplied to the paused workflow block." }
8915
10414
  }
8916
10415
  },
10416
+ revertWorkflowVersion: {
10417
+ method: "POST",
10418
+ path: "/api/v2/workflows/[workflowId]/versions/[version]/revert",
10419
+ pathParams: ["workflowId", "version"],
10420
+ pathParamDocs: {
10421
+ workflowId: "Unique workflow identifier.",
10422
+ version: "Numeric deployment version, or `active` for the currently live version."
10423
+ },
10424
+ responseMode: "json",
10425
+ summary: "Revert Workflow To Version"
10426
+ },
10427
+ revokeSkillEditor: {
10428
+ method: "DELETE",
10429
+ path: "/api/v2/skills/[skillId]/editors",
10430
+ pathParams: ["skillId"],
10431
+ pathParamDocs: {
10432
+ skillId: "Unique skill identifier. A built-in skill is `builtin-` followed by its name, for example `builtin-research`."
10433
+ },
10434
+ responseMode: "json",
10435
+ summary: "Revoke Skill Editor",
10436
+ query: {
10437
+ workspaceId: { kind: "string", required: true, describe: "Workspace that owns the skill." },
10438
+ email: {
10439
+ kind: "string",
10440
+ required: true,
10441
+ describe: "Email address of a current workspace member."
10442
+ }
10443
+ }
10444
+ },
8917
10445
  rollbackWorkflow: {
8918
10446
  method: "POST",
8919
- path: "/api/v2/workflows/[id]/rollback",
8920
- pathParams: ["id"],
8921
- pathParamDocs: { id: "Unique workflow identifier." },
10447
+ path: "/api/v2/workflows/[workflowId]/rollback",
10448
+ pathParams: ["workflowId"],
10449
+ pathParamDocs: { workflowId: "Unique workflow identifier." },
8922
10450
  responseMode: "json",
8923
10451
  summary: "Rollback Workflow",
8924
10452
  body: {
@@ -8943,35 +10471,6 @@ var V2_OPERATIONS = {
8943
10471
  workspaceId: { kind: "string", required: true, describe: "Unique workspace identifier." }
8944
10472
  }
8945
10473
  },
8946
- runTableColumn: {
8947
- method: "POST",
8948
- path: "/api/v2/tables/[tableId]/columns/run",
8949
- pathParams: ["tableId"],
8950
- pathParamDocs: { tableId: "Unique table identifier." },
8951
- responseMode: "json",
8952
- summary: "Run Column Groups",
8953
- body: {
8954
- workspaceId: { kind: "string", required: true, describe: "Unique workspace identifier." },
8955
- groupIds: {
8956
- kind: "array",
8957
- required: true,
8958
- describe: "Workflow or enrichment groups to run."
8959
- },
8960
- runMode: {
8961
- kind: "enum",
8962
- values: ["all", "incomplete"],
8963
- default: "all",
8964
- describe: "Whether to run all or only incomplete cells."
8965
- },
8966
- rowIds: { kind: "array", describe: "Explicit row subset to run." },
8967
- filter: {
8968
- kind: "unknown",
8969
- 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.'
8970
- },
8971
- excludeRowIds: { kind: "array", describe: "Rows excluded from a select-all run scope." },
8972
- limit: { kind: "object", describe: "Optional cap on eligible rows to run." }
8973
- }
8974
- },
8975
10474
  searchKnowledge: {
8976
10475
  method: "POST",
8977
10476
  path: "/api/v2/knowledge/search",
@@ -9000,7 +10499,7 @@ var V2_OPERATIONS = {
9000
10499
  },
9001
10500
  tagFilters: {
9002
10501
  kind: "array",
9003
- 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`."
10502
+ 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/{knowledgeBaseId}/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/{knowledgeBaseId}/tags`."
9004
10503
  },
9005
10504
  searchMode: {
9006
10505
  kind: "enum",
@@ -9023,6 +10522,23 @@ var V2_OPERATIONS = {
9023
10522
  }
9024
10523
  }
9025
10524
  },
10525
+ searchTableRows: {
10526
+ method: "POST",
10527
+ path: "/api/v2/tables/[tableId]/rows/search",
10528
+ pathParams: ["tableId"],
10529
+ pathParamDocs: { tableId: "Unique table identifier." },
10530
+ responseMode: "json",
10531
+ summary: "Search Rows",
10532
+ body: {
10533
+ workspaceId: { kind: "string", required: true, describe: "Unique workspace identifier." },
10534
+ q: { kind: "string", required: true, describe: "Case-insensitive cell substring to find." },
10535
+ predicate: {
10536
+ kind: "unknown",
10537
+ 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.'
10538
+ },
10539
+ sort: { kind: "array", describe: "Ordered table-row sort specification." }
10540
+ }
10541
+ },
9026
10542
  setSecret: {
9027
10543
  method: "PUT",
9028
10544
  path: "/api/v2/secrets/[name]",
@@ -9050,14 +10566,44 @@ var V2_OPERATIONS = {
9050
10566
  description: {
9051
10567
  kind: "string",
9052
10568
  describe: "What the secret is for, shown to teammates. Workspace scope only — sending it for a personal secret is rejected. Omit it to leave an existing description untouched; send null or an empty string to clear one."
10569
+ },
10570
+ unredacted: {
10571
+ kind: "boolean",
10572
+ describe: "Opt the workspace secret out of redaction: its value then appears in plaintext in run logs, model-visible content, and files, including publicly shared log links. Workspace scope only — sending it for a personal secret is rejected. Omit it to leave the current setting untouched."
10573
+ }
10574
+ }
10575
+ },
10576
+ syncKnowledgeConnector: {
10577
+ method: "POST",
10578
+ path: "/api/v2/knowledge/[knowledgeBaseId]/connectors/[connectorId]/sync",
10579
+ pathParams: ["knowledgeBaseId", "connectorId"],
10580
+ pathParamDocs: {
10581
+ knowledgeBaseId: "Knowledge base that owns the connector.",
10582
+ connectorId: "Connector selected for the operation."
10583
+ },
10584
+ responseMode: "json",
10585
+ summary: "Sync Knowledge Connector",
10586
+ body: {
10587
+ workspaceId: {
10588
+ kind: "string",
10589
+ required: true,
10590
+ describe: "Workspace that owns the knowledge base."
10591
+ },
10592
+ rehydrate: {
10593
+ kind: "boolean",
10594
+ default: false,
10595
+ describe: "Re-fetch and re-index every existing connector document."
9053
10596
  }
9054
10597
  }
9055
10598
  },
9056
10599
  tableExportDownload: {
9057
10600
  method: "GET",
9058
- path: "/api/v2/tables/exports/[exportId]/download",
9059
- pathParams: ["exportId"],
9060
- pathParamDocs: { exportId: "Unique table-export identifier." },
10601
+ path: "/api/v2/tables/[tableId]/exports/[exportId]/download",
10602
+ pathParams: ["tableId", "exportId"],
10603
+ pathParamDocs: {
10604
+ tableId: "Unique table identifier.",
10605
+ exportId: "Unique table-export identifier."
10606
+ },
9061
10607
  responseMode: "json",
9062
10608
  summary: "Download Table Export",
9063
10609
  query: {
@@ -9070,17 +10616,77 @@ var V2_OPERATIONS = {
9070
10616
  },
9071
10617
  undeployWorkflow: {
9072
10618
  method: "DELETE",
9073
- path: "/api/v2/workflows/[id]/deploy",
9074
- pathParams: ["id"],
9075
- pathParamDocs: { id: "Unique workflow identifier." },
10619
+ path: "/api/v2/workflows/[workflowId]/deploy",
10620
+ pathParams: ["workflowId"],
10621
+ pathParamDocs: { workflowId: "Unique workflow identifier." },
9076
10622
  responseMode: "json",
9077
10623
  summary: "Undeploy Workflow"
9078
10624
  },
10625
+ undeployWorkflowMcpTool: {
10626
+ method: "DELETE",
10627
+ path: "/api/v2/workflow-mcp-servers/[serverId]/tools/[workflowId]",
10628
+ pathParams: ["serverId", "workflowId"],
10629
+ pathParamDocs: {
10630
+ serverId: "Unique workflow-MCP server identifier.",
10631
+ workflowId: "Workflow published as a tool on this server."
10632
+ },
10633
+ responseMode: "json",
10634
+ summary: "Unpublish Workflow MCP Tool"
10635
+ },
10636
+ unzipFile: {
10637
+ method: "POST",
10638
+ path: "/api/v2/files/[fileId]/unzip",
10639
+ pathParams: ["fileId"],
10640
+ pathParamDocs: { fileId: "File identifier." },
10641
+ responseMode: "json",
10642
+ summary: "Unzip File",
10643
+ body: {
10644
+ workspaceId: { kind: "string", required: true, describe: "Workspace that owns the archive." }
10645
+ }
10646
+ },
10647
+ updateCredential: {
10648
+ method: "PATCH",
10649
+ path: "/api/v2/credentials/[credentialId]",
10650
+ pathParams: ["credentialId"],
10651
+ pathParamDocs: { credentialId: "Credential to update or disconnect." },
10652
+ responseMode: "json",
10653
+ summary: "Update Credential",
10654
+ query: {
10655
+ workspaceId: {
10656
+ kind: "string",
10657
+ required: true,
10658
+ describe: "Workspace expected to own the credential."
10659
+ }
10660
+ },
10661
+ body: {
10662
+ displayName: { kind: "string", describe: "New name shown for the credential in Sim." },
10663
+ description: {
10664
+ kind: "string",
10665
+ describe: "New credential description. Send null to clear the stored one."
10666
+ },
10667
+ serviceAccountJson: {
10668
+ kind: "string",
10669
+ describe: "Write-only Google service-account JSON key."
10670
+ },
10671
+ apiToken: { kind: "string", describe: "Write-only provider API token." },
10672
+ domain: { kind: "string", describe: "Provider account domain." },
10673
+ signingSecret: { kind: "string", describe: "Write-only webhook signing secret." },
10674
+ botToken: { kind: "string", describe: "Write-only bot token." },
10675
+ clientId: { kind: "string", describe: "OAuth client identifier." },
10676
+ clientSecret: { kind: "string", describe: "Write-only OAuth client secret." },
10677
+ certificateId: { kind: "string", describe: "Provider certificate mapping identifier." },
10678
+ orgId: { kind: "string", describe: "Provider organization ID." },
10679
+ dataCenter: { kind: "string", describe: "Provider data center." },
10680
+ authMethod: { kind: "string", describe: "Provider authentication method." },
10681
+ privateKey: { kind: "string", describe: "Write-only PEM private key." },
10682
+ username: { kind: "string", describe: "Provider run-as username." }
10683
+ }
10684
+ },
9079
10685
  updateCustomTool: {
9080
10686
  method: "PATCH",
9081
- path: "/api/v2/custom-tools/[id]",
9082
- pathParams: ["id"],
9083
- pathParamDocs: { id: "Unique custom tool identifier." },
10687
+ path: "/api/v2/custom-tools/[customToolId]",
10688
+ pathParams: ["customToolId"],
10689
+ pathParamDocs: { customToolId: "Unique custom tool identifier." },
9084
10690
  responseMode: "json",
9085
10691
  summary: "Update Custom Tool",
9086
10692
  body: {
@@ -9116,31 +10722,118 @@ var V2_OPERATIONS = {
9116
10722
  }
9117
10723
  }
9118
10724
  },
9119
- updateKnowledgeBase: {
10725
+ updateKnowledgeBase: {
10726
+ method: "PATCH",
10727
+ path: "/api/v2/knowledge/[knowledgeBaseId]",
10728
+ pathParams: ["knowledgeBaseId"],
10729
+ pathParamDocs: { knowledgeBaseId: "Unique knowledge base identifier." },
10730
+ responseMode: "json",
10731
+ summary: "Update Knowledge Base",
10732
+ body: {
10733
+ workspaceId: {
10734
+ kind: "string",
10735
+ required: true,
10736
+ describe: "Workspace that owns the knowledge base."
10737
+ },
10738
+ name: { kind: "string", describe: "New knowledge base name." },
10739
+ description: { kind: "string", describe: "New knowledge base description." },
10740
+ chunkingConfig: { kind: "object", describe: "New document chunking configuration." },
10741
+ folderPath: { kind: "string", describe: "New containing-folder path." }
10742
+ }
10743
+ },
10744
+ updateKnowledgeChunk: {
10745
+ method: "PATCH",
10746
+ path: "/api/v2/knowledge/[knowledgeBaseId]/documents/[documentId]/chunks/[chunkId]",
10747
+ pathParams: ["knowledgeBaseId", "documentId", "chunkId"],
10748
+ pathParamDocs: {
10749
+ knowledgeBaseId: "Unique knowledge base identifier.",
10750
+ documentId: "Unique knowledge document identifier.",
10751
+ chunkId: "Unique chunk identifier."
10752
+ },
10753
+ responseMode: "json",
10754
+ summary: "Update Chunk",
10755
+ body: {
10756
+ workspaceId: {
10757
+ kind: "string",
10758
+ required: true,
10759
+ describe: "Workspace that owns the knowledge base."
10760
+ },
10761
+ content: {
10762
+ kind: "string",
10763
+ describe: "Replacement text. Changing it re-embeds the chunk and re-derives its token and character counts."
10764
+ },
10765
+ enabled: {
10766
+ kind: "boolean",
10767
+ describe: "Whether the chunk participates in search. Disabling keeps it indexed."
10768
+ }
10769
+ }
10770
+ },
10771
+ updateKnowledgeConnector: {
10772
+ method: "PATCH",
10773
+ path: "/api/v2/knowledge/[knowledgeBaseId]/connectors/[connectorId]",
10774
+ pathParams: ["knowledgeBaseId", "connectorId"],
10775
+ pathParamDocs: {
10776
+ knowledgeBaseId: "Knowledge base that owns the connector.",
10777
+ connectorId: "Connector selected for the operation."
10778
+ },
10779
+ responseMode: "json",
10780
+ summary: "Update Knowledge Connector",
10781
+ body: {
10782
+ workspaceId: {
10783
+ kind: "string",
10784
+ required: true,
10785
+ describe: "Workspace that owns the knowledge base."
10786
+ },
10787
+ sourceConfig: {
10788
+ kind: "object",
10789
+ describe: "Replacement source selection and filtering configuration. Updating a runnable connector queues synchronization; paused connectors remain paused."
10790
+ },
10791
+ syncIntervalMinutes: {
10792
+ kind: "integer",
10793
+ describe: "New scheduled synchronization interval in minutes."
10794
+ },
10795
+ status: {
10796
+ kind: "enum",
10797
+ values: ["active", "paused"],
10798
+ describe: "New connector state."
10799
+ }
10800
+ }
10801
+ },
10802
+ updateKnowledgeConnectorDocuments: {
9120
10803
  method: "PATCH",
9121
- path: "/api/v2/knowledge/[id]",
9122
- pathParams: ["id"],
9123
- pathParamDocs: { id: "Unique knowledge base identifier." },
10804
+ path: "/api/v2/knowledge/[knowledgeBaseId]/connectors/[connectorId]/documents",
10805
+ pathParams: ["knowledgeBaseId", "connectorId"],
10806
+ pathParamDocs: {
10807
+ knowledgeBaseId: "Knowledge base that owns the connector.",
10808
+ connectorId: "Connector selected for the operation."
10809
+ },
9124
10810
  responseMode: "json",
9125
- summary: "Update Knowledge Base",
10811
+ summary: "Update Knowledge Connector Documents",
9126
10812
  body: {
9127
10813
  workspaceId: {
9128
10814
  kind: "string",
9129
10815
  required: true,
9130
10816
  describe: "Workspace that owns the knowledge base."
9131
10817
  },
9132
- name: { kind: "string", describe: "New knowledge base name." },
9133
- description: { kind: "string", describe: "New knowledge base description." },
9134
- chunkingConfig: { kind: "object", describe: "New document chunking configuration." },
9135
- folderPath: { kind: "string", describe: "New containing-folder path." }
10818
+ operation: {
10819
+ kind: "enum",
10820
+ required: true,
10821
+ values: ["restore", "exclude"],
10822
+ describe: "Whether to restore or exclude the selected documents."
10823
+ },
10824
+ documentIds: {
10825
+ kind: "array",
10826
+ required: true,
10827
+ describe: "Connector document identifiers to update."
10828
+ }
9136
10829
  }
9137
10830
  },
9138
10831
  updateKnowledgeDocument: {
9139
10832
  method: "PATCH",
9140
- path: "/api/v2/knowledge/[id]/documents/[documentId]",
9141
- pathParams: ["id", "documentId"],
10833
+ path: "/api/v2/knowledge/[knowledgeBaseId]/documents/[documentId]",
10834
+ pathParams: ["knowledgeBaseId", "documentId"],
9142
10835
  pathParamDocs: {
9143
- id: "Unique knowledge base identifier.",
10836
+ knowledgeBaseId: "Unique knowledge base identifier.",
9144
10837
  documentId: "Unique knowledge document identifier."
9145
10838
  },
9146
10839
  responseMode: "json",
@@ -9179,11 +10872,35 @@ var V2_OPERATIONS = {
9179
10872
  }
9180
10873
  }
9181
10874
  },
10875
+ updateKnowledgeTag: {
10876
+ method: "PATCH",
10877
+ path: "/api/v2/knowledge/[knowledgeBaseId]/tags/[tagId]",
10878
+ pathParams: ["knowledgeBaseId", "tagId"],
10879
+ pathParamDocs: {
10880
+ knowledgeBaseId: "Unique knowledge base identifier.",
10881
+ tagId: "Unique tag definition identifier."
10882
+ },
10883
+ responseMode: "json",
10884
+ summary: "Update Tag",
10885
+ body: {
10886
+ workspaceId: {
10887
+ kind: "string",
10888
+ required: true,
10889
+ describe: "Workspace that owns the knowledge base."
10890
+ },
10891
+ displayName: { kind: "string", describe: "New tag display name." },
10892
+ fieldType: {
10893
+ kind: "enum",
10894
+ values: ["text", "number", "date", "boolean"],
10895
+ describe: "New value type for the tag."
10896
+ }
10897
+ }
10898
+ },
9182
10899
  updateMcpServer: {
9183
10900
  method: "PATCH",
9184
- path: "/api/v2/mcp-servers/[id]",
9185
- pathParams: ["id"],
9186
- pathParamDocs: { id: "Unique MCP server identifier." },
10901
+ path: "/api/v2/mcp-servers/[mcpServerId]",
10902
+ pathParams: ["mcpServerId"],
10903
+ pathParamDocs: { mcpServerId: "Unique MCP server identifier." },
9187
10904
  responseMode: "json",
9188
10905
  summary: "Update MCP Server",
9189
10906
  body: {
@@ -9262,10 +10979,10 @@ var V2_OPERATIONS = {
9262
10979
  },
9263
10980
  updateSkill: {
9264
10981
  method: "PATCH",
9265
- path: "/api/v2/skills/[id]",
9266
- pathParams: ["id"],
10982
+ path: "/api/v2/skills/[skillId]",
10983
+ pathParams: ["skillId"],
9267
10984
  pathParamDocs: {
9268
- id: "Unique skill identifier. A built-in skill is `builtin-` followed by its name, for example `builtin-research`."
10985
+ skillId: "Unique skill identifier. A built-in skill is `builtin-` followed by its name, for example `builtin-research`."
9269
10986
  },
9270
10987
  responseMode: "json",
9271
10988
  summary: "Update Skill",
@@ -9352,9 +11069,9 @@ var V2_OPERATIONS = {
9352
11069
  },
9353
11070
  updateWorkflow: {
9354
11071
  method: "PATCH",
9355
- path: "/api/v2/workflows/[id]",
9356
- pathParams: ["id"],
9357
- pathParamDocs: { id: "Unique workflow identifier." },
11072
+ path: "/api/v2/workflows/[workflowId]",
11073
+ pathParams: ["workflowId"],
11074
+ pathParamDocs: { workflowId: "Unique workflow identifier." },
9358
11075
  responseMode: "json",
9359
11076
  summary: "Update Workflow",
9360
11077
  body: {
@@ -9399,11 +11116,60 @@ var V2_OPERATIONS = {
9399
11116
  autoRun: { kind: "boolean", describe: "Replacement automatic-run setting." }
9400
11117
  }
9401
11118
  },
11119
+ updateWorkflowMcpServer: {
11120
+ method: "PATCH",
11121
+ path: "/api/v2/workflow-mcp-servers/[serverId]",
11122
+ pathParams: ["serverId"],
11123
+ pathParamDocs: { serverId: "Unique workflow-MCP server identifier." },
11124
+ responseMode: "json",
11125
+ summary: "Update Workflow MCP Server",
11126
+ body: {
11127
+ name: { kind: "string", describe: "Server display name, shown to connecting MCP clients." },
11128
+ description: { kind: "string", describe: "New server description, or null to clear it." },
11129
+ isPublic: {
11130
+ kind: "boolean",
11131
+ describe: "Whether the server answers MCP clients without a Sim API key."
11132
+ }
11133
+ }
11134
+ },
11135
+ updateWorkflowPublicApi: {
11136
+ method: "PATCH",
11137
+ path: "/api/v2/workflows/[workflowId]/deployment",
11138
+ pathParams: ["workflowId"],
11139
+ pathParamDocs: { workflowId: "Unique workflow identifier." },
11140
+ responseMode: "json",
11141
+ summary: "Update Workflow Public API Access",
11142
+ body: {
11143
+ isPublicApi: {
11144
+ kind: "boolean",
11145
+ required: true,
11146
+ describe: "Whether the deployed workflow should accept unauthenticated public API execution."
11147
+ }
11148
+ }
11149
+ },
11150
+ updateWorkflowVersion: {
11151
+ method: "PATCH",
11152
+ path: "/api/v2/workflows/[workflowId]/versions/[version]",
11153
+ pathParams: ["workflowId", "version"],
11154
+ pathParamDocs: {
11155
+ workflowId: "Unique workflow identifier.",
11156
+ version: "Numeric deployment version."
11157
+ },
11158
+ responseMode: "json",
11159
+ summary: "Update Workflow Version",
11160
+ body: {
11161
+ name: { kind: "string", describe: "New label for the deployment version." },
11162
+ description: {
11163
+ kind: "string",
11164
+ describe: "New release note for the deployment version, or null to clear it."
11165
+ }
11166
+ }
11167
+ },
9402
11168
  uploadKnowledgeDocument: {
9403
11169
  method: "POST",
9404
- path: "/api/v2/knowledge/[id]/documents",
9405
- pathParams: ["id"],
9406
- pathParamDocs: { id: "Unique knowledge base identifier." },
11170
+ path: "/api/v2/knowledge/[knowledgeBaseId]/documents",
11171
+ pathParams: ["knowledgeBaseId"],
11172
+ pathParamDocs: { knowledgeBaseId: "Unique knowledge base identifier." },
9407
11173
  responseMode: "json",
9408
11174
  summary: "Upload Document",
9409
11175
  query: {
@@ -9463,6 +11229,8 @@ var V2_OPERATIONS = {
9463
11229
  };
9464
11230
 
9465
11231
  // src/commands/auth.ts
11232
+ var PROFILE_NAME_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
11233
+ var MAX_INTERACTIVE_WORKSPACES = 1000;
9466
11234
  function openBrowser(url) {
9467
11235
  const [command, args] = process.platform === "win32" ? ["cmd", ["/c", "start", "", url]] : [process.platform === "darwin" ? "open" : "xdg-open", [url]];
9468
11236
  try {
@@ -9498,9 +11266,91 @@ async function confirmProfileOverwrite(profileName) {
9498
11266
  prompt.close();
9499
11267
  }
9500
11268
  }
11269
+ function selectedProfileName(command) {
11270
+ return globalsOf(command).profile || process.env.SIM_PROFILE || DEFAULT_PROFILE;
11271
+ }
11272
+ function validateNewProfileName(profileName) {
11273
+ if (!PROFILE_NAME_PATTERN.test(profileName)) {
11274
+ throw new SimApiError(`Invalid profile name "${profileName}". Use letters, numbers, dots, underscores, or hyphens, starting with a letter or number.`, 0);
11275
+ }
11276
+ if (listProfiles().includes(profileName)) {
11277
+ throw new SimApiError(`Profile "${profileName}" already exists. Remove it first with: sim logout --all --profile ${profileName}`, 0);
11278
+ }
11279
+ }
11280
+ function requireStoredAuthentication(profile) {
11281
+ const authProfile = resolveAuthenticationProfileName(profile.name);
11282
+ const storedKey = readCredentialsProfile(authProfile).api_key;
11283
+ if (profile.sources.apiKey !== "credentials" || !storedKey) {
11284
+ throw new SimApiError(`Cannot create a shared profile from "${profile.name}": the active API key is not stored. Run: sim login --profile ${authProfile}`, 0);
11285
+ }
11286
+ if (profile.sources.endpoint === "flag" || profile.sources.endpoint === "env") {
11287
+ throw new SimApiError(`Cannot create a shared profile from "${profile.name}": the active endpoint comes from ${profile.sources.endpoint}. Save it with: sim configure --profile ${authProfile} --set-endpoint ${profile.endpoint}`, 0);
11288
+ }
11289
+ return authProfile;
11290
+ }
11291
+ async function getWorkspaceById(client, workspaceId) {
11292
+ const operation = V2_OPERATIONS.getWorkspace;
11293
+ const response = await client.request(resolvePath(operation.path, { workspaceId }), { method: operation.method });
11294
+ return response.data;
11295
+ }
11296
+ async function chooseWorkspace(client) {
11297
+ if (!process.stdin.isTTY) {
11298
+ throw new SimApiError("No workspace provided. Pass --workspace <id> when creating a profile non-interactively.", 0);
11299
+ }
11300
+ const operation = V2_OPERATIONS.listWorkspaces;
11301
+ const workspaces = await requestAllPages(client, operation.path, {
11302
+ method: operation.method,
11303
+ query: { sortBy: "name", sortOrder: "asc" },
11304
+ pageSize: 100,
11305
+ limit: MAX_INTERACTIVE_WORKSPACES + 1
11306
+ });
11307
+ if (workspaces.length === 0) {
11308
+ throw new SimApiError("The active API key cannot access any workspaces.", 0);
11309
+ }
11310
+ if (workspaces.length > MAX_INTERACTIVE_WORKSPACES) {
11311
+ throw new SimApiError(`The active API key can access more than ${MAX_INTERACTIVE_WORKSPACES} workspaces, which is too many to show interactively. Pass --workspace <id> instead.`, 0);
11312
+ }
11313
+ console.log(`
11314
+ Available workspaces:`);
11315
+ for (const [index, workspace] of workspaces.entries()) {
11316
+ console.log(` ${index + 1}) ${safeOneLine(workspace.name)} (${workspace.id})`);
11317
+ }
11318
+ const prompt = createInterface({ input: process.stdin, output: process.stderr });
11319
+ try {
11320
+ const answer = await prompt.question(`Choose a workspace [1-${workspaces.length}]: `);
11321
+ const selected = Number(answer.trim());
11322
+ if (!Number.isInteger(selected) || selected < 1 || selected > workspaces.length) {
11323
+ throw new SimApiError(`Invalid workspace selection "${safeOneLine(answer)}". Choose a number from 1 to ${workspaces.length}.`, 0);
11324
+ }
11325
+ return workspaces[selected - 1];
11326
+ } finally {
11327
+ prompt.close();
11328
+ }
11329
+ }
11330
+ function addProfileCommand() {
11331
+ return new Command("add").description("Add a workspace profile that shares the active stored login").argument("<name>", "Name for the new profile").option("-w, --workspace <id>", "Existing workspace to use; omit for an interactive picker").action(async (profileName, _options, command) => {
11332
+ validateNewProfileName(profileName);
11333
+ const { client, profile } = clientFrom(command);
11334
+ const authProfile = requireStoredAuthentication(profile);
11335
+ const workspaceId = globalsOf(command).workspace;
11336
+ const workspace = workspaceId ? await getWorkspaceById(client, workspaceId) : await chooseWorkspace(client);
11337
+ writeConfigProfile(profileName, {
11338
+ auth_profile: authProfile,
11339
+ workspace: workspace.id
11340
+ });
11341
+ console.log(source_default.green(`✓ Added profile "${profileName}" in ${configPath()}`));
11342
+ console.log(` Workspace: ${safeOneLine(workspace.name)} (${workspace.id})`);
11343
+ console.log(` Authentication: ${authProfile}`);
11344
+ console.log(source_default.dim(` Try: sim --profile ${profileName} whoami`));
11345
+ });
11346
+ }
9501
11347
  function loginCommand() {
9502
11348
  return new Command("login").description("Authorize this terminal and store an API key for the profile").option("--scope <scope>", "Key space to mint from: platform or copilot", "platform").option("--no-browser", "Print the URL instead of opening a browser").option("-y, --yes", "Overwrite an existing profile without prompting").action(async (options, command) => {
9503
11349
  const profile = profileFrom(command);
11350
+ const authProfile = resolveAuthenticationProfileName(profile.name);
11351
+ if (authProfile !== profile.name) {
11352
+ throw new SimApiError(`Profile "${profile.name}" shares authentication with "${authProfile}". Run: sim login --profile ${authProfile}`, 0);
11353
+ }
9504
11354
  if (options.scope !== "platform" && options.scope !== "copilot") {
9505
11355
  throw new SimApiError(`Unknown scope "${options.scope}". Use platform or copilot.`, 0);
9506
11356
  }
@@ -9547,16 +11397,25 @@ Waiting for approval…`));
9547
11397
  }
9548
11398
  function logoutCommand() {
9549
11399
  return new Command("logout").description("Remove the profile's stored API key").option("--all", "Remove the profile entirely, including its settings").action((options, command) => {
9550
- const profile = profileFrom(command);
9551
11400
  if (options.all) {
9552
- const removed = deleteProfile(profile.name);
11401
+ const profileName = selectedProfileName(command);
11402
+ const dependents = listAuthenticationDependents(profileName);
11403
+ if (dependents.length > 0) {
11404
+ throw new SimApiError(`Cannot remove authentication profile "${profileName}" because it is used by: ${dependents.join(", ")}. Remove those profiles first.`, 0);
11405
+ }
11406
+ const removed = deleteProfile(profileName);
9553
11407
  if (!removed.config && !removed.credentials) {
9554
- console.log(source_default.dim(`Nothing stored for profile "${profile.name}".`));
11408
+ console.log(source_default.dim(`Nothing stored for profile "${profileName}".`));
9555
11409
  return;
9556
11410
  }
9557
- console.log(source_default.green(`✓ Removed profile "${profile.name}".`));
11411
+ console.log(source_default.green(`✓ Removed profile "${profileName}".`));
9558
11412
  return;
9559
11413
  }
11414
+ const profile = profileFrom(command);
11415
+ const authProfile = resolveAuthenticationProfileName(profile.name);
11416
+ if (authProfile !== profile.name) {
11417
+ throw new SimApiError(`Profile "${profile.name}" shares authentication with "${authProfile}". Log out of the authentication profile instead: sim logout --profile ${authProfile}`, 0);
11418
+ }
9560
11419
  if (!readCredentialsProfile(profile.name).api_key) {
9561
11420
  console.log(source_default.dim(`No stored key for profile "${profile.name}".`));
9562
11421
  return;
@@ -9664,27 +11523,38 @@ function whoamiCommand() {
9664
11523
  });
9665
11524
  }
9666
11525
  function profilesCommand() {
9667
- return new Command("profiles").alias("profile").description("List the profiles defined in the config and credentials files").action((_options, command) => {
11526
+ const command = new Command("profiles").alias("profile").description("List profiles or add a workspace profile that shares a stored login");
11527
+ const printProfiles = (_options, actionCommand) => {
9668
11528
  const profiles = listProfiles();
9669
11529
  if (profiles.length === 0) {
9670
11530
  console.log(source_default.dim("No profiles yet. Run: sim login"));
9671
11531
  return;
9672
11532
  }
9673
- const active = profileFrom(command).name;
11533
+ const active = selectedProfileName(actionCommand);
9674
11534
  for (const name of profiles) {
9675
11535
  const marker = name === active ? source_default.green("*") : " ";
9676
- const hasKey = Boolean(readCredentialsProfile(name).api_key);
9677
- console.log(`${marker} ${name}${hasKey ? "" : source_default.dim(" (no key)")}`);
11536
+ const authProfile = resolveAuthenticationProfileName(name);
11537
+ const hasKey = Boolean(readCredentialsProfile(authProfile).api_key);
11538
+ const authentication = authProfile === name ? "" : source_default.dim(` (auth: ${authProfile})`);
11539
+ console.log(`${marker} ${name}${hasKey ? "" : source_default.dim(" (no key)")}${authentication}`);
9678
11540
  }
9679
- });
11541
+ };
11542
+ command.action(printProfiles);
11543
+ command.addCommand(new Command("list").description("List configured profiles").action(printProfiles));
11544
+ command.addCommand(addProfileCommand());
11545
+ return command;
9680
11546
  }
9681
11547
 
9682
11548
  // src/commands/configure.ts
9683
11549
  function configureCommand() {
9684
11550
  return new Command("configure").description("Set a profile's endpoint, default workspace, or output format").option("--set-endpoint <url>", "Sim deployment to talk to").option("--set-workspace <id>", "Default workspace for workspace-scoped commands").option("--set-output <format>", `Default output format (${OUTPUT_FORMATS.join(" | ")})`).option("--unset <key...>", "Remove settings (endpoint, workspace, output)").action((options, command) => {
9685
11551
  const profile = profileFrom(command);
11552
+ const authProfile = resolveAuthenticationProfileName(profile.name);
9686
11553
  const updates = {};
9687
11554
  if (options.setEndpoint) {
11555
+ if (authProfile !== profile.name) {
11556
+ throw new SimApiError(`Profile "${profile.name}" shares its endpoint with authentication profile "${authProfile}". Run: sim configure --profile ${authProfile} --set-endpoint ${options.setEndpoint}`, 0);
11557
+ }
9688
11558
  updates.endpoint = normalizeEndpoint(options.setEndpoint, "--set-endpoint");
9689
11559
  }
9690
11560
  if (options.setWorkspace)
@@ -9699,6 +11569,9 @@ function configureCommand() {
9699
11569
  if (!["endpoint", "workspace", "output"].includes(key)) {
9700
11570
  throw new SimApiError(`Cannot unset "${key}". Use endpoint, workspace, or output.`, 0);
9701
11571
  }
11572
+ if (key === "endpoint" && authProfile !== profile.name) {
11573
+ throw new SimApiError(`Profile "${profile.name}" shares its endpoint with authentication profile "${authProfile}". Run: sim configure --profile ${authProfile} --unset endpoint`, 0);
11574
+ }
9702
11575
  updates[key] = null;
9703
11576
  }
9704
11577
  if (Object.keys(updates).length === 0) {
@@ -9723,7 +11596,9 @@ import { existsSync as existsSync2, readFileSync as readFileSync3, readSync } fr
9723
11596
  // src/contract/commands.ts
9724
11597
  var TABLE_NAME_HELP = "Identifier: letters, numbers, and underscores; cannot start with a number";
9725
11598
  var TABLE_FILTER_HELP = 'Predicate: {"all":[{"field":"status","op":"eq","value":"active"}]}; groups use all/any. Operators: eq, ne, gt, gte, lt, lte, in, nin, contains, ncontains, startsWith, endsWith, like, ilike, nlike, nilike, isEmpty, isNotEmpty, isNull, isNotNull';
11599
+ var TABLE_READ_FILTER_HELP = 'Condition: {"field":"status","op":"eq","value":"active"}. Groups: {"all":[{"field":"status","op":"eq","value":"active"}]} or {"any":[{"field":"status","op":"eq","value":"active"}]}; group entries may also be nested groups. Operators: eq, ne, gt, gte, lt, lte, in, nin, contains, ncontains, startsWith, endsWith, like, ilike, nlike, nilike, isEmpty, isNotEmpty, isNull, isNotNull';
9726
11600
  var TABLE_SORT_HELP = 'Ordered sort keys: [{"field":"createdAt","direction":"desc"}] (direction: asc or desc)';
11601
+ var KNOWLEDGE_TAG_DEFINITIONS_HELP = 'Tag definitions: [{"tagSlot":"tag1","displayName":"category","fieldType":"text"}]';
9727
11602
  var CUSTOM_TOOL_SCHEMA_HELP = 'OpenAI function schema: {"type":"function","function":{"name":"...","parameters":{"type":"object","properties":{}}}}';
9728
11603
  var FOLDER_PATH_INPUT = {
9729
11604
  describe: "Folder path as shown in the app; the leading / is optional",
@@ -9737,14 +11612,25 @@ var FOLDER_DELETE_FLAGS = {
9737
11612
  path: FOLDER_PATH_INPUT,
9738
11613
  recursive: { boolean: true, describe: "Delete the folder and its descendants" }
9739
11614
  };
9740
- var KNOWLEDGE_BASE_PATH_ARGUMENT = { id: "knowledgeBaseId" };
11615
+ var KNOWLEDGE_BASE_PATH_ARGUMENT = { knowledgeBaseId: "knowledgeBaseId" };
9741
11616
  var WORKFLOW_RUN_SCOPE = {
9742
- id: {
11617
+ workflowId: {
9743
11618
  name: "workflow",
9744
11619
  placeholder: "workflowId",
9745
11620
  describe: "Workflow ID"
9746
11621
  }
9747
11622
  };
11623
+ var FOLDER_PATHS_FLAG = { ...FOLDER_PATH_FLAG, list: true };
11624
+ var TARGET_FOLDER_PATH_FLAG = {
11625
+ ...FOLDER_PATH_INPUT,
11626
+ name: "to",
11627
+ describe: "Destination folder path; omit for root"
11628
+ };
11629
+ var LOG_LIST_FILTER_FLAGS = {
11630
+ workflowIds: { name: "workflow", list: true },
11631
+ folderPaths: FOLDER_PATHS_FLAG,
11632
+ triggers: { name: "trigger", list: true }
11633
+ };
9748
11634
  var FOLDER_COLUMN = { header: "folder", path: "folderPath", format: "folder-path" };
9749
11635
  var FOLDER_LIST_COLUMNS = [
9750
11636
  { header: "path", format: "folder-path" },
@@ -9761,6 +11647,7 @@ function moveResource(command, resource) {
9761
11647
  };
9762
11648
  }
9763
11649
  var CLI_CONTRACT = {
11650
+ chat: { hidden: true },
9764
11651
  createCredentialConnection: { hidden: true },
9765
11652
  createServiceAccountCredential: { hidden: true },
9766
11653
  getBillingStatus: {
@@ -9825,6 +11712,43 @@ var CLI_CONTRACT = {
9825
11712
  selectAll: { boolean: true, describe: "Apply to every document in the knowledge base" }
9826
11713
  }
9827
11714
  },
11715
+ bulkUpdateKnowledgeChunks: {
11716
+ command: "knowledge chunks batch-update",
11717
+ describe: "Enable, disable, or delete many chunks at once",
11718
+ pathArgumentNames: KNOWLEDGE_BASE_PATH_ARGUMENT,
11719
+ flags: {
11720
+ chunkIds: { name: "chunk", list: true }
11721
+ },
11722
+ confirm: "This can delete every named chunk and its embedding, and cannot be undone."
11723
+ },
11724
+ createKnowledgeConnector: {
11725
+ pathArgumentNames: KNOWLEDGE_BASE_PATH_ARGUMENT
11726
+ },
11727
+ listKnowledgeConnectors: {
11728
+ pathArgumentNames: KNOWLEDGE_BASE_PATH_ARGUMENT
11729
+ },
11730
+ getKnowledgeConnector: {
11731
+ pathArgumentNames: KNOWLEDGE_BASE_PATH_ARGUMENT
11732
+ },
11733
+ listKnowledgeConnectorDocuments: {
11734
+ command: "knowledge connectors documents list",
11735
+ pathArgumentNames: KNOWLEDGE_BASE_PATH_ARGUMENT
11736
+ },
11737
+ updateKnowledgeConnector: {
11738
+ pathArgumentNames: KNOWLEDGE_BASE_PATH_ARGUMENT
11739
+ },
11740
+ updateKnowledgeConnectorDocuments: {
11741
+ command: "knowledge connectors documents update",
11742
+ pathArgumentNames: KNOWLEDGE_BASE_PATH_ARGUMENT,
11743
+ flags: {
11744
+ documentIds: { name: "document", list: true }
11745
+ }
11746
+ },
11747
+ syncKnowledgeConnector: {
11748
+ command: "knowledge connectors sync",
11749
+ pathArgumentNames: KNOWLEDGE_BASE_PATH_ARGUMENT,
11750
+ describe: "Queue a knowledge connector synchronization"
11751
+ },
9828
11752
  undeployWorkflow: {
9829
11753
  command: "workflows undeploy",
9830
11754
  describe: "Take a workflow out of deployment"
@@ -9846,11 +11770,18 @@ var CLI_CONTRACT = {
9846
11770
  pathArgumentNames: KNOWLEDGE_BASE_PATH_ARGUMENT,
9847
11771
  confirm: "This deletes the document and its embeddings."
9848
11772
  },
11773
+ deleteKnowledgeConnector: {
11774
+ pathArgumentNames: KNOWLEDGE_BASE_PATH_ARGUMENT,
11775
+ confirm: "This deletes the connector; --delete-documents also deletes its synchronized documents."
11776
+ },
9849
11777
  deleteFile: { confirm: "This archives the file." },
9850
11778
  deleteCredential: {
9851
11779
  confirm: "This disconnects the credential and removes its stored authentication."
9852
11780
  },
9853
11781
  deleteSkill: { confirm: "This deletes the skill." },
11782
+ revokeSkillEditor: {
11783
+ confirm: "This revokes the explicit skill editor grant for the selected email."
11784
+ },
9854
11785
  deleteCustomTool: { confirm: "This deletes the custom tool." },
9855
11786
  deleteMcpServer: {
9856
11787
  confirm: "This removes the MCP server and the tools it provides."
@@ -9870,9 +11801,7 @@ var CLI_CONTRACT = {
9870
11801
  },
9871
11802
  listLogs: {
9872
11803
  flags: {
9873
- workflowIds: { name: "workflow", list: true },
9874
- folderPaths: { ...FOLDER_PATH_FLAG, list: true },
9875
- triggers: { name: "trigger", list: true },
11804
+ ...LOG_LIST_FILTER_FLAGS,
9876
11805
  details: {
9877
11806
  requestDefault: "full",
9878
11807
  describe: "Response detail level; full is requested by default to name each run’s workflow"
@@ -9914,6 +11843,73 @@ var CLI_CONTRACT = {
9914
11843
  { header: "trace", path: "traceSpans", format: "trace-count" }
9915
11844
  ]
9916
11845
  },
11846
+ getMeta: {
11847
+ command: "meta status",
11848
+ describe: "Show what this API supports and which limits apply"
11849
+ },
11850
+ getWorkflowChatDeployment: {
11851
+ command: "workflows chat status",
11852
+ describe: "Show a workflow’s chat deployment"
11853
+ },
11854
+ getLogStats: {
11855
+ command: "logs stats",
11856
+ describe: "Summarize run counts, failures, and cost over a window",
11857
+ flags: LOG_LIST_FILTER_FLAGS
11858
+ },
11859
+ readFileText: {
11860
+ command: "files read",
11861
+ describe: "Read a file’s text content"
11862
+ },
11863
+ createWorkflowMcpServer: {
11864
+ flags: { workflowIds: { name: "workflow", list: true } }
11865
+ },
11866
+ deleteWorkflowMcpServer: {
11867
+ confirm: "This deletes the MCP server, and any agent calling its tools loses access."
11868
+ },
11869
+ undeployWorkflowMcpTool: {
11870
+ confirm: "This withdraws the tool, and any agent calling it loses access."
11871
+ },
11872
+ duplicateWorkflow: {
11873
+ flags: { folderPath: FOLDER_PATH_FLAG }
11874
+ },
11875
+ getWorkflowState: { command: "workflows state get" },
11876
+ replaceWorkflowState: {
11877
+ command: "workflows state replace",
11878
+ confirm: "This replaces the entire draft graph and cannot be undone."
11879
+ },
11880
+ applyWorkflowOperations: {
11881
+ command: "workflows operations apply",
11882
+ confirm: "This edits the draft graph, and a delete operation removes blocks and their edges."
11883
+ },
11884
+ applyWorkflowVariables: {
11885
+ confirm: "This replaces the workflow’s variables and cannot be undone."
11886
+ },
11887
+ revertWorkflowVersion: {
11888
+ confirm: "This overwrites the draft graph with the selected version and cannot be undone."
11889
+ },
11890
+ moveWorkflows: {
11891
+ command: "workflows move",
11892
+ flags: {
11893
+ workflowIds: { name: "workflow", list: true },
11894
+ folderPath: FOLDER_PATH_FLAG
11895
+ }
11896
+ },
11897
+ moveTables: {
11898
+ command: "tables move",
11899
+ flags: {
11900
+ folderPaths: FOLDER_PATHS_FLAG,
11901
+ targetFolderPath: TARGET_FOLDER_PATH_FLAG
11902
+ }
11903
+ },
11904
+ bulkUpdateTableRows: {
11905
+ command: "tables rows update-each",
11906
+ describe: "Apply a distinct patch to each listed row"
11907
+ },
11908
+ bulkDeleteTables: {
11909
+ command: "tables batch-delete",
11910
+ flags: { folderPaths: FOLDER_PATHS_FLAG },
11911
+ confirm: "This deletes every listed table and all of their rows."
11912
+ },
9917
11913
  searchKnowledge: {
9918
11914
  flags: {
9919
11915
  knowledgeBaseIds: { name: "kb", list: true, describe: "Knowledge base ID (repeatable)" },
@@ -9946,7 +11942,7 @@ var CLI_CONTRACT = {
9946
11942
  queryRows: {
9947
11943
  command: "tables rows query",
9948
11944
  flags: {
9949
- predicate: { name: "filter", json: true, describe: TABLE_FILTER_HELP },
11945
+ predicate: { name: "filter", json: true, describe: TABLE_READ_FILTER_HELP },
9950
11946
  sort: { json: true, describe: TABLE_SORT_HELP }
9951
11947
  },
9952
11948
  expand: "data"
@@ -10046,6 +12042,49 @@ var CLI_CONTRACT = {
10046
12042
  getKnowledgeDocument: { pathArgumentNames: KNOWLEDGE_BASE_PATH_ARGUMENT },
10047
12043
  updateKnowledgeDocument: { pathArgumentNames: KNOWLEDGE_BASE_PATH_ARGUMENT },
10048
12044
  listKnowledgeTags: { pathArgumentNames: KNOWLEDGE_BASE_PATH_ARGUMENT },
12045
+ createKnowledgeTag: { pathArgumentNames: KNOWLEDGE_BASE_PATH_ARGUMENT },
12046
+ updateKnowledgeTag: { pathArgumentNames: KNOWLEDGE_BASE_PATH_ARGUMENT },
12047
+ deleteKnowledgeTag: {
12048
+ pathArgumentNames: KNOWLEDGE_BASE_PATH_ARGUMENT,
12049
+ confirm: "This deletes the tag and clears its values on every document and chunk."
12050
+ },
12051
+ getNextKnowledgeTagSlot: {
12052
+ command: "knowledge tags next-slot",
12053
+ describe: "Show which tag slot a create would take for a field type",
12054
+ pathArgumentNames: KNOWLEDGE_BASE_PATH_ARGUMENT
12055
+ },
12056
+ listKnowledgeTagUsage: {
12057
+ command: "knowledge tags usage",
12058
+ describe: "Show how many documents and chunks carry each tag",
12059
+ pathArgumentNames: KNOWLEDGE_BASE_PATH_ARGUMENT
12060
+ },
12061
+ addWorkspaceFilesToKnowledgeBase: {
12062
+ pathArgumentNames: KNOWLEDGE_BASE_PATH_ARGUMENT,
12063
+ describe: "Index files the workspace already stores",
12064
+ flags: {
12065
+ fileReferences: {
12066
+ name: "file",
12067
+ list: true,
12068
+ describe: "Workspace file ID or key (repeatable)"
12069
+ }
12070
+ }
12071
+ },
12072
+ listKnowledgeChunks: {
12073
+ pathArgumentNames: KNOWLEDGE_BASE_PATH_ARGUMENT,
12074
+ columns: [
12075
+ { header: "id" },
12076
+ { header: "index", path: "chunkIndex" },
12077
+ { header: "tokens", path: "tokenCount" },
12078
+ { header: "enabled" }
12079
+ ]
12080
+ },
12081
+ createKnowledgeChunk: { pathArgumentNames: KNOWLEDGE_BASE_PATH_ARGUMENT },
12082
+ getKnowledgeChunk: { pathArgumentNames: KNOWLEDGE_BASE_PATH_ARGUMENT },
12083
+ updateKnowledgeChunk: { pathArgumentNames: KNOWLEDGE_BASE_PATH_ARGUMENT },
12084
+ deleteKnowledgeChunk: {
12085
+ pathArgumentNames: KNOWLEDGE_BASE_PATH_ARGUMENT,
12086
+ confirm: "This deletes the chunk and its embedding."
12087
+ },
10049
12088
  listKnowledgeDocuments: {
10050
12089
  pathArgumentNames: KNOWLEDGE_BASE_PATH_ARGUMENT,
10051
12090
  columns: [
@@ -10171,6 +12210,7 @@ var CLI_CONTRACT = {
10171
12210
  describe: "Show file metadata and sharing status",
10172
12211
  fields: [
10173
12212
  { header: "id" },
12213
+ { header: "web URL", path: "webUrl" },
10174
12214
  { header: "name" },
10175
12215
  { header: "size", format: "bytes" },
10176
12216
  { header: "type" },
@@ -10190,11 +12230,7 @@ var CLI_CONTRACT = {
10190
12230
  describe: "Move files into another folder",
10191
12231
  flags: {
10192
12232
  fileIds: { list: true },
10193
- targetFolderPath: {
10194
- ...FOLDER_PATH_INPUT,
10195
- name: "to",
10196
- describe: "Destination folder path; omit for root"
10197
- }
12233
+ targetFolderPath: TARGET_FOLDER_PATH_FLAG
10198
12234
  }
10199
12235
  },
10200
12236
  renameFile: {
@@ -10206,6 +12242,72 @@ var CLI_CONTRACT = {
10206
12242
  renamedFrom: ["files restore create"],
10207
12243
  describe: "Restore an archived file"
10208
12244
  },
12245
+ restoreFileFolder: {
12246
+ command: "files folders restore",
12247
+ positionals: ["path"],
12248
+ flags: { path: FOLDER_PATH_INPUT },
12249
+ describe: "Restore an archived file folder"
12250
+ },
12251
+ restoreTable: {
12252
+ command: "tables restore",
12253
+ describe: "Restore an archived table"
12254
+ },
12255
+ restoreTableFolder: {
12256
+ command: "tables folders restore",
12257
+ positionals: ["path"],
12258
+ flags: { path: FOLDER_PATH_INPUT },
12259
+ describe: "Restore an archived table folder"
12260
+ },
12261
+ restoreKnowledgeBase: {
12262
+ command: "knowledge restore",
12263
+ describe: "Restore an archived knowledge base"
12264
+ },
12265
+ restoreWorkflow: {
12266
+ command: "workflows restore",
12267
+ describe: "Restore an archived workflow"
12268
+ },
12269
+ cancelTableDispatch: {
12270
+ command: "tables dispatches cancel",
12271
+ describe: "Cancel a running dispatch",
12272
+ confirm: "This stops the dispatch. Cells already handed to the queue keep running — use `tables cancel-runs` to stop those."
12273
+ },
12274
+ replaceWorkflowChatDeployment: {
12275
+ command: "workflows chat publish",
12276
+ describe: "Publish or replace a workflow’s chat deployment",
12277
+ confirm: "This replaces the chat deployment wholesale. Any field you omit returns to its default, including a stored password or allow-list."
12278
+ },
12279
+ deleteWorkflowChatDeployment: {
12280
+ command: "workflows chat unpublish",
12281
+ describe: "Take a workflow’s chat deployment offline",
12282
+ confirm: "This takes the chat offline and frees its identifier. The workflow itself stays deployed and executable."
12283
+ },
12284
+ bulkSaveKnowledgeTagDefinitions: {
12285
+ command: "knowledge tags save",
12286
+ describe: "Declare the tag definitions a knowledge base needs",
12287
+ pathArgumentNames: KNOWLEDGE_BASE_PATH_ARGUMENT,
12288
+ flags: {
12289
+ definitions: { json: true, describe: KNOWLEDGE_TAG_DEFINITIONS_HELP }
12290
+ }
12291
+ },
12292
+ deleteKnowledgeTagDefinitions: {
12293
+ command: "knowledge tags cleanup",
12294
+ pathArgumentNames: KNOWLEDGE_BASE_PATH_ARGUMENT,
12295
+ describe: "Remove tag definitions no document still uses",
12296
+ confirm: "This deletes every tag definition no document still uses. Their slots become free for a different field."
12297
+ },
12298
+ unzipFile: {
12299
+ command: "files unzip",
12300
+ describe: "Unzip an archive into a new folder beside it",
12301
+ confirm: "This writes every file in the archive into the workspace."
12302
+ },
12303
+ bulkDownloadFiles: {
12304
+ command: "files bulk-download",
12305
+ describe: "Download files and folders as a zip archive",
12306
+ flags: {
12307
+ fileIds: { list: true },
12308
+ folderPaths: FOLDER_PATHS_FLAG
12309
+ }
12310
+ },
10209
12311
  updateFileContent: {
10210
12312
  command: "files set-content",
10211
12313
  describe: "Replace a file’s contents",
@@ -10354,11 +12456,12 @@ var CLI_CONTRACT = {
10354
12456
  filter: { json: true, describe: TABLE_FILTER_HELP }
10355
12457
  }
10356
12458
  },
10357
- findTableRows: {
10358
- command: "tables rows find",
10359
- describe: "Find rows matching a predicate",
12459
+ searchTableRows: {
12460
+ command: "tables rows search",
12461
+ renamedFrom: ["tables rows find"],
12462
+ describe: "Search cells for a value and return their coordinates",
10360
12463
  flags: {
10361
- q: { name: "query", renamedFrom: ["q"], describe: "Value to find" },
12464
+ q: { name: "query", renamedFrom: ["q"], describe: "Value to search for" },
10362
12465
  predicate: { name: "filter", json: true, describe: TABLE_FILTER_HELP },
10363
12466
  sort: { json: true, describe: TABLE_SORT_HELP }
10364
12467
  },
@@ -10374,13 +12477,14 @@ var CLI_CONTRACT = {
10374
12477
  name: "filter",
10375
12478
  renamedFrom: ["predicate"],
10376
12479
  json: true,
10377
- describe: TABLE_FILTER_HELP
12480
+ describe: TABLE_READ_FILTER_HELP
10378
12481
  }
10379
12482
  }
10380
12483
  },
10381
- runTableColumn: {
10382
- command: "tables columns run",
10383
- describe: "Run a column’s workflow",
12484
+ createTableDispatch: {
12485
+ command: "tables dispatches create",
12486
+ renamedFrom: ["tables columns run"],
12487
+ describe: "Start a column or enrichment run",
10384
12488
  flags: {
10385
12489
  groupIds: { list: true },
10386
12490
  rowIds: { list: true },
@@ -10407,10 +12511,14 @@ var CLI_CONTRACT = {
10407
12511
  },
10408
12512
  executeWorkflow: {
10409
12513
  command: "workflows run",
10410
- describe: "Run a deployed workflow",
12514
+ describe: "Run a deployed workflow or execute saved state manually",
10411
12515
  flags: {
10412
12516
  async: { boolean: true, describe: "Queue the run and return immediately" },
10413
12517
  input: { json: true, describe: "Trigger input as JSON" },
12518
+ run: {
12519
+ hidden: true,
12520
+ describe: "Low-level workflow state and entry-point selection"
12521
+ },
10414
12522
  selectedOutputs: {
10415
12523
  name: "select-output",
10416
12524
  list: true,
@@ -11133,7 +13241,7 @@ async function createServiceAccount(command, providerId, options) {
11133
13241
  if (provider.requiresClientGeneratedCredentialId && !options.id) {
11134
13242
  throw new SimApiError(`--id is required for ${providerId}.`, 0);
11135
13243
  }
11136
- const credentials = credentialValues(provider, options.credentials);
13244
+ const credentialFields = credentialValues(provider, options.credentials);
11137
13245
  const operation = V2_OPERATIONS.createServiceAccountCredential;
11138
13246
  const response = await client.request(operation.path, {
11139
13247
  method: operation.method,
@@ -11144,7 +13252,7 @@ async function createServiceAccount(command, providerId, options) {
11144
13252
  displayName: options.name,
11145
13253
  ...options.description ? { description: options.description } : {},
11146
13254
  ...options.id ? { id: options.id } : {},
11147
- ...credentials
13255
+ credentials: JSON.stringify(credentialFields)
11148
13256
  }
11149
13257
  });
11150
13258
  renderResult("createServiceAccountCredential", profile.output, response.data, SERVICE_ACCOUNT_RESULT);
@@ -11170,21 +13278,129 @@ function attachCredentialCommands(program2) {
11170
13278
  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 }));
11171
13279
  }
11172
13280
 
11173
- // src/commands/protocol/files-get.ts
11174
- import { once as once2 } from "node:events";
11175
- import { createWriteStream } from "node:fs";
11176
- import { link, lstat, mkdtemp, readlink, rename, rm } from "node:fs/promises";
11177
- import { dirname as dirname2, join as join2, resolve as resolve2 } from "node:path";
11178
- import { Readable } from "node:stream";
11179
- import { pipeline } from "node:stream/promises";
11180
-
11181
13281
  // src/commands/protocol/result.ts
11182
13282
  function printProtocolResult(format, result) {
11183
13283
  const fields = Object.entries(result).map(([key, value]) => [key, text(value)]);
11184
13284
  printRecord(format, fields, result);
11185
13285
  }
11186
13286
 
13287
+ // src/commands/protocol/chat.ts
13288
+ function parseChatStreamLine(line) {
13289
+ const trimmed = line.trim();
13290
+ if (!trimmed)
13291
+ return;
13292
+ try {
13293
+ return JSON.parse(trimmed);
13294
+ } catch {
13295
+ throw new SimApiError("Chat stream returned malformed data", 0);
13296
+ }
13297
+ }
13298
+ async function readChatStream(response, onChunk) {
13299
+ if (!response.body) {
13300
+ throw new SimApiError("Chat stream ended without a response body", 0);
13301
+ }
13302
+ const reader = response.body.getReader();
13303
+ const decoder = new TextDecoder;
13304
+ let buffer = "";
13305
+ let finalResult;
13306
+ const processLine = (line) => {
13307
+ const event = parseChatStreamLine(line);
13308
+ if (!event || event.type === "heartbeat")
13309
+ return;
13310
+ if (event.type === "chunk") {
13311
+ if (event.content)
13312
+ onChunk(sanitize(event.content));
13313
+ return;
13314
+ }
13315
+ if (event.type === "error") {
13316
+ throw new SimApiError(event.error || "Chat request failed", 0);
13317
+ }
13318
+ if (event.type === "final") {
13319
+ finalResult = event.data;
13320
+ return;
13321
+ }
13322
+ throw new SimApiError("Chat stream returned an unknown event", 0);
13323
+ };
13324
+ try {
13325
+ while (true) {
13326
+ const { done, value } = await reader.read();
13327
+ if (done)
13328
+ break;
13329
+ buffer += decoder.decode(value, { stream: true });
13330
+ const lines = buffer.split(`
13331
+ `);
13332
+ buffer = lines.pop() ?? "";
13333
+ for (const line of lines) {
13334
+ processLine(line);
13335
+ }
13336
+ }
13337
+ buffer += decoder.decode();
13338
+ processLine(buffer);
13339
+ if (!finalResult) {
13340
+ throw new SimApiError("Chat stream ended without a final result", 0);
13341
+ }
13342
+ return finalResult;
13343
+ } finally {
13344
+ reader.releaseLock();
13345
+ }
13346
+ }
13347
+ function attachChat(program2) {
13348
+ program2.command("chat").description("Ask Sim and print the reply").argument("<message>", "What to ask Sim").option("-c, --conversation <id>", "Continue the conversation with this ID").addHelpText("after", `
13349
+ Each turn prints the reply on stdout and the conversation ID on stderr; pass
13350
+ that ID back with -c to continue the same conversation. With --output json or
13351
+ yaml the reply is not streamed — the finished result is printed as one
13352
+ document, conversation ID included.
13353
+
13354
+ Examples:
13355
+ $ sim chat "What workflows do I have?"
13356
+ $ sim chat -c 3f2a… "Which of those run on a schedule?"
13357
+ $ sim --output json chat "Summarize yesterday's failed runs" | jq -r '.content'
13358
+ `).action(async (message, options, command) => {
13359
+ const { client, profile } = clientFrom(command);
13360
+ const workspaceId = client.requireWorkspace();
13361
+ const response = await client.requestRaw(V2_OPERATIONS.chat.path, {
13362
+ method: "POST",
13363
+ body: {
13364
+ workspaceId,
13365
+ message,
13366
+ ...options.conversation ? { conversationId: options.conversation } : {}
13367
+ },
13368
+ headers: { accept: "application/x-ndjson" }
13369
+ });
13370
+ const streaming = profile.output === "table" || profile.output === "text";
13371
+ let streamed = "";
13372
+ const result = await readChatStream(response, (content2) => {
13373
+ if (!streaming)
13374
+ return;
13375
+ streamed += content2;
13376
+ process.stdout.write(content2);
13377
+ });
13378
+ if (!streaming) {
13379
+ printProtocolResult(profile.output, result);
13380
+ return;
13381
+ }
13382
+ const content = sanitize(result.content ?? "");
13383
+ if (content.startsWith(streamed) && content.length > streamed.length) {
13384
+ process.stdout.write(content.slice(streamed.length));
13385
+ streamed = content;
13386
+ }
13387
+ if (streamed.length > 0 && !streamed.endsWith(`
13388
+ `)) {
13389
+ process.stdout.write(`
13390
+ `);
13391
+ }
13392
+ process.stderr.write(`${source_default.dim(`conversation: ${result.conversationId}`)}
13393
+ `);
13394
+ });
13395
+ }
13396
+
11187
13397
  // src/commands/protocol/files-get.ts
13398
+ import { once as once2 } from "node:events";
13399
+ import { createWriteStream } from "node:fs";
13400
+ import { link, lstat, mkdtemp, readlink, rename, rm } from "node:fs/promises";
13401
+ import { dirname as dirname2, join as join2, resolve as resolve2 } from "node:path";
13402
+ import { Readable } from "node:stream";
13403
+ import { pipeline } from "node:stream/promises";
11188
13404
  function writeFailure(path, error) {
11189
13405
  if (isRequestTimeout(error)) {
11190
13406
  return new SimApiError(`Downloading ${path} timed out. ${RAISE_TIMEOUT_HINT}`, 0);
@@ -11846,6 +14062,8 @@ function addFieldOption(command, operation, field, descriptor) {
11846
14062
  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)" : ""}`;
11847
14063
  const renamedFrom = flag.renamedFrom ?? [];
11848
14064
  const option = new Option(`${short}--${name} ${placeholder}`, describe);
14065
+ if (flag.hidden)
14066
+ option.hideHelp();
11849
14067
  if (choices && !takesList)
11850
14068
  option.choices([...choices]);
11851
14069
  if (descriptor.default !== undefined && field !== "limit") {
@@ -11946,6 +14164,7 @@ function entriesFor(config, folders, resources) {
11946
14164
  kind: config.kind,
11947
14165
  name: resource.name,
11948
14166
  ref: resource.id,
14167
+ webUrl: resource.webUrl,
11949
14168
  folderPath: resource.folderPath,
11950
14169
  updatedAt: resource.updatedAt
11951
14170
  }))
@@ -12157,7 +14376,7 @@ async function executeOperation(operation, commandSpec, operationSpec, invocatio
12157
14376
  requestFlags[camel(flagNameFor(operation, field))] = invocation[pathPositionalCount + index];
12158
14377
  }
12159
14378
  foldRenamedFlags(operation, commandSpec, requestFlags);
12160
- if (commandSpec.confirm && !requestFlags.yes) {
14379
+ if (commandSpec.confirm && !requestFlags.yes && requestFlags.dryRun !== true) {
12161
14380
  throw new SimApiError(`${commandSpec.confirm} Re-run with --yes to confirm.`, 0);
12162
14381
  }
12163
14382
  if (commandSpec.allWorkspaces && requestFlags.allWorkspaces && requestFlags.workspace) {
@@ -12211,6 +14430,49 @@ async function executeOperation(operation, commandSpec, operationSpec, invocatio
12211
14430
  var AGENT_STREAM_PROTOCOL_HEADER = "x-sim-stream-protocol";
12212
14431
  var AGENT_STREAM_PROTOCOL_V1 = "agent-events-v1";
12213
14432
  var DONE_SENTINEL = "[DONE]";
14433
+ function resolveWorkflowRunSelection(flags) {
14434
+ const manual = flags.manual === true;
14435
+ const trigger = typeof flags.trigger === "string" ? flags.trigger : undefined;
14436
+ const useMockPayload = flags.mockPayload === true;
14437
+ const fromBlock = typeof flags.fromBlock === "string" ? flags.fromBlock : undefined;
14438
+ const sourceRun = typeof flags.sourceRun === "string" ? flags.sourceRun : undefined;
14439
+ if ((trigger || useMockPayload) && !manual) {
14440
+ throw new SimApiError("--trigger and --mock-payload require --manual", 0);
14441
+ }
14442
+ if (fromBlock && (trigger || useMockPayload)) {
14443
+ throw new SimApiError("--from-block cannot be combined with --trigger or --mock-payload", 0);
14444
+ }
14445
+ if (fromBlock && !sourceRun) {
14446
+ throw new SimApiError("--from-block requires --source-run <runId>", 0);
14447
+ }
14448
+ if (sourceRun && !fromBlock) {
14449
+ throw new SimApiError("--source-run requires --from-block <blockId>", 0);
14450
+ }
14451
+ if ((manual || fromBlock) && flags.async === true) {
14452
+ throw new SimApiError("Manual execution does not support --async", 0);
14453
+ }
14454
+ if (useMockPayload && flags.input !== undefined) {
14455
+ throw new SimApiError("--mock-payload cannot be combined with --input", 0);
14456
+ }
14457
+ if (fromBlock && sourceRun) {
14458
+ return {
14459
+ source: "manual",
14460
+ entry: { type: "block", blockId: fromBlock, sourceRunId: sourceRun }
14461
+ };
14462
+ }
14463
+ if (!manual)
14464
+ return;
14465
+ if (!trigger && !useMockPayload)
14466
+ return { source: "manual" };
14467
+ return {
14468
+ source: "manual",
14469
+ entry: {
14470
+ type: "trigger",
14471
+ ...trigger ? { blockId: trigger } : {},
14472
+ ...useMockPayload ? { useMockPayload: true } : {}
14473
+ }
14474
+ };
14475
+ }
12214
14476
  function isRecord(value) {
12215
14477
  return typeof value === "object" && value !== null && !Array.isArray(value);
12216
14478
  }
@@ -12377,6 +14639,10 @@ async function followRun(workflowId, command) {
12377
14639
  }
12378
14640
  function followOrDelegate(previous) {
12379
14641
  return async (workflowId, _options, command) => {
14642
+ const initialFlags = command.optsWithGlobals();
14643
+ const selection = resolveWorkflowRunSelection(initialFlags);
14644
+ if (selection)
14645
+ command.setOptionValue("run", selection);
12380
14646
  const flags = command.optsWithGlobals();
12381
14647
  if (flags.follow !== true) {
12382
14648
  if (flags.includeThinking === true || flags.includeToolCalls === true) {
@@ -12399,7 +14665,7 @@ function attachWorkflowRunFollow(workflows) {
12399
14665
  }
12400
14666
  const held = run._actionHandler;
12401
14667
  const previous = typeof held === "function" ? held : null;
12402
- run.option("--follow", "Stream the run as it happens; progress on stderr, result on stdout. The stream reports only success and output, so the result omits the run id and timings a non-streaming run returns").option("--include-thinking", "Show model reasoning while following (requires --follow)").option("--include-tool-calls", "Show tool calls while following (requires --follow)").action(followOrDelegate(previous));
14668
+ run.option("--manual", "Run the current saved workflow state instead of the active deployment").option("--trigger <blockId>", "Enter a manual run through this runnable trigger (requires --manual)").option("--mock-payload", "Use the selected trigger's server-derived mock payload (requires --manual)").option("--from-block <blockId>", "Run manually from this saved workflow block").option("--source-run <runId>", "Prior run whose persisted state supplies upstream outputs (requires --from-block)").option("--follow", "Stream the run as it happens; progress on stderr, result on stdout. The stream reports only success and output, so the result omits the run id and timings a non-streaming run returns").option("--include-thinking", "Show model reasoning while following (requires --follow)").option("--include-tool-calls", "Show tool calls while following (requires --follow)").action(followOrDelegate(previous));
12403
14669
  }
12404
14670
 
12405
14671
  // src/commands/protocol/workflow-run-wait.ts
@@ -12484,7 +14750,7 @@ function attachWorkflowRunWait(runs) {
12484
14750
  const timeoutSeconds = options.waitTimeout === undefined ? DEFAULT_WAIT_TIMEOUT_SECONDS : parseWaitTimeout(options.waitTimeout);
12485
14751
  const { client, profile } = clientFrom(command);
12486
14752
  const operation = V2_OPERATIONS.getWorkflowRun;
12487
- const path = resolvePath(operation.path, { id: options.workflow, runId });
14753
+ const path = resolvePath(operation.path, { workflowId: options.workflow, runId });
12488
14754
  const startedAt = Date.now();
12489
14755
  const deadline = timeoutSeconds === 0 ? Number.POSITIVE_INFINITY : startedAt + timeoutSeconds * 1000;
12490
14756
  const progress = waitProgress();
@@ -12566,6 +14832,7 @@ function attachProtocolCommands(program2) {
12566
14832
  attachWorkflowRunFollow(workflows);
12567
14833
  attachWorkflowRunWait(group(workflows, "runs"));
12568
14834
  attachLogsFollow(group(program2, "logs"));
14835
+ attachChat(program2);
12569
14836
  }
12570
14837
 
12571
14838
  // src/terminal/secret-input.ts
@@ -12846,8 +15113,11 @@ function addLeafCommand(groups, operation, spec, segments) {
12846
15113
  throw new Error(`${operation} leaf command must include a verb`);
12847
15114
  const group2 = groupFor(groups, groupName);
12848
15115
  if (rest.length > 1) {
12849
- const [subName, ...tail] = rest;
12850
- nestedGroup(group2, subName).addCommand(buildLeaf(operation, spec, tail.join(" ")));
15116
+ let parent = group2;
15117
+ for (const segment of rest.slice(0, -1)) {
15118
+ parent = nestedGroup(parent, segment);
15119
+ }
15120
+ parent.addCommand(buildLeaf(operation, spec, rest[rest.length - 1]));
12851
15121
  return;
12852
15122
  }
12853
15123
  group2.addCommand(buildLeaf(operation, spec, rest[0]));
@@ -12908,6 +15178,7 @@ with -P, --profile, or SIM_PROFILE.
12908
15178
 
12909
15179
  Examples:
12910
15180
  $ sim login Authorize the default profile
15181
+ $ sim profile add acme --workspace ws_123 Reuse that login for a workspace
12911
15182
  $ sim login --profile dev --endpoint http://localhost:3000
12912
15183
  $ sim workflows list
12913
15184
  $ sim logs list --level error --limit 20