Skip to content

Commit e64e8d1

Browse files
committed
fix: proper naming
Signed-off-by: Tomas Weiss <[email protected]>
1 parent 548a18d commit e64e8d1

File tree

12 files changed

+64
-64
lines changed

12 files changed

+64
-64
lines changed

apps/beeai-sdk-ts/src/client/a2a/extensions/handle-agent-card.ts

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ import { oauthProviderExtension } from './services/oauth-provider';
1717
import { platformApiExtension } from './services/platform';
1818
import type { SecretDemands, SecretFulfillments } from './services/secrets';
1919
import { secretsExtension } from './services/secrets';
20-
import type { FormDemands, FormFullfillments } from './ui/form';
20+
import type { FormDemands, FormFulfillments } from './ui/form';
2121
import { formExtension } from './ui/form';
2222
import { oauthRequestExtension } from './ui/oauth';
23-
import type { SettingsDemands, SettingsFullfillments } from './ui/settings';
23+
import type { SettingsDemands, SettingsFulfillments } from './ui/settings';
2424
import { settingsExtension } from './ui/settings';
2525
import { extractServiceExtensionDemands, fulfillServiceExtensionDemand } from './utils';
2626

@@ -29,9 +29,9 @@ export interface Fulfillments {
2929
embedding: (demand: EmbeddingDemands) => Promise<EmbeddingFulfillments>;
3030
mcp: (demand: MCPDemands) => Promise<MCPFulfillments>;
3131
oauth: (demand: OAuthDemands) => Promise<OAuthFulfillments>;
32-
settings: (demand: SettingsDemands) => Promise<SettingsFullfillments>;
32+
settings: (demand: SettingsDemands) => Promise<SettingsFulfillments>;
3333
secrets: (demand: SecretDemands) => Promise<SecretFulfillments>;
34-
form: (demand: FormDemands) => Promise<FormFullfillments | null>;
34+
form: (demand: FormDemands) => Promise<FormFulfillments | null>;
3535
oauthRedirectUri: () => string | null;
3636
getContextToken: () => ContextToken;
3737
}
@@ -44,13 +44,13 @@ const settingsExtensionExtractor = extractServiceExtensionDemands(settingsExtens
4444
const secretExtensionExtractor = extractServiceExtensionDemands(secretsExtension);
4545
const formExtensionExtractor = extractServiceExtensionDemands(formExtension);
4646

47-
const fullfillMcpDemand = fulfillServiceExtensionDemand(mcpExtension);
48-
const fullfillLlmDemand = fulfillServiceExtensionDemand(llmExtension);
49-
const fullfillEmbeddingDemand = fulfillServiceExtensionDemand(embeddingExtension);
50-
const fullfillOAuthDemand = fulfillServiceExtensionDemand(oauthProviderExtension);
51-
const fullfillSettingsDemand = fulfillServiceExtensionDemand(settingsExtension);
52-
const fullfillSecretDemand = fulfillServiceExtensionDemand(secretsExtension);
53-
const fullfillFormDemand = fulfillServiceExtensionDemand(formExtension);
47+
const fulfillMcpDemand = fulfillServiceExtensionDemand(mcpExtension);
48+
const fulfillLlmDemand = fulfillServiceExtensionDemand(llmExtension);
49+
const fulfillEmbeddingDemand = fulfillServiceExtensionDemand(embeddingExtension);
50+
const fulfillOAuthDemand = fulfillServiceExtensionDemand(oauthProviderExtension);
51+
const fulfillSettingsDemand = fulfillServiceExtensionDemand(settingsExtension);
52+
const fulfillSecretDemand = fulfillServiceExtensionDemand(secretsExtension);
53+
const fulfillFormDemand = fulfillServiceExtensionDemand(formExtension);
5454

5555
export const handleAgentCard = (agentCard: { capabilities: AgentCapabilities }) => {
5656
const extensions = agentCard.capabilities.extensions ?? [];
@@ -63,53 +63,53 @@ export const handleAgentCard = (agentCard: { capabilities: AgentCapabilities })
6363
const secretDemands = secretExtensionExtractor(extensions);
6464
const formDemands = formExtensionExtractor(extensions);
6565

66-
const resolveMetadata = async (fullfillments: Fulfillments) => {
67-
let fullfilledMetadata = {};
66+
const resolveMetadata = async (fulfillments: Fulfillments) => {
67+
let fulfilledMetadata = {};
6868

69-
fullfilledMetadata = platformApiExtension(fullfilledMetadata, fullfillments.getContextToken());
69+
fulfilledMetadata = platformApiExtension(fulfilledMetadata, fulfillments.getContextToken());
7070

7171
if (llmDemands) {
72-
fullfilledMetadata = fullfillLlmDemand(fullfilledMetadata, await fullfillments.llm(llmDemands));
72+
fulfilledMetadata = fulfillLlmDemand(fulfilledMetadata, await fulfillments.llm(llmDemands));
7373
}
7474

7575
if (embeddingDemands) {
76-
fullfilledMetadata = fullfillEmbeddingDemand(fullfilledMetadata, await fullfillments.embedding(embeddingDemands));
76+
fulfilledMetadata = fulfillEmbeddingDemand(fulfilledMetadata, await fulfillments.embedding(embeddingDemands));
7777
}
7878

7979
if (mcpDemands) {
80-
fullfilledMetadata = fullfillMcpDemand(fullfilledMetadata, await fullfillments.mcp(mcpDemands));
80+
fulfilledMetadata = fulfillMcpDemand(fulfilledMetadata, await fulfillments.mcp(mcpDemands));
8181
}
8282

8383
if (oauthDemands) {
84-
fullfilledMetadata = fullfillOAuthDemand(fullfilledMetadata, await fullfillments.oauth(oauthDemands));
84+
fulfilledMetadata = fulfillOAuthDemand(fulfilledMetadata, await fulfillments.oauth(oauthDemands));
8585
}
8686

8787
if (settingsDemands) {
88-
fullfilledMetadata = fullfillSettingsDemand(fullfilledMetadata, await fullfillments.settings(settingsDemands));
88+
fulfilledMetadata = fulfillSettingsDemand(fulfilledMetadata, await fulfillments.settings(settingsDemands));
8989
}
9090

9191
if (secretDemands) {
92-
fullfilledMetadata = fullfillSecretDemand(fullfilledMetadata, await fullfillments.secrets(secretDemands));
92+
fulfilledMetadata = fulfillSecretDemand(fulfilledMetadata, await fulfillments.secrets(secretDemands));
9393
}
9494

9595
if (formDemands) {
96-
const formFullfilment = await fullfillments.form(formDemands);
97-
if (formFullfilment) {
98-
fullfilledMetadata = fullfillFormDemand(fullfilledMetadata, formFullfilment);
96+
const formFulfilment = await fulfillments.form(formDemands);
97+
if (formFulfilment) {
98+
fulfilledMetadata = fulfillFormDemand(fulfilledMetadata, formFulfilment);
9999
}
100100
}
101101

102-
const oauthRedirectUri = fullfillments.oauthRedirectUri();
102+
const oauthRedirectUri = fulfillments.oauthRedirectUri();
103103
if (oauthRedirectUri) {
104-
fullfilledMetadata = {
105-
...fullfilledMetadata,
104+
fulfilledMetadata = {
105+
...fulfilledMetadata,
106106
[oauthRequestExtension.getUri()]: {
107107
redirect_uri: oauthRedirectUri,
108108
},
109109
};
110110
}
111111

112-
return fullfilledMetadata;
112+
return fulfilledMetadata;
113113
};
114114

115115
return {

apps/beeai-sdk-ts/src/client/a2a/extensions/ui/form.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,14 @@ export type CheckboxField = z.infer<typeof checkboxField>;
120120
export type FormField = z.infer<typeof fieldSchema>;
121121

122122
export type FormDemands = z.infer<typeof renderSchema>;
123-
export type FormFullfillments = z.infer<typeof responseSchema>;
124-
export type FormResponseValue = FormFullfillments['values'][string];
123+
export type FormFulfillments = z.infer<typeof responseSchema>;
124+
export type FormResponseValue = FormFulfillments['values'][string];
125125

126126
export const formMessageExtension: A2AUiExtension<typeof URI, FormDemands> = {
127127
getMessageMetadataSchema: () => z.object({ [URI]: renderSchema }).partial(),
128128
getUri: () => URI,
129129
};
130-
export const formExtension: A2AServiceExtension<typeof URI, z.infer<typeof renderSchema>, FormFullfillments> = {
130+
export const formExtension: A2AServiceExtension<typeof URI, z.infer<typeof renderSchema>, FormFulfillments> = {
131131
getDemandsSchema: () => renderSchema,
132132
getFulfillmentSchema: () => responseSchema,
133133
getUri: () => URI,

apps/beeai-sdk-ts/src/client/a2a/extensions/ui/settings.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ export type SettingsSingleSelectFieldValue = z.infer<typeof singleSelectFieldVal
7171
export type SettingsFieldValue = z.infer<typeof settingsFieldValue>;
7272

7373
export type SettingsDemands = z.infer<typeof settingsRenderSchema>;
74-
export type SettingsFullfillments = z.infer<typeof agentRunSettingsSchema>;
74+
export type SettingsFulfillments = z.infer<typeof agentRunSettingsSchema>;
7575

7676
export const settingsExtension: A2AServiceExtension<
7777
typeof URI,
7878
z.infer<typeof settingsRenderSchema>,
79-
SettingsFullfillments
79+
SettingsFulfillments
8080
> = {
8181
getDemandsSchema: () => settingsRenderSchema,
8282
getFulfillmentSchema: () => agentRunSettingsSchema,

apps/beeai-ui/src/modules/compose/contexts/ComposeProvider.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ interface Props {
5757

5858
function ComposeProviderWithContext({ agentClient, children }: PropsWithChildren<Props>) {
5959
const { getContextId } = usePlatformContext();
60-
const { getFullfilments } = useAgentDemands();
60+
const { getFulfillments } = useAgentDemands();
6161
const { data: agents } = useListAgents({ onlyUiSupported: true });
6262

6363
const searchParams = useSearchParams();
@@ -172,7 +172,7 @@ function ComposeProviderWithContext({ agentClient, children }: PropsWithChildren
172172
: undefined,
173173
});
174174
});
175-
const fulfillments = await getFullfilments({});
175+
const fulfillments = await getFulfillments({});
176176

177177
const userMessage: UIUserMessage = {
178178
id: uuid(),
@@ -237,7 +237,7 @@ function ComposeProviderWithContext({ agentClient, children }: PropsWithChildren
237237
pendingSubscription.current = undefined;
238238
}
239239
},
240-
[agentClient, getContextId, getFullfilments, updateStep, getActiveStepIdx, getValues, handleError, onDone],
240+
[agentClient, getContextId, getFulfillments, updateStep, getActiveStepIdx, getValues, handleError, onDone],
241241
);
242242

243243
const onSubmit = useCallback(() => {

apps/beeai-ui/src/modules/form/components/FormFields.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import type { FormDemands, FormFullfillments } from 'beeai-sdk';
6+
import type { FormDemands, FormFulfillments } from 'beeai-sdk';
77
import type { CSSProperties } from 'react';
88

99
import { FormField } from './FormField';
@@ -12,7 +12,7 @@ import classes from './FormFields.module.scss';
1212
interface Props {
1313
fields: FormDemands['fields'];
1414
columns: FormDemands['columns'];
15-
values?: FormFullfillments['values'];
15+
values?: FormFulfillments['values'];
1616
}
1717

1818
export function FormFields({ fields, columns, values }: Props) {

apps/beeai-ui/src/modules/messages/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55

66
import type { Task } from '@a2a-js/sdk';
7-
import type { FormDemands, FormFullfillments, SecretDemands } from 'beeai-sdk';
7+
import type { FormDemands, FormFulfillments, SecretDemands } from 'beeai-sdk';
88

99
import type { TaskId } from '#modules/tasks/api/types.ts';
1010

@@ -144,5 +144,5 @@ export enum UITransformType {
144144

145145
export interface UIMessageForm {
146146
request: FormDemands;
147-
response: FormFullfillments;
147+
response: FormFulfillments;
148148
}

apps/beeai-ui/src/modules/runs/contexts/agent-demands/AgentDemandsProvider.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ import { useCreateContextToken } from '#modules/platform-context/api/mutations/u
1212
import { useMatchProviders } from '#modules/platform-context/api/mutations/useMatchProviders.ts';
1313
import { usePlatformContext } from '#modules/platform-context/contexts/index.ts';
1414
import { ModelCapability } from '#modules/platform-context/types.ts';
15-
import { getSettingsRenderDefaultValues } from '#modules/runs/settings/utils.ts';
15+
import { getSettingsDemandsDefaultValues } from '#modules/runs/settings/utils.ts';
1616

1717
import { useAgentSecrets } from '../agent-secrets';
1818
import type { FulfillmentsContext } from './agent-demands-context';
1919
import { AgentDemandsContext } from './agent-demands-context';
20-
import { buildFullfilments } from './build-fulfillments';
20+
import { buildFulfillments } from './build-fulfillments';
2121

2222
interface Props<UIGenericPart> {
2323
agentClient?: AgentA2AClient<UIGenericPart>;
@@ -42,7 +42,7 @@ export function AgentDemandsProvider<UIGenericPart>({
4242

4343
useEffect(() => {
4444
if (agentClient?.demands.settingsDemands) {
45-
setSelectedSettings(getSettingsRenderDefaultValues(agentClient.demands.settingsDemands));
45+
setSelectedSettings(getSettingsDemandsDefaultValues(agentClient.demands.settingsDemands));
4646
}
4747
}, [agentClient?.demands.settingsDemands]);
4848

@@ -168,7 +168,7 @@ export function AgentDemandsProvider<UIGenericPart>({
168168
return contextToken;
169169
}, [contextId, createContextToken]);
170170

171-
const getFullfilments = useCallback(
171+
const getFulfillments = useCallback(
172172
async (fulfillmentsContext: FulfillmentsContext) => {
173173
const contextToken = await getContextToken();
174174

@@ -179,15 +179,15 @@ export function AgentDemandsProvider<UIGenericPart>({
179179
return memo;
180180
}, fulfillmentsContext.providedSecrets ?? {});
181181

182-
return buildFullfilments({
182+
return buildFulfillments({
183183
contextToken,
184184
selectedLLMProviders,
185185
selectedEmbeddingProviders,
186186
selectedMCPServers,
187187
providedSecrets,
188188
featureFlags,
189189
selectedSettings,
190-
formFullfillments: fulfillmentsContext.formFullfillments ?? null,
190+
formFulfillments: fulfillmentsContext.formFulfillments ?? null,
191191
oauthRedirectUri: fulfillmentsContext.oauthRedirectUri ?? null,
192192
});
193193
},
@@ -209,7 +209,7 @@ export function AgentDemandsProvider<UIGenericPart>({
209209
selectedLLMProviders,
210210
matchedEmbeddingProviders,
211211
selectedEmbeddingProviders,
212-
getFullfilments,
212+
getFulfillments,
213213
selectLLMProvider,
214214
selectEmbeddingProvider,
215215
selectMCPServer,

apps/beeai-ui/src/modules/runs/contexts/agent-demands/agent-demands-context.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import type { AgentSettings, FormFullfillments, Fulfillments, SettingsDemands } from 'beeai-sdk';
6+
import type { AgentSettings, FormFulfillments, Fulfillments, SettingsDemands } from 'beeai-sdk';
77
import { createContext } from 'react';
88

99
import type { TaskId } from '#modules/tasks/api/types.ts';
1010

1111
export type FulfillmentsContext = Partial<{
1212
taskId: TaskId;
1313
providedSecrets: Record<string, string>;
14-
formFullfillments: FormFullfillments;
14+
formFulfillments: FormFulfillments;
1515
oauthRedirectUri: string;
1616
}>;
1717

@@ -20,7 +20,7 @@ interface AgentDemandsContextValue {
2020
selectedLLMProviders: Record<string, string>;
2121
matchedEmbeddingProviders?: Record<string, string[]>;
2222
selectedEmbeddingProviders: Record<string, string>;
23-
getFullfilments: (context: FulfillmentsContext) => Promise<Fulfillments>;
23+
getFulfillments: (context: FulfillmentsContext) => Promise<Fulfillments>;
2424
selectLLMProvider: (key: string, value: string) => void;
2525
selectEmbeddingProvider: (key: string, value: string) => void;
2626
selectMCPServer: (key: string, value: string) => void;

apps/beeai-ui/src/modules/runs/contexts/agent-demands/build-fulfillments.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,34 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import type { AgentSettings, ContextToken, EmbeddingDemands, FormFullfillments, Fulfillments } from 'beeai-sdk';
6+
import type { AgentSettings, ContextToken, EmbeddingDemands, FormFulfillments, Fulfillments } from 'beeai-sdk';
77

88
import { BASE_URL } from '#utils/constants.ts';
99
import type { FeatureFlags } from '#utils/feature-flags.ts';
1010

11-
interface BuildFullfilmentsParams {
11+
interface BuildFulfillmentsParams {
1212
contextToken: ContextToken;
1313
selectedLLMProviders: Record<string, string>;
1414
selectedEmbeddingProviders: Record<string, string>;
1515
selectedMCPServers: Record<string, string>;
1616
providedSecrets: Record<string, string>;
1717
selectedSettings: AgentSettings;
18-
formFullfillments: FormFullfillments | null;
18+
formFulfillments: FormFulfillments | null;
1919
oauthRedirectUri: string | null;
2020
featureFlags: FeatureFlags;
2121
}
2222

23-
export const buildFullfilments = ({
23+
export const buildFulfillments = ({
2424
contextToken,
2525
selectedLLMProviders,
2626
selectedEmbeddingProviders,
2727
selectedMCPServers,
2828
selectedSettings,
2929
providedSecrets,
30-
formFullfillments,
30+
formFulfillments,
3131
oauthRedirectUri,
3232
featureFlags,
33-
}: BuildFullfilmentsParams): Fulfillments => {
33+
}: BuildFulfillmentsParams): Fulfillments => {
3434
return {
3535
getContextToken: () => contextToken,
3636

@@ -41,7 +41,7 @@ export const buildFullfilments = ({
4141
},
4242

4343
form: async () => {
44-
return formFullfillments;
44+
return formFulfillments;
4545
},
4646

4747
secrets: async () => {

apps/beeai-ui/src/modules/runs/contexts/agent-run/AgentRunProvider.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ function AgentRunProvider({ agent, agentClient, children }: PropsWithChildren<Ag
8888
const pendingRun = useRef<ChatRun>(undefined);
8989

9090
const { contextId, getContextId, updateContextWithAgentMetadata } = usePlatformContext();
91-
const { getFullfilments } = useAgentDemands();
91+
const { getFulfillments } = useAgentDemands();
9292
const { files, clearFiles } = useFileUpload();
9393

9494
const updateCurrentAgentMessage = useCallback(
@@ -183,7 +183,7 @@ function AgentRunProvider({ agent, agentClient, children }: PropsWithChildren<Ag
183183

184184
const contextId = getContextId();
185185

186-
const fulfillments = await getFullfilments(fulfillmentsContext);
186+
const fulfillments = await getFulfillments(fulfillmentsContext);
187187

188188
const agentMessage: UIAgentMessage = {
189189
id: uuid(),
@@ -267,7 +267,7 @@ function AgentRunProvider({ agent, agentClient, children }: PropsWithChildren<Ag
267267
queryClient,
268268
checkPendingRun,
269269
getContextId,
270-
getFullfilments,
270+
getFulfillments,
271271
setMessages,
272272
agentClient,
273273
agent,
@@ -308,7 +308,7 @@ function AgentRunProvider({ agent, agentClient, children }: PropsWithChildren<Ag
308308
form,
309309
};
310310

311-
return run(message, { taskId, formFullfillments: form.response });
311+
return run(message, { taskId, formFulfillments: form.response });
312312
},
313313
[checkPendingRun, run],
314314
);
@@ -324,7 +324,7 @@ function AgentRunProvider({ agent, agentClient, children }: PropsWithChildren<Ag
324324
form,
325325
};
326326

327-
return run(message, { formFullfillments: form.response });
327+
return run(message, { formFulfillments: form.response });
328328
},
329329
[checkPendingRun, run],
330330
);

0 commit comments

Comments
 (0)