deepline 0.1.38 → 0.1.39

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.
@@ -193,8 +193,8 @@ function resolveConfig(options) {
193
193
  }
194
194
 
195
195
  // src/version.ts
196
- var SDK_VERSION = "0.1.38";
197
- var SDK_API_CONTRACT = "2026-05-v2-tool-response-play-guardrails";
196
+ var SDK_VERSION = "0.1.39";
197
+ var SDK_API_CONTRACT = "2026-05-v2-play-live-definition";
198
198
 
199
199
  // ../shared_libs/play-runtime/coordinator-headers.ts
200
200
  var COORDINATOR_INTERNAL_TOKEN_HEADER = "x-deepline-internal-token";
@@ -7478,126 +7478,6 @@ function shouldUseLocalOnlyPlayCheck() {
7478
7478
  const value = process.env.DEEPLINE_PLAY_CHECK_LOCAL_ONLY?.trim().toLowerCase();
7479
7479
  return value === "1" || value === "true" || value === "yes" || value === "on";
7480
7480
  }
7481
- function isRecord3(value) {
7482
- return Boolean(value && typeof value === "object" && !Array.isArray(value));
7483
- }
7484
- function stringValue(value) {
7485
- return typeof value === "string" ? value.trim() : "";
7486
- }
7487
- function asArray(value) {
7488
- return Array.isArray(value) ? value : [];
7489
- }
7490
- function extractionEntries(value) {
7491
- if (Array.isArray(value)) return value.filter(isRecord3);
7492
- if (!isRecord3(value)) return [];
7493
- return Object.entries(value).map(
7494
- ([name, entry]) => isRecord3(entry) ? { name, ...entry } : { name }
7495
- );
7496
- }
7497
- function firstRawPath(entry) {
7498
- const details = isRecord3(entry.details) ? entry.details : {};
7499
- const paths = [
7500
- ...asArray(details.rawToolOutputPaths),
7501
- ...asArray(details.raw_tool_output_paths),
7502
- ...asArray(details.candidatePaths),
7503
- ...asArray(details.candidate_paths)
7504
- ].map(stringValue).filter(Boolean);
7505
- return paths[0];
7506
- }
7507
- function checkHintExpression(value) {
7508
- return stringValue(value).replace(/^toolExecutionResult\./, "result.");
7509
- }
7510
- function checkHintRawPath(value) {
7511
- return value?.replace(/^toolResponse\./, "result.toolResponse.");
7512
- }
7513
- function collectStaticPipelineToolIds(staticPipeline) {
7514
- const seen = /* @__PURE__ */ new Set();
7515
- const visitPipeline = (pipeline) => {
7516
- if (!isRecord3(pipeline)) return;
7517
- for (const step of [
7518
- ...asArray(pipeline.stages),
7519
- ...asArray(pipeline.substeps)
7520
- ]) {
7521
- if (!isRecord3(step)) continue;
7522
- if (step.type === "tool") {
7523
- const toolId = stringValue(step.toolId) || stringValue(step.tool);
7524
- if (toolId) seen.add(toolId);
7525
- }
7526
- if (step.type === "play_call") {
7527
- visitPipeline(step.pipeline);
7528
- }
7529
- }
7530
- };
7531
- visitPipeline(staticPipeline);
7532
- return [...seen].sort();
7533
- }
7534
- function toolGetterHintFromMetadata(toolId, tool) {
7535
- const usageGuidance = isRecord3(tool.usageGuidance) ? tool.usageGuidance : {};
7536
- const resultGuidance = isRecord3(usageGuidance.toolExecutionResult) ? usageGuidance.toolExecutionResult : isRecord3(usageGuidance.tool_execution_result) ? usageGuidance.tool_execution_result : {};
7537
- const toolResponse = isRecord3(resultGuidance.toolResponse) ? resultGuidance.toolResponse : isRecord3(resultGuidance.tool_response) ? resultGuidance.tool_response : {};
7538
- const lists = extractionEntries(
7539
- resultGuidance.extractedLists ?? resultGuidance.extracted_lists
7540
- ).map((entry) => ({
7541
- name: stringValue(entry.name),
7542
- expression: checkHintExpression(entry.expression),
7543
- raw: checkHintRawPath(firstRawPath(entry))
7544
- })).filter((entry) => entry.name && entry.expression);
7545
- const values = extractionEntries(
7546
- resultGuidance.extractedValues ?? resultGuidance.extracted_values
7547
- ).map((entry) => ({
7548
- name: stringValue(entry.name),
7549
- expression: checkHintExpression(entry.expression),
7550
- raw: checkHintRawPath(firstRawPath(entry))
7551
- })).filter((entry) => entry.name && entry.expression);
7552
- return {
7553
- toolId,
7554
- lists,
7555
- values,
7556
- raw: checkHintExpression(toolResponse.raw) || "result.toolResponse.raw"
7557
- };
7558
- }
7559
- async function buildToolGetterHints(client, staticPipeline) {
7560
- const toolIds = collectStaticPipelineToolIds(staticPipeline);
7561
- return Promise.all(
7562
- toolIds.map(async (toolId) => {
7563
- try {
7564
- const tool = await client.getTool(toolId);
7565
- return toolGetterHintFromMetadata(toolId, tool);
7566
- } catch (error) {
7567
- return {
7568
- toolId,
7569
- lists: [],
7570
- values: [],
7571
- raw: "result.toolResponse.raw",
7572
- unavailable: error instanceof Error ? error.message : String(error)
7573
- };
7574
- }
7575
- })
7576
- );
7577
- }
7578
- function printToolGetterHints(hints) {
7579
- if (!hints?.length) return;
7580
- console.log(" Tool result getter hints:");
7581
- for (const hint of hints) {
7582
- console.log(` ${hint.toolId} output:`);
7583
- if (hint.lists.length) {
7584
- for (const entry of hint.lists) {
7585
- const raw = entry.raw ? ` (raw: ${entry.raw})` : "";
7586
- console.log(` - list ${entry.name}: ${entry.expression}${raw}`);
7587
- }
7588
- }
7589
- if (hint.values.length) {
7590
- const valueNames = hint.values.map((entry) => entry.name).join(", ");
7591
- console.log(` - values: ${valueNames}`);
7592
- for (const entry of hint.values) {
7593
- const raw = entry.raw ? ` (raw: ${entry.raw})` : "";
7594
- console.log(` ${entry.name}: ${entry.expression}${raw}`);
7595
- }
7596
- }
7597
- if (hint.raw) console.log(` - raw: ${hint.raw}`);
7598
- if (hint.unavailable) console.log(` - warning: ${hint.unavailable}`);
7599
- }
7600
- }
7601
7481
  async function handlePlayCheck(args) {
7602
7482
  const options = parsePlayCheckOptions(args);
7603
7483
  if (!isFileTarget(options.target)) {
@@ -7628,7 +7508,6 @@ async function handlePlayCheck(args) {
7628
7508
  valid: true,
7629
7509
  errors: [],
7630
7510
  staticPipeline: graph.root.compilerManifest?.staticPipeline ?? null,
7631
- toolGetterHints: [],
7632
7511
  artifactHash: graph.root.artifact.artifactHash,
7633
7512
  graphHash: graph.root.artifact.graphHash
7634
7513
  };
@@ -7638,7 +7517,6 @@ async function handlePlayCheck(args) {
7638
7517
  } else {
7639
7518
  console.log(`\u2713 ${playName} passed local play check`);
7640
7519
  console.log(` artifact: ${result2.artifactHash.slice(0, 12)}`);
7641
- printToolGetterHints(result2.toolGetterHints);
7642
7520
  }
7643
7521
  return 0;
7644
7522
  }
@@ -7649,27 +7527,21 @@ async function handlePlayCheck(args) {
7649
7527
  sourceFiles: graph.root.sourceFiles,
7650
7528
  artifact: graph.root.artifact
7651
7529
  });
