deepline 0.1.46 → 0.1.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -221,6 +221,22 @@ interface CustomerDbQueryResult {
221
221
  columns: CustomerDbColumn[];
222
222
  rows: unknown[];
223
223
  }
224
+ interface ToolPricingSummary {
225
+ /** User-facing pricing text for quick discovery displays. */
226
+ displayText: string | null;
227
+ /** User-facing unit the price applies to. */
228
+ unit: 'call' | 'result' | 'page' | 'usage' | null;
229
+ /** Deepline credits charged per unit, when statically knowable. */
230
+ creditsPerUnit: number | null;
231
+ /** USD equivalent charged per unit, when statically knowable. */
232
+ usdPerUnit: number | null;
233
+ /** Currency for `usdPerUnit`. */
234
+ currency: 'USD';
235
+ /** Short user-facing pricing summary for variable pricing. */
236
+ summary: string | null;
237
+ /** Additional user-facing pricing notes. */
238
+ details: string[];
239
+ }
224
240
  /**
225
241
  * Summary definition of a tool, returned by {@link DeeplineClient.listTools}.
226
242
  *
@@ -255,6 +271,8 @@ interface ToolDefinition {
255
271
  inputSchema?: Record<string, unknown>;
256
272
  /** JSON Schema describing the tool's output shape. */
257
273
  outputSchema?: Record<string, unknown>;
274
+ /** User-facing pricing summary. Internal provider/settlement costs are intentionally omitted. */
275
+ pricing?: ToolPricingSummary | null;
258
276
  /** Copyable play-runtime guidance for V2 tool execution results. */
