deepline 0.2.73 → 0.3.0

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.
Files changed (28) hide show
  1. package/dist/bundling-sources/sdk/src/client.ts +75 -4
  2. package/dist/bundling-sources/sdk/src/compat.ts +4 -0
  3. package/dist/bundling-sources/sdk/src/play.ts +9 -0
  4. package/dist/bundling-sources/sdk/src/release.ts +12 -1
  5. package/dist/bundling-sources/sdk/src/types.ts +7 -0
  6. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +159 -32
  7. package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +3 -0
  8. package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +3 -0
  9. package/dist/bundling-sources/shared_libs/play-runtime/secret-capability.ts +32 -7
  10. package/dist/bundling-sources/shared_libs/play-runtime/tool-response-contract.ts +89 -0
  11. package/dist/bundling-sources/shared_libs/play-runtime/tool-result-types.ts +29 -3
  12. package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +203 -16
  13. package/dist/bundling-sources/shared_libs/plays/artifact-types.ts +3 -0
  14. package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +6 -3
  15. package/dist/bundling-sources/shared_libs/plays/contracts.ts +14 -0
  16. package/dist/cli/index.js +83 -9
  17. package/dist/cli/index.mjs +83 -9
  18. package/dist/{compiler-manifest-DFBtSjB2.d.mts → compiler-manifest-BX85pKXW.d.mts} +11 -4
  19. package/dist/{compiler-manifest-DFBtSjB2.d.ts → compiler-manifest-BX85pKXW.d.ts} +11 -4
  20. package/dist/index.d.mts +14 -3
  21. package/dist/index.d.ts +14 -3
  22. package/dist/index.js +85 -4
  23. package/dist/index.mjs +85 -4
  24. package/dist/install-integrity.json +3 -2
  25. package/dist/plays/bundle-play-file.d.mts +12 -2
  26. package/dist/plays/bundle-play-file.d.ts +12 -2
  27. package/dist/plays/bundle-play-file.mjs +7 -2
  28. package/package.json +1 -1
