@fabric-harness/databricks 7.3.0 → 7.4.0-dev.2b138c6e
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 +3 -1
- package/dist/agent.js +16 -2
- package/dist/agent.js.map +1 -1
- package/dist/document-extract-fake.d.ts +55 -0
- package/dist/document-extract-fake.d.ts.map +1 -0
- package/dist/document-extract.d.ts +6 -1
- package/dist/document-extract.d.ts.map +1 -1
- package/dist/document-staging.d.ts +47 -0
- package/dist/document-staging.d.ts.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +266 -5
- package/dist/index.js.map +1 -1
- package/package.json +23 -12
package/README.md
CHANGED
|
@@ -242,7 +242,9 @@ runtime-denial tests prevent these exceptions from spreading to other stable ser
|
|
|
242
242
|
- AI Gateway and Model Serving: automatic `system.ai.*` routing, explicit mode/base URL selection, model-service discovery, gateway readiness, request tags, streaming, tools, and custom endpoints.
|
|
243
243
|
- Managed MCP: async `databricksWithManagedMcp()` discovery for Genie, AI Search, SQL, Unity Catalog functions, and registered Unity AI Gateway MCP Services; rotating OBO/M2M auth, same-origin token enforcement, explicit effect classification, token redaction, governed static resources, and request-scoped reconnection.
|
|
244
244
|
- Identity: Databricks CLI OAuth profiles, explicit PAT/pre-fetched bearer, cached OAuth M2M, Databricks Apps service principal, and forwarded user token helpers.
|
|
245
|
-
- Document extraction (Beta): `extractDatabricksDocument()` and `databricksDocumentExtractTool()` run `ai_parse_document` and `ai_extract` on one file from an exact or segment-boundary prefix Volume allowlist, check the result against a configured schema, and resolve each citation to a parsed element by exact bounding-box match. Errors carry a stable `code` and are built only from fixed text, numbers, configured field names, validated request values and Harness's own literals, which a response string can select only by exact equality, so response text is not copied into them. A model tool's result still enters the agent's context, history and events; call the function from server code where that is not acceptable. See the [document extraction guide](https://harness.techfabric.com/docs/databricks/document-extraction).
|
|
245
|
+
- Document extraction (Beta): `extractDatabricksDocument()` and `databricksDocumentExtractTool()` run `ai_parse_document` and `ai_extract` on one file from an exact or segment-boundary prefix Volume allowlist, check the result against a configured schema, and resolve each citation to a parsed element by exact bounding-box match. Function callers can bind the result to staged bytes with `expectedContentSha256` and `expectedSizeBytes`; a difference reports `content_mismatch`. The model tool does not expose these options. Errors carry a stable `code` and are built only from fixed text, numbers, configured field names, validated request values and Harness's own literals, which a response string can select only by exact equality, so response text is not copied into them. A model tool's result still enters the agent's context, history and events; call the function from server code where that is not acceptable. See the [document extraction guide](https://harness.techfabric.com/docs/databricks/document-extraction).
|
|
246
|
+
Use `fakeDatabricksDocumentStatementClient()` to test document extraction locally with supplied bytes, fields, and citations.
|
|
247
|
+
- Document staging: `stageDatabricksDocument()` uploads bytes to an exact Volume path without overwriting an existing file and returns their `sizeBytes` and `contentSha256`; pass those to the extraction as `expectedSizeBytes` and `expectedContentSha256`, and call `deleteStagedDatabricksDocument()` to clean up. See the [staging guide](https://harness.techfabric.com/docs/databricks/document-extraction#stage-a-file).
|
|
246
248
|
- Data and AI: SELECT-only `databricksSqlReadTool()`, policy-bound arbitrary SQL Warehouse execution, Unity Catalog discovery/admin, AI Search query/admin, bounded citation-validated RAG with token streaming, MLflow 3 evaluation records and a managed-judge release Job, embeddings, endpoint-bound `ai_query()`, typed Genie Agent conversations, beta normalized lifecycle/ACL authoring, explicit Beta Agent Mode SSE streaming, Feature Serving, typed Jobs 2.2 authoring/run APIs, and workspace read/write APIs.
|
|
247
249
|
- Agent governance: explicit-Beta Unity Catalog Agent Services registration, discovery, metadata updates, `EXECUTE`/`READ_METADATA` grants, and deletion for externally hosted Harness agents.
|
|
248
250
|
- Native managed agents: explicit-Beta Supervisor Agent and Knowledge Assistant discovery through the official generated SDK, guarded lifecycle access, Responses-compatible invocation, cancellation propagation, and fixed-resource model tool projection.
|
package/dist/agent.js
CHANGED
|
@@ -25117,6 +25117,14 @@ async function extractDatabricksDocument(client, policy, options, input2) {
|
|
|
25117
25117
|
options.pollIntervalMs ?? DEFAULT_POLL_INTERVAL_MS,
|
|
25118
25118
|
"pollIntervalMs"
|
|
25119
25119
|
);
|
|
25120
|
+
if (input2.expectedContentSha256 !== void 0 && (typeof input2.expectedContentSha256 !== "string" || !SHA256_HEX.test(input2.expectedContentSha256)))
|
|
25121
|
+
throw new TypeError(
|
|
25122
|
+
"Databricks document extraction expectedContentSha256 must be lowercase SHA-256 hex."
|
|
25123
|
+
);
|
|
25124
|
+
if (input2.expectedSizeBytes !== void 0 && (!Number.isSafeInteger(input2.expectedSizeBytes) || input2.expectedSizeBytes < 0))
|
|
25125
|
+
throw new TypeError(
|
|
25126
|
+
"Databricks document extraction expectedSizeBytes must be a non-negative safe integer."
|
|
25127
|
+
);
|
|
25120
25128
|
const schemaName = input2.schemaName;
|
|
25121
25129
|
const schema = typeof schemaName === "string" ? resolved.schemas.get(schemaName) : void 0;
|
|
25122
25130
|
if (!schema)
|
|
@@ -25174,7 +25182,7 @@ async function extractDatabricksDocument(client, policy, options, input2) {
|
|
|
25174
25182
|
}
|
|
25175
25183
|
try {
|
|
25176
25184
|
const row = statementRow(response, context);
|
|
25177
|
-
const result = await documentResult(resolved, schema, row, context);
|
|
25185
|
+
const result = await documentResult(resolved, schema, row, context, input2);
|
|
25178
25186
|
const outputBytes = new TextEncoder().encode(JSON.stringify(result)).byteLength;
|
|
25179
25187
|
if (outputBytes > resolved.maxOutputBytes)
|
|
25180
25188
|
throw new DatabricksDocumentExtractError(
|
|
@@ -25259,7 +25267,7 @@ function statementRow(response, context) {
|
|
|
25259
25267
|
RESULT_COLUMNS.map((name) => [name, cells[index[name]]])
|
|
25260
25268
|
);
|
|
25261
25269
|
}
|
|
25262
|
-
async function documentResult(policy, schema, row, context) {
|
|
25270
|
+
async function documentResult(policy, schema, row, context, expected) {
|
|
25263
25271
|
const unexpected = (what) => new DatabricksDocumentExtractError(
|
|
25264
25272
|
"unexpected_response",
|
|
25265
25273
|
`Databricks document extraction statement returned ${what}.`,
|
|
@@ -25277,6 +25285,12 @@ async function documentResult(policy, schema, row, context) {
|
|
|
25277
25285
|
throw unexpected("an invalid modification time");
|
|
25278
25286
|
if (typeof row.content_sha256 !== "string" || !SHA256_HEX.test(row.content_sha256))
|
|
25279
25287
|
throw unexpected("an invalid content hash");
|
|
25288
|
+
if (expected.expectedContentSha256 !== void 0 && expected.expectedContentSha256 !== row.content_sha256 || expected.expectedSizeBytes !== void 0 && expected.expectedSizeBytes !== sizeBytes)
|
|
25289
|
+
throw new DatabricksDocumentExtractError(
|
|
25290
|
+
"content_mismatch",
|
|
25291
|
+
"Databricks document extraction file read at the path did not match the expected content.",
|
|
25292
|
+
{ ...context, sizeBytes }
|
|
25293
|
+
);
|
|
25280
25294
|
if (sizeBytes > policy.maxFileBytes)
|
|
25281
25295
|
throw new DatabricksDocumentExtractError(
|
|
25282
25296
|
"file_too_large",
|