@fabric-harness/databricks 4.1.0 → 4.1.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 CHANGED
@@ -78,12 +78,12 @@ discovery, and the ResponsesAgent custom request schema. Its exhaustive method-a
78
78
  rejects every other route before credential resolution or network I/O. Callers use typed bundle
79
79
  capabilities rather than constructing that transport.
80
80
 
81
- One compatibility exception is deliberately quarantined: SDK 0.21's generated Genie query-result
82
- parser rejects Databricks' real row-array payload. Genie retries that one decoded response through the
83
- raw protocol transport only when the generated client raises the exact schema error. Authentication,
84
- conversation lifecycle, polling, and unrelated failures continue through or fail from the official
85
- client. Source-boundary and runtime-denial tests prevent this exception from spreading to stable
86
- services.
81
+ Two compatibility exceptions are deliberately quarantined in SDK 0.21. The generated Genie
82
+ query-result parser rejects Databricks' real row-array payload, and the shared JSON decoder attempts
83
+ to convert a floating-point AI Search score to `BigInt`. Fabric retries only those read-only responses
84
+ through the raw protocol transport when the exact decoder error is raised. Authentication, lifecycle,
85
+ and unrelated failures continue through or fail from the official clients. Source-boundary and
86
+ runtime-denial tests prevent these exceptions from spreading to other stable services.
87
87
 
88
88
  ## Shipped surface
89
89
 
package/dist/agent.js CHANGED
@@ -17811,6 +17811,11 @@ var DATABRICKS_RAW_PROTOCOL_RULES = [
17811
17811
  methods: ["GET"],
17812
17812
  path: /^\/api\/2\.0\/genie\/spaces\/[^/?#]+\/conversations\/[^/?#]+\/messages\/[^/?#]+\/attachments\/[^/?#]+\/query-result$/u
17813
17813
  },
17814
+ {
17815
+ id: "vector-search-query-sdk-compatibility",
17816
+ methods: ["POST"],
17817
+ path: /^\/api\/2\.0\/vector-search\/indexes\/[^/?#]+\/query$/u
17818
+ },
17814
17819
  {
17815
17820
  id: "responses-agent-custom-schema",
17816
17821
  methods: ["POST"],
@@ -57852,18 +57857,55 @@ function databricksAiSearch(options) {
57852
57857
  };
57853
57858
  if (opts.filter) body.filtersJson = JSON.stringify(opts.filter);
57854
57859
  if (queryType === "vector") {
57855
- if (!options.embeddings) throw new Error('databricks AI Search: queryType "vector" requires an embeddings provider.');
57860
+ if (!options.embeddings)
57861
+ throw new Error(
57862
+ 'databricks AI Search: queryType "vector" requires an embeddings provider.'
57863
+ );
57856
57864
  const [vector] = await options.embeddings.embed([query]);
57857
- if (!vector) throw new Error("databricks AI Search: embeddings returned no vector for the query.");
57865
+ if (!vector)
57866
+ throw new Error("databricks AI Search: embeddings returned no vector for the query.");
57858
57867
  body.queryVector = vector;
57859
57868
  } else {
57860
57869
  body.queryText = query;
57861
57870
  }
57862
- const response = await options.client.queryVectorIndex(body);
57871
+ const response = await queryVectorIndex(options, body);
57863
57872
  return mapResults(response, options, columns);
57864
57873
  }
57865
57874
  };
57866
57875
  }
57876
+ async function queryVectorIndex(options, body) {
57877
+ try {
57878
+ return await options.client.queryVectorIndex(body);
57879
+ } catch (error51) {
57880
+ if (!options.rawProtocolClient || !isGeneratedFloatingPointDecodeError(error51)) throw error51;
57881
+ const raw = await options.rawProtocolClient.post(
57882
+ `/api/2.0/vector-search/indexes/${encodeURIComponent(options.index)}/query`,
57883
+ {
57884
+ columns: body.columns,
57885
+ num_results: body.numResults,
57886
+ ...body.filtersJson !== void 0 ? { filters_json: body.filtersJson } : {},
57887
+ ...body.queryText !== void 0 ? { query_text: body.queryText } : {},
57888
+ ...body.queryVector !== void 0 ? { query_vector: body.queryVector } : {}
57889
+ },
57890
+ void 0,
57891
+ { retry: "safe" }
57892
+ );
57893
+ return {
57894
+ ...raw.manifest ? { manifest: raw.manifest } : {},
57895
+ ...raw.result ? {
57896
+ result: {
57897
+ ...raw.result.data_array ? { dataArray: raw.result.data_array } : {},
57898
+ ...raw.result.row_count !== void 0 ? { rowCount: raw.result.row_count } : {}
57899
+ }
57900
+ } : {},
57901
+ ...raw.next_page_token ? { nextPageToken: raw.next_page_token } : {}
57902
+ };
57903
+ }
57904
+ }
57905
+ function isGeneratedFloatingPointDecodeError(error51) {
57906
+ const message = error51 instanceof Error ? `${error51.name}: ${error51.message}` : String(error51);
57907
+ return /Cannot convert [-+]?\d+\.\d+(?:e[-+]?\d+)? to a BigInt/iu.test(message);
57908
+ }
57867
57909
  function mapResults(response, options, requestedColumns) {
57868
57910
  const names = (response.manifest?.columns ?? []).map((c2) => c2.name ?? "");
57869
57911
  const requested = new Set(requestedColumns);
@@ -58033,6 +58075,7 @@ function buildDatabricksBundle(config2, scope) {
58033
58075
  });
58034
58076
  retriever = databricksAiSearch({
58035
58077
  client: native.vectorSearch,
58078
+ rawProtocolClient: client,
58036
58079
  index: aiSearch.index,
58037
58080
  textColumn: aiSearch.textColumn,
58038
58081
  ...aiSearch.columns ? { columns: aiSearch.columns } : {},