package/dist/cli/index.js CHANGED
@@ -1044,7 +1044,11 @@ var SDK_RELEASE = {
1044
1044
  // 0.2.0 makes Dataset Handles uniformly async-only after 0.1.320 briefly
1045
1045
  // exposed storage-dependent synchronous access. This deliberate minor
1046
1046
  // release keeps lazy paging semantics independent of row residency.
1047
- version: "0.2.73",
1047
+ // 0.3.0 introduces raw-v2: complete scrubbed provider responses are
1048
+ // available at toolResponse.rawV2 while toolResponse.raw and all declared
1049
+ // getters keep their established compatibility behavior.
1050
+ version: "0.3.0",
1051
+ updateSummary: "New raw-v2 tool responses preserve complete scrubbed provider envelopes at toolResponse.rawV2, including JSON:API included resources, links, cursors, and totals. Existing toolResponse.raw and declared getters keep working unchanged.",
1048
1052
  contracts: {
1049
1053
  api: {
1050
1054
  name: "sdk-http-api",
@@ -3759,12 +3763,33 @@ function normalizePlayRuntimeEnvironment(value) {
3759
3763
  return typeof value === "string" && PLAY_RUNTIME_ENVIRONMENTS.includes(value) ? value : null;
3760
3764
  }
3761
3765
 
3766
+ // ../shared_libs/play-runtime/tool-response-contract.ts
3767
+ var RAW_V2_TOOL_RESPONSE_CONTRACT = "raw-v2";
3768
+ function legacyRawFromToolResponseRawV2(rawV2, view, responseMeta) {
3769
+ const legacyRaw = view === "data" && rawV2 && typeof rawV2 === "object" && !Array.isArray(rawV2) ? rawV2.data : rawV2;
3770
+ const deeplineBilling = responseMeta?.deepline_billing;
3771
+ if (view === "rawV2" && deeplineBilling !== void 0 && legacyRaw && typeof legacyRaw === "object" && !Array.isArray(legacyRaw)) {
3772
+ return {
3773
+ ...legacyRaw,
3774
+ deepline_billing: deeplineBilling
3775
+ };
3776
+ }
3777
+ return legacyRaw;
3778
+ }
3779
+ function providerMetaFromToolResponseRawV2(rawV2, view) {
3780
+ if (view !== "data" || !rawV2 || typeof rawV2 !== "object" || Array.isArray(rawV2)) {
3781
+ return void 0;
3782
+ }
3783
+ const meta = rawV2.meta;
3784
+ return meta && typeof meta === "object" && !Array.isArray(meta) ? meta : void 0;
3785
+ }
3786
+
3762
3787
  // src/client.ts
3763
3788
  var TERMINAL_PLAY_STATUSES = /* @__PURE__ */ new Set(["completed", "failed", "cancelled"]);
3764
3789
  var INCLUDE_TOOL_METADATA_HEADER = "x-deepline-include-tool-metadata";
3765
3790
  var EXECUTE_RESPONSE_CONTRACT_HEADER = "x-deepline-execute-response-contract";
3766
3791
  var EXECUTE_RESPONSE_INTENT_HEADER = "x-deepline-execute-response-intent";
3767
- var V2_EXECUTE_RESPONSE_CONTRACT = "v2-tool-response";
3792
+ var RAW_V2_EXECUTE_RESPONSE_CONTRACT = RAW_V2_TOOL_RESPONSE_CONTRACT;
3768
3793
  var COMPILE_MANIFEST_RETRY_DELAYS_MS = [250, 1e3];
3769
3794
  var REGISTER_PLAY_ARTIFACTS_COMPILE_CONCURRENCY = 3;
3770
3795
  var REGISTER_PLAY_ARTIFACTS_MAX_BATCH_COUNT = 3;
@@ -3979,6 +4004,50 @@ function requireTargetBillingIdempotencyKey(value) {
3979
4004
  function isRecord7(value) {
3980
4005
  return Boolean(value && typeof value === "object" && !Array.isArray(value));
3981
4006
  }
4007
+ function materializeToolExecutionResponse(response) {
4008
+ const toolResponse = response.toolResponse;
4009
+ if (!toolResponse && isRecord7(response.result)) {
4010
+ const legacyResult = response.result;
4011
+ if (Object.prototype.hasOwnProperty.call(legacyResult, "data")) {
4012
+ const legacyMeta = isRecord7(legacyResult.meta) ? legacyResult.meta : void 0;
4013
+ return {
4014
+ ...response,
4015
+ toolResponse: {
4016
+ raw: legacyResult.data,
4017
+ ...legacyMeta ? { meta: legacyMeta } : {}
4018
+ }
4019
+ };
4020
+ }
4021
+ }
4022
+ if (!toolResponse || Object.prototype.hasOwnProperty.call(toolResponse, "raw")) {
4023
+ return response;
4024
+ }
4025
+ const rawV2 = toolResponse.rawV2;
4026
+ const view = toolResponse.view;
4027
+ const providerMeta = providerMetaFromToolResponseRawV2(
4028
+ rawV2,
4029
+ view ?? "rawV2"
4030
+ );
4031
+ const responseMeta = isRecord7(toolResponse.responseMeta) ? toolResponse.responseMeta : void 0;
4032
+ return {
4033
+ ...response,
4034
+ toolResponse: {
4035
+ ...toolResponse,
4036
+ raw: legacyRawFromToolResponseRawV2(
4037
+ rawV2,
4038
+ view ?? "rawV2",
4039
+ responseMeta
4040
+ ),
4041
+ ...toolResponse.meta || providerMeta || responseMeta ? {
4042
+ meta: {
4043
+ ...toolResponse.meta ?? {},
4044
+ ...providerMeta ?? {},
4045
+ ...responseMeta ?? {}
4046
+ }
4047
+ } : {}
4048
+ }
4049
+ };
4050
+ }
3982
4051
  function isPrebuiltPlayDescription(play) {
3983
4052
  return play.origin === "prebuilt" || play.ownerType === "deepline";
3984
4053
  }
@@ -4528,14 +4597,14 @@ var DeeplineClient = class {
4528
4597
  */
4529
4598
  async executeTool(toolId, input2, options) {
4530
4599
  const headers = {
4531
- [EXECUTE_RESPONSE_CONTRACT_HEADER]: V2_EXECUTE_RESPONSE_CONTRACT,
4600
+ [EXECUTE_RESPONSE_CONTRACT_HEADER]: RAW_V2_EXECUTE_RESPONSE_CONTRACT,
4532
4601
  [TOOL_EXECUTION_ERROR_SCHEMA_HEADER]: String(
4533
4602
  TOOL_EXECUTION_ERROR_SCHEMA_VERSION
4534
4603
  ),
4535
4604
  ...options?.includeToolMetadata ? { [INCLUDE_TOOL_METADATA_HEADER]: "true" } : {},
4536
4605
  [EXECUTE_RESPONSE_INTENT_HEADER]: options?.responseIntent ?? "raw"
4537
4606
  };
4538
- return this.http.post(
4607
+ const response = await this.http.post(
4539
4608
  `/api/v2/integrations/${encodeURIComponent(toolId)}/execute`,
4540
4609
  {
4541
4610
  payload: input2,
@@ -4549,6 +4618,7 @@ var DeeplineClient = class {
4549
4618
  toolId
4550
4619
  }
4551
4620
  );
4621
+ return materializeToolExecutionResponse(response);
4552
4622
  }
4553
4623
  /**
4554
4624
  * Back-compatible alias for {@link executeTool}.
@@ -16604,6 +16674,7 @@ var PLAY_AUTHORING_CLOUD_TYPE_DECLARATIONS = [
16604
16674
  "declare const SECRET_HANDLE_BRAND: unique symbol;",
16605
16675
  "export type SecretHandle = { readonly [SECRET_HANDLE_BRAND]: never; readonly name: string; toString(): string; toJSON(): never };",
16606
16676
  "export type SecretAuth = { readonly kind: 'bearer' | 'header'; readonly secret: SecretHandle; readonly header?: string };",
16677
+ "export type SecretAuthInput = SecretAuth | readonly SecretAuth[];",
16607
16678
  "export type PlayInputContract<TInput> = { readonly schema: Record<string, unknown>; readonly __inputType?: TInput };",
16608
16679
  "export type PlayReturnObject = Record<string, unknown> & { readonly _metadata?: never };",
16609
16680
  "export type CsvRenameMap = Record<string, string | readonly string[]>;",
@@ -16652,7 +16723,7 @@ var PLAY_AUTHORING_CLOUD_TYPE_DECLARATIONS = [
16652
16723
  ` customerDb: { query<TRow extends Record<string, unknown> = Record<string, unknown>>(statement: SqlQuery, options?: { maxRows?: ${cloudReferenceType("ctx.customerDb.query.options.maxRows")}; timeoutMs?: ${cloudReferenceType("ctx.customerDb.query.options.timeoutMs")} }): Promise<TRow[]> };`,
16653
16724
  ` tool<K extends string>(key: ${cloudReferenceType("ctx.tool.key")}, toolId: K, input: ${cloudReferenceType("ctx.tool.input")}, options?: { description?: ${cloudReferenceType("ctx.tool.options.description")} }): Promise<ToolExecutionOutput<K>>;`,
16654
16725
  " step<T>(id: string, run: () => T | Promise<T>, options?: RuntimeStepOptions): Promise<T>;",
16655
- " fetch(key: string, url: string | URL, init?: RequestInit & { headers?: HeadersInit & { 'Idempotency-Key'?: string; 'X-Idempotency-Key'?: string }; auth?: SecretAuth }, options?: FetchOptions): Promise<PlayFetchResponse>;",
16726
+ " fetch(key: string, url: string | URL, init?: RequestInit & { headers?: HeadersInit & { 'Idempotency-Key'?: string; 'X-Idempotency-Key'?: string }; auth?: SecretAuthInput }, options?: FetchOptions): Promise<PlayFetchResponse>;",
16656
16727
  " secrets: { get(name: string): SecretHandle; bearer(secret: SecretHandle): SecretAuth; header(header: string, secret: SecretHandle): SecretAuth };",
16657
16728
  ` runPlay<TOutput = unknown>(key: string, playRef: ${cloudReferenceType("ctx.runPlay.playRef")}, input: ${cloudReferenceType("ctx.runPlay.input")}, options: PlayCallOptions): Promise<TOutput>;`,
16658
16729
  " log(message: string): void;",
@@ -40753,9 +40824,7 @@ function shouldSkipSelfUpdate() {
40753
40824
  function parseSemver(version) {
40754
40825
  const trimmed = version?.trim();
40755
40826
  if (!trimmed) return null;
40756
- const match = /^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/.exec(
40757
- trimmed
40758
- );
40827
+ const match = /^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/.exec(trimmed);
40759
40828
  if (!match) return null;
40760
40829
  return {
40761
40830
  major: Number(match[1]),
@@ -40846,7 +40915,12 @@ async function maybeAutoUpdateAndRelaunch(response) {
40846
40915
  );
40847
40916
  return false;
40848
40917
  }
40849
- process.stderr.write("Deepline SDK/CLI updated; rerunning command.\n");
40918
+ const updateSummary = response.update_summary ? `
40919
+ What changed in ${response.update_summary.version}: ${response.update_summary.summary}` : "";
40920
+ process.stderr.write(
40921
+ `Deepline SDK/CLI updated; rerunning command.${updateSummary}
40922
+ `
40923
+ );
40850
40924
  const exitCode = await relaunchCurrentCommand(plan);
40851
40925
  process.exit(exitCode);
40852
40926
  return true;
@@ -1030,7 +1030,11 @@ var SDK_RELEASE = {
1030
1030
  // 0.2.0 makes Dataset Handles uniformly async-only after 0.1.320 briefly
1031
1031
  // exposed storage-dependent synchronous access. This deliberate minor
1032
1032
  // release keeps lazy paging semantics independent of row residency.
1033
- version: "0.2.73",
1033
+ // 0.3.0 introduces raw-v2: complete scrubbed provider responses are
1034
+ // available at toolResponse.rawV2 while toolResponse.raw and all declared
1035
+ // getters keep their established compatibility behavior.
1036
+ version: "0.3.0",
1037
+ updateSummary: "New raw-v2 tool responses preserve complete scrubbed provider envelopes at toolResponse.rawV2, including JSON:API included resources, links, cursors, and totals. Existing toolResponse.raw and declared getters keep working unchanged.",
1034
1038
  contracts: {
1035
1039
  api: {
1036
1040
  name: "sdk-http-api",
@@ -3745,12 +3749,33 @@ function normalizePlayRuntimeEnvironment(value) {
3745
3749
  return typeof value === "string" && PLAY_RUNTIME_ENVIRONMENTS.includes(value) ? value : null;
3746
3750
  }
3747
3751
 
3752
+ // ../shared_libs/play-runtime/tool-response-contract.ts
3753
+ var RAW_V2_TOOL_RESPONSE_CONTRACT = "raw-v2";
3754
+ function legacyRawFromToolResponseRawV2(rawV2, view, responseMeta) {
3755
+ const legacyRaw = view === "data" && rawV2 && typeof rawV2 === "object" && !Array.isArray(rawV2) ? rawV2.data : rawV2;
3756
+ const deeplineBilling = responseMeta?.deepline_billing;
3757
+ if (view === "rawV2" && deeplineBilling !== void 0 && legacyRaw && typeof legacyRaw === "object" && !Array.isArray(legacyRaw)) {
3758
+ return {
3759
+ ...legacyRaw,
3760
+ deepline_billing: deeplineBilling
3761
+ };
3762
+ }
3763
+ return legacyRaw;
3764
+ }
3765
+ function providerMetaFromToolResponseRawV2(rawV2, view) {
3766
+ if (view !== "data" || !rawV2 || typeof rawV2 !== "object" || Array.isArray(rawV2)) {
3767
+ return void 0;
3768
+ }
3769
+ const meta = rawV2.meta;
3770
+ return meta && typeof meta === "object" && !Array.isArray(meta) ? meta : void 0;
3771
+ }
3772
+
3748
3773
  // src/client.ts
3749
3774
  var TERMINAL_PLAY_STATUSES = /* @__PURE__ */ new Set(["completed", "failed", "cancelled"]);
3750
3775
  var INCLUDE_TOOL_METADATA_HEADER = "x-deepline-include-tool-metadata";
3751
3776
  var EXECUTE_RESPONSE_CONTRACT_HEADER = "x-deepline-execute-response-contract";
3752
3777
  var EXECUTE_RESPONSE_INTENT_HEADER = "x-deepline-execute-response-intent";
3753
- var V2_EXECUTE_RESPONSE_CONTRACT = "v2-tool-response";
3778
+ var RAW_V2_EXECUTE_RESPONSE_CONTRACT = RAW_V2_TOOL_RESPONSE_CONTRACT;
3754
3779
  var COMPILE_MANIFEST_RETRY_DELAYS_MS = [250, 1e3];
3755
3780
  var REGISTER_PLAY_ARTIFACTS_COMPILE_CONCURRENCY = 3;
3756
3781
  var REGISTER_PLAY_ARTIFACTS_MAX_BATCH_COUNT = 3;
@@ -3965,6 +3990,50 @@ function requireTargetBillingIdempotencyKey(value) {
3965
3990
  function isRecord7(value) {
3966
3991
  return Boolean(value && typeof value === "object" && !Array.isArray(value));
3967
3992
  }
3993
+ function materializeToolExecutionResponse(response) {
3994
+ const toolResponse = response.toolResponse;
3995
+ if (!toolResponse && isRecord7(response.result)) {
3996
+ const legacyResult = response.result;
3997
+ if (Object.prototype.hasOwnProperty.call(legacyResult, "data")) {
3998
+ const legacyMeta = isRecord7(legacyResult.meta) ? legacyResult.meta : void 0;
3999
+ return {
4000
+ ...response,
4001
+ toolResponse: {
4002
+ raw: legacyResult.data,
4003
+ ...legacyMeta ? { meta: legacyMeta } : {}
4004
+ }
4005
+ };
4006
+ }
4007
+ }
4008
+ if (!toolResponse || Object.prototype.hasOwnProperty.call(toolResponse, "raw")) {
4009
+ return response;
4010
+ }
4011
+ const rawV2 = toolResponse.rawV2;
4012
+ const view = toolResponse.view;
4013
+ const providerMeta = providerMetaFromToolResponseRawV2(
4014
+ rawV2,
4015
+ view ?? "rawV2"
4016
+ );
4017
+ const responseMeta = isRecord7(toolResponse.responseMeta) ? toolResponse.responseMeta : void 0;
4018
+ return {
4019
+ ...response,
4020
+ toolResponse: {
4021
+ ...toolResponse,
4022
+ raw: legacyRawFromToolResponseRawV2(
4023
+ rawV2,
4024
+ view ?? "rawV2",
4025
+ responseMeta
4026
+ ),
4027
+ ...toolResponse.meta || providerMeta || responseMeta ? {
4028
+ meta: {
4029
+ ...toolResponse.meta ?? {},
4030
+ ...providerMeta ?? {},
4031
+ ...responseMeta ?? {}
4032
+ }
4033
+ } : {}
4034
+ }
4035
+ };
4036
+ }
3968
4037
  function isPrebuiltPlayDescription(play) {
3969
4038
  return play.origin === "prebuilt" || play.ownerType === "deepline";
3970
4039
  }
@@ -4514,14 +4583,14 @@ var DeeplineClient = class {
4514
4583
  */
4515
4584
  async executeTool(toolId, input2, options) {
4516
4585
  const headers = {
4517
- [EXECUTE_RESPONSE_CONTRACT_HEADER]: V2_EXECUTE_RESPONSE_CONTRACT,
4586
+ [EXECUTE_RESPONSE_CONTRACT_HEADER]: RAW_V2_EXECUTE_RESPONSE_CONTRACT,
4518
4587
  [TOOL_EXECUTION_ERROR_SCHEMA_HEADER]: String(
4519
4588
  TOOL_EXECUTION_ERROR_SCHEMA_VERSION
4520
4589
  ),
4521
4590
  ...options?.includeToolMetadata ? { [INCLUDE_TOOL_METADATA_HEADER]: "true" } : {},
4522
4591
  [EXECUTE_RESPONSE_INTENT_HEADER]: options?.responseIntent ?? "raw"
4523
4592
  };
4524
- return this.http.post(
4593
+ const response = await this.http.post(
4525
4594
  `/api/v2/integrations/${encodeURIComponent(toolId)}/execute`,
4526
4595
  {
4527
4596
  payload: input2,
@@ -4535,6 +4604,7 @@ var DeeplineClient = class {
4535
4604
  toolId
4536
4605
  }
4537
4606
  );
4607
+ return materializeToolExecutionResponse(response);
4538
4608
  }
4539
4609
  /**
4540
4610
  * Back-compatible alias for {@link executeTool}.
@@ -16657,6 +16727,7 @@ var PLAY_AUTHORING_CLOUD_TYPE_DECLARATIONS = [
16657
16727
  "declare const SECRET_HANDLE_BRAND: unique symbol;",
16658
16728
  "export type SecretHandle = { readonly [SECRET_HANDLE_BRAND]: never; readonly name: string; toString(): string; toJSON(): never };",
16659
16729
  "export type SecretAuth = { readonly kind: 'bearer' | 'header'; readonly secret: SecretHandle; readonly header?: string };",
16730
+ "export type SecretAuthInput = SecretAuth | readonly SecretAuth[];",
16660
16731
  "export type PlayInputContract<TInput> = { readonly schema: Record<string, unknown>; readonly __inputType?: TInput };",
16661
16732
  "export type PlayReturnObject = Record<string, unknown> & { readonly _metadata?: never };",
16662
16733
  "export type CsvRenameMap = Record<string, string | readonly string[]>;",
@@ -16705,7 +16776,7 @@ var PLAY_AUTHORING_CLOUD_TYPE_DECLARATIONS = [
16705
16776
  ` customerDb: { query<TRow extends Record<string, unknown> = Record<string, unknown>>(statement: SqlQuery, options?: { maxRows?: ${cloudReferenceType("ctx.customerDb.query.options.maxRows")}; timeoutMs?: ${cloudReferenceType("ctx.customerDb.query.options.timeoutMs")} }): Promise<TRow[]> };`,
16706
16777
  ` tool<K extends string>(key: ${cloudReferenceType("ctx.tool.key")}, toolId: K, input: ${cloudReferenceType("ctx.tool.input")}, options?: { description?: ${cloudReferenceType("ctx.tool.options.description")} }): Promise<ToolExecutionOutput<K>>;`,
16707
16778
  " step<T>(id: string, run: () => T | Promise<T>, options?: RuntimeStepOptions): Promise<T>;",
16708
- " fetch(key: string, url: string | URL, init?: RequestInit & { headers?: HeadersInit & { 'Idempotency-Key'?: string; 'X-Idempotency-Key'?: string }; auth?: SecretAuth }, options?: FetchOptions): Promise<PlayFetchResponse>;",
16779
+ " fetch(key: string, url: string | URL, init?: RequestInit & { headers?: HeadersInit & { 'Idempotency-Key'?: string; 'X-Idempotency-Key'?: string }; auth?: SecretAuthInput }, options?: FetchOptions): Promise<PlayFetchResponse>;",
16709
16780
  " secrets: { get(name: string): SecretHandle; bearer(secret: SecretHandle): SecretAuth; header(header: string, secret: SecretHandle): SecretAuth };",
16710
16781
  ` runPlay<TOutput = unknown>(key: string, playRef: ${cloudReferenceType("ctx.runPlay.playRef")}, input: ${cloudReferenceType("ctx.runPlay.input")}, options: PlayCallOptions): Promise<TOutput>;`,
16711
16782
  " log(message: string): void;",
@@ -40849,9 +40920,7 @@ function shouldSkipSelfUpdate() {
40849
40920
  function parseSemver(version) {
40850
40921
  const trimmed = version?.trim();
40851
40922
  if (!trimmed) return null;
40852
- const match = /^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/.exec(
40853
- trimmed
40854
- );
40923
+ const match = /^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/.exec(trimmed);
40855
40924
  if (!match) return null;
40856
40925
  return {
40857
40926
  major: Number(match[1]),
@@ -40942,7 +41011,12 @@ async function maybeAutoUpdateAndRelaunch(response) {
40942
41011
  );
40943
41012
  return false;
40944
41013
  }
40945
- process.stderr.write("Deepline SDK/CLI updated; rerunning command.\n");
41014
+ const updateSummary = response.update_summary ? `
41015
+ What changed in ${response.update_summary.version}: ${response.update_summary.summary}` : "";
41016
+ process.stderr.write(
41017
+ `Deepline SDK/CLI updated; rerunning command.${updateSummary}
41018
+ `
41019
+ );
40946
41020
  const exitCode = await relaunchCurrentCommand(plan);
40947
41021
  process.exit(exitCode);
40948
41022
  return true;
@@ -724,6 +724,10 @@ type ToolResultListAccessor<T = Record<string, unknown>, TKey extends string = s
724
724
  };
725
725
  type ToolResponseEnvelope<TData = unknown, TMeta = Record<string, unknown>> = {
726
726
  raw: TData;
727
+ /** Complete parsed and scrubbed provider response, materialized from raw-v2. */
728
+ rawV2?: unknown;
729
+ /** Durable descriptor for deriving the legacy raw view from `rawV2`. */
730
+ view?: 'data' | 'rawV2';
727
731
  meta?: TMeta;
728
732
  };
729
733
  type ToolExecuteResultBase<TResult = unknown, TMeta = Record<string, unknown>> = {
@@ -765,8 +769,9 @@ type ToolExecuteResultAccessors<TExtracted extends Record<string, unknown> = Par
765
769
  * Canonical result returned by Deepline tool execution.
766
770
  *
767
771
  * The top-level object is Deepline-owned execution metadata and semantic
768
- * extraction state. Raw tool/provider data lives under `toolResponse.raw`;
769
- * response metadata lives under `toolResponse.meta`. Semantic single-value
772
+ * extraction state. The canonical provider response lives under
773
+ * `toolResponse.rawV2`; `toolResponse.raw` remains the legacy compatibility
774
+ * projection. Response metadata lives under `toolResponse.meta`. Semantic single-value
770
775
  * getters live under `extractedValues.<name>.get()`, and list getters live
771
776
  * under `extractedLists.<name>.get()`.
772
777
  *
@@ -1162,6 +1167,8 @@ type PlaySecretAuth = {
1162
1167
  /** Header name, set only when `kind` is `header`. */
1163
1168
  readonly header?: string;
1164
1169
  };
1170
+ /** One or more resolved authentication schemes for an outbound request. */
1171
+ type PlaySecretAuthInput = PlaySecretAuth | readonly PlaySecretAuth[];
1165
1172
  /**
1166
1173
  * The `init` accepted by `ctx.fetch`. Same shape as `RequestInit` plus `auth`.
1167
1174
  *
@@ -1171,9 +1178,9 @@ type PlaySecretAwareRequestInit = Omit<RequestInit, 'headers'> & {
1171
1178
  /** Ordinary request headers, recorded in the durable receipt. Never interpolate a secret value here — use `auth`. */
1172
1179
  headers?: HeadersInit;
1173
1180
  /**
1174
- * The single authenticated header for this request. One value, not a list: exactly one `ctx.secrets` auth attaches per `ctx.fetch`. An API wanting two credentialed headers at once Supabase with both `apikey` and `Authorization` cannot express both. Put the must-stay-secret credential in `auth`; pass a genuinely non-secret second value in `headers`. If both are secret, the request needs a server-side proxy holding one of them.
1181
+ * One or more secret-backed authentication headers for this request. Pass a single `ctx.secrets` auth for the common case, or an array when an API requires multiple credentialed headers for example, Supabase with both `apikey` and `Authorization`. Every secret is resolved only while the request is attached, never stored in the durable receipt. Each auth entry must target a distinct header.
1175
1182
  */
1176
- auth?: PlaySecretAuth;
1183
+ auth?: PlaySecretAuthInput;
1177
1184
  };
1178
1185
  type PlayLooseObject = {
1179
1186
  [key: string]: PlayLooseObject;
@@ -724,6 +724,10 @@ type ToolResultListAccessor<T = Record<string, unknown>, TKey extends string = s
724
724
  };
725
725
  type ToolResponseEnvelope<TData = unknown, TMeta = Record<string, unknown>> = {
726
726
  raw: TData;
727
+ /** Complete parsed and scrubbed provider response, materialized from raw-v2. */
728
+ rawV2?: unknown;
729
+ /** Durable descriptor for deriving the legacy raw view from `rawV2`. */
730
+ view?: 'data' | 'rawV2';
727
731
  meta?: TMeta;
728
732
  };
729
733
  type ToolExecuteResultBase<TResult = unknown, TMeta = Record<string, unknown>> = {
@@ -765,8 +769,9 @@ type ToolExecuteResultAccessors<TExtracted extends Record<string, unknown> = Par
765
769
  * Canonical result returned by Deepline tool execution.
766
770
  *
767
771
  * The top-level object is Deepline-owned execution metadata and semantic
768
- * extraction state. Raw tool/provider data lives under `toolResponse.raw`;
769
- * response metadata lives under `toolResponse.meta`. Semantic single-value
772
+ * extraction state. The canonical provider response lives under
773
+ * `toolResponse.rawV2`; `toolResponse.raw` remains the legacy compatibility
774
+ * projection. Response metadata lives under `toolResponse.meta`. Semantic single-value
770
775
  * getters live under `extractedValues.<name>.get()`, and list getters live
771
776
  * under `extractedLists.<name>.get()`.
772
777
  *
@@ -1162,6 +1167,8 @@ type PlaySecretAuth = {
1162
1167
  /** Header name, set only when `kind` is `header`. */
1163
1168
  readonly header?: string;
1164
1169
  };
1170
+ /** One or more resolved authentication schemes for an outbound request. */
1171
+ type PlaySecretAuthInput = PlaySecretAuth | readonly PlaySecretAuth[];
1165
1172
  /**
1166
1173
  * The `init` accepted by `ctx.fetch`. Same shape as `RequestInit` plus `auth`.
1167
1174
  *
@@ -1171,9 +1178,9 @@ type PlaySecretAwareRequestInit = Omit<RequestInit, 'headers'> & {
1171
1178
  /** Ordinary request headers, recorded in the durable receipt. Never interpolate a secret value here — use `auth`. */
1172
1179
  headers?: HeadersInit;
1173
1180
  /**
1174
- * The single authenticated header for this request. One value, not a list: exactly one `ctx.secrets` auth attaches per `ctx.fetch`. An API wanting two credentialed headers at once Supabase with both `apikey` and `Authorization` cannot express both. Put the must-stay-secret credential in `auth`; pass a genuinely non-secret second value in `headers`. If both are secret, the request needs a server-side proxy holding one of them.
1181
+ * One or more secret-backed authentication headers for this request. Pass a single `ctx.secrets` auth for the common case, or an array when an API requires multiple credentialed headers for example, Supabase with both `apikey` and `Authorization`. Every secret is resolved only while the request is attached, never stored in the durable receipt. Each auth entry must target a distinct header.
1175
1182
  */
1176
- auth?: PlaySecretAuth;
1183
+ auth?: PlaySecretAuthInput;
1177
1184
  };
1178
1185
  type PlayLooseObject = {
1179
1186
  [key: string]: PlayLooseObject;
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { e as PlayRuntimeBackendId, c as PlayCompilerManifest, D as DeeplineError, f as ToolExecutionError, g as ToolExecutionErrorOptions, h as PlayAuthoringColumnMap, i as PlayAuthoringColumnResolver, j as PlayAuthoringRuntimeContext, k as PlayAuthoringConditionalStepResolver, l as PlayAuthoringCsvInput, m as PlayAuthoringCsvOptions, n as PlayAuthoringDatasetBuilder, o as PlayAuthoringDatasetColumnDefinition, p as PlayAuthoringDatasetColumnRunInput, q as ToolExecuteResult, r as PlayAuthoringReferenceLike, s as PlayReturnObject$1, t as PlayAuthoringDefineConfig, u as PlayAuthoringDefinedPlay, v as PlayAuthoringFetchOptions, w as PlayAuthoringFileInput, x as PlayAuthoringBindings, y as PlayAuthoringCallExecution, z as PlayAuthoringCallOptions, A as PlayAuthoringFetchResponse, B as PlayAuthoringInputContract, C as PlayAuthoringStepProgramStep, E as PlayAuthoringRuntimeStepOptions, F as PlaySqlListenerDeclaration, G as PlaySqlListenerEvent, H as PlaySqlListenerOperation, I as PlaySqlQuery, J as PlayAuthoringStepOptions, K as PlayAuthoringStepProgram, L as PlayAuthoringStepProgramResolver, M as PlayAuthoringStepResolver, N as PlayToolExecutionRequest, O as PlayAuthoringStepProgramOptions } from './compiler-manifest-DFBtSjB2.mjs';
2
- export { Q as DEEPLINE_EXTRACTOR_TARGETS, R as DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS, S as DeeplineEmailStatusGetterValue, U as DeeplineExtractorTarget, V as DeeplineGetterValue, W as DeeplineGetterValueMap, X as JOB_CHANGE_STATUS_VALUES, Y as JobChangeStatus, Z as PHONE_STATUS_VALUES, _ as PhoneStatus, $ as PlayDataset, a0 as PlayDatasetInput, a1 as PreviousCell, a2 as ProviderTransientError, a3 as ProviderTransientErrorCategory, a4 as ProviderUnavailableError, a5 as ProviderUnavailableReason, a6 as ToolExecutionErrorCategory, a7 as ToolExecutionErrorOrigin, a8 as ToolExecutionFailureV1, a9 as ToolExecutionNetworkKind, aa as ToolExecutionNetworkScope, ab as getProviderUnavailableReason, ac as isDeeplineExtractorTarget, ad as isProviderUnavailable, ae as isProviderWaterfallUnavailableError } from './compiler-manifest-DFBtSjB2.mjs';
1
+ import { e as PlayRuntimeBackendId, c as PlayCompilerManifest, D as DeeplineError, f as ToolExecutionError, g as ToolExecutionErrorOptions, h as PlayAuthoringColumnMap, i as PlayAuthoringColumnResolver, j as PlayAuthoringRuntimeContext, k as PlayAuthoringConditionalStepResolver, l as PlayAuthoringCsvInput, m as PlayAuthoringCsvOptions, n as PlayAuthoringDatasetBuilder, o as PlayAuthoringDatasetColumnDefinition, p as PlayAuthoringDatasetColumnRunInput, q as ToolExecuteResult, r as PlayAuthoringReferenceLike, s as PlayReturnObject$1, t as PlayAuthoringDefineConfig, u as PlayAuthoringDefinedPlay, v as PlayAuthoringFetchOptions, w as PlayAuthoringFileInput, x as PlayAuthoringBindings, y as PlayAuthoringCallExecution, z as PlayAuthoringCallOptions, A as PlayAuthoringFetchResponse, B as PlayAuthoringInputContract, C as PlayAuthoringStepProgramStep, E as PlayAuthoringRuntimeStepOptions, F as PlaySqlListenerDeclaration, G as PlaySqlListenerEvent, H as PlaySqlListenerOperation, I as PlaySqlQuery, J as PlayAuthoringStepOptions, K as PlayAuthoringStepProgram, L as PlayAuthoringStepProgramResolver, M as PlayAuthoringStepResolver, N as PlayToolExecutionRequest, O as PlayAuthoringStepProgramOptions } from './compiler-manifest-BX85pKXW.mjs';
2
+ export { Q as DEEPLINE_EXTRACTOR_TARGETS, R as DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS, S as DeeplineEmailStatusGetterValue, U as DeeplineExtractorTarget, V as DeeplineGetterValue, W as DeeplineGetterValueMap, X as JOB_CHANGE_STATUS_VALUES, Y as JobChangeStatus, Z as PHONE_STATUS_VALUES, _ as PhoneStatus, $ as PlayDataset, a0 as PlayDatasetInput, a1 as PreviousCell, a2 as ProviderTransientError, a3 as ProviderTransientErrorCategory, a4 as ProviderUnavailableError, a5 as ProviderUnavailableReason, a6 as ToolExecutionErrorCategory, a7 as ToolExecutionErrorOrigin, a8 as ToolExecutionFailureV1, a9 as ToolExecutionNetworkKind, aa as ToolExecutionNetworkScope, ab as getProviderUnavailableReason, ac as isDeeplineExtractorTarget, ad as isProviderUnavailable, ae as isProviderWaterfallUnavailableError } from './compiler-manifest-BX85pKXW.mjs';
3
3
  import '@sinclair/typebox';
4
4
 
5
5
  declare const FIXTURE_BEHAVIOR_VERSION: 1;
@@ -338,12 +338,19 @@ interface ToolDefinition {
338
338
  expression?: string;
339
339
  meaning?: string;
340
340
  };
341
+ canonicalToolResponse?: {
342
+ expression?: string;
343
+ meaning?: string;
344
+ };
341
345
  invalidGetterHint?: string;
342
346
  };
343
347
  toolExecutionResult?: {
344
348
  type?: 'ToolExecutionResult';
345
349
  toolResponse?: {
346
350
  raw?: string;
351
+ rawV2?: string;
352
+ view?: string;
353
+ responseMeta?: string;
347
354
  meta?: string;
348
355
  };
349
356
  meta?: string;
@@ -1948,7 +1955,8 @@ type ExecuteToolRawOptions = {
1948
1955
  /**
1949
1956
  * Standard provider/tool execution envelope returned by low-level SDK calls.
1950
1957
  *
1951
- * `toolResponse.raw` contains the provider result. `extractedValues` and
1958
+ * `toolResponse.rawV2` contains the complete scrubbed provider response;
1959
+ * `toolResponse.raw` is derived locally as the legacy provider-result projection. `extractedValues` and
1952
1960
  * `extractedLists` contain Deepline-normalized getters when the tool exposes
1953
1961
  * them. Billing fields are Deepline-facing and must not expose provider spend.
1954
1962
  */
@@ -1958,7 +1966,10 @@ type ToolExecution<TData = unknown, TMeta = Record<string, unknown>> = {
1958
1966
  meta?: Record<string, unknown>;
1959
1967
  toolResponse: {
1960
1968
  raw: TData;
1969
+ rawV2?: unknown;
1970
+ view?: 'data' | 'rawV2';
1961
1971
  meta?: TMeta;
1972
+ responseMeta?: TMeta;
1962
1973
  };
1963
1974
  extractedLists?: Record<string, unknown>;
1964
1975
  extractedValues?: Record<string, unknown>;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { e as PlayRuntimeBackendId, c as PlayCompilerManifest, D as DeeplineError, f as ToolExecutionError, g as ToolExecutionErrorOptions, h as PlayAuthoringColumnMap, i as PlayAuthoringColumnResolver, j as PlayAuthoringRuntimeContext, k as PlayAuthoringConditionalStepResolver, l as PlayAuthoringCsvInput, m as PlayAuthoringCsvOptions, n as PlayAuthoringDatasetBuilder, o as PlayAuthoringDatasetColumnDefinition, p as PlayAuthoringDatasetColumnRunInput, q as ToolExecuteResult, r as PlayAuthoringReferenceLike, s as PlayReturnObject$1, t as PlayAuthoringDefineConfig, u as PlayAuthoringDefinedPlay, v as PlayAuthoringFetchOptions, w as PlayAuthoringFileInput, x as PlayAuthoringBindings, y as PlayAuthoringCallExecution, z as PlayAuthoringCallOptions, A as PlayAuthoringFetchResponse, B as PlayAuthoringInputContract, C as PlayAuthoringStepProgramStep, E as PlayAuthoringRuntimeStepOptions, F as PlaySqlListenerDeclaration, G as PlaySqlListenerEvent, H as PlaySqlListenerOperation, I as PlaySqlQuery, J as PlayAuthoringStepOptions, K as PlayAuthoringStepProgram, L as PlayAuthoringStepProgramResolver, M as PlayAuthoringStepResolver, N as PlayToolExecutionRequest, O as PlayAuthoringStepProgramOptions } from './compiler-manifest-DFBtSjB2.js';
2
- export { Q as DEEPLINE_EXTRACTOR_TARGETS, R as DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS, S as DeeplineEmailStatusGetterValue, U as DeeplineExtractorTarget, V as DeeplineGetterValue, W as DeeplineGetterValueMap, X as JOB_CHANGE_STATUS_VALUES, Y as JobChangeStatus, Z as PHONE_STATUS_VALUES, _ as PhoneStatus, $ as PlayDataset, a0 as PlayDatasetInput, a1 as PreviousCell, a2 as ProviderTransientError, a3 as ProviderTransientErrorCategory, a4 as ProviderUnavailableError, a5 as ProviderUnavailableReason, a6 as ToolExecutionErrorCategory, a7 as ToolExecutionErrorOrigin, a8 as ToolExecutionFailureV1, a9 as ToolExecutionNetworkKind, aa as ToolExecutionNetworkScope, ab as getProviderUnavailableReason, ac as isDeeplineExtractorTarget, ad as isProviderUnavailable, ae as isProviderWaterfallUnavailableError } from './compiler-manifest-DFBtSjB2.js';
1
+ import { e as PlayRuntimeBackendId, c as PlayCompilerManifest, D as DeeplineError, f as ToolExecutionError, g as ToolExecutionErrorOptions, h as PlayAuthoringColumnMap, i as PlayAuthoringColumnResolver, j as PlayAuthoringRuntimeContext, k as PlayAuthoringConditionalStepResolver, l as PlayAuthoringCsvInput, m as PlayAuthoringCsvOptions, n as PlayAuthoringDatasetBuilder, o as PlayAuthoringDatasetColumnDefinition, p as PlayAuthoringDatasetColumnRunInput, q as ToolExecuteResult, r as PlayAuthoringReferenceLike, s as PlayReturnObject$1, t as PlayAuthoringDefineConfig, u as PlayAuthoringDefinedPlay, v as PlayAuthoringFetchOptions, w as PlayAuthoringFileInput, x as PlayAuthoringBindings, y as PlayAuthoringCallExecution, z as PlayAuthoringCallOptions, A as PlayAuthoringFetchResponse, B as PlayAuthoringInputContract, C as PlayAuthoringStepProgramStep, E as PlayAuthoringRuntimeStepOptions, F as PlaySqlListenerDeclaration, G as PlaySqlListenerEvent, H as PlaySqlListenerOperation, I as PlaySqlQuery, J as PlayAuthoringStepOptions, K as PlayAuthoringStepProgram, L as PlayAuthoringStepProgramResolver, M as PlayAuthoringStepResolver, N as PlayToolExecutionRequest, O as PlayAuthoringStepProgramOptions } from './compiler-manifest-BX85pKXW.js';
2
+ export { Q as DEEPLINE_EXTRACTOR_TARGETS, R as DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS, S as DeeplineEmailStatusGetterValue, U as DeeplineExtractorTarget, V as DeeplineGetterValue, W as DeeplineGetterValueMap, X as JOB_CHANGE_STATUS_VALUES, Y as JobChangeStatus, Z as PHONE_STATUS_VALUES, _ as PhoneStatus, $ as PlayDataset, a0 as PlayDatasetInput, a1 as PreviousCell, a2 as ProviderTransientError, a3 as ProviderTransientErrorCategory, a4 as ProviderUnavailableError, a5 as ProviderUnavailableReason, a6 as ToolExecutionErrorCategory, a7 as ToolExecutionErrorOrigin, a8 as ToolExecutionFailureV1, a9 as ToolExecutionNetworkKind, aa as ToolExecutionNetworkScope, ab as getProviderUnavailableReason, ac as isDeeplineExtractorTarget, ad as isProviderUnavailable, ae as isProviderWaterfallUnavailableError } from './compiler-manifest-BX85pKXW.js';
3
3
  import '@sinclair/typebox';
4
4
 
5
5
  declare const FIXTURE_BEHAVIOR_VERSION: 1;
@@ -338,12 +338,19 @@ interface ToolDefinition {
338
338
  expression?: string;
339
339
  meaning?: string;
340
340
  };
341
+ canonicalToolResponse?: {
342
+ expression?: string;
343
+ meaning?: string;
344
+ };
341
345
  invalidGetterHint?: string;
342
346
  };
343
347
  toolExecutionResult?: {
344
348
  type?: 'ToolExecutionResult';
345
349
  toolResponse?: {
346
350
  raw?: string;
351
+ rawV2?: string;
352
+ view?: string;
353
+ responseMeta?: string;
347
354
  meta?: string;
348
355
  };
349
356
  meta?: string;
@@ -1948,7 +1955,8 @@ type ExecuteToolRawOptions = {
1948
1955
  /**
1949
1956
  * Standard provider/tool execution envelope returned by low-level SDK calls.
1950
1957
  *
1951
- * `toolResponse.raw` contains the provider result. `extractedValues` and
1958
+ * `toolResponse.rawV2` contains the complete scrubbed provider response;
1959
+ * `toolResponse.raw` is derived locally as the legacy provider-result projection. `extractedValues` and
1952
1960
  * `extractedLists` contain Deepline-normalized getters when the tool exposes
1953
1961
  * them. Billing fields are Deepline-facing and must not expose provider spend.
1954
1962
  */
@@ -1958,7 +1966,10 @@ type ToolExecution<TData = unknown, TMeta = Record<string, unknown>> = {
1958
1966
  meta?: Record<string, unknown>;
1959
1967
  toolResponse: {
1960
1968
  raw: TData;
1969
+ rawV2?: unknown;
1970
+ view?: 'data' | 'rawV2';
1961
1971
  meta?: TMeta;
1972
+ responseMeta?: TMeta;
1962
1973
  };
1963
1974
  extractedLists?: Record<string, unknown>;
1964
1975
  extractedValues?: Record<string, unknown>;