deepline 0.3.239 → 0.3.241

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.
@@ -1806,6 +1806,15 @@ export type TargetBillingStatusResult = {
1806
1806
  payment_state: string;
1807
1807
  recharge_state: string;
1808
1808
  billing_email?: string | null;
1809
+ /** Omitted when unavailable; null when no address has been saved. */
1810
+ billing_address?: {
1811
+ line1: string | null;
1812
+ line2: string | null;
1813
+ city: string | null;
1814
+ state: string | null;
1815
+ postal_code: string | null;
1816
+ country: string | null;
1817
+ } | null;
1809
1818
  collection_method?: 'charge_automatically' | 'send_invoice';
1810
1819
  payment_access_policy?: 'payment_required' | 'net_30' | 'net_60';
1811
1820
  plan_invoice?: {
@@ -2163,7 +2172,9 @@ export type BillingNamespace = {
2163
2172
  options: TargetBillingPlanTransitionOptions,
2164
2173
  ) => Promise<TargetBillingMutationResult>;
2165
2174
  /** Create a Stripe-hosted billing Portal session. */
2166
- portalSession: () => Promise<{ url: string }>;
2175
+ portalSession: (options?: {
2176
+ flow?: 'customer_update';
2177
+ }) => Promise<{ url: string }>;
2167
2178
  };
2168
2179
 
2169
2180
  function requireTargetBillingIdempotencyKey(value: string): string {
@@ -2713,7 +2724,8 @@ export class DeeplineClient {
2713
2724
  recoverCreditPurchase: (options) =>
2714
2725
  this.recoverTargetBillingCreditPurchase(options),
2715
2726
  transitionPlan: (options) => this.transitionTargetBillingPlan(options),
2716
- portalSession: () => this.createTargetBillingPortalSession(),
2727
+ portalSession: (options) =>
2728
+ this.createTargetBillingPortalSession(options),
2717
2729
  };
2718
2730
  this.workspaces = {
2719
2731
  create: (options) => this.createWorkspace(options),
@@ -6154,11 +6166,18 @@ export class DeeplineClient {
6154
6166
  }
6155
6167
 
6156
6168
  /** Create a Stripe-hosted portal session for payment recovery and invoices. */
6157
- async createTargetBillingPortalSession(): Promise<{ url: string }> {
6169
+ async createTargetBillingPortalSession(options?: {
6170
+ flow?: 'customer_update';
6171
+ }): Promise<{ url: string }> {
6158
6172
  const response = await this.http.post<{
6159
6173
  data: { url: string };
6160
6174
  request_id?: string;
6161
- }>('/api/v2/billing/portal-sessions', {});
6175
+ }>(
6176
+ options?.flow === 'customer_update'
6177
+ ? '/api/v2/billing/portal-sessions?flow=customer_update'
6178
+ : '/api/v2/billing/portal-sessions',
6179
+ {},
6180
+ );
6162
6181
  return response.data;
6163
6182
  }
6164
6183
 
@@ -395,6 +395,11 @@ export class HttpClient {
395
395
  let fetchAttempts = 0;
396
396
  let lastRequestUrl = url;
397
397
  let networkFailedAt: number | undefined;
398
+ let networkPhase:
399
+ | 'before_request'
400
+ | 'retry_wait'
401
+ | 'awaiting_headers'
402
+ | 'reading_body' = 'before_request';
398
403
 
399
404
  const headers = this.authHeaders(options?.headers);
400
405
 
@@ -423,6 +428,7 @@ export class HttpClient {
423
428
  ? backoffMs
424
429
  : Math.max(backoffMs, retryAfterDelayMs);
425
430
  retryAfterDelayMs = null;
431
+ networkPhase = 'retry_wait';
426
432
  try {
427
433
  await sleep(delayMs, options?.signal);
428
434
  } catch (error) {
@@ -450,6 +456,7 @@ export class HttpClient {
450
456
  once: true,
451
457
  });
452
458
 
459
+ networkPhase = 'before_request';
453
460
  try {
454
461
  const requestBody =
455
462
  options?.formData !== undefined
@@ -461,6 +468,7 @@ export class HttpClient {
461
468
  : undefined;
462
469
  fetchAttempts += 1;
463
470
  lastRequestUrl = candidateUrl;
471
+ networkPhase = 'awaiting_headers';
464
472
  const response = await fetch(candidateUrl, {
465
473
  method,
466
474
  headers,
@@ -468,6 +476,7 @@ export class HttpClient {
468
476
  signal: controller.signal,
469
477
  });
470
478
 
479
+ networkPhase = 'reading_body';
471
480
  options?.onResponse?.(response);
472
481
  if (response.status === 404 && options?.allowNotFound) {
473
482
  clearTimeout(timeoutId);
@@ -671,6 +680,7 @@ export class HttpClient {
671
680
  // Elapsed time covers the entire logical request, including retries.
672
681
  elapsedMs: Math.max(0, failedAt - requestStartedAt),
673
682
  attempts: fetchAttempts,
683
+ phase: networkPhase,
674
684
  },
675
685
  };
676
686
  if (options?.toolId) {
@@ -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.239',
203
+ version: '0.3.241',
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: {
@@ -1,3 +1,4 @@
1
+ import { OPENSOSDATA_LOOKUP_CLIENT_TIMEOUT_MS } from '../../shared_libs/integration-contracts/opensosdata/execution-policy.js';
1
2
  import type { ToolResultBilling } from '../../shared_libs/plays/tool-result-types.js';
2
3
  import { resolveTheirstackClientTimeoutMs } from '../../shared_libs/integration-contracts/theirstack/execution-policy.js';
3
4
  import { resolveWaterfallClientTimeoutMs } from '../../shared_libs/integration-contracts/waterfall/execution-policy.js';
@@ -172,6 +173,9 @@ function resolveToolExecuteTimeoutMs(
172
173
  input: Record<string, unknown>,
173
174
  ): number | undefined {
174
175
  const normalized = toolId.trim().toLowerCase();
176
+ if (normalized === 'opensosdata_business_lookup') {
177
+ return OPENSOSDATA_LOOKUP_CLIENT_TIMEOUT_MS;
178
+ }
175
179
  if (normalized === 'apify_run_actor_sync') {
176
180
  const requestedTimeoutMs = input.timeoutMs ?? APIFY_SYNC_DEFAULT_TIMEOUT_MS;
177
181
  if (
@@ -228,6 +228,8 @@ export interface ToolDefinition extends ToolExecutionMetadataFields {
228
228
  outputSchema?: Record<string, unknown>;
229
229
  /** User-facing pricing summary. Internal provider/settlement costs are intentionally omitted. */
230
230
  pricing?: ToolPricingSummary | null;
231
+ /** How to use the tool well: the provider's summary and the tool's own notes. */
232
+ guidance?: { provider?: string; tool?: string };
231
233
  /** Copyable play-runtime guidance for V2 tool execution results. */
232
234
  usageGuidance?: {
233
235
  execute?: string;
@@ -0,0 +1,18 @@
1
+ /** OpenSOSData's single-entity lookup can complete synchronously or poll a 202 job. */
2
+ export const OPENSOSDATA_LOOKUP_REQUEST_TIMEOUT_MS = 120_000;
3
+ export const OPENSOSDATA_POLL_INTERVAL_MS = 3_000;
4
+ export const OPENSOSDATA_POLL_TIMEOUT_MS = 90_000;
5
+
6
+ /**
7
+ * Preserve the provider's existing request and polling windows. A final poll
8
+ * can begin just before the poll window ends, so include that in-flight request
9
+ * as well as route/admission and response overhead. Explicit caller deadlines
10
+ * still take precedence; unrelated tools retain their existing budgets.
11
+ */
12
+ export const OPENSOSDATA_LOOKUP_CLIENT_TIMEOUT_MS =
13
+ 60_000 +
14
+ OPENSOSDATA_LOOKUP_REQUEST_TIMEOUT_MS +
15
+ OPENSOSDATA_POLL_TIMEOUT_MS +
16
+ OPENSOSDATA_POLL_INTERVAL_MS +
17
+ OPENSOSDATA_LOOKUP_REQUEST_TIMEOUT_MS +
18
+ 15_000;
@@ -187,8 +187,16 @@ export const RUNTIME_TOPOLOGY = {
187
187
  dockerfile: 'deploy/fly/runtime-worker/Dockerfile.absurd-scaler',
188
188
  },
189
189
  processGroups: {
190
- app: { desiredStarted: 1, healthCheck: 'scaler_ready' },
191
- projector: { desiredStarted: 2, healthCheck: 'projector_ready' },
190
+ app: {
191
+ desiredStarted: 1,
192
+ healthCheck: 'scaler_ready',
193
+ guest: { cpu_kind: 'shared', cpus: 1, memory_mb: 256 },
194
+ },
195
+ projector: {
196
+ desiredStarted: 2,
197
+ healthCheck: 'projector_ready',
198
+ guest: { cpu_kind: 'shared', cpus: 1, memory_mb: 1024 },
199
+ },
192
200
  },
193
201
  },
194
202
  workerLogShipper: {