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.
@@ -69,6 +69,7 @@ import type {
69
69
  PublishPlayVersionResult,
70
70
  StartPlayRunRequest,
71
71
  DeletePlayResult,
72
+ RestorePlayResult,
72
73
  SharePageStatus,
73
74
  PublishSharePageRequest,
74
75
  UpdateSharePageRequest,
@@ -1155,16 +1156,16 @@ function isPrebuiltPlayDescription(
1155
1156
  function preferPrebuiltPlayDescriptions<T extends PlayDescription>(
1156
1157
  plays: T[],
1157
1158
  ): T[] {
1158
- const prebuilt: T[] = [];
1159
- const owned: T[] = [];
1160
- for (const play of plays) {
1161
- if (isPrebuiltPlayDescription(play)) {
1162
- prebuilt.push(play);
1163
- } else {
1164
- owned.push(play);
1165
- }
1166
- }
1167
- return [...prebuilt, ...owned];
1159
+ return plays
1160
+ .map((play, index) => ({ play, index }))
1161
+ .sort(
1162
+ (left, right) =>
1163
+ Number(right.play.pinned) - Number(left.play.pinned) ||
1164
+ Number(isPrebuiltPlayDescription(right.play)) -
1165
+ Number(isPrebuiltPlayDescription(left.play)) ||
1166
+ left.index - right.index,
1167
+ )
1168
+ .map(({ play }) => play);
1168
1169
  }
1169
1170
 
1170
1171
  function isPlayRunPackage(value: unknown): value is PlayRunPackage {
@@ -1774,6 +1775,8 @@ export class DeeplineClient {
1774
1775
  ...(play.reference ? { reference: play.reference } : {}),
1775
1776
  ...(play.displayName ? { displayName: play.displayName } : {}),
1776
1777
  ...(description ? { description } : {}),
1778
+ pinned: Boolean(play.pinned),
1779
+ toolCategories: play.toolCategories ?? [],
1777
1780
  origin: play.origin,
1778
1781
  ownerType: play.ownerType,
1779
1782
  canEdit: play.canEdit,
@@ -3777,9 +3780,24 @@ export class DeeplineClient {
3777
3780
  origin?: 'prebuilt' | 'owned';
3778
3781
  grep?: string;
3779
3782
  grepMode?: 'all' | 'any' | 'phrase';
3783
+ categories?: string | string[];
3784
+ includeToolCategories?: boolean;
3785
+ includeArchived?: boolean;
3780
3786
  }): Promise<PlayListItem[]> {
3781
3787
  const params = new URLSearchParams();
3782
3788
  if (options?.origin) params.set('origin', options.origin);
3789
+ if (options?.categories) {
3790
+ params.set(
3791
+ 'categories',
3792
+ Array.isArray(options.categories)
3793
+ ? options.categories.join(',')
3794
+ : options.categories,
3795
+ );
3796
+ }
3797
+ if (options?.categories || options?.includeToolCategories) {
3798
+ params.set('include_tool_categories', '1');
3799
+ }
3800
+ if (options?.includeArchived) params.set('include_archived', '1');
3783
3801
  if (options?.grep?.trim()) {
3784
3802
  params.set('grep', options.grep.trim());
3785
3803
  params.set('grep_mode', options.grepMode ?? 'all');
@@ -3792,6 +3810,16 @@ export class DeeplineClient {
3792
3810
  return response.plays ?? [];
3793
3811
  }
3794
3812
 
3813
+ /** Set whether an org-owned Play sorts before unpinned Plays. */
3814
+ async setPlayPinned(
3815
+ playName: string,
3816
+ pinned: boolean,
3817
+ ): Promise<{ name: string; pinned: boolean }> {
3818
+ return this.http.post(`/api/v2/plays/${encodeURIComponent(playName)}/pin`, {
3819
+ pinned,
3820
+ });
3821
+ }
3822
+
3795
3823
  /** Read product-notification destinations, subscriptions, event catalog, and DLQ health. */
3796
3824
  async getNotificationSettings(): Promise<ProductNotificationSettings> {
3797
3825
  return this.http.get('/api/v2/settings/notifications');
@@ -4066,14 +4094,24 @@ export class DeeplineClient {
4066
4094
  }
4067
4095
 
4068
4096
  /**
4069
- * Delete an org-owned play definition, including its revisions, trigger
4070
- * bindings, and local run records. Deepline prebuilt plays are read-only.
4097
+ * Move an org-owned play to Trash. This disables its active triggers while
4098
+ * retaining its revisions and run history so it can be restored. Deepline
4099
+ * prebuilt plays are read-only.
4071
4100
  */
4072
4101
  async deletePlay(name: string): Promise<DeletePlayResult> {
4073
4102
  const encodedName = encodeURIComponent(name);
4074
4103
  return this.http.delete<DeletePlayResult>(`/api/v2/plays/${encodedName}`);
4075
4104
  }
4076
4105
 
4106
+ /** Restore an org-owned play that was previously moved to Trash. */
4107
+ async restorePlay(name: string): Promise<RestorePlayResult> {
4108
+ const encodedName = encodeURIComponent(name);
4109
+ return this.http.post<RestorePlayResult>(
4110
+ `/api/v2/plays/${encodedName}/restore`,
4111
+ {},
4112
+ );
4113
+ }
4114
+
4077
4115
  // ——————————————————————————————————————————————————————————
4078
4116
  // Plays — public share pages
4079
4117
  // ——————————————————————————————————————————————————————————
@@ -183,7 +183,7 @@ export const SDK_RELEASE = {
183
183
  // 0.2.0 makes Dataset Handles uniformly async-only after 0.1.320 briefly
184
184
  // exposed storage-dependent synchronous access. This deliberate minor
185
185
  // release keeps lazy paging semantics independent of row residency.
186
- version: '0.2.69',
186
+ version: '0.2.71',
187
187
  contracts: {
188
188
  api: {
189
189
  name: 'sdk-http-api',
@@ -1010,6 +1010,10 @@ export interface PlayDefinitionDetail {
1010
1010
  name: string;
1011
1011
  /** Human-friendly display name for UI surfaces. */
1012
1012
  displayName?: string;
1013
+ /** Whether this Play sorts before unpinned Plays. */
1014
+ pinned?: boolean;
1015
+ /** Canonical categories declared by tools used in this Play. */
1016
+ toolCategories?: string[];
1013
1017
  /** Whether this entry comes from the Deepline prebuilt registry or the org-owned catalog. */
1014
1018
  origin?: 'prebuilt' | 'owned';
1015
1019
  /** Ownership class used for permissions and badges. */
@@ -1064,6 +1068,8 @@ export interface PlayListItem {
1064
1068
  name: string;
1065
1069
  displayName?: string;
1066
1070
  description?: string | null;
1071
+ pinned?: boolean;
1072
+ toolCategories?: string[];
1067
1073
  origin?: 'prebuilt' | 'owned';
1068
1074
  ownerType?: 'deepline' | 'org';
1069
1075
  ownerSlug?: string;
@@ -1135,6 +1141,8 @@ export interface PlayDescription {
1135
1141
  reference?: string;
1136
1142
  displayName?: string;
1137
1143
  description?: string | null;
1144
+ pinned?: boolean;
1145
+ toolCategories?: string[];
1138
1146
  origin?: 'prebuilt' | 'owned';
1139
1147
  ownerType?: 'deepline' | 'org';
1140
1148
  canEdit?: boolean;
@@ -1547,14 +1555,24 @@ export interface PublishPlayVersionResult {
1547
1555
  }
1548
1556
 
1549
1557
  /**
1550
- * Result returned after deleting an org-owned play.
1558
+ * Result returned after moving an org-owned play to Trash.
1559
+ *
1560
+ * `deletePlay` is retained as the SDK method name for compatibility, but play
1561
+ * deletion is soft: revisions and run history remain available if the play is
1562
+ * restored.
1551
1563
  */
1552
1564
  export interface DeletePlayResult {
1553
- deleted: boolean;
1565
+ archived: boolean;
1566
+ alreadyArchived: boolean;
1567
+ name: string;
1568
+ archivedBindingCount: number;
1569
+ }
1570
+
1571
+ /** Result returned after restoring an org-owned play from Trash. */
1572
+ export interface RestorePlayResult {
1573
+ restored: boolean;
1574
+ alreadyActive?: boolean;
1554
1575
  name: string;
1555
- deletedRevisionCount: number;
1556
- deletedBindingCount: number;
1557
- deletedRunCount: number;
1558
1576
  }
1559
1577
 
1560
1578
  // ——————————————————————————————————————————————————————————
@@ -38,7 +38,7 @@ export const PLAY_AUTHORING_CONTRACT_CHANGELOG = [
38
38
  changed:
39
39
  'Materializes the declared input schema in the admitted snapshot so launch never reparses current source.',
40
40
  compatibilityOwner: 'Plays Runtime',
41
- newWritesEnd: null,
41
+ newWritesEnd: '2026-08-19',
42
42
  readerRemoval: null,
43
43
  },
44
44
  ] as const;
@@ -691,10 +691,20 @@ export function compileEnrichConfigToPlaySource(
691
691
  const runOptionsSource = options.failFast
692
692
  ? `{ key: (row, index) => __dlEnrichRowKey(row, index + rowStart), onRowError: 'fail' as const }`
693
693
  : `{ key: (row, index) => __dlEnrichRowKey(row, index + rowStart) }`;
694
+ const describedColumns = config.commands
695
+ .filter((command) => isWaterfall(command) || !command.disabled)
696
+ .map((command) =>
697
+ (isWaterfall(command) ? command.with_waterfall : command.alias)
698
+ .replace(/[_-]+/g, ' ')
699
+ .trim(),
700
+ )
701
+ .filter(Boolean)
702
+ .slice(0, 3);
703
+ const generatedDescription = describedColumns.length
704
+ ? `Enrich CSV rows with ${describedColumns.join(', ')}.`
705
+ : 'Prepare CSV rows for enrichment.';
694
706
  const playOptionsSource = [
695
- `description: ${stringLiteral(
696
- 'Read a CSV file, run the configured Deepline enrich commands, and return enriched rows.',
697
- )}`,
707
+ `description: ${stringLiteral(generatedDescription)}`,
698
708
  ...(options.maxCreditsPerRun === undefined
699
709
  ? []
700
710
  : [`billing: { maxCreditsPerRun: ${String(options.maxCreditsPerRun)} }`]),
@@ -49,3 +49,15 @@ export const TOOL_CATEGORY_DESCRIPTIONS: Readonly<Record<string, string>> = {
49
49
  export function describeToolCategory(category: string): string | null {
50
50
  return TOOL_CATEGORY_DESCRIPTIONS[category] ?? null;
51
51
  }
52
+
53
+ /** Human-readable label for a canonical tool-category slug. */
54
+ export function formatToolCategoryLabel(category: string): string {
55
+ const normalized = category
56
+ .trim()
57
+ .replace(/[_-]+/g, ' ')
58
+ .replace(/\s+/g, ' ')
59
+ .toLowerCase();
60
+ return normalized
61
+ ? `${normalized[0]?.toUpperCase() ?? ''}${normalized.slice(1)}`
62
+ : '';
63
+ }