@fabric-harness/databricks 3.0.2 → 4.0.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 +11 -9
- package/dist/agent.js +426 -22
- package/dist/agent.js.map +1 -1
- package/dist/app.d.ts +6 -0
- package/dist/app.d.ts.map +1 -1
- package/dist/artifact-digest.d.ts.map +1 -1
- package/dist/authoring-certification.d.ts +12 -0
- package/dist/authoring-certification.d.ts.map +1 -1
- package/dist/capabilities.d.ts.map +1 -1
- package/dist/certify.js +128 -28
- package/dist/certify.js.map +1 -1
- package/dist/genie-authoring.d.ts.map +1 -1
- package/dist/index.d.ts +27 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +461 -419
- package/dist/index.js.map +1 -1
- package/dist/serving-admin.d.ts +29 -4
- package/dist/serving-admin.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1795,6 +1795,172 @@ var require_json_bigint = __commonJS({
|
|
|
1795
1795
|
// src/index.ts
|
|
1796
1796
|
import { createSearchTool as createSearchTool2 } from "@fabric-harness/sdk";
|
|
1797
1797
|
|
|
1798
|
+
// src/agent-services.ts
|
|
1799
|
+
var DATABRICKS_AGENT_SERVICES_API = "/api/2.1/unity-catalog/agent-services";
|
|
1800
|
+
var DATABRICKS_AGENT_SERVICE_SECURABLE = "AGENT_SERVICE";
|
|
1801
|
+
var DatabricksAgentServices = class {
|
|
1802
|
+
constructor(client, options) {
|
|
1803
|
+
this.client = client;
|
|
1804
|
+
if (options.acknowledgeBeta !== true) {
|
|
1805
|
+
throw new Error("databricks agent services: acknowledgeBeta must be true.");
|
|
1806
|
+
}
|
|
1807
|
+
}
|
|
1808
|
+
create(options) {
|
|
1809
|
+
const catalog = ucIdentifier(options.catalog, "catalog");
|
|
1810
|
+
const schema = ucIdentifier(options.schema, "schema");
|
|
1811
|
+
const id = ucIdentifier(options.id, "agent service id");
|
|
1812
|
+
const basePath = externalBasePath(options.basePath ?? "/responses");
|
|
1813
|
+
return this.client.post(
|
|
1814
|
+
DATABRICKS_AGENT_SERVICES_API,
|
|
1815
|
+
{
|
|
1816
|
+
agent_service_type: "AGENT_SERVICE_TYPE_EXTERNAL",
|
|
1817
|
+
...options.comment !== void 0 ? { comment: options.comment } : {},
|
|
1818
|
+
config: {
|
|
1819
|
+
connection: { name: connectionResourceName(options.connection) },
|
|
1820
|
+
base_path: basePath,
|
|
1821
|
+
...options.systemPrompt !== void 0 ? { system_prompt: options.systemPrompt } : {}
|
|
1822
|
+
}
|
|
1823
|
+
},
|
|
1824
|
+
{ parent: `schemas/${catalog}.${schema}`, agent_service_id: id },
|
|
1825
|
+
{ retry: "never" }
|
|
1826
|
+
);
|
|
1827
|
+
}
|
|
1828
|
+
get(fullName) {
|
|
1829
|
+
return this.client.get(agentServicePath(fullName));
|
|
1830
|
+
}
|
|
1831
|
+
list(options = {}) {
|
|
1832
|
+
if (options.catalog === void 0 !== (options.schema === void 0)) {
|
|
1833
|
+
throw new Error("databricks agent services: catalog and schema must be provided together.");
|
|
1834
|
+
}
|
|
1835
|
+
const parent = options.catalog && options.schema ? `schemas/${ucIdentifier(options.catalog, "catalog")}.${ucIdentifier(options.schema, "schema")}` : void 0;
|
|
1836
|
+
return this.client.get(DATABRICKS_AGENT_SERVICES_API, {
|
|
1837
|
+
parent,
|
|
1838
|
+
page_token: options.pageToken
|
|
1839
|
+
});
|
|
1840
|
+
}
|
|
1841
|
+
update(fullName, options) {
|
|
1842
|
+
const mask = [];
|
|
1843
|
+
const config2 = {};
|
|
1844
|
+
const body = {};
|
|
1845
|
+
if (options.comment !== void 0) {
|
|
1846
|
+
mask.push("comment");
|
|
1847
|
+
body.comment = options.comment;
|
|
1848
|
+
}
|
|
1849
|
+
if (options.basePath !== void 0) {
|
|
1850
|
+
mask.push("config.base_path");
|
|
1851
|
+
config2.base_path = externalBasePath(options.basePath);
|
|
1852
|
+
}
|
|
1853
|
+
if (options.systemPrompt !== void 0) {
|
|
1854
|
+
mask.push("config.system_prompt");
|
|
1855
|
+
config2.system_prompt = options.systemPrompt;
|
|
1856
|
+
}
|
|
1857
|
+
if (mask.length === 0) {
|
|
1858
|
+
throw new Error(
|
|
1859
|
+
"databricks agent services: update requires comment, basePath or systemPrompt."
|
|
1860
|
+
);
|
|
1861
|
+
}
|
|
1862
|
+
if (Object.keys(config2).length > 0) body.config = config2;
|
|
1863
|
+
return this.client.request(
|
|
1864
|
+
"PATCH",
|
|
1865
|
+
agentServicePath(fullName),
|
|
1866
|
+
body,
|
|
1867
|
+
{ update_mask: mask.join(",") },
|
|
1868
|
+
{ retry: "safe" }
|
|
1869
|
+
);
|
|
1870
|
+
}
|
|
1871
|
+
delete(fullName) {
|
|
1872
|
+
return this.client.request(
|
|
1873
|
+
"DELETE",
|
|
1874
|
+
agentServicePath(fullName),
|
|
1875
|
+
void 0,
|
|
1876
|
+
{},
|
|
1877
|
+
{ retry: "never" }
|
|
1878
|
+
);
|
|
1879
|
+
}
|
|
1880
|
+
permissions(fullName) {
|
|
1881
|
+
return this.client.get(permissionsPath(fullName));
|
|
1882
|
+
}
|
|
1883
|
+
updatePermissions(fullName, changes) {
|
|
1884
|
+
if (changes.length === 0) {
|
|
1885
|
+
throw new Error("databricks agent services: at least one permission change is required.");
|
|
1886
|
+
}
|
|
1887
|
+
for (const change of changes) {
|
|
1888
|
+
if (!change.principal.trim())
|
|
1889
|
+
throw new Error("databricks agent services: principal cannot be empty.");
|
|
1890
|
+
if ((change.add?.length ?? 0) === 0 && (change.remove?.length ?? 0) === 0) {
|
|
1891
|
+
throw new Error(
|
|
1892
|
+
`databricks agent services: ${change.principal} has no privileges to add or remove.`
|
|
1893
|
+
);
|
|
1894
|
+
}
|
|
1895
|
+
}
|
|
1896
|
+
return this.client.request(
|
|
1897
|
+
"PATCH",
|
|
1898
|
+
permissionsPath(fullName),
|
|
1899
|
+
{ changes },
|
|
1900
|
+
{},
|
|
1901
|
+
{ retry: "safe" }
|
|
1902
|
+
);
|
|
1903
|
+
}
|
|
1904
|
+
grant(fullName, principal, privileges = ["EXECUTE"]) {
|
|
1905
|
+
return this.updatePermissions(fullName, [{ principal, add: privileges }]);
|
|
1906
|
+
}
|
|
1907
|
+
revoke(fullName, principal, privileges = ["EXECUTE"]) {
|
|
1908
|
+
return this.updatePermissions(fullName, [{ principal, remove: privileges }]);
|
|
1909
|
+
}
|
|
1910
|
+
};
|
|
1911
|
+
function databricksAgentServices(client, options) {
|
|
1912
|
+
return new DatabricksAgentServices(client, options);
|
|
1913
|
+
}
|
|
1914
|
+
function agentServicePath(fullName) {
|
|
1915
|
+
return `${DATABRICKS_AGENT_SERVICES_API}/${encodeURIComponent(fullUcName(fullName))}`;
|
|
1916
|
+
}
|
|
1917
|
+
function permissionsPath(fullName) {
|
|
1918
|
+
return `/api/2.1/unity-catalog/permissions/${DATABRICKS_AGENT_SERVICE_SECURABLE}/${encodeURIComponent(fullUcName(fullName))}`;
|
|
1919
|
+
}
|
|
1920
|
+
function fullUcName(value) {
|
|
1921
|
+
const parts = value.split(".");
|
|
1922
|
+
if (parts.length !== 3) {
|
|
1923
|
+
throw new Error(
|
|
1924
|
+
`databricks agent services: expected catalog.schema.service, received ${value}.`
|
|
1925
|
+
);
|
|
1926
|
+
}
|
|
1927
|
+
return parts.map(
|
|
1928
|
+
(part, index) => ucIdentifier(part, ["catalog", "schema", "service"][index] ?? "identifier")
|
|
1929
|
+
).join(".");
|
|
1930
|
+
}
|
|
1931
|
+
function connectionResourceName(value) {
|
|
1932
|
+
const trimmed = value.trim();
|
|
1933
|
+
const name = trimmed.startsWith("connections/") ? trimmed.slice("connections/".length) : trimmed;
|
|
1934
|
+
const parts = name.split(".");
|
|
1935
|
+
if (parts.length !== 1 && parts.length !== 3) {
|
|
1936
|
+
throw new Error(
|
|
1937
|
+
`databricks agent services: expected connection name or catalog.schema.connection, received ${value}.`
|
|
1938
|
+
);
|
|
1939
|
+
}
|
|
1940
|
+
return `connections/${parts.map(
|
|
1941
|
+
(part, index) => ucIdentifier(
|
|
1942
|
+
part,
|
|
1943
|
+
parts.length === 1 ? "connection" : ["catalog", "schema", "connection"][index] ?? "identifier"
|
|
1944
|
+
)
|
|
1945
|
+
).join(".")}`;
|
|
1946
|
+
}
|
|
1947
|
+
function externalBasePath(value) {
|
|
1948
|
+
const path = value.trim();
|
|
1949
|
+
if (!path.startsWith("/") || path.startsWith("//") || path.includes("?") || path.includes("#")) {
|
|
1950
|
+
throw new Error(
|
|
1951
|
+
"databricks agent services: basePath must be an absolute URL path without a query or fragment."
|
|
1952
|
+
);
|
|
1953
|
+
}
|
|
1954
|
+
return path;
|
|
1955
|
+
}
|
|
1956
|
+
function ucIdentifier(value, label) {
|
|
1957
|
+
const normalized = value.trim();
|
|
1958
|
+
if (!/^[A-Za-z0-9_][A-Za-z0-9_$-]*$/.test(normalized)) {
|
|
1959
|
+
throw new Error(`databricks agent services: invalid ${label} ${JSON.stringify(value)}.`);
|
|
1960
|
+
}
|
|
1961
|
+
return normalized;
|
|
1962
|
+
}
|
|
1963
|
+
|
|
1798
1964
|
// src/ai-search-admin.ts
|
|
1799
1965
|
var DatabricksAiSearchAdmin = class {
|
|
1800
1966
|
constructor(client) {
|
|
@@ -2035,6 +2201,55 @@ function jitter(ms) {
|
|
|
2035
2201
|
return Math.max(1, Math.round(ms * (0.9 + Math.random() * 0.2)));
|
|
2036
2202
|
}
|
|
2037
2203
|
|
|
2204
|
+
// src/ai-gateway.ts
|
|
2205
|
+
async function ensureDatabricksAiGateway(client) {
|
|
2206
|
+
await client.get("/api/ai-gateway/v2/endpoints", { page_size: 1 });
|
|
2207
|
+
}
|
|
2208
|
+
async function listDatabricksModelServices(client, options = {}) {
|
|
2209
|
+
const pageSize = positiveInteger(options.pageSize ?? 100, "pageSize");
|
|
2210
|
+
const maxPages = positiveInteger(options.maxPages ?? 100, "maxPages");
|
|
2211
|
+
const requiredPrefix = options.requiredPrefix ?? "system.ai.";
|
|
2212
|
+
const services = /* @__PURE__ */ new Map();
|
|
2213
|
+
const seenTokens = /* @__PURE__ */ new Set();
|
|
2214
|
+
let pageToken;
|
|
2215
|
+
for (let page = 0; page < maxPages; page += 1) {
|
|
2216
|
+
const response = await client.get(
|
|
2217
|
+
"/api/2.1/unity-catalog/model-services",
|
|
2218
|
+
{ page_size: pageSize, ...pageToken ? { page_token: pageToken } : {} }
|
|
2219
|
+
);
|
|
2220
|
+
for (const raw of response.model_services ?? []) {
|
|
2221
|
+
const service = normalizeModelService(raw, requiredPrefix);
|
|
2222
|
+
if (service) services.set(service.name, service);
|
|
2223
|
+
}
|
|
2224
|
+
const next = response.next_page_token?.trim();
|
|
2225
|
+
if (!next) return [...services.values()].sort((a2, b2) => a2.name.localeCompare(b2.name));
|
|
2226
|
+
if (seenTokens.has(next))
|
|
2227
|
+
throw new Error(
|
|
2228
|
+
`databricks model-services pagination repeated token after page ${page + 1}.`
|
|
2229
|
+
);
|
|
2230
|
+
seenTokens.add(next);
|
|
2231
|
+
pageToken = next;
|
|
2232
|
+
}
|
|
2233
|
+
throw new Error(`databricks model-services pagination exceeded ${maxPages} pages.`);
|
|
2234
|
+
}
|
|
2235
|
+
function normalizeModelService(raw, requiredPrefix) {
|
|
2236
|
+
const rawName = typeof raw.name === "string" ? raw.name.trim() : "";
|
|
2237
|
+
const name = rawName.replace(/^model-services\//, "");
|
|
2238
|
+
if (!name.startsWith(requiredPrefix)) return void 0;
|
|
2239
|
+
return {
|
|
2240
|
+
name,
|
|
2241
|
+
...typeof raw.comment === "string" ? { comment: raw.comment } : {},
|
|
2242
|
+
...typeof raw.creator === "string" ? { creator: raw.creator } : {},
|
|
2243
|
+
...typeof raw.created_at === "number" ? { createdAt: raw.created_at } : {},
|
|
2244
|
+
...typeof raw.updated_at === "number" ? { updatedAt: raw.updated_at } : {}
|
|
2245
|
+
};
|
|
2246
|
+
}
|
|
2247
|
+
function positiveInteger(value, name) {
|
|
2248
|
+
if (!Number.isSafeInteger(value) || value <= 0)
|
|
2249
|
+
throw new Error(`${name} must be a positive integer.`);
|
|
2250
|
+
return value;
|
|
2251
|
+
}
|
|
2252
|
+
|
|
2038
2253
|
// src/sql-exec.ts
|
|
2039
2254
|
var TERMINAL_STATES = /* @__PURE__ */ new Set(["SUCCEEDED", "FAILED", "CANCELED", "CLOSED"]);
|
|
2040
2255
|
async function runStatement(client, warehouseId, statement, parameters, poll) {
|
|
@@ -2694,10 +2909,10 @@ var DatabricksGenieAgentModeClient = class {
|
|
|
2694
2909
|
if (options.acknowledgeBeta !== true)
|
|
2695
2910
|
throw new Error("Databricks Genie Agent Mode requires acknowledgeBeta: true.");
|
|
2696
2911
|
this.agentId = validateAgentId(options.agentId);
|
|
2697
|
-
this.maxEventBytes =
|
|
2698
|
-
this.maxEvents =
|
|
2699
|
-
this.timeoutMs =
|
|
2700
|
-
this.idleTimeoutMs =
|
|
2912
|
+
this.maxEventBytes = positiveInteger2(options.maxEventBytes ?? 2 * 1024 * 1024, "maxEventBytes");
|
|
2913
|
+
this.maxEvents = positiveInteger2(options.maxEvents ?? 1e4, "maxEvents");
|
|
2914
|
+
this.timeoutMs = positiveInteger2(options.timeoutMs ?? 90 * 6e4, "timeoutMs");
|
|
2915
|
+
this.idleTimeoutMs = positiveInteger2(options.idleTimeoutMs ?? 2 * 6e4, "idleTimeoutMs");
|
|
2701
2916
|
this.onEvent = options.onEvent;
|
|
2702
2917
|
}
|
|
2703
2918
|
agentId;
|
|
@@ -2812,7 +3027,7 @@ var DatabricksGenieAgentModeClient = class {
|
|
|
2812
3027
|
`/api/2.0/genie/agents/${encodeURIComponent(this.agentId)}/conversations/${encodeURIComponent(nonEmpty(conversationId, "conversationId"))}/items`,
|
|
2813
3028
|
{
|
|
2814
3029
|
after: optionalNonEmpty(options.after, "after"),
|
|
2815
|
-
limit: options.limit === void 0 ? void 0 :
|
|
3030
|
+
limit: options.limit === void 0 ? void 0 : positiveInteger2(options.limit, "limit")
|
|
2816
3031
|
},
|
|
2817
3032
|
signalOption(options.signal)
|
|
2818
3033
|
);
|
|
@@ -2831,7 +3046,7 @@ function databricksGenieAgentMode(client, options) {
|
|
|
2831
3046
|
}
|
|
2832
3047
|
function databricksGenieAgentModeTool(client, agentId, options = {}) {
|
|
2833
3048
|
const configuredAgentId = validateAgentId(agentId);
|
|
2834
|
-
const maxOutputBytes =
|
|
3049
|
+
const maxOutputBytes = positiveInteger2(options.maxOutputBytes ?? 1024 * 1024, "maxOutputBytes");
|
|
2835
3050
|
return {
|
|
2836
3051
|
name: "databricks_genie_agent_mode",
|
|
2837
3052
|
description: "Ask a Databricks Genie Agent through the Beta Agent Mode streaming API and return its terminal response.",
|
|
@@ -3031,7 +3246,7 @@ function nonEmpty(value, name) {
|
|
|
3031
3246
|
function optionalNonEmpty(value, name) {
|
|
3032
3247
|
return value === void 0 ? void 0 : nonEmpty(value, name);
|
|
3033
3248
|
}
|
|
3034
|
-
function
|
|
3249
|
+
function positiveInteger2(value, name) {
|
|
3035
3250
|
if (!Number.isSafeInteger(value) || value <= 0)
|
|
3036
3251
|
throw new Error(`Databricks Genie Agent Mode ${name} must be a positive integer.`);
|
|
3037
3252
|
return value;
|
|
@@ -3612,10 +3827,17 @@ function databricksGenieAuthoringTools(client, options) {
|
|
|
3612
3827
|
}
|
|
3613
3828
|
throw error51;
|
|
3614
3829
|
}
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3830
|
+
let current;
|
|
3831
|
+
try {
|
|
3832
|
+
current = await admin.get(agentId, {
|
|
3833
|
+
includeConfiguration: true,
|
|
3834
|
+
...contextSignal(context)
|
|
3835
|
+
});
|
|
3836
|
+
} catch (lookupError) {
|
|
3837
|
+
if (!isGenieAbsentError(lookupError)) throw lookupError;
|
|
3838
|
+
await options.managedResourceStore.delete(GENIE_RESOURCE_TYPE, agentId);
|
|
3839
|
+
return { deleted: true, agentId, alreadyAbsent: true };
|
|
3840
|
+
}
|
|
3619
3841
|
if (current.fingerprint !== expectedFingerprint) {
|
|
3620
3842
|
throw new DatabricksManagedResourceConflictError({
|
|
3621
3843
|
resourceType: GENIE_RESOURCE_TYPE,
|
|
@@ -4333,19 +4555,19 @@ var DatabricksGenieClient = class {
|
|
|
4333
4555
|
this.agentId = resolveAgentId(options);
|
|
4334
4556
|
this.previewClient = options.previewClient;
|
|
4335
4557
|
this.basePath = `/api/2.0/genie/spaces/${enc2(this.agentId)}`;
|
|
4336
|
-
this.pollIntervalMs =
|
|
4337
|
-
this.timeoutMs =
|
|
4558
|
+
this.pollIntervalMs = positiveInteger3(options.pollIntervalMs ?? 2e3, "pollIntervalMs");
|
|
4559
|
+
this.timeoutMs = positiveInteger3(options.timeoutMs ?? 12e4, "timeoutMs");
|
|
4338
4560
|
this.pollJitterRatio = boundedRatio(options.pollJitterRatio ?? 0.2, "pollJitterRatio");
|
|
4339
|
-
this.maxAttachments =
|
|
4561
|
+
this.maxAttachments = positiveInteger3(options.maxAttachments ?? 32, "maxAttachments");
|
|
4340
4562
|
this.maxUnknownAttachments = nonNegativeInteger(
|
|
4341
4563
|
options.maxUnknownAttachments ?? 8,
|
|
4342
4564
|
"maxUnknownAttachments"
|
|
4343
4565
|
);
|
|
4344
|
-
this.maxResultBytes =
|
|
4566
|
+
this.maxResultBytes = positiveInteger3(
|
|
4345
4567
|
options.maxResultBytes ?? 2 * 1024 * 1024,
|
|
4346
4568
|
"maxResultBytes"
|
|
4347
4569
|
);
|
|
4348
|
-
this.maxTextChars =
|
|
4570
|
+
this.maxTextChars = positiveInteger3(options.maxTextChars ?? 1e5, "maxTextChars");
|
|
4349
4571
|
}
|
|
4350
4572
|
agentId;
|
|
4351
4573
|
basePath;
|
|
@@ -4680,7 +4902,7 @@ function nonEmpty3(value, name) {
|
|
|
4680
4902
|
if (!normalized) throw new Error(`Databricks Genie ${name} cannot be empty.`);
|
|
4681
4903
|
return normalized;
|
|
4682
4904
|
}
|
|
4683
|
-
function
|
|
4905
|
+
function positiveInteger3(value, name) {
|
|
4684
4906
|
if (!Number.isInteger(value) || value <= 0)
|
|
4685
4907
|
throw new Error(`Databricks Genie ${name} must be a positive integer.`);
|
|
4686
4908
|
return value;
|
|
@@ -20905,7 +21127,10 @@ function serializeTask(task) {
|
|
|
20905
21127
|
policyId: task.newCluster.policyId,
|
|
20906
21128
|
sparkVersion: task.newCluster.sparkVersion,
|
|
20907
21129
|
nodeTypeId: task.newCluster.nodeTypeId,
|
|
20908
|
-
|
|
21130
|
+
size: {
|
|
21131
|
+
$case: "numWorkers",
|
|
21132
|
+
numWorkers: task.newCluster.numWorkers
|
|
21133
|
+
},
|
|
20909
21134
|
...task.newCluster.customTags ? { customTags: task.newCluster.customTags } : {}
|
|
20910
21135
|
} }
|
|
20911
21136
|
} : {}
|
|
@@ -56078,6 +56303,151 @@ function databricksLakeflowTools(client) {
|
|
|
56078
56303
|
];
|
|
56079
56304
|
}
|
|
56080
56305
|
|
|
56306
|
+
// src/mlflow-tracing.ts
|
|
56307
|
+
import { createHash } from "crypto";
|
|
56308
|
+
import { eventToTelemetrySpan } from "@fabric-harness/sdk";
|
|
56309
|
+
function mlflowTraceExporter(options) {
|
|
56310
|
+
const onError = options.onError ?? ((context, error51) => {
|
|
56311
|
+
console.error(`[fabric-harness:mlflow-tracing] ${context}:`, error51);
|
|
56312
|
+
});
|
|
56313
|
+
const buffers = /* @__PURE__ */ new Map();
|
|
56314
|
+
return {
|
|
56315
|
+
sink: {
|
|
56316
|
+
record(event) {
|
|
56317
|
+
try {
|
|
56318
|
+
const key = `agent:${event.agent}:${event.instanceId}:${event.session}`;
|
|
56319
|
+
if (event.type === "submission_started") {
|
|
56320
|
+
buffers.set(key, {
|
|
56321
|
+
submissionId: event.submissionId,
|
|
56322
|
+
agent: event.agent,
|
|
56323
|
+
instanceId: event.instanceId,
|
|
56324
|
+
session: event.session,
|
|
56325
|
+
startedAtMs: event.at,
|
|
56326
|
+
attemptCount: event.attemptCount,
|
|
56327
|
+
...event.tenantId !== void 0 ? { tenantId: event.tenantId } : {},
|
|
56328
|
+
spans: []
|
|
56329
|
+
});
|
|
56330
|
+
return;
|
|
56331
|
+
}
|
|
56332
|
+
if (event.type !== "submission_settled") return;
|
|
56333
|
+
const buffer = buffers.get(key);
|
|
56334
|
+
buffers.delete(key);
|
|
56335
|
+
const startedAtMs = buffer?.startedAtMs ?? event.at - (event.durationMs ?? 0);
|
|
56336
|
+
const attemptCount = event.attemptCount ?? buffer?.attemptCount;
|
|
56337
|
+
const trace = buildMlflowTrace({
|
|
56338
|
+
submissionId: event.submissionId,
|
|
56339
|
+
agent: event.agent,
|
|
56340
|
+
instanceId: event.instanceId,
|
|
56341
|
+
session: event.session,
|
|
56342
|
+
experimentId: options.experimentId,
|
|
56343
|
+
startedAtMs,
|
|
56344
|
+
settledAtMs: event.at,
|
|
56345
|
+
state: event.outcome === "completed" ? "OK" : "ERROR",
|
|
56346
|
+
spans: buffer?.spans ?? [],
|
|
56347
|
+
...attemptCount !== void 0 ? { attemptCount } : {},
|
|
56348
|
+
...event.tenantId !== void 0 ? { tenantId: event.tenantId } : {},
|
|
56349
|
+
...event.error !== void 0 ? { error: event.error } : {}
|
|
56350
|
+
});
|
|
56351
|
+
void options.client.post("/api/3.0/mlflow/traces", trace).catch((error51) => onError(`trace export failed for ${event.submissionId}`, error51));
|
|
56352
|
+
} catch (error51) {
|
|
56353
|
+
onError("telemetry event handling failed", error51);
|
|
56354
|
+
}
|
|
56355
|
+
}
|
|
56356
|
+
},
|
|
56357
|
+
onEvent(event) {
|
|
56358
|
+
try {
|
|
56359
|
+
if (!event.sessionId) return;
|
|
56360
|
+
const buffer = buffers.get(event.sessionId);
|
|
56361
|
+
if (!buffer) return;
|
|
56362
|
+
const span = eventToTelemetrySpan(event);
|
|
56363
|
+
if (span) buffer.spans.push(span);
|
|
56364
|
+
} catch (error51) {
|
|
56365
|
+
onError("event buffering failed", error51);
|
|
56366
|
+
}
|
|
56367
|
+
}
|
|
56368
|
+
};
|
|
56369
|
+
}
|
|
56370
|
+
function buildMlflowTrace(input) {
|
|
56371
|
+
const traceBytes = sha256(input.submissionId).subarray(0, 16);
|
|
56372
|
+
const traceIdBase64 = traceBytes.toString("base64");
|
|
56373
|
+
const rootSpanId = spanIdFor(input.submissionId, 0);
|
|
56374
|
+
const durationSeconds = Math.max(0, input.settledAtMs - input.startedAtMs) / 1e3;
|
|
56375
|
+
const rootSpan = {
|
|
56376
|
+
trace_id: traceIdBase64,
|
|
56377
|
+
span_id: rootSpanId,
|
|
56378
|
+
name: `fabric.submission ${input.agent}`,
|
|
56379
|
+
start_time_unix_nano: toUnixNano(input.startedAtMs),
|
|
56380
|
+
end_time_unix_nano: toUnixNano(input.settledAtMs),
|
|
56381
|
+
attributes: toOtlpAttributes({
|
|
56382
|
+
"fabric.submission_id": input.submissionId,
|
|
56383
|
+
"fabric.agent": input.agent,
|
|
56384
|
+
"fabric.instance_id": input.instanceId,
|
|
56385
|
+
"fabric.session": input.session,
|
|
56386
|
+
...input.attemptCount !== void 0 ? { "fabric.attempt_count": input.attemptCount } : {},
|
|
56387
|
+
...input.error !== void 0 ? { "fabric.error": input.error } : {}
|
|
56388
|
+
}),
|
|
56389
|
+
status: {
|
|
56390
|
+
code: input.state === "OK" ? "STATUS_CODE_OK" : "STATUS_CODE_ERROR",
|
|
56391
|
+
...input.error !== void 0 ? { message: input.error } : {}
|
|
56392
|
+
}
|
|
56393
|
+
};
|
|
56394
|
+
const childSpans = input.spans.map(
|
|
56395
|
+
(span, index) => ({
|
|
56396
|
+
trace_id: traceIdBase64,
|
|
56397
|
+
span_id: spanIdFor(input.submissionId, index + 1),
|
|
56398
|
+
parent_span_id: rootSpanId,
|
|
56399
|
+
name: span.name,
|
|
56400
|
+
start_time_unix_nano: toUnixNano(Date.parse(span.startedAt)),
|
|
56401
|
+
end_time_unix_nano: toUnixNano(Date.parse(span.endedAt)),
|
|
56402
|
+
attributes: toOtlpAttributes(span.attributes),
|
|
56403
|
+
status: { code: "STATUS_CODE_OK" }
|
|
56404
|
+
})
|
|
56405
|
+
);
|
|
56406
|
+
return {
|
|
56407
|
+
trace: {
|
|
56408
|
+
trace_info: {
|
|
56409
|
+
trace_id: `tr-${traceBytes.toString("hex")}`,
|
|
56410
|
+
trace_location: {
|
|
56411
|
+
type: "MLFLOW_EXPERIMENT",
|
|
56412
|
+
mlflow_experiment: { experiment_id: input.experimentId }
|
|
56413
|
+
},
|
|
56414
|
+
request_time: new Date(input.startedAtMs).toISOString(),
|
|
56415
|
+
execution_duration: `${durationSeconds.toFixed(3)}s`,
|
|
56416
|
+
state: input.state,
|
|
56417
|
+
trace_metadata: {
|
|
56418
|
+
"fabric.submission_id": input.submissionId,
|
|
56419
|
+
"fabric.agent": input.agent,
|
|
56420
|
+
"fabric.instance_id": input.instanceId,
|
|
56421
|
+
"fabric.session": input.session,
|
|
56422
|
+
...input.attemptCount !== void 0 ? { "fabric.attempt_count": String(input.attemptCount) } : {}
|
|
56423
|
+
},
|
|
56424
|
+
tags: {
|
|
56425
|
+
"fabric.agent": input.agent,
|
|
56426
|
+
...input.tenantId !== void 0 ? { "fabric.tenant_id": input.tenantId } : {}
|
|
56427
|
+
}
|
|
56428
|
+
},
|
|
56429
|
+
trace_data: { spans: [rootSpan, ...childSpans] }
|
|
56430
|
+
}
|
|
56431
|
+
};
|
|
56432
|
+
}
|
|
56433
|
+
function sha256(seed) {
|
|
56434
|
+
return createHash("sha256").update(seed).digest();
|
|
56435
|
+
}
|
|
56436
|
+
function spanIdFor(submissionId, index) {
|
|
56437
|
+
return sha256(`${submissionId}:span:${index}`).subarray(0, 8).toString("base64");
|
|
56438
|
+
}
|
|
56439
|
+
function toUnixNano(epochMs) {
|
|
56440
|
+
return `${Math.round(epochMs)}000000`;
|
|
56441
|
+
}
|
|
56442
|
+
function toOtlpAttributes(attributes) {
|
|
56443
|
+
return Object.entries(attributes).map(([key, value]) => {
|
|
56444
|
+
if (typeof value === "number") {
|
|
56445
|
+
return Number.isInteger(value) ? { key, value: { int_value: String(value) } } : { key, value: { double_value: value } };
|
|
56446
|
+
}
|
|
56447
|
+
return { key, value: { string_value: String(value) } };
|
|
56448
|
+
});
|
|
56449
|
+
}
|
|
56450
|
+
|
|
56081
56451
|
// src/model.ts
|
|
56082
56452
|
import {
|
|
56083
56453
|
OpenAICompatibleModelProvider,
|
|
@@ -56364,11 +56734,19 @@ var DatabricksServingAdmin = class {
|
|
|
56364
56734
|
});
|
|
56365
56735
|
}
|
|
56366
56736
|
updateAiGateway(name, update) {
|
|
56737
|
+
const rateLimits = update.rateLimits?.map((limit) => ({
|
|
56738
|
+
...limit.calls !== void 0 ? { calls: positiveBigInt(limit.calls, "rateLimits.calls") } : {},
|
|
56739
|
+
...limit.tokens !== void 0 ? { tokens: positiveBigInt(limit.tokens, "rateLimits.tokens") } : {},
|
|
56740
|
+
...limit.key !== void 0 ? { key: limit.key } : {},
|
|
56741
|
+
...limit.renewalPeriod !== void 0 ? { renewalPeriod: limit.renewalPeriod } : {},
|
|
56742
|
+
...limit.principal !== void 0 ? { principal: limit.principal } : {}
|
|
56743
|
+
}));
|
|
56367
56744
|
return this.client.putInferenceEndpointAiGateway({
|
|
56368
56745
|
name,
|
|
56369
|
-
...
|
|
56746
|
+
...rateLimits ? { rateLimits } : {},
|
|
56370
56747
|
...update.guardrails ? { guardrails: update.guardrails } : {},
|
|
56371
|
-
...update.
|
|
56748
|
+
...update.inferenceTableConfig ? { inferenceTableConfig: update.inferenceTableConfig } : {},
|
|
56749
|
+
...update.usageTrackingConfig ? { usageTrackingConfig: update.usageTrackingConfig } : {},
|
|
56372
56750
|
...update.fallbackEnabled !== void 0 ? { fallbackConfig: { enabled: update.fallbackEnabled } } : {}
|
|
56373
56751
|
});
|
|
56374
56752
|
}
|
|
@@ -56455,6 +56833,11 @@ function validate(spec) {
|
|
|
56455
56833
|
throw new Error("databricks serving: provisionedModelUnits must be a positive integer.");
|
|
56456
56834
|
}
|
|
56457
56835
|
}
|
|
56836
|
+
function positiveBigInt(value, name) {
|
|
56837
|
+
if (!Number.isSafeInteger(value) || value <= 0)
|
|
56838
|
+
throw new Error(`databricks serving: ${name} must be a positive safe integer.`);
|
|
56839
|
+
return BigInt(value);
|
|
56840
|
+
}
|
|
56458
56841
|
function serialize2(spec) {
|
|
56459
56842
|
return {
|
|
56460
56843
|
name: spec.name,
|
|
@@ -56602,9 +56985,23 @@ function gatewaySchema() {
|
|
|
56602
56985
|
additionalProperties: false,
|
|
56603
56986
|
properties: {
|
|
56604
56987
|
name: { type: "string" },
|
|
56605
|
-
rateLimits: {
|
|
56988
|
+
rateLimits: {
|
|
56989
|
+
type: "array",
|
|
56990
|
+
items: {
|
|
56991
|
+
type: "object",
|
|
56992
|
+
additionalProperties: false,
|
|
56993
|
+
properties: {
|
|
56994
|
+
calls: { type: "integer", minimum: 1 },
|
|
56995
|
+
tokens: { type: "integer", minimum: 1 },
|
|
56996
|
+
key: { type: "string" },
|
|
56997
|
+
renewalPeriod: { type: "string" },
|
|
56998
|
+
principal: { type: "string" }
|
|
56999
|
+
}
|
|
57000
|
+
}
|
|
57001
|
+
},
|
|
56606
57002
|
guardrails: { type: "object", additionalProperties: true },
|
|
56607
|
-
|
|
57003
|
+
inferenceTableConfig: { type: "object", additionalProperties: true },
|
|
57004
|
+
usageTrackingConfig: { type: "object", additionalProperties: true },
|
|
56608
57005
|
fallbackEnabled: { type: "boolean" }
|
|
56609
57006
|
},
|
|
56610
57007
|
required: ["name"]
|
|
@@ -57365,221 +57762,6 @@ function base643(value) {
|
|
|
57365
57762
|
return btoa(String.fromCharCode(...bytes));
|
|
57366
57763
|
}
|
|
57367
57764
|
|
|
57368
|
-
// src/agent-services.ts
|
|
57369
|
-
var DATABRICKS_AGENT_SERVICES_API = "/api/2.1/unity-catalog/agent-services";
|
|
57370
|
-
var DATABRICKS_AGENT_SERVICE_SECURABLE = "AGENT_SERVICE";
|
|
57371
|
-
var DatabricksAgentServices = class {
|
|
57372
|
-
constructor(client, options) {
|
|
57373
|
-
this.client = client;
|
|
57374
|
-
if (options.acknowledgeBeta !== true) {
|
|
57375
|
-
throw new Error("databricks agent services: acknowledgeBeta must be true.");
|
|
57376
|
-
}
|
|
57377
|
-
}
|
|
57378
|
-
create(options) {
|
|
57379
|
-
const catalog = ucIdentifier(options.catalog, "catalog");
|
|
57380
|
-
const schema = ucIdentifier(options.schema, "schema");
|
|
57381
|
-
const id = ucIdentifier(options.id, "agent service id");
|
|
57382
|
-
const basePath = externalBasePath(options.basePath ?? "/responses");
|
|
57383
|
-
return this.client.post(
|
|
57384
|
-
DATABRICKS_AGENT_SERVICES_API,
|
|
57385
|
-
{
|
|
57386
|
-
agent_service_type: "AGENT_SERVICE_TYPE_EXTERNAL",
|
|
57387
|
-
...options.comment !== void 0 ? { comment: options.comment } : {},
|
|
57388
|
-
config: {
|
|
57389
|
-
connection: { name: connectionResourceName(options.connection) },
|
|
57390
|
-
base_path: basePath,
|
|
57391
|
-
...options.systemPrompt !== void 0 ? { system_prompt: options.systemPrompt } : {}
|
|
57392
|
-
}
|
|
57393
|
-
},
|
|
57394
|
-
{ parent: `schemas/${catalog}.${schema}`, agent_service_id: id },
|
|
57395
|
-
{ retry: "never" }
|
|
57396
|
-
);
|
|
57397
|
-
}
|
|
57398
|
-
get(fullName) {
|
|
57399
|
-
return this.client.get(agentServicePath(fullName));
|
|
57400
|
-
}
|
|
57401
|
-
list(options = {}) {
|
|
57402
|
-
if (options.catalog === void 0 !== (options.schema === void 0)) {
|
|
57403
|
-
throw new Error("databricks agent services: catalog and schema must be provided together.");
|
|
57404
|
-
}
|
|
57405
|
-
const parent = options.catalog && options.schema ? `schemas/${ucIdentifier(options.catalog, "catalog")}.${ucIdentifier(options.schema, "schema")}` : void 0;
|
|
57406
|
-
return this.client.get(DATABRICKS_AGENT_SERVICES_API, {
|
|
57407
|
-
parent,
|
|
57408
|
-
page_token: options.pageToken
|
|
57409
|
-
});
|
|
57410
|
-
}
|
|
57411
|
-
update(fullName, options) {
|
|
57412
|
-
const mask = [];
|
|
57413
|
-
const config2 = {};
|
|
57414
|
-
const body = {};
|
|
57415
|
-
if (options.comment !== void 0) {
|
|
57416
|
-
mask.push("comment");
|
|
57417
|
-
body.comment = options.comment;
|
|
57418
|
-
}
|
|
57419
|
-
if (options.basePath !== void 0) {
|
|
57420
|
-
mask.push("config.base_path");
|
|
57421
|
-
config2.base_path = externalBasePath(options.basePath);
|
|
57422
|
-
}
|
|
57423
|
-
if (options.systemPrompt !== void 0) {
|
|
57424
|
-
mask.push("config.system_prompt");
|
|
57425
|
-
config2.system_prompt = options.systemPrompt;
|
|
57426
|
-
}
|
|
57427
|
-
if (mask.length === 0) {
|
|
57428
|
-
throw new Error(
|
|
57429
|
-
"databricks agent services: update requires comment, basePath or systemPrompt."
|
|
57430
|
-
);
|
|
57431
|
-
}
|
|
57432
|
-
if (Object.keys(config2).length > 0) body.config = config2;
|
|
57433
|
-
return this.client.request(
|
|
57434
|
-
"PATCH",
|
|
57435
|
-
agentServicePath(fullName),
|
|
57436
|
-
body,
|
|
57437
|
-
{ update_mask: mask.join(",") },
|
|
57438
|
-
{ retry: "safe" }
|
|
57439
|
-
);
|
|
57440
|
-
}
|
|
57441
|
-
delete(fullName) {
|
|
57442
|
-
return this.client.request(
|
|
57443
|
-
"DELETE",
|
|
57444
|
-
agentServicePath(fullName),
|
|
57445
|
-
void 0,
|
|
57446
|
-
{},
|
|
57447
|
-
{ retry: "never" }
|
|
57448
|
-
);
|
|
57449
|
-
}
|
|
57450
|
-
permissions(fullName) {
|
|
57451
|
-
return this.client.get(permissionsPath(fullName));
|
|
57452
|
-
}
|
|
57453
|
-
updatePermissions(fullName, changes) {
|
|
57454
|
-
if (changes.length === 0) {
|
|
57455
|
-
throw new Error("databricks agent services: at least one permission change is required.");
|
|
57456
|
-
}
|
|
57457
|
-
for (const change of changes) {
|
|
57458
|
-
if (!change.principal.trim())
|
|
57459
|
-
throw new Error("databricks agent services: principal cannot be empty.");
|
|
57460
|
-
if ((change.add?.length ?? 0) === 0 && (change.remove?.length ?? 0) === 0) {
|
|
57461
|
-
throw new Error(
|
|
57462
|
-
`databricks agent services: ${change.principal} has no privileges to add or remove.`
|
|
57463
|
-
);
|
|
57464
|
-
}
|
|
57465
|
-
}
|
|
57466
|
-
return this.client.request(
|
|
57467
|
-
"PATCH",
|
|
57468
|
-
permissionsPath(fullName),
|
|
57469
|
-
{ changes },
|
|
57470
|
-
{},
|
|
57471
|
-
{ retry: "safe" }
|
|
57472
|
-
);
|
|
57473
|
-
}
|
|
57474
|
-
grant(fullName, principal, privileges = ["EXECUTE"]) {
|
|
57475
|
-
return this.updatePermissions(fullName, [{ principal, add: privileges }]);
|
|
57476
|
-
}
|
|
57477
|
-
revoke(fullName, principal, privileges = ["EXECUTE"]) {
|
|
57478
|
-
return this.updatePermissions(fullName, [{ principal, remove: privileges }]);
|
|
57479
|
-
}
|
|
57480
|
-
};
|
|
57481
|
-
function databricksAgentServices(client, options) {
|
|
57482
|
-
return new DatabricksAgentServices(client, options);
|
|
57483
|
-
}
|
|
57484
|
-
function agentServicePath(fullName) {
|
|
57485
|
-
return `${DATABRICKS_AGENT_SERVICES_API}/${encodeURIComponent(fullUcName(fullName))}`;
|
|
57486
|
-
}
|
|
57487
|
-
function permissionsPath(fullName) {
|
|
57488
|
-
return `/api/2.1/unity-catalog/permissions/${DATABRICKS_AGENT_SERVICE_SECURABLE}/${encodeURIComponent(fullUcName(fullName))}`;
|
|
57489
|
-
}
|
|
57490
|
-
function fullUcName(value) {
|
|
57491
|
-
const parts = value.split(".");
|
|
57492
|
-
if (parts.length !== 3) {
|
|
57493
|
-
throw new Error(
|
|
57494
|
-
`databricks agent services: expected catalog.schema.service, received ${value}.`
|
|
57495
|
-
);
|
|
57496
|
-
}
|
|
57497
|
-
return parts.map(
|
|
57498
|
-
(part, index) => ucIdentifier(part, ["catalog", "schema", "service"][index] ?? "identifier")
|
|
57499
|
-
).join(".");
|
|
57500
|
-
}
|
|
57501
|
-
function connectionResourceName(value) {
|
|
57502
|
-
const trimmed = value.trim();
|
|
57503
|
-
const name = trimmed.startsWith("connections/") ? trimmed.slice("connections/".length) : trimmed;
|
|
57504
|
-
const parts = name.split(".");
|
|
57505
|
-
if (parts.length !== 1 && parts.length !== 3) {
|
|
57506
|
-
throw new Error(
|
|
57507
|
-
`databricks agent services: expected connection name or catalog.schema.connection, received ${value}.`
|
|
57508
|
-
);
|
|
57509
|
-
}
|
|
57510
|
-
return `connections/${parts.map(
|
|
57511
|
-
(part, index) => ucIdentifier(
|
|
57512
|
-
part,
|
|
57513
|
-
parts.length === 1 ? "connection" : ["catalog", "schema", "connection"][index] ?? "identifier"
|
|
57514
|
-
)
|
|
57515
|
-
).join(".")}`;
|
|
57516
|
-
}
|
|
57517
|
-
function externalBasePath(value) {
|
|
57518
|
-
const path = value.trim();
|
|
57519
|
-
if (!path.startsWith("/") || path.startsWith("//") || path.includes("?") || path.includes("#")) {
|
|
57520
|
-
throw new Error(
|
|
57521
|
-
"databricks agent services: basePath must be an absolute URL path without a query or fragment."
|
|
57522
|
-
);
|
|
57523
|
-
}
|
|
57524
|
-
return path;
|
|
57525
|
-
}
|
|
57526
|
-
function ucIdentifier(value, label) {
|
|
57527
|
-
const normalized = value.trim();
|
|
57528
|
-
if (!/^[A-Za-z0-9_][A-Za-z0-9_$-]*$/.test(normalized)) {
|
|
57529
|
-
throw new Error(`databricks agent services: invalid ${label} ${JSON.stringify(value)}.`);
|
|
57530
|
-
}
|
|
57531
|
-
return normalized;
|
|
57532
|
-
}
|
|
57533
|
-
|
|
57534
|
-
// src/ai-gateway.ts
|
|
57535
|
-
async function ensureDatabricksAiGateway(client) {
|
|
57536
|
-
await client.get("/api/ai-gateway/v2/endpoints", { page_size: 1 });
|
|
57537
|
-
}
|
|
57538
|
-
async function listDatabricksModelServices(client, options = {}) {
|
|
57539
|
-
const pageSize = positiveInteger3(options.pageSize ?? 100, "pageSize");
|
|
57540
|
-
const maxPages = positiveInteger3(options.maxPages ?? 100, "maxPages");
|
|
57541
|
-
const requiredPrefix = options.requiredPrefix ?? "system.ai.";
|
|
57542
|
-
const services = /* @__PURE__ */ new Map();
|
|
57543
|
-
const seenTokens = /* @__PURE__ */ new Set();
|
|
57544
|
-
let pageToken;
|
|
57545
|
-
for (let page = 0; page < maxPages; page += 1) {
|
|
57546
|
-
const response = await client.get(
|
|
57547
|
-
"/api/2.1/unity-catalog/model-services",
|
|
57548
|
-
{ page_size: pageSize, ...pageToken ? { page_token: pageToken } : {} }
|
|
57549
|
-
);
|
|
57550
|
-
for (const raw of response.model_services ?? []) {
|
|
57551
|
-
const service = normalizeModelService(raw, requiredPrefix);
|
|
57552
|
-
if (service) services.set(service.name, service);
|
|
57553
|
-
}
|
|
57554
|
-
const next = response.next_page_token?.trim();
|
|
57555
|
-
if (!next) return [...services.values()].sort((a2, b2) => a2.name.localeCompare(b2.name));
|
|
57556
|
-
if (seenTokens.has(next))
|
|
57557
|
-
throw new Error(
|
|
57558
|
-
`databricks model-services pagination repeated token after page ${page + 1}.`
|
|
57559
|
-
);
|
|
57560
|
-
seenTokens.add(next);
|
|
57561
|
-
pageToken = next;
|
|
57562
|
-
}
|
|
57563
|
-
throw new Error(`databricks model-services pagination exceeded ${maxPages} pages.`);
|
|
57564
|
-
}
|
|
57565
|
-
function normalizeModelService(raw, requiredPrefix) {
|
|
57566
|
-
const rawName = typeof raw.name === "string" ? raw.name.trim() : "";
|
|
57567
|
-
const name = rawName.replace(/^model-services\//, "");
|
|
57568
|
-
if (!name.startsWith(requiredPrefix)) return void 0;
|
|
57569
|
-
return {
|
|
57570
|
-
name,
|
|
57571
|
-
...typeof raw.comment === "string" ? { comment: raw.comment } : {},
|
|
57572
|
-
...typeof raw.creator === "string" ? { creator: raw.creator } : {},
|
|
57573
|
-
...typeof raw.created_at === "number" ? { createdAt: raw.created_at } : {},
|
|
57574
|
-
...typeof raw.updated_at === "number" ? { updatedAt: raw.updated_at } : {}
|
|
57575
|
-
};
|
|
57576
|
-
}
|
|
57577
|
-
function positiveInteger3(value, name) {
|
|
57578
|
-
if (!Number.isSafeInteger(value) || value <= 0)
|
|
57579
|
-
throw new Error(`${name} must be a positive integer.`);
|
|
57580
|
-
return value;
|
|
57581
|
-
}
|
|
57582
|
-
|
|
57583
57765
|
// src/persistence.ts
|
|
57584
57766
|
function databricksPersistence(options) {
|
|
57585
57767
|
const client = isLakebaseClient(options.lakebase) ? options.lakebase : lakebaseClient(options.lakebase);
|
|
@@ -58067,6 +58249,7 @@ function databricksApp(options = {}) {
|
|
|
58067
58249
|
...persistence ? { persistence } : {},
|
|
58068
58250
|
...telemetry ? { telemetry } : {},
|
|
58069
58251
|
...attachmentStore ? { attachmentStore } : {},
|
|
58252
|
+
mlflowTraceExporter: (traceOptions) => mlflowTraceExporter({ client: native.preview, ...traceOptions }),
|
|
58070
58253
|
async serverOptions() {
|
|
58071
58254
|
if (!persistence) return attachmentStore ? { attachmentStore } : {};
|
|
58072
58255
|
const { store, submissionStore, conversationStreamStore } = await persistence.connectAll();
|
|
@@ -58100,7 +58283,7 @@ function parseInferenceMode(value) {
|
|
|
58100
58283
|
}
|
|
58101
58284
|
|
|
58102
58285
|
// src/app-user-authorization.ts
|
|
58103
|
-
import { createHash } from "crypto";
|
|
58286
|
+
import { createHash as createHash2 } from "crypto";
|
|
58104
58287
|
var DATABRICKS_APP_USER_PERMISSIONS = [
|
|
58105
58288
|
"agent:invoke",
|
|
58106
58289
|
"approval:read",
|
|
@@ -58122,7 +58305,7 @@ function createDatabricksAppUserAuthenticator(options) {
|
|
|
58122
58305
|
if (!delegated) return void 0;
|
|
58123
58306
|
const now = options.now?.() ?? Date.now();
|
|
58124
58307
|
const token = await databricksIdentity(delegated)();
|
|
58125
|
-
const digest =
|
|
58308
|
+
const digest = createHash2("sha256").update(token).digest("hex");
|
|
58126
58309
|
const cached4 = cache.get(digest);
|
|
58127
58310
|
if (cached4 && cached4.expiresAt > now) return cached4.principal;
|
|
58128
58311
|
try {
|
|
@@ -58133,7 +58316,7 @@ function createDatabricksAppUserAuthenticator(options) {
|
|
|
58133
58316
|
...options.now ? { now: options.now } : {}
|
|
58134
58317
|
});
|
|
58135
58318
|
const id = inspection.principal.id;
|
|
58136
|
-
const tenantId = options.tenantId?.(inspection) ?? `databricks-user:${
|
|
58319
|
+
const tenantId = options.tenantId?.(inspection) ?? `databricks-user:${createHash2("sha256").update(id).digest("hex").slice(0, 24)}`;
|
|
58137
58320
|
if (!tenantId) return false;
|
|
58138
58321
|
const principal = {
|
|
58139
58322
|
id,
|
|
@@ -58205,151 +58388,6 @@ function jwtLifetimeClaims(token) {
|
|
|
58205
58388
|
}
|
|
58206
58389
|
}
|
|
58207
58390
|
|
|
58208
|
-
// src/mlflow-tracing.ts
|
|
58209
|
-
import { createHash as createHash2 } from "crypto";
|
|
58210
|
-
import { eventToTelemetrySpan } from "@fabric-harness/sdk";
|
|
58211
|
-
function mlflowTraceExporter(options) {
|
|
58212
|
-
const onError = options.onError ?? ((context, error51) => {
|
|
58213
|
-
console.error(`[fabric-harness:mlflow-tracing] ${context}:`, error51);
|
|
58214
|
-
});
|
|
58215
|
-
const buffers = /* @__PURE__ */ new Map();
|
|
58216
|
-
return {
|
|
58217
|
-
sink: {
|
|
58218
|
-
record(event) {
|
|
58219
|
-
try {
|
|
58220
|
-
const key = `agent:${event.agent}:${event.instanceId}:${event.session}`;
|
|
58221
|
-
if (event.type === "submission_started") {
|
|
58222
|
-
buffers.set(key, {
|
|
58223
|
-
submissionId: event.submissionId,
|
|
58224
|
-
agent: event.agent,
|
|
58225
|
-
instanceId: event.instanceId,
|
|
58226
|
-
session: event.session,
|
|
58227
|
-
startedAtMs: event.at,
|
|
58228
|
-
attemptCount: event.attemptCount,
|
|
58229
|
-
...event.tenantId !== void 0 ? { tenantId: event.tenantId } : {},
|
|
58230
|
-
spans: []
|
|
58231
|
-
});
|
|
58232
|
-
return;
|
|
58233
|
-
}
|
|
58234
|
-
if (event.type !== "submission_settled") return;
|
|
58235
|
-
const buffer = buffers.get(key);
|
|
58236
|
-
buffers.delete(key);
|
|
58237
|
-
const startedAtMs = buffer?.startedAtMs ?? event.at - (event.durationMs ?? 0);
|
|
58238
|
-
const attemptCount = event.attemptCount ?? buffer?.attemptCount;
|
|
58239
|
-
const trace = buildMlflowTrace({
|
|
58240
|
-
submissionId: event.submissionId,
|
|
58241
|
-
agent: event.agent,
|
|
58242
|
-
instanceId: event.instanceId,
|
|
58243
|
-
session: event.session,
|
|
58244
|
-
experimentId: options.experimentId,
|
|
58245
|
-
startedAtMs,
|
|
58246
|
-
settledAtMs: event.at,
|
|
58247
|
-
state: event.outcome === "completed" ? "OK" : "ERROR",
|
|
58248
|
-
spans: buffer?.spans ?? [],
|
|
58249
|
-
...attemptCount !== void 0 ? { attemptCount } : {},
|
|
58250
|
-
...event.tenantId !== void 0 ? { tenantId: event.tenantId } : {},
|
|
58251
|
-
...event.error !== void 0 ? { error: event.error } : {}
|
|
58252
|
-
});
|
|
58253
|
-
void options.client.post("/api/3.0/mlflow/traces", trace).catch((error51) => onError(`trace export failed for ${event.submissionId}`, error51));
|
|
58254
|
-
} catch (error51) {
|
|
58255
|
-
onError("telemetry event handling failed", error51);
|
|
58256
|
-
}
|
|
58257
|
-
}
|
|
58258
|
-
},
|
|
58259
|
-
onEvent(event) {
|
|
58260
|
-
try {
|
|
58261
|
-
if (!event.sessionId) return;
|
|
58262
|
-
const buffer = buffers.get(event.sessionId);
|
|
58263
|
-
if (!buffer) return;
|
|
58264
|
-
const span = eventToTelemetrySpan(event);
|
|
58265
|
-
if (span) buffer.spans.push(span);
|
|
58266
|
-
} catch (error51) {
|
|
58267
|
-
onError("event buffering failed", error51);
|
|
58268
|
-
}
|
|
58269
|
-
}
|
|
58270
|
-
};
|
|
58271
|
-
}
|
|
58272
|
-
function buildMlflowTrace(input) {
|
|
58273
|
-
const traceBytes = sha256(input.submissionId).subarray(0, 16);
|
|
58274
|
-
const traceIdBase64 = traceBytes.toString("base64");
|
|
58275
|
-
const rootSpanId = spanIdFor(input.submissionId, 0);
|
|
58276
|
-
const durationSeconds = Math.max(0, input.settledAtMs - input.startedAtMs) / 1e3;
|
|
58277
|
-
const rootSpan = {
|
|
58278
|
-
trace_id: traceIdBase64,
|
|
58279
|
-
span_id: rootSpanId,
|
|
58280
|
-
name: `fabric.submission ${input.agent}`,
|
|
58281
|
-
start_time_unix_nano: toUnixNano(input.startedAtMs),
|
|
58282
|
-
end_time_unix_nano: toUnixNano(input.settledAtMs),
|
|
58283
|
-
attributes: toOtlpAttributes({
|
|
58284
|
-
"fabric.submission_id": input.submissionId,
|
|
58285
|
-
"fabric.agent": input.agent,
|
|
58286
|
-
"fabric.instance_id": input.instanceId,
|
|
58287
|
-
"fabric.session": input.session,
|
|
58288
|
-
...input.attemptCount !== void 0 ? { "fabric.attempt_count": input.attemptCount } : {},
|
|
58289
|
-
...input.error !== void 0 ? { "fabric.error": input.error } : {}
|
|
58290
|
-
}),
|
|
58291
|
-
status: {
|
|
58292
|
-
code: input.state === "OK" ? "STATUS_CODE_OK" : "STATUS_CODE_ERROR",
|
|
58293
|
-
...input.error !== void 0 ? { message: input.error } : {}
|
|
58294
|
-
}
|
|
58295
|
-
};
|
|
58296
|
-
const childSpans = input.spans.map(
|
|
58297
|
-
(span, index) => ({
|
|
58298
|
-
trace_id: traceIdBase64,
|
|
58299
|
-
span_id: spanIdFor(input.submissionId, index + 1),
|
|
58300
|
-
parent_span_id: rootSpanId,
|
|
58301
|
-
name: span.name,
|
|
58302
|
-
start_time_unix_nano: toUnixNano(Date.parse(span.startedAt)),
|
|
58303
|
-
end_time_unix_nano: toUnixNano(Date.parse(span.endedAt)),
|
|
58304
|
-
attributes: toOtlpAttributes(span.attributes),
|
|
58305
|
-
status: { code: "STATUS_CODE_OK" }
|
|
58306
|
-
})
|
|
58307
|
-
);
|
|
58308
|
-
return {
|
|
58309
|
-
trace: {
|
|
58310
|
-
trace_info: {
|
|
58311
|
-
trace_id: `tr-${traceBytes.toString("hex")}`,
|
|
58312
|
-
trace_location: {
|
|
58313
|
-
type: "MLFLOW_EXPERIMENT",
|
|
58314
|
-
mlflow_experiment: { experiment_id: input.experimentId }
|
|
58315
|
-
},
|
|
58316
|
-
request_time: new Date(input.startedAtMs).toISOString(),
|
|
58317
|
-
execution_duration: `${durationSeconds.toFixed(3)}s`,
|
|
58318
|
-
state: input.state,
|
|
58319
|
-
trace_metadata: {
|
|
58320
|
-
"fabric.submission_id": input.submissionId,
|
|
58321
|
-
"fabric.agent": input.agent,
|
|
58322
|
-
"fabric.instance_id": input.instanceId,
|
|
58323
|
-
"fabric.session": input.session,
|
|
58324
|
-
...input.attemptCount !== void 0 ? { "fabric.attempt_count": String(input.attemptCount) } : {}
|
|
58325
|
-
},
|
|
58326
|
-
tags: {
|
|
58327
|
-
"fabric.agent": input.agent,
|
|
58328
|
-
...input.tenantId !== void 0 ? { "fabric.tenant_id": input.tenantId } : {}
|
|
58329
|
-
}
|
|
58330
|
-
},
|
|
58331
|
-
trace_data: { spans: [rootSpan, ...childSpans] }
|
|
58332
|
-
}
|
|
58333
|
-
};
|
|
58334
|
-
}
|
|
58335
|
-
function sha256(seed) {
|
|
58336
|
-
return createHash2("sha256").update(seed).digest();
|
|
58337
|
-
}
|
|
58338
|
-
function spanIdFor(submissionId, index) {
|
|
58339
|
-
return sha256(`${submissionId}:span:${index}`).subarray(0, 8).toString("base64");
|
|
58340
|
-
}
|
|
58341
|
-
function toUnixNano(epochMs) {
|
|
58342
|
-
return `${Math.round(epochMs)}000000`;
|
|
58343
|
-
}
|
|
58344
|
-
function toOtlpAttributes(attributes) {
|
|
58345
|
-
return Object.entries(attributes).map(([key, value]) => {
|
|
58346
|
-
if (typeof value === "number") {
|
|
58347
|
-
return Number.isInteger(value) ? { key, value: { int_value: String(value) } } : { key, value: { double_value: value } };
|
|
58348
|
-
}
|
|
58349
|
-
return { key, value: { string_value: String(value) } };
|
|
58350
|
-
});
|
|
58351
|
-
}
|
|
58352
|
-
|
|
58353
58391
|
// src/serving-usage.ts
|
|
58354
58392
|
import { currentSubmissionContext as currentSubmissionContext3, emitSubmissionTelemetry } from "@fabric-harness/sdk";
|
|
58355
58393
|
function servingUsageCapture(options) {
|
|
@@ -58718,7 +58756,12 @@ function createDatabricksAuthoringCertificationChecks(fixtures) {
|
|
|
58718
58756
|
check2(
|
|
58719
58757
|
"jobs-authoring",
|
|
58720
58758
|
fixtures.enabled && Boolean(fixtures.jobs),
|
|
58721
|
-
() => jobsLifecycle(fixtures)
|
|
58759
|
+
() => jobsLifecycle(fixtures, requiredFixture(fixtures.jobs, "jobs"), "job")
|
|
58760
|
+
),
|
|
58761
|
+
check2(
|
|
58762
|
+
"jobs-classic-authoring",
|
|
58763
|
+
fixtures.enabled && Boolean(fixtures.classicJobs),
|
|
58764
|
+
() => jobsLifecycle(fixtures, requiredFixture(fixtures.classicJobs, "classicJobs"), "classic-job")
|
|
58722
58765
|
),
|
|
58723
58766
|
check2(
|
|
58724
58767
|
"lakeflow-authoring",
|
|
@@ -58728,12 +58771,22 @@ function createDatabricksAuthoringCertificationChecks(fixtures) {
|
|
|
58728
58771
|
check2(
|
|
58729
58772
|
"ai-search-admin",
|
|
58730
58773
|
fixtures.enabled && Boolean(fixtures.aiSearch),
|
|
58731
|
-
() => aiSearchLifecycle(fixtures)
|
|
58774
|
+
() => aiSearchLifecycle(fixtures, requiredFixture(fixtures.aiSearch, "aiSearch"), "ai-search-endpoint")
|
|
58775
|
+
),
|
|
58776
|
+
check2(
|
|
58777
|
+
"ai-search-delta-sync-admin",
|
|
58778
|
+
fixtures.enabled && Boolean(fixtures.deltaAiSearch),
|
|
58779
|
+
() => aiSearchLifecycle(fixtures, requiredFixture(fixtures.deltaAiSearch, "deltaAiSearch"), "ai-search-delta-sync-endpoint")
|
|
58732
58780
|
),
|
|
58733
58781
|
check2(
|
|
58734
58782
|
"serving-admin",
|
|
58735
58783
|
fixtures.enabled && Boolean(fixtures.serving),
|
|
58736
|
-
() => servingLifecycle(fixtures)
|
|
58784
|
+
() => servingLifecycle(fixtures, requiredFixture(fixtures.serving, "serving"), "serving-endpoint")
|
|
58785
|
+
),
|
|
58786
|
+
check2(
|
|
58787
|
+
"serving-provisioned-throughput-admin",
|
|
58788
|
+
fixtures.enabled && Boolean(fixtures.provisionedServing),
|
|
58789
|
+
() => servingLifecycle(fixtures, requiredFixture(fixtures.provisionedServing, "provisionedServing"), "serving-provisioned-throughput-endpoint")
|
|
58737
58790
|
),
|
|
58738
58791
|
check2(
|
|
58739
58792
|
"uc-admin-obo-execution",
|
|
@@ -58766,7 +58819,7 @@ function check2(id, configured, run) {
|
|
|
58766
58819
|
};
|
|
58767
58820
|
}
|
|
58768
58821
|
function authoringEvidenceChecks(id) {
|
|
58769
|
-
const prefix = id === "jobs-authoring" ? "jobs" : id === "lakeflow-authoring" ? "lakeflow" : id === "ai-search-admin" ? "ai-search-admin" : id === "serving-admin" ? "serving" : id === "uc-admin-obo-execution" ? "uc-admin" : id === "workspace-write" ? "workspace" : id === "secrets-write" ? "secrets" : id === "genie-authoring" ? "genie-authoring" : void 0;
|
|
58822
|
+
const prefix = id === "jobs-authoring" || id === "jobs-classic-authoring" ? "jobs" : id === "lakeflow-authoring" ? "lakeflow" : id === "ai-search-admin" || id === "ai-search-delta-sync-admin" ? "ai-search-admin" : id === "serving-admin" || id === "serving-provisioned-throughput-admin" ? "serving" : id === "uc-admin-obo-execution" ? "uc-admin" : id === "workspace-write" ? "workspace" : id === "secrets-write" ? "secrets" : id === "genie-authoring" ? "genie-authoring" : void 0;
|
|
58770
58823
|
if (!prefix) return ["approval.request", "approval.consume", "lineage.write"];
|
|
58771
58824
|
return [
|
|
58772
58825
|
`${prefix}.create`,
|
|
@@ -58801,15 +58854,14 @@ async function approvalProvenance(fixtures) {
|
|
|
58801
58854
|
throw new Error("Approval probe returned the wrong resource.");
|
|
58802
58855
|
return runner.evidence();
|
|
58803
58856
|
}
|
|
58804
|
-
async function jobsLifecycle(fixtures) {
|
|
58805
|
-
const config2 = requiredFixture(fixtures.jobs, "jobs");
|
|
58857
|
+
async function jobsLifecycle(fixtures, config2, kind) {
|
|
58806
58858
|
const jobsClient = requiredFixture(fixtures.jobsClient, "jobs native SDK client");
|
|
58807
58859
|
const runner = new GovernedCertificationRunner(fixtures);
|
|
58808
58860
|
const tools = databricksJobsAuthoringTools(jobsClient, config2.computePolicy);
|
|
58809
58861
|
const api = new DatabricksJobsAuthoring(jobsClient, config2.computePolicy);
|
|
58810
58862
|
let jobId2 = 0;
|
|
58811
58863
|
const lifecycle = await runDatabricksAuthoringLifecycle({
|
|
58812
|
-
kind
|
|
58864
|
+
kind,
|
|
58813
58865
|
create: async () => {
|
|
58814
58866
|
const created = await runner.execute(
|
|
58815
58867
|
findTool(tools, "databricks_create_job"),
|
|
@@ -58881,8 +58933,7 @@ async function lakeflowLifecycle(fixtures) {
|
|
|
58881
58933
|
void api;
|
|
58882
58934
|
return runner.evidence(lifecycle);
|
|
58883
58935
|
}
|
|
58884
|
-
async function aiSearchLifecycle(fixtures) {
|
|
58885
|
-
const config2 = requiredFixture(fixtures.aiSearch, "aiSearch");
|
|
58936
|
+
async function aiSearchLifecycle(fixtures, config2, kind) {
|
|
58886
58937
|
const vectorSearchClient = requiredFixture(
|
|
58887
58938
|
fixtures.vectorSearchClient,
|
|
58888
58939
|
"vector search native SDK client"
|
|
@@ -58891,7 +58942,7 @@ async function aiSearchLifecycle(fixtures) {
|
|
|
58891
58942
|
const tools = databricksAiSearchAdminTools(vectorSearchClient);
|
|
58892
58943
|
const api = new DatabricksAiSearchAdmin(vectorSearchClient);
|
|
58893
58944
|
const lifecycle = await runDatabricksAuthoringLifecycle({
|
|
58894
|
-
kind
|
|
58945
|
+
kind,
|
|
58895
58946
|
create: async () => {
|
|
58896
58947
|
await runner.execute(findTool(tools, "databricks_create_search_endpoint"), {
|
|
58897
58948
|
name: config2.endpointName,
|
|
@@ -58922,8 +58973,7 @@ async function aiSearchLifecycle(fixtures) {
|
|
|
58922
58973
|
});
|
|
58923
58974
|
return runner.evidence(lifecycle);
|
|
58924
58975
|
}
|
|
58925
|
-
async function servingLifecycle(fixtures) {
|
|
58926
|
-
const config2 = requiredFixture(fixtures.serving, "serving");
|
|
58976
|
+
async function servingLifecycle(fixtures, config2, kind) {
|
|
58927
58977
|
const modelServingClient = requiredFixture(
|
|
58928
58978
|
fixtures.modelServingClient,
|
|
58929
58979
|
"model serving native SDK client"
|
|
@@ -58932,7 +58982,7 @@ async function servingLifecycle(fixtures) {
|
|
|
58932
58982
|
const tools = databricksServingAdminTools(modelServingClient);
|
|
58933
58983
|
const api = new DatabricksServingAdmin(modelServingClient);
|
|
58934
58984
|
const lifecycle = await runDatabricksAuthoringLifecycle({
|
|
58935
|
-
kind
|
|
58985
|
+
kind,
|
|
58936
58986
|
create: async () => {
|
|
58937
58987
|
await runner.execute(
|
|
58938
58988
|
findTool(tools, "databricks_create_serving_endpoint"),
|
|
@@ -59561,8 +59611,7 @@ var DATABRICKS_CAPABILITY_DEFINITIONS = [
|
|
|
59561
59611
|
{
|
|
59562
59612
|
package: "@fabric-harness/databricks",
|
|
59563
59613
|
exports: [
|
|
59564
|
-
"
|
|
59565
|
-
"listDatabricksModelServices",
|
|
59614
|
+
"databricks",
|
|
59566
59615
|
"databricksFoundationModelProvider"
|
|
59567
59616
|
]
|
|
59568
59617
|
}
|
|
@@ -59580,7 +59629,7 @@ var DATABRICKS_CAPABILITY_DEFINITIONS = [
|
|
|
59580
59629
|
certification: "contract",
|
|
59581
59630
|
auth: ["oauth-m2m", "app-service-principal"],
|
|
59582
59631
|
contractClouds: ALL_CLOUDS,
|
|
59583
|
-
surfaces: [{ package: "@fabric-harness/databricks", exports: ["
|
|
59632
|
+
surfaces: [{ package: "@fabric-harness/databricks", exports: ["databricks"] }],
|
|
59584
59633
|
requiredEvidence: [
|
|
59585
59634
|
"agent-services.create",
|
|
59586
59635
|
"agent-services.verify",
|
|
@@ -59625,7 +59674,7 @@ var DATABRICKS_CAPABILITY_DEFINITIONS = [
|
|
|
59625
59674
|
auth: ["oauth-m2m", "app-service-principal", "pat"],
|
|
59626
59675
|
contractClouds: ALL_CLOUDS,
|
|
59627
59676
|
surfaces: [
|
|
59628
|
-
{ package: "@fabric-harness/databricks", exports: ["
|
|
59677
|
+
{ package: "@fabric-harness/databricks", exports: ["databricks", "scoreRagTurn"] }
|
|
59629
59678
|
],
|
|
59630
59679
|
requiredEvidence: ["mlflow.trace", "mlflow.evaluate"],
|
|
59631
59680
|
evidenceIds: ["dbx-cert-d03df5a0a5b69a98d8acb0ad4c1e9ef9bcffefea7e433cbd2ba0ff3d792fec71"],
|
|
@@ -59712,7 +59761,7 @@ var DATABRICKS_CAPABILITY_DEFINITIONS = [
|
|
|
59712
59761
|
surfaces: [
|
|
59713
59762
|
{
|
|
59714
59763
|
package: "@fabric-harness/databricks",
|
|
59715
|
-
exports: ["
|
|
59764
|
+
exports: ["databricks", "serializeDatabricksGenieAgentSpec"]
|
|
59716
59765
|
}
|
|
59717
59766
|
],
|
|
59718
59767
|
docs: "/docs/databricks/authoring",
|
|
@@ -59738,7 +59787,7 @@ var DATABRICKS_CAPABILITY_DEFINITIONS = [
|
|
|
59738
59787
|
surfaces: [
|
|
59739
59788
|
{
|
|
59740
59789
|
package: "@fabric-harness/databricks",
|
|
59741
|
-
exports: ["
|
|
59790
|
+
exports: ["databricks", "databricksGenieAgentModeTool"]
|
|
59742
59791
|
}
|
|
59743
59792
|
],
|
|
59744
59793
|
docs: "/docs/databricks/authoring",
|
|
@@ -59885,7 +59934,7 @@ var DATABRICKS_CAPABILITY_DEFINITIONS = [
|
|
|
59885
59934
|
surfaces: [
|
|
59886
59935
|
{
|
|
59887
59936
|
package: "@fabric-harness/databricks",
|
|
59888
|
-
exports: ["
|
|
59937
|
+
exports: ["databricks"]
|
|
59889
59938
|
}
|
|
59890
59939
|
],
|
|
59891
59940
|
docs: "/docs/databricks/authoring",
|
|
@@ -60680,6 +60729,7 @@ function buildDatabricksBundle(config2, scope) {
|
|
|
60680
60729
|
});
|
|
60681
60730
|
const client = native.preview;
|
|
60682
60731
|
const genieAgentModeClient = genie.agentMode ? databricksGenieAgentMode(client, genie.agentMode) : void 0;
|
|
60732
|
+
const agentServicesClient = config2.agentServices ? databricksAgentServices(client, config2.agentServices) : void 0;
|
|
60683
60733
|
let embeddings;
|
|
60684
60734
|
let retriever;
|
|
60685
60735
|
let searchTool;
|
|
@@ -60800,6 +60850,12 @@ function buildDatabricksBundle(config2, scope) {
|
|
|
60800
60850
|
})
|
|
60801
60851
|
} : {},
|
|
60802
60852
|
...genieAgentModeClient ? { genieAgentMode: genieAgentModeClient } : {},
|
|
60853
|
+
...agentServicesClient ? { agentServices: agentServicesClient } : {},
|
|
60854
|
+
aiGateway: {
|
|
60855
|
+
ensure: () => ensureDatabricksAiGateway(client),
|
|
60856
|
+
listModelServices: (options) => listDatabricksModelServices(client, options)
|
|
60857
|
+
},
|
|
60858
|
+
mlflowTraceExporter: (options) => mlflowTraceExporter({ client, ...options }),
|
|
60803
60859
|
forPrincipal(input) {
|
|
60804
60860
|
const scoped = buildDatabricksBundle(config2, {
|
|
60805
60861
|
identity: input.tokenProvider,
|
|
@@ -60916,11 +60972,8 @@ export {
|
|
|
60916
60972
|
DATABRICKS_CAPABILITY_EVIDENCE,
|
|
60917
60973
|
DATABRICKS_CERTIFICATION_RESOURCE_PREFIX,
|
|
60918
60974
|
DATABRICKS_PACKAGE_COMPATIBILITY,
|
|
60919
|
-
DatabricksAgentServices,
|
|
60920
60975
|
DatabricksAiSearchAdmin,
|
|
60921
60976
|
DatabricksCertificationCleanupLedger,
|
|
60922
|
-
DatabricksGenieAdmin,
|
|
60923
|
-
DatabricksGenieAgentModeClient,
|
|
60924
60977
|
DatabricksGenieAgentModeProtocolError,
|
|
60925
60978
|
DatabricksGenieAgentModeResponseError,
|
|
60926
60979
|
DatabricksGenieAgentModeTimeoutError,
|
|
@@ -60933,13 +60986,11 @@ export {
|
|
|
60933
60986
|
DatabricksJobsAuthoring,
|
|
60934
60987
|
DatabricksLakeflowAuthoring,
|
|
60935
60988
|
DatabricksManagedResourceConflictError,
|
|
60936
|
-
DatabricksPreviewClient,
|
|
60937
60989
|
DatabricksRunTimeoutError,
|
|
60938
60990
|
DatabricksSecretsAuthoring,
|
|
60939
60991
|
DatabricksServingAdmin,
|
|
60940
60992
|
DatabricksUnityCatalogAdmin,
|
|
60941
60993
|
DatabricksUnmanagedResourceError,
|
|
60942
|
-
DatabricksWorkspaceAuthoring,
|
|
60943
60994
|
LakebaseDatabricksManagedResourceStore,
|
|
60944
60995
|
MemoryDatabricksManagedResourceStore,
|
|
60945
60996
|
MockDatabricksModelProvider,
|
|
@@ -60951,7 +61002,6 @@ export {
|
|
|
60951
61002
|
createDatabricksRagChain,
|
|
60952
61003
|
databricks,
|
|
60953
61004
|
databricksActualCostSource,
|
|
60954
|
-
databricksAgentServices,
|
|
60955
61005
|
databricksAiQueryTool,
|
|
60956
61006
|
databricksAiSearch,
|
|
60957
61007
|
databricksAiSearchAdminTools,
|
|
@@ -60964,10 +61014,7 @@ export {
|
|
|
60964
61014
|
databricksFeatureLookupTool,
|
|
60965
61015
|
databricksFoundationModelProvider,
|
|
60966
61016
|
databricksGenie,
|
|
60967
|
-
databricksGenieAdmin,
|
|
60968
|
-
databricksGenieAgentMode,
|
|
60969
61017
|
databricksGenieAgentModeTool,
|
|
60970
|
-
databricksGenieAuthoringTools,
|
|
60971
61018
|
databricksGenieTool,
|
|
60972
61019
|
databricksGovernancePolicy,
|
|
60973
61020
|
databricksIdentity,
|
|
@@ -60998,11 +61045,8 @@ export {
|
|
|
60998
61045
|
databricksTelemetry,
|
|
60999
61046
|
databricksTenantCostLimit,
|
|
61000
61047
|
databricksUnityCatalogAdminTools,
|
|
61001
|
-
databricksWorkspaceAuthoringTools,
|
|
61002
61048
|
databricksWorkspaceOrigin,
|
|
61003
|
-
databricksWorkspaceSource,
|
|
61004
61049
|
defineDatabricksAgent,
|
|
61005
|
-
ensureDatabricksAiGateway,
|
|
61006
61050
|
ensureDatabricksTelemetryTables,
|
|
61007
61051
|
exportAgentEvaluationJsonl,
|
|
61008
61052
|
exportMlflow3EvaluationJsonl,
|
|
@@ -61016,9 +61060,7 @@ export {
|
|
|
61016
61060
|
lakebaseClient,
|
|
61017
61061
|
lakebaseCredentialProvider,
|
|
61018
61062
|
listDatabricksCapabilities,
|
|
61019
|
-
listDatabricksModelServices,
|
|
61020
61063
|
missingDatabricksCapabilityEvidence,
|
|
61021
|
-
mlflowTraceExporter,
|
|
61022
61064
|
normalizeDatabricksGenieAgentSpec,
|
|
61023
61065
|
onBehalfOfFromHeaders,
|
|
61024
61066
|
queryDatabricksLineageEvidence,
|