@truefoundry/assistant-ui-runtime 0.1.10-rc.1 → 0.1.12

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.
Files changed (33) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/dist/{chunk-BRPTG6VA.js → chunk-2NLIAJJX.js} +100 -12
  3. package/dist/chunk-2NLIAJJX.js.map +1 -0
  4. package/dist/index.d.ts +13 -2
  5. package/dist/index.js +70 -66
  6. package/dist/index.js.map +1 -1
  7. package/dist/plugins/truefoundry-agent-server-adapter/index.d.ts +3 -3
  8. package/dist/plugins/truefoundry-agent-server-adapter/index.js +1 -1
  9. package/dist/server/index.d.ts +2 -2
  10. package/dist/{types-CgZUnILu.d.ts → types-CSRQSnHu.d.ts} +148 -80
  11. package/package.json +3 -3
  12. package/src/convertTurnMessages.test.ts +123 -0
  13. package/src/convertTurnMessages.ts +8 -2
  14. package/src/draft/truefoundryDraftThreadListAdapter.test.ts +58 -4
  15. package/src/draft/truefoundryDraftThreadListAdapter.ts +18 -22
  16. package/src/index.ts +27 -0
  17. package/src/plugins/truefoundry-agent-server-adapter/chatServer.ts +1 -1
  18. package/src/plugins/truefoundry-agent-server-adapter/cp.test.ts +169 -6
  19. package/src/plugins/truefoundry-agent-server-adapter/cp.ts +126 -1
  20. package/src/plugins/truefoundry-agent-server-adapter/createTrueFoundryAgentUIServer.ts +7 -0
  21. package/src/plugins/truefoundry-agent-server-adapter/normalizeAgentSpec.test.ts +34 -0
  22. package/src/plugins/truefoundry-agent-server-adapter/normalizeAgentSpec.ts +12 -5
  23. package/src/plugins/truefoundry-agent-server-adapter/types.ts +2 -2
  24. package/src/server/index.ts +15 -0
  25. package/src/server/types.ts +448 -381
  26. package/src/sessionThreadMetadata.ts +42 -0
  27. package/src/truefoundryOwnedSessionsThreadListAdapter.test.ts +17 -0
  28. package/src/truefoundryOwnedSessionsThreadListAdapter.ts +13 -25
  29. package/src/truefoundryThreadListAdapter.test.ts +17 -9
  30. package/src/truefoundryThreadListAdapter.ts +9 -14
  31. package/src/types.ts +5 -0
  32. package/src/useTrueFoundryAgentRuntime.ts +4 -1
  33. package/dist/chunk-BRPTG6VA.js.map +0 -1
@@ -7,10 +7,10 @@
7
7
  */
8
8
 
9
9
  import type {
10
- ActionRequiredEvent,
11
- SessionEventItem,
12
- TurnEvent,
13
- TurnStreamData
10
+ ActionRequiredEvent,
11
+ SessionEventItem,
12
+ TurnEvent,
13
+ TurnStreamData
14
14
  } from "./events.js";
15
15
 
16
16
  // ---------------------------------------------------------------------------
