deepline 0.3.87 → 0.3.89

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 (69) hide show
  1. package/dist/bundling-sources/sdk/src/client.ts +532 -2
  2. package/dist/bundling-sources/sdk/src/config.ts +77 -0
  3. package/dist/bundling-sources/sdk/src/http.ts +76 -30
  4. package/dist/bundling-sources/sdk/src/index.ts +6 -0
  5. package/dist/bundling-sources/sdk/src/play.ts +15 -1
  6. package/dist/bundling-sources/sdk/src/plays/bundle-play-file.ts +1 -1
  7. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  8. package/dist/bundling-sources/sdk/src/types.ts +83 -4
  9. package/dist/bundling-sources/shared_libs/monitors/deactivation-reasons.ts +16 -0
  10. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-batch-operation.ts +263 -0
  11. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-identity-claims.ts +9 -1
  12. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-state.ts +122 -0
  13. package/dist/bundling-sources/shared_libs/play-runtime/activity-observation.ts +6 -11
  14. package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +90 -12
  15. package/dist/bundling-sources/shared_libs/play-runtime/async-play-invocation.ts +78 -0
  16. package/dist/bundling-sources/shared_libs/play-runtime/checkpoint-boundaries.ts +70 -0
  17. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +407 -53
  18. package/dist/bundling-sources/shared_libs/play-runtime/coordinator-headers.ts +1 -32
  19. package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +57 -0
  20. package/dist/bundling-sources/shared_libs/play-runtime/default-batch-strategies.ts +20 -1
  21. package/dist/bundling-sources/shared_libs/play-runtime/execution-capabilities.ts +6 -0
  22. package/dist/bundling-sources/shared_libs/play-runtime/execution-protocol.ts +7 -1
  23. package/dist/bundling-sources/shared_libs/play-runtime/lane-retirement-gate.ts +189 -0
  24. package/dist/bundling-sources/shared_libs/play-runtime/play-runtime-semantics.ts +28 -0
  25. package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +2 -0
  26. package/dist/bundling-sources/shared_libs/play-runtime/run-failure.ts +23 -0
  27. package/dist/bundling-sources/shared_libs/play-runtime/run-snapshot-stream.ts +1 -1
  28. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts +18 -4
  29. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-start-admission.ts +68 -0
  30. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona.ts +2 -0
  31. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/runtime-sandbox-reconciliation.ts +1 -0
  32. package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +10 -8
  33. package/dist/bundling-sources/shared_libs/play-runtime/runtime-capacity-policy.ts +20 -0
  34. package/dist/bundling-sources/shared_libs/play-runtime/runtime-contract.ts +6 -0
  35. package/dist/bundling-sources/shared_libs/play-runtime/runtime-scheduler-topology.ts +24 -0
  36. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +30 -1
  37. package/dist/bundling-sources/shared_libs/plays/artifact-types.ts +6 -3
  38. package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +152 -17
  39. package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +19 -4
  40. package/dist/bundling-sources/shared_libs/plays/contracts.ts +6 -14
  41. package/dist/bundling-sources/shared_libs/plays/core.ts +11 -6
  42. package/dist/bundling-sources/shared_libs/plays/docflow-binding-owner.ts +16 -11
  43. package/dist/bundling-sources/shared_libs/plays/resolve-static-pipeline.ts +1 -1
  44. package/dist/bundling-sources/shared_libs/plays/slug.ts +115 -0
  45. package/dist/bundling-sources/shared_libs/plays/static-pipeline.ts +44 -14
  46. package/dist/bundling-sources/shared_libs/product-notifications/catalog.ts +877 -0
  47. package/dist/bundling-sources/shared_libs/product-notifications/configuration-draft.ts +456 -0
  48. package/dist/bundling-sources/shared_libs/product-notifications/configuration.ts +560 -0
  49. package/dist/bundling-sources/shared_libs/product-notifications/content.ts +28 -0
  50. package/dist/bundling-sources/shared_libs/product-notifications/default-policy.ts +59 -0
  51. package/dist/bundling-sources/shared_libs/product-notifications/email.ts +246 -0
  52. package/dist/bundling-sources/shared_libs/product-notifications/evaluation.ts +280 -0
  53. package/dist/bundling-sources/shared_libs/product-notifications/events.ts +433 -0
  54. package/dist/bundling-sources/shared_libs/product-notifications/legacy-slack.ts +80 -0
  55. package/dist/bundling-sources/shared_libs/product-notifications/workspace.ts +38 -0
  56. package/dist/bundling-sources/shared_libs/security/internal-actor.ts +50 -0
  57. package/dist/cli/index.js +1065 -190
  58. package/dist/cli/index.mjs +1052 -177
  59. package/dist/{compiler-manifest-Dbov16F7.d.mts → compiler-manifest-DsLbQaew.d.mts} +132 -8
  60. package/dist/{compiler-manifest-Dbov16F7.d.ts → compiler-manifest-DsLbQaew.d.ts} +132 -8
  61. package/dist/index.d.mts +833 -11
  62. package/dist/index.d.ts +833 -11
  63. package/dist/index.js +467 -38
  64. package/dist/index.mjs +467 -38
  65. package/dist/install-integrity.json +20 -2
  66. package/dist/plays/bundle-play-file.d.mts +8 -3
  67. package/dist/plays/bundle-play-file.d.ts +8 -3
  68. package/dist/plays/bundle-play-file.mjs +100 -20
  69. package/package.json +1 -1
package/dist/index.d.mts CHANGED
@@ -1,8 +1,128 @@
1
1
  /// <reference path="./text-imports.d.ts" />