259
277
  usageGuidance?: {
260
278
  execute?: string;
@@ -327,6 +345,10 @@ interface ToolSearchResult {
327
345
  search_mode?: 'v1' | 'v2';
328
346
  search_fallback_to_category?: boolean;
329
347
  omitted_plays_hint?: string;
348
+ commandTemplates?: {
349
+ describe?: string;
350
+ execute?: string;
351
+ };
330
352
  render?: {
331
353
  sections?: Array<{
332
354
  title: string;
@@ -357,11 +379,11 @@ interface ToolMetadata extends ToolDefinition {
357
379
  asyncGetAction?: string | null;
358
380
  /** Known failure scenarios and their expected handling. */
359
381
  failureMode?: Record<string, unknown> | null;
360
- /** Provider-side pricing structure. */
382
+ /** Sanitized pricing model for describe metadata. Provider internal prices are intentionally omitted. */
361
383
  cost?: Record<string, unknown> | null;
362
- /** How many Deepline credits map to one provider pricing unit. */
384
+ /** Deepline credits charged for one user-visible pricing unit. */
363
385
  deeplineCreditsPerPricingUnit?: number | null;
364
- /** Whether cost is billed by the provider or by Deepline. */
386
+ /** Whether the customer pays with Deepline credits or their own connected account. */
365
387
  billingSource?: string;
366
388
  /** Display label for the billing source. */
367
389
  billingSourceLabel?: string;
@@ -1511,7 +1533,7 @@ declare class DeeplineClient {
1511
1533
  }>;
1512
1534
  }
1513
1535
 
1514
- declare const SDK_VERSION = "0.1.46";
1536
+ declare const SDK_VERSION = "0.1.48";
1515
1537
  declare const SDK_API_CONTRACT = "2026-05-stripe-promo-checkout";
1516
1538
 
1517
1539
  /**
@@ -1829,6 +1851,7 @@ type ToolExecutionRequest = {
1829
1851
  tool: string;
1830
1852
  input: Record<string, unknown>;
1831
1853
  description?: string;
1854
+ staleAfterSeconds?: number;
1832
1855
  };
1833
1856
  type StepResolver<Row, Value> = (row: Row, ctx: DeeplinePlayRuntimeContext, index: number) => Value | Promise<Value>;
1834
1857
  type ConditionalStepResolver<Row, Value, Else = null> = {
@@ -1912,7 +1935,10 @@ type CsvOptions = {
1912
1935
  * const enriched = await ctx
1913
1936
  * .map('companies', [{ domain: 'a.com' }, { domain: 'b.com' }])
1914
1937
  * .step('company', (row, rowCtx) =>
1915
- * rowCtx.tool('company_search', 'test_company_search', { domain: row.domain }, {
1938
+ * rowCtx.tools.execute({
1939
+ * id: 'company_search',
1940
+ * tool: 'test_company_search',
1941
+ * input: { domain: row.domain },
1916
1942
  * description: 'Look up company details by domain.',
1917
1943
  * }))
1918
1944
  * .run({ description: 'Look up company details.' });
@@ -1973,30 +1999,30 @@ interface DeeplinePlayRuntimeContext {
1973
1999
  *
1974
2000
  * @example Single tool per row
1975
2001
  * ```typescript
1976
- * const results = await ctx
1977
- * .map('companies', leads)
1978
- * .step('company', (row, ctx) =>
1979
- * ctx.tools.execute({
1980
- * id: 'company_search',
1981
- * tool: 'test_company_search',
1982
- * input: { domain: row.domain },
1983
- * description: 'Look up company details by domain.',
1984
- * }))
2002
+ * const results = await ctx
2003
+ * .map('companies', leads)
2004
+ * .step('company', (row, ctx) =>
2005
+ * ctx.tools.execute({
2006
+ * id: 'company_search',
2007
+ * tool: 'test_company_search',
2008
+ * input: { domain: row.domain },
2009
+ * description: 'Look up company details by domain.',
2010
+ * }))
1985
2011
  * .run({ description: 'Look up companies.' });
1986
2012
  * // [{ domain: 'stripe.com', company: { name: 'Stripe', ... } }, ...]
1987
2013
  * ```
1988
2014
  *
1989
2015
  * @example Multiple columns with pre/post logic
1990
2016
  * ```typescript
1991
- * const results = await ctx
1992
- * .map('leads', leads)
1993
- * .step('company', (row, ctx) =>
1994
- * ctx.tools.execute({
1995
- * id: 'company_search',
1996
- * tool: 'test_company_search',
1997
- * input: { domain: row.domain },
1998
- * description: 'Look up company details by domain.',
1999
- * }))
2017
+ * const results = await ctx
2018
+ * .map('leads', leads)
2019
+ * .step('company', (row, ctx) =>
2020
+ * ctx.tools.execute({
2021
+ * id: 'company_search',
2022
+ * tool: 'test_company_search',
2023
+ * input: { domain: row.domain },
2024
+ * description: 'Look up company details by domain.',
2025
+ * }))
2000
2026
  * .step('score', (row) =>
2001
2027
  * row.company?.employeeCount > 100 ? 'enterprise' : 'smb')
2002
2028
  * .run({ description: 'Enrich leads.' });
@@ -2013,22 +2039,19 @@ interface DeeplinePlayRuntimeContext {
2013
2039
  * @param request.input - Tool-specific input parameters
2014
2040
  * @returns The tool's output
2015
2041
  */
2016
- execute<TOutput = LoosePlayObject>(request: ToolExecutionRequest): Promise<ToolExecuteResult<TOutput>>;
2042
+ execute<TOutput = LoosePlayObject>(request: ToolExecutionRequest & {
2043
+ staleAfterSeconds?: number;
2044
+ }): Promise<ToolExecuteResult<TOutput>>;
2017
2045
  };
2018
- /**
2019
- * Execute a single tool by stable step key and tool ID.
2020
- *
2021
- * Shorthand for `ctx.tools.execute(...)`; this is the preferred spelling in
2022
- * row-level step programs.
2023
- */
2024
- tool<TOutput = LoosePlayObject>(key: string, toolId: string, input: Record<string, unknown>, options?: {
2025
- description?: string;
2026
- }): Promise<ToolExecuteResult<TOutput>>;
2027
2046
  runSteps<TInput extends Record<string, unknown>, TOutput>(program: StepProgram<TInput, any, TOutput>, input: TInput, options?: {
2028
2047
  description?: string;
2029
2048
  }): Promise<TOutput>;
2030
- step<T>(id: string, run: () => T | Promise<T>): Promise<T>;
2031
- fetch(key: string, url: string | URL, init?: RequestInit): Promise<{
2049
+ step<T>(id: string, run: () => T | Promise<T>, options?: {
2050
+ staleAfterSeconds?: number;
2051
+ }): Promise<T>;
2052
+ fetch(key: string, url: string | URL, init?: RequestInit, options?: {
2053
+ staleAfterSeconds?: number;
2054
+ }): Promise<{
2032
2055
  ok: boolean;
2033
2056
  status: number;
2034
2057
  statusText: string;
@@ -2039,6 +2062,7 @@ interface DeeplinePlayRuntimeContext {
2039
2062
  }>;
2040
2063
  runPlay(key: string, playRef: string | PlayReferenceLike, input: Record<string, unknown>, options: {
2041
2064
  description?: string;
2065
+ staleAfterSeconds?: number;
2042
2066
  }): Promise<Record<string, unknown>>;
2043
2067
  /**
2044
2068
  * Emit a log line visible in `play tail` and the play's progress logs.
package/dist/index.js CHANGED
@@ -215,7 +215,7 @@ function resolveConfig(options) {
215
215
  }
216
216
 
217
217
  // src/version.ts
218
- var SDK_VERSION = "0.1.46";
218
+ var SDK_VERSION = "0.1.48";
219
219
  var SDK_API_CONTRACT = "2026-05-stripe-promo-checkout";
220
220
 
221
221
  // ../shared_libs/play-runtime/coordinator-headers.ts
@@ -2195,11 +2195,9 @@ var DeeplineContext = class {
2195
2195
  get: (toolId) => this.client.getTool(toolId),
2196
2196
  /** Execute a tool and return the standard execution envelope. */
2197
2197
  execute: async (toolId, input) => {
2198
- const response = await this.client.executeTool(
2199
- toolId,
2200
- input,
2201
- { includeToolMetadata: true }
2202
- );
2198
+ const response = await this.client.executeTool(toolId, input, {
2199
+ includeToolMetadata: true
2200
+ });
2203
2201
  return toolExecutionEnvelopeToResult(toolId, response);
2204
2202
  }
2205
2203
  };
@@ -2348,9 +2346,7 @@ function toolExecutionEnvelopeToResult(fallbackToolId, response) {
2348
2346
  metadata: {
2349
2347
  toolId: typeof toolMetadata.toolId === "string" ? toolMetadata.toolId : fallbackToolId,
2350
2348
  extractors: extractorDescriptorRecord(toolMetadata.extractors),
2351
- targetGetters: stringArrayRecord(
2352
- toolMetadata.targetGetters
2353
- ),
2349
+ targetGetters: stringArrayRecord(toolMetadata.targetGetters),
2354
2350
  listExtractorPaths: stringArray(toolMetadata.listExtractorPaths),
2355
2351
  listIdentityGetters: stringArrayRecord(toolMetadata.listIdentityGetters)
2356
2352
  },
package/dist/index.mjs CHANGED
@@ -169,7 +169,7 @@ function resolveConfig(options) {
169
169
  }
170
170
 
171
171
  // src/version.ts
172
- var SDK_VERSION = "0.1.46";
172
+ var SDK_VERSION = "0.1.48";
173
173
  var SDK_API_CONTRACT = "2026-05-stripe-promo-checkout";
174
174
 
175
175
  // ../shared_libs/play-runtime/coordinator-headers.ts
@@ -2149,11 +2149,9 @@ var DeeplineContext = class {
2149
2149
  get: (toolId) => this.client.getTool(toolId),
2150
2150
  /** Execute a tool and return the standard execution envelope. */
2151
2151
  execute: async (toolId, input) => {
2152
- const response = await this.client.executeTool(
2153
- toolId,
2154
- input,
2155
- { includeToolMetadata: true }
2156
- );
2152
+ const response = await this.client.executeTool(toolId, input, {
2153
+ includeToolMetadata: true
2154
+ });
2157
2155
  return toolExecutionEnvelopeToResult(toolId, response);
2158
2156
  }
2159
2157
  };
@@ -2302,9 +2300,7 @@ function toolExecutionEnvelopeToResult(fallbackToolId, response) {
2302
2300
  metadata: {
2303
2301
  toolId: typeof toolMetadata.toolId === "string" ? toolMetadata.toolId : fallbackToolId,
2304
2302
  extractors: extractorDescriptorRecord(toolMetadata.extractors),
2305
- targetGetters: stringArrayRecord(
2306
- toolMetadata.targetGetters
2307
- ),
2303
+ targetGetters: stringArrayRecord(toolMetadata.targetGetters),
2308
2304
  listExtractorPaths: stringArray(toolMetadata.listExtractorPaths),
2309
2305
  listIdentityGetters: stringArrayRecord(toolMetadata.listIdentityGetters)
2310
2306
  },