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