deepline 0.3.230 → 0.3.232

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -91,126 +91,6 @@ type PlaySettingsPathsPage = {
91
91
  hasMore: boolean;
92
92
  };
93
93
 
94
- type ProductNotificationFactValue = string | number | boolean;
95
- type ProductNotificationFacts = Record<string, ProductNotificationFactValue>;
96
- type ProductNotificationDestinationSettings = {
97
- kind: 'slack';
98
- targetKind: 'channel' | 'member';
99
- targetId: string;
100
- targetName: string;
101
- oauthConnectionId: string;
102
- } | {
103
- kind: 'email_addresses';
104
- to: string[];
105
- cc?: string[];
106
- bcc?: string[];
107
- } | {
108
- kind: 'email_roles';
109
- roles: string[];
110
- };
111
- type ProductNotificationTrigger = {
112
- kind: 'each_match';
113
- } | {
114
- kind: 'state_transition';
115
- targetState: string;
116
- reasonCode?: string;
117
- } | {
118
- kind: 'threshold_crossing';
119
- direction: 'above' | 'below' | 'at_or_above';
120
- threshold: number;
121
- unit?: string;
122
- } | {
123
- kind: 'consecutive_outcomes';
124
- count: number;
125
- outcome: string;
126
- maxLookback: number;
127
- };
128
- type ProductNotificationDeliveryTiming = {
129
- mode: 'immediate';
130
- } | {
131
- mode: 'immediate_first' | 'digest_only' | 'rolling_limit';
132
- windowMs: number;
133
- };
134
- type ProductNotificationRepeatMode = 'on_enter' | 'every_match';
135
- type ProductNotificationDefaultPolicy = {
136
- version: number;
137
- groups: ProductNotificationDefaultGroup[];
138
- destinations: ProductNotificationDefaultDestination[];
139
- rules: ProductNotificationDefaultRule[];
140
- };
141
- type ProductNotificationDefaultGroup = {
142
- groupKey: string;
143
- name: string;
144
- enabled: boolean;
145
- /** Omitted only by stored compatibility rows; effective groups are normalized. */
146
- deliveryTiming?: ProductNotificationDeliveryTiming;
147
- };
148
- type ProductNotificationDefaultDestination = {
149
- destinationKey: string;
150
- groupKey: string;
151
- name: string;
152
- enabled: boolean;
153
- settings: ProductNotificationDestinationSettings;
154
- };
155
- type ProductNotificationDefaultRule = {
156
- ruleKey: string;
157
- groupKey: string;
158
- enabled: boolean;
159
- notificationType: string;
160
- eventName: string;
161
- eventFilter: ProductNotificationFacts;
162
- trigger: ProductNotificationTrigger;
163
- /** Omitted only by stored compatibility rows; effective rules are normalized. */
164
- repeatMode?: ProductNotificationRepeatMode;
165
- /** Omitted only by stored compatibility rows; effective rules are normalized. */
166
- conditionGeneration?: number;
167
- };
168
- type ProductNotificationConfigMode = 'custom' | 'replace_default' | 'disable_default';
169
- /** The provider-neutral state edited by UI and CLI clients for one group. */
170
- type ProductNotificationGroupDraft = {
171
- group: EffectiveProductNotificationGroup;
172
- destinations: EffectiveProductNotificationDestination[];
173
- rules: EffectiveProductNotificationRule[];
174
- };
175
- /** Public configuration intent. Convex alone derives sparse override writes. */
176
- type ProductNotificationConfigurationChange = {
177
- kind: 'save_group';
178
- draft: ProductNotificationGroupDraft;
179
- } | {
180
- kind: 'delete_group';
181
- groupKey: string;
182
- };
183
- type EffectiveProductNotificationGroup = Omit<ProductNotificationDefaultGroup, 'deliveryTiming'> & {
184
- deliveryTiming: ProductNotificationDeliveryTiming;
185
- source: 'default' | 'workspace';
186
- configMode: 'default' | ProductNotificationConfigMode;
187
- defaultKey?: string;
188
- version: number;
189
- };
190
- type EffectiveProductNotificationDestination = ProductNotificationDefaultDestination & {
191
- source: 'default' | 'workspace';
192
- configMode: 'default' | ProductNotificationConfigMode;
193
- defaultKey?: string;
194
- version: number;
195
- status: string;
196
- };
197
- type EffectiveProductNotificationRule = Omit<ProductNotificationDefaultRule, 'repeatMode' | 'conditionGeneration'> & {
198
- repeatMode: ProductNotificationRepeatMode;
199
- conditionGeneration: number;
200
- source: 'default' | 'workspace';
201
- configMode: 'default' | ProductNotificationConfigMode;
202
- defaultKey?: string;
203
- version: number;
204
- };
205
- type EffectiveProductNotificationConfiguration = {
206
- /** Exact policy used to materialize this effective configuration. */
207
- defaultPolicy: ProductNotificationDefaultPolicy | null;
208
- workspaceVersion: number;
209
- groups: EffectiveProductNotificationGroup[];
210
- destinations: EffectiveProductNotificationDestination[];
211
- rules: EffectiveProductNotificationRule[];
212
- };
213
-
214
94
  declare const FIXTURE_BEHAVIOR_VERSION: 1;
