deepline 0.1.272 → 0.1.274

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/README.md CHANGED
@@ -113,7 +113,7 @@ surfaces we exercise in CI:
113
113
  - `client.runs.list({ play: name })`
114
114
  - `client.runs.tail(runId)`
115
115
  - `client.runs.stop(runId, { reason })`
116
- 3. High-level SDK handles
116
+ 3. Connected SDK context (outside a running play)
117
117
  - `ctx.play(name).run(...)`
118
118
  - `ctx.play(name).runSync(...)`
119
119
  - `ctx.runPlay(name, input)`
@@ -122,7 +122,9 @@ surfaces we exercise in CI:
122
122
  - `GET /api/v2/runs/:runId`
123
123
  - `GET /api/v2/runs/:runId/tail`
124
124
  5. In-play composition
125
- - `ctx.runPlay(...)`
125
+ - `ctx.runPlay(key, playRef, input, { description })`
126
+ - Org-owned `playRef` accepts a bare name, `self/<play>`, or the canonical
127
+ `<orgSlug>/<play>` returned by `plays get`.
126
128
 
127
129
  Internal / advanced only:
128
130
 
@@ -117,7 +117,7 @@ import type { ToolExecution } from './client.js';
117
117
  export type PlayCallExecution = 'inline' | 'child-workflow';
118
118
 
119
119
  export interface PlayCallOptions {
120
- description?: string;
120
+ description: string;
121
121
  execution?: PlayCallExecution;
122
122
  }
123
123
 
@@ -903,7 +903,7 @@ export interface DeeplinePlayRuntimeContext {
903
903
  key: string,
904
904
  playRef: string | PlayReferenceLike,
905
905
  input: Record<string, unknown>,
906
- options?: PlayCallOptions,
906
+ options: PlayCallOptions,
907
907
  ): Promise<TOutput>;
908
908
 
