deepline 0.2.69 → 0.2.71

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.
@@ -1030,7 +1030,7 @@ var SDK_RELEASE = {
1030
1030
  // 0.2.0 makes Dataset Handles uniformly async-only after 0.1.320 briefly
1031
1031
  // exposed storage-dependent synchronous access. This deliberate minor
1032
1032
  // release keeps lazy paging semantics independent of row residency.
1033
- version: "0.2.69",
1033
+ version: "0.2.71",
1034
1034
  contracts: {
1035
1035
  api: {
1036
1036
  name: "sdk-http-api",
@@ -3969,16 +3969,9 @@ function isPrebuiltPlayDescription(play) {
3969
3969
  return play.origin === "prebuilt" || play.ownerType === "deepline";
3970
3970
  }
3971
3971
  function preferPrebuiltPlayDescriptions(plays) {
3972
- const prebuilt = [];
3973
- const owned = [];
3974
- for (const play of plays) {
3975
- if (isPrebuiltPlayDescription(play)) {
3976
- prebuilt.push(play);
3977
- } else {
3978
- owned.push(play);
3979
- }
3980
- }
3981
- return [...prebuilt, ...owned];
3972
+ return plays.map((play, index) => ({ play, index })).sort(
3973
+ (left, right) => Number(right.play.pinned) - Number(left.play.pinned) || Number(isPrebuiltPlayDescription(right.play)) - Number(isPrebuiltPlayDescription(left.play)) || left.index - right.index
3974
+ ).map(({ play }) => play);
3982
3975
  }
3983
3976
  function isPlayRunPackage(value) {
3984
3977
  return Boolean(
@@ -4325,6 +4318,8 @@ var DeeplineClient = class {
4325
4318
  ...play.reference ? { reference: play.reference } : {},
4326
4319
  ...play.displayName ? { displayName: play.displayName } : {},
4327
4320
  ...description ? { description } : {},
4321
+ pinned: Boolean(play.pinned),
4322
+ toolCategories: play.toolCategories ?? [],
4328
4323
  origin: play.origin,
4329
4324
  ownerType: play.ownerType,
4330
4325
  canEdit: play.canEdit,
@@ -5823,6 +5818,16 @@ var DeeplineClient = class {
5823
5818
  async listPlays(options) {
5824
5819
  const params = new URLSearchParams();
5825
5820
  if (options?.origin) params.set("origin", options.origin);
5821
+ if (options?.categories) {
5822
+ params.set(
5823
+ "categories",
5824
+ Array.isArray(options.categories) ? options.categories.join(",") : options.categories
5825
+ );
5826
+ }
5827
+ if (options?.categories || options?.includeToolCategories) {
5828
+ params.set("include_tool_categories", "1");
5829
+ }
5830
+ if (options?.includeArchived) params.set("include_archived", "1");
5826
5831
  if (options?.grep?.trim()) {
5827
5832
  params.set("grep", options.grep.trim());
5828
5833
  params.set("grep_mode", options.grepMode ?? "all");
@@ -5834,6 +5839,12 @@ var DeeplineClient = class {
5834
5839
  );
5835
5840
  return response.plays ?? [];
5836
5841
  }
5842
+ /** Set whether an org-owned Play sorts before unpinned Plays. */
5843
+ async setPlayPinned(playName, pinned) {
5844
+ return this.http.post(`/api/v2/plays/${encodeURIComponent(playName)}/pin`, {
5845
+ pinned
5846
+ });
5847
+ }
5837
5848
  /** Read product-notification destinations, subscriptions, event catalog, and DLQ health. */
5838
5849
  async getNotificationSettings() {
5839
5850
  return this.http.get("/api/v2/settings/notifications");
@@ -6036,13 +6047,22 @@ var DeeplineClient = class {
6036
6047
  );
6037
6048
  }
6038
6049
  /**
6039
- * Delete an org-owned play definition, including its revisions, trigger
6040
- * bindings, and local run records. Deepline prebuilt plays are read-only.
6050
+ * Move an org-owned play to Trash. This disables its active triggers while
6051
+ * retaining its revisions and run history so it can be restored. Deepline
6052
+ * prebuilt plays are read-only.
6041
6053
  */
6042
6054
  async deletePlay(name) {
6043
6055
  const encodedName = encodeURIComponent(name);
6044
6056
  return this.http.delete(`/api/v2/plays/${encodedName}`);
6045
6057
  }
6058
+ /** Restore an org-owned play that was previously moved to Trash. */
6059
+ async restorePlay(name) {
6060
+ const encodedName = encodeURIComponent(name);
6061
+ return this.http.post(
6062
+ `/api/v2/plays/${encodedName}/restore`,
6063
+ {}
6064
+ );
6065
+ }
6046
6066
  // ——————————————————————————————————————————————————————————
6047
6067
  // Plays — public share pages
6048
6068
  // ——————————————————————————————————————————————————————————
@@ -22891,6 +22911,29 @@ function resolvePlayCheckExportNames(sourceCode) {
22891
22911
  if (!exports || exports.length === 0) return [PLAY_DEFAULT_EXPORT];
22892
22912
  return exports.map((entry) => entry.name);
22893
22913
  }
22914
+ function artifactForProductionCompatibilityCheck(artifact) {
22915
+ const rawEdition = process.env.DEEPLINE_PROD_CHECK_AUTHORING_CONTRACT_EDITION?.trim();
22916
+ if (!rawEdition) return artifact;
22917
+ if (!/^\d+$/.test(rawEdition)) {
22918
+ throw new Error(
22919
+ "DEEPLINE_PROD_CHECK_AUTHORING_CONTRACT_EDITION must be a positive integer."
22920
+ );
22921
+ }
22922
+ const edition = Number(rawEdition);
22923
+ if (edition < 1) {
22924
+ throw new Error(
22925
+ "DEEPLINE_PROD_CHECK_AUTHORING_CONTRACT_EDITION must be a positive integer."
22926
+ );
22927
+ }
22928
+ const compatibility = isRecord10(artifact.compatibility) ? artifact.compatibility : {};
22929
+ return {
22930
+ ...artifact,
22931
+ compatibility: {
22932
+ ...compatibility,
22933
+ authoringContractEdition: edition
22934
+ }
22935
+ };
22936
+ }
22894
22937
  async function checkOneExportedPlay(input2) {
22895
22938
  const { absolutePlayPath, sourceCode, exportName } = input2;
22896
22939
  const fallbackName = extractPlayName(sourceCode, absolutePlayPath);
@@ -22930,7 +22973,7 @@ async function checkOneExportedPlay(input2) {
22930
22973
  sourceCode: graph.root.sourceCode,
22931
22974
  sourceFiles: graph.root.sourceFiles,
22932
22975
  description: graph.root.playDescription ?? void 0,
22933
- artifact: graph.root.artifact,
22976
+ artifact: artifactForProductionCompatibilityCheck(graph.root.artifact),
22934
22977
  ...exportName === PLAY_DEFAULT_EXPORT ? {} : { exportName },
22935
22978
  ...importedPlays.length > 0 ? { importedPlays } : {},
22936
22979
  ...integrationMode ? { integrationMode } : {}
@@ -24116,7 +24159,12 @@ async function handlePlayVersions(args) {
24116
24159
  async function handlePlayList(args) {
24117
24160
  const jsonOutput = argsWantJson(args);
24118
24161
  const client2 = new DeeplineClient();
24119
- const plays = await client2.listPlays();
24162
+ const categoriesIndex = args.indexOf("--categories");
24163
+ const categories = categoriesIndex >= 0 ? args[categoriesIndex + 1]?.trim() : void 0;
24164
+ const plays = await client2.listPlays({
24165
+ categories,
24166
+ includeToolCategories: true
24167
+ });
24120
24168
  if (jsonOutput) {
24121
24169
  process.stdout.write(`${JSON.stringify(plays)}
24122
24170
  `);
@@ -24127,6 +24175,8 @@ async function handlePlayList(args) {
24127
24175
  `);
24128
24176
  for (const play of plays) {
24129
24177
  const flags = [
24178
+ play.pinned ? "pinned" : null,
24179
+ ...(play.toolCategories ?? []).map((category) => `category:${category}`),
24130
24180
  play.origin === "prebuilt" || play.ownerType === "deepline" ? "prebuilt" : "owned",
24131
24181
  play.canEdit ? "editable" : "readonly",
24132
24182
  play.isDraftDirty ? "draft-dirty" : null
@@ -24156,6 +24206,36 @@ async function handlePlayList(args) {
24156
24206
  }
24157
24207
  return 0;
24158
24208
  }
24209
+ async function handlePlayPin(args, pinned) {
24210
+ const target = args.find((arg) => !arg.startsWith("-"))?.trim();
24211
+ const jsonOutput = argsWantJson(args);
24212
+ const dryRun = args.includes("--dry-run");
24213
+ if (!target) {
24214
+ console.error(
24215
+ `Usage: deepline plays ${pinned ? "pin" : "unpin"} <play> [--dry-run] [--json]`
24216
+ );
24217
+ return 2;
24218
+ }
24219
+ const parsedTarget = parseReferencedPlayTarget2(target);
24220
+ if (parsedTarget.ownerSlug) {
24221
+ console.error(
24222
+ `deepline plays ${pinned ? "pin" : "unpin"} accepts an org-owned Play identifier without a namespace. Use "${parsedTarget.unqualifiedPlayName}" instead of "${target}".`
24223
+ );
24224
+ return 2;
24225
+ }
24226
+ const name = parsedTarget.playName;
24227
+ const plan = { name, pinned, dryRun };
24228
+ if (dryRun) {
24229
+ process.stdout.write(`${JSON.stringify(plan)}
24230
+ `);
24231
+ return 0;
24232
+ }
24233
+ const result = await new DeeplineClient().setPlayPinned(name, pinned);
24234
+ if (jsonOutput) process.stdout.write(`${JSON.stringify(result)}
24235
+ `);
24236
+ else console.log(`${result.pinned ? "Pinned" : "Unpinned"} ${result.name}.`);
24237
+ return 0;
24238
+ }
24159
24239
  function parsePlaySearchOptions(args) {
24160
24240
  const query = args[0]?.trim();
24161
24241
  if (!query) {
@@ -24190,6 +24270,12 @@ function printPlayDescription(play) {
24190
24270
  if (play.description) {
24191
24271
  console.log(` Description: ${play.description}`);
24192
24272
  }
24273
+ if (play.pinned) {
24274
+ console.log(" Pinned: yes");
24275
+ }
24276
+ if (play.toolCategories?.length) {
24277
+ console.log(` Tool categories: ${play.toolCategories.join(", ")}`);
24278
+ }
24193
24279
  if (play.aliases.length > 0) {
24194
24280
  console.log(` Aliases: ${play.aliases.join(", ")}`);
24195
24281
  }
@@ -24295,6 +24381,8 @@ function summarizePlayListItemForCli(play, options) {
24295
24381
  name: play.name,
24296
24382
  ...play.reference ? { reference: play.reference } : {},
24297
24383
  ...play.displayName ? { displayName: play.displayName } : {},
24384
+ pinned: Boolean(play.pinned),
24385
+ toolCategories: play.toolCategories ?? [],
24298
24386
  origin: play.origin,
24299
24387
  ownerType: play.ownerType,
24300
24388
  canEdit: play.canEdit,
@@ -24425,6 +24513,7 @@ async function handlePlayGrep(args) {
24425
24513
  origin: play.origin,
24426
24514
  ownerType: play.ownerType,
24427
24515
  aliases: play.aliases,
24516
+ toolCategories: play.toolCategories,
24428
24517
  inputSchema: play.inputSchema,
24429
24518
  outputSchema: play.outputSchema
24430
24519
  },
@@ -24725,15 +24814,32 @@ async function handlePlayPublish(args) {
24725
24814
  async function handlePlayDelete(args) {
24726
24815
  const playName = args[0];
24727
24816
  if (!playName) {
24728
- console.error("Usage: deepline plays delete <play-name> --yes [--json]");
24729
- return 1;
24817
+ console.error(
24818
+ "Usage: deepline plays delete <play-name> --yes [--dry-run] [--json]"
24819
+ );
24820
+ return 2;
24821
+ }
24822
+ if (looksLikeRunId(playName)) {
24823
+ console.error(
24824
+ formatPlayCommandReceivedRunIdError({
24825
+ command: "delete",
24826
+ runId: playName
24827
+ })
24828
+ );
24829
+ return 2;
24830
+ }
24831
+ if (isFileTarget(playName) || looksLikeFilePath(playName)) {
24832
+ console.error(
24833
+ "Refusing to delete a local file. This command only moves a saved org-owned play to Trash."
24834
+ );
24835
+ return 2;
24730
24836
  }
24731
- const confirmed = args.includes("--yes") || args.includes("-y") || args.includes("--force");
24837
+ const confirmed = args.includes("--yes") || args.includes("-y");
24732
24838
  if (!confirmed) {
24733
24839
  console.error(
24734
- "Refusing to delete without --yes. This deletes the org-owned play, its revisions, trigger bindings, and local run records."
24840
+ "Refusing to move the play to Trash without --yes. This stops active triggers; the play can be restored later."
24735
24841
  );
24736
- return 1;
24842
+ return 2;
24737
24843
  }
24738
24844
  const client2 = new DeeplineClient();
24739
24845
  let detail;
@@ -24741,27 +24847,103 @@ async function handlePlayDelete(args) {
24741
24847
  detail = await client2.getPlay(parseReferencedPlayTarget2(playName).playName);
24742
24848
  } catch (error) {
24743
24849
  console.error(error instanceof Error ? error.message : String(error));
24744
- return 1;
24850
+ return 5;
24745
24851
  }
24746
24852
  if (detail.play.ownerType === "deepline" || detail.play.origin === "prebuilt") {
24747
24853
  console.error(
24748
- `Cannot delete prebuilt play: ${formatPlayReference(detail.play)}`
24854
+ `Cannot move prebuilt play to Trash: ${formatPlayReference(detail.play)}`
24749
24855
  );
24750
- return 1;
24856
+ return 2;
24751
24857
  }
24752
- const result = await client2.deletePlay(
24753
- parseReferencedPlayTarget2(formatPlayReference(detail.play)).playName
24754
- );
24858
+ const resolvedName = parseReferencedPlayTarget2(
24859
+ formatPlayReference(detail.play)
24860
+ ).playName;
24861
+ if (args.includes("--dry-run")) {
24862
+ const result2 = {
24863
+ ok: true,
24864
+ dryRun: true,
24865
+ name: resolvedName,
24866
+ plannedMutation: "move saved org-owned play to Trash and stop triggers"
24867
+ };
24868
+ if (argsWantJson(args)) {
24869
+ process.stdout.write(`${JSON.stringify(result2)}
24870
+ `);
24871
+ } else {
24872
+ process.stdout.write(
24873
+ `Dry run: would move ${result2.name} to Trash and stop its active triggers.
24874
+ `
24875
+ );
24876
+ }
24877
+ return 0;
24878
+ }
24879
+ const result = await client2.deletePlay(resolvedName);
24755
24880
  if (argsWantJson(args)) {
24756
24881
  process.stdout.write(`${JSON.stringify(result)}
24757
24882
  `);
24758
- return result.deleted ? 0 : 1;
24883
+ return result.archived || result.alreadyArchived ? 0 : 4;
24884
+ }
24885
+ if (result.alreadyArchived) {
24886
+ process.stdout.write(`Play ${result.name} is already in Trash.
24887
+ `);
24888
+ return 0;
24889
+ }
24890
+ if (!result.archived) {
24891
+ console.error(`Play not found: ${result.name}`);
24892
+ return 4;
24759
24893
  }
24760
24894
  process.stdout.write(
24761
- `Deleted ${result.name}: revisions=${result.deletedRevisionCount}, bindings=${result.deletedBindingCount}, runs=${result.deletedRunCount}
24895
+ `Moved ${result.name} to Trash: stopped bindings=${result.archivedBindingCount}
24762
24896
  `
24763
24897
  );
24764
- return result.deleted ? 0 : 1;
24898
+ return 0;
24899
+ }
24900
+ async function handlePlayRestore(args) {
24901
+ const playName = args[0];
24902
+ if (!playName) {
24903
+ console.error("Usage: deepline plays restore <play-name> [--json]");
24904
+ return 2;
24905
+ }
24906
+ if (looksLikeRunId(playName)) {
24907
+ console.error(
24908
+ formatPlayCommandReceivedRunIdError({
24909
+ command: "restore",
24910
+ runId: playName
24911
+ })
24912
+ );
24913
+ return 2;
24914
+ }
24915
+ if (isFileTarget(playName) || looksLikeFilePath(playName)) {
24916
+ console.error(
24917
+ "Refusing to restore a local file. This command only restores a saved org-owned play from Trash."
24918
+ );
24919
+ return 2;
24920
+ }
24921
+ const client2 = new DeeplineClient();
24922
+ try {
24923
+ const result = await client2.restorePlay(
24924
+ parseReferencedPlayTarget2(playName).playName
24925
+ );
24926
+ if (argsWantJson(args)) {
24927
+ process.stdout.write(`${JSON.stringify(result)}
24928
+ `);
24929
+ return result.restored || result.alreadyActive ? 0 : 4;
24930
+ }
24931
+ if (result.alreadyActive) {
24932
+ process.stdout.write(`Play ${result.name} is already active.
24933
+ `);
24934
+ return 0;
24935
+ }
24936
+ if (!result.restored) {
24937
+ console.error(`Play not found: ${result.name}`);
24938
+ return 4;
24939
+ }
24940
+ process.stdout.write(`Restored ${result.name} from Trash.
24941
+ `);
24942
+ return 0;
24943
+ } catch (error) {
24944
+ console.error(error instanceof Error ? error.message : String(error));
24945
+ return 5;
24946
+ }
24765
24947
  }
24766
24948
  function registerPlayCommands(program) {
24767
24949
  const play = program.command("plays").description("Search, validate, run, and manage cloud plays.").addHelpText(
@@ -24995,11 +25177,35 @@ Examples:
24995
25177
  deepline plays list
24996
25178
  deepline plays search email --json
24997
25179
  `
24998
- ).option("--json", "Emit JSON output. Also automatic when stdout is piped").action(async (options) => {
25180
+ ).option("--json", "Emit JSON output. Also automatic when stdout is piped").option(
25181
+ "--categories <categories>",
25182
+ "Filter by comma-separated canonical tool categories"
25183
+ ).action(async (options) => {
24999
25184
  process.exitCode = await handlePlayList([
25185
+ ...options.categories ? ["--categories", options.categories] : [],
25000
25186
  ...options.json ? ["--json"] : []
25001
25187
  ]);
25002
25188
  });
25189
+ play.command("pin <target>").description("Pin an org-owned play to the top of play listings.").option("--dry-run", "Print the planned change without saving it").option("--json", "Emit JSON output").action(async (target, options) => {
25190
+ process.exitCode = await handlePlayPin(
25191
+ [
25192
+ target,
25193
+ ...options.dryRun ? ["--dry-run"] : [],
25194
+ ...options.json ? ["--json"] : []
25195
+ ],
25196
+ true
25197
+ );
25198
+ });
25199
+ play.command("unpin <target>").description("Remove an org-owned play from the pinned group.").option("--dry-run", "Print the planned change without saving it").option("--json", "Emit JSON output").action(async (target, options) => {
25200
+ process.exitCode = await handlePlayPin(
25201
+ [
25202
+ target,
25203
+ ...options.dryRun ? ["--dry-run"] : [],
25204
+ ...options.json ? ["--json"] : []
25205
+ ],
25206
+ false
25207
+ );
25208
+ });
25003
25209
  const addPlaySearchCommand = (command) => command.description("Search Deepline prebuilt plays by task.").option(
25004
25210
  "--prebuilt",
25005
25211
  "Only show Deepline-managed prebuilt plays (default)"
@@ -25146,21 +25352,40 @@ Examples:
25146
25352
  ...options.json ? ["--json"] : []
25147
25353
  ]);
25148
25354
  });
25149
- play.command("delete <target>").description("Delete an org-owned play and its saved revisions/runs.").addHelpText(
25355
+ play.command("delete <target>").description("Move an org-owned play to Trash and stop its triggers.").addHelpText(
25150
25356
  "after",
25151
25357
  `
25152
25358
  Notes:
25153
- Destructive mutation. Deletes an org-owned play plus saved revisions and run
25154
- records. Prebuilt/read-only plays are refused. Use --yes for noninteractive runs.
25359
+ Soft delete. Moves an org-owned play to Trash and stops active triggers while
25360
+ retaining revisions and run history. Prebuilt/read-only plays are refused.
25361
+ Use --yes for noninteractive runs. Restore later with \`plays restore\`.
25155
25362
 
25156
25363
  Examples:
25157
- deepline plays delete my-play
25364
+ deepline plays delete my-play --yes
25158
25365
  deepline plays delete my-play --yes --json
25366
+ deepline plays delete my-play --yes --dry-run --json
25159
25367
  `
25160
- ).option("-y, --yes", "Confirm deletion").option("--json", "Emit JSON output. Also automatic when stdout is piped").action(async (target, options) => {
25368
+ ).option("-y, --yes", "Confirm deletion").option("--dry-run", "Show the planned archive without mutating the play").option("--json", "Emit JSON output. Also automatic when stdout is piped").action(async (target, options) => {
25161
25369
  process.exitCode = await handlePlayDelete([
25162
25370
  target,
25163
25371
  ...options.yes ? ["--yes"] : [],
25372
+ ...options.dryRun ? ["--dry-run"] : [],
25373
+ ...options.json ? ["--json"] : []
25374
+ ]);
25375
+ });
25376
+ play.command("restore <target>").description("Restore an org-owned play from Trash.").addHelpText(
25377
+ "after",
25378
+ `
25379
+ Notes:
25380
+ Restoring re-enables the saved play and recreates its trigger bindings.
25381
+
25382
+ Examples:
25383
+ deepline plays restore my-play
25384
+ deepline plays restore my-play --json
25385
+ `
25386
+ ).option("--json", "Emit JSON output. Also automatic when stdout is piped").action(async (target, options) => {
25387
+ process.exitCode = await handlePlayRestore([
25388
+ target,
25164
25389
  ...options.json ? ["--json"] : []
25165
25390
  ]);
25166
25391
  });
@@ -26335,10 +26560,12 @@ function compileEnrichConfigToPlaySource(config, options = {}) {
26335
26560
  const metadataColumnSource = renderMetadataColumnStep(config);
26336
26561
  const generatedAliases = collectGeneratedAliases(config.commands);
26337
26562
  const runOptionsSource = options.failFast ? `{ key: (row, index) => __dlEnrichRowKey(row, index + rowStart), onRowError: 'fail' as const }` : `{ key: (row, index) => __dlEnrichRowKey(row, index + rowStart) }`;
26563
+ const describedColumns = config.commands.filter((command) => isWaterfall(command) || !command.disabled).map(
26564
+ (command) => (isWaterfall(command) ? command.with_waterfall : command.alias).replace(/[_-]+/g, " ").trim()
26565
+ ).filter(Boolean).slice(0, 3);
26566
+ const generatedDescription = describedColumns.length ? `Enrich CSV rows with ${describedColumns.join(", ")}.` : "Prepare CSV rows for enrichment.";
26338
26567
  const playOptionsSource = [
26339
- `description: ${stringLiteral(
26340
- "Read a CSV file, run the configured Deepline enrich commands, and return enriched rows."
26341
- )}`,
26568
+ `description: ${stringLiteral(generatedDescription)}`,
26342
26569
  ...options.maxCreditsPerRun === void 0 ? [] : [`billing: { maxCreditsPerRun: ${String(options.maxCreditsPerRun)} }`]
26343
26570
  ].join(", ");
26344
26571
  const body = [
package/dist/index.d.mts CHANGED
@@ -1108,6 +1108,10 @@ interface PlayDefinitionDetail {
1108
1108
  name: string;
1109
1109
  /** Human-friendly display name for UI surfaces. */
1110
1110
  displayName?: string;
1111
+ /** Whether this Play sorts before unpinned Plays. */
1112
+ pinned?: boolean;
1113
+ /** Canonical categories declared by tools used in this Play. */
1114
+ toolCategories?: string[];
1111
1115
  /** Whether this entry comes from the Deepline prebuilt registry or the org-owned catalog. */
1112
1116
  origin?: 'prebuilt' | 'owned';
1113
1117
  /** Ownership class used for permissions and badges. */
@@ -1161,6 +1165,8 @@ interface PlayListItem {
1161
1165
  name: string;
1162
1166
  displayName?: string;
1163
1167
  description?: string | null;
1168
+ pinned?: boolean;
1169
+ toolCategories?: string[];
1164
1170
  origin?: 'prebuilt' | 'owned';
1165
1171
  ownerType?: 'deepline' | 'org';
1166
1172
  ownerSlug?: string;
@@ -1240,6 +1246,8 @@ interface PlayDescription {
1240
1246
  reference?: string;
1241
1247
  displayName?: string;
1242
1248
  description?: string | null;
1249
+ pinned?: boolean;
1250
+ toolCategories?: string[];
1243
1251
  origin?: 'prebuilt' | 'owned';
1244
1252
  ownerType?: 'deepline' | 'org';
1245
1253
  canEdit?: boolean;
@@ -1634,14 +1642,23 @@ interface PublishPlayVersionResult {
1634
1642
  triggerBindings?: unknown;
1635
1643
  }
1636
1644
  /**
1637
- * Result returned after deleting an org-owned play.
1645
+ * Result returned after moving an org-owned play to Trash.
1646
+ *
1647
+ * `deletePlay` is retained as the SDK method name for compatibility, but play
1648
+ * deletion is soft: revisions and run history remain available if the play is
1649
+ * restored.
1638
1650
  */
1639
1651
  interface DeletePlayResult {
1640
- deleted: boolean;
1652
+ archived: boolean;
1653
+ alreadyArchived: boolean;
1654
+ name: string;
1655
+ archivedBindingCount: number;
1656
+ }
1657
+ /** Result returned after restoring an org-owned play from Trash. */
1658
+ interface RestorePlayResult {
1659
+ restored: boolean;
1660
+ alreadyActive?: boolean;
1641
1661
  name: string;
1642
- deletedRevisionCount: number;
1643
- deletedBindingCount: number;
1644
- deletedRunCount: number;
1645
1662
  }
1646
1663
  /** Owner-facing view of a play's public share page. */
1647
1664
  interface SharePageOwnerView {
@@ -3269,7 +3286,15 @@ declare class DeeplineClient {
3269
3286
  origin?: 'prebuilt' | 'owned';
3270
3287
  grep?: string;
3271
3288
  grepMode?: 'all' | 'any' | 'phrase';
3289
+ categories?: string | string[];
3290
+ includeToolCategories?: boolean;
3291
+ includeArchived?: boolean;
3272
3292
  }): Promise<PlayListItem[]>;
3293
+ /** Set whether an org-owned Play sorts before unpinned Plays. */
3294
+ setPlayPinned(playName: string, pinned: boolean): Promise<{
3295
+ name: string;
3296
+ pinned: boolean;
3297
+ }>;
3273
3298
  /** Read product-notification destinations, subscriptions, event catalog, and DLQ health. */
3274
3299
  getNotificationSettings(): Promise<ProductNotificationSettings>;
3275
3300
  /** Start the Slack OAuth flow required by product notifications. */
@@ -3428,10 +3453,13 @@ declare class DeeplineClient {
3428
3453
  */
3429
3454
  publishPlayVersion(name: string, request?: PublishPlayVersionRequest): Promise<PublishPlayVersionResult>;
3430
3455
  /**
3431
- * Delete an org-owned play definition, including its revisions, trigger
3432
- * bindings, and local run records. Deepline prebuilt plays are read-only.
3456
+ * Move an org-owned play to Trash. This disables its active triggers while
3457
+ * retaining its revisions and run history so it can be restored. Deepline
3458
+ * prebuilt plays are read-only.
3433
3459
  */
3434
3460
  deletePlay(name: string): Promise<DeletePlayResult>;
3461
+ /** Restore an org-owned play that was previously moved to Trash. */
3462
+ restorePlay(name: string): Promise<RestorePlayResult>;
3435
3463
  /**
3436
3464
  * Current share status for a play: the public page (if any), the published
3437
3465
  * copy, and the revision picker. Read-only.
package/dist/index.d.ts CHANGED
@@ -1108,6 +1108,10 @@ interface PlayDefinitionDetail {
1108
1108
  name: string;
1109
1109
  /** Human-friendly display name for UI surfaces. */
1110
1110
  displayName?: string;
1111
+ /** Whether this Play sorts before unpinned Plays. */
1112
+ pinned?: boolean;
1113
+ /** Canonical categories declared by tools used in this Play. */
1114
+ toolCategories?: string[];
1111
1115
  /** Whether this entry comes from the Deepline prebuilt registry or the org-owned catalog. */
1112
1116
  origin?: 'prebuilt' | 'owned';
1113
1117
  /** Ownership class used for permissions and badges. */
@@ -1161,6 +1165,8 @@ interface PlayListItem {
1161
1165
  name: string;
1162
1166
  displayName?: string;
1163
1167
  description?: string | null;
1168
+ pinned?: boolean;
1169
+ toolCategories?: string[];
1164
1170
  origin?: 'prebuilt' | 'owned';
1165
1171
  ownerType?: 'deepline' | 'org';
1166
1172
  ownerSlug?: string;
@@ -1240,6 +1246,8 @@ interface PlayDescription {
1240
1246
  reference?: string;
1241
1247
  displayName?: string;
1242
1248
  description?: string | null;
1249
+ pinned?: boolean;
1250
+ toolCategories?: string[];
1243
1251
  origin?: 'prebuilt' | 'owned';
1244
1252
  ownerType?: 'deepline' | 'org';
1245
1253
  canEdit?: boolean;
@@ -1634,14 +1642,23 @@ interface PublishPlayVersionResult {
1634
1642
  triggerBindings?: unknown;
1635
1643
  }
1636
1644
  /**
1637
- * Result returned after deleting an org-owned play.
1645
+ * Result returned after moving an org-owned play to Trash.
1646
+ *
1647
+ * `deletePlay` is retained as the SDK method name for compatibility, but play
1648
+ * deletion is soft: revisions and run history remain available if the play is
1649
+ * restored.
1638
1650
  */
1639
1651
  interface DeletePlayResult {
1640
- deleted: boolean;
1652
+ archived: boolean;
1653
+ alreadyArchived: boolean;
1654
+ name: string;
1655
+ archivedBindingCount: number;
1656
+ }
1657
+ /** Result returned after restoring an org-owned play from Trash. */
1658
+ interface RestorePlayResult {
1659
+ restored: boolean;
1660
+ alreadyActive?: boolean;
1641
1661
  name: string;
1642
- deletedRevisionCount: number;
1643
- deletedBindingCount: number;
1644
- deletedRunCount: number;
1645
1662
  }
1646
1663
  /** Owner-facing view of a play's public share page. */
1647
1664
  interface SharePageOwnerView {
@@ -3269,7 +3286,15 @@ declare class DeeplineClient {
3269
3286
  origin?: 'prebuilt' | 'owned';
3270
3287
  grep?: string;
3271
3288
  grepMode?: 'all' | 'any' | 'phrase';
3289
+ categories?: string | string[];
3290
+ includeToolCategories?: boolean;
3291
+ includeArchived?: boolean;
3272
3292
  }): Promise<PlayListItem[]>;
3293
+ /** Set whether an org-owned Play sorts before unpinned Plays. */
3294
+ setPlayPinned(playName: string, pinned: boolean): Promise<{
3295
+ name: string;
3296
+ pinned: boolean;
3297
+ }>;
3273
3298
  /** Read product-notification destinations, subscriptions, event catalog, and DLQ health. */
3274
3299
  getNotificationSettings(): Promise<ProductNotificationSettings>;
3275
3300
  /** Start the Slack OAuth flow required by product notifications. */
@@ -3428,10 +3453,13 @@ declare class DeeplineClient {
3428
3453
  */
3429
3454
  publishPlayVersion(name: string, request?: PublishPlayVersionRequest): Promise<PublishPlayVersionResult>;
3430
3455
  /**
3431
- * Delete an org-owned play definition, including its revisions, trigger
3432
- * bindings, and local run records. Deepline prebuilt plays are read-only.
3456
+ * Move an org-owned play to Trash. This disables its active triggers while
3457
+ * retaining its revisions and run history so it can be restored. Deepline
3458
+ * prebuilt plays are read-only.
3433
3459
  */
3434
3460
  deletePlay(name: string): Promise<DeletePlayResult>;
3461
+ /** Restore an org-owned play that was previously moved to Trash. */
3462
+ restorePlay(name: string): Promise<RestorePlayResult>;
3435
3463
  /**
3436
3464
  * Current share status for a play: the public page (if any), the published
3437
3465
  * copy, and the revision picker. Read-only.