@dbx-tools/genie 0.9.131 → 0.9.132

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
@@ -1,25 +1,26 @@
1
1
  # @dbx-tools/genie
2
2
 
3
- Server-side Databricks Genie chat drivers.
3
+ Run Databricks Genie turns from Node or AppKit code as raw message snapshots or
4
+ a typed event stream. AppKit requests keep their on-behalf-of-user (OBO)
5
+ identity, standalone callers use the Databricks SDK authentication chain, and
6
+ both modes support cancellation.
4
7
 
5
- Run a Genie turn from Node or AppKit code and consume raw message snapshots or a
6
- typed event stream. AppKit requests keep their OBO identity; standalone callers
7
- use the Databricks SDK authentication chain. Both modes support cancellation.
8
-
9
- ## Quick Start
8
+ ## Quick start
10
9
 
11
10
  ```ts
12
11
  import { chat } from "@dbx-tools/genie";
13
12
 
13
+ const spaceId = process.env.DATABRICKS_GENIE_SPACE_ID!;
14
+
14
15
  for await (const event of chat.genieEventChat(spaceId, "Top stores by revenue?")) {
15
16
  console.log(event.type, event);
16
17
  }
17
18
  ```
18
19
 
19
20
  Pure Genie schemas and event detector helpers live in
20
- [`@dbx-tools/shared-genie`](../../shared/genie).
21
+ [@dbx-tools/shared-genie](../../shared/genie).
21
22
 
22
- Key features:
23
+ The driver:
23
24
 
24
25
  - Streams the Genie Agent Mode API by default, including reasoning, SQL calls,
25
26
  query output, and the synthesized answer.
@@ -40,15 +41,17 @@ Key features:
40
41
  CLI tools.
41
42
  - Fetches Genie space metadata and starter questions for UI suggestions.
42
43
 
43
- ## Choose The Driver Or AppKit Genie
44
+ ## Choose Genie integration
44
45
 
45
- Native AppKit's Genie plugin is the right choice for a standalone Genie chat
46
- experience: it provides named space aliases, SSE status updates, conversation
46
+ Use native AppKit's Genie plugin for a standalone Genie chat experience. It
47
+ provides named space aliases, SSE status updates, conversation
47
48
  history replay, query result fetching, OBO execution, and the AppKit UI
48
49
  `GenieChat` component.
49
50
 
50
- Use this package when Genie is one capability inside a larger agent or custom
51
- backend:
51
+ Use direct Genie when one Genie space owns the conversation and answer. Use
52
+ [@dbx-tools/appkit-mastra](../appkit-mastra) when a supervising agent must
53
+ combine Genie with other tools, Mastra memory, approvals, or workflows. Use
54
+ this package directly when custom backend code needs the lower-level stream:
52
55
 
53
56
  - You want a low-level async iterator rather than an AppKit HTTP route.
54
57
  - You want raw message snapshots or a normalized event stream that can be fed
@@ -60,7 +63,7 @@ backend:
60
63
  - You need the same driver to work inside AppKit with OBO auth and outside
61
64
  AppKit from scripts using normal Databricks SDK auth.
62
65
 
63
- ## Handle Semantic Events
66
+ ## Handle semantic events
64
67
 
65
68
  ```ts
66
69
  import { chat } from "@dbx-tools/genie";
@@ -85,10 +88,10 @@ for await (const event of chat.genieEventChat(spaceId, "Top stores by revenue?")
85
88
 
86
89
  `chat.genieEventChat()` wraps the lower-level snapshot stream and yields a
87
90
  `GenieChatEvent` union. Use it for SSE streams, log pipelines, and tool writer
88
- events where consumers care about progress and SQL, not just the terminal
91
+ events where consumers care about progress and SQL rather than only the terminal
89
92
  message.
90
93
 
91
- ## Stream Raw Message Snapshots
94
+ ## Stream raw message snapshots
92
95
 
93
96
  ```ts
94
97
  import { chat } from "@dbx-tools/genie";
@@ -107,7 +110,7 @@ normalized wire shape. Agent Mode returns query output inline as Markdown and
107
110
  copies a query output's `statement_id` onto the matching query attachment when
108
111
  Databricks supplies one.
109
112
 
110
- ## Continue A Conversation
113
+ ## Continue a conversation
111
114
 
112
115
  ```ts
113
116
  let conversationId: string | undefined;
@@ -126,7 +129,7 @@ message or event and passing it into the next turn. This works in stateless
126
129
  route handlers, durable thread stores, and one-off scripts. AppKit-Mastra stores
127
130
  the id with its thread and passes it back when a conversation continues.
128
131
 
129
- ## Resolve A Workspace Client
132
+ ## Resolve a workspace client
130
133
 
131
134
  ```ts
132
135
  import { createWorkspaceClient } from "@databricks/appkit";
