deepline 0.3.228 → 0.3.230

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 (48) hide show
  1. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  2. package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +18 -0
  3. package/dist/bundling-sources/shared_libs/play-data-plane/contracts.ts +12 -0
  4. package/dist/bundling-sources/shared_libs/play-data-plane/index.ts +1 -0
  5. package/dist/bundling-sources/shared_libs/play-data-plane/sheet-column-storage.ts +252 -0
  6. package/dist/bundling-sources/shared_libs/play-data-plane/sheet-contract.ts +29 -8
  7. package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +19 -0
  8. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +297 -69
  9. package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +5 -0
  10. package/dist/bundling-sources/shared_libs/play-runtime/deployment/fly-machines.ts +38 -2
  11. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/gateway-adapter.ts +8 -3
  12. package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +9 -0
  13. package/dist/bundling-sources/shared_libs/play-runtime/resource-governor.ts +39 -0
  14. package/dist/bundling-sources/shared_libs/play-runtime/run-ledger.ts +293 -4
  15. package/dist/bundling-sources/shared_libs/play-runtime/run-snapshot-stream.ts +29 -0
  16. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +56 -11
  17. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/progress-sidecar.ts +1 -0
  18. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/local-process.ts +4 -0
  19. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/types.ts +4 -0
  20. package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +380 -183
  21. package/dist/bundling-sources/shared_libs/play-runtime/runtime-capacity-policy.ts +187 -14
  22. package/dist/bundling-sources/shared_libs/play-runtime/runtime-work-counters.ts +52 -2
  23. package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/runner-backend-adapter.ts +5 -0
  24. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +30 -2
  25. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-progress.ts +118 -6
  26. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +135 -21
  27. package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +1 -0
  28. package/dist/bundling-sources/shared_libs/plays/dataset.ts +16 -2
  29. package/dist/bundling-sources/shared_libs/plays/execution-pipeline.ts +72 -0
  30. package/dist/bundling-sources/shared_libs/plays/launch/prepare.ts +1 -3
  31. package/dist/bundling-sources/shared_libs/plays/sheet-filter.ts +9 -13
  32. package/dist/bundling-sources/shared_libs/plays/static-pipeline.ts +28 -31
  33. package/dist/cli/index.js +102 -2
  34. package/dist/cli/index.mjs +102 -2
  35. package/dist/{compiler-manifest-Dpd2hEet.d.mts → compiler-manifest-n8ZtPv2h.d.mts} +31 -21
  36. package/dist/{compiler-manifest-Dpd2hEet.d.ts → compiler-manifest-n8ZtPv2h.d.ts} +31 -21
  37. package/dist/index.d.mts +2 -2
  38. package/dist/index.d.ts +2 -2
  39. package/dist/index.js +98 -2
  40. package/dist/index.mjs +98 -2
  41. package/dist/install-integrity.json +4 -2
  42. package/dist/plays/bundle-play-file.d.mts +2 -2
  43. package/dist/plays/bundle-play-file.d.ts +2 -2
  44. package/dist/release.d.mts +1 -1
  45. package/dist/release.d.ts +1 -1
  46. package/dist/release.js +1 -1
  47. package/dist/release.mjs +1 -1
  48. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /// <reference path="./text-imports.d.ts" />
2
2
  import { z } from 'zod';
