@truefoundry/assistant-ui-runtime 0.1.2 → 0.1.3-rc.1

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
@@ -3,7 +3,9 @@ import { ExternalStoreSharedOptions, AttachmentAdapter, SpeechSynthesisAdapter,
3
3
  import * as truefoundry_gateway_sdk_agents from 'truefoundry-gateway-sdk/agents';
4
4
  import { AgentSessionClient, TurnEvent, ThreadCreatedEvent, UserToolResponseEvent, McpAuthRequiredEvent, UserToolApprovalEvent, Turn, TurnInputItem, AgentSession } from 'truefoundry-gateway-sdk/agents';
5
5
  export { SandboxCreatedEvent } from 'truefoundry-gateway-sdk/agents';
6
- import { TruefoundryGatewayApi, TrueFoundryGateway } from 'truefoundry-gateway-sdk';
6
+ import { PrivateAgentSessionClient } from 'truefoundry-gateway-sdk/agents/private';
7
+ export { AgentDraftSession, PrivateAgentSessionClient } from 'truefoundry-gateway-sdk/agents/private';
8
+ import { TruefoundryGatewayApi } from 'truefoundry-gateway-sdk';
7
9
  import * as _assistant_ui_core_internal from '@assistant-ui/core/internal';
8
10
 
9
11
  type AgentSpec = TruefoundryGatewayApi.AgentSpec;
@@ -53,8 +55,11 @@ type UseTrueFoundryAgentRuntimeOptions = TrueFoundryAgentRuntimeBaseOptions & {
53
55
  agent?: TrueFoundryAgentConfig | undefined;
54
56
  /** Legacy named-agent shorthand. Prefer `agent: { mode: "named", agentName }`. */
55
57
  agentName?: string | undefined;
56
- /** Required when `agent.mode === "draft"`. */
57
- gateway?: TrueFoundryGateway | undefined;
58
+ /**
59
+ * Required when `agent.mode === "draft"`. Also used for sandbox file downloads
60
+ * (named or draft).
61
+ */
62
+ privateClient?: PrivateAgentSessionClient | undefined;
58
63
  };
59
64
 
60
65
  declare function useTrueFoundryAgentRuntime(options: UseTrueFoundryAgentRuntimeOptions): _assistant_ui_core.AssistantRuntime;
@@ -178,16 +183,24 @@ declare function buildEditedUserMessageContent(editedText: string, originalInput
178
183
  declare function repositoryItemsFromMessages(messages: readonly ThreadMessage[]): ExportedMessageRepositoryItem[];
179
184
 
180
185
  declare function createTrueFoundryDraftThreadListAdapter(options: {
181
- gateway: TrueFoundryGateway;
186
+ privateClient: PrivateAgentSessionClient;
182
187
  defaultAgentSpec: AgentSpec;
183
188
  getAgentSpec?: () => AgentSpec;
184
189
  }): RemoteThreadListAdapter;
185
190
 
191
+ /**
192
+ * Read-only thread-list adapter backed by `PrivateAgentSessionClient.listOwnedSessions`.
193
+ * Returns every session the caller owns (named + draft), newest first.
194
+ */
195
+ declare function createTrueFoundryOwnedSessionsThreadListAdapter(options: {
196
+ privateClient: PrivateAgentSessionClient;
197
+ }): RemoteThreadListAdapter;
198
+
186
199
  type DraftSessionBridge = {
187
200
  syncAgentSpec: (draftSessionId: string, agentSpec: AgentSpec) => Promise<string>;
188
201
  getDraftAgentSpec: (draftSessionId: string) => Promise<AgentSpec>;
189
202
  };
190
- declare function createDraftSessionBridge(gateway: TrueFoundryGateway): DraftSessionBridge;
203
+ declare function createDraftSessionBridge(privateClient: PrivateAgentSessionClient): DraftSessionBridge;
191
204
 
192
205
  type PendingApproval = {
193
206
  approvalId: string;
@@ -297,8 +310,8 @@ declare function createTrueFoundryThreadListAdapter(options: {
297
310
  }): RemoteThreadListAdapter;
298
311
 
299
312
  type GetSessionOptions = {
300
- /** When set, validates the draft and binds turns to `/agents/sessions/{id}/turns`. */
301
- draftGateway?: TrueFoundryGateway;
313
+ /** When set, validates the draft and binds turns via PrivateAgentSessionClient. */
314
+ privateClient?: PrivateAgentSessionClient;
302
315
  };
303
316
  /** `sessionId` is the assistant-ui thread `remoteId` from `RemoteThreadListAdapter.initialize`. */
304
317
  declare function getSession(client: AgentSessionClient, sessionId: string, options?: GetSessionOptions): Promise<AgentSession>;
@@ -309,4 +322,4 @@ declare function getSession(client: AgentSessionClient, sessionId: string, optio
309
322
  */
310
323
  declare const trueFoundryAttachmentAdapter: AttachmentAdapter;
311
324
 
312
- export { type AgentSpec, type AgentSpecUpdate, type ConvertTurnsResult, type DraftAgentConfig, type DraftSession, type DraftSessionBridge, type McpAuthMessageCustomMetadata, type NamedAgentConfig, type PendingApproval, type PendingToolResponse, ROOT_THREAD_ID, type SandboxMessageCustomMetadata, type SubAgentArtifact, type SubAgentCustomMetadata, type SubAgentMessageCustomMetadata, TOOL_RESPONSE_THREAD_ID_CUSTOM_KEY, type ToolApprovalMessageCustomMetadata, type ToolResponseMessageCustomMetadata, type TrueFoundryAgentConfig, type TrueFoundryDraftRuntimeExtras, type TrueFoundryMessageCustomMetadata, type TrueFoundryRuntimeExtras, type UseTrueFoundryAgentRuntimeOptions, type UserMessageContent, buildEditedUserMessageContent, buildTurnAssistantContent, buildUserMessageContent, collectApprovalInputs, collectRequiredActionInputs, collectResponseInputs, convertTurnsToThreadMessages, createDraftSessionBridge, createTrueFoundryDraftThreadListAdapter, createTrueFoundryThreadListAdapter, draftSessionTitle, findPausedAssistantMessage, getSession, getTurnMessageContent, mergeAgentSpec, messageHasPendingApprovals, messageHasPendingRequiredActions, messageHasPendingResponses, parseTurnIdFromMessageId, repositoryItemsFromMessages, toTrueFoundryApprovalInputs, trueFoundryAttachmentAdapter, trueFoundryExtras, useTrueFoundryAgentRuntime, useTrueFoundryAgentSpec, useTrueFoundryApprovals, useTrueFoundryCancel, useTrueFoundryDownloadSandboxFile, useTrueFoundryHistoryPagination, useTrueFoundryMcpAuth, useTrueFoundryReload, useTrueFoundryResetFromTurn, useTrueFoundryRespondToToolApproval, useTrueFoundryRespondToToolResponse, useTrueFoundryResumeMcpAuth, useTrueFoundrySandboxId, useTrueFoundryToolResponses, useTrueFoundryUpdateAgentSpec };
325
+ export { type AgentSpec, type AgentSpecUpdate, type ConvertTurnsResult, type DraftAgentConfig, type DraftSession, type DraftSessionBridge, type McpAuthMessageCustomMetadata, type NamedAgentConfig, type PendingApproval, type PendingToolResponse, ROOT_THREAD_ID, type SandboxMessageCustomMetadata, type SubAgentArtifact, type SubAgentCustomMetadata, type SubAgentMessageCustomMetadata, TOOL_RESPONSE_THREAD_ID_CUSTOM_KEY, type ToolApprovalMessageCustomMetadata, type ToolResponseMessageCustomMetadata, type TrueFoundryAgentConfig, type TrueFoundryDraftRuntimeExtras, type TrueFoundryMessageCustomMetadata, type TrueFoundryRuntimeExtras, type UseTrueFoundryAgentRuntimeOptions, type UserMessageContent, buildEditedUserMessageContent, buildTurnAssistantContent, buildUserMessageContent, collectApprovalInputs, collectRequiredActionInputs, collectResponseInputs, convertTurnsToThreadMessages, createDraftSessionBridge, createTrueFoundryDraftThreadListAdapter, createTrueFoundryOwnedSessionsThreadListAdapter, createTrueFoundryThreadListAdapter, draftSessionTitle, findPausedAssistantMessage, getSession, getTurnMessageContent, mergeAgentSpec, messageHasPendingApprovals, messageHasPendingRequiredActions, messageHasPendingResponses, parseTurnIdFromMessageId, repositoryItemsFromMessages, toTrueFoundryApprovalInputs, trueFoundryAttachmentAdapter, trueFoundryExtras, useTrueFoundryAgentRuntime, useTrueFoundryAgentSpec, useTrueFoundryApprovals, useTrueFoundryCancel, useTrueFoundryDownloadSandboxFile, useTrueFoundryHistoryPagination, useTrueFoundryMcpAuth, useTrueFoundryReload, useTrueFoundryResetFromTurn, useTrueFoundryRespondToToolApproval, useTrueFoundryRespondToToolResponse, useTrueFoundryResumeMcpAuth, useTrueFoundrySandboxId, useTrueFoundryToolResponses, useTrueFoundryUpdateAgentSpec };