@truefoundry/assistant-ui-runtime 0.1.3-rc.3 → 0.1.5

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.js CHANGED
@@ -2051,10 +2051,10 @@ async function buildSnapshotBeforeTurnIndex(session, turnIndex, _concurrency = D
2051
2051
  }
2052
2052
  async function resolveGatewayBranchPreviousTurnId(session, turnIndex, orderedTurns) {
2053
2053
  if (turnIndex <= 0) {
2054
- return null;
2054
+ return "none";
2055
2055
  }
2056
2056
  const turns = orderedTurns ?? await listSessionTurnsOrdered(session);
2057
- return turns[turnIndex - 1]?.id ?? null;
2057
+ return turns[turnIndex - 1]?.id ?? "none";
2058
2058
  }
2059
2059
  async function resolveGatewayBranchPreviousTurnIdForTurn(session, turnId) {
2060
2060
  const turns = await listSessionTurnsOrdered(session);
@@ -2498,7 +2498,7 @@ function createTrueFoundryThreadListAdapter(options) {
2498
2498
  const threads = page.data.map((session) => ({
2499
2499
  status: "regular",
2500
2500
  remoteId: session.id,
2501
- title: session.title,
2501
+ title: session.title ?? void 0,
2502
2502
  lastMessageAt: new Date(session.updatedAt)
2503
2503
  }));
2504
2504
  return {
@@ -2515,7 +2515,7 @@ function createTrueFoundryThreadListAdapter(options) {
2515
2515
  return {
2516
2516
  status: "regular",
2517
2517
  remoteId: session.id,
2518
- title: session.title,
2518
+ title: session.title ?? void 0,
2519
2519
  lastMessageAt: new Date(session.updatedAt)
2520
2520
  };
2521
2521
  },
@@ -2809,7 +2809,6 @@ function findPausedAssistantMessage(messages) {
2809
2809
  }
2810
2810
 
2811
2811
  // src/streamTurn.ts
2812
- import "truefoundry-gateway-sdk/agents";
2813
2812
  function buildTurnInput(options) {
2814
2813
  if (options.inputs != null) {
2815
2814
  return options.inputs;
@@ -2831,10 +2830,9 @@ function bindAbort(session, abortSignal) {
2831
2830
  return onAbort;
2832
2831
  }
2833
2832
  async function* streamTurnContent(session, foldState, options, abortSignal, groupRootBaseline, onTurnIdAvailable) {
2834
- const previousTurnId = options.previousTurnId === null ? null : options.previousTurnId ?? "auto";
2835
2833
  const turn = session.prepareTurn({
2836
2834
  input: buildTurnInput(options),
2837
- ...previousTurnId !== void 0 ? { previousTurnId } : {}
2835
+ previousTurnId: options.previousTurnId ?? "auto"
2838
2836
  });
2839
2837
  const onAbort = bindAbort(session, abortSignal);
2840
2838
  if (abortSignal.aborted) {
@@ -3338,7 +3336,7 @@ function useTrueFoundryAgentMessages({
3338
3336
  snapshotRef.current.fold,
3339
3337
  {
3340
3338
  userMessage: options.userMessage,
3341
- ...options.previousTurnId !== void 0 ? { previousTurnId: options.previousTurnId } : isFirstTurnInSession ? { previousTurnId: null } : {},
3339
+ ...options.previousTurnId !== void 0 ? { previousTurnId: options.previousTurnId } : isFirstTurnInSession ? { previousTurnId: "none" } : {},
3342
3340
  ...streamHeaders
3343
3341
  },
3344
3342
  signal,
@@ -3694,8 +3692,7 @@ function useTrueFoundryAgentRuntimeImpl(options, pendingAgentSpecRef) {
3694
3692
  onError?.(error);
3695
3693
  throw error;
3696
3694
  }
3697
- const gateway = getGatewayFromPrivateClient(privateClient);
3698
- const response = await gateway.agents.downloadSandboxFile(sandboxId, { path });
3695
+ const response = await privateClient.downloadSandboxFile(sandboxId, { path });
3699
3696
  return await response.blob();
3700
3697
  },
3701
3698
  [privateClient, sandboxId, onError]