@fabric-harness/databricks 4.4.1 → 4.7.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.
package/dist/index.js CHANGED
@@ -1984,6 +1984,25 @@ async function listDatabricksModelServices(client, options = {}) {
1984
1984
  }
1985
1985
  throw new Error(`databricks model-services pagination exceeded ${maxPages} pages.`);
1986
1986
  }
1987
+ async function listDatabricksModelProviderServices(client) {
1988
+ const payload = await client.get("/api/2.1/unity-catalog/model-provider-services");
1989
+ return (payload.model_provider_services ?? []).flatMap((service) => {
1990
+ const rawName = service.name?.trim();
1991
+ if (!rawName) return [];
1992
+ const config2 = service.config ?? {};
1993
+ return [
1994
+ {
1995
+ name: rawName.replace(/^model-provider-services\//, ""),
1996
+ providerType: (config2.provider_type ?? "").replace(/^EXTERNAL_MODEL_PROVIDER_TYPE_/, "").toLowerCase(),
1997
+ targets: (config2.targets ?? []).map((target) => target.model?.trim()).filter((model) => Boolean(model)),
1998
+ allowAllTargets: Boolean(config2.allow_all_targets)
1999
+ }
2000
+ ];
2001
+ }).sort((left, right) => left.name.localeCompare(right.name));
2002
+ }
2003
+ function databricksModelProviderSupportsAnthropic(service) {
2004
+ return service.providerType === "anthropic" || service.providerType === "amazon_bedrock";
2005
+ }
1987
2006
  function normalizeModelService(raw, requiredPrefix) {
1988
2007
  const rawName = typeof raw.name === "string" ? raw.name.trim() : "";
1989
2008
  const name = rawName.replace(/^model-services\//, "");
@@ -57366,7 +57385,12 @@ var DATABRICKS_RAW_PROTOCOL_RULES = [
57366
57385
  {
57367
57386
  id: "ai-gateway-discovery",
57368
57387
  methods: ["GET"],
57369
- path: /^\/api\/(?:ai-gateway\/v2\/endpoints|2\.1\/unity-catalog\/model-services)$/u
57388
+ path: /^\/api\/(?:ai-gateway\/v2\/endpoints|2\.1\/unity-catalog\/model-(?:provider-)?services)$/u
57389
+ },
57390
+ {
57391
+ id: "sql-warehouse-discovery",
57392
+ methods: ["GET"],
57393
+ path: /^\/api\/2\.0\/sql\/warehouses$/u
57370
57394
  },
57371
57395
  {
57372
57396
  id: "agent-services-beta",
@@ -58034,6 +58058,21 @@ function jitter3(ms) {
58034
58058
  return Math.max(1, Math.round(ms * (0.9 + Math.random() * 0.2)));
58035
58059
  }
58036
58060
 
58061
+ // src/sql-warehouses.ts
58062
+ async function listDatabricksSqlWarehouses(client) {
58063
+ const payload = await client.get("/api/2.0/sql/warehouses");
58064
+ return (payload.warehouses ?? []).filter(
58065
+ (warehouse) => Boolean(warehouse.id)
58066
+ ).map((warehouse) => ({
58067
+ id: warehouse.id,
58068
+ ...warehouse.name ? { name: warehouse.name } : {},
58069
+ ...warehouse.state ? { state: warehouse.state } : {}
58070
+ }));
58071
+ }
58072
+ function chooseDatabricksSqlWarehouse(warehouses) {
58073
+ return warehouses.find((warehouse) => warehouse.state?.toUpperCase() === "RUNNING") ?? warehouses[0];
58074
+ }
58075
+
58037
58076
  // src/jobs.ts
58038
58077
  import {
58039
58078
  createAttachmentRef
@@ -59153,6 +59192,32 @@ function rejectUnsupportedEntry(entry, info) {
59153
59192
  }
59154
59193
  }
59155
59194
 
59195
+ // src/authenticated-fetch.ts
59196
+ function createDatabricksAuthenticatedFetch(options) {
59197
+ let token = databricksIdentity(options.principal);
59198
+ const fetchImpl = options.fetchImpl ?? fetch;
59199
+ return async (input, init) => {
59200
+ const request = async (forceRefresh) => {
59201
+ if (forceRefresh) token = databricksIdentity(options.principal);
59202
+ const inherited = input instanceof Request ? input.headers : void 0;
59203
+ const headers = new Headers(inherited);
59204
+ for (const [key, value] of new Headers(init?.headers)) headers.set(key, value);
59205
+ const additional = typeof options.additionalHeaders === "function" ? await options.additionalHeaders() : options.additionalHeaders;
59206
+ for (const [key, value] of new Headers(additional)) headers.set(key, value);
59207
+ const accessToken = await token();
59208
+ headers.set("authorization", `Bearer ${accessToken}`);
59209
+ headers.set("x-api-key", accessToken);
59210
+ return fetchImpl(input, { ...init, headers });
59211
+ };
59212
+ const response = await request(false);
59213
+ return response.status === 401 || response.status === 403 ? request(true) : response;
59214
+ };
59215
+ }
59216
+ function databricksAnthropicGatewayBaseUrl(host) {
59217
+ const normalized = new URL(/^https?:\/\//i.test(host) ? host : `https://${host}`);
59218
+ return `${normalized.origin}/ai-gateway/anthropic/v1`;
59219
+ }
59220
+
59156
59221
  // src/persistence.ts
59157
59222
  function databricksPersistence(options) {
59158
59223
  const client = isLakebaseClient(options.lakebase) ? options.lakebase : lakebaseClient(options.lakebase);
@@ -59805,11 +59870,12 @@ function forwardedUserIdentity(headers) {
59805
59870
  const first = Array.isArray(value) ? value[0] : value;
59806
59871
  return first?.trim() || void 0;
59807
59872
  };
59808
- const id = read("x-forwarded-user");
59809
- if (!id) return void 0;
59810
59873
  const email3 = read("x-forwarded-email");
59811
59874
  const preferredUsername = read("x-forwarded-preferred-username");
59812
- const ucPrincipal = email3 ?? preferredUsername;
59875
+ const naturalPersonMarker = email3 ?? preferredUsername;
59876
+ if (!naturalPersonMarker) return void 0;
59877
+ const id = read("x-forwarded-user") ?? naturalPersonMarker;
59878
+ const ucPrincipal = naturalPersonMarker;
59813
59879
  return {
59814
59880
  id,
59815
59881
  ...preferredUsername ? { displayName: preferredUsername } : email3 ? { displayName: email3 } : {},
@@ -60247,6 +60313,193 @@ function sanitizeHost(host) {
60247
60313
  }
60248
60314
 
60249
60315
  // src/release-evidence.ts
60316
+ function validateDatabricksCrossTierEvidence(options) {
60317
+ const { consumption, authoring } = options;
60318
+ const errors = [];
60319
+ const now = options.now ?? /* @__PURE__ */ new Date();
60320
+ validateTierEvidence(
60321
+ "consumption",
60322
+ consumption,
60323
+ DATABRICKS_RELEASE_CERTIFICATION_CHECKS,
60324
+ "R",
60325
+ errors
60326
+ );
60327
+ validateTierEvidence(
60328
+ "authoring",
60329
+ authoring,
60330
+ DATABRICKS_AUTHORING_CERTIFICATION_CHECKS,
60331
+ "A",
60332
+ errors
60333
+ );
60334
+ if (!consumption.packageVersion || consumption.packageVersion !== authoring.packageVersion) {
60335
+ errors.push("consumption and authoring packageVersion values must match");
60336
+ }
60337
+ if (!consumption.commitSha || consumption.commitSha !== authoring.commitSha) {
60338
+ errors.push("consumption and authoring commitSha values must match");
60339
+ }
60340
+ if (!consumption.packageArtifactSha256 || consumption.packageArtifactSha256 !== authoring.packageArtifactSha256) {
60341
+ errors.push("consumption and authoring package artifact digests must match");
60342
+ }
60343
+ if (options.expectedPackageVersion && consumption.packageVersion !== options.expectedPackageVersion) {
60344
+ errors.push(`packageVersion does not match expected ${options.expectedPackageVersion}`);
60345
+ }
60346
+ if (options.expectedCommitSha && consumption.commitSha !== options.expectedCommitSha) {
60347
+ errors.push(`commitSha does not match expected ${options.expectedCommitSha}`);
60348
+ }
60349
+ if (options.expectedPackageArtifactSha256 && consumption.packageArtifactSha256 !== options.expectedPackageArtifactSha256) {
60350
+ errors.push("package artifact digest does not match the supplied candidate");
60351
+ }
60352
+ if (options.maxAgeMs !== void 0) {
60353
+ for (const [tier, evidence] of [
60354
+ ["consumption", consumption],
60355
+ ["authoring", authoring]
60356
+ ]) {
60357
+ const generatedAt = Date.parse(evidence.generatedAt);
60358
+ if (!Number.isFinite(generatedAt)) errors.push(`${tier} generatedAt is invalid`);
60359
+ else if (now.getTime() - generatedAt > options.maxAgeMs)
60360
+ errors.push(`${tier} evidence is stale`);
60361
+ else if (generatedAt > now.getTime() + 5 * 6e4)
60362
+ errors.push(`${tier} generatedAt is in the future`);
60363
+ }
60364
+ }
60365
+ if (errors.length > 0) {
60366
+ throw new Error(
60367
+ `Databricks cross-tier evidence is invalid:
60368
+ - ${[...new Set(errors)].join("\n- ")}`
60369
+ );
60370
+ }
60371
+ return {
60372
+ schemaVersion: 1,
60373
+ valid: true,
60374
+ generatedAt: now.toISOString(),
60375
+ packageVersion: requiredEvidenceValue(consumption.packageVersion, "packageVersion"),
60376
+ commitSha: requiredEvidenceValue(consumption.commitSha, "commitSha"),
60377
+ packageArtifactSha256: requiredEvidenceValue(
60378
+ consumption.packageArtifactSha256,
60379
+ "packageArtifactSha256"
60380
+ ),
60381
+ consumption: {
60382
+ evidenceId: consumption.evidenceId,
60383
+ generatedAt: consumption.generatedAt
60384
+ },
60385
+ authoring: {
60386
+ evidenceId: authoring.evidenceId,
60387
+ generatedAt: authoring.generatedAt
60388
+ }
60389
+ };
60390
+ }
60391
+ function validateTierEvidence(label, evidence, checks, tier, errors) {
60392
+ if (evidence.schemaVersion !== 2) errors.push(`${label} schemaVersion must be 2`);
60393
+ if (!evidence.passed) errors.push(`${label} certification did not pass`);
60394
+ for (const checkId of checks) {
60395
+ if (!evidence.requiredChecks.includes(checkId)) {
60396
+ errors.push(`${label} Tier ${tier} check ${checkId} is absent from requiredChecks`);
60397
+ continue;
60398
+ }
60399
+ const result = evidence.results.find((candidate) => candidate.id === checkId);
60400
+ if (!result || !result.required || result.status !== "passed" || result.tier !== tier) {
60401
+ errors.push(`${label} Tier ${tier} check ${checkId} does not have a required passing result`);
60402
+ }
60403
+ }
60404
+ }
60405
+ function validateDatabricksRollingEvidence(options) {
60406
+ const now = options.now ?? /* @__PURE__ */ new Date();
60407
+ const requiredDays = options.requiredDays ?? 14;
60408
+ if (!Number.isInteger(requiredDays) || requiredDays < 2) {
60409
+ throw new Error("Databricks rolling evidence requiredDays must be an integer of at least 2.");
60410
+ }
60411
+ const end = utcDay(now);
60412
+ const expectedDates = Array.from(
60413
+ { length: requiredDays },
60414
+ (_2, offset) => utcDateKey(new Date(end.getTime() - (requiredDays - 1 - offset) * 864e5))
60415
+ );
60416
+ const expectedDateSet = new Set(expectedDates);
60417
+ const errors = [];
60418
+ const consumptionByDate = /* @__PURE__ */ new Map();
60419
+ for (const evidence of options.consumption) {
60420
+ const generatedAt = Date.parse(evidence.generatedAt);
60421
+ if (!Number.isFinite(generatedAt)) {
60422
+ errors.push(`Tier R evidence ${evidence.evidenceId} has an invalid generatedAt`);
60423
+ continue;
60424
+ }
60425
+ const date5 = utcDateKey(new Date(generatedAt));
60426
+ if (!expectedDateSet.has(date5)) continue;
60427
+ const tierErrors = [];
60428
+ validateTierEvidence(
60429
+ `Tier R evidence ${evidence.evidenceId}`,
60430
+ evidence,
60431
+ DATABRICKS_RELEASE_CERTIFICATION_CHECKS,
60432
+ "R",
60433
+ tierErrors
60434
+ );
60435
+ if (!evidence.relatedEvidenceSha256?.["app-user-isolation"]?.match(/^[a-f0-9]{64}$/)) {
60436
+ tierErrors.push(`Tier R evidence ${evidence.evidenceId} is not bound to App user isolation`);
60437
+ }
60438
+ if (tierErrors.length > 0) {
60439
+ errors.push(...tierErrors);
60440
+ continue;
60441
+ }
60442
+ const previous = consumptionByDate.get(date5);
60443
+ if (!previous || Date.parse(previous.generatedAt) < generatedAt) {
60444
+ consumptionByDate.set(date5, evidence);
60445
+ }
60446
+ }
60447
+ for (const date5 of expectedDates) {
60448
+ if (!consumptionByDate.has(date5)) errors.push(`Tier R evidence is missing for ${date5}`);
60449
+ }
60450
+ const consumptionById = new Map(
60451
+ [...consumptionByDate.values()].map((evidence) => [evidence.evidenceId, evidence])
60452
+ );
60453
+ const validCrossTier = options.crossTier.filter((manifest) => {
60454
+ const generatedAt = Date.parse(manifest.generatedAt);
60455
+ if (!Number.isFinite(generatedAt) || !expectedDateSet.has(utcDateKey(new Date(generatedAt)))) {
60456
+ return false;
60457
+ }
60458
+ const consumption = consumptionById.get(manifest.consumption.evidenceId);
60459
+ if (manifest.schemaVersion !== 1 || manifest.valid !== true || !consumption || manifest.packageVersion !== consumption.packageVersion || manifest.commitSha !== consumption.commitSha || manifest.packageArtifactSha256 !== consumption.packageArtifactSha256) {
60460
+ errors.push(`Cross-tier evidence for ${manifest.generatedAt} does not match retained Tier R`);
60461
+ return false;
60462
+ }
60463
+ return true;
60464
+ });
60465
+ const crossTierDates = [
60466
+ ...new Set(validCrossTier.map((item) => utcDateKey(new Date(item.generatedAt))))
60467
+ ].sort();
60468
+ if (crossTierDates.length < 2) {
60469
+ errors.push("At least two distinct cross-tier certification dates are required in the window");
60470
+ }
60471
+ if (errors.length > 0) {
60472
+ throw new Error(
60473
+ `Databricks rolling evidence is invalid:
60474
+ - ${[...new Set(errors)].join("\n- ")}`
60475
+ );
60476
+ }
60477
+ return {
60478
+ schemaVersion: 1,
60479
+ valid: true,
60480
+ generatedAt: now.toISOString(),
60481
+ windowStart: `${expectedDates[0]}T00:00:00.000Z`,
60482
+ windowEnd: `${expectedDates.at(-1)}T23:59:59.999Z`,
60483
+ requiredDays,
60484
+ consumptionDates: expectedDates,
60485
+ crossTierDates,
60486
+ packageVersions: [
60487
+ ...new Set(
60488
+ [...consumptionByDate.values()].map((evidence) => evidence.packageVersion).filter((value) => Boolean(value))
60489
+ )
60490
+ ].sort()
60491
+ };
60492
+ }
60493
+ function requiredEvidenceValue(value, field) {
60494
+ if (!value) throw new Error(`Databricks evidence ${field} is missing.`);
60495
+ return value;
60496
+ }
60497
+ function utcDay(value) {
60498
+ return new Date(Date.UTC(value.getUTCFullYear(), value.getUTCMonth(), value.getUTCDate()));
60499
+ }
60500
+ function utcDateKey(value) {
60501
+ return value.toISOString().slice(0, 10);
60502
+ }
60250
60503
  function validateDatabricksReleaseEvidence(options) {
60251
60504
  const { evidence } = options;
60252
60505
  const errors = [];
@@ -60362,6 +60615,32 @@ function validateDatabricksAppRecoveryEvidence(evidence) {
60362
60615
  - ${errors.join("\n- ")}`);
60363
60616
  }
60364
60617
  }
60618
+ function validateDatabricksAppUserIsolationEvidence(evidence) {
60619
+ const errors = [];
60620
+ if (evidence.schemaVersion !== 1) errors.push("schemaVersion must be 1");
60621
+ if (evidence.target !== "databricks-app") errors.push("target must be databricks-app");
60622
+ if (!evidence.generatedAt || !Number.isFinite(Date.parse(evidence.generatedAt)))
60623
+ errors.push("generatedAt must be a valid timestamp");
60624
+ for (const field of [
60625
+ "principalsDistinct",
60626
+ "ownerCanList",
60627
+ "ownerCanRead",
60628
+ "otherCannotList"
60629
+ ]) {
60630
+ if (evidence[field] !== true) errors.push(`${field} must be true`);
60631
+ }
60632
+ if (evidence.otherDirectReadStatus !== 404) errors.push("otherDirectReadStatus must be 404");
60633
+ if (evidence.secretsAbsentFromResponses !== true)
60634
+ errors.push("secretsAbsentFromResponses must be true");
60635
+ if (evidence.principalIdentifiersRetained !== false)
60636
+ errors.push("principalIdentifiersRetained must be false");
60637
+ if (!evidence.runIdHash?.match(/^[a-f0-9]{64}$/))
60638
+ errors.push("runIdHash must be a SHA-256 digest");
60639
+ if (errors.length > 0) {
60640
+ throw new Error(`Databricks App user-isolation evidence is invalid:
60641
+ - ${errors.join("\n- ")}`);
60642
+ }
60643
+ }
60365
60644
 
60366
60645
  // src/certification-environment.ts
60367
60646
  var REQUIREMENTS = {
@@ -60487,6 +60766,20 @@ function validateDatabricksCertificationEnvironment(environment, requiredChecks)
60487
60766
  )
60488
60767
  );
60489
60768
  }
60769
+ if (environment.FABRIC_DATABRICKS_REQUIRE_USER_ISOLATION === "1") {
60770
+ const missing = ["DATABRICKS_OBO_TOKEN_A", "DATABRICKS_OBO_TOKEN_B"].filter(
60771
+ (name) => !present(environment, name)
60772
+ );
60773
+ if (missing.length > 0) {
60774
+ issues.push(
60775
+ issue2(
60776
+ "app-user-isolation",
60777
+ missing,
60778
+ `two distinct OBO identities are required; missing ${missing.join(", ")}`
60779
+ )
60780
+ );
60781
+ }
60782
+ }
60490
60783
  if (requiredChecks.some((checkId) => databricksCertificationTier(checkId) === "A")) {
60491
60784
  const missing = [
60492
60785
  "FABRIC_DATABRICKS_AUTHORING_TEST",
@@ -61355,9 +61648,73 @@ function databricksCompatibilityRecord(evidence) {
61355
61648
 
61356
61649
  // src/capabilities.ts
61357
61650
  var ALL_CLOUDS = ["aws", "azure", "gcp"];
61358
- var AUTHORING_EVIDENCE_ID = "dbx-cert-b2c709717ef3a452234a5b2944311a576dafda03a9eea8246747ab3fa430b183";
61651
+ var AUTHORING_EVIDENCE_ID = "dbx-cert-d4b16490526892f3945ba5a53249c600581aaed105829c0b87f00eed508bcb18";
61359
61652
  var CLASSIC_AUTHORING_EVIDENCE_ID = "dbx-cert-d5bdbd276533a8634910e223898337314446561be2a444030fc2d11baa237bec";
61653
+ var CURRENT_CONSUMPTION_EVIDENCE_ID = "dbx-cert-cae2dd6ea7929cd1fdeb7b75dd168d3c111e0cb3c47df1a21efd4fdb266f8d30";
61360
61654
  var DATABRICKS_CAPABILITY_EVIDENCE = [
61655
+ {
61656
+ id: CURRENT_CONSUMPTION_EVIDENCE_ID,
61657
+ source: "repository-evidence:artifacts/databricks-certification-current.json",
61658
+ certifiedAt: "2026-07-20T11:09:31.941Z",
61659
+ packageVersion: "4.4.1",
61660
+ artifactSha256: "6eea378ebe5f4e73b38b4cf01b873b53a5aba5d14bd0a1e7cb7ecf2daf35e55b",
61661
+ apiVersions: {
61662
+ sdkJs: "0.21.0",
61663
+ jobs: "2.2",
61664
+ sqlStatements: "2.0",
61665
+ unityCatalog: "2.1",
61666
+ workspace: "2.0",
61667
+ mlflow: "2.0",
61668
+ lakebaseCredentials: "2.0",
61669
+ apps: "2.0",
61670
+ responses: "agent/v1/responses",
61671
+ aiSearch: "2.0",
61672
+ serving: "2.0",
61673
+ lakeflow: "2.0",
61674
+ genie: "2.0",
61675
+ mcp: "2.0"
61676
+ },
61677
+ environments: [{ cloud: "azure", region: "eastus2", authMode: "oauth-m2m" }],
61678
+ checks: [
61679
+ "identity",
61680
+ "ai-gateway.discover",
61681
+ "ai-gateway.invoke",
61682
+ "sql.execute",
61683
+ "sql.uc-allowed",
61684
+ "sql.uc-denied",
61685
+ "jobs.run",
61686
+ "jobs.wait",
61687
+ "jobs.output",
61688
+ "lakebase.read",
61689
+ "lakebase.write",
61690
+ "lakebase.recovery",
61691
+ "volumes.read",
61692
+ "volumes.write",
61693
+ "volumes.authorization-denied",
61694
+ "uc.read",
61695
+ "uc.authorization-denied",
61696
+ "cost.read",
61697
+ "cost.reconcile",
61698
+ "approval.request",
61699
+ "approval.consume",
61700
+ "approval.denied",
61701
+ "lineage.write",
61702
+ "apps.build",
61703
+ "apps.deploy",
61704
+ "apps.identity",
61705
+ "apps.restart",
61706
+ "genie.execute",
61707
+ "genie.authorization-denied",
61708
+ "feature-serving.read",
61709
+ "feature-serving.authorization-denied",
61710
+ "ai-search.query",
61711
+ "ai-search.authorization-denied",
61712
+ "lakeflow.read",
61713
+ "lakeflow.execute",
61714
+ "responses.execute",
61715
+ "responses.recovery"
61716
+ ]
61717
+ },
61361
61718
  {
61362
61719
  id: "dbx-cert-d03df5a0a5b69a98d8acb0ad4c1e9ef9bcffefea7e433cbd2ba0ff3d792fec71",
61363
61720
  source: "github-actions-run:29173178927",
@@ -61416,10 +61773,10 @@ var DATABRICKS_CAPABILITY_EVIDENCE = [
61416
61773
  },
61417
61774
  {
61418
61775
  id: AUTHORING_EVIDENCE_ID,
61419
- source: "github-actions-run:29660486290",
61420
- certifiedAt: "2026-07-18T20:54:53.195Z",
61421
- packageVersion: "4.0.2",
61422
- artifactSha256: "72f602626b9d79a808f6dd9e30f6ba703061bda19bae2aef983e7e92d7c61a45",
61776
+ source: "repository-evidence:artifacts/databricks-authoring-certification-current.json",
61777
+ certifiedAt: "2026-07-20T10:33:24.197Z",
61778
+ packageVersion: "4.4.1",
61779
+ artifactSha256: "52e9a74de75da3f51a1f18c0cc59213474ef6b7ee6143885129c14b24cde9e4b",
61423
61780
  apiVersions: {
61424
61781
  jobs: "2.2",
61425
61782
  sqlStatements: "2.0",
@@ -61430,6 +61787,9 @@ var DATABRICKS_CAPABILITY_EVIDENCE = [
61430
61787
  apps: "2.0",
61431
61788
  responses: "agent/v1/responses",
61432
61789
  aiSearch: "2.0",
61790
+ serving: "2.0",
61791
+ lakeflow: "2.0",
61792
+ genie: "2.0",
61433
61793
  mcp: "2.0"
61434
61794
  },
61435
61795
  environments: [{ cloud: "azure", region: "eastus2", authMode: "on-behalf-of" }],
@@ -61511,13 +61871,14 @@ var DATABRICKS_CAPABILITY_DEFINITIONS = [
61511
61871
  category: "agent",
61512
61872
  status: "beta",
61513
61873
  tier: "first-party",
61514
- certification: "contract",
61874
+ certification: "protected-live",
61515
61875
  auth: ["oauth-m2m", "app-service-principal", "on-behalf-of"],
61516
61876
  contractClouds: ALL_CLOUDS,
61517
61877
  surfaces: [{ package: "@fabric-harness/databricks", exports: ["databricksApp"] }],
61518
61878
  requiredEvidence: ["responses.execute", "responses.recovery"],
61879
+ evidenceIds: [CURRENT_CONSUMPTION_EVIDENCE_ID],
61519
61880
  docs: "/docs/databricks/responses-agent",
61520
- notes: "The Serving profile remains Beta and Tier O until responses execution and recovery pass on the exact package candidate."
61881
+ notes: "The API remains Beta, but execution, streaming output, inference-table configuration and recovery passed on the exact 4.4.1 package and App artifacts."
61521
61882
  },
61522
61883
  {
61523
61884
  id: "unity-ai-gateway",
@@ -61535,7 +61896,7 @@ var DATABRICKS_CAPABILITY_DEFINITIONS = [
61535
61896
  }
61536
61897
  ],
61537
61898
  requiredEvidence: ["ai-gateway.discover", "ai-gateway.invoke"],
61538
- evidenceIds: ["dbx-cert-d03df5a0a5b69a98d8acb0ad4c1e9ef9bcffefea7e433cbd2ba0ff3d792fec71"],
61899
+ evidenceIds: [CURRENT_CONSUMPTION_EVIDENCE_ID],
61539
61900
  docs: "/docs/databricks/integrations"
61540
61901
  },
61541
61902
  {
@@ -61613,7 +61974,7 @@ var DATABRICKS_CAPABILITY_DEFINITIONS = [
61613
61974
  }
61614
61975
  ],
61615
61976
  requiredEvidence: ["ai-search.query", "ai-search.authorization-denied"],
61616
- evidenceIds: ["dbx-cert-d03df5a0a5b69a98d8acb0ad4c1e9ef9bcffefea7e433cbd2ba0ff3d792fec71"],
61977
+ evidenceIds: [CURRENT_CONSUMPTION_EVIDENCE_ID],
61617
61978
  docs: "/docs/databricks/rag",
61618
61979
  notes: "Query evidence remains separate from the beta ai-search-admin lifecycle."
61619
61980
  },
@@ -61633,7 +61994,7 @@ var DATABRICKS_CAPABILITY_DEFINITIONS = [
61633
61994
  }
61634
61995
  ],
61635
61996
  requiredEvidence: ["lakeflow.read", "lakeflow.execute"],
61636
- evidenceIds: ["dbx-cert-d03df5a0a5b69a98d8acb0ad4c1e9ef9bcffefea7e433cbd2ba0ff3d792fec71"],
61997
+ evidenceIds: [CURRENT_CONSUMPTION_EVIDENCE_ID],
61637
61998
  docs: "/docs/databricks/integrations",
61638
61999
  notes: "Read/execute evidence remains separate from the beta lakeflow-authoring lifecycle."
61639
62000
  },
@@ -61648,7 +62009,7 @@ var DATABRICKS_CAPABILITY_DEFINITIONS = [
61648
62009
  contractClouds: ALL_CLOUDS,
61649
62010
  surfaces: [{ package: "@fabric-harness/databricks", exports: ["databricksApp"] }],
61650
62011
  requiredEvidence: ["apps.build", "apps.deploy"],
61651
- evidenceIds: ["dbx-cert-d03df5a0a5b69a98d8acb0ad4c1e9ef9bcffefea7e433cbd2ba0ff3d792fec71"],
62012
+ evidenceIds: [CURRENT_CONSUMPTION_EVIDENCE_ID],
61652
62013
  docs: "/docs/deployment/databricks",
61653
62014
  notes: "Typed multi-resource composition and schema-driven validation remain."
61654
62015
  },
@@ -61971,7 +62332,7 @@ function stableConsumptionCapabilities() {
61971
62332
  id,
61972
62333
  name,
61973
62334
  category,
61974
- status: id === "jobs-run" ? "beta" : "stable",
62335
+ status: "stable",
61975
62336
  tier: "first-party",
61976
62337
  certification: "protected-live",
61977
62338
  auth: ["oauth-m2m", "app-service-principal", "on-behalf-of", "pat"],
@@ -61979,10 +62340,7 @@ function stableConsumptionCapabilities() {
61979
62340
  surfaces: [{ package: "@fabric-harness/databricks", exports }],
61980
62341
  docs: "/docs/databricks/integrations",
61981
62342
  requiredEvidence,
61982
- evidenceIds: ["dbx-cert-d03df5a0a5b69a98d8acb0ad4c1e9ef9bcffefea7e433cbd2ba0ff3d792fec71"],
61983
- ...id === "jobs-run" ? {
61984
- notes: "Jobs 2.2 contract coverage passes; stable promotion awaits refreshed 2.2 live evidence."
61985
- } : {}
62343
+ evidenceIds: id === "ai-functions" ? ["dbx-cert-d03df5a0a5b69a98d8acb0ad4c1e9ef9bcffefea7e433cbd2ba0ff3d792fec71"] : [CURRENT_CONSUMPTION_EVIDENCE_ID]
61986
62344
  }));
61987
62345
  }
61988
62346
  function certifiedCloudsForEvidence(evidenceIds) {
@@ -62289,6 +62647,7 @@ function defineDatabricksAgent(options = {}) {
62289
62647
  const merged = options ? mergeOptions(options) : {};
62290
62648
  const {
62291
62649
  databricks: explicitConfig,
62650
+ analyticsCopilot = false,
62292
62651
  modelProvider,
62293
62652
  tools = [],
62294
62653
  sandbox,
@@ -62306,8 +62665,9 @@ function defineDatabricksAgent(options = {}) {
62306
62665
  ...directTools.length > 0 ? { tools: directTools } : {},
62307
62666
  run: async (context) => {
62308
62667
  const env2 = context.env ?? {};
62309
- const config2 = explicitConfig ?? databricksConfigFromEnv(env2);
62668
+ const config2 = explicitConfig ?? databricksConfigFromEnv(env2, { analyticsCopilot });
62310
62669
  const bundle = databricks(config2);
62670
+ const analyticsCostLimit = analyticsCopilot ? databricksAnalyticsCostLimitFromEnv(env2, config2, bundle) : void 0;
62311
62671
  if (toolRefs.length > 0) resolveToolRefs(bundle, toolRefs);
62312
62672
  const directNames = new Set(directTools.map((tool7) => tool7.name));
62313
62673
  const bundleTools = bundle.tools.filter((tool7) => !directNames.has(tool7.name));
@@ -62317,6 +62677,7 @@ function defineDatabricksAgent(options = {}) {
62317
62677
  ...initOptions,
62318
62678
  modelProvider: initOptions.modelProvider ?? modelProvider ?? bundle.modelProvider,
62319
62679
  tools: [...bundleTools, ...initOptions.tools ?? []],
62680
+ ...analyticsCostLimit && initOptions.costLimit === void 0 ? { costLimit: analyticsCostLimit } : {},
62320
62681
  ...policy ? { policy } : {},
62321
62682
  ...bundle.store && initOptions.store === void 0 ? { store: bundle.store } : {},
62322
62683
  ...sandbox && initOptions.sandbox === void 0 ? { sandbox } : {}
@@ -62330,7 +62691,22 @@ function defineDatabricksAgent(options = {}) {
62330
62691
  };
62331
62692
  return defineAgent(def);
62332
62693
  }
62333
- function databricksConfigFromEnv(env2) {
62694
+ function databricksAnalyticsCostLimitFromEnv(env2, config2, bundle) {
62695
+ if (env2.FABRIC_MOCK === "1") return void 0;
62696
+ const warehouseId = config2.warehouseId;
62697
+ const tenantId = env2.DATABRICKS_COST_TENANT_ID?.trim();
62698
+ const perDayUsd = Number(env2.DATABRICKS_COST_PER_DAY_USD);
62699
+ if (!warehouseId) throw new Error("Analytics copilot cost enforcement requires a SQL Warehouse.");
62700
+ if (!tenantId) throw new Error("Analytics copilot requires DATABRICKS_COST_TENANT_ID.");
62701
+ if (!Number.isFinite(perDayUsd) || perDayUsd <= 0) {
62702
+ throw new Error("Analytics copilot requires a positive DATABRICKS_COST_PER_DAY_USD.");
62703
+ }
62704
+ return databricksTenantCostLimit(bundle.sdk.statements, warehouseId, tenantId, {
62705
+ perDayUsd,
62706
+ onExceed: "throw"
62707
+ });
62708
+ }
62709
+ function databricksConfigFromEnv(env2, options = {}) {
62334
62710
  const rawHost = env2.DATABRICKS_HOST;
62335
62711
  const host = rawHost ? rawHost.includes("://") ? rawHost : `https://${rawHost}` : void 0;
62336
62712
  if (!host && env2.FABRIC_MOCK !== "1") {
@@ -62339,12 +62715,38 @@ function databricksConfigFromEnv(env2) {
62339
62715
  );
62340
62716
  }
62341
62717
  const principal = env2.FABRIC_MOCK === "1" ? { kind: "pat", token: "mock-token" } : databricksPrincipalFromEnv(env2);
62718
+ const analyticsCopilot = options.analyticsCopilot === true;
62719
+ const genieAgentId = env2.DATABRICKS_GENIE_SPACE_ID;
62720
+ const stewardAudience = env2.DATABRICKS_ANALYTICS_STEWARD_AUDIENCE;
62721
+ if (analyticsCopilot && env2.FABRIC_MOCK !== "1" && !env2.DATABRICKS_WAREHOUSE_ID) {
62722
+ throw new Error("Analytics copilot requires DATABRICKS_WAREHOUSE_ID.");
62723
+ }
62724
+ if (analyticsCopilot && env2.FABRIC_MOCK !== "1" && !genieAgentId) {
62725
+ throw new Error("Analytics copilot requires DATABRICKS_GENIE_SPACE_ID.");
62726
+ }
62727
+ if (analyticsCopilot && env2.FABRIC_MOCK !== "1" && !stewardAudience) {
62728
+ throw new Error("Analytics copilot requires DATABRICKS_ANALYTICS_STEWARD_AUDIENCE.");
62729
+ }
62730
+ const catalog = env2.DATABRICKS_CATALOG?.trim();
62342
62731
  return {
62343
62732
  host: host ?? "https://mock.databricks.com",
62344
62733
  principal,
62345
62734
  ...env2.DATABRICKS_MODEL ? { model: env2.DATABRICKS_MODEL } : {},
62346
62735
  ...env2.DATABRICKS_WAREHOUSE_ID ? { warehouseId: env2.DATABRICKS_WAREHOUSE_ID } : {},
62347
- ...env2.FABRIC_MOCK === "1" ? { warehouseId: "mock-warehouse-id" } : {}
62736
+ ...env2.FABRIC_MOCK === "1" ? { warehouseId: "mock-warehouse-id" } : {},
62737
+ ...analyticsCopilot ? {
62738
+ sqlRead: true,
62739
+ consumption: true,
62740
+ genie: {
62741
+ conversations: {
62742
+ agentId: genieAgentId ?? "mock-genie-agent"
62743
+ }
62744
+ },
62745
+ governance: analyticsCopilotGovernance({
62746
+ stewardAudience: stewardAudience ?? "analytics-stewards",
62747
+ ...catalog ? { catalogs: [catalog] } : {}
62748
+ })
62749
+ } : {}
62348
62750
  };
62349
62751
  }
62350
62752
  function resolveToolRefs(bundle, refs) {
@@ -62354,6 +62756,7 @@ function resolveToolRefs(bundle, refs) {
62354
62756
  }
62355
62757
  const shortNameMap = {
62356
62758
  sql: "databricks_sql",
62759
+ "sql-read": "sql_read",
62357
62760
  tables: "databricks_unity_catalog_tables",
62358
62761
  "table-info": "databricks_table_info",
62359
62762
  search: "search",
@@ -62879,6 +63282,7 @@ function buildDatabricksBundle(config2, scope) {
62879
63282
  });
62880
63283
  }
62881
63284
  const rawTools = [
63285
+ ...config2.sqlRead && config2.warehouseId ? [databricksSqlReadTool(native.statements, { warehouseId: config2.warehouseId })] : [],
62882
63286
  ...config2.warehouseId ? [databricksSqlTool(native.statements, { warehouseId: config2.warehouseId })] : [],
62883
63287
  unityCatalogTablesTool(native.tables),
62884
63288
  databricksTableInfoTool(native.tables),
@@ -63005,8 +63409,10 @@ function buildDatabricksBundle(config2, scope) {
63005
63409
  ...agentServicesClient ? { agentServices: agentServicesClient } : {},
63006
63410
  aiGateway: {
63007
63411
  ensure: () => ensureDatabricksAiGateway(client),
63008
- listModelServices: (options) => listDatabricksModelServices(client, options)
63412
+ listModelServices: (options) => listDatabricksModelServices(client, options),
63413
+ listModelProviderServices: () => listDatabricksModelProviderServices(client)
63009
63414
  },
63415
+ sqlWarehouses: { list: () => listDatabricksSqlWarehouses(client) },
63010
63416
  mlflowTraceExporter: (options) => mlflowTraceExporter({ client, ...options }),
63011
63417
  forPrincipal(input) {
63012
63418
  const scoped = buildDatabricksBundle(config2, {
@@ -63154,7 +63560,9 @@ export {
63154
63560
  analyticsCopilotGovernance,
63155
63561
  appServicePrincipalFromEnv,
63156
63562
  buildMlflowTrace,
63563
+ chooseDatabricksSqlWarehouse,
63157
63564
  createDatabricksAppUserAuthenticator,
63565
+ createDatabricksAuthenticatedFetch,
63158
63566
  createDatabricksAuthoringCertificationChecks,
63159
63567
  createDatabricksRagChain,
63160
63568
  databricks,
@@ -63162,6 +63570,7 @@ export {
63162
63570
  databricksAiQueryTool,
63163
63571
  databricksAiSearch,
63164
63572
  databricksAiSearchAdminTools,
63573
+ databricksAnthropicGatewayBaseUrl,
63165
63574
  databricksApp,
63166
63575
  databricksApprovalRules,
63167
63576
  databricksCertificationTier,
@@ -63184,6 +63593,7 @@ export {
63184
63593
  databricksMlflowLogMetricTool,
63185
63594
  databricksMlflowLogParamTool,
63186
63595
  databricksModelBaseUrl,
63596
+ databricksModelProviderSupportsAnthropic,
63187
63597
  databricksNotebookTool,
63188
63598
  databricksPersistence,
63189
63599
  databricksPipelineListTool,
@@ -63227,6 +63637,7 @@ export {
63227
63637
  missingDatabricksCapabilityEvidence,
63228
63638
  normalizeDatabricksGenieAgentSpec,
63229
63639
  onBehalfOfFromHeaders,
63640
+ parseStatementRows,
63230
63641
  queryDatabricksLineageEvidence,
63231
63642
  ragTurnCitationsScorer,
63232
63643
  ragTurnContainsScorer,
@@ -63239,6 +63650,7 @@ export {
63239
63650
  runDatabricksAuthoringLifecycle,
63240
63651
  runDatabricksCertification,
63241
63652
  runDatabricksCommand,
63653
+ runStatement,
63242
63654
  scoreRagTurn,
63243
63655
  serializeDatabricksGenieAgentSpec,
63244
63656
  servingUsageCapture,
@@ -63250,11 +63662,14 @@ export {
63250
63662
  unregisterDatabricksSqlSandboxBackend,
63251
63663
  validateDatabricksAppArtifact,
63252
63664
  validateDatabricksAppRecoveryEvidence,
63665
+ validateDatabricksAppUserIsolationEvidence,
63253
63666
  validateDatabricksCertificationEnvironment,
63254
63667
  validateDatabricksComputePolicy,
63668
+ validateDatabricksCrossTierEvidence,
63255
63669
  validateDatabricksGenieSqlReferences,
63256
63670
  validateDatabricksGovernanceDescriptor,
63257
63671
  validateDatabricksReleaseEvidence,
63672
+ validateDatabricksRollingEvidence,
63258
63673
  validateJobSpec,
63259
63674
  withGovernance,
63260
63675
  withGovernanceTools