@fabric-harness/databricks 4.6.0 → 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/README.md CHANGED
@@ -197,6 +197,16 @@ Run the opt-in credential/connection smoke with `FABRIC_DATABRICKS_LAKEBASE_TEST
197
197
  `DATABRICKS_HOST`, either `DATABRICKS_TOKEN` or M2M client credentials, `ENDPOINT_NAME`, `PGHOST`,
198
198
  `PGDATABASE`, and `PGUSER`.
199
199
 
200
+ ## Vertical application control-plane seams
201
+
202
+ Vertical applications import Databricks behavior from this package instead of maintaining their
203
+ own token, SQL, or discovery clients. `createDatabricksAuthenticatedFetch()` adapts the canonical
204
+ principal to third-party SDKs with a bounded authentication retry. `runStatement()` uses the
205
+ generated Statement Execution client. `databricks(...).aiGateway` discovers both system model
206
+ services and governed model-provider services, while `databricks(...).sqlWarehouses.list()` covers
207
+ the reviewed SDK gap for warehouse discovery. Credentials remain outside returned evidence and
208
+ application mutation parameters.
209
+
200
210
  ## SQL Warehouse sandbox
201
211
 
202
212
  ```ts
package/dist/agent.js CHANGED
@@ -18078,6 +18078,22 @@ async function listDatabricksModelServices(client, options = {}) {
18078
18078
  }
18079
18079
  throw new Error(`databricks model-services pagination exceeded ${maxPages} pages.`);
18080
18080
  }
18081
+ async function listDatabricksModelProviderServices(client) {
18082
+ const payload = await client.get("/api/2.1/unity-catalog/model-provider-services");
18083
+ return (payload.model_provider_services ?? []).flatMap((service) => {
18084
+ const rawName = service.name?.trim();
18085
+ if (!rawName) return [];
18086
+ const config2 = service.config ?? {};
18087
+ return [
18088
+ {
18089
+ name: rawName.replace(/^model-provider-services\//, ""),
18090
+ providerType: (config2.provider_type ?? "").replace(/^EXTERNAL_MODEL_PROVIDER_TYPE_/, "").toLowerCase(),
18091
+ targets: (config2.targets ?? []).map((target) => target.model?.trim()).filter((model) => Boolean(model)),
18092
+ allowAllTargets: Boolean(config2.allow_all_targets)
18093
+ }
18094
+ ];
18095
+ }).sort((left, right) => left.name.localeCompare(right.name));
18096
+ }
18081
18097
  function normalizeModelService(raw, requiredPrefix) {
18082
18098
  const rawName = typeof raw.name === "string" ? raw.name.trim() : "";
18083
18099
  const name = rawName.replace(/^model-services\//, "");
@@ -57158,7 +57174,12 @@ var DATABRICKS_RAW_PROTOCOL_RULES = [
57158
57174
  {
57159
57175
  id: "ai-gateway-discovery",
57160
57176
  methods: ["GET"],
57161
- path: /^\/api\/(?:ai-gateway\/v2\/endpoints|2\.1\/unity-catalog\/model-services)$/u
57177
+ path: /^\/api\/(?:ai-gateway\/v2\/endpoints|2\.1\/unity-catalog\/model-(?:provider-)?services)$/u
57178
+ },
57179
+ {
57180
+ id: "sql-warehouse-discovery",
57181
+ methods: ["GET"],
57182
+ path: /^\/api\/2\.0\/sql\/warehouses$/u
57162
57183
  },
57163
57184
  {
57164
57185
  id: "agent-services-beta",
@@ -57810,6 +57831,18 @@ function jitter3(ms) {
57810
57831
  return Math.max(1, Math.round(ms * (0.9 + Math.random() * 0.2)));
57811
57832
  }
57812
57833
 
57834
+ // src/sql-warehouses.ts
57835
+ async function listDatabricksSqlWarehouses(client) {
57836
+ const payload = await client.get("/api/2.0/sql/warehouses");
57837
+ return (payload.warehouses ?? []).filter(
57838
+ (warehouse) => Boolean(warehouse.id)
57839
+ ).map((warehouse) => ({
57840
+ id: warehouse.id,
57841
+ ...warehouse.name ? { name: warehouse.name } : {},
57842
+ ...warehouse.state ? { state: warehouse.state } : {}
57843
+ }));
57844
+ }
57845
+
57813
57846
  // src/tools.ts
57814
57847
  var UNSAFE_SQL_KEYWORDS = /* @__PURE__ */ new Set([
57815
57848
  "ADD",
@@ -58839,8 +58872,10 @@ function buildDatabricksBundle(config2, scope) {
58839
58872
  ...agentServicesClient ? { agentServices: agentServicesClient } : {},
58840
58873
  aiGateway: {
58841
58874
  ensure: () => ensureDatabricksAiGateway(client),
58842
- listModelServices: (options) => listDatabricksModelServices(client, options)
58875
+ listModelServices: (options) => listDatabricksModelServices(client, options),
58876
+ listModelProviderServices: () => listDatabricksModelProviderServices(client)
58843
58877
  },
58878
+ sqlWarehouses: { list: () => listDatabricksSqlWarehouses(client) },
58844
58879
  mlflowTraceExporter: (options) => mlflowTraceExporter({ client, ...options }),
58845
58880
  forPrincipal(input) {
58846
58881
  const scoped = buildDatabricksBundle(config2, {