@@ -139,14 +142,14 @@ await chat.genieEventChat(spaceId, content, {
139
142
 
140
143
  Client resolution order:
141
144
 
142
- 1. `options.workspaceClient`;
143
- 2. AppKit execution-context client, when present;
144
- 3. `createWorkspaceClient()` using AppKit's normal Databricks auth chain.
145
+ 1. `options.workspaceClient`.
146
+ 1. AppKit execution-context client, when present.
147
+ 1. `createWorkspaceClient()` using AppKit's normal Databricks auth chain.
145
148
 
146
149
  Pass `options.context` as an `AbortSignal` or SDK context to cancel the Agent
147
150
  Mode stream, SDK calls, and any polling fallback sleep.
148
151
 
149
- ## Read Space Metadata And Starter Questions
152
+ ## Read space metadata and starter questions
150
153
 
151
154
  ```ts
152
155
  import { space } from "@dbx-tools/genie";
@@ -163,7 +166,7 @@ The serialized blob needs `Can Edit` on the space, while `Can Run` is enough for
163
166
  title and description. When the workspace rejects the serialized request for
164
167
  lack of permission, `getGenieSpace()` retries once without it and logs
165
168
  `serialized-space:forbidden`, so an app service principal holding only `Can Run`
166
- still resolves the space and simply reports no starter questions. Every other
169
+ still resolves the space and reports no starter questions. Every other
167
170
  failure - a cancelled request, a missing space, a retry that also fails - is
168
171
  thrown.
169
172
 
@@ -172,9 +175,9 @@ thrown.
172
175
  `chat.GenieChatOptions` is shared by both drivers:
173
176
 
174
177
  - `conversationId` - append to an existing Genie conversation.
175
- - `agentMode` - use Agent Mode SSE, default `true`; `false` forces polling.
178
+ - `agentMode` - use Agent Mode SSE, default `true`. `false` forces polling.
176
179
  - `agentModeFallback` - fall back to classic polling when Agent Mode is
177
- unavailable, default `true`; direct Agent-only callers set `false`.
180
+ unavailable, default `true`. Direct Agent-only callers set `false`.
178
181
  - `enableVisualization` - request Agent Mode visualization generation.
179
182
  - `workspaceClient` - explicit Databricks SDK client.
180
183
  - `pollIntervalMs` - fallback polling cadence, default `500`.
@@ -188,6 +191,6 @@ thrown.
188
191
  Mode transport options plus Agent Mode conversation history.
189
192
  - `space` - `getGenieSpace()` and `genieSampleQuestions()`.
190
193
 
191
- The AppKit-Mastra package builds its Genie tools on top of this driver; see
192
- [`@dbx-tools/appkit-mastra`](../appkit-mastra) for the agent-level
194
+ The AppKit-Mastra package builds its Genie tools on top of this driver. See
195
+ [@dbx-tools/appkit-mastra](../appkit-mastra) for the agent-level
193
196
  workflow.
package/index.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  // Hand edits are overwritten on the next watch; this file is read-only.
4
4
 
5
5
  export const PACKAGE_IDENTIFIER = "@dbx-tools/genie";
6
- export const PACKAGE_VERSION = "0.9.131";
6
+ export const PACKAGE_VERSION = "0.9.132";
7
7
  export * as agentMode from "./src/agent-mode.ts";
8
8
  export * as chat from "./src/chat.ts";
9
9
  export * as space from "./src/space.ts";
package/lib/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export declare const PACKAGE_IDENTIFIER = "@dbx-tools/genie";
2
- export declare const PACKAGE_VERSION = "0.9.131";
2
+ export declare const PACKAGE_VERSION = "0.9.132";
3
3
  export * as agentMode from "./src/agent-mode.ts";
4
4
  export * as chat from "./src/chat.ts";
5
5
  export * as space from "./src/space.ts";
package/lib/index.js CHANGED
@@ -2,8 +2,8 @@
2
2
  // Regenerated from the exporting modules in ./src.
3
3
  // Hand edits are overwritten on the next watch; this file is read-only.
4
4
  export const PACKAGE_IDENTIFIER = "@dbx-tools/genie";
5
- export const PACKAGE_VERSION = "0.9.131";
5
+ export const PACKAGE_VERSION = "0.9.132";
6
6
  export * as agentMode from "./src/agent-mode.js";
7
7
  export * as chat from "./src/chat.js";
8
8
  export * as space from "./src/space.js";
9
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSwyQ0FBMkM7QUFDM0MsbURBQW1EO0FBQ25ELHdFQUF3RTtBQUV4RSxNQUFNLENBQUMsTUFBTSxrQkFBa0IsR0FBRyxrQkFBa0IsQ0FBQztBQUNyRCxNQUFNLENBQUMsTUFBTSxlQUFlLEdB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uL3NyYy9hZ2VudC1tb2RlLnRzXCI7XG5leHBvcnQgdHlwZSB7IEdlbmllQ2hhdE9wdGlvbnMgfSBmcm9tIFwiLi9zcmMvY2hhdC50c1wiO1xuZXhwb3J0IHR5cGUgeyBHZXRHZW5pZVNwYWNlT3B0aW9ucyB9IGZyb20gXCIuL3NyYy9zcGFjZS50c1wiO1xuIl19
package/package.json CHANGED
@@ -24,9 +24,9 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@databricks/appkit": "0.81.0",
27
- "@dbx-tools/appkit": "^0.9.131",
28
- "@dbx-tools/shared-core": "^0.9.131",
29
- "@dbx-tools/shared-genie": "^0.9.131"
27
+ "@dbx-tools/appkit": "^0.9.132",
28
+ "@dbx-tools/shared-core": "^0.9.132",
29
+ "@dbx-tools/shared-genie": "^0.9.132"
30
30
  },
31
31
  "main": "./lib/index.js",
32
32
  "license": "Apache-2.0",
@@ -58,7 +58,7 @@
58
58
  "./package.json": "./package.json"
59
59
  }
60
60
  },
61
- "version": "0.9.131",
61
+ "version": "0.9.132",
62
62
  "types": "./lib/index.d.ts",
63
63
  "dbxToolsConfig": {
64
64
  "tags": [