909
909
  /**
@@ -155,7 +155,7 @@ export const SDK_RELEASE = {
155
155
  // 0.1.253 makes play-page browser opening opt-in and retires --no-open.
156
156
  // 0.1.254 removes the internal operations tree from the published SDK CLI.
157
157
  // Operators use the checkout-local deepline-admin binary instead.
158
- version: '0.1.272',
158
+ version: '0.1.274',
159
159
  contracts: {
160
160
  api: {
161
161
  name: 'sdk-http-api',
@@ -6731,6 +6731,15 @@ export class PlayContextImpl {
6731
6731
  ): Promise<TOutput> {
6732
6732
  assertNoSecretTaint(input, 'ctx.runPlay input');
6733
6733
  const normalizedKey = this.normalizeContextKey(key, 'runPlay');
6734
+ if (
6735
+ arguments.length === 3 &&
6736
+ typeof playRef === 'object' &&
6737
+ playRef !== null
6738
+ ) {
6739
+ throw new Error(
6740
+ 'ctx.runPlay(...) signature is ctx.runPlay(key, playRef, input, { description }). Add a stable call key as the first argument.',
6741
+ );
6742
+ }
6734
6743
  const resolvedName =
6735
6744
  typeof playRef === 'string'
6736
6745
  ? playRef
package/dist/cli/index.js CHANGED
@@ -718,7 +718,7 @@ var SDK_RELEASE = {
718
718
  // 0.1.253 makes play-page browser opening opt-in and retires --no-open.
719
719
  // 0.1.254 removes the internal operations tree from the published SDK CLI.
720
720
  // Operators use the checkout-local deepline-admin binary instead.
721
- version: "0.1.272",
721
+ version: "0.1.274",
722
722
  contracts: {
723
723
  api: {
724
724
  name: "sdk-http-api",
@@ -27124,6 +27124,9 @@ function isPlayLikeTool(tool) {
27124
27124
  const toolId = typeof record.toolId === "string" ? record.toolId : "";
27125
27125
  return toolId.endsWith("_waterfall");
27126
27126
  }
27127
+ function isMonitorTypeTool(tool) {
27128
+ return stringField2(tool, "kind") === "monitor_type";
27129
+ }
27127
27130
  function playReferenceForTool(tool) {
27128
27131
  const record = tool;
27129
27132
  const declared = stringField2(record, "playReference", "play_reference");
@@ -27540,7 +27543,100 @@ function extractionContractEntries(entries) {
27540
27543
  return name && expression ? [{ name, expression }] : [];
27541
27544
  });
27542
27545
  }
27546
+ function printMonitorTypeFilters(tool) {
27547
+ const schema = recordField2(tool, "payload_schema", "payloadSchema");
27548
+ const properties = recordField2(schema, "properties");
27549
+ const required = new Set(
27550
+ arrayField2(schema, "required").filter(
27551
+ (v) => typeof v === "string"
27552
+ )
27553
+ );
27554
+ const names = Object.keys(properties);
27555
+ if (!names.length) {
27556
+ console.log("Deploy filters: none");
27557
+ return;
27558
+ }
27559
+ console.log("Deploy filters (set in the monitor payload):");
27560
+ for (const name of names) {
27561
+ const field = isRecord8(properties[name]) ? properties[name] : {};
27562
+ const star = required.has(name) ? "*" : "";
27563
+ const enumVals = arrayField2(field, "enum").filter(
27564
+ (v) => typeof v === "string"
27565
+ );
27566
+ const type = enumVals.length ? `one of [${enumVals.join(", ")}]` : stringField2(field, "type") || "string";
27567
+ const desc = stringField2(field, "description");
27568
+ console.log(`- ${name}${star}: ${type}${desc ? ` - ${desc}` : ""}`);
27569
+ }
27570
+ }
27571
+ function printMonitorTypeStreams(tool) {
27572
+ const streams = arrayField2(tool, "streams", "output_streams").filter(isRecord8);
27573
+ if (!streams.length) return;
27574
+ console.log("");
27575
+ console.log("Filter columns (a play's sqlListeners.where, per stream):");
27576
+ for (const stream of streams) {
27577
+ const name = stringField2(stream, "stream");
27578
+ const cols = arrayField2(stream, "columns").filter(isRecord8).map((col) => stringField2(col, "name")).filter(Boolean);
27579
+ console.log(`- ${name}: ${cols.join(", ")}`);
27580
+ }
27581
+ }
27582
+ function printMonitorTypePricing(tool) {
27583
+ const pricing = recordField2(tool, "pricing");
27584
+ const byType = recordField2(
27585
+ pricing,
27586
+ "pricing_by_radar_type",
27587
+ "pricingByRadarType"
27588
+ );
27589
+ const keys = Object.keys(byType);
27590
+ if (!keys.length) {
27591
+ console.log("Pricing: Deepline credits per accepted event (see --json)");
27592
+ return;
27593
+ }
27594
+ console.log("Pricing (Deepline credits per accepted event):");
27595
+ for (const key of keys) {
27596
+ const entry = isRecord8(byType[key]) ? byType[key] : {};
27597
+ const credits = numberField2(entry, "deepline_credits", "deeplineCredits");
27598
+ const display = stringField2(entry, "display");
27599
+ const shown = display || (credits !== null ? `${formatDecimal(credits)} credits/event` : "see --json");
27600
+ console.log(`- ${key}: ${shown}`);
27601
+ }
27602
+ }
27603
+ function printMonitorTypeDeploy(tool) {
27604
+ const deploy = recordField2(tool, "deploy");
27605
+ const toolId = stringField2(tool, "toolId");
27606
+ const example = stringField2(deploy, "example") || `deepline monitors deploy '{"key":"...","tool":"${toolId}","payload":{...}}'`;
27607
+ console.log("Deploy (a monitor type is deployed, not executed):");
27608
+ console.log(` ${example}`);
27609
+ }
27610
+ function printMonitorTypeContract(tool, requestedToolId) {
27611
+ const toolId = stringField2(tool, "toolId") || requestedToolId;
27612
+ console.log(toolId);
27613
+ const displayName = stringField2(tool, "displayName");
27614
+ if (displayName) console.log(`Best for: ${displayName}`);
27615
+ const description = stringField2(tool, "description");
27616
+ if (description) console.log(`Description: ${description}`);
27617
+ const categories = arrayField2(tool, "categories").filter(
27618
+ (v) => typeof v === "string"
27619
+ );
27620
+ if (categories.length) console.log(`Tags: ${categories.join(", ")}`);
27621
+ console.log("");
27622
+ console.log(
27623
+ "Monitor type \u2014 streams a provider's events into your warehouse. Deploy it, don't execute it."
27624
+ );
27625
+ console.log("");
27626
+ printMonitorTypeFilters(tool);
27627
+ printMonitorTypeStreams(tool);
27628
+ console.log("");
27629
+ printMonitorTypePricing(tool);
27630
+ console.log("");
27631
+ printMonitorTypeDeploy(tool);
27632
+ console.log("");
27633
+ console.log(`More: deepline tools get ${toolId} --json`);
27634
+ }
27543
27635
  function printCompactToolContract(tool, requestedToolId) {
27636
+ if (isMonitorTypeTool(tool)) {
27637
+ printMonitorTypeContract(tool, requestedToolId);
27638
+ return;
27639
+ }
27544
27640
  const contract = toolContractJsonForDescribe(tool, requestedToolId);
27545
27641
  const cost = isRecord8(contract.cost) ? contract.cost : {};
27546
27642
  const getters = isRecord8(contract.getters) ? contract.getters : {};
@@ -27606,6 +27702,10 @@ function printCompactToolContract(tool, requestedToolId) {
27606
27702
  );
27607
27703
  }
27608
27704
  function printToolPricingOnly(tool, requestedToolId, options = {}) {
27705
+ if (isMonitorTypeTool(tool)) {
27706
+ printMonitorTypePricing(tool);
27707
+ return;
27708
+ }
27609
27709
  const contract = toolContractJsonForDescribe(tool, requestedToolId);
27610
27710
  const cost = isRecord8(contract.cost) ? contract.cost : {};
27611
27711
  const pricingModel = stringField2(cost, "pricingModel") || "unknown";
@@ -27618,6 +27718,11 @@ function printToolPricingOnly(tool, requestedToolId, options = {}) {
27618
27718
  console.log(`Billing: ${billingMode}`);
27619
27719
  }
27620
27720
  function printToolSchemaOnly(tool, requestedToolId) {
27721
+ if (isMonitorTypeTool(tool)) {
27722
+ printMonitorTypeFilters(tool);
27723
+ printMonitorTypeStreams(tool);
27724
+ return;
27725
+ }
27621
27726
  const contract = toolContractJsonForDescribe(tool, requestedToolId);
27622
27727
  const inputFields = Array.isArray(contract.inputFields) ? contract.inputFields : [];
27623
27728
  console.log(`Schema: ${contract.toolId}`);
@@ -27640,6 +27745,10 @@ function printToolSchemaOnly(tool, requestedToolId) {
27640
27745
  }
27641
27746
  }
27642
27747
  function printToolExamplesOnly(tool, requestedToolId, options = {}) {
27748
+ if (isMonitorTypeTool(tool)) {
27749
+ printMonitorTypeDeploy(tool);
27750
+ return;
27751
+ }
27643
27752
  if (isPlayLikeTool(tool)) {
27644
27753
  printPlayLikeToolUsage(tool, requestedToolId);
27645
27754
  return;
@@ -703,7 +703,7 @@ var SDK_RELEASE = {
703
703
  // 0.1.253 makes play-page browser opening opt-in and retires --no-open.
704
704
  // 0.1.254 removes the internal operations tree from the published SDK CLI.
705
705
  // Operators use the checkout-local deepline-admin binary instead.
706
- version: "0.1.272",
706
+ version: "0.1.274",
707
707
  contracts: {
708
708
  api: {
709
709
  name: "sdk-http-api",
@@ -27172,6 +27172,9 @@ function isPlayLikeTool(tool) {
27172
27172
  const toolId = typeof record.toolId === "string" ? record.toolId : "";
27173
27173
  return toolId.endsWith("_waterfall");
27174
27174
  }
27175
+ function isMonitorTypeTool(tool) {
27176
+ return stringField2(tool, "kind") === "monitor_type";
27177
+ }
27175
27178
  function playReferenceForTool(tool) {
27176
27179
  const record = tool;
27177
27180
  const declared = stringField2(record, "playReference", "play_reference");
@@ -27588,7 +27591,100 @@ function extractionContractEntries(entries) {
27588
27591
  return name && expression ? [{ name, expression }] : [];
27589
27592
  });
27590
27593
  }
27594
+ function printMonitorTypeFilters(tool) {
27595
+ const schema = recordField2(tool, "payload_schema", "payloadSchema");
27596
+ const properties = recordField2(schema, "properties");
27597
+ const required = new Set(
27598
+ arrayField2(schema, "required").filter(
27599
+ (v) => typeof v === "string"
27600
+ )
27601
+ );
27602
+ const names = Object.keys(properties);
27603
+ if (!names.length) {
27604
+ console.log("Deploy filters: none");
27605
+ return;
27606
+ }
27607
+ console.log("Deploy filters (set in the monitor payload):");
27608
+ for (const name of names) {
27609
+ const field = isRecord8(properties[name]) ? properties[name] : {};
27610
+ const star = required.has(name) ? "*" : "";
27611
+ const enumVals = arrayField2(field, "enum").filter(
27612
+ (v) => typeof v === "string"
27613
+ );
27614
+ const type = enumVals.length ? `one of [${enumVals.join(", ")}]` : stringField2(field, "type") || "string";
27615
+ const desc = stringField2(field, "description");
27616
+ console.log(`- ${name}${star}: ${type}${desc ? ` - ${desc}` : ""}`);
27617
+ }
27618
+ }
27619
+ function printMonitorTypeStreams(tool) {
27620
+ const streams = arrayField2(tool, "streams", "output_streams").filter(isRecord8);
27621
+ if (!streams.length) return;
27622
+ console.log("");
27623
+ console.log("Filter columns (a play's sqlListeners.where, per stream):");
27624
+ for (const stream of streams) {
27625
+ const name = stringField2(stream, "stream");
27626
+ const cols = arrayField2(stream, "columns").filter(isRecord8).map((col) => stringField2(col, "name")).filter(Boolean);
27627
+ console.log(`- ${name}: ${cols.join(", ")}`);
27628
+ }
27629
+ }
27630
+ function printMonitorTypePricing(tool) {
27631
+ const pricing = recordField2(tool, "pricing");
27632
+ const byType = recordField2(
27633
+ pricing,
27634
+ "pricing_by_radar_type",
27635
+ "pricingByRadarType"
27636
+ );
27637
+ const keys = Object.keys(byType);
27638
+ if (!keys.length) {
27639
+ console.log("Pricing: Deepline credits per accepted event (see --json)");
27640
+ return;
27641
+ }
27642
+ console.log("Pricing (Deepline credits per accepted event):");
27643
+ for (const key of keys) {
27644
+ const entry = isRecord8(byType[key]) ? byType[key] : {};
27645
+ const credits = numberField2(entry, "deepline_credits", "deeplineCredits");
27646
+ const display = stringField2(entry, "display");
27647
+ const shown = display || (credits !== null ? `${formatDecimal(credits)} credits/event` : "see --json");
27648
+ console.log(`- ${key}: ${shown}`);
27649
+ }
27650
+ }
27651
+ function printMonitorTypeDeploy(tool) {
27652
+ const deploy = recordField2(tool, "deploy");
27653
+ const toolId = stringField2(tool, "toolId");
27654
+ const example = stringField2(deploy, "example") || `deepline monitors deploy '{"key":"...","tool":"${toolId}","payload":{...}}'`;
27655
+ console.log("Deploy (a monitor type is deployed, not executed):");
27656
+ console.log(` ${example}`);
27657
+ }
27658
+ function printMonitorTypeContract(tool, requestedToolId) {
27659
+ const toolId = stringField2(tool, "toolId") || requestedToolId;
27660
+ console.log(toolId);
27661
+ const displayName = stringField2(tool, "displayName");
27662
+ if (displayName) console.log(`Best for: ${displayName}`);
27663
+ const description = stringField2(tool, "description");
27664
+ if (description) console.log(`Description: ${description}`);
27665
+ const categories = arrayField2(tool, "categories").filter(
27666
+ (v) => typeof v === "string"
27667
+ );
27668
+ if (categories.length) console.log(`Tags: ${categories.join(", ")}`);
27669
+ console.log("");
27670
+ console.log(
27671
+ "Monitor type \u2014 streams a provider's events into your warehouse. Deploy it, don't execute it."
27672
+ );
27673
+ console.log("");
27674
+ printMonitorTypeFilters(tool);
27675
+ printMonitorTypeStreams(tool);
27676
+ console.log("");
27677
+ printMonitorTypePricing(tool);
27678
+ console.log("");
27679
+ printMonitorTypeDeploy(tool);
27680
+ console.log("");
27681
+ console.log(`More: deepline tools get ${toolId} --json`);
27682
+ }
27591
27683
  function printCompactToolContract(tool, requestedToolId) {
27684
+ if (isMonitorTypeTool(tool)) {
27685
+ printMonitorTypeContract(tool, requestedToolId);
27686
+ return;
27687
+ }
27592
27688
  const contract = toolContractJsonForDescribe(tool, requestedToolId);
27593
27689
  const cost = isRecord8(contract.cost) ? contract.cost : {};
27594
27690
  const getters = isRecord8(contract.getters) ? contract.getters : {};
@@ -27654,6 +27750,10 @@ function printCompactToolContract(tool, requestedToolId) {
27654
27750
  );
27655
27751
  }
27656
27752
  function printToolPricingOnly(tool, requestedToolId, options = {}) {
27753
+ if (isMonitorTypeTool(tool)) {
27754
+ printMonitorTypePricing(tool);
27755
+ return;
27756
+ }
27657
27757
  const contract = toolContractJsonForDescribe(tool, requestedToolId);
27658
27758
  const cost = isRecord8(contract.cost) ? contract.cost : {};
27659
27759
  const pricingModel = stringField2(cost, "pricingModel") || "unknown";
@@ -27666,6 +27766,11 @@ function printToolPricingOnly(tool, requestedToolId, options = {}) {
27666
27766
  console.log(`Billing: ${billingMode}`);
27667
27767
  }
27668
27768
  function printToolSchemaOnly(tool, requestedToolId) {
27769
+ if (isMonitorTypeTool(tool)) {
27770
+ printMonitorTypeFilters(tool);
27771
+ printMonitorTypeStreams(tool);
27772
+ return;
27773
+ }
27669
27774
  const contract = toolContractJsonForDescribe(tool, requestedToolId);
27670
27775
  const inputFields = Array.isArray(contract.inputFields) ? contract.inputFields : [];
27671
27776
  console.log(`Schema: ${contract.toolId}`);
@@ -27688,6 +27793,10 @@ function printToolSchemaOnly(tool, requestedToolId) {
27688
27793
  }
27689
27794
  }
27690
27795
  function printToolExamplesOnly(tool, requestedToolId, options = {}) {
27796
+ if (isMonitorTypeTool(tool)) {
27797
+ printMonitorTypeDeploy(tool);
27798
+ return;
27799
+ }
27691
27800
  if (isPlayLikeTool(tool)) {
27692
27801
  printPlayLikeToolUsage(tool, requestedToolId);
27693
27802
  return;
package/dist/index.d.mts CHANGED
@@ -3595,7 +3595,7 @@ type PreviousCell<Value = unknown> = {
3595
3595
 
3596
3596
  type PlayCallExecution = 'inline' | 'child-workflow';
3597
3597
  interface PlayCallOptions {
3598
- description?: string;
3598
+ description: string;
3599
3599
  execution?: PlayCallExecution;
3600
3600
  }
3601
3601
  /**
@@ -4231,7 +4231,7 @@ interface DeeplinePlayRuntimeContext {
4231
4231
  *
4232
4232
  * @sdkReference runtime 140 ctx.runPlay(key, playRef, input, options)
4233
4233
  */
