deepline 0.1.265 → 0.1.267

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.
@@ -703,8 +703,31 @@ var SDK_RELEASE = {
703
703
  // 0.1.253 makes play-page browser opening opt-in and retires --no-open.
704
704
  // 0.1.254 removes the internal operations tree from the published SDK CLI.
705
705
  // Operators use the checkout-local deepline-admin binary instead.
706
- version: "0.1.265",
707
- apiContract: "2026-07-admin-cli-local-cutover",
706
+ version: "0.1.267",
707
+ contracts: {
708
+ api: {
709
+ name: "sdk-http-api",
710
+ // API v2 is append-only. A breaking public request/response change needs
711
+ // v3 and an explicit v2 support-window decision, never a patch release.
712
+ currentMajor: 2,
713
+ supportedMajors: [2],
714
+ // Accepted only to bridge SDKs released before X-Deepline-API-Major.
715
+ legacyWireIds: [
716
+ "2026-07-admin-cli-local-cutover",
717
+ "2026-07-native-monitor-launch-hard-cutover"
718
+ ]
719
+ },
720
+ playArtifact: {
721
+ name: "play-artifact-runtime",
722
+ currentVersion: 2,
723
+ supportedVersions: [1, 2]
724
+ },
725
+ release: {
726
+ name: "production-sdk-release",
727
+ publishFrom: "latest-successful-production-deployment",
728
+ coalesce: "latest-healthy"
729
+ }
730
+ },
708
731
  supportPolicy: {
709
732
  minimumSupported: "0.1.53",
710
733
  deprecatedBelow: "0.1.219",
@@ -801,7 +824,8 @@ var SDK_RELEASE = {
801
824
 
802
825
  // src/version.ts
803
826
  var SDK_VERSION = SDK_RELEASE.version;
804
- var SDK_API_CONTRACT = SDK_RELEASE.apiContract;
827
+ var SDK_API_MAJOR = SDK_RELEASE.contracts.api.currentMajor;
828
+ var SDK_API_CONTRACT = SDK_RELEASE.contracts.api.legacyWireIds[0] ?? `api-v${SDK_API_MAJOR}`;
805
829
 
806
830
  // src/agent-runtime.ts
807
831
  import { homedir as homedir2 } from "os";
@@ -4823,6 +4847,7 @@ function compatibilityCacheKey(baseUrl, command, skillsVersion) {
4823
4847
  baseUrl: baseUrl.replace(/\/$/, ""),
4824
4848
  version: SDK_VERSION,
4825
4849
  apiContract: SDK_API_CONTRACT,
4850
+ apiMajor: SDK_API_MAJOR,
4826
4851
  command: command?.trim() || null,
4827
4852
  skillsVersion: skillsVersion ?? null
4828
4853
  });
@@ -4891,6 +4916,7 @@ async function checkSdkCompatibility(baseUrl, options = {}) {
4891
4916
  headers: {
4892
4917
  "User-Agent": `deepline-ts-sdk/${SDK_VERSION}`,
4893
4918
  "X-Deepline-SDK-Version": SDK_VERSION,
4919
+ "X-Deepline-API-Major": String(SDK_API_MAJOR),
4894
4920
  "X-Deepline-API-Contract": SDK_API_CONTRACT
4895
4921
  },
4896
4922
  signal: controller.signal
@@ -5281,26 +5307,29 @@ function browserOpeningDisabled() {
5281
5307
  ).trim().toLowerCase();
5282
5308
  return value === "1" || value === "true" || value === "yes" || value === "on";
5283
5309
  }
5284
- function openInBrowser(url) {
5310
+ function openInBrowser(url, options = {}) {
5285
5311
  try {
5286
- if (browserOpeningDisabled()) return;
5312
+ if (browserOpeningDisabled()) return "failed";
5287
5313
  const targetUrl = String(url || "").trim();
5288
- if (!targetUrl) return;
5289
- if (!claimBrowserOpen(Date.now(), void 0, targetUrl)) return;
5314
+ if (!targetUrl) return "failed";
5315
+ if (options.deduplicate !== false && !claimBrowserOpen(Date.now(), void 0, targetUrl)) {
5316
+ return "suppressed";
5317
+ }
5290
5318
  const allowFocus = true;
5291
5319
  if (process.platform === "darwin") {
5292
- openUrlMacos(targetUrl, allowFocus);
5293
- return;
5320
+ return openUrlMacos(targetUrl, allowFocus) ? "opened" : "failed";
5294
5321
  }
5295
- if (!allowFocus) return;
5322
+ if (!allowFocus) return "failed";
5296
5323
  if (process.platform === "win32") {
5297
5324
  childProcess.execFileSync("cmd.exe", ["/c", "start", "", targetUrl], {
5298
5325
  stdio: "ignore"
5299
5326
  });
5300
- return;
5327
+ return "opened";
5301
5328
  }
5302
5329
  childProcess.execFileSync("xdg-open", [targetUrl], { stdio: "ignore" });
5330
+ return "opened";
5303
5331
  } catch {
5332
+ return "failed";
5304
5333
  }
5305
5334
  }
5306
5335
  function sleep3(ms) {
@@ -14285,6 +14314,26 @@ function withOrdinaryRunAgainCommand(status, options, resolvedRevisionId) {
14285
14314
  rerunCommand: buildOrdinaryPlayRunCommand(options, resolvedRevisionId)
14286
14315
  } : status;
14287
14316
  }
14317
+ function buildBillingRollupTextLines(status) {
14318
+ const billing = status.billing;
14319
+ const rollup = billing?.rollup;
14320
+ if (!rollup) return [];
14321
+ const total = formatCreditAmount(rollup.totalCreditsRollup);
14322
+ if (rollup.childCredits > 0 && rollup.descendantRunCount > 0) {
14323
+ const own = formatCreditAmount(rollup.ownCredits);
14324
+ const child = formatCreditAmount(rollup.childCredits);
14325
+ const suffix = rollup.rollupComplete ? "" : " (incomplete: child billing could not be fully resolved)";
14326
+ return [
14327
+ ` cost: ${total} credits total \u2014 ${own} this run + ${child} across ${rollup.descendantRunCount} child run${rollup.descendantRunCount === 1 ? "" : "s"}${suffix}`
14328
+ ];
14329
+ }
14330
+ if (!rollup.rollupComplete) {
14331
+ return [
14332
+ ` cost: ${total} credits (incomplete: child billing could not be fully resolved${rollup.rollupError ? ` \u2014 ${rollup.rollupError}` : ""})`
14333
+ ];
14334
+ }
14335
+ return [` cost: ${total} credits`];
14336
+ }
14288
14337
  function writePlayResult(status, jsonOutput, options) {
14289
14338
  const packaged = getPlayRunPackage(status);
14290
14339
  if (jsonOutput) {
@@ -14347,6 +14396,7 @@ function writePlayResult(status, jsonOutput, options) {
14347
14396
  lines.push(...renderedServerView.lines);
14348
14397
  }
14349
14398
  lines.push(...renderedServerView.actions);
14399
+ lines.push(...buildBillingRollupTextLines(status));
14350
14400
  const compact = compactPlayStatus(status);
14351
14401
  const payload = options?.fullJson ? status : compact;
14352
14402
  printCommandEnvelope(
@@ -29550,6 +29600,18 @@ function inferNpmGlobalPrefixFromEntrypoint(entrypoint) {
29550
29600
  const prefix = normalized.startsWith("/") && prefixParts[0] !== "" ? `/${prefixParts.join("/")}` : prefixParts.join("/");
29551
29601
  return prefix || null;
29552
29602
  }
29603
+ function isHomebrewFormulaEntrypoint(entrypoint) {
29604
+ const normalized = (() => {
29605
+ try {
29606
+ return realpathSync3(entrypoint);
29607
+ } catch {
29608
+ return resolve13(entrypoint);
29609
+ }
29610
+ })();
29611
+ const parts = normalized.split(/[\\/]+/);
29612
+ const cellarIndex = parts.lastIndexOf("Cellar");
29613
+ return cellarIndex >= 0 && parts[cellarIndex + 1] === "deepline" && parts.slice(cellarIndex + 3).includes("libexec");
29614
+ }
29553
29615
  function resolveUpdatePlan(options = {}) {
29554
29616
  const env = options.env ?? process.env;
29555
29617
  const homeDir2 = options.homeDir ?? homedir12();
@@ -29562,6 +29624,12 @@ function resolveUpdatePlan(options = {}) {
29562
29624
  manualCommand: buildSourceUpdateCommand(sourceRoot)
29563
29625
  };
29564
29626
  }
29627
+ if (entrypoint && isHomebrewFormulaEntrypoint(entrypoint)) {
29628
+ return {
29629
+ kind: "homebrew",
29630
+ manualCommand: "brew upgrade deepline"
29631
+ };
29632
+ }
29565
29633
  const sidecarPlan = resolvePythonSidecarUpdatePlan({
29566
29634
  entrypoint,
29567
29635
  env,
@@ -29593,7 +29661,7 @@ function resolveUpdatePlan(options = {}) {
29593
29661
  }
29594
29662
  var AUTO_UPDATE_FAILURE_FILE = ".auto-update-failure.json";
29595
29663
  function autoUpdateFailurePath(plan) {
29596
- if (plan.kind === "source") return null;
29664
+ if (plan.kind === "source" || plan.kind === "homebrew") return null;
29597
29665
  if (plan.kind === "python-sidecar") {
29598
29666
  return join15(plan.stateDir, AUTO_UPDATE_FAILURE_FILE);
29599
29667
  }
@@ -29606,7 +29674,7 @@ function autoUpdateFailurePath(plan) {
29606
29674
  );
29607
29675
  }
29608
29676
  function autoUpdatePackageSpec(plan) {
29609
- if (plan.kind === "source") return "";
29677
+ if (plan.kind === "source" || plan.kind === "homebrew") return "";
29610
29678
  if (plan.kind === "python-sidecar") return plan.packageSpec;
29611
29679
  return plan.args[plan.args.length - 1] ?? plan.manualCommand;
29612
29680
  }
@@ -29627,7 +29695,7 @@ function readAutoUpdateFailure(plan) {
29627
29695
  }
29628
29696
  function writeAutoUpdateFailure(plan, exitCode) {
29629
29697
  const path = autoUpdateFailurePath(plan);
29630
- if (!path || plan.kind === "source") return;
29698
+ if (!path || plan.kind === "source" || plan.kind === "homebrew") return;
29631
29699
  const marker = {
29632
29700
  kind: plan.kind,
29633
29701
  packageSpec: autoUpdatePackageSpec(plan),
@@ -29652,7 +29720,9 @@ function clearAutoUpdateFailure(plan) {
29652
29720
  }
29653
29721
  function matchingAutoUpdateFailure(plan) {
29654
29722
  const marker = readAutoUpdateFailure(plan);
29655
- if (!marker || plan.kind === "source") return null;
29723
+ if (!marker || plan.kind === "source" || plan.kind === "homebrew") {
29724
+ return null;
29725
+ }
29656
29726
  if (marker.kind !== plan.kind) return null;
29657
29727
  if (marker.packageSpec !== autoUpdatePackageSpec(plan)) return null;
29658
29728
  return marker;
@@ -29910,6 +29980,8 @@ async function runUpdatePlan(plan) {
29910
29980
  });
29911
29981
  } else if (plan.kind === "python-sidecar") {
29912
29982
  exitCode = await runPythonSidecarUpdatePlan(plan);
29983
+ } else if (plan.kind === "homebrew") {
29984
+ exitCode = 0;
29913
29985
  }
29914
29986
  if (exitCode === 0) {
29915
29987
  clearAutoUpdateFailure(plan);
@@ -29948,6 +30020,9 @@ async function runUpdateCommand(options, dependencies = {}) {
29948
30020
  lines: plan.kind === "source" ? [
29949
30021
  "This Deepline CLI is running from SDK source, so it cannot safely update itself like an npm global.",
29950
30022
  `Update the backing checkout with: ${plan.manualCommand}`
30023
+ ] : plan.kind === "homebrew" ? [
30024
+ "This Deepline CLI was installed by Homebrew, which owns its upgrades.",
30025
+ `Update it with: ${plan.manualCommand}`
29951
30026
  ] : plan.kind === "python-sidecar" ? [
29952
30027
  "This Deepline CLI is running from the Python-managed SDK sidecar.",
29953
30028
  "Updating will refresh that sidecar, not a global npm binary."
@@ -29972,7 +30047,7 @@ async function runUpdateCommand(options, dependencies = {}) {
29972
30047
  );
29973
30048
  return 0;
29974
30049
  }
29975
- if (plan.kind === "source") {
30050
+ if (plan.kind === "source" || plan.kind === "homebrew") {
29976
30051
  printCommandEnvelope({ ...plan, render }, { json: false });
29977
30052
  return 0;
29978
30053
  }
@@ -29991,6 +30066,8 @@ function registerUpdateCommand(program) {
29991
30066
  `
29992
30067
  Notes:
29993
30068
  For the published npm CLI, this runs npm install -g deepline@latest.
30069
+ For a Homebrew installation, this prints brew upgrade deepline; Homebrew
30070
+ owns formula upgrades and Deepline never runs npm inside its Cellar.
29994
30071
  For Python-managed SDK sidecars, this refreshes the sidecar that launched
29995
30072
  the current SDK CLI instead of changing a global npm binary.
29996
30073
  For repo-backed SDK wrappers such as cli-env sdk-prod or sdk-worktree, this
@@ -30118,14 +30195,37 @@ function resolveScopeRoot(scope) {
30118
30195
  function authScopeForSetup(scope) {
30119
30196
  return scope === "local" ? "folder" : "global";
30120
30197
  }
30121
- function shouldOpenSetupAuthorization(runtime = detectAgentRuntime()) {
30122
- return runtime !== "claude_cowork";
30123
- }
30124
30198
  function openSetupAuthorization(authorizationUrl, options = {}) {
30125
30199
  const url = authorizationUrl.trim();
30126
- if (!url || !shouldOpenSetupAuthorization(options.runtime)) return false;
30127
- (options.open ?? openInBrowser)(url);
30128
- return true;
30200
+ if (!url) return "failed";
30201
+ if (options.open) return options.open(url);
30202
+ const result = openInBrowser(url, { deduplicate: false });
30203
+ return result === "opened" ? "opened" : "failed";
30204
+ }
30205
+ function buildPendingAuthorizationOutput(input2) {
30206
+ const authorizationUrl = input2.authorizationUrl.trim();
30207
+ if (input2.browserOpenStatus === "opened") {
30208
+ return {
30209
+ authorizationUrl: null,
30210
+ next: `Complete browser approval, then run: ${input2.resumeCommand}`,
30211
+ lines: ["Complete authorization in the browser window Deepline opened."]
30212
+ };
30213
+ }
30214
+ if (authorizationUrl) {
30215
+ return {
30216
+ authorizationUrl,
30217
+ next: `Open the authorization URL, approve it, then run: ${input2.resumeCommand}`,
30218
+ lines: [
30219
+ "Browser launch failed. Open the authorization URL to continue.",
30220
+ authorizationUrl
30221
+ ]
30222
+ };
30223
+ }
30224
+ return {
30225
+ authorizationUrl: null,
30226
+ next: `Authorization is pending without a browser URL. Retry: ${input2.resumeCommand}`,
30227
+ lines: ["Authorization is pending, but no browser URL was returned."]
30228
+ };
30129
30229
  }
30130
30230
  function setupStatePath(baseUrl, scope, root) {
30131
30231
  return scope === "local" && root ? join16(root, ".deepline", "setup", "state.json") : join16(sdkCliStateDirPath(baseUrl), "setup.json");
@@ -30155,15 +30255,6 @@ function parseCapturedJson(stdout) {
30155
30255
  function asRecord2(value) {
30156
30256
  return value !== null && typeof value === "object" && !Array.isArray(value) ? value : null;
30157
30257
  }
30158
- function printCapturedAuthorizationUrl(stdout) {
30159
- const urls = stdout.match(/https:\/\/[^\s]+/g) ?? [];
30160
- for (const url of new Set(
30161
- urls.map((value) => value.replace(/[).,]+$/, ""))
30162
- )) {
30163
- process.stderr.write(`Authorize Deepline: ${url}
30164
- `);
30165
- }
30166
- }
30167
30258
  function safeRead(path) {
30168
30259
  try {
30169
30260
  return readFileSync14(path, "utf8");
@@ -30502,18 +30593,32 @@ function pendingResult(input2) {
30502
30593
  status: "authorization_pending",
30503
30594
  phases: input2.phases
30504
30595
  });
30596
+ let browserOpenStatus = "failed";
30505
30597
  if (input2.authorizationUrl) {
30506
- openSetupAuthorization(input2.authorizationUrl);
30507
- process.stderr.write(`Authorize Deepline: ${input2.authorizationUrl}
30598
+ browserOpenStatus = openSetupAuthorization(input2.authorizationUrl);
30599
+ if (browserOpenStatus === "opened") {
30600
+ process.stderr.write(
30601
+ "Opened Deepline authorization in your browser. Complete approval there.\n"
30602
+ );
30603
+ } else if (browserOpenStatus === "failed") {
30604
+ process.stderr.write(`Authorize Deepline: ${input2.authorizationUrl}
30508
30605
  `);
30606
+ }
30509
30607
  }
30608
+ const pendingOutput = buildPendingAuthorizationOutput({
30609
+ authorizationUrl: input2.authorizationUrl,
30610
+ browserOpenStatus,
30611
+ resumeCommand: setupResumeCommand(input2.baseUrl, input2.scope)
30612
+ });
30510
30613
  printCommandEnvelope(
30511
30614
  {
30512
30615
  ok: true,
30513
30616
  status: "authorization_pending",
30514
30617
  complete: false,
30515
30618
  scope: input2.scope,
30516
- authorizationUrl: input2.authorizationUrl || null,
30619
+ authorizationUrl: pendingOutput.authorizationUrl,
30620
+ browserOpened: browserOpenStatus === "opened",
30621
+ browserOpenStatus,
30517
30622
  statePath,
30518
30623
  phases: input2.phases,
30519
30624
  currentPhase: "auth",
@@ -30523,15 +30628,12 @@ function pendingResult(input2) {
30523
30628
  scope: input2.scope,
30524
30629
  phase: "auth"
30525
30630
  }),
30526
- next: `Approve the link, then run: ${setupResumeCommand(input2.baseUrl, input2.scope)}`,
30631
+ next: pendingOutput.next,
30527
30632
  render: {
30528
30633
  sections: [
30529
30634
  {
30530
30635
  title: "setup",
30531
- lines: [
30532
- "Authorization is waiting for browser approval.",
30533
- ...input2.authorizationUrl ? [input2.authorizationUrl] : []
30534
- ]
30636
+ lines: pendingOutput.lines
30535
30637
  }
30536
30638
  ]
30537
30639
  }
@@ -30700,10 +30802,9 @@ async function runSetupCommand(options) {
30700
30802
  const pending = readPendingAuthClaim(baseUrl, authScope);
30701
30803
  if (pending) {
30702
30804
  process.stderr.write("Checking pending Deepline authorization...\n");
30703
- const waited = await captureStdout2(
30805
+ await captureStdout2(
30704
30806
  () => handleWait(["--timeout", "1", "--auth-scope", authScope])
30705
30807
  );
30706
- printCapturedAuthorizationUrl(waited.stdout);
30707
30808
  auth = await readAuthStatus(authScope);
30708
30809
  const resumedAuthFailure = reportSetupAuthStatusFailure({
30709
30810
  auth,
@@ -30739,7 +30840,6 @@ async function runSetupCommand(options) {
30739
30840
  const registered = await captureStdout2(
30740
30841
  () => handleRegister(["--wait", waitMode, "--auth-scope", authScope])
30741
30842
  );
30742
- printCapturedAuthorizationUrl(registered.stdout);
30743
30843
  if (registered.exitCode !== 0) {
30744
30844
  return reportSetupPhaseFailure({
30745
30845
  baseUrl,
package/dist/index.d.mts CHANGED
@@ -667,6 +667,62 @@ interface PlayStatus {
667
667
  };
668
668
  /** Exact ordinary `plays run` command that can rerun a failed execution. */
669
669
  rerunCommand?: string;
670
+ /**
671
+ * Projected settled-charge billing for the run. Returned by `runs.get`.
672
+ * `totalCredits`/`providerEvents` describe THIS run only; `rollup` (present
673
+ * with `--full`) carries the true subtree cost including ctx.runPlay children.
674
+ * Deepline credits only — provider spend is never exposed.
675
+ */
676
+ billing?: RunBillingSummary;
677
+ /**
678
+ * True subtree cost in Deepline credits (this run + every descendant run),
679
+ * mirrored to the top level for convenience. Present only with `--full`.
680
+ */
681
+ billingTotalCreditsRollup?: number;
682
+ /** Deepline credits attributable to descendant runs only. Present with `--full`. */
683
+ billingChildCredits?: number;
684
+ /** True when the child-run billing rollup could not be fully resolved. */
685
+ billingRollupIncomplete?: boolean;
686
+ /** Durable summaries of ctx.runPlay children, returned by `runs.get --full`. */
687
+ childRuns?: ChildRunSummary[];
688
+ }
689
+ /** One ctx.runPlay child run exposed on the parent's `--full` payload. */
690
+ interface ChildRunSummary {
691
+ runId: string;
692
+ playName?: string | null;
693
+ status: string;
694
+ parentRunId?: string | null;
695
+ rootRunId?: string | null;
696
+ createdAt?: number | null;
697
+ startedAt?: number | null;
698
+ finishedAt?: number | null;
699
+ }
700
+ /**
701
+ * Rolled-up billing for a run subtree, projected from settled Charge Lifecycle
702
+ * facts. Deepline credits only — never provider spend.
703
+ */
704
+ interface RunBillingSummary {
705
+ runId: string;
706
+ /** THIS run's own charges (parent-only; excludes descendant runs). */
707
+ totalCalls: number;
708
+ totalCredits: number;
709
+ providerEvents: number;
710
+ computeEvents: number;
711
+ /** Subtree rollup including descendant ctx.runPlay runs. Present with `--full`. */
712
+ rollup?: {
713
+ totalCreditsRollup: number;
714
+ childCredits: number;
715
+ ownCredits: number;
716
+ totalCallsRollup: number;
717
+ providerEventsRollup: number;
718
+ computeEventsRollup: number;
719
+ childProviderEvents: number;
720
+ childComputeEvents: number;
721
+ descendantRunCount: number;
722
+ rollupComplete: boolean;
723
+ rollupError?: string;
724
+ };
725
+ [key: string]: unknown;
670
726
  }
671
727
  type LiveEventScope = 'play' | 'agent';
672
728
  interface LiveEventEnvelope<TPayload = unknown> {
@@ -2647,6 +2703,7 @@ declare class RunObserveTransportUnavailableError extends Error {
2647
2703
  }
2648
2704
 
2649
2705
  declare const SDK_VERSION: string;
2706
+ /** @deprecated Transitional wire id for pre-major-header SDKs only. */
2650
2707
  declare const SDK_API_CONTRACT: string;
2651
2708
 
2652
2709
  /**
package/dist/index.d.ts CHANGED
@@ -667,6 +667,62 @@ interface PlayStatus {
667
667
  };
668
668
  /** Exact ordinary `plays run` command that can rerun a failed execution. */
669
669
  rerunCommand?: string;
670
+ /**
671
+ * Projected settled-charge billing for the run. Returned by `runs.get`.
672
+ * `totalCredits`/`providerEvents` describe THIS run only; `rollup` (present
673
+ * with `--full`) carries the true subtree cost including ctx.runPlay children.
674
+ * Deepline credits only — provider spend is never exposed.
675
+ */
676
+ billing?: RunBillingSummary;
677
+ /**
678
+ * True subtree cost in Deepline credits (this run + every descendant run),
679
+ * mirrored to the top level for convenience. Present only with `--full`.
680
+ */
681
+ billingTotalCreditsRollup?: number;
682
+ /** Deepline credits attributable to descendant runs only. Present with `--full`. */
683
+ billingChildCredits?: number;
684
+ /** True when the child-run billing rollup could not be fully resolved. */
685
+ billingRollupIncomplete?: boolean;
686
+ /** Durable summaries of ctx.runPlay children, returned by `runs.get --full`. */
687
+ childRuns?: ChildRunSummary[];
688
+ }
689
+ /** One ctx.runPlay child run exposed on the parent's `--full` payload. */
690
+ interface ChildRunSummary {
691
+ runId: string;
692
+ playName?: string | null;
693
+ status: string;
694
+ parentRunId?: string | null;
695
+ rootRunId?: string | null;
696
+ createdAt?: number | null;
697
+ startedAt?: number | null;
698
+ finishedAt?: number | null;
699
+ }
700
+ /**
701
+ * Rolled-up billing for a run subtree, projected from settled Charge Lifecycle
702
+ * facts. Deepline credits only — never provider spend.
703
+ */
704
+ interface RunBillingSummary {
705
+ runId: string;
706
+ /** THIS run's own charges (parent-only; excludes descendant runs). */
707
+ totalCalls: number;
708
+ totalCredits: number;
709
+ providerEvents: number;
710
+ computeEvents: number;
711
+ /** Subtree rollup including descendant ctx.runPlay runs. Present with `--full`. */
712
+ rollup?: {
713
+ totalCreditsRollup: number;
714
+ childCredits: number;
715
+ ownCredits: number;
716
+ totalCallsRollup: number;
717
+ providerEventsRollup: number;
718
+ computeEventsRollup: number;
719
+ childProviderEvents: number;
720
+ childComputeEvents: number;
721
+ descendantRunCount: number;
722
+ rollupComplete: boolean;
723
+ rollupError?: string;
724
+ };
725
+ [key: string]: unknown;
670
726
  }
671
727
  type LiveEventScope = 'play' | 'agent';
672
728
  interface LiveEventEnvelope<TPayload = unknown> {
@@ -2647,6 +2703,7 @@ declare class RunObserveTransportUnavailableError extends Error {
2647
2703
  }
2648
2704
 
2649
2705
  declare const SDK_VERSION: string;
2706
+ /** @deprecated Transitional wire id for pre-major-header SDKs only. */
2650
2707
  declare const SDK_API_CONTRACT: string;
2651
2708
 
2652
2709
  /**
package/dist/index.js CHANGED
@@ -437,8 +437,31 @@ var SDK_RELEASE = {
437
437
  // 0.1.253 makes play-page browser opening opt-in and retires --no-open.
438
438
  // 0.1.254 removes the internal operations tree from the published SDK CLI.
439
439
  // Operators use the checkout-local deepline-admin binary instead.
440
- version: "0.1.265",
441
- apiContract: "2026-07-admin-cli-local-cutover",
440
+ version: "0.1.267",
441
+ contracts: {
442
+ api: {
443
+ name: "sdk-http-api",
444
+ // API v2 is append-only. A breaking public request/response change needs
445
+ // v3 and an explicit v2 support-window decision, never a patch release.
446
+ currentMajor: 2,
447
+ supportedMajors: [2],
448
+ // Accepted only to bridge SDKs released before X-Deepline-API-Major.
449
+ legacyWireIds: [
450
+ "2026-07-admin-cli-local-cutover",
451
+ "2026-07-native-monitor-launch-hard-cutover"
452
+ ]
453
+ },
454
+ playArtifact: {
455
+ name: "play-artifact-runtime",
456
+ currentVersion: 2,
457
+ supportedVersions: [1, 2]
458
+ },
459
+ release: {
460
+ name: "production-sdk-release",
461
+ publishFrom: "latest-successful-production-deployment",
462
+ coalesce: "latest-healthy"
463
+ }
464
+ },
442
465
  supportPolicy: {
443
466
  minimumSupported: "0.1.53",
444
467
  deprecatedBelow: "0.1.219",
@@ -535,7 +558,8 @@ var SDK_RELEASE = {
535
558
 
536
559
  // src/version.ts
537
560
  var SDK_VERSION = SDK_RELEASE.version;
538
- var SDK_API_CONTRACT = SDK_RELEASE.apiContract;
561
+ var SDK_API_MAJOR = SDK_RELEASE.contracts.api.currentMajor;
562
+ var SDK_API_CONTRACT = SDK_RELEASE.contracts.api.legacyWireIds[0] ?? `api-v${SDK_API_MAJOR}`;
539
563
 
540
564
  // src/agent-runtime.ts
541
565
  var import_node_os2 = require("os");
package/dist/index.mjs CHANGED
@@ -367,8 +367,31 @@ var SDK_RELEASE = {
367
367
  // 0.1.253 makes play-page browser opening opt-in and retires --no-open.
368
368
  // 0.1.254 removes the internal operations tree from the published SDK CLI.
369
369
  // Operators use the checkout-local deepline-admin binary instead.
370
- version: "0.1.265",
371
- apiContract: "2026-07-admin-cli-local-cutover",
370
+ version: "0.1.267",
371
+ contracts: {
372
+ api: {
373
+ name: "sdk-http-api",
374
+ // API v2 is append-only. A breaking public request/response change needs
375
+ // v3 and an explicit v2 support-window decision, never a patch release.
376
+ currentMajor: 2,
377
+ supportedMajors: [2],
378
+ // Accepted only to bridge SDKs released before X-Deepline-API-Major.
379
+ legacyWireIds: [
380
+ "2026-07-admin-cli-local-cutover",
381
+ "2026-07-native-monitor-launch-hard-cutover"
382
+ ]
383
+ },
384
+ playArtifact: {
385
+ name: "play-artifact-runtime",
386
+ currentVersion: 2,
387
+ supportedVersions: [1, 2]
388
+ },
389
+ release: {
390
+ name: "production-sdk-release",
391
+ publishFrom: "latest-successful-production-deployment",
392
+ coalesce: "latest-healthy"
393
+ }
394
+ },
372
395
  supportPolicy: {
373
396
  minimumSupported: "0.1.53",
374
397
  deprecatedBelow: "0.1.219",
@@ -465,7 +488,8 @@ var SDK_RELEASE = {
465
488
 
466
489
  // src/version.ts
467
490
  var SDK_VERSION = SDK_RELEASE.version;
468
- var SDK_API_CONTRACT = SDK_RELEASE.apiContract;
491
+ var SDK_API_MAJOR = SDK_RELEASE.contracts.api.currentMajor;
492
+ var SDK_API_CONTRACT = SDK_RELEASE.contracts.api.legacyWireIds[0] ?? `api-v${SDK_API_MAJOR}`;
469
493
 
470
494
  // src/agent-runtime.ts
471
495
  import { homedir as homedir2 } from "os";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepline",
3
- "version": "0.1.265",
3
+ "version": "0.1.267",
4
4
  "description": "Deepline SDK + CLI — B2B data enrichment powered by durable cloud execution",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -62,6 +62,7 @@
62
62
  "typescript": "^6.0.2"
63
63
  },
64
64
  "deepline": {
65
- "apiContract": "2026-07-admin-cli-local-cutover"
65
+ "apiContract": "2026-07-admin-cli-local-cutover",
66
+ "apiMajor": 2
66
67
  }
67
68
  }