215
95
  declare const FIXTURE_BEHAVIOR_RESPONSE_VERSION: 2;
216
96
  declare const FIXTURE_BEHAVIOR_REPLAY_VERSION: 3;
@@ -427,6 +307,126 @@ declare function formatPlayBootstrapFinderKinds(): string;
427
307
  declare function formatPlayBootstrapTemplates(): string;
428
308
  declare function formatPlayBootstrapFinderKindsForSentence(): string;
429
309
 
310
+ type ProductNotificationFactValue = string | number | boolean;
311
+ type ProductNotificationFacts = Record<string, ProductNotificationFactValue>;
312
+ type ProductNotificationDestinationSettings = {
313
+ kind: 'slack';
314
+ targetKind: 'channel' | 'member';
315
+ targetId: string;
316
+ targetName: string;
317
+ oauthConnectionId: string;
318
+ } | {
319
+ kind: 'email_addresses';
320
+ to: string[];
321
+ cc?: string[];
322
+ bcc?: string[];
323
+ } | {
324
+ kind: 'email_roles';
325
+ roles: string[];
326
+ };
327
+ type ProductNotificationTrigger = {
328
+ kind: 'each_match';
329
+ } | {
330
+ kind: 'state_transition';
331
+ targetState: string;
332
+ reasonCode?: string;
333
+ } | {
334
+ kind: 'threshold_crossing';
335
+ direction: 'above' | 'below' | 'at_or_above';
336
+ threshold: number;
337
+ unit?: string;
338
+ } | {
339
+ kind: 'consecutive_outcomes';
340
+ count: number;
341
+ outcome: string;
342
+ maxLookback: number;
343
+ };
344
+ type ProductNotificationDeliveryTiming = {
345
+ mode: 'immediate';
346
+ } | {
347
+ mode: 'immediate_first' | 'digest_only' | 'rolling_limit';
348
+ windowMs: number;
349
+ };
350
+ type ProductNotificationRepeatMode = 'on_enter' | 'every_match';
351
+ type ProductNotificationDefaultPolicy = {
352
+ version: number;
353
+ groups: ProductNotificationDefaultGroup[];
354
+ destinations: ProductNotificationDefaultDestination[];
355
+ rules: ProductNotificationDefaultRule[];
356
+ };
357
+ type ProductNotificationDefaultGroup = {
358
+ groupKey: string;
359
+ name: string;
360
+ enabled: boolean;
361
+ /** Omitted only by stored compatibility rows; effective groups are normalized. */
362
+ deliveryTiming?: ProductNotificationDeliveryTiming;
363
+ };
364
+ type ProductNotificationDefaultDestination = {
365
+ destinationKey: string;
366
+ groupKey: string;
367
+ name: string;
368
+ enabled: boolean;
369
+ settings: ProductNotificationDestinationSettings;
370
+ };
371
+ type ProductNotificationDefaultRule = {
372
+ ruleKey: string;
373
+ groupKey: string;
374
+ enabled: boolean;
375
+ notificationType: string;
376
+ eventName: string;
377
+ eventFilter: ProductNotificationFacts;
378
+ trigger: ProductNotificationTrigger;
379
+ /** Omitted only by stored compatibility rows; effective rules are normalized. */
380
+ repeatMode?: ProductNotificationRepeatMode;
381
+ /** Omitted only by stored compatibility rows; effective rules are normalized. */
382
+ conditionGeneration?: number;
383
+ };
384
+ type ProductNotificationConfigMode = 'custom' | 'replace_default' | 'disable_default';
385
+ /** The provider-neutral state edited by UI and CLI clients for one group. */
386
+ type ProductNotificationGroupDraft = {
387
+ group: EffectiveProductNotificationGroup;
388
+ destinations: EffectiveProductNotificationDestination[];
389
+ rules: EffectiveProductNotificationRule[];
390
+ };
391
+ /** Public configuration intent. Convex alone derives sparse override writes. */
392
+ type ProductNotificationConfigurationChange = {
393
+ kind: 'save_group';
394
+ draft: ProductNotificationGroupDraft;
395
+ } | {
396
+ kind: 'delete_group';
397
+ groupKey: string;
398
+ };
399
+ type EffectiveProductNotificationGroup = Omit<ProductNotificationDefaultGroup, 'deliveryTiming'> & {
400
+ deliveryTiming: ProductNotificationDeliveryTiming;
401
+ source: 'default' | 'workspace';
402
+ configMode: 'default' | ProductNotificationConfigMode;
403
+ defaultKey?: string;
404
+ version: number;
405
+ };
406
+ type EffectiveProductNotificationDestination = ProductNotificationDefaultDestination & {
407
+ source: 'default' | 'workspace';
408
+ configMode: 'default' | ProductNotificationConfigMode;
409
+ defaultKey?: string;
410
+ version: number;
411
+ status: string;
412
+ };
413
+ type EffectiveProductNotificationRule = Omit<ProductNotificationDefaultRule, 'repeatMode' | 'conditionGeneration'> & {
414
+ repeatMode: ProductNotificationRepeatMode;
415
+ conditionGeneration: number;
416
+ source: 'default' | 'workspace';
417
+ configMode: 'default' | ProductNotificationConfigMode;
418
+ defaultKey?: string;
419
+ version: number;
420
+ };
421
+ type EffectiveProductNotificationConfiguration = {
422
+ /** Exact policy used to materialize this effective configuration. */
423
+ defaultPolicy: ProductNotificationDefaultPolicy | null;
424
+ workspaceVersion: number;
425
+ groups: EffectiveProductNotificationGroup[];
426
+ destinations: EffectiveProductNotificationDestination[];
427
+ rules: EffectiveProductNotificationRule[];
428
+ };
429
+
430
430
  /** Type-owned content, independent of email markup and persisted audit strings. */
