deepline 0.3.222 → 0.3.223

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.
@@ -200,7 +200,7 @@ export const SDK_RELEASE = {
200
200
  // getters keep their established compatibility behavior.
201
201
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
202
202
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
203
- version: '0.3.222',
203
+ version: '0.3.223',
204
204
  updateSummary:
205
205
  'Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.',
206
206
  packageCapabilities: {
@@ -1721,6 +1721,14 @@ function toolAttemptOutcomeForResult(
1721
1721
  return record.status === 'no_result' ? 'no_result' : 'completed';
1722
1722
  }
1723
1723
 
1724
+ function isControlledPlaySuspension(error: unknown): boolean {
1725
+ return (
1726
+ isPlayExecutionSuspendedError(error) ||
1727
+ isPlayRowExecutionSuspendedError(error) ||
1728
+ error instanceof PlayRowProviderBackpressureError
1729
+ );
1730
+ }
1731
+
1724
1732
  /**
1725
1733
  * Explicit execution location for a queued row-scoped tool call (ADR 0018).
1726
1734
  * `toolIdOverride` lets a native batch report the batch operation it actually
@@ -3614,6 +3622,9 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
3614
3622
  });
3615
3623
  };
3616
3624
  const fail = (error: unknown): void => {
3625
+ // Durable waits unwind the authored node so the scheduler can resume it.
3626
+ // Keep its started observation; the resumed invocation will settle it.
3627
+ if (isControlledPlaySuspension(error)) return;
3617
3628
  const errorPreview = buildPlayDocflowNodeErrorPreview(
3618
3629
  error,
3619
3630
  this.secretRedactor,
@@ -13476,7 +13487,13 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
13476
13487
  }
13477
13488
  return this.materializeToolExecutionResult(wrapped);
13478
13489
  } catch (error) {
13479
- settleDirectCall('failed', error);
13490
+ if (isControlledPlaySuspension(error)) {
13491
+ // A durable pause is not a terminal tool failure. Leave the start
13492
+ // event open so the resumed attempt can settle the same node.
13493
+ directSettled = true;
13494
+ } else {
13495
+ settleDirectCall('failed', error);
13496
+ }
13480
13497
  throw error;
13481
13498
  } finally {
13482
13499
  settleDirectCall('failed');
@@ -13541,8 +13558,14 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
13541
13558
  };
13542
13559
  const settleProducerAttempt = (
13543
13560
  outcome: PlayCellProducerAttempt['outcome'],
13561
+ waiting = false,
13544
13562
  ) => {
13545
13563
  producerAttempt.outcome = outcome;
13564
+ if (waiting) {
13565
+ producerAttempt.waiting = true;
13566
+ } else {
13567
+ delete producerAttempt.waiting;
13568
+ }
13546
13569
  producerAttempt.durationMs = Date.now() - producerAttemptStartedAt;
13547
13570
  };
13548
13571
  // Everything the resolver did since its previous result landed — user
@@ -13666,7 +13689,8 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
13666
13689
  observeLogicalCallWall();
13667
13690
  observeResultDelivery();
13668
13691
  this.openRowResolverGap(resolverGap);
13669
- settleProducerAttempt('failed');
13692
+ const waiting = isControlledPlaySuspension(error);
13693
+ settleProducerAttempt(waiting ? 'running' : 'failed', waiting);
13670
13694
  throw error;
13671
13695
  },
13672
13696
  );
@@ -398,7 +398,10 @@ export type RuntimeDatasetRunOptions<TItem = Record<string, unknown>> = Pick<
398
398
  'description' | 'key' | 'onRowError' | 'mode' | 'undrawnColumns'
399
399
  >;
400
400
 
401
- export type ToolCallOptions = PlayToolCallOptions;
401
+ /** Runtime-only receipt recovery bit; never part of the customer authoring API. */
402
+ export type ToolCallOptions = PlayToolCallOptions & {
403
+ forceFailedRefresh?: boolean;
404
+ };
402
405
  export type ToolExecutionRequest = PlayToolExecutionRequest;
403
406
 
404
407
  export type PlayCallOptions = Omit<
@@ -1491,6 +1494,8 @@ export interface PlayCellProducerAttempt {
1491
1494
  /** Attempt start, epoch ms. */
1492
1495
  at: number;
1493
1496
  outcome: 'running' | 'completed' | 'no_result' | 'failed' | 'cached';
1497
+ /** True when the in-flight call yielded to a durable runtime wait. */
1498
+ waiting?: boolean;
1494
1499
  durationMs?: number | null;
1495
1500
  }
1496
1501
 
@@ -25,7 +25,8 @@ export type SlackChannelKey =
25
25
  | 'python_cli_session'
26
26
  | 'monitor_activity'
27
27
  | 'monitor_error_activity'
28
- | 'plain_thread_activity';
28
+ | 'plain_thread_activity'
29
+ | 'inbound_leads';
29
30
 
30
31
  export type SlackPayloadEnricher = (
31
32
  payload: SlackPayload,
@@ -57,6 +58,10 @@ const CHANNEL_WEBHOOK_ENV: Partial<Record<SlackChannelKey, string>> = {
57
58
  monitor_activity: 'SLACK_MONITOR_ACTIVITY_WEBHOOK_URL',
58
59
  monitor_error_activity: 'SLACK_MONITOR_ERROR_ACTIVITY_WEBHOOK_URL',
59
60
  plain_thread_activity: 'SLACK_PLAIN_THREAD_ACTIVITY_WEBHOOK_URL',
61
+ // Inbound demo requests are delivered by the shared reporting bot (see
62
+ // resolveBotChannel). This webhook is only a fallback for a deployment that
63
+ // has no bot token.
64
+ inbound_leads: 'SLACK_INBOUND_LEADS_WEBHOOK_URL',
60
65
  };
61
66
 
62
67
  const CHANNEL_WEBHOOK_FALLBACK_ENVS: Partial<
@@ -70,6 +75,9 @@ const SLACK_DEEPLINE_REPORTING_BOT_TOKEN_ENV =
70
75
  const SLACK_PROVIDER_ALERTS_CHANNEL_ID_ENV = 'SLACK_PROVIDER_ALERTS_CHANNEL_ID';
71
76
  const SLACK_ERROR_ACTIVITY_CHANNEL_ID_ENV = 'SLACK_ERROR_ACTIVITY_CHANNEL_ID';
72
77
  const SLACK_USER_SIGNUP_CHANNEL_ID_ENV = 'SLACK_USER_SIGNUP_CHANNEL_ID';
78
+ const SLACK_INBOUND_LEADS_CHANNEL_ID_ENV = 'SLACK_INBOUND_LEADS_CHANNEL_ID';
79
+ // #alerts-gtm. Inbound demo requests go where GTM already watches for leads.
80
+ const DEFAULT_INBOUND_LEADS_CHANNEL_ID = 'C07KT4HB24U';
73
81
  const SLACK_MONITOR_ACTIVITY_CHANNEL_ID_ENV =
74
82
  'SLACK_MONITOR_ACTIVITY_CHANNEL_ID';
75
83
  const SLACK_MONITOR_ERROR_ACTIVITY_CHANNEL_ID_ENV =
@@ -117,6 +125,7 @@ const CHANNEL_ALERT_LEVEL: Record<
117
125
  monitor_activity: 'info',
118
126
  monitor_error_activity: 'error',
119
127
  plain_thread_activity: 'info',
128
+ inbound_leads: 'info',
120
129
  };
121
130
 
122
131
  function normalizeText(value: unknown): string {
@@ -135,6 +144,8 @@ function getSlackChannelEnvironmentRequirement(
135
144
  case 'user_signup':
136
145
  case 'sdk_cli_activity':
137
146
  case 'sdk_cli_errors':
147
+ // Preview and local deploys must never page GTM with test submissions.
148
+ case 'inbound_leads':
138
149
  return 'prod';
139
150
  case 'session_activity':
140
151
  case 'error_activity':
@@ -242,6 +253,13 @@ function resolveBotChannel(
242
253
  process.env[SLACK_MONITOR_ERROR_ACTIVITY_CHANNEL_ID_ENV]?.trim() ||
243
254
  DEFAULT_MONITOR_ERROR_ACTIVITY_CHANNEL_ID,
244
255
  };
256
+ case 'inbound_leads':
257
+ return {
258
+ token,
259
+ channelId:
260
+ process.env[SLACK_INBOUND_LEADS_CHANNEL_ID_ENV]?.trim() ||
261
+ DEFAULT_INBOUND_LEADS_CHANNEL_ID,
262
+ };
245
263
  case 'sdk_cli_activity':
246
264
  return { token, channelId: SDK_CLI_ACTIVITY_SLACK_CHANNEL_ID };
247
265
  case 'sdk_cli_errors':
package/dist/cli/index.js CHANGED
@@ -3051,7 +3051,7 @@ var SDK_RELEASE = {
3051
3051
  // getters keep their established compatibility behavior.
3052
3052
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
3053
3053
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
3054
- version: "0.3.222",
3054
+ version: "0.3.223",
3055
3055
  updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.",
3056
3056
  packageCapabilities: {
3057
3057
  updatePreferences: 1
@@ -3046,7 +3046,7 @@ var SDK_RELEASE = {
3046
3046
  // getters keep their established compatibility behavior.
3047
3047
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
3048
3048
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
3049
- version: "0.3.222",
3049
+ version: "0.3.223",
3050
3050
  updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.",
3051
3051
  packageCapabilities: {
3052
3052
  updatePreferences: 1
package/dist/index.js CHANGED
@@ -864,7 +864,7 @@ var SDK_RELEASE = {
864
864
  // getters keep their established compatibility behavior.
865
865
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
866
866
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
867
- version: "0.3.222",
867
+ version: "0.3.223",
868
868
  updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.",
869
869
  packageCapabilities: {
870
870
  updatePreferences: 1
package/dist/index.mjs CHANGED
@@ -768,7 +768,7 @@ var SDK_RELEASE = {
768
768
  // getters keep their established compatibility behavior.
769
769
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
770
770
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
771
- version: "0.3.222",
771
+ version: "0.3.223",
772
772
  updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.",
773
773
  packageCapabilities: {
774
774
  updatePreferences: 1
@@ -149,7 +149,7 @@ type SdkRelease = {
149
149
  supportPolicy: SdkSupportPolicy;
150
150
  };
151
151
  declare const SDK_RELEASE: {
152
- readonly version: "0.3.222";
152
+ readonly version: "0.3.223";
153
153
  readonly updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.";
154
154
  readonly packageCapabilities: {
155
155
  readonly updatePreferences: 1;
package/dist/release.d.ts CHANGED
@@ -149,7 +149,7 @@ type SdkRelease = {
149
149
  supportPolicy: SdkSupportPolicy;
150
150
  };
151
151
  declare const SDK_RELEASE: {
152
- readonly version: "0.3.222";
152
+ readonly version: "0.3.223";
153
153
  readonly updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.";
154
154
  readonly packageCapabilities: {
155
155
  readonly updatePreferences: 1;
package/dist/release.js CHANGED
@@ -74,7 +74,7 @@ var SDK_RELEASE = {
74
74
  // getters keep their established compatibility behavior.
75
75
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
76
76
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
77
- version: "0.3.222",
77
+ version: "0.3.223",
78
78
  updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.",
79
79
  packageCapabilities: {
80
80
  updatePreferences: 1
package/dist/release.mjs CHANGED
@@ -48,7 +48,7 @@ var SDK_RELEASE = {
48
48
  // getters keep their established compatibility behavior.
49
49
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
50
50
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
51
- version: "0.3.222",
51
+ version: "0.3.223",
52
52
  updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.",
53
53
  packageCapabilities: {
54
54
  updatePreferences: 1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepline",
3
- "version": "0.3.222",
3
+ "version": "0.3.223",
4
4
  "description": "GTM data CLI and TypeScript SDK for coding agents",
5
5
  "license": "MIT",
6
6
  "homepage": "https://code.deepline.com",