2
- import { c as PlayCompilerManifest, i as PlayAuthoringColumnMap, j as PlayAuthoringColumnResolver, k as PlayAuthoringRuntimeContext, l as PlayAuthoringConditionalStepResolver, m as PlayAuthoringCsvInput, n as PlayAuthoringCsvOptions, o as PlayAuthoringDatasetBuilder, p as PlayAuthoringDatasetColumnDefinition, q as PlayAuthoringDatasetColumnRunInput, T as ToolExecuteResult, r as PlayAuthoringReferenceLike, s as PlayReturnObject$1, t as PlayAuthoringDefineConfig, u as PlayAuthoringDefinedPlay, v as PlayAuthoringFetchOptions, w as PlayAuthoringFileInput, x as PlayAuthoringBindings, y as PlayAuthoringCallExecution, z as PlayAuthoringCallOptions, A as PlayAuthoringFetchResponse, B as PlayAuthoringInputContract, C as PlayAuthoringStepProgramStep, D as PlayAuthoringRuntimeStepOptions, E as PlaySqlListenerDeclaration, F as PlaySqlListenerEvent, G as PlaySqlListenerOperation, H as PlaySqlQuery, I as PlayAuthoringStepOptions, J as PlayAuthoringStepProgram, K as PlayAuthoringStepProgramResolver, L as PlayAuthoringStepResolver, M as PlayToolExecutionRequest, N as PlayAuthoringStepProgramOptions, O as DeeplineError, Q as ToolExecutionError, R as ToolExecutionErrorOptions } from './compiler-manifest-Dbov16F7.mjs';
3
- export { S as CtxFetchHttpError, U as DEEPLINE_EXTRACTOR_TARGETS, V as DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS, W as DeeplineEmailStatusGetterValue, X as DeeplineExtractorTarget, Y as DeeplineGetterValue, Z as DeeplineGetterValueMap, _ as JOB_CHANGE_STATUS_VALUES, $ as JobChangeStatus, a0 as PHONE_STATUS_VALUES, a1 as PhoneStatus, a2 as PlayDataset, a3 as PlayDatasetInput, a4 as PreviousCell, a5 as ProviderTransientError, a6 as ProviderTransientErrorCategory, a7 as ProviderUnavailableError, a8 as ProviderUnavailableReason, a9 as ToolExecutionErrorCategory, aa as ToolExecutionErrorOrigin, ab as ToolExecutionFailureV1, ac as ToolExecutionNetworkKind, ad as ToolExecutionNetworkScope, ae as ToolExecutionPublicDetails, af as getProviderUnavailableReason, ag as isDeeplineExtractorTarget, ah as isProviderUnavailable, ai as isProviderWaterfallUnavailableError } from './compiler-manifest-Dbov16F7.mjs';
2
+ import { c as PlayCompilerManifest, A as AsyncPlayRunRef$1, i as PlayAuthoringColumnMap, j as PlayAuthoringColumnResolver, k as PlayAuthoringRuntimeContext, l as PlayAuthoringConditionalStepResolver, m as PlayAuthoringCsvInput, n as PlayAuthoringCsvOptions, o as PlayAuthoringDatasetBuilder, p as PlayAuthoringDatasetColumnDefinition, q as PlayAuthoringDatasetColumnRunInput, T as ToolExecuteResult, r as PlayAuthoringReferenceLike, s as PlayReturnObject$1, t as PlayAuthoringDefineConfig, u as PlayAuthoringDefinedPlay, v as PlayAuthoringFetchOptions, w as PlayAuthoringFileInput, x as PlayAuthoringAsyncCallOptions, y as PlayAuthoringBindings, z as PlayAuthoringCallExecution, B as PlayAuthoringCallOptions, C as PlayAuthoringFetchResponse, D as PlayAuthoringInputContract, E as PlayRunId$1, F as PlayAuthoringStepProgramStep, G as PlayAuthoringRuntimeStepOptions, H as PlaySqlListenerDeclaration, I as PlaySqlListenerEvent, J as PlaySqlListenerOperation, K as PlaySqlQuery, L as PlayAuthoringStepOptions, M as PlayAuthoringStepProgram, N as PlayAuthoringStepProgramResolver, O as PlayAuthoringStepResolver, Q as PlayToolExecutionRequest, R as PlayAuthoringStepProgramOptions, S as DeeplineError, U as ToolExecutionError, V as ToolExecutionErrorOptions } from './compiler-manifest-DsLbQaew.mjs';
3
+ export { W as CtxFetchHttpError, X as DEEPLINE_EXTRACTOR_TARGETS, Y as DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS, Z as DeeplineEmailStatusGetterValue, _ as DeeplineExtractorTarget, $ as DeeplineGetterValue, a0 as DeeplineGetterValueMap, a1 as JOB_CHANGE_STATUS_VALUES, a2 as JobChangeStatus, a3 as PHONE_STATUS_VALUES, a4 as PhoneStatus, a5 as PlayDataset, a6 as PlayDatasetInput, a7 as PreviousCell, a8 as ProviderTransientError, a9 as ProviderTransientErrorCategory, aa as ProviderUnavailableError, ab as ProviderUnavailableReason, ac as ToolExecutionErrorCategory, ad as ToolExecutionErrorOrigin, ae as ToolExecutionFailureV1, af as ToolExecutionNetworkKind, ag as ToolExecutionNetworkScope, ah as ToolExecutionPublicDetails, ai as getProviderUnavailableReason, aj as isDeeplineExtractorTarget, ak as isProviderUnavailable, al as isProviderWaterfallUnavailableError } from './compiler-manifest-DsLbQaew.mjs';
4
4
  import '@sinclair/typebox';
5
5
 
6
+ type ProductNotificationFactValue = string | number | boolean;
7
+ type ProductNotificationFacts = Record<string, ProductNotificationFactValue>;
8
+ type ProductNotificationDestinationSettings = {
9
+ kind: 'slack';
10
+ targetKind: 'channel' | 'member';
11
+ targetId: string;
12
+ targetName: string;
13
+ oauthConnectionId: string;
14
+ } | {
15
+ kind: 'email_addresses';
16
+ to: string[];
17
+ cc?: string[];
18
+ bcc?: string[];
19
+ } | {
20
+ kind: 'email_roles';
21
+ roles: string[];
22
+ };
23
+ type ProductNotificationTrigger = {
24
+ kind: 'each_match';
25
+ } | {
26
+ kind: 'state_transition';
27
+ targetState: string;
28
+ reasonCode?: string;
29
+ } | {
30
+ kind: 'threshold_crossing';
31
+ direction: 'above' | 'below' | 'at_or_above';
32
+ threshold: number;
33
+ unit?: string;
34
+ } | {
35
+ kind: 'consecutive_outcomes';
36
+ count: number;
37
+ outcome: string;
38
+ maxLookback: number;
39
+ };
40
+ type ProductNotificationDeliveryTiming = {
41
+ mode: 'immediate';
42
+ } | {
43
+ mode: 'immediate_first' | 'digest_only';
44
+ windowMs: number;
45
+ };
46
+ type ProductNotificationRepeatMode = 'on_enter' | 'every_match';
47
+ type ProductNotificationDefaultPolicy = {
48
+ version: number;
49
+ groups: ProductNotificationDefaultGroup[];
50
+ destinations: ProductNotificationDefaultDestination[];
51
+ rules: ProductNotificationDefaultRule[];
52
+ };
53
+ type ProductNotificationDefaultGroup = {
54
+ groupKey: string;
55
+ name: string;
56
+ enabled: boolean;
57
+ /** Omitted only by stored compatibility rows; effective groups are normalized. */
58
+ deliveryTiming?: ProductNotificationDeliveryTiming;
59
+ };
60
+ type ProductNotificationDefaultDestination = {
61
+ destinationKey: string;
62
+ groupKey: string;
63
+ name: string;
64
+ enabled: boolean;
65
+ settings: ProductNotificationDestinationSettings;
66
+ };
67
+ type ProductNotificationDefaultRule = {
68
+ ruleKey: string;
69
+ groupKey: string;
70
+ enabled: boolean;
71
+ notificationType: string;
72
+ eventName: string;
73
+ eventFilter: ProductNotificationFacts;
74
+ trigger: ProductNotificationTrigger;
75
+ /** Omitted only by stored compatibility rows; effective rules are normalized. */
76
+ repeatMode?: ProductNotificationRepeatMode;
77
+ /** Omitted only by stored compatibility rows; effective rules are normalized. */
78
+ conditionGeneration?: number;
79
+ };
80
+ type ProductNotificationConfigMode = 'custom' | 'replace_default' | 'disable_default';
81
+ /** The provider-neutral state edited by UI and CLI clients for one group. */
82
+ type ProductNotificationGroupDraft = {
83
+ group: EffectiveProductNotificationGroup;
84
+ destinations: EffectiveProductNotificationDestination[];
85
+ rules: EffectiveProductNotificationRule[];
86
+ };
87
+ /** Public configuration intent. Convex alone derives sparse override writes. */
88
+ type ProductNotificationConfigurationChange = {
89
+ kind: 'save_group';
90
+ draft: ProductNotificationGroupDraft;
91
+ } | {
92
+ kind: 'delete_group';
93
+ groupKey: string;
94
+ };
95
+ type EffectiveProductNotificationGroup = Omit<ProductNotificationDefaultGroup, 'deliveryTiming'> & {
96
+ deliveryTiming: ProductNotificationDeliveryTiming;
97
+ source: 'default' | 'workspace';
98
+ configMode: 'default' | ProductNotificationConfigMode;
99
+ defaultKey?: string;
100
+ version: number;
101
+ };
102
+ type EffectiveProductNotificationDestination = ProductNotificationDefaultDestination & {
103
+ source: 'default' | 'workspace';
104
+ configMode: 'default' | ProductNotificationConfigMode;
105
+ defaultKey?: string;
106
+ version: number;
107
+ status: string;
108
+ };
109
+ type EffectiveProductNotificationRule = Omit<ProductNotificationDefaultRule, 'repeatMode' | 'conditionGeneration'> & {
110
+ repeatMode: ProductNotificationRepeatMode;
111
+ conditionGeneration: number;
112
+ source: 'default' | 'workspace';
113
+ configMode: 'default' | ProductNotificationConfigMode;
114
+ defaultKey?: string;
115
+ version: number;
116
+ };
117
+ type EffectiveProductNotificationConfiguration = {
118
+ /** Exact policy used to materialize this effective configuration. */
119
+ defaultPolicy: ProductNotificationDefaultPolicy | null;
120
+ workspaceVersion: number;
121
+ groups: EffectiveProductNotificationGroup[];
122
+ destinations: EffectiveProductNotificationDestination[];
123
+ rules: EffectiveProductNotificationRule[];
124
+ };
125
+
6
126
  declare const FIXTURE_BEHAVIOR_VERSION: 1;
7
127
  declare const FIXTURE_BEHAVIOR_RESPONSE_VERSION: 2;
