Compare commits

...

2 Commits

Author SHA1 Message Date
Lluis Agusti
b1fbc1c88f chore: more 2025-07-14 18:58:02 +04:00
Lluis Agusti
0f13d14fd4 feat(frontend): captcha and vercel 2025-07-14 18:43:14 +04:00
27 changed files with 1352 additions and 515 deletions

View File

@@ -219,13 +219,22 @@ async def health():
class AgentServer(backend.util.service.AppProcess):
def run(self):
server_app = starlette.middleware.cors.CORSMiddleware(
app=app,
allow_origins=settings.config.backend_cors_allow_origins,
allow_credentials=True,
allow_methods=["*"], # Allows all methods
allow_headers=["*"], # Allows all headers
)
cors_kwargs = {
"app": app,
"allow_origins": settings.config.backend_cors_allow_origins,
"allow_credentials": True,
"allow_methods": ["*"],
"allow_headers": ["*"],
}
# Use regex pattern if configured (for dynamic domains like Vercel previews)
# Only enable in non-production environments for security
if (settings.config.backend_cors_allow_origin_regex and
settings.config.app_env.value != "prod"):
cors_kwargs["allow_origin_regex"] = settings.config.backend_cors_allow_origin_regex
logger.info(f"CORS regex enabled for {settings.config.app_env.value}: {settings.config.backend_cors_allow_origin_regex}")
server_app = starlette.middleware.cors.CORSMiddleware(**cors_kwargs)
uvicorn.run(
server_app,
host=backend.util.settings.Config().agent_api_host,

View File

@@ -303,13 +303,22 @@ async def health():
class WebsocketServer(AppProcess):
def run(self):
logger.info(f"CORS allow origins: {settings.config.backend_cors_allow_origins}")
server_app = CORSMiddleware(
app=app,
allow_origins=settings.config.backend_cors_allow_origins,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
cors_kwargs = {
"app": app,
"allow_origins": settings.config.backend_cors_allow_origins,
"allow_credentials": True,
"allow_methods": ["*"],
"allow_headers": ["*"],
}
# Use regex pattern if configured (for dynamic domains like Vercel previews)
# Only enable in non-production environments for security
if (settings.config.backend_cors_allow_origin_regex and
settings.config.app_env.value != "prod"):
cors_kwargs["allow_origin_regex"] = settings.config.backend_cors_allow_origin_regex
logger.info(f"CORS regex enabled for {settings.config.app_env.value}: {settings.config.backend_cors_allow_origin_regex}")
server_app = CORSMiddleware(**cors_kwargs)
uvicorn.run(
server_app,

View File

@@ -316,6 +316,11 @@ class Config(UpdateTrackingModel["Config"], BaseSettings):
)
backend_cors_allow_origins: List[str] = Field(default_factory=list)
backend_cors_allow_origin_regex: str = Field(
default="",
description="Regex pattern for allowed CORS origins (for dynamic domains like Vercel previews). "
"Example: 'https://autogpt-.*\\.vercel\\.app' to restrict to your organization only."
)
@field_validator("backend_cors_allow_origins")
@classmethod
@@ -324,8 +329,14 @@ class Config(UpdateTrackingModel["Config"], BaseSettings):
port = None
has_localhost = False
has_127_0_0_1 = False
for url in v:
url = url.strip()
# Skip wildcard patterns - these should be handled via allow_origin_regex
if "*" in url:
continue
if url.startswith(("http://", "https://")):
if "localhost" in url:
port = url.split(":")[2]

View File

@@ -23,6 +23,7 @@ export async function login(
return await Sentry.withServerActionInstrumentation("login", {}, async () => {
const supabase = await getServerSupabase();
const api = new BackendAPI();
const isVercelPreview = process.env.VERCEL_ENV === "preview";
if (!supabase) {
redirect("/error");
@@ -30,7 +31,7 @@ export async function login(
// Verify Turnstile token if provided
const success = await verifyTurnstileToken(turnstileToken, "login");
if (!success) {
if (!success && !isVercelPreview) {
return "CAPTCHA verification failed. Please try again.";
}

View File

@@ -21,6 +21,7 @@ export default function LoginPage() {
isLoading,
isLoggedIn,
isCloudEnv,
shouldNotRenderCaptcha,
isUserLoading,
isGoogleLoading,
showNotAllowedModal,
@@ -85,16 +86,18 @@ export default function LoginPage() {
/>
{/* Turnstile CAPTCHA Component */}
<Turnstile
key={captchaKey}
siteKey={turnstile.siteKey}
onVerify={turnstile.handleVerify}
onExpire={turnstile.handleExpire}
onError={turnstile.handleError}
setWidgetId={turnstile.setWidgetId}
action="login"
shouldRender={turnstile.shouldRender}
/>
{shouldNotRenderCaptcha ? null : (
<Turnstile
key={captchaKey}
siteKey={turnstile.siteKey}
onVerify={turnstile.handleVerify}
onExpire={turnstile.handleExpire}
onError={turnstile.handleError}
setWidgetId={turnstile.setWidgetId}
action="login"
shouldRender={turnstile.shouldRender}
/>
)}
<Button
variant="primary"

View File

@@ -28,6 +28,8 @@ export function useLoginPage() {
resetOnError: true,
});
const shouldNotRenderCaptcha = isVercelPreview || turnstile.verified;
const form = useForm<z.infer<typeof loginFormSchema>>({
resolver: zodResolver(loginFormSchema),
defaultValues: {
@@ -125,6 +127,7 @@ export function useLoginPage() {
isLoading,
isCloudEnv,
isUserLoading,
shouldNotRenderCaptcha,
isGoogleLoading,
showNotAllowedModal,
isSupabaseAvailable: !!supabase,

View File

@@ -18,6 +18,7 @@ export async function signup(
{},
async () => {
const supabase = await getServerSupabase();
const isVercelPreview = process.env.VERCEL_ENV === "preview";
if (!supabase) {
redirect("/error");
@@ -25,7 +26,7 @@ export async function signup(
// Verify Turnstile token if provided
const success = await verifyTurnstileToken(turnstileToken, "signup");
if (!success) {
if (!success && !isVercelPreview) {
return "CAPTCHA verification failed. Please try again.";
}

View File

@@ -32,6 +32,7 @@ export default function SignupPage() {
isLoading,
isCloudEnv,
isUserLoading,
shouldNotRenderCaptcha,
isGoogleLoading,
showNotAllowedModal,
isSupabaseAvailable,
@@ -163,16 +164,18 @@ export default function SignupPage() {
/>
{/* Turnstile CAPTCHA Component */}
<Turnstile
key={captchaKey}
siteKey={turnstile.siteKey}
onVerify={turnstile.handleVerify}
onExpire={turnstile.handleExpire}
onError={turnstile.handleError}
setWidgetId={turnstile.setWidgetId}
action="signup"
shouldRender={turnstile.shouldRender}
/>
{shouldNotRenderCaptcha ? null : (
<Turnstile
key={captchaKey}
siteKey={turnstile.siteKey}
onVerify={turnstile.handleVerify}
onExpire={turnstile.handleExpire}
onError={turnstile.handleError}
setWidgetId={turnstile.setWidgetId}
action="signup"
shouldRender={turnstile.shouldRender}
/>
)}
<Button
variant="primary"

View File

@@ -30,6 +30,8 @@ export function useSignupPage() {
resetOnError: true,
});
const shouldNotRenderCaptcha = isVercelPreview || turnstile.verified;
const resetCaptcha = useCallback(() => {
setCaptchaKey((k) => k + 1);
turnstile.reset();
@@ -132,6 +134,7 @@ export function useSignupPage() {
isCloudEnv,
isUserLoading,
isGoogleLoading,
shouldNotRenderCaptcha,
showNotAllowedModal,
isSupabaseAvailable: !!supabase,
handleSubmit: form.handleSubmit(handleSignup),

View File

@@ -39,6 +39,8 @@ import type { Graph } from "../../models/graph";
import type { GraphExecutionMeta } from "../../models/graphExecutionMeta";
import type { GraphMeta } from "../../models/graphMeta";
import type { GraphModel } from "../../models/graphModel";
import type { HTTPValidationError } from "../../models/hTTPValidationError";
@@ -47,8 +49,6 @@ import type { PostV1ExecuteGraphAgentParams } from "../../models/postV1ExecuteGr
import type { PostV1StopGraphExecution200 } from "../../models/postV1StopGraphExecution200";
import type { PostV1StopGraphExecutionsParams } from "../../models/postV1StopGraphExecutionsParams";
import type { SetGraphActiveVersion } from "../../models/setGraphActiveVersion";
import { customMutator } from "../../../mutators/custom-mutator";
@@ -59,7 +59,7 @@ type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
* @summary List user graphs
*/
export type getV1ListUserGraphsResponse200 = {
data: GraphModel[];
data: GraphMeta[];
status: 200;
};
@@ -1610,130 +1610,6 @@ export const usePostV1StopGraphExecution = <
return useMutation(mutationOptions, queryClient);
};
/**
* @summary Stop graph executions
*/
export type postV1StopGraphExecutionsResponse200 = {
data: GraphExecutionMeta[];
status: 200;
};
export type postV1StopGraphExecutionsResponse422 = {
data: HTTPValidationError;
status: 422;
};
export type postV1StopGraphExecutionsResponseComposite =
| postV1StopGraphExecutionsResponse200
| postV1StopGraphExecutionsResponse422;
export type postV1StopGraphExecutionsResponse =
postV1StopGraphExecutionsResponseComposite & {
headers: Headers;
};
export const getPostV1StopGraphExecutionsUrl = (
params: PostV1StopGraphExecutionsParams,
) => {
const normalizedParams = new URLSearchParams();
Object.entries(params || {}).forEach(([key, value]) => {
if (value !== undefined) {
normalizedParams.append(key, value === null ? "null" : value.toString());
}
});
const stringifiedParams = normalizedParams.toString();
return stringifiedParams.length > 0
? `/api/executions?${stringifiedParams}`
: `/api/executions`;
};
export const postV1StopGraphExecutions = async (
params: PostV1StopGraphExecutionsParams,
options?: RequestInit,
): Promise<postV1StopGraphExecutionsResponse> => {
return customMutator<postV1StopGraphExecutionsResponse>(
getPostV1StopGraphExecutionsUrl(params),
{
...options,
method: "POST",
},
);
};
export const getPostV1StopGraphExecutionsMutationOptions = <
TError = HTTPValidationError,
TContext = unknown,
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof postV1StopGraphExecutions>>,
TError,
{ params: PostV1StopGraphExecutionsParams },
TContext
>;
request?: SecondParameter<typeof customMutator>;
}): UseMutationOptions<
Awaited<ReturnType<typeof postV1StopGraphExecutions>>,
TError,
{ params: PostV1StopGraphExecutionsParams },
TContext
> => {
const mutationKey = ["postV1StopGraphExecutions"];
const { mutation: mutationOptions, request: requestOptions } = options
? options.mutation &&
"mutationKey" in options.mutation &&
options.mutation.mutationKey
? options
: { ...options, mutation: { ...options.mutation, mutationKey } }
: { mutation: { mutationKey }, request: undefined };
const mutationFn: MutationFunction<
Awaited<ReturnType<typeof postV1StopGraphExecutions>>,
{ params: PostV1StopGraphExecutionsParams }
> = (props) => {
const { params } = props ?? {};
return postV1StopGraphExecutions(params, requestOptions);
};
return { mutationFn, ...mutationOptions };
};
export type PostV1StopGraphExecutionsMutationResult = NonNullable<
Awaited<ReturnType<typeof postV1StopGraphExecutions>>
>;
export type PostV1StopGraphExecutionsMutationError = HTTPValidationError;
/**
* @summary Stop graph executions
*/
export const usePostV1StopGraphExecutions = <
TError = HTTPValidationError,
TContext = unknown,
>(
options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof postV1StopGraphExecutions>>,
TError,
{ params: PostV1StopGraphExecutionsParams },
TContext
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseMutationResult<
Awaited<ReturnType<typeof postV1StopGraphExecutions>>,
TError,
{ params: PostV1StopGraphExecutionsParams },
TContext
> => {
const mutationOptions = getPostV1StopGraphExecutionsMutationOptions(options);
return useMutation(mutationOptions, queryClient);
};
/**
* @summary Get all executions
*/

View File

@@ -37,14 +37,10 @@ import type { HTTPValidationError } from "../../models/hTTPValidationError";
import type { LibraryAgent } from "../../models/libraryAgent";
import type { LibraryAgentPreset } from "../../models/libraryAgentPreset";
import type { LibraryAgentResponse } from "../../models/libraryAgentResponse";
import type { LibraryAgentUpdateRequest } from "../../models/libraryAgentUpdateRequest";
import type { TriggeredPresetSetupParams } from "../../models/triggeredPresetSetupParams";
import { customMutator } from "../../../mutators/custom-mutator";
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
@@ -1588,117 +1584,3 @@ export const usePostV2ForkLibraryAgent = <
return useMutation(mutationOptions, queryClient);
};
/**
* Sets up a webhook-triggered `LibraryAgentPreset` for a `LibraryAgent`.
Returns the correspondingly created `LibraryAgentPreset` with `webhook_id` set.
* @summary Setup Trigger
*/
export type postV2SetupTriggerResponse200 = {
data: LibraryAgentPreset;
status: 200;
};
export type postV2SetupTriggerResponse422 = {
data: HTTPValidationError;
status: 422;
};
export type postV2SetupTriggerResponseComposite =
| postV2SetupTriggerResponse200
| postV2SetupTriggerResponse422;
export type postV2SetupTriggerResponse = postV2SetupTriggerResponseComposite & {
headers: Headers;
};
export const getPostV2SetupTriggerUrl = (libraryAgentId: string) => {
return `/api/library/agents/${libraryAgentId}/setup-trigger`;
};
export const postV2SetupTrigger = async (
libraryAgentId: string,
triggeredPresetSetupParams: TriggeredPresetSetupParams,
options?: RequestInit,
): Promise<postV2SetupTriggerResponse> => {
return customMutator<postV2SetupTriggerResponse>(
getPostV2SetupTriggerUrl(libraryAgentId),
{
...options,
method: "POST",
headers: { "Content-Type": "application/json", ...options?.headers },
body: JSON.stringify(triggeredPresetSetupParams),
},
);
};
export const getPostV2SetupTriggerMutationOptions = <
TError = HTTPValidationError,
TContext = unknown,
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof postV2SetupTrigger>>,
TError,
{ libraryAgentId: string; data: TriggeredPresetSetupParams },
TContext
>;
request?: SecondParameter<typeof customMutator>;
}): UseMutationOptions<
Awaited<ReturnType<typeof postV2SetupTrigger>>,
TError,
{ libraryAgentId: string; data: TriggeredPresetSetupParams },
TContext
> => {
const mutationKey = ["postV2SetupTrigger"];
const { mutation: mutationOptions, request: requestOptions } = options
? options.mutation &&
"mutationKey" in options.mutation &&
options.mutation.mutationKey
? options
: { ...options, mutation: { ...options.mutation, mutationKey } }
: { mutation: { mutationKey }, request: undefined };
const mutationFn: MutationFunction<
Awaited<ReturnType<typeof postV2SetupTrigger>>,
{ libraryAgentId: string; data: TriggeredPresetSetupParams }
> = (props) => {
const { libraryAgentId, data } = props ?? {};
return postV2SetupTrigger(libraryAgentId, data, requestOptions);
};
return { mutationFn, ...mutationOptions };
};
export type PostV2SetupTriggerMutationResult = NonNullable<
Awaited<ReturnType<typeof postV2SetupTrigger>>
>;
export type PostV2SetupTriggerMutationBody = TriggeredPresetSetupParams;
export type PostV2SetupTriggerMutationError = HTTPValidationError;
/**
* @summary Setup Trigger
*/
export const usePostV2SetupTrigger = <
TError = HTTPValidationError,
TContext = unknown,
>(
options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof postV2SetupTrigger>>,
TError,
{ libraryAgentId: string; data: TriggeredPresetSetupParams },
TContext
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseMutationResult<
Awaited<ReturnType<typeof postV2SetupTrigger>>,
TError,
{ libraryAgentId: string; data: TriggeredPresetSetupParams },
TContext
> => {
const mutationOptions = getPostV2SetupTriggerMutationOptions(options);
return useMutation(mutationOptions, queryClient);
};

View File

@@ -37,6 +37,8 @@ import type { PostV2CreateANewPresetBody } from "../../models/postV2CreateANewPr
import type { PostV2ExecuteAPreset200 } from "../../models/postV2ExecuteAPreset200";
import type { TriggeredPresetSetupRequest } from "../../models/triggeredPresetSetupRequest";
import { customMutator } from "../../../mutators/custom-mutator";
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
@@ -779,6 +781,116 @@ export const useDeleteV2DeleteAPreset = <
return useMutation(mutationOptions, queryClient);
};
/**
* Sets up a webhook-triggered `LibraryAgentPreset` for a `LibraryAgent`.
Returns the correspondingly created `LibraryAgentPreset` with `webhook_id` set.
* @summary Setup Trigger
*/
export type postV2SetupTriggerResponse200 = {
data: LibraryAgentPreset;
status: 200;
};
export type postV2SetupTriggerResponse422 = {
data: HTTPValidationError;
status: 422;
};
export type postV2SetupTriggerResponseComposite =
| postV2SetupTriggerResponse200
| postV2SetupTriggerResponse422;
export type postV2SetupTriggerResponse = postV2SetupTriggerResponseComposite & {
headers: Headers;
};
export const getPostV2SetupTriggerUrl = () => {
return `/api/library/presets/setup-trigger`;
};
export const postV2SetupTrigger = async (
triggeredPresetSetupRequest: TriggeredPresetSetupRequest,
options?: RequestInit,
): Promise<postV2SetupTriggerResponse> => {
return customMutator<postV2SetupTriggerResponse>(getPostV2SetupTriggerUrl(), {
...options,
method: "POST",
headers: { "Content-Type": "application/json", ...options?.headers },
body: JSON.stringify(triggeredPresetSetupRequest),
});
};
export const getPostV2SetupTriggerMutationOptions = <
TError = HTTPValidationError,
TContext = unknown,
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof postV2SetupTrigger>>,
TError,
{ data: TriggeredPresetSetupRequest },
TContext
>;
request?: SecondParameter<typeof customMutator>;
}): UseMutationOptions<
Awaited<ReturnType<typeof postV2SetupTrigger>>,
TError,
{ data: TriggeredPresetSetupRequest },
TContext
> => {
const mutationKey = ["postV2SetupTrigger"];
const { mutation: mutationOptions, request: requestOptions } = options
? options.mutation &&
"mutationKey" in options.mutation &&
options.mutation.mutationKey
? options
: { ...options, mutation: { ...options.mutation, mutationKey } }
: { mutation: { mutationKey }, request: undefined };
const mutationFn: MutationFunction<
Awaited<ReturnType<typeof postV2SetupTrigger>>,
{ data: TriggeredPresetSetupRequest }
> = (props) => {
const { data } = props ?? {};
return postV2SetupTrigger(data, requestOptions);
};
return { mutationFn, ...mutationOptions };
};
export type PostV2SetupTriggerMutationResult = NonNullable<
Awaited<ReturnType<typeof postV2SetupTrigger>>
>;
export type PostV2SetupTriggerMutationBody = TriggeredPresetSetupRequest;
export type PostV2SetupTriggerMutationError = HTTPValidationError;
/**
* @summary Setup Trigger
*/
export const usePostV2SetupTrigger = <
TError = HTTPValidationError,
TContext = unknown,
>(
options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof postV2SetupTrigger>>,
TError,
{ data: TriggeredPresetSetupRequest },
TContext
>;
request?: SecondParameter<typeof customMutator>;
},
queryClient?: QueryClient,
): UseMutationResult<
Awaited<ReturnType<typeof postV2SetupTrigger>>,
TError,
{ data: TriggeredPresetSetupRequest },
TContext
> => {
const mutationOptions = getPostV2SetupTriggerMutationOptions(options);
return useMutation(mutationOptions, queryClient);
};
/**
* Execute a preset with the given graph and node input for the current user.
* @summary Execute a preset

View File

@@ -24,4 +24,5 @@ export interface BaseGraphOutput {
forked_from_version?: BaseGraphOutputForkedFromVersion;
readonly input_schema: BaseGraphOutputInputSchema;
readonly output_schema: BaseGraphOutputOutputSchema;
readonly has_external_trigger: boolean;
}

View File

@@ -6,12 +6,12 @@
* OpenAPI spec version: 0.1
*/
import type { CredentialsMetaInputTitle } from "./credentialsMetaInputTitle";
import type { ProviderName } from "./providerName";
import type { CredentialsMetaInputType } from "./credentialsMetaInputType";
export interface CredentialsMetaInput {
id: string;
title?: CredentialsMetaInputTitle;
provider: ProviderName;
/** Provider name for integrations. Can be any string value, including custom provider names. */
provider: string;
type: CredentialsMetaInputType;
}

View File

@@ -0,0 +1,29 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
import type { GraphMetaForkedFromId } from "./graphMetaForkedFromId";
import type { GraphMetaForkedFromVersion } from "./graphMetaForkedFromVersion";
import type { BaseGraphOutput } from "./baseGraphOutput";
import type { GraphMetaInputSchema } from "./graphMetaInputSchema";
import type { GraphMetaOutputSchema } from "./graphMetaOutputSchema";
import type { GraphMetaCredentialsInputSchema } from "./graphMetaCredentialsInputSchema";
export interface GraphMeta {
id?: string;
version?: number;
is_active?: boolean;
name: string;
description: string;
forked_from_id?: GraphMetaForkedFromId;
forked_from_version?: GraphMetaForkedFromVersion;
sub_graphs?: BaseGraphOutput[];
user_id: string;
readonly input_schema: GraphMetaInputSchema;
readonly output_schema: GraphMetaOutputSchema;
readonly has_external_trigger: boolean;
readonly credentials_input_schema: GraphMetaCredentialsInputSchema;
}

View File

@@ -0,0 +1,9 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export type GraphMetaCredentialsInputSchema = { [key: string]: unknown };

View File

@@ -0,0 +1,9 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export type GraphMetaForkedFromId = string | null;

View File

@@ -0,0 +1,9 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export type GraphMetaForkedFromVersion = number | null;

View File

@@ -0,0 +1,9 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export type GraphMetaInputSchema = { [key: string]: unknown };

View File

@@ -0,0 +1,9 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
export type GraphMetaOutputSchema = { [key: string]: unknown };

View File

@@ -28,6 +28,6 @@ export interface GraphModel {
user_id: string;
readonly input_schema: GraphModelInputSchema;
readonly output_schema: GraphModelOutputSchema;
readonly has_external_trigger: boolean;
readonly credentials_input_schema: GraphModelCredentialsInputSchema;
readonly has_webhook_trigger: boolean;
}

View File

@@ -5,12 +5,12 @@
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
import type { ProviderName } from "./providerName";
import type { LibraryAgentTriggerInfoConfigSchema } from "./libraryAgentTriggerInfoConfigSchema";
import type { LibraryAgentTriggerInfoCredentialsInputName } from "./libraryAgentTriggerInfoCredentialsInputName";
export interface LibraryAgentTriggerInfo {
provider: ProviderName;
/** Provider name for integrations. Can be any string value, including custom provider names. */
provider: string;
/** Input schema for the trigger block */
config_schema: LibraryAgentTriggerInfoConfigSchema;
credentials_input_name: LibraryAgentTriggerInfoCredentialsInputName;

View File

@@ -0,0 +1,18 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
import type { TriggeredPresetSetupRequestTriggerConfig } from "./triggeredPresetSetupRequestTriggerConfig";
import type { TriggeredPresetSetupRequestAgentCredentials } from "./triggeredPresetSetupRequestAgentCredentials";
export interface TriggeredPresetSetupRequest {
name: string;
description?: string;
graph_id: string;
graph_version: number;
trigger_config: TriggeredPresetSetupRequestTriggerConfig;
agent_credentials?: TriggeredPresetSetupRequestAgentCredentials;
}

View File

@@ -0,0 +1,12 @@
/**
* Generated by orval v7.10.0 🍺
* Do not edit manually.
* AutoGPT Agent Server
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
import type { CredentialsMetaInput } from "./credentialsMetaInput";
export type TriggeredPresetSetupRequestAgentCredentials = {
[key: string]: CredentialsMetaInput;
};

View File

@@ -5,13 +5,13 @@
* This server is used to execute agents that are created by the AutoGPT system.
* OpenAPI spec version: 0.1
*/
import type { ProviderName } from "./providerName";
import type { WebhookConfig } from "./webhookConfig";
export interface Webhook {
id?: string;
user_id: string;
provider: ProviderName;
/** Provider name for integrations. Can be any string value, including custom provider names. */
provider: string;
credentials_id: string;
webhook_type: string;
resource: string;

View File

@@ -18,8 +18,9 @@
"in": "path",
"required": true,
"schema": {
"$ref": "#/components/schemas/ProviderName",
"title": "The provider to initiate an OAuth flow for"
"type": "string",
"title": "The provider to initiate an OAuth flow for",
"description": "Provider name for integrations. Can be any string value, including custom provider names."
}
},
{
@@ -64,8 +65,9 @@
"in": "path",
"required": true,
"schema": {
"$ref": "#/components/schemas/ProviderName",
"title": "The target provider for this OAuth exchange"
"type": "string",
"title": "The target provider for this OAuth exchange",
"description": "Provider name for integrations. Can be any string value, including custom provider names."
}
}
],
@@ -133,8 +135,9 @@
"in": "path",
"required": true,
"schema": {
"$ref": "#/components/schemas/ProviderName",
"title": "The provider to list credentials for"
"type": "string",
"title": "The provider to list credentials for",
"description": "Provider name for integrations. Can be any string value, including custom provider names."
}
}
],
@@ -173,8 +176,9 @@
"in": "path",
"required": true,
"schema": {
"$ref": "#/components/schemas/ProviderName",
"title": "The provider to create credentials for"
"type": "string",
"title": "The provider to create credentials for",
"description": "Provider name for integrations. Can be any string value, including custom provider names."
}
}
],
@@ -253,8 +257,9 @@
"in": "path",
"required": true,
"schema": {
"$ref": "#/components/schemas/ProviderName",
"title": "The provider to retrieve credentials for"
"type": "string",
"title": "The provider to retrieve credentials for",
"description": "Provider name for integrations. Can be any string value, including custom provider names."
}
},
{
@@ -315,8 +320,9 @@
"in": "path",
"required": true,
"schema": {
"$ref": "#/components/schemas/ProviderName",
"title": "The provider to delete credentials for"
"type": "string",
"title": "The provider to delete credentials for",
"description": "Provider name for integrations. Can be any string value, including custom provider names."
}
},
{
@@ -380,8 +386,9 @@
"in": "path",
"required": true,
"schema": {
"$ref": "#/components/schemas/ProviderName",
"title": "Provider where the webhook was registered"
"type": "string",
"title": "Provider where the webhook was registered",
"description": "Provider name for integrations. Can be any string value, including custom provider names."
}
},
{
@@ -436,6 +443,86 @@
}
}
},
"/api/integrations/providers": {
"get": {
"tags": ["v1", "integrations"],
"summary": "List Providers",
"description": "Get a list of all available provider names.\n\nReturns both statically defined providers (from ProviderName enum)\nand dynamically registered providers (from SDK decorators).\n\nNote: The complete list of provider names is also available as a constant\nin the generated TypeScript client via PROVIDER_NAMES.",
"operationId": "getV1ListProviders",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"items": { "type": "string" },
"type": "array",
"title": "Response Getv1Listproviders"
}
}
}
}
}
}
},
"/api/integrations/providers/names": {
"get": {
"tags": ["v1", "integrations"],
"summary": "Get Provider Names",
"description": "Get all provider names in a structured format.\n\nThis endpoint is specifically designed to expose the provider names\nin the OpenAPI schema so that code generators like Orval can create\nappropriate TypeScript constants.",
"operationId": "getV1GetProviderNames",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProviderNamesResponse"
}
}
}
}
}
}
},
"/api/integrations/providers/constants": {
"get": {
"tags": ["v1", "integrations"],
"summary": "Get Provider Constants",
"description": "Get provider names as constants.\n\nThis endpoint returns a model with provider names as constants,\nspecifically designed for OpenAPI code generation tools to create\nTypeScript constants.",
"operationId": "getV1GetProviderConstants",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/ProviderConstants" }
}
}
}
}
}
},
"/api/integrations/providers/enum-example": {
"get": {
"tags": ["v1", "integrations"],
"summary": "Get Provider Enum Example",
"description": "Example endpoint that uses the CompleteProviderNames enum.\n\nThis endpoint exists to ensure that the CompleteProviderNames enum is included\nin the OpenAPI schema, which will cause Orval to generate it as a\nTypeScript enum/constant.",
"operationId": "getV1GetProviderEnumExample",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProviderEnumResponse"
}
}
}
}
}
}
},
"/api/analytics/log_raw_metric": {
"post": {
"tags": ["v1", "analytics"],
@@ -1018,7 +1105,7 @@
"content": {
"application/json": {
"schema": {
"items": { "$ref": "#/components/schemas/GraphModel" },
"items": { "$ref": "#/components/schemas/GraphMeta" },
"type": "array",
"title": "Response Getv1List User Graphs"
}
@@ -1415,49 +1502,6 @@
}
},
"/api/executions": {
"post": {
"tags": ["v1", "graphs"],
"summary": "Stop graph executions",
"operationId": "postV1Stop graph executions",
"parameters": [
{
"name": "graph_id",
"in": "query",
"required": true,
"schema": { "type": "string", "title": "Graph Id" }
},
{
"name": "graph_exec_id",
"in": "query",
"required": true,
"schema": { "type": "string", "title": "Graph Exec Id" }
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/GraphExecutionMeta"
},
"title": "Response Postv1Stop Graph Executions"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/HTTPValidationError" }
}
}
}
}
},
"get": {
"tags": ["v1", "graphs"],
"summary": "Get all executions",
@@ -1468,10 +1512,10 @@
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/GraphExecutionMeta"
},
"type": "array",
"title": "Response Getv1Get All Executions"
}
}
@@ -3014,6 +3058,42 @@
}
}
},
"/api/library/presets/setup-trigger": {
"post": {
"tags": ["v2", "presets"],
"summary": "Setup Trigger",
"description": "Sets up a webhook-triggered `LibraryAgentPreset` for a `LibraryAgent`.\nReturns the correspondingly created `LibraryAgentPreset` with `webhook_id` set.",
"operationId": "postV2SetupTrigger",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TriggeredPresetSetupRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/LibraryAgentPreset" }
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/HTTPValidationError" }
}
}
}
}
}
},
"/api/library/presets/{preset_id}/execute": {
"post": {
"tags": ["v2", "presets", "presets"],
@@ -3401,55 +3481,6 @@
}
}
},
"/api/library/agents/{library_agent_id}/setup-trigger": {
"post": {
"tags": ["v2", "library", "private"],
"summary": "Setup Trigger",
"description": "Sets up a webhook-triggered `LibraryAgentPreset` for a `LibraryAgent`.\nReturns the correspondingly created `LibraryAgentPreset` with `webhook_id` set.",
"operationId": "postV2SetupTrigger",
"parameters": [
{
"name": "library_agent_id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"description": "ID of the library agent",
"title": "Library Agent Id"
},
"description": "ID of the library agent"
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TriggeredPresetSetupParams"
}
}
}
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/LibraryAgentPreset" }
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/HTTPValidationError" }
}
}
}
}
}
},
"/api/otto/ask": {
"post": {
"tags": ["v2", "otto"],
@@ -3837,10 +3868,21 @@
"type": "object",
"title": "Output Schema",
"readOnly": true
},
"has_external_trigger": {
"type": "boolean",
"title": "Has External Trigger",
"readOnly": true
}
},
"type": "object",
"required": ["name", "description", "input_schema", "output_schema"],
"required": [
"name",
"description",
"input_schema",
"output_schema",
"has_external_trigger"
],
"title": "BaseGraph"
},
"Body_postV1Callback": {
@@ -4101,7 +4143,11 @@
"anyOf": [{ "type": "string" }, { "type": "null" }],
"title": "Title"
},
"provider": { "$ref": "#/components/schemas/ProviderName" },
"provider": {
"type": "string",
"title": "Provider",
"description": "Provider name for integrations. Can be any string value, including custom provider names."
},
"type": {
"type": "string",
"enum": ["api_key", "oauth2", "user_password", "host_scoped"],
@@ -4405,6 +4451,68 @@
],
"title": "GraphExecutionWithNodes"
},
"GraphMeta": {
"properties": {
"id": { "type": "string", "title": "Id" },
"version": { "type": "integer", "title": "Version", "default": 1 },
"is_active": {
"type": "boolean",
"title": "Is Active",
"default": true
},
"name": { "type": "string", "title": "Name" },
"description": { "type": "string", "title": "Description" },
"forked_from_id": {
"anyOf": [{ "type": "string" }, { "type": "null" }],
"title": "Forked From Id"
},
"forked_from_version": {
"anyOf": [{ "type": "integer" }, { "type": "null" }],
"title": "Forked From Version"
},
"sub_graphs": {
"items": { "$ref": "#/components/schemas/BaseGraph-Output" },
"type": "array",
"title": "Sub Graphs",
"default": []
},
"user_id": { "type": "string", "title": "User Id" },
"input_schema": {
"additionalProperties": true,
"type": "object",
"title": "Input Schema",
"readOnly": true
},
"output_schema": {
"additionalProperties": true,
"type": "object",
"title": "Output Schema",
"readOnly": true
},
"has_external_trigger": {
"type": "boolean",
"title": "Has External Trigger",
"readOnly": true
},
"credentials_input_schema": {
"additionalProperties": true,
"type": "object",
"title": "Credentials Input Schema",
"readOnly": true
}
},
"type": "object",
"required": [
"name",
"description",
"user_id",
"input_schema",
"output_schema",
"has_external_trigger",
"credentials_input_schema"
],
"title": "GraphMeta"
},
"GraphModel": {
"properties": {
"id": { "type": "string", "title": "Id" },
@@ -4455,16 +4563,16 @@
"title": "Output Schema",
"readOnly": true
},
"has_external_trigger": {
"type": "boolean",
"title": "Has External Trigger",
"readOnly": true
},
"credentials_input_schema": {
"additionalProperties": true,
"type": "object",
"title": "Credentials Input Schema",
"readOnly": true
},
"has_webhook_trigger": {
"type": "boolean",
"title": "Has Webhook Trigger",
"readOnly": true
}
},
"type": "object",
@@ -4474,8 +4582,8 @@
"user_id",
"input_schema",
"output_schema",
"credentials_input_schema",
"has_webhook_trigger"
"has_external_trigger",
"credentials_input_schema"
],
"title": "GraphModel"
},
@@ -4820,7 +4928,11 @@
},
"LibraryAgentTriggerInfo": {
"properties": {
"provider": { "$ref": "#/components/schemas/ProviderName" },
"provider": {
"type": "string",
"title": "Provider",
"description": "Provider name for integrations. Can be any string value, including custom provider names."
},
"config_schema": {
"additionalProperties": true,
"type": "object",
@@ -5623,51 +5735,44 @@
"required": ["name", "username", "description", "links"],
"title": "ProfileDetails"
},
"ProviderName": {
"type": "string",
"enum": [
"aiml_api",
"anthropic",
"apollo",
"compass",
"discord",
"d_id",
"e2b",
"exa",
"fal",
"generic_webhook",
"github",
"google",
"google_maps",
"groq",
"http",
"hubspot",
"ideogram",
"jina",
"linear",
"llama_api",
"medium",
"mem0",
"notion",
"nvidia",
"ollama",
"openai",
"openweathermap",
"open_router",
"pinecone",
"reddit",
"replicate",
"revid",
"screenshotone",
"slant3d",
"smartlead",
"smtp",
"twitter",
"todoist",
"unreal_speech",
"zerobounce"
],
"title": "ProviderName"
"ProviderConstants": {
"properties": {
"PROVIDER_NAMES": {
"additionalProperties": { "type": "string" },
"type": "object",
"title": "Provider Names",
"description": "All available provider names as a constant mapping"
}
},
"type": "object",
"title": "ProviderConstants",
"description": "Model that exposes all provider names as a constant in the OpenAPI schema.\nThis is designed to be converted by Orval into a TypeScript constant."
},
"ProviderEnumResponse": {
"properties": {
"provider": {
"type": "string",
"title": "Provider",
"description": "A provider name from the complete list of providers"
}
},
"type": "object",
"required": ["provider"],
"title": "ProviderEnumResponse",
"description": "Response containing a provider from the enum."
},
"ProviderNamesResponse": {
"properties": {
"providers": {
"items": { "type": "string" },
"type": "array",
"title": "Providers",
"description": "List of all available provider names"
}
},
"type": "object",
"title": "ProviderNamesResponse",
"description": "Response containing list of all provider names."
},
"RefundRequest": {
"properties": {
@@ -6153,7 +6258,7 @@
"required": ["transactions", "next_transaction_time"],
"title": "TransactionHistory"
},
"TriggeredPresetSetupParams": {
"TriggeredPresetSetupRequest": {
"properties": {
"name": { "type": "string", "title": "Name" },
"description": {
@@ -6161,6 +6266,8 @@
"title": "Description",
"default": ""
},
"graph_id": { "type": "string", "title": "Graph Id" },
"graph_version": { "type": "integer", "title": "Graph Version" },
"trigger_config": {
"additionalProperties": true,
"type": "object",
@@ -6175,8 +6282,8 @@
}
},
"type": "object",
"required": ["name", "trigger_config"],
"title": "TriggeredPresetSetupParams"
"required": ["name", "graph_id", "graph_version", "trigger_config"],
"title": "TriggeredPresetSetupRequest"
},
"TurnstileVerifyRequest": {
"properties": {
@@ -6441,7 +6548,11 @@
"properties": {
"id": { "type": "string", "title": "Id" },
"user_id": { "type": "string", "title": "User Id" },
"provider": { "$ref": "#/components/schemas/ProviderName" },
"provider": {
"type": "string",
"title": "Provider",
"description": "Provider name for integrations. Can be any string value, including custom provider names."
},
"credentials_id": { "type": "string", "title": "Credentials Id" },
"webhook_type": { "type": "string", "title": "Webhook Type" },
"resource": { "type": "string", "title": "Resource" },