@dbx-tools/genie 0.1.74 → 0.1.75

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.
Files changed (2) hide show
  1. package/dist/index.js +2 -12
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { GenieMessageSchema, GenieSpaceSchema, eventsFromMessage, isTerminalStatus } from "@dbx-tools/genie-shared";
2
2
  import { WorkspaceClient } from "@databricks/sdk-experimental";
3
- import { apiUtils, commonUtils, logUtils } from "@dbx-tools/shared";
3
+ import { apiUtils, commonUtils, logUtils, stringUtils } from "@dbx-tools/shared";
4
4
 
5
5
  export * from "@dbx-tools/genie-shared"
6
6
 
@@ -268,16 +268,6 @@ async function getGenieSpace(spaceId, options) {
268
268
  }, context);
269
269
  return GenieSpaceSchema.parse(raw);
270
270
  }
271
- /** Pull the first non-empty string out of a `question` field (string | string[]). */
272
- function questionText(question) {
273
- if (typeof question === "string") {
274
- const trimmed = question.trim();
275
- return trimmed.length > 0 ? trimmed : void 0;
276
- }
277
- if (Array.isArray(question)) {
278
- for (const part of question) if (typeof part === "string" && part.trim().length > 0) return part.trim();
279
- }
280
- }
281
271
  /**
282
272
  * Extract the curated starter questions an author configured on a
283
273
  * Genie space. Reads `serialized_space -> config.sample_questions[*]
@@ -305,7 +295,7 @@ function genieSampleQuestions(space) {
305
295
  const seen = /* @__PURE__ */ new Set();
306
296
  const out = [];
307
297
  for (const entry of sampleQuestions) {
308
- const text = questionText(entry?.question);
298
+ const text = stringUtils.firstNonEmpty(entry?.question);
309
299
  if (!text || seen.has(text)) continue;
310
300
  seen.add(text);
311
301
  out.push(text);
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@dbx-tools/genie",
3
- "version": "0.1.74",
3
+ "version": "0.1.75",
4
4
  "dependencies": {
5
5
  "@databricks/sdk-experimental": "^0.17",
6
- "@dbx-tools/genie-shared": "0.1.74",
7
- "@dbx-tools/shared": "0.1.74"
6
+ "@dbx-tools/genie-shared": "0.1.75",
7
+ "@dbx-tools/shared": "0.1.75"
8
8
  },
9
9
  "exports": {
10
10
  ".": {