8
128
  declare const FIXTURE_BEHAVIOR_REPLAY_VERSION: 3;
@@ -135,7 +255,11 @@ type PlayActivityState = {
135
255
  code?: string;
136
256
  };
137
257
  type PlayActivityObservation = {
138
- schemaVersion: 1;
258
+ /**
259
+ * Retired marker. Producers stopped writing it; envelopes still in flight
260
+ * from an older producer carry `1`, so readers tolerate both shapes.
261
+ */
262
+ schemaVersion?: 1;
139
263
  /** Stable within one run, for example `tool:discover_ctos` or `dataset:leads`. */
140
264
  activityId: string;
141
265
  /** Optional owning play step. */
@@ -181,6 +305,503 @@ declare function formatPlayBootstrapFinderKinds(): string;
181
305
  declare function formatPlayBootstrapTemplates(): string;
182
306
  declare function formatPlayBootstrapFinderKindsForSentence(): string;
183
307
 
308
+ /** Type-owned content, independent of email markup and persisted audit strings. */
309
+ type NotificationText = string | readonly (string | {
310
+ strong: string;
311
+ } | {
312
+ workspace: true;
313
+ })[];
314
+
315
+ /**
316
+ * The sections the configuration surface skims by. Declared here so UI, API,
317
+ * and CLI order and label them identically.
318
+ */
319
+ declare const PRODUCT_NOTIFICATION_CATEGORIES: readonly [{
320
+ readonly id: "credits";
321
+ readonly name: "Credits and usage";
322
+ }, {
323
+ readonly id: "plays";
324
+ readonly name: "Play runs";
325
+ }];
326
+ type ProductNotificationCategoryId = (typeof PRODUCT_NOTIFICATION_CATEGORIES)[number]['id'];
327
+ type ProductNotificationTypeCatalogMetadata = {
328
+ name: string;
329
+ description: string;
330
+ category: ProductNotificationCategoryId;
331
+ allowMultiple: boolean;
332
+ editor: {
333
+ kind: 'threshold';
334
+ label: string;
335
+ defaultThreshold: number;
336
+ minimum: number;
337
+ maximum?: number;
338
+ suffix?: string;
339
+ /**
340
+ * When set, editors show and accept `remainingOf - threshold` (for
341
+ * example percent remaining) while the stored trigger stays in the
342
+ * runtime's "used" terms. Bounds and defaults are stored values.
343
+ */
344
+ remainingOf?: number;
345
+ } | {
346
+ kind: 'play_failure';
347
+ defaultFailureCount: number;
348
+ } | {
349
+ kind: 'play_scope';
350
+ } | {
351
+ kind: 'none';
352
+ };
353
+ };
354
+ type ProductNotificationPresentation = {
355
+ title: string;
356
+ summary: NotificationText;
357
+ details: NotificationText[];
358
+ targetUrl: string;
359
+ subjectKind: string;
360
+ subjectId: string;
361
+ };
362
+ type ProductNotificationRuleInput = {
363
+ ruleKey: string;
364
+ groupKey: string;
365
+ notificationType: ConfigurableProductNotificationType;
366
+ threshold?: number;
367
+ playFailure?: ProductNotificationPlayFailureSettings;
368
+ };
369
+ type ProductNotificationRuleBase = Omit<ProductNotificationDefaultRule, 'trigger'>;
370
+ declare function validateInsufficientCreditDisable(trigger: ProductNotificationTrigger): void;
371
+ declare function validateFailedOutcome(trigger: ProductNotificationTrigger): void;
372
+ /** One canonical registry owns every notification type's runtime and UI metadata. */
373
+ declare const PRODUCT_NOTIFICATION_TYPE_REGISTRY: readonly [{
374
+ readonly id: "monitor.disabled.insufficient_credits";
375
+ readonly eventName: "monitor.lifecycle.changed";
376
+ readonly requiredFilter: {};
377
+ readonly allowedTriggers: ["state_transition"];
378
+ readonly catalog: {
379
+ readonly name: "Monitor disabled due to insufficient credits";
380
+ readonly category: "credits";
381
+ readonly description: "Notify when Deepline disables a Monitor because the workspace ran out of credits.";
382
+ readonly allowMultiple: false;
383
+ readonly editor: {
384
+ readonly kind: "none";
385
+ };
386
+ };
387
+ readonly rule: {
388
+ readonly conditionSubject: "workspace";
389
+ readonly rearm: {
390
+ readonly eventName: "credits.balance.changed";
391
+ readonly matches: (payload: ProductNotificationFacts) => boolean;
392
+ };
393
+ readonly create: (_input: ProductNotificationRuleInput, base: ProductNotificationRuleBase) => {
394
+ trigger: {
395
+ kind: "state_transition";
396
+ targetState: string;
397
+ reasonCode: string;
398
+ };
399
+ groupKey: string;
400
+ enabled: boolean;
401
+ repeatMode?: ProductNotificationRepeatMode | undefined;
402
+ conditionGeneration?: number | undefined;
403
+ ruleKey: string;
404
+ notificationType: string;
405
+ eventName: string;
406
+ eventFilter: ProductNotificationFacts;
407
+ };
408
+ readonly validate: typeof validateInsufficientCreditDisable;
409
+ readonly present: ({ payload }: {
410
+ payload: ProductNotificationFacts;
411
+ trigger: ProductNotificationTrigger;
412
+ }) => {
413
+ title: string;
414
+ summary: (string | {
415
+ workspace: true;
416
+ })[];
417
+ details: never[];
418
+ targetUrl: string;
419
+ subjectKind: string;
420
+ subjectId: string;
421
+ };
422
+ };
423
+ }, {
424
+ readonly id: "play.disabled.insufficient_credits";
425
+ readonly eventName: "play.lifecycle.changed";
426
+ readonly requiredFilter: {};
427
+ readonly allowedTriggers: ["state_transition"];
428
+ readonly catalog: {
429
+ readonly name: "Play temporarily disabled due to insufficient credits";
430
+ readonly category: "credits";
431
+ readonly description: "Notify when Deepline temporarily disables a scheduled Play because the workspace ran out of credits. Future runs resume automatically once the workspace has enough credits.";
432
+ readonly allowMultiple: false;
433
+ readonly editor: {
434
+ readonly kind: "none";
435
+ };
436
+ };
437
+ readonly rule: {
438
+ readonly default: {
439
+ readonly ruleKey: "default.play_disabled";
440
+ readonly groupKey: "default";
441
+ };
442
+ readonly conditionSubject: "workspace";
443
+ readonly rearm: {
444
+ readonly eventName: "credits.balance.changed";
445
+ readonly matches: (payload: ProductNotificationFacts) => boolean;
446
+ };
447
+ readonly create: (_input: ProductNotificationRuleInput, base: ProductNotificationRuleBase) => {
448
+ trigger: {
449
+ kind: "state_transition";
450
+ targetState: string;
451
+ reasonCode: string;
452
+ };
453
+ groupKey: string;
454
+ enabled: boolean;
455
+ repeatMode?: ProductNotificationRepeatMode | undefined;
456
+ conditionGeneration?: number | undefined;
457
+ ruleKey: string;
458
+ notificationType: string;
459
+ eventName: string;
460
+ eventFilter: ProductNotificationFacts;
461
+ };
462
+ readonly validate: typeof validateInsufficientCreditDisable;
463
+ readonly present: ({ payload }: {
464
+ payload: ProductNotificationFacts;
465
+ trigger: ProductNotificationTrigger;
466
+ }) => {
467
+ title: string;
468
+ summary: (string | {
469
+ workspace: true;
470
+ })[];
471
+ details: string[];
472
+ targetUrl: string;
473
+ subjectKind: string;
474
+ subjectId: string;
475
+ };
476
+ };
477
+ }, {
478
+ readonly id: "usage.monthly.limit_reached";
479
+ readonly eventName: "credits.usage.recorded";
480
+ readonly requiredFilter: {};
481
+ readonly allowedTriggers: ["threshold_crossing"];
482
+ readonly catalog: {
483
+ readonly name: "Usage limit reached";
484
+ readonly category: "credits";
485
+ readonly description: "Notify when monthly usage reaches the workspace limit.";
486
+ readonly allowMultiple: false;
487
+ readonly editor: {
488
+ readonly kind: "none";
489
+ };
490
+ };
491
+ readonly rule: {
492
+ readonly default: {
493
+ readonly ruleKey: "default.usage_limit_reached";
494
+ readonly groupKey: "default";
495
+ };
496
+ readonly conditionSubject: "workspace";
497
+ readonly create: (_input: ProductNotificationRuleInput, base: ProductNotificationRuleBase) => {
498
+ trigger: {
499
+ kind: "threshold_crossing";
500
+ direction: "at_or_above";
501
+ threshold: number;
502
+ unit: string;
503
+ };
504
+ groupKey: string;
505
+ enabled: boolean;
506
+ repeatMode?: ProductNotificationRepeatMode | undefined;
507
+ conditionGeneration?: number | undefined;
508
+ ruleKey: string;
509
+ notificationType: string;
510
+ eventName: string;
511
+ eventFilter: ProductNotificationFacts;
512
+ };
513
+ readonly validate: (trigger: ProductNotificationTrigger) => void;
514
+ readonly present: ({ payload }: {
515
+ payload: ProductNotificationFacts;
516
+ trigger: ProductNotificationTrigger;
517
+ }) => {
518
+ title: string;
519
+ summary: (string | {
520
+ workspace: true;
521
+ })[];
522
+ details: (string | {
523
+ strong: string;
524
+ })[][];
525
+ targetUrl: string;
526
+ subjectKind: string;
527
+ subjectId: string;
528
+ };
529
+ };
530
+ }, {
531
+ readonly id: "credits.low";
532
+ readonly eventName: "credits.balance.changed";
533
+ readonly requiredFilter: {};
534
+ readonly allowedTriggers: ["threshold_crossing"];
535
+ readonly catalog: {
536
+ readonly name: "Low credit warning";
537
+ readonly category: "credits";
538
+ readonly description: "Notify when the workspace credit balance crosses below a threshold.";
539
+ readonly allowMultiple: false;
540
+ readonly editor: {
541
+ readonly kind: "threshold";
542
+ readonly label: "Credit threshold";
543
+ readonly defaultThreshold: 10;
544
+ readonly minimum: 0;
545
+ };
546
+ };
547
+ readonly rule: {
548
+ readonly default: {
549
+ readonly ruleKey: "default.low_credits";
550
+ readonly groupKey: "default";
551
+ };
552
+ readonly conditionSubject: "workspace";
553
+ readonly create: (input: ProductNotificationRuleInput, base: ProductNotificationRuleBase, editor: {
554
+ kind: "threshold";
555
+ label: string;
556
+ defaultThreshold: number;
557
+ minimum: number;
558
+ maximum?: number;
559
+ suffix?: string;
560
+ /**
561
+ * When set, editors show and accept `remainingOf - threshold` (for
562
+ * example percent remaining) while the stored trigger stays in the
563
+ * runtime's "used" terms. Bounds and defaults are stored values.
564
+ */
565
+ remainingOf?: number;
566
+ } | {
567
+ kind: "play_failure";
568
+ defaultFailureCount: number;
569
+ } | {
570
+ kind: "play_scope";
571
+ } | {
572
+ kind: "none";
573
+ }) => {
574
+ trigger: {
575
+ kind: "threshold_crossing";
576
+ direction: "below";
577
+ threshold: number;
578
+ unit: string;
579
+ };
580
+ groupKey: string;
581
+ enabled: boolean;
582
+ repeatMode?: ProductNotificationRepeatMode | undefined;
583
+ conditionGeneration?: number | undefined;
584
+ ruleKey: string;
585
+ notificationType: string;
586
+ eventName: string;
587
+ eventFilter: ProductNotificationFacts;
588
+ };
589
+ readonly validate: (trigger: ProductNotificationTrigger) => void;
590
+ readonly present: ({ payload, trigger }: {
591
+ payload: ProductNotificationFacts;
592
+ trigger: ProductNotificationTrigger;
593
+ }) => {
594
+ title: string;
595
+ summary: (string | {
596
+ workspace: true;
597
+ })[];
598
+ details: (string | {
599
+ strong: string;
600
+ })[][];
601
+ targetUrl: string;
602
+ subjectKind: string;
603
+ subjectId: string;
604
+ };
605
+ };
606
+ }, {
607
+ readonly id: "usage.monthly.nearing_limit";
608
+ readonly eventName: "credits.usage.recorded";
609
+ readonly requiredFilter: {};
610
+ readonly allowedTriggers: ["threshold_crossing"];
611
+ readonly catalog: {
612
+ readonly name: "Usage limit warning";
613
+ readonly category: "credits";
614
+ readonly description: "Notify when only a configurable percentage of the monthly usage limit remains.";
615
+ readonly allowMultiple: false;
616
+ readonly editor: {
617
+ readonly kind: "threshold";
618
+ readonly label: "Remaining usage";
619
+ readonly defaultThreshold: 90;
620
+ readonly minimum: 1;
621
+ readonly maximum: 99;
622
+ readonly suffix: "%";
623
+ readonly remainingOf: 100;
624
+ };
625
+ };
626
+ readonly rule: {
627
+ readonly conditionSubject: "workspace";
628
+ readonly create: (input: ProductNotificationRuleInput, base: ProductNotificationRuleBase, editor: {
629
+ kind: "threshold";
630
+ label: string;
631
+ defaultThreshold: number;
632
+ minimum: number;
633
+ maximum?: number;
634
+ suffix?: string;
635
+ /**
636
+ * When set, editors show and accept `remainingOf - threshold` (for
637
+ * example percent remaining) while the stored trigger stays in the
638
+ * runtime's "used" terms. Bounds and defaults are stored values.
639
+ */
640
+ remainingOf?: number;
641
+ } | {
642
+ kind: "play_failure";
643
+ defaultFailureCount: number;
644
+ } | {
645
+ kind: "play_scope";
646
+ } | {
647
+ kind: "none";
648
+ }) => {
649
+ trigger: {
650
+ kind: "threshold_crossing";
651
+ direction: "at_or_above";
652
+ threshold: number;
653
+ unit: string;
654
+ };
655
+ groupKey: string;
656
+ enabled: boolean;
657
+ repeatMode?: ProductNotificationRepeatMode | undefined;
658
+ conditionGeneration?: number | undefined;
659
+ ruleKey: string;
660
+ notificationType: string;
661
+ eventName: string;
662
+ eventFilter: ProductNotificationFacts;
663
+ };
664
+ readonly validate: (trigger: ProductNotificationTrigger) => void;
665
+ readonly present: ({ payload, trigger }: {
666
+ payload: ProductNotificationFacts;
667
+ trigger: ProductNotificationTrigger;
668
+ }) => {
669
+ title: string;
670
+ summary: (string | {
671
+ workspace: true;
672
+ })[];
673
+ details: (string | {
674
+ strong: string;
675
+ })[][];
676
+ targetUrl: string;
677
+ subjectKind: string;
678
+ subjectId: string;
679
+ };
680
+ };
681
+ }, {
682
+ readonly id: "play.failed";
683
+ readonly eventName: "play.run.completed";
684
+ readonly requiredFilter: {
685
+ readonly outcome: "failed";
686
+ };
687
+ readonly allowedTriggers: ["each_match", "consecutive_outcomes"];
688
+ readonly catalog: {
689
+ readonly name: "Play failed";
690
+ readonly category: "plays";
691
+ readonly description: "Notify for all, scheduled, webhook-triggered, or specific Play failures.";
692
+ readonly allowMultiple: true;
693
+ readonly editor: {
694
+ readonly kind: "play_failure";
695
+ readonly defaultFailureCount: 1;
696
+ };
697
+ };
698
+ readonly rule: {
699
+ readonly create: (input: ProductNotificationRuleInput, base: ProductNotificationRuleBase) => {
700
+ eventFilter: ProductNotificationFacts;
701
+ repeatMode: "on_enter" | "every_match";
702
+ trigger: {
703
+ kind: "each_match";
704
+ count?: undefined;
705
+ outcome?: undefined;
706
+ maxLookback?: undefined;
707
+ } | {
708
+ kind: "consecutive_outcomes";
709
+ count: number;
710
+ outcome: string;
711
+ maxLookback: number;
712
+ };
713
+ groupKey: string;
714
+ enabled: boolean;
715
+ conditionGeneration?: number | undefined;
716
+ ruleKey: string;
717
+ notificationType: string;
718
+ eventName: string;
719
+ };
720
+ readonly validate: typeof validateFailedOutcome;
721
+ readonly present: ({ payload }: {
722
+ payload: ProductNotificationFacts;
723
+ trigger: ProductNotificationTrigger;
724
+ }) => ProductNotificationPresentation;
725
+ };
726
+ }, {
727
+ readonly id: "play.succeeded";
728
+ readonly eventName: "play.run.completed";
729
+ readonly requiredFilter: {
730
+ readonly outcome: "succeeded";
731
+ };
732
+ readonly allowedTriggers: ["each_match"];
733
+ readonly catalog: {
734
+ readonly name: "Play succeeded";
735
+ readonly category: "plays";
736
+ readonly description: "Notify for all, scheduled, webhook-triggered, or specific Play successes.";
737
+ readonly allowMultiple: true;
738
+ readonly editor: {
739
+ readonly kind: "play_scope";
740
+ };
741
+ };
742
+ readonly rule: {
743
+ readonly create: (input: ProductNotificationRuleInput, base: ProductNotificationRuleBase) => {
744
+ eventFilter: ProductNotificationFacts;
745
+ repeatMode: "every_match";
746
+ trigger: {
747
+ kind: "each_match";
748
+ };
749
+ groupKey: string;
750
+ enabled: boolean;
751
+ conditionGeneration?: number | undefined;
752
+ ruleKey: string;
753
+ notificationType: string;
754
+ eventName: string;
755
+ };
756
+ readonly present: ({ payload }: {
757
+ payload: ProductNotificationFacts;
758
+ trigger: ProductNotificationTrigger;
759
+ }) => ProductNotificationPresentation;
760
+ };
761
+ }, {
762
+ readonly id: "webhook.delivery.failed";
763
+ readonly eventName: "webhook.delivery.completed";
764
+ readonly requiredFilter: {
765
+ readonly outcome: "failed";
766
+ };
767
+ readonly allowedTriggers: ["each_match", "consecutive_outcomes"];
768
+ readonly catalog: undefined;
769
+ readonly rule: {
770
+ readonly validate: typeof validateFailedOutcome;
771
+ readonly present: ({ payload }: {
772
+ payload: ProductNotificationFacts;
773
+ trigger: ProductNotificationTrigger;
774
+ }) => ProductNotificationPresentation;
775
+ };
776
+ }, {
777
+ readonly id: "webhook.delivery.succeeded";
778
+ readonly eventName: "webhook.delivery.completed";
779
+ readonly requiredFilter: {
780
+ readonly outcome: "succeeded";
781
+ };
782
+ readonly allowedTriggers: ["each_match"];
783
+ readonly catalog: undefined;
784
+ readonly rule: {
785
+ readonly present: ({ payload }: {
786
+ payload: ProductNotificationFacts;
787
+ trigger: ProductNotificationTrigger;
788
+ }) => ProductNotificationPresentation;
789
+ };
790
+ }];
791
+ type ConfigurableProductNotificationRegistration = Extract<(typeof PRODUCT_NOTIFICATION_TYPE_REGISTRY)[number], {
792
+ catalog: ProductNotificationTypeCatalogMetadata;
793
+ }>;
794
+ type ConfigurableProductNotificationType = ConfigurableProductNotificationRegistration['id'];
795
+ type ProductNotificationTypeCatalogItem = ProductNotificationTypeCatalogMetadata & {
796
+ id: ConfigurableProductNotificationType;
797
+ };
798
+ type ProductNotificationPlayFailureSettings = {
799
+ scope: 'all' | 'cron' | 'webhook' | 'specific';
800
+ playId?: string;
801
+ playName?: string;
802
+ failureCount: number;
803
+ };
804
+
184
805
  /**
185
806
  * Options for constructing a {@link DeeplineClient} or connecting via {@link Deepline.connect}.
186
807
  *
@@ -213,6 +834,17 @@ interface DeeplineClientOptions {
213
834
  timeout?: number;
214
835
  /** Maximum retry attempts for transient failures (network errors, 429s). Default: `3`. */
215
836
  maxRetries?: number;
837
+ /**
838
+ * Extra request headers attached to every request this client sends.
839
+ *
840
+ * They are merged *after* the headers the transport derives from the
841
+ * environment, so an explicit header replaces the env-derived one. Header
842
+ * names match case-insensitively and are normalized to lowercase.
843
+ *
844
+ * This is transport plumbing only: the server still authorizes every
845
+ * internal header it honors.
846
+ */
847
+ headers?: Record<string, string>;
216
848
  }
