@dbx-tools/genie 0.1.27 → 0.1.28

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/index.d.ts CHANGED
@@ -1,33 +1,15 @@
1
1
  /**
2
2
  * `@dbx-tools/genie` public surface.
3
3
  *
4
- * - {@link genieChat}: low-level async generator. Yields every
5
- * poll-observed `GenieMessage` for a single turn against a
6
- * Genie space. Multi-turn conversations are driven by the
7
- * caller (thread the `conversation_id` off each yielded
8
- * message into the next call's `options.conversationId`).
9
- * - {@link genieEventChat}: high-level async generator. Drives
10
- * `genieChat` and yields a strongly-typed
11
- * {@link GenieChatEvent} stream of flat `{type, ...fields}`
12
- * records (`message`, `status`, `attachment`, `thinking`,
13
- * `text`, `query`, `statement`, `rows`,
14
- * `suggested_questions`, `result`). The final yield for any
15
- * terminal turn is always `{ type: "result", ... }`.
4
+ * Bundles the package's Node-side chat driver with a re-export of
5
+ * the pure `@dbx-tools/genie-shared` wire vocabulary so a single
6
+ * `from "@dbx-tools/genie"` import serves server-side consumers
7
+ * that need both the live driver and the protocol types.
16
8
  *
17
- * Wire-format types, the {@link GenieChatEvent} discriminated
18
- * union, per-event detectors (`detectStatus`, `detectThinking`,
19
- * `detectAttachmentAdded`, `detectText`, `detectQuery`,
20
- * `detectStatement`, `detectRows`, `detectSuggestedQuestions`),
21
- * the `eventsFromMessage` sync generator, and terminal-status
22
- * helpers all live in `@dbx-tools/genie-shared` and are
23
- * re-exported here so a single `from "@dbx-tools/genie"` import
24
- * works for server-side consumers. Browser-side consumers should
25
- * import from `@dbx-tools/genie-shared` directly to avoid pulling
26
- * in the Node-only `chat.ts` runtime.
27
- *
28
- * Browser safety: `chat.ts` pulls in `WorkspaceClient` and is
29
- * Node-only; the re-exports from `@dbx-tools/genie-shared` are
30
- * pure (types + sync functions) and safe for any runtime.
9
+ * Browser-side consumers should import `@dbx-tools/genie-shared`
10
+ * directly: the chat driver pulls in `WorkspaceClient` and is
11
+ * Node-only, whereas the re-exported protocol surface is pure
12
+ * (types + sync functions) and safe for any runtime.
31
13
  */
32
14
  export * from "./src/chat.js";
33
15
  export * from "@dbx-tools/genie-shared";
package/dist/index.js CHANGED
@@ -1,33 +1,15 @@
1
1
  /**
2
2
  * `@dbx-tools/genie` public surface.
3
3
  *
4
- * - {@link genieChat}: low-level async generator. Yields every
5
- * poll-observed `GenieMessage` for a single turn against a
6
- * Genie space. Multi-turn conversations are driven by the
7
- * caller (thread the `conversation_id` off each yielded
8
- * message into the next call's `options.conversationId`).
9
- * - {@link genieEventChat}: high-level async generator. Drives
10
- * `genieChat` and yields a strongly-typed
11
- * {@link GenieChatEvent} stream of flat `{type, ...fields}`
12
- * records (`message`, `status`, `attachment`, `thinking`,
13
- * `text`, `query`, `statement`, `rows`,
14
- * `suggested_questions`, `result`). The final yield for any
15
- * terminal turn is always `{ type: "result", ... }`.
4
+ * Bundles the package's Node-side chat driver with a re-export of
5
+ * the pure `@dbx-tools/genie-shared` wire vocabulary so a single
6
+ * `from "@dbx-tools/genie"` import serves server-side consumers
7
+ * that need both the live driver and the protocol types.
16
8
  *
17
- * Wire-format types, the {@link GenieChatEvent} discriminated
18
- * union, per-event detectors (`detectStatus`, `detectThinking`,
19
- * `detectAttachmentAdded`, `detectText`, `detectQuery`,
20
- * `detectStatement`, `detectRows`, `detectSuggestedQuestions`),
21
- * the `eventsFromMessage` sync generator, and terminal-status
22
- * helpers all live in `@dbx-tools/genie-shared` and are
23
- * re-exported here so a single `from "@dbx-tools/genie"` import
24
- * works for server-side consumers. Browser-side consumers should
25
- * import from `@dbx-tools/genie-shared` directly to avoid pulling
26
- * in the Node-only `chat.ts` runtime.
27
- *
28
- * Browser safety: `chat.ts` pulls in `WorkspaceClient` and is
29
- * Node-only; the re-exports from `@dbx-tools/genie-shared` are
30
- * pure (types + sync functions) and safe for any runtime.
9
+ * Browser-side consumers should import `@dbx-tools/genie-shared`
10
+ * directly: the chat driver pulls in `WorkspaceClient` and is
11
+ * Node-only, whereas the re-exported protocol surface is pure
12
+ * (types + sync functions) and safe for any runtime.
31
13
  */
32
14
  export * from "./src/chat.js";
33
15
  export * from "@dbx-tools/genie-shared";
