@fabric-harness/databricks 4.3.1 → 4.3.2
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/agent.d.ts.map +1 -1
- package/dist/agent.js +1 -192
- package/dist/agent.js.map +1 -1
- package/dist/capabilities.d.ts.map +1 -1
- package/dist/certification-environment.d.ts.map +1 -1
- package/dist/certification.d.ts +1 -8
- package/dist/certification.d.ts.map +1 -1
- package/dist/certify.js +7 -93
- package/dist/certify.js.map +1 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -377
- package/dist/index.js.map +1 -1
- package/dist/sql-sandbox.d.ts +0 -18
- package/dist/sql-sandbox.d.ts.map +1 -1
- package/dist/sql-sandbox.js +3 -114
- package/dist/sql-sandbox.js.map +1 -1
- package/package.json +1 -1
- package/dist/agent-services.js +0 -142
- package/dist/agent-services.js.map +0 -1
- package/dist/ai-gateway.js +0 -51
- package/dist/ai-gateway.js.map +0 -1
- package/dist/ai-search-admin.js +0 -194
- package/dist/ai-search-admin.js.map +0 -1
- package/dist/ai.js +0 -22
- package/dist/ai.js.map +0 -1
- package/dist/app.js +0 -143
- package/dist/app.js.map +0 -1
- package/dist/authoring-certification.js +0 -476
- package/dist/authoring-certification.js.map +0 -1
- package/dist/capabilities.js +0 -633
- package/dist/capabilities.js.map +0 -1
- package/dist/certification-resource.js +0 -17
- package/dist/certification-resource.js.map +0 -1
- package/dist/certification-sweeper.js +0 -128
- package/dist/certification-sweeper.js.map +0 -1
- package/dist/certification.js +0 -236
- package/dist/certification.js.map +0 -1
- package/dist/client.d.ts +0 -58
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js +0 -184
- package/dist/client.js.map +0 -1
- package/dist/compatibility.js +0 -88
- package/dist/compatibility.js.map +0 -1
- package/dist/consumption.js +0 -85
- package/dist/consumption.js.map +0 -1
- package/dist/cost-budget-actuals.js +0 -316
- package/dist/cost-budget-actuals.js.map +0 -1
- package/dist/embeddings.js +0 -24
- package/dist/embeddings.js.map +0 -1
- package/dist/feature-serving.js +0 -29
- package/dist/feature-serving.js.map +0 -1
- package/dist/genie-agent-mode.js +0 -374
- package/dist/genie-agent-mode.js.map +0 -1
- package/dist/genie-authoring.js +0 -898
- package/dist/genie-authoring.js.map +0 -1
- package/dist/genie.js +0 -405
- package/dist/genie.js.map +0 -1
- package/dist/governance.js +0 -353
- package/dist/governance.js.map +0 -1
- package/dist/identity.js +0 -229
- package/dist/identity.js.map +0 -1
- package/dist/jobs-authoring.js +0 -570
- package/dist/jobs-authoring.js.map +0 -1
- package/dist/jobs.js +0 -173
- package/dist/jobs.js.map +0 -1
- package/dist/lakebase.js +0 -110
- package/dist/lakebase.js.map +0 -1
- package/dist/lakeflow-authoring.js +0 -115
- package/dist/lakeflow-authoring.js.map +0 -1
- package/dist/lakeflow.js +0 -75
- package/dist/lakeflow.js.map +0 -1
- package/dist/managed-resource.js +0 -197
- package/dist/managed-resource.js.map +0 -1
- package/dist/mlflow-tracing.js +0 -167
- package/dist/mlflow-tracing.js.map +0 -1
- package/dist/mock-provider.js +0 -66
- package/dist/mock-provider.js.map +0 -1
- package/dist/model.js +0 -173
- package/dist/model.js.map +0 -1
- package/dist/persistence.js +0 -82
- package/dist/persistence.js.map +0 -1
- package/dist/rag-chain.js +0 -212
- package/dist/rag-chain.js.map +0 -1
- package/dist/rag-eval.js +0 -151
- package/dist/rag-eval.js.map +0 -1
- package/dist/release-evidence.d.ts +0 -49
- package/dist/release-evidence.d.ts.map +0 -1
- package/dist/secrets-authoring.js +0 -78
- package/dist/secrets-authoring.js.map +0 -1
- package/dist/secrets.js +0 -25
- package/dist/secrets.js.map +0 -1
- package/dist/serving-admin.js +0 -255
- package/dist/serving-admin.js.map +0 -1
- package/dist/serving-usage.js +0 -100
- package/dist/serving-usage.js.map +0 -1
- package/dist/sql-exec.js +0 -36
- package/dist/sql-exec.js.map +0 -1
- package/dist/telemetry-sink.js +0 -180
- package/dist/telemetry-sink.js.map +0 -1
- package/dist/tools.js +0 -167
- package/dist/tools.js.map +0 -1
- package/dist/unity-catalog-admin.js +0 -166
- package/dist/unity-catalog-admin.js.map +0 -1
- package/dist/vector-search.js +0 -65
- package/dist/vector-search.js.map +0 -1
- package/dist/volumes-attachment-store.js +0 -172
- package/dist/volumes-attachment-store.js.map +0 -1
- package/dist/workspace-authoring.js +0 -78
- package/dist/workspace-authoring.js.map +0 -1
package/dist/agent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EACZ,eAAe,EAEf,YAAY,EAGZ,UAAU,EACV,aAAa,EACb,cAAc,EACd,OAAO,EACR,MAAM,qBAAqB,CAAC;AAG7B,OAAO,KAAK,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAG3E,MAAM,MAAM,4BAA4B,CAAC,MAAM,GAAG,UAAU,EAAE,OAAO,GAAG,OAAO,IAAI,IAAI,CACrF,eAAe,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,KAAK,GAAG,OAAO,CAChB,GAAG;IACF,UAAU,CAAC,EAAE,sBAAsB,CAAC;IACpC,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,KAAK,CAAC,EAAE,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,CAAC;IAChC,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,GAAG,CAAC,EAAE,CACJ,OAAO,EAAE,eAAe,CAAC,MAAM,CAAC,GAAG;QAAE,UAAU,EAAE,gBAAgB,CAAA;KAAE,KAChE,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;CACjC,CAAC;AAkEF,wBAAgB,qBAAqB,CAAC,MAAM,GAAG,UAAU,EAAE,OAAO,GAAG,OAAO,EAC1E,OAAO,GAAE,4BAA4B,CAAC,MAAM,EAAE,OAAO,CAAM,GAC1D,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,CA0C/B;AAuBD,wBAAgB,eAAe,CAAC,MAAM,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,CAgCnF"}
|
package/dist/agent.js
CHANGED
|
@@ -1793,11 +1793,7 @@ var require_json_bigint = __commonJS({
|
|
|
1793
1793
|
});
|
|
1794
1794
|
|
|
1795
1795
|
// src/agent.ts
|
|
1796
|
-
import {
|
|
1797
|
-
defineAgent,
|
|
1798
|
-
listSandboxBackendFactories,
|
|
1799
|
-
mergeCapabilityPolicies
|
|
1800
|
-
} from "@fabric-harness/sdk/strict";
|
|
1796
|
+
import { defineAgent, mergeCapabilityPolicies } from "@fabric-harness/sdk/strict";
|
|
1801
1797
|
|
|
1802
1798
|
// ../../node_modules/.pnpm/@databricks+sdk-auth@0.21.0/node_modules/@databricks/sdk-auth/package.json
|
|
1803
1799
|
var package_default = {
|
|
@@ -58048,190 +58044,6 @@ function base643(value) {
|
|
|
58048
58044
|
return btoa(String.fromCharCode(...bytes));
|
|
58049
58045
|
}
|
|
58050
58046
|
|
|
58051
|
-
// src/sql-sandbox.ts
|
|
58052
|
-
import { createRemoteSandboxEnv, registerSandboxBackendFactory, registerSandboxRefDecoder, unregisterSandboxBackendFactory, unregisterSandboxRefDecoder } from "@fabric-harness/sdk";
|
|
58053
|
-
var DATABRICKS_SQL_SANDBOX_REF_PROVIDER = "databricks-sql";
|
|
58054
|
-
function databricksSqlSandbox(options) {
|
|
58055
|
-
const identity = databricksIdentity(options.principal);
|
|
58056
|
-
const client = options.client ?? createDatabricksNativeClients({
|
|
58057
|
-
host: options.host,
|
|
58058
|
-
credentials: databricksCredentials(options.principal),
|
|
58059
|
-
tokenProvider: identity,
|
|
58060
|
-
...options.fetchImpl ? { fetchImpl: options.fetchImpl } : {}
|
|
58061
|
-
}).statements;
|
|
58062
|
-
const waitTimeoutSeconds = options.waitTimeoutSeconds ?? 30;
|
|
58063
|
-
const resultFormat = options.resultFormat ?? "jsonl";
|
|
58064
|
-
const memFs = /* @__PURE__ */ new Map();
|
|
58065
|
-
const api = {
|
|
58066
|
-
async exec(command) {
|
|
58067
|
-
const startedAt = Date.now();
|
|
58068
|
-
try {
|
|
58069
|
-
const response = await client.executeStatement({
|
|
58070
|
-
warehouseId: options.warehouseId,
|
|
58071
|
-
statement: command,
|
|
58072
|
-
waitTimeout: `${waitTimeoutSeconds}s`,
|
|
58073
|
-
onWaitTimeout: "CANCEL",
|
|
58074
|
-
...options.catalog ? { catalog: options.catalog } : {},
|
|
58075
|
-
...options.schema ? { schema: options.schema } : {}
|
|
58076
|
-
});
|
|
58077
|
-
if (response.status?.state === "FAILED" || response.status?.state === "CANCELED") {
|
|
58078
|
-
return {
|
|
58079
|
-
command,
|
|
58080
|
-
exitCode: 1,
|
|
58081
|
-
stdout: "",
|
|
58082
|
-
stderr: response.status.error?.message ?? `Statement ${response.status.state}`,
|
|
58083
|
-
durationMs: Date.now() - startedAt
|
|
58084
|
-
};
|
|
58085
|
-
}
|
|
58086
|
-
const stdout = serializeResult(response, resultFormat);
|
|
58087
|
-
return { command, exitCode: 0, stdout, stderr: "", durationMs: Date.now() - startedAt };
|
|
58088
|
-
} catch (error51) {
|
|
58089
|
-
return {
|
|
58090
|
-
command,
|
|
58091
|
-
exitCode: 1,
|
|
58092
|
-
stdout: "",
|
|
58093
|
-
stderr: error51 instanceof Error ? error51.message : String(error51),
|
|
58094
|
-
durationMs: Date.now() - startedAt
|
|
58095
|
-
};
|
|
58096
|
-
}
|
|
58097
|
-
},
|
|
58098
|
-
async readFile(path) {
|
|
58099
|
-
const bytes = memFs.get(path);
|
|
58100
|
-
if (!bytes) throw new Error(`No such file: ${path}`);
|
|
58101
|
-
return new TextDecoder().decode(bytes);
|
|
58102
|
-
},
|
|
58103
|
-
async readFileBuffer(path) {
|
|
58104
|
-
const bytes = memFs.get(path);
|
|
58105
|
-
if (!bytes) throw new Error(`No such file: ${path}`);
|
|
58106
|
-
return bytes;
|
|
58107
|
-
},
|
|
58108
|
-
async writeFile(path, content) {
|
|
58109
|
-
memFs.set(path, typeof content === "string" ? new TextEncoder().encode(content) : content);
|
|
58110
|
-
},
|
|
58111
|
-
async stat(path) {
|
|
58112
|
-
const bytes = memFs.get(path);
|
|
58113
|
-
if (!bytes) throw new Error(`No such file: ${path}`);
|
|
58114
|
-
return { type: "file", size: bytes.byteLength };
|
|
58115
|
-
},
|
|
58116
|
-
async readdir(path) {
|
|
58117
|
-
const prefix = path.replace(/\/$/, "");
|
|
58118
|
-
const direct = /* @__PURE__ */ new Set();
|
|
58119
|
-
for (const key of memFs.keys()) {
|
|
58120
|
-
if (!key.startsWith(`${prefix}/`)) continue;
|
|
58121
|
-
const tail = key.slice(prefix.length + 1);
|
|
58122
|
-
const slash = tail.indexOf("/");
|
|
58123
|
-
direct.add(slash > 0 ? tail.slice(0, slash) : tail);
|
|
58124
|
-
}
|
|
58125
|
-
return [...direct];
|
|
58126
|
-
},
|
|
58127
|
-
async exists(path) {
|
|
58128
|
-
return memFs.has(path);
|
|
58129
|
-
},
|
|
58130
|
-
async mkdir() {
|
|
58131
|
-
},
|
|
58132
|
-
async rm(path) {
|
|
58133
|
-
for (const key of [...memFs.keys()]) {
|
|
58134
|
-
if (key === path || key.startsWith(`${path}/`)) memFs.delete(key);
|
|
58135
|
-
}
|
|
58136
|
-
}
|
|
58137
|
-
};
|
|
58138
|
-
return createRemoteSandboxEnv(api, {
|
|
58139
|
-
cwd: "/workspace",
|
|
58140
|
-
capabilities: { exec: true, filesystem: true, binaryFiles: true, snapshots: false, restore: false, reconnect: true, network: "provider-managed", persistence: "session", isolation: "provider" },
|
|
58141
|
-
encodeRef: () => ({
|
|
58142
|
-
provider: DATABRICKS_SQL_SANDBOX_REF_PROVIDER,
|
|
58143
|
-
providerData: databricksSqlSandboxRefData(options)
|
|
58144
|
-
})
|
|
58145
|
-
});
|
|
58146
|
-
}
|
|
58147
|
-
function registerDatabricksSqlSandboxBackend(registration = {}) {
|
|
58148
|
-
registerSandboxBackendFactory("databricks", (factoryOptions) => createRegisteredDatabricksSqlSandbox(factoryOptions, registration));
|
|
58149
|
-
registerSandboxRefDecoder(DATABRICKS_SQL_SANDBOX_REF_PROVIDER, (providerData) => {
|
|
58150
|
-
const target = assertDatabricksSqlSandboxRefData(providerData);
|
|
58151
|
-
return (factoryOptions) => databricksSqlSandbox({
|
|
58152
|
-
...target,
|
|
58153
|
-
principal: resolveRegisteredPrincipal(factoryOptions, target, registration),
|
|
58154
|
-
...registration.client ? { client: registration.client } : {}
|
|
58155
|
-
});
|
|
58156
|
-
});
|
|
58157
|
-
}
|
|
58158
|
-
function createRegisteredDatabricksSqlSandbox(options, registration) {
|
|
58159
|
-
const env2 = options.env ?? process.env;
|
|
58160
|
-
const metadata = options.metadata ?? {};
|
|
58161
|
-
const catalog = metadataString(metadata, "databricksCatalog") ?? env2.DATABRICKS_CATALOG;
|
|
58162
|
-
const schema = metadataString(metadata, "databricksSchema") ?? env2.DATABRICKS_SCHEMA;
|
|
58163
|
-
const resultFormat = metadataString(metadata, "databricksResultFormat");
|
|
58164
|
-
const target = {
|
|
58165
|
-
host: metadataString(metadata, "databricksHost") ?? env2.DATABRICKS_HOST ?? "",
|
|
58166
|
-
warehouseId: metadataString(metadata, "databricksWarehouseId") ?? env2.DATABRICKS_WAREHOUSE_ID ?? "",
|
|
58167
|
-
...catalog ? { catalog } : {},
|
|
58168
|
-
...schema ? { schema } : {},
|
|
58169
|
-
...resultFormat ? { resultFormat: assertResultFormat(resultFormat) } : {}
|
|
58170
|
-
};
|
|
58171
|
-
assertDatabricksSqlSandboxRefData(target);
|
|
58172
|
-
return databricksSqlSandbox({
|
|
58173
|
-
...target,
|
|
58174
|
-
principal: resolveRegisteredPrincipal(options, target, registration),
|
|
58175
|
-
...registration.client ? { client: registration.client } : {}
|
|
58176
|
-
});
|
|
58177
|
-
}
|
|
58178
|
-
function resolveRegisteredPrincipal(options, target, registration) {
|
|
58179
|
-
const env2 = options.env ?? process.env;
|
|
58180
|
-
return registration.resolvePrincipal?.(env2, target) ?? databricksPrincipalFromEnv(env2);
|
|
58181
|
-
}
|
|
58182
|
-
function databricksSqlSandboxRefData(options) {
|
|
58183
|
-
return {
|
|
58184
|
-
host: options.host,
|
|
58185
|
-
warehouseId: options.warehouseId,
|
|
58186
|
-
...options.catalog ? { catalog: options.catalog } : {},
|
|
58187
|
-
...options.schema ? { schema: options.schema } : {},
|
|
58188
|
-
...options.resultFormat ? { resultFormat: options.resultFormat } : {},
|
|
58189
|
-
...options.waitTimeoutSeconds !== void 0 ? { waitTimeoutSeconds: options.waitTimeoutSeconds } : {}
|
|
58190
|
-
};
|
|
58191
|
-
}
|
|
58192
|
-
function assertDatabricksSqlSandboxRefData(value) {
|
|
58193
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) throw new Error("Invalid Databricks SQL sandbox reference.");
|
|
58194
|
-
const data = value;
|
|
58195
|
-
if (typeof data.host !== "string" || data.host.trim().length === 0) throw new Error("Databricks SQL sandbox reference is missing host.");
|
|
58196
|
-
if (typeof data.warehouseId !== "string" || data.warehouseId.trim().length === 0) throw new Error("Databricks SQL sandbox reference is missing warehouseId.");
|
|
58197
|
-
const result = { host: data.host, warehouseId: data.warehouseId };
|
|
58198
|
-
if (typeof data.catalog === "string") result.catalog = data.catalog;
|
|
58199
|
-
if (typeof data.schema === "string") result.schema = data.schema;
|
|
58200
|
-
if (data.resultFormat !== void 0) result.resultFormat = assertResultFormat(data.resultFormat);
|
|
58201
|
-
if (data.waitTimeoutSeconds !== void 0) {
|
|
58202
|
-
if (typeof data.waitTimeoutSeconds !== "number" || !Number.isFinite(data.waitTimeoutSeconds)) throw new Error("Databricks SQL sandbox reference has an invalid waitTimeoutSeconds.");
|
|
58203
|
-
result.waitTimeoutSeconds = data.waitTimeoutSeconds;
|
|
58204
|
-
}
|
|
58205
|
-
return result;
|
|
58206
|
-
}
|
|
58207
|
-
function metadataString(metadata, key) {
|
|
58208
|
-
const value = metadata[key];
|
|
58209
|
-
return typeof value === "string" && value.trim().length > 0 ? value : void 0;
|
|
58210
|
-
}
|
|
58211
|
-
function assertResultFormat(value) {
|
|
58212
|
-
if (value === "jsonl" || value === "csv") return value;
|
|
58213
|
-
throw new Error("Databricks SQL sandbox result format must be jsonl or csv.");
|
|
58214
|
-
}
|
|
58215
|
-
function serializeResult(response, format) {
|
|
58216
|
-
const columns = response.manifest?.schema?.columns?.map((c2) => c2.name ?? "") ?? [];
|
|
58217
|
-
const rows = response.result?.dataArray ?? [];
|
|
58218
|
-
if (format === "csv") {
|
|
58219
|
-
const header = columns.join(",");
|
|
58220
|
-
const body = rows.map((row) => row.map(formatCsvCell).join(",")).join("\n");
|
|
58221
|
-
return [header, body].filter(Boolean).join("\n");
|
|
58222
|
-
}
|
|
58223
|
-
return rows.map((row) => {
|
|
58224
|
-
const obj = {};
|
|
58225
|
-
for (let i2 = 0; i2 < columns.length; i2 += 1) obj[columns[i2] ?? `_${i2}`] = row[i2];
|
|
58226
|
-
return JSON.stringify(obj);
|
|
58227
|
-
}).join("\n");
|
|
58228
|
-
}
|
|
58229
|
-
function formatCsvCell(value) {
|
|
58230
|
-
if (value === null || value === void 0) return "";
|
|
58231
|
-
const str = String(value);
|
|
58232
|
-
return /[",\n]/.test(str) ? `"${str.replace(/"/g, '""')}"` : str;
|
|
58233
|
-
}
|
|
58234
|
-
|
|
58235
58047
|
// src/index.ts
|
|
58236
58048
|
function databricks(config2) {
|
|
58237
58049
|
return buildDatabricksBundle(config2);
|
|
@@ -58544,9 +58356,6 @@ function defineDatabricksAgent(options = {}) {
|
|
|
58544
58356
|
} = merged;
|
|
58545
58357
|
const directTools = tools.filter((tool7) => typeof tool7 !== "string");
|
|
58546
58358
|
const toolRefs = tools.filter((tool7) => typeof tool7 === "string");
|
|
58547
|
-
if (sandbox === "databricks" && !listSandboxBackendFactories().includes("databricks")) {
|
|
58548
|
-
registerDatabricksSqlSandboxBackend();
|
|
58549
|
-
}
|
|
58550
58359
|
const def = {
|
|
58551
58360
|
...definition,
|
|
58552
58361
|
...directTools.length > 0 ? { tools: directTools } : {},
|