217
849
  /**
218
850
  * Fully resolved configuration used internally by the SDK.
@@ -228,6 +860,12 @@ interface ResolvedConfig {
228
860
  timeout: number;
229
861
  /** Max retry count for transient failures. */
230
862
  maxRetries: number;
863
+ /**
864
+ * Caller-supplied headers merged over the env-derived headers on every
865
+ * request. Absent unless the caller passed
866
+ * {@link DeeplineClientOptions.headers}.
867
+ */
868
+ headers?: Record<string, string>;
231
869
  }
232
870
  /** Column metadata returned by a customer data query. */
233
871
  interface CustomerDbColumn {
@@ -912,8 +1550,9 @@ interface PlayStatus {
912
1550
  /**
913
1551
  * Projected settled-charge billing for the run. Returned by `runs.get`.
914
1552
  * `totalCredits`/`providerEvents` describe THIS run only; `rollup` (present
915
- * with `--full`) carries the true subtree cost including ctx.runPlay children.
916
- * Deepline credits only — provider spend is never exposed.
1553
+ * with `--full`) carries the true subtree cost including independently
1554
+ * executing ctx.runPlayAsync descendants. Deepline credits only — provider
1555
+ * spend is never exposed.
917
1556
  */
918
1557
  billing?: RunBillingSummary;
919
1558
  /**
@@ -925,13 +1564,25 @@ interface PlayStatus {
925
1564
  billingChildCredits?: number;
926
1565
  /** True when the child-run billing rollup could not be fully resolved. */
927
1566
  billingRollupIncomplete?: boolean;
928
- /** Durable summaries of ctx.runPlay children, returned by `runs.get --full`. */
1567
+ /** Durable summaries of ctx.runPlayAsync children, returned by `runs.get --full`. */
929
1568
  childRuns?: ChildRunSummary[];
1569
+ /**
1570
+ * Child Runs grouped by the authored ctx.runPlayAsync launch key. `complete`
1571
+ * is false when the bounded response is a lower bound rather than the full
1572
+ * direct-child set; use each opaque `runId` to retrieve a child Run.
1573
+ */
1574
+ childRunProjection?: AsyncChildRunProjection;
930
1575
  }
931
- /** One ctx.runPlay child run exposed on the parent's `--full` payload. */
1576
+ /** One ctx.runPlayAsync child Run exposed on the parent's `--full` payload. */
932
1577
  interface ChildRunSummary {
933
1578
  runId: string;
934
1579
  playName?: string | null;
1580
+ /** Authored ctx.runPlayAsync key; stable across row fanout. */
1581
+ launchKey?: string | null;
1582
+ /** Opaque durable identity for one authored invocation. */
1583
+ invocationKey?: string | null;
1584
+ /** Whether this child uses root-owned Deepline billing attribution. */
1585
+ rootBillingOwned?: boolean;
935
1586
  status: string;
936
1587
  parentRunId?: string | null;
937
1588
  rootRunId?: string | null;
@@ -939,6 +1590,29 @@ interface ChildRunSummary {
939
1590
  startedAt?: number | null;
940
1591
  finishedAt?: number | null;
941
1592
  }
1593
+ interface AsyncChildRunStatusCounts {
1594
+ total: number;
1595
+ queued: number;
1596
+ active: number;
1597
+ waiting: number;
1598
+ succeeded: number;
1599
+ failed: number;
1600
+ cancelled: number;
1601
+ unknown: number;
1602
+ }
1603
+ interface AsyncChildRunLaunchProjection {
1604
+ launchKey: string | null;
1605
+ playName: string | null;
1606
+ counts: AsyncChildRunStatusCounts;
1607
+ children: ChildRunSummary[];
1608
+ }
1609
+ interface AsyncChildRunProjection {
1610
+ kind: 'async_child_runs';
1611
+ returnedCount: number;
1612
+ complete: boolean;
1613
+ counts: AsyncChildRunStatusCounts;
1614
+ launches: AsyncChildRunLaunchProjection[];
1615
+ }
942
1616
  /**
943
1617
  * Rolled-up billing for a run subtree, projected from settled Charge Lifecycle
944
1618
  * facts. Deepline credits only — never provider spend.
@@ -1300,6 +1974,15 @@ interface ProductNotification {
1300
1974
  lastTestStatus?: string;
1301
1975
  lastErrorMessage?: string;
1302
1976
  }
1977
+ interface ProductNotificationConfigurationResponse {
1978
+ configuration: EffectiveProductNotificationConfiguration;
1979
+ catalog: readonly ProductNotificationTypeCatalogItem[];
1980
+ slackConnection: {
1981
+ connected: boolean;
1982
+ status: string;
1983
+ connectionId?: string;
1984
+ };
1985
+ }
1303
1986
  interface PlayDescription {
1304
1987
  name: string;
1305
1988
  /** Stable registry key. Same value `plays list` reports for this play. */
@@ -2124,6 +2807,28 @@ type UpdateNotificationInput = {
2124
2807
  name: string;
2125
2808
  eventTypes: string[];
2126
2809
  } & SlackNotificationTarget);
2810
+ type CreateNotificationGroupInput = {
2811
+ name: string;
2812
+ targets: string[];
2813
+ legacyEvents?: string[];
2814
+ dryRun?: boolean;
2815
+ };
2816
+ type CreateNotificationGroupResult = {
2817
+ mode: 'dry_run';
2818
+ compatibilityMode: boolean;
2819
+ name: string;
2820
+ targets: string[];
2821
+ legacyEvents: string[];
2822
+ } | {
2823
+ mode: 'legacy';
2824
+ notification: unknown;
2825
+ } | {
2826
+ mode: 'native';
2827
+ groupKey: string;
2828
+ targets: string[];
2829
+ group: EffectiveProductNotificationGroup;
2830
+ destinations: EffectiveProductNotificationDestination[];
2831
+ };
2127
2832
  type IngestionStorageRepairResult = {
2128
2833
  status?: 'repaired';
2129
2834
  connection_grants: {
@@ -2334,6 +3039,13 @@ type PlaySecretMetadata = {
2334
3039
  updatedAt: number;
2335
3040
  lastUsedAt?: number;
2336
3041
  };
3042
+ type PlaySecretCheck = {
3043
+ ok: boolean;
3044
+ name: string;
3045
+ playName: string | null;
3046
+ reason: 'active' | 'missing' | 'disabled' | 'empty' | 'invalid_version';
3047
+ secret: PlaySecretMetadata | null;
3048
+ };
2337
3049
  /**
2338
3050
  * Public runs namespace exposed as `client.runs`.
2339
3051
  *
@@ -2604,6 +3316,58 @@ type MonitorFleetWaitOptions = {
2604
3316
  */
2605
3317
  until?: 'converged' | 'deactivated';
2606
3318
  };
3319
+ /** A durable monitor batch can name a small key set, a query target, or one Fleet. */
3320
+ type MonitorBatchScope = {
3321
+ kind: 'keys';
3322
+ monitorKeys: string[];
3323
+ } | {
3324
+ kind: 'target';
3325
+ target: 'all' | 'all-active' | 'billing-suspended' | 'needs-repair';
3326
+ } | {
3327
+ kind: 'fleet';
3328
+ fleetId: string;
3329
+ };
3330
+ type MonitorBatchExistingSubmitOptions = {
3331
+ kind: 'audit' | 'deactivate' | 'reactivate' | 'repair';
3332
+ scope: MonitorBatchScope;
3333
+ dryRun?: boolean;
3334
+ /** Required for deactivate; it is the declared reason shown by health/UI. */
3335
+ deactivationReason?: string;
3336
+ /** Stable retry key. Reusing it joins the original durable operation. */
3337
+ idempotencyKey: string;
3338
+ };
3339
+ /** Complete definitions, one JSON object per line; uploaded as bounded shards. */
3340
+ type MonitorBatchDeploySubmitOptions = {
3341
+ kind: 'deploy';
3342
+ manifestNdjson: string;
3343
+ dryRun?: boolean;
3344
+ /** Stable retry key. Reusing it joins the same content-addressed manifest. */
3345
+ idempotencyKey: string;
3346
+ };
3347
+ type MonitorBatchSubmitOptions = MonitorBatchExistingSubmitOptions | MonitorBatchDeploySubmitOptions;
3348
+ type MonitorBatchOperationResult = {
3349
+ ok?: boolean;
3350
+ rejoined?: boolean;
3351
+ operation: {
3352
+ runId: string;
3353
+ kind: 'audit' | 'deactivate' | 'reactivate' | 'deploy' | 'repair';
3354
+ state: 'running' | 'retry_scheduled' | 'completed' | 'failed';
3355
+ dryRun: boolean;
3356
+ scope: unknown;
3357
+ submittedAt: number;
3358
+ updatedAt: number;
3359
+ deactivationReason?: string;
3360
+ nextAttemptAt?: number;
3361
+ completedAt?: number;
3362
+ summary?: Record<string, unknown>;
3363
+ lastError?: string;
3364
+ };
3365
+ results?: {
3366
+ page: Array<Record<string, unknown>>;
3367
+ isDone: boolean;
3368
+ continueCursor: string;
3369
+ };
3370
+ };
2607
3371
  type MonitorFleetsNamespace = {
2608
3372
  /**
2609
3373
  * Create, update, or re-plan a fleet. Pass a definition to admit new source
@@ -2621,6 +3385,12 @@ type MonitorFleetsNamespace = {
2621
3385
  /** Poll the fleet until the server reports a terminal status (or the timeout elapses). */
2622
3386
  waitForConvergence: (fleetId: string, options?: MonitorFleetWaitOptions) => Promise<MonitorFleetResult>;
2623
3387
  };
3388
+ type MonitorBatchNamespace = {
3389
+ submit: (options: MonitorBatchSubmitOptions) => Promise<MonitorBatchOperationResult>;
3390
+ get: (operationId: string, options?: {
3391
+ cursor?: string | null;
3392
+ }) => Promise<MonitorBatchOperationResult>;
3393
+ };
2624
3394
  /**
2625
3395
  * Delivery and convergence health for a scope, from
2626
3396
  * `GET /api/v2/monitors/health`.
@@ -2638,6 +3408,16 @@ type MonitorsHealth = {
2638
3408
  scanned: number;
2639
3409
  /** True when the scope was larger than one bounded read; counts are partial. */
2640
3410
  truncated: boolean;
3411
+ /**
3412
+ * A durable whole-scope snapshot is rebuilding. Counts remain intentionally
3413
+ * partial until it completes; older servers omit this additive field.
3414
+ */
3415
+ refresh?: {
3416
+ state: 'running' | 'completed';
3417
+ started_at: number;
3418
+ updated_at: number;
3419
+ completed_at: number | null;
3420
+ };
2641
3421
  desired: {
2642
3422
  active: number;
2643
3423
  inactive: number;
@@ -2668,6 +3448,15 @@ type MonitorsHealth = {
2668
3448
  observed_at: number | null;
2669
3449
  provider_resource_id: string | null;
2670
3450
  }>;
3451
+ /** Bounded current durable monitor work, if the server supports it. */
3452
+ batch_operations?: Array<{
3453
+ run_id: string;
3454
+ kind: 'audit' | 'deactivate' | 'reactivate' | 'repair' | 'deploy';
3455
+ state: 'running' | 'retry_scheduled';
3456
+ updated_at: number;
3457
+ next_attempt_at?: number;
3458
+ summary?: Record<string, unknown>;
3459
+ }>;
2671
3460
  };
2672
3461
  /** One bounded audit pass, from `POST /api/v2/monitors/audit`. */
2673
3462
  type MonitorsAuditResult = {
@@ -2796,6 +3585,8 @@ type MonitorsNamespace = {
2796
3585
  health: (options?: {
2797
3586
  fleetId?: string;
2798
3587
  }) => Promise<MonitorsHealth>;
3588
+ /** Durable bulk audit/deactivation/reactivation/repair with retained progress. */
3589
+ batch: MonitorBatchNamespace;
2799
3590
  /** Define, reconcile, and control table-backed monitor fleets. */
2800
3591
  fleets: MonitorFleetsNamespace;
2801
3592
  };
@@ -2936,7 +3727,7 @@ type TargetBillingMutationResult = {
2936
3727
  };
2937
3728
  type TargetBillingPlanTransitionOptions = {
2938
3729
  action: 'start_or_change';
2939
- targetPlanSku: 'payg-v1' | 'builder-v1' | 'team-v1';
3730
+ targetPlanSku: 'payg-v1' | 'builder-v1' | 'growth-v1' | 'growth-canary-v1' | 'team-v1';
2940
3731
  idempotencyKey: string;
2941
3732
  } | {
2942
3733
  action: 'cancel' | 'undo_cancel';
@@ -3016,7 +3807,12 @@ type WorkspaceCreateResult = {
3016
3807
  org_name: string;
3017
3808
  org_slug: string;
3018
3809
  plan_sku: 'payg-v1';
3019
- rate_policy_ref: 'payg-rates-v2';
3810
+ /**
3811
+ * The PAYG rate policy the workspace was provisioned onto, taken from the
3812
+ * catalog revision its operation pinned: v4 bound payg-rates-v2, v5 binds
3813
+ * the flat payg-rates-v3.
3814
+ */
3815
+ rate_policy_ref: 'payg-rates-v2' | 'payg-rates-v3';
3020
3816
  operation: {
3021
3817
  id: string;
3022
3818
  state: 'completed';
@@ -3161,6 +3957,14 @@ declare class DeeplineClient {
3161
3957
  * @returns Matching active secret metadata, or `null`.
3162
3958
  */
3163
3959
  checkSecret(name: string): Promise<PlaySecretMetadata | null>;
3960
+ /** Check effective scope and active-version health without reading the value.
3961
+ * Without playName, checks the organization-scoped secret only. With a Play
3962
+ * name, an active Play secret takes precedence; a deleted/disabled Play
3963
+ * secret falls back to the organization-scoped secret.
3964
+ */
3965
+ inspectSecret(name: string, options?: {
3966
+ playName?: string;
3967
+ }): Promise<PlaySecretCheck>;
3164
3968
  /**
3165
3969
  * List all available tools.
3166
3970
  *
@@ -3862,6 +4666,12 @@ declare class DeeplineClient {
3862
4666
  updateNotificationDlqDelivery(deliveryId: string, action: 'retry' | 'archive'): Promise<unknown>;
3863
4667
  /** List the workspace's named notification rules. */
3864
4668
  getNotifications(): Promise<ProductNotificationSettings>;
4669
+ /** Read the group-based product-notification configuration and rule catalog. */
4670
+ getNotificationConfiguration(): Promise<ProductNotificationConfigurationResponse>;
4671
+ /** Atomically apply one retry-safe desired configuration change. */
4672
+ changeNotificationConfiguration(expectedWorkspaceVersion: number, change: ProductNotificationConfigurationChange): Promise<Pick<ProductNotificationConfigurationResponse, 'configuration'>>;
4673
+ /** Create one notification group and its destinations as a retry-safe unit. */
4674
+ createNotificationGroup(input: CreateNotificationGroupInput): Promise<CreateNotificationGroupResult>;
3865
4675
  /** List Slack channels available to an already-connected Slack integration. */
3866
4676
  listNotificationChannels(query?: string): Promise<{
3867
4677
  identity: {
@@ -4170,6 +4980,12 @@ declare class DeeplineClient {
4170
4980
  readMonitorsHealth(options?: {
4171
4981
  fleetId?: string;
4172
4982
  }): Promise<MonitorsHealth>;
4983
+ /** Submit durable monitor work; transport retries use the same idempotency key. */
4984
+ submitMonitorBatch(options: MonitorBatchSubmitOptions): Promise<MonitorBatchOperationResult>;
4985
+ /** Get durable batch progress and a bounded retained evidence page. */
4986
+ getMonitorBatch(operationId: string, options?: {
4987
+ cursor?: string | null;
4988
+ }): Promise<MonitorBatchOperationResult>;
4173
4989
  /**
4174
4990
  * The deployable monitor tools catalog. Pass a tool id (positional or
4175
4991
  * `{ tool }`) to describe one tool's full payload/stream contract, or no tool
@@ -4640,7 +5456,13 @@ type PrebuiltPlayRef = {
4640
5456
  readonly playName: string;
4641
5457
  readonly name: string;
4642
5458
  };
4643
- type PlayReferenceLike = PlayAuthoringReferenceLike;
5459
+ type PlayReferenceLike<TInput extends Record<string, unknown> = Record<string, unknown>> = PlayAuthoringReferenceLike<TInput>;
5460
+ /** Branded durable identity returned by ctx.runPlayAsync. */
5461
+ type PlayRunId = PlayRunId$1;
5462
+ /** Serializable reference to an independently scheduled Play Run. */
5463
+ type AsyncPlayRunRef = AsyncPlayRunRef$1;
5464
+ /** Author intent for an independently scheduled child Run. */
5465
+ type PlayAsyncCallOptions = PlayAuthoringAsyncCallOptions;
4644
5466
 
4645
5467
  type PlayReturnObject = PlayReturnObject$1;
4646
5468
  type PlayInputContract<TInput> = PlayAuthoringInputContract<TInput>;
@@ -5239,4 +6061,4 @@ declare function writeCsvOutputFile(rows: Array<Record<string, unknown>>, stem:
5239
6061
  */
5240
6062
  declare function extractSummaryFields(payload: unknown): Record<string, Scalar>;
5241
6063
 
5242
- export { type AdmittedMonitorFleetAuthoringContract, AuthError, type BillingCreditPool, type BillingInvoiceEntry, type BillingInvoicesResult, type BillingNamespace, type BillingPaymentMethodSummary, type BillingSubscriptionCancelResult, type BillingSubscriptionStatus, type BillingTopUpResult, type ClearPlayHistoryRequest, type ClearPlayHistoryResult, type ColumnMap, type ColumnResolver, type ConditionalStepResolver, ConfigError, type CsvInput, type CsvOptions, type CustomerDbQueryResult, DEEPLINE_TOOL_CATEGORIES, type DatasetBuilder, type DatasetColumnDefinition, type DatasetColumnRunInput, type DbNamespace, Deepline, DeeplineClient, type DeeplineClientOptions, DeeplineContext, DeeplineError, type DeeplineNamedPlay, type DeeplinePlayRuntimeContext, type DeeplinePlaysNamespace, type DeeplineToolCategory, type DeeplineToolsNamespace, type DefinePlayConfig, type DefinedPlay, type FetchOptions, type FileInput, type IngestionStorageRepairResult, type LiveEventEnvelope, MONITOR_FLEET_AUTHORING_CONTRACT_CHANGELOG, MONITOR_FLEET_AUTHORING_CONTRACT_EDITION, MONITOR_FLEET_DOCUMENTATION, MONITOR_FLEET_FRONTIER_MAX_ROWS, MONITOR_FLEET_MAX_MEMBERS, type MonitorCheckResult, type MonitorControls, type MonitorDefinition, type MonitorDeleteResult, type MonitorDependents, type MonitorDeployResult, type MonitorDetail, type MonitorFleetAuthoringContractEdition, type MonitorFleetAuthoringContractResult, type MonitorFleetColumn, type MonitorFleetContractIssue, type MonitorFleetDeactivateOptions, type MonitorFleetDefinition, type MonitorFleetExpression, type MonitorFleetGetOptions, type MonitorFleetReactivateOptions, type MonitorFleetResult, type MonitorFleetStatus, type MonitorFleetSyncOptions, type MonitorFleetTemplate, type MonitorFleetWaitOptions, type MonitorFleetsNamespace, type MonitorListEntry, type MonitorPayload, type MonitorReactivateResult, type MonitorSpec, type MonitorUpdateChangeSummary, type MonitorUpdateResult, type MonitorsAccessStatus, type MonitorsAvailableOptions, type MonitorsAvailableResult, type MonitorsListOptions, type MonitorsListResult, type MonitorsNamespace, PLAY_BOOTSTRAP_COMPANY_FIELDS, PLAY_BOOTSTRAP_COMPANY_PROVIDER_CATEGORY, PLAY_BOOTSTRAP_CONTACT_FIELDS, PLAY_BOOTSTRAP_FINDER_KINDS, PLAY_BOOTSTRAP_OUTPUT_FIELD_BY_FINDER, PLAY_BOOTSTRAP_PEOPLE_PROVIDER_CATEGORY, PLAY_BOOTSTRAP_PROVIDER_CATEGORY_BY_FINDER, PLAY_BOOTSTRAP_SOURCE_KINDS, PLAY_BOOTSTRAP_STAGE_KINDS, PLAY_BOOTSTRAP_TEMPLATES, PROD_URL, type PlayActivityObservation, type PlayActivityState, type PlayActivityTarget, type PlayBindings, type PlayBootstrapEntityKind, type PlayBootstrapFinderKind, type PlayCallExecution, type PlayCallOptions, type PlayFetchResponse, type PlayInputContract, type PlayJob, type PlayListItem, type PlayLiveEvent, type PlayRevisionSummary, type PlayRunActionPackage, type PlayRunActivityProjection, type PlayRunDatasetActions, type PlayRunPackage, type PlayRunResult, type PlayRunStart, type PlaySheetRow, type PlaySheetRowsResult, type PlayStatus, type PlayStepProgramStep, type PrebuiltPlayRef, type PublishPlayVersionRequest, type PublishPlayVersionResult, RateLimitError, type ResolvedConfig, RunObserveTransportUnavailableError, type RunsListOptions, type RunsLogsOptions, type RunsLogsResult, type RunsNamespace, type RunsTailOptions, type RuntimeStepOptions, SDK_API_CONTRACT, SDK_VERSION, type SqlListenerDeclaration, type SqlListenerEvent, type SqlListenerOperation, type SqlQuery, type StartPlayRunRequest, type StepOptions, type StepProgram, type StepProgramResolver, type StepResolver, type StopPlayRunResult, type ToolDefinition, ToolExecuteResult, type ToolExecution, ToolExecutionError, ToolExecutionErrorOptions, type ToolExecutionRequest, type ToolMetadata, ToolRateLimitError, type ToolSearchOptions, type ToolSearchResult, type WorkspaceCreateResult, type WorkspacesNamespace, admitMonitorFleetAuthoringContract, defineInput, defineMonitor, defineMonitorFleet, definePlay, defineWorkflow, extractSummaryFields, fleetColumn, fleetKey, formatPlayBootstrapFinderKinds, formatPlayBootstrapFinderKindsForSentence, formatPlayBootstrapTemplates, getDefinedPlayMetadata, isPlayBootstrapFinderKind, isPlayBootstrapTemplate, resolveConfig, runIf, steps, tryConvertToList, validateMonitorFleetDefinition, writeCsvOutputFile, writeJsonOutputFile };
6064
+ export { type AdmittedMonitorFleetAuthoringContract, type AsyncPlayRunRef, AuthError, type BillingCreditPool, type BillingInvoiceEntry, type BillingInvoicesResult, type BillingNamespace, type BillingPaymentMethodSummary, type BillingSubscriptionCancelResult, type BillingSubscriptionStatus, type BillingTopUpResult, type ClearPlayHistoryRequest, type ClearPlayHistoryResult, type ColumnMap, type ColumnResolver, type ConditionalStepResolver, ConfigError, type CreateNotificationGroupInput, type CreateNotificationGroupResult, type CsvInput, type CsvOptions, type CustomerDbQueryResult, DEEPLINE_TOOL_CATEGORIES, type DatasetBuilder, type DatasetColumnDefinition, type DatasetColumnRunInput, type DbNamespace, Deepline, DeeplineClient, type DeeplineClientOptions, DeeplineContext, DeeplineError, type DeeplineNamedPlay, type DeeplinePlayRuntimeContext, type DeeplinePlaysNamespace, type DeeplineToolCategory, type DeeplineToolsNamespace, type DefinePlayConfig, type DefinedPlay, type FetchOptions, type FileInput, type IngestionStorageRepairResult, type LiveEventEnvelope, MONITOR_FLEET_AUTHORING_CONTRACT_CHANGELOG, MONITOR_FLEET_AUTHORING_CONTRACT_EDITION, MONITOR_FLEET_DOCUMENTATION, MONITOR_FLEET_FRONTIER_MAX_ROWS, MONITOR_FLEET_MAX_MEMBERS, type MonitorCheckResult, type MonitorControls, type MonitorDefinition, type MonitorDeleteResult, type MonitorDependents, type MonitorDeployResult, type MonitorDetail, type MonitorFleetAuthoringContractEdition, type MonitorFleetAuthoringContractResult, type MonitorFleetColumn, type MonitorFleetContractIssue, type MonitorFleetDeactivateOptions, type MonitorFleetDefinition, type MonitorFleetExpression, type MonitorFleetGetOptions, type MonitorFleetReactivateOptions, type MonitorFleetResult, type MonitorFleetStatus, type MonitorFleetSyncOptions, type MonitorFleetTemplate, type MonitorFleetWaitOptions, type MonitorFleetsNamespace, type MonitorListEntry, type MonitorPayload, type MonitorReactivateResult, type MonitorSpec, type MonitorUpdateChangeSummary, type MonitorUpdateResult, type MonitorsAccessStatus, type MonitorsAvailableOptions, type MonitorsAvailableResult, type MonitorsListOptions, type MonitorsListResult, type MonitorsNamespace, PLAY_BOOTSTRAP_COMPANY_FIELDS, PLAY_BOOTSTRAP_COMPANY_PROVIDER_CATEGORY, PLAY_BOOTSTRAP_CONTACT_FIELDS, PLAY_BOOTSTRAP_FINDER_KINDS, PLAY_BOOTSTRAP_OUTPUT_FIELD_BY_FINDER, PLAY_BOOTSTRAP_PEOPLE_PROVIDER_CATEGORY, PLAY_BOOTSTRAP_PROVIDER_CATEGORY_BY_FINDER, PLAY_BOOTSTRAP_SOURCE_KINDS, PLAY_BOOTSTRAP_STAGE_KINDS, PLAY_BOOTSTRAP_TEMPLATES, PROD_URL, type PlayActivityObservation, type PlayActivityState, type PlayActivityTarget, type PlayAsyncCallOptions, type PlayBindings, type PlayBootstrapEntityKind, type PlayBootstrapFinderKind, type PlayCallExecution, type PlayCallOptions, type PlayFetchResponse, type PlayInputContract, type PlayJob, type PlayListItem, type PlayLiveEvent, type PlayReferenceLike, type PlayRevisionSummary, type PlayRunActionPackage, type PlayRunActivityProjection, type PlayRunDatasetActions, type PlayRunId, type PlayRunPackage, type PlayRunResult, type PlayRunStart, type PlaySheetRow, type PlaySheetRowsResult, type PlayStatus, type PlayStepProgramStep, type PrebuiltPlayRef, type PublishPlayVersionRequest, type PublishPlayVersionResult, RateLimitError, type ResolvedConfig, RunObserveTransportUnavailableError, type RunsListOptions, type RunsLogsOptions, type RunsLogsResult, type RunsNamespace, type RunsTailOptions, type RuntimeStepOptions, SDK_API_CONTRACT, SDK_VERSION, type SqlListenerDeclaration, type SqlListenerEvent, type SqlListenerOperation, type SqlQuery, type StartPlayRunRequest, type StepOptions, type StepProgram, type StepProgramResolver, type StepResolver, type StopPlayRunResult, type ToolDefinition, ToolExecuteResult, type ToolExecution, ToolExecutionError, ToolExecutionErrorOptions, type ToolExecutionRequest, type ToolMetadata, ToolRateLimitError, type ToolSearchOptions, type ToolSearchResult, type WorkspaceCreateResult, type WorkspacesNamespace, admitMonitorFleetAuthoringContract, defineInput, defineMonitor, defineMonitorFleet, definePlay, defineWorkflow, extractSummaryFields, fleetColumn, fleetKey, formatPlayBootstrapFinderKinds, formatPlayBootstrapFinderKindsForSentence, formatPlayBootstrapTemplates, getDefinedPlayMetadata, isPlayBootstrapFinderKind, isPlayBootstrapTemplate, resolveConfig, runIf, steps, tryConvertToList, validateMonitorFleetDefinition, writeCsvOutputFile, writeJsonOutputFile };