deepline 0.3.59 → 0.3.60

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.
@@ -711,7 +711,7 @@ type ToolExecuteResultAccessors<TExtracted extends Record<string, unknown> = Par
711
711
  */
712
712
  type ToolExecuteResult<TResult = unknown, TMeta = Record<string, unknown>, TExtracted extends Record<string, unknown> = Partial<DeeplineGetterValueMap>, TLists extends Record<string, Record<string, unknown>> = Record<string, Record<string, unknown>>> = ToolExecuteResultBase<TResult, TMeta> & ToolExecuteResultAccessors<TExtracted, TLists>;
713
713
 
714
- declare const SUPPORTED_PLAY_AUTHORING_CONTRACT_EDITIONS: readonly [1, 2, 3, 4, 5];
714
+ declare const SUPPORTED_PLAY_AUTHORING_CONTRACT_EDITIONS: readonly [1, 2, 3, 4, 5, 6];
715
715
  type PlayAuthoringContractEdition = (typeof SUPPORTED_PLAY_AUTHORING_CONTRACT_EDITIONS)[number];
716
716
  type PlaySqlListenerOperation = 'INSERT' | 'UPDATE' | 'DELETE';
717
717
  type PlayStandardWebhookHeaderFamily = 'standard' | 'svix';
@@ -781,14 +781,22 @@ type PlayAuthoringAstBindings = {
781
781
  cron?: {
782
782
  schedule: string;
783
783
  timezone?: string;
784
+ /** Static JSON object supplied to every run started by this cron binding. */
785
+ input?: Record<string, unknown>;
784
786
  };
785
787
  sqlListeners?: PlayAuthoringAstSqlListenerDeclaration[];
786
788
  invalidSqlListenerSingular?: boolean;
787
789
  invalidSqlListenerShape?: boolean;
788
790
  secrets?: string[];
789
791
  };
792
+ /**
793
+ * Static cron input must be an object because the scheduler accepts a JSON
794
+ * object. It is tied to the Play handler input so TypeScript rejects missing
795
+ * required fields and incompatible values before the Play reaches `check`.
796
+ */
797
+ type PlayAuthoringCronInput<TInput> = TInput extends readonly unknown[] ? never : TInput extends object ? TInput : never;
790
798
  /** The one public type for options accepted by definePlay. */