3
- import { c as PlayCompilerManifest, T as ToolResultBilling, A as AsyncPlayRunRef$1, i as PlayAuthoringColumnMap, j as PlayAuthoringColumnResolver, k as PlayAuthoringRuntimeContext, l as PlayAuthoringConditionalStepResolver, m as PlayAuthoringCsvInput, n as PlayAuthoringCsvOptions, o as PlayAuthoringDatasetBuilder, p as PlayAuthoringDatasetColumnDefinition, q as PlayAuthoringDatasetColumnRunInput, r as ToolExecuteResult, s as PlayAuthoringReferenceLike, t as PlayReturnObject$1, u as PlayAuthoringDefineConfig, v as PlayAuthoringDefinedPlay, w as PlayAuthoringFetchOptions, x as PlayAuthoringFileInput, y as PlayAuthoringAsyncCallOptions, z as PlayAuthoringBindings, B as PlayAuthoringCallExecution, C as PlayAuthoringCallOptions, D as PlayAuthoringFetchResponse, E as PlayAuthoringInputContract, F as PlayRunId$1, G as PlayAuthoringStepProgramStep, H as PlayAuthoringRuntimeStepOptions, I as PlaySqlListenerDeclaration, J as PlaySqlListenerEvent, K as PlaySqlListenerOperation, L as PlaySqlQuery, M as PlayAuthoringStepOptions, N as PlayAuthoringStepProgram, O as PlayAuthoringStepProgramResolver, Q as PlayAuthoringStepResolver, R as PlayToolExecutionRequest, S as PlayAuthoringStepProgramOptions, U as DeeplineError, V as ToolExecutionError, W as ToolExecutionErrorOptions } from './compiler-manifest-Dpd2hEet.js';
4
- export { X as CtxFetchHttpError, Y as DEEPLINE_EXTRACTOR_TARGETS, Z as DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS, _ as DeeplineEmailStatusGetterValue, $ as DeeplineExtractorTarget, a0 as DeeplineGetterValue, a1 as DeeplineGetterValueMap, a2 as JOB_CHANGE_STATUS_VALUES, a3 as JobChangeStatus, a4 as PHONE_STATUS_VALUES, a5 as PhoneStatus, a6 as PlayDataset, a7 as PlayDatasetInput, a8 as PreviousCell, a9 as ProviderTransientError, aa as ProviderTransientErrorCategory, ab as ProviderUnavailableError, ac as ProviderUnavailableReason, ad as ToolExecutionErrorCategory, ae as ToolExecutionErrorOrigin, af as ToolExecutionFailureV1, ag as ToolExecutionNetworkKind, ah as ToolExecutionNetworkScope, ai as ToolExecutionPublicDetails, aj as getProviderUnavailableReason, ak as isDeeplineExtractorTarget, al as isProviderUnavailable, am as isProviderWaterfallUnavailableError } from './compiler-manifest-Dpd2hEet.js';
3
+ import { c as PlayCompilerManifest, T as ToolResultBilling, A as AsyncPlayRunRef$1, i as PlayAuthoringColumnMap, j as PlayAuthoringColumnResolver, k as PlayAuthoringRuntimeContext, l as PlayAuthoringConditionalStepResolver, m as PlayAuthoringCsvInput, n as PlayAuthoringCsvOptions, o as PlayAuthoringDatasetBuilder, p as PlayAuthoringDatasetColumnDefinition, q as PlayAuthoringDatasetColumnRunInput, r as ToolExecuteResult, s as PlayAuthoringReferenceLike, t as PlayReturnObject$1, u as PlayAuthoringDefineConfig, v as PlayAuthoringDefinedPlay, w as PlayAuthoringFetchOptions, x as PlayAuthoringFileInput, y as PlayAuthoringAsyncCallOptions, z as PlayAuthoringBindings, B as PlayAuthoringCallExecution, C as PlayAuthoringCallOptions, D as PlayAuthoringFetchResponse, E as PlayAuthoringInputContract, F as PlayRunId$1, G as PlayAuthoringStepProgramStep, H as PlayAuthoringRuntimeStepOptions, I as PlaySqlListenerDeclaration, J as PlaySqlListenerEvent, K as PlaySqlListenerOperation, L as PlaySqlQuery, M as PlayAuthoringStepOptions, N as PlayAuthoringStepProgram, O as PlayAuthoringStepProgramResolver, Q as PlayAuthoringStepResolver, R as PlayToolExecutionRequest, S as PlayAuthoringStepProgramOptions, U as DeeplineError, V as ToolExecutionError, W as ToolExecutionErrorOptions } from './compiler-manifest-n8ZtPv2h.js';
4
+ export { X as CtxFetchHttpError, Y as DEEPLINE_EXTRACTOR_TARGETS, Z as DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS, _ as DeeplineEmailStatusGetterValue, $ as DeeplineExtractorTarget, a0 as DeeplineGetterValue, a1 as DeeplineGetterValueMap, a2 as JOB_CHANGE_STATUS_VALUES, a3 as JobChangeStatus, a4 as PHONE_STATUS_VALUES, a5 as PhoneStatus, a6 as PlayDataset, a7 as PlayDatasetInput, a8 as PreviousCell, a9 as ProviderTransientError, aa as ProviderTransientErrorCategory, ab as ProviderUnavailableError, ac as ProviderUnavailableReason, ad as ToolExecutionErrorCategory, ae as ToolExecutionErrorOrigin, af as ToolExecutionFailureV1, ag as ToolExecutionNetworkKind, ah as ToolExecutionNetworkScope, ai as ToolExecutionPublicDetails, aj as getProviderUnavailableReason, ak as isDeeplineExtractorTarget, al as isProviderUnavailable, am as isProviderWaterfallUnavailableError } from './compiler-manifest-n8ZtPv2h.js';
5
5
  import { MonitorFleetDefinition } from './monitor-fleet-contract.js';
6
6
  export { AdmittedMonitorFleetAuthoringContract, MONITOR_FLEET_AUTHORING_CONTRACT_CHANGELOG, MONITOR_FLEET_AUTHORING_CONTRACT_EDITION, MONITOR_FLEET_DOCUMENTATION, MONITOR_FLEET_FRONTIER_MAX_ROWS, MONITOR_FLEET_MAX_MEMBERS, MonitorFleetAuthoringContractEdition, MonitorFleetAuthoringContractResult, MonitorFleetColumn, MonitorFleetContractIssue, MonitorFleetExpression, MonitorFleetTemplate, admitMonitorFleetAuthoringContract, defineMonitorFleet, fleetColumn, fleetKey, lintMonitorFleetInput, validateMonitorFleetDefinition } from './monitor-fleet-contract.js';
