@fabric-harness/databricks 4.6.0 → 4.7.1
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 +31 -0
- package/dist/agent.js +37 -2
- package/dist/agent.js.map +1 -1
- package/dist/ai-gateway.d.ts +9 -0
- package/dist/ai-gateway.d.ts.map +1 -1
- package/dist/authenticated-fetch.d.ts +13 -0
- package/dist/authenticated-fetch.d.ts.map +1 -0
- package/dist/certify.js +6 -1
- package/dist/certify.js.map +1 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +75 -2
- package/dist/index.js.map +1 -1
- package/dist/raw-protocol-client.d.ts.map +1 -1
- package/dist/runtime.d.ts +33 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +53046 -0
- package/dist/runtime.js.map +1 -0
- package/dist/sql-sandbox.js +6 -1
- package/dist/sql-sandbox.js.map +1 -1
- package/dist/sql-warehouses.d.ts +10 -0
- package/dist/sql-warehouses.d.ts.map +1 -0
- package/package.json +13 -9
package/README.md
CHANGED
|
@@ -82,6 +82,27 @@ Fabric verticals must import this package instead of implementing local Databric
|
|
|
82
82
|
clients, credential exchange, polling, or retry logic. Applications retain only domain resource
|
|
83
83
|
names, policies, and readiness composition.
|
|
84
84
|
|
|
85
|
+
Server application bundles should import control-plane, generated SDK, SQL, identity, and Lakebase
|
|
86
|
+
helpers from `@fabric-harness/databricks/runtime`. That subpath intentionally excludes Harness build,
|
|
87
|
+
deployment, and agent-authoring modules, so frameworks such as Next.js do not trace build-time Node
|
|
88
|
+
tooling into request handlers. Agent definitions and release tooling continue to use the root export.
|
|
89
|
+
|
|
90
|
+
```ts
|
|
91
|
+
import {
|
|
92
|
+
databricksControlPlane,
|
|
93
|
+
databricksPrincipalFromEnv,
|
|
94
|
+
databricksSdk,
|
|
95
|
+
} from '@fabric-harness/databricks/runtime';
|
|
96
|
+
|
|
97
|
+
const principal = databricksPrincipalFromEnv(process.env);
|
|
98
|
+
const sdk = databricksSdk({ host: process.env.DATABRICKS_HOST!, principal });
|
|
99
|
+
const controlPlane = databricksControlPlane({
|
|
100
|
+
host: process.env.DATABRICKS_HOST!,
|
|
101
|
+
principal,
|
|
102
|
+
});
|
|
103
|
+
const warehouses = await controlPlane.sqlWarehouses.list();
|
|
104
|
+
```
|
|
105
|
+
|
|
85
106
|
### Fabric Platform integration
|
|
86
107
|
|
|
87
108
|
The optional `@fabric-harness/databricks/platform` subpath maps Databricks resource identity and
|
|
@@ -197,6 +218,16 @@ Run the opt-in credential/connection smoke with `FABRIC_DATABRICKS_LAKEBASE_TEST
|
|
|
197
218
|
`DATABRICKS_HOST`, either `DATABRICKS_TOKEN` or M2M client credentials, `ENDPOINT_NAME`, `PGHOST`,
|
|
198
219
|
`PGDATABASE`, and `PGUSER`.
|
|
199
220
|
|
|
221
|
+
## Vertical application control-plane seams
|
|
222
|
+
|
|
223
|
+
Vertical applications import Databricks behavior from this package instead of maintaining their
|
|
224
|
+
own token, SQL, or discovery clients. `createDatabricksAuthenticatedFetch()` adapts the canonical
|
|
225
|
+
principal to third-party SDKs with a bounded authentication retry. `runStatement()` uses the
|
|
226
|
+
generated Statement Execution client. `databricks(...).aiGateway` discovers both system model
|
|
227
|
+
services and governed model-provider services, while `databricks(...).sqlWarehouses.list()` covers
|
|
228
|
+
the reviewed SDK gap for warehouse discovery. Credentials remain outside returned evidence and
|
|
229
|
+
application mutation parameters.
|
|
230
|
+
|
|
200
231
|
## SQL Warehouse sandbox
|
|
201
232
|
|
|
202
233
|
```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, {
|