4234
- runPlay<TOutput = unknown>(key: string, playRef: string | PlayReferenceLike, input: Record<string, unknown>, options?: PlayCallOptions): Promise<TOutput>;
4234
+ runPlay<TOutput = unknown>(key: string, playRef: string | PlayReferenceLike, input: Record<string, unknown>, options: PlayCallOptions): Promise<TOutput>;
4235
4235
  /**
4236
4236
  * Emit a log line visible in `play tail` and the play's progress logs.
4237
4237
  *
package/dist/index.d.ts CHANGED
@@ -3595,7 +3595,7 @@ type PreviousCell<Value = unknown> = {
3595
3595
 
3596
3596
  type PlayCallExecution = 'inline' | 'child-workflow';
3597
3597
  interface PlayCallOptions {
3598
- description?: string;
3598
+ description: string;
3599
3599
  execution?: PlayCallExecution;
3600
3600
  }
3601
3601
  /**
@@ -4231,7 +4231,7 @@ interface DeeplinePlayRuntimeContext {
4231
4231
  *
4232
4232
  * @sdkReference runtime 140 ctx.runPlay(key, playRef, input, options)
4233
4233
  */
4234
- runPlay<TOutput = unknown>(key: string, playRef: string | PlayReferenceLike, input: Record<string, unknown>, options?: PlayCallOptions): Promise<TOutput>;
4234
+ runPlay<TOutput = unknown>(key: string, playRef: string | PlayReferenceLike, input: Record<string, unknown>, options: PlayCallOptions): Promise<TOutput>;
4235
4235
  /**
4236
4236
  * Emit a log line visible in `play tail` and the play's progress logs.
4237
4237
  *
package/dist/index.js CHANGED
@@ -438,7 +438,7 @@ var SDK_RELEASE = {
438
438
  // 0.1.253 makes play-page browser opening opt-in and retires --no-open.
439
439
  // 0.1.254 removes the internal operations tree from the published SDK CLI.
440
440
  // Operators use the checkout-local deepline-admin binary instead.
441
- version: "0.1.272",
441
+ version: "0.1.274",
442
442
  contracts: {
443
443
  api: {
444
444
  name: "sdk-http-api",
package/dist/index.mjs CHANGED
@@ -367,7 +367,7 @@ var SDK_RELEASE = {
367
367
  // 0.1.253 makes play-page browser opening opt-in and retires --no-open.
368
368
  // 0.1.254 removes the internal operations tree from the published SDK CLI.
369
369
  // Operators use the checkout-local deepline-admin binary instead.
370
- version: "0.1.272",
370
+ version: "0.1.274",
371
371
  contracts: {
372
372
  api: {
373
373
  name: "sdk-http-api",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepline",
3
- "version": "0.1.272",
3
+ "version": "0.1.274",
4
4
  "description": "Deepline SDK + CLI — B2B data enrichment powered by durable cloud execution",
5
5
  "license": "MIT",
6
6
  "repository": {