@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
|
@@ -1029,10 +1029,12 @@ function projectHistoryTurns(
|
|
|
1029
1029
|
const messages: ThreadMessage[] = [];
|
|
1030
1030
|
let lastAssistantIndex: number | undefined;
|
|
1031
1031
|
let groupRootIds: string[] = [];
|
|
1032
|
+
let sandboxId: string | undefined;
|
|
1032
1033
|
|
|
1033
1034
|
for (let turnIndex = 0; turnIndex < snapshot.turns.length; turnIndex++) {
|
|
1034
1035
|
const record = snapshot.turns[turnIndex]!;
|
|
1035
1036
|
const turnRootIds = record.rootModelMessageIds ?? [];
|
|
1037
|
+
sandboxId = record.sandboxId ?? sandboxId;
|
|
1036
1038
|
|
|
1037
1039
|
if (record.userText) {
|
|
1038
1040
|
groupRootIds = [...turnRootIds];
|
|
@@ -1080,7 +1082,7 @@ function projectHistoryTurns(
|
|
|
1080
1082
|
const custom = {
|
|
1081
1083
|
...baseCustom,
|
|
1082
1084
|
turnId: record.id,
|
|
1083
|
-
...(
|
|
1085
|
+
...(sandboxId != null ? { sandboxId } : {}),
|
|
1084
1086
|
};
|
|
1085
1087
|
|
|
1086
1088
|
if (record.userText) {
|
|
@@ -1738,7 +1740,11 @@ export function turnStreamUpdateToAssistantMessage(
|
|
|
1738
1740
|
unstable_annotations: [],
|
|
1739
1741
|
unstable_data: [],
|
|
1740
1742
|
steps: [],
|
|
1741
|
-
custom: {
|
|
1743
|
+
custom: {
|
|
1744
|
+
...(existing?.role === "assistant" ? existing.metadata.custom : {}),
|
|
1745
|
+
...update.metadata?.custom,
|
|
1746
|
+
turnId,
|
|
1747
|
+
},
|
|
1742
1748
|
},
|
|
1743
1749
|
};
|
|
1744
1750
|
}
|
|
@@ -87,20 +87,21 @@ describe("createTrueFoundryDraftThreadListAdapter", () => {
|
|
|
87
87
|
remoteId: "d1",
|
|
88
88
|
title: "My draft",
|
|
89
89
|
lastMessageAt: new Date("2026-06-30T10:00:00.000Z"),
|
|
90
|
+
custom: { isMutable: true },
|
|
90
91
|
},
|
|
91
92
|
{
|
|
92
93
|
status: "regular",
|
|
93
94
|
remoteId: "s1",
|
|
94
95
|
title: "Named",
|
|
95
96
|
lastMessageAt: new Date("2026-06-30T09:00:00.000Z"),
|
|
96
|
-
custom: { agentName: "from-sdk" },
|
|
97
|
+
custom: { isMutable: false, agentName: "from-sdk" },
|
|
97
98
|
},
|
|
98
99
|
{
|
|
99
100
|
status: "regular",
|
|
100
101
|
remoteId: "s2",
|
|
101
102
|
title: "untitled-agent",
|
|
102
103
|
lastMessageAt: new Date("2026-06-30T08:00:00.000Z"),
|
|
103
|
-
custom: { agentName: "untitled-agent" },
|
|
104
|
+
custom: { isMutable: false, agentName: "untitled-agent" },
|
|
104
105
|
},
|
|
105
106
|
]);
|
|
106
107
|
expect(result.nextCursor).toBe("page-2");
|
package/src/index.ts
CHANGED
|
@@ -77,7 +77,9 @@ export { trueFoundryAttachmentAdapter } from "./attachmentAdapter.js";
|
|
|
77
77
|
|
|
78
78
|
export type {
|
|
79
79
|
AgentChatServer,
|
|
80
|
+
AgentBuilderCapabilitiesResponse,
|
|
80
81
|
AgentBuilderServer,
|
|
82
|
+
SaveAgentRequest,
|
|
81
83
|
Session,
|
|
82
84
|
Turn,
|
|
83
85
|
TurnState,
|
|
@@ -91,8 +93,11 @@ export type {
|
|
|
91
93
|
UserMessage,
|
|
92
94
|
UserToolApprovalEvent,
|
|
93
95
|
UserToolResponseEvent,
|
|
96
|
+
ApprovalDecision,
|
|
94
97
|
PreviousTurnIdInput,
|
|
95
98
|
ProviderType,
|
|
99
|
+
PageParams,
|
|
100
|
+
ListSessionsOrder,
|
|
96
101
|
ModelEntry,
|
|
97
102
|
ModelProviderConfigBase,
|
|
98
103
|
ModelProviderBase,
|
|
@@ -115,6 +120,8 @@ export type {
|
|
|
115
120
|
ConnectorCatalogEntry,
|
|
116
121
|
CreateConnectorRequest,
|
|
117
122
|
UpdateConnectorRequest,
|
|
123
|
+
AuthenticateConnectorRequest,
|
|
124
|
+
ConnectorAuthenticationResult,
|
|
118
125
|
ConnectorCatalogServer,
|
|
119
126
|
SkillBase,
|
|
120
127
|
RegistrySkill,
|
|
@@ -132,9 +139,31 @@ export type {
|
|
|
132
139
|
SandboxBase,
|
|
133
140
|
CreateSandboxRequest,
|
|
134
141
|
UpdateSandboxRequest,
|
|
142
|
+
SandboxProviderConfig,
|
|
143
|
+
SandboxProviderCatalogEntry,
|
|
144
|
+
SandboxProviderBase,
|
|
145
|
+
CreateSandboxProviderRequest,
|
|
146
|
+
UpdateSandboxProviderRequest,
|
|
135
147
|
SandboxCatalogServer,
|
|
136
148
|
CatalogServer,
|
|
137
149
|
AgentUIServerPort,
|
|
150
|
+
AgentUIServer,
|
|
151
|
+
ProviderEntry,
|
|
152
|
+
ModelProperties,
|
|
153
|
+
ModelSelectorEntry,
|
|
154
|
+
SkillSelectorEntry,
|
|
155
|
+
ConnectorSelectorEntry,
|
|
156
|
+
AgentSelectorEntry,
|
|
157
|
+
SearchAgentSelectorParams,
|
|
158
|
+
ModelSelection,
|
|
159
|
+
AgentSkill,
|
|
160
|
+
ConnectorState,
|
|
161
|
+
AgentLibraryEntry,
|
|
162
|
+
SearchAgentsParams,
|
|
163
|
+
SkillMount,
|
|
164
|
+
McpServerMount,
|
|
165
|
+
ModelParams,
|
|
166
|
+
Model,
|
|
138
167
|
} from "./server/index.js";
|
|
139
168
|
export type {
|
|
140
169
|
SandboxCreatedEvent,
|
|
@@ -149,20 +149,22 @@ describe("normalizeEnabledModels", () => {
|
|
|
149
149
|
|
|
150
150
|
expect(rows).toEqual([
|
|
151
151
|
{
|
|
152
|
+
id: "openai-main/gpt-4.1",
|
|
152
153
|
name: "gpt-4.1",
|
|
153
|
-
provider: "openai",
|
|
154
|
+
provider: { name: "openai" },
|
|
155
|
+
properties: {},
|
|
154
156
|
apiModel: "openai-main/gpt-4.1",
|
|
155
157
|
modelId: "gpt-4.1",
|
|
156
158
|
providerAccount: "openai-main",
|
|
157
|
-
id: "openai-main/gpt-4.1",
|
|
158
159
|
},
|
|
159
160
|
{
|
|
161
|
+
id: "anthropic-prod/claude-sonnet-4-6",
|
|
160
162
|
name: "claude-sonnet-4-6",
|
|
161
|
-
provider: "anthropic",
|
|
163
|
+
provider: { name: "anthropic" },
|
|
164
|
+
properties: {},
|
|
162
165
|
apiModel: "anthropic-prod/claude-sonnet-4-6",
|
|
163
166
|
modelId: "claude-sonnet-4-6",
|
|
164
167
|
providerAccount: "anthropic-prod",
|
|
165
|
-
id: "anthropic-prod/claude-sonnet-4-6",
|
|
166
168
|
},
|
|
167
169
|
]);
|
|
168
170
|
});
|
|
@@ -183,12 +185,13 @@ describe("normalizeEnabledModels", () => {
|
|
|
183
185
|
|
|
184
186
|
expect(rows).toEqual([
|
|
185
187
|
{
|
|
188
|
+
id: "virtual-main/router",
|
|
186
189
|
name: "router",
|
|
187
|
-
provider: "virtual-model",
|
|
190
|
+
provider: { name: "virtual-model" },
|
|
191
|
+
properties: {},
|
|
188
192
|
apiModel: "virtual-main/router",
|
|
189
193
|
modelId: "router",
|
|
190
194
|
providerAccount: "virtual-main",
|
|
191
|
-
id: "virtual-main/router",
|
|
192
195
|
},
|
|
193
196
|
]);
|
|
194
197
|
});
|
|
@@ -24,7 +24,6 @@ export interface TfyModelSelectorEntry extends ModelSelectorEntry {
|
|
|
24
24
|
apiModel: string;
|
|
25
25
|
modelId: string;
|
|
26
26
|
providerAccount?: string;
|
|
27
|
-
id?: string;
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
export interface TfySkillSelectorEntry extends SkillSelectorEntry {
|
|
@@ -163,17 +162,17 @@ function toModelEntry(row: RawEnabledModel): TfyModelSelectorEntry | null {
|
|
|
163
162
|
if (apiModel == null || apiModel === "" || name == null || name === "") {
|
|
164
163
|
return null;
|
|
165
164
|
}
|
|
166
|
-
const provider = row.provider ?? "unknown";
|
|
167
165
|
const modelId = row.model_id ?? name;
|
|
168
166
|
return {
|
|
167
|
+
id: apiModel,
|
|
169
168
|
name,
|
|
170
|
-
provider,
|
|
169
|
+
provider: { name: row.provider ?? "unknown" },
|
|
170
|
+
properties: {},
|
|
171
171
|
apiModel,
|
|
172
172
|
modelId,
|
|
173
173
|
...(row.provider_account_name != null
|
|
174
174
|
? { providerAccount: row.provider_account_name }
|
|
175
175
|
: {}),
|
|
176
|
-
id: apiModel,
|
|
177
176
|
};
|
|
178
177
|
}
|
|
179
178
|
|
|
@@ -76,6 +76,13 @@ export async function createTrueFoundryAgentUIServer<
|
|
|
76
76
|
|
|
77
77
|
const server: TrueFoundryAgentUIServer<TSpec> = {
|
|
78
78
|
...chat,
|
|
79
|
+
getCapabilities: async () => ({
|
|
80
|
+
data: {
|
|
81
|
+
sandbox: { enabled: true },
|
|
82
|
+
skill: { enabled: true },
|
|
83
|
+
settings: { enabled: true },
|
|
84
|
+
},
|
|
85
|
+
}),
|
|
79
86
|
getModels: () => listEnabledModels(cp),
|
|
80
87
|
getSkills: () => listAgentSkills(cp),
|
|
81
88
|
getMcp: () => listMcpServers(cp),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* TrueFoundry-specific type extensions over the runtime's generic bases.
|
|
3
3
|
*
|
|
4
|
-
* The runtime defines
|
|
5
|
-
*
|
|
4
|
+
* The runtime defines opaque mount bases (`SkillMount` / `McpServerMount` =
|
|
5
|
+
* `object`) that hosts intersect with gateway shapes via generics.
|
|
6
6
|
*
|
|
7
7
|
* This file builds the concrete TrueFoundry types by:
|
|
8
8
|
* - Importing the runtime's AgentSpec as the base to extend.
|
package/src/server/index.ts
CHANGED
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
export type {
|
|
2
|
+
ProviderEntry,
|
|
3
|
+
ModelProperties,
|
|
2
4
|
ModelSelectorEntry,
|
|
3
5
|
SkillSelectorEntry,
|
|
4
6
|
ConnectorSelectorEntry,
|
|
5
7
|
AgentSelectorEntry,
|
|
6
8
|
SearchAgentSelectorParams,
|
|
9
|
+
ModelSelection,
|
|
10
|
+
AgentSkill,
|
|
11
|
+
ConnectorState,
|
|
12
|
+
AgentLibraryEntry,
|
|
13
|
+
SearchAgentsParams,
|
|
7
14
|
SkillMount,
|
|
8
15
|
McpServerMount,
|
|
9
16
|
ModelParams,
|
|
10
17
|
Model,
|
|
11
18
|
AgentSpec,
|
|
19
|
+
SaveAgentRequest,
|
|
12
20
|
Session,
|
|
13
21
|
CreateSessionRequest,
|
|
14
22
|
UpdateSessionRequest,
|
|
@@ -30,6 +38,7 @@ export type {
|
|
|
30
38
|
TurnState,
|
|
31
39
|
Turn,
|
|
32
40
|
AgentChatServer,
|
|
41
|
+
AgentBuilderCapabilitiesResponse,
|
|
33
42
|
AgentBuilderServer,
|
|
34
43
|
ProviderType,
|
|
35
44
|
ModelEntry,
|
|
@@ -54,6 +63,8 @@ export type {
|
|
|
54
63
|
ConnectorCatalogEntry,
|
|
55
64
|
CreateConnectorRequest,
|
|
56
65
|
UpdateConnectorRequest,
|
|
66
|
+
AuthenticateConnectorRequest,
|
|
67
|
+
ConnectorAuthenticationResult,
|
|
57
68
|
ConnectorCatalogServer,
|
|
58
69
|
SkillBase,
|
|
59
70
|
RegistrySkill,
|
|
@@ -71,9 +82,15 @@ export type {
|
|
|
71
82
|
SandboxBase,
|
|
72
83
|
CreateSandboxRequest,
|
|
73
84
|
UpdateSandboxRequest,
|
|
85
|
+
SandboxProviderConfig,
|
|
86
|
+
SandboxProviderCatalogEntry,
|
|
87
|
+
SandboxProviderBase,
|
|
88
|
+
CreateSandboxProviderRequest,
|
|
89
|
+
UpdateSandboxProviderRequest,
|
|
74
90
|
SandboxCatalogServer,
|
|
75
91
|
CatalogServer,
|
|
76
92
|
AgentUIServerPort,
|
|
93
|
+
AgentUIServer,
|
|
77
94
|
} from "./types.js";
|
|
78
95
|
|
|
79
96
|
export type {
|