@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.
- package/CHANGELOG.md +66 -0
- package/dist/{chunk-BRPTG6VA.js → chunk-2NLIAJJX.js} +100 -12
- package/dist/chunk-2NLIAJJX.js.map +1 -0
- package/dist/index.d.ts +13 -2
- package/dist/index.js +70 -66
- package/dist/index.js.map +1 -1
- package/dist/plugins/truefoundry-agent-server-adapter/index.d.ts +3 -3
- package/dist/plugins/truefoundry-agent-server-adapter/index.js +1 -1
- package/dist/server/index.d.ts +2 -2
- package/dist/{types-CgZUnILu.d.ts → types-CSRQSnHu.d.ts} +148 -80
- package/package.json +3 -3
- package/src/convertTurnMessages.test.ts +123 -0
- package/src/convertTurnMessages.ts +8 -2
- package/src/draft/truefoundryDraftThreadListAdapter.test.ts +58 -4
- package/src/draft/truefoundryDraftThreadListAdapter.ts +18 -22
- package/src/index.ts +27 -0
- package/src/plugins/truefoundry-agent-server-adapter/chatServer.ts +1 -1
- package/src/plugins/truefoundry-agent-server-adapter/cp.test.ts +169 -6
- package/src/plugins/truefoundry-agent-server-adapter/cp.ts +126 -1
- package/src/plugins/truefoundry-agent-server-adapter/createTrueFoundryAgentUIServer.ts +7 -0
- package/src/plugins/truefoundry-agent-server-adapter/normalizeAgentSpec.test.ts +34 -0
- package/src/plugins/truefoundry-agent-server-adapter/normalizeAgentSpec.ts +12 -5
- package/src/plugins/truefoundry-agent-server-adapter/types.ts +2 -2
- package/src/server/index.ts +15 -0
- package/src/server/types.ts +448 -381
- package/src/sessionThreadMetadata.ts +42 -0
- package/src/truefoundryOwnedSessionsThreadListAdapter.test.ts +17 -0
- package/src/truefoundryOwnedSessionsThreadListAdapter.ts +13 -25
- package/src/truefoundryThreadListAdapter.test.ts +17 -9
- package/src/truefoundryThreadListAdapter.ts +9 -14
- package/src/types.ts +5 -0
- package/src/useTrueFoundryAgentRuntime.ts +4 -1
- package/dist/chunk-BRPTG6VA.js.map +0 -1
package/src/server/types.ts
CHANGED
|
@@ -7,10 +7,10 @@
|
|
|
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
|
// ---------------------------------------------------------------------------
|
|
@@ -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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
|
47
|
+
/** Agent selector row. Host extends for metadata; `agentSpec` enables Edit. */
|
|
42
48
|
export interface AgentSelectorEntry {
|
|
43
|
-
|
|
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
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
-
|
|
80
|
-
|
|
89
|
+
maxTokens?: number;
|
|
90
|
+
reasoningEffort?: string;
|
|
81
91
|
}
|
|
82
92
|
|
|
83
93
|
export interface Model {
|
|
84
|
-
|
|
85
|
-
|
|
94
|
+
name: string;
|
|
95
|
+
params?: ModelParams;
|
|
86
96
|
}
|
|
87
97
|
|
|
88
98
|
/**
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
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
|
-
|
|
95
|
-
|
|
96
|
-
|
|
104
|
+
TModel extends Model = Model,
|
|
105
|
+
TSkill extends SkillMount = SkillMount,
|
|
106
|
+
TMcp extends McpServerMount = McpServerMount,
|
|
97
107
|
> {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
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
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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
|
-
|
|
122
|
-
|
|
123
|
-
|
|
131
|
+
agentName?: string;
|
|
132
|
+
agentSpec?: TSpec;
|
|
133
|
+
title?: string;
|
|
124
134
|
}
|
|
125
135
|
|
|
126
136
|
export interface UpdateSessionRequest<TSpec extends AgentSpec = AgentSpec> {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
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
|
-
|
|
138
|
-
|
|
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
|
-
|
|
145
|
-
|
|
146
|
-
|
|
154
|
+
limit?: number;
|
|
155
|
+
order?: ListSessionsOrder;
|
|
156
|
+
pageToken?: string;
|
|
147
157
|
};
|
|
148
158
|
|
|
149
159
|
export interface ListSessionsParams extends PageParams {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
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
|
-
|
|
163
|
-
|
|
173
|
+
| string
|
|
174
|
+
| Array<{ type: "text"; text: string } | { type: "file"; name: string; data: string }>;
|
|
164
175
|
|
|
165
176
|
export interface UserMessage {
|
|
166
|
-
|
|
167
|
-
|
|
177
|
+
type: "user.message";
|
|
178
|
+
content: UserMessageContent;
|
|
168
179
|
}
|
|
169
180
|
|
|
170
181
|
export type ApprovalDecision =
|
|
171
|
-
|
|
172
|
-
|
|
182
|
+
| { status: "allow" }
|
|
183
|
+
| { status: "deny"; reason?: string };
|
|
173
184
|
|
|
174
185
|
export interface UserToolApprovalEvent {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
186
|
+
type: "user.tool_approval";
|
|
187
|
+
threadId: string;
|
|
188
|
+
toolCallId: string;
|
|
189
|
+
approval: ApprovalDecision;
|
|
179
190
|
}
|
|
180
191
|
|
|
181
192
|
export interface UserToolResponseEvent {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
193
|
+
type: "user.tool_response";
|
|
194
|
+
threadId: string;
|
|
195
|
+
toolCallId: string;
|
|
196
|
+
content: string;
|
|
186
197
|
}
|
|
187
198
|
|
|
188
199
|
export type TurnInputItem =
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
200
|
+
| UserMessage
|
|
201
|
+
| UserToolApprovalEvent
|
|
202
|
+
| UserToolResponseEvent;
|
|
192
203
|
|
|
193
204
|
export type TurnStateRunning = { status: "running" };
|
|
194
205
|
|
|
195
206
|
export type TurnStateDone = {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
207
|
+
status: "done";
|
|
208
|
+
output?: unknown;
|
|
209
|
+
requiredActions?: ActionRequiredEvent[];
|
|
210
|
+
completedAt: string;
|
|
200
211
|
};
|
|
201
212
|
|
|
202
213
|
export type TurnStateCancelled = {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
214
|
+
status: "cancelled";
|
|
215
|
+
reason: string;
|
|
216
|
+
completedAt: string;
|
|
206
217
|
};
|
|
207
218
|
|
|
208
219
|
export type TurnStateError = {
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
220
|
+
status: "error";
|
|
221
|
+
message: string;
|
|
222
|
+
completedAt: string;
|
|
212
223
|
};
|
|
213
224
|
|
|
214
225
|
export type TurnState =
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
226
|
+
| TurnStateRunning
|
|
227
|
+
| TurnStateDone
|
|
228
|
+
| TurnStateCancelled
|
|
229
|
+
| TurnStateError;
|
|
219
230
|
|
|
220
231
|
/** Plain turn DTO — no methods. */
|
|
221
232
|
export interface Turn {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
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
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
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
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
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
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
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
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
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
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
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
|
-
|
|
345
|
-
|
|
346
|
-
|
|
371
|
+
* Model row — form "Model ID" + "Display name".
|
|
372
|
+
* Host extends for properties, etc.
|
|
373
|
+
*/
|
|
347
374
|
export interface ModelEntry {
|
|
348
|
-
|
|
349
|
-
|
|
375
|
+
id: string;
|
|
376
|
+
name: string;
|
|
350
377
|
}
|
|
351
378
|
|
|
352
379
|
/**
|
|
353
|
-
|
|
354
|
-
|
|
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
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
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
|
-
|
|
367
|
-
|
|
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
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
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
|
-
|
|
380
|
-
|
|
381
|
-
|
|
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
|
-
|
|
385
|
-
|
|
386
|
-
|
|
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
|
-
|
|
420
|
+
ModelProviderConfigBase<TModel>;
|
|
392
421
|
|
|
393
422
|
/** Update — `id` required. */
|
|
394
423
|
export type UpdateModelProviderRequest<TModel extends ModelEntry = ModelEntry> =
|
|
395
|
-
|
|
424
|
+
ModelProviderConfigBase<TModel> & { id: string };
|
|
396
425
|
|
|
397
426
|
export interface ModelCatalogServer<
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
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
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
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
|
-
|
|
415
|
-
|
|
416
|
-
|
|
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
|
-
|
|
426
|
-
|
|
427
|
-
|
|
454
|
+
type: "header";
|
|
455
|
+
apiKey?: string;
|
|
456
|
+
headerName?: string;
|
|
428
457
|
};
|
|
429
458
|
export type ConnectorAuthNone = { type: "none" };
|
|
430
459
|
export type ConnectorAuth =
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
460
|
+
| ConnectorAuthOAuth
|
|
461
|
+
| ConnectorAuthApiKey
|
|
462
|
+
| ConnectorAuthNone;
|
|
434
463
|
|
|
435
|
-
// Public (list/detail) — no secrets
|
|
436
|
-
export type ConnectorAuthPublicOAuth = { type: "dcr"; authUrl
|
|
464
|
+
// Public (list/detail) — no secrets
|
|
465
|
+
export type ConnectorAuthPublicOAuth = { type: "dcr"; authUrl?: string };
|
|
437
466
|
export type ConnectorAuthPublicApiKey = {
|
|
438
|
-
|
|
439
|
-
|
|
467
|
+
type: "header";
|
|
468
|
+
headerName?: string;
|
|
440
469
|
};
|
|
441
470
|
export type ConnectorAuthPublicNone = { type: "none" };
|
|
442
471
|
export type ConnectorAuthPublic =
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
472
|
+
| ConnectorAuthPublicOAuth
|
|
473
|
+
| ConnectorAuthPublicApiKey
|
|
474
|
+
| ConnectorAuthPublicNone;
|
|
446
475
|
|
|
447
476
|
/**
|
|
448
|
-
|
|
449
|
-
|
|
477
|
+
* MCP / connector create-edit config. Host extends for extra fields, etc.
|
|
478
|
+
*/
|
|
450
479
|
export interface ConnectorConfigBase<
|
|
451
|
-
|
|
480
|
+
TAuth extends ConnectorAuth = ConnectorAuth,
|
|
452
481
|
> {
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
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
|
-
|
|
464
|
-
TAuth extends ConnectorAuthPublic = ConnectorAuthPublic,
|
|
493
|
+
TAuth extends ConnectorAuthPublic = ConnectorAuthPublic,
|
|
465
494
|
> {
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
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
|
-
|
|
507
|
+
TAuth extends ConnectorAuthPublic = ConnectorAuthPublic,
|
|
480
508
|
> {
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
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
|
-
|
|
519
|
+
ConnectorConfigBase<TAuth>;
|
|
491
520
|
|
|
492
521
|
/** Update connector — `id` required. Host extends. */
|
|
493
522
|
export type UpdateConnectorRequest<TAuth extends ConnectorAuth = ConnectorAuth> =
|
|
494
|
-
|
|
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
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
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
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
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
|
-
|
|
533
|
-
|
|
534
|
-
|
|
577
|
+
id: string;
|
|
578
|
+
name: string;
|
|
579
|
+
description: string;
|
|
535
580
|
}
|
|
536
581
|
|
|
537
582
|
export interface RegistrySkill extends SkillBase {
|
|
538
|
-
|
|
539
|
-
|
|
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
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
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
|
-
|
|
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
|
-
|
|
564
|
-
|
|
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
|
-
|
|
571
|
-
|
|
615
|
+
| SelectRegistrySkillRequest
|
|
616
|
+
| ImportGithubSkillRequest;
|
|
572
617
|
|
|
573
618
|
export interface SkillCatalogServer<
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
619
|
+
TSkill extends SkillBase = SkillBase,
|
|
620
|
+
TCatalogEntry extends SkillCatalogEntry = SkillCatalogEntry,
|
|
621
|
+
TCreate extends CreateSkillRequest = CreateSkillRequest,
|
|
577
622
|
> {
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
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
|
-
//
|
|
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
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
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
|
-
|
|
599
|
-
|
|
600
|
-
|
|
643
|
+
id: string;
|
|
644
|
+
name: string;
|
|
645
|
+
type: string;
|
|
601
646
|
}
|
|
602
647
|
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
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
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
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
|
-
|
|
620
|
-
|
|
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
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
681
|
+
TProvider extends SandboxBase = SandboxBase,
|
|
682
|
+
TCatalogEntry extends SandboxCatalogEntry = SandboxCatalogEntry,
|
|
683
|
+
TCreate extends CreateSandboxRequest = CreateSandboxRequest,
|
|
684
|
+
TUpdate extends UpdateSandboxRequest = UpdateSandboxRequest,
|
|
628
685
|
> {
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
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
|
-
|
|
638
|
-
|
|
639
|
-
|
|
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
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
706
|
+
TModelCatalog extends ModelCatalogServer = ModelCatalogServer,
|
|
707
|
+
TConnectorCatalog extends ConnectorCatalogServer = ConnectorCatalogServer,
|
|
708
|
+
TSkillCatalog extends SkillCatalogServer = SkillCatalogServer,
|
|
709
|
+
TSandboxCatalog extends SandboxCatalogServer = SandboxCatalogServer,
|
|
646
710
|
> {
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
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
|
-
|
|
666
|
-
|
|
667
|
-
|
|
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;
|