431
431
  type NotificationText = string | readonly (string | {
432
432
  strong: string;
@@ -3058,6 +3058,76 @@ interface UpdateSharePageRequest {
3058
3058
  seoIndexing?: 'index' | 'noindex';
3059
3059
  }
3060
3060
 
3061
+ type ExecuteToolRawOptions = {
3062
+ includeToolMetadata?: boolean;
3063
+ responseIntent?: 'dataset' | 'raw' | 'row_artifact';
3064
+ metadata?: Record<string, unknown>;
3065
+ timeout?: number;
3066
+ maxRetries?: number;
3067
+ /** Retry transient HTTP API responses when the caller has confirmed safety. */
3068
+ retryApiErrors?: boolean;
3069
+ /** Reuse this stable key to recover or retry an ambiguous execution. */
3070
+ idempotencyKey?: string;
3071
+ /** Generate a key and enable recoverable execution before dispatch. */
3072
+ recover?: boolean;
3073
+ /** Called and awaited with the key before the first network request. */
3074
+ onExecution?: (execution: {
3075
+ idempotencyKey: string;
3076
+ }) => void | Promise<void>;
3077
+ /** Maximum time to reconnect to an in-progress keyed execution. Defaults to 15 minutes. */
3078
+ recoveryTimeoutMs?: number;
3079
+ /** The `search_ref` of the tools search that found this tool. */
3080
+ searchRef?: string;
3081
+ };
3082
+ /** Durable state returned for a keyed tool execution. */
3083
+ type ExecutionRecovery = {
3084
+ /** Stable caller key used to resume or replay this execution. */
3085
+ idempotencyKey: string;
3086
+ /** Whether the execution is still running, completed, or has an unknown provider outcome. */
3087
+ state: 'running' | 'completed' | 'outcome_unknown';
3088
+ /** Whether this response came from an existing durable execution. */
3089
+ replayed: boolean;
3090
+ /** ISO timestamp after which the completed execution can no longer be replayed. */
3091
+ expiresAt?: string;
3092
+ };
3093
+ /** Durable lookup result for a keyed tool execution. */
3094
+ type ExecutionByKeyResult = {
3095
+ /** Recovery state and the key that owns the execution. */
3096
+ executionRecovery: ExecutionRecovery;
3097
+ /** Provider tool associated with the execution. */
3098
+ toolId: string;
3099
+ /** Original server-owned billing request ID, allocated before provider dispatch. */
3100
+ requestId?: string;
3101
+ /** HTTP status saved with the original response, when it was terminal. */
3102
+ responseStatus?: number;
3103
+ /** Saved execution response, when one is available for replay. */
3104
+ response?: unknown;
3105
+ };
3106
+ /**
3107
+ * Standard provider/tool execution envelope returned by low-level SDK calls.
3108
+ *
3109
+ * `toolResponse.rawV2` contains the complete scrubbed provider response;
3110
+ * `toolResponse.raw` is derived locally as the legacy provider-result projection. `extractedValues` and
3111
+ * `extractedLists` contain Deepline-normalized getters when the tool exposes
3112
+ * them. Billing fields are Deepline-facing and must not expose provider spend.
3113
+ */
3114
+ type ToolExecution<TData = unknown, TMeta = Record<string, unknown>> = {
3115
+ status: string;
3116
+ job_id?: string;
3117
+ meta?: Record<string, unknown>;
3118
+ toolResponse: {
3119
+ raw: TData;
3120
+ rawV2?: unknown;
3121
+ view?: 'data' | 'rawV2';
3122
+ meta?: TMeta;
3123
+ responseMeta?: TMeta;
3124
+ };
3125
+ extractedLists?: Record<string, unknown>;
3126
+ extractedValues?: Record<string, unknown>;
3127
+ billing?: ToolResultBilling;
3128
+ [key: string]: unknown;
3129
+ };
3130
+
3061
3131
  /**
3062
3132
  * Monitor authoring and typing for the Deepline SDK.
3063
3133
  *
@@ -3298,75 +3368,6 @@ type IngestionStorageRepairResult = {
3298
3368
  };
3299
3369
  };
3300
3370
  };
3301
- type ExecuteToolRawOptions = {
3302
- includeToolMetadata?: boolean;
3303
- responseIntent?: 'dataset' | 'raw' | 'row_artifact';
3304
- metadata?: Record<string, unknown>;
3305
- timeout?: number;
3306
- maxRetries?: number;
3307
- /** Retry transient HTTP API responses when the caller has confirmed safety. */
3308
- retryApiErrors?: boolean;
3309
- /** Reuse this stable key to recover or retry an ambiguous execution. */
3310
- idempotencyKey?: string;
3311
- /** Generate a key and enable recoverable execution before dispatch. */
3312
- recover?: boolean;
3313
- /** Called and awaited with the key before the first network request. */
3314
- onExecution?: (execution: {
3315
- idempotencyKey: string;
3316
- }) => void | Promise<void>;
3317
- /** Maximum time to reconnect to an in-progress keyed execution. Defaults to 15 minutes. */
3318
- recoveryTimeoutMs?: number;
3319
- /** The `search_ref` of the tools search that found this tool. */
3320
- searchRef?: string;
3321
- };
3322
- /** Durable state returned for a keyed tool execution. */
3323
- type ExecutionRecovery = {
3324
- /** Stable caller key used to resume or replay this execution. */
3325
- idempotencyKey: string;
3326
- /** Whether the execution is still running, completed, or has an unknown provider outcome. */
3327
- state: 'running' | 'completed' | 'outcome_unknown';
3328
- /** Whether this response came from an existing durable execution. */
3329
- replayed: boolean;
3330
- /** ISO timestamp after which the completed execution can no longer be replayed. */
3331
- expiresAt?: string;
3332
- };
3333
- /** Durable lookup result for a keyed tool execution. */
3334
- type ExecutionByKeyResult = {
3335
- /** Recovery state and the key that owns the execution. */
3336
- executionRecovery: ExecutionRecovery;
3337
- /** Provider tool associated with the execution. */
3338
- toolId: string;
3339
- /** Original server-owned billing request ID, allocated before provider dispatch. */
3340
- requestId?: string;
3341
- /** HTTP status saved with the original response, when it was terminal. */
3342
- responseStatus?: number;
3343
- /** Saved execution response, when one is available for replay. */
3344
- response?: unknown;
3345
- };
3346
- /**
3347
- * Standard provider/tool execution envelope returned by low-level SDK calls.
3348
- *
3349
- * `toolResponse.rawV2` contains the complete scrubbed provider response;
3350
- * `toolResponse.raw` is derived locally as the legacy provider-result projection. `extractedValues` and
3351
- * `extractedLists` contain Deepline-normalized getters when the tool exposes
3352
- * them. Billing fields are Deepline-facing and must not expose provider spend.
3353
- */
3354
- type ToolExecution<TData = unknown, TMeta = Record<string, unknown>> = {
3355
- status: string;
3356
- job_id?: string;
3357
- meta?: Record<string, unknown>;
3358
- toolResponse: {
3359
- raw: TData;
3360
- rawV2?: unknown;
3361
- view?: 'data' | 'rawV2';
3362
- meta?: TMeta;
3363
- responseMeta?: TMeta;
3364
- };
3365
- extractedLists?: Record<string, unknown>;
3366
- extractedValues?: Record<string, unknown>;
3367
- billing?: ToolResultBilling;
3368
- [key: string]: unknown;
3369
- };
3370
3371
  /** Filters for `client.runs.list(...)`. */
3371
3372
  type RunsListOptions = {
3372
3373
  play?: string;
@@ -4888,6 +4889,7 @@ type MintStagedFileUpload = {
4888
4889
  */
4889
4890
  declare class DeeplineClient {
4890
4891
  private readonly http;
4892
+ private readonly toolCalls;
4891
4893
  private readonly config;
4892
4894
  /** Canonical run lifecycle namespace backed by `/api/v2/runs`. */
4893
4895
  readonly runs: RunsNamespace;
@@ -5020,7 +5022,6 @@ declare class DeeplineClient {
5020
5022
  executeTool<TData = unknown, TMeta = Record<string, unknown>>(toolId: string, input: Record<string, unknown>, options?: ExecuteToolRawOptions): Promise<ToolExecution<TData, TMeta>>;
5021
5023
  /** Read the durable state of a keyed tool execution. */
5022
5024
  getExecutionByKey(idempotencyKey: string): Promise<ExecutionByKeyResult>;
5023
- private lookupExecutionByKey;
5024
5025
  /** Public recovery namespace. */
5025
5026
  get executions(): {
5026
5027
  getByKey: (key: string) => Promise<ExecutionByKeyResult>;