791
- type PlayAuthoringBindings = {
799
+ type PlayAuthoringBindings<TInput = Record<string, unknown>> = {
792
800
  description?: string;
793
801
  compatibility?: {
794
802
  toolErrorSchemaVersion?: ToolExecutionErrorSchemaVersion;
@@ -823,6 +831,8 @@ type PlayAuthoringBindings = {
823
831
  cron?: {
824
832
  schedule: string;
825
833
  timezone?: string;
834
+ /** Static JSON object supplied to every run started by this cron binding. */
835
+ input?: PlayAuthoringCronInput<TInput>;
826
836
  };
827
837
  sqlListeners?: PlaySqlListenerDeclaration[];
828
838
  secrets?: readonly string[];
@@ -891,7 +901,7 @@ type PlaySecretAwareRequestInit = Omit<RequestInit, 'headers'> & {
891
901
  /** Ordinary request headers, recorded in the durable receipt with any resolved Play secret value redacted. Prefer `auth` for credentials: it enforces HTTPS and keeps the auth header out of the receipt. */
892
902
  headers?: HeadersInit;
893
903
  /**
894
- * One or more credentialed headers for this request. Pass a single `ctx.secrets` auth for the common case, or an array when an API requires multiple credentialed headers — for example, Supabase with both `apikey` and `Authorization`. Auth-helper requests require HTTPS and omit the credential from the durable receipt. Each auth entry must target a distinct header.
904
+ * One or more credentialed headers for this request. Pass a single `ctx.secrets` auth for the common case, or an array when an API requires multiple credentialed headers. Auth-helper requests require HTTPS and omit the credential from the durable receipt. Each auth entry must target a distinct header.
895
905
  */
896
906
  auth?: PlaySecretAuthInput;
897
907
  };
@@ -913,16 +923,16 @@ type PlayAuthoringDefineConfig<TInput, TOutput extends PlayReturnObject, TContex
913
923
  description?: string;
914
924
  input: PlayAuthoringInputContract<TInput>;
915
925
  run: (ctx: TContext, input: TInput) => Promise<TOutput>;
916
- bindings?: PlayAuthoringBindings;
917
- billing?: PlayAuthoringBindings['billing'];
918
- runtime?: PlayAuthoringBindings['runtime'];
919
- compatibility?: PlayAuthoringBindings['compatibility'];
926
+ bindings?: PlayAuthoringBindings<TInput>;
927
+ billing?: PlayAuthoringBindings<TInput>['billing'];
928
+ runtime?: PlayAuthoringBindings<TInput>['runtime'];
929
+ compatibility?: PlayAuthoringBindings<TInput>['compatibility'];
920
930
  };
921
931
  /** Shared callable-plus-handle shape returned by `definePlay`. */
922
932
  type PlayAuthoringDefinedPlay<TInput, TOutput extends PlayReturnObject, TContext, THandle extends object> = ((ctx: TContext, input: TInput) => Promise<TOutput>) & THandle & {
923
- readonly bindings?: PlayAuthoringBindings;
924
- readonly runtime?: PlayAuthoringBindings['runtime'];
925
- readonly compatibility?: PlayAuthoringBindings['compatibility'];
933
+ readonly bindings?: PlayAuthoringBindings<TInput>;
934
+ readonly runtime?: PlayAuthoringBindings<TInput>['runtime'];
935
+ readonly compatibility?: PlayAuthoringBindings<TInput>['compatibility'];
926
936
  readonly playName: string;
927
937
  };
928
938
  /** Canonical resolver shape for a customer-authored durable step. */
@@ -1484,6 +1494,24 @@ declare const PLAY_AUTHORING_FIELD_REGISTRY: {
1484
1494
  readonly description: "IANA timezone. Omitted means UTC.";
1485
1495
  readonly errorMessage: "bindings.cron.timezone must be a valid non-empty IANA timezone string.";
1486
1496
  };
1497
+ readonly 'bindings.cron.input': {
1498
+ readonly schema: _sinclair_typebox.TObject<{}>;
1499
+ readonly fixtures: {
1500
+ readonly valid: {
1501
+ readonly apply: true;
1502
+ };
1503
+ readonly invalid: readonly ["apply"];
1504
+ readonly absent: undefined;
1505
+ readonly unresolved: readonly ["cronInput"];
1506
+ readonly edition1: undefined;
1507
+ };
1508
+ readonly referenceType: "Record<string, unknown>";
1509
+ readonly required: false;
1510
+ readonly resolution: "static-required";
1511
+ readonly issueCode: "play_authoring_binding_invalid";
1512
+ readonly description: "Static JSON object passed to every run created by this cron binding.";
1513
+ readonly errorMessage: "bindings.cron.input must be a static JSON object (no variables, spreads, or functions).";
1514
+ };
1487
1515
  readonly 'bindings.sqlListeners': {
1488
1516
  readonly schema: _sinclair_typebox.TArray<_sinclair_typebox.TObject<{}>>;
1489
1517
  readonly fixtures: {
@@ -711,7 +711,7 @@ type ToolExecuteResultAccessors<TExtracted extends Record<string, unknown> = Par
711
711
  */
712
712
  type ToolExecuteResult<TResult = unknown, TMeta = Record<string, unknown>, TExtracted extends Record<string, unknown> = Partial<DeeplineGetterValueMap>, TLists extends Record<string, Record<string, unknown>> = Record<string, Record<string, unknown>>> = ToolExecuteResultBase<TResult, TMeta> & ToolExecuteResultAccessors<TExtracted, TLists>;
713
713
 
714
- declare const SUPPORTED_PLAY_AUTHORING_CONTRACT_EDITIONS: readonly [1, 2, 3, 4, 5];
714
+ declare const SUPPORTED_PLAY_AUTHORING_CONTRACT_EDITIONS: readonly [1, 2, 3, 4, 5, 6];
715
715
  type PlayAuthoringContractEdition = (typeof SUPPORTED_PLAY_AUTHORING_CONTRACT_EDITIONS)[number];
716
716
  type PlaySqlListenerOperation = 'INSERT' | 'UPDATE' | 'DELETE';
717
717
  type PlayStandardWebhookHeaderFamily = 'standard' | 'svix';
@@ -781,14 +781,22 @@ type PlayAuthoringAstBindings = {
781
781
  cron?: {
782
782
  schedule: string;
783
783
  timezone?: string;
784
+ /** Static JSON object supplied to every run started by this cron binding. */
785
+ input?: Record<string, unknown>;
784
786
  };
785
787
  sqlListeners?: PlayAuthoringAstSqlListenerDeclaration[];
786
788
  invalidSqlListenerSingular?: boolean;
787
789
  invalidSqlListenerShape?: boolean;
788
790
  secrets?: string[];
789
791
  };
792
+ /**
793
+ * Static cron input must be an object because the scheduler accepts a JSON
794
+ * object. It is tied to the Play handler input so TypeScript rejects missing
795
+ * required fields and incompatible values before the Play reaches `check`.
796
+ */
797
+ type PlayAuthoringCronInput<TInput> = TInput extends readonly unknown[] ? never : TInput extends object ? TInput : never;
790
798
  /** The one public type for options accepted by definePlay. */
791
- type PlayAuthoringBindings = {
799
+ type PlayAuthoringBindings<TInput = Record<string, unknown>> = {
792
800
  description?: string;
793
801
  compatibility?: {
794
802
  toolErrorSchemaVersion?: ToolExecutionErrorSchemaVersion;
@@ -823,6 +831,8 @@ type PlayAuthoringBindings = {
823
831
  cron?: {
824
832
  schedule: string;
825
833
  timezone?: string;
834
+ /** Static JSON object supplied to every run started by this cron binding. */
835
+ input?: PlayAuthoringCronInput<TInput>;
826
836
  };
827
837
  sqlListeners?: PlaySqlListenerDeclaration[];
828
838
  secrets?: readonly string[];
@@ -891,7 +901,7 @@ type PlaySecretAwareRequestInit = Omit<RequestInit, 'headers'> & {
891
901
  /** Ordinary request headers, recorded in the durable receipt with any resolved Play secret value redacted. Prefer `auth` for credentials: it enforces HTTPS and keeps the auth header out of the receipt. */
892
902
  headers?: HeadersInit;
893
903
  /**
894
- * One or more credentialed headers for this request. Pass a single `ctx.secrets` auth for the common case, or an array when an API requires multiple credentialed headers — for example, Supabase with both `apikey` and `Authorization`. Auth-helper requests require HTTPS and omit the credential from the durable receipt. Each auth entry must target a distinct header.
904
+ * One or more credentialed headers for this request. Pass a single `ctx.secrets` auth for the common case, or an array when an API requires multiple credentialed headers. Auth-helper requests require HTTPS and omit the credential from the durable receipt. Each auth entry must target a distinct header.
895
905
  */
896
906
  auth?: PlaySecretAuthInput;
897
907
  };
@@ -913,16 +923,16 @@ type PlayAuthoringDefineConfig<TInput, TOutput extends PlayReturnObject, TContex
913
923
  description?: string;
914
924
  input: PlayAuthoringInputContract<TInput>;
915
925
  run: (ctx: TContext, input: TInput) => Promise<TOutput>;
916
- bindings?: PlayAuthoringBindings;
917
- billing?: PlayAuthoringBindings['billing'];
918
- runtime?: PlayAuthoringBindings['runtime'];
919
- compatibility?: PlayAuthoringBindings['compatibility'];
926
+ bindings?: PlayAuthoringBindings<TInput>;
927
+ billing?: PlayAuthoringBindings<TInput>['billing'];
928
+ runtime?: PlayAuthoringBindings<TInput>['runtime'];
929
+ compatibility?: PlayAuthoringBindings<TInput>['compatibility'];
920
930
  };
921
931
  /** Shared callable-plus-handle shape returned by `definePlay`. */
922
932
  type PlayAuthoringDefinedPlay<TInput, TOutput extends PlayReturnObject, TContext, THandle extends object> = ((ctx: TContext, input: TInput) => Promise<TOutput>) & THandle & {
923
- readonly bindings?: PlayAuthoringBindings;
924
- readonly runtime?: PlayAuthoringBindings['runtime'];
925
- readonly compatibility?: PlayAuthoringBindings['compatibility'];
933
+ readonly bindings?: PlayAuthoringBindings<TInput>;
934
+ readonly runtime?: PlayAuthoringBindings<TInput>['runtime'];
935
+ readonly compatibility?: PlayAuthoringBindings<TInput>['compatibility'];
926
936
  readonly playName: string;
927
937
  };
928
938
  /** Canonical resolver shape for a customer-authored durable step. */
@@ -1484,6 +1494,24 @@ declare const PLAY_AUTHORING_FIELD_REGISTRY: {
1484
1494
  readonly description: "IANA timezone. Omitted means UTC.";
1485
1495
  readonly errorMessage: "bindings.cron.timezone must be a valid non-empty IANA timezone string.";
1486
1496
  };
1497
+ readonly 'bindings.cron.input': {
1498
+ readonly schema: _sinclair_typebox.TObject<{}>;
1499
+ readonly fixtures: {
1500
+ readonly valid: {
1501
+ readonly apply: true;
1502
+ };
1503
+ readonly invalid: readonly ["apply"];
1504
+ readonly absent: undefined;
1505
+ readonly unresolved: readonly ["cronInput"];
1506
+ readonly edition1: undefined;
1507
+ };
1508
+ readonly referenceType: "Record<string, unknown>";
1509
+ readonly required: false;
1510
+ readonly resolution: "static-required";
1511
+ readonly issueCode: "play_authoring_binding_invalid";
1512
+ readonly description: "Static JSON object passed to every run created by this cron binding.";
1513
+ readonly errorMessage: "bindings.cron.input must be a static JSON object (no variables, spreads, or functions).";
1514
+ };
1487
1515
  readonly 'bindings.sqlListeners': {
1488
1516
  readonly schema: _sinclair_typebox.TArray<_sinclair_typebox.TObject<{}>>;
1489
1517
  readonly fixtures: {
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
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-B47AA7As.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-B47AA7As.mjs';
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-IkyvsUO-.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-IkyvsUO-.mjs';
4
4
  import '@sinclair/typebox';
5
5
 
6
6
  declare const FIXTURE_BEHAVIOR_VERSION: 1;
@@ -1193,6 +1193,20 @@ interface PlayDefinitionDetail {
1193
1193
  liveRevision?: PlayRevisionSummary | null;
1194
1194
  /** `true` if the working revision differs from the live revision. */
1195
1195
  isDraftDirty?: boolean;
1196
+ /** Live trigger state. This is operational state, not a source declaration. */
1197
+ triggerStatus?: PlayTriggerStatus;
1198
+ /**
1199
+ * Additive scheduler metadata for human/UI rendering. Values are absent for
1200
+ * plays with no cron binding and must never be inferred from source alone.
1201
+ */
1202
+ triggerMetadata?: {
1203
+ cronSchedule?: string | null;
1204
+ cronTimezone?: string | null;
1205
+ nextScheduledAt?: number | null;
1206
+ lastScheduledAt?: number | null;
1207
+ blockedReason?: string | null;
1208
+ [key: string]: unknown;
1209
+ } | null;
1196
1210
  /** Effective sandbox limit from the live revision, or the working draft before first publish. */
1197
1211
  runtimeLimit?: PlayRuntimeLimit | null;
1198
1212
  /** Present for a Play with a cron trigger. Advisory only; publish remains authoritative. */
@@ -1228,11 +1242,13 @@ interface PlayListItem {
1228
1242
  currentRevision?: PlayRevisionSummary | null;
1229
1243
  liveRevision?: PlayRevisionSummary | null;
1230
1244
  aliases?: string[];
1231
- triggerStatus?: {
1232
- cron: string | null;
1233
- webhook: string | null;
1234
- blockedReason: string | null;
1235
- };
1245
+ triggerStatus?: PlayTriggerStatus;
1246
+ }
1247
+ /** Additive live trigger state shared by list, get, and describe. */
1248
+ interface PlayTriggerStatus {
1249
+ cron: string | null;
1250
+ webhook: string | null;
1251
+ blockedReason: string | null;
1236
1252
  }
1237
1253
  interface ProductNotificationEventDefinition {
1238
1254
  id: string;
@@ -1314,11 +1330,9 @@ interface PlayDescription {
1314
1330
  */
1315
1331
  liveVersion?: number | null;
1316
1332
  /** Whether this play's cron and webhook triggers are armed. */
1317
- triggerStatus?: {
1318
- cron: string | null;
1319
- webhook: string | null;
1320
- blockedReason: string | null;
1321
- };
1333
+ triggerStatus?: PlayTriggerStatus;
1334
+ /** Additive cron timing metadata for an operational description. */
1335
+ triggerMetadata?: PlayDefinitionDetail['triggerMetadata'];
1322
1336
  isDraftDirty?: boolean;
1323
1337
  latestRunId?: string | null;
1324
1338
  /** Effective sandbox limit from the revision named runs use. */
@@ -1613,6 +1627,8 @@ interface PlayCheckTriggersSummary {
1613
1627
  cron?: {
1614
1628
  schedule: string;
1615
1629
  timezone?: string;
1630
+ /** Static input supplied to every run started by this cron binding. */
1631
+ input?: Record<string, unknown>;
1616
1632
  };
1617
1633
  webhook?: true;
1618
1634
  }
@@ -4132,7 +4148,7 @@ type PlayFetchResponse = PlayAuthoringFetchResponse;
4132
4148
  *
4133
4149
  * @sdkReference runtime 030
4134
4150
  */
4135
- type PlayBindings = PlayAuthoringBindings;
4151
+ type PlayBindings<TInput = Record<string, unknown>> = PlayAuthoringBindings<TInput>;
4136
4152
  type SqlListenerOperation = PlaySqlListenerOperation;
4137
4153
  type SqlListenerDeclaration = PlaySqlListenerDeclaration;
4138
4154
  type SqlListenerEvent<T extends object = Record<string, unknown>> = PlaySqlListenerEvent<T>;
@@ -4491,14 +4507,16 @@ declare function runIf<Row, Value>(predicate: (row: Row, index: number) => boole
4491
4507
  * ```
4492
4508
  */
4493
4509
  type DefinedPlay<TInput, TOutput extends PlayReturnObject> = PlayAuthoringDefinedPlay<TInput, TOutput, DeeplinePlayRuntimeContext, DeeplineNamedPlay<TInput, TOutput>>;
4494
- type PlayMetadata = {
4510
+ type PlayHandlerInput<THandler> = THandler extends (context: DeeplinePlayRuntimeContext, input: infer TInput) => Promise<PlayReturnObject> ? TInput : never;
4511
+ type PlayHandlerOutput<THandler> = THandler extends (context: DeeplinePlayRuntimeContext, input: unknown) => Promise<infer TOutput extends PlayReturnObject> ? TOutput : never;
4512
+ type PlayMetadata<TInput = Record<string, unknown>> = {
4495
4513
  name: string;
4496
4514
  description?: string;
4497
- bindings?: PlayBindings;
4515
+ bindings?: PlayBindings<TInput>;
4498
4516
  inputSchema?: Record<string, unknown>;
4499
- billing?: PlayBindings['billing'];
4500
- runtime?: PlayBindings['runtime'];
4501
- compatibility?: PlayBindings['compatibility'];
4517
+ billing?: PlayBindings<TInput>['billing'];
4518
+ runtime?: PlayBindings<TInput>['runtime'];
4519
+ compatibility?: PlayBindings<TInput>['compatibility'];
4502
4520
  };
4503
4521
  /**
4504
4522
  * High-level SDK context with tool shortcuts and play handles.
@@ -4705,6 +4723,10 @@ declare function defineInput<TInput>(schema: Record<string, unknown>): PlayInput
4705
4723
  * ```
4706
4724
  */
4707
4725
  declare function definePlay<TInput, TOutput extends PlayReturnObject>(config: DefinePlayConfig<TInput, TOutput>): DefinedPlay<TInput, TOutput>;
4726
+ /** @internal Contextually type unannotated monitor-event handlers as unknown. */
4727
+ declare function definePlay<TOutput extends PlayReturnObject>(name: string, fn: (context: DeeplinePlayRuntimeContext, input: unknown) => Promise<TOutput>, bindings: PlayBindings<never> & {
4728
+ readonly sqlListeners: readonly SqlListenerDeclaration[];
4729
+ }): DefinedPlay<unknown, TOutput>;
4708
4730
  /**
4709
4731
  * Define a play with a name and function.
4710
4732
  *
@@ -4713,7 +4735,7 @@ declare function definePlay<TInput, TOutput extends PlayReturnObject>(config: De
4713
4735
  * @param bindings - Play configuration, including runtime limits and triggers.
4714
4736
  * @returns Play handle.
4715
4737
  */
4716
- declare function definePlay<TInput, TOutput extends PlayReturnObject>(name: string, fn: (ctx: DeeplinePlayRuntimeContext, input: TInput) => Promise<TOutput>, bindings?: PlayBindings): DefinedPlay<TInput, TOutput>;
4738
+ declare function definePlay<THandler extends (context: DeeplinePlayRuntimeContext, input: any) => Promise<PlayReturnObject>>(name: string, fn: THandler, bindings?: PlayBindings<NoInfer<PlayHandlerInput<THandler>>>): DefinedPlay<PlayHandlerInput<THandler>, PlayHandlerOutput<THandler>>;
4717
4739
  /**
4718
4740
  * Alias for {@link definePlay}. Workflows and plays share the same public
4719
4741
  * Deepline SDK contract; the selected execution profile decides whether the
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
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-B47AA7As.js';
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-B47AA7As.js';
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-IkyvsUO-.js';
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-IkyvsUO-.js';
4
4
  import '@sinclair/typebox';
5
5
 
6
6
  declare const FIXTURE_BEHAVIOR_VERSION: 1;
@@ -1193,6 +1193,20 @@ interface PlayDefinitionDetail {
1193
1193
  liveRevision?: PlayRevisionSummary | null;
1194
1194
  /** `true` if the working revision differs from the live revision. */
1195
1195
  isDraftDirty?: boolean;
1196
+ /** Live trigger state. This is operational state, not a source declaration. */
1197
+ triggerStatus?: PlayTriggerStatus;
1198
+ /**
1199
+ * Additive scheduler metadata for human/UI rendering. Values are absent for
1200
+ * plays with no cron binding and must never be inferred from source alone.
1201
+ */
1202
+ triggerMetadata?: {
1203
+ cronSchedule?: string | null;
1204
+ cronTimezone?: string | null;
1205
+ nextScheduledAt?: number | null;
1206
+ lastScheduledAt?: number | null;
1207
+ blockedReason?: string | null;
1208
+ [key: string]: unknown;
1209
+ } | null;
1196
1210
  /** Effective sandbox limit from the live revision, or the working draft before first publish. */
1197
1211
  runtimeLimit?: PlayRuntimeLimit | null;
1198
1212
  /** Present for a Play with a cron trigger. Advisory only; publish remains authoritative. */
@@ -1228,11 +1242,13 @@ interface PlayListItem {
1228
1242
  currentRevision?: PlayRevisionSummary | null;
1229
1243
  liveRevision?: PlayRevisionSummary | null;
1230
1244
  aliases?: string[];
1231
- triggerStatus?: {
1232
- cron: string | null;
1233
- webhook: string | null;
1234
- blockedReason: string | null;
1235
- };
1245
+ triggerStatus?: PlayTriggerStatus;
1246
+ }
1247
+ /** Additive live trigger state shared by list, get, and describe. */
1248
+ interface PlayTriggerStatus {
1249
+ cron: string | null;
1250
+ webhook: string | null;
1251
+ blockedReason: string | null;
1236
1252
  }
1237
1253
  interface ProductNotificationEventDefinition {
1238
1254
  id: string;
@@ -1314,11 +1330,9 @@ interface PlayDescription {
1314
1330
  */
1315
1331
  liveVersion?: number | null;
1316
1332
  /** Whether this play's cron and webhook triggers are armed. */
1317
- triggerStatus?: {
1318
- cron: string | null;
1319
- webhook: string | null;
1320
- blockedReason: string | null;
1321
- };
1333
+ triggerStatus?: PlayTriggerStatus;
1334
+ /** Additive cron timing metadata for an operational description. */
1335
+ triggerMetadata?: PlayDefinitionDetail['triggerMetadata'];
1322
1336
  isDraftDirty?: boolean;
1323
1337
  latestRunId?: string | null;
1324
1338
  /** Effective sandbox limit from the revision named runs use. */
@@ -1613,6 +1627,8 @@ interface PlayCheckTriggersSummary {
1613
1627
  cron?: {
1614
1628
  schedule: string;
1615
1629
  timezone?: string;
1630
+ /** Static input supplied to every run started by this cron binding. */
1631
+ input?: Record<string, unknown>;
1616
1632
  };
1617
1633
  webhook?: true;
1618
1634
  }
@@ -4132,7 +4148,7 @@ type PlayFetchResponse = PlayAuthoringFetchResponse;
4132
4148
  *
4133
4149
  * @sdkReference runtime 030
4134
4150
  */
4135
- type PlayBindings = PlayAuthoringBindings;
4151
+ type PlayBindings<TInput = Record<string, unknown>> = PlayAuthoringBindings<TInput>;
4136
4152
  type SqlListenerOperation = PlaySqlListenerOperation;
4137
4153
  type SqlListenerDeclaration = PlaySqlListenerDeclaration;
4138
4154
  type SqlListenerEvent<T extends object = Record<string, unknown>> = PlaySqlListenerEvent<T>;
@@ -4491,14 +4507,16 @@ declare function runIf<Row, Value>(predicate: (row: Row, index: number) => boole
4491
4507
  * ```
4492
4508
  */
4493
4509
  type DefinedPlay<TInput, TOutput extends PlayReturnObject> = PlayAuthoringDefinedPlay<TInput, TOutput, DeeplinePlayRuntimeContext, DeeplineNamedPlay<TInput, TOutput>>;
4494
- type PlayMetadata = {
4510
+ type PlayHandlerInput<THandler> = THandler extends (context: DeeplinePlayRuntimeContext, input: infer TInput) => Promise<PlayReturnObject> ? TInput : never;
4511
+ type PlayHandlerOutput<THandler> = THandler extends (context: DeeplinePlayRuntimeContext, input: unknown) => Promise<infer TOutput extends PlayReturnObject> ? TOutput : never;
4512
+ type PlayMetadata<TInput = Record<string, unknown>> = {
4495
4513
  name: string;
4496
4514
  description?: string;
4497
- bindings?: PlayBindings;
4515
+ bindings?: PlayBindings<TInput>;
4498
4516
  inputSchema?: Record<string, unknown>;
4499
- billing?: PlayBindings['billing'];
4500
- runtime?: PlayBindings['runtime'];
4501
- compatibility?: PlayBindings['compatibility'];
4517
+ billing?: PlayBindings<TInput>['billing'];
4518
+ runtime?: PlayBindings<TInput>['runtime'];
4519
+ compatibility?: PlayBindings<TInput>['compatibility'];
4502
4520
  };
4503
4521
  /**
4504
4522
  * High-level SDK context with tool shortcuts and play handles.
@@ -4705,6 +4723,10 @@ declare function defineInput<TInput>(schema: Record<string, unknown>): PlayInput
4705
4723
  * ```
4706
4724
  */
4707
4725
  declare function definePlay<TInput, TOutput extends PlayReturnObject>(config: DefinePlayConfig<TInput, TOutput>): DefinedPlay<TInput, TOutput>;
4726
+ /** @internal Contextually type unannotated monitor-event handlers as unknown. */
4727
+ declare function definePlay<TOutput extends PlayReturnObject>(name: string, fn: (context: DeeplinePlayRuntimeContext, input: unknown) => Promise<TOutput>, bindings: PlayBindings<never> & {
4728
+ readonly sqlListeners: readonly SqlListenerDeclaration[];
4729
+ }): DefinedPlay<unknown, TOutput>;
4708
4730
  /**
4709
4731
  * Define a play with a name and function.
4710
4732
  *
@@ -4713,7 +4735,7 @@ declare function definePlay<TInput, TOutput extends PlayReturnObject>(config: De
4713
4735
  * @param bindings - Play configuration, including runtime limits and triggers.
4714
4736
  * @returns Play handle.
4715
4737
  */
4716
- declare function definePlay<TInput, TOutput extends PlayReturnObject>(name: string, fn: (ctx: DeeplinePlayRuntimeContext, input: TInput) => Promise<TOutput>, bindings?: PlayBindings): DefinedPlay<TInput, TOutput>;
4738
+ declare function definePlay<THandler extends (context: DeeplinePlayRuntimeContext, input: any) => Promise<PlayReturnObject>>(name: string, fn: THandler, bindings?: PlayBindings<NoInfer<PlayHandlerInput<THandler>>>): DefinedPlay<PlayHandlerInput<THandler>, PlayHandlerOutput<THandler>>;
4717
4739
  /**
4718
4740
  * Alias for {@link definePlay}. Workflows and plays share the same public
4719
4741
  * Deepline SDK contract; the selected execution profile decides whether the
package/dist/index.js CHANGED
@@ -826,7 +826,7 @@ var SDK_RELEASE = {
826
826
  // available at toolResponse.rawV2 while toolResponse.raw and all declared
827
827
  // getters keep their established compatibility behavior.
828
828
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
829
- version: "0.3.59",
829
+ version: "0.3.60",
830
830
  updateSummary: "Automatic CLI updates are now enabled by default. To opt out, run `deepline settings autoupdate off`; use `deepline settings autoupdate on` to re-enable updates or `deepline settings autoupdate pin <version>` to hold an exact release. This release also adds raw-v2 tool responses at toolResponse.rawV2 while preserving existing toolResponse.raw and declared getters.",
831
831
  packageCapabilities: {
832
832
  updatePreferences: 1
@@ -4596,6 +4596,7 @@ var DeeplineClient = class {
4596
4596
  ...this.summarizePlayListItem(play, options),
4597
4597
  currentPublishedVersion: play.currentPublishedVersion ?? play.liveRevision?.version ?? null,
4598
4598
  latestRunId: play.latestRunId ?? detail.latestRuns[0]?.workflowId ?? null,
4599
+ ...play.triggerMetadata ? { triggerMetadata: play.triggerMetadata } : {},
4599
4600
  ...play.runtimeLimit ? { runtimeLimit: play.runtimeLimit } : {},
4600
4601
  ...play.activeScheduledPlays ? { activeScheduledPlays: play.activeScheduledPlays } : {}
4601
4602
  };
@@ -8395,6 +8396,39 @@ var PLAY_SQL_LISTENER_TOOL_PATTERN = /^[a-zA-Z][a-zA-Z0-9_-]*\.[a-zA-Z][a-zA-Z0-
8395
8396
  var PLAY_SQL_LISTENER_WHERE_OPERATOR_SET = new Set(
8396
8397
  PLAY_SQL_LISTENER_WHERE_OPERATORS
8397
8398
  );
8399
+ var PLAY_AUTHORING_BINDING_FIELDS = {
8400
+ root: [
8401
+ "billing",
8402
+ "compatibility",
8403
+ "cron",
8404
+ "inline",
8405
+ "runtime",
8406
+ "secrets",
8407
+ "sqlListeners",
8408
+ "webhook"
8409
+ ],
8410
+ cron: ["schedule", "timezone", "input"],
8411
+ webhook: ["auth", "hmac"],
8412
+ sqlListener: [
8413
+ "id",
8414
+ "tool",
8415
+ "stream",
8416
+ "where",
8417
+ "table",
8418
+ "monitor",
8419
+ "output",
8420
+ "operations"
8421
+ ]
8422
+ };
8423
+ var PLAY_AUTHORING_DEFINE_PLAY_OPTION_FIELDS = [
8424
+ "id",
8425
+ "name",
8426
+ "description",
8427
+ "input",
8428
+ "run",
8429
+ "bindings",
8430
+ ...PLAY_AUTHORING_BINDING_FIELDS.root
8431
+ ];
8398
8432
  var CtxFetchHttpError = class extends Error {
8399
8433
  /** Build the error from the durable response record. */
8400
8434
  constructor(response) {
@@ -8694,6 +8728,22 @@ var PLAY_AUTHORING_FIELD_REGISTRY = {
8694
8728
  description: "IANA timezone. Omitted means UTC.",
8695
8729
  errorMessage: "bindings.cron.timezone must be a valid non-empty IANA timezone string."
8696
8730
  },
8731
+ "bindings.cron.input": {
8732
+ schema: import_typebox.Type.Object({}, { additionalProperties: true }),
8733
+ fixtures: {
8734
+ valid: { apply: true },
8735
+ invalid: ["apply"],
8736
+ absent: void 0,
8737
+ unresolved: ["cronInput"],
8738
+ edition1: void 0
8739
+ },
8740
+ referenceType: "Record<string, unknown>",
8741
+ required: false,
8742
+ resolution: "static-required",
8743
+ issueCode: "play_authoring_binding_invalid",
8744
+ description: "Static JSON object passed to every run created by this cron binding.",
8745
+ errorMessage: "bindings.cron.input must be a static JSON object (no variables, spreads, or functions)."
8746
+ },
8697
8747
  "bindings.sqlListeners": {
8698
8748
  schema: import_typebox.Type.Array(import_typebox.Type.Object({}, { additionalProperties: true })),
8699
8749
  fixtures: {
@@ -9697,14 +9747,15 @@ var PLAY_AUTHORING_CLOUD_TYPE_DECLARATIONS = [
9697
9747
  " readonly timeoutMs?: PlayRuntimeTimeoutMs;",
9698
9748
  " readonly receiptWaitMs?: PlayReceiptWaitMs;",
9699
9749
  "};",
9700
- "export type PlayBindings = {",
9750
+ "export type PlayCronInput<TInput> = TInput extends readonly unknown[] ? never : TInput extends object ? TInput : never;",
9751
+ "export type PlayBindings<TInput = Record<string, unknown>> = {",
9701
9752
  ` description?: ${cloudReferenceType("description")};`,
9702
9753
  ` compatibility?: { toolErrorSchemaVersion?: ${cloudReferenceType("compatibility.toolErrorSchemaVersion")}; toolResponseReceiptRevision?: ${cloudReferenceType("compatibility.toolResponseReceiptRevision")} };`,
9703
9754
  ` inline?: ${cloudReferenceType("inline")};`,
9704
9755
  ` billing?: { maxCreditsPerRun?: ${cloudReferenceType("billing.maxCreditsPerRun")} };`,
9705
9756
  ` runtime?: { timeout?: ${cloudReferenceType("runtime.timeout")}; size?: ${cloudReferenceType("runtime.size")} };`,
9706
9757
  ` webhook?: { hmac?: { algorithm?: ${cloudReferenceType("bindings.webhook.hmac.algorithm")}; header?: ${cloudReferenceType("bindings.webhook.hmac.header")}; secretEnv: ${cloudReferenceType("bindings.webhook.hmac.secretEnv")} }; auth?: { type: ${cloudReferenceType("bindings.webhook.auth.type")}; headerFamily: ${cloudReferenceType("bindings.webhook.auth.headerFamily")}; signingSecrets: readonly ${cloudReferenceType("bindings.webhook.auth.signingSecrets[]")}[]; toleranceSeconds?: ${cloudReferenceType("bindings.webhook.auth.toleranceSeconds")} } };`,
9707
- ` cron?: { schedule: ${cloudReferenceType("bindings.cron.schedule")}; timezone?: ${cloudReferenceType("bindings.cron.timezone")} };`,
9758
+ ` cron?: { schedule: ${cloudReferenceType("bindings.cron.schedule")}; timezone?: ${cloudReferenceType("bindings.cron.timezone")}; input?: PlayCronInput<TInput> };`,
9708
9759
  " sqlListeners?: readonly SqlListenerDeclaration[];",
9709
9760
  ` secrets?: readonly ${cloudReferenceType("bindings.secrets[]")}[];`,
9710
9761
  "};",
@@ -9770,8 +9821,10 @@ var PLAY_AUTHORING_CLOUD_TYPE_DECLARATIONS = [
9770
9821
  " log(message: string): void;",
9771
9822
  ` sleep(ms: ${cloudReferenceType("ctx.sleep.ms")}): Promise<void>;`,
9772
9823
  "}",
9773
- "export type DefinePlayConfig<TInput, TOutput extends PlayReturnObject> = { id: string; description?: string; input: PlayInputContract<TInput>; run: (ctx: DeeplinePlayRuntimeContext, input: TInput) => Promise<TOutput>; bindings?: PlayBindings; billing?: PlayBindings['billing']; runtime?: PlayBindings['runtime']; compatibility?: PlayBindings['compatibility'] };",
9774
- "export type DefinedPlay<TInput, TOutput extends PlayReturnObject> = ((ctx: DeeplinePlayRuntimeContext, input: TInput) => Promise<TOutput>) & { readonly name: string; readonly __inputType?: TInput; readonly __outputType?: TOutput; readonly runtime?: PlayBindings['runtime']; readonly compatibility?: PlayBindings['compatibility'] };"
9824
+ "export type DefinePlayConfig<TInput, TOutput extends PlayReturnObject> = { id: string; description?: string; input: PlayInputContract<TInput>; run: (ctx: DeeplinePlayRuntimeContext, input: TInput) => Promise<TOutput>; bindings?: PlayBindings<TInput>; billing?: PlayBindings<TInput>['billing']; runtime?: PlayBindings<TInput>['runtime']; compatibility?: PlayBindings<TInput>['compatibility'] };",
9825
+ "export type DefinedPlay<TInput, TOutput extends PlayReturnObject> = ((ctx: DeeplinePlayRuntimeContext, input: TInput) => Promise<TOutput>) & { readonly name: string; readonly __inputType?: TInput; readonly __outputType?: TOutput; readonly bindings?: PlayBindings<TInput>; readonly runtime?: PlayBindings<TInput>['runtime']; readonly compatibility?: PlayBindings<TInput>['compatibility'] };",
9826
+ "export type PlayHandlerInput<THandler> = THandler extends (context: DeeplinePlayRuntimeContext, input: infer TInput) => Promise<PlayReturnObject> ? TInput : never;",
9827
+ "export type PlayHandlerOutput<THandler> = THandler extends (context: DeeplinePlayRuntimeContext, input: unknown) => Promise<infer TOutput extends PlayReturnObject> ? TOutput : never;"
9775
9828
  ];
9776
9829
 
9777
9830
  // ../play-runtime/query-result-dataset.ts