7652
- const enrichedResult = {
7653
- ...result,
7654
- toolGetterHints: result.toolGetterHints ?? await buildToolGetterHints(client, result.staticPipeline)
7655
- };
7656
7530
  if (options.jsonOutput) {
7657
- process.stdout.write(`${JSON.stringify({ name: playName, ...enrichedResult })}
7531
+ process.stdout.write(`${JSON.stringify({ name: playName, ...result })}
7658
7532
  `);
7659
- } else if (enrichedResult.valid) {
7533
+ } else if (result.valid) {
7660
7534
  console.log(`\u2713 ${playName} passed cloud play check`);
7661
- if (enrichedResult.artifactHash) {
7662
- console.log(` artifact: ${enrichedResult.artifactHash.slice(0, 12)}`);
7535
+ if (result.artifactHash) {
7536
+ console.log(` artifact: ${result.artifactHash.slice(0, 12)}`);
7663
7537
  }
7664
- printToolGetterHints(enrichedResult.toolGetterHints);
7665
7538
  } else {
7666
7539
  console.error(`\u2717 ${playName} failed cloud play check`);
7667
- for (const error of enrichedResult.errors) {
7540
+ for (const error of result.errors) {
7668
7541
  console.error(` ${error}`);
7669
7542
  }
7670
- printToolGetterHints(enrichedResult.toolGetterHints);
7671
7543
  }
7672
- return enrichedResult.valid ? 0 : 1;
7544
+ return result.valid ? 0 : 1;
7673
7545
  }
7674
7546
  async function handleFileBackedRun(options) {
7675
7547
  if (options.target.kind !== "file") {
@@ -8772,7 +8644,7 @@ Pass-through input flags:
8772
8644
  ...options.logs ? ["--logs"] : [],
8773
8645
  ...options.tailTimeoutMs ? ["--tail-timeout-ms", options.tailTimeoutMs] : [],
8774
8646
  ...options.force ? ["--force"] : [],
8775
- ...options.noOpen || options.open === false ? ["--no-open"] : [],
8647
+ ...options.open === false ? ["--no-open"] : [],
8776
8648
  ...options.json ? ["--json"] : [],
8777
8649
  ...passthroughArgs
8778
8650
  ]);
@@ -9228,15 +9100,6 @@ function extractSummaryFields(payload) {
9228
9100
 
9229
9101
  // src/cli/commands/tools.ts
9230
9102
  function toListedTool(tool) {
9231
- if (isPlayLikeTool(tool)) {
9232
- const playReference = playReferenceForTool(tool);
9233
- return {
9234
- ...tool,
9235
- id: tool.toolId,
9236
- type: "play",
9237
- executeCommand: `deepline plays run ${playReference} --input '{...}' --watch`
9238
- };
9239
- }
9240
9103
  return {
9241
9104
  ...tool,
9242
9105
  id: tool.toolId,
@@ -9275,12 +9138,11 @@ async function searchTools(queryInput, options = {}) {
9275
9138
  searchMode: options.searchMode,
9276
9139
  includeSearchDebug: options.includeSearchDebug
9277
9140
  });
9278
- const items = result.tools.filter((tool) => !isPlayLikeTool(tool)).map(toListedTool);
9141
+ const items = result.tools.map(toListedTool);
9279
9142
  const envelope = {
9280
9143
  ...result,
9281
9144
  tools: items,
9282
9145
  count: items.length,
9283
- omitted_plays_hint: "Use `deepline plays search <query> --json` for prebuilt and org-owned plays.",
9284
9146
  render: {
9285
9147
  sections: [
9286
9148
  {
@@ -9293,10 +9155,6 @@ async function searchTools(queryInput, options = {}) {
9293
9155
  ...item.inputSchema ? [" inputSchema: yes"] : []
9294
9156
  ];
9295
9157
  })
9296
- },
9297
- {
9298
- title: "plays",
9299
- lines: ["For prebuilt or org-owned workflows, run: deepline plays search <query>"]
9300
9158
  }
9301
9159
  ]
9302
9160
  }
@@ -9315,36 +9173,13 @@ async function findPlayForToolId(client, toolId) {
9315
9173
  const plays = await client.searchPlays({ query: requested, compact: true });
9316
9174
  return plays.find((play) => playIdentifiers(play).includes(requested)) ?? null;
9317
9175
  }
9318
- function playAliasToolErrorMessage(toolId, play) {
9176
+ function printPlayAliasToolError(toolId, play) {
9319
9177
  const playName = play.reference ?? play.name;
9320
- return `${toolId} is a play, not a tool.
9178
+ console.error(
9179
+ `${toolId} is a play, not a tool.
9321
9180
  Use: deepline plays run ${playName} --input '{...}' --watch
9322
- Inspect its schema with: deepline plays describe ${playName} --json`;
9323
- }
9324
- function printPlayAliasToolError(toolId, play) {
9325
- console.error(playAliasToolErrorMessage(toolId, play));
9326
- }
9327
- function isPlayLikeTool(tool) {
9328
- const record = tool;
9329
- if (record.isPlay === true || record.is_play === true) return true;
9330
- const playExpansion = recordField(record, "playExpansion", "play_expansion");
9331
- if (Object.keys(playExpansion).length > 0) return true;
9332
- const toolId = typeof record.toolId === "string" ? record.toolId : "";
9333
- return toolId.endsWith("_waterfall");
9334
- }
9335
- function playReferenceForTool(tool) {
9336
- const record = tool;
9337
- const toolId = typeof record.toolId === "string" ? record.toolId : "play";
9338
- return `prebuilt/${toolId.replace(/_/g, "-")}`;
9339
- }
9340
- function playLikeToolExecuteErrorMessage(toolId) {
9341
- const playReference = `prebuilt/${toolId.replace(/_/g, "-")}`;
9342
- return `${toolId} is a workflow/play entry, not an atomic provider tool.
9343
- Use: deepline plays run ${playReference} --input '{...}' --watch
9344
- Or search provider tools only with: deepline tools search "<query>" --json`;
9345
- }
9346
- function printPlayLikeToolExecuteError(toolId) {
9347
- console.error(playLikeToolExecuteErrorMessage(toolId));
9181
+ Inspect its schema with: deepline plays describe ${playName} --json`
9182
+ );
9348
9183
  }
9349
9184
  function registerToolsCommands(program) {
9350
9185
  const tools = program.command("tools").description("Search, describe, and execute atomic provider tools.").addHelpText(
@@ -9519,7 +9354,7 @@ function printToolDetails(tool, requestedToolId) {
9519
9354
  const operation = typeof tool.operation === "string" ? tool.operation : "";
9520
9355
  const displayBase = operation && operation.startsWith(`${tool.provider}_`) ? operation.slice(String(tool.provider).length + 1) : operation ? `${tool.provider} ${operation}`.trim() : toolId;
9521
9356
  const displayName = titleCase(displayBase || String(tool.displayName || toolId));
9522
- const cost = isRecord4(tool.cost) ? tool.cost : null;
9357
+ const cost = isRecord3(tool.cost) ? tool.cost : null;
9523
9358
  const deeplineCredits = numberField(tool, "deeplineCreditsPerPricingUnit", "deepline_credits_per_pricing_unit");
9524
9359
  const deeplineUsdPerPricingUnit = numberField(tool, "deeplineUsdPerPricingUnit", "deepline_usd_per_pricing_unit");
9525
9360
  const deeplineUsdPerCredit = numberField(tool, "deeplineUsdPerCredit", "deepline_usd_per_credit");
@@ -9569,7 +9404,7 @@ function printToolDetails(tool, requestedToolId) {
9569
9404
  if (stepContributions.length) {
9570
9405
  console.log(" step contributions:");
9571
9406
  for (const item of stepContributions) {
9572
- if (!isRecord4(item)) continue;
9407
+ if (!isRecord3(item)) continue;
9573
9408
  const stepTool = typeof item.tool === "string" ? item.tool.trim() : "";
9574
9409
  const low = typeof item.lowCredits === "number" ? item.lowCredits : null;
9575
9410
  const high = typeof item.highCredits === "number" ? item.highCredits : null;
@@ -9609,7 +9444,7 @@ function printToolDetails(tool, requestedToolId) {
9609
9444
  }
9610
9445
  const toolExecutionResult = recordField(usageGuidance, "toolExecutionResult");
9611
9446
  const extractedValues = arrayField(toolExecutionResult, "extractedValues", "extracted_values");
9612
- const targets = extractedValues.map((entry) => isRecord4(entry) && typeof entry.name === "string" ? entry.name : "").filter(Boolean).sort();
9447
+ const targets = extractedValues.map((entry) => isRecord3(entry) && typeof entry.name === "string" ? entry.name : "").filter(Boolean).sort();
9613
9448
  if (targets.length) {
9614
9449
  console.log(` - Built-in extract targets: ${targets.join(", ")}`);
9615
9450
  }
@@ -9650,7 +9485,7 @@ function printExtractions(label, entries) {
9650
9485
  if (!entries.length) return;
9651
9486
  console.log(` ${label}:`);
9652
9487
  for (const entry of entries) {
9653
- if (!isRecord4(entry)) continue;
9488
+ if (!isRecord3(entry)) continue;
9654
9489
  const name = stringField(entry, "name");
9655
9490
  const expression = stringField(entry, "expression");
9656
9491
  const details = recordField(entry, "details");
@@ -9690,12 +9525,12 @@ function printToolCost(input) {
9690
9525
  return false;
9691
9526
  }
9692
9527
  function toolInputFieldsForDisplay(inputSchema) {
9693
- if (Array.isArray(inputSchema.fields)) return inputSchema.fields.filter(isRecord4);
9694
- const jsonSchema = isRecord4(inputSchema.jsonSchema) ? inputSchema.jsonSchema : inputSchema;
9695
- const properties = isRecord4(jsonSchema.properties) ? jsonSchema.properties : {};
9528
+ if (Array.isArray(inputSchema.fields)) return inputSchema.fields.filter(isRecord3);
9529
+ const jsonSchema = isRecord3(inputSchema.jsonSchema) ? inputSchema.jsonSchema : inputSchema;
9530
+ const properties = isRecord3(jsonSchema.properties) ? jsonSchema.properties : {};
9696
9531
  const required = Array.isArray(jsonSchema.required) ? new Set(jsonSchema.required.map(String)) : /* @__PURE__ */ new Set();
9697
9532
  return Object.entries(properties).map(([name, value]) => {
9698
- const property = isRecord4(value) ? value : {};
9533
+ const property = isRecord3(value) ? value : {};
9699
9534
  return {
9700
9535
  name,
9701
9536
  type: typeof property.type === "string" ? property.type : "unknown",
@@ -9722,15 +9557,15 @@ function printJsonPreview(label, payload) {
9722
9557
  }
9723
9558
  function samplePayload(samples, key) {
9724
9559
  const entry = samples[key];
9725
- if (!isRecord4(entry)) return void 0;
9560
+ if (!isRecord3(entry)) return void 0;
9726
9561
  return Object.prototype.hasOwnProperty.call(entry, "payload") ? entry.payload : entry;
9727
9562
  }
9728
9563
  function commandEnvelopeFromRawResponse(rawResponse) {
9729
- return isRecord4(rawResponse) ? { ...rawResponse } : { status: "completed", result: rawResponse };
9564
+ return isRecord3(rawResponse) ? { ...rawResponse } : { status: "completed", result: rawResponse };
9730
9565
  }
9731
9566
  function listExtractorPathsFromUsageGuidance(tool) {
9732
9567
  const toolExecutionResult = tool.usageGuidance?.toolExecutionResult;
9733
- const extractedLists = Array.isArray(toolExecutionResult?.extractedLists) ? toolExecutionResult.extractedLists : isRecord4(toolExecutionResult?.extractedLists) ? Object.values(toolExecutionResult.extractedLists) : [];
9568
+ const extractedLists = Array.isArray(toolExecutionResult?.extractedLists) ? toolExecutionResult.extractedLists : isRecord3(toolExecutionResult?.extractedLists) ? Object.values(toolExecutionResult.extractedLists) : [];
9734
9569
  return extractedLists.flatMap((entry) => {
9735
9570
  const paths = entry.details?.candidatePaths ?? entry.details?.rawToolOutputPaths;
9736
9571
  if (!Array.isArray(paths)) return [];
@@ -9757,7 +9592,7 @@ function formatDecimal(value) {
9757
9592
  function formatUsd(value) {
9758
9593
  return `$${formatDecimal(value)}`;
9759
9594
  }
9760
- function isRecord4(value) {
9595
+ function isRecord3(value) {
9761
9596
  return Boolean(value && typeof value === "object" && !Array.isArray(value));
9762
9597
  }
9763
9598
  function stringField(source, ...keys) {
@@ -9784,7 +9619,7 @@ function arrayField(source, ...keys) {
9784
9619
  function recordField(source, ...keys) {
9785
9620
  for (const key of keys) {
9786
9621
  const value = source[key];
9787
- if (isRecord4(value)) return value;
9622
+ if (isRecord3(value)) return value;
9788
9623
  }
9789
9624
  return {};
9790
9625
  }
@@ -9882,11 +9717,8 @@ export default definePlay(${JSON.stringify(playName)}, async (ctx) => {
9882
9717
  // .step('phone_waterfall', (row, rowCtx) => rowCtx.runPlay('contact_phone', 'contact-to-phone', { first_name: String(row.first_name ?? ''), last_name: String(row.last_name ?? ''), email: String(row.email ?? '') }, { description: 'Resolve phone.' }))
9883
9718
  // ctx.map is idempotent by map key + row key; reruns reuse completed rows.
9884
9719
  const enrichedData = await ctx
9885
- .map('enriched_data', rows)
9886
- .run({
9887
- key: ${rowKey},
9888
- description: 'Enrich seeded rows.',
9889
- });
9720
+ .map('enriched_data', rows, { key: ${rowKey} })
9721
+ .run({ description: 'Enrich seeded rows.' });
9890
9722
 
9891
9723
  return {
9892
9724
  rows: enrichedData,
@@ -9916,7 +9748,7 @@ function buildToolExecuteBaseEnvelope(input) {
9916
9748
  kind: summaryEntries.length > 0 ? "object" : "raw",
9917
9749
  summary: input.summary
9918
9750
  };
9919
- const envelopeHasCanonicalOutput = isRecord4(envelope.toolResponse) && Object.prototype.hasOwnProperty.call(envelope.toolResponse, "raw");
9751
+ const envelopeHasCanonicalOutput = isRecord3(envelope.toolResponse) && Object.prototype.hasOwnProperty.call(envelope.toolResponse, "raw");
9920
9752
  const inspectCommand = `deepline tools execute ${input.toolId} --input ${shellQuote(JSON.stringify(input.params))} --json`;
9921
9753
  const actions = input.listConversion ? [
9922
9754
  {
@@ -9976,11 +9808,7 @@ async function executeTool(args) {
9976
9808
  } catch (error) {
9977
9809
  const play = await findPlayForToolId(client, parsed.toolId);
9978
9810
  if (play) {
9979
- if (argsWantJson(args)) {
9980
- printJsonError(new Error(playAliasToolErrorMessage(parsed.toolId, play)));
9981
- } else {
9982
- printPlayAliasToolError(parsed.toolId, play);
9983
- }
9811
+ printPlayAliasToolError(parsed.toolId, play);
9984
9812
  return 2;
9985
9813
  }
9986
9814
  if (error instanceof DeeplineError) {
@@ -9988,14 +9816,6 @@ async function executeTool(args) {
9988
9816
  }
9989
9817
  throw error;
9990
9818
  }
9991
- if (isPlayLikeTool(metadata)) {
9992
- if (argsWantJson(args)) {
9993
- printJsonError(new Error(playLikeToolExecuteErrorMessage(parsed.toolId)));
9994
- } else {
9995
- printPlayLikeToolExecuteError(parsed.toolId);
9996
- }
9997
- return 2;
9998
- }
9999
9819
  const rawResponse = await client.executeTool(parsed.toolId, parsed.params);
10000
9820
  const listConversion = tryConvertToList(rawResponse, {
10001
9821
  listExtractorPaths: listExtractorPathsFromUsageGuidance(metadata)
@@ -10018,7 +9838,7 @@ async function executeTool(args) {
10018
9838
  {
10019
9839
  ...baseEnvelope,
10020
9840
  local: {
10021
- ...isRecord4(baseEnvelope.local) ? baseEnvelope.local : {},
9841
+ ...isRecord3(baseEnvelope.local) ? baseEnvelope.local : {},
10022
9842
  payload_file: jsonPath
10023
9843
  }
10024
9844
  },
@@ -10616,15 +10436,9 @@ Notes:
10616
10436
 
10617
10437
  Examples:
10618
10438
  deepline version
10619
- deepline version --json
10620
10439
  deepline --version
10621
10440
  `
10622
- ).option("--json", "Emit JSON output").action((options) => {
10623
- if (options.json) {
10624
- process.stdout.write(`${JSON.stringify({ version: SDK_VERSION })}
10625
- `);
10626
- return;
10627
- }
10441
+ ).action(() => {
10628
10442
  process.stdout.write(`deepline ${SDK_VERSION}
10629
10443
  `);
10630
10444
  });
package/dist/index.d.mts CHANGED
@@ -745,25 +745,9 @@ interface PlayCheckResult {
745
745
  valid: boolean;
746
746
  errors: string[];
747
747
  staticPipeline?: Record<string, unknown> | null;
748
- toolGetterHints?: PlayCheckToolGetterHint[];
749
748
  artifactHash?: string | null;
750
749
  graphHash?: string | null;
751
750
  }
752
- interface PlayCheckToolGetterHint {
753
- toolId: string;
754
- lists: Array<{
755
- name: string;
756
- expression: string;
757
- raw?: string;
758
- }>;
759
- values: Array<{
760
- name: string;
761
- expression: string;
762
- raw?: string;
763
- }>;
764
- raw?: string;
765
- unavailable?: string;
766
- }
767
751
  /**
768
752
  * Request body for starting a play run via {@link DeeplineClient.startPlayRun}.
769
753
  *
@@ -1493,8 +1477,8 @@ declare class DeeplineClient {
1493
1477
  }>;
1494
1478
  }
1495
1479
 
1496
- declare const SDK_VERSION = "0.1.38";
1497
- declare const SDK_API_CONTRACT = "2026-05-v2-tool-response-play-guardrails";
1480
+ declare const SDK_VERSION = "0.1.39";
1481
+ declare const SDK_API_CONTRACT = "2026-05-v2-play-live-definition";
1498
1482
 
1499
1483
  /**
1500
1484
  * Base error class for all Deepline SDK errors.
package/dist/index.d.ts CHANGED
@@ -745,25 +745,9 @@ interface PlayCheckResult {
745
745
  valid: boolean;
746
746
  errors: string[];
747
747
  staticPipeline?: Record<string, unknown> | null;
748
- toolGetterHints?: PlayCheckToolGetterHint[];
749
748
  artifactHash?: string | null;
750
749
  graphHash?: string | null;
751
750
  }
752
- interface PlayCheckToolGetterHint {
753
- toolId: string;
754
- lists: Array<{
755
- name: string;
756
- expression: string;
757
- raw?: string;
758
- }>;
759
- values: Array<{
760
- name: string;
761
- expression: string;
762
- raw?: string;
763
- }>;
764
- raw?: string;
765
- unavailable?: string;
766
- }
767
751
  /**
768
752
  * Request body for starting a play run via {@link DeeplineClient.startPlayRun}.
769
753
  *
@@ -1493,8 +1477,8 @@ declare class DeeplineClient {
1493
1477
  }>;
1494
1478
  }
1495
1479
 
1496
- declare const SDK_VERSION = "0.1.38";
1497
- declare const SDK_API_CONTRACT = "2026-05-v2-tool-response-play-guardrails";
1480
+ declare const SDK_VERSION = "0.1.39";
1481
+ declare const SDK_API_CONTRACT = "2026-05-v2-play-live-definition";
1498
1482
 
1499
1483
  /**
1500
1484
  * Base error class for all Deepline SDK errors.
package/dist/index.js CHANGED
@@ -215,8 +215,8 @@ function resolveConfig(options) {
215
215
  }
216
216
 
217
217
  // src/version.ts
218
- var SDK_VERSION = "0.1.38";
219
- var SDK_API_CONTRACT = "2026-05-v2-tool-response-play-guardrails";
218
+ var SDK_VERSION = "0.1.39";
219
+ var SDK_API_CONTRACT = "2026-05-v2-play-live-definition";
220
220
 
221
221
  // ../shared_libs/play-runtime/coordinator-headers.ts
222
222
  var COORDINATOR_INTERNAL_TOKEN_HEADER = "x-deepline-internal-token";
@@ -1891,8 +1891,9 @@ function buildTargets(result, resultIdentityGetters) {
1891
1891
  }
1892
1892
  return targets;
1893
1893
  }
1894
- function buildLists(resolved, metadata) {
1894
+ function buildLists(result, metadata) {
1895
1895
  const lists = {};
1896
+ const resolved = resolveListRows(result, metadata.listExtractorPaths);
1896
1897
  for (const [name, list] of Object.entries(resolved)) {
1897
1898
  lists[name] = {
1898
1899
  path: list.path,
@@ -1927,10 +1928,9 @@ function buildExtractedAccessors(targets) {
1927
1928
  })
1928
1929
  );
1929
1930
  }
1930
- function buildListAccessors(resolved, lists) {
1931
+ function buildListAccessors(result, lists) {
1931
1932
  return Object.fromEntries(
1932
1933
  Object.entries(lists).map(([name, metadata]) => {
1933
- const rows = resolved[name]?.rows ?? [];
1934
1934
  const accessor = {
1935
1935
  path: metadata.path,
1936
1936
  count: metadata.count,
@@ -1938,7 +1938,7 @@ function buildListAccessors(resolved, lists) {
1938
1938
  };
1939
1939
  Object.defineProperty(accessor, "get", {
1940
1940
  value() {
1941
- return rows;
1941
+ return normalizeRows(getAtPath(result, metadata.path)) ?? [];
1942
1942
  },
1943
1943
  enumerable: false
1944
1944
  });
@@ -1958,11 +1958,7 @@ function createToolExecuteResult(input) {
1958
1958
  resultRoot,
1959
1959
  input.metadata.resultIdentityGetters
1960
1960
  );
1961
- const resolvedLists = resolveListRows(
1962
- resultRoot,
1963
- input.metadata.listExtractorPaths
1964
- );
1965
- const lists = buildLists(resolvedLists, input.metadata);
1961
+ const lists = buildLists(resultRoot, input.metadata);
1966
1962
  const metadata = {
1967
1963
  toolId: input.metadata.toolId,
1968
1964
  execution: input.execution,
@@ -1974,7 +1970,7 @@ function createToolExecuteResult(input) {
1974
1970
  ...result.meta ? { meta: result.meta } : {}
1975
1971
  };
1976
1972
  const extractedValues = buildExtractedAccessors(targets);
1977
- const extractedLists = buildListAccessors(resolvedLists, lists);
1973
+ const extractedLists = buildListAccessors(resultRoot, lists);
1978
1974
  const wrapper = {
1979
1975
  status: input.status,
1980
1976
  ...input.jobId ? { job_id: input.jobId } : {},
package/dist/index.mjs CHANGED
@@ -169,8 +169,8 @@ function resolveConfig(options) {
169
169
  }
170
170
 
171
171
  // src/version.ts
172
- var SDK_VERSION = "0.1.38";
173
- var SDK_API_CONTRACT = "2026-05-v2-tool-response-play-guardrails";
172
+ var SDK_VERSION = "0.1.39";
173
+ var SDK_API_CONTRACT = "2026-05-v2-play-live-definition";
174
174
 
175
175
  // ../shared_libs/play-runtime/coordinator-headers.ts
176
176
  var COORDINATOR_INTERNAL_TOKEN_HEADER = "x-deepline-internal-token";
@@ -1845,8 +1845,9 @@ function buildTargets(result, resultIdentityGetters) {
1845
1845
  }
1846
1846
  return targets;
1847
1847
  }
1848
- function buildLists(resolved, metadata) {
1848
+ function buildLists(result, metadata) {
1849
1849
  const lists = {};
1850
+ const resolved = resolveListRows(result, metadata.listExtractorPaths);
1850
1851
  for (const [name, list] of Object.entries(resolved)) {
1851
1852
  lists[name] = {
1852
1853
  path: list.path,
@@ -1881,10 +1882,9 @@ function buildExtractedAccessors(targets) {
1881
1882
  })
1882
1883
  );
1883
1884
  }
1884
- function buildListAccessors(resolved, lists) {
1885
+ function buildListAccessors(result, lists) {
1885
1886
  return Object.fromEntries(
1886
1887
  Object.entries(lists).map(([name, metadata]) => {
1887
- const rows = resolved[name]?.rows ?? [];
1888
1888
  const accessor = {
1889
1889
  path: metadata.path,
1890
1890
  count: metadata.count,
@@ -1892,7 +1892,7 @@ function buildListAccessors(resolved, lists) {
1892
1892
  };
1893
1893
  Object.defineProperty(accessor, "get", {
1894
1894
  value() {
1895
- return rows;
1895
+ return normalizeRows(getAtPath(result, metadata.path)) ?? [];
1896
1896
  },
1897
1897
  enumerable: false
1898
1898
  });
@@ -1912,11 +1912,7 @@ function createToolExecuteResult(input) {
1912
1912
  resultRoot,
1913
1913
  input.metadata.resultIdentityGetters
1914
1914
  );
1915
- const resolvedLists = resolveListRows(
1916
- resultRoot,
1917
- input.metadata.listExtractorPaths
1918
- );
1919
- const lists = buildLists(resolvedLists, input.metadata);
1915
+ const lists = buildLists(resultRoot, input.metadata);
1920
1916
  const metadata = {
1921
1917
  toolId: input.metadata.toolId,
1922
1918
  execution: input.execution,
@@ -1928,7 +1924,7 @@ function createToolExecuteResult(input) {
1928
1924
  ...result.meta ? { meta: result.meta } : {}
1929
1925
  };
1930
1926
  const extractedValues = buildExtractedAccessors(targets);
1931
- const extractedLists = buildListAccessors(resolvedLists, lists);
1927
+ const extractedLists = buildListAccessors(resultRoot, lists);
1932
1928
  const wrapper = {
1933
1929
  status: input.status,
1934
1930
  ...input.jobId ? { job_id: input.jobId } : {},