7
7
  export { BatchMonitorInput, MonitorInputIssue, MonitorSpec as MonitorInputSpec, lintMonitorBatchInput, lintMonitorSpecTemplate, renderMonitorSpecTemplate } from './monitor-input-contract.js';
package/dist/index.js CHANGED
@@ -864,7 +864,7 @@ var SDK_RELEASE = {
864
864
  // getters keep their established compatibility behavior.
865
865
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
866
866
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
867
- version: "0.3.228",
867
+ version: "0.3.230",
868
868
  updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.",
869
869
  packageCapabilities: {
870
870
  updatePreferences: 1
@@ -3135,12 +3135,84 @@ function normalizeDatasetBornFrom(value) {
3135
3135
 
3136
3136
  // ../play-runtime/run-ledger.ts
3137
3137
  var LOG_TAIL_LIMIT = 100;
3138
+ var TERMINAL_STATUSES = /* @__PURE__ */ new Set([
3139
+ "completed",
3140
+ "failed",
3141
+ "cancelled",
3142
+ "terminated",
3143
+ "timed_out"
3144
+ ]);
3138
3145
  function isRecord5(value) {
3139
3146
  return Boolean(value && typeof value === "object" && !Array.isArray(value));
3140
3147
  }
3141
3148
  function finiteNumber(value) {
3142
3149
  return typeof value === "number" && Number.isFinite(value) ? value : null;
3143
3150
  }
3151
+ function nonnegativeSafeInteger(value) {
3152
+ return typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
3153
+ }
3154
+ function isWorkCounterSegmentId(value) {
3155
+ return typeof value === "string" && /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(
3156
+ value
3157
+ );
3158
+ }
3159
+ function normalizePlayRunLedgerTerminalWorkCounterSegment(value) {
3160
+ if (!isRecord5(value)) return void 0;
3161
+ if (!nonnegativeSafeInteger(value.attempt) || !nonnegativeSafeInteger(value.invocationSeq) || value.invocationSeq === 0 || !isWorkCounterSegmentId(value.segmentId)) {
3162
+ return void 0;
3163
+ }
3164
+ return {
3165
+ attempt: value.attempt,
3166
+ invocationSeq: value.invocationSeq,
3167
+ segmentId: value.segmentId
3168
+ };
3169
+ }
3170
+ function hasConfirmedPlayRunLedgerWorkCounters(snapshot) {
3171
+ const counters = snapshot.workCounters;
3172
+ const terminal = snapshot.terminalWorkCounterSegment;
3173
+ return Boolean(
3174
+ isTerminalPlayRunLedgerStatus(snapshot.status) && (snapshot.terminalSource === "worker" || snapshot.terminalSource === "system") && counters?.final && counters.completeThroughAttempt && counters.consistent && terminal && counters.attempt === terminal.attempt && counters.invocationSeq === terminal.invocationSeq && counters.segmentId === terminal.segmentId && Number.isSafeInteger(
3175
+ counters.completedLogicalCalls + counters.logicalCalls
3176
+ ) && Number.isSafeInteger(
3177
+ counters.completedProviderRequests + counters.providerRequests
3178
+ ) && Number.isSafeInteger(
3179
+ counters.completedProvider429s + counters.provider429s
3180
+ )
3181
+ );
3182
+ }
3183
+ function normalizeWorkCounters(value) {
3184
+ if (!isRecord5(value)) return void 0;
3185
+ for (const field of [
3186
+ "attempt",
3187
+ "invocationSeq",
3188
+ "logicalCalls",
3189
+ "providerRequests",
3190
+ "provider429s",
3191
+ "completedLogicalCalls",
3192
+ "completedProviderRequests",
3193
+ "completedProvider429s"
3194
+ ]) {
3195
+ if (!nonnegativeSafeInteger(value[field])) return void 0;
3196
+ }
3197
+ if (value.invocationSeq === 0 || !isWorkCounterSegmentId(value.segmentId) || typeof value.final !== "boolean" || typeof value.completeThroughAttempt !== "boolean" || typeof value.consistent !== "boolean") {
3198
+ return void 0;
3199
+ }
3200
+ return {
3201
+ ...value,
3202
+ attempt: value.attempt,
3203
+ invocationSeq: value.invocationSeq,
3204
+ segmentId: value.segmentId,
3205
+ logicalCalls: value.logicalCalls,
3206
+ providerRequests: value.providerRequests,
3207
+ provider429s: value.provider429s,
3208
+ final: value.final,
3209
+ completedLogicalCalls: value.completedLogicalCalls,
3210
+ completedProviderRequests: value.completedProviderRequests,
3211
+ completedProvider429s: value.completedProvider429s,
3212
+ completeThroughAttempt: value.completeThroughAttempt,
3213
+ consistent: value.consistent
3214
+ };
3215
+ }
3144
3216
  function optionalFiniteNumber(value) {
3145
3217
  const normalized = finiteNumber(value);
3146
3218
  return normalized === null ? void 0 : normalized;
@@ -3182,6 +3254,9 @@ function normalizePlayRunLedgerStatus(value) {
3182
3254
  return "unknown";
3183
3255
  }
3184
3256
  }
3257
+ function isTerminalPlayRunLedgerStatus(status) {
3258
+ return TERMINAL_STATUSES.has(status);
3259
+ }
3185
3260
  function summarizeRunRowOutcomes(snapshot) {
3186
3261
  let completedRows = 0;
3187
3262
  let failedRows = 0;
@@ -3316,6 +3391,10 @@ function normalizePlayRunLedgerSnapshot(value, fallback) {
3316
3391
  const error = Object.prototype.hasOwnProperty.call(value, "error") ? optionalNullableString(value.error) ?? null : fallback.error ?? null;
3317
3392
  const rawTail = Array.isArray(value.logTail) ? value.logTail : value.logs;
3318
3393
  const logTail = Array.isArray(rawTail) ? rawTail.filter((line) => typeof line === "string") : [];
3394
+ const workCounters = normalizeWorkCounters(value.workCounters);
3395
+ const terminalWorkCounterSegment = normalizePlayRunLedgerTerminalWorkCounterSegment(
3396
+ value.terminalWorkCounterSegment
3397
+ );
3319
3398
  return {
3320
3399
  runId: optionalString(value.runId) ?? fallback.runId,
3321
3400
  playName: optionalNullableString(value.playName) ?? fallback.playName ?? null,
@@ -3338,6 +3417,8 @@ function normalizePlayRunLedgerSnapshot(value, fallback) {
3338
3417
  (activityId) => typeof activityId === "string" && Boolean(activitiesById[activityId])
3339
3418
  ),
3340
3419
  activitiesById,
3420
+ ...workCounters ? { workCounters } : {},
3421
+ ...terminalWorkCounterSegment ? { terminalWorkCounterSegment } : {},
3341
3422
  logTail: logTail.slice(-LOG_TAIL_LIMIT),
3342
3423
  // Snapshots persisted before totalLogCount existed only know the retained
3343
3424
  // tail, so the best lower bound for the cumulative count is the tail size.
@@ -3545,6 +3626,13 @@ function buildSnapshotFromLedger(snapshot) {
3545
3626
  const liveStatus = normalizePlayRunLiveStatus(snapshot.status);
3546
3627
  const terminalRowOutcomes = isTerminalPlayRunLiveStatus(liveStatus) ? summarizeRunRowOutcomes(snapshot) : null;
3547
3628
  const rowOutcomes = terminalRowOutcomes && (Object.keys(snapshot.stepsById).length > 0 || terminalRowOutcomes.totalRows > 0 || (terminalRowOutcomes.supersededRows ?? 0) > 0) ? terminalRowOutcomes : null;
3629
+ const workCounters = snapshot.workCounters;
3630
+ const calls = workCounters ? {
3631
+ logicalCalls: workCounters.completedLogicalCalls + workCounters.logicalCalls,
3632
+ providerRequests: workCounters.completedProviderRequests + workCounters.providerRequests,
3633
+ provider429s: workCounters.completedProvider429s + workCounters.provider429s,
3634
+ confirmed: isTerminalPlayRunLiveStatus(liveStatus) && hasConfirmedPlayRunLedgerWorkCounters(snapshot)
3635
+ } : null;
3548
3636
  return {
3549
3637
  runId: snapshot.runId,
3550
3638
  status: liveStatus,
@@ -3569,7 +3657,10 @@ function buildSnapshotFromLedger(snapshot) {
3569
3657
  activeActivity: snapshot.activeActivityId ? snapshot.activitiesById[snapshot.activeActivityId] ?? null : null,
3570
3658
  nodeStates,
3571
3659
  activeNodeId: snapshot.activeStepId ?? null,
3572
- ...rowOutcomes ? { rowOutcomes } : {}
3660
+ ...rowOutcomes ? { rowOutcomes } : {},
3661
+ ...calls && Object.values(calls).every(
3662
+ (value) => typeof value === "boolean" || Number.isSafeInteger(value)
3663
+ ) ? { calls } : {}
3573
3664
  };
3574
3665
  }
3575
3666
  function buildPlayRunStatusSnapshot(input) {
@@ -8647,6 +8738,7 @@ var DeferredPlayDataset = class {
8647
8738
  backing;
8648
8739
  sourceLabel;
8649
8740
  tableNamespace;
8741
+ columnTypes;
8650
8742
  previewRows;
8651
8743
  previewColumns;
8652
8744
  workProgress;
@@ -8665,6 +8757,7 @@ var DeferredPlayDataset = class {
8665
8757
  this.previewColumns = inferPreviewColumns(this.previewRows);
8666
8758
  this.sourceLabel = input.sourceLabel ?? null;
8667
8759
  this.tableNamespace = input.tableNamespace ?? null;
8760
+ this.columnTypes = input.columnTypes;
8668
8761
  this.workProgress = input.workProgress;
8669
8762
  this.resolvers = input.resolvers;
8670
8763
  }
@@ -8773,6 +8866,7 @@ var DeferredPlayDataset = class {
8773
8866
  ...this.sourceLabel ? { sourceLabel: this.sourceLabel } : {},
8774
8867
  ...this.tableNamespace ? { tableNamespace: this.tableNamespace } : {},
8775
8868
  ...this.previewColumns ? { columns: this.previewColumns } : {},
8869
+ ...this.columnTypes ? { columnTypes: this.columnTypes } : {},
8776
8870
  ...this.workProgress ? { _metadata: { workProgress: this.workProgress } } : {},
8777
8871
  preview: [...this.previewRows]
8778
8872
  };
@@ -8868,6 +8962,7 @@ function createTransformedPlayDataset(source, transform, options) {
8868
8962
  backing: source.backing,
8869
8963
  sourceLabel,
8870
8964
  tableNamespace: options?.key ?? null,
8965
+ columnTypes: transform.kind === "map" ? void 0 : source.columnTypes,
8871
8966
  resolvers: {
8872
8967
  count,
8873
8968
  peek: async (limit) => collect(limit),
@@ -8955,6 +9050,7 @@ function createPlayDataset(rows, metadata) {
8955
9050
  residentRows: materializedRows,
8956
9051
  sourceLabel: metadata?.sourceLabel ?? null,
8957
9052
  tableNamespace: metadata?.tableNamespace ?? null,
9053
+ columnTypes: metadata?.columnTypes,
8958
9054
  resolvers: {
8959
9055
  count: async () => materializedRows.length,
8960
9056
  peek: async (limit) => materializedRows.slice(0, Math.max(0, limit)),
package/dist/index.mjs CHANGED
@@ -768,7 +768,7 @@ var SDK_RELEASE = {
768
768
  // getters keep their established compatibility behavior.
769
769
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
770
770
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
771
- version: "0.3.228",
771
+ version: "0.3.230",
772
772
  updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.",
773
773
  packageCapabilities: {
774
774
  updatePreferences: 1
@@ -3039,12 +3039,84 @@ function normalizeDatasetBornFrom(value) {
3039
3039
 
3040
3040
  // ../play-runtime/run-ledger.ts
3041
3041
  var LOG_TAIL_LIMIT = 100;
3042
+ var TERMINAL_STATUSES = /* @__PURE__ */ new Set([
3043
+ "completed",
3044
+ "failed",
3045
+ "cancelled",
3046
+ "terminated",
3047
+ "timed_out"
3048
+ ]);
3042
3049
  function isRecord5(value) {
3043
3050
  return Boolean(value && typeof value === "object" && !Array.isArray(value));
3044
3051
  }
3045
3052
  function finiteNumber(value) {
3046
3053
  return typeof value === "number" && Number.isFinite(value) ? value : null;
3047
3054
  }
3055
+ function nonnegativeSafeInteger(value) {
3056
+ return typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
3057
+ }
3058
+ function isWorkCounterSegmentId(value) {
3059
+ return typeof value === "string" && /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(
3060
+ value
3061
+ );
3062
+ }
3063
+ function normalizePlayRunLedgerTerminalWorkCounterSegment(value) {
3064
+ if (!isRecord5(value)) return void 0;
3065
+ if (!nonnegativeSafeInteger(value.attempt) || !nonnegativeSafeInteger(value.invocationSeq) || value.invocationSeq === 0 || !isWorkCounterSegmentId(value.segmentId)) {
3066
+ return void 0;
3067
+ }
3068
+ return {
3069
+ attempt: value.attempt,
3070
+ invocationSeq: value.invocationSeq,
3071
+ segmentId: value.segmentId
3072
+ };
3073
+ }
3074
+ function hasConfirmedPlayRunLedgerWorkCounters(snapshot) {
3075
+ const counters = snapshot.workCounters;
3076
+ const terminal = snapshot.terminalWorkCounterSegment;
3077
+ return Boolean(
3078
+ isTerminalPlayRunLedgerStatus(snapshot.status) && (snapshot.terminalSource === "worker" || snapshot.terminalSource === "system") && counters?.final && counters.completeThroughAttempt && counters.consistent && terminal && counters.attempt === terminal.attempt && counters.invocationSeq === terminal.invocationSeq && counters.segmentId === terminal.segmentId && Number.isSafeInteger(
3079
+ counters.completedLogicalCalls + counters.logicalCalls
3080
+ ) && Number.isSafeInteger(
3081
+ counters.completedProviderRequests + counters.providerRequests
3082
+ ) && Number.isSafeInteger(
3083
+ counters.completedProvider429s + counters.provider429s
3084
+ )
3085
+ );
3086
+ }
3087
+ function normalizeWorkCounters(value) {
3088
+ if (!isRecord5(value)) return void 0;
3089
+ for (const field of [
3090
+ "attempt",
3091
+ "invocationSeq",
3092
+ "logicalCalls",
3093
+ "providerRequests",
3094
+ "provider429s",
3095
+ "completedLogicalCalls",
3096
+ "completedProviderRequests",
3097
+ "completedProvider429s"
3098
+ ]) {
3099
+ if (!nonnegativeSafeInteger(value[field])) return void 0;
3100
+ }
3101
+ if (value.invocationSeq === 0 || !isWorkCounterSegmentId(value.segmentId) || typeof value.final !== "boolean" || typeof value.completeThroughAttempt !== "boolean" || typeof value.consistent !== "boolean") {
3102
+ return void 0;
3103
+ }
3104
+ return {
3105
+ ...value,
3106
+ attempt: value.attempt,
3107
+ invocationSeq: value.invocationSeq,
3108
+ segmentId: value.segmentId,
3109
+ logicalCalls: value.logicalCalls,
3110
+ providerRequests: value.providerRequests,
3111
+ provider429s: value.provider429s,
3112
+ final: value.final,
3113
+ completedLogicalCalls: value.completedLogicalCalls,
3114
+ completedProviderRequests: value.completedProviderRequests,
3115
+ completedProvider429s: value.completedProvider429s,
3116
+ completeThroughAttempt: value.completeThroughAttempt,
3117
+ consistent: value.consistent
3118
+ };
3119
+ }
3048
3120
  function optionalFiniteNumber(value) {
3049
3121
  const normalized = finiteNumber(value);
3050
3122
  return normalized === null ? void 0 : normalized;
@@ -3086,6 +3158,9 @@ function normalizePlayRunLedgerStatus(value) {
3086
3158
  return "unknown";
3087
3159
  }
3088
3160
  }
3161
+ function isTerminalPlayRunLedgerStatus(status) {
3162
+ return TERMINAL_STATUSES.has(status);
3163
+ }
3089
3164
  function summarizeRunRowOutcomes(snapshot) {
3090
3165
  let completedRows = 0;
3091
3166
  let failedRows = 0;
@@ -3220,6 +3295,10 @@ function normalizePlayRunLedgerSnapshot(value, fallback) {
3220
3295
  const error = Object.prototype.hasOwnProperty.call(value, "error") ? optionalNullableString(value.error) ?? null : fallback.error ?? null;
3221
3296
  const rawTail = Array.isArray(value.logTail) ? value.logTail : value.logs;
3222
3297
  const logTail = Array.isArray(rawTail) ? rawTail.filter((line) => typeof line === "string") : [];
3298
+ const workCounters = normalizeWorkCounters(value.workCounters);
3299
+ const terminalWorkCounterSegment = normalizePlayRunLedgerTerminalWorkCounterSegment(
3300
+ value.terminalWorkCounterSegment
3301
+ );
3223
3302
  return {
3224
3303
  runId: optionalString(value.runId) ?? fallback.runId,
3225
3304
  playName: optionalNullableString(value.playName) ?? fallback.playName ?? null,
@@ -3242,6 +3321,8 @@ function normalizePlayRunLedgerSnapshot(value, fallback) {
3242
3321
  (activityId) => typeof activityId === "string" && Boolean(activitiesById[activityId])
3243
3322
  ),
3244
3323
  activitiesById,
3324
+ ...workCounters ? { workCounters } : {},
3325
+ ...terminalWorkCounterSegment ? { terminalWorkCounterSegment } : {},
3245
3326
  logTail: logTail.slice(-LOG_TAIL_LIMIT),
3246
3327
  // Snapshots persisted before totalLogCount existed only know the retained
3247
3328
  // tail, so the best lower bound for the cumulative count is the tail size.
@@ -3449,6 +3530,13 @@ function buildSnapshotFromLedger(snapshot) {
3449
3530
  const liveStatus = normalizePlayRunLiveStatus(snapshot.status);
3450
3531
  const terminalRowOutcomes = isTerminalPlayRunLiveStatus(liveStatus) ? summarizeRunRowOutcomes(snapshot) : null;
3451
3532
  const rowOutcomes = terminalRowOutcomes && (Object.keys(snapshot.stepsById).length > 0 || terminalRowOutcomes.totalRows > 0 || (terminalRowOutcomes.supersededRows ?? 0) > 0) ? terminalRowOutcomes : null;
3533
+ const workCounters = snapshot.workCounters;
3534
+ const calls = workCounters ? {
3535
+ logicalCalls: workCounters.completedLogicalCalls + workCounters.logicalCalls,
3536
+ providerRequests: workCounters.completedProviderRequests + workCounters.providerRequests,
3537
+ provider429s: workCounters.completedProvider429s + workCounters.provider429s,
3538
+ confirmed: isTerminalPlayRunLiveStatus(liveStatus) && hasConfirmedPlayRunLedgerWorkCounters(snapshot)
3539
+ } : null;
3452
3540
  return {
3453
3541
  runId: snapshot.runId,
3454
3542
  status: liveStatus,
@@ -3473,7 +3561,10 @@ function buildSnapshotFromLedger(snapshot) {
3473
3561
  activeActivity: snapshot.activeActivityId ? snapshot.activitiesById[snapshot.activeActivityId] ?? null : null,
3474
3562
  nodeStates,
3475
3563
  activeNodeId: snapshot.activeStepId ?? null,
3476
- ...rowOutcomes ? { rowOutcomes } : {}
3564
+ ...rowOutcomes ? { rowOutcomes } : {},
3565
+ ...calls && Object.values(calls).every(
3566
+ (value) => typeof value === "boolean" || Number.isSafeInteger(value)
3567
+ ) ? { calls } : {}
3477
3568
  };
3478
3569
  }
3479
3570
  function buildPlayRunStatusSnapshot(input) {
@@ -8551,6 +8642,7 @@ var DeferredPlayDataset = class {
8551
8642
  backing;
8552
8643
  sourceLabel;
8553
8644
  tableNamespace;
8645
+ columnTypes;
8554
8646
  previewRows;
8555
8647
  previewColumns;
8556
8648
  workProgress;
@@ -8569,6 +8661,7 @@ var DeferredPlayDataset = class {
8569
8661
  this.previewColumns = inferPreviewColumns(this.previewRows);
8570
8662
  this.sourceLabel = input.sourceLabel ?? null;
8571
8663
  this.tableNamespace = input.tableNamespace ?? null;
8664
+ this.columnTypes = input.columnTypes;
8572
8665
  this.workProgress = input.workProgress;
8573
8666
  this.resolvers = input.resolvers;
8574
8667
  }
@@ -8677,6 +8770,7 @@ var DeferredPlayDataset = class {
8677
8770
  ...this.sourceLabel ? { sourceLabel: this.sourceLabel } : {},
8678
8771
  ...this.tableNamespace ? { tableNamespace: this.tableNamespace } : {},
8679
8772
  ...this.previewColumns ? { columns: this.previewColumns } : {},
8773
+ ...this.columnTypes ? { columnTypes: this.columnTypes } : {},
8680
8774
  ...this.workProgress ? { _metadata: { workProgress: this.workProgress } } : {},
8681
8775
  preview: [...this.previewRows]
8682
8776
  };
@@ -8772,6 +8866,7 @@ function createTransformedPlayDataset(source, transform, options) {
8772
8866
  backing: source.backing,
8773
8867
  sourceLabel,
8774
8868
  tableNamespace: options?.key ?? null,
8869
+ columnTypes: transform.kind === "map" ? void 0 : source.columnTypes,
8775
8870
  resolvers: {
8776
8871
  count,
8777
8872
  peek: async (limit) => collect(limit),
@@ -8859,6 +8954,7 @@ function createPlayDataset(rows, metadata) {
8859
8954
  residentRows: materializedRows,
8860
8955
  sourceLabel: metadata?.sourceLabel ?? null,
8861
8956
  tableNamespace: metadata?.tableNamespace ?? null,
8957
+ columnTypes: metadata?.columnTypes,
8862
8958
  resolvers: {
8863
8959
  count: async () => materializedRows.length,
8864
8960
  peek: async (limit) => materializedRows.slice(0, Math.max(0, limit)),
@@ -118,6 +118,7 @@
118
118
  "dist/bundling-sources/shared_libs/play-data-plane/r2.ts",
119
119
  "dist/bundling-sources/shared_libs/play-data-plane/runtime-sheet-orm.ts",
120
120
  "dist/bundling-sources/shared_libs/play-data-plane/runtime-sheet-storage-contract.ts",
121
+ "dist/bundling-sources/shared_libs/play-data-plane/sheet-column-storage.ts",
121
122
  "dist/bundling-sources/shared_libs/play-data-plane/sheet-contract.ts",
122
123
  "dist/bundling-sources/shared_libs/play-runtime/activity-observation.ts",
123
124
  "dist/bundling-sources/shared_libs/play-runtime/admission-transport-policy.ts",
@@ -488,6 +489,7 @@
488
489
  "dist/bundling-sources/shared_libs/plays/email-status.ts",
489
490
  "dist/bundling-sources/shared_libs/plays/enrich-compat-adapter.ts",
490
491
  "dist/bundling-sources/shared_libs/plays/enrich-play-compiler.ts",
492
+ "dist/bundling-sources/shared_libs/plays/execution-pipeline.ts",
491
493
  "dist/bundling-sources/shared_libs/plays/extractor-targets.ts",
492
494
  "dist/bundling-sources/shared_libs/plays/file-refs.ts",
493
495
  "dist/bundling-sources/shared_libs/plays/input-contract-definition.ts",
@@ -567,8 +569,8 @@
567
569
  "dist/cli/index.js",
568
570
  "dist/cli/index.mjs",
569
571
  "dist/cli/text-imports.d.ts",
570
- "dist/compiler-manifest-Dpd2hEet.d.mts",
571
- "dist/compiler-manifest-Dpd2hEet.d.ts",
572
+ "dist/compiler-manifest-n8ZtPv2h.d.mts",
573
+ "dist/compiler-manifest-n8ZtPv2h.d.ts",
572
574
  "dist/helpers.d.mts",
573
575
  "dist/helpers.d.ts",
574
576
  "dist/helpers.js",
@@ -1,6 +1,6 @@
1
1
  /// <reference path="./text-imports.d.ts" />
2
- import { P as PlayArtifactKind, a as PlayBundleArtifact, b as PlaySandboxRuntimeDeclaration, c as PlayCompilerManifest } from '../compiler-manifest-Dpd2hEet.mjs';
3
- export { d as PLAY_ARTIFACT_KINDS, e as PlayArtifactCompatibility, f as PlayImportPolicy, g as PlayPackageImport, h as PlayRuntimeFeature } from '../compiler-manifest-Dpd2hEet.mjs';
2
+ import { P as PlayArtifactKind, a as PlayBundleArtifact, b as PlaySandboxRuntimeDeclaration, c as PlayCompilerManifest } from '../compiler-manifest-n8ZtPv2h.mjs';
3
+ export { d as PLAY_ARTIFACT_KINDS, e as PlayArtifactCompatibility, f as PlayImportPolicy, g as PlayPackageImport, h as PlayRuntimeFeature } from '../compiler-manifest-n8ZtPv2h.mjs';
4
4
  import '@sinclair/typebox';
5
5
 
6
6
  type ImportedPlayDependency = {
@@ -1,6 +1,6 @@
1
1
  /// <reference path="./text-imports.d.ts" />
2
- import { P as PlayArtifactKind, a as PlayBundleArtifact, b as PlaySandboxRuntimeDeclaration, c as PlayCompilerManifest } from '../compiler-manifest-Dpd2hEet.js';
3
- export { d as PLAY_ARTIFACT_KINDS, e as PlayArtifactCompatibility, f as PlayImportPolicy, g as PlayPackageImport, h as PlayRuntimeFeature } from '../compiler-manifest-Dpd2hEet.js';
2
+ import { P as PlayArtifactKind, a as PlayBundleArtifact, b as PlaySandboxRuntimeDeclaration, c as PlayCompilerManifest } from '../compiler-manifest-n8ZtPv2h.js';
3
+ export { d as PLAY_ARTIFACT_KINDS, e as PlayArtifactCompatibility, f as PlayImportPolicy, g as PlayPackageImport, h as PlayRuntimeFeature } from '../compiler-manifest-n8ZtPv2h.js';
4
4
  import '@sinclair/typebox';
5
5
 
6
6
  type ImportedPlayDependency = {
@@ -149,7 +149,7 @@ type SdkRelease = {
149
149
  supportPolicy: SdkSupportPolicy;
150
150
  };
151
151
  declare const SDK_RELEASE: {
152
- readonly version: "0.3.228";
152
+ readonly version: "0.3.230";
153
153
  readonly updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.";
154
154
  readonly packageCapabilities: {
155
155
  readonly updatePreferences: 1;
package/dist/release.d.ts CHANGED
@@ -149,7 +149,7 @@ type SdkRelease = {
149
149
  supportPolicy: SdkSupportPolicy;
150
150
  };
151
151
  declare const SDK_RELEASE: {
152
- readonly version: "0.3.228";
152
+ readonly version: "0.3.230";
153
153
  readonly updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.";
154
154
  readonly packageCapabilities: {
155
155
  readonly updatePreferences: 1;
package/dist/release.js CHANGED
@@ -74,7 +74,7 @@ var SDK_RELEASE = {
74
74
  // getters keep their established compatibility behavior.
75
75
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
76
76
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
77
- version: "0.3.228",
77
+ version: "0.3.230",
78
78
  updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.",
79
79
  packageCapabilities: {
80
80
  updatePreferences: 1
package/dist/release.mjs CHANGED
@@ -48,7 +48,7 @@ var SDK_RELEASE = {
48
48
  // getters keep their established compatibility behavior.
49
49
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
50
50
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
51
- version: "0.3.228",
51
+ version: "0.3.230",
52
52
  updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.",
53
53
  packageCapabilities: {
54
54
  updatePreferences: 1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepline",
3
- "version": "0.3.228",
3
+ "version": "0.3.230",
4
4
  "description": "GTM data CLI and TypeScript SDK for coding agents",
5
5
  "license": "MIT",
6
6
  "homepage": "https://code.deepline.com",