@athenaintel/react 0.10.41-rc.1 → 0.10.41-rc.2

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.cjs CHANGED
@@ -45,6 +45,7 @@ const jsxRuntime = require("react/jsx-runtime");
45
45
  const react$1 = require("@assistant-ui/react");
46
46
  const React = require("react");
47
47
  const AthenaAuthContext = require("./AthenaAuthContext-B3AwLA5Z.cjs");
48
+ const localStorage$1 = require("@assistant-ui/react-statewire/local-storage");
48
49
  const tap = require("@assistant-ui/tap");
49
50
  const statewire = require("statewire");
50
51
  require("@assistant-ui/core");
@@ -10876,6 +10877,7 @@ function useDeepAgentThread({
10876
10877
  sse = false,
10877
10878
  headers,
10878
10879
  sessionStore,
10880
+ storage,
10879
10881
  isNewChat = false,
10880
10882
  attachKey,
10881
10883
  suspended = false,
@@ -11043,6 +11045,9 @@ function useDeepAgentThread({
11043
11045
  );
11044
11046
  })()
11045
11047
  ),
11048
+ // Survives the transport remounts above: a bumped attachKey re-attaches the
11049
+ // same lane, and a persistent session storage carries it across reloads.
11050
+ ...storage && { storage },
11046
11051
  // The run subsystem (status, lanes, input requests, runId) is mounted on
11047
11052
  // the state root and always replicated by react-statewire >= 0.14 (the
11048
11053
  // former `runs: true` opt-in is gone) — the converter only maps app-owned
@@ -11280,6 +11285,7 @@ function useAthenaStatewireRuntime(config2) {
11280
11285
  const clientTools = useStatewireClientTools(frontendToolkit);
11281
11286
  const clientToolsRef = React.useRef(clientTools);
11282
11287
  clientToolsRef.current = clientTools;
11288
+ const [canPersistSession] = React.useState(() => typeof localStorage !== "undefined");
11283
11289
  const thread = useDeepAgentThread({
11284
11290
  threadId,
11285
11291
  baseUrl: syncUrl,
@@ -11297,6 +11303,17 @@ function useAthenaStatewireRuntime(config2) {
11297
11303
  // Queued entries render in the SDK's queue panel, so only the steer lane
11298
11304
  // projects into the message tail.
11299
11305
  laneProjection: "steer-only",
11306
+ // Durable session: a reload resumes the lane and resends whatever the
11307
+ // server has not marked durable. Scoped by host — a thread id is only
11308
+ // meaningful against the backend that minted it.
11309
+ ...canPersistSession && {
11310
+ storage: {
11311
+ session: localStorage$1.LocalStorageSession({
11312
+ threadId,
11313
+ key: (id) => `${syncUrl}:${id}`
11314
+ })
11315
+ }
11316
+ },
11300
11317
  capabilities: { edit: true, reload: true, continue: true },
11301
11318
  onConnectionChange,
11302
11319
  onRawConnectionChange,