@@ -19,34 +19,44 @@ import type {
19
19
 
20
20
  /** Model selector row. Host extends for apiModel, modelId, pricing, etc. */
21
21
  export interface ModelSelectorEntry {
22
- name: string;
23
- provider: string;
24
- reasoningEfforts?: string[];
22
+ name: string;
23
+ provider: string;
24
+ reasoningEfforts?: string[];
25
+ /** Provider logo URL from the model catalog; selector falls back to a monogram when omitted. */
26
+ providerLogo?: string;
25
27
  }
26
28
 
27
29
  /** Skill selector row. Host extends for fqn, preload, etc. */
28
30
  export interface SkillSelectorEntry {
29
- id: string;
30
- name: string;
31
- description?: string;
31
+ id: string;
32
+ name: string;
33
+ description?: string;
32
34
  }
33
35
 
34
36
  /** MCP connector selector row. Host extends for type, enableTools, url, etc. */
35
37
  export interface ConnectorSelectorEntry {
36
- id: string;
37
- name: string;
38
- description?: string;
38
+ id: string;
39
+ name: string;
40
+ description?: string;
41
+ /** When true, the connector must be authenticated before use. Omitted when the host does not report auth. */
42
+ requiresAuth?: boolean;
43
+ /** When true, the connector is already authenticated. Omitted when the host does not report auth. */
44
+ authenticated?: boolean;
39
45
  }
40
46
 
41
- /** Agent selector row — UI shows name only. Host extends for metadata. */
47
+ /** Agent selector row. Host extends for metadata; `agentSpec` enables Edit. */
42
48
  export interface AgentSelectorEntry {
43
- name: string;
49
+ name: string;
50
+ /** Stable id when distinct from display `name`. Falls back to `name` when omitted. */
51
+ agentId?: string;
52
+ /** Published agent spec — required for Edit; optional for Try-only hosts. */
53
+ agentSpec?: AgentSpec;
44
54
  }
45
55
 
46
56
  export type SearchAgentSelectorParams = {
47
- query?: string;
48
- limit?: number;
49
- offset?: number;
57
+ query?: string;
58
+ limit?: number;
59
+ offset?: number;
50
60
  };
51
61
 
52
62
  // ---------------------------------------------------------------------------
@@ -54,19 +64,19 @@ export type SearchAgentSelectorParams = {
54
64
  // ---------------------------------------------------------------------------
55
65
 
56
66
  /**
57
- * Mounts written to AgentSpec.skills[] / AgentSpec.mcpServers[].
58
- *
59
- * These are opaque to the runtime — it stores and forwards them but never reads
60
- * a field, and the backend owns the shape (the gateway identifies a skill by
61
- * `fqn`, with no `id` or `name` anywhere). So the base constrains only that a
62
- * mount is an object; hosts intersect their concrete mount type over it, as
63
- * `TfySkillMount` / `TfyMcpServerMount` do in the gateway adapter.
64
- *
65
- * Naming a field here would not just be unread, it would be wrong: a base with
66
- * required fields rejects the backend's own payloads, and one with only optional
67
- * fields is a weak type, which TypeScript rejects for a source that shares no
68
- * property with it — the gateway's registry skill shares none.
69
- */
67
+ * Mounts written to AgentSpec.skills[] / AgentSpec.mcpServers[].
68
+ *
69
+ * These are opaque to the runtime — it stores and forwards them but never reads
70
+ * a field, and the backend owns the shape (the gateway identifies a skill by
71
+ * `fqn`, with no `id` or `name` anywhere). So the base constrains only that a
72
+ * mount is an object; hosts intersect their concrete mount type over it, as
73
+ * `TfySkillMount` / `TfyMcpServerMount` do in the gateway adapter.
74
+ *
75
+ * Naming a field here would not just be unread, it would be wrong: a base with
76
+ * required fields rejects the backend's own payloads, and one with only optional
77
+ * fields is a weak type, which TypeScript rejects for a source that shares no
78
+ * property with it — the gateway's registry skill shares none.
79
+ */
70
80
  export type SkillMount = object;
71
81
 
72
82
  export type McpServerMount = object;
@@ -76,30 +86,30 @@ export type McpServerMount = object;
76
86
  // ---------------------------------------------------------------------------
77
87
 
78
88
  export interface ModelParams {
79
- maxTokens?: number;
80
- reasoningEffort?: string;
89
+ maxTokens?: number;
90
+ reasoningEffort?: string;
81
91
  }
82
92
 
83
93
  export interface Model {
84
- name: string;
85
- params?: ModelParams;
94
+ name: string;
95
+ params?: ModelParams;
86
96
  }
87
97
 
88
98
  /**
89
- * SDK-owned agent definition — fields the FE reads/writes.
90
- * Host widens `model` / `skills` / `mcpServers` via type params, and adds
91
- * extra fields via `TSpec extends AgentSpec<...>`.
92
- */
99
+ * SDK-owned agent definition — fields the FE reads/writes.
100
+ * Host widens `model` / `skills` / `mcpServers` via type params, and adds
101
+ * extra fields via `TSpec extends AgentSpec<...>`.
102
+ */
93
103
  export interface AgentSpec<
94
- TModel extends Model = Model,
95
- TSkill extends SkillMount = SkillMount,
96
- TMcp extends McpServerMount = McpServerMount,
104
+ TModel extends Model = Model,
105
+ TSkill extends SkillMount = SkillMount,
106
+ TMcp extends McpServerMount = McpServerMount,
97
107
  > {
98
- model: TModel;
99
- skills?: TSkill[];
100
- mcpServers?: TMcp[];
101
- instructions?: string;
102
- variables?: Record<string, string>;
108
+ model: TModel;
109
+ skills?: TSkill[];
110
+ mcpServers?: TMcp[];
111
+ instructions?: string;
112
+ variables?: Record<string, string>;
103
113
  }
104
114
 
105
115
  // ---------------------------------------------------------------------------
@@ -107,26 +117,26 @@ export interface AgentSpec<
107
117
  // ---------------------------------------------------------------------------
108
118
 
109
119
  export interface Session<TSpec extends AgentSpec = AgentSpec> {
110
- id: string;
111
- title?: string | null;
112
- agentName?: string | null;
113
- agentSpec?: TSpec;
114
- /** true → mutable builder + updateSession(spec) allowed. */
115
- isMutable: boolean;
116
- createdAt: string;
117
- updatedAt: string;
120
+ id: string;
121
+ title?: string | null;
122
+ agentName?: string | null;
123
+ agentSpec?: TSpec;
124
+ /** true → mutable builder + updateSession(spec) allowed. */
125
+ isMutable: boolean;
126
+ createdAt: string;
127
+ updatedAt: string;
118
128
  }
119
129
 
120
130
  export interface CreateSessionRequest<TSpec extends AgentSpec = AgentSpec> {
121
- agentName?: string;
122
- agentSpec?: TSpec;
123
- title?: string;
131
+ agentName?: string;
132
+ agentSpec?: TSpec;
133
+ title?: string;
124
134
  }
125
135
 
126
136
  export interface UpdateSessionRequest<TSpec extends AgentSpec = AgentSpec> {
127
- sessionId: string;
128
- agentSpec?: TSpec;
129
- title?: string;
137
+ sessionId: string;
138
+ agentSpec?: TSpec;
139
+ title?: string;
130
140
  }
131
141
 
132
142
  // ---------------------------------------------------------------------------
@@ -134,97 +144,98 @@ export interface UpdateSessionRequest<TSpec extends AgentSpec = AgentSpec> {
134
144
  // ---------------------------------------------------------------------------
135
145
 
136
146
  export interface ListResult<T> {
137
- data: T[];
138
- nextPageToken?: string;
147
+ data: T[];
148
+ nextPageToken?: string;
139
149
  }
140
150
 
141
151
  export type ListSessionsOrder = "asc" | "desc";
142
152
 
143
153
  export type PageParams = {
144
- limit?: number;
145
- order?: ListSessionsOrder;
146
- pageToken?: string;
154
+ limit?: number;
155
+ order?: ListSessionsOrder;
156
+ pageToken?: string;
147
157
  };
148
158
 
149
159
  export interface ListSessionsParams extends PageParams {
150
- agentName?: string;
151
- /** Host-specific filter (e.g. TFY startTimestamp). */
152
- startTimestamp?: string;
160
+ /** Host-owned agent identity filter. Hosts that key agents by name pass that name here. */
161
+ agentId?: string;
162
+ /** Host-specific filter (e.g. TFY startTimestamp). */
163
+ startTimestamp?: string;
153
164
  }
154
165
 
155
- export type PreviousTurnIdInput = "auto" | string;
166
+ export type PreviousTurnIdInput = "auto" | "none" | string;
156
167
 
157
168
  // ---------------------------------------------------------------------------
158
169
  // Turn input / state — what runtime sends and reads
159
170
  // ---------------------------------------------------------------------------
160
171
 
161
172
  export type UserMessageContent =
162
- | string
163
- | Array<{ type: "text"; text: string } | { type: "file"; name: string; data: string }>;
173
+ | string
174
+ | Array<{ type: "text"; text: string } | { type: "file"; name: string; data: string }>;
164
175
 
165
176
  export interface UserMessage {
166
- type: "user.message";
167
- content: UserMessageContent;
177
+ type: "user.message";
178
+ content: UserMessageContent;
168
179
  }
169
180
 
170
181
  export type ApprovalDecision =
171
- | { status: "allow" }
172
- | { status: "deny"; reason?: string };
182
+ | { status: "allow" }
183
+ | { status: "deny"; reason?: string };
173
184
 
174
185
  export interface UserToolApprovalEvent {
175
- type: "user.tool_approval";
176
- threadId: string;
177
- toolCallId: string;
178
- approval: ApprovalDecision;
186
+ type: "user.tool_approval";
187
+ threadId: string;
188
+ toolCallId: string;
189
+ approval: ApprovalDecision;
179
190
  }
180
191
 
181
192
  export interface UserToolResponseEvent {
182
- type: "user.tool_response";
183
- threadId: string;
184
- toolCallId: string;
185
- content: string;
193
+ type: "user.tool_response";
194
+ threadId: string;
195
+ toolCallId: string;
196
+ content: string;
186
197
  }
187
198
 
188
199
  export type TurnInputItem =
189
- | UserMessage
190
- | UserToolApprovalEvent
191
- | UserToolResponseEvent;
200
+ | UserMessage
201
+ | UserToolApprovalEvent
202
+ | UserToolResponseEvent;
192
203
 
193
204
  export type TurnStateRunning = { status: "running" };
194
205
 
195
206
  export type TurnStateDone = {
196
- status: "done";
197
- output?: unknown;
198
- requiredActions?: ActionRequiredEvent[];
199
- completedAt: string;
207
+ status: "done";
208
+ output?: unknown;
209
+ requiredActions?: ActionRequiredEvent[];
210
+ completedAt: string;
200
211
  };
201
212
 
202
213
  export type TurnStateCancelled = {
203
- status: "cancelled";
204
- reason: string;
205
- completedAt: string;
214
+ status: "cancelled";
215
+ reason: string;
216
+ completedAt: string;
206
217
  };
207
218
 
208
219
  export type TurnStateError = {
209
- status: "error";
210
- message: string;
211
- completedAt: string;
220
+ status: "error";
221
+ message: string;
222
+ completedAt: string;
212
223
  };
213
224
 
214
225
  export type TurnState =
215
- | TurnStateRunning
216
- | TurnStateDone
217
- | TurnStateCancelled
218
- | TurnStateError;
226
+ | TurnStateRunning
227
+ | TurnStateDone
228
+ | TurnStateCancelled
229
+ | TurnStateError;
219
230
 
220
231
  /** Plain turn DTO — no methods. */
221
232
  export interface Turn {
222
- id: string;
223
- sessionId: string;
224
- previousTurnId?: string | null;
225
- input?: TurnInputItem[];
226
- state: TurnState;
227
- createdAt: string;
233
+ id: string;
234
+ sessionId: string;
235
+ previousTurnId?: string | null;
236
+ input?: TurnInputItem[];
237
+ state: TurnState;
238
+ createdAt: string;
228
239
  }
229
240
 
230
241
  // ---------------------------------------------------------------------------
@@ -232,99 +243,115 @@ export interface Turn {
232
243
  // ---------------------------------------------------------------------------
233
244
 
234
245
  /**
235
- * Chat / session port — the runtime calls these.
236
- *
237
- * All session ops are flat (sessionId param). No gateway client dependency.
238
- * `createTrueFoundryServer` is one possible implementation (TFY adapter).
239
- */
246
+ * Chat / session port — the runtime calls these.
247
+ *
248
+ * All session ops are flat (sessionId param). No gateway client dependency.
249
+ * `createTrueFoundryServer` is one possible implementation (TFY adapter).
250
+ */
240
251
  export interface AgentChatServer<
241
- TSpec extends AgentSpec = AgentSpec,
242
- TSession extends Session<TSpec> = Session<TSpec>,
243
- TCreate extends CreateSessionRequest<TSpec> = CreateSessionRequest<TSpec>,
244
- TList extends ListSessionsParams = ListSessionsParams,
245
- TUpdate extends UpdateSessionRequest<TSpec> = UpdateSessionRequest<TSpec>,
246
- TTurn extends Turn = Turn,
252
+ TSpec extends AgentSpec = AgentSpec,
253
+ TSession extends Session<TSpec> = Session<TSpec>,
254
+ TCreate extends CreateSessionRequest<TSpec> = CreateSessionRequest<TSpec>,
255
+ TList extends ListSessionsParams = ListSessionsParams,
256
+ TUpdate extends UpdateSessionRequest<TSpec> = UpdateSessionRequest<TSpec>,
257
+ TTurn extends Turn = Turn,
247
258
  > {
248
- createSession(req: TCreate): Promise<TSession>;
249
- listSessions(req?: TList): Promise<ListResult<TSession>>;
250
- getSession(req: { sessionId: string }): Promise<TSession>;
251
- updateSession(req: TUpdate): Promise<TSession>;
252
-
253
- createTurn(req: {
254
- sessionId: string;
255
- input?: TurnInputItem[];
256
- previousTurnId?: PreviousTurnIdInput;
257
- abortSignal?: AbortSignal;
258
- headers?: Record<string, string>;
259
- }): AsyncIterable<TurnStreamData>;
260
-
261
- cancelSession(req: { sessionId: string }): Promise<void>;
262
- deleteSession?(req: { sessionId: string }): Promise<void>;
263
-
264
- listTurns(req: {
265
- sessionId: string;
266
- limit?: number;
267
- pageToken?: string;
268
- order?: ListSessionsOrder;
269
- }): Promise<ListResult<TTurn>>;
270
- getTurn(req: { sessionId: string; turnId: string }): Promise<TTurn>;
271
- listEvents(req: {
272
- sessionId: string;
273
- pageToken?: string;
274
- lastTurnId?: string;
275
- limit?: number;
276
- }): Promise<ListResult<SessionEventItem>>;
277
-
278
- /** Optional per-turn event listing (hydrate in-flight turn content). */
279
- listTurnEvents?(req: {
280
- sessionId: string;
281
- turnId: string;
282
- limit?: number;
283
- pageToken?: string;
284
- order?: ListSessionsOrder;
285
- }): Promise<ListResult<TurnEvent>>;
286
-
287
- subscribeToTurn?(req: {
288
- sessionId: string;
289
- turnId: string;
290
- afterSequenceNumber?: number;
291
- abortSignal?: AbortSignal;
292
- }): AsyncIterable<TurnStreamData>;
293
-
294
- /**
295
- * Reads a file the agent wrote inside its sandbox. Hosts whose download route is scoped to a
296
- * turn resolve the sandbox from `turnId` and ignore `sandboxId`; hosts addressing sandboxes
297
- * directly use `sandboxId`.
298
- */
299
- downloadSandboxFile?(req: {
300
- sessionId: string;
301
- turnId: string;
302
- sandboxId: string;
303
- path: string;
304
- }): Promise<Blob>;
259
+ createSession(req: TCreate): Promise<TSession>;
260
+ listSessions(req?: TList): Promise<ListResult<TSession>>;
261
+ getSession(req: { sessionId: string }): Promise<TSession>;
262
+ updateSession(req: TUpdate): Promise<TSession>;
263
+
264
+ createTurn(req: {
265
+ sessionId: string;
266
+ input?: TurnInputItem[];
267
+ previousTurnId?: PreviousTurnIdInput;
268
+ abortSignal?: AbortSignal;
269
+ headers?: Record<string, string>;
270
+ }): AsyncIterable<TurnStreamData>;
271
+
272
+ cancelSession(req: { sessionId: string }): Promise<void>;
273
+ deleteSession?(req: { sessionId: string }): Promise<void>;
274
+
275
+ listTurns(req: {
276
+ sessionId: string;
277
+ limit?: number;
278
+ pageToken?: string;
279
+ order?: ListSessionsOrder;
280
+ }): Promise<ListResult<TTurn>>;
281
+ getTurn(req: { sessionId: string; turnId: string }): Promise<TTurn>;
282
+ listEvents(req: {
283
+ sessionId: string;
284
+ pageToken?: string;
285
+ lastTurnId?: string;
286
+ limit?: number;
287
+ }): Promise<ListResult<SessionEventItem>>;
288
+
289
+ /** Optional per-turn event listing (hydrate in-flight turn content). */
290
+ listTurnEvents?(req: {
291
+ sessionId: string;
292
+ turnId: string;
293
+ limit?: number;
294
+ pageToken?: string;
295
+ order?: ListSessionsOrder;
296
+ }): Promise<ListResult<TurnEvent>>;
297
+
298
+ subscribeToTurn?(req: {
299
+ sessionId: string;
300
+ turnId: string;
301
+ afterSequenceNumber?: number;
302
+ abortSignal?: AbortSignal;
303
+ }): AsyncIterable<TurnStreamData>;
304
+
305
+ /**
306
+ * Reads a file the agent wrote inside its sandbox. Hosts whose download route is scoped to a
307
+ * turn resolve the sandbox from `turnId` and ignore `sandboxId`; hosts addressing sandboxes
308
+ * directly use `sandboxId`.
309
+ */
310
+ downloadSandboxFile?(req: {
311
+ sessionId: string;
312
+ turnId: string;
313
+ sandboxId: string;
314
+ path: string;
315
+ }): Promise<Blob>;
316
+ }
317
+
318
+ /** Request body for `AgentBuilderServer.saveAgent`. */
319
+ export interface SaveAgentRequest<TSpec extends AgentSpec = AgentSpec> {
320
+ agentName: string;
321
+ agentSpec: TSpec;
305
322
  }
306
323
 
307
324
  /**
308
- * Builder catalog + persist port — atoms call these.
309
- * Passed separately from the runtime's chat server.
325
+ * Builder feature flags — atoms gate sandbox / skill / settings surfaces on these.
310
326
  */
327
+ export interface AgentBuilderCapabilitiesResponse {
328
+ data: {
329
+ sandbox: { enabled: boolean };
330
+ skill: { enabled: boolean; reason?: string };
331
+ settings?: { enabled: boolean };
332
+ };
333
+ }
334
+
335
+ /**
336
+ * Builder catalog + persist port — atoms call these.
337
+ * Passed separately from the runtime's chat server.
338
+ */
311
339
  export interface AgentBuilderServer<
312
- TSpec extends AgentSpec = AgentSpec,
313
- TModel extends ModelSelectorEntry = ModelSelectorEntry,
314
- TSkill extends SkillSelectorEntry = SkillSelectorEntry,
315
- TMcp extends ConnectorSelectorEntry = ConnectorSelectorEntry,
316
- TAgent extends AgentSelectorEntry = AgentSelectorEntry,
317
- TSave = unknown,
340
+ TSpec extends AgentSpec = AgentSpec,
341
+ TModel extends ModelSelectorEntry = ModelSelectorEntry,
342
+ TSkill extends SkillSelectorEntry = SkillSelectorEntry,
343
+ TMcp extends ConnectorSelectorEntry = ConnectorSelectorEntry,
344
+ TAgent extends AgentSelectorEntry = AgentSelectorEntry,
345
+ TSave = unknown,
346
+ TCapabilities extends AgentBuilderCapabilitiesResponse = AgentBuilderCapabilitiesResponse,
318
347
  > {
319
- getModels(): Promise<TModel[]>;
320
- getSkills(): Promise<TSkill[]>;
321
- getMcp(): Promise<TMcp[]>;
322
- searchAgents(req?: SearchAgentSelectorParams): Promise<TAgent[]>;
323
- saveAgent(req: {
324
- agentName: string;
325
- agentSpec: TSpec;
326
- }): Promise<TSave>;
327
- deleteAgent?(req: { agentName: string }): Promise<void>;
348
+ getCapabilities(): Promise<TCapabilities>;
349
+ getModels(): Promise<TModel[]>;
350
+ getSkills(): Promise<TSkill[]>;
351
+ getMcp(): Promise<TMcp[]>;
352
+ searchAgents(req?: SearchAgentSelectorParams): Promise<TAgent[]>;
353
+ saveAgent(req: SaveAgentRequest<TSpec>): Promise<TSave>;
354
+ deleteAgent?(req: { agentName: string }): Promise<void>;
328
355
  }
329
356
 
330
357
  // ---------------------------------------------------------------------------
@@ -332,88 +359,90 @@ export interface AgentBuilderServer<
332
359
  // ---------------------------------------------------------------------------
333
360
 
334
361
  /**
335
- * Provider type id. Reserved literal: `"custom"` for user-defined providers;
336
- * any other string is a builtin (e.g. `"openai"`, `"anthropic"`).
337
- *
338
- * Note: `string | "custom"` is useless in TypeScript (`"custom"` ⊆ `string`),
339
- * so this stays `string` and `"custom"` is a documented convention.
340
- */
362
+ * Provider type id. Reserved literal: `"custom"` for user-defined providers;
363
+ * any other string is a builtin (e.g. `"openai"`, `"anthropic"`).
364
+ *
365
+ * Note: `string | "custom"` is useless in TypeScript (`"custom"` ⊆ `string`),
366
+ * so this stays `string` and `"custom"` is a documented convention.
367
+ */
341
368
  export type ProviderType = string;
342
369
 
343
370
  /**
344
- * Model row — form "Model ID" + "Display name".
345
- * Host extends for properties, etc.
346
- */
371
+ * Model row — form "Model ID" + "Display name".
372
+ * Host extends for properties, etc.
373
+ */
347
374
  export interface ModelEntry {
348
- id: string;
349
- name: string;
375
+ id: string;
376
+ name: string;
350
377
  }
351
378
 
352
379
  /**
353
- * Write config for create/update (custom form + catalog "Save key").
354
- * Host extends. `baseUrl` present iff `type === "custom"`.
355
- */
380
+ * Write config for create/update (custom form + catalog "Save key").
381
+ * Host extends. `baseUrl` present iff `type === "custom"`.
382
+ */
356
383
  export interface ModelProviderConfigBase<TModel extends ModelEntry = ModelEntry> {
357
- type: ProviderType;
358
- name: string;
359
- /** Present iff `type === "custom"`. */
360
- baseUrl?: string;
361
- apiKey: string;
362
- models: TModel[];
384
+ type: ProviderType;
385
+ name: string;
386
+ /** Present iff `type === "custom"`. */
387
+ baseUrl?: string;
388
+ apiKey: string;
389
+ models: TModel[];
363
390
  }
364
391
 
365
392
  /**
366
- * Configured provider card (list/read). No raw `apiKey`.
367
- * Host extends for apiKeySet, timestamps, etc.
368
- */
393
+ * Configured provider card (list/read). No raw `apiKey`.
394
+ * Host extends for apiKeySet, timestamps, etc.
395
+ */
369
396
  export interface ModelProviderBase<TModel extends ModelEntry = ModelEntry> {
370
- id: string;
371
- type: ProviderType;
372
- name: string;
373
- /** Present iff `type === "custom"`. */
374
- baseUrl?: string;
375
- models: TModel[];
397
+ id: string;
398
+ type: ProviderType;
399
+ name: string;
400
+ /** Present iff `type === "custom"`. */
401
+ baseUrl?: string;
402
+ models: TModel[];
376
403
  }
377
404
 
378
405
  /**
379
- * Discovery-only catalog provider (AVAILABLE list).
380
- * `type` must not be `"custom"` — custom providers use the custom form.
381
- * Host extends for richer model rows.
382
- */
406
+ * Discovery-only catalog provider (AVAILABLE list).
407
+ * `type` must not be `"custom"` — custom providers use the custom form.
408
+ * Host extends for richer model rows.
409
+ */
383
410
  export interface ModelProviderCatalogEntry<TModel extends ModelEntry = ModelEntry> {
384
- type: ProviderType;
385
- name: string;
386
- models: TModel[];
411
+ type: ProviderType;
412
+ name: string;
413
+ models: TModel[];
414
+ supportedReasoningEfforts?: string[];
415
+ logo?: string;
387
416
  }
388
417
 
389
418
  /** Create — no `id`; server assigns it. Catalog path = entry + apiKey. */
390
419
  export type CreateModelProviderRequest<TModel extends ModelEntry = ModelEntry> =
391
- ModelProviderConfigBase<TModel>;
420
+ ModelProviderConfigBase<TModel>;
392
421
 
393
422
  /** Update — `id` required. */
394
423
  export type UpdateModelProviderRequest<TModel extends ModelEntry = ModelEntry> =
395
- ModelProviderConfigBase<TModel> & { id: string };
424
+ ModelProviderConfigBase<TModel> & { id: string };
396
425
 
397
426
  export interface ModelCatalogServer<
398
- TModel extends ModelEntry = ModelEntry,
399
- TProvider extends ModelProviderBase<TModel> = ModelProviderBase<TModel>,
400
- TCatalogProvider extends ModelProviderCatalogEntry<TModel> = ModelProviderCatalogEntry<TModel>,
401
- TCreate extends CreateModelProviderRequest<TModel> = CreateModelProviderRequest<TModel>,
402
- TUpdate extends UpdateModelProviderRequest<TModel> = UpdateModelProviderRequest<TModel>,
427
+ TModel extends ModelEntry = ModelEntry,
428
+ TProvider extends ModelProviderBase<TModel> = ModelProviderBase<TModel>,
429
+ TCatalogProvider extends ModelProviderCatalogEntry<TModel> = ModelProviderCatalogEntry<TModel>,
430
+ TCreate extends CreateModelProviderRequest<TModel> = CreateModelProviderRequest<TModel>,
431
+ TUpdate extends UpdateModelProviderRequest<TModel> = UpdateModelProviderRequest<TModel>,
403
432
  > {
404
- getModelProviderCatalog(): Promise<TCatalogProvider[]>;
405
- listModelProviders(): Promise<TProvider[]>;
406
- createModelProvider(req: TCreate): Promise<TProvider>;
407
- /** Full replace update keyed by provider `id`. */
408
- updateModelProvider(req: TUpdate): Promise<TProvider>;
409
- deleteModelProvider?(req: { id: string }): Promise<void>;
433
+ getModelProviderCatalog(): Promise<TCatalogProvider[]>;
434
+ listModelProviders(): Promise<TProvider[]>;
435
+ createModelProvider(req: TCreate): Promise<TProvider>;
436
+ /** Full replace update keyed by provider `id`. */
437
+ updateModelProvider(req: TUpdate): Promise<TProvider>;
438
+ deleteModelProvider?(req: { id: string }): Promise<void>;
410
439
  }
411
440
 
412
441
  /** Tool row on a connector detail. Host extends for schemas, etc. */
413
442
  export interface ToolBase {
414
- id: string;
415
- name: string;
416
- description: string;
443
+ id: string;
444
+ name: string;
445
+ description: string;
417
446
  }
418
447
 
419
448
  /** Strict auth type id. Hosts widen branches via intersection + re-union. */
@@ -422,105 +451,121 @@ export type ConnectorAuthType = "dcr" | "header" | "none";
422
451
  // Write (create/update) — export branches so hosts can intersect extras
423
452
  export type ConnectorAuthOAuth = { type: "dcr"; authUrl?: string };
424
453
  export type ConnectorAuthApiKey = {
425
- type: "header";
426
- apiKey?: string;
427
- headerName?: string;
454
+ type: "header";
455
+ apiKey?: string;
456
+ headerName?: string;
428
457
  };
429
458
  export type ConnectorAuthNone = { type: "none" };
430
459
  export type ConnectorAuth =
431
- | ConnectorAuthOAuth
432
- | ConnectorAuthApiKey
433
- | ConnectorAuthNone;
460
+ | ConnectorAuthOAuth
461
+ | ConnectorAuthApiKey
462
+ | ConnectorAuthNone;
434
463
 
435
- // Public (list/detail) — no secrets; dcr requires authUrl
436
- export type ConnectorAuthPublicOAuth = { type: "dcr"; authUrl: string };
464
+ // Public (list/detail) — no secrets
465
+ export type ConnectorAuthPublicOAuth = { type: "dcr"; authUrl?: string };
437
466
  export type ConnectorAuthPublicApiKey = {
438
- type: "header";
439
- headerName?: string;
467
+ type: "header";
468
+ headerName?: string;
440
469
  };
441
470
  export type ConnectorAuthPublicNone = { type: "none" };
442
471
  export type ConnectorAuthPublic =
443
- | ConnectorAuthPublicOAuth
444
- | ConnectorAuthPublicApiKey
445
- | ConnectorAuthPublicNone;
472
+ | ConnectorAuthPublicOAuth
473
+ | ConnectorAuthPublicApiKey
474
+ | ConnectorAuthPublicNone;
446
475
 
447
476
  /**
448
- * MCP / connector create-edit config. Host extends for extra fields, etc.
449
- */
477
+ * MCP / connector create-edit config. Host extends for extra fields, etc.
478
+ */
450
479
  export interface ConnectorConfigBase<
451
- TAuth extends ConnectorAuth = ConnectorAuth,
480
+ TAuth extends ConnectorAuth = ConnectorAuth,
452
481
  > {
453
- name: string;
454
- url: string;
455
- auth: TAuth;
482
+ name: string;
483
+ url: string;
484
+ auth: TAuth;
456
485
  }
457
486
 
458
487
  /**
459
- * Connected connector row (settings/connectors). No raw `apiKey`.
488
+ * Connected connector row (settings/connectors). No raw `apiKey` or tools.
489
+ * Tools are fetched separately with `getToolsByConnectorId`.
460
490
  * Host extends.
461
491
  */
462
492
  export interface ConnectorBase<
463
- TTool extends ToolBase = ToolBase,
464
- TAuth extends ConnectorAuthPublic = ConnectorAuthPublic,
493
+ TAuth extends ConnectorAuthPublic = ConnectorAuthPublic,
465
494
  > {
466
- id: string;
467
- name: string;
468
- description: string;
469
- url: string;
470
- auth: TAuth;
471
- /** When true, UI should not show Disconnect. */
472
- requiresAuth: boolean;
473
- authenticated: boolean;
474
- tools: TTool[];
495
+ id: string;
496
+ name: string;
497
+ description: string;
498
+ url: string;
499
+ auth: TAuth;
500
+ /** When true, UI should not show Disconnect. */
501
+ requiresAuth: boolean;
502
+ authenticated: boolean;
475
503
  }
476
504
 
477
505
  /** Discovery catalog entry for "+ Add MCP server". Host extends. */
478
506
  export interface ConnectorCatalogEntry<
479
- TAuth extends ConnectorAuthPublic = ConnectorAuthPublic,
507
+ TAuth extends ConnectorAuthPublic = ConnectorAuthPublic,
480
508
  > {
481
- id: string;
482
- name: string;
483
- description?: string;
484
- url: string;
485
- auth: TAuth;
509
+ id: string;
510
+ name: string;
511
+ description?: string;
512
+ url: string;
513
+ auth: TAuth;
514
+ logo?: string;
486
515
  }
487
516
 
488
517
  /** Create connector — no `id`; server assigns it. Host extends. */
489
518
  export type CreateConnectorRequest<TAuth extends ConnectorAuth = ConnectorAuth> =
490
- ConnectorConfigBase<TAuth>;
519
+ ConnectorConfigBase<TAuth>;
491
520
 
492
521
  /** Update connector — `id` required. Host extends. */
493
522
  export type UpdateConnectorRequest<TAuth extends ConnectorAuth = ConnectorAuth> =
494
- ConnectorConfigBase<TAuth> & { id: string };
523
+ ConnectorConfigBase<TAuth> & { id: string };
524
+
525
+ export interface AuthenticateConnectorRequest {
526
+ id: string;
527
+ /** OAuth callback page owned by the host application. */
528
+ redirectURL?: string;
529
+ }
530
+
531
+ export interface ConnectorAuthenticationResult<
532
+ TConnector extends ConnectorBase = ConnectorBase,
533
+ > {
534
+ connector?: TConnector;
535
+ status?: string;
536
+ authorization_endpoint?: string | undefined;
537
+ }
495
538
 
496
539
  export interface ConnectorCatalogServer<
497
- TTool extends ToolBase = ToolBase,
498
- TAuthWrite extends ConnectorAuth = ConnectorAuth,
499
- TAuthPublic extends ConnectorAuthPublic = ConnectorAuthPublic,
500
- TConnector extends ConnectorBase<TTool, TAuthPublic> = ConnectorBase<
501
- TTool,
502
- TAuthPublic
503
- >,
504
- TCatalogEntry extends ConnectorCatalogEntry<TAuthPublic> =
505
- ConnectorCatalogEntry<TAuthPublic>,
506
- TCreate extends CreateConnectorRequest<TAuthWrite> =
507
- CreateConnectorRequest<TAuthWrite>,
508
- TUpdate extends UpdateConnectorRequest<TAuthWrite> =
509
- UpdateConnectorRequest<TAuthWrite>,
540
+ TTool extends ToolBase = ToolBase,
541
+ TAuthWrite extends ConnectorAuth = ConnectorAuth,
542
+ TAuthPublic extends ConnectorAuthPublic = ConnectorAuthPublic,
543
+ TConnector extends ConnectorBase<TAuthPublic> = ConnectorBase<TAuthPublic>,
544
+ TCatalogEntry extends ConnectorCatalogEntry<TAuthPublic> =
545
+ ConnectorCatalogEntry<TAuthPublic>,
546
+ TCreate extends CreateConnectorRequest<TAuthWrite> =
547
+ CreateConnectorRequest<TAuthWrite>,
548
+ TUpdate extends UpdateConnectorRequest<TAuthWrite> =
549
+ UpdateConnectorRequest<TAuthWrite>,
510
550
  > {
511
- getConnectorCatalog(): Promise<TCatalogEntry[]>;
512
- listConnectors(req?: { query?: string }): Promise<TConnector[]>;
513
- createConnector(req: TCreate): Promise<TConnector>;
514
- /** Full replace update keyed by connector `id`. */
515
- updateConnector(req: TUpdate): Promise<TConnector>;
516
- /**
517
- * Start connector auth (e.g. OAuth).
518
- * For oauth, the returned connector's `auth.authUrl` is the authorize URL.
519
- */
520
- authenticateConnector(req: { id: string }): Promise<TConnector>;
521
- /** Clear connector auth. */
522
- disconnectConnector(req: { id: string }): Promise<TConnector>;
523
- deleteConnector?(req: { id: string }): Promise<void>;
551
+ getConnectorCatalog(): Promise<TCatalogEntry[]>;
552
+ getConnector(req: { id: string }): Promise<TConnector>;
553
+ listConnectors(req?: { query?: string }): Promise<TConnector[]>;
554
+ getToolsByConnectorId(req: { id: string }): Promise<TTool[]>;
555
+ createConnector(req: TCreate): Promise<TConnector>;
556
+ /** Full replace update keyed by connector `id`. */
557
+ updateConnector(req: TUpdate): Promise<TConnector>;
558
+ /**
559
+ * Start connector auth (e.g. OAuth).
560
+ * May return a connector (already authenticated / with `auth.authUrl`) or a
561
+ * result carrying `authorization_endpoint` for the popup flow.
562
+ */
563
+ authenticateConnector(
564
+ req: AuthenticateConnectorRequest,
565
+ ): Promise<TConnector | ConnectorAuthenticationResult<TConnector>>;
566
+ /** Clear connector auth. */
567
+ disconnectConnector(req: { id: string }): Promise<TConnector>;
568
+ deleteConnector?(req: { id: string }): Promise<void>;
524
569
  }
525
570
 
526
571
  // ---------------------------------------------------------------------------
@@ -529,14 +574,14 @@ export interface ConnectorCatalogServer<
529
574
 
530
575
  /** Skill row shown in settings/skills (list + delete). Host extends for fqn, etc. */
531
576
  export interface SkillBase {
532
- id: string;
533
- name: string;
534
- description: string;
577
+ id: string;
578
+ name: string;
579
+ description: string;
535
580
  }
536
581
 
537
582
  export interface RegistrySkill extends SkillBase {
538
- /** `SkillCatalogEntry.id` this skill was created from. */
539
- catalogId: string;
583
+ /** `SkillCatalogEntry.id` this skill was created from. */
584
+ catalogId: string;
540
585
  }
541
586
 
542
587
  export interface GithubSkill extends SkillBase {}
@@ -545,124 +590,146 @@ export type DefinedSkill = RegistrySkill | GithubSkill;
545
590
 
546
591
  /** Git source fields shared by catalog entries and create requests. */
547
592
  export interface SkillConfigBase {
548
- name: string;
549
- description: string;
550
- repoURL: string;
551
- path: string;
552
- ref: string;
593
+ name: string;
594
+ description: string;
595
+ repoURL: string;
596
+ path: string;
597
+ ref: string;
553
598
  }
554
599
 
555
600
  export interface SkillCatalogEntry extends SkillConfigBase {
556
- id: string;
601
+ id: string;
557
602
  }
558
603
 
559
604
  /** Create-skill base. Hosts may intersect extra fields and re-union. */
560
605
  export interface CreateSkillRequestBase extends SkillConfigBase {}
561
606
 
562
607
  export interface SelectRegistrySkillRequest extends CreateSkillRequestBase {
563
- /** `SkillCatalogEntry.id`, persisted so the created skill links back to it. */
564
- catalogId: string;
608
+ /** `SkillCatalogEntry.id`, persisted so the created skill links back to it. */
609
+ catalogId: string;
565
610
  }
566
611
 
567
612
  export interface ImportGithubSkillRequest extends CreateSkillRequestBase {}
568
613
 
569
614
  export type CreateSkillRequest =
570
- | SelectRegistrySkillRequest
571
- | ImportGithubSkillRequest;
615
+ | SelectRegistrySkillRequest
616
+ | ImportGithubSkillRequest;
572
617
 
573
618
  export interface SkillCatalogServer<
574
- TSkill extends SkillBase = SkillBase,
575
- TCatalogEntry extends SkillCatalogEntry = SkillCatalogEntry,
576
- TCreate extends CreateSkillRequest = CreateSkillRequest,
619
+ TSkill extends SkillBase = SkillBase,
620
+ TCatalogEntry extends SkillCatalogEntry = SkillCatalogEntry,
621
+ TCreate extends CreateSkillRequest = CreateSkillRequest,
577
622
  > {
578
- getSkillCatalog(): Promise<TCatalogEntry[]>;
579
- listSkills(req?: { query?: string }): Promise<TSkill[]>;
580
- createSkill(req: TCreate): Promise<TSkill>;
581
- deleteSkill?(req: { id: string }): Promise<void>;
623
+ getSkillCatalog(): Promise<TCatalogEntry[]>;
624
+ listSkills(req?: { query?: string }): Promise<TSkill[]>;
625
+ createSkill(req: TCreate): Promise<TSkill>;
626
+ deleteSkill?(req: { id: string }): Promise<void>;
582
627
  }
583
628
 
584
629
  // ---------------------------------------------------------------------------
585
- // Sandboxes catalog — public rows omit credentials; writes accept them
630
+ // Sandbox providers catalog — public rows omit credentials; writes accept them
586
631
  // ---------------------------------------------------------------------------
587
632
 
588
- /** Mutable sandbox settings shared by catalog rows, create, and update. */
633
+ /** Mutable sandbox provider settings shared by catalog rows, create, and update. */
589
634
  export interface SandboxConfig {
590
- snapshotName: string;
591
- execTimeoutMs: number;
592
- autoStopIntervalInMinutes: number;
593
- autoArchiveIntervalInMinutes: number;
594
- autoDeleteIntervalInMinutes: number;
635
+ snapshotName: string;
636
+ execTimeoutMs: number;
637
+ autoStopIntervalInMinutes: number;
638
+ autoArchiveIntervalInMinutes: number;
639
+ autoDeleteIntervalInMinutes: number;
595
640
  }
596
641
 
597
642
  export interface SandboxCatalogEntry extends SandboxConfig {
598
- id: string;
599
- name: string;
600
- type: string;
643
+ id: string;
644
+ name: string;
645
+ type: string;
601
646
  }
602
647
 
603
- export interface SandboxBase {
604
- id: string;
605
- name: string;
606
- catalogId: string;
607
- isConnected: boolean;
648
+ /**
649
+ * Connected sandbox provider row (settings/sandboxes). No raw `apiKey`.
650
+ * Includes last-saved config so update forms can show previous values.
651
+ */
652
+ export interface SandboxBase extends SandboxConfig {
653
+ id: string;
654
+ name: string;
655
+ catalogId: string;
656
+ isConnected: boolean;
608
657
  }
609
658
 
610
659
  export interface CreateSandboxRequest extends SandboxConfig {
611
- /** `SandboxCatalogEntry.id` used to create this sandbox. */
612
- catalogId: string;
613
- name: string;
614
- type: string;
615
- apiKey: string;
660
+ /** `SandboxCatalogEntry.id` used to create this sandbox provider. */
661
+ catalogId: string;
662
+ name: string;
663
+ type: string;
664
+ apiKey: string;
616
665
  }
617
666
 
618
667
  export interface UpdateSandboxRequest extends SandboxConfig {
619
- id: string;
620
- apiKey: string;
668
+ id: string;
669
+ /** Omit to keep the existing key; send a value to rotate. */
670
+ apiKey?: string;
621
671
  }
622
672
 
673
+ /** Host-facing aliases (trueforge-ui public names). */
674
+ export type SandboxProviderConfig = SandboxConfig;
675
+ export type SandboxProviderCatalogEntry = SandboxCatalogEntry;
676
+ export type SandboxProviderBase = SandboxBase;
677
+ export type CreateSandboxProviderRequest = CreateSandboxRequest;
678
+ export type UpdateSandboxProviderRequest = UpdateSandboxRequest;
679
+
623
680
  export interface SandboxCatalogServer<
624
- TSandbox extends SandboxBase = SandboxBase,
625
- TCatalogEntry extends SandboxCatalogEntry = SandboxCatalogEntry,
626
- TCreate extends CreateSandboxRequest = CreateSandboxRequest,
627
- TUpdate extends UpdateSandboxRequest = UpdateSandboxRequest,
681
+ TProvider extends SandboxBase = SandboxBase,
682
+ TCatalogEntry extends SandboxCatalogEntry = SandboxCatalogEntry,
683
+ TCreate extends CreateSandboxRequest = CreateSandboxRequest,
684
+ TUpdate extends UpdateSandboxRequest = UpdateSandboxRequest,
628
685
  > {
629
- getSandboxCatalog(): Promise<TCatalogEntry[]>;
630
- listSandboxes(req?: { query?: string }): Promise<TSandbox[]>;
631
- createSandbox(req: TCreate): Promise<TSandbox>;
632
- updateSandbox(req: TUpdate): Promise<TSandbox>;
633
- deleteSandbox(req: { id: string }): Promise<void>;
686
+ getSandboxProviderCatalog(): Promise<TCatalogEntry[]>;
687
+ listSandboxProviders(req?: { query?: string }): Promise<TProvider[]>;
688
+ createSandboxProvider(req: TCreate): Promise<TProvider>;
689
+ updateSandboxProvider(req: TUpdate): Promise<TProvider>;
690
+ deleteSandboxProvider?(req: { id: string }): Promise<void>;
634
691
  }
635
692
 
693
+ /** Host-facing selector / compose aliases (trueforge-ui public names). */
694
+ export type ModelSelection = ModelSelectorEntry;
695
+ export type AgentSkill = SkillSelectorEntry;
696
+ export type ConnectorState = ConnectorSelectorEntry;
697
+ export type AgentLibraryEntry = AgentSelectorEntry;
698
+ export type SearchAgentsParams = SearchAgentSelectorParams;
699
+
636
700
  /**
637
- * Settings management aggregate — modelCatalog + connectorCatalog + optional
638
- * skill and sandbox catalogs.
639
- * Hosts may pass the whole object to an app shell, or a focused sub-port to a page.
640
- */
701
+ * Settings management aggregate — modelCatalog + connectorCatalog + optional
702
+ * skill and sandbox catalogs.
703
+ * Hosts may pass the whole object to an app shell, or a focused sub-port to a page.
704
+ */
641
705
  export interface CatalogServer<
642
- TModelCatalog extends ModelCatalogServer = ModelCatalogServer,
643
- TConnectorCatalog extends ConnectorCatalogServer = ConnectorCatalogServer,
644
- TSkillCatalog extends SkillCatalogServer = SkillCatalogServer,
645
- TSandboxCatalog extends SandboxCatalogServer = SandboxCatalogServer,
706
+ TModelCatalog extends ModelCatalogServer = ModelCatalogServer,
707
+ TConnectorCatalog extends ConnectorCatalogServer = ConnectorCatalogServer,
708
+ TSkillCatalog extends SkillCatalogServer = SkillCatalogServer,
709
+ TSandboxCatalog extends SandboxCatalogServer = SandboxCatalogServer,
646
710
  > {
647
- modelCatalog: TModelCatalog;
648
- connectorCatalog: TConnectorCatalog;
649
- /** Optional — omit when the host has no skills settings surface. */
650
- skillCatalog?: TSkillCatalog;
651
- /** Optional — omit when the host has no sandboxes settings surface. */
652
- sandboxCatalog?: TSandboxCatalog;
711
+ modelCatalog: TModelCatalog;
712
+ connectorCatalog: TConnectorCatalog;
713
+ /** Optional — omit when the host has no skills settings surface. */
714
+ skillCatalog?: TSkillCatalog;
715
+ /** Optional — omit when the host has no sandboxes settings surface. */
716
+ sandboxCatalog?: TSandboxCatalog;
653
717
  }
654
718
 
655
719
  /**
656
720
  * Composed host port: chat + builder + optional settings catalog.
657
- * Agent-ui's `AgentUIServer` mirrors this shape; named differently here to
658
- * avoid colliding with that package's local type name.
659
721
  *
660
722
  * `catalog` is optional — if the host passes it, settings UI can call
661
723
  * `useCatalogServer()` / show modelCatalog, connectorCatalog, and skillCatalog;
662
724
  * if omitted, those surfaces stay hidden.
725
+ *
726
+ * trueforge-ui re-exports this as `AgentUIServer`.
663
727
  */
664
728
  export type AgentUIServerPort<
665
- TChat extends AgentChatServer = AgentChatServer,
666
- TBuilder extends AgentBuilderServer = AgentBuilderServer,
667
- TCatalog extends CatalogServer = CatalogServer,
729
+ TChat extends AgentChatServer = AgentChatServer,
730
+ TBuilder extends AgentBuilderServer = AgentBuilderServer,
731
+ TCatalog extends CatalogServer = CatalogServer,
668
732
  > = TChat & TBuilder & { catalog?: TCatalog };
733
+
734
+ /** Host-facing alias used by trueforge-ui. */
735
+ export type AgentUIServer = AgentUIServerPort;