@@ -1,28 +1,24 @@
1
1
  /**
2
2
  * `@dbx-tools/genie` chat driver.
3
3
  *
4
- * Two async generators ship from this file. Both take a single
5
- * `content` string for one turn against a Genie space; for
6
- * multi-turn conversations, the caller drives the loop and
7
- * threads the `conversation_id` returned on each
8
- * `GenieMessage` into the next call's `options.conversationId`.
4
+ * Drives a single turn against a Genie space from one `content`
5
+ * string; multi-turn conversations are the caller's job (thread
6
+ * the `conversation_id` returned on each `GenieMessage` back into
7
+ * the next turn's `options.conversationId`).
9
8
  *
10
- * - {@link genieChat}: low-level. Yields every poll-observed
11
- * `GenieMessage` verbatim. Cancellation, conversation seeding,
12
- * distinct-filtering, and SDK quirks (Waiter stripping) live
13
- * here. Use directly when you want the raw stream.
14
- * - {@link genieEventChat}: high-level. Wraps `genieChat` and
15
- * emits semantic, deduplicated events as a typed
16
- * `{ type, payload }` stream (see {@link GenieChatEvent}). The
17
- * final yield for a successful turn is always
18
- * `{ type: "result", payload }` carrying the terminal
19
- * `GenieMessage`. Errors propagate by the generator throwing -
20
- * there is no `"error"` variant.
21
- *
22
- * Pick the layer that matches your consumer. Iterating UI / agent
23
- * code that wants every message verbatim should use `genieChat`.
24
- * Subscribers that want to react to "Genie is thinking about X"
25
- * or "Genie produced text Y" should use `genieEventChat`.
9
+ * Two layers serve two kinds of consumer. The low-level layer
10
+ * yields every poll-observed `GenieMessage` verbatim and owns the
11
+ * messy parts - cancellation, conversation seeding,
12
+ * distinct-filtering, and SDK quirks (Waiter stripping); reach for
13
+ * it when you want the raw stream. The high-level layer wraps it
14
+ * and emits semantic, deduplicated `{ type, payload }` events
15
+ * (see {@link GenieChatEvent}), always closing a successful turn
16
+ * with a terminal `result` event carrying the final
17
+ * `GenieMessage`; errors propagate by throwing, with no `error`
18
+ * variant. Iterating UI / agent code that wants every message
19
+ * verbatim takes the low-level stream; subscribers reacting to
20
+ * "Genie is thinking about X" or "Genie produced text Y" take the
21
+ * event layer.
26
22
  */
27
23
  import { WorkspaceClient } from "@databricks/sdk-experimental";
28
24
  import { type GenieChatEvent, type GenieMessage } from "@dbx-tools/genie-shared";
package/dist/src/chat.js CHANGED
@@ -1,28 +1,24 @@
1
1
  /**
2
2
  * `@dbx-tools/genie` chat driver.
3
3
  *
4
- * Two async generators ship from this file. Both take a single
5
- * `content` string for one turn against a Genie space; for
6
- * multi-turn conversations, the caller drives the loop and
7
- * threads the `conversation_id` returned on each
8
- * `GenieMessage` into the next call's `options.conversationId`.
4
+ * Drives a single turn against a Genie space from one `content`
5
+ * string; multi-turn conversations are the caller's job (thread
6
+ * the `conversation_id` returned on each `GenieMessage` back into
7
+ * the next turn's `options.conversationId`).
9
8
  *
10
- * - {@link genieChat}: low-level. Yields every poll-observed
11
- * `GenieMessage` verbatim. Cancellation, conversation seeding,
12
- * distinct-filtering, and SDK quirks (Waiter stripping) live
13
- * here. Use directly when you want the raw stream.
14
- * - {@link genieEventChat}: high-level. Wraps `genieChat` and
15
- * emits semantic, deduplicated events as a typed
16
- * `{ type, payload }` stream (see {@link GenieChatEvent}). The
17
- * final yield for a successful turn is always
18
- * `{ type: "result", payload }` carrying the terminal
19
- * `GenieMessage`. Errors propagate by the generator throwing -
20
- * there is no `"error"` variant.
21
- *
22
- * Pick the layer that matches your consumer. Iterating UI / agent
23
- * code that wants every message verbatim should use `genieChat`.
24
- * Subscribers that want to react to "Genie is thinking about X"
25
- * or "Genie produced text Y" should use `genieEventChat`.
9
+ * Two layers serve two kinds of consumer. The low-level layer
10
+ * yields every poll-observed `GenieMessage` verbatim and owns the
11
+ * messy parts - cancellation, conversation seeding,
12
+ * distinct-filtering, and SDK quirks (Waiter stripping); reach for
13
+ * it when you want the raw stream. The high-level layer wraps it
14
+ * and emits semantic, deduplicated `{ type, payload }` events
15
+ * (see {@link GenieChatEvent}), always closing a successful turn
16
+ * with a terminal `result` event carrying the final
17
+ * `GenieMessage`; errors propagate by throwing, with no `error`
18
+ * variant. Iterating UI / agent code that wants every message
19
+ * verbatim takes the low-level stream; subscribers reacting to
20
+ * "Genie is thinking about X" or "Genie produced text Y" take the
21
+ * event layer.
26
22
  */
27
23
  import { WorkspaceClient } from "@databricks/sdk-experimental";
28
24
  import { eventsFromMessage, isTerminalStatus, } from "@dbx-tools/genie-shared";