@alexkroman1/aai-ui 5.4.0 → 5.5.0

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.
@@ -1,4 +1,4 @@
1
- import{i as e}from"./index-DyY8OeVc.js";import{t}from"./_module-url-BX0RuRU2.js";var n=t(`
1
+ import{i as e}from"./index-C99SRlSn.js";import{t}from"./_module-url-BX0RuRU2.js";var n=t(`
2
2
  class PlaybackProcessor extends AudioWorkletProcessor {
3
3
  constructor(options) {
4
4
  super();
@@ -6,7 +6,7 @@
6
6
  <title>aai</title>
7
7
  <link rel="icon" href="./favicon.ico" />
8
8
  <style>html, body { background: #FBF8F2; margin: 0; }</style>
9
- <script type="module" crossorigin src="./assets/index-DyY8OeVc.js"></script>
9
+ <script type="module" crossorigin src="./assets/index-C99SRlSn.js"></script>
10
10
  <link rel="stylesheet" crossorigin href="./assets/index-CRfdZPH1.css">
11
11
  </head>
12
12
  <body>
@@ -1,4 +1,4 @@
1
- import { r as fetchClientConfig, t as createSessionCore } from "./session-core-DX2SIpdQ.js";
1
+ import { r as fetchClientConfig, t as createSessionCore } from "./session-core-KY9B5nqn.js";
2
2
  import { SessionProvider, ThemeProvider } from "./context.js";
3
3
  import { t as ChatView } from "./chat-view-CqRGHImR.js";
4
4
  import { t as pageBaseUrl } from "./_utils-CsqbIVGI.js";
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { i as loadClientConfig, n as buildAgentUrl, r as fetchClientConfig, t as createSessionCore } from "./session-core-DX2SIpdQ.js";
1
+ import { i as loadClientConfig, n as buildAgentUrl, r as fetchClientConfig, t as createSessionCore } from "./session-core-KY9B5nqn.js";
2
2
  import { SessionProvider, ThemeProvider, useSession, useSessionSelector, useTheme } from "./context.js";
3
3
  import { Button } from "./components/button.js";
4
4
  import { t as ChatView } from "./chat-view-CqRGHImR.js";
@@ -807,6 +807,18 @@ function createSessionCore(options) {
807
807
  connect();
808
808
  }
809
809
  }
810
+ function end() {
811
+ teardownConnection();
812
+ sessionId = void 0;
813
+ hasConnected = false;
814
+ updateState({
815
+ ...CLEARED_SESSION_STATE,
816
+ state: "disconnected",
817
+ started: false,
818
+ running: false,
819
+ recording: false
820
+ });
821
+ }
810
822
  return {
811
823
  getSnapshot,
812
824
  subscribe,
@@ -817,6 +829,7 @@ function createSessionCore(options) {
817
829
  disconnect,
818
830
  start,
819
831
  toggle,
832
+ end,
820
833
  [Symbol.dispose]() {
821
834
  disconnect();
822
835
  }
@@ -111,6 +111,15 @@ export type SessionCore = {
111
111
  start(): void;
112
112
  /** Toggle between connected and disconnected states (after `start()`). */
113
113
  toggle(): void;
114
+ /**
115
+ * End the call: close the connection, clear the conversation, and return
116
+ * to the not-started state (`started` flips back to false, so a
117
+ * start-screen UI shows its Start control again). Unlike `reset()` —
118
+ * which keeps the call live and only clears the conversation — the next
119
+ * `start()` mints a brand-new session: a new session id, fresh
120
+ * per-session tool state, greeting included.
121
+ */
122
+ end(): void;
114
123
  /** Alias for `disconnect` for use with `using`. */
115
124
  [Symbol.dispose](): void;
116
125
  };
@@ -1,2 +1,2 @@
1
- import { t as createSessionCore } from "./session-core-DX2SIpdQ.js";
1
+ import { t as createSessionCore } from "./session-core-KY9B5nqn.js";
2
2
  export { createSessionCore };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexkroman1/aai-ui",
3
- "version": "5.4.0",
3
+ "version": "5.5.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -22,7 +22,7 @@
22
22
  "react-markdown": "^10.1.0",
23
23
  "remark-gfm": "^4.0.1",
24
24
  "use-sync-external-store": "^1.6.0",
25
- "@alexkroman1/aai": "5.4.0"
25
+ "@alexkroman1/aai": "5.5.